@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
|
@@ -114,6 +114,8 @@ function runCheck(type: any, context: any, shared: any): any {
|
|
|
114
114
|
return checkCompletionChecklist(context);
|
|
115
115
|
case "review-ledger":
|
|
116
116
|
return checkReviewLedger(context);
|
|
117
|
+
case "manual-validation":
|
|
118
|
+
return checkManualValidation(context);
|
|
117
119
|
case "review-summary":
|
|
118
120
|
return checkReviewSummary(context);
|
|
119
121
|
case "review-fact":
|
|
@@ -122,6 +124,8 @@ function runCheck(type: any, context: any, shared: any): any {
|
|
|
122
124
|
return checkPostReviewCommit(context);
|
|
123
125
|
case "orchestration-state":
|
|
124
126
|
return checkOrchestrationState(context);
|
|
127
|
+
case "orchestration-evidence":
|
|
128
|
+
return checkOrchestrationEvidence(context);
|
|
125
129
|
default: {
|
|
126
130
|
const adapter = PLATFORM_ADAPTERS[type];
|
|
127
131
|
if (!adapter) {
|
|
@@ -137,6 +141,25 @@ function runCheck(type: any, context: any, shared: any): any {
|
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
|
|
144
|
+
function isFailClosedLegacyPause(run: any): boolean {
|
|
145
|
+
if (
|
|
146
|
+
run.schemaVersion !== 1
|
|
147
|
+
|| run.status !== 'paused'
|
|
148
|
+
|| run.pause?.recoverable !== false
|
|
149
|
+
|| !exactText(run.pause?.message)
|
|
150
|
+
|| !Array.isArray(run.receipts)
|
|
151
|
+
) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if (run.pause.code === 'ORCHESTRATION_HISTORICAL_EFFORT_UNVERIFIED') {
|
|
155
|
+
return run.receipts.length > 0 && run.pendingDelegation === null;
|
|
156
|
+
}
|
|
157
|
+
if (run.pause.code === 'ORCHESTRATION_DELEGATION_BUSY') {
|
|
158
|
+
return run.pendingDelegation != null && run.pendingDelegation.status !== 'sealed';
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
|
|
140
163
|
function checkOrchestrationState({ taskDir }: any): any {
|
|
141
164
|
const file = path.join(taskDir, 'orchestration.json');
|
|
142
165
|
const stat = safeStat(file);
|
|
@@ -147,22 +170,177 @@ function checkOrchestrationState({ taskDir }: any): any {
|
|
|
147
170
|
} catch (error) {
|
|
148
171
|
return failResult('orchestration-state', `Invalid orchestration.json: ${String(error)}`);
|
|
149
172
|
}
|
|
150
|
-
if (
|
|
173
|
+
if (isFailClosedLegacyPause(run)) {
|
|
174
|
+
return passResult('orchestration-state', 'Legacy orchestration run is safely paused');
|
|
175
|
+
}
|
|
176
|
+
if (run.schemaVersion !== 2 || !['paused', 'completed'].includes(run.status)) {
|
|
151
177
|
return failResult('orchestration-state', `Expected paused or completed run, received '${run.status}'`);
|
|
152
178
|
}
|
|
153
179
|
if (run.status === 'paused' && (!run.pause?.code || !run.pause?.message)) {
|
|
154
180
|
return failResult('orchestration-state', 'Paused run requires a stable pause code and message');
|
|
155
181
|
}
|
|
156
182
|
if (run.status === 'completed') {
|
|
157
|
-
if (run.
|
|
183
|
+
if (run.completionEvidence != null) {
|
|
184
|
+
const evidenceError = validateCleanCompletionEvidence(run);
|
|
185
|
+
if (evidenceError) return failResult('orchestration-state', evidenceError);
|
|
186
|
+
} else if (run.pendingDelegation !== null || !run.commitAuthorization?.consumedAt) {
|
|
158
187
|
return failResult('orchestration-state', 'Completed run must consume commit authorization and clear pending delegation');
|
|
159
188
|
}
|
|
189
|
+
} else if (run.completionEvidence != null) {
|
|
190
|
+
return failResult('orchestration-state', 'Clean completion evidence requires a completed run');
|
|
160
191
|
} else if (run.pendingDelegation?.status === 'sealed') {
|
|
161
192
|
return failResult('orchestration-state', 'Paused run has a sealed delegation that could still advance');
|
|
162
193
|
}
|
|
163
194
|
return passResult('orchestration-state', `Orchestration run is safely ${run.status}`);
|
|
164
195
|
}
|
|
165
196
|
|
|
197
|
+
function exactText(value: unknown): value is string {
|
|
198
|
+
return typeof value === 'string' && value.length > 0 && value.trim() === value;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function validateCleanCompletionEvidence(run: any): string | null {
|
|
202
|
+
const evidence = run.completionEvidence;
|
|
203
|
+
const shaPattern = /^[0-9a-f]{40}$/i;
|
|
204
|
+
if (
|
|
205
|
+
evidence?.kind !== 'reviewed-head-clean'
|
|
206
|
+
|| !exactText(evidence.observedAt)
|
|
207
|
+
|| Number.isNaN(Date.parse(evidence.observedAt))
|
|
208
|
+
|| !shaPattern.test(evidence.head)
|
|
209
|
+
|| !shaPattern.test(evidence.headTree)
|
|
210
|
+
|| !shaPattern.test(evidence.worktreeTree)
|
|
211
|
+
|| !shaPattern.test(evidence.lastReviewedCommit)
|
|
212
|
+
|| !Number.isInteger(evidence.prNumber)
|
|
213
|
+
|| evidence.prNumber <= 0
|
|
214
|
+
|| !shaPattern.test(evidence.prHead)
|
|
215
|
+
) {
|
|
216
|
+
return 'Clean completion evidence has an invalid structure';
|
|
217
|
+
}
|
|
218
|
+
if (
|
|
219
|
+
evidence.head !== evidence.lastReviewedCommit
|
|
220
|
+
|| evidence.head !== evidence.prHead
|
|
221
|
+
|| evidence.headTree !== evidence.worktreeTree
|
|
222
|
+
) {
|
|
223
|
+
return 'Clean completion evidence does not bind matching commit and tree identities';
|
|
224
|
+
}
|
|
225
|
+
if (
|
|
226
|
+
run.status !== 'completed'
|
|
227
|
+
|| run.pendingDelegation !== null
|
|
228
|
+
|| run.commitAuthorization?.issuedAt !== null
|
|
229
|
+
|| run.commitAuthorization?.consumedAt !== null
|
|
230
|
+
|| !Array.isArray(run.receipts)
|
|
231
|
+
|| run.receipts.some((receipt: any) => receipt.stage === 'commit')
|
|
232
|
+
) {
|
|
233
|
+
return 'Clean completion evidence conflicts with commit delegation state';
|
|
234
|
+
}
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function checkOrchestrationEvidence({ taskDir }: any): any {
|
|
239
|
+
const file = path.join(taskDir, 'orchestration.json');
|
|
240
|
+
const stat = safeStat(file);
|
|
241
|
+
if (!stat?.isFile()) return failResult('orchestration-evidence', 'orchestration.json is missing');
|
|
242
|
+
let run: any;
|
|
243
|
+
try {
|
|
244
|
+
run = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
245
|
+
} catch (error) {
|
|
246
|
+
return failResult('orchestration-evidence', `Invalid orchestration.json: ${String(error)}`);
|
|
247
|
+
}
|
|
248
|
+
if (isFailClosedLegacyPause(run)) {
|
|
249
|
+
return passResult('orchestration-evidence', 'Legacy orchestration evidence is preserved in a fail-closed pause');
|
|
250
|
+
}
|
|
251
|
+
const policy = run.modelPolicy;
|
|
252
|
+
if (
|
|
253
|
+
!policy
|
|
254
|
+
|| !exactText(policy.executor?.model)
|
|
255
|
+
|| !exactText(policy.executor?.reasoningEffort)
|
|
256
|
+
|| !exactText(policy.reviewer?.model)
|
|
257
|
+
|| !exactText(policy.reviewer?.reasoningEffort)
|
|
258
|
+
) {
|
|
259
|
+
return failResult('orchestration-evidence', 'Run model policy requires exact executor and reviewer model and effort');
|
|
260
|
+
}
|
|
261
|
+
if (
|
|
262
|
+
!run.modelPolicySource
|
|
263
|
+
|| !['explicit', 'project-config'].includes(run.modelPolicySource.kind)
|
|
264
|
+
|| !exactText(run.modelPolicySource.client)
|
|
265
|
+
|| !exactText(run.modelPolicySource.resolvedAt)
|
|
266
|
+
|| !Array.isArray(run.recoveryHistory)
|
|
267
|
+
) {
|
|
268
|
+
return failResult('orchestration-evidence', 'Run model policy source or recovery history is invalid');
|
|
269
|
+
}
|
|
270
|
+
for (const recovery of run.recoveryHistory) {
|
|
271
|
+
if (
|
|
272
|
+
recovery.code !== 'MODEL_POLICY_SUPPLEMENTED'
|
|
273
|
+
|| recovery.previousSchemaVersion !== 1
|
|
274
|
+
|| recovery.receiptCount !== 0
|
|
275
|
+
|| recovery.pendingDelegation !== false
|
|
276
|
+
|| !exactText(recovery.recoveredAt)
|
|
277
|
+
|| !recovery.policySource
|
|
278
|
+
) {
|
|
279
|
+
return failResult('orchestration-evidence', 'Run recovery history contains invalid provenance');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (!Array.isArray(run.receipts)) {
|
|
283
|
+
return failResult('orchestration-evidence', 'Run receipts must be an array');
|
|
284
|
+
}
|
|
285
|
+
if (run.completionEvidence != null) {
|
|
286
|
+
const evidenceError = validateCleanCompletionEvidence(run);
|
|
287
|
+
if (evidenceError) return failResult('orchestration-evidence', evidenceError);
|
|
288
|
+
} else if (run.status === 'completed' && (
|
|
289
|
+
run.receipts.length === 0
|
|
290
|
+
|| run.receipts.at(-1)?.stage !== 'commit'
|
|
291
|
+
|| run.receipts.at(-1)?.status !== 'consumed'
|
|
292
|
+
)) {
|
|
293
|
+
return failResult('orchestration-evidence', 'Completed run requires a final consumed commit receipt');
|
|
294
|
+
}
|
|
295
|
+
if (run.pendingDelegation && !['prepared', 'activated', 'stage-completed'].includes(run.pendingDelegation.status)) {
|
|
296
|
+
return failResult('orchestration-evidence', `Pending receipt has unsafe status '${run.pendingDelegation.status}'`);
|
|
297
|
+
}
|
|
298
|
+
const receipts = [...run.receipts, ...(run.pendingDelegation ? [run.pendingDelegation] : [])];
|
|
299
|
+
for (const receipt of receipts) {
|
|
300
|
+
const expectedPolicy = policy[receipt.role];
|
|
301
|
+
if (!expectedPolicy || receipt.requestedModel !== expectedPolicy.model) {
|
|
302
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' requested model does not match its role policy`);
|
|
303
|
+
}
|
|
304
|
+
if (receipt.requestedReasoningEffort !== expectedPolicy.reasoningEffort) {
|
|
305
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' requested reasoning effort does not match its role policy`);
|
|
306
|
+
}
|
|
307
|
+
const activated = ['activated', 'stage-completed', 'sealed', 'consumed'].includes(receipt.status);
|
|
308
|
+
if (activated) {
|
|
309
|
+
if (!exactText(receipt.actualModel)) {
|
|
310
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' has no host-observed actual model`);
|
|
311
|
+
}
|
|
312
|
+
if (!exactText(receipt.actualReasoningEffort)) {
|
|
313
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' has no host-observed actual reasoning effort`);
|
|
314
|
+
}
|
|
315
|
+
if (!exactText(receipt.parentId) || !exactText(receipt.childId) || receipt.parentId === receipt.childId || receipt.spawnMode !== 'fresh') {
|
|
316
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' has invalid fresh delegation identity`);
|
|
317
|
+
}
|
|
318
|
+
if (receipt.actualModel !== receipt.requestedModel && !exactText(receipt.modelFallbackReason)) {
|
|
319
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' model fallback is not justified`);
|
|
320
|
+
}
|
|
321
|
+
if (receipt.actualModel === receipt.requestedModel && receipt.modelFallbackReason !== null) {
|
|
322
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' has an unrelated model fallback reason`);
|
|
323
|
+
}
|
|
324
|
+
if (
|
|
325
|
+
receipt.actualReasoningEffort !== receipt.requestedReasoningEffort
|
|
326
|
+
&& !exactText(receipt.reasoningEffortFallbackReason)
|
|
327
|
+
) {
|
|
328
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' reasoning-effort fallback is not justified`);
|
|
329
|
+
}
|
|
330
|
+
if (
|
|
331
|
+
receipt.actualReasoningEffort === receipt.requestedReasoningEffort
|
|
332
|
+
&& receipt.reasoningEffortFallbackReason !== null
|
|
333
|
+
) {
|
|
334
|
+
return failResult('orchestration-evidence', `Receipt '${receipt.id ?? '(unknown)'}' has an unrelated reasoning-effort fallback reason`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (run.receipts.some((receipt: any) => receipt.status !== 'consumed')) {
|
|
339
|
+
return failResult('orchestration-evidence', 'Historical receipts must be consumed');
|
|
340
|
+
}
|
|
341
|
+
return passResult('orchestration-evidence', 'Persisted orchestration model and delegation evidence is internally consistent');
|
|
342
|
+
}
|
|
343
|
+
|
|
166
344
|
// === Check Functions ===
|
|
167
345
|
|
|
168
346
|
function checkTaskMeta({ taskDir, config }: any): any {
|
|
@@ -740,6 +918,75 @@ function checkReviewLedger({ taskDir, config }: any): any {
|
|
|
740
918
|
return passResult("review-ledger", `Disagreement ledger clean (${inScopeCount} in-scope entries terminal${scopeLabel})`);
|
|
741
919
|
}
|
|
742
920
|
|
|
921
|
+
function checkManualValidation({ taskDir }: any): any {
|
|
922
|
+
// 1. Latest review-code artifact; none -> pass (no review, check not applicable).
|
|
923
|
+
const review = findAuthoritativeReviewCodeArtifact(taskDir);
|
|
924
|
+
if (!review.ok) {
|
|
925
|
+
return passResult("manual-validation", "No review-code artifact; manual validation not applicable");
|
|
926
|
+
}
|
|
927
|
+
// 2. Parse the numeric manual-validation count; unparseable/null -> fail closed
|
|
928
|
+
// (review-code.completed already enforces a numeric count on the normal path).
|
|
929
|
+
const parsed = parseReviewSummary(fs.readFileSync(review.path!, "utf8"));
|
|
930
|
+
if (!parsed.ok || parsed.summary.manualValidation === null) {
|
|
931
|
+
return failResult("manual-validation", "Latest review-code has no numeric manual-validation count");
|
|
932
|
+
}
|
|
933
|
+
// 3. Count 0 -> pass (no pending items to cover).
|
|
934
|
+
if (parsed.summary.manualValidation === 0) {
|
|
935
|
+
return passResult("manual-validation", "No pending manual validation items");
|
|
936
|
+
}
|
|
937
|
+
// 4. Highest-round manual-validation artifact; none -> fail (items pending,
|
|
938
|
+
// run complete-manual-validation first). A falsy artifactFile goes through
|
|
939
|
+
// pattern parsing; resolveArtifactPath only returns { ok, path }.
|
|
940
|
+
const resolved = resolveArtifactPath(taskDir, "manual-validation.md|manual-validation-r{N}.md", "");
|
|
941
|
+
if (!resolved.ok) {
|
|
942
|
+
return failResult(
|
|
943
|
+
"manual-validation",
|
|
944
|
+
`${parsed.summary.manualValidation} manual validation item(s) pending: run /complete-manual-validation`
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
// 5. The Activity Log must record the matching completion entry; the file name
|
|
948
|
+
// is derived with path.basename (resolveArtifactPath does not return fileName).
|
|
949
|
+
const artifactName = path.basename(resolved.path);
|
|
950
|
+
const task = loadTask(taskDir);
|
|
951
|
+
if (!task.ok) return failResult("manual-validation", task.message);
|
|
952
|
+
const log = getSectionContent(task.content, ["活动日志", "Activity Log"]);
|
|
953
|
+
const completed = new RegExp(
|
|
954
|
+
`\\*\\*Complete Manual Validation\\*\\*[\\s\\S]*?Manual validation passed → ${escapeRegExp(artifactName)};`
|
|
955
|
+
);
|
|
956
|
+
if (!completed.test(log)) {
|
|
957
|
+
return failResult(
|
|
958
|
+
"manual-validation",
|
|
959
|
+
`Manual validation artifact exists but completion is not recorded for ${artifactName}: re-run /complete-manual-validation`
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
// 6. Timing correlation (PL-3 fix, PL-4 corrected): the completion entry must
|
|
963
|
+
// sit AFTER the latest review-code round's completion entry in the
|
|
964
|
+
// append-only Activity Log. indexOf is a literal search, so the artifactName
|
|
965
|
+
// must NOT be passed through escapeRegExp here (that escapes '.' to '\.',
|
|
966
|
+
// which indexOf never matches). Not reusing completed.exec().index: exec
|
|
967
|
+
// anchors to the first '**Complete Manual Validation**' heading, which can
|
|
968
|
+
// belong to an earlier round's entry and misorder the standard path.
|
|
969
|
+
const reviewDoneIndex = log.indexOf(`**Review Code (Round ${review.round})** by `);
|
|
970
|
+
const completedIndex = log.indexOf(`Manual validation passed → ${artifactName};`);
|
|
971
|
+
if (reviewDoneIndex === -1) {
|
|
972
|
+
// The latest review-code round's completion entry is missing entirely (abnormal
|
|
973
|
+
// state, e.g. a restored/historical task without a review-code.completed record).
|
|
974
|
+
// Re-running complete-manual-validation cannot restore it, so the remediation
|
|
975
|
+
// targets the review record itself. Fail closed either way.
|
|
976
|
+
return failResult(
|
|
977
|
+
"manual-validation",
|
|
978
|
+
`Latest review-code (round ${review.round}) completion entry is missing from the Activity Log (abnormal state): re-run review-code or restore the completion record`
|
|
979
|
+
);
|
|
980
|
+
}
|
|
981
|
+
if (completedIndex < reviewDoneIndex) {
|
|
982
|
+
return failResult(
|
|
983
|
+
"manual-validation",
|
|
984
|
+
`Latest review-code (round ${review.round}) came after the manual validation completion recorded for ${artifactName}: re-run /complete-manual-validation to cover new pending items`
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
return passResult("manual-validation", `Manual validation completed → ${artifactName}`);
|
|
988
|
+
}
|
|
989
|
+
|
|
743
990
|
function checkPostReviewCommit({ taskDir, config }: any): any {
|
|
744
991
|
const reviewArtifact = findAuthoritativeReviewCodeArtifact(taskDir);
|
|
745
992
|
if (!reviewArtifact.ok) {
|
package/lib/task/verification.ts
CHANGED
|
@@ -17,6 +17,7 @@ type VerificationEvent =
|
|
|
17
17
|
| 'create-pr.completed' | 'create-task.completed'
|
|
18
18
|
| 'import-codescan.completed' | 'import-dependabot.completed'
|
|
19
19
|
| 'import-issue.completed' | 'watch-pr.completed'
|
|
20
|
+
| 'review-pr.completed'
|
|
20
21
|
| 'run-task.paused' | 'run-task.completed';
|
|
21
22
|
type VerificationSpec = {
|
|
22
23
|
skill: string;
|
|
@@ -64,7 +65,7 @@ const VERIFICATION_CATALOG: Readonly<Record<VerificationEvent, VerificationSpec>
|
|
|
64
65
|
'block-task.completed': gate('block-task', 'blocked'),
|
|
65
66
|
'cancel-task.completed': gate('cancel-task', 'completed'),
|
|
66
67
|
'commit.completed': gate('commit', 'active'),
|
|
67
|
-
'complete-task.preflight': { skill: 'complete-task', expectedState: 'active', mode: 'checks', checks: ['review-ledger', 'post-review-commit', 'platform-sync-preflight'] },
|
|
68
|
+
'complete-task.preflight': { skill: 'complete-task', expectedState: 'active', mode: 'checks', checks: ['review-ledger', 'manual-validation', 'post-review-commit', 'platform-sync-preflight'] },
|
|
68
69
|
'complete-task.completed': gate('complete-task', 'completed'),
|
|
69
70
|
'create-pr.completed': gate('create-pr', 'active'),
|
|
70
71
|
'create-task.completed': gate('create-task', 'active'),
|
|
@@ -72,8 +73,9 @@ const VERIFICATION_CATALOG: Readonly<Record<VerificationEvent, VerificationSpec>
|
|
|
72
73
|
'import-dependabot.completed': gate('import-dependabot', 'active'),
|
|
73
74
|
'import-issue.completed': gate('import-issue', 'active'),
|
|
74
75
|
'watch-pr.completed': gate('watch-pr', 'active'),
|
|
75
|
-
'
|
|
76
|
-
'run-task.
|
|
76
|
+
'review-pr.completed': gate('review-pr', 'active', 'pr-review'),
|
|
77
|
+
'run-task.paused': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state', 'orchestration-evidence'] },
|
|
78
|
+
'run-task.completed': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state', 'orchestration-evidence'] }
|
|
77
79
|
};
|
|
78
80
|
|
|
79
81
|
function failure(request: { taskRef: string; event: string; artifact?: string }, code: string, message: string, extra: Partial<TaskVerificationResult> = {}): TaskVerificationResult {
|
|
@@ -12,15 +12,20 @@ function git(repoRoot: string, indexFile: string | null, args: string[]): string
|
|
|
12
12
|
return result.stdout;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type RepositorySnapshot = Readonly<{
|
|
16
|
+
head: string;
|
|
17
|
+
headTree: string;
|
|
18
|
+
worktreeTree: string;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
function captureWorktreeTree(repoRoot: string, forcedPath: string | null): string {
|
|
16
22
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agent-infra-orchestration-index-'));
|
|
17
23
|
const indexFile = path.join(tempDir, 'index');
|
|
18
24
|
try {
|
|
19
25
|
git(repoRoot, indexFile, ['read-tree', 'HEAD']);
|
|
20
26
|
git(repoRoot, indexFile, ['add', '-A', '--', ':/']);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
git(repoRoot, indexFile, ['add', '-f', '--', '.agents/workspace/active']);
|
|
27
|
+
if (forcedPath && fs.existsSync(path.join(repoRoot, forcedPath))) {
|
|
28
|
+
git(repoRoot, indexFile, ['add', '-f', '--', forcedPath]);
|
|
24
29
|
}
|
|
25
30
|
return git(repoRoot, indexFile, ['write-tree']).trim();
|
|
26
31
|
} finally {
|
|
@@ -28,9 +33,25 @@ function captureWorkspaceSnapshot(repoRoot: string): string {
|
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
|
|
36
|
+
function captureWorkspaceSnapshot(repoRoot: string, taskId: string | null): string {
|
|
37
|
+
const workspaceRelative = taskId
|
|
38
|
+
? `.agents/workspace/active/${taskId}`
|
|
39
|
+
: '.agents/workspace/active';
|
|
40
|
+
return captureWorktreeTree(repoRoot, workspaceRelative);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function captureRepositorySnapshot(repoRoot: string): RepositorySnapshot {
|
|
44
|
+
return {
|
|
45
|
+
head: git(repoRoot, null, ['rev-parse', 'HEAD']).trim(),
|
|
46
|
+
headTree: git(repoRoot, null, ['rev-parse', 'HEAD^{tree}']).trim(),
|
|
47
|
+
worktreeTree: captureWorktreeTree(repoRoot, null)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
31
51
|
function diffWorkspaceSnapshots(repoRoot: string, before: string, after: string): string[] {
|
|
32
52
|
const output = git(repoRoot, null, ['diff', '--name-only', '-z', before, after]);
|
|
33
53
|
return output.split('\0').filter(Boolean);
|
|
34
54
|
}
|
|
35
55
|
|
|
36
|
-
export { captureWorkspaceSnapshot, diffWorkspaceSnapshots };
|
|
56
|
+
export { captureRepositorySnapshot, captureWorkspaceSnapshot, diffWorkspaceSnapshots };
|
|
57
|
+
export type { RepositorySnapshot };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fitlab-ai/agent-infra",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex,
|
|
3
|
+
"version": "0.9.4",
|
|
4
|
+
"description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Antigravity CLI, and OpenCode",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "CodeCaster <codecaster365@outlook.com>",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"collaboration",
|
|
39
39
|
"claude-code",
|
|
40
40
|
"codex",
|
|
41
|
-
"
|
|
41
|
+
"antigravity",
|
|
42
42
|
"opencode",
|
|
43
43
|
"cli",
|
|
44
44
|
"bootstrap",
|
|
@@ -4,7 +4,7 @@ This guide walks you through using multiple AI coding assistants together on a p
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
- At least one AI coding tool installed (Claude Code, Codex CLI,
|
|
7
|
+
- At least one AI coding tool installed (Claude Code, Codex CLI, Antigravity CLI, or OpenCode)
|
|
8
8
|
- A project with `.agents/` directory set up (this project)
|
|
9
9
|
- Familiarity with your project's codebase
|
|
10
10
|
|
|
@@ -18,6 +18,23 @@ git config core.hooksPath .git-hooks
|
|
|
18
18
|
|
|
19
19
|
This makes Git invoke the hooks in the project repository's `.git-hooks/` directory, including `pre-commit` and `check-version-format.sh`.
|
|
20
20
|
|
|
21
|
+
## Development Checkout CLI Alignment
|
|
22
|
+
|
|
23
|
+
When developing agent-infra from a source checkout, install dependencies and rebuild the local CLI before running lifecycle orchestration:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install
|
|
27
|
+
npm run build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Lifecycle hooks prefer the checkout's `dist/bin/internal-cli.js` when it exists and fall back to `agent-infra-internal` on `PATH` otherwise. Rebuild after CLI source changes. If shell commands must also resolve to this checkout, link it and compare the active version with the package version:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm link
|
|
34
|
+
ai version --raw
|
|
35
|
+
node -p "'v' + require('./package.json').version"
|
|
36
|
+
```
|
|
37
|
+
|
|
21
38
|
## External Templates And Skills
|
|
22
39
|
|
|
23
40
|
If your team maintains private platform templates or shared custom skills, configure local sources in `.agents/.airc.json`:
|
|
@@ -49,7 +66,7 @@ cp .agents/templates/task.md .agents/workspace/active/task-001.md
|
|
|
49
66
|
id: task-001
|
|
50
67
|
type: feature # feature | bugfix | refactor | docs | review
|
|
51
68
|
status: open # open | in-progress | review | blocked | completed
|
|
52
|
-
assigned_to: claude # claude | codex |
|
|
69
|
+
assigned_to: claude # claude | codex | antigravity | opencode | human
|
|
53
70
|
```
|
|
54
71
|
|
|
55
72
|
3. Describe the task in the body of the document.
|
|
@@ -69,11 +86,11 @@ claude
|
|
|
69
86
|
|
|
70
87
|
Claude Code excels at codebase exploration and understanding complex relationships between files.
|
|
71
88
|
|
|
72
|
-
### Phase 2: Design (Recommended: Claude Code or
|
|
89
|
+
### Phase 2: Design (Recommended: Claude Code or Antigravity CLI)
|
|
73
90
|
|
|
74
91
|
```bash
|
|
75
|
-
# Continue with Claude Code or switch to
|
|
76
|
-
|
|
92
|
+
# Continue with Claude Code or switch to Antigravity CLI for large codebases
|
|
93
|
+
agy
|
|
77
94
|
|
|
78
95
|
# Example prompt:
|
|
79
96
|
# "Based on the analysis in .agents/workspace/active/task-001.md,
|
|
@@ -134,7 +151,7 @@ cp .agents/templates/review-report.md .agents/workspace/active/review-pr-42.md
|
|
|
134
151
|
|
|
135
152
|
### Refactoring
|
|
136
153
|
|
|
137
|
-
1. **Analyze Scope** (Claude Code /
|
|
154
|
+
1. **Analyze Scope** (Claude Code / Antigravity CLI): Map all affected areas.
|
|
138
155
|
2. **Design** (Claude Code): Plan the refactoring approach.
|
|
139
156
|
3. **Implement** (Codex CLI / OpenCode): Execute the refactoring.
|
|
140
157
|
4. **Verify** (Claude Code): Ensure no regressions, run tests.
|
|
@@ -172,9 +189,9 @@ Even if you're switching between AIs quickly, a brief handoff note saves time an
|
|
|
172
189
|
|
|
173
190
|
### 3. Use the Right Tool for the Job
|
|
174
191
|
|
|
175
|
-
- Complex analysis? Use Claude Code or
|
|
192
|
+
- Complex analysis? Use Claude Code or Antigravity CLI.
|
|
176
193
|
- Straightforward implementation? Use Codex CLI or OpenCode.
|
|
177
|
-
- Large file review? Use
|
|
194
|
+
- Large file review? Use Antigravity CLI.
|
|
178
195
|
|
|
179
196
|
### 4. Keep Tasks Small
|
|
180
197
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## 前提条件
|
|
6
6
|
|
|
7
|
-
- 至少安装一个 AI 编程工具(Claude Code、Codex CLI、
|
|
7
|
+
- 至少安装一个 AI 编程工具(Claude Code、Codex CLI、Antigravity CLI 或 OpenCode)
|
|
8
8
|
- 项目已设置 `.agents/` 目录(本项目已就绪)
|
|
9
9
|
- 熟悉你的项目代码库
|
|
10
10
|
|
|
@@ -18,6 +18,23 @@ git config core.hooksPath .git-hooks
|
|
|
18
18
|
|
|
19
19
|
这样 Git 才会调用项目仓库 `.git-hooks/` 目录下的 hook,包括 `pre-commit` 和 `check-version-format.sh`。
|
|
20
20
|
|
|
21
|
+
## 开发检出中的 CLI 对齐
|
|
22
|
+
|
|
23
|
+
从源码检出开发 agent-infra 时,请先安装依赖并重新构建本地 CLI,再运行生命周期编排:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install
|
|
27
|
+
npm run build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
本地 `dist/bin/internal-cli.js` 存在时,生命周期 hook 会优先使用它;不存在时则回退到 `PATH` 上的 `agent-infra-internal`。修改 CLI 源码后需要重新构建。如果 shell 命令也必须解析到当前检出,请建立链接并比较当前版本与包版本:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm link
|
|
34
|
+
ai version --raw
|
|
35
|
+
node -p "'v' + require('./package.json').version"
|
|
36
|
+
```
|
|
37
|
+
|
|
21
38
|
## 外部模板与 Skill
|
|
22
39
|
|
|
23
40
|
如果团队维护私有平台模板或共享自定义 skill,可在 `.agents/.airc.json` 中配置本地源:
|
|
@@ -49,7 +66,7 @@ cp .agents/templates/task.md .agents/workspace/active/task-001.md
|
|
|
49
66
|
id: task-001
|
|
50
67
|
type: feature # feature | bugfix | refactor | docs | chore
|
|
51
68
|
status: active # active | blocked | completed
|
|
52
|
-
assigned_to: claude # claude | codex |
|
|
69
|
+
assigned_to: claude # claude | codex | antigravity | opencode | human
|
|
53
70
|
```
|
|
54
71
|
|
|
55
72
|
3. 在文档正文中描述任务。
|
|
@@ -69,11 +86,11 @@ claude
|
|
|
69
86
|
|
|
70
87
|
Claude Code 擅长代码库探索和理解文件间的复杂关系。
|
|
71
88
|
|
|
72
|
-
### 阶段 2:设计(推荐:Claude Code 或
|
|
89
|
+
### 阶段 2:设计(推荐:Claude Code 或 Antigravity CLI)
|
|
73
90
|
|
|
74
91
|
```bash
|
|
75
|
-
# 继续使用 Claude Code 或切换到
|
|
76
|
-
|
|
92
|
+
# 继续使用 Claude Code 或切换到 Antigravity CLI 处理大型代码库
|
|
93
|
+
agy
|
|
77
94
|
|
|
78
95
|
# 示例提示:
|
|
79
96
|
# "基于 .agents/workspace/active/task-001.md 中的分析结果,
|
|
@@ -134,7 +151,7 @@ cp .agents/templates/review-report.md .agents/workspace/active/review-pr-42.md
|
|
|
134
151
|
|
|
135
152
|
### 重构
|
|
136
153
|
|
|
137
|
-
1. **分析范围**(Claude Code /
|
|
154
|
+
1. **分析范围**(Claude Code / Antigravity CLI):映射所有受影响区域。
|
|
138
155
|
2. **设计**(Claude Code):规划重构方案。
|
|
139
156
|
3. **实现**(Codex CLI / OpenCode):执行重构。
|
|
140
157
|
4. **验证**(Claude Code):确保没有回归问题,运行测试。
|
|
@@ -172,9 +189,9 @@ cp .agents/templates/handoff.md .agents/workspace/active/handoff-task-001-phase2
|
|
|
172
189
|
|
|
173
190
|
### 3. 选择合适的工具
|
|
174
191
|
|
|
175
|
-
- 复杂分析?使用 Claude Code 或
|
|
192
|
+
- 复杂分析?使用 Claude Code 或 Antigravity CLI。
|
|
176
193
|
- 直接的实现工作?使用 Codex CLI 或 OpenCode。
|
|
177
|
-
- 大文件审查?使用
|
|
194
|
+
- 大文件审查?使用 Antigravity CLI。
|
|
178
195
|
|
|
179
196
|
### 4. 保持任务小而精
|
|
180
197
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Multi-AI Collaboration Guide
|
|
2
2
|
|
|
3
|
-
This project supports collaboration across multiple AI coding assistants, including Claude Code, OpenAI Codex CLI,
|
|
3
|
+
This project supports collaboration across multiple AI coding assistants, including Claude Code, OpenAI Codex CLI, Antigravity CLI, OpenCode, and others.
|
|
4
4
|
|
|
5
5
|
## Dual-Config Architecture
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Different AI tools read configuration from different locations:
|
|
|
10
10
|
|---------|---------------|----------|
|
|
11
11
|
| Claude Code | `.claude/` (CLAUDE.md, commands/, settings.json) | - |
|
|
12
12
|
| OpenAI Codex CLI | `AGENTS.md` | - |
|
|
13
|
-
|
|
|
13
|
+
| Antigravity CLI | `AGENTS.md`, `.agents/skills/` | - |
|
|
14
14
|
| OpenCode | `AGENTS.md` | - |
|
|
15
15
|
| Other AI Tools | `AGENTS.md` | Project README |
|
|
16
16
|
|
|
@@ -75,7 +75,7 @@ When one AI completes a phase, it produces a **handoff document** (see `.agents/
|
|
|
75
75
|
|
|
76
76
|
Each AI tool has different strengths. Use them accordingly:
|
|
77
77
|
|
|
78
|
-
| Capability | Claude Code | Codex CLI |
|
|
78
|
+
| Capability | Claude Code | Codex CLI | Antigravity CLI | OpenCode |
|
|
79
79
|
|-----------|-------------|-----------|------------|----------|
|
|
80
80
|
| Codebase analysis | Excellent | Good | Excellent | Good |
|
|
81
81
|
| Code review | Excellent | Good | Good | Good |
|
|
@@ -88,7 +88,7 @@ Each AI tool has different strengths. Use them accordingly:
|
|
|
88
88
|
|
|
89
89
|
- **Analysis & Review** - Claude Code (strong reasoning, thorough exploration)
|
|
90
90
|
- **Implementation** - Codex CLI or OpenCode (fast code generation, command-driven editing)
|
|
91
|
-
- **Large Context Tasks** -
|
|
91
|
+
- **Large Context Tasks** - Antigravity CLI (large context window for cross-file analysis)
|
|
92
92
|
- **Command-Driven Iteration** - OpenCode (workflow-friendly TUI execution)
|
|
93
93
|
|
|
94
94
|
## Quick Start
|
|
@@ -173,7 +173,7 @@ Write `description` as "one-line responsibility + scenario clause": after the sh
|
|
|
173
173
|
|
|
174
174
|
Set the generic optional `disable-model-invocation` field to `true` when generated TUI commands should disable model invocation; each TUI adapter consumes it according to its capabilities. To preserve line breaks in a multiline `description`, use a YAML literal block (`|`); sync emits the corresponding multiline metadata format for each TUI.
|
|
175
175
|
|
|
176
|
-
After adding or updating a custom skill, run `update-agent-infra` again. The sync step detects non-built-in skills
|
|
176
|
+
After adding or updating a custom skill, run `update-agent-infra` again. The sync step detects non-built-in skills, generates matching commands for Claude Code and OpenCode, and lets Antigravity CLI discover the shared skills directly.
|
|
177
177
|
|
|
178
178
|
### Shared skill sources
|
|
179
179
|
|
|
@@ -220,13 +220,16 @@ Ordinary `managed` files keep their overwrite semantics. A small set of platform
|
|
|
220
220
|
|
|
221
221
|
## Agent Client Configuration
|
|
222
222
|
|
|
223
|
-
Use the top-level `.agents/.airc.json` `agentClients` array to configure all four built-in clients (`claude-code`, `codex`, `
|
|
223
|
+
Use the top-level `.agents/.airc.json` `agentClients` array to configure all four built-in clients (`claude-code`, `codex`, `antigravity-cli`, `opencode`). Each canonical entry has three required fields and one optional orchestration policy:
|
|
224
224
|
|
|
225
225
|
| Field | Meaning |
|
|
226
226
|
|-------|---------|
|
|
227
227
|
| `id` | Built-in Agent Client id. The canonical array contains exactly one entry for each built-in client. |
|
|
228
228
|
| `enabled` | Whether agent-infra writes and maintains that client's project integration and seed command. |
|
|
229
229
|
| `installInSandbox` | Whether the sandbox image installs that client's CLI. This is independent from `enabled`. |
|
|
230
|
+
| `orchestration` | Optional `run-task` default. It must include executor/reviewer `model` and host-native `reasoningEffort`; both roles may use the same model. |
|
|
231
|
+
|
|
232
|
+
Explicit `run-task` model/effort flags are atomic: any one requires all four role fields and configuration never fills omissions. With no explicit policy, only the current client's `orchestration` is used. Query model-selection context with `agent-infra-internal agent-client model-selection --client <id>`; it labels results complete, partial, or interactive-only and never presents a local override list as a complete catalog.
|
|
230
233
|
|
|
231
234
|
Manage these settings without hand-editing JSON:
|
|
232
235
|
|
|
@@ -234,7 +237,7 @@ Manage these settings without hand-editing JSON:
|
|
|
234
237
|
ai agent-client list
|
|
235
238
|
ai agent-client status
|
|
236
239
|
ai agent-client enable codex
|
|
237
|
-
ai agent-client disable
|
|
240
|
+
ai agent-client disable antigravity-cli
|
|
238
241
|
ai agent-client configure
|
|
239
242
|
```
|
|
240
243
|
|