@allocator-one/rcl 4.5.3 → 4.5.5
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 +12 -3
- package/dist/converge/attempt-budget.d.ts +14 -0
- package/dist/converge/attempt-budget.js +216 -1
- package/dist/converge/attempt-budget.js.map +1 -1
- package/dist/converge/historical-delivery-reconciliation-schema.d.ts +131 -0
- package/dist/converge/historical-delivery-reconciliation-schema.js +111 -0
- package/dist/converge/historical-delivery-reconciliation-schema.js.map +1 -0
- package/dist/converge/historical-delivery-reconciliation.d.ts +15 -0
- package/dist/converge/historical-delivery-reconciliation.js +326 -0
- package/dist/converge/historical-delivery-reconciliation.js.map +1 -0
- package/dist/converge/launch-guard.js +25 -6
- package/dist/converge/launch-guard.js.map +1 -1
- package/dist/converge/launch-record.d.ts +36 -0
- package/dist/converge/launch-record.js +9 -3
- package/dist/converge/launch-record.js.map +1 -1
- package/dist/converge/legacy-launch-health.d.ts +36 -0
- package/dist/converge/native-lock.d.ts +3 -1
- package/dist/converge/native-lock.js +4 -4
- package/dist/converge/native-lock.js.map +1 -1
- package/dist/converge/ordinary-pending-export.d.ts +3 -0
- package/dist/converge/ordinary-pending-export.js +64 -17
- package/dist/converge/ordinary-pending-export.js.map +1 -1
- package/dist/converge/ordinary-pending-package.d.ts +11 -0
- package/dist/converge/ordinary-pending-package.js +18 -4
- package/dist/converge/ordinary-pending-package.js.map +1 -1
- package/dist/converge/pending-finalization-receipt.d.ts +4 -0
- package/dist/converge/pending-finalization-receipt.js +102 -0
- package/dist/converge/pending-finalization-receipt.js.map +1 -0
- package/dist/converge/pending-legacy-resume.d.ts +42 -3
- package/dist/converge/pending-legacy-resume.js +164 -32
- package/dist/converge/pending-legacy-resume.js.map +1 -1
- package/dist/converge/pending-recovery-source.d.ts +114 -0
- package/dist/converge/pending-recovery-source.js +36 -1
- package/dist/converge/pending-recovery-source.js.map +1 -1
- package/dist/converge/process-identity.d.ts +51 -0
- package/dist/converge/process-identity.js +190 -0
- package/dist/converge/process-identity.js.map +1 -0
- package/dist/converge/recovery-launch.js +39 -17
- package/dist/converge/recovery-launch.js.map +1 -1
- package/dist/converge/recovery-state.d.ts +55 -0
- package/dist/converge/recovery-state.js +306 -0
- package/dist/converge/recovery-state.js.map +1 -0
- package/dist/converge/run-state.d.ts +43 -1
- package/dist/converge/run-state.js +252 -18
- package/dist/converge/run-state.js.map +1 -1
- package/dist/converge/semantic-state.d.ts +55 -0
- package/dist/converge/semantic-state.js +666 -0
- package/dist/converge/semantic-state.js.map +1 -0
- package/dist/converge/stale-report.d.ts +412 -0
- package/dist/converge/stale-report.js +42 -0
- package/dist/converge/stale-report.js.map +1 -1
- package/dist/converge/terminal-rejection.d.ts +1 -0
- package/dist/converge/terminal-rejection.js +6 -6
- package/dist/converge/terminal-rejection.js.map +1 -1
- package/dist/dispatch/async-lane.d.ts +12 -0
- package/dist/dispatch/async-lane.js +94 -0
- package/dist/dispatch/async-lane.js.map +1 -1
- package/dist/evidence/claim-recovery/validation/native-state.d.ts +22 -0
- package/dist/evidence/claim-recovery/validation/native-state.js +91 -9
- package/dist/evidence/claim-recovery/validation/native-state.js.map +1 -1
- package/dist/evidence/claim-recovery/validation/obligations.js +2 -1
- package/dist/evidence/claim-recovery/validation/obligations.js.map +1 -1
- package/dist/evidence/claim-recovery/validation/semantic-validation.d.ts +11 -0
- package/dist/evidence/claim-recovery/validation/semantic-validation.js +105 -28
- package/dist/evidence/claim-recovery/validation/semantic-validation.js.map +1 -1
- package/dist/evidence/claim-recovery/validation/types.d.ts +10 -0
- package/dist/evidence/original-run/lock-scope.d.ts +12 -6
- package/dist/evidence/original-run/lock-scope.js +12 -9
- package/dist/evidence/original-run/lock-scope.js.map +1 -1
- package/dist/index.js +74 -11
- package/dist/index.js.map +1 -1
- package/dist/telemetry/recovery/files.d.ts +4 -0
- package/dist/telemetry/recovery/files.js +15 -5
- package/dist/telemetry/recovery/files.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-scope.js","sourceRoot":"","sources":["../../../src/evidence/original-run/lock-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"lock-scope.js","sourceRoot":"","sources":["../../../src/evidence/original-run/lock-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,gEAAgE,CAAC;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IAC9D,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IACvH,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,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MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAAC,CAAC;AACjE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { retainAssemblyRefusal } from './output/assembly-refusal.js';
|
|
|
6
6
|
import { createReviewCycleRemote } from './converge/cycle-remote.js';
|
|
7
7
|
import { assertNoPendingFreshReview, freshReviewOutputPaths } from './converge/fresh-review.js';
|
|
8
8
|
import { previewStaleReport, applyStaleReport } from './converge/stale-report.js';
|
|
9
|
+
import { previewHistoricalDeliveryReconciliation, applyHistoricalDeliveryReconciliation } from './converge/historical-delivery-reconciliation.js';
|
|
9
10
|
import { Command, InvalidArgumentError } from 'commander';
|
|
10
11
|
import ora from 'ora';
|
|
11
12
|
import chalk from 'chalk';
|
|
@@ -32,7 +33,7 @@ import { originalRunReportSchema } from './telemetry/recovery/source.js';
|
|
|
32
33
|
import { buildAssignments, detectProvider } from './roles/dispatcher.js';
|
|
33
34
|
import { defaultAdapterFactory, runReviews } from './dispatch/runner.js';
|
|
34
35
|
import { mergeChunkReviews } from './dispatch/merge.js';
|
|
35
|
-
import { partitionAsyncAssignments, asyncTargetKey, resolveAsyncStoreDir, resolveExistingAsyncStoreDir, spoolAsyncCalls, launchAsyncWorkers, runAsyncWorker, collectAsyncResults, currentBranchLabel, MAX_ASYNC_CALLS_PER_ROUND, snapshotAsyncResults, consumeBoundAsyncResults, } from './dispatch/async-lane.js';
|
|
36
|
+
import { partitionAsyncAssignments, asyncTargetKey, resolveAsyncStoreDir, resolveExistingAsyncStoreDir, spoolAsyncCalls, launchAsyncWorkers, runAsyncWorker, collectAsyncResults, currentBranchLabel, MAX_ASYNC_CALLS_PER_ROUND, snapshotAsyncResults, snapshotAsyncHistory, consumeBoundAsyncResults, } from './dispatch/async-lane.js';
|
|
36
37
|
import { evaluateCiGate } from './ci.js';
|
|
37
38
|
import { resolveQuorumPolicy } from './dispatch/quorum.js';
|
|
38
39
|
import { assertAdmissibleReportHealth, deriveBlockingHealth, describeBlockingHealth, ReportHealthError } from './report/blocking-health.js';
|
|
@@ -108,7 +109,7 @@ program.hook('preAction', async (_thisCommand, actionCommand) => {
|
|
|
108
109
|
// Reads and explicit repairs must not flush unrelated evidence, even in preview.
|
|
109
110
|
if (actionCommand.parent?.name() === 'evidence' && (name === 'show' || name === 'status'))
|
|
110
111
|
return;
|
|
111
|
-
if (name === 'converge-rejected' || name === 'converge-stale' || name === 'converge-gap' || name === 'recover-run' || name === 'recover-finding' || name === 'retriage-finding' || name === 'telemetry' || actionCommand.parent?.name() === 'telemetry' || name.includes('worker'))
|
|
112
|
+
if (name === 'converge-rejected' || name === 'converge-stale' || name === 'converge-gap' || name === 'converge-reconcile-history' || name === 'recover-run' || name === 'recover-finding' || name === 'retriage-finding' || name === 'telemetry' || actionCommand.parent?.name() === 'telemetry' || name.includes('worker'))
|
|
112
113
|
return;
|
|
113
114
|
const flags = actionCommand.opts();
|
|
114
115
|
if (flags.telemetry === false || (process.env['RCL_TELEMETRY'] ?? '').trim().toLowerCase() === 'off')
|
|
@@ -236,12 +237,12 @@ program
|
|
|
236
237
|
.option('--launch-intent <intent>', 'Guarded intent: review, stop-upstream, stop-review, or retry-delivery')
|
|
237
238
|
.option('--retry-report <path>', 'Original legacy report proving an inconclusive launch; the new inputs may differ; requires --retry-reason')
|
|
238
239
|
.option('--resume-pending', 'Finalize an unobservable pending legacy dispatch, then claim one fresh checkpointed retry under its target lock')
|
|
239
|
-
.option('--finalize-pending-only', 'Finalize one authenticated
|
|
240
|
+
.option('--finalize-pending-only', 'Finalize one authenticated pending launch without claiming or dispatching its successor')
|
|
240
241
|
.option('--pending-native-sha256 <digest>', 'Finalize-only: exact native state digest returned by --preview-pending')
|
|
241
242
|
.option('--pending-attempt-sha256 <digest>', 'Finalize-only: exact attempt state digest returned by --preview-pending')
|
|
242
|
-
.option('--export-pending-package <path>', 'Export authenticated
|
|
243
|
+
.option('--export-pending-package <path>', 'Export authenticated pending inputs to an exclusive private file without provider calls or native writes')
|
|
243
244
|
.option('--expect-base-sha <sha>', 'Pending package export: require the resolved current base to equal this SHA')
|
|
244
|
-
.option('--ordinary-pending-package <path>', 'Immutable
|
|
245
|
+
.option('--ordinary-pending-package <path>', 'Immutable pending-launch package; requires --resume-pending or --finalize-pending-only and replaces --retry-report')
|
|
245
246
|
.option('--preview-pending', 'Authenticate pending recovery or preview a pending package export without provider calls')
|
|
246
247
|
.option('--resume-async-sha256 <hashes>', 'Comma-separated SHA-256 bindings for every legacy async result retained as historical evidence')
|
|
247
248
|
.option('--retry-reason <reason>', 'Explicit bounded recovery decision for a previous failed or unknown launch; never resets caps')
|
|
@@ -417,6 +418,47 @@ program
|
|
|
417
418
|
}
|
|
418
419
|
});
|
|
419
420
|
// Cross-round finding identity + machine-enforced round cap (RCL-24).
|
|
421
|
+
program
|
|
422
|
+
.command('converge-reconcile-history')
|
|
423
|
+
.description('Preview or apply an exact historical delivery reconciliation after lastLaunch advanced')
|
|
424
|
+
.option('--preview').option('--apply')
|
|
425
|
+
.option('--manifest <path>', 'Exact reviewed preview output for apply')
|
|
426
|
+
.option('--manifest-sha256 <sha256>', 'Exact reviewed manifest digest for apply')
|
|
427
|
+
.option('--target <target>').option('--run <uuid>')
|
|
428
|
+
.action(async (opts) => {
|
|
429
|
+
try {
|
|
430
|
+
if ([opts.preview, opts.apply].filter(Boolean).length !== 1)
|
|
431
|
+
throw new Error('choose_exactly_one_historical_reconciliation_mode');
|
|
432
|
+
const common = await resolveGitCommonDir();
|
|
433
|
+
const opened = await openReadSink({ rclVersion: RCL_VERSION });
|
|
434
|
+
if (!opened.sink)
|
|
435
|
+
throw new Error(`historical_delivery_reconciliation_credential_unavailable: ${opened.note}`);
|
|
436
|
+
if (opts.preview) {
|
|
437
|
+
if (opts.manifest !== undefined || opts.manifestSha256 !== undefined ||
|
|
438
|
+
typeof opts.target !== 'string' || typeof opts.run !== 'string') {
|
|
439
|
+
throw new Error('historical_delivery_reconciliation_preview_arguments_invalid');
|
|
440
|
+
}
|
|
441
|
+
const manifest = await previewHistoricalDeliveryReconciliation({ target: opts.target, runId: opts.run }, common, opened.sink);
|
|
442
|
+
const bytes = serializeRecoveryDocument(manifest);
|
|
443
|
+
process.stderr.write(`manifest-sha256 ${sha256(bytes)}\n`);
|
|
444
|
+
process.stdout.write(bytes);
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
if (opts.target !== undefined || opts.run !== undefined || typeof opts.manifest !== 'string' ||
|
|
448
|
+
typeof opts.manifestSha256 !== 'string')
|
|
449
|
+
throw new Error('apply_uses_only_pinned_manifest');
|
|
450
|
+
const result = await applyHistoricalDeliveryReconciliation({ manifest: opts.manifest,
|
|
451
|
+
manifestSha256: opts.manifestSha256 }, common, opened.sink);
|
|
452
|
+
console.log(JSON.stringify({ mode: 'apply', result, accounting: 'unchanged',
|
|
453
|
+
scope: 'historical local authority receipt only; no admission, provider calls or approval' }));
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
catch (error) {
|
|
457
|
+
console.error(JSON.stringify({ error: { code: 'RCL_CONVERGE_RECONCILE_HISTORY',
|
|
458
|
+
message: error instanceof Error ? error.message : String(error) } }));
|
|
459
|
+
process.exitCode = 3;
|
|
460
|
+
}
|
|
461
|
+
});
|
|
420
462
|
program
|
|
421
463
|
.command('converge-stale')
|
|
422
464
|
.description('Preview/apply/resume an audited stale unadmitted report disposition; preserves reports, attempts and findings')
|
|
@@ -1809,12 +1851,13 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
|
|
|
1809
1851
|
let completion;
|
|
1810
1852
|
const common = await resolveGitCommonDir();
|
|
1811
1853
|
if (opts.exportPendingPackage) {
|
|
1854
|
+
const pendingNative = await loadConvergeRunState(common, prepared.converge.target);
|
|
1812
1855
|
const receipt = await exportOrdinaryPendingPackage({ gitCommonDir: common,
|
|
1813
1856
|
target: prepared.converge.target, headSha: extra.target.headSha ?? '', baseSha: extra.target.baseSha ?? '',
|
|
1814
1857
|
expectedBaseSha: opts.expectBaseSha, expectedRound: prepared.converge.round,
|
|
1815
1858
|
guardedInput, path: opts.exportPendingPackage,
|
|
1816
1859
|
preview: opts.previewPending === true, asyncStoreDir: await resolveExistingAsyncStoreDir(),
|
|
1817
|
-
asyncTargetKey: asyncTargetKey(extra.asyncTargetLabel ?? prepared.converge.target, extra.target.kind === 'patch' ? prepared.converge.target : undefined),
|
|
1860
|
+
asyncTargetKey: asyncTargetKey(extra.asyncTargetLabel ?? prepared.converge.target, extra.target.kind === 'patch' ? prepared.converge.target : undefined, pendingNative?.cycle?.id),
|
|
1818
1861
|
asyncDescriptors: ordinaryAsyncDescriptors });
|
|
1819
1862
|
spinner.stop();
|
|
1820
1863
|
console.log(JSON.stringify(receipt));
|
|
@@ -1841,16 +1884,29 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
|
|
|
1841
1884
|
cycleRemote = createReviewCycleRemote(runtime.sink, extra.target.repo, extra.target.prNumber, extra.target.headSha ?? '');
|
|
1842
1885
|
}
|
|
1843
1886
|
if (opts.resumePending || opts.finalizePendingOnly) {
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1887
|
+
const asyncBinding = opts.resumeAsyncSha256.trim();
|
|
1888
|
+
const expectedAsyncSha256 = asyncBinding === 'none'
|
|
1889
|
+
? [] : asyncBinding.split(',').map(value => value.trim());
|
|
1890
|
+
if (expectedAsyncSha256.some(value => !/^[a-f0-9]{64}$/.test(value))) {
|
|
1891
|
+
throw new ReviewLaunchRefused('pending_async_binding_invalid', 'Retained async bindings must be comma-separated lowercase SHA-256 digests, or "none" for an empty cycle history.');
|
|
1848
1892
|
}
|
|
1849
1893
|
const migrationPackage = opts.ordinaryPendingPackage === undefined ? undefined : JSON.parse((await readStable(opts.ordinaryPendingPackage)).text);
|
|
1894
|
+
if (migrationPackage?.version !== 2 && (expectedAsyncSha256.length === 0 ||
|
|
1895
|
+
new Set(expectedAsyncSha256).size !== expectedAsyncSha256.length)) {
|
|
1896
|
+
throw new ReviewLaunchRefused('pending_async_binding_invalid', 'Ordinary retained async SHA-256 bindings must be non-empty and unique.');
|
|
1897
|
+
}
|
|
1898
|
+
if (migrationPackage?.version === 2 && opts.resumePending) {
|
|
1899
|
+
throw new ReviewLaunchRefused('cycle_pending_finalize_only', 'Cycle-backed packages can only terminalize the unknown original attempt. Launch a later successor normally after its terminal receipt verifies.');
|
|
1900
|
+
}
|
|
1850
1901
|
const loadMigrationRetainedAsync = async () => {
|
|
1851
1902
|
if (!migrationPackage)
|
|
1852
1903
|
throw new ReviewLaunchRefused('pending_async_missing', 'An ordinary package is required.');
|
|
1853
1904
|
const store = await resolveExistingAsyncStoreDir();
|
|
1905
|
+
if (migrationPackage.version === 2) {
|
|
1906
|
+
const key = asyncTargetKey(extra.asyncTargetLabel ?? prepared.converge.target, extra.target.kind === 'patch' ? prepared.converge.target : undefined, migrationPackage.cycle.id);
|
|
1907
|
+
const snapshot = await snapshotAsyncHistory(store, key, (migrationPackage.attemptsUsed + 1) * MAX_ASYNC_CALLS_PER_ROUND, expectedAsyncSha256);
|
|
1908
|
+
return snapshot.artifacts;
|
|
1909
|
+
}
|
|
1854
1910
|
const wanted = new Map(migrationPackage.retainedAsync.map(item => [item.sha256, item]));
|
|
1855
1911
|
const found = new Map();
|
|
1856
1912
|
for (const name of await readdir(store)) {
|
|
@@ -1887,6 +1943,7 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
|
|
|
1887
1943
|
migrationPackage, maxAttempts: Number(opts.maxAttempts), maxPhysicalCalls: 1, maxAttemptsPerCell: 1,
|
|
1888
1944
|
maxDurationMs: 1, validate: async () => { }, loadRetainedAsync: loadMigrationRetainedAsync,
|
|
1889
1945
|
run: async () => { throw new Error('preview_must_not_run'); }, preview: true,
|
|
1946
|
+
cycleRemote,
|
|
1890
1947
|
previewMode: opts.finalizePendingOnly ? 'finalize-only' : 'combined' });
|
|
1891
1948
|
spinner.stop();
|
|
1892
1949
|
console.log(JSON.stringify({
|
|
@@ -1901,7 +1958,13 @@ async function executeCouncil(spinner, prepared, diff, opts, extra, preparedWork
|
|
|
1901
1958
|
baseSha: extra.target.baseSha ?? '', pendingInputSha256: inputSha256,
|
|
1902
1959
|
nativeStateSha256: opts.pendingNativeSha256, attemptStateSha256: opts.pendingAttemptSha256,
|
|
1903
1960
|
retainedAsyncSha256: expectedAsyncSha256, migrationPackage,
|
|
1904
|
-
maxAttempts: Number(opts.maxAttempts),
|
|
1961
|
+
maxAttempts: Number(opts.maxAttempts), cycleRemote,
|
|
1962
|
+
loadRetainedAsync: loadMigrationRetainedAsync,
|
|
1963
|
+
...(migrationPackage.version === 2 ? { cycleHistory: {
|
|
1964
|
+
resolveStoreDir: resolveExistingAsyncStoreDir,
|
|
1965
|
+
targetKey: asyncTargetKey(extra.asyncTargetLabel ?? prepared.converge.target, extra.target.kind === 'patch' ? prepared.converge.target : undefined, migrationPackage.cycle.id),
|
|
1966
|
+
maxResults: (migrationPackage.attemptsUsed + 1) * MAX_ASYNC_CALLS_PER_ROUND,
|
|
1967
|
+
} } : {}) });
|
|
1905
1968
|
spinner.stop();
|
|
1906
1969
|
console.log(JSON.stringify({ mode: 'finalize-only', ...result }));
|
|
1907
1970
|
return undefined;
|