nx 23.2.1 → 23.3.0-beta.1
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/dist/src/command-line/format/format.js +2 -18
- package/dist/src/command-line/graph/graph.js +42 -3
- package/dist/src/command-line/init/implementation/format.js +2 -3
- package/dist/src/command-line/migrate/agentic/definitions.js +75 -19
- package/dist/src/command-line/migrate/agentic/format-command.d.ts +14 -0
- package/dist/src/command-line/migrate/agentic/format-command.js +44 -0
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +3 -3
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +3 -3
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +27 -17
- package/dist/src/command-line/migrate/agentic/handoff.js +107 -24
- package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +21 -0
- package/dist/src/command-line/migrate/agentic/instruction-files.js +36 -0
- package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +16 -0
- package/dist/src/command-line/migrate/agentic/prompts/fragments.js +70 -0
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +4 -3
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +25 -1
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +57 -34
- package/dist/src/command-line/migrate/agentic/run-step.js +28 -4
- package/dist/src/command-line/migrate/agentic/runner.d.ts +17 -8
- package/dist/src/command-line/migrate/agentic/runner.js +110 -55
- package/dist/src/command-line/migrate/agentic/types.d.ts +23 -8
- package/dist/src/command-line/migrate/agentic/types.js +10 -7
- package/dist/src/command-line/migrate/migrate-commits.d.ts +1 -0
- package/dist/src/command-line/migrate/migrate-commits.js +9 -0
- package/dist/src/command-line/migrate/migrate-output.d.ts +3 -7
- package/dist/src/command-line/migrate/migrate-output.js +3 -7
- package/dist/src/command-line/migrate/migrate.js +21 -8
- package/dist/src/command-line/migrate/run/agent-output.d.ts +10 -0
- package/dist/src/command-line/migrate/run/agent-output.js +16 -2
- package/dist/src/command-line/migrate/run/agent-work-payload.d.ts +37 -0
- package/dist/src/command-line/migrate/run/agent-work-payload.js +142 -0
- package/dist/src/command-line/migrate/run/atomic-write.d.ts +8 -0
- package/dist/src/command-line/migrate/run/atomic-write.js +17 -0
- package/dist/src/command-line/migrate/run/index.d.ts +1 -1
- package/dist/src/command-line/migrate/run/issues.d.ts +106 -0
- package/dist/src/command-line/migrate/run/issues.js +980 -0
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +1 -0
- package/dist/src/command-line/migrate/run/orchestrator.js +662 -105
- package/dist/src/command-line/migrate/run/run-state.d.ts +43 -8
- package/dist/src/command-line/migrate/run/run-state.js +184 -20
- package/dist/src/command-line/migrate/run/runbook.d.ts +17 -0
- package/dist/src/command-line/migrate/run/runbook.js +97 -0
- package/dist/src/command-line/migrate/run/state-lock.d.ts +2 -2
- package/dist/src/command-line/migrate/run/state-lock.js +2 -2
- package/dist/src/command-line/migrate/run/state-machine.d.ts +5 -1
- package/dist/src/command-line/migrate/run/state-machine.js +27 -1
- package/dist/src/command-line/migrate/run/worker.js +206 -56
- package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +5 -1
- package/dist/src/command-line/release/publish.js +11 -4
- package/dist/src/command-line/release/utils/remote-release-clients/github.js +3 -3
- package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +3 -3
- package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +2 -0
- package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +35 -0
- package/dist/src/command-line/yargs-utils/shared-options.d.ts +1 -1
- package/dist/src/command-line/yargs-utils/shared-options.js +22 -4
- package/dist/src/config/workspace-json-project-json.d.ts +2 -0
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/daemon/client/client.d.ts +4 -2
- package/dist/src/daemon/client/client.js +20 -11
- package/dist/src/daemon/message-types/run-tasks-execution-hooks.d.ts +3 -2
- package/dist/src/daemon/server/handle-hash-tasks.d.ts +8 -2
- package/dist/src/daemon/server/handle-hash-tasks.js +16 -3
- package/dist/src/daemon/server/handle-outputs-changes.d.ts +2 -2
- package/dist/src/daemon/server/handle-outputs-changes.js +21 -6
- package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +3 -2
- package/dist/src/daemon/server/outputs-tracking.d.ts +6 -0
- package/dist/src/daemon/server/outputs-tracking.js +18 -0
- package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +22 -7
- package/dist/src/daemon/server/project-graph-incremental-recomputation.js +99 -69
- package/dist/src/daemon/server/restart-checks.d.ts +22 -0
- package/dist/src/daemon/server/restart-checks.js +77 -0
- package/dist/src/daemon/server/server.js +28 -18
- package/dist/src/daemon/server/shutdown-utils.d.ts +0 -5
- package/dist/src/daemon/server/shutdown-utils.js +3 -26
- package/dist/src/hasher/hash-task.js +20 -16
- package/dist/src/hasher/native-task-hasher-impl.d.ts +8 -0
- package/dist/src/hasher/native-task-hasher-impl.js +46 -3
- package/dist/src/hasher/task-hasher.d.ts +9 -0
- package/dist/src/hasher/task-hasher.js +14 -0
- package/dist/src/native/index.d.ts +202 -21
- package/dist/src/native/index.js +3 -3
- package/dist/src/native/native-bindings.js +3 -1
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -1
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +2 -0
- package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +22 -0
- package/dist/src/plugins/js/utils/register.js +2 -1
- package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +2 -1
- package/dist/src/project-graph/plugins/isolation/messaging.d.ts +3 -2
- package/dist/src/project-graph/plugins/isolation/plugin-worker.js +5 -1
- package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +3 -2
- package/dist/src/project-graph/plugins/loaded-nx-plugin.js +5 -1
- package/dist/src/project-graph/plugins/task-results-stub.d.ts +50 -0
- package/dist/src/project-graph/plugins/task-results-stub.js +111 -0
- package/dist/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -2
- package/dist/src/project-graph/plugins/tasks-execution-hooks.js +2 -1
- package/dist/src/project-graph/project-graph.js +2 -0
- package/dist/src/tasks-runner/batch/run-batch.js +15 -0
- package/dist/src/tasks-runner/cache.d.ts +35 -0
- package/dist/src/tasks-runner/cache.js +40 -0
- package/dist/src/tasks-runner/create-task-graph.js +1 -0
- package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
- package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
- package/dist/src/tasks-runner/forked-process-task-runner.js +8 -7
- package/dist/src/tasks-runner/init-tasks-runner.js +5 -1
- package/dist/src/tasks-runner/is-tui-enabled.js +4 -3
- package/dist/src/tasks-runner/life-cycle.d.ts +7 -0
- package/dist/src/tasks-runner/life-cycle.js +7 -0
- package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.d.ts +35 -0
- package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +146 -0
- package/dist/src/tasks-runner/prune-task-graph.d.ts +17 -0
- package/dist/src/tasks-runner/prune-task-graph.js +45 -0
- package/dist/src/tasks-runner/run-command.js +14 -3
- package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +93 -19
- package/dist/src/tasks-runner/running-tasks/batch-process.js +184 -88
- package/dist/src/tasks-runner/task-orchestrator.d.ts +64 -2
- package/dist/src/tasks-runner/task-orchestrator.js +232 -46
- package/dist/src/tasks-runner/terminal-output-path.d.ts +11 -0
- package/dist/src/tasks-runner/terminal-output-path.js +18 -0
- package/dist/src/tasks-runner/utils.js +5 -2
- package/dist/src/utils/ab-testing.d.ts +3 -0
- package/dist/src/utils/ab-testing.js +11 -3
- package/dist/src/utils/chunkify.d.ts +1 -7
- package/dist/src/utils/chunkify.js +2 -8
- package/dist/src/utils/command-line-utils.d.ts +19 -0
- package/dist/src/utils/command-line-utils.js +10 -3
- package/dist/src/utils/formatters/index.d.ts +6 -0
- package/dist/src/utils/formatters/index.js +5 -0
- package/dist/src/utils/formatters/prettier.d.ts +0 -8
- package/dist/src/utils/formatters/prettier.js +4 -26
- package/dist/src/utils/installed-nx-version.js +2 -48
- package/dist/src/utils/min-release-age/packument.js +1 -1
- package/dist/src/utils/output.d.ts +22 -3
- package/dist/src/utils/output.js +28 -5
- package/dist/src/utils/package-json.d.ts +25 -0
- package/dist/src/utils/package-json.js +41 -6
- package/dist/src/utils/package-manager.d.ts +6 -0
- package/dist/src/utils/package-manager.js +10 -0
- package/dist/src/utils/provenance.js +20 -4
- package/dist/src/utils/workspace-context.d.ts +47 -3
- package/dist/src/utils/workspace-context.js +162 -10
- package/package.json +12 -12
- package/schemas/nx-schema.json +4 -0
- package/schemas/project-schema.json +4 -0
- package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +0 -9
- package/dist/src/daemon/server/file-watching/route-workspace-changes.js +0 -76
- package/dist/src/daemon/server/watcher.d.ts +0 -18
- package/dist/src/daemon/server/watcher.js +0 -126
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Internal to run/: deliberately not re-exported from ./index.
|
|
3
|
+
//
|
|
4
|
+
// Persists each parked payload by step and attempt, so a reconcile can re-emit
|
|
5
|
+
// it after a compaction or restart without reusing payloads from discarded
|
|
6
|
+
// attempts.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.agentWorkPayloadPath = agentWorkPayloadPath;
|
|
9
|
+
exports.persistAgentWorkPayload = persistAgentWorkPayload;
|
|
10
|
+
exports.readAgentWorkPayload = readAgentWorkPayload;
|
|
11
|
+
exports.latestStoredAgentWorkPayload = latestStoredAgentWorkPayload;
|
|
12
|
+
exports.removeAgentWorkPayloads = removeAgentWorkPayloads;
|
|
13
|
+
const fs_1 = require("fs");
|
|
14
|
+
const path_1 = require("path");
|
|
15
|
+
const atomic_write_1 = require("./atomic-write");
|
|
16
|
+
const AGENT_WORK_DIR_NAME = 'agent-work';
|
|
17
|
+
// Both segments are Nx-issued (`step-<n>` and the attempt counter), so the
|
|
18
|
+
// name never carries untrusted path segments.
|
|
19
|
+
function agentWorkPayloadPath(runDirPath, stepId, attempt) {
|
|
20
|
+
return (0, path_1.join)(runDirPath, AGENT_WORK_DIR_NAME, `${stepId}-attempt-${attempt}.json`);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Failures propagate: the runbook promises a parked step's block is
|
|
24
|
+
* re-emitted, so a caller that cannot store the payload must fail the attempt
|
|
25
|
+
* rather than park.
|
|
26
|
+
*/
|
|
27
|
+
function persistAgentWorkPayload(filePath, payload) {
|
|
28
|
+
(0, fs_1.mkdirSync)((0, path_1.dirname)(filePath), { recursive: true });
|
|
29
|
+
(0, atomic_write_1.publishFileAtomically)(filePath, (tmpPath) => (0, fs_1.writeFileSync)(tmpPath, JSON.stringify(payload, null, 2)));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The stored payload, or null when nothing usable is on disk: the file is
|
|
33
|
+
* missing (the park predates this mechanism), does not parse to a plain
|
|
34
|
+
* object, or does not match what the step awaits. Null is undifferentiated on
|
|
35
|
+
* purpose: every caller's remediation is the same freshly derived payload.
|
|
36
|
+
* The returned object is never re-emitted as text; both re-emission sites go
|
|
37
|
+
* back through the block writer's escaping, so a tampered file cannot break
|
|
38
|
+
* the framing.
|
|
39
|
+
*/
|
|
40
|
+
function readAgentWorkPayload(filePath, expected) {
|
|
41
|
+
let content;
|
|
42
|
+
try {
|
|
43
|
+
content = (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
let parsed;
|
|
49
|
+
try {
|
|
50
|
+
parsed = JSON.parse(content);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed;
|
|
59
|
+
if (payload.migrationId !== expected.migrationId) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const matchesKind = expected.kind === 'generator-validation'
|
|
63
|
+
? payload.kind === 'generator-validation'
|
|
64
|
+
: payload.kind === undefined &&
|
|
65
|
+
expected.promptPath !== undefined &&
|
|
66
|
+
payload.prompt === expected.promptPath;
|
|
67
|
+
return matchesKind ? payload : null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns the newest payload from the current generator lineage, or null.
|
|
71
|
+
* `fromAttempt` excludes generator runs discarded by reset-backed retries; an
|
|
72
|
+
* absent boundary fails closed for states written by older Nx.
|
|
73
|
+
*/
|
|
74
|
+
function latestStoredAgentWorkPayload(runDirPath, stepId, beforeAttempt, fromAttempt, expected) {
|
|
75
|
+
if (fromAttempt === undefined) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
// Enumerated from disk rather than counted down from `beforeAttempt`:
|
|
79
|
+
// attempts are persisted numbers, and a loop spanning their range would
|
|
80
|
+
// let a tampered-but-valid counter drive that many synchronous reads.
|
|
81
|
+
const candidates = storedAttemptsForStep(runDirPath, stepId)
|
|
82
|
+
.filter((attempt) => attempt >= fromAttempt && attempt < beforeAttempt)
|
|
83
|
+
.sort((a, b) => b - a);
|
|
84
|
+
for (const attempt of candidates) {
|
|
85
|
+
const payload = readAgentWorkPayload(agentWorkPayloadPath(runDirPath, stepId, attempt), expected);
|
|
86
|
+
if (payload) {
|
|
87
|
+
return payload;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
// An unreadable directory reads as empty: the lookup falls back to a freshly
|
|
93
|
+
// derived payload, and removal is best effort. The `-attempt-` infix keeps
|
|
94
|
+
// `step-1` from matching `step-12`'s files.
|
|
95
|
+
function storedAttemptsForStep(runDirPath, stepId) {
|
|
96
|
+
let entries;
|
|
97
|
+
try {
|
|
98
|
+
entries = (0, fs_1.readdirSync)((0, path_1.join)(runDirPath, AGENT_WORK_DIR_NAME));
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
const prefix = `${stepId}-attempt-`;
|
|
104
|
+
const suffix = '.json';
|
|
105
|
+
const attempts = [];
|
|
106
|
+
for (const name of entries) {
|
|
107
|
+
if (!name.startsWith(prefix) || !name.endsWith(suffix)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const middle = name.slice(prefix.length, -suffix.length);
|
|
111
|
+
if (!/^[1-9]\d*$/.test(middle)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const attempt = Number(middle);
|
|
115
|
+
if (Number.isSafeInteger(attempt)) {
|
|
116
|
+
attempts.push(attempt);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return attempts;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Best effort per file: the callers run after the outcome or rearm is already
|
|
123
|
+
* decided, so an entry that cannot be removed (a permission failure, a
|
|
124
|
+
* directory planted at the path) is left to whole-run pruning rather than
|
|
125
|
+
* failing the reconcile. A planted directory is never re-handed either way:
|
|
126
|
+
* reading it fails, which the reader treats as no stored copy.
|
|
127
|
+
*/
|
|
128
|
+
function removeAgentWorkPayloads(runDirPath, stepId, throughAttempt) {
|
|
129
|
+
// Enumerated for the same reason as the lookup: a tampered-but-valid attempt
|
|
130
|
+
// would otherwise drive that many synchronous removals.
|
|
131
|
+
for (const attempt of storedAttemptsForStep(runDirPath, stepId)) {
|
|
132
|
+
if (attempt > throughAttempt) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
(0, fs_1.rmSync)(agentWorkPayloadPath(runDirPath, stepId, attempt), {
|
|
137
|
+
force: true,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch { }
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `write` against a unique sibling temp path, then renames it over
|
|
3
|
+
* `filePath`: a crash mid-write can only leave a stale temp file, never a
|
|
4
|
+
* half-written artifact, and rename replaces whatever sits at the destination
|
|
5
|
+
* without following it. The random suffix keeps concurrent writers apart; a
|
|
6
|
+
* pid would collide across PID namespaces sharing the workspace.
|
|
7
|
+
*/
|
|
8
|
+
export declare function publishFileAtomically(filePath: string, write: (tmpPath: string) => void): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.publishFileAtomically = publishFileAtomically;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
/**
|
|
7
|
+
* Runs `write` against a unique sibling temp path, then renames it over
|
|
8
|
+
* `filePath`: a crash mid-write can only leave a stale temp file, never a
|
|
9
|
+
* half-written artifact, and rename replaces whatever sits at the destination
|
|
10
|
+
* without following it. The random suffix keeps concurrent writers apart; a
|
|
11
|
+
* pid would collide across PID namespaces sharing the workspace.
|
|
12
|
+
*/
|
|
13
|
+
function publishFileAtomically(filePath, write) {
|
|
14
|
+
const tmpPath = `${filePath}~${(0, crypto_1.randomBytes)(4).toString('hex')}`;
|
|
15
|
+
write(tmpPath);
|
|
16
|
+
(0, fs_1.renameSync)(tmpPath, filePath);
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CURRENT_RUN_STATE_FORMAT_VERSION, NewerRunStateFormatError, migrateRunsDir, runDir, readRunState, writeRunState, findActiveRun, createRun, } from './run-state';
|
|
2
|
-
export type { MigrateRunStatus, MigrateRunRound, MigrateStepStatus, PromptOutcomeStatus, MigrateStepOutcome, MigrateStepPromptOutcome, MigrateStep, MigrateCommitKind, MigrateCommitLedgerEntry, MigrateRunAnalytics, MigrateRunState, } from './run-state';
|
|
2
|
+
export type { MigrateRunStatus, MigrateRunRound, MigrateStepStatus, PromptOutcomeStatus, MigrateStepAwaitingKind, MigrateStepOutcome, MigrateStepPromptOutcome, MigrateStep, MigrateCommitKind, MigrateCommitLedgerEntry, MigrateIssueDisposition, MigrateRunIssue, MigrateRunAnalytics, MigrateRunNoProgress, MigrateRunState, } from './run-state';
|
|
3
3
|
export { applyStepEvent, hasPendingCommitDebt } from './state-machine';
|
|
4
4
|
export type { StepAction, StepEvent, ApplyStepEventResult, } from './state-machine';
|
|
5
5
|
export { createRunId, computePlanHash } from './run-id';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { issueFingerprint, type MigrateCommitLedgerEntry, type MigrateIssueDisposition, type MigrateRunIssue, type MigrateRunState, type MigrateStep } from './run-state';
|
|
2
|
+
export { issueFingerprint };
|
|
3
|
+
export interface ReportedIssue {
|
|
4
|
+
summary: string;
|
|
5
|
+
detail?: string;
|
|
6
|
+
applicableMigrations: string[] | 'unknown';
|
|
7
|
+
disposition?: MigrateIssueDisposition;
|
|
8
|
+
}
|
|
9
|
+
export interface ReportedIssueUpdate {
|
|
10
|
+
id: string;
|
|
11
|
+
disposition: Exclude<MigrateIssueDisposition, 'recorded'>;
|
|
12
|
+
note?: string;
|
|
13
|
+
}
|
|
14
|
+
export type ParsedHandoffIssues = {
|
|
15
|
+
ok: true;
|
|
16
|
+
issues: ReportedIssue[];
|
|
17
|
+
updates: ReportedIssueUpdate[];
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
reason: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Validates a handoff's `issues` / `issueUpdates` against the run's current
|
|
24
|
+
* state. Absent fields parse as empty; any invalid entry rejects the whole
|
|
25
|
+
* report with a reason the awaiting dispense hands back to the agent. Also
|
|
26
|
+
* rejects unrecognized top-level handoff fields: a misspelled "issueUpates"
|
|
27
|
+
* would otherwise read as an absent report and be discarded with the handoff.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseHandoffIssues(extras: Record<string, unknown> | undefined, state: MigrateRunState, reportingStep: MigrateStep): ParsedHandoffIssues;
|
|
30
|
+
export interface IssueArchiveUpdate {
|
|
31
|
+
issueId: string;
|
|
32
|
+
stepId: string;
|
|
33
|
+
disposition: MigrateIssueDisposition;
|
|
34
|
+
note?: string;
|
|
35
|
+
detail?: string;
|
|
36
|
+
applicableMigrations?: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface IssueApplication {
|
|
39
|
+
state: MigrateRunState;
|
|
40
|
+
newIssues: {
|
|
41
|
+
entry: MigrateRunIssue;
|
|
42
|
+
report: ReportedIssue;
|
|
43
|
+
}[];
|
|
44
|
+
updates: IssueArchiveUpdate[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Pure. Must run on state read fresh inside the fold's locked write, or ids
|
|
48
|
+
* collide and the claim checks test state that is no longer on disk.
|
|
49
|
+
*/
|
|
50
|
+
export declare function applyReportedIssues(state: MigrateRunState, reportingStep: MigrateStep, issues: ReportedIssue[], updates: ReportedIssueUpdate[]): IssueApplication;
|
|
51
|
+
/**
|
|
52
|
+
* The issue ids a landed commit naming `stepIds` carries. Attribution rides on
|
|
53
|
+
* the persisted `resolvedByStepId`, so a resolution whose own commit attempt
|
|
54
|
+
* failed still reaches the later commit that absorbs that step's tree.
|
|
55
|
+
*/
|
|
56
|
+
export declare function issueIdsForCommit(state: MigrateRunState, stepIds: string[]): string[];
|
|
57
|
+
/**
|
|
58
|
+
* Attaches the issue ids a landed entry carries; non-landed entries pass
|
|
59
|
+
* through. Every commit append (worker, fold, adopt) routes through this so
|
|
60
|
+
* attribution cannot diverge between terminal paths.
|
|
61
|
+
*/
|
|
62
|
+
export declare function attachIssueIdsToCommitEntry(state: MigrateRunState, entry: MigrateCommitLedgerEntry): MigrateCommitLedgerEntry;
|
|
63
|
+
/**
|
|
64
|
+
* Reverts resolutions not carried by a landed commit and releases claims
|
|
65
|
+
* during a reset-backed retry. Returned disposition changes form the archive
|
|
66
|
+
* trail; claim releases do not.
|
|
67
|
+
*/
|
|
68
|
+
export declare function reopenResolutionsForStep(state: MigrateRunState, stepId: string): {
|
|
69
|
+
state: MigrateRunState;
|
|
70
|
+
updates: IssueArchiveUpdate[];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Claims the still-recorded issues applicable to the step being dispensed, up
|
|
74
|
+
* to what the digest can publish. Must run inside the dispense's locked write:
|
|
75
|
+
* serial dispensing is what makes reassignment to the next applicable step
|
|
76
|
+
* deterministic when an earlier one left the issue unresolved.
|
|
77
|
+
*/
|
|
78
|
+
export declare function claimIssuesForStep(state: MigrateRunState, stepId: string, runId: string): MigrateRunState;
|
|
79
|
+
/**
|
|
80
|
+
* Before rendering, release terminal claims and defer issues no remaining
|
|
81
|
+
* step can claim; report-time routing can become stale as steps finish. Do
|
|
82
|
+
* not archive Nx-driven progression.
|
|
83
|
+
*/
|
|
84
|
+
export declare function settleUnclaimableIssues(state: MigrateRunState): MigrateRunState;
|
|
85
|
+
/**
|
|
86
|
+
* The bounded "Known issues" digest a work dispense carries. Assigned entries
|
|
87
|
+
* lead and share claimIssuesForStep's prefix bound, so every kept claim appears.
|
|
88
|
+
*/
|
|
89
|
+
export declare function renderIssueDigestLines(state: MigrateRunState, currentStepId: string, runId: string): string[];
|
|
90
|
+
export declare function renderUnresolvedIssueLines(state: MigrateRunState, runId: string): string[];
|
|
91
|
+
export declare function issueArchivePath(runDirPath: string, issueId: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Archives an application's new issues (with the detail the ledger does not
|
|
94
|
+
* carry) and appends its updates to the archived files. Failures propagate;
|
|
95
|
+
* the caller then keeps the handoff file as the fallback detail store.
|
|
96
|
+
* `reconstructedIds` is filled as it goes rather than returned alone: a retry
|
|
97
|
+
* finds a rebuilt shell healthy, so a throw-interrupted pass is the only
|
|
98
|
+
* chance to warn that an archive was lost.
|
|
99
|
+
*/
|
|
100
|
+
export declare function archiveIssues(runDirPath: string, application: IssueApplication, reconstructedIds?: string[]): string[];
|
|
101
|
+
/**
|
|
102
|
+
* Verifies the archive state expected after phase 1. New-issue fields must
|
|
103
|
+
* match the report and have no updates; existing-issue updates must end with
|
|
104
|
+
* this application's whole batch.
|
|
105
|
+
*/
|
|
106
|
+
export declare function applicationArchivesIntact(runDirPath: string, application: IssueApplication): boolean;
|