mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-09-21 21:03:38 +08:00
Refine course progression and runtime safety
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
{
|
||||
"type": "tool_result",
|
||||
"toolName": "todo_write",
|
||||
"content": "Todos updated.",
|
||||
"annotation": "The current todo list is kept by the harness."
|
||||
"content": "[>] Inspect parser\n[ ] Refactor parsing branch\n[ ] Add regression test\n\n(0/3 completed)",
|
||||
"annotation": "The harness returns the current list to the model."
|
||||
},
|
||||
{
|
||||
"type": "tool_call",
|
||||
@@ -28,8 +28,8 @@
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "<reminder>Update todo status after 3 rounds without todo_write.</reminder>",
|
||||
"annotation": "The nag reminder keeps the plan fresh during long work."
|
||||
"content": "<reminder>Update your todos.</reminder>",
|
||||
"annotation": "After three rounds without todo_write, the harness appends a reminder."
|
||||
},
|
||||
{
|
||||
"type": "assistant_text",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": "s06",
|
||||
"title": "Subagent",
|
||||
"description": "The task tool spawns a fresh subagent context and returns only a final summary to the parent.",
|
||||
"description": "The task tool runs a nested agent loop with fresh messages and returns its final text to the parent.",
|
||||
"steps": [
|
||||
{
|
||||
"type": "user_message",
|
||||
@@ -16,20 +16,20 @@
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "spawn_subagent: messages=[{role:\"user\", content: prompt}], tools=bash/read/write/edit/glob",
|
||||
"annotation": "The child receives a fresh message history and no recursive task tool."
|
||||
"content": "run_subagent: messages=[{role:\"user\", content: prompt}], tools=bash/read/write/edit/glob",
|
||||
"annotation": "The subagent receives fresh messages and no task tool."
|
||||
},
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "read_file",
|
||||
"content": "{\"path\":\"cli.py\"}",
|
||||
"annotation": "Inside the child loop, intermediate tool calls stay private."
|
||||
"annotation": "The tool call stays in the subagent's local message list."
|
||||
},
|
||||
{
|
||||
"type": "tool_result",
|
||||
"toolName": "task",
|
||||
"content": "Summary: cli.py parses args, selects a command handler, then dispatches.",
|
||||
"annotation": "Only the subagent's final summary returns to the parent."
|
||||
"annotation": "The subagent's final text becomes the parent's task result."
|
||||
},
|
||||
{
|
||||
"type": "assistant_text",
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "spawn_teammate",
|
||||
"content": "{\"name\":\"backend\",\"role\":\"backend engineer\",\"prompt\":\"Claim the authentication task and propose a plan.\"}",
|
||||
"annotation": "A persistent teammate receives focused work through the team runtime."
|
||||
"content": "{\"name\":\"backend\",\"role\":\"backend engineer\",\"prompt\":\"Claim the authentication task and propose a plan.\",\"require_plan\":true}",
|
||||
"annotation": "The plan gate is active before the teammate thread starts, so claim and mutation cannot race ahead of approval."
|
||||
},
|
||||
{
|
||||
"type": "tool_call",
|
||||
@@ -62,13 +62,30 @@
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "plan_request(req_plan_7) -> plan_response(req_plan_7, approved=true)",
|
||||
"annotation": "Typed correlation and an approval gate protect mutating tools."
|
||||
"content": "claim_next_task(backend) -> task_1712345678_0042; task_store_lock commits owner=backend",
|
||||
"annotation": "The ownership check and persisted state transition share the cross-process task-store lock."
|
||||
},
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "request_plan",
|
||||
"content": "{\"teammate\":\"backend\",\"task\":\"Inspect the claimed authentication task and submit a plan before changing files.\"}",
|
||||
"annotation": "The Lead delivers the plan request for the current assignment; the gate was already active before the teammate thread started."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "claim_next_task(backend) -> task_1712345678_0042; task_lock commits owner=backend",
|
||||
"annotation": "The ownership check and state transition are atomic."
|
||||
"content": "backend submit_plan -> plan_approval_request(request_id=req_000007, task_id=task_1712345678_0042)",
|
||||
"annotation": "The request records the task and work version that the plan is meant to authorize."
|
||||
},
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "review_plan",
|
||||
"content": "{\"request_id\":\"req_000007\",\"approve\":true,\"feedback\":\"Proceed with the scoped refactor.\"}",
|
||||
"annotation": "Approval is correlated by request ID and cannot carry into a different assignment."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "plan_approval_response(request_id=req_000007, approve=true) -> backend",
|
||||
"annotation": "The teammate receives the typed response before mutating tools are released."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
@@ -84,7 +101,7 @@
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "backend -> Lead: result(auth refactor complete) -> idle_notification",
|
||||
"annotation": "Result and idle state are separate events; the teammate remains available."
|
||||
"annotation": "The task directory stays selected through the completion turn, then IDLE releases the assignment."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
|
||||
@@ -62,9 +62,14 @@
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "bash",
|
||||
"content": "{\"command\":\"npm run lint && npm run test\",\"run_in_background\":true}",
|
||||
"content": "{\"command\":\"python -m unittest tests.test_agent_teams_runtime\",\"run_in_background\":true}",
|
||||
"annotation": "Long-running validation goes through the background task path."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "permission: user approved the exact test command",
|
||||
"annotation": "Team confirmation does not authorize shell execution; the foreground turn asks separately before dispatch."
|
||||
},
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "connect_mcp",
|
||||
@@ -85,7 +90,7 @@
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "recover: background task done, teammate replied, deploy status result appended",
|
||||
"content": "task_notification(status=completed): tests passed; teammate result and deploy status appended",
|
||||
"annotation": "The integrated runtime folds asynchronous results back into the loop."
|
||||
},
|
||||
{
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
{
|
||||
"type": "tool_call",
|
||||
"toolName": "Workflow",
|
||||
"content": "{\"name\":\"review-changes\",\"description\":\"Review changed files across dimensions and verify each finding\",\"phases\":[\"Review\",\"Verify\"]}",
|
||||
"annotation": "One tool call hands deterministic orchestration to the workflow runtime."
|
||||
"content": "{\"name\":\"review-changes\",\"args\":{\"budget\":null}}",
|
||||
"annotation": "The model selects a saved workflow and arguments; the host registry supplies its trusted metadata and script."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "async_launched(runId=wf_review-changes_6779) -> task_started",
|
||||
"content": "async_launched(runId=wf_review-changes_0000000000001a7b) -> task_started",
|
||||
"annotation": "The runtime emits launch lifecycle events before it executes the script; this is not a tool result."
|
||||
},
|
||||
{
|
||||
@@ -36,19 +36,19 @@
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "task_notification(status=completed, outputFile=.runtime/wf_review-changes_6779.output.json)",
|
||||
"content": "task_notification(status=completed, outputFile=.runtime/wf_review-changes_0000000000001a7b.output.json)",
|
||||
"annotation": "The task emits its final lifecycle event after output is written."
|
||||
},
|
||||
{
|
||||
"type": "tool_result",
|
||||
"toolName": "Workflow",
|
||||
"content": "{\"launched\":{\"status\":\"async_launched\",\"runId\":\"wf_review-changes_6779\"},\"result\":{\"confirmed\":[]},\"task\":{\"status\":\"completed\"}}",
|
||||
"annotation": "The completed call returns once, with launch metadata, the workflow result, and task state together."
|
||||
"content": "{\"launched\":{\"status\":\"async_launched\",\"taskId\":\"local_workflow_wf_review-changes_0000000000001a7b\",\"taskType\":\"local_workflow\",\"runId\":\"wf_review-changes_0000000000001a7b\",\"workflowName\":\"review-changes\"},\"result\":{\"confirmed\":[{\"dimension\":\"security\",\"title\":\"audit:security #1\",\"severity\":\"high\"},{\"dimension\":\"style\",\"title\":\"audit:style #1\",\"severity\":\"high\"},{\"dimension\":\"security\",\"title\":\"audit:security #2\",\"severity\":\"medium\"},{\"dimension\":\"performance\",\"title\":\"audit:performance #2\",\"severity\":\"medium\"},{\"dimension\":\"correctness\",\"title\":\"audit:correctness #1\",\"severity\":\"low\"},{\"dimension\":\"performance\",\"title\":\"audit:performance #1\",\"severity\":\"low\"}]},\"task\":{\"taskId\":\"local_workflow_wf_review-changes_0000000000001a7b\",\"taskType\":\"local_workflow\",\"runId\":\"wf_review-changes_0000000000001a7b\",\"workflowName\":\"review-changes\",\"status\":\"completed\",\"usage\":{\"agents\":11,\"tokens\":352},\"progress\":[{\"type\":\"workflow_phase\",\"title\":\"Review\"},{\"type\":\"workflow_agent\",\"label\":\"audit:correctness\",\"phase\":\"Review\",\"status\":\"done\"},{\"type\":\"workflow_phase\",\"title\":\"Verify\"},{\"type\":\"workflow_agent\",\"label\":\"audit:security\",\"phase\":\"Review\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"audit:performance\",\"phase\":\"Review\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"audit:style\",\"phase\":\"Review\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:correctness:audit:correctness #1\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:security:audit:security #1\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:security:audit:security #2\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:performance:audit:performance #1\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:performance:audit:performance #2\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:style:audit:style #1\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_agent\",\"label\":\"verify:style:audit:style #2\",\"phase\":\"Verify\",\"status\":\"done\"},{\"type\":\"workflow_log\",\"message\":\"confirmed 6 real finding(s)\"}]}}",
|
||||
"annotation": "The deterministic sample returns its six fixture findings and measured runner usage; these are not claims about the repository."
|
||||
},
|
||||
{
|
||||
"type": "system_event",
|
||||
"content": "append Workflow tool_result -> messages[]",
|
||||
"annotation": "The main loop receives that single result and continues with the updated conversation."
|
||||
"annotation": "A main-loop integration can append this JSON-safe result and continue with the updated conversation."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user