Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A swarm intelligence prediction engine. Upload documents describing any scenario, and MiroFish simulates thousands of AI agents reacting on social media to predict how events will unfold.

**Live:** [synth.scty.org](https://synth.scty.org)
**Discord:** [discord.gg/ePf5aPaHnA](https://discord.gg/ePf5aPaHnA)

> Fork of [666ghj/MiroFish](https://github.com/666ghj/MiroFish) — fully translated to English, local graph storage with embedded KuzuDB by default, Claude/Codex CLI support added.

Expand Down
26 changes: 26 additions & 0 deletions backend/tests/test_llm_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[1]))

from app.utils.llm_client import LLMClient


def test_clean_content_strips_think_tags():
client = object.__new__(LLMClient)

cleaned = LLMClient._clean_content(
client,
'<think>hidden reasoning</think>\n{"status": "ok"}',
)

assert cleaned == '{"status": "ok"}'


def test_chat_json_accepts_markdown_fenced_json():
client = object.__new__(LLMClient)
client.chat = lambda **kwargs: '```json\n{"status": "ok"}\n```'

payload = LLMClient.chat_json(client, messages=[])

assert payload == {"status": "ok"}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"dev": "concurrently --kill-others -n \"backend,frontend\" -c \"green,cyan\" \"npm run backend\" \"npm run frontend\"",
"backend": "cd backend && uv run python run.py",
"frontend": "cd frontend && npm run dev",
"build": "cd frontend && npm run build"
"build": "cd frontend && npm run build",
"lint": "node scripts/lint.mjs"
},
"devDependencies": {
"concurrently": "^9.1.2"
Expand Down
38 changes: 38 additions & 0 deletions scripts/lint.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { spawnSync } from 'node:child_process';

const shouldFix = process.argv.includes('--fix');
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';

if (shouldFix) {
console.log('No auto-fixers are configured; running verification checks only.');
}

const commands = [
{
cmd: npmCommand,
args: ['run', 'build', '--prefix', 'frontend'],
},
{
cmd: 'uv',
args: ['run', 'pytest', 'tests'],
cwd: 'backend',
env: {
UV_CACHE_DIR: '/tmp/uv-cache',
},
},
];

for (const command of commands) {
const result = spawnSync(command.cmd, command.args, {
cwd: command.cwd,
Comment thread
amadad marked this conversation as resolved.
env: {
...process.env,
...command.env,
},
stdio: 'inherit',
});

if (result.status !== 0) {
process.exit(result.status ?? 1);
}
}