@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
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { activityWarnings } from '../task/activity-log.js';
|
|
4
|
+
import { lifecycleExecutions } from '../task/lifecycle-execution.js';
|
|
4
5
|
import { resolveTaskRef } from '../task/resolve-ref.js';
|
|
6
|
+
import { prepareAndRenderPrSummaryContent } from '../platform/pr-summary.js';
|
|
5
7
|
import { applyTaskEvent } from '../task/events.js';
|
|
6
8
|
import { normalizeAgentToken } from '../agent-clients/tokens.js';
|
|
7
|
-
import {
|
|
9
|
+
import { createManualValidationReceipt, manualValidationFinalSummaryDigest, manualValidationFinalSummaryProjectionMatches, readManualValidationReceipt, writeManualValidationReceiptAtomic } from '../task/manual-validation-receipt.js';
|
|
8
10
|
import { archiveManualValidationGeneration, createManualValidationTransaction, readManualValidationTransaction, retryManualValidationTransaction, summaryPreimageDigest, transitionManualValidationTransaction, validateManualValidationGenerationArchive, writeManualValidationTransactionAtomic } from '../task/manual-validation-transaction.js';
|
|
9
11
|
import { sha256File } from '../task/artifact-receipts.js';
|
|
10
12
|
import { summaryCommentState, syncPullRequestSummary } from '../platform/pr-summary.js';
|
|
@@ -21,22 +23,14 @@ function printFailure(format, error) {
|
|
|
21
23
|
process.stderr.write(`${error.code}: ${error.message}\n`);
|
|
22
24
|
process.exitCode = 1;
|
|
23
25
|
}
|
|
24
|
-
const MANUAL_VALIDATION_STATUS_HEADING = /^###\s+(?:⚠️\s+(?:需人工校验|Manual Validation Required)|✅\s+(?:人工验证已通过|无需人工校验|Manual Validation Passed|No Manual Validation Required)|⏳\s+(?:人工验证待收尾|Manual Validation Pending))\s*$/mu;
|
|
25
26
|
function manualSummaryBody(body, phase) {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (MANUAL_VALIDATION_STATUS_HEADING.test(body)) {
|
|
34
|
-
return `${body.replace(MANUAL_VALIDATION_STATUS_HEADING, `${heading}${marker}`).replace(/\s+$/u, '')}\n`;
|
|
35
|
-
}
|
|
36
|
-
const fallback = phase === 'pending'
|
|
37
|
-
? chinese ? '人工验证正在等待最终完成。' : 'Manual validation is awaiting final promotion.'
|
|
38
|
-
: chinese ? '人工验证已通过。' : 'Manual validation passed.';
|
|
39
|
-
return `${body.replace(/\s+$/u, '')}\n\n${heading}${marker}\n\n${fallback}\n`;
|
|
27
|
+
const content = JSON.parse(body);
|
|
28
|
+
const manual = content.manualValidation;
|
|
29
|
+
manual.state = phase === 'pending' ? 'pending' : 'passed';
|
|
30
|
+
return JSON.stringify(content);
|
|
31
|
+
}
|
|
32
|
+
function renderedManualSummaryBody(body, phase, taskContent) {
|
|
33
|
+
return prepareAndRenderPrSummaryContent(JSON.parse(manualSummaryBody(body, phase)), taskContent).rendered;
|
|
40
34
|
}
|
|
41
35
|
function openManualValidationStarted(taskMdPath) {
|
|
42
36
|
let content;
|
|
@@ -46,17 +40,14 @@ function openManualValidationStarted(taskMdPath) {
|
|
|
46
40
|
catch {
|
|
47
41
|
return { present: false, transactionId: null };
|
|
48
42
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
return { present: false, transactionId: null };
|
|
52
|
-
const row = pairEntries(section.entries)
|
|
53
|
-
.filter((item) => item.step === 'Complete Manual Validation' && item.started && !item.done)
|
|
43
|
+
const row = lifecycleExecutions(content)
|
|
44
|
+
.filter((item) => item.family === 'manual-validation')
|
|
54
45
|
.at(-1);
|
|
55
46
|
if (!row)
|
|
56
47
|
return { present: false, transactionId: null };
|
|
57
48
|
return {
|
|
58
49
|
present: true,
|
|
59
|
-
transactionId:
|
|
50
|
+
transactionId: row.transactionId ?? null
|
|
60
51
|
};
|
|
61
52
|
}
|
|
62
53
|
async function executeManualValidationTransaction(taskRef, values, cwd, options = {}) {
|
|
@@ -90,6 +81,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
90
81
|
const preimage = { commentId: currentState.comment?.id ?? null, body: preimageBody, digest: summaryPreimageDigest(preimageBody) };
|
|
91
82
|
const summaryPath = path.resolve(cwd, values.summaryFile);
|
|
92
83
|
const finalBodyWithoutReceipt = fs.readFileSync(summaryPath, 'utf8');
|
|
84
|
+
const taskContent = fs.readFileSync(resolved.taskMdPath, 'utf8');
|
|
93
85
|
const evidenceDigest = sha256File(summaryPath);
|
|
94
86
|
const archiveGeneration = options.archiveGeneration ?? archiveManualValidationGeneration;
|
|
95
87
|
let transactionResult = readManualValidationTransaction(resolved.taskDir, { taskId: resolved.taskId, prNumber: pullRequest.number, prHeadSha: pullRequest.head.sha, evidenceDigest, artifact: values.artifact });
|
|
@@ -112,7 +104,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
112
104
|
if (!transactionResult.ok && transactionResult.error.code !== 'MANUAL_VALIDATION_TRANSACTION_MISSING')
|
|
113
105
|
return result('failed', transactionResult.error);
|
|
114
106
|
if (transactionResult.ok && transactionResult.value.phase === 'committed')
|
|
115
|
-
return result('applied', null, { transaction: transactionResult.value, receipt: transactionResult.value.committedReceipt, idempotent: true });
|
|
107
|
+
return result('applied', null, { transaction: transactionResult.value, receipt: transactionResult.value.committedReceipt, idempotent: true, warnings: activityWarnings(taskContent) });
|
|
116
108
|
const openStarted = transactionResult.ok ? { present: false, transactionId: null } : openManualValidationStarted(resolved.taskMdPath);
|
|
117
109
|
if (openStarted.present && !openStarted.transactionId) {
|
|
118
110
|
return result('failed', { code: 'MANUAL_VALIDATION_TRANSACTION_RECOVERY_REQUIRED', message: 'open manual-validation started event has no recoverable transactionId' });
|
|
@@ -132,7 +124,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
132
124
|
evidenceDigest,
|
|
133
125
|
summaryPreimage: preimage,
|
|
134
126
|
pendingSummaryDigest: summaryPreimageDigest(pendingBody),
|
|
135
|
-
finalSummaryDigest: manualValidationFinalSummaryDigest(
|
|
127
|
+
finalSummaryDigest: manualValidationFinalSummaryDigest(renderedManualSummaryBody(finalBodyWithoutReceipt, 'final', taskContent)),
|
|
136
128
|
artifact: values.artifact,
|
|
137
129
|
attempt: 1,
|
|
138
130
|
createdAt: new Date().toISOString(),
|
|
@@ -140,12 +132,17 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
140
132
|
});
|
|
141
133
|
let transaction;
|
|
142
134
|
const idempotent = transactionResult.ok;
|
|
135
|
+
const warnings = [];
|
|
136
|
+
const currentWarnings = () => warnings.length
|
|
137
|
+
? warnings.filter((warning, index) => warnings.findIndex((item) => item.code === warning.code && item.message === warning.message) === index)
|
|
138
|
+
: activityWarnings(taskContent);
|
|
143
139
|
let startedEventApplied = false;
|
|
144
140
|
if (!transactionResult.ok) {
|
|
145
141
|
transaction = createTransaction();
|
|
146
142
|
const started = applyTaskEvent({ taskRef, event: 'manual-validation.started', agent, initiator: 'model', requestId: transactionId, reasonCode: 'user-request', transactionId }, { repoRoot: cwd });
|
|
147
143
|
if (started.status === 'failed')
|
|
148
144
|
return result('failed', started.error ?? { code: 'MANUAL_VALIDATION_TRANSACTION_FAILED', message: 'manual-validation started event failed' });
|
|
145
|
+
warnings.push(...(started.warnings ?? []));
|
|
149
146
|
startedEventApplied = true;
|
|
150
147
|
if (previousTransaction) {
|
|
151
148
|
try {
|
|
@@ -171,9 +168,10 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
171
168
|
const started = applyTaskEvent({ taskRef, event: 'manual-validation.started', agent, initiator: 'model', requestId: transaction.transactionId, reasonCode: 'user-request', transactionId: transaction.transactionId }, { repoRoot: cwd });
|
|
172
169
|
if (started.status === 'failed')
|
|
173
170
|
return result('failed', started.error ?? { code: 'MANUAL_VALIDATION_TRANSACTION_FAILED', message: 'manual-validation started event failed' });
|
|
171
|
+
warnings.push(...(started.warnings ?? []));
|
|
174
172
|
}
|
|
175
173
|
if (prepareOnly)
|
|
176
|
-
return result('applied', null, { transaction, prepared: true, idempotent });
|
|
174
|
+
return result('applied', null, { transaction, prepared: true, idempotent, warnings: currentWarnings() });
|
|
177
175
|
const transactionFailure = (failure) => {
|
|
178
176
|
throw new Error(`${failure.code}: ${failure.message}`);
|
|
179
177
|
};
|
|
@@ -230,6 +228,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
230
228
|
const completed = applyTaskEvent({ taskRef, event: 'manual-validation.completed', agent, initiator: 'model', requestId: transaction.transactionId, reasonCode: 'user-request', artifact: values.artifact, summaryResult: 'human-confirmed validation and committed receipt', transactionId: transaction.transactionId, receiptDigest: receipt.receiptDigest, prHeadSha: receipt.prHeadSha }, { repoRoot: cwd });
|
|
231
229
|
if (completed.status === 'failed')
|
|
232
230
|
transactionFailure(completed.error ?? { code: 'MANUAL_VALIDATION_TRANSACTION_FAILED', message: 'manual-validation completion event failed' });
|
|
231
|
+
warnings.push(...(completed.warnings ?? []));
|
|
233
232
|
transitionAndPersist('receipt-committed', { eventAppended: true });
|
|
234
233
|
}
|
|
235
234
|
if (transaction.phase === 'receipt-committed') {
|
|
@@ -245,7 +244,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
245
244
|
if (!/^###\s+✅\s+(?:Manual Validation Passed|人工验证已通过)\s*$/mu.test(postWrite.comment?.body ?? '') || postWrite.pullRequest?.head.sha !== receipt.prHeadSha || !manualValidationFinalSummaryProjectionMatches(postWrite.comment?.body ?? '', receipt))
|
|
246
245
|
transactionFailure({ code: 'MANUAL_VALIDATION_TRANSACTION_RECOVERY_REQUIRED', message: 'final summary post-write verification failed' });
|
|
247
246
|
transitionAndPersist('committed', { postWriteVerified: true });
|
|
248
|
-
return result('applied', null, { transaction, receipt, idempotent: false });
|
|
247
|
+
return result('applied', null, { transaction, receipt, idempotent: false, warnings: currentWarnings() });
|
|
249
248
|
}
|
|
250
249
|
catch (error) {
|
|
251
250
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -315,6 +314,9 @@ async function manualValidation(args = []) {
|
|
|
315
314
|
const format = values.format === 'text' ? 'text' : 'json';
|
|
316
315
|
const output = await executeManualValidationTransaction(taskRef, values, path.resolve(values.cwd ?? process.cwd()));
|
|
317
316
|
process.stdout.write(format === 'json' ? `${JSON.stringify(output)}\n` : `${output.status === 'applied' ? 'Manual validation transaction committed.' : `${output.error?.code}: ${output.error?.message}`}\n`);
|
|
317
|
+
if (format === 'text' && Array.isArray(output.warnings))
|
|
318
|
+
for (const warning of output.warnings)
|
|
319
|
+
process.stderr.write(`${warning.code}: ${warning.message}\n`);
|
|
318
320
|
if (output.status === 'failed')
|
|
319
321
|
process.exitCode = 1;
|
|
320
322
|
}
|
|
@@ -10,6 +10,9 @@ import { recoverTaskFromComments } from '../platform/task-recovery.js';
|
|
|
10
10
|
import { backfillCompletionComments } from '../platform/completion-backfill.js';
|
|
11
11
|
import { ensureInternalHandlerRoute, internalHandlerRoute } from './cli-route-inventory.js';
|
|
12
12
|
import { resolveTaskRef } from '../task/resolve-ref.js';
|
|
13
|
+
import { enumerateArtifacts } from '../task/artifacts.js';
|
|
14
|
+
import { parseTaskFrontmatter } from '../task/frontmatter.js';
|
|
15
|
+
import { prepareAndRenderCancelSummaryContent, prepareAndRenderDeliverySummaryContent } from '../platform/issue-summary-content.js';
|
|
13
16
|
const USAGE = `Usage: agent-infra-internal platform-comment list --issue <token> [--cwd <path>]
|
|
14
17
|
agent-infra-internal platform-comment recover --issue <token> --task-id <TASK-id> --output <staging-task.md> [--cwd <path>]
|
|
15
18
|
agent-infra-internal platform-comment owner <task-ref> [--cwd <path>]
|
|
@@ -202,19 +205,34 @@ async function platformComment(args = []) {
|
|
|
202
205
|
fail(`unable to read body file: ${error instanceof Error ? error.message : String(error)}`);
|
|
203
206
|
return;
|
|
204
207
|
}
|
|
205
|
-
const canonical = canonicalizeSummaryBody(body);
|
|
206
|
-
if (!canonical.ok) {
|
|
207
|
-
fail(`unable to stage summary: ${canonical.error.code}: ${canonical.error.message}`);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
body = canonical.value;
|
|
211
208
|
const resolved = resolveTaskRef(taskRef, { repoRoot: cwd });
|
|
212
209
|
if (!resolved.ok || resolved.state !== 'active') {
|
|
213
210
|
fail('stage-summary requires an active task');
|
|
214
211
|
return;
|
|
215
212
|
}
|
|
216
213
|
const target = path.join(resolved.taskDir, '.delivery-summary.json');
|
|
217
|
-
|
|
214
|
+
let content;
|
|
215
|
+
try {
|
|
216
|
+
const supplied = JSON.parse(body);
|
|
217
|
+
const taskContent = fs.readFileSync(resolved.taskMdPath, 'utf8');
|
|
218
|
+
const title = /^#\s+(.+)$/mu.exec(taskContent)?.[1]?.trim();
|
|
219
|
+
const prepared = prepareAndRenderDeliverySummaryContent(supplied, {
|
|
220
|
+
taskId: resolved.taskId,
|
|
221
|
+
title: title || resolved.taskId,
|
|
222
|
+
artifacts: enumerateArtifacts(resolved.taskDir).filter((artifact) => artifact.name !== 'task.md').map((artifact) => artifact.name),
|
|
223
|
+
verificationFallback: { state: 'not-run', detail: 'Final verification has not run at summary staging.' }
|
|
224
|
+
});
|
|
225
|
+
content = prepared.content;
|
|
226
|
+
const canonical = canonicalizeSummaryBody(prepared.rendered);
|
|
227
|
+
if (!canonical.ok)
|
|
228
|
+
throw new Error(`${canonical.error.code}: ${canonical.error.message}`);
|
|
229
|
+
body = canonical.value;
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
fail(`unable to stage summary: ${error instanceof Error ? error.message : String(error)}`);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const value = { taskId: resolved.taskId, content, contentSha256: createHash('sha256').update(JSON.stringify(content)).digest('hex') };
|
|
218
236
|
const previous = fs.existsSync(target) ? fs.readFileSync(target, 'utf8') : null;
|
|
219
237
|
const next = `${JSON.stringify(value)}\n`;
|
|
220
238
|
if (previous === next) {
|
|
@@ -273,6 +291,37 @@ async function platformComment(args = []) {
|
|
|
273
291
|
fail(`unable to read body file: ${error instanceof Error ? error.message : String(error)}`);
|
|
274
292
|
return;
|
|
275
293
|
}
|
|
294
|
+
if (kind === 'summary' || kind === 'cancel') {
|
|
295
|
+
try {
|
|
296
|
+
const input = JSON.parse(body);
|
|
297
|
+
const resolved = resolveTaskRef(taskRef, { repoRoot: cwd });
|
|
298
|
+
if (!resolved.ok)
|
|
299
|
+
throw new Error(resolved.message);
|
|
300
|
+
const taskContent = fs.readFileSync(resolved.taskMdPath, 'utf8');
|
|
301
|
+
const taskFrontmatter = parseTaskFrontmatter(taskContent);
|
|
302
|
+
const title = /^#\s+(.+)$/mu.exec(taskContent)?.[1]?.trim();
|
|
303
|
+
const artifacts = enumerateArtifacts(resolved.taskDir).filter((artifact) => artifact.name !== 'task.md').map((artifact) => artifact.name);
|
|
304
|
+
const rendered = kind === 'summary'
|
|
305
|
+
? prepareAndRenderDeliverySummaryContent(input, {
|
|
306
|
+
taskId: resolved.taskId,
|
|
307
|
+
title: title || resolved.taskId,
|
|
308
|
+
artifacts,
|
|
309
|
+
...(resolved.state === 'active' ? { verificationFallback: { state: 'not-run', detail: 'Final verification has not run at summary staging.' } } : {})
|
|
310
|
+
}).rendered
|
|
311
|
+
: prepareAndRenderCancelSummaryContent(input, {
|
|
312
|
+
taskId: resolved.taskId,
|
|
313
|
+
title: title || resolved.taskId,
|
|
314
|
+
reason: typeof taskFrontmatter.cancel_reason === 'string' ? taskFrontmatter.cancel_reason : '',
|
|
315
|
+
cancelledAt: typeof taskFrontmatter.cancelled_at === 'string' ? taskFrontmatter.cancelled_at : '',
|
|
316
|
+
lastCompletedArtifact: artifacts.at(-1) ?? null
|
|
317
|
+
}).rendered;
|
|
318
|
+
body = rendered;
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
fail(`invalid ${kind} summary structure: ${error instanceof Error ? error.message : String(error)}`);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
276
325
|
finish(await syncPlatformComment(taskRef, {
|
|
277
326
|
kind: kind,
|
|
278
327
|
agent: normalizedAgent,
|
|
@@ -4,7 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import { requestSandboxTaskCreate, SandboxControlClientError } from '../sandbox/control/client.js';
|
|
5
5
|
import { SANDBOX_CONTROL_MAX_BYTES } from '../sandbox/control/protocol.js';
|
|
6
6
|
import { validateTaskCreateCandidate } from '../task/create.js';
|
|
7
|
-
import { createTask, parseTaskCreateResult,
|
|
7
|
+
import { createTask, parseTaskCreateResult, taskCreateExitCode, taskCreateFailure } from '../task/create-service.js';
|
|
8
8
|
import { ensureInternalHandlerRoute, internalHandlerRoute } from './cli-route-inventory.js';
|
|
9
9
|
function failed(code, message, retryable = false, control) {
|
|
10
10
|
return taskCreateFailure({ code, message, retryable }, control);
|
|
@@ -2,7 +2,7 @@ import { normalizeAgentToken, AGENT_USAGE_HINT } from '../agent-clients/tokens.j
|
|
|
2
2
|
import { applyTaskEvent, eventCatalog } from '../task/events.js';
|
|
3
3
|
import { resolveTaskRef } from '../task/resolve-ref.js';
|
|
4
4
|
import { ensureInternalHandlerRoute, internalHandlerRoute } from './cli-route-inventory.js';
|
|
5
|
-
const USAGE = `Usage: agent-infra-internal task-event <N | TASK-id> <event> --agent <agent> [event options] [--
|
|
5
|
+
const USAGE = `Usage: agent-infra-internal task-event <N | TASK-id> <event> --agent <agent> [event options] [--dry-run]
|
|
6
6
|
|
|
7
7
|
Apply one closed-set task lifecycle event and print a structured JSON result.
|
|
8
8
|
Events: ${eventCatalog.join(', ')}
|
|
@@ -31,13 +31,6 @@ export function parseTaskEventRequest(args) {
|
|
|
31
31
|
const seen = new Set();
|
|
32
32
|
for (let index = 2; index < args.length; index += 1) {
|
|
33
33
|
const flag = args[index];
|
|
34
|
-
if (flag === '--orchestrated') {
|
|
35
|
-
if (seen.has(flag))
|
|
36
|
-
throw new Error(`duplicate option '${flag}'`);
|
|
37
|
-
seen.add(flag);
|
|
38
|
-
request.orchestrated = true;
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
34
|
if (flag === '--dry-run') {
|
|
42
35
|
if (seen.has(flag))
|
|
43
36
|
throw new Error(`duplicate option '${flag}'`);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { createDirectHostExecutionContext, dispatchTaskControlOperation, parseTaskControlOperation } from '../task/control-authority.js';
|
|
3
2
|
import { applyTaskFinalization } from '../task/finalization.js';
|
|
4
3
|
import { detectRepoRoot, resolveTaskRef } from '../task/resolve-ref.js';
|
|
@@ -3,7 +3,7 @@ import { lifecycleIntentCatalog } from '../task/lifecycle.js';
|
|
|
3
3
|
import { detectRepoRoot, resolveTaskRef } from '../task/resolve-ref.js';
|
|
4
4
|
import { ensureInternalHandlerRoute, internalHandlerRoute } from './cli-route-inventory.js';
|
|
5
5
|
import { loadSandboxControlLocation } from '../sandbox/config.js';
|
|
6
|
-
const USAGE = `Usage: agent-infra-internal task-lifecycle <N | TASK-id> <intent> --agent <agent> [intent flags] [--dry-run]\n\nIntents: ${lifecycleIntentCatalog.filter((intent) => intent !== 'complete').join(', ')}\
|
|
6
|
+
const USAGE = `Usage: agent-infra-internal task-lifecycle <N | TASK-id> <intent> --agent <agent> [intent flags] [--dry-run]\n\nIntents: ${lifecycleIntentCatalog.filter((intent) => intent !== 'complete').join(', ')}\n`;
|
|
7
7
|
function usageFailure(message) {
|
|
8
8
|
process.stdout.write(`${JSON.stringify({ status: 'failed', changed: false, error: { code: 'LIFECYCLE_PAYLOAD_INVALID', message } })}\n`);
|
|
9
9
|
process.stderr.write(USAGE);
|
|
@@ -56,7 +56,7 @@ async function taskLifecycle(args = []) {
|
|
|
56
56
|
const controlLocation = loadSandboxControlLocation(repoRoot);
|
|
57
57
|
const result = await dispatchTaskControlOperation(createDirectHostExecutionContext({ repoRoot, ...(controlLocation ?? {}) }), operation);
|
|
58
58
|
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
59
|
-
if (result.status === 'failed'
|
|
59
|
+
if (result.status === 'failed')
|
|
60
60
|
process.exitCode = 1;
|
|
61
61
|
}
|
|
62
62
|
export { taskLifecycle };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import
|
|
3
|
-
import { accessSandboxTaskView, parseSandboxTaskView, taskViewFromStatus } from '../sandbox/control/task-view.js';
|
|
2
|
+
import { accessSandboxTaskView, taskViewFromStatus } from '../sandbox/control/task-view.js';
|
|
4
3
|
import { resolveTaskRef } from '../task/resolve-ref.js';
|
|
5
4
|
import { PUBLIC_CLI_COMMAND_ALIASES, PUBLIC_CLI_SELECTOR_ALIASES, internalRouteSelector } from './cli-route-inventory.js';
|
|
6
|
-
import { hasSandboxControlMarker,
|
|
5
|
+
import { hasSandboxControlMarker, sandboxTaskMarkerState } from '../sandbox/environment.js';
|
|
7
6
|
export { resolveSandboxControlTransport } from '../sandbox/environment.js';
|
|
8
7
|
const descriptor = (dispatcher, command, selector, scope, effect, taskRefSource = scope === 'non-task' ? 'none' : 'argv') => ({ dispatcher, command, selector, scope, effect, taskRefSource, guardBeforeImport: true });
|
|
9
8
|
function internalTaskRoutes() {
|
|
@@ -19,12 +18,6 @@ function internalTaskRoutes() {
|
|
|
19
18
|
descriptor('internal', 'sandbox-control', 'client', 'conditional', 'progress', 'delegated'),
|
|
20
19
|
descriptor('internal', 'agent-client', 'next-steps', 'non-task', 'diagnostic', 'none'),
|
|
21
20
|
descriptor('internal', 'agent-client', 'model-selection', 'non-task', 'diagnostic', 'none'),
|
|
22
|
-
descriptor('internal', 'agent-client', 'launch-carrier', 'non-task', 'diagnostic', 'none'),
|
|
23
|
-
descriptor('internal', 'codex-lifecycle', 'preflight', 'non-task', 'diagnostic', 'none'),
|
|
24
|
-
descriptor('internal', 'codex-lifecycle', 'hook-event', 'conditional', 'progress'),
|
|
25
|
-
descriptor('internal', 'codex-lifecycle', 'resolve-start', 'conditional', 'progress'),
|
|
26
|
-
descriptor('internal', 'codex-lifecycle', 'resolve-stop', 'conditional', 'progress'),
|
|
27
|
-
descriptor('internal', 'codex-lifecycle', 'consume', 'conditional', 'progress'),
|
|
28
21
|
descriptor('internal', 'git-workflow', 'inspect', 'conditional', 'diagnostic'),
|
|
29
22
|
descriptor('internal', 'git-workflow', 'preview-tree', 'conditional', 'diagnostic'),
|
|
30
23
|
descriptor('internal', 'git-workflow', 'snapshot', 'conditional', 'diagnostic'),
|
|
@@ -97,8 +90,6 @@ function internalTaskRoutes() {
|
|
|
97
90
|
descriptor('internal', 'task-artifact', 'init', 'task-bound', 'artifact-write'),
|
|
98
91
|
descriptor('internal', 'task-artifact', 'preflight', 'task-bound', 'artifact-write'),
|
|
99
92
|
descriptor('internal', 'task-artifact', 'finalize-local', 'task-bound', 'artifact-write'),
|
|
100
|
-
descriptor('internal', 'task-orchestration', 'status', 'task-bound', 'diagnostic'),
|
|
101
|
-
descriptor('internal', 'task-orchestration', 'progress', 'task-bound', 'progress'),
|
|
102
93
|
descriptor('internal', 'task-review', 'preflight', 'task-bound', 'artifact-write'),
|
|
103
94
|
descriptor('internal', 'task-review', 'finalize-summary', 'task-bound', 'progress'),
|
|
104
95
|
descriptor('internal', 'task-event', 'event', 'task-bound', 'progress'),
|
|
@@ -174,11 +165,11 @@ export const TASK_OPERATION_DESCRIPTORS = Object.freeze([
|
|
|
174
165
|
...PUBLIC_OPERATION_DESCRIPTORS
|
|
175
166
|
]);
|
|
176
167
|
export const INTERNAL_DISPATCHER_ROUTES = Object.freeze([
|
|
177
|
-
'task-create', 'task-qualification', 'sandbox-control', 'agent-client',
|
|
168
|
+
'task-create', 'task-qualification', 'sandbox-control', 'agent-client',
|
|
178
169
|
'git-workflow', 'task-delivery', 'release-workflow', 'platform-release-notes', 'platform-security', 'platform-metadata', 'platform-context',
|
|
179
170
|
'platform-comment', 'platform-issue', 'platform-pr', 'platform-pr-review', 'pr-review-grade',
|
|
180
171
|
'platform-checks', 'task-context', 'task-workspace', 'task-ledger', 'task-warning', 'task-activity', 'task-artifact',
|
|
181
|
-
'task-
|
|
172
|
+
'task-review', 'task-event', 'task-lifecycle',
|
|
182
173
|
'task-finalization', 'task-platform-recovery', 'task-short-id', 'task-snapshot', 'task-verify', 'task-validate', 'manual-validation'
|
|
183
174
|
]);
|
|
184
175
|
export const PUBLIC_DISPATCHER_ROUTES = Object.freeze([
|
|
@@ -228,8 +219,6 @@ export function resolveDelegatedTaskOperation(args) {
|
|
|
228
219
|
const [operation, ...rest] = args;
|
|
229
220
|
if (operation !== 'client' || !rest[0])
|
|
230
221
|
return null;
|
|
231
|
-
if (rest[0] === 'task-orchestration')
|
|
232
|
-
return null;
|
|
233
222
|
return resolveTaskOperation('internal', rest[0], rest.slice(1));
|
|
234
223
|
}
|
|
235
224
|
function explicitTaskRefForOperation(dispatcher, command, args, selected) {
|
|
@@ -253,8 +242,6 @@ function explicitTaskRefForOperation(dispatcher, command, args, selected) {
|
|
|
253
242
|
}
|
|
254
243
|
return command === 'merge' ? null : first(args) || null;
|
|
255
244
|
}
|
|
256
|
-
if (command === 'codex-lifecycle')
|
|
257
|
-
return optionValue(args, '--task-id') ?? null;
|
|
258
245
|
if (command === 'platform-comment' || command === 'platform-issue') {
|
|
259
246
|
return first(args) === 'list' ? null : args[1] ?? null;
|
|
260
247
|
}
|
|
@@ -391,7 +378,4 @@ export function guardTaskOperation(dispatcher, command, args = [], options = {})
|
|
|
391
378
|
}
|
|
392
379
|
return { descriptor: selected, taskView };
|
|
393
380
|
}
|
|
394
|
-
export function assertTaskViewStatus(value) {
|
|
395
|
-
return parseSandboxTaskView(value);
|
|
396
|
-
}
|
|
397
381
|
//# sourceMappingURL=task-operation-registry.js.map
|
|
@@ -2,7 +2,7 @@ import { parseReviewCommand } from '../task/review-command.js';
|
|
|
2
2
|
import { finalizeReviewSummary, preflightReviewSummary } from '../task/review-finalization.js';
|
|
3
3
|
import { resolveTaskRef } from '../task/resolve-ref.js';
|
|
4
4
|
import { ensureInternalHandlerRoute } from './cli-route-inventory.js';
|
|
5
|
-
const USAGE = 'Usage: agent-infra-internal task-review <task-ref> <preflight|finalize-summary> --stage <analysis|plan|code> --artifact <review-*.md> [--
|
|
5
|
+
const USAGE = 'Usage: agent-infra-internal task-review <task-ref> <preflight|finalize-summary> --stage <analysis|plan|code> --artifact <review-*.md> [--dry-run]\n';
|
|
6
6
|
function failUsage(message) {
|
|
7
7
|
process.stdout.write(`${JSON.stringify({
|
|
8
8
|
status: 'failed',
|
|
@@ -28,7 +28,7 @@ async function taskReview(args = []) {
|
|
|
28
28
|
failUsage(error instanceof Error ? error.message : String(error));
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
const { stage, artifact, dryRun
|
|
31
|
+
const { stage, artifact, dryRun } = request;
|
|
32
32
|
const operation = args[1];
|
|
33
33
|
const resolved = resolveTaskRef(args[0]);
|
|
34
34
|
if (!resolved.ok) {
|
|
@@ -36,8 +36,8 @@ async function taskReview(args = []) {
|
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
const result = operation === 'preflight'
|
|
39
|
-
? preflightReviewSummary({ taskRef: args[0], stage, artifact,
|
|
40
|
-
: finalizeReviewSummary({ taskRef: args[0], stage, artifact,
|
|
39
|
+
? preflightReviewSummary({ taskRef: args[0], stage, artifact, dryRun })
|
|
40
|
+
: finalizeReviewSummary({ taskRef: args[0], stage, artifact, dryRun });
|
|
41
41
|
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
42
42
|
if (result.status === 'failed')
|
|
43
43
|
process.exitCode = 1;
|
|
@@ -75,12 +75,6 @@ function escapeHtml(value) {
|
|
|
75
75
|
function escapeHtmlText(value) {
|
|
76
76
|
return escapeHtml(value);
|
|
77
77
|
}
|
|
78
|
-
function escapeHtmlAttribute(value) {
|
|
79
|
-
return escapeHtml(value);
|
|
80
|
-
}
|
|
81
|
-
function escapeMarkdownLiteral(value) {
|
|
82
|
-
return value.replace(/[\\`*_{}\[\]()#+.!|<>-]/g, '\\$&');
|
|
83
|
-
}
|
|
84
78
|
function markerSafe(value, markers) {
|
|
85
79
|
let result = value;
|
|
86
80
|
for (const marker of markers) {
|
|
@@ -231,5 +225,5 @@ function splitDocumentPlaceholder(value, placeholder) {
|
|
|
231
225
|
}
|
|
232
226
|
return ok({ prefix: source.slice(0, position), suffix: source.slice(position + placeholder.length) });
|
|
233
227
|
}
|
|
234
|
-
export { CONTROL_MARKER_PATTERN,
|
|
228
|
+
export { CONTROL_MARKER_PATTERN, escapeHtmlText, fenceRanges, renderSafeCodeFence, canonicalizeCommentBody, canonicalizeSummaryBody, sanitizeMarkdownDocument, splitDocumentPlaceholder };
|
|
235
229
|
//# sourceMappingURL=comment-safety.js.map
|
|
@@ -129,16 +129,6 @@ function flattenPages(value) {
|
|
|
129
129
|
return [];
|
|
130
130
|
return value.flatMap((page) => Array.isArray(page) ? page : [page]);
|
|
131
131
|
}
|
|
132
|
-
function extractRepositoryLabelNames(value) {
|
|
133
|
-
return flattenPages(value).flatMap((entry) => {
|
|
134
|
-
if (typeof entry === 'string')
|
|
135
|
-
return [entry];
|
|
136
|
-
if (entry && typeof entry === 'object' && typeof entry.name === 'string') {
|
|
137
|
-
return [entry.name];
|
|
138
|
-
}
|
|
139
|
-
return [];
|
|
140
|
-
}).filter(Boolean).sort();
|
|
141
|
-
}
|
|
142
132
|
function extractPullRequestFileNames(value) {
|
|
143
133
|
const entries = flattenPages(value);
|
|
144
134
|
if (!Array.isArray(value) || entries.some((entry) => !entry || typeof entry !== 'object'))
|
|
@@ -148,8 +138,5 @@ function extractPullRequestFileNames(value) {
|
|
|
148
138
|
return null;
|
|
149
139
|
return [...new Set(names)].sort();
|
|
150
140
|
}
|
|
151
|
-
|
|
152
|
-
return { kind, number, labels: [...labels].sort() };
|
|
153
|
-
}
|
|
154
|
-
export { extractPullRequestFileNames, extractRepositoryLabelNames, flattenPages, inLabels, inLabelMappingDigest, labelDelta, mergeInLabels, planInLabelUpdate, resourceSnapshot, syncLabelDelta, validateInLabelMapping, validateRepositoryLabelPayload };
|
|
141
|
+
export { extractPullRequestFileNames, flattenPages, inLabels, inLabelMappingDigest, labelDelta, mergeInLabels, planInLabelUpdate, syncLabelDelta, validateInLabelMapping, validateRepositoryLabelPayload };
|
|
155
142
|
//# sourceMappingURL=in-label-sync.js.map
|