@fitlab-ai/agent-infra 0.9.2 → 0.9.4
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/README.md +12 -9
- package/README.zh-CN.md +12 -9
- package/bin/cli.ts +12 -0
- package/dist/bin/cli.js +14 -0
- package/dist/bin/internal-cli.js +134 -108
- package/dist/lib/agent-clients/adapter.js +137 -4
- package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
- package/dist/lib/{sandbox/credentials.js → agent-clients/adapters/claude-code-credentials.js} +4 -14
- package/dist/lib/agent-clients/adapters/claude-code-refresh.js +85 -0
- package/dist/lib/agent-clients/adapters/claude-code-sandbox.js +247 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +27 -4
- package/dist/lib/agent-clients/adapters/codex.js +9 -0
- package/dist/lib/agent-clients/adapters/index.js +2 -2
- package/dist/lib/agent-clients/adapters/opencode-sandbox.js +108 -0
- package/dist/lib/agent-clients/adapters/opencode.js +24 -3
- package/dist/lib/agent-clients/adapters/runtimes/claude-code.dockerfile +65 -0
- package/dist/lib/agent-clients/config.js +42 -4
- package/dist/lib/agent-clients/next-steps.js +11 -2
- package/dist/lib/agent-clients/reconcile.js +2 -1
- package/dist/lib/agent-clients/registry.js +16 -2
- package/dist/lib/agent-clients/schema.js +18 -0
- package/dist/lib/agent-clients/tokens.js +49 -0
- package/dist/lib/agent-clients/types.js +1 -1
- package/dist/lib/defaults.json +1 -1
- package/dist/lib/git/workflow.js +54 -1
- package/dist/lib/internal/agent-client.js +61 -4
- package/dist/lib/internal/git-workflow.js +6 -1
- package/dist/lib/internal/platform-checks.js +3 -3
- package/dist/lib/internal/platform-comment.js +29 -2
- package/dist/lib/internal/platform-issue.js +7 -0
- package/dist/lib/internal/platform-pr-review.js +132 -0
- package/dist/lib/internal/platform-pr.js +20 -2
- package/dist/lib/internal/platform-release-notes.js +52 -16
- package/dist/lib/internal/pr-review-grade.js +140 -0
- package/dist/lib/internal/release-workflow.js +13 -6
- package/dist/lib/internal/sandbox-control.js +24 -0
- package/dist/lib/internal/task-activity.js +105 -0
- package/dist/lib/internal/task-event.js +17 -1
- package/dist/lib/internal/task-ledger.js +12 -3
- package/dist/lib/internal/task-lifecycle.js +26 -1
- package/dist/lib/internal/task-orchestration.js +167 -18
- package/dist/lib/internal/task-review.js +8 -3
- package/dist/lib/platform/adapters.js +8 -1
- package/dist/lib/platform/completion-backfill.js +122 -0
- package/dist/lib/platform/github-client.js +19 -2
- package/dist/lib/platform/issue-comments.js +3 -2
- package/dist/lib/platform/merged-pr-equivalence.js +115 -5
- package/dist/lib/platform/pr-checks.js +65 -42
- package/dist/lib/platform/pr-review.js +166 -0
- package/dist/lib/platform/pull-requests.js +371 -4
- package/dist/lib/platform/release-notes.js +85 -3
- package/dist/lib/platform/releases.js +13 -5
- package/dist/lib/pr-review/evidence-grading.js +229 -0
- package/dist/lib/process-data/index.js +239 -0
- package/dist/lib/process-data/normalize.js +198 -0
- package/dist/lib/process-data/privacy.js +33 -0
- package/dist/lib/process-data/reconcile.js +95 -0
- package/dist/lib/process-data/repair.js +58 -0
- package/dist/lib/process-data/sources.js +345 -0
- package/dist/lib/process-data/store.js +282 -0
- package/dist/lib/process-data/types.js +2 -0
- package/dist/lib/run/index.js +4 -3
- package/dist/lib/run/tui.js +10 -13
- package/dist/lib/sandbox/agent-client-reconciler.js +26 -2
- package/dist/lib/sandbox/capture.js +7 -2
- package/dist/lib/sandbox/commands/create.js +109 -248
- package/dist/lib/sandbox/commands/enter.js +15 -47
- package/dist/lib/sandbox/commands/list-running.js +16 -6
- package/dist/lib/sandbox/commands/ls.js +10 -6
- package/dist/lib/sandbox/commands/rebuild.js +4 -3
- package/dist/lib/sandbox/commands/refresh.js +4 -84
- package/dist/lib/sandbox/commands/rm.js +24 -3
- package/dist/lib/sandbox/commands/show.js +13 -4
- package/dist/lib/sandbox/commands/start.js +7 -4
- package/dist/lib/sandbox/config.js +2 -0
- package/dist/lib/sandbox/constants.js +6 -0
- package/dist/lib/sandbox/control/client.js +44 -0
- package/dist/lib/sandbox/control/protocol.js +35 -0
- package/dist/lib/sandbox/control/server.js +109 -0
- package/dist/lib/sandbox/dockerfile.js +36 -13
- package/dist/lib/sandbox/mounts.js +17 -4
- package/dist/lib/sandbox/recovery.js +128 -5
- package/dist/lib/sandbox/redaction.js +12 -0
- package/dist/lib/sandbox/runtimes/base.dockerfile +24 -74
- package/dist/lib/sandbox/workspace-identity.js +95 -0
- package/dist/lib/sandbox/workspace-view.js +103 -0
- package/dist/lib/task/activity-intent.js +307 -0
- package/dist/lib/task/artifact-lifecycle.js +2 -1
- package/dist/lib/task/commands/log.js +15 -14
- package/dist/lib/task/commit-finalization.js +267 -0
- package/dist/lib/task/commit-intent.js +165 -0
- package/dist/lib/task/decision-intents.js +31 -17
- package/dist/lib/task/delegation-receipts.js +25 -4
- package/dist/lib/task/events.js +67 -28
- package/dist/lib/task/finalization-artifacts.js +35 -0
- package/dist/lib/task/implementation-inputs.js +54 -7
- package/dist/lib/task/ledger-intents.js +35 -1
- package/dist/lib/task/lifecycle-execution.js +46 -0
- package/dist/lib/task/orchestration.js +753 -54
- package/dist/lib/task/resolve-ref.js +41 -1
- package/dist/lib/task/review-finalization.js +29 -9
- package/dist/lib/task/task-execution-lock.js +231 -0
- package/dist/lib/task/verification-checks.js +1 -1
- package/dist/lib/task/verification-engine.js +218 -2
- package/dist/lib/task/verification.js +4 -3
- package/dist/lib/task/workspace-snapshot.js +17 -5
- package/lib/agent-clients/adapter.ts +201 -4
- package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
- package/lib/{sandbox/credentials.ts → agent-clients/adapters/claude-code-credentials.ts} +3 -18
- package/lib/agent-clients/adapters/claude-code-refresh.ts +128 -0
- package/lib/agent-clients/adapters/claude-code-sandbox.ts +295 -0
- package/lib/agent-clients/adapters/claude-code.ts +31 -4
- package/lib/agent-clients/adapters/codex.ts +9 -0
- package/lib/agent-clients/adapters/index.ts +2 -2
- package/lib/agent-clients/adapters/opencode-sandbox.ts +136 -0
- package/lib/agent-clients/adapters/opencode.ts +27 -3
- package/lib/agent-clients/adapters/runtimes/claude-code.dockerfile +65 -0
- package/lib/agent-clients/config.ts +49 -4
- package/lib/agent-clients/next-steps.ts +15 -2
- package/lib/agent-clients/reconcile.ts +2 -1
- package/lib/agent-clients/registry.ts +19 -1
- package/lib/agent-clients/schema.ts +18 -0
- package/lib/agent-clients/tokens.ts +53 -0
- package/lib/agent-clients/types.ts +15 -1
- package/lib/defaults.json +1 -1
- package/lib/git/workflow.ts +66 -2
- package/lib/internal/agent-client.ts +59 -4
- package/lib/internal/git-workflow.ts +5 -1
- package/lib/internal/platform-checks.ts +4 -4
- package/lib/internal/platform-comment.ts +17 -2
- package/lib/internal/platform-issue.ts +4 -0
- package/lib/internal/platform-pr-review.ts +104 -0
- package/lib/internal/platform-pr.ts +14 -1
- package/lib/internal/platform-release-notes.ts +59 -16
- package/lib/internal/pr-review-grade.ts +130 -0
- package/lib/internal/release-workflow.ts +13 -6
- package/lib/internal/sandbox-control.ts +24 -0
- package/lib/internal/task-activity.ts +91 -0
- package/lib/internal/task-event.ts +9 -1
- package/lib/internal/task-ledger.ts +12 -3
- package/lib/internal/task-lifecycle.ts +26 -1
- package/lib/internal/task-orchestration.ts +123 -14
- package/lib/internal/task-review.ts +8 -3
- package/lib/platform/adapters.ts +29 -2
- package/lib/platform/completion-backfill.ts +134 -0
- package/lib/platform/github-client.ts +20 -2
- package/lib/platform/issue-comments.ts +3 -2
- package/lib/platform/merged-pr-equivalence.ts +127 -5
- package/lib/platform/pr-checks.ts +73 -46
- package/lib/platform/pr-review.ts +201 -0
- package/lib/platform/pull-requests.ts +444 -3
- package/lib/platform/release-notes.ts +100 -4
- package/lib/platform/releases.ts +16 -4
- package/lib/pr-review/evidence-grading.ts +318 -0
- package/lib/process-data/index.ts +224 -0
- package/lib/process-data/normalize.ts +202 -0
- package/lib/process-data/privacy.ts +41 -0
- package/lib/process-data/reconcile.ts +110 -0
- package/lib/process-data/repair.ts +64 -0
- package/lib/process-data/sources.ts +354 -0
- package/lib/process-data/store.ts +315 -0
- package/lib/process-data/types.ts +135 -0
- package/lib/run/index.ts +5 -3
- package/lib/run/tui.ts +14 -12
- package/lib/sandbox/agent-client-reconciler.ts +44 -2
- package/lib/sandbox/capture.ts +9 -2
- package/lib/sandbox/commands/create.ts +126 -280
- package/lib/sandbox/commands/enter.ts +13 -59
- package/lib/sandbox/commands/list-running.ts +23 -6
- package/lib/sandbox/commands/ls.ts +22 -6
- package/lib/sandbox/commands/rebuild.ts +4 -3
- package/lib/sandbox/commands/refresh.ts +4 -126
- package/lib/sandbox/commands/rm.ts +24 -3
- package/lib/sandbox/commands/show.ts +30 -4
- package/lib/sandbox/commands/start.ts +6 -4
- package/lib/sandbox/config.ts +4 -0
- package/lib/sandbox/constants.ts +8 -0
- package/lib/sandbox/control/client.ts +55 -0
- package/lib/sandbox/control/protocol.ts +75 -0
- package/lib/sandbox/control/server.ts +117 -0
- package/lib/sandbox/dockerfile.ts +66 -13
- package/lib/sandbox/mounts.ts +24 -4
- package/lib/sandbox/recovery.ts +163 -6
- package/lib/sandbox/redaction.ts +14 -0
- package/lib/sandbox/runtimes/base.dockerfile +24 -74
- package/lib/sandbox/tool-types.ts +16 -0
- package/lib/sandbox/workspace-identity.ts +123 -0
- package/lib/sandbox/workspace-view.ts +143 -0
- package/lib/server/server.schema.json +2 -2
- package/lib/task/activity-intent.ts +417 -0
- package/lib/task/artifact-lifecycle.ts +2 -1
- package/lib/task/commands/log.ts +15 -14
- package/lib/task/commit-finalization.ts +356 -0
- package/lib/task/commit-intent.ts +230 -0
- package/lib/task/decision-intents.ts +32 -12
- package/lib/task/delegation-receipts.ts +34 -5
- package/lib/task/events.ts +75 -30
- package/lib/task/finalization-artifacts.ts +58 -0
- package/lib/task/implementation-inputs.ts +62 -8
- package/lib/task/ledger-intents.ts +43 -3
- package/lib/task/lifecycle-execution.ts +106 -0
- package/lib/task/orchestration.ts +1019 -72
- package/lib/task/resolve-ref.ts +46 -1
- package/lib/task/review-finalization.ts +40 -9
- package/lib/task/task-execution-lock.ts +296 -0
- package/lib/task/verification-checks.ts +1 -1
- package/lib/task/verification-engine.ts +249 -2
- package/lib/task/verification.ts +5 -3
- package/lib/task/workspace-snapshot.ts +26 -5
- package/package.json +3 -3
- package/templates/.agents/QUICKSTART.en.md +25 -8
- package/templates/.agents/QUICKSTART.zh-CN.md +25 -8
- package/templates/.agents/README.en.md +10 -7
- package/templates/.agents/README.zh-CN.md +10 -7
- package/templates/.agents/hooks/lifecycle-delegation.js +15 -4
- package/templates/.agents/rules/README.en.md +1 -1
- package/templates/.agents/rules/README.zh-CN.md +1 -1
- package/templates/.agents/rules/create-issue.github.en.md +4 -2
- package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -2
- package/templates/.agents/rules/human-decision-context.en.md +11 -2
- package/templates/.agents/rules/human-decision-context.zh-CN.md +11 -2
- package/templates/.agents/rules/issue-fields.github.en.md +3 -1
- package/templates/.agents/rules/issue-fields.github.zh-CN.md +3 -1
- package/templates/.agents/rules/issue-pr-commands.en.md +5 -3
- package/templates/.agents/rules/issue-pr-commands.github.en.md +5 -3
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +5 -3
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -3
- package/templates/.agents/rules/issue-sync.github.en.md +7 -3
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +8 -4
- package/templates/.agents/rules/lifecycle-orchestration.en.md +5 -2
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +5 -2
- package/templates/.agents/rules/milestone-inference.github.en.md +4 -2
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -2
- package/templates/.agents/rules/next-step-output.en.md +3 -1
- package/templates/.agents/rules/next-step-output.zh-CN.md +3 -1
- package/templates/.agents/rules/no-mid-flow-questions.en.md +17 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +17 -0
- package/templates/.agents/rules/pr-checks-commands.en.md +3 -3
- package/templates/.agents/rules/pr-checks-commands.github.en.md +2 -2
- package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +3 -3
- package/templates/.agents/rules/pr-checks-commands.zh-CN.md +3 -3
- package/templates/.agents/rules/pr-sync.en.md +3 -1
- package/templates/.agents/rules/pr-sync.github.en.md +11 -1
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +11 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +3 -1
- package/templates/.agents/rules/release-commands.en.md +1 -1
- package/templates/.agents/rules/release-commands.github.en.md +12 -2
- package/templates/.agents/rules/release-commands.github.zh-CN.md +12 -2
- package/templates/.agents/rules/release-commands.zh-CN.md +1 -1
- package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
- package/templates/.agents/rules/task-management.en.md +13 -0
- package/templates/.agents/rules/task-management.zh-CN.md +13 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +10 -7
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +10 -7
- package/templates/.agents/skills/block-task/SKILL.en.md +7 -5
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +7 -5
- package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -4
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +6 -4
- package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +10 -7
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +12 -9
- package/templates/.agents/skills/commit/SKILL.en.md +23 -11
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +29 -11
- package/templates/.agents/skills/commit/reference/commit-message.en.md +1 -1
- package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +49 -0
- package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +55 -0
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
- package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +4 -4
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +4 -4
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +6 -4
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +6 -4
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +22 -7
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +22 -7
- package/templates/.agents/skills/complete-task/config/verify.en.json +1 -0
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +17 -0
- package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +17 -0
- package/templates/.agents/skills/create-pr/SKILL.en.md +7 -5
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +7 -5
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
- package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -16
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +17 -16
- package/templates/.agents/skills/create-task/SKILL.en.md +5 -3
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/create-task/reference/context-capture.en.md +34 -0
- package/templates/.agents/skills/create-task/reference/context-capture.zh-CN.md +34 -0
- package/templates/.agents/skills/import-issue/SKILL.en.md +5 -3
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/plan-task/SKILL.en.md +8 -5
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +8 -5
- package/templates/.agents/skills/post-release/SKILL.en.md +2 -0
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +2 -0
- package/templates/.agents/skills/release/SKILL.en.md +16 -10
- package/templates/.agents/skills/release/SKILL.zh-CN.md +16 -10
- package/templates/.agents/skills/restore-task/SKILL.en.md +4 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +7 -4
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +7 -4
- package/templates/.agents/skills/review-code/SKILL.en.md +11 -8
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +11 -8
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +1 -1
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +1 -1
- package/templates/.agents/skills/review-plan/SKILL.en.md +7 -4
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +7 -4
- package/templates/.agents/skills/review-pr/SKILL.en.md +186 -0
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +186 -0
- package/templates/.agents/skills/review-pr/config/verify.en.json +37 -0
- package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +37 -0
- package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +65 -0
- package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +65 -0
- package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +18 -0
- package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +18 -0
- package/templates/.agents/skills/review-pr/reference/report-template.en.md +85 -0
- package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +85 -0
- package/templates/.agents/skills/run-task/SKILL.en.md +8 -8
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/run-task/config/verify.en.json +2 -1
- package/templates/.agents/skills/run-task/config/verify.zh-CN.json +2 -1
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +20 -0
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +20 -0
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +98 -107
- package/templates/.agents/skills/watch-pr/SKILL.en.md +13 -13
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +13 -13
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +27 -6
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +26 -5
- package/templates/.agents/templates/task.en.md +2 -2
- package/templates/.agents/templates/task.zh-CN.md +2 -2
- package/templates/.agents/workflows/bug-fix.en.yaml +3 -3
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +3 -3
- package/templates/.agents/workflows/code-review.en.yaml +1 -1
- package/templates/.agents/workflows/code-review.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/feature-development.en.yaml +4 -4
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +4 -4
- package/templates/.agents/workflows/refactoring.en.yaml +3 -3
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +3 -3
- package/templates/.claude/commands/post-release.en.md +1 -0
- package/templates/.claude/commands/post-release.zh-CN.md +1 -0
- package/templates/.claude/commands/review-pr.en.md +8 -0
- package/templates/.claude/commands/review-pr.zh-CN.md +8 -0
- package/templates/.claude/commands/watch-pr.en.md +1 -1
- package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
- package/templates/.claude/rules/tool-preferences.en.md +20 -0
- package/templates/.claude/rules/tool-preferences.zh-CN.md +20 -0
- package/templates/.opencode/commands/post-release.en.md +2 -0
- package/templates/.opencode/commands/post-release.zh-CN.md +2 -0
- package/templates/.opencode/commands/review-pr.en.md +11 -0
- package/templates/.opencode/commands/review-pr.zh-CN.md +11 -0
- package/templates/.opencode/commands/watch-pr.en.md +1 -1
- package/templates/.opencode/commands/watch-pr.zh-CN.md +1 -1
- package/dist/lib/agent-clients/adapters/gemini-cli.js +0 -64
- package/lib/agent-clients/adapters/gemini-cli.ts +0 -65
- package/templates/.gemini/commands/_project_/analyze-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/archive-tasks.en.toml +0 -10
- package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/block-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/cancel-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/cancel-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/check-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/close-codescan.en.toml +0 -8
- package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/close-dependabot.en.toml +0 -8
- package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/code-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/commit.en.toml +0 -10
- package/templates/.gemini/commands/_project_/commit.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/create-pr.en.toml +0 -10
- package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/create-release-note.en.toml +0 -8
- package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/create-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/import-codescan.en.toml +0 -8
- package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/import-dependabot.en.toml +0 -8
- package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/import-issue.en.toml +0 -8
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/init-labels.en.toml +0 -8
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/init-milestones.en.toml +0 -10
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/plan-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/post-release.en.toml +0 -6
- package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/refine-title.en.toml +0 -8
- package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/release.en.toml +0 -8
- package/templates/.gemini/commands/_project_/release.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/restore-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/review-analysis.en.toml +0 -10
- package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/review-code.en.toml +0 -10
- package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/review-plan.en.toml +0 -10
- package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/run-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/test-integration.en.toml +0 -6
- package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/test.en.toml +0 -6
- package/templates/.gemini/commands/_project_/test.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/update-agent-infra.en.toml +0 -6
- package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/upgrade-dependency.en.toml +0 -8
- package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/watch-pr.en.toml +0 -10
- package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +0 -10
- package/templates/.gemini/settings.json +0 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# 证据分级参考
|
|
2
|
+
|
|
3
|
+
本文件固化 `review-pr` 的证据分级主决策流。判定全部由 typed core 纯函数(`lib/pr-review/evidence-grading.ts`)机械执行,skill 提示词层只做编排;本文件用于解释判据与理由,不替代 core。
|
|
4
|
+
|
|
5
|
+
## 主决策流
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
解析 PR base/head 与关联 Issue/task(宿主解析)
|
|
9
|
+
├─ 唯一宿主 → 绑定任务,枚举 artifact 存在性 → 证据分类
|
|
10
|
+
├─ 多宿主歧义 → fail closed(decide 拒绝分类,要求人工指定)
|
|
11
|
+
└─ 无宿主 → 默认阻塞要求关联;显式一次性检视 → reviews/{pr-number}/
|
|
12
|
+
↓
|
|
13
|
+
证据场景分类(S1/S2/S3)→ 新鲜度/对齐 → 风险分级 → 模式选择
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 宿主解析
|
|
17
|
+
|
|
18
|
+
- 唯一命中 → `unique`;多个且无法唯一 → `ambiguous`(候选列表);零命中 → `none`。
|
|
19
|
+
- 多宿主歧义即 fail closed:不进入证据分类;由 `pr-review-grade resolve-host --pr <N>` 返回 typed `HostResolution`,`decide` 对 `ambiguous` 显式拒绝。
|
|
20
|
+
- PR body 的 `Closes/Fixes #N`(大小写不敏感、逗号/空格分隔、支持列表)经 `extractClosingIssueNumbers` 解析;本地 `active/*/task.md` 的 `pr_number` 命中优先于 `issue_number` 反查,同一任务经两条路径命中按单候选去重。
|
|
21
|
+
|
|
22
|
+
## 证据场景分类(S1 → S2 → S3)
|
|
23
|
+
|
|
24
|
+
| 场景 | 判据 |
|
|
25
|
+
|------|------|
|
|
26
|
+
| S1 完整可信 | 唯一任务且 issue_number 与远端一致 + `analysis`/`plan`/`code` 及三族 review 齐全 + 最新 `pr-review*` 被审 head == 当前 head + 来源受信 |
|
|
27
|
+
| S2 部分/可疑 | 任务存在但 artifact 缺失关键产物,或 head 漂移,或来源不可信 / 无法证明与当前 head 对齐 |
|
|
28
|
+
| S3 仅 PR | 无宿主;或任务唯一但无任何生命周期 artifact 且无先前 `pr-review*` |
|
|
29
|
+
|
|
30
|
+
- S3(b) 判据(对称口径):`!hasAnalysis && !hasPlan && !hasCode && !hasReviewAnalysis && !hasReviewPlan && !hasReviewCode && !hasPriorPrReview`。仅含任一 review 产物(review-analysis / review-plan / review-code)的畸形任务落 S2 → audit。
|
|
31
|
+
- 首次审查(无先前 `pr-review*`)时 S1(c) 不满足,完整生命周期任务落入 S2 → audit。
|
|
32
|
+
|
|
33
|
+
## 新鲜度与对齐
|
|
34
|
+
|
|
35
|
+
- 新鲜度基准 = 上一轮 `pr-review*` 记录的被审 head SHA,与当前 head 逐字符比对:一致 → `fresh`,否则 → `stale`。
|
|
36
|
+
- 对齐 = freshness 为 fresh 且 `issue_number` / `pr_number` 与解析结果一致。
|
|
37
|
+
- 无先前 `pr-review*` → `n/a` / `n/a`(首轮特例)。
|
|
38
|
+
|
|
39
|
+
## 风险分级(纯证据口径)
|
|
40
|
+
|
|
41
|
+
| 因素 | LOW | HIGH |
|
|
42
|
+
|------|-----|------|
|
|
43
|
+
| 变更规模 | 文件少、净增行少 | 文件多、净增行大 |
|
|
44
|
+
| 变更敏感度 | 未触及受保护路径 | 触及 lifecycle / rule / skill / config / 安全 / 认证 / 幂等 / 并发路径 |
|
|
45
|
+
| 结构性变更 | 无 schema/frontmatter/迁移/接口契约变化 | 涉及 schema / frontmatter / 迁移 / 接口契约 |
|
|
46
|
+
| 测试覆盖 | 有配套测试且可通过 | 无测试或测试缺失/不可通过 |
|
|
47
|
+
| 证据来源可信度 | 存在可复核的受信生命周期且与当前 head 对齐 | 无受信记录,或来源不可复核 |
|
|
48
|
+
| 恢复/合并影响 | 不影响可恢复契约 | 可能破坏可恢复契约或形成双写真源 |
|
|
49
|
+
|
|
50
|
+
聚合:任一优先因素(敏感度 / 证据来源可信度)HIGH → HIGH;否则任一 HIGH → MEDIUM;全 LOW → LOW。身份因素不参与任何因素判定。
|
|
51
|
+
|
|
52
|
+
## 模式选择矩阵
|
|
53
|
+
|
|
54
|
+
| 证据场景 | 新鲜度/对齐 | 风险 | 模式 |
|
|
55
|
+
|----------|-------------|------|------|
|
|
56
|
+
| S1 | fresh + aligned | LOW/MEDIUM | verify(轻量复核) |
|
|
57
|
+
| S1 | fresh + aligned | HIGH | audit(证据审计) |
|
|
58
|
+
| S2 | stale / misaligned / 部分缺失 | 任意 | audit |
|
|
59
|
+
| S3 | n/a | 任意 | reconstruct(重建式审查) |
|
|
60
|
+
|
|
61
|
+
首次对完整生命周期任务运行 `review-pr` 因无先前 head 记录落入 S2 → audit;「已有可信生命周期记录 → verify」对应「存在上轮 `pr-review*` 且 head 未漂移」的再审查场景。
|
|
62
|
+
|
|
63
|
+
## 最低充分重建
|
|
64
|
+
|
|
65
|
+
模式为 `reconstruct`(或 `audit` 证据不足)时,在行级审查前形成重建记录,至少覆盖:需求边界、架构选择、影响面、验证覆盖;顺序保证「重建上下文 → 覆盖矩阵 → 行级 finding」。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Output Guidance
|
|
2
|
+
|
|
3
|
+
Read this file and `.agents/rules/next-step-output.md` before presenting the final result to the user. `review-pr` has exactly three exits; pick exactly one based on the run outcome.
|
|
4
|
+
|
|
5
|
+
## Exit Selection
|
|
6
|
+
|
|
7
|
+
| Exit | Trigger | Present |
|
|
8
|
+
|------|---------|---------|
|
|
9
|
+
| A Published | the formal Review was published (applied/no-op) and verification passed | conclusion, mode, reviewed head SHA, Review URL, receipt, next step |
|
|
10
|
+
| B Blocked, requires linking | `resolve-host` returned none or ambiguous | linking guidance (create/link an Issue and task); do not auto-create an Issue; or explicitly choose the one-shot review |
|
|
11
|
+
| C One-shot review | the user explicitly chose a "one-shot review" | non-recoverable notice, artifact directory `.agents/workspace/reviews/{pr-number}/`, Review URL |
|
|
12
|
+
|
|
13
|
+
## Presentation Requirements
|
|
14
|
+
|
|
15
|
+
- On publish (exit A) report: review mode (verify/audit/reconstruct), evidence scenario (S1/S2/S3), reviewed head SHA, finding count, formal Review URL, receipt.
|
|
16
|
+
- On block (exit B) provide concrete commands/steps to establish the link; if `resolve-host` returned `ambiguous`, list the candidate tasks and ask a human to pin the host.
|
|
17
|
+
- On one-shot (exit C) state clearly `recoverable: false` and make no recovery promise.
|
|
18
|
+
- Read `.agents/rules/next-step-output.md` before rendering the next step, and generate the "next step" command per its convention.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 输出指引
|
|
2
|
+
|
|
3
|
+
向用户呈现最终结果前先读取本文件与 `.agents/rules/next-step-output.md`。`review-pr` 有且仅有三个出口,按本次运行结果选一个,不要输出多个。
|
|
4
|
+
|
|
5
|
+
## 出口选择
|
|
6
|
+
|
|
7
|
+
| 出口 | 触发条件 | 呈现内容 |
|
|
8
|
+
|------|----------|----------|
|
|
9
|
+
| A 正常发布 | 正式 Review 已发布(applied/no-op)且校验通过 | 结论、模式、被审 head SHA、Review URL、receipt、下一步 |
|
|
10
|
+
| B 阻塞要求关联 | `resolve-host` 返回 none 或 ambiguous | 关联指引(创建/关联 Issue 与 task),不自动创建 Issue;或显式选择一次性检视 |
|
|
11
|
+
| C 一次性检视 | 用户显式选择「仅一次性检视」 | 不可恢复提示、产物目录 `.agents/workspace/reviews/{pr-number}/`、Review URL |
|
|
12
|
+
|
|
13
|
+
## 呈现要求
|
|
14
|
+
|
|
15
|
+
- 正常发布(出口 A)时报告:审查模式(verify/audit/reconstruct)、证据场景(S1/S2/S3)、被审 head SHA、finding 总数、正式 Review URL、receipt。
|
|
16
|
+
- 阻塞(出口 B)时给出建立关联的具体命令或步骤;如果 `resolve-host` 返回 ambiguous,列出候选任务并要求人工指定。
|
|
17
|
+
- 一次性检视(出口 C)明确 `recoverable: false`,不承诺可恢复。
|
|
18
|
+
- 渲染下一步前读取 `.agents/rules/next-step-output.md`,并按其中的「下一步」命令约定生成。
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# PR Review Report Template
|
|
2
|
+
|
|
3
|
+
Use the following structure when creating `pr-review.md` or `pr-review-r{N}.md`.
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# PR Review Report
|
|
7
|
+
|
|
8
|
+
- **Review Round**: Round {round}
|
|
9
|
+
- **Artifact File**: `pr-review.md` / `pr-review-r{N}.md`
|
|
10
|
+
- **Recoverable**: true (task-anchored path) / false (one-shot path)
|
|
11
|
+
|
|
12
|
+
## State Check
|
|
13
|
+
|
|
14
|
+
> Paste the state-check command output verbatim; each command starts with `$ `.
|
|
15
|
+
|
|
16
|
+
## Identity
|
|
17
|
+
|
|
18
|
+
- **PR Number**: {pr-number}
|
|
19
|
+
- **Base Branch**: {base-ref} (SHA `{base-sha}`)
|
|
20
|
+
- **Head Branch**: {head-ref}
|
|
21
|
+
- **Reviewed Head SHA**: {40 hex}
|
|
22
|
+
- **Linked Issue**: {issue-number or N/A}
|
|
23
|
+
- **Linked Task**: {task-id or N/A}
|
|
24
|
+
- **Task Directory**: {task-dir or N/A}
|
|
25
|
+
|
|
26
|
+
## Evidence List
|
|
27
|
+
|
|
28
|
+
- **Host Resolution**: `unique` / `ambiguous` / `none`
|
|
29
|
+
- **Evidence Scenario**: S{1|2|3}
|
|
30
|
+
- **Freshness**: `fresh` / `stale` / `n/a`
|
|
31
|
+
- **Alignment**: `aligned` / `misaligned` / `n/a`
|
|
32
|
+
- **Review Mode**: `verify` / `audit` / `reconstruct`
|
|
33
|
+
- **Risk Level**: `LOW` / `MEDIUM` / `HIGH`
|
|
34
|
+
- **First Review**: true / false
|
|
35
|
+
- **receipt**: {receipt}
|
|
36
|
+
- **Decision Input and Output**: paste the full `pr-review-grade decide` input JSON and the output DecisionRecord (the decision input includes host, artifact presence, head state, and the six risk factors).
|
|
37
|
+
|
|
38
|
+
### Reconstruction Context (reconstruct / audit with insufficient evidence)
|
|
39
|
+
|
|
40
|
+
Land the following in order before the line-level findings, without impersonating a standard lifecycle artifact:
|
|
41
|
+
|
|
42
|
+
1. **Requirement boundary**: what the PR does and does not do.
|
|
43
|
+
2. **Architecture choices**: key technical paths and trade-offs.
|
|
44
|
+
3. **Impact surface**: modules / rules / contracts touched.
|
|
45
|
+
4. **Validation coverage**: what tests should exist and whether current tests cover them.
|
|
46
|
+
|
|
47
|
+
## Coverage Matrix
|
|
48
|
+
|
|
49
|
+
| Review Surface | Evidence | Conclusion | Uncovered / Gap |
|
|
50
|
+
|----------------|----------|------------|-----------------|
|
|
51
|
+
| Requirement boundary | {evidence} | {conclusion} | {gap} |
|
|
52
|
+
| Architecture choices | {evidence} | {conclusion} | {gap} |
|
|
53
|
+
| Impact surface | {evidence} | {conclusion} | {gap} |
|
|
54
|
+
| Validation coverage | {evidence} | {conclusion} | {gap} |
|
|
55
|
+
|
|
56
|
+
## Findings
|
|
57
|
+
|
|
58
|
+
### Blockers (must fix)
|
|
59
|
+
|
|
60
|
+
- **{title}**: {description} · `{file}:{line}` · Evidence: {evidence} · Impact: {impact} · Suggestion: {suggestion}
|
|
61
|
+
|
|
62
|
+
### Major (should fix)
|
|
63
|
+
|
|
64
|
+
- **{title}**: {description} · `{file}:{line}` · Evidence: {evidence} · Impact: {impact} · Suggestion: {suggestion}
|
|
65
|
+
|
|
66
|
+
### Minor (low impact, close the loop)
|
|
67
|
+
|
|
68
|
+
- **{title}**: {description} · `{file}:{line}` · Evidence: {evidence} · Impact: {impact} · Suggestion: {suggestion}
|
|
69
|
+
|
|
70
|
+
## Publication Result
|
|
71
|
+
|
|
72
|
+
- **Formal Review Status**: {pending / applied / no-op / aborted / superseded / blocked / failed}
|
|
73
|
+
- **Review ID**: {review-id or N/A}
|
|
74
|
+
- **Review URL**: {review-url or N/A}
|
|
75
|
+
- **Issue Artifact Comment URL**: {comment-url or N/A}
|
|
76
|
+
|
|
77
|
+
## Evidence
|
|
78
|
+
|
|
79
|
+
> Every "I verified X" assertion must pair with the corresponding tool output verbatim; the gate only checks this section exists and has at least one `$ ` line.
|
|
80
|
+
|
|
81
|
+
- Assertion: {verified claim}
|
|
82
|
+
```text
|
|
83
|
+
$ {command}
|
|
84
|
+
{raw output}
|
|
85
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# PR 审查报告模板
|
|
2
|
+
|
|
3
|
+
创建 `pr-review.md` 或 `pr-review-r{N}.md` 时使用以下结构。
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
# PR 审查报告
|
|
7
|
+
|
|
8
|
+
- **审查轮次**:Round {round}
|
|
9
|
+
- **产物文件**:`pr-review.md` / `pr-review-r{N}.md`
|
|
10
|
+
- **可恢复**:true(任务锚定路径)/ false(一次性检视路径)
|
|
11
|
+
|
|
12
|
+
## 状态核对
|
|
13
|
+
|
|
14
|
+
> 粘贴状态核对命令原文;每条命令以 `$ ` 开头。
|
|
15
|
+
|
|
16
|
+
## 身份信息
|
|
17
|
+
|
|
18
|
+
- **PR 编号**:{pr-number}
|
|
19
|
+
- **Base 分支**:{base-ref}(SHA `{base-sha}`)
|
|
20
|
+
- **Head 分支**:{head-ref}
|
|
21
|
+
- **被审 head SHA**:{40 位 hex}
|
|
22
|
+
- **关联 Issue**:{issue-number 或 N/A}
|
|
23
|
+
- **关联任务**:{task-id 或 N/A}
|
|
24
|
+
- **关联任务目录**:{task-dir 或 N/A}
|
|
25
|
+
|
|
26
|
+
## 证据清单
|
|
27
|
+
|
|
28
|
+
- **宿主解析结果**:`unique` / `ambiguous` / `none`
|
|
29
|
+
- **证据场景**:S{1|2|3}
|
|
30
|
+
- **新鲜度**:`fresh` / `stale` / `n/a`
|
|
31
|
+
- **对齐**:`aligned` / `misaligned` / `n/a`
|
|
32
|
+
- **审查模式**:`verify` / `audit` / `reconstruct`
|
|
33
|
+
- **风险等级**:`LOW` / `MEDIUM` / `HIGH`
|
|
34
|
+
- **是否首次审查**:true / false
|
|
35
|
+
- **receipt**:{receipt}
|
|
36
|
+
- **决策输入与输出**:粘贴 `pr-review-grade decide` 的完整输入 JSON 与输出 DecisionRecord(decision 输入含宿主、artifact 存在性、head 状态、六个风险因素)。
|
|
37
|
+
|
|
38
|
+
### 重建上下文(reconstruct / audit 证据不足时)
|
|
39
|
+
|
|
40
|
+
在行级 finding 之前按以下顺序落盘,不冒充标准生命周期产物:
|
|
41
|
+
|
|
42
|
+
1. **需求边界**:PR 要实现什么、不做什么。
|
|
43
|
+
2. **架构选择**:关键技术路径与取舍。
|
|
44
|
+
3. **影响面**:改动波及的模块 / 规则 / 契约。
|
|
45
|
+
4. **验证覆盖**:应有哪些测试、现有测试能否覆盖。
|
|
46
|
+
|
|
47
|
+
## 覆盖矩阵
|
|
48
|
+
|
|
49
|
+
| 检视面 | 证据 | 结论 | 未覆盖/缺口 |
|
|
50
|
+
|--------|------|------|-------------|
|
|
51
|
+
| 需求边界 | {证据} | {结论} | {缺口} |
|
|
52
|
+
| 架构选择 | {证据} | {结论} | {缺口} |
|
|
53
|
+
| 影响面 | {证据} | {结论} | {缺口} |
|
|
54
|
+
| 验证覆盖 | {证据} | {结论} | {缺口} |
|
|
55
|
+
|
|
56
|
+
## 问题清单
|
|
57
|
+
|
|
58
|
+
### 阻塞项(必须修复)
|
|
59
|
+
|
|
60
|
+
- **{标题}**:{描述} · `{file}:{line}` · 证据:{evidence} · 影响:{impact} · 建议:{suggestion}
|
|
61
|
+
|
|
62
|
+
### 主要问题(建议修复)
|
|
63
|
+
|
|
64
|
+
- **{标题}**:{描述} · `{file}:{line}` · 证据:{evidence} · 影响:{impact} · 建议:{suggestion}
|
|
65
|
+
|
|
66
|
+
### 次要问题(低影响但需闭环)
|
|
67
|
+
|
|
68
|
+
- **{标题}**:{描述} · `{file}:{line}` · 证据:{evidence} · 影响:{impact} · 建议:{suggestion}
|
|
69
|
+
|
|
70
|
+
## 发布结果
|
|
71
|
+
|
|
72
|
+
- **正式 Review 状态**:{pending / applied / no-op / aborted / superseded / blocked / failed}
|
|
73
|
+
- **Review ID**:{review-id 或 N/A}
|
|
74
|
+
- **Review URL**:{review-url 或 N/A}
|
|
75
|
+
- **Issue artifact 评论 URL**:{comment-url 或 N/A}
|
|
76
|
+
|
|
77
|
+
## 证据原文
|
|
78
|
+
|
|
79
|
+
> 每条「我验证了 X」断言都要配对对应 tool output 原文;gate 仅校验本段存在和至少一行 `$ `。
|
|
80
|
+
|
|
81
|
+
- 断言:{verified claim}
|
|
82
|
+
```text
|
|
83
|
+
$ {command}
|
|
84
|
+
{raw output}
|
|
85
|
+
```
|
|
@@ -7,16 +7,16 @@ description: >
|
|
|
7
7
|
|
|
8
8
|
# Run Task Lifecycle
|
|
9
9
|
|
|
10
|
-
The orchestrator delegates only and never executes a stage skill itself. First read `.agents/rules/no-mid-flow-questions.md
|
|
10
|
+
The orchestrator delegates only and never executes a stage skill itself. First read `.agents/rules/no-mid-flow-questions.md`, `.agents/rules/lifecycle-orchestration.md`, and `reference/host-validation.md`.
|
|
11
11
|
|
|
12
|
-
1. Resolve the task and
|
|
13
|
-
2. Run `
|
|
14
|
-
3. Run `route` and use its single action, role, round, and
|
|
15
|
-
4.
|
|
12
|
+
1. Resolve the task, current Agent Client, and optional atomic policy flags `--executor-model`, `--executor-reasoning-effort`, `--reviewer-model`, and `--reviewer-reasoning-effort`, then run `task-snapshot`. If any explicit policy flag is present, all four role fields are required and must not be merged with configuration; both roles may use the same model.
|
|
13
|
+
2. Run `task-orchestration {task-id} begin-or-resume --client {client}` with the complete explicit policy. With no explicit policy, core reads only that client's `agentClients[].orchestration`; an existing v2 run uses its persisted policy. Only on `ORCHESTRATION_MODEL_POLICY_REQUIRED`, show the complete/partial/interactive-only `agent-client model-selection` context and collect one complete policy; no answer means no run is created. Stop on paused/completed results.
|
|
14
|
+
3. Run `route` and read its structured result. On `completed`, immediately run `agent-infra-internal task-verify {task-id} run-task.completed --format text` and stop. Only when the result is `running` with a non-null `next`, use its single action, role, round, artifact, `requestedModel`, and `requestedReasoningEffort`; never infer them from review prose, session defaults, or a partial tool schema.
|
|
15
|
+
4. Only for the `running` result from step 3, run `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}` so core validates both fields and host evidence before snapshotting. Claude Code's native start event currently cannot provide stable actual model/effort evidence, so it returns `ORCHESTRATION_CLIENT_UNSUPPORTED` and stops like any other client without that evidence. Only after validation succeeds, start a fresh native child with the same model/effort overrides and only the short task ref, skill name, literal `--orchestrated` execution marker, and minimal handoff. The child must forward that marker to every provenance-sensitive command in the stage.
|
|
16
16
|
5. Native start/stop hooks correlate the unique pending delegation and let core compute workspace changes and seal the receipt. After the child returns, run `advance`. Repeat step 3 only for `running`; stop immediately for `paused` or `completed`.
|
|
17
|
-
6. Create a new child every round and never follow up with an old reviewer. Capability, hook, identity,
|
|
18
|
-
7. On pause or completion, run the matching typed verification and report the structured run summary, pause reason, or
|
|
17
|
+
6. Create a new child every round and never follow up with an old reviewer. Native start must report actual model and actual reasoning effort; each requested/actual mismatch needs its own host fallback reason, and requested values must never be fabricated as actual evidence. Capability, hook, identity, evidence, ledger, or fingerprint failures must call `pause` and fail closed.
|
|
18
|
+
7. On pause or completion, run the matching typed verification and report the structured run summary, pause reason, commit endpoint, or clean completion evidence.
|
|
19
19
|
|
|
20
20
|
## Stop
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Stop after a safe `commit` or reviewed-head-clean endpoint; do not create a PR, monitor checks, or archive the task.
|
|
@@ -7,16 +7,16 @@ description: >
|
|
|
7
7
|
|
|
8
8
|
# 运行任务生命周期
|
|
9
9
|
|
|
10
|
-
总控只编排,不直接执行任何阶段技能。执行前先读取 `.agents/rules/no-mid-flow-questions.md
|
|
10
|
+
总控只编排,不直接执行任何阶段技能。执行前先读取 `.agents/rules/no-mid-flow-questions.md`、`.agents/rules/lifecycle-orchestration.md` 与 `reference/host-validation.md`。
|
|
11
11
|
|
|
12
|
-
1.
|
|
13
|
-
2. 调用 `agent-infra-internal task-orchestration {task-id} begin-or-resume
|
|
14
|
-
3. 调用 `route`
|
|
15
|
-
4.
|
|
12
|
+
1. 解析任务引用、当前 Agent Client,以及可选的原子策略 `--executor-model`、`--executor-reasoning-effort`、`--reviewer-model`、`--reviewer-reasoning-effort`,并执行 `agent-infra-internal task-snapshot {task-id} --format text`。任一显式策略字段出现时四个 role 字段必须完整,不得与配置拼接;两个角色可以使用同一模型。
|
|
13
|
+
2. 调用 `agent-infra-internal task-orchestration {task-id} begin-or-resume --client {client}` 并转发完整显式策略。完全没有显式策略时由核心读取当前 client 的 `agentClients[].orchestration`;已有 v2 run 使用持久化策略。仅当核心返回 `ORCHESTRATION_MODEL_POLICY_REQUIRED` 时,先用 `agent-client model-selection` 展示 complete/partial/interactive-only 来源,再一次收集完整策略;未回答则不创建 run。若为 paused/completed,按结构化结果停止。
|
|
14
|
+
3. 调用 `route` 并读取结构化结果。若返回 `completed`,立即运行 `agent-infra-internal task-verify {task-id} run-task.completed --format text` 并停止;仅当返回 `running` 且 `next` 非空时读取唯一 action、role、round、artifact、`requestedModel` 和 `requestedReasoningEffort`,不得从审查文案、会话默认或局部 tool schema 自行推断。
|
|
15
|
+
4. 仅对步骤 3 的 `running` 结果调用 `prepare --client {client} --requested-model {requestedModel} --requested-reasoning-effort {requestedReasoningEffort}`;核心在记录工作区基线前校验两字段与宿主证据能力。当前 Claude Code 的原生 start 事件无法稳定提供 actual model/effort,因此与其他缺少该证据的客户端一样返回 `ORCHESTRATION_CLIENT_UNSUPPORTED` 并停止。只有校验成功时才用当前客户端的 fresh 原生子 Agent 启动指定角色,并显式覆盖同一 model/effort;只传短任务引用、skill 名、字面执行标记 `--orchestrated` 和最小交接摘要,不传 receipt identity,不继承总控历史。子 Agent 必须把该标记转发给本阶段所有 provenance 敏感命令。
|
|
16
16
|
5. 原生 start/stop hook 通过唯一 pending delegation 自动关联任务,并由核心计算工作区变化、封存 receipt;子 Agent 返回后调用 `advance`。只有 `running` 才重复步骤 3;`paused` 或 `completed` 立即停止。
|
|
17
|
-
6. 每轮创建新 child;禁止 follow-up 复用 reviewer
|
|
18
|
-
7. 完成或暂停后运行对应 typed verification,并把结构化 run
|
|
17
|
+
6. 每轮创建新 child;禁止 follow-up 复用 reviewer。原生 start 必须回传 actual model 与 actual reasoning effort;任一 actual 与 requested 不同时必须有各自的宿主降级理由,缺失时不得用 requested 值补造。任何 capability、hook、身份、证据、账本或 fingerprint 异常都调用 `pause` 并失败关闭。
|
|
18
|
+
7. 完成或暂停后运行对应 typed verification,并把结构化 run 摘要、暂停原因、commit 终点或 clean completion evidence 告知用户。
|
|
19
19
|
|
|
20
20
|
## 停止
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
在安全 `commit` 或 reviewed-head-clean 终点后结束;不要继续创建 PR、监控 checks 或归档任务。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Host Contract Validation
|
|
2
|
+
|
|
3
|
+
Before publishing support for a client, prove the lifecycle evidence chain with real host events. Bridge tests prove field mapping only; they do not prove host provenance.
|
|
4
|
+
|
|
5
|
+
## Required Evidence
|
|
6
|
+
|
|
7
|
+
- Client version, enabled multi-agent capability, launch surface, and trust boundary.
|
|
8
|
+
- Raw start/stop events stably provide event type, managed agent, parent/child identity, fresh spawn mode, actual model, and actual reasoning effort.
|
|
9
|
+
- Explicit requested model/effort reaches each executor/reviewer. A fallback of either field reports the corresponding actual value and its own non-empty reason.
|
|
10
|
+
- Candidate-checkout and packed-install behavior match, with model policy, receipts, and verification results auditable in `orchestration.json`.
|
|
11
|
+
|
|
12
|
+
## Validation Sequence
|
|
13
|
+
|
|
14
|
+
1. Record client version, feature state, and launch command in a clean temporary repository.
|
|
15
|
+
2. Start a fresh executor and reviewer, retaining redacted raw stdin and the structured run. Never synthesize a field the host did not emit.
|
|
16
|
+
3. Validate model/effort match paths, single and dual justified fallbacks, and fail-closed behavior for missing actual fields.
|
|
17
|
+
4. Validate the same commit from a candidate checkout and an `npm pack` install; record the tarball hash and results.
|
|
18
|
+
5. Commit only redacted summaries and non-sensitive fixtures. Remove or replace tokens, user-specific absolute paths, transcript content, and credentials.
|
|
19
|
+
|
|
20
|
+
If any required field cannot be observed reliably from the real host, keep that client's orchestration capability `unsupported` and record the gap as manual validation.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 宿主契约验证
|
|
2
|
+
|
|
3
|
+
发布支持某个客户端前,必须用真实宿主事件证明生命周期证据链;bridge 单测只证明字段映射,不能证明事件来自宿主。
|
|
4
|
+
|
|
5
|
+
## 必须证明的字段
|
|
6
|
+
|
|
7
|
+
- 客户端版本、启用的多代理能力、启动入口与信任边界。
|
|
8
|
+
- 原始 start/stop 事件能稳定给出 event type、managed agent、parent/child identity、fresh spawn mode、actual model 和 actual reasoning effort。
|
|
9
|
+
- 显式 requested model/effort 能传给 executor/reviewer;宿主对任一字段回退时,事件能给出对应 actual 值与独立的非空 fallback reason。
|
|
10
|
+
- candidate checkout 与打包安装后的行为一致,且模型策略、receipt 与验证结果可从 `orchestration.json` 复核。
|
|
11
|
+
|
|
12
|
+
## 验证顺序
|
|
13
|
+
|
|
14
|
+
1. 在干净临时仓库记录客户端版本、feature 状态和启动命令。
|
|
15
|
+
2. 分别启动 fresh executor 与 fresh reviewer,保存去敏后的原始 stdin 和结构化 run;不得补写宿主未产生的字段。
|
|
16
|
+
3. 分别验证 model/effort 的 requested/actual 一致路径、单项与双项有理由 fallback 路径,并确认缺 actual 字段会失败关闭。
|
|
17
|
+
4. 对同一 commit 执行 candidate checkout 与 `npm pack` 安装验证,记录 tarball 哈希和结果。
|
|
18
|
+
5. 仅把去敏摘要与非敏感 fixture 纳入版本库;token、绝对用户路径、transcript 内容和凭证必须删除或替换。
|
|
19
|
+
|
|
20
|
+
任一字段无法从真实宿主稳定观察时,该客户端的 orchestration capability 保持 `unsupported`,并把缺口记录为人工验证项。
|