@synapse-research/synapse 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +113 -113
- package/dist/.next/app-path-routes-manifest.json +27 -27
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/prerender-manifest.json +6 -6
- package/dist/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/compute/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-designs/[designUuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-designs/new/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-designs/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-runs/[runUuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiment-runs/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiments/new/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/experiments/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/insights/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/related-works/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/research-questions/[questionUuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/research-questions/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/[uuid]/settings/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/new/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/research-projects/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/admin/companies/new.html +1 -1
- package/dist/.next/server/app/admin/companies/new.rsc +1 -1
- package/dist/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/admin/companies.html +1 -1
- package/dist/.next/server/app/admin/companies.rsc +1 -1
- package/dist/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/admin.html +1 -1
- package/dist/.next/server/app/admin.rsc +1 -1
- package/dist/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/admin/stats/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/compute-gpus/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/compute-nodes/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/compute-nodes/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/compute-pools/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/compute-pools/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/documents/[uuid]/images/[filename]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/documents/[uuid]/images/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-designs/[uuid]/approve/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-designs/[uuid]/close/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-designs/[uuid]/reject/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-designs/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/claim/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/dependencies/[dependsOnRunUuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/evaluate-criteria/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/registry/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiment-runs/[uuid]/sessions/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/complete/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/progress/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/request-plan/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/reset/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/review/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/experiments/[uuid]/start/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/onboarding/status/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/agent-activity/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/available/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/baselines/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/experiment-designs/[designUuid]/validate/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/experiment-designs/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/experiment-designs/summary/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/experiment-runs/dependencies/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/experiment-runs/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/experiments/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/github/branches/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/group/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/related-works/[workUuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/related-works/auto-search/complete/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/related-works/auto-search/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/related-works/deep-research/complete/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/related-works/deep-research/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/related-works/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/research-questions/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/synthesis/complete/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/synthesis/refresh/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/[uuid]/synthesis/trigger/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-projects/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-questions/[uuid]/claim/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-questions/[uuid]/move/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-questions/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-questions/[uuid]/review/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/research-questions/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/settings/integrations/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/api/ssh-config/route_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/index.html +1 -1
- package/dist/.next/server/app/index.rsc +1 -1
- package/dist/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/login/admin.html +1 -1
- package/dist/.next/server/app/login/admin.rsc +1 -1
- package/dist/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/login/callback.html +1 -1
- package/dist/.next/server/app/login/callback.rsc +1 -1
- package/dist/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/login/silent-refresh/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/login/silent-refresh.html +1 -1
- package/dist/.next/server/app/login/silent-refresh.rsc +1 -1
- package/dist/.next/server/app/login.html +1 -1
- package/dist/.next/server/app/login.rsc +1 -1
- package/dist/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/research-projects/new.html +1 -1
- package/dist/.next/server/app/research-projects/new.rsc +1 -1
- package/dist/.next/server/app/research-projects.html +1 -1
- package/dist/.next/server/app/research-projects.rsc +1 -1
- package/dist/.next/server/app/settings.html +1 -1
- package/dist/.next/server/app/settings.rsc +1 -1
- package/dist/.next/server/app-paths-manifest.json +27 -27
- package/dist/.next/server/middleware-manifest.json +1 -1
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/pages-manifest.json +1 -1
- package/package.json +4 -2
- package/dist/public/skill/SKILL.md +0 -200
- package/dist/public/skill/aris-synapse-sync/SKILL.md +0 -368
- package/dist/public/skill/package.json +0 -79
- package/dist/public/skill/references/00-common-tools.md +0 -253
- package/dist/public/skill/references/01-setup.md +0 -251
- package/dist/public/skill/references/02-pm-workflow.md +0 -584
- package/dist/public/skill/references/03-developer-workflow.md +0 -325
- package/dist/public/skill/references/04-admin-workflow.md +0 -328
- package/dist/public/skill/references/06-claude-code-agent-teams.md +0 -233
- package/dist/public/synapse-plugin/.claude-plugin/plugin.json +0 -20
- package/dist/public/synapse-plugin/.mcp.json +0 -11
- package/dist/public/synapse-plugin/bin/on-post-create-experiment.sh +0 -61
- package/dist/public/synapse-plugin/bin/on-post-submit-results.sh +0 -56
- package/dist/public/synapse-plugin/bin/on-pre-enter-plan.sh +0 -26
- package/dist/public/synapse-plugin/bin/on-pre-exit-plan.sh +0 -22
- package/dist/public/synapse-plugin/bin/on-pre-spawn-agent.sh +0 -64
- package/dist/public/synapse-plugin/bin/on-session-end.sh +0 -39
- package/dist/public/synapse-plugin/bin/on-session-start.sh +0 -284
- package/dist/public/synapse-plugin/bin/on-subagent-start.sh +0 -233
- package/dist/public/synapse-plugin/bin/on-subagent-stop.sh +0 -80
- package/dist/public/synapse-plugin/bin/on-task-completed.sh +0 -66
- package/dist/public/synapse-plugin/bin/on-teammate-idle.sh +0 -47
- package/dist/public/synapse-plugin/bin/on-user-prompt.sh +0 -57
- package/dist/public/synapse-plugin/bin/synapse-api.sh +0 -387
- package/dist/public/synapse-plugin/bin/test-syntax.sh +0 -85
- package/dist/public/synapse-plugin/hooks/hooks.json +0 -125
- package/dist/public/synapse-plugin/skills/autonomy/SKILL.md +0 -177
- package/dist/public/synapse-plugin/skills/experiments/SKILL.md +0 -135
- package/dist/public/synapse-plugin/skills/research/SKILL.md +0 -58
- package/dist/public/synapse-plugin/skills/sessions/SKILL.md +0 -176
- package/dist/public/synapse-plugin/skills/setup/SKILL.md +0 -108
- package/dist/public/synapse-plugin/skills/synapse/SKILL.md +0 -145
- package/dist/public/synapse-plugin/skills/synapse/package.json +0 -49
- package/dist/public/synapse-plugin/skills/synapse/references/00-common-tools.md +0 -144
- package/dist/public/synapse-plugin/skills/synapse/references/01-setup.md +0 -130
- package/dist/public/synapse-plugin/skills/synapse/references/02-research-workflow.md +0 -145
- package/dist/public/synapse-plugin/skills/synapse/references/03-experiment-workflow.md +0 -319
- package/dist/public/synapse-plugin/skills/synapse/references/04-autonomous-loop.md +0 -223
- package/dist/public/synapse-plugin/skills/synapse/references/05-session-sub-agent.md +0 -253
- /package/dist/.next/static/{CTg26EE4IkxbdY0E6xEiL → VlyiqgSt6DSLuCX7rlcKa}/_buildManifest.js +0 -0
- /package/dist/.next/static/{CTg26EE4IkxbdY0E6xEiL → VlyiqgSt6DSLuCX7rlcKa}/_ssgManifest.js +0 -0
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
# Autonomous Loop (Claude Code-Client)
|
|
2
|
-
|
|
3
|
-
This guide covers the **CC-client autonomous loop**: the main Claude Code agent drives research on a project without waiting for per-step human instruction. It proposes experiments, dispatches sub-agents to execute them, monitors progress, synthesizes results, and iterates.
|
|
4
|
-
|
|
5
|
-
The CC-client loop runs entirely inside the current Claude Code session. It does not depend on the server-side `ResearchProject.autonomousLoopEnabled` flag — that flag is for realtime-transport agents. A user opens Claude Code, says "enable autonomous loop on project X", and the main agent takes over.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Architecture
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
Main CC agent (orchestrator)
|
|
13
|
-
├── synapse_get_project_full_context (each iteration)
|
|
14
|
-
├── synapse_get_assigned_experiments (each iteration)
|
|
15
|
-
├── synapse_list_compute_nodes (before proposing)
|
|
16
|
-
├── Task() → sub-agent → executes experiment
|
|
17
|
-
├── Task() → sub-agent → executes experiment (parallel)
|
|
18
|
-
├── synapse_save_project_synthesis (when new results exist)
|
|
19
|
-
├── synapse_propose_experiment (when queue empty)
|
|
20
|
-
└── synapse_add_comment (audit trail)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
- The main agent **never** runs training itself. It monitors and proposes.
|
|
24
|
-
- Sub-agents spawned via the Task tool are auto-enrolled by the `SubagentStart` hook: session created, UUID injected, execution workflow attached.
|
|
25
|
-
- State persists in Synapse (experiments, results, synthesis document). No extra local state is required.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Modes
|
|
30
|
-
|
|
31
|
-
### Full Auto (default)
|
|
32
|
-
|
|
33
|
-
- Proposals created as `pending_start` and immediately dispatched to sub-agents.
|
|
34
|
-
- No human approval between iterations.
|
|
35
|
-
- User can stop at any time by interrupting the session or saying "stop autonomous loop".
|
|
36
|
-
|
|
37
|
-
### Review
|
|
38
|
-
|
|
39
|
-
- Proposals created as `pending_review`.
|
|
40
|
-
- The main agent pauses until a human approves, then returns to the loop.
|
|
41
|
-
- Use when the user wants a sanity check on each proposed experiment.
|
|
42
|
-
|
|
43
|
-
Choose the mode at loop start. Default is full auto unless the user explicitly asks for review.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Before Starting
|
|
48
|
-
|
|
49
|
-
1. `synapse_checkin()` — refresh identity, roles, assignments.
|
|
50
|
-
2. `synapse_get_research_project({ researchProjectUuid })` — confirm the target project and check its `autonomousLoopEnabled` flag.
|
|
51
|
-
3. If `autonomousLoopEnabled = true` and a realtime loop agent is already assigned, warn the user: running the CC-client loop against the same project will double-dispatch proposals. Ask the user to either disable the server-side loop or run the CC loop on a different project.
|
|
52
|
-
4. `synapse_get_project_full_context({ researchProjectUuid })` — load the brief, evaluation methods, past experiments, and latest synthesis.
|
|
53
|
-
5. If the project has no completed experiments, do not enter the loop cold. Offer the foundational path first (see **[03-experiment-workflow.md](03-experiment-workflow.md)** — Foundational First Experiment). Once the baseline exists, the loop has something to build on.
|
|
54
|
-
6. Collect budgets from the user: `maxIterations`, `maxExperimentsProposed`, optional `maxComputeHours`.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Iteration Procedure
|
|
59
|
-
|
|
60
|
-
Each iteration runs the same five steps:
|
|
61
|
-
|
|
62
|
-
### Step 1: Refresh state
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
synapse_get_project_full_context({ researchProjectUuid: "..." })
|
|
66
|
-
synapse_get_assigned_experiments({
|
|
67
|
-
researchProjectUuid: "...",
|
|
68
|
-
statuses: ["pending_start", "in_progress"]
|
|
69
|
-
})
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Step 2: Decide what this iteration does
|
|
73
|
-
|
|
74
|
-
Priority order:
|
|
75
|
-
|
|
76
|
-
- **Monitor** — if any experiment is `in_progress`, do not propose. Poll `synapse_get_experiment` for each, write a short progress note, and yield.
|
|
77
|
-
- **Dispatch** — if any experiment is `pending_start` and mode is `full_auto`, spawn a Task sub-agent per experiment (see Step 3). Do not wait for them to finish — sub-agents run in parallel.
|
|
78
|
-
- **Synthesize** — if the queue is empty and new completed experiments exist, read the current `project_synthesis` document with `synapse_get_documents({ type: "project_synthesis" })` + `synapse_get_document`. Update it with `synapse_save_project_synthesis` only if the new evidence is not already covered.
|
|
79
|
-
- **Propose** — if the queue is empty and synthesis is current, call `synapse_propose_experiment`. One independent run per proposal — split comparisons, ablations, and parameter sweeps into separate proposals.
|
|
80
|
-
|
|
81
|
-
### Step 3: Dispatch sub-agents for `pending_start` experiments
|
|
82
|
-
|
|
83
|
-
```text
|
|
84
|
-
Task({
|
|
85
|
-
subagent_type: "general-purpose",
|
|
86
|
-
name: "exp-<short-id>",
|
|
87
|
-
prompt: "Your Synapse experiment UUID: <experiment-uuid>. Execute the experiment end to end following the experiments skill."
|
|
88
|
-
})
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
The `SubagentStart` hook automatically creates/reuses a Synapse session, injects the session UUID, and includes the execution workflow. The main agent does not call `synapse_create_session`.
|
|
92
|
-
|
|
93
|
-
Dispatch all `pending_start` experiments concurrently if compute allows. Let the sub-agents do the work — the main agent only tracks them via `synapse_get_assigned_experiments` and `synapse_get_experiment` on subsequent iterations.
|
|
94
|
-
|
|
95
|
-
### Step 4: Respect compute reality
|
|
96
|
-
|
|
97
|
-
Before proposing new experiments:
|
|
98
|
-
|
|
99
|
-
```text
|
|
100
|
-
synapse_list_compute_nodes({
|
|
101
|
-
researchProjectUuid: "...",
|
|
102
|
-
onlyAvailable: true
|
|
103
|
-
})
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Do not over-propose concurrent experiments beyond what free GPUs can accommodate. If the project has a `computePoolUuid`, all proposals must fit within that pool.
|
|
107
|
-
|
|
108
|
-
### Step 5: Log and check stop conditions
|
|
109
|
-
|
|
110
|
-
Leave an audit trail for the human:
|
|
111
|
-
|
|
112
|
-
```text
|
|
113
|
-
synapse_add_comment({
|
|
114
|
-
targetType: "research_project",
|
|
115
|
-
targetUuid: "...",
|
|
116
|
-
content: "Iteration 5 — dispatched exp <uuid1>, <uuid2>; no proposal (queue saturated)."
|
|
117
|
-
})
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Then evaluate stop conditions (next section). If none trigger, continue to the next iteration.
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## Writing A Proposal
|
|
125
|
-
|
|
126
|
-
`synapse_propose_experiment` creates a new experiment card. A good proposal includes:
|
|
127
|
-
|
|
128
|
-
- **Motivation** — what prior result or gap this addresses
|
|
129
|
-
- **Hypothesis** — what you expect to learn
|
|
130
|
-
- **Method** — enough detail that a sub-agent can execute without further prompting
|
|
131
|
-
- **Success criteria** — how the result will be judged against the project's evaluation method
|
|
132
|
-
- **Compute fit** — realistic given current availability
|
|
133
|
-
|
|
134
|
-
```text
|
|
135
|
-
synapse_propose_experiment({
|
|
136
|
-
researchProjectUuid: "...",
|
|
137
|
-
title: "Ablation: remove cross-attention from layer 6",
|
|
138
|
-
description: "## Motivation\n\nExperiment <uuid> showed..."
|
|
139
|
-
})
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
In full auto mode the resulting experiment lands as `pending_start` and is auto-assigned back to the loop agent for execution on the next iteration. In review mode it lands as `pending_review`.
|
|
143
|
-
|
|
144
|
-
**One independent run per proposal.** Do not bundle comparisons, ablations, or parameter sweeps into one card — create multiple proposals instead.
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Stop Conditions
|
|
149
|
-
|
|
150
|
-
Exit the loop cleanly when any of the following hold:
|
|
151
|
-
|
|
152
|
-
- `maxIterations` reached
|
|
153
|
-
- `maxExperimentsProposed` reached
|
|
154
|
-
- `maxComputeHours` consumed across loop-dispatched experiments
|
|
155
|
-
- synthesis unchanged across K consecutive iterations (no-progress signal)
|
|
156
|
-
- all research questions are `completed` and no promising direction remains
|
|
157
|
-
- compute pool exhausted and no experiment is making forward progress
|
|
158
|
-
- user interrupts or says "stop"
|
|
159
|
-
|
|
160
|
-
On exit, summarize for the user:
|
|
161
|
-
|
|
162
|
-
- experiments dispatched and their outcomes
|
|
163
|
-
- whether the synthesis changed materially
|
|
164
|
-
- open questions and recommended next steps the human should consider
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Mutual Exclusion With The Server-Side Loop
|
|
169
|
-
|
|
170
|
-
The server-side autonomous loop (`autonomousLoopEnabled`) is designed for realtime-transport agents and dispatches proposals through a different path than the CC-client loop. Running both against the same project will cause double-dispatch.
|
|
171
|
-
|
|
172
|
-
Before entering the CC-client loop:
|
|
173
|
-
|
|
174
|
-
- If `autonomousLoopEnabled = true` → warn the user, do not start.
|
|
175
|
-
- If the user insists, ask them to disable the server-side loop first, or use a different project.
|
|
176
|
-
|
|
177
|
-
Do not try to take over the server-side flag from inside Claude Code.
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
## Compact End-to-End Example
|
|
182
|
-
|
|
183
|
-
```text
|
|
184
|
-
# Turn 1 — enter loop
|
|
185
|
-
synapse_checkin()
|
|
186
|
-
synapse_get_research_project({ researchProjectUuid }) # check flag
|
|
187
|
-
synapse_get_project_full_context({ researchProjectUuid })
|
|
188
|
-
|
|
189
|
-
# Iteration 1
|
|
190
|
-
synapse_get_assigned_experiments({ researchProjectUuid, statuses: ["pending_start", "in_progress"] })
|
|
191
|
-
# queue empty, no new results
|
|
192
|
-
synapse_list_compute_nodes({ researchProjectUuid, onlyAvailable: true })
|
|
193
|
-
synapse_propose_experiment({ researchProjectUuid, title, description })
|
|
194
|
-
synapse_add_comment({ targetType: "research_project", targetUuid, content: "Iter 1 — proposed <title>" })
|
|
195
|
-
|
|
196
|
-
# Iteration 2 (same turn or next turn)
|
|
197
|
-
synapse_get_assigned_experiments(...) # one pending_start now
|
|
198
|
-
Task({ name: "exp-ablation-1", prompt: "Your Synapse experiment UUID: <uuid>. Execute end to end." })
|
|
199
|
-
synapse_add_comment({ ..., content: "Iter 2 — dispatched exp <uuid>" })
|
|
200
|
-
|
|
201
|
-
# Iteration 3
|
|
202
|
-
synapse_get_assigned_experiments(...) # in_progress
|
|
203
|
-
# monitor only, no proposal
|
|
204
|
-
|
|
205
|
-
# Iteration 4
|
|
206
|
-
synapse_get_assigned_experiments(...) # completed
|
|
207
|
-
synapse_get_documents({ researchProjectUuid, type: "project_synthesis" })
|
|
208
|
-
synapse_save_project_synthesis({ researchProjectUuid, title, content })
|
|
209
|
-
# queue empty again → next propose
|
|
210
|
-
|
|
211
|
-
# ...until a stop condition fires
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Tips
|
|
217
|
-
|
|
218
|
-
- Do not re-propose an experiment that has already completed. Always check `synapse_get_project_full_context` for prior work first.
|
|
219
|
-
- Build on failures — an `outcome: "failure"` experiment is signal, not noise.
|
|
220
|
-
- Stay aligned with the project's research questions and evaluation method.
|
|
221
|
-
- Proposals should be specific enough that a sub-agent can execute them unattended.
|
|
222
|
-
- Use the compute availability summary to keep proposals realistic.
|
|
223
|
-
- Leave a comment on the project each iteration — it is the user's only visible log when the loop runs for hours.
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
# Plugin Hooks, Sessions, And Multi-Agent Parallel Execution
|
|
2
|
-
|
|
3
|
-
This reference documents how the Synapse Claude Code plugin actually works: which hooks fire, what they do, where their state lives, and how to run multiple experiments in parallel using Task sub-agents.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Plugin Layout
|
|
8
|
-
|
|
9
|
-
The plugin ships under `public/synapse-plugin/` in the repo and is installed into Claude Code's plugin directory. Three things matter for day-to-day use:
|
|
10
|
-
|
|
11
|
-
| Path | Purpose |
|
|
12
|
-
|---|---|
|
|
13
|
-
| `.claude-plugin/plugin.json` | Plugin manifest (name, version). |
|
|
14
|
-
| `.mcp.json` | MCP server config. Streamable HTTP transport to `${SYNAPSE_URL}/api/mcp` with `Authorization: Bearer ${SYNAPSE_API_KEY}`. |
|
|
15
|
-
| `hooks/hooks.json` | Wires Claude Code events (`SessionStart`, `UserPromptSubmit`, `PreToolUse`, `SubagentStart`, `TeammateIdle`, `SubagentStop`, `TaskCompleted`, `SessionEnd`) to the hook scripts under `bin/`. |
|
|
16
|
-
| `bin/on-*.sh` + `bin/synapse-api.sh` | The hook scripts themselves. `synapse-api.sh` is the shared helper: flock-guarded state read/write and MCP JSON-RPC over streamable HTTP. |
|
|
17
|
-
|
|
18
|
-
Local state per project lives under `.synapse/` in the working directory.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Hook Catalogue
|
|
23
|
-
|
|
24
|
-
| Hook script | Claude Code event | What it does | State touched | MCP calls |
|
|
25
|
-
|---|---|---|---|---|
|
|
26
|
-
| `on-session-start.sh` | `SessionStart` (`startup` \| `resume` \| `compact`) | Calls `synapse_checkin`, caches owner / roles / project UUID into `state.json`, scans for pre-assigned sub-agent session files, and builds the rich `additionalContext` block that orients the agent on assignments, projects, and workflow. On `resume`, injects the existing main session UUID instead of creating a new one. | `state.json`, reads `sessions/*.json` | `synapse_checkin`, optional `synapse_session_heartbeat` |
|
|
27
|
-
| `on-user-prompt.sh` | `UserPromptSubmit` | Fast local-only check on every user turn. Scans `.synapse/sessions/` and injects a brief reminder that sub-agent sessions are auto-managed and that experiment UUIDs should be passed in prompts. No network, stays under 100 ms. | reads `sessions/` | none |
|
|
28
|
-
| `on-pre-enter-plan.sh` | `PreToolUse` (`EnterPlanMode`) | Injects planning-mode guidance: prefer the current Experiment pipeline (`draft → pending_review → pending_start → in_progress → completed`), plan one independent run per experiment card, do not plan to create sessions manually. | none | none |
|
|
29
|
-
| `on-pre-exit-plan.sh` | `PreToolUse` (`ExitPlanMode`) | Reminds the agent to verify the plan is expressed as Experiment records before executing. | none | none |
|
|
30
|
-
| `on-pre-spawn-agent.sh` | `PreToolUse` (`Task`) | Atomically writes `.synapse/pending/{name}` with the agent name and type so the `SubagentStart` hook can claim it. Skips read-only sub-agent types (Explore, Plan, etc.). Per-spawn file avoids shared-state contention. | writes `pending/{name}` | none |
|
|
31
|
-
| `on-subagent-start.sh` | `SubagentStart` | Atomically claims the pending file via `mv`. Reuses an active session, reopens a closed one, or creates a new one via `synapse_list_sessions` / `synapse_reopen_session` / `synapse_create_session` (named by the sub-agent name). Writes `sessions/{name}.json`, stores `session_{id}` / `agent_for_session_{uuid}` / `name_for_agent_{id}` mappings in `state.json`, and injects the session UUID plus execution workflow directly into the sub-agent's context. | `state.json`, `sessions/{name}.json`, `claimed/{agent_id}` | `synapse_list_sessions`, `synapse_create_session`, `synapse_reopen_session`, `synapse_session_heartbeat` |
|
|
32
|
-
| `on-teammate-idle.sh` | `TeammateIdle` | Sends a heartbeat so the sub-agent's Synapse session does not auto-time-out after 1 hour. Output suppressed — this fires too often to notify the user. | reads `state.json` | `synapse_session_heartbeat` |
|
|
33
|
-
| `on-subagent-stop.sh` | `SubagentStop` | Looks up the session UUID, calls `synapse_close_session`, and cleans up `state.json` mappings, `sessions/{name}.json`, and `claimed/{agent_id}`. | deletes state entries, `sessions/{name}.json`, `claimed/{agent_id}` | `synapse_close_session` |
|
|
34
|
-
| `on-task-completed.sh` | `TaskCompleted` | Scans the completed task's description/subject for a `synapse:experiment:<uuid>` marker. If found, injects a reminder to finalize the experiment with `synapse_submit_experiment_results` (or report progress if still running). | reads task metadata only | none |
|
|
35
|
-
| `on-session-end.sh` | `SessionEnd` | Safety-checked cleanup. Removes `.synapse/` only when all sub-agent sessions are closed and `state.json` has no meaningful content left. Otherwise state is preserved so a resumed session reconnects to the same Synapse sessions. | deletes `.synapse/` if safe | none |
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Context Injection Points
|
|
40
|
-
|
|
41
|
-
The plugin injects context into the model via two channels in its hook output JSON:
|
|
42
|
-
|
|
43
|
-
- `systemMessage` — a toast shown to the user (not visible to the model in its system prompt).
|
|
44
|
-
- `hookSpecificOutput.additionalContext` — prepended to the model's system context.
|
|
45
|
-
|
|
46
|
-
Where context is injected:
|
|
47
|
-
|
|
48
|
-
- **SessionStart**: full checkin result, pending assignments, project summaries, workflow guide, session management rules, and (on resume) the main session UUID.
|
|
49
|
-
- **UserPromptSubmit**: short reminder listing active sub-agent sessions.
|
|
50
|
-
- **PreToolUse (EnterPlanMode / ExitPlanMode)**: plan-mode guidance.
|
|
51
|
-
- **PreToolUse (Task)**: reminder to pass experiment UUIDs into sub-agent prompts.
|
|
52
|
-
- **SubagentStart**: session UUID, execution workflow, owner identity (so sub-agents can `@mention` correctly).
|
|
53
|
-
- **TaskCompleted**: reminder to finalize a Synapse experiment if the task was linked to one.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Local State Layout
|
|
58
|
-
|
|
59
|
-
Per-project state under `.synapse/`:
|
|
60
|
-
|
|
61
|
-
| Path | Owner | Lifecycle |
|
|
62
|
-
|---|---|---|
|
|
63
|
-
| `state.json` | all hooks | Flock-guarded key/value store. Owner info, agent roles, primary project UUID, and `session_{agent_id}` / `agent_for_session_{uuid}` / `name_for_agent_{id}` / `session_{name}` mappings. |
|
|
64
|
-
| `pending/{name}` | `on-pre-spawn-agent.sh` → `on-subagent-start.sh` | Written just before `Task` runs, atomically claimed by `mv` when the sub-agent actually starts. |
|
|
65
|
-
| `claimed/{agent_id}` | `on-subagent-start.sh` → `on-subagent-stop.sh` | Marker of which pending entry was claimed. Deleted on stop. |
|
|
66
|
-
| `sessions/{name}.json` | `on-subagent-start.sh` → `on-subagent-stop.sh` | Per-sub-agent session metadata: `sessionUuid`, `agentId`, `agentName`, `agentType`, `sessionAction` (`created` / `reused` / `reopened`), `createdAt`. Read by idle/stop/user-prompt hooks. |
|
|
67
|
-
|
|
68
|
-
`on-session-end.sh` only wipes `.synapse/` if everything inside is either closed or empty.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## MCP Connection Session vs Synapse Agent Session
|
|
73
|
-
|
|
74
|
-
These are two different things.
|
|
75
|
-
|
|
76
|
-
- **MCP connection session** — the HTTP-streamable session on `/api/mcp`. Identified by the `mcp-session-id` header, auto-renewed on every request, expires after 30 minutes of inactivity. Handled transparently by the plugin; you never touch it.
|
|
77
|
-
- **Synapse agent session** — a durable record in Synapse of which agent is working on what. Drives the green / yellow / grey indicators on the Settings page and the activity stream. Created/closed by plugin hooks, or explicitly via `synapse_create_session` / `synapse_close_session` for direct (non-sub-agent) work.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Session Status Lifecycle
|
|
82
|
-
|
|
83
|
-
```text
|
|
84
|
-
active ——(no heartbeat 1h)——> inactive ——(heartbeat)——> active
|
|
85
|
-
\ \
|
|
86
|
-
\—— close ——> closed ——(reopen)——> active
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
| Status | Meaning |
|
|
90
|
-
|---|---|
|
|
91
|
-
| `active` | Agent is working. Green indicator. |
|
|
92
|
-
| `inactive` | No heartbeat in over an hour. Yellow indicator. |
|
|
93
|
-
| `closed` | Session ended. Grey indicator. Reusable via `synapse_reopen_session`. |
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Session Tools
|
|
98
|
-
|
|
99
|
-
| Tool | Purpose |
|
|
100
|
-
|---|---|
|
|
101
|
-
| `synapse_list_sessions` | List sessions for the current agent. |
|
|
102
|
-
| `synapse_get_session` | Read one session's details. |
|
|
103
|
-
| `synapse_create_session` | Create a named session — usually only needed for direct work, not sub-agents. |
|
|
104
|
-
| `synapse_close_session` | Close a session. |
|
|
105
|
-
| `synapse_reopen_session` | Reopen a closed session instead of creating a duplicate with the same name. |
|
|
106
|
-
| `synapse_session_heartbeat` | Keep a session active. Hooks already send heartbeats automatically via `TeammateIdle`. |
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Running Multiple Experiments In Parallel
|
|
111
|
-
|
|
112
|
-
The main agent **orchestrates**. Sub-agents **execute**. This is the recommended pattern whenever there is more than one `pending_start` experiment that can run concurrently.
|
|
113
|
-
|
|
114
|
-
### Architecture
|
|
115
|
-
|
|
116
|
-
```text
|
|
117
|
-
Main agent (Claude Code)
|
|
118
|
-
├── spawn Task → sub-agent A → Synapse session A → Experiment X
|
|
119
|
-
├── spawn Task → sub-agent B → Synapse session B → Experiment Y
|
|
120
|
-
└── spawn Task → sub-agent C → Synapse session C → Experiment Z
|
|
121
|
-
|
|
122
|
-
All session creation / heartbeats / closes are handled by the plugin hooks.
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Tool availability still depends on the Synapse roles attached to the API key. The sub-agent inherits the same MCP config the main agent uses (see **Project-Level MCP** below), but the roles it can exercise are determined by whichever API key is configured in `.mcp.json`.
|
|
126
|
-
|
|
127
|
-
### Main agent: dispatch
|
|
128
|
-
|
|
129
|
-
```text
|
|
130
|
-
# 1. Refresh and list what needs to run
|
|
131
|
-
synapse_checkin()
|
|
132
|
-
synapse_get_assigned_experiments({ researchProjectUuid, statuses: ["pending_start"] })
|
|
133
|
-
|
|
134
|
-
# 2. Inspect each candidate
|
|
135
|
-
synapse_get_experiment({ experimentUuid })
|
|
136
|
-
|
|
137
|
-
# 3. For each experiment, spawn a Task sub-agent with the experiment UUID in the prompt.
|
|
138
|
-
# The SubagentStart hook auto-creates/reuses a Synapse session and injects the
|
|
139
|
-
# execution workflow. The main agent does not call synapse_create_session.
|
|
140
|
-
Task({
|
|
141
|
-
subagent_type: "general-purpose",
|
|
142
|
-
name: "training-worker-1",
|
|
143
|
-
prompt: "Your Synapse experiment UUID: <experiment-uuid>. Run the experiment end to end following the experiments skill."
|
|
144
|
-
})
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Sub-agent: execute
|
|
148
|
-
|
|
149
|
-
Each sub-agent follows the full execution checklist in **[03-experiment-workflow.md](03-experiment-workflow.md)**:
|
|
150
|
-
|
|
151
|
-
```text
|
|
152
|
-
synapse_start_experiment({ experimentUuid })
|
|
153
|
-
synapse_list_compute_nodes({ researchProjectUuid, onlyAvailable: true }) # if needed
|
|
154
|
-
synapse_reserve_gpus({ experimentUuid, gpuUuids }) # if needed
|
|
155
|
-
synapse_get_node_access_bundle({ experimentUuid, nodeUuid }) # write PEM, chmod 600, SSH
|
|
156
|
-
# run in tmux with python -u
|
|
157
|
-
synapse_report_experiment_progress({ experimentUuid, message, phase, liveStatus })
|
|
158
|
-
synapse_submit_experiment_results({ experimentUuid, outcome, experimentResults })
|
|
159
|
-
synapse_save_experiment_report({ experimentUuid, title, content }) # if the flow needs it
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Planning / revision sub-agent
|
|
163
|
-
|
|
164
|
-
A sub-agent can also be used for plan authoring or reviewer-driven revision:
|
|
165
|
-
|
|
166
|
-
```text
|
|
167
|
-
synapse_get_experiment({ experimentUuid })
|
|
168
|
-
synapse_get_comments({ targetType: "experiment", targetUuid: experimentUuid })
|
|
169
|
-
synapse_update_experiment_status({ experimentUuid, status: "draft", liveStatus: "writing" })
|
|
170
|
-
synapse_update_experiment_plan({ experimentUuid, description: "## Objective\n\n..." })
|
|
171
|
-
synapse_update_experiment_status({ experimentUuid, status: "pending_review" })
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Main agent: monitor and continue
|
|
175
|
-
|
|
176
|
-
The main agent does not block on any individual sub-agent. It polls Synapse:
|
|
177
|
-
|
|
178
|
-
```text
|
|
179
|
-
synapse_get_assigned_experiments({
|
|
180
|
-
researchProjectUuid,
|
|
181
|
-
statuses: ["in_progress", "completed"]
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
# For any experiment still in_progress, read its latest state:
|
|
185
|
-
synapse_get_experiment({ experimentUuid })
|
|
186
|
-
|
|
187
|
-
# Once all have completed, synthesize. If this is the assigned autonomous-loop
|
|
188
|
-
# agent, propose follow-ups; otherwise use synapse_create_experiment for
|
|
189
|
-
# user-directed terminal work.
|
|
190
|
-
synapse_save_project_synthesis({ researchProjectUuid, title, content })
|
|
191
|
-
synapse_propose_experiment({ researchProjectUuid, title, description })
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Sequential multi-experiment sub-agent
|
|
195
|
-
|
|
196
|
-
One sub-agent can also handle multiple experiments in order when dependencies matter:
|
|
197
|
-
|
|
198
|
-
```text
|
|
199
|
-
Task({
|
|
200
|
-
subagent_type: "general-purpose",
|
|
201
|
-
name: "sequential-worker",
|
|
202
|
-
prompt: """
|
|
203
|
-
Synapse experiments, in order (each depends on the previous):
|
|
204
|
-
1. <experiment-uuid-1> — baseline evaluation
|
|
205
|
-
2. <experiment-uuid-2> — ablation built on #1's results
|
|
206
|
-
|
|
207
|
-
For each: start_experiment → run → report_progress → submit_results.
|
|
208
|
-
"""
|
|
209
|
-
})
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
## Project-Level MCP For Sub-Agents
|
|
215
|
-
|
|
216
|
-
Sub-agents only inherit Synapse MCP access if the MCP server is configured at the project level. Put `.mcp.json` at the project root (the plugin bundle ships the template at `public/synapse-plugin/.mcp.json`). User-level-only MCP configs will not reach Task sub-agents.
|
|
217
|
-
|
|
218
|
-
```json
|
|
219
|
-
{
|
|
220
|
-
"mcpServers": {
|
|
221
|
-
"synapse": {
|
|
222
|
-
"type": "http",
|
|
223
|
-
"url": "<BASE_URL>/api/mcp",
|
|
224
|
-
"headers": {
|
|
225
|
-
"Authorization": "Bearer syn_xxxxxxxxxxxx"
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Tips
|
|
235
|
-
|
|
236
|
-
- **Descriptive sub-agent names** — use `training-worker`, `eval-worker`, `exp-ablation-3` rather than `agent-1`. The name becomes the Synapse session name and is reused on respawn.
|
|
237
|
-
- **Session reuse is automatic** — respawn with the same name and `on-subagent-start.sh` will reuse/reopen the existing session rather than create a duplicate.
|
|
238
|
-
- **Heartbeats are automatic** — `TeammateIdle` sends them. You do not need to call `synapse_session_heartbeat` manually.
|
|
239
|
-
- **Main agent never SSHs** — it orchestrates and monitors. All remote work belongs in sub-agents.
|
|
240
|
-
- **Pass UUIDs, not workflow** — the `SubagentStart` hook already injects the experiment workflow. The main agent's sub-agent prompt only needs the experiment UUID plus a one-line intent.
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## Troubleshooting
|
|
245
|
-
|
|
246
|
-
| Symptom | Likely cause / fix |
|
|
247
|
-
|---|---|
|
|
248
|
-
| Sub-agent cannot see Synapse tools | MCP is user-level only. Move `.mcp.json` to the project root. |
|
|
249
|
-
| Sub-agent session shown as `inactive` | Heartbeat has not fired for 1 h; sub-agent probably crashed. Respawn with the same name — `SubagentStart` will reopen the existing session. |
|
|
250
|
-
| Duplicate sessions appear with similar names | A previous sub-agent stopped without the `SubagentStop` hook firing (hard crash). Close stale sessions with `synapse_close_session`, then respawn. |
|
|
251
|
-
| Main agent did not receive checkin context | `SessionStart` hook failed; check `SYNAPSE_URL` and `SYNAPSE_API_KEY` in the environment. Recover by calling `synapse_checkin()` manually. |
|
|
252
|
-
| Experiment stuck in `in_progress` | Sub-agent died before `synapse_submit_experiment_results`. Either respawn the sub-agent with the same experiment UUID (it will resume), or close it out with `synapse_submit_experiment_results({ outcome: "failure", experimentResults: { error: "..." } })`. |
|
|
253
|
-
| `.synapse/` not cleaned up at session end | Deliberate — cleanup only happens when all sessions are closed and `state.json` is empty. Preserves state across resumed sessions. |
|
/package/dist/.next/static/{CTg26EE4IkxbdY0E6xEiL → VlyiqgSt6DSLuCX7rlcKa}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|