@fitlab-ai/agent-infra 0.12.0 → 0.12.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 +0 -2
- package/README.zh-CN.md +0 -2
- package/dist/bin/internal-cli.js +2 -17
- package/dist/lib/agent-clients/adapter.js +0 -13
- package/dist/lib/agent-clients/adapters/antigravity-cli.js +0 -5
- package/dist/lib/agent-clients/adapters/claude-code-credentials.js +0 -17
- package/dist/lib/agent-clients/adapters/claude-code.js +0 -9
- package/dist/lib/agent-clients/adapters/codex.js +0 -52
- package/dist/lib/agent-clients/adapters/opencode.js +0 -5
- package/dist/lib/agent-clients/adapters/traecli.js +0 -5
- package/dist/lib/agent-clients/config.js +19 -54
- package/dist/lib/agent-clients/registry.js +1 -12
- package/dist/lib/agent-clients/schema.js +0 -18
- package/dist/lib/agent-clients/tokens.js +1 -2
- package/dist/lib/agent-clients/types.js +0 -1
- package/dist/lib/decide.js +2 -0
- package/dist/lib/git/worktree-identity.js +1 -9
- package/dist/lib/internal/agent-client.js +2 -62
- package/dist/lib/internal/cli-route-inventory.js +1 -5
- package/dist/lib/internal/manual-validation.js +29 -27
- package/dist/lib/internal/platform-comment.js +56 -7
- package/dist/lib/internal/task-create.js +1 -1
- package/dist/lib/internal/task-event.js +1 -8
- package/dist/lib/internal/task-finalization.js +0 -1
- package/dist/lib/internal/task-lifecycle.js +2 -2
- package/dist/lib/internal/task-operation-registry.js +4 -20
- package/dist/lib/internal/task-review.js +4 -4
- package/dist/lib/platform/comment-safety.js +1 -7
- package/dist/lib/platform/in-label-sync.js +1 -14
- package/dist/lib/platform/issue-comments.js +373 -282
- package/dist/lib/platform/issue-summary-content.js +112 -0
- package/dist/lib/platform/issues.js +1 -1
- package/dist/lib/platform/operation-coordinator.js +4 -2
- package/dist/lib/platform/pr-change-report.js +176 -30
- package/dist/lib/platform/pr-checks.js +2 -8
- package/dist/lib/platform/pr-summary-content.js +54 -0
- package/dist/lib/platform/pr-summary.js +318 -284
- package/dist/lib/platform/provider-validation.js +0 -20
- package/dist/lib/platform/pull-requests.js +73 -84
- package/dist/lib/platform/releases.js +1 -43
- package/dist/lib/platform/summary-content-pipeline.js +18 -0
- package/dist/lib/platform/verification-required.js +0 -2
- package/dist/lib/platform/verification-sync.js +1 -79
- package/dist/lib/process-data/normalize.js +1 -185
- package/dist/lib/process-data/privacy.js +1 -16
- package/dist/lib/process-data/sources.js +2 -279
- package/dist/lib/render.js +0 -12
- package/dist/lib/run/index.js +15 -10
- package/dist/lib/run/skills.js +0 -3
- package/dist/lib/sandbox/commands/create.js +40 -53
- package/dist/lib/sandbox/commands/list-running.js +0 -18
- package/dist/lib/sandbox/commands/start.js +7 -8
- package/dist/lib/sandbox/constants.js +0 -6
- package/dist/lib/sandbox/control/client.js +0 -1
- package/dist/lib/sandbox/control/container-identity.js +1 -16
- package/dist/lib/sandbox/control/executor.js +0 -4
- package/dist/lib/sandbox/control/identity-sentinel.js +0 -7
- package/dist/lib/sandbox/control/lifecycle.js +21 -37
- package/dist/lib/sandbox/control/native-file-lock.js +0 -3
- package/dist/lib/sandbox/control/server.js +18 -38
- package/dist/lib/sandbox/control/state.js +1 -9
- package/dist/lib/sandbox/dockerfile.js +0 -6
- package/dist/lib/sandbox/engine.js +0 -14
- package/dist/lib/sandbox/engines/docker-exact-discovery.js +1 -4
- package/dist/lib/sandbox/engines/wsl2-paths.js +0 -3
- package/dist/lib/sandbox/recovery.js +24 -26
- package/dist/lib/sandbox/removal.js +67 -518
- package/dist/lib/sandbox/task-resolver.js +0 -41
- package/dist/lib/sandbox/tools.js +1 -4
- package/dist/lib/sandbox/workspace-view.js +1 -2
- package/dist/lib/server/display.js +0 -6
- package/dist/lib/task/activity-intent.js +45 -40
- package/dist/lib/task/activity-log.js +9 -16
- package/dist/lib/task/artifact-command.js +1 -1
- package/dist/lib/task/artifact-lifecycle.js +61 -63
- package/dist/lib/task/artifact-name.js +0 -6
- package/dist/lib/task/artifact-operations.js +3 -3
- package/dist/lib/task/capabilities.js +4 -5
- package/dist/lib/task/commands/log.js +0 -6
- package/dist/lib/task/commands/status.js +17 -60
- package/dist/lib/task/commit-operation.js +28 -39
- package/dist/lib/task/completion-facts.js +56 -43
- package/dist/lib/task/control-authority.js +23 -256
- package/dist/lib/task/control-recovery.js +3 -5
- package/dist/lib/task/create.js +2 -4
- package/dist/lib/task/decision-intents.js +8 -9
- package/dist/lib/task/delivery-target.js +1 -40
- package/dist/lib/task/events.js +84 -107
- package/dist/lib/task/finalization.js +60 -15
- package/dist/lib/task/ledger-intents.js +1 -1
- package/dist/lib/task/lifecycle-execution.js +38 -33
- package/dist/lib/task/lifecycle.js +49 -41
- package/dist/lib/task/local-artifact-finalization.js +1 -4
- package/dist/lib/task/manual-validation-evidence.js +1 -37
- package/dist/lib/task/platform-operation-recovery.js +151 -108
- package/dist/lib/task/pr-delivery-fact.js +2 -5
- package/dist/lib/task/qualification-confirmation.js +5 -7
- package/dist/lib/task/resolve-ref.js +1 -25
- package/dist/lib/task/review-command.js +2 -2
- package/dist/lib/task/review-finalization.js +1 -21
- package/dist/lib/task/review-fingerprint.js +0 -4
- package/dist/lib/task/secure-fs.js +0 -56
- package/dist/lib/task/short-id.js +1 -39
- package/dist/lib/task/skill-scope.js +0 -1
- package/dist/lib/task/verification-engine.js +58 -282
- package/dist/lib/task/verification.js +6 -3
- package/dist/lib/task/write.js +11 -1
- package/lib/agent-clients/adapter.ts +0 -76
- package/lib/agent-clients/adapters/antigravity-cli.ts +0 -5
- package/lib/agent-clients/adapters/claude-code-credentials.ts +0 -19
- package/lib/agent-clients/adapters/claude-code.ts +0 -9
- package/lib/agent-clients/adapters/codex.ts +0 -56
- package/lib/agent-clients/adapters/opencode.ts +0 -5
- package/lib/agent-clients/adapters/traecli.ts +0 -5
- package/lib/agent-clients/config.ts +20 -61
- package/lib/agent-clients/registry.ts +1 -34
- package/lib/agent-clients/schema.ts +0 -18
- package/lib/agent-clients/tokens.ts +1 -2
- package/lib/agent-clients/types.ts +0 -15
- package/lib/decide.ts +1 -0
- package/lib/git/worktree-identity.ts +0 -10
- package/lib/internal/agent-client.ts +2 -70
- package/lib/internal/cli-route-inventory.ts +1 -4
- package/lib/internal/manual-validation.ts +28 -27
- package/lib/internal/platform-comment.ts +46 -4
- package/lib/internal/task-create.ts +0 -1
- package/lib/internal/task-event.ts +1 -5
- package/lib/internal/task-finalization.ts +0 -1
- package/lib/internal/task-lifecycle.ts +3 -5
- package/lib/internal/task-operation-registry.ts +3 -19
- package/lib/internal/task-review.ts +4 -4
- package/lib/platform/comment-safety.ts +0 -10
- package/lib/platform/github-provider.ts +0 -2
- package/lib/platform/in-label-sync.ts +0 -16
- package/lib/platform/issue-comments.ts +478 -301
- package/lib/platform/issue-summary-content.ts +132 -0
- package/lib/platform/issues.ts +0 -2
- package/lib/platform/operation-coordinator.ts +4 -2
- package/lib/platform/pr-change-report.ts +165 -25
- package/lib/platform/pr-checks.ts +1 -10
- package/lib/platform/pr-review.ts +1 -1
- package/lib/platform/pr-summary-content.ts +60 -0
- package/lib/platform/pr-summary.ts +364 -257
- package/lib/platform/provider-bridge.ts +0 -1
- package/lib/platform/provider-loader.ts +1 -5
- package/lib/platform/provider-validation.ts +1 -49
- package/lib/platform/pull-requests.ts +64 -99
- package/lib/platform/releases.ts +1 -40
- package/lib/platform/summary-content-pipeline.ts +23 -0
- package/lib/platform/verification-required.ts +0 -2
- package/lib/platform/verification-sync.ts +0 -94
- package/lib/process-data/normalize.ts +1 -186
- package/lib/process-data/privacy.ts +2 -19
- package/lib/process-data/sources.ts +3 -283
- package/lib/render.ts +0 -15
- package/lib/run/index.ts +13 -7
- package/lib/run/skills.ts +0 -4
- package/lib/sandbox/commands/create.ts +37 -74
- package/lib/sandbox/commands/list-running.ts +0 -19
- package/lib/sandbox/commands/start.ts +7 -10
- package/lib/sandbox/constants.ts +0 -8
- package/lib/sandbox/control/client.ts +0 -1
- package/lib/sandbox/control/container-identity.ts +1 -16
- package/lib/sandbox/control/executor.ts +1 -5
- package/lib/sandbox/control/identity-sentinel.ts +0 -8
- package/lib/sandbox/control/lifecycle.ts +18 -51
- package/lib/sandbox/control/native-file-lock.ts +0 -8
- package/lib/sandbox/control/protocol.ts +0 -2
- package/lib/sandbox/control/server.ts +13 -39
- package/lib/sandbox/control/state.ts +1 -10
- package/lib/sandbox/dockerfile.ts +0 -11
- package/lib/sandbox/engine.ts +0 -17
- package/lib/sandbox/engines/docker-exact-discovery.ts +1 -5
- package/lib/sandbox/engines/wsl2-paths.ts +0 -4
- package/lib/sandbox/recovery.ts +24 -26
- package/lib/sandbox/removal.ts +58 -687
- package/lib/sandbox/shell.ts +1 -1
- package/lib/sandbox/task-resolver.ts +0 -48
- package/lib/sandbox/tools.ts +1 -5
- package/lib/sandbox/workspace-view.ts +2 -4
- package/lib/server/display.ts +0 -14
- package/lib/server/process-control.ts +1 -1
- package/lib/task/activity-intent.ts +36 -44
- package/lib/task/activity-log.ts +9 -22
- package/lib/task/artifact-command.ts +1 -1
- package/lib/task/artifact-lifecycle.ts +58 -67
- package/lib/task/artifact-name.ts +0 -7
- package/lib/task/artifact-operations.ts +3 -3
- package/lib/task/capabilities.ts +5 -6
- package/lib/task/commands/log.ts +0 -7
- package/lib/task/commands/status.ts +14 -79
- package/lib/task/commit-operation.ts +29 -51
- package/lib/task/completion-facts.ts +45 -42
- package/lib/task/control-authority.ts +27 -317
- package/lib/task/control-recovery.ts +2 -5
- package/lib/task/create.ts +2 -5
- package/lib/task/decision-intents.ts +5 -5
- package/lib/task/delivery-target.ts +0 -40
- package/lib/task/events.ts +89 -123
- package/lib/task/finalization.ts +52 -15
- package/lib/task/ledger-intents.ts +1 -1
- package/lib/task/lifecycle-execution.ts +37 -89
- package/lib/task/lifecycle.ts +48 -44
- package/lib/task/local-artifact-finalization.ts +0 -7
- package/lib/task/manual-validation-evidence.ts +1 -47
- package/lib/task/platform-operation-recovery.ts +117 -104
- package/lib/task/pr-delivery-fact.ts +2 -11
- package/lib/task/qualification-confirmation.ts +6 -6
- package/lib/task/resolve-ref.ts +0 -23
- package/lib/task/review-command.ts +2 -2
- package/lib/task/review-finalization.ts +1 -27
- package/lib/task/review-fingerprint.ts +0 -8
- package/lib/task/secure-fs.ts +0 -42
- package/lib/task/short-id.ts +0 -43
- package/lib/task/skill-scope.ts +0 -1
- package/lib/task/verification-engine.ts +56 -287
- package/lib/task/verification.ts +5 -5
- package/lib/task/write.ts +12 -1
- package/package.json +2 -2
- package/templates/.agents/README.en.md +1 -3
- package/templates/.agents/README.zh-CN.md +0 -2
- package/templates/.agents/rules/README.en.md +0 -1
- package/templates/.agents/rules/README.zh-CN.md +0 -1
- package/templates/.agents/rules/commit-and-pr.en.md +1 -1
- package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -1
- package/templates/.agents/rules/no-mid-flow-questions.en.md +0 -10
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +0 -10
- package/templates/.agents/rules/pr-sync.en.md +4 -2
- package/templates/.agents/rules/pr-sync.zh-CN.md +6 -9
- package/templates/.agents/rules/task-management.en.md +3 -3
- package/templates/.agents/rules/task-management.zh-CN.md +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/code-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/commit/SKILL.en.md +2 -2
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +6 -6
- package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +6 -6
- 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/reference/summary-update.en.md +2 -2
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +2 -2
- package/templates/.agents/skills/complete-task/SKILL.en.md +10 -25
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +11 -26
- package/templates/.agents/skills/create-pr/SKILL.en.md +1 -1
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -2
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -2
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +2 -2
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +2 -2
- package/templates/.agents/skills/create-task/SKILL.en.md +0 -18
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +0 -18
- package/templates/.agents/skills/plan-task/SKILL.en.md +2 -2
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/review-analysis/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/review-code/SKILL.en.md +5 -5
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/review-plan/SKILL.en.md +3 -3
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/review-pr/SKILL.en.md +4 -4
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +1 -1
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +3 -75
- package/templates/.agents/skills/watch-pr/SKILL.en.md +1 -1
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +3 -3
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +3 -3
- package/templates/.agents/templates/task.en.md +1 -0
- package/templates/.agents/templates/task.zh-CN.md +1 -0
- package/templates/.claude/settings.json +0 -24
- package/templates/.codex/hooks.json +0 -50
- package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +0 -582
- package/dist/lib/agent-clients/adapters/codex-lifecycle/binding.js +0 -114
- package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +0 -237
- package/dist/lib/agent-clients/adapters/codex-lifecycle/cli.js +0 -443
- package/dist/lib/agent-clients/adapters/codex-lifecycle/evidence.js +0 -236
- package/dist/lib/agent-clients/adapters/codex-lifecycle/recovery.js +0 -292
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +0 -267
- package/dist/lib/agent-clients/adapters/codex-orchestration.js +0 -466
- package/dist/lib/internal/task-orchestration.js +0 -71
- package/dist/lib/platform/verification.js +0 -6
- package/dist/lib/run/prompt.js +0 -2
- package/dist/lib/sandbox/engines/authority.js +0 -289
- package/dist/lib/task/delegation-receipts.js +0 -410
- package/dist/lib/task/orchestration.js +0 -1233
- package/dist/lib/task/verification-checks.js +0 -9
- package/dist/lib/task/workspace-snapshot.js +0 -121
- package/dist/lifecycle-build-manifest.json +0 -6
- package/lib/agent-clients/adapters/codex-lifecycle/app-server.ts +0 -688
- package/lib/agent-clients/adapters/codex-lifecycle/binding.ts +0 -147
- package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +0 -349
- package/lib/agent-clients/adapters/codex-lifecycle/cli.ts +0 -506
- package/lib/agent-clients/adapters/codex-lifecycle/evidence.ts +0 -385
- package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +0 -41
- package/lib/agent-clients/adapters/codex-lifecycle/recovery.ts +0 -418
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +0 -354
- package/lib/agent-clients/adapters/codex-orchestration.ts +0 -630
- package/lib/internal/task-orchestration.ts +0 -74
- package/lib/platform/verification.ts +0 -11
- package/lib/run/prompt.ts +0 -1
- package/lib/sandbox/engines/authority.ts +0 -365
- package/lib/task/delegation-receipts.ts +0 -547
- package/lib/task/orchestration.ts +0 -1651
- package/lib/task/verification-checks.ts +0 -10
- package/lib/task/workspace-snapshot.ts +0 -144
- package/templates/.agents/hooks/lifecycle-delegation.js +0 -140
- package/templates/.agents/rules/lifecycle-orchestration.en.md +0 -44
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +0 -44
- package/templates/.agents/skills/run-task/SKILL.en.md +0 -29
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +0 -29
- package/templates/.agents/skills/run-task/config/verify.en.json +0 -10
- package/templates/.agents/skills/run-task/config/verify.zh-CN.json +0 -10
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +0 -24
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +0 -24
- package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +0 -6
- package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +0 -6
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +0 -6
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +0 -6
- package/templates/.claude/commands/run-task.en.md +0 -8
- package/templates/.claude/commands/run-task.zh-CN.md +0 -8
- package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +0 -3
- package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +0 -3
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +0 -3
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +0 -3
- package/templates/.opencode/commands/run-task.en.md +0 -11
- package/templates/.opencode/commands/run-task.zh-CN.md +0 -11
package/lib/task/verification.ts
CHANGED
|
@@ -17,8 +17,7 @@ type VerificationEvent =
|
|
|
17
17
|
| 'create-pr.completed' | 'create-task.completed'
|
|
18
18
|
| 'import-codescan.completed' | 'import-dependabot.completed'
|
|
19
19
|
| 'import-issue.completed' | 'watch-pr.completed'
|
|
20
|
-
| 'review-pr.completed'
|
|
21
|
-
| 'run-task.paused' | 'run-task.completed';
|
|
20
|
+
| 'review-pr.completed';
|
|
22
21
|
type VerificationSpec = {
|
|
23
22
|
skill: string;
|
|
24
23
|
expectedState: 'active' | 'blocked' | 'completed';
|
|
@@ -75,9 +74,7 @@ const VERIFICATION_CATALOG: Readonly<Record<VerificationEvent, VerificationSpec>
|
|
|
75
74
|
'import-dependabot.completed': gate('import-dependabot', 'active'),
|
|
76
75
|
'import-issue.completed': gate('import-issue', 'active'),
|
|
77
76
|
'watch-pr.completed': gate('watch-pr', 'active'),
|
|
78
|
-
'review-pr.completed': gate('review-pr', 'active', 'pr-review')
|
|
79
|
-
'run-task.paused': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state', 'orchestration-evidence'] },
|
|
80
|
-
'run-task.completed': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state', 'orchestration-evidence'] }
|
|
77
|
+
'review-pr.completed': gate('review-pr', 'active', 'pr-review')
|
|
81
78
|
};
|
|
82
79
|
|
|
83
80
|
function failure(request: { taskRef: string; event: string; artifact?: string }, code: string, message: string, extra: Partial<TaskVerificationResult> = {}): TaskVerificationResult {
|
|
@@ -161,6 +158,9 @@ function renderTaskVerification(result: TaskVerificationResult): string {
|
|
|
161
158
|
&& typeof message === 'string'
|
|
162
159
|
&& /\bhuman-decided (?:post-review )?exemption\b/i.test(message)
|
|
163
160
|
&& /\bPRC-\d+\s*:/.test(message);
|
|
161
|
+
if (Array.isArray(check.warnings)) {
|
|
162
|
+
for (const warning of check.warnings) if (typeof warning === 'string') lines.push(`Warning: ${id} - ${warning}`);
|
|
163
|
+
}
|
|
164
164
|
if (effectiveStatus === 'pass' && !isSoftWarning && !isHumanExemptionNotice) continue;
|
|
165
165
|
lines.push(isSoftWarning
|
|
166
166
|
? `Warning: ${id} (${rawStatus === 'blocked' ? `raw BLOCKED; ` : ''}${reason}) - ${message}; ${action}`
|
package/lib/task/write.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
TaskWorkspaceState
|
|
15
15
|
} from './resolve-ref.ts';
|
|
16
16
|
import { mutateTableRow, upsertSection } from './sections.ts';
|
|
17
|
+
import { lifecycleExecutions, prReviewExecution, serializeLifecycleExecution } from './lifecycle-execution.ts';
|
|
17
18
|
import { validateCurrentTaskContract } from './current-contract.ts';
|
|
18
19
|
import type {
|
|
19
20
|
TableRowDeleteMutation,
|
|
@@ -24,6 +25,7 @@ type FrontmatterMutation = {
|
|
|
24
25
|
kind: 'frontmatter';
|
|
25
26
|
set: Readonly<Record<string, FrontmatterScalar>>;
|
|
26
27
|
remove?: readonly string[];
|
|
28
|
+
lifecycleExecutionDomain?: 'ordinary' | 'pr-review';
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
type SectionMutation = {
|
|
@@ -288,7 +290,16 @@ function writeTaskCore(request: TaskWriteRequest, options: TaskWriteOptions = {}
|
|
|
288
290
|
}
|
|
289
291
|
const before = candidate;
|
|
290
292
|
if (mutation.kind === 'frontmatter') {
|
|
291
|
-
|
|
293
|
+
let set = mutation.set;
|
|
294
|
+
if (mutation.lifecycleExecutionDomain) {
|
|
295
|
+
const proposed = updateTaskFrontmatter(candidate, mutation.set);
|
|
296
|
+
const open = mutation.lifecycleExecutionDomain === 'ordinary'
|
|
297
|
+
? lifecycleExecutions(proposed)
|
|
298
|
+
: lifecycleExecutions(candidate);
|
|
299
|
+
const pr = prReviewExecution(mutation.lifecycleExecutionDomain === 'pr-review' ? proposed : candidate);
|
|
300
|
+
set = { ...mutation.set, lifecycle_execution: serializeLifecycleExecution(open, undefined, pr) };
|
|
301
|
+
}
|
|
302
|
+
candidate = updateTaskFrontmatter(candidate, set, mutation.remove);
|
|
292
303
|
operations.push({
|
|
293
304
|
index,
|
|
294
305
|
kind: 'frontmatter',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fitlab-ai/agent-infra",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Antigravity CLI, and OpenCode",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@clack/prompts": "1.8.1",
|
|
56
56
|
"@larksuiteoapi/node-sdk": "^1.68.0",
|
|
57
57
|
"cross-spawn": "^7.0.6",
|
|
58
|
-
"fs-native-extensions": "1.5.
|
|
58
|
+
"fs-native-extensions": "1.5.2",
|
|
59
59
|
"picocolors": "1.1.1",
|
|
60
60
|
"semver": "^7.8.1",
|
|
61
61
|
"smol-toml": "^1.6.1",
|
|
@@ -222,16 +222,14 @@ Ordinary `managed` files keep their overwrite semantics. A small set of platform
|
|
|
222
222
|
|
|
223
223
|
## Agent Client Configuration
|
|
224
224
|
|
|
225
|
-
Use the top-level `.agents/.airc.json` `agentClients` array to configure all five built-in clients (`claude-code`, `codex`, `antigravity-cli`, `opencode`, `traecli`). Each canonical entry has three required fields
|
|
225
|
+
Use the top-level `.agents/.airc.json` `agentClients` array to configure all five built-in clients (`claude-code`, `codex`, `antigravity-cli`, `opencode`, `traecli`). Each canonical entry has three required fields:
|
|
226
226
|
|
|
227
227
|
| Field | Meaning |
|
|
228
228
|
|-------|---------|
|
|
229
229
|
| `id` | Built-in Agent Client id. The canonical array contains exactly one entry for each built-in client. |
|
|
230
230
|
| `enabled` | Whether agent-infra writes and maintains that client's project integration and seed command. |
|
|
231
231
|
| `installInSandbox` | Whether the sandbox image installs that client's CLI. This is independent from `enabled`. |
|
|
232
|
-
| `orchestration` | Optional `run-task` default. It must include executor/reviewer `model` and host-native `reasoningEffort`; both roles may use the same model. |
|
|
233
232
|
|
|
234
|
-
Explicit `run-task` model/effort flags are atomic: any one requires all four role fields and configuration never fills omissions. With no explicit policy, only the current client's `orchestration` is used. Query model-selection context with `agent-infra-internal agent-client model-selection --client <id>`; it labels results complete, partial, or interactive-only and never presents a local override list as a complete catalog.
|
|
235
233
|
|
|
236
234
|
Manage these settings without hand-editing JSON:
|
|
237
235
|
|
|
@@ -228,9 +228,7 @@ disable-model-invocation: true # 可选;由支持该能力的 TUI 适配器
|
|
|
228
228
|
| `id` | 内建 Agent Client id。规范数组为每个内建客户端保留且仅保留一个条目。 |
|
|
229
229
|
| `enabled` | agent-infra 是否写入并维护该客户端的项目集成与种子命令。 |
|
|
230
230
|
| `installInSandbox` | 沙箱镜像是否安装该客户端 CLI;此字段与 `enabled` 相互独立。 |
|
|
231
|
-
| `orchestration` | `run-task` 可选默认策略;必须同时提供 executor/reviewer 的 `model` 与宿主原生 `reasoningEffort`,两个角色可以使用同一模型。 |
|
|
232
231
|
|
|
233
|
-
`run-task` 的显式 model/effort 参数是原子输入:只要提供其中任一字段,就必须完整提供四个 role 字段,不能从配置补齐。完全没有显式策略时,只读取当前客户端的 `orchestration`。模型目录通过 `agent-infra-internal agent-client model-selection --client <id>` 查询,并明确标记 complete、partial 或 interactive-only;局部 override 列表不能当作完整目录。
|
|
234
232
|
|
|
235
233
|
无需手工编辑 JSON,可使用:
|
|
236
234
|
|
|
@@ -31,7 +31,6 @@ so you can quickly find "which ones to read" without opening each file.
|
|
|
31
31
|
## Task Workflow
|
|
32
32
|
|
|
33
33
|
- [`task-management.md`](task-management.md) — Task intent detection, workflow-command mapping, and skill blocking boundaries.
|
|
34
|
-
- [`lifecycle-orchestration.md`](lifecycle-orchestration.md) — Fresh executor/reviewer, one-use receipt, pause/recovery, and safe endpoint rules for `run-task`.
|
|
35
34
|
- [`review-handshake.md`](review-handshake.md) — Three-stage bidirectional review handshake: four-state disposition, symmetric evidence, disagreement ledger, convergence and post-review commit gate.
|
|
36
35
|
- [`review-method.md`](review-method.md) — Shared three-stage review method: multi-pass review, risk lenses, traceability, and finding evidence.
|
|
37
36
|
- [`local-artifact-repair.md`](local-artifact-repair.md) — Pre-completion local artifact validation for analysis/plan/code and model-per-case repair, safety gates, and convergence for failed review artifacts.
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
## 任务工作流
|
|
31
31
|
|
|
32
32
|
- [`task-management.md`](task-management.md) — 任务语义识别、工作流命令映射与技能阻塞边界。
|
|
33
|
-
- [`lifecycle-orchestration.md`](lifecycle-orchestration.md) — `run-task` 的 fresh executor/reviewer、一次性 receipt、暂停恢复与安全终点规则。
|
|
34
33
|
- [`review-handshake.md`](review-handshake.md) — 三阶段双向审查握手协议:四态处置、对称证据、分歧账本、收敛与 post-review commit 门禁。
|
|
35
34
|
- [`review-method.md`](review-method.md) — 三阶段共享检视方法:多遍检视、风险镜头、追踪与 finding 证据契约。
|
|
36
35
|
- [`local-artifact-repair.md`](local-artifact-repair.md) — analysis/plan/code completed 前的本地产物校验、review artifact 失败后的模型逐例修复、机械安全门与收敛契约。
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## Commit Execution Boundary
|
|
11
11
|
|
|
12
12
|
- Do not run `git add` or `git commit` directly. All automatic commits must use the shared `agent-infra-internal git-workflow commit` core and follow the paths, HEAD/tree, and delivery-mode constraints of the applicable skill.
|
|
13
|
-
- The active workflow defines whether a commit is required. Completing `code-task` requires a local checkpoint through the shared core after tests and report preflight pass.
|
|
13
|
+
- The active workflow defines whether a commit is required. Completing `code-task` requires a local checkpoint through the shared core after tests and report preflight pass. The current code-task invocation calls the shared core.
|
|
14
14
|
- A `code-task` checkpoint never pushes to a remote. Other skills may call the shared core only when their workflow explicitly requires it. The standalone `commit` skill still requires an explicit user invocation and follows its push-delivery flow.
|
|
15
15
|
- Do not create a commit when the workflow does not require one. When a separate user commit is needed, remind the user to use the appropriate TUI command.
|
|
16
16
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## 提交执行边界
|
|
11
11
|
|
|
12
12
|
- 不直接执行 `git add` 或 `git commit`;所有自动提交都必须通过 `agent-infra-internal git-workflow commit` 共享 core,并遵守对应技能提供的 paths、HEAD/tree 和交付模式约束。
|
|
13
|
-
- 提交由当前工作流定义。`code-task` 完成实现必须在测试和实现报告 preflight 通过后,通过共享 core 创建一个本地 checkpoint
|
|
13
|
+
- 提交由当前工作流定义。`code-task` 完成实现必须在测试和实现报告 preflight 通过后,通过共享 core 创建一个本地 checkpoint;该要求由当前 code-task 调用共享 core 完成。
|
|
14
14
|
- `code-task` 的本地 checkpoint 不推送远端。其他技能只有在其流程明确要求时才可调用共享 core;独立 `commit` 技能仍须由用户显式调用,并遵循其 push delivery 流程。
|
|
15
15
|
- 工作流没有要求提交时,不要自行创建提交;需要用户执行独立提交时,再提示对应 TUI 命令。
|
|
16
16
|
|
|
@@ -49,14 +49,6 @@ SKILLs currently covered by this exemption:
|
|
|
49
49
|
- `create-release-note`: may confirm publish after presenting exact staged notes and their digest
|
|
50
50
|
- `post-release`: may confirm a normal push after preparing the local post commit and presenting the complete `postConfirmation` and digest
|
|
51
51
|
|
|
52
|
-
### Exemption 5: Complete model policy missing at lifecycle start
|
|
53
|
-
|
|
54
|
-
Only when `run-task` receives `ORCHESTRATION_MODEL_POLICY_REQUIRED` before any run, baseline, receipt, or child is created may it show model-selection context with its completeness label and ask once for complete executor/reviewer model + reasoning effort. Partial explicit policy, a missing client, active delegation, and other pause causes do not qualify. No answer means no run is created.
|
|
55
|
-
|
|
56
|
-
SKILLs currently covered by this exemption:
|
|
57
|
-
|
|
58
|
-
- `run-task`: may collect only the atomic model policy explicitly required by core
|
|
59
|
-
|
|
60
52
|
### Exemption 6: Necessary facts or security accountability that cannot be inferred
|
|
61
53
|
|
|
62
54
|
Only when the executor has checked the current task, configuration, code, Git, and platform records and still cannot safely infer a user-specific fact or security-accountability information required to proceed may it ask the user for that missing information. Keep the question limited to the missing fact itself. Do not ask for ordinary implementation preferences that existing evidence can resolve, and do not turn an exhausted recovery budget into general permission to ask.
|
|
@@ -105,8 +97,6 @@ A mandatory human review checkpoint means:
|
|
|
105
97
|
|
|
106
98
|
If a key decision needs human judgment during execution, follow the rule above and register the detail identity through the structured `decision-next-id` / `decision-upsert` commands for the user to address at the review checkpoint; ordinary open questions still go to `## Open Questions` / `未决问题`.
|
|
107
99
|
|
|
108
|
-
The `run-task` orchestrator may continue after a child skill artifact only when core mechanical state permits it; this does not bypass human decisions. When core reports a human decision, manual validation, or another stable pause condition, the orchestrator must stop without asking mid-flow or approving it itself.
|
|
109
|
-
|
|
110
100
|
## Error diagnosis and recovery order
|
|
111
101
|
|
|
112
102
|
When a tool, gate, platform, or local operation fails, read the complete error and structured result first. Determine state from the operation identity, acceptance status, side effects, receipt, and explicit retryability. Do not infer network failure, non-execution, or a need for user intervention from an exit code, wording, or temporary lack of output alone.
|
|
@@ -49,14 +49,6 @@
|
|
|
49
49
|
- `create-release-note`:展示 stage 后的精确 notes 与摘要后确认是否 publish
|
|
50
50
|
- `post-release`:完成本地 post commit 并展示完整 `postConfirmation` 与摘要后确认是否普通 push
|
|
51
51
|
|
|
52
|
-
### 例外 5:生命周期启动缺少完整模型策略
|
|
53
|
-
|
|
54
|
-
仅当 `run-task` 在创建任何 run、baseline、receipt 或 child 之前收到核心错误 `ORCHESTRATION_MODEL_POLICY_REQUIRED` 时,可展示带完整性标签的模型选择上下文,并一次询问 executor/reviewer 的完整 model + reasoning effort。部分显式策略、缺少 client、active delegation 或其他暂停原因不适用;用户未回答时不得创建 run。
|
|
55
|
-
|
|
56
|
-
当前归入本例外的 SKILL:
|
|
57
|
-
|
|
58
|
-
- `run-task`:仅补齐核心明确要求的原子模型策略
|
|
59
|
-
|
|
60
52
|
### 例外 6:无法推导的必要事实或安全责任信息
|
|
61
53
|
|
|
62
54
|
仅当已检查当前任务、配置、代码、Git 与平台记录后,仍无法安全推导继续执行所必需的用户专属事实或安全责任信息时,才可请求用户提供缺失内容。问题必须限定在缺失事实本身;不得询问可由现有证据决定的普通实现偏好,也不得把恢复预算耗尽泛化为提问许可。
|
|
@@ -105,8 +97,6 @@
|
|
|
105
97
|
|
|
106
98
|
如果在执行过程中发现需要用户裁定的关键决策,按上文「关键设计决策标记与落账」处理:通过 `decision-next-id` / `decision-upsert` 结构化命令登记详情块与账本身份,由用户在审查检查点统一回应;普通未决问题仍写 `## 未决问题` / `Open Questions`。
|
|
107
99
|
|
|
108
|
-
`run-task` 总控可以在子技能产出后依据核心机械状态继续到下一阶段;这不构成绕过人工裁决。只要核心返回人工裁决、人工验证或其他稳定暂停条件,总控必须停止,不能向用户中途提问,也不能自行批准。
|
|
109
|
-
|
|
110
100
|
## 错误诊断与恢复顺序
|
|
111
101
|
|
|
112
102
|
遇到工具、校验、平台或本地操作失败时,先读取完整错误与结构化结果,再按当前操作的身份、是否接纳、已发生副作用、receipt 和明确的 retryability 判断状态。不得仅凭退出码、错误措辞或暂时无输出推断网络故障、操作未执行或需要用户介入。
|
|
@@ -25,7 +25,7 @@ agent-infra-internal platform-pr summary-sync {task-id} \
|
|
|
25
25
|
--result {primary-result}
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Use only canonical inputs returned by the context command. The precheck must contain file evidence for six fixed checks; `formalReview` is always false and `needs-review` routes to `review-code`.
|
|
28
|
+
Use only canonical inputs returned by the context command. The precheck must contain file evidence for six fixed checks; `formalReview` is always false and `needs-review` routes to `review-code`. Generate a typed JSON payload with `overview:string`, `tests:{state,detail}`, `review:{state,detail}`, `manualValidation:{state,detail}`, `humanDecisions:{open,resolved,detail}`, and `risks:string`. Detail fields are non-empty, counts are non-negative integers, and structure checks do not assess semantic quality. The body file contains only these semantic fields; do not add a Markdown envelope, control markers, or the canonical report placeholder. The core renders the sections and inserts the placeholder, summary marker, and authoritative HEAD. Use `not-started`/`pending` for tests that have not started, `none`/`not-observed`/`not-published` for absent or unobserved remote Reviews, and `pending` for manual validation that has not run. Human-decision counts come from the task ledger. The core validates the task-intent digest, bound PR identity, complete patch SHA, and mechanical totals before rendering the report, then owns create/update/no-op behavior.
|
|
29
29
|
|
|
30
30
|
The canonical comment envelope produced by the core is:
|
|
31
31
|
|
|
@@ -40,7 +40,9 @@ The canonical comment envelope produced by the core is:
|
|
|
40
40
|
### PR Code Changes
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
Canonical inputs include `manual-validation.md`. The manual-validation
|
|
43
|
+
Canonical inputs include `manual-validation.md`. The manual-validation `state` can be `required`, `pending`, `passed`, `none`/`not-required`, or `not-observed`. English headings such as `### ⚠️ Manual Verification Required`, `### ✅ Manual Validation Passed`, and `### ✅ No Manual Verification Needed` are documentation labels; the current renderer emits Chinese headings. `complete-manual-validation` refreshes the same summary in place. The PR code-change section uses authoritative base/head facts from `platform-pr inspect` and the complete `git diff --find-renames --numstat base...head`, reconciles runtime, test, skill/rule, template, documentation, and other categories, and explains renames, mechanical mirrors, and potentially unnecessary changes. The core renderer supplies the canonical `### PR Code Changes` section. After publishing, the core reads comments back and requires one summary marker with a body that exactly matches the canonical rendered body; mismatch or read failure uses the existing coordinator/recovery path.
|
|
44
|
+
|
|
45
|
+
Examples include `required`, `pending`, `passed`, `none`/`not-required`, and `not-observed`; this list is illustrative, not exhaustive. The renderer also accepts `unavailable` and other non-empty states through its existing fallback. English headings below are documentation labels; the current renderer emits the stated Chinese headings. `required` retains each item, location, and reason under `### ⚠️ 需人工校验`. `pending` means validation has not started or remains incomplete and renders as `### ⏳ 人工验证待收尾`. `passed` (`### ✅ Manual Validation Passed` in this documentation; `### ✅ 人工验证已通过` from the renderer) is publishable only through the final `complete-manual-validation` coordinator after it writes a valid receipt. Preserve the receipt marker bound to the transaction, receipt, evidence, and current PR head; never infer passed status from summary text or another state. `none`/`not-required` renders as `### ✅ 无需人工校验` only when no manual item is required and carries no passed receipt. `not-observed` means the state has not been read and renders as `### ℹ️ 尚未读取人工校验状态`.
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
48
|
agent-infra-internal task-warning {task-id} add --step {step} --severity WARNING \
|
|
@@ -18,17 +18,14 @@ PR 摘要的语义聚合由模型完成;任务意图 digest、完整三点 dif
|
|
|
18
18
|
agent-infra-internal platform-pr summary-context {task-id}
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
只使用返回的 canonical latest `plan*`、`review-plan*`、`code*`、`review-code*`、`manual-validation*`(包括 `manual-validation.md
|
|
21
|
+
只使用返回的 canonical latest `plan*`、`review-plan*`、`code*`、`review-code*`、`manual-validation*`(包括 `manual-validation.md`)。模型生成 PR 专属 JSON payload:`overview:string`、`tests:{state,detail}`、`review:{state,detail}`、`manualValidation:{state,detail}`、`humanDecisions:{open,resolved,detail}`、`risks:string`。说明字段为非空字符串,计数为非负整数;结构校验不评价内容语义。body file 只包含这些语义字段;不要写入 Markdown envelope、控制 marker 或 canonical report placeholder。core 负责渲染章节并插入 placeholder、summary marker 和权威 HEAD。
|
|
22
22
|
|
|
23
|
-
-
|
|
24
|
-
- 测试结果
|
|
25
|
-
- 审查历程与当前结论
|
|
26
|
-
- 人工校验三态:`### ⚠️ 需人工校验`、`### ✅ 人工验证已通过` 或 `### ✅ 无需人工校验`
|
|
27
|
-
- 变更摘要、实现范围、测试结果、审查历程和人工校验三态
|
|
28
|
-
- 一个 `<!-- canonical-pr-change-report -->` 占位符;`### PR 代码增减` 由 core renderer 基于权威 diff 生成,调用方不自行写标题或统计
|
|
23
|
+
测试尚未启动用 `not-started`/`pending`,暂无远端 Review 用 `none`/`not-observed`/`not-published`,待人工校验用 `pending`,不得渲染为通过或零值。决策计数来自当前任务账本。renderer 固定生成完整章节并加入一个 canonical 报告占位符;代码增减仍由现有 report renderer 输出。
|
|
29
24
|
|
|
30
25
|
保留人工校验项时,每条写明校验内容、定位和只能人工完成的原因。
|
|
31
26
|
|
|
27
|
+
例如可见状态包括 `required`、`pending`、`passed`、`none`/`not-required` 和 `not-observed`;这些是示例而非穷举。renderer 也接受 `unavailable` 及其他非空状态,并按现有 fallback 渲染。英文标题是文档标签;当前 renderer 输出下列中文标题:`required` 使用 `### ⚠️ 需人工校验` 并保留每项内容、定位和原因;`pending` 使用 `### ⏳ 人工验证待收尾`;`passed` 使用 `### ✅ 人工验证已通过`,但仅允许 `complete-manual-validation` 的 final coordinator 写入有效 receipt 后发布,并保留绑定 transaction、receipt、evidence 和当前 PR head 的凭据标记;不得根据摘要文字或其他状态推断通过。`none`/`not-required` 仅在无需人工校验时使用 `### ✅ 无需人工校验`,不附加通过凭据;`not-observed` 使用 `### ℹ️ 尚未读取人工校验状态`。
|
|
28
|
+
|
|
32
29
|
core 最终包装出的 canonical 评论结构为:
|
|
33
30
|
|
|
34
31
|
```markdown
|
|
@@ -54,7 +51,7 @@ precheck 必须覆盖六项固定检查并提供文件证据;`formalReview`
|
|
|
54
51
|
|
|
55
52
|
## 发布
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
把聚合后的 JSON payload 写入 `{summary-body-file}`,不要自行添加 marker 或 commit SHA:
|
|
58
55
|
|
|
59
56
|
```bash
|
|
60
57
|
agent-infra-internal platform-pr summary-sync {task-id} \
|
|
@@ -63,7 +60,7 @@ agent-infra-internal platform-pr summary-sync {task-id} \
|
|
|
63
60
|
--result {primary-result}
|
|
64
61
|
```
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
core 校验结构后插入报告占位符,重新校验任务意图 digest、PR identity、完整 patch SHA 和机械统计,生成报告段,再包装 marker 与权威 HEAD。发布后使用 `comments.list` 回读并要求唯一 marker 和正文完全匹配;不符或读取失败沿用现有 coordinator/recovery。payload 通过文件输入,调用方不得拼 shell/heredoc。
|
|
67
64
|
|
|
68
65
|
## 结果回传
|
|
69
66
|
|
|
@@ -27,7 +27,7 @@ Map user intent to the corresponding workflow command:
|
|
|
27
27
|
- Long-name mapping (normalized to the short token before writing): `claude-code` -> `claude`, `antigravity-cli` -> `antigravity`
|
|
28
28
|
- Manual-step exception: no matter which agent is used, a human-made decision is always declared as `human`
|
|
29
29
|
|
|
30
|
-
The
|
|
30
|
+
The six internal commands (`task-event` / `task-lifecycle` / `task-finalization` / `platform-issue` / `platform-comment` / `platform-pr`) hard-validate `--agent` against a whitelist: they accept a short token, a long name, or `human`, and reject non-standard values with the matching `*_PAYLOAD_INVALID` error; long names are normalized to the short token before being persisted or forwarded. The `ai task log` renderer keeps unknown tokens grouped as `human` but appends a visible `(unknown)` marker.
|
|
31
31
|
|
|
32
32
|
## State Snapshot and Completion Verification Entrypoints
|
|
33
33
|
|
|
@@ -71,7 +71,7 @@ Other skills continue past deferrable writes according to their local delivery g
|
|
|
71
71
|
|
|
72
72
|
`analyze-task`, `review-analysis`, `plan-task`, `review-plan`, `code-task`, and `review-code` must declare business events through `agent-infra-internal task-event`. The event core generates `current_step`, `assigned_to`, `updated_at`, `agent_infra_version`, and the log text below. Other lifecycle skills not yet migrated continue to follow this textual protocol.
|
|
73
73
|
|
|
74
|
-
> This section
|
|
74
|
+
> This section defines log formatting. Structured facts govern business state; when the log cannot be appended safely, preserve the business result and report a diagnostic.
|
|
75
75
|
|
|
76
76
|
**Line grammar is unchanged** and shared by the log renderer and verification activity parser.
|
|
77
77
|
|
|
@@ -79,7 +79,7 @@ Other skills continue past deferrable writes according to their local delivery g
|
|
|
79
79
|
`- {time} — **{base} [started]** by {agent} — started`
|
|
80
80
|
- **done line** (written when the step completes, unchanged from today): the action is the base itself:
|
|
81
81
|
`- {time} — **{base}** by {agent} — {completion summary}`
|
|
82
|
-
- **Commit execution boundary**: the commit skill must not hand-write task Activity Log, review anchors, receipts, or checkpoints.
|
|
82
|
+
- **Commit execution boundary**: the commit skill must not hand-write task Activity Log, review anchors, receipts, or checkpoints. Commit core uses direct execution; task-bound callers select local checkpoint or push delivery. Taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and creates no task-state side effects.
|
|
83
83
|
- `{base}` is that skill's existing done action text, including `(Round {N})` (e.g. `Plan Task (Round 1)`). started and done must share the same `{base}` to pair.
|
|
84
84
|
|
|
85
85
|
**Pairing and rendering** (`ai task log`): a started entry pairs with the next same-`{base}` done entry onto one row (repeated executions of the same base pair FIFO by ascending time). The STARTED column shows the start time, DONE the completion time; started with no done = in progress (DONE shows `(in progress)`); done with no started (legacy logs) = a standalone completed row. All three shapes are valid and never error.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
- 长名映射(写入前归一化为短名):`claude-code` → `claude`、`antigravity-cli` → `antigravity`
|
|
28
28
|
- 人工步骤例外:无论使用哪个 Agent,只要是人做的决定,统一声明 `human`
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
六个内部命令(`task-event` / `task-lifecycle` / `task-finalization` / `platform-issue` / `platform-comment` / `platform-pr`)对 `--agent` 做白名单硬校验:接受短名、长名或 `human`,非标准值返回对应 `*_PAYLOAD_INVALID` 错误;长名在落库/透传前归一化为短名。渲染端 `ai task log` 对无法识别的 token 保留 `human` 归类并附加 `(unknown)` 标记。
|
|
31
31
|
|
|
32
32
|
## 状态快照与完成验证入口
|
|
33
33
|
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
`analyze-task`、`review-analysis`、`plan-task`、`review-plan`、`code-task`、`review-code` 必须通过 `agent-infra-internal task-event` 声明业务事件;事件核心统一生成 `current_step`、`assigned_to`、`updated_at`、`agent_infra_version` 和下述日志文本。其余尚未迁移的生命周期 SKILL 继续遵循本节文本协议。
|
|
73
73
|
|
|
74
|
-
>
|
|
74
|
+
> 本节定义日志行的格式。业务状态以结构化事实为准;日志不可安全追加时保留业务结果并报告诊断。
|
|
75
75
|
|
|
76
76
|
**行语法不变**:started 与 done 都沿用既有条目语法
|
|
77
77
|
`- {YYYY-MM-DD HH:mm:ss±HH:MM} — **{action}** by {agent} — {note}`,因此解析正则
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
`- {time} — **{基名} [started]** by {agent} — started`
|
|
82
82
|
- **done 行**(步骤完成时写,与现状一致):action 即基名本身:
|
|
83
83
|
`- {time} — **{基名}** by {agent} — {完成说明}`
|
|
84
|
-
- **Commit 执行边界**:commit 技能不得手写 task Activity Log、review anchor、receipt 或 checkpoint。task-bound
|
|
84
|
+
- **Commit 执行边界**:commit 技能不得手写 task Activity Log、review anchor、receipt 或 checkpoint。commit core 固定使用 direct execution;task-bound 调用方按 `local` checkpoint 或 `push` delivery 选择交付方式。taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,且不产生任务状态副作用。
|
|
85
85
|
- `{基名}` 指该 SKILL 既有 done 条目的 action 文本,含 `(Round {N})`(如 `Plan Task (Round 1)`)。
|
|
86
86
|
started 与 done 共用同一 `{基名}` 才能配对。
|
|
87
87
|
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# Analyze Task
|
|
10
10
|
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request`, `new-requirement`, or `upstream-fact-doubt`. Reuse the same values for started and completed.
|
|
13
13
|
|
|
14
14
|
## Boundary / Critical Rules
|
|
15
15
|
|
|
@@ -119,7 +119,7 @@ Runs after Step 0 state check and Step 3 (questioning is an external-state actio
|
|
|
119
119
|
- otherwise (no pending question) → pick the single highest-value question (acceptance criteria > scope > ambiguity) and write `## Brainstorming`: `status: asking`, `pending_question: <question>`, `question_count += 1`.
|
|
120
120
|
2. If `start_date` is empty, write today (`date +%F`), then run `agent-infra-internal task-event {task-id} analyze.awaiting-input --agent {standard-agent-token} --question {question_count}` so the core updates base metadata and Activity Log.
|
|
121
121
|
3. Issue sync (when a valid `platform_issue_identity` exists, skip on any failure): run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` to update only the **task comment**; keep the `status` label at `pending-design-work`; do **not** publish an analysis artifact comment.
|
|
122
|
-
4. Verification (replaces the step 8 artifact gate): `agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text` (the early-exit set `current_step: requirement-analysis` and wrote `start_date`, so it should pass); also
|
|
122
|
+
4. Verification (replaces the step 8 artifact gate): `agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text` (the early-exit set `current_step: requirement-analysis` and wrote `start_date`, so it should pass); also retain any log diagnostic from the event result and the task-comment sync evidence. Do **not** run the artifact gate, nor `check activity-log` / `check platform-sync` (both bind to the analysis artifact path).
|
|
123
123
|
5. User output: show only the current **single question** plus how to answer/continue (re-trigger `analyze-task {task-ref}` with the answer).
|
|
124
124
|
6. **STOP** and wait for the answer. The next trigger returns to this step.
|
|
125
125
|
|
|
@@ -239,7 +239,7 @@ agent-infra-internal task-artifact {task-id} finalize-local --family analysis --
|
|
|
239
239
|
- On `status=failed`, correct the formal artifact directly and rerun the finalizer completely; if the current diagnostic remains unresolved, continue to the next attempt.
|
|
240
240
|
- On an external formal-artifact change, an unsafe repair, repeated diagnostics or fingerprints, no progress, or the shared edit limit, stop without publishing a completed event.
|
|
241
241
|
|
|
242
|
-
Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}
|
|
242
|
+
Use the digests from that same `status=passed` result in `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}` so the core records the link, stage, agent, metadata, and Activity Log atomically.
|
|
243
243
|
- {YYYY-MM-DD HH:mm:ss±HH:MM} — **Analyze Task (Round {N})** by {agent} — Analysis completed → {analysis-artifact}
|
|
244
244
|
```
|
|
245
245
|
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# 分析任务
|
|
10
10
|
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 使用 `user-request`、`new-requirement` 或 `upstream-fact-doubt`;started 与 completed 使用同一组值。
|
|
13
13
|
|
|
14
14
|
## 行为边界 / 关键规则
|
|
15
15
|
|
|
@@ -122,7 +122,7 @@ agent-infra-internal task-event {task-id} analyze.started --agent {standard-agen
|
|
|
122
122
|
- 否则(无待答问题)→ 选最高价值的一个问题(验收标准 > 范围 > 歧义),写入 `## Brainstorming`:`status: asking`、`pending_question: <问题>`、`question_count += 1`。
|
|
123
123
|
2. 若 `start_date` 为空,写入当日日期(`date +%F`);随后执行 `agent-infra-internal task-event {task-id} analyze.awaiting-input --agent {standard-agent-token} --question {question_count}`,由核心统一更新基础 frontmatter 和 Activity Log。
|
|
124
124
|
3. Issue 同步(存在有效 `platform_issue_identity` 时,任一失败跳过):调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}` 更新 **task 评论**;`status` label 维持 `pending-design-work`;**不**发布分析产物评论。
|
|
125
|
-
4. 校验(替代步骤 8 的 artifact gate):`agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text`(早退已置 `current_step: requirement-analysis` 且已写入 `start_date
|
|
125
|
+
4. 校验(替代步骤 8 的 artifact gate):`agent-infra-internal task-verify {task-id} analyze.awaiting-input --format text`(早退已置 `current_step: requirement-analysis` 且已写入 `start_date`,预期通过);并保留事件结果中的日志诊断(如有)与 task 评论同步证据。**不**跑 artifact gate,也不跑 `check activity-log` / `check platform-sync`(二者绑定分析产物路径)。
|
|
126
126
|
5. 用户输出:只展示当前**单个问题** + 如何回答/继续(再次触发 `analyze-task {task-ref}` 并附答案)。
|
|
127
127
|
6. **STOP**,等待回答。下一次触发回到本步骤。
|
|
128
128
|
|
|
@@ -241,7 +241,7 @@ agent-infra-internal task-artifact {task-id} init --family analysis --artifact {
|
|
|
241
241
|
- `status=passed`:保存本次返回的 `artifactSha256` 和 `semanticDigest`;finalizer 已记录对应的一次性本地 provenance intent。
|
|
242
242
|
- `status=failed`:直接修正正式产物并完整重跑 finalizer;若仍失败且诊断未解决,继续下一轮。
|
|
243
243
|
- 当前正式产物发生外部变化、无法安全修复、诊断或指纹重复、无进展,或达到共享规则的编辑上限时停止,不发布 completed 事件。
|
|
244
|
-
- 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}
|
|
244
|
+
- 使用同一次 `status=passed` 返回的摘要执行 `agent-infra-internal task-event {task-id} analyze.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {analysis-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest}`,由核心登记链接、阶段、代理、时间、版本和 Activity Log。
|
|
245
245
|
|
|
246
246
|
如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(任一失败则跳过并继续):
|
|
247
247
|
- 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status pending-design-work --fields`
|
|
@@ -80,10 +80,10 @@ Check whether `task.md` contains a valid `platform_issue_identity`. If not, skip
|
|
|
80
80
|
|
|
81
81
|
If a valid `platform_issue_identity` exists, require `applied` / `no-op` without an error for every operation before declaring cancellation fully complete. On failure, retain the local terminal state and recovery record, then retry this skill for the same task after repair:
|
|
82
82
|
- Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
|
|
83
|
-
- Write the cancellation
|
|
83
|
+
- Write the cancellation comment JSON payload to a temporary file and run `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
84
84
|
- Run `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
85
85
|
|
|
86
|
-
The cancellation comment must include at least:
|
|
86
|
+
The cancellation comment JSON fields are `taskId`, `title`, `outcome:"cancelled"`, `reason`, `cancelledAt`, and `lastCompletedArtifact`. `taskId` must match the current task; the core fills missing values from the task.md title, cancellation reason/time metadata, and artifact registry (`lastCompletedArtifact` is `null` when no completed artifact exists), then renders the comment body. It must include at least:
|
|
87
87
|
- the cancellation reason
|
|
88
88
|
- the selected `status:` label
|
|
89
89
|
|
|
@@ -79,10 +79,10 @@ ls <task-workspace>/completed/{task-id}/task.md
|
|
|
79
79
|
|
|
80
80
|
如果存在有效的 `platform_issue_identity`,以下操作均须取得 `applied` / `no-op` 且无错误后才能宣称取消全部完成;失败时保留本地终态和待恢复记录,修复后以同一任务重试本技能:
|
|
81
81
|
- 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status {reason} --in-labels none --assignees none --milestone none --state closed --close-reason not_planned`
|
|
82
|
-
-
|
|
82
|
+
- 将取消评论 JSON payload 写入临时文件,调用 `agent-infra-internal platform-comment sync {task-id} --kind cancel --body-file {path} --agent {standard-agent-token}`
|
|
83
83
|
- 调用 `agent-infra-internal platform-comment sync {task-id} --kind task --agent {standard-agent-token}`
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
取消评论 JSON 字段为 `taskId`、`title`、`outcome:"cancelled"`、`reason`、`cancelledAt`、`lastCompletedArtifact`。`taskId` 必须匹配当前任务;core 从 task.md 标题、取消原因/时间元数据和 artifact registry 补齐缺省值,无已完成产物时 `lastCompletedArtifact` 为 `null`,然后渲染评论正文。取消评论至少包含:
|
|
86
86
|
- 取消原因
|
|
87
87
|
- 选定的 `status:` label
|
|
88
88
|
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# Code Task
|
|
10
10
|
> `--agent` values are defined in `.agents/rules/task-management.md` under “Collaborator Token Specification”.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Lifecycle events require explicit trigger data: ordinary skill invocation uses `model`; use `human` only when the user explicitly requests it. `{request-id}` is a stable single-line identifier for this task and artifact round, and `{reason-code}` use `user-request` for initial work and `review-finding` for fixes or decisions. Reuse the same values for started and completed.
|
|
13
13
|
|
|
14
14
|
Implement from the input selected by the lifecycle path and produce `code.md` or `code-r{N}.md`. This skill supports initial implementation, fix mode based on `review-code` feedback, and human-decision-driven implementation.
|
|
15
15
|
|
|
@@ -168,7 +168,7 @@ Do not rescan or manually write digest data; the completion event must include `
|
|
|
168
168
|
|
|
169
169
|
### 11. Update Task Status
|
|
170
170
|
|
|
171
|
-
After requirement checkboxes are updated, run the initial event `agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --files-modified {n} --tests-passed {n}
|
|
171
|
+
After requirement checkboxes are updated, run the initial event `agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --files-modified {n} --tests-passed {n}`; in fix mode add `--fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n}` instead; in decision mode add `--implementation-input {input-id}` to the initial counts. The core atomically records the artifact link, stage, metadata, done log, and decision-input consumption.
|
|
172
172
|
|
|
173
173
|
If task.md has a valid `platform_issue_identity`, read `.agents/rules/issue-sync.md`, then run these syncs. Record failures as warnings and continue the local workflow:
|
|
174
174
|
- Run `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status in-progress`
|
|
@@ -9,7 +9,7 @@ description: >
|
|
|
9
9
|
# 编码任务
|
|
10
10
|
> `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
生命周期事件必须携带显式触发信息:普通技能调用使用 `model`;仅用户明确要求时使用 `human`。`{request-id}` 是本任务与本轮产物的稳定单行标识,`{reason-code}` 初次实现使用 `user-request`,修复或裁决使用 `review-finding`;started 与 completed 使用同一组值。
|
|
13
13
|
|
|
14
14
|
根据所选生命周期路径的实现输入编码任务,并产出 `code.md` 或 `code-r{N}.md`。本技能支持初次实现、基于 `review-code` 反馈的修复,以及人工裁决驱动实现三种模式。
|
|
15
15
|
|
|
@@ -211,9 +211,9 @@ echo "$finalizer"
|
|
|
211
211
|
- 审查 `## 需求` 段落,仅把本轮已由代码实现且有测试通过支撑的条目从 `- [ ]` 勾为 `- [x]`
|
|
212
212
|
- 产物链接、阶段与完成日志由 completed 事件统一登记
|
|
213
213
|
- 完成业务内容更新后声明完成事件:
|
|
214
|
-
- 初次实现:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --files-modified {n} --tests-passed {n}
|
|
215
|
-
- 修复模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n}
|
|
216
|
-
- 裁决模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --implementation-input {input-id} --files-modified {n} --tests-passed {n}
|
|
214
|
+
- 初次实现:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --files-modified {n} --tests-passed {n}`
|
|
215
|
+
- 修复模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --fix-for {review-artifact} --blockers {n} --major {n} --minor {n} --manual-validation {n}`
|
|
216
|
+
- 裁决模式:`agent-infra-internal task-event {task-id} code.completed --agent {standard-agent-token} --initiator {trigger-initiator} --request-id {request-id} --reason-code {reason-code} --artifact {code-artifact} --artifact-sha256 {artifact-sha256} --semantic-digest {semantic-digest} --implementation-input {input-id} --files-modified {n} --tests-passed {n}`
|
|
217
217
|
|
|
218
218
|
如果 task.md 中存在有效的 `platform_issue_identity`,执行以下同步操作(失败按规则记录 warning,继续本地流程;边界见 `.agents/rules/issue-sync.md`):
|
|
219
219
|
- 调用 `agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status in-progress`
|
|
@@ -19,9 +19,9 @@ The entry point may omit the task ref; explicit task scope accepts only `--task
|
|
|
19
19
|
|
|
20
20
|
- An explicit task-resolution failure stops the operation.
|
|
21
21
|
- Without an explicit task scope, only `TASK_CONTEXT_NOT_FOUND` may enter taskless direct mode; detached HEAD, malformed candidates, and multiple matches fail closed.
|
|
22
|
-
-
|
|
22
|
+
- Execution mode is always `direct`; the caller selects delivery with `delivery=local|push`.
|
|
23
23
|
- Taskless direct mode does not read, create, or complete task intent, receipt, checkpoint, or task.md records.
|
|
24
|
-
-
|
|
24
|
+
- `code-task` creates `delivery=local` checkpoints through the shared core; standalone `commit` uses `delivery=push`.
|
|
25
25
|
- After resolution, use only the core-returned `taskId`; never infer task identity from the environment, branch, or filename.
|
|
26
26
|
|
|
27
27
|
## 1. Inspect local changes
|
|
@@ -19,9 +19,9 @@ commit core 只返回一个主结果:`committed`、`no_op`、`committed_with_w
|
|
|
19
19
|
|
|
20
20
|
- 显式 task scope 解析失败时停止。
|
|
21
21
|
- 未显式指定 task scope 时,只有 `TASK_CONTEXT_NOT_FOUND` 可进入 taskless direct;detached HEAD、损坏候选或多匹配必须 fail closed。
|
|
22
|
-
-
|
|
22
|
+
- 执行模式固定为 `direct`;调用方通过 `delivery=local|push` 指定交付方式。
|
|
23
23
|
- taskless direct 不读取、创建或完成 task intent、receipt、checkpoint 或 task.md 收尾记录。
|
|
24
|
-
- task
|
|
24
|
+
- `code-task` 通过共享 core 创建 `delivery=local` checkpoint;独立 `commit` 使用 `delivery=push`。
|
|
25
25
|
- 解析成功后只使用 core 返回的 `taskId`;不得从环境、分支或文件名猜测任务身份。
|
|
26
26
|
|
|
27
27
|
## 1. 检查本地修改
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Commit core boundary
|
|
2
2
|
|
|
3
|
-
Commit, push, result mapping, and task finalization use one `commit-operation.execute`. The entry point
|
|
3
|
+
Commit, push, result mapping, and task finalization use one `commit-operation.execute`. The entry point resolves task scope, explicit agent, and call arguments. Execution mode is always `direct`; the caller explicitly selects delivery mode `local` or `push`.
|
|
4
4
|
|
|
5
|
-
## Entry
|
|
5
|
+
## Entry contract
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- `
|
|
7
|
+
- Task-bound direct may read task facts. Taskless direct is allowed only for `TASK_CONTEXT_NOT_FOUND` and skips task facts, review, checkpoint, and task.md finalization.
|
|
8
|
+
- `code-task` creates a local checkpoint through the shared core with `delivery=local`; standalone `commit` uses `delivery=push`. Both share the same validation and commit order.
|
|
9
9
|
|
|
10
10
|
## Shared order
|
|
11
11
|
|
|
12
|
-
1.
|
|
12
|
+
1. Execute serially according to caller semantics.
|
|
13
13
|
2. Validate the repository, current branch, explicit paths, sensitive paths, staged scope, expected HEAD/tree, remote, and full heads ref.
|
|
14
14
|
3. Validate direct-mode authorization.
|
|
15
15
|
4. Create at most one local commit; with no changes, allow push-only and never create an empty commit.
|
|
@@ -18,4 +18,4 @@ Commit, push, result mapping, and task finalization use one `commit-operation.ex
|
|
|
18
18
|
|
|
19
19
|
## Retry boundary
|
|
20
20
|
|
|
21
|
-
Retries reread current HEAD, worktree, branch, and remote facts. A local commit that already exists is push-only and cannot produce a second commit. Taskless retries create no task record.
|
|
21
|
+
Retries reread current HEAD, worktree, branch, and remote facts. A local commit that already exists is push-only and cannot produce a second commit. Taskless retries create no task record.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Commit Core 边界
|
|
2
2
|
|
|
3
|
-
commit、push、结果映射和任务收尾使用同一个 `commit-operation.execute
|
|
3
|
+
commit、push、结果映射和任务收尾使用同一个 `commit-operation.execute`。入口解析 task scope、显式 agent 与调用参数;执行模式固定为 `direct`,交付模式由调用方明确指定为 `local` 或 `push`。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 入口契约
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- `
|
|
7
|
+
- task-bound direct 可读取任务事实;taskless direct 只在 `TASK_CONTEXT_NOT_FOUND` 时允许,并跳过 task facts、review、checkpoint 和 task.md 收尾。
|
|
8
|
+
- 本地 checkpoint 由 `code-task` 通过共享 core 以 `delivery=local` 执行;独立 `commit` 使用 `delivery=push`。两者共享同一校验与提交顺序。
|
|
9
9
|
|
|
10
10
|
## 共享执行顺序
|
|
11
11
|
|
|
12
|
-
1.
|
|
12
|
+
1. 按调用方语义串行执行。
|
|
13
13
|
2. 验证 repository、当前 branch、明确 paths、敏感路径、staged scope、expected HEAD/tree、remote 和 full heads ref。
|
|
14
14
|
3. 完成 direct 模式授权校验。
|
|
15
15
|
4. 最多创建一个本地 commit;无修改时只允许 push-only,不创建空 commit。
|
|
@@ -18,4 +18,4 @@ commit、push、结果映射和任务收尾使用同一个 `commit-operation.exe
|
|
|
18
18
|
|
|
19
19
|
## 重试边界
|
|
20
20
|
|
|
21
|
-
重跑重新读取当前 HEAD、worktree、branch 和 remote 事实。已有本地 commit 时只补 push,不创建第二个 commit;taskless
|
|
21
|
+
重跑重新读取当前 HEAD、worktree、branch 和 remote 事实。已有本地 commit 时只补 push,不创建第二个 commit;taskless 重跑不创建任何任务记录。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Run only when `{task-id}` is valid and task.md has a `bound/verified` `pr_delivery_fact`.
|
|
4
4
|
|
|
5
5
|
1. Run `agent-infra-internal platform-pr summary-context {task-id}` to obtain canonical inputs and report status; rebuild a stale/missing sidecar through the `change-report` flow for the current head.
|
|
6
|
-
2. Generate the
|
|
6
|
+
2. Generate the complete PR summary JSON payload per `.agents/rules/pr-sync.md` and write it to a temporary file.
|
|
7
7
|
3. Run `agent-infra-internal platform-pr summary-sync {task-id} --agent {standard-agent-token} --body-file {summary-body-file} --change-report-file <task-workspace>/active/{task-id}/pr-change-report.json --result no_op`. The commit path only synchronizes an existing PR summary and neither creates nor reuses a PR, so `no_op` explicitly represents the unchanged PR identity.
|
|
8
8
|
|
|
9
9
|
Failure records a warning but never blocks or rolls back the completed commit. `no-op` maps to `summary skipped (no diff)`.
|