@synapse-research/synapse 0.2.10 → 0.2.12
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 +118 -118
- package/dist/.next/app-path-routes-manifest.json +37 -37
- 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.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.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.js +4 -4
- 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 +37 -37
- package/dist/.next/server/chunks/8499.js +1 -1
- 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/public/skill/aris-synapse-sync/SKILL.md +2 -2
- package/dist/public/synapse-plugin/.claude-plugin/plugin.json +1 -1
- package/dist/public/synapse-plugin/bin/on-post-create-experiment.sh +61 -0
- package/dist/public/synapse-plugin/bin/on-post-submit-results.sh +56 -0
- package/dist/public/synapse-plugin/bin/on-session-start.sh +2 -1
- package/dist/public/synapse-plugin/hooks/hooks.json +20 -0
- package/dist/public/synapse-plugin/skills/autonomy/SKILL.md +37 -0
- package/dist/public/synapse-plugin/skills/experiments/SKILL.md +52 -4
- package/dist/public/synapse-plugin/skills/sessions/SKILL.md +3 -1
- package/dist/public/synapse-plugin/skills/setup/SKILL.md +39 -4
- package/dist/public/synapse-plugin/skills/synapse/SKILL.md +2 -1
- package/dist/public/synapse-plugin/skills/synapse/references/00-common-tools.md +38 -1
- package/dist/public/synapse-plugin/skills/synapse/references/01-setup.md +28 -10
- package/dist/public/synapse-plugin/skills/synapse/references/03-experiment-workflow.md +4 -4
- package/dist/public/synapse-plugin/skills/synapse/references/05-session-sub-agent.md +3 -1
- package/package.json +1 -1
- /package/dist/.next/static/{B096FrY7TLvvjN2OLGsgv → CTg26EE4IkxbdY0E6xEiL}/_buildManifest.js +0 -0
- /package/dist/.next/static/{B096FrY7TLvvjN2OLGsgv → CTg26EE4IkxbdY0E6xEiL}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# on-post-create-experiment.sh — PostToolUse hook for synapse_create_experiment
|
|
3
|
+
# Triggered immediately after the agent creates an experiment.
|
|
4
|
+
# Reminds the main agent that the next step is a sub-agent self-review
|
|
5
|
+
# before the experiment is pushed to pending_review.
|
|
6
|
+
#
|
|
7
|
+
# Output: JSON with additionalContext (LLM-visible) + systemMessage (user toast)
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
[ -z "${SYNAPSE_URL:-}" ] && exit 0
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
14
|
+
API="${SCRIPT_DIR}/synapse-api.sh"
|
|
15
|
+
|
|
16
|
+
EVENT=""
|
|
17
|
+
if [ ! -t 0 ]; then
|
|
18
|
+
EVENT=$(cat)
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ -z "$EVENT" ]; then
|
|
22
|
+
exit 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
TOOL_NAME=$(echo "$EVENT" | jq -r '.tool_name // .toolName // empty' 2>/dev/null) || true
|
|
26
|
+
case "$TOOL_NAME" in
|
|
27
|
+
*synapse_create_experiment) ;;
|
|
28
|
+
*) exit 0 ;;
|
|
29
|
+
esac
|
|
30
|
+
|
|
31
|
+
# Try to extract the new experiment UUID from the tool response.
|
|
32
|
+
EXPERIMENT_UUID=$(echo "$EVENT" \
|
|
33
|
+
| jq -r '.tool_response.experiment.uuid // .tool_response.uuid // .response.experiment.uuid // empty' 2>/dev/null) || true
|
|
34
|
+
|
|
35
|
+
if [ -z "$EXPERIMENT_UUID" ]; then
|
|
36
|
+
EXPERIMENT_UUID=$(echo "$EVENT" \
|
|
37
|
+
| jq -r '.tool_response.content[0].text // empty' 2>/dev/null \
|
|
38
|
+
| jq -r '.experiment.uuid // .uuid // empty' 2>/dev/null) || true
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
if [ -n "$EXPERIMENT_UUID" ]; then
|
|
42
|
+
CONTEXT="[Synapse Plugin — Required next step after creating an experiment]
|
|
43
|
+
You just created experiment ${EXPERIMENT_UUID}. It is in 'draft'.
|
|
44
|
+
DO NOT push it to pending_review yet. First, spawn a sub-agent via the Task tool to self-review this draft. The sub-agent should call synapse_get_experiment, then evaluate:
|
|
45
|
+
- Is the objective specific and measurable?
|
|
46
|
+
- Is the methodology sound and reproducible?
|
|
47
|
+
- Are the success criteria aligned with the project's evaluationMethods?
|
|
48
|
+
- Is the compute budget realistic given current availability?
|
|
49
|
+
The sub-agent returns its verdict to you in-session — it does NOT write to Synapse.
|
|
50
|
+
Apply revisions with synapse_update_experiment_plan if needed.
|
|
51
|
+
Then call synapse_update_experiment_status({ experimentUuid: \"${EXPERIMENT_UUID}\", status: \"pending_review\" }) and present the self-review summary plus plan summary to the user.
|
|
52
|
+
Wait for the user's verbal approve / reject. On approve, call synapse_review_experiment with reviewNote quoting the user's words. On reject, summarize the user's revision request (including a quoted phrase) into reviewNote and call synapse_review_experiment with decision \"rejected\" — do NOT also call synapse_add_comment, the review tool writes the comment for you.
|
|
53
|
+
If the autonomy skill has marked this session as full_auto, skip the user gate and call synapse_review_experiment directly with reviewNote: 'Full-auto session authorized by <ownerName> at <ISO time>. Self-review pass: <key points>.'"
|
|
54
|
+
USER_MSG="Synapse: experiment ${EXPERIMENT_UUID:0:8} drafted — run self-review next"
|
|
55
|
+
else
|
|
56
|
+
CONTEXT="[Synapse Plugin — Required next step after creating an experiment]
|
|
57
|
+
You just created an experiment in 'draft'. Spawn a Task sub-agent to self-review the plan, revise via synapse_update_experiment_plan if needed, then push it to pending_review with synapse_update_experiment_status. After that, present the self-review summary to the user and wait for verbal approve / reject. Approvals call synapse_review_experiment with the user's quoted words in reviewNote; rejections summarize the user's revision request into reviewNote (the review tool writes the comment automatically — do not double-write)."
|
|
58
|
+
USER_MSG="Synapse: experiment drafted — run self-review next"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
"$API" hook-output "$USER_MSG" "$CONTEXT" "PostToolUse"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# on-post-submit-results.sh — PostToolUse hook for synapse_submit_experiment_results
|
|
3
|
+
# Triggered immediately after the agent submits experiment results.
|
|
4
|
+
# Injects a hard reminder that the agent MUST now call synapse_save_experiment_report
|
|
5
|
+
# to write the markdown experiment report. Runs while the agent is still alive,
|
|
6
|
+
# so it can act on the reminder in its very next turn.
|
|
7
|
+
#
|
|
8
|
+
# Output: JSON with additionalContext (LLM-visible) + systemMessage (user toast)
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
[ -z "${SYNAPSE_URL:-}" ] && exit 0
|
|
13
|
+
|
|
14
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
15
|
+
API="${SCRIPT_DIR}/synapse-api.sh"
|
|
16
|
+
|
|
17
|
+
# Read event JSON from stdin
|
|
18
|
+
EVENT=""
|
|
19
|
+
if [ ! -t 0 ]; then
|
|
20
|
+
EVENT=$(cat)
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
if [ -z "$EVENT" ]; then
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Only act on the submit-results tool. Tool names from CC arrive in either
|
|
28
|
+
# the bare form ("synapse_submit_experiment_results") or the MCP-prefixed form
|
|
29
|
+
# ("mcp__synapse__synapse_submit_experiment_results") depending on transport.
|
|
30
|
+
TOOL_NAME=$(echo "$EVENT" | jq -r '.tool_name // .toolName // empty' 2>/dev/null) || true
|
|
31
|
+
case "$TOOL_NAME" in
|
|
32
|
+
*synapse_submit_experiment_results) ;;
|
|
33
|
+
*) exit 0 ;;
|
|
34
|
+
esac
|
|
35
|
+
|
|
36
|
+
# Pull the experiment UUID out of the tool input so the reminder can be specific.
|
|
37
|
+
EXPERIMENT_UUID=$(echo "$EVENT" \
|
|
38
|
+
| jq -r '.tool_input.experimentUuid // .input.experimentUuid // empty' 2>/dev/null) || true
|
|
39
|
+
|
|
40
|
+
# Pull the outcome too — used only for phrasing.
|
|
41
|
+
OUTCOME=$(echo "$EVENT" \
|
|
42
|
+
| jq -r '.tool_input.outcome // .input.outcome // empty' 2>/dev/null) || true
|
|
43
|
+
|
|
44
|
+
if [ -n "$EXPERIMENT_UUID" ]; then
|
|
45
|
+
CONTEXT="[Synapse Plugin — Required next step after submitting results]
|
|
46
|
+
You just called synapse_submit_experiment_results for experiment ${EXPERIMENT_UUID}${OUTCOME:+ (outcome=${OUTCOME})}.
|
|
47
|
+
You MUST now immediately call synapse_save_experiment_report({ experimentUuid: \"${EXPERIMENT_UUID}\", title, content }) with a full markdown writeup (objective, methodology, results, analysis, charts where useful).
|
|
48
|
+
This is required for success, failure, and inconclusive outcomes alike. Do not finish the task, hand off, or move on until the report has been saved. Do not post the writeup as a comment — use synapse_save_experiment_report."
|
|
49
|
+
USER_MSG="Synapse: results submitted for ${EXPERIMENT_UUID:0:8} — now save the experiment report"
|
|
50
|
+
else
|
|
51
|
+
CONTEXT="[Synapse Plugin — Required next step after submitting results]
|
|
52
|
+
You just called synapse_submit_experiment_results. You MUST now immediately call synapse_save_experiment_report({ experimentUuid, title, content }) with a full markdown writeup (objective, methodology, results, analysis). This is required for every outcome — success, failure, and inconclusive. Do not finish the task or move on until the report has been saved."
|
|
53
|
+
USER_MSG="Synapse: results submitted — now save the experiment report"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
"$API" hook-output "$USER_MSG" "$CONTEXT" "PostToolUse"
|
|
@@ -169,7 +169,8 @@ Tool availability depends on the agent's Synapse roles. Public read/comment/noti
|
|
|
169
169
|
- Claim / status-update tools are available only when the agent has the matching research-oriented role
|
|
170
170
|
|
|
171
171
|
**Experiment Planning / Revision:**
|
|
172
|
-
- \`synapse_create_experiment({ researchProjectUuid, title, description, researchQuestionUuid?, priority?, status? })\` — create a brand-new experiment outside autonomous loop (defaults to \`pending_review\`)
|
|
172
|
+
- \`synapse_create_experiment({ researchProjectUuid, title, description, researchQuestionUuid?, priority?, status? })\` — create a brand-new experiment outside autonomous loop (defaults to \`draft\`; spawn a self-review sub-agent and revise before pushing to \`pending_review\`)
|
|
173
|
+
- \`synapse_review_experiment({ experimentUuid, decision, reviewNote?, assignedAgentUuid? })\` — PI/admin agents can approve into \`pending_start\` or reject back to \`draft\` from the terminal flow
|
|
173
174
|
- \`synapse_get_experiment({ experimentUuid })\` — inspect the current experiment
|
|
174
175
|
- \`synapse_get_comments({ targetType: \"experiment\", targetUuid })\` — read review feedback or @mention threads
|
|
175
176
|
- \`synapse_update_experiment_status({ experimentUuid, status: \"draft\", liveStatus: \"writing\", liveMessage })\` — mark that you are drafting or revising the plan
|
|
@@ -50,6 +50,26 @@
|
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
],
|
|
53
|
+
"PostToolUse": [
|
|
54
|
+
{
|
|
55
|
+
"matcher": "mcp__synapse__synapse_submit_experiment_results|synapse_submit_experiment_results",
|
|
56
|
+
"hooks": [
|
|
57
|
+
{
|
|
58
|
+
"type": "command",
|
|
59
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/bin/on-post-submit-results.sh"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"matcher": "mcp__synapse__synapse_create_experiment|synapse_create_experiment",
|
|
65
|
+
"hooks": [
|
|
66
|
+
{
|
|
67
|
+
"type": "command",
|
|
68
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/bin/on-post-create-experiment.sh"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
53
73
|
"SubagentStart": [
|
|
54
74
|
{
|
|
55
75
|
"hooks": [
|
|
@@ -25,6 +25,17 @@ This is the **CC-client autonomous loop**. It does not depend on the server-side
|
|
|
25
25
|
|
|
26
26
|
If the user explicitly asks for "human review before each experiment", switch to **review mode**: proposals land as `pending_review` and the loop pauses until they are approved externally.
|
|
27
27
|
|
|
28
|
+
## Full-Auto Lives In This Session Only
|
|
29
|
+
|
|
30
|
+
Full-auto mode for the CC-client autonomous loop is opted in **verbally** ("turn on autonomous loop", "full auto", "run until done") and lives only in the main agent's current session context. It does **not** flip the server-side `autonomousLoopEnabled` / `autonomousLoopMode` fields, and it does not write any state to Synapse.
|
|
31
|
+
|
|
32
|
+
Full-auto is a one-way track. The only exits are:
|
|
33
|
+
|
|
34
|
+
- The user explicitly says stop (or interrupts the session).
|
|
35
|
+
- A hard external error makes progress impossible (compute exhausted, MCP failure, network partition that cannot be recovered).
|
|
36
|
+
|
|
37
|
+
Self-review **never** pauses full-auto. Sub-agent timeouts in self-review do not pause full-auto. Advisory issues raised by self-review do not pause full-auto. The main agent applies a single revision pass when feasible and continues. Whatever the main agent decides, it must be reflected in the `reviewNote` of the resulting `synapse_review_experiment` call (see template below).
|
|
38
|
+
|
|
28
39
|
## Prompt Boundary
|
|
29
40
|
|
|
30
41
|
Stay inside this skill when the work is about:
|
|
@@ -72,6 +83,12 @@ Each iteration of the loop follows the same shape. The main agent runs this unti
|
|
|
72
83
|
|
|
73
84
|
5. **Check stop conditions**, then either return control to the user (normal case) or immediately re-run step 1 if the user asked for tight, unattended iteration within a single turn.
|
|
74
85
|
|
|
86
|
+
## Self-Review Before `synapse_propose_experiment`
|
|
87
|
+
|
|
88
|
+
Before calling `synapse_propose_experiment`, spawn a `Task` sub-agent to self-review the proposal text (motivation, hypothesis, method, success criteria, compute fit) against the project context and evaluation methods. Self-review is in-session only — it does **not** write to Synapse. Refine the proposal text based on the verdict, then call `synapse_propose_experiment`.
|
|
89
|
+
|
|
90
|
+
The same applies after `synapse_create_experiment` lands a draft inside the loop: self-review the draft via a sub-agent, revise, then push to `pending_review` and (in full-auto) auto-approve.
|
|
91
|
+
|
|
75
92
|
## Monitor-Not-Executor
|
|
76
93
|
|
|
77
94
|
The main agent does **not** SSH into GPU nodes, does **not** run training loops, and does **not** call `synapse_start_experiment` itself (unless the user explicitly tells it to run an experiment inline with no sub-agent). Its job is:
|
|
@@ -109,6 +126,26 @@ Exit the loop and report back to the user when any of these hold:
|
|
|
109
126
|
|
|
110
127
|
On exit, summarize what was run, what was learned, the current state of the synthesis document, and any recommended follow-ups for a human.
|
|
111
128
|
|
|
129
|
+
## Auto-Approve `reviewNote` Template (CC Full-Auto Only)
|
|
130
|
+
|
|
131
|
+
When the main agent auto-approves a draft after a successful self-review:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
synapse_review_experiment({
|
|
135
|
+
experimentUuid,
|
|
136
|
+
decision: "approved",
|
|
137
|
+
reviewNote: "Full-auto session authorized by <ownerName> at <ISO time>. Self-review pass: <key points>.",
|
|
138
|
+
})
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
When self-review failed or timed out, use:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
reviewNote: "Full-auto session authorized by <ownerName> at <ISO time>. Self-review skipped: <reason>."
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Either way, full-auto continues — the `reviewNote` is the audit truth.
|
|
148
|
+
|
|
112
149
|
## Mutual Exclusion With The Server-Side Loop
|
|
113
150
|
|
|
114
151
|
If `synapse_get_research_project` shows the project already has `autonomousLoopEnabled = true` and a loop agent assigned on the realtime side, do not also run the CC-client loop against it. Warn the user and either defer, or ask them to disable the server-side loop first — running both will double-dispatch proposals and reservations.
|
|
@@ -33,10 +33,56 @@ Hand off to:
|
|
|
33
33
|
If `synapse_get_assigned_experiments` returns empty, do not idle. Ask the user which path:
|
|
34
34
|
|
|
35
35
|
1. **Execute an approved experiment** — list `pending_start` experiments in the project with `synapse_get_project_full_context` and ask which to start.
|
|
36
|
-
2. **Flesh out a quick idea** — call `synapse_get_project_full_context`, then draft a plan with `synapse_create_experiment` (defaults to `
|
|
36
|
+
2. **Flesh out a quick idea** — call `synapse_get_project_full_context`, then draft a plan with `synapse_create_experiment` (defaults to `draft`; run a self-review sub-agent before pushing to `pending_review` per the "Create → Self-Review → Pending Review → Verbal Approve" section below).
|
|
37
37
|
3. **Create the foundational experiment** — if the project has no completed experiments, offer the foundational template below.
|
|
38
38
|
4. **Enter the autonomous loop** — hand off to **[autonomy](../autonomy/SKILL.md)** to propose and auto-dispatch the next experiment.
|
|
39
39
|
|
|
40
|
+
## Create → Self-Review → Pending Review → Verbal Approve
|
|
41
|
+
|
|
42
|
+
Every agent-created experiment goes through this sequence before reaching `pending_review`.
|
|
43
|
+
|
|
44
|
+
1. `synapse_create_experiment(...)` — defaults to `draft`. The PostToolUse hook will remind you to run self-review next.
|
|
45
|
+
2. Spawn a self-review sub-agent with the `Task` tool. Use a prompt similar to:
|
|
46
|
+
```
|
|
47
|
+
Self-review experiment <experimentUuid> for project <projectUuid>.
|
|
48
|
+
Call synapse_get_experiment to read the plan. Then evaluate against the project's evaluationMethods:
|
|
49
|
+
- Is the objective specific and measurable?
|
|
50
|
+
- Is the methodology sound and reproducible?
|
|
51
|
+
- Do the success criteria align with the project's evaluation methods?
|
|
52
|
+
- Is the compute budget realistic given current availability (synapse_list_compute_nodes)?
|
|
53
|
+
Return a short verdict: "pass" or a bulleted list of concrete revisions.
|
|
54
|
+
Do NOT write back to Synapse — your verdict is consumed in-session by the main agent.
|
|
55
|
+
```
|
|
56
|
+
3. If the verdict surfaces issues, apply revisions with `synapse_update_experiment_plan({ experimentUuid, ... })`.
|
|
57
|
+
4. `synapse_update_experiment_status({ experimentUuid, status: "pending_review" })` to push the draft into review.
|
|
58
|
+
5. Present the self-review summary and the plan summary to the user in the terminal. Wait for a verbal answer.
|
|
59
|
+
6. **On verbal approve:**
|
|
60
|
+
```
|
|
61
|
+
synapse_review_experiment({
|
|
62
|
+
experimentUuid,
|
|
63
|
+
decision: "approved",
|
|
64
|
+
reviewNote: 'User verbally approved in terminal: "<exact words>"',
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
That call atomically transitions to `pending_start`, writes the activity, and emits `task_assigned` so execution can begin.
|
|
68
|
+
7. **On verbal reject:** summarize the user's revision request in second-person Chinese, including a quoted phrase from the user, and pass it as `reviewNote`:
|
|
69
|
+
```
|
|
70
|
+
synapse_review_experiment({
|
|
71
|
+
experimentUuid,
|
|
72
|
+
decision: "rejected",
|
|
73
|
+
reviewNote: '用户口头要求修改:…(原话:"…")',
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
The review tool writes the comment and emits `experiment_revision_requested` automatically — **do not** also call `synapse_add_comment`.
|
|
77
|
+
8. After a reject, the experiment is back in `draft`. Revise per feedback, run self-review again, then resubmit to `pending_review`.
|
|
78
|
+
9. **Full-auto mode** (set verbally via the `autonomy` skill, lives only in the current CC session): after step 4, skip steps 5–8 and immediately call `synapse_review_experiment` with the fixed full-auto template:
|
|
79
|
+
```
|
|
80
|
+
reviewNote: 'Full-auto session authorized by <ownerName> at <ISO time>. Self-review pass: <key points>.'
|
|
81
|
+
```
|
|
82
|
+
If self-review timed out or errored: `'Self-review skipped: <reason>.'`. Full-auto **never pauses** on advisory self-review output — it only exits on user-stop or hard external errors.
|
|
83
|
+
|
|
84
|
+
The `synapse_review_experiment` tool requires `admin` or `pi_agent` role. To run verbal-approve flows on Claude Code, configure the CC agent with one of those roles.
|
|
85
|
+
|
|
40
86
|
## Foundational First Experiment
|
|
41
87
|
|
|
42
88
|
If the project has no completed experiments yet, the first experiment is not a normal research run — it is the project's baseline infrastructure. Drive it through three bundled deliverables before any comparison work:
|
|
@@ -51,20 +97,20 @@ If the project has a repo, commit all three onto the base branch (or a per-exper
|
|
|
51
97
|
|
|
52
98
|
1. `synapse_checkin()` — refresh identity and assignments
|
|
53
99
|
2. Author or fetch the experiment
|
|
54
|
-
- New plan: `synapse_create_experiment(...)` (defaults to `
|
|
100
|
+
- New plan: `synapse_create_experiment(...)` (defaults to `draft`; run a self-review sub-agent and revise before pushing to `pending_review` per the section below)
|
|
55
101
|
- Existing assignment: `synapse_get_assigned_experiments()` then `synapse_get_experiment({ experimentUuid })`
|
|
56
102
|
3. If drafting or revising: `synapse_update_experiment_status({ status: "draft", liveStatus: "writing" })` + `synapse_update_experiment_plan(...)`, then `synapse_update_experiment_status({ status: "pending_review" })`
|
|
57
103
|
4. Before execution: `synapse_list_compute_nodes({ onlyAvailable: true, researchProjectUuid })`
|
|
58
104
|
5. Reserve compute: optional `synapse_reserve_gpus(...)` or inline via `synapse_start_experiment({ gpuUuids })`
|
|
59
105
|
6. `synapse_start_experiment({ experimentUuid, workingNotes })` — moves to `in_progress`
|
|
60
106
|
7. If remote compute: `synapse_get_node_access_bundle({ experimentUuid, nodeUuid })`, write the returned `privateKeyPemBase64` to a local PEM, `chmod 600`, SSH with the returned host/user/port
|
|
61
|
-
8. If repo-backed: `synapse_get_repo_access` → clone → branch from the experiment's base branch
|
|
107
|
+
8. If repo-backed: `synapse_get_repo_access` → clone → branch from the experiment's base branch (commit + push back to this repo at the end is mandatory)
|
|
62
108
|
9. Run the workload in a persistent remote shell (`tmux`/`screen`) with unbuffered output (`python -u …` or `PYTHONUNBUFFERED=1`) so logs never stall a tool call
|
|
63
109
|
10. Report progress with `synapse_report_experiment_progress` at milestones — `phase` ∈ `setup` | `training` | `evaluation` | `analysis`; `liveStatus` ∈ `checking_resources` | `queuing` | `running`
|
|
64
110
|
11. For long runs (>30 min), schedule periodic progress updates (cron on the remote node, or the main agent polling and calling `synapse_report_experiment_progress` on a timer) so the card never looks dead
|
|
65
111
|
12. Commit code/artifacts to the experiment branch or base branch; capture the commit SHA
|
|
66
112
|
13. Finish with `synapse_submit_experiment_results({ outcome, experimentResults, branch, commitSha })` — `outcome` ∈ `success` | `failure` | `inconclusive`; on failure include the error and partial results
|
|
67
|
-
14.
|
|
113
|
+
14. **Always** follow `synapse_submit_experiment_results` with `synapse_save_experiment_report({ experimentUuid, title, content })` — write a full markdown writeup (objective, methodology, results, analysis, charts where relevant). Do **not** post the report as a comment, and do **not** treat this step as optional even for `failure` / `inconclusive` runs
|
|
68
114
|
15. If revising per reviewer feedback, read the full thread first with `synapse_get_comments({ targetType: "experiment", targetUuid })` before editing the plan
|
|
69
115
|
|
|
70
116
|
## Core Rules
|
|
@@ -72,6 +118,8 @@ If the project has a repo, commit all three onto the base branch (or a per-exper
|
|
|
72
118
|
- **Never assume a server-local SSH key path exists.** Always fetch the access bundle and write the PEM locally.
|
|
73
119
|
- **One independent run per experiment card.** Do not bundle comparison runs, ablations, or parameter sweeps into a single experiment — create multiple cards.
|
|
74
120
|
- **Match the project description's language.** If the project brief is in Chinese, write the plan, progress, and report in Chinese.
|
|
121
|
+
- **If the project is repo-backed, you must commit back.** Whenever `synapse_get_repo_access` returns a configured repo, all experiment code, configs, and meaningful artifacts must be committed and pushed to that repo (on the experiment branch or merged to base), and the resulting `branch` + `commitSha` must be passed to `synapse_submit_experiment_results`. Local-only runs without a commit are not acceptable when a repo exists.
|
|
122
|
+
- **Always save an experiment report after submitting results.** Every `synapse_submit_experiment_results` call must be immediately followed by `synapse_save_experiment_report({ experimentUuid, title, content })` with a full markdown writeup. This applies to `success`, `failure`, and `inconclusive` outcomes alike.
|
|
75
123
|
- **Split plan / execution / report tools.** Use `synapse_update_experiment_plan` for plan edits, `synapse_report_experiment_progress` for live status, `synapse_submit_experiment_results` for completion, and `synapse_save_experiment_report` for the dedicated report. Do not substitute with comments.
|
|
76
124
|
- **Revision stays durable.** When a reviewer sends an experiment back, flip to `draft`, revise, then move it back to `pending_review`; leave a reply via `synapse_add_comment` using `@[name](actorType:uuid)` format to notify the reviewer.
|
|
77
125
|
- **Failures are data.** An experiment that crashes or shows a regression is still a valid submission: set `outcome: "failure"` (or `"inconclusive"`) and write up what happened in `experimentResults` and the report.
|
|
@@ -130,7 +130,9 @@ synapse_get_assigned_experiments({
|
|
|
130
130
|
# For any experiment still in_progress, read its latest state
|
|
131
131
|
synapse_get_experiment({ experimentUuid })
|
|
132
132
|
|
|
133
|
-
# Once all have completed, synthesize
|
|
133
|
+
# Once all have completed, synthesize. If this is the assigned autonomous-loop
|
|
134
|
+
# agent, propose follow-ups; otherwise use synapse_create_experiment for
|
|
135
|
+
# user-directed terminal work.
|
|
134
136
|
synapse_propose_experiment({ researchProjectUuid, title, description })
|
|
135
137
|
```
|
|
136
138
|
|
|
@@ -30,13 +30,33 @@ This skill does not cover day-to-day research or experiment execution. Hand off
|
|
|
30
30
|
## Recommended Flow
|
|
31
31
|
|
|
32
32
|
1. Get an API key from the Synapse **Agents** page.
|
|
33
|
-
2.
|
|
34
|
-
3. Restart Claude Code
|
|
33
|
+
2. Set `SYNAPSE_URL` and `SYNAPSE_API_KEY` **in one place** (see "Where the credentials live" below).
|
|
34
|
+
3. Restart Claude Code so it reloads MCP config and re-evaluates env.
|
|
35
35
|
4. Call `synapse_checkin()` and confirm expected roles/tools are visible.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
The plugin already ships its own `.mcp.json` (at `public/synapse-plugin/.mcp.json` inside the plugin bundle), so you do **not** need to copy a `.mcp.json` into your project. Installing the plugin makes the MCP server available; the only thing you supply is the env values.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
## Where The Credentials Live (Important)
|
|
40
|
+
|
|
41
|
+
The plugin's bundled `.mcp.json` carries `${SYNAPSE_URL}` and `${SYNAPSE_API_KEY}` placeholders. Claude Code substitutes them at MCP-server-startup time from your env. You only put the real values in **one** location:
|
|
42
|
+
|
|
43
|
+
- **User-level Claude Code settings** — `~/.claude/settings.json`'s `env` block. Best for personal use across projects.
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"env": {
|
|
47
|
+
"SYNAPSE_URL": "http://localhost:3000",
|
|
48
|
+
"SYNAPSE_API_KEY": "syn_..."
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
- **Project-level Claude Code settings** — `<project>/.claude/settings.json`'s `env` block. Best when several teammates share a project but each needs their own key (use `.claude/settings.local.json` for personal values; never commit the key).
|
|
53
|
+
- **Shell environment** — `export SYNAPSE_URL=...; export SYNAPSE_API_KEY=...` in your shell rc, before launching Claude Code. Ad-hoc only.
|
|
54
|
+
|
|
55
|
+
The plugin's bash hooks (`SessionStart`, `PostToolUse`, etc.) also read the same two env variables, so a single env source covers both the MCP server and the hook scripts.
|
|
56
|
+
|
|
57
|
+
## Plugin's Own `.mcp.json` (For Reference)
|
|
58
|
+
|
|
59
|
+
You don't need to edit or copy this file — the plugin ships and loads it automatically:
|
|
40
60
|
|
|
41
61
|
```json
|
|
42
62
|
{
|
|
@@ -52,6 +72,20 @@ The plugin ships a project-level template at `public/synapse-plugin/.mcp.json`.
|
|
|
52
72
|
}
|
|
53
73
|
```
|
|
54
74
|
|
|
75
|
+
If you have a strong reason to override (e.g. add `X-Synapse-Project` filter headers for one project), you can add a `.mcp.json` at your project root that defines a different `synapse` server entry — Claude Code project-level config takes precedence.
|
|
76
|
+
|
|
77
|
+
## Roles That Matter
|
|
78
|
+
|
|
79
|
+
Set the agent's roles on the **Agents** page based on what you expect Claude Code to do:
|
|
80
|
+
|
|
81
|
+
- `pre_research` — paper search, literature reading.
|
|
82
|
+
- `research` — research-question CRUD.
|
|
83
|
+
- `experiment` — create/start/report/submit experiments, compute tools.
|
|
84
|
+
- `report` — document and synthesis tools.
|
|
85
|
+
- `admin` / `pi_agent` — needed if Claude Code should call `synapse_review_experiment` to carry the user's verbal approve / reject from the terminal into Synapse. Without one of these, `/api/experiments/<uuid>/review` returns 403.
|
|
86
|
+
|
|
87
|
+
If the same Claude Code agent should both execute experiments and verbally-approve them, give it both `experiment` and `admin` (or `pi_agent`).
|
|
88
|
+
|
|
55
89
|
## Verification
|
|
56
90
|
|
|
57
91
|
Use:
|
|
@@ -64,6 +98,7 @@ If the connection is wrong, check:
|
|
|
64
98
|
- the key starts with `syn_`
|
|
65
99
|
- `SYNAPSE_URL` is reachable
|
|
66
100
|
- Claude Code has reloaded the MCP config
|
|
101
|
+
- the env variables actually reach the MCP server process (`echo $SYNAPSE_URL` from the same shell that launches Claude Code)
|
|
67
102
|
- the agent has the roles needed for the tools you expect to use
|
|
68
103
|
|
|
69
104
|
## Reference
|
|
@@ -104,7 +104,8 @@ Each stage skill repeats this onboarding prompt from its own perspective when en
|
|
|
104
104
|
| Documents and synthesis | `synapse_get_documents`, `synapse_get_document`, `synapse_save_project_synthesis` |
|
|
105
105
|
| Literature and deep research | `synapse_search_papers`, `synapse_add_related_work`, `synapse_get_related_works`, `synapse_get_deep_research_report` |
|
|
106
106
|
| Research questions | `synapse_get_research_question` and research-question mutation tools when roles allow |
|
|
107
|
-
| Experiments | `synapse_get_assigned_experiments`, `synapse_get_experiment`, `synapse_start_experiment`, `synapse_report_experiment_progress`, `synapse_submit_experiment_results`, `synapse_propose_experiment` |
|
|
107
|
+
| Experiments | `synapse_get_assigned_experiments`, `synapse_get_experiment`, `synapse_create_experiment`, `synapse_start_experiment`, `synapse_report_experiment_progress`, `synapse_submit_experiment_results`, `synapse_propose_experiment` (autonomous loop only) |
|
|
108
|
+
| PI/Admin review | `synapse_review_experiment` |
|
|
108
109
|
| Compute | `synapse_list_compute_nodes`, `synapse_reserve_gpus`, `synapse_get_node_access_bundle` |
|
|
109
110
|
| Collaboration | `synapse_add_comment`, `synapse_get_comments`, `synapse_search_mentionables` |
|
|
110
111
|
| Task cleanup | `synapse_complete_task` except where a task-specific save/submit tool already clears state |
|
|
@@ -61,7 +61,7 @@ Requires the `experiment` tool family.
|
|
|
61
61
|
| `synapse_report_experiment_progress` | Report live progress to the experiment card and timeline. Supports `liveStatus` such as `queuing`, `checking_resources`, or `running`. |
|
|
62
62
|
| `synapse_submit_experiment_results` | Finish an experiment and submit structured results. |
|
|
63
63
|
| `synapse_save_experiment_report` | Create or update the dedicated experiment result document after completion. |
|
|
64
|
-
| `synapse_propose_experiment` |
|
|
64
|
+
| `synapse_propose_experiment` | Autonomous-loop only: propose the next experiment when the caller is the assigned loop agent. Human-review mode creates `pending_review`; full-auto mode creates `pending_start` and auto-assigns it back to the agent. Use `synapse_create_experiment` for user-directed terminal work. |
|
|
65
65
|
| `synapse_list_compute_nodes` | List pools, nodes, GPUs, and access details. |
|
|
66
66
|
| `synapse_get_node_access_bundle` | Get managed SSH access details and `privateKeyPemBase64`. |
|
|
67
67
|
| `synapse_sync_node_inventory` | Sync node instance metadata and GPU inventory. |
|
|
@@ -70,6 +70,43 @@ Requires the `experiment` tool family.
|
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
+
## PI / Admin Review
|
|
74
|
+
|
|
75
|
+
Requires `admin`, `pi`, or `pi_agent`.
|
|
76
|
+
|
|
77
|
+
| Tool | Description |
|
|
78
|
+
|------|-------------|
|
|
79
|
+
| `synapse_review_experiment` | Approve a pending experiment into `pending_start` or reject it back to `draft`. Use this for Claude Code terminal review flows. |
|
|
80
|
+
|
|
81
|
+
### `reviewNote` Formatting
|
|
82
|
+
|
|
83
|
+
`synapse_review_experiment` records `reviewNote` in:
|
|
84
|
+
- the activity entry,
|
|
85
|
+
- the recipient notification,
|
|
86
|
+
- and (on reject) a comment authored by the actor.
|
|
87
|
+
|
|
88
|
+
The wording matters because the actor is the agent — `reviewNote` is what makes the human voice visible in audit. Use these formats:
|
|
89
|
+
|
|
90
|
+
- **Verbal approve (Claude Code terminal):**
|
|
91
|
+
```
|
|
92
|
+
reviewNote: 'User verbally approved in terminal: "<exact words from the user>"'
|
|
93
|
+
```
|
|
94
|
+
- **Verbal reject (Claude Code terminal):** summarize the user's revision request in second-person Chinese, including a quoted phrase. Example:
|
|
95
|
+
```
|
|
96
|
+
reviewNote: '用户口头要求修改:把 batch size 改回 32(原话:"那个 batch size 改回 32 试试")'
|
|
97
|
+
```
|
|
98
|
+
The tool writes the comment and emits `experiment_revision_requested` automatically — **do not** also call `synapse_add_comment`.
|
|
99
|
+
- **Claude Code full-auto auto-approve:**
|
|
100
|
+
```
|
|
101
|
+
reviewNote: 'Full-auto session authorized by <ownerName> at <ISO time>. Self-review pass: <key points>.'
|
|
102
|
+
```
|
|
103
|
+
Or, if self-review failed:
|
|
104
|
+
```
|
|
105
|
+
reviewNote: 'Full-auto session authorized by <ownerName> at <ISO time>. Self-review skipped: <reason>.'
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
73
110
|
## Literature And Related Works
|
|
74
111
|
|
|
75
112
|
Usually requires `pre_research`.
|
|
@@ -28,27 +28,44 @@ If you do not have an API key yet:
|
|
|
28
28
|
|
|
29
29
|
## 2. MCP Server Configuration
|
|
30
30
|
|
|
31
|
-
Synapse MCP uses the HTTP Streamable transport.
|
|
31
|
+
Synapse MCP uses the HTTP Streamable transport. **Once the Synapse plugin is installed in Claude Code, you do not need to write your own `.mcp.json`** — the plugin bundles one (at `public/synapse-plugin/.mcp.json`) and Claude Code loads it automatically.
|
|
32
32
|
|
|
33
|
-
The
|
|
34
|
-
|
|
35
|
-
Replace `<BASE_URL>` with the Synapse address (for example `https://synapse.example.com` or `http://localhost:3000`).
|
|
33
|
+
The bundled file uses env placeholders:
|
|
36
34
|
|
|
37
35
|
```json
|
|
38
36
|
{
|
|
39
37
|
"mcpServers": {
|
|
40
38
|
"synapse": {
|
|
41
39
|
"type": "http",
|
|
42
|
-
"url": "
|
|
40
|
+
"url": "${SYNAPSE_URL}/api/mcp",
|
|
43
41
|
"headers": {
|
|
44
|
-
"Authorization": "Bearer
|
|
42
|
+
"Authorization": "Bearer ${SYNAPSE_API_KEY}"
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
```
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
You only have to supply the env values, in **one** place. Example via `~/.claude/settings.json`:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"env": {
|
|
54
|
+
"SYNAPSE_URL": "http://localhost:3000",
|
|
55
|
+
"SYNAPSE_API_KEY": "syn_..."
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Other equally valid sources for those env values:
|
|
61
|
+
- `<project>/.claude/settings.json`'s `env` block (project scope; per-developer values can go in `.claude/settings.local.json`).
|
|
62
|
+
- Shell environment (`export SYNAPSE_URL=...; export SYNAPSE_API_KEY=...`) before launching Claude Code.
|
|
63
|
+
|
|
64
|
+
The plugin's bash hooks read the same two variables, so one env source covers both the MCP server and the hook scripts.
|
|
65
|
+
|
|
66
|
+
If you really do need to override the bundled MCP entry (e.g. to add `X-Synapse-Project` filter headers for one project), drop a project-root `.mcp.json` with a `synapse` entry — Claude Code project-level config takes precedence.
|
|
67
|
+
|
|
68
|
+
Restart Claude Code after editing env values so MCP picks them up.
|
|
52
69
|
|
|
53
70
|
### Optional: Project Filtering
|
|
54
71
|
|
|
@@ -88,9 +105,10 @@ A successful response includes your agent identity, roles, current assignments,
|
|
|
88
105
|
|
|
89
106
|
If it fails, check:
|
|
90
107
|
- Is the API key correct and does it start with `syn_`?
|
|
91
|
-
- Is the URL reachable?
|
|
92
|
-
- Did you restart Claude Code
|
|
93
|
-
-
|
|
108
|
+
- Is the URL reachable from the machine running Claude Code?
|
|
109
|
+
- Did you restart Claude Code after editing `.mcp.json` or `settings.json`?
|
|
110
|
+
- Are the env variables actually visible to the MCP server process? `echo $SYNAPSE_URL` from the shell that launches Claude Code should print the value.
|
|
111
|
+
- Does the agent have the roles needed for the tools you expect to use (`pre_research`, `research`, `experiment`, `report`, `admin`, `pi_agent`)? `synapse_review_experiment` requires `admin` or `pi_agent` specifically.
|
|
94
112
|
|
|
95
113
|
---
|
|
96
114
|
|
|
@@ -208,7 +208,7 @@ This is the detailed flow for moving an experiment through `in_progress` to `com
|
|
|
208
208
|
|
|
209
209
|
9. **Monitoring — short runs** (a few minutes): skip the cron, report progress inline at setup / mid-training / evaluation / analysis transitions.
|
|
210
210
|
|
|
211
|
-
10. **Commit code and artifacts** — commit configs, scripts, and meaningful artifacts to the experiment branch (or base branch) and
|
|
211
|
+
10. **Commit code and artifacts** — if `synapse_get_repo_access` shows the project is repo-backed, you **must** commit configs, scripts, and meaningful artifacts to the experiment branch (or base branch) **and push to the configured repo**. Capture the commit SHA so it can be passed to `synapse_submit_experiment_results` as `experimentResults.commit` (and `branch`). Local-only runs that never push back are not acceptable when a repo is configured.
|
|
212
212
|
|
|
213
213
|
11. **Submit results**
|
|
214
214
|
|
|
@@ -227,7 +227,7 @@ This is the detailed flow for moving an experiment through `in_progress` to `com
|
|
|
227
227
|
|
|
228
228
|
`outcome` is optional, typically `success`, `failure`, or `inconclusive`. Submitting moves the experiment to `completed`, refreshes the experiment result document, and triggers the project synthesis refresh.
|
|
229
229
|
|
|
230
|
-
12. **Save the dedicated experiment report** —
|
|
230
|
+
12. **Save the dedicated experiment report** — every submission must be immediately followed by a markdown report. This is required for `success`, `failure`, and `inconclusive` outcomes:
|
|
231
231
|
|
|
232
232
|
```text
|
|
233
233
|
synapse_save_experiment_report({
|
|
@@ -237,7 +237,7 @@ This is the detailed flow for moving an experiment through `in_progress` to `com
|
|
|
237
237
|
})
|
|
238
238
|
```
|
|
239
239
|
|
|
240
|
-
Use python + a plotting library to generate charts and embed them in the markdown where they help. Do **not** post the report as a comment — always use `synapse_save_experiment_report` so the dedicated result document exists.
|
|
240
|
+
Use python + a plotting library to generate charts and embed them in the markdown where they help. Do **not** post the report as a comment — always use `synapse_save_experiment_report` so the dedicated result document exists. The plugin's `PostToolUse` hook on `synapse_submit_experiment_results` injects a reminder, but you should treat this step as part of the submit flow, not as something to wait for the hook to nag about.
|
|
241
241
|
|
|
242
242
|
13. **Match the project description's language** — if the project brief is in Chinese, write plan, progress messages, and report in Chinese.
|
|
243
243
|
|
|
@@ -313,7 +313,7 @@ When a reviewer sends `pending_review` back to `draft`:
|
|
|
313
313
|
8. Run workload in tmux + unbuffered python
|
|
314
314
|
9. `synapse_report_experiment_progress()` at milestones
|
|
315
315
|
10. `synapse_submit_experiment_results()` — success, failure, or inconclusive
|
|
316
|
-
11. `synapse_save_experiment_report()`
|
|
316
|
+
11. `synapse_save_experiment_report()` — **always** runs immediately after submit, regardless of outcome
|
|
317
317
|
12. `synapse_add_comment()` for durable findings and mention the reviewer
|
|
318
318
|
|
|
319
319
|
For parallel multi-experiment dispatch (main agent orchestrates, sub-agents execute), see **[05-session-sub-agent.md](05-session-sub-agent.md)**.
|
|
@@ -184,7 +184,9 @@ synapse_get_assigned_experiments({
|
|
|
184
184
|
# For any experiment still in_progress, read its latest state:
|
|
185
185
|
synapse_get_experiment({ experimentUuid })
|
|
186
186
|
|
|
187
|
-
# Once all have completed, synthesize
|
|
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.
|
|
188
190
|
synapse_save_project_synthesis({ researchProjectUuid, title, content })
|
|
189
191
|
synapse_propose_experiment({ researchProjectUuid, title, description })
|
|
190
192
|
```
|
package/package.json
CHANGED
/package/dist/.next/static/{B096FrY7TLvvjN2OLGsgv → CTg26EE4IkxbdY0E6xEiL}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|