@fitlab-ai/agent-infra 0.9.1 → 0.9.2
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 +16 -4
- package/README.zh-CN.md +16 -4
- package/bin/cli.ts +12 -0
- package/dist/bin/cli.js +14 -0
- package/dist/bin/internal-cli.js +15 -0
- package/dist/lib/agent-client.js +163 -0
- package/dist/lib/agent-clients/adapter.js +294 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +62 -0
- package/dist/lib/agent-clients/adapters/codex-sandbox.js +210 -0
- package/dist/lib/agent-clients/adapters/codex.js +54 -0
- package/dist/lib/agent-clients/adapters/gemini-cli.js +64 -0
- package/dist/lib/agent-clients/adapters/index.js +20 -0
- package/dist/lib/agent-clients/adapters/opencode.js +64 -0
- package/dist/lib/agent-clients/config.js +177 -0
- package/dist/lib/agent-clients/custom-tuis.js +99 -0
- package/dist/lib/agent-clients/invocation.js +9 -0
- package/dist/lib/agent-clients/next-steps.js +38 -0
- package/dist/lib/agent-clients/project-assets.js +45 -0
- package/dist/lib/agent-clients/reconcile.js +235 -0
- package/dist/lib/agent-clients/registry.js +72 -0
- package/dist/lib/agent-clients/schema.js +57 -0
- package/dist/lib/agent-clients/types.js +29 -0
- package/dist/lib/builtin-tuis.js +9 -14
- package/dist/lib/defaults.json +85 -73
- package/dist/lib/git/review-snapshot.js +25 -10
- package/dist/lib/git/reviewed-commit-equivalence.js +110 -0
- package/dist/lib/init.js +47 -91
- package/dist/lib/internal/agent-client.js +117 -0
- package/dist/lib/internal/git-workflow.js +1 -1
- package/dist/lib/internal/release-workflow.js +71 -16
- package/dist/lib/internal/task-orchestration.js +151 -0
- package/dist/lib/internal/task-review.js +65 -0
- package/dist/lib/merge.js +2 -1
- package/dist/lib/platform/adapters.js +38 -1
- package/dist/lib/platform/change-request-git-evidence.js +113 -0
- package/dist/lib/platform/merged-pr-equivalence.js +41 -11
- package/dist/lib/platform/pr-checks.js +38 -10
- package/dist/lib/platform/pull-requests.js +110 -6
- package/dist/lib/platform/releases.js +1 -1
- package/dist/lib/platform/verification-required.js +8 -10
- package/dist/lib/prompt.js +15 -3
- package/dist/lib/release/channels.js +4 -1
- package/dist/lib/release/workflow.js +4 -2
- package/dist/lib/remove-dir.js +25 -0
- package/dist/lib/run/tui.js +8 -2
- package/dist/lib/sandbox/agent-client-reconciler.js +234 -0
- package/dist/lib/sandbox/clipboard/linux.js +2 -1
- package/dist/lib/sandbox/commands/create.js +76 -180
- package/dist/lib/sandbox/commands/enter.js +17 -1
- package/dist/lib/sandbox/commands/prune.js +2 -2
- package/dist/lib/sandbox/commands/rm.js +3 -2
- package/dist/lib/sandbox/config.js +21 -4
- package/dist/lib/sandbox/constants.js +3 -0
- package/dist/lib/sandbox/dockerfile.js +2 -1
- package/dist/lib/sandbox/managed-fs.js +10 -5
- package/dist/lib/sandbox/recovery.js +52 -36
- package/dist/lib/sandbox/shell.js +1 -1
- package/dist/lib/sandbox/tool-types.js +8 -0
- package/dist/lib/sandbox/tools.js +2 -126
- package/dist/lib/task/artifact-lifecycle.js +1 -49
- package/dist/lib/task/commands/decisions.js +50 -20
- package/dist/lib/task/delegation-receipts.js +107 -0
- package/dist/lib/task/events.js +100 -1
- package/dist/lib/task/orchestration.js +420 -0
- package/dist/lib/task/review-artifacts.js +143 -59
- package/dist/lib/task/review-finalization.js +166 -0
- package/dist/lib/task/review-fingerprint.js +4 -0
- package/dist/lib/task/verification-checks.js +2 -1
- package/dist/lib/task/verification-engine.js +156 -28
- package/dist/lib/task/verification-review.js +1 -1
- package/dist/lib/task/verification.js +3 -1
- package/dist/lib/task/workspace-snapshot.js +34 -0
- package/dist/lib/update.js +42 -161
- package/lib/agent-client.ts +214 -0
- package/lib/agent-clients/adapter.ts +461 -0
- package/lib/agent-clients/adapters/claude-code.ts +70 -0
- package/lib/agent-clients/adapters/codex-sandbox.ts +245 -0
- package/lib/agent-clients/adapters/codex.ts +58 -0
- package/lib/agent-clients/adapters/gemini-cli.ts +65 -0
- package/lib/agent-clients/adapters/index.ts +27 -0
- package/lib/agent-clients/adapters/opencode.ts +66 -0
- package/lib/agent-clients/config.ts +278 -0
- package/lib/agent-clients/custom-tuis.ts +149 -0
- package/lib/agent-clients/invocation.ts +19 -0
- package/lib/agent-clients/next-steps.ts +72 -0
- package/lib/agent-clients/project-assets.ts +96 -0
- package/lib/agent-clients/reconcile.ts +324 -0
- package/lib/agent-clients/registry.ts +144 -0
- package/lib/agent-clients/schema.ts +62 -0
- package/lib/agent-clients/types.ts +78 -0
- package/lib/benchmark/schemas/v1.0.0/case-manifest.schema.json +120 -0
- package/lib/benchmark/schemas/v1.0.0/common.schema.json +109 -0
- package/lib/benchmark/schemas/v1.0.0/grader-result.schema.json +160 -0
- package/lib/benchmark/schemas/v1.0.0/run-manifest.schema.json +122 -0
- package/lib/benchmark/schemas/v1.0.0/subject.schema.json +227 -0
- package/lib/builtin-tuis.ts +16 -15
- package/lib/defaults.json +24 -12
- package/lib/git/review-snapshot.ts +39 -9
- package/lib/git/reviewed-commit-equivalence.ts +135 -0
- package/lib/init.ts +53 -121
- package/lib/internal/agent-client.ts +131 -0
- package/lib/internal/git-workflow.ts +1 -1
- package/lib/internal/release-workflow.ts +68 -16
- package/lib/internal/task-orchestration.ts +132 -0
- package/lib/internal/task-review.ts +65 -0
- package/lib/merge.ts +2 -1
- package/lib/platform/adapters.ts +142 -3
- package/lib/platform/change-request-git-evidence.ts +159 -0
- package/lib/platform/merged-pr-equivalence.ts +51 -14
- package/lib/platform/pr-checks.ts +50 -22
- package/lib/platform/pull-requests.ts +134 -25
- package/lib/platform/releases.ts +1 -1
- package/lib/platform/verification-required.ts +12 -10
- package/lib/prompt.ts +16 -3
- package/lib/release/channels.ts +4 -1
- package/lib/release/workflow.ts +4 -3
- package/lib/remove-dir.ts +28 -0
- package/lib/run/tui.ts +9 -1
- package/lib/sandbox/agent-client-reconciler.ts +378 -0
- package/lib/sandbox/clipboard/linux.ts +2 -1
- package/lib/sandbox/commands/create.ts +111 -192
- package/lib/sandbox/commands/enter.ts +23 -1
- package/lib/sandbox/commands/prune.ts +2 -2
- package/lib/sandbox/commands/rm.ts +3 -2
- package/lib/sandbox/config.ts +31 -4
- package/lib/sandbox/constants.ts +6 -0
- package/lib/sandbox/dockerfile.ts +2 -1
- package/lib/sandbox/managed-fs.ts +18 -5
- package/lib/sandbox/recovery.ts +98 -67
- package/lib/sandbox/shell.ts +1 -1
- package/lib/sandbox/tool-types.ts +143 -0
- package/lib/sandbox/tools.ts +5 -157
- package/lib/task/artifact-lifecycle.ts +1 -38
- package/lib/task/commands/decisions.ts +53 -20
- package/lib/task/delegation-receipts.ts +170 -0
- package/lib/task/events.ts +110 -2
- package/lib/task/orchestration.ts +543 -0
- package/lib/task/review-artifacts.ts +201 -69
- package/lib/task/review-finalization.ts +275 -0
- package/lib/task/review-fingerprint.ts +5 -0
- package/lib/task/verification-checks.ts +2 -1
- package/lib/task/verification-engine.ts +177 -28
- package/lib/task/verification-review.ts +1 -0
- package/lib/task/verification.ts +5 -2
- package/lib/task/workspace-snapshot.ts +36 -0
- package/lib/update.ts +48 -184
- package/package.json +2 -2
- package/templates/.agents/README.en.md +21 -20
- package/templates/.agents/README.zh-CN.md +21 -20
- package/templates/.agents/hooks/lifecycle-delegation.js +64 -0
- package/templates/.agents/rules/README.en.md +2 -0
- package/templates/.agents/rules/README.zh-CN.md +2 -0
- package/templates/.agents/rules/commit-and-pr.en.md +1 -0
- package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -0
- package/templates/.agents/rules/human-decision-context.en.md +14 -12
- package/templates/.agents/rules/human-decision-context.zh-CN.md +14 -12
- package/templates/.agents/rules/lifecycle-orchestration.en.md +21 -0
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +21 -0
- package/templates/.agents/rules/next-step-output.en.md +16 -0
- package/templates/.agents/rules/next-step-output.zh-CN.md +16 -0
- package/templates/.agents/rules/no-mid-flow-questions.en.md +2 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +2 -0
- package/templates/.agents/rules/release-commands.github.en.md +11 -5
- package/templates/.agents/rules/release-commands.github.zh-CN.md +11 -5
- package/templates/.agents/rules/review-handshake.en.md +4 -4
- package/templates/.agents/rules/review-handshake.zh-CN.md +4 -4
- package/templates/.agents/rules/review-method.en.md +113 -0
- package/templates/.agents/rules/review-method.zh-CN.md +98 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/block-task/SKILL.en.md +4 -4
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/cancel-task/SKILL.en.md +4 -4
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/check-task/SKILL.en.md +16 -16
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -16
- package/templates/.agents/skills/close-codescan/SKILL.en.md +4 -4
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +4 -4
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/code-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/code-task/reference/fix-mode.en.md +14 -16
- package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +14 -16
- package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
- package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
- package/templates/.agents/skills/commit/SKILL.en.md +11 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +11 -1
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +24 -28
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +24 -28
- package/templates/.agents/skills/complete-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/create-pr/SKILL.en.md +10 -10
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +10 -10
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
- package/templates/.agents/skills/create-task/SKILL.en.md +11 -11
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +11 -11
- package/templates/.agents/skills/import-codescan/SKILL.en.md +5 -5
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +5 -5
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/import-issue/SKILL.en.md +5 -5
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/init-labels/SKILL.en.md +4 -4
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/init-milestones/SKILL.en.md +4 -4
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/plan-task/SKILL.en.md +5 -5
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/release/SKILL.en.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +13 -2
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +14 -3
- package/templates/.agents/skills/review-analysis/config/verify.en.json +6 -0
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +6 -0
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +13 -15
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +13 -15
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +51 -5
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +52 -6
- package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +25 -22
- package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +25 -22
- package/templates/.agents/skills/review-code/SKILL.en.md +28 -8
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +28 -8
- package/templates/.agents/skills/review-code/config/verify.en.json +7 -0
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +7 -0
- package/templates/.agents/skills/review-code/reference/concurrency-risks.en.md +25 -0
- package/templates/.agents/skills/review-code/reference/concurrency-risks.zh-CN.md +25 -0
- package/templates/.agents/skills/review-code/reference/cross-platform-risks.en.md +27 -0
- package/templates/.agents/skills/review-code/reference/cross-platform-risks.zh-CN.md +27 -0
- package/templates/.agents/skills/review-code/reference/documentation-antipatterns.en.md +13 -0
- package/templates/.agents/skills/review-code/reference/documentation-antipatterns.zh-CN.md +13 -0
- package/templates/.agents/skills/review-code/reference/migration-risks.en.md +25 -0
- package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +25 -0
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +22 -24
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +22 -24
- package/templates/.agents/skills/review-code/reference/report-template.en.md +54 -7
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +54 -7
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +29 -24
- package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +29 -24
- package/templates/.agents/skills/review-code/reference/security-risks.en.md +25 -0
- package/templates/.agents/skills/review-code/reference/security-risks.zh-CN.md +25 -0
- package/templates/.agents/skills/review-plan/SKILL.en.md +13 -2
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +14 -3
- package/templates/.agents/skills/review-plan/config/verify.en.json +6 -0
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +6 -0
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +13 -15
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +13 -15
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +61 -5
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +61 -5
- package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +21 -24
- package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +21 -24
- package/templates/.agents/skills/run-task/SKILL.en.md +22 -0
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +22 -0
- package/templates/.agents/skills/run-task/config/verify.en.json +9 -0
- package/templates/.agents/skills/run-task/config/verify.zh-CN.json +9 -0
- package/templates/.agents/skills/test/SKILL.en.md +4 -4
- package/templates/.agents/skills/test/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/test-integration/SKILL.en.md +4 -4
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +5 -5
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +647 -203
- package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +4 -4
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/watch-pr/SKILL.en.md +8 -8
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +8 -8
- package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +6 -0
- package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +6 -0
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +6 -0
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +6 -0
- package/templates/.claude/commands/run-task.en.md +8 -0
- package/templates/.claude/commands/run-task.zh-CN.md +8 -0
- package/templates/.claude/settings.json +24 -0
- package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +3 -0
- package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +3 -0
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +3 -0
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +3 -0
- package/templates/.gemini/commands/_project_/run-task.en.toml +8 -0
- package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +8 -0
- package/templates/.opencode/commands/run-task.en.md +11 -0
- package/templates/.opencode/commands/run-task.zh-CN.md +11 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Shared Review Method
|
|
2
|
+
|
|
3
|
+
This rule defines the lightweight review protocol shared by the `analysis`, `plan`,
|
|
4
|
+
and `code` stages. Stage-specific checks remain in each skill's
|
|
5
|
+
`reference/review-criteria.md`; finding state, human decisions, and ledger writes
|
|
6
|
+
remain governed by [review-handshake.md](review-handshake.md); risk lenses only route
|
|
7
|
+
an observed risk to references that must then be loaded.
|
|
8
|
+
|
|
9
|
+
## Responsibility Boundary
|
|
10
|
+
|
|
11
|
+
- This rule defines review order, evidence shape, and completion conditions without duplicating stage checklists.
|
|
12
|
+
- Observable evidence triggers risk lenses; every matched reference must be read and recorded in the report.
|
|
13
|
+
- Automation supplies facts; the reviewer judges completeness, impact, severity, confidence, and counterevidence.
|
|
14
|
+
- Report structure makes review claims traceable; it does not automatically prove that semantic judgments are correct.
|
|
15
|
+
|
|
16
|
+
## Readiness
|
|
17
|
+
|
|
18
|
+
Before forming candidate findings, confirm that:
|
|
19
|
+
|
|
20
|
+
1. The task, input artifact, upstream sources, and review scope are resolved and readable.
|
|
21
|
+
2. The state snapshot, diff, or other factual evidence required by the skill has been captured.
|
|
22
|
+
3. The reviewed artifact, baseline, and context boundary can be identified accurately in the report.
|
|
23
|
+
|
|
24
|
+
If any prerequisite is missing, an Approved verdict is forbidden; follow the owning
|
|
25
|
+
skill's blocked or failure path.
|
|
26
|
+
|
|
27
|
+
## Multi-pass Review Protocol
|
|
28
|
+
|
|
29
|
+
Run these five passes in order. Record each pass's scope, evidence, result, and
|
|
30
|
+
gaps/assumptions in the report coverage table.
|
|
31
|
+
|
|
32
|
+
1. **Pass 1 — Raw evidence**: read source requests, upstream artifacts, changes, and tests before executor summaries can anchor the review; form independent candidate issues.
|
|
33
|
+
2. **Pass 2 — Traceability and boundaries**: map source → requirement → plan → implementation → test, looking for omissions, broken links, and unexpected scope.
|
|
34
|
+
3. **Pass 3 — Risk lenses**: evaluate every registry trigger against the complete context, load every matched reference, and record trigger evidence and results.
|
|
35
|
+
4. **Pass 4 — Counterevidence**: seek evidence that disproves or downgrades each candidate finding and counterexamples that could invalidate an approval.
|
|
36
|
+
5. **Pass 5 — Classification and convergence**: classify issues as findings, manual-validation, or advisories; reconcile evidence contracts, ledger intents, unverified assumptions, and the verdict.
|
|
37
|
+
|
|
38
|
+
## Risk Lens Registry
|
|
39
|
+
|
|
40
|
+
Registry rows use stable fields: `lens_id` identifies the lens, `stages` limits its
|
|
41
|
+
scope, `observable_trigger` states observable evidence, `required_reference` is
|
|
42
|
+
mandatory when matched, and `report_evidence` defines the audit trail.
|
|
43
|
+
|
|
44
|
+
| lens_id | stages | observable_trigger | required_reference | report_evidence |
|
|
45
|
+
|---------|--------|--------------------|--------------------|-----------------|
|
|
46
|
+
| documentation-antipatterns | code | The complete change context touches Markdown, rules, skills, CLI help, or user documentation that describes current behavior | `.agents/skills/review-code/reference/documentation-antipatterns.md` | Record triggering files, `loaded=yes`, and the lens result |
|
|
47
|
+
| testing-discipline | code | The complete change context touches tests, fixtures, snapshots, or test helpers | `.agents/rules/testing-discipline.md` | Record triggering files, `loaded=yes`, and the test-discipline result |
|
|
48
|
+
| security-risks | code | Authentication, authorization, untrusted input, sensitive data, credentials, cryptography, dependencies, or system boundaries change | `.agents/skills/review-code/reference/security-risks.md` | Record the changed security boundary, `loaded=yes`, and the lens result |
|
|
49
|
+
| migration-risks | code | Persistent formats, schemas, configuration/frontmatter, compatibility reads, migrations, or rollback behavior change | `.agents/skills/review-code/reference/migration-risks.md` | Record compatibility or migration evidence, `loaded=yes`, and the lens result |
|
|
50
|
+
| concurrency-risks | code | Async coordination, shared state, locks, retries, idempotency, races, cancellation, or timeouts change | `.agents/skills/review-code/reference/concurrency-risks.md` | Record the concurrency path, `loaded=yes`, and the lens result |
|
|
51
|
+
| cross-platform-risks | code | OS branches, paths, shells, permissions, symlinks, newlines, signals, or cross-platform behavior change | `.agents/skills/review-code/reference/cross-platform-risks.md` | Record platform evidence, `loaded=yes`, and the lens result |
|
|
52
|
+
|
|
53
|
+
Unmatched lenses still require reproducible non-trigger evidence. `loaded` accepts
|
|
54
|
+
only `yes`, `no`, or `not-applicable`; a matched but unloaded lens forbids approval.
|
|
55
|
+
|
|
56
|
+
## Automation and Semantic Judgment
|
|
57
|
+
|
|
58
|
+
| Source | Facts it can support | Semantic judgment it cannot replace |
|
|
59
|
+
|--------|----------------------|-------------------------------------|
|
|
60
|
+
| snapshot, diff, link, test, artifact gate | files, scope, command results, reference existence, section existence | requirement completeness, design soundness, implementation correctness |
|
|
61
|
+
| traceability matrix | explicit mappings and visible gaps | mapping sufficiency, gap impact, priority |
|
|
62
|
+
| risk-lens record | trigger evidence, load status, lens result entry point | acceptable risk, finding severity, confidence |
|
|
63
|
+
|
|
64
|
+
When automated facts and semantic conclusions diverge, record each separately.
|
|
65
|
+
Never present a passing structural gate as proof of semantic completeness.
|
|
66
|
+
|
|
67
|
+
## Context Coverage and Traceability Contract
|
|
68
|
+
|
|
69
|
+
Reports must contain both coverage tables:
|
|
70
|
+
|
|
71
|
+
| pass_id | scope | evidence | result | gaps_or_assumptions |
|
|
72
|
+
|---------|-------|----------|--------|---------------------|
|
|
73
|
+
| pass-1..5 | scope actually reviewed in this pass | locatable artifact, file, command, or line | finding or conclusion | uncovered item, gap, or assumption |
|
|
74
|
+
|
|
75
|
+
| lens_id | trigger_evidence | loaded | result |
|
|
76
|
+
|---------|------------------|--------|--------|
|
|
77
|
+
| registry token | reproducible trigger or non-trigger evidence | yes / no / not-applicable | lens conclusion |
|
|
78
|
+
|
|
79
|
+
Reports must also contain the shared traceability matrix:
|
|
80
|
+
|
|
81
|
+
| source_id | upstream | reviewed_target | verification | status_or_gap |
|
|
82
|
+
|-----------|----------|-----------------|--------------|---------------|
|
|
83
|
+
| stable source identifier | upstream requirement, decision, or step | object reviewed at this stage | automated or human evidence | covered / gap and impact |
|
|
84
|
+
|
|
85
|
+
Analysis traces sources to requirements, acceptance, impact, and risk. Plan traces
|
|
86
|
+
approved requirements to decisions, implementation steps, and test strategy. Code
|
|
87
|
+
traces requirements and plan steps to the diff and automated tests or human checks.
|
|
88
|
+
|
|
89
|
+
## Finding Evidence Contract
|
|
90
|
+
|
|
91
|
+
Every blocker or major finding must include:
|
|
92
|
+
|
|
93
|
+
1. **Scenario**: preconditions and the path that triggers the problem.
|
|
94
|
+
2. **Impact**: concrete consequences for correctness, security, delivery, or acceptance.
|
|
95
|
+
3. **Evidence**: reproducible artifact, `file:line`, command, and raw result.
|
|
96
|
+
4. **Confidence**: stable token `high`, `medium`, or `low`.
|
|
97
|
+
5. **Unverified assumptions**: claims not directly proven that would change the conclusion if disproved; explicitly state none when empty.
|
|
98
|
+
6. **Fix direction**: the smallest actionable repair goal without redesigning outside the executor's authority.
|
|
99
|
+
|
|
100
|
+
Minor findings stay lightweight but still need a specific location and actionable
|
|
101
|
+
advice. The finding ledger's `evidence` continues to point to a stable report anchor;
|
|
102
|
+
no ledger fields are added. Handle manual-validation, advisories, and
|
|
103
|
+
`needs-human-decision` through the review handshake and stage rules.
|
|
104
|
+
|
|
105
|
+
## Completion
|
|
106
|
+
|
|
107
|
+
A final verdict is allowed only when:
|
|
108
|
+
|
|
109
|
+
- All five passes record scope, evidence, result, and gaps/assumptions.
|
|
110
|
+
- Every risk trigger has a decision, and every matched lens was loaded and recorded.
|
|
111
|
+
- The traceability matrix covers the stage responsibility, with gaps classified as a finding, manual-validation, advisory, or explicit assumption.
|
|
112
|
+
- Every blocker/major satisfies the evidence contract and every candidate finding received a counterevidence pass.
|
|
113
|
+
- Ledger intents, manual checks, pending decisions, unverified assumptions, and finding counts agree.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# 通用检视方法
|
|
2
|
+
|
|
3
|
+
本规则定义 `analysis`、`plan` 和 `code` 三个审查阶段共用的轻量检视协议。阶段专属检查项留在各 skill 的 `reference/review-criteria.md`;finding 状态机、人工裁决和账本写入继续以 [review-handshake.md](review-handshake.md) 为准;风险镜头只承载命中某类风险后必须加载的专项 reference。
|
|
4
|
+
|
|
5
|
+
## 职责边界
|
|
6
|
+
|
|
7
|
+
- 本规则规定审查顺序、证据形状和完成条件,不复制阶段 checklist。
|
|
8
|
+
- 风险镜头由可观察证据触发;命中后必须读取全部对应 reference,并在报告留证。
|
|
9
|
+
- 自动化检查提供事实,reviewer 负责完整性、影响、严重度、置信度和反证等语义判断。
|
|
10
|
+
- 报告结构证明审查声明可追溯,不等于自动证明语义判断正确。
|
|
11
|
+
|
|
12
|
+
## Readiness
|
|
13
|
+
|
|
14
|
+
形成候选 finding 前必须确认:
|
|
15
|
+
|
|
16
|
+
1. 任务、输入 artifact、上游来源和审查范围已解析且可读。
|
|
17
|
+
2. skill 要求的状态快照、差异或其他事实证据已捕获。
|
|
18
|
+
3. 本轮实际审查的 artifact、基线和上下文边界可在报告中准确标识。
|
|
19
|
+
|
|
20
|
+
任一前置项缺失时,不得给出通过结论;按所属 skill 的阻塞或失败路径处理。
|
|
21
|
+
|
|
22
|
+
## 多遍检视协议
|
|
23
|
+
|
|
24
|
+
按顺序执行以下五遍;每遍都在报告的检视覆盖表中记录范围、证据、结果与缺口/假设。
|
|
25
|
+
|
|
26
|
+
1. **Pass 1 — 原始证据**:先读任务来源、上游 artifact、变更和测试等原始证据,独立形成候选问题,避免被执行方摘要锚定。
|
|
27
|
+
2. **Pass 2 — 追踪与边界**:建立来源—需求—方案—实现—测试追踪,识别遗漏、断链和意外范围扩张。
|
|
28
|
+
3. **Pass 3 — 风险镜头**:依据完整上下文逐项判断注册表触发器,加载所有命中的专项 reference,并记录命中证据与结果。
|
|
29
|
+
4. **Pass 4 — 反证**:主动寻找能推翻或降级每个候选 finding 的证据,并检查放行结论可能失败的反例。
|
|
30
|
+
5. **Pass 5 — 归类与收敛**:将问题归为 finding、manual-validation 或 advisory,核对证据契约、账本意图、未验证假设和 verdict。
|
|
31
|
+
|
|
32
|
+
## 风险镜头注册表
|
|
33
|
+
|
|
34
|
+
注册行使用稳定字段:`lens_id` 标识镜头,`stages` 限定阶段,`observable_trigger` 给出可观察触发条件,`required_reference` 是命中后必读路径,`report_evidence` 规定报告留证。
|
|
35
|
+
|
|
36
|
+
| lens_id | stages | observable_trigger | required_reference | report_evidence |
|
|
37
|
+
|---------|--------|--------------------|--------------------|-----------------|
|
|
38
|
+
| documentation-antipatterns | code | 完整变更上下文触及描述当前行为的 Markdown、规则、skill、CLI 帮助或用户文档 | `.agents/skills/review-code/reference/documentation-antipatterns.md` | 记录触发文件、`loaded=yes` 与检视结果 |
|
|
39
|
+
| testing-discipline | code | 完整变更上下文触及测试、fixture、snapshot 或测试 helper | `.agents/rules/testing-discipline.md` | 记录触发文件、`loaded=yes` 与测试纪律结论 |
|
|
40
|
+
| security-risks | code | 认证授权、非可信输入、敏感数据、凭据、加密、依赖或系统边界发生变化 | `.agents/skills/review-code/reference/security-risks.md` | 记录安全边界变化、`loaded=yes` 与检视结果 |
|
|
41
|
+
| migration-risks | code | 持久化格式、schema、配置/frontmatter、兼容读取或迁移/回滚发生变化 | `.agents/skills/review-code/reference/migration-risks.md` | 记录兼容或迁移触发证据、`loaded=yes` 与检视结果 |
|
|
42
|
+
| concurrency-risks | code | 异步协调、共享状态、锁、重试、幂等、竞态、取消或超时发生变化 | `.agents/skills/review-code/reference/concurrency-risks.md` | 记录并发触发路径、`loaded=yes` 与检视结果 |
|
|
43
|
+
| cross-platform-risks | code | OS 分支、路径、shell、权限、符号链接、换行、信号或跨平台行为发生变化 | `.agents/skills/review-code/reference/cross-platform-risks.md` | 记录平台触发证据、`loaded=yes` 与检视结果 |
|
|
44
|
+
|
|
45
|
+
未命中镜头也必须记录可复核的未命中证据。`loaded` 只使用 `yes`、`no`、`not-applicable`;命中但未加载时不得给出通过结论。
|
|
46
|
+
|
|
47
|
+
## 自动化与语义判断
|
|
48
|
+
|
|
49
|
+
| 来源 | 可支持的事实 | 不可替代的语义判断 |
|
|
50
|
+
|------|--------------|--------------------|
|
|
51
|
+
| snapshot、diff、link、test、artifact gate | 文件、范围、命令结果、引用存在、章节存在 | 需求是否完整、设计是否合理、实现是否正确 |
|
|
52
|
+
| 追踪矩阵 | 显式映射及可见缺口 | 映射是否充分、缺口影响和优先级 |
|
|
53
|
+
| 风险镜头记录 | 触发证据、加载状态、专项结果入口 | 风险是否可接受、finding 严重度与置信度 |
|
|
54
|
+
|
|
55
|
+
自动化结果与语义结论冲突时,报告必须分别记录事实与推理,不得把结构 gate 的通过写成语义完整性的证明。
|
|
56
|
+
|
|
57
|
+
## 上下文覆盖与追踪契约
|
|
58
|
+
|
|
59
|
+
报告必须包含两张覆盖表:
|
|
60
|
+
|
|
61
|
+
| pass_id | scope | evidence | result | gaps_or_assumptions |
|
|
62
|
+
|---------|-------|----------|--------|---------------------|
|
|
63
|
+
| pass-1..5 | 本遍实际覆盖范围 | 可定位的 artifact、文件、命令或行号 | 发现或结论 | 未覆盖项、缺口或假设 |
|
|
64
|
+
|
|
65
|
+
| lens_id | trigger_evidence | loaded | result |
|
|
66
|
+
|---------|------------------|--------|--------|
|
|
67
|
+
| 注册表 token | 命中或未命中的可复核证据 | yes / no / not-applicable | 专项检视结论 |
|
|
68
|
+
|
|
69
|
+
并包含统一追踪矩阵:
|
|
70
|
+
|
|
71
|
+
| source_id | upstream | reviewed_target | verification | status_or_gap |
|
|
72
|
+
|-----------|----------|-----------------|--------------|---------------|
|
|
73
|
+
| 稳定来源标识 | 上游需求、决策或步骤 | 本阶段被审对象 | 自动化或人工证据 | covered / gap 及影响 |
|
|
74
|
+
|
|
75
|
+
analysis 阶段追踪来源到需求、验收、影响和风险;plan 阶段追踪已批准需求到设计决策、步骤和测试策略;code 阶段追踪需求/方案到 diff 与自动化测试或人工校验。
|
|
76
|
+
|
|
77
|
+
## Finding 证据契约
|
|
78
|
+
|
|
79
|
+
每个 blocker 或 major finding 必须包含:
|
|
80
|
+
|
|
81
|
+
1. **场景**:触发问题的前置条件和路径。
|
|
82
|
+
2. **影响**:对正确性、安全、交付或验收的具体后果。
|
|
83
|
+
3. **证据**:可复现的 artifact、`file:line`、命令和原始结果。
|
|
84
|
+
4. **置信度**:稳定 token `high`、`medium` 或 `low`。
|
|
85
|
+
5. **未验证假设**:尚未直接证明、若被推翻会改变结论的假设;没有则明确写无。
|
|
86
|
+
6. **修复方向**:可执行的最小修复目标,不替执行方越权重设计。
|
|
87
|
+
|
|
88
|
+
minor 保持轻量,但仍须提供具体位置和可执行建议。finding ledger 的 `evidence` 继续指向报告中的稳定锚点,不新增账本字段。manual-validation、advisory 和 `needs-human-decision` 按 review handshake 与阶段规则处理。
|
|
89
|
+
|
|
90
|
+
## Completion
|
|
91
|
+
|
|
92
|
+
只有同时满足以下条件才可形成最终 verdict:
|
|
93
|
+
|
|
94
|
+
- 五遍检视均已记录范围、证据、结果和缺口/假设。
|
|
95
|
+
- 所有风险触发器均有命中判断,命中镜头均已加载并留证。
|
|
96
|
+
- 追踪矩阵覆盖本阶段职责,缺口已进入 finding、manual-validation、advisory 或明确假设。
|
|
97
|
+
- 所有 blocker/major 满足统一证据契约,候选 finding 已完成反证检视。
|
|
98
|
+
- 账本意图、人工校验、待裁决项、未验证假设与问题计数一致。
|
|
@@ -230,9 +230,11 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
230
230
|
|
|
231
231
|
> Execute this step only after the verification gate passes.
|
|
232
232
|
|
|
233
|
-
>
|
|
233
|
+
> 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}`.
|
|
234
234
|
|
|
235
235
|
Output format:
|
|
236
|
+
Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill review-analysis --task-ref {task-ref}`.
|
|
237
|
+
|
|
236
238
|
```
|
|
237
239
|
Analysis complete for task {task-id}.
|
|
238
240
|
|
|
@@ -245,9 +247,7 @@ Output file:
|
|
|
245
247
|
- Analysis report: .agents/workspace/active/{task-id}/{analysis-artifact}
|
|
246
248
|
|
|
247
249
|
Next step - review the analysis:
|
|
248
|
-
|
|
249
|
-
- Gemini CLI: /{{project}}:review-analysis {task-ref}
|
|
250
|
-
- Codex CLI: $review-analysis {task-ref}
|
|
250
|
+
{next-step-commands}
|
|
251
251
|
```
|
|
252
252
|
|
|
253
253
|
## Completion Checklist
|
|
@@ -259,7 +259,7 @@ Next step - review the analysis:
|
|
|
259
259
|
- [ ] Updated `assigned_to` in task.md
|
|
260
260
|
- [ ] Appended an Activity Log entry to task.md
|
|
261
261
|
- [ ] Marked requirement-analysis as complete in workflow progress
|
|
262
|
-
- [ ]
|
|
262
|
+
- [ ] Rendered the selected next-step commands through the shared helper
|
|
263
263
|
- [ ] **Did not modify any business code**
|
|
264
264
|
|
|
265
265
|
## STOP
|
|
@@ -229,9 +229,11 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
|
|
|
229
229
|
|
|
230
230
|
> 仅在校验通过后执行本步骤。
|
|
231
231
|
|
|
232
|
-
>
|
|
232
|
+
> 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
|
|
233
233
|
|
|
234
234
|
输出格式:
|
|
235
|
+
使用 `agent-infra-internal agent-client next-steps --skill review-analysis --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
|
|
236
|
+
|
|
235
237
|
```
|
|
236
238
|
任务 {task-id} 分析完成。
|
|
237
239
|
|
|
@@ -244,9 +246,7 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
|
|
|
244
246
|
- 分析报告:.agents/workspace/active/{task-id}/{analysis-artifact}
|
|
245
247
|
|
|
246
248
|
下一步 - 审查需求分析:
|
|
247
|
-
|
|
248
|
-
- Gemini CLI:/{{project}}:review-analysis {task-ref}
|
|
249
|
-
- Codex CLI:$review-analysis {task-ref}
|
|
249
|
+
{next-step-commands}
|
|
250
250
|
```
|
|
251
251
|
|
|
252
252
|
## 完成检查清单
|
|
@@ -258,7 +258,7 @@ agent-infra-internal task-verify {task-id} analyze.completed --artifact {analysi
|
|
|
258
258
|
- [ ] 更新了 task.md 中的 `assigned_to`
|
|
259
259
|
- [ ] 追加了 Activity Log 条目到 task.md
|
|
260
260
|
- [ ] 在工作流进度中标记了 requirement-analysis 为已完成
|
|
261
|
-
- [ ]
|
|
261
|
+
- [ ] 已通过统一 helper 渲染已选场景的下一步命令
|
|
262
262
|
- [ ] **没有修改任何业务代码**
|
|
263
263
|
|
|
264
264
|
## 停止
|
|
@@ -95,11 +95,13 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
95
95
|
|
|
96
96
|
> Execute this step only after the verification gate passes.
|
|
97
97
|
|
|
98
|
-
>
|
|
98
|
+
> 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}`.
|
|
99
99
|
|
|
100
100
|
> **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after "Archived to" and before "To unblock" in the output below — only when BOTH (1) `.agents/.airc.json` has a `sandbox` field and (2) task.md's `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the task.md you already loaded (the task has moved to blocked/, so read it from `.agents/workspace/blocked/{task-id}/task.md`). This block is independent of "Next step" semantics.
|
|
101
101
|
|
|
102
102
|
Output format:
|
|
103
|
+
Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}`.
|
|
104
|
+
|
|
103
105
|
```
|
|
104
106
|
Task {task-id} marked as blocked.
|
|
105
107
|
|
|
@@ -116,9 +118,7 @@ To unblock when the issue is resolved:
|
|
|
116
118
|
agent-infra-internal task-lifecycle {task-id} activate --agent {agent} --note "{activation note}"
|
|
117
119
|
|
|
118
120
|
Next step - check task status after unblocking:
|
|
119
|
-
|
|
120
|
-
- Gemini CLI: /{{project}}:check-task {task-ref}
|
|
121
|
-
- Codex CLI: $check-task {task-ref}
|
|
121
|
+
{next-step-commands}
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
|
|
@@ -96,11 +96,13 @@ agent-infra-internal task-verify {task-id} block-task.completed --format text
|
|
|
96
96
|
|
|
97
97
|
> 仅在校验通过后执行本步骤。
|
|
98
98
|
|
|
99
|
-
>
|
|
99
|
+
> 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
|
|
100
100
|
|
|
101
101
|
> **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「归档路径」之后、「解除阻塞时执行」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取已读入的 task.md 的 `branch` 值(任务此时已移动到 blocked/,从 `.agents/workspace/blocked/{task-id}/task.md` 读取)。该块独立于「下一步」语义。
|
|
102
102
|
|
|
103
103
|
输出格式:
|
|
104
|
+
使用 `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
|
|
105
|
+
|
|
104
106
|
```
|
|
105
107
|
任务 {task-id} 已标记为阻塞。
|
|
106
108
|
|
|
@@ -117,9 +119,7 @@ ai sandbox rm {branch}
|
|
|
117
119
|
agent-infra-internal task-lifecycle {task-id} activate --agent {agent} --note "{恢复说明}"
|
|
118
120
|
|
|
119
121
|
下一步 - 检查任务状态(解除阻塞后):
|
|
120
|
-
|
|
121
|
-
- Gemini CLI:/{{project}}:check-task {task-ref}
|
|
122
|
-
- Codex CLI:$check-task {task-ref}
|
|
122
|
+
{next-step-commands}
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
|
|
@@ -102,11 +102,13 @@ Keep the gate output in your reply as fresh evidence. Do not claim completion wi
|
|
|
102
102
|
|
|
103
103
|
> Execute this step only after the verification gate passes.
|
|
104
104
|
|
|
105
|
-
>
|
|
105
|
+
> 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}`.
|
|
106
106
|
|
|
107
107
|
> **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after "Target path" and before "Next step" in the output below — only when BOTH (1) `.agents/.airc.json` has a `sandbox` field and (2) task.md's `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the task.md you already loaded (the task has moved to completed/, so read it from `.agents/workspace/completed/{task-id}/task.md`). This block is independent of "Next steps" semantics.
|
|
108
108
|
|
|
109
109
|
Output format:
|
|
110
|
+
Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}`.
|
|
111
|
+
|
|
110
112
|
```
|
|
111
113
|
Task {task-id} cancelled; task directory moved to completed/.
|
|
112
114
|
|
|
@@ -120,9 +122,7 @@ Optional: clean up this task's sandbox
|
|
|
120
122
|
ai sandbox rm {branch}
|
|
121
123
|
|
|
122
124
|
Next step - inspect the moved task:
|
|
123
|
-
|
|
124
|
-
- Gemini CLI: /{{project}}:check-task {task-ref}
|
|
125
|
-
- Codex CLI: $check-task {task-ref}
|
|
125
|
+
{next-step-commands}
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
|
|
@@ -101,11 +101,13 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
|
|
|
101
101
|
|
|
102
102
|
> 仅在校验通过后执行本步骤。
|
|
103
103
|
|
|
104
|
-
>
|
|
104
|
+
> 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
|
|
105
105
|
|
|
106
106
|
> **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「目标路径」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取已读入的 task.md 的 `branch` 值(任务此时已移动到 completed/,从 `.agents/workspace/completed/{task-id}/task.md` 读取)。该块独立于「下一步」语义。
|
|
107
107
|
|
|
108
108
|
输出格式:
|
|
109
|
+
使用 `agent-infra-internal agent-client next-steps --skill check-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
|
|
110
|
+
|
|
109
111
|
```
|
|
110
112
|
任务 {task-id} 已取消,任务目录已转移到 completed/。
|
|
111
113
|
|
|
@@ -119,9 +121,7 @@ agent-infra-internal task-verify {task-id} cancel-task.completed --format text
|
|
|
119
121
|
ai sandbox rm {branch}
|
|
120
122
|
|
|
121
123
|
下一步 - 查看已转移任务:
|
|
122
|
-
|
|
123
|
-
- Gemini CLI:/{{project}}:check-task {task-ref}
|
|
124
|
-
- Codex CLI:$check-task {task-ref}
|
|
124
|
+
{next-step-commands}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
|
|
@@ -132,7 +132,7 @@ ai sandbox rm {branch}
|
|
|
132
132
|
- [ ] 已将任务目录移动到 `.agents/workspace/completed/`
|
|
133
133
|
- [ ] 已在存在 Issue 时完成 Issue 同步
|
|
134
134
|
- [ ] 已运行 gate 校验并通过
|
|
135
|
-
- [ ]
|
|
135
|
+
- [ ] 已通过统一 helper 渲染已选场景的下一步命令
|
|
136
136
|
|
|
137
137
|
## 注意事项
|
|
138
138
|
|
|
@@ -59,7 +59,7 @@ Workflow progress:
|
|
|
59
59
|
|
|
60
60
|
### 3. Recommend Next Action
|
|
61
61
|
|
|
62
|
-
Recommend the appropriate next skill based on the current workflow state.
|
|
62
|
+
Recommend the appropriate next skill based on the current workflow state.
|
|
63
63
|
|
|
64
64
|
> **⚠️ CONDITION CHECK — you must choose the single matching row in the table below based on `status`, `current_step`, the latest artifacts, and the latest review result:**
|
|
65
65
|
>
|
|
@@ -77,21 +77,21 @@ Recommend the appropriate next skill based on the current workflow state. You mu
|
|
|
77
77
|
>
|
|
78
78
|
> **Important: if the latest review report contains any issue at all, do not use the corresponding review-passed row. Use the corresponding has-issues row instead.**
|
|
79
79
|
>
|
|
80
|
-
> Before rendering the final output, read `.agents/rules/next-step-output.md
|
|
81
|
-
|
|
82
|
-
| Current State |
|
|
83
|
-
|
|
84
|
-
| Analysis Complete |
|
|
85
|
-
| Analysis Review Passed |
|
|
86
|
-
| Analysis Review Has Issues |
|
|
87
|
-
| Plan Complete |
|
|
88
|
-
| Plan Review Passed |
|
|
89
|
-
| Plan Review Has Issues |
|
|
90
|
-
| Code Complete |
|
|
91
|
-
| Code Review Passed |
|
|
92
|
-
| Code Review Has Issues |
|
|
93
|
-
| Task Blocked |
|
|
94
|
-
| Task Completed |
|
|
80
|
+
> Before rendering the final output, read `.agents/rules/next-step-output.md`. After selecting an actionable row, invoke `agent-infra-internal agent-client next-steps --skill {next-skill} [--task-ref {task-ref}]` exactly once and render stdout verbatim as `{next-step-commands}`. Do not invoke the helper for `Task Blocked` or `Task Completed`. Append the `Completed at` trailing line last.
|
|
81
|
+
|
|
82
|
+
| Current State | next skill | task ref |
|
|
83
|
+
|----------------------------|-------------------|----------|
|
|
84
|
+
| Analysis Complete | `review-analysis` | required |
|
|
85
|
+
| Analysis Review Passed | `plan-task` | required |
|
|
86
|
+
| Analysis Review Has Issues | `analyze-task` | required |
|
|
87
|
+
| Plan Complete | `review-plan` | required |
|
|
88
|
+
| Plan Review Passed | `code-task` | required |
|
|
89
|
+
| Plan Review Has Issues | `plan-task` | required |
|
|
90
|
+
| Code Complete | `review-code` | required |
|
|
91
|
+
| Code Review Passed | `commit` | omitted |
|
|
92
|
+
| Code Review Has Issues | `code-task` | required |
|
|
93
|
+
| Task Blocked | — | — |
|
|
94
|
+
| Task Completed | — | — |
|
|
95
95
|
|
|
96
96
|
## Notes
|
|
97
97
|
|
|
@@ -59,7 +59,7 @@ ai task status {task-id}
|
|
|
59
59
|
|
|
60
60
|
### 3. 建议下一步操作
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
根据当前工作流状态,建议合适的下一个技能:
|
|
63
63
|
|
|
64
64
|
> **⚠️ 条件判断 — 你必须先根据 `status`、`current_step`、最新产物和最新审查结果,选择下表中唯一匹配的一行:**
|
|
65
65
|
>
|
|
@@ -77,21 +77,21 @@ ai task status {task-id}
|
|
|
77
77
|
>
|
|
78
78
|
> **特别注意:只要最新审查报告中存在任何问题,就不能使用对应「审查通过」行。必须改用对应「审查有问题」行。**
|
|
79
79
|
>
|
|
80
|
-
> 渲染最终输出前先读取 `.agents/rules/next-step-output.md`
|
|
81
|
-
|
|
82
|
-
| 当前状态 |
|
|
83
|
-
|
|
84
|
-
| 分析完成 |
|
|
85
|
-
| 需求分析审查通过 |
|
|
86
|
-
| 需求分析审查有问题 |
|
|
87
|
-
| 计划完成 |
|
|
88
|
-
| 技术方案审查通过 |
|
|
89
|
-
| 技术方案审查有问题 |
|
|
90
|
-
| 实现完成 |
|
|
91
|
-
| 代码审查通过 |
|
|
92
|
-
| 代码审查有问题 |
|
|
93
|
-
| 任务被阻塞 |
|
|
94
|
-
| 任务已完成 |
|
|
80
|
+
> 渲染最终输出前先读取 `.agents/rules/next-step-output.md`。选中可执行行后只调用一次 `agent-infra-internal agent-client next-steps --skill {next-skill} [--task-ref {task-ref}]`,将 stdout 原样输出为 `{next-step-commands}`;`任务被阻塞` 与 `任务已完成` 不调用 helper。最后追加 `Completed at` 收尾行。
|
|
81
|
+
|
|
82
|
+
| 当前状态 | next skill | task ref |
|
|
83
|
+
|--------------------|-------------------|----------|
|
|
84
|
+
| 分析完成 | `review-analysis` | required |
|
|
85
|
+
| 需求分析审查通过 | `plan-task` | required |
|
|
86
|
+
| 需求分析审查有问题 | `analyze-task` | required |
|
|
87
|
+
| 计划完成 | `review-plan` | required |
|
|
88
|
+
| 技术方案审查通过 | `code-task` | required |
|
|
89
|
+
| 技术方案审查有问题 | `plan-task` | required |
|
|
90
|
+
| 实现完成 | `review-code` | required |
|
|
91
|
+
| 代码审查通过 | `commit` | omitted |
|
|
92
|
+
| 代码审查有问题 | `code-task` | required |
|
|
93
|
+
| 任务被阻塞 | — | — |
|
|
94
|
+
| 任务已完成 | — | — |
|
|
95
95
|
|
|
96
96
|
## 注意事项
|
|
97
97
|
|
|
@@ -89,10 +89,12 @@ Only `status=applied|no-op` means local archival completed. If the API dismissal
|
|
|
89
89
|
|
|
90
90
|
### 8. Inform User
|
|
91
91
|
|
|
92
|
-
>
|
|
92
|
+
> 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}`.
|
|
93
93
|
|
|
94
94
|
> **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after the "Note:" line and before "Next step" in the output below — only when ALL of (1) `.agents/.airc.json` has a `sandbox` field, (2) step 7 located a related task by the alert number, and (3) that related task's task.md `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the related task.md located in step 7. This block is independent of "Next step" semantics.
|
|
95
95
|
|
|
96
|
+
Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
|
|
97
|
+
|
|
96
98
|
```
|
|
97
99
|
Code Scanning alert #{alert-number} dismissed.
|
|
98
100
|
|
|
@@ -111,9 +113,7 @@ Optional: clean up this task's sandbox
|
|
|
111
113
|
ai sandbox rm {branch}
|
|
112
114
|
|
|
113
115
|
Next step - complete and archive the task if a related task exists:
|
|
114
|
-
|
|
115
|
-
- Gemini CLI: /{{project}}:complete-task {task-ref}
|
|
116
|
-
- Codex CLI: $complete-task {task-ref}
|
|
116
|
+
{next-step-commands}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
## Notes
|
|
@@ -89,10 +89,12 @@ agent-infra-internal task-lifecycle {task-id} close-codescan --agent {agent} \
|
|
|
89
89
|
|
|
90
90
|
### 8. 告知用户
|
|
91
91
|
|
|
92
|
-
>
|
|
92
|
+
> 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
|
|
93
93
|
|
|
94
94
|
> **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) 第 7 步按告警号定位到了关联任务、(3) 该关联任务 task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「注意:…」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取第 7 步定位到的关联任务 task.md 的 `branch` 值。该块独立于「下一步」语义。
|
|
95
95
|
|
|
96
|
+
使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
|
|
97
|
+
|
|
96
98
|
```
|
|
97
99
|
Code Scanning 告警 #{alert-number} 已关闭。
|
|
98
100
|
|
|
@@ -111,9 +113,7 @@ Code Scanning 告警 #{alert-number} 已关闭。
|
|
|
111
113
|
ai sandbox rm {branch}
|
|
112
114
|
|
|
113
115
|
下一步 - 完成并归档任务(如有关联任务):
|
|
114
|
-
|
|
115
|
-
- Gemini CLI:/{{project}}:complete-task {task-ref}
|
|
116
|
-
- Codex CLI:$complete-task {task-ref}
|
|
116
|
+
{next-step-commands}
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
## 注意事项
|
|
@@ -97,10 +97,12 @@ Only `status=applied|no-op` means local archival completed. If the API dismissal
|
|
|
97
97
|
|
|
98
98
|
### 8. Inform User
|
|
99
99
|
|
|
100
|
-
>
|
|
100
|
+
> 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}`.
|
|
101
101
|
|
|
102
102
|
> **Optional sandbox-cleanup hint (gated)**: Render the "Optional: clean up this task's sandbox" block — placed after the "Note:" line and before "Next step" in the output below — only when ALL of (1) `.agents/.airc.json` has a `sandbox` field, (2) step 7 located a related task by the alert number, and (3) that related task's task.md `branch` field exists and is not `main` / `master`; otherwise omit the whole block. `{branch}` is the `branch` value from the related task.md located in step 7. This block is independent of "Next step" semantics.
|
|
103
103
|
|
|
104
|
+
Populate `{next-step-commands}` for this scenario by running `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}`.
|
|
105
|
+
|
|
104
106
|
```
|
|
105
107
|
Security alert #{alert-number} dismissed.
|
|
106
108
|
|
|
@@ -119,9 +121,7 @@ Optional: clean up this task's sandbox
|
|
|
119
121
|
ai sandbox rm {branch}
|
|
120
122
|
|
|
121
123
|
Next step - complete and archive the task if a related task exists:
|
|
122
|
-
|
|
123
|
-
- Gemini CLI: /{{project}}:complete-task {task-ref}
|
|
124
|
-
- Codex CLI: $complete-task {task-ref}
|
|
124
|
+
{next-step-commands}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
## Notes
|
|
@@ -97,10 +97,12 @@ agent-infra-internal task-lifecycle {task-id} close-dependabot --agent {agent} \
|
|
|
97
97
|
|
|
98
98
|
### 8. 告知用户
|
|
99
99
|
|
|
100
|
-
>
|
|
100
|
+
> 渲染下一步前先读取 `.agents/rules/next-step-output.md`,仅为已选场景调用统一 helper,并将 stdout 填入 `{next-step-commands}`。
|
|
101
101
|
|
|
102
102
|
> **可选沙箱清理提示(门控渲染)**:仅当同时满足 (1) `.agents/.airc.json` 存在 `sandbox` 字段、(2) 第 7 步按告警号定位到了关联任务、(3) 该关联任务 task.md 的 `branch` 字段存在且不是 `main` / `master` 时,才渲染下方输出中「注意:…」之后、「下一步」之前的「可选:清理本任务的沙箱」块;任一不满足则整段省略。`{branch}` 取第 7 步定位到的关联任务 task.md 的 `branch` 值。该块独立于「下一步」语义。
|
|
103
103
|
|
|
104
|
+
使用 `agent-infra-internal agent-client next-steps --skill complete-task --task-ref {task-ref}` 生成本场景的 `{next-step-commands}`。
|
|
105
|
+
|
|
104
106
|
```
|
|
105
107
|
安全告警 #{alert-number} 已关闭。
|
|
106
108
|
|
|
@@ -119,9 +121,7 @@ agent-infra-internal task-lifecycle {task-id} close-dependabot --agent {agent} \
|
|
|
119
121
|
ai sandbox rm {branch}
|
|
120
122
|
|
|
121
123
|
下一步 - 完成并归档任务(如有关联任务):
|
|
122
|
-
|
|
123
|
-
- Gemini CLI:/{{project}}:complete-task {task-ref}
|
|
124
|
-
- Codex CLI:$complete-task {task-ref}
|
|
124
|
+
{next-step-commands}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
## 注意事项
|