@fitlab-ai/agent-infra 0.9.2 → 0.9.3
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 +10 -9
- package/README.zh-CN.md +10 -9
- package/dist/bin/internal-cli.js +15 -0
- package/dist/lib/agent-clients/adapter.js +45 -2
- package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +10 -1
- 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.js +9 -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 +7 -1
- 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/task-activity.js +73 -0
- package/dist/lib/internal/task-event.js +17 -1
- package/dist/lib/internal/task-lifecycle.js +7 -0
- package/dist/lib/internal/task-orchestration.js +51 -6
- 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/issue-comments.js +3 -2
- package/dist/lib/platform/merged-pr-equivalence.js +115 -5
- package/dist/lib/platform/pr-checks.js +64 -41
- package/dist/lib/platform/pr-review.js +166 -0
- package/dist/lib/platform/pull-requests.js +324 -3
- package/dist/lib/platform/release-notes.js +85 -3
- package/dist/lib/pr-review/evidence-grading.js +229 -0
- package/dist/lib/run/tui.js +3 -5
- package/dist/lib/sandbox/commands/create.js +0 -20
- package/dist/lib/sandbox/commands/show.js +1 -1
- package/dist/lib/task/activity-intent.js +101 -0
- package/dist/lib/task/artifact-lifecycle.js +2 -1
- package/dist/lib/task/commands/log.js +15 -14
- package/dist/lib/task/delegation-receipts.js +23 -2
- package/dist/lib/task/events.js +67 -28
- package/dist/lib/task/finalization-artifacts.js +35 -0
- package/dist/lib/task/lifecycle-execution.js +46 -0
- package/dist/lib/task/orchestration.js +408 -44
- 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 +75 -2
- package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
- package/lib/agent-clients/adapters/claude-code.ts +10 -1
- package/lib/agent-clients/adapters/codex.ts +9 -0
- package/lib/agent-clients/adapters/index.ts +2 -2
- package/lib/agent-clients/adapters/opencode.ts +9 -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 +10 -0
- 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/task-activity.ts +55 -0
- package/lib/internal/task-event.ts +9 -1
- package/lib/internal/task-lifecycle.ts +4 -0
- package/lib/internal/task-orchestration.ts +45 -6
- 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/issue-comments.ts +3 -2
- package/lib/platform/merged-pr-equivalence.ts +127 -5
- package/lib/platform/pr-checks.ts +72 -45
- package/lib/platform/pr-review.ts +201 -0
- package/lib/platform/pull-requests.ts +395 -2
- package/lib/platform/release-notes.ts +100 -4
- package/lib/pr-review/evidence-grading.ts +318 -0
- package/lib/run/tui.ts +3 -4
- package/lib/sandbox/commands/create.ts +0 -20
- package/lib/sandbox/commands/show.ts +1 -1
- package/lib/server/server.schema.json +2 -2
- package/lib/task/activity-intent.ts +128 -0
- package/lib/task/artifact-lifecycle.ts +2 -1
- package/lib/task/commands/log.ts +15 -14
- package/lib/task/delegation-receipts.ts +32 -3
- package/lib/task/events.ts +75 -30
- package/lib/task/finalization-artifacts.ts +58 -0
- package/lib/task/lifecycle-execution.ts +106 -0
- package/lib/task/orchestration.ts +543 -64
- 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/create-issue.github.en.md +4 -2
- package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -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 +2 -2
- 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/task-management.en.md +11 -0
- package/templates/.agents/rules/task-management.zh-CN.md +11 -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 +9 -6
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -8
- package/templates/.agents/skills/commit/SKILL.en.md +3 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -1
- 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/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/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 +21 -6
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +21 -6
- 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 +3 -1
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -1
- 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/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 +9 -6
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +9 -6
- 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 +158 -0
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +158 -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 +35 -61
- 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 +1 -1
- package/templates/.agents/templates/task.zh-CN.md +1 -1
- 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/.gemini/commands/_project_/review-pr.en.toml +10 -0
- package/templates/.gemini/commands/_project_/review-pr.zh-CN.toml +10 -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/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,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`,并把缺口记录为人工验证项。
|
|
@@ -40,7 +40,7 @@ const DEFAULTS = {
|
|
|
40
40
|
"installInSandbox": true
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
"id": "
|
|
43
|
+
"id": "antigravity-cli",
|
|
44
44
|
"enabled": true,
|
|
45
45
|
"installInSandbox": true
|
|
46
46
|
},
|
|
@@ -146,18 +146,12 @@ const AGENT_CLIENT_MANIFEST = [
|
|
|
146
146
|
"ejected": []
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
"id": "
|
|
150
|
-
"displayName": "
|
|
151
|
-
"invocation": "/${
|
|
152
|
-
"ownedPathPrefixes": [
|
|
153
|
-
|
|
154
|
-
],
|
|
155
|
-
"managed": [
|
|
156
|
-
".gemini/commands/"
|
|
157
|
-
],
|
|
158
|
-
"merged": [
|
|
159
|
-
".gemini/settings.json"
|
|
160
|
-
],
|
|
149
|
+
"id": "antigravity-cli",
|
|
150
|
+
"displayName": "Antigravity CLI",
|
|
151
|
+
"invocation": "/${skillName}",
|
|
152
|
+
"ownedPathPrefixes": [],
|
|
153
|
+
"managed": [],
|
|
154
|
+
"merged": [],
|
|
161
155
|
"ejected": []
|
|
162
156
|
},
|
|
163
157
|
{
|
|
@@ -276,10 +270,11 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
276
270
|
}
|
|
277
271
|
const keys = Object.keys(candidate);
|
|
278
272
|
if (
|
|
279
|
-
keys.length !== 3
|
|
273
|
+
(keys.length !== 3 && keys.length !== 4)
|
|
280
274
|
|| !own(candidate, 'id')
|
|
281
275
|
|| !own(candidate, 'enabled')
|
|
282
276
|
|| !own(candidate, 'installInSandbox')
|
|
277
|
+
|| (keys.length === 4 && !own(candidate, 'orchestration'))
|
|
283
278
|
) {
|
|
284
279
|
return failure('INVALID_AGENT_CLIENTS', entryPath);
|
|
285
280
|
}
|
|
@@ -290,9 +285,32 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
290
285
|
if (typeof candidate.enabled !== 'boolean' || typeof candidate.installInSandbox !== 'boolean') {
|
|
291
286
|
return failure('INVALID_AGENT_CLIENTS', entryPath);
|
|
292
287
|
}
|
|
288
|
+
let orchestration;
|
|
289
|
+
if (own(candidate, 'orchestration')) {
|
|
290
|
+
const policy = candidate.orchestration;
|
|
291
|
+
const exact = (value) => typeof value === 'string' && value.length > 0 && value.trim() === value;
|
|
292
|
+
const validRole = (role) => role
|
|
293
|
+
&& typeof role === 'object'
|
|
294
|
+
&& !Array.isArray(role)
|
|
295
|
+
&& Object.keys(role).length === 2
|
|
296
|
+
&& exact(role.model)
|
|
297
|
+
&& exact(role.reasoningEffort);
|
|
298
|
+
if (
|
|
299
|
+
!policy
|
|
300
|
+
|| typeof policy !== 'object'
|
|
301
|
+
|| Array.isArray(policy)
|
|
302
|
+
|| Object.keys(policy).length !== 2
|
|
303
|
+
|| !validRole(policy.executor)
|
|
304
|
+
|| !validRole(policy.reviewer)
|
|
305
|
+
) {
|
|
306
|
+
return failure('INVALID_AGENT_CLIENTS', `${entryPath}.orchestration`);
|
|
307
|
+
}
|
|
308
|
+
orchestration = structuredClone(policy);
|
|
309
|
+
}
|
|
293
310
|
entries.set(candidate.id, {
|
|
294
311
|
enabled: candidate.enabled,
|
|
295
|
-
installInSandbox: candidate.installInSandbox
|
|
312
|
+
installInSandbox: candidate.installInSandbox,
|
|
313
|
+
...(orchestration ? { orchestration } : {})
|
|
296
314
|
});
|
|
297
315
|
}
|
|
298
316
|
if (BUILTIN_TUI_IDS.some((id) => !entries.has(id))) {
|
|
@@ -547,14 +565,13 @@ function detectCustomSkills(projectRoot, templateSkillNames) {
|
|
|
547
565
|
.sort((left, right) => left.dirName.localeCompare(right.dirName));
|
|
548
566
|
}
|
|
549
567
|
|
|
550
|
-
function isCustomProtected(targetPath, customSkills,
|
|
568
|
+
function isCustomProtected(targetPath, customSkills, customTUICommandTargets) {
|
|
551
569
|
const normalized = norm(targetPath);
|
|
552
570
|
|
|
553
571
|
return customSkills.some(({ dirName }) => (
|
|
554
572
|
normalized.startsWith(`.agents/skills/${dirName}/`) ||
|
|
555
573
|
normalized === `.claude/commands/${dirName}.md` ||
|
|
556
574
|
normalized === `.opencode/commands/${dirName}.md` ||
|
|
557
|
-
normalized === '.gemini/commands/' + project + '/' + dirName + '.toml' ||
|
|
558
575
|
customTUICommandTargets.has(normalized)
|
|
559
576
|
));
|
|
560
577
|
}
|
|
@@ -763,15 +780,6 @@ function formatYamlMetadata(key, value) {
|
|
|
763
780
|
return [`${key}: |-`, ...value.split('\n').map((line) => ` ${line}`)];
|
|
764
781
|
}
|
|
765
782
|
|
|
766
|
-
function formatTomlMetadata(key, value) {
|
|
767
|
-
if (!value.includes('\n')) {
|
|
768
|
-
return `${key} = ${JSON.stringify(value)}`;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
const lines = value.split('\n').map((line) => JSON.stringify(line).slice(1, -1));
|
|
772
|
-
return `${key} = """${lines.join('\n')}"""`;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
783
|
function generateClaudeCommand(skill, lang) {
|
|
776
784
|
const isZhCN = lang === 'zh-CN';
|
|
777
785
|
const lines = ['---', ...formatYamlMetadata('description', skill.description)];
|
|
@@ -796,31 +804,6 @@ function generateClaudeCommand(skill, lang) {
|
|
|
796
804
|
return `${lines.join('\n')}\n`;
|
|
797
805
|
}
|
|
798
806
|
|
|
799
|
-
function generateGeminiCommand(skill, lang) {
|
|
800
|
-
const isZhCN = lang === 'zh-CN';
|
|
801
|
-
const promptLines = [];
|
|
802
|
-
|
|
803
|
-
if (skill.args) {
|
|
804
|
-
promptLines.push(isZhCN ? '参数:{{args}}' : 'Arguments: {{args}}');
|
|
805
|
-
promptLines.push('');
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
promptLines.push(
|
|
809
|
-
isZhCN
|
|
810
|
-
? `读取并执行 \`.agents/skills/${skill.dirName}/SKILL.md\` 中的 ${skill.dirName} 技能。`
|
|
811
|
-
: `Read and execute the ${skill.dirName} skill from \`.agents/skills/${skill.dirName}/SKILL.md\`.`
|
|
812
|
-
);
|
|
813
|
-
promptLines.push('');
|
|
814
|
-
promptLines.push(isZhCN ? '严格按照技能中定义的所有步骤执行。' : 'Follow all steps defined in the skill exactly.');
|
|
815
|
-
|
|
816
|
-
return [
|
|
817
|
-
formatTomlMetadata('description', skill.description),
|
|
818
|
-
'prompt = """',
|
|
819
|
-
...promptLines,
|
|
820
|
-
'"""'
|
|
821
|
-
].join('\n') + '\n';
|
|
822
|
-
}
|
|
823
|
-
|
|
824
807
|
function generateOpenCodeCommand(skill, lang) {
|
|
825
808
|
const isZhCN = lang === 'zh-CN';
|
|
826
809
|
const lines = [
|
|
@@ -1069,7 +1052,6 @@ function learnAndGenerateCommands(projectRoot, customSkills, tool, templateSkill
|
|
|
1069
1052
|
function generateCustomCommands(
|
|
1070
1053
|
projectRoot,
|
|
1071
1054
|
customSkills,
|
|
1072
|
-
project,
|
|
1073
1055
|
lang,
|
|
1074
1056
|
report,
|
|
1075
1057
|
customTUIs,
|
|
@@ -1085,13 +1067,6 @@ function generateCustomCommands(
|
|
|
1085
1067
|
report.custom.commands
|
|
1086
1068
|
);
|
|
1087
1069
|
}
|
|
1088
|
-
if (enabledTUIs.has('gemini-cli')) {
|
|
1089
|
-
managedWriter(
|
|
1090
|
-
'.gemini/commands/' + project + '/' + skill.dirName + '.toml',
|
|
1091
|
-
generateGeminiCommand(skill, lang),
|
|
1092
|
-
report.custom.commands
|
|
1093
|
-
);
|
|
1094
|
-
}
|
|
1095
1070
|
if (enabledTUIs.has('opencode')) {
|
|
1096
1071
|
managedWriter(
|
|
1097
1072
|
`.opencode/commands/${skill.dirName}.md`,
|
|
@@ -1699,7 +1674,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1699
1674
|
for (const projFile of projFiles) {
|
|
1700
1675
|
if (expectedTargets.has(projFile)) continue;
|
|
1701
1676
|
if (projFile === configPathRel) continue;
|
|
1702
|
-
if (isCustomProtected(projFile, protectedCustomSkills,
|
|
1677
|
+
if (isCustomProtected(projFile, protectedCustomSkills, customTUICommandTargets)) continue;
|
|
1703
1678
|
if (matchesAny(projFile, merged) || matchesAny(projFile, ejected)) continue;
|
|
1704
1679
|
if (assetPlan.enabledManaged.includes(entry)) {
|
|
1705
1680
|
const baseline = trustedBaseline(managedBaselines[projFile]);
|
|
@@ -1741,7 +1716,6 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1741
1716
|
generateCustomCommands(
|
|
1742
1717
|
projectRoot,
|
|
1743
1718
|
customSkills,
|
|
1744
|
-
project,
|
|
1745
1719
|
lang,
|
|
1746
1720
|
report,
|
|
1747
1721
|
customTUIs,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: watch-pr
|
|
3
3
|
description: >
|
|
4
|
-
Watch
|
|
5
|
-
Use when
|
|
4
|
+
Watch PR readiness and self-heal required-check failures or merge conflicts.
|
|
5
|
+
Use when a PR must be monitored until checks pass and it is explicitly mergeable.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Watch Pull Request
|
|
9
9
|
|
|
10
|
-
After `create-pr`, continuously watch
|
|
10
|
+
After `create-pr`, continuously watch required checks and mergeability for the same PR head. Only passed checks plus explicit mergeability may reach success; check failures use the existing repair path, conflicts use constrained rebase healing, and unknown or unsafe states fail closed.
|
|
11
11
|
|
|
12
12
|
## Behavior Boundaries / Key Rules
|
|
13
13
|
|
|
14
|
-
- Only
|
|
14
|
+
- Only self-heal the current PR's required checks and text merge conflicts; do not add approval or repository-rule readiness dimensions.
|
|
15
15
|
- Self-heal publishes through Git workflow intents, but **affected tests must pass first**; the attempt cap and code-layer authorization remain unchanged.
|
|
16
16
|
- The help exit is "produce-then-stop": end this round, output the blocker explanation, and wait for the user to trigger the next step — **never** ask mid-flow.
|
|
17
17
|
- Bare numbers / `NN` / `TASK-id` arguments are always resolved as task short ids (see `.agents/rules/task-short-id.md`); a PR number is passed only via `--pr <number>` / a PR URL / omission (current branch), never reusing the bare-number syntax.
|
|
@@ -44,21 +44,21 @@ Resolve the target PR number `{pr#}` and an optional `{task-id}` via these deter
|
|
|
44
44
|
- Scenario C (`--pr <number>` or a PR URL): use that PR number directly as `{pr#}`; then determine `{task-id}` via "Reverse-lookup task".
|
|
45
45
|
- Reverse-lookup task (scenarios A / C): use task context/query capabilities to find the unique active task bound to `{pr#}`. If none exists, stop and request binding first; the typed checks intent does not create a second taskless state machine.
|
|
46
46
|
|
|
47
|
-
### 2. Watch
|
|
47
|
+
### 2. Watch PR Readiness
|
|
48
48
|
|
|
49
49
|
Before running this step, read `reference/monitor-and-heal.md` and `.agents/rules/pr-checks-commands.md`.
|
|
50
50
|
|
|
51
|
-
Initialize
|
|
51
|
+
Initialize `repairCommits=[]` and `rebaseAttempts=0`. Run `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`, then route only by `readiness.state`: `ready` to step 7, `conflicting|checks-failed` to step 3, and `pending|timed-out|cancelled` to step 4.
|
|
52
52
|
|
|
53
|
-
### 3.
|
|
53
|
+
### 3. Self-Heal Loop
|
|
54
54
|
|
|
55
55
|
Before running this step, read the "Self-Heal Decision Tree" of `reference/monitor-and-heal.md` and "Resolve a Failing Run id and Pull Logs" of `.agents/rules/pr-checks-commands.md`.
|
|
56
56
|
|
|
57
|
-
For a locatable code-layer failure,
|
|
57
|
+
For `checks-failed`, minimally fix a locatable code-layer failure, test, and publish through the existing commit/push intents. For `conflicting`, follow the reference's same-repository, clean-tree, head/base identity, rebase, full-test, and `git-workflow push-rebased` exact-lease flow, capped at two attempts. Append only remotely verified SHAs, then watch the new head again; any failed safety check goes to step 4.
|
|
58
58
|
|
|
59
59
|
### 4. Help Exit (Produce-Then-Stop)
|
|
60
60
|
|
|
61
|
-
When
|
|
61
|
+
When healing hits a cap, a check failure is non-code/unlocatable, readiness stays unknown, or rebase, tests, remote identity, or exact lease cannot close safely, stop and report the PR head/base, conflict paths, remote facts, tests, and attempts using the reference template. Do **not** render a next-step command. Then run steps 5/6 on the task-anchored path.
|
|
62
62
|
|
|
63
63
|
### 5. Update Task State
|
|
64
64
|
|
|
@@ -77,7 +77,7 @@ Update `.agents/workspace/active/{task-id}/task.md`:
|
|
|
77
77
|
- **Do not change** `pr_status` (keep `created`) or `current_step`
|
|
78
78
|
- **Append** to `## Activity Log` (do not overwrite prior entries; `{N}` = number of existing Watch PR entries for this task + 1):
|
|
79
79
|
```
|
|
80
|
-
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N})** by {agent} — {
|
|
80
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N})** by {agent} — {success: PR ready, repair commits: {k} [{SHA summary}] / blocked: blocked: {summary}}
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
### 6. Verification Gate
|
|
@@ -104,7 +104,7 @@ Keep the gate output in your reply as the verification evidence. Without current
|
|
|
104
104
|
> Before rendering next steps, read `.agents/rules/next-step-output.md`, invoke the shared helper only for the selected scenario, and insert its stdout at `{next-step-commands}`.
|
|
105
105
|
|
|
106
106
|
Output per scenario:
|
|
107
|
-
-
|
|
107
|
+
- `ready` + task-anchored: state that required checks passed and the current head is explicitly mergeable, then render exactly one exit based on whether this run created repair commits (`{task-ref}` becomes the short id):
|
|
108
108
|
|
|
109
109
|
`repairCommits.length == 0`:
|
|
110
110
|
|
|
@@ -129,8 +129,8 @@ Populate `{next-step-commands}` for this scenario by running `agent-infra-intern
|
|
|
129
129
|
## Completion Checklist
|
|
130
130
|
|
|
131
131
|
- [ ] Resolved the target PR (and any task context)
|
|
132
|
-
- [ ] Completed
|
|
133
|
-
- [ ]
|
|
132
|
+
- [ ] Completed readiness watching; success requires passed checks and explicit mergeability
|
|
133
|
+
- [ ] Check/rebase healing passed local tests and its safety intent within the attempt cap
|
|
134
134
|
- [ ] Task-anchored path: updated task.md and appended the Watch PR Activity Log entry
|
|
135
135
|
- [ ] Task-anchored path: verification gate passed
|
|
136
136
|
- [ ] Rendered the selected next-step commands through the shared helper
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: watch-pr
|
|
3
3
|
description: >
|
|
4
|
-
监控 PR
|
|
5
|
-
|
|
4
|
+
监控 PR readiness,并在 required checks 失败或合并冲突时自愈。
|
|
5
|
+
当需要持续监控 PR 直到门禁通过且明确可合入时使用。
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# 监控 Pull Request
|
|
9
9
|
|
|
10
|
-
在 `create-pr`
|
|
10
|
+
在 `create-pr` 之后持续监控同一 PR head 的 required checks 与 mergeability。只有 checks 通过且平台明确可合入才进入成功出口;check 失败走既有修复,合并冲突走受限 rebase 自愈,未知或无法安全闭环时 fail-closed。
|
|
11
11
|
|
|
12
12
|
## 行为边界 / 关键规则
|
|
13
13
|
|
|
14
|
-
- 仅监控 + 自愈当前 PR 的 required checks
|
|
14
|
+
- 仅监控 + 自愈当前 PR 的 required checks 与文本合并冲突;不扩展到审批或其他仓库规则。
|
|
15
15
|
- 自愈通过 Git workflow intent 发布修复,但**发布前必须本地跑通相关测试**;修复上限与代码层分类授权不变。
|
|
16
16
|
- 求助出口是「产出后停止」语义:停止本轮、输出阻塞说明、等待用户主动触发,**不**中途提问。
|
|
17
17
|
- 裸数字 / `NN` / `TASK-id` 入参一律按任务短号解析(见 `.agents/rules/task-short-id.md`);PR 号只走 `--pr <number>` / PR URL / 省略(当前分支),不复用裸数字语法。
|
|
@@ -44,21 +44,21 @@ description: >
|
|
|
44
44
|
- 场景 C(`--pr <number>` 或 PR URL):直接取该 PR 号为 `{pr#}`;随后按「反查任务」确定 `{task-id}`。
|
|
45
45
|
- 反查任务(场景 A / C):通过任务上下文/任务查询取得与 `{pr#}` 唯一绑定的 active task。未命中时停止并提示先绑定 PR;typed checks intent 不建立第二套无任务状态机。
|
|
46
46
|
|
|
47
|
-
### 2. 监控
|
|
47
|
+
### 2. 监控 PR readiness
|
|
48
48
|
|
|
49
49
|
执行此步骤前,先读取 `reference/monitor-and-heal.md` 与 `.agents/rules/pr-checks-commands.md`。
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
进入本轮时初始化 `repairCommits=[]` 与 `rebaseAttempts=0`。调用 `agent-infra-internal platform-checks watch {task-id} --interval-seconds 30 --deadline-seconds 1800`,只按结构化 `readiness.state` 分流:`ready` 进入步骤 7,`conflicting` 或 `checks-failed` 进入步骤 3,`pending|timed-out|cancelled` 进入步骤 4。
|
|
52
52
|
|
|
53
|
-
### 3.
|
|
53
|
+
### 3. 自愈循环
|
|
54
54
|
|
|
55
55
|
执行此步骤前,先读取 `reference/monitor-and-heal.md` 的「自愈决策树」与 `.agents/rules/pr-checks-commands.md` 的「解析失败 run id 并拉日志」。
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
`checks-failed` 只对可定位代码层失败做最小修复和测试,再用既有 commit/push intent 发布。`conflicting` 严格执行 reference 的同仓库、干净工作树、head/base 身份、rebase、完整测试与 `git-workflow push-rebased` 精确 lease 流程;上限 2 次。仅记录远端复核成功的 SHA,随后重新监控新 head;任一安全检查失败转步骤 4。
|
|
58
58
|
|
|
59
59
|
### 4. 求助出口(产出后停止)
|
|
60
60
|
|
|
61
|
-
当自愈达上限、失败属非代码层、run id
|
|
61
|
+
当自愈达上限、失败属非代码层、run id 不可定位、readiness 未知/超时,或 rebase、测试、远端身份、精确 lease 任一无法闭环时,停止本轮并按 reference 汇总 PR head/base、冲突文件、远端事实、测试与尝试记录。**不**渲染下一步命令。随后在任务锚定路径下执行步骤 5/6。
|
|
62
62
|
|
|
63
63
|
### 5. 更新任务状态
|
|
64
64
|
|
|
@@ -77,7 +77,7 @@ date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'
|
|
|
77
77
|
- **不改** `pr_status`(保持 `created`)与 `current_step`
|
|
78
78
|
- **追加**到 `## 活动日志`(不要覆盖之前的记录;`{N}` = 本任务已有 Watch PR 条目数 + 1):
|
|
79
79
|
```
|
|
80
|
-
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N})** by {agent} — {
|
|
80
|
+
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Watch PR (Round {N})** by {agent} — {成功:PR ready, repair commits: {k} [{sha 摘要}] / 阻塞:blocked: {简述}}
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
### 6. 完成校验
|
|
@@ -104,7 +104,7 @@ agent-infra-internal task-verify {task-id} watch-pr.completed --format text
|
|
|
104
104
|
> 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
|
|
105
105
|
|
|
106
106
|
按场景输出:
|
|
107
|
-
-
|
|
107
|
+
- `ready` + 任务锚定:说明 required checks 已通过且当前 head 明确可合入,并只按本轮是否产生修复 commit 渲染一个出口(`{task-ref}` 替换为短号):
|
|
108
108
|
|
|
109
109
|
`repairCommits.length == 0`:
|
|
110
110
|
|
|
@@ -129,8 +129,8 @@ agent-infra-internal task-verify {task-id} watch-pr.completed --format text
|
|
|
129
129
|
## 完成检查清单
|
|
130
130
|
|
|
131
131
|
- [ ] 解析出目标 PR(及可能的任务上下文)
|
|
132
|
-
- [ ] 完成
|
|
133
|
-
- [ ]
|
|
132
|
+
- [ ] 完成 readiness 监控,只有 checks 通过且明确可合入才得到成功结论
|
|
133
|
+
- [ ] check / rebase 自愈均通过本地测试和对应安全 intent,且未超修复上限
|
|
134
134
|
- [ ] 任务锚定路径:更新了 task.md 并追加 Watch PR 的 Activity Log
|
|
135
135
|
- [ ] 任务锚定路径:完成校验通过
|
|
136
136
|
- [ ] 已通过统一 helper 渲染已选场景的下一步命令
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Platform-agnostic decision logic for `watch-pr` steps 2/3/4. The concrete platform commands (watch, resolve a failing run, pull logs, read the PR number) live in `.agents/rules/pr-checks-commands.md`; this file only describes platform-independent classification and decisions.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Readiness Classification
|
|
6
6
|
|
|
7
|
-
After
|
|
7
|
+
After the watch command, route by structured `readiness.state`:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- `ready`: required checks passed and the same head is explicitly mergeable → SKILL step 7.
|
|
10
|
+
- `checks-failed`: a required check failed or was cancelled → CI healing in SKILL step 3.
|
|
11
|
+
- `conflicting`: the platform explicitly reports a head/base conflict → rebase healing in SKILL step 3.
|
|
12
|
+
- `pending|timed-out|cancelled`: no reliable success fact exists → SKILL step 4.
|
|
12
13
|
|
|
13
14
|
## Self-Heal Decision Tree
|
|
14
15
|
|
|
@@ -34,6 +35,23 @@ For each failing check, decide "self-heal" vs "ask for help" in this order:
|
|
|
34
35
|
- Append the fix commit SHA to this run's `repairCommits`, increment the fix count, and return to SKILL step 2. When checks turn green, an empty list routes to `complete-task`; a non-empty list routes to `review-code`.
|
|
35
36
|
- Never make unrelated "drive-by" optimizations; never loosen / skip the failing assertion to "make it green".
|
|
36
37
|
|
|
38
|
+
## Merge-Conflict Healing
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
# conflict-heal-contract
|
|
42
|
+
strategy: rebase
|
|
43
|
+
remote-update: exact-lease
|
|
44
|
+
unsafe: help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
1. Continue only when the PR, head, and base repositories match; the current branch equals the head ref; local HEAD equals the snapshot head SHA; and the worktree/index are clean.
|
|
48
|
+
2. Select a remote that exactly matches the PR repository, fetch the base ref, record the full `expectedBaseHead`, and confirm the remote head still equals the full old SHA.
|
|
49
|
+
3. Run `git rebase <expectedBaseHead>`. Handle only Git-reported text unmerged paths. If resolution is unsafe, run `git rebase --abort`, record paths and both SHAs, and use help.
|
|
50
|
+
4. After rebase, run the project `test` skill's full validation. Never push a failing result.
|
|
51
|
+
5. Write remote, branch, full `expectedOldHead`, `newHead`, baseBranch, and full `expectedBaseHead` to a temporary intent outside the repository; call `agent-infra-internal git-workflow push-rebased --input {intent.json}`.
|
|
52
|
+
6. Core verifies clean state, branch/HEAD, remote head/base, ancestry, exact `--force-with-lease`, and the post-push SHA. Never fall back to generic force; refresh the PR snapshot or use help.
|
|
53
|
+
7. On success, append the new SHA to `repairCommits`, increment `rebaseAttempts`, and watch the new head. Cap at two attempts; a final ready state with repairs routes only to `review-code`.
|
|
54
|
+
|
|
37
55
|
## Help Report Template
|
|
38
56
|
|
|
39
57
|
When entering the help exit, output the following fixed structure to the user (not written to any artifact file):
|
|
@@ -41,7 +59,10 @@ When entering the help exit, output the following fixed structure to the user (n
|
|
|
41
59
|
```
|
|
42
60
|
PR #{pr#} monitoring is blocked; manual intervention needed.
|
|
43
61
|
|
|
44
|
-
Blocker: {non-code layer /
|
|
62
|
+
Blocker: {non-code layer / cap reached / run unlocatable / readiness unknown / unsafe rebase or update}
|
|
63
|
+
PR head/base: {repository/ref/SHA}
|
|
64
|
+
Conflict and remote facts: {paths / expected and actual head/base / rebase abort state}
|
|
65
|
+
Validation: {command and failure summary, or why it did not run}
|
|
45
66
|
Failing check: {name} (workflow: {workflow})
|
|
46
67
|
Failing run / logs: {run/job link}
|
|
47
68
|
Fixes attempted ({k} total):
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
`watch-pr` 步骤 2/3/4 的平台无关判定逻辑。具体平台命令(监控、解析失败 run、拉日志、读取 PR 号)见 `.agents/rules/pr-checks-commands.md`;本文件只描述与平台无关的分类与决策。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Readiness 分类
|
|
6
6
|
|
|
7
7
|
按 `.agents/rules/pr-checks-commands.md` 的监控命令执行后,依其退出码归为三类:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- `ready`:同一 head 的 required checks 通过且平台明确可合入 → SKILL 步骤 7。
|
|
10
|
+
- `checks-failed`:至少一个 required check 失败或取消 → SKILL 步骤 3 的 CI 自愈。
|
|
11
|
+
- `conflicting`:平台明确当前 head 与 base 冲突 → SKILL 步骤 3 的 rebase 自愈。
|
|
12
|
+
- `pending|timed-out|cancelled`:mergeability/checks 未形成可靠成功事实 → SKILL 步骤 4。
|
|
12
13
|
|
|
13
14
|
## 自愈决策树
|
|
14
15
|
|
|
@@ -34,6 +35,23 @@ unknown: help
|
|
|
34
35
|
- 将本次修复的 commit SHA 追加到当前运行的 `repairCommits`,修复计数 +1,回到 SKILL 步骤 2 重新监控;全绿时列表为空走 `complete-task`,非空走 `review-code`。
|
|
35
36
|
- 绝不执行与失败无关的「顺手优化」;不放宽 / 跳过失败的断言来「修绿」。
|
|
36
37
|
|
|
38
|
+
## 合并冲突自愈
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
# conflict-heal-contract
|
|
42
|
+
strategy: rebase
|
|
43
|
+
remote-update: exact-lease
|
|
44
|
+
unsafe: help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
1. 仅当 PR、head 与 base repository 完全相同,当前分支等于 head ref,本地 HEAD 等于快照 head SHA,且工作树/暂存区干净时继续;否则求助。
|
|
48
|
+
2. 找到与 PR repository 精确匹配的 remote,抓取 base ref,记录完整 `expectedBaseHead`,并确认远端 head 仍等于完整旧 SHA。
|
|
49
|
+
3. 执行 `git rebase <expectedBaseHead>`。只处理 Git 报告的文本 unmerged paths;无法可靠解决时 `git rebase --abort`,记录冲突路径和双方 SHA 后求助。
|
|
50
|
+
4. rebase 完成后运行项目 `test` skill 的完整验证。失败时不推送。
|
|
51
|
+
5. 把 remote、branch、完整 `expectedOldHead`、`newHead`、baseBranch 和完整 `expectedBaseHead` 写入仓库外的临时 intent JSON,调用 `agent-infra-internal git-workflow push-rebased --input {intent.json}`。
|
|
52
|
+
6. core 会复核干净状态、分支/HEAD、远端 head/base、ancestor、精确 `--force-with-lease` 与推送后远端 SHA。任一失败不得改用普通 force;重新取 PR 快照或求助。
|
|
53
|
+
7. 推送成功后把新 SHA 加入 `repairCommits`,`rebaseAttempts += 1`,重新监控新 head。上限 2 次;最终 ready 且列表非空时只进入 `review-code` 出口。
|
|
54
|
+
|
|
37
55
|
## 求助报告模板
|
|
38
56
|
|
|
39
57
|
进入求助出口时,向用户输出以下固定结构(不写入产物文件):
|
|
@@ -41,7 +59,10 @@ unknown: help
|
|
|
41
59
|
```
|
|
42
60
|
PR #{pr#} 监控阻塞,需人工介入。
|
|
43
61
|
|
|
44
|
-
阻塞原因:{非代码层 / 达修复上限 / run 不可定位 /
|
|
62
|
+
阻塞原因:{非代码层 / 达修复上限 / run 不可定位 / readiness 未知 / rebase 或安全更新失败}
|
|
63
|
+
PR head/base:{repository/ref/SHA}
|
|
64
|
+
冲突与远端事实:{conflict paths / expected 与 actual head/base / rebase abort 状态}
|
|
65
|
+
验证:{命令与失败摘要;未运行则说明原因}
|
|
45
66
|
失败 check:{name}(workflow:{workflow})
|
|
46
67
|
失败 run / 日志:{run/job 链接}
|
|
47
68
|
已尝试的修复(共 {k} 次):
|
|
@@ -12,7 +12,7 @@ effort: # Optional Issue field: High | Medium | Low
|
|
|
12
12
|
start_date: # Optional Issue field for Feature: YYYY-MM-DD
|
|
13
13
|
target_date: # Optional Issue field for Feature: YYYY-MM-DD
|
|
14
14
|
current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
|
|
15
|
-
assigned_to: # claude | codex |
|
|
15
|
+
assigned_to: # claude | codex | antigravity | opencode | human
|
|
16
16
|
pr_status: pending # PR status: pending (default) | created (PR created) | skipped (explicitly skipped)
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ effort: # 可选 Issue 字段:High | Medium | Low
|
|
|
12
12
|
start_date: # Feature 可选 Issue 字段:YYYY-MM-DD
|
|
13
13
|
target_date: # Feature 可选 Issue 字段:YYYY-MM-DD
|
|
14
14
|
current_step: requirement-analysis # requirement-analysis | requirement-analysis-review | technical-design | technical-design-review | code | code-review | completed
|
|
15
|
-
assigned_to: # claude | codex |
|
|
15
|
+
assigned_to: # claude | codex | antigravity | opencode | human
|
|
16
16
|
pr_status: pending # PR 状态:pending(默认)| created(已创建 PR)| skipped(显式跳过)
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -14,7 +14,7 @@ steps:
|
|
|
14
14
|
description: Reproduce the defect, identify the root cause, and define the fix scope.
|
|
15
15
|
recommended_agents:
|
|
16
16
|
- claude
|
|
17
|
-
-
|
|
17
|
+
- antigravity
|
|
18
18
|
tasks:
|
|
19
19
|
- Understand the defect report and expected behavior
|
|
20
20
|
- Reproduce the defect when possible
|
|
@@ -39,7 +39,7 @@ steps:
|
|
|
39
39
|
description: Review whether the defect analysis has sufficient reproduction evidence, a clear root cause, and a scoped fix.
|
|
40
40
|
recommended_agents:
|
|
41
41
|
- claude
|
|
42
|
-
-
|
|
42
|
+
- antigravity
|
|
43
43
|
tasks:
|
|
44
44
|
- Verify reproduction evidence or the non-reproducible explanation
|
|
45
45
|
- Check root-cause reasoning and impact scope
|
|
@@ -93,7 +93,7 @@ steps:
|
|
|
93
93
|
description: Review whether the fix plan addresses the root cause, has sufficient tests, and controls side effects.
|
|
94
94
|
recommended_agents:
|
|
95
95
|
- claude
|
|
96
|
-
-
|
|
96
|
+
- antigravity
|
|
97
97
|
tasks:
|
|
98
98
|
- Verify the plan covers the approved root-cause analysis
|
|
99
99
|
- Check regression test strategy and potential side effects
|
|
@@ -13,7 +13,7 @@ steps:
|
|
|
13
13
|
description: 复现缺陷,识别根本原因,确定修复范围。
|
|
14
14
|
recommended_agents:
|
|
15
15
|
- claude
|
|
16
|
-
-
|
|
16
|
+
- antigravity
|
|
17
17
|
tasks:
|
|
18
18
|
- 理解缺陷报告和预期行为
|
|
19
19
|
- 复现缺陷(如果可能)
|
|
@@ -38,7 +38,7 @@ steps:
|
|
|
38
38
|
description: 审查缺陷分析是否复现充分、根因明确且修复范围清晰。
|
|
39
39
|
recommended_agents:
|
|
40
40
|
- claude
|
|
41
|
-
-
|
|
41
|
+
- antigravity
|
|
42
42
|
tasks:
|
|
43
43
|
- 验证缺陷复现或不可复现说明
|
|
44
44
|
- 检查根因推导和影响范围
|
|
@@ -92,7 +92,7 @@ steps:
|
|
|
92
92
|
description: 审查修复方案是否覆盖根因、测试充分且副作用可控。
|
|
93
93
|
recommended_agents:
|
|
94
94
|
- claude
|
|
95
|
-
-
|
|
95
|
+
- antigravity
|
|
96
96
|
tasks:
|
|
97
97
|
- 验证方案覆盖已批准的根因分析
|
|
98
98
|
- 检查回归测试策略和潜在副作用
|
|
@@ -14,7 +14,7 @@ steps:
|
|
|
14
14
|
description: Analyze feature requirements, explore the codebase, and identify affected areas.
|
|
15
15
|
recommended_agents:
|
|
16
16
|
- claude
|
|
17
|
-
-
|
|
17
|
+
- antigravity
|
|
18
18
|
tasks:
|
|
19
19
|
- Read and understand the feature requirements
|
|
20
20
|
- Explore the codebase to identify relevant files and modules
|
|
@@ -37,7 +37,7 @@ steps:
|
|
|
37
37
|
description: Review whether the requirement analysis is complete, verifiable, and clearly scoped.
|
|
38
38
|
recommended_agents:
|
|
39
39
|
- claude
|
|
40
|
-
-
|
|
40
|
+
- antigravity
|
|
41
41
|
tasks:
|
|
42
42
|
- Check requirement scope, constraints, and acceptance criteria
|
|
43
43
|
- Verify affected areas and risk identification
|
|
@@ -63,7 +63,7 @@ steps:
|
|
|
63
63
|
description: Create the technical design for the feature implementation.
|
|
64
64
|
recommended_agents:
|
|
65
65
|
- claude
|
|
66
|
-
-
|
|
66
|
+
- antigravity
|
|
67
67
|
tasks:
|
|
68
68
|
- Define interfaces and data structures
|
|
69
69
|
- Outline the implementation approach
|
|
@@ -93,7 +93,7 @@ steps:
|
|
|
93
93
|
description: Review whether the technical design is implementable, low-risk, and requirement-complete.
|
|
94
94
|
recommended_agents:
|
|
95
95
|
- claude
|
|
96
|
-
-
|
|
96
|
+
- antigravity
|
|
97
97
|
tasks:
|
|
98
98
|
- Verify the plan covers the approved analysis
|
|
99
99
|
- Check architecture fit, risks, and test strategy
|