@fitlab-ai/agent-infra 0.12.1 → 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 +18 -10
- 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 +1 -16
- 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 +1 -4
- package/dist/lib/platform/pr-checks.js +2 -8
- 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/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 +11 -519
- 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 +44 -8
- 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 +67 -24
- 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 +16 -9
- 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 +0 -21
- package/lib/platform/issues.ts +0 -2
- package/lib/platform/operation-coordinator.ts +4 -2
- package/lib/platform/pr-change-report.ts +0 -5
- package/lib/platform/pr-checks.ts +1 -10
- package/lib/platform/pr-review.ts +1 -1
- 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/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 +11 -696
- 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 +41 -9
- 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 +50 -26
- 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 +1 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +1 -1
- 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/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/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,6 +1,7 @@
|
|
|
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';
|
|
5
6
|
import { prepareAndRenderPrSummaryContent } from '../platform/pr-summary.js';
|
|
6
7
|
import { applyTaskEvent } from '../task/events.js';
|
|
@@ -39,17 +40,14 @@ function openManualValidationStarted(taskMdPath) {
|
|
|
39
40
|
catch {
|
|
40
41
|
return { present: false, transactionId: null };
|
|
41
42
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
return { present: false, transactionId: null };
|
|
45
|
-
const row = pairEntries(section.entries)
|
|
46
|
-
.filter((item) => item.step === 'Complete Manual Validation' && item.started && !item.done)
|
|
43
|
+
const row = lifecycleExecutions(content)
|
|
44
|
+
.filter((item) => item.family === 'manual-validation')
|
|
47
45
|
.at(-1);
|
|
48
46
|
if (!row)
|
|
49
47
|
return { present: false, transactionId: null };
|
|
50
48
|
return {
|
|
51
49
|
present: true,
|
|
52
|
-
transactionId:
|
|
50
|
+
transactionId: row.transactionId ?? null
|
|
53
51
|
};
|
|
54
52
|
}
|
|
55
53
|
async function executeManualValidationTransaction(taskRef, values, cwd, options = {}) {
|
|
@@ -106,7 +104,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
106
104
|
if (!transactionResult.ok && transactionResult.error.code !== 'MANUAL_VALIDATION_TRANSACTION_MISSING')
|
|
107
105
|
return result('failed', transactionResult.error);
|
|
108
106
|
if (transactionResult.ok && transactionResult.value.phase === 'committed')
|
|
109
|
-
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) });
|
|
110
108
|
const openStarted = transactionResult.ok ? { present: false, transactionId: null } : openManualValidationStarted(resolved.taskMdPath);
|
|
111
109
|
if (openStarted.present && !openStarted.transactionId) {
|
|
112
110
|
return result('failed', { code: 'MANUAL_VALIDATION_TRANSACTION_RECOVERY_REQUIRED', message: 'open manual-validation started event has no recoverable transactionId' });
|
|
@@ -134,12 +132,17 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
134
132
|
});
|
|
135
133
|
let transaction;
|
|
136
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);
|
|
137
139
|
let startedEventApplied = false;
|
|
138
140
|
if (!transactionResult.ok) {
|
|
139
141
|
transaction = createTransaction();
|
|
140
142
|
const started = applyTaskEvent({ taskRef, event: 'manual-validation.started', agent, initiator: 'model', requestId: transactionId, reasonCode: 'user-request', transactionId }, { repoRoot: cwd });
|
|
141
143
|
if (started.status === 'failed')
|
|
142
144
|
return result('failed', started.error ?? { code: 'MANUAL_VALIDATION_TRANSACTION_FAILED', message: 'manual-validation started event failed' });
|
|
145
|
+
warnings.push(...(started.warnings ?? []));
|
|
143
146
|
startedEventApplied = true;
|
|
144
147
|
if (previousTransaction) {
|
|
145
148
|
try {
|
|
@@ -165,9 +168,10 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
165
168
|
const started = applyTaskEvent({ taskRef, event: 'manual-validation.started', agent, initiator: 'model', requestId: transaction.transactionId, reasonCode: 'user-request', transactionId: transaction.transactionId }, { repoRoot: cwd });
|
|
166
169
|
if (started.status === 'failed')
|
|
167
170
|
return result('failed', started.error ?? { code: 'MANUAL_VALIDATION_TRANSACTION_FAILED', message: 'manual-validation started event failed' });
|
|
171
|
+
warnings.push(...(started.warnings ?? []));
|
|
168
172
|
}
|
|
169
173
|
if (prepareOnly)
|
|
170
|
-
return result('applied', null, { transaction, prepared: true, idempotent });
|
|
174
|
+
return result('applied', null, { transaction, prepared: true, idempotent, warnings: currentWarnings() });
|
|
171
175
|
const transactionFailure = (failure) => {
|
|
172
176
|
throw new Error(`${failure.code}: ${failure.message}`);
|
|
173
177
|
};
|
|
@@ -224,6 +228,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
224
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 });
|
|
225
229
|
if (completed.status === 'failed')
|
|
226
230
|
transactionFailure(completed.error ?? { code: 'MANUAL_VALIDATION_TRANSACTION_FAILED', message: 'manual-validation completion event failed' });
|
|
231
|
+
warnings.push(...(completed.warnings ?? []));
|
|
227
232
|
transitionAndPersist('receipt-committed', { eventAppended: true });
|
|
228
233
|
}
|
|
229
234
|
if (transaction.phase === 'receipt-committed') {
|
|
@@ -239,7 +244,7 @@ async function executeManualValidationTransactionAtResolvedTask(taskRef, values,
|
|
|
239
244
|
if (!/^###\s+✅\s+(?:Manual Validation Passed|人工验证已通过)\s*$/mu.test(postWrite.comment?.body ?? '') || postWrite.pullRequest?.head.sha !== receipt.prHeadSha || !manualValidationFinalSummaryProjectionMatches(postWrite.comment?.body ?? '', receipt))
|
|
240
245
|
transactionFailure({ code: 'MANUAL_VALIDATION_TRANSACTION_RECOVERY_REQUIRED', message: 'final summary post-write verification failed' });
|
|
241
246
|
transitionAndPersist('committed', { postWriteVerified: true });
|
|
242
|
-
return result('applied', null, { transaction, receipt, idempotent: false });
|
|
247
|
+
return result('applied', null, { transaction, receipt, idempotent: false, warnings: currentWarnings() });
|
|
243
248
|
}
|
|
244
249
|
catch (error) {
|
|
245
250
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -309,6 +314,9 @@ async function manualValidation(args = []) {
|
|
|
309
314
|
const format = values.format === 'text' ? 'text' : 'json';
|
|
310
315
|
const output = await executeManualValidationTransaction(taskRef, values, path.resolve(values.cwd ?? process.cwd()));
|
|
311
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`);
|
|
312
320
|
if (output.status === 'failed')
|
|
313
321
|
process.exitCode = 1;
|
|
314
322
|
}
|
|
@@ -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
|
|
@@ -101,9 +101,6 @@ function renderTaskCommentResult(content, taskId, language = '') {
|
|
|
101
101
|
function renderTaskComment(content, taskId, _agent, language = '') {
|
|
102
102
|
return renderTaskCommentResult(content, taskId, language).body;
|
|
103
103
|
}
|
|
104
|
-
function isTaskCommentTooLarge(content, taskId = 'TASK-UNKNOWN', _agent = 'codex') {
|
|
105
|
-
return renderTaskCommentResult(content, taskId).byteLength > COMMENT_BYTE_LIMIT;
|
|
106
|
-
}
|
|
107
104
|
function taskCommentLanguage(repoRoot) {
|
|
108
105
|
try {
|
|
109
106
|
const config = JSON.parse(fs.readFileSync(path.join(repoRoot, '.agents', '.airc.json'), 'utf8'));
|
|
@@ -301,18 +298,6 @@ function chunkArtifactComment(input) {
|
|
|
301
298
|
function findMarkerComments(comments, marker) {
|
|
302
299
|
return comments.filter((comment) => normalizeCommentContent(String(comment.body || '')).split('\n', 1)[0] === marker);
|
|
303
300
|
}
|
|
304
|
-
function flattenComments(value) {
|
|
305
|
-
if (!Array.isArray(value))
|
|
306
|
-
return [];
|
|
307
|
-
const flattened = value.flatMap((entry) => Array.isArray(entry) ? entry : [entry]);
|
|
308
|
-
return flattened.filter((entry) => Boolean(entry && typeof entry === 'object' && (typeof entry.id === 'number' || typeof entry.id === 'string') && typeof entry.body === 'string'));
|
|
309
|
-
}
|
|
310
|
-
function listRemoteComments(client, repo, issue, cwd) {
|
|
311
|
-
const result = client.json([
|
|
312
|
-
'api', '--paginate', '--slurp', `repos/${repo}/issues/${issue}/comments?per_page=100`
|
|
313
|
-
], { cwd });
|
|
314
|
-
return result.ok ? { ok: true, value: flattenComments(result.value) } : result;
|
|
315
|
-
}
|
|
316
301
|
function contextFields(context) {
|
|
317
302
|
return {
|
|
318
303
|
platform: context.platform,
|
|
@@ -872,5 +857,5 @@ async function checkPlatformCommentOwner(taskRef, options = {}) {
|
|
|
872
857
|
}
|
|
873
858
|
return platformResult('no-op', { ...contextFields(context), resource: { kind: 'issue', number: resourceIdentityNumber(issueIdentity), identity: issueIdentity }, error: null });
|
|
874
859
|
}
|
|
875
|
-
export { COMMENT_BYTE_LIMIT, MARKERS, chunkArtifactComment, inspectPlatformCommentOperation, findMarkerComments,
|
|
860
|
+
export { COMMENT_BYTE_LIMIT, MARKERS, chunkArtifactComment, inspectPlatformCommentOperation, findMarkerComments, checkPlatformCommentOwner, listPlatformComments, normalizeCommentContent, renderTaskComment, renderTaskCommentResult, syncCommentPlan, syncPlatformComment, validateRelatedMarkerSet };
|
|
876
861
|
//# sourceMappingURL=issue-comments.js.map
|
|
@@ -11,7 +11,7 @@ import { writeTask } from '../task/write.js';
|
|
|
11
11
|
import { resolvePlatformProviderContext } from './context.js';
|
|
12
12
|
import { DEFAULT_REQUIREMENT_SECTION_ANCHORS, chooseMilestone, desiredIssueType, normalizeOption, planIssueMetadata } from './issue-metadata.js';
|
|
13
13
|
import { platformResult } from './types.js';
|
|
14
|
-
import { labelDelta, inLabelMappingDigest, planInLabelUpdate,
|
|
14
|
+
import { labelDelta, inLabelMappingDigest, planInLabelUpdate, validateInLabelMapping, } from './in-label-sync.js';
|
|
15
15
|
import { providerError, providerOperationContext, providerStatus, providerResourceIdentity, providerResourceToken, unsupportedProviderOperation } from './provider-bridge.js';
|
|
16
16
|
import { resourceIdentityEquals, resourceIdentityNumber, resourceIdentityString, serializeResourceIdentity } from './resource-identity.js';
|
|
17
17
|
import { taskIssueIdentity, taskIssueIdentityError } from './task-identities.js';
|
|
@@ -14,7 +14,8 @@ async function coordinatePlatformWrite(input) {
|
|
|
14
14
|
retryable: true
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const boundedPr = input.operation.kind === 'pull-request' && input.operation.dependency === 'required';
|
|
18
|
+
const selection = boundedPr || input.operation.kind === 'issue-metadata' && input.operation.issueMetadata?.state === 'closed'
|
|
18
19
|
? 'all' : input.operation.dependency;
|
|
19
20
|
const drained = input.drain
|
|
20
21
|
? await input.drain(input.operation.taskRef, operationId, input.agent, input.operation.cwd)
|
|
@@ -22,7 +23,8 @@ async function coordinatePlatformWrite(input) {
|
|
|
22
23
|
agent: input.agent,
|
|
23
24
|
client: input.client,
|
|
24
25
|
cwd: input.operation.cwd,
|
|
25
|
-
excludeId: operationId
|
|
26
|
+
excludeId: operationId,
|
|
27
|
+
...(boundedPr ? { beforeId: operationId } : {})
|
|
26
28
|
});
|
|
27
29
|
if (drained.status !== 'applied' && drained.status !== 'no-op') {
|
|
28
30
|
return input.block(drained.error ? { ...drained.error, retryable: true } : {
|
|
@@ -435,9 +435,6 @@ function buildPrChangeReport(identity, taskIntentSha256, mechanical, candidate)
|
|
|
435
435
|
precheck
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
|
-
function reportFilePath(taskDir) {
|
|
439
|
-
return path.join(taskDir, REPORT_FILE_NAME);
|
|
440
|
-
}
|
|
441
438
|
function readPrChangeReport(file) {
|
|
442
439
|
try {
|
|
443
440
|
const stat = fs.lstatSync(file);
|
|
@@ -698,5 +695,5 @@ function replaceCanonicalReportPlaceholder(body, report) {
|
|
|
698
695
|
return invalid('summary contains a reserved control marker', 'PR_SUMMARY_RENDER_INVALID');
|
|
699
696
|
return { ok: true, value };
|
|
700
697
|
}
|
|
701
|
-
export { CANONICAL_REPORT_HEADING, CANONICAL_REPORT_PLACEHOLDER, PRECHECK_IDS, REPORT_FILE_NAME, REPORT_VERSION, buildPrChangeReport, readPrChangeReport, renderCanonicalChangeReport, replaceCanonicalReportPlaceholder,
|
|
698
|
+
export { CANONICAL_REPORT_HEADING, CANONICAL_REPORT_PLACEHOLDER, PRECHECK_IDS, REPORT_FILE_NAME, REPORT_VERSION, buildPrChangeReport, readPrChangeReport, renderCanonicalChangeReport, replaceCanonicalReportPlaceholder, runMechanicalChangeReport, taskIntentDigest, taskIntentProjection, validateMechanicalReport, validatePrecheckCandidate, validatePrChangeReport, writePrChangeReportAtomic };
|
|
702
699
|
//# sourceMappingURL=pr-change-report.js.map
|
|
@@ -6,7 +6,7 @@ import { resolvePlatformProviderContext } from './context.js';
|
|
|
6
6
|
import { inspectPlatformPullRequest } from './pull-requests.js';
|
|
7
7
|
import { platformResult } from './types.js';
|
|
8
8
|
import { readPrDeliveryFact } from '../task/pr-delivery-fact.js';
|
|
9
|
-
import { providerError, providerOperationContext, providerStatus,
|
|
9
|
+
import { providerError, providerOperationContext, providerStatus, resourceIdentityNumber, unsupportedProviderOperation } from './provider-bridge.js';
|
|
10
10
|
function classifyRequiredChecks(required) {
|
|
11
11
|
if (required.length === 0)
|
|
12
12
|
return { state: 'no-required', required };
|
|
@@ -27,12 +27,6 @@ function classifyPullRequestReadiness(input) {
|
|
|
27
27
|
return { state: 'pending', headSha: input.headSha };
|
|
28
28
|
return { state: 'ready', headSha: input.headSha };
|
|
29
29
|
}
|
|
30
|
-
function resolveRunCandidate(candidates, headSha, checkName) {
|
|
31
|
-
const matches = candidates.filter((candidate) => candidate.headSha === headSha && candidate.name === checkName);
|
|
32
|
-
if (matches.length === 1)
|
|
33
|
-
return { status: 'resolved', runId: matches[0].id, jobId: matches[0].jobId || null };
|
|
34
|
-
return { status: matches.length === 0 ? 'missing' : 'ambiguous', runId: null, jobId: null };
|
|
35
|
-
}
|
|
36
30
|
function checksResult(status, overrides = {}) {
|
|
37
31
|
return {
|
|
38
32
|
...platformResult(status),
|
|
@@ -228,5 +222,5 @@ async function fetchPlatformCheckLogs(taskRef, options) {
|
|
|
228
222
|
});
|
|
229
223
|
}
|
|
230
224
|
}
|
|
231
|
-
export { classifyPullRequestReadiness, classifyRequiredChecks, fetchPlatformCheckLogs, inspectRequiredChecks, inspectPullRequestReadiness, resolvePlatformCheckRun,
|
|
225
|
+
export { classifyPullRequestReadiness, classifyRequiredChecks, fetchPlatformCheckLogs, inspectRequiredChecks, inspectPullRequestReadiness, resolvePlatformCheckRun, watchPullRequestReadiness };
|
|
232
226
|
//# sourceMappingURL=pr-checks.js.map
|
|
@@ -290,15 +290,6 @@ function validateSecurityAlert(value) {
|
|
|
290
290
|
data: jsonValue(item.data, 'security alert.data')
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
function validateLabelDefinition(value, label) {
|
|
294
|
-
const item = record(value, label);
|
|
295
|
-
exactKeys(item, ['name', 'color', 'description'], label);
|
|
296
|
-
return {
|
|
297
|
-
name: stringValue(item.name, `${label}.name`),
|
|
298
|
-
color: stringValue(item.color, `${label}.color`),
|
|
299
|
-
description: stringValue(item.description, `${label}.description`, true)
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
293
|
function validateLabelReconciliation(value) {
|
|
303
294
|
const item = record(value, 'label reconciliation');
|
|
304
295
|
exactKeys(item, ['changed', 'created', 'updated', 'removed', 'skipped'], 'label reconciliation');
|
|
@@ -311,17 +302,6 @@ function validateLabelReconciliation(value) {
|
|
|
311
302
|
skipped: names('skipped')
|
|
312
303
|
};
|
|
313
304
|
}
|
|
314
|
-
function validateMilestoneDefinition(value, label) {
|
|
315
|
-
const item = record(value, label);
|
|
316
|
-
exactKeys(item, ['title', 'description', 'state'], label);
|
|
317
|
-
if (item.state !== 'open' && item.state !== 'closed')
|
|
318
|
-
throw new Error(`${label}.state is invalid`);
|
|
319
|
-
return {
|
|
320
|
-
title: stringValue(item.title, `${label}.title`),
|
|
321
|
-
description: stringValue(item.description, `${label}.description`, true),
|
|
322
|
-
state: item.state
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
305
|
function validateMilestoneInitialization(value) {
|
|
326
306
|
const item = record(value, 'milestone initialization');
|
|
327
307
|
exactKeys(item, ['changed', 'created', 'skipped'], 'milestone initialization');
|