@allocator-one/rcl 4.5.8 → 4.5.12
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 +5 -4
- package/dist/consensus/semantic-deduper.d.ts +2 -1
- package/dist/consensus/semantic-deduper.js +21 -10
- package/dist/consensus/semantic-deduper.js.map +1 -1
- package/dist/converge/attempt-budget.d.ts +11 -0
- package/dist/converge/attempt-budget.js +119 -61
- package/dist/converge/attempt-budget.js.map +1 -1
- package/dist/converge/cycle-remote.d.ts +6 -1
- package/dist/converge/cycle-remote.js +13 -3
- package/dist/converge/cycle-remote.js.map +1 -1
- package/dist/converge/delivery-reconciliation.d.ts +2 -1
- package/dist/converge/delivery-reconciliation.js +105 -11
- package/dist/converge/delivery-reconciliation.js.map +1 -1
- package/dist/converge/launch-guard.d.ts +3 -0
- package/dist/converge/launch-guard.js +53 -17
- package/dist/converge/launch-guard.js.map +1 -1
- package/dist/converge/ordinary-pending-export.d.ts +5 -0
- package/dist/converge/ordinary-pending-export.js +9 -1
- package/dist/converge/ordinary-pending-export.js.map +1 -1
- package/dist/converge/recovered-production.d.ts +14 -0
- package/dist/converge/recovered-production.js +61 -0
- package/dist/converge/recovered-production.js.map +1 -0
- package/dist/converge/recovery-launch.js +82 -35
- package/dist/converge/recovery-launch.js.map +1 -1
- package/dist/converge/run-state.d.ts +2 -0
- package/dist/converge/run-state.js +26 -12
- package/dist/converge/run-state.js.map +1 -1
- package/dist/converge/semantic-state.js +18 -4
- package/dist/converge/semantic-state.js.map +1 -1
- package/dist/coordination/registry-lock.d.ts +2 -0
- package/dist/coordination/registry-lock.js +42 -13
- package/dist/coordination/registry-lock.js.map +1 -1
- package/dist/evidence/claim-recovery/delivery.d.ts +25 -0
- package/dist/evidence/claim-recovery/delivery.js +100 -0
- package/dist/evidence/claim-recovery/delivery.js.map +1 -0
- package/dist/evidence/claim-recovery/public-adoption.d.ts +31 -0
- package/dist/evidence/claim-recovery/public-adoption.js +177 -0
- package/dist/evidence/claim-recovery/public-adoption.js.map +1 -0
- package/dist/evidence/claim-recovery/public-manifest.d.ts +114 -0
- package/dist/evidence/claim-recovery/public-manifest.js +11 -0
- package/dist/evidence/claim-recovery/public-manifest.js.map +1 -0
- package/dist/evidence/claim-recovery/public-model.d.ts +85 -0
- package/dist/evidence/claim-recovery/public-model.js +177 -0
- package/dist/evidence/claim-recovery/public-model.js.map +1 -0
- package/dist/evidence/original-run/journal.d.ts +10 -0
- package/dist/evidence/original-run/journal.js +55 -3
- package/dist/evidence/original-run/journal.js.map +1 -1
- package/dist/evidence/original-run/lock.js +22 -9
- package/dist/evidence/original-run/lock.js.map +1 -1
- package/dist/evidence/recover-claim.d.ts +21 -0
- package/dist/evidence/recover-claim.js +504 -0
- package/dist/evidence/recover-claim.js.map +1 -0
- package/dist/index.js +239 -137
- package/dist/index.js.map +1 -1
- package/dist/report/assembly.d.ts +2 -0
- package/dist/report/assembly.js +1 -0
- package/dist/report/assembly.js.map +1 -1
- package/dist/report/consensus-assembly.d.ts +2 -0
- package/dist/report/consensus-assembly.js +6 -3
- package/dist/report/consensus-assembly.js.map +1 -1
- package/dist/report/reviewer-artifact.js +3 -1
- package/dist/report/reviewer-artifact.js.map +1 -1
- package/dist/report/run-header.js +2 -0
- package/dist/report/run-header.js.map +1 -1
- package/dist/telemetry/deliver.d.ts +8 -0
- package/dist/telemetry/deliver.js +55 -8
- package/dist/telemetry/deliver.js.map +1 -1
- package/dist/telemetry/events.js +2 -0
- package/dist/telemetry/events.js.map +1 -1
- package/dist/telemetry/outbox.d.ts +20 -0
- package/dist/telemetry/outbox.js +324 -103
- package/dist/telemetry/outbox.js.map +1 -1
- package/dist/telemetry/reviewer-delivery.d.ts +95 -3
- package/dist/telemetry/reviewer-delivery.js +600 -12
- package/dist/telemetry/reviewer-delivery.js.map +1 -1
- package/dist/telemetry/sink.d.ts +14 -0
- package/dist/telemetry/sink.js +44 -2
- package/dist/telemetry/sink.js.map +1 -1
- package/dist/telemetry/terminal-reviewer-delivery.d.ts +154 -5
- package/dist/telemetry/terminal-reviewer-delivery.js +196 -21
- package/dist/telemetry/terminal-reviewer-delivery.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../src/evidence/original-run/lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAmB5F,SAAS,IAAI,CAAC,KAAc,IAAwB,OAAQ,KAA+B,EAAE,IAAI,CAAC,CAAC,CAAC;AACpG,KAAK,UAAU,IAAI,CAAC,IAAY;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAAC,IAAI,CAAC;QAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IAAC,CAAC;YAAS,CAAC;QAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;AACtG,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAI,IAAY,EAAE,QAAgB,EAAE,IAA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AAM,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,MAAO,GAAG,KAAK,CAAC,MAAO;wBAChE,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;wBAAE,OAAO,GAAG,IAAI,CAAC;gBAC3E,CAAC;gBACD,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,MAAM,WAAW,EAAE,CAAC;oBAAC,SAAS,EAAE,CAAC;oBAAC,MAAM,IAAI,CAAC,eAAe,CAAC,CAAC;oBAC9D,OAAO,MAAM,IAAI,EAAE,CAAC;gBACtB,CAAC;gBACD,SAAS,EAAE,CAAC;gBAAC,MAAM,IAAI,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,MAAM,GAAG,IAAI,CAAC;YAAC,OAAO,GAAG,KAAK,CAAC;YAAC,MAAM,KAAK,CAAC;QAAC,CAAC;gBACxD,CAAC;YACP,IAAI,CAAC;gBAAC,MAAM,OAAO,EAAE,CAAC;YAAC,CAAC;YACxB,OAAO,KAAK,EAAE,CAAC;gBAAC,IAAI,MAAM;oBAAE,MAAM,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,8BAA8B,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;gBAAC,MAAM,KAAK,CAAC;YAAC,CAAC;QAC5I,CAAC;IACD,CAAC,CAAC;IACF,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type EvidenceDeps } from './status.js';
|
|
2
|
+
import { type RecoveryClock } from '../telemetry/recovery-request-budget.js';
|
|
3
|
+
export interface PublicClaimRecoveryOptions {
|
|
4
|
+
preview?: boolean;
|
|
5
|
+
apply?: boolean;
|
|
6
|
+
resume?: boolean;
|
|
7
|
+
json?: boolean;
|
|
8
|
+
selection?: string;
|
|
9
|
+
adoptManifest?: string;
|
|
10
|
+
adoptManifestSha256?: string;
|
|
11
|
+
manifest: string;
|
|
12
|
+
manifestSha256?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PublicClaimRecoveryDeps extends EvidenceDeps {
|
|
15
|
+
/** Inject elapsed time for quota tests; no runtime environment override exists. */
|
|
16
|
+
requestClock?: RecoveryClock;
|
|
17
|
+
beforeCheckpoint?: (phase: string) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/** Public Mode B. Ordinary authenticated reads, exact durable events and the
|
|
20
|
+
* same native target; no review, accounting reset, outbox or original rewrite. */
|
|
21
|
+
export declare function runPublicClaimRecovery(options: PublicClaimRecoveryOptions, deps: PublicClaimRecoveryDeps): Promise<number>;
|
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { manifestSchema } from './claim-recovery/public-manifest.js';
|
|
2
|
+
import { prepareClaimAdoption, verifyAdoptionFiles, verifyReplacedAbsence } from './claim-recovery/public-adoption.js';
|
|
3
|
+
import { readClaimProof, writeClaimProof } from './claim-recovery/proof-storage.js';
|
|
4
|
+
import { scrubDeep } from '../telemetry/scrub.js';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
import { lstat, realpath } from 'node:fs/promises';
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
9
|
+
import { resolveGitCommonDir } from '../converge/attempt-budget.js';
|
|
10
|
+
import { loadConvergeRunStateEvidence, convergeRunStatePath } from '../converge/run-state.js';
|
|
11
|
+
import { withRecoveryTarget } from '../converge/target-ownership.js';
|
|
12
|
+
import { applyNativeRecovery, deriveNativeRecovery, nativeRecoveryPlanProjectionVersion, readNativeRecoverySourceJsons, readNativeRecoveryMaterials, recoveryAnchors } from '../converge/recovery-state.js';
|
|
13
|
+
import { correctionAnchor } from '../converge/correction-anchors.js';
|
|
14
|
+
import { prepareClaimSplit } from './claim-split.js';
|
|
15
|
+
import { prepareObligationTransfer, prepareClaimDisposition, validatePreservedDispositionSubject } from './claim-recovery/validation/occurrence.js';
|
|
16
|
+
import { validateOccurrenceSource } from './claim-recovery/validation/occurrence-source.js';
|
|
17
|
+
import { projectOccurrenceCarrier } from './claim-recovery/validation/carrier-projection.js';
|
|
18
|
+
import { readClaimTargetHistory, claimHistoryContent, sameClaimHistoryEvidence } from './claim-recovery/carrier-inventory.js';
|
|
19
|
+
import { publicClaimSelectionSchema, historySource, historyContext, claimRunHistory, claimCarriers, assertHistoryExtension, assertUnusedClaimIdentity } from './claim-recovery/public-model.js';
|
|
20
|
+
import { deliverPreparedClaimEvent } from './claim-recovery/delivery.js';
|
|
21
|
+
import { decodeRecoveryDocument, decodeOriginalReport } from './original-run/decode.js';
|
|
22
|
+
import { inspectRecoveryDirectory } from './original-run/lock-path.js';
|
|
23
|
+
import { openJournal, writeExclusive, MAX_RECOVERY_DOCUMENT_BYTES } from './original-run/journal.js';
|
|
24
|
+
import { platformPath, readStable, sha256 } from '../telemetry/recovery/files.js';
|
|
25
|
+
import { matchesPreparedEventReceipt } from './event-receipts.js';
|
|
26
|
+
import { openSink } from './status.js';
|
|
27
|
+
import { RecoveryRequestBudget } from '../telemetry/recovery-request-budget.js';
|
|
28
|
+
const MAX_MATERIAL = 64 * 1024 * 1024;
|
|
29
|
+
function decode(text) { return decodeRecoveryDocument(text); }
|
|
30
|
+
async function exists(path) {
|
|
31
|
+
try {
|
|
32
|
+
await lstat(path);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
if (e.code === 'ENOENT')
|
|
37
|
+
return false;
|
|
38
|
+
throw e;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function splitInput(selection, material, manifest, history) {
|
|
42
|
+
const source = historySource(history, selection.source);
|
|
43
|
+
const bound = validateOccurrenceSource(source);
|
|
44
|
+
const member = bound.members.find(m => m.ref === selection.findingRef);
|
|
45
|
+
if (!member || member.unresolvedReason || member.identity !== selection.previousIdentity)
|
|
46
|
+
throw new Error('claim_original_mapping_unavailable');
|
|
47
|
+
return {
|
|
48
|
+
scope: selection.source.scope, target: selection.source.target, eventId: manifest.stages[0].id, occurredAt: manifest.createdAt,
|
|
49
|
+
nativeJson: material.nativeJson, nativeSourceJsons: material.nativeSourceJsons, recoveryMaterials: material.recoveryMaterials, reportJson: source.reportJson, findingRef: selection.findingRef,
|
|
50
|
+
previousIdentity: selection.previousIdentity, identity: selection.identity, descriptor: selection.descriptor, reason: selection.reason,
|
|
51
|
+
expectedEventSequence: historyContext(history, selection.source).eventSequence, classificationId: source.classification.id,
|
|
52
|
+
...(member.correction ? { correctionId: member.correction.id } : {}), sourceReceipts: [source.classification, ...(member.correction ? [member.correction] : [])]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function errorCode(e) { const m = e instanceof Error ? e.message : ''; return /^[a-z][a-z0-9_]+$/.test(m) ? m : 'claim_recovery_refused'; }
|
|
56
|
+
/** Public Mode B. Ordinary authenticated reads, exact durable events and the
|
|
57
|
+
* same native target; no review, accounting reset, outbox or original rewrite. */
|
|
58
|
+
export async function runPublicClaimRecovery(options, deps) {
|
|
59
|
+
let stage = 'input';
|
|
60
|
+
const requestBudget = new RecoveryRequestBudget(deps.requestClock, ms => deps.stderr(`Recovery request budget: waiting ${Math.ceil(ms / 1000)}s before the next request.`));
|
|
61
|
+
try {
|
|
62
|
+
if ([options.preview, options.apply, options.resume].filter(Boolean).length !== 1)
|
|
63
|
+
throw new Error('choose_exactly_one_recovery_mode');
|
|
64
|
+
const path = platformPath(options.manifest);
|
|
65
|
+
const pool = `${path}.proofs`;
|
|
66
|
+
await inspectRecoveryDirectory(dirname(path), true);
|
|
67
|
+
const commonDir = await realpath(await resolveGitCommonDir(deps.cwd));
|
|
68
|
+
let manifest;
|
|
69
|
+
let material;
|
|
70
|
+
let manifestSha;
|
|
71
|
+
if (options.preview) {
|
|
72
|
+
if (options.manifestSha256 || Boolean(options.selection) === Boolean(options.adoptManifest) || Boolean(options.adoptManifest) !== Boolean(options.adoptManifestSha256))
|
|
73
|
+
throw new Error('preview_requires_selection_or_adoption');
|
|
74
|
+
if (await exists(path) || await exists(`${path}.material`))
|
|
75
|
+
throw new Error('manifest_already_exists');
|
|
76
|
+
const oldPath = options.adoptManifest ? platformPath(options.adoptManifest) : undefined;
|
|
77
|
+
const oldRaw = oldPath ? await readStable(oldPath, MAX_RECOVERY_DOCUMENT_BYTES) : undefined;
|
|
78
|
+
if (oldRaw && oldRaw.sha256 !== options.adoptManifestSha256)
|
|
79
|
+
throw new Error('manifest_digest_mismatch');
|
|
80
|
+
const oldManifest = oldRaw ? manifestSchema.parse(decode(oldRaw.text)) : undefined;
|
|
81
|
+
if (oldManifest && oldManifest.gitCommonDir !== commonDir)
|
|
82
|
+
throw new Error('native_repository_conflict');
|
|
83
|
+
const selection = oldManifest?.selection ?? publicClaimSelectionSchema.parse(decodeOriginalReport((await readStable(platformPath(options.selection), MAX_RECOVERY_DOCUMENT_BYTES)).text, { exactNumbers: true }).value);
|
|
84
|
+
const native = await loadConvergeRunStateEvidence(commonDir, selection.source.target);
|
|
85
|
+
if (!native)
|
|
86
|
+
throw new Error('native_target_unavailable');
|
|
87
|
+
const nativeRaw = await readStable(convergeRunStatePath(commonDir, selection.source.target), MAX_MATERIAL);
|
|
88
|
+
if (nativeRaw.sha256 !== native.sha256)
|
|
89
|
+
throw new Error('native_source_changed');
|
|
90
|
+
const ancestors = await readNativeRecoverySourceJsons(commonDir, native.state);
|
|
91
|
+
stage = 'remote';
|
|
92
|
+
const sink = await openSink(deps, requestBudget);
|
|
93
|
+
if (!sink)
|
|
94
|
+
return 3;
|
|
95
|
+
const read = await readClaimTargetHistory(sink, selection.source);
|
|
96
|
+
if (read.kind !== 'ok')
|
|
97
|
+
throw new Error('claim_history_unanswered');
|
|
98
|
+
const history = claimHistoryContent(read.value);
|
|
99
|
+
if (selection.action === 'split' && !oldManifest)
|
|
100
|
+
assertUnusedClaimIdentity(history, selection.identity);
|
|
101
|
+
material = { nativeJson: nativeRaw.text, nativeSourceJsons: ancestors, recoveryMaterials: await readNativeRecoveryMaterials(commonDir, native.state), history };
|
|
102
|
+
const carriers = claimCarriers(history, selection);
|
|
103
|
+
if (!carriers.length)
|
|
104
|
+
throw new Error('claim_carrier_unavailable');
|
|
105
|
+
if (selection.action === 'disposition' && !selection.disposition || selection.action === 'refresh' && selection.disposition)
|
|
106
|
+
throw new Error('claim_action_disposition_conflict');
|
|
107
|
+
let stages = [...(selection.action === 'split' ? [{ id: randomUUID(), kind: 'split' }, ...carriers.map((_, carrierIndex) => ({ id: randomUUID(), kind: 'transfer', carrierIndex }))] : []),
|
|
108
|
+
...(selection.disposition ? [{ id: randomUUID(), kind: 'disposition' }] : [])];
|
|
109
|
+
const createdAt = new Date().toISOString();
|
|
110
|
+
if (oldManifest) {
|
|
111
|
+
if (oldManifest.nativeSha256 !== nativeRaw.sha256)
|
|
112
|
+
throw new Error('native_source_changed');
|
|
113
|
+
const adoption = await prepareClaimAdoption({ path: oldPath, manifest: oldManifest, manifestSha: oldRaw.sha256, current: history, stages, sink, validate: validatePreparation, splitEvidence });
|
|
114
|
+
material.adoption = adoption.proof;
|
|
115
|
+
stages = adoption.stages;
|
|
116
|
+
}
|
|
117
|
+
const adoptedSplit = stages[0]?.kind === 'split' ? material.adoption?.accepted.find(s => s.id === stages[0]?.id) : undefined;
|
|
118
|
+
const prepared = adoptedSplit ? prepareClaimSplit(adoptedSplit.preparation) : selection.action === 'split' ? prepareClaimSplit(splitInput(selection, material, { stages, createdAt }, history)) :
|
|
119
|
+
prepareClaimSplit(existingSplit(selection, material, history).selection);
|
|
120
|
+
if (adoptedSplit && selection.disposition && !material.adoption?.accepted.some(a => a.id === stages.at(-1)?.id))
|
|
121
|
+
prepareClaimDisposition(dispositionInput(selection, history, splitEvidence(material, selection, adoptedSplit.preparation, adoptedSplit.receipt), stages.at(-1).id, createdAt, history.actorUserId));
|
|
122
|
+
else if (!adoptedSplit)
|
|
123
|
+
validateDispositionIntent(selection, history, stages.at(-1)?.id, material, createdAt);
|
|
124
|
+
const preview = {
|
|
125
|
+
source: prepared.source, newIdentity: selection.identity, carriers: carriers.map(carrier => projectOccurrenceCarrier({
|
|
126
|
+
carrier,
|
|
127
|
+
inventoryStatus: 'complete', sources: history.sources, transfers: [], nativePredecessors: [{ sourceJson: material.nativeJson, nativeSourceJsons: ancestors }]
|
|
128
|
+
})),
|
|
129
|
+
disposition: selection.disposition ?? null, legacyVerdicts: 'retained without inherited semantic approval', accounting: 'unchanged; same target and rounds',
|
|
130
|
+
...(material.adoption ? { adoption: { previous_manifest: oldPath, previous_manifest_sha256: oldRaw.sha256, accepted_event_ids: material.adoption.accepted.map(a => a.id), replacements: material.adoption.replacements } } : {})
|
|
131
|
+
};
|
|
132
|
+
if ((await readStable(convergeRunStatePath(commonDir, selection.source.target), MAX_MATERIAL)).sha256 !== nativeRaw.sha256)
|
|
133
|
+
throw new Error('native_source_changed');
|
|
134
|
+
stage = 'journal';
|
|
135
|
+
await writeClaimProof(`${path}.material`, pool, material);
|
|
136
|
+
const stored = await readStable(`${path}.material`, MAX_MATERIAL);
|
|
137
|
+
manifest = {
|
|
138
|
+
kind: 'rcl-public-claim-recovery', version: material.adoption ? 3 : 2, operationId: randomUUID(), createdAt, rclVersion: deps.rclVersion, gitCommonDir: commonDir,
|
|
139
|
+
selection, actorUserId: history.actorUserId, materialSha256: stored.sha256, nativeSha256: nativeRaw.sha256, stages, preview
|
|
140
|
+
};
|
|
141
|
+
await writeExclusive(path, manifest, MAX_RECOVERY_DOCUMENT_BYTES);
|
|
142
|
+
manifestSha = (await readStable(path, MAX_RECOVERY_DOCUMENT_BYTES)).sha256;
|
|
143
|
+
deps.stdout(JSON.stringify({ status: 'prepared', manifest: path, manifest_sha256: manifestSha, operation_id: manifest.operationId, preview }));
|
|
144
|
+
return 0;
|
|
145
|
+
}
|
|
146
|
+
if (options.selection || options.adoptManifest || options.adoptManifestSha256 || !options.manifestSha256)
|
|
147
|
+
throw new Error('apply_requires_exact_manifest');
|
|
148
|
+
const retained = await readStable(path, MAX_RECOVERY_DOCUMENT_BYTES);
|
|
149
|
+
if (retained.sha256 !== options.manifestSha256)
|
|
150
|
+
throw new Error('manifest_digest_mismatch');
|
|
151
|
+
manifest = manifestSchema.parse(decode(retained.text));
|
|
152
|
+
manifestSha = retained.sha256;
|
|
153
|
+
if (manifest.gitCommonDir !== commonDir)
|
|
154
|
+
throw new Error('native_repository_conflict');
|
|
155
|
+
const rawMaterial = await readStable(`${path}.material`, MAX_MATERIAL);
|
|
156
|
+
if (rawMaterial.sha256 !== manifest.materialSha256)
|
|
157
|
+
throw new Error('claim_material_changed');
|
|
158
|
+
material = await readClaimProof(`${path}.material`, pool);
|
|
159
|
+
if (sha256(material.nativeJson) !== manifest.nativeSha256)
|
|
160
|
+
throw new Error('native_source_conflict');
|
|
161
|
+
const selection = manifest.selection;
|
|
162
|
+
if (Boolean(material.adoption) !== (manifest.version === 3))
|
|
163
|
+
throw new Error('claim_adoption_version_conflict');
|
|
164
|
+
if (material.adoption)
|
|
165
|
+
await verifyAdoptionFiles(material.adoption);
|
|
166
|
+
const adoptedSplit = manifest.stages[0]?.kind === 'split' ? material.adoption?.accepted.find(s => s.id === manifest.stages[0]?.id) : undefined;
|
|
167
|
+
if (selection.action === 'split' && !adoptedSplit)
|
|
168
|
+
assertUnusedClaimIdentity(material.history, selection.identity);
|
|
169
|
+
const carriers = claimCarriers(material.history, selection);
|
|
170
|
+
const expectedKinds = [...(selection.action === 'split' ? ['split', ...carriers.map(() => 'transfer')] : []), ...(selection.disposition ? ['disposition'] : [])];
|
|
171
|
+
if (!isDeepStrictEqual(manifest.stages.map(s => s.kind), expectedKinds) || new Set(manifest.stages.map(s => s.id)).size !== manifest.stages.length ||
|
|
172
|
+
selection.action === 'split' && carriers.some((_, i) => manifest.stages[i + 1].carrierIndex !== i))
|
|
173
|
+
throw new Error('claim_manifest_stage_conflict');
|
|
174
|
+
if (!adoptedSplit)
|
|
175
|
+
validateDispositionIntent(selection, material.history, manifest.stages.at(-1)?.id, material, manifest.createdAt);
|
|
176
|
+
// Re-prove the pinned original before acquiring authority or contacting HTTP.
|
|
177
|
+
if (selection.action === 'split')
|
|
178
|
+
prepareClaimSplit(adoptedSplit ? adoptedSplit.preparation : splitInput(selection, material, manifest, material.history));
|
|
179
|
+
else
|
|
180
|
+
existingSplit(selection, material, material.history);
|
|
181
|
+
stage = 'remote';
|
|
182
|
+
const sink = await openSink(deps, requestBudget);
|
|
183
|
+
if (!sink)
|
|
184
|
+
return 3;
|
|
185
|
+
const output = await withRecoveryTarget(commonDir, selection.source.target, async (ownership) => {
|
|
186
|
+
stage = 'journal';
|
|
187
|
+
const journal = await openJournal(`${path}.journal`, manifestSha, manifest.operationId, options.apply ? 'apply' : 'resume', deps.beforeCheckpoint);
|
|
188
|
+
const owned = new Map(material.adoption?.accepted.map(a => [a.id, a.eventJson]));
|
|
189
|
+
// Existing packets are immutable and are the only receipts permitted to
|
|
190
|
+
// extend the preview. Never regenerate a payload after uncertain delivery.
|
|
191
|
+
for (const item of manifest.stages) {
|
|
192
|
+
const packetPath = `${path}.${item.id}.packet`;
|
|
193
|
+
if (await exists(packetPath)) {
|
|
194
|
+
const packet = decode((await readStable(packetPath, MAX_RECOVERY_DOCUMENT_BYTES)).text);
|
|
195
|
+
owned.set(item.id, packet.event_json);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
let history = material.history;
|
|
199
|
+
let historyToken;
|
|
200
|
+
const fresh = async () => {
|
|
201
|
+
if ((await readStable(path, MAX_RECOVERY_DOCUMENT_BYTES)).sha256 !== manifestSha ||
|
|
202
|
+
(await readStable(`${path}.material`, MAX_MATERIAL)).sha256 !== manifest.materialSha256)
|
|
203
|
+
throw new Error('claim_manifest_changed');
|
|
204
|
+
if (material.adoption) {
|
|
205
|
+
await verifyAdoptionFiles(material.adoption);
|
|
206
|
+
await verifyReplacedAbsence(material.adoption, sink);
|
|
207
|
+
}
|
|
208
|
+
const read = await readClaimTargetHistory(sink, selection.source, manifest.actorUserId);
|
|
209
|
+
if (read.kind !== 'ok')
|
|
210
|
+
throw new Error('claim_history_unanswered');
|
|
211
|
+
const current = claimHistoryContent(read.value);
|
|
212
|
+
assertHistoryExtension(material.history, current, owned);
|
|
213
|
+
for (const h of current.histories)
|
|
214
|
+
for (const receipt of h.receipts) {
|
|
215
|
+
const event = owned.get(receipt.id);
|
|
216
|
+
if (event &&
|
|
217
|
+
!matchesPreparedEventReceipt(receipt, event, { ...selection.source.scope, run_id: h.runId }, manifest.actorUserId))
|
|
218
|
+
throw new Error('claim_receipt_conflict');
|
|
219
|
+
}
|
|
220
|
+
history = current;
|
|
221
|
+
historyToken = read.value;
|
|
222
|
+
};
|
|
223
|
+
await fresh();
|
|
224
|
+
const stateBefore = await readStable(convergeRunStatePath(commonDir, selection.source.target), MAX_MATERIAL);
|
|
225
|
+
const savedPlanPath = `${path}.native-plan`;
|
|
226
|
+
if (stateBefore.sha256 !== manifest.nativeSha256 && !(await exists(savedPlanPath)))
|
|
227
|
+
throw new Error('native_source_changed');
|
|
228
|
+
const transfers = [];
|
|
229
|
+
const dispositions = [];
|
|
230
|
+
let acceptedSplit = selection.action === 'split' ? undefined : existingSplit(selection, material, history);
|
|
231
|
+
for (const item of manifest.stages) {
|
|
232
|
+
stage = 'remote';
|
|
233
|
+
await fresh();
|
|
234
|
+
const inputPath = `${path}.${item.id}.input`;
|
|
235
|
+
let preparation;
|
|
236
|
+
const inputExists = await exists(inputPath);
|
|
237
|
+
const adopted = material.adoption?.accepted.find(a => a.id === item.id);
|
|
238
|
+
if (adopted) {
|
|
239
|
+
preparation = adopted.preparation;
|
|
240
|
+
if (inputExists && !isDeepStrictEqual(await readClaimProof(inputPath, pool), preparation))
|
|
241
|
+
throw new Error('claim_preparation_conflict');
|
|
242
|
+
}
|
|
243
|
+
else if (inputExists)
|
|
244
|
+
preparation = await readClaimProof(inputPath, pool);
|
|
245
|
+
else if (item.kind === 'split')
|
|
246
|
+
preparation = splitInput(selection, material, manifest, history);
|
|
247
|
+
else {
|
|
248
|
+
if (!acceptedSplit)
|
|
249
|
+
throw new Error('claim_split_receipt_missing');
|
|
250
|
+
const common = { eventId: item.id, occurredAt: manifest.createdAt, actorUserId: manifest.actorUserId, split: acceptedSplit, sourceContext: historyContext(history, selection.source) };
|
|
251
|
+
if (item.kind === 'transfer') {
|
|
252
|
+
const carrier = carriers[item.carrierIndex];
|
|
253
|
+
preparation = { ...common, carrier: historySource(history, carrier), carrierContext: historyContext(history, carrier), carrierKind: carrier.kind, carrierIdentity: carrier.identity, reason: selection.reason };
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
preparation = dispositionInput(selection, history, acceptedSplit, item.id, manifest.createdAt, manifest.actorUserId);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
validatePreparation(manifest, material, adopted?.validationStage ?? item, preparation, adopted?.history ?? history, acceptedSplit, adopted?.createdAt ?? manifest.createdAt);
|
|
260
|
+
const event = item.kind === 'split' ? prepareClaimSplit(preparation).event :
|
|
261
|
+
item.kind === 'transfer' ? prepareObligationTransfer(preparation).event : prepareClaimDisposition(preparation).event;
|
|
262
|
+
const eventJson = JSON.stringify(event);
|
|
263
|
+
if (adopted && eventJson !== adopted.eventJson)
|
|
264
|
+
throw new Error('claim_adoption_event_conflict');
|
|
265
|
+
const packetPath = `${path}.${item.id}.packet`;
|
|
266
|
+
if (!inputExists)
|
|
267
|
+
await writeClaimProof(inputPath, pool, preparation);
|
|
268
|
+
owned.set(item.id, eventJson);
|
|
269
|
+
const receipt = await deliverPreparedClaimEvent({
|
|
270
|
+
gitCommonDir: commonDir, target: selection.source.target, ownership,
|
|
271
|
+
operationId: manifest.operationId, manifestSha256: manifestSha, packetPath, mode: await exists(packetPath) ? 'resume' : 'apply',
|
|
272
|
+
scope: { ...selection.source.scope, run_id: event.run_id }, actor: manifest.actorUserId, eventJson, sink, journal, verifyContext: fresh, allowPost: !adopted
|
|
273
|
+
});
|
|
274
|
+
if (item.kind === 'split') {
|
|
275
|
+
const p = preparation;
|
|
276
|
+
acceptedSplit = {
|
|
277
|
+
selection: p, receipt, actorUserId: manifest.actorUserId,
|
|
278
|
+
source: historySource(history, selection.source), native: {
|
|
279
|
+
sourceJson: material.nativeJson, target: selection.source.target, nativeSourceJsons: material.nativeSourceJsons, recoveryMaterials: material.recoveryMaterials,
|
|
280
|
+
reports: nativeReports(material)
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
else if (item.kind === 'transfer')
|
|
285
|
+
transfers.push({ preparation: preparation, receipt, actorUserId: manifest.actorUserId });
|
|
286
|
+
else
|
|
287
|
+
dispositions.push({ preparation: preparation, receipt, actorUserId: manifest.actorUserId });
|
|
288
|
+
}
|
|
289
|
+
await fresh();
|
|
290
|
+
if (!acceptedSplit)
|
|
291
|
+
throw new Error('claim_split_receipt_missing');
|
|
292
|
+
let projectionVersion = 2;
|
|
293
|
+
if (await exists(savedPlanPath)) {
|
|
294
|
+
const saved = await readClaimProof(savedPlanPath, pool);
|
|
295
|
+
if (!saved.currentHistory || !sameClaimHistoryEvidence(saved.currentHistory, history))
|
|
296
|
+
throw new Error('native_plan_history_changed');
|
|
297
|
+
projectionVersion = nativeRecoveryPlanProjectionVersion(saved);
|
|
298
|
+
history = { ...history, readWindow: saved.currentHistory.readWindow };
|
|
299
|
+
}
|
|
300
|
+
const input = {
|
|
301
|
+
sourceJson: material.nativeJson, externalMaterial: true, recoveryMaterials: material.recoveryMaterials, currentHistory: history, nativeSourceJsons: material.nativeSourceJsons, target: selection.source.target, operationId: manifest.operationId,
|
|
302
|
+
anchors: selection.action === 'split' ? [correctionAnchor(acceptedSplit.selection, acceptedSplit.receipt, manifest.actorUserId, manifest.operationId)] : [], reports: selection.action === 'split' ? [acceptedSplit.source.reportJson] : [],
|
|
303
|
+
sourceReceipts: selection.action === 'split' ? acceptedSplit.selection.sourceReceipts : [], transfers, dispositions, carriers: carriers.map(carrier => ({ carrier, inventoryStatus: 'complete', sources: history.sources }))
|
|
304
|
+
};
|
|
305
|
+
const plan = deriveNativeRecovery(input, projectionVersion);
|
|
306
|
+
if (await exists(savedPlanPath)) {
|
|
307
|
+
if (!isDeepStrictEqual(await readClaimProof(savedPlanPath, pool), plan))
|
|
308
|
+
throw new Error('native_plan_conflict');
|
|
309
|
+
}
|
|
310
|
+
else
|
|
311
|
+
await writeClaimProof(savedPlanPath, pool, plan);
|
|
312
|
+
await journal.append('claim_native_intent', { source_sha256: plan.sourceSha256, result_sha256: plan.resultSha256 });
|
|
313
|
+
await fresh();
|
|
314
|
+
const result = await applyNativeRecovery({ gitCommonDir: commonDir, plan, ownership, history: historyToken });
|
|
315
|
+
await journal.append('claim_native_verified', result);
|
|
316
|
+
return {
|
|
317
|
+
status: 'acknowledged', operation_id: manifest.operationId, native: result, actionable_identities: plan.actionableIdentities,
|
|
318
|
+
accounting: 'rounds, attempts and original findings unchanged', projection_freshness: { read_window: plan.currentHistory?.readWindow, qualification: 'authenticated snapshot; not current server approval' }, receipt_ids: manifest.stages.map(s => s.id)
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
deps.stdout(JSON.stringify(output));
|
|
322
|
+
return 0;
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
deps.stdout(JSON.stringify({ status: 'refused', reason: errorCode(error), stage }));
|
|
326
|
+
return stage === 'input' ? 2 : stage === 'journal' ? 5 : 4;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function nativeReports(material) {
|
|
330
|
+
const states = [material.nativeJson, ...material.nativeSourceJsons].map(s => decode(s));
|
|
331
|
+
const digests = new Set();
|
|
332
|
+
for (const state of states) {
|
|
333
|
+
for (const round of state.rounds ?? [])
|
|
334
|
+
if (round.reportBinding?.reportSha256)
|
|
335
|
+
digests.add(round.reportBinding.reportSha256);
|
|
336
|
+
for (const op of state.recovery?.operations ?? [])
|
|
337
|
+
for (const anchor of op.anchors ?? [])
|
|
338
|
+
digests.add(anchor.source.reportSha256);
|
|
339
|
+
}
|
|
340
|
+
return [...digests].map(digest => {
|
|
341
|
+
const source = material.history.sources.find(s => s.selector.reportSha256 === digest);
|
|
342
|
+
if (!source?.reportJson)
|
|
343
|
+
throw new Error('native_original_report_unavailable');
|
|
344
|
+
return source.reportJson;
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
function existingSplit(selection, material, history) {
|
|
348
|
+
const state = decode(material.nativeJson);
|
|
349
|
+
const candidates = recoveryAnchors(state).filter(a => a.identity === selection.identity);
|
|
350
|
+
if (candidates.length !== 1)
|
|
351
|
+
throw new Error('existing_claim_anchor_unavailable');
|
|
352
|
+
const anchor = candidates[0];
|
|
353
|
+
if (anchor.source.findingRef !== selection.findingRef || anchor.source.previousIdentity !== selection.previousIdentity ||
|
|
354
|
+
anchor.source.reportSha256 !== selection.source.reportSha256 || anchor.source.runId !== selection.source.scope.run_id ||
|
|
355
|
+
!isDeepStrictEqual(anchor.descriptor, selection.descriptor) || !isDeepStrictEqual(anchor.destination, selection.source.scope))
|
|
356
|
+
throw new Error('existing_claim_anchor_conflict');
|
|
357
|
+
const receipt = history.histories.flatMap(h => h.receipts).find(r => r.id === anchor.receipt.id);
|
|
358
|
+
if (!receipt || !isDeepStrictEqual(receipt, anchor.receipt) || !receipt.actor_user_id)
|
|
359
|
+
throw new Error('existing_claim_receipt_unavailable');
|
|
360
|
+
const snapshotMap = new Map([material.nativeJson, ...material.nativeSourceJsons].map(text => [sha256(text), text]));
|
|
361
|
+
const nativeJson = snapshotMap.get(anchor.nativeSource.sha256);
|
|
362
|
+
if (!nativeJson)
|
|
363
|
+
throw new Error('existing_claim_native_source_unavailable');
|
|
364
|
+
const snapshots = [];
|
|
365
|
+
let sourceState = decode(nativeJson);
|
|
366
|
+
const seen = new Set();
|
|
367
|
+
for (;;) {
|
|
368
|
+
const digest = sourceState.version === 3 ? sourceState.recovery?.operations?.at(-1)?.sourceSha256 : sourceState.version === 2 ? sourceState.migration?.sourceSha256 : undefined;
|
|
369
|
+
if (!digest)
|
|
370
|
+
break;
|
|
371
|
+
const text = snapshotMap.get(digest);
|
|
372
|
+
if (!text || seen.has(digest))
|
|
373
|
+
throw new Error('existing_claim_native_source_unavailable');
|
|
374
|
+
seen.add(digest);
|
|
375
|
+
snapshots.push(text);
|
|
376
|
+
sourceState = decode(text);
|
|
377
|
+
}
|
|
378
|
+
const event = decode(anchor.eventJson);
|
|
379
|
+
const payload = event.payload;
|
|
380
|
+
const source = historySource(history, selection.source);
|
|
381
|
+
const eventIds = payload.source_event_ids;
|
|
382
|
+
const sourceReceipts = eventIds.map(id => {
|
|
383
|
+
const r = history.histories.flatMap(h => h.receipts).find(r => r.id === id);
|
|
384
|
+
if (!r)
|
|
385
|
+
throw new Error('existing_claim_receipt_unavailable');
|
|
386
|
+
return r;
|
|
387
|
+
});
|
|
388
|
+
const input = {
|
|
389
|
+
scope: anchor.destination, target: selection.source.target, eventId: event.id, occurredAt: event.occurred_at, nativeJson, nativeSourceJsons: snapshots,
|
|
390
|
+
recoveryMaterials: material.recoveryMaterials, reportJson: source.reportJson, findingRef: selection.findingRef, previousIdentity: selection.previousIdentity,
|
|
391
|
+
identity: selection.identity, descriptor: selection.descriptor, reason: payload.reason, expectedEventSequence: payload.expected_event_sequence,
|
|
392
|
+
classificationId: eventIds[0], ...(eventIds[1] ? { correctionId: eventIds[1] } : {}), sourceReceipts
|
|
393
|
+
};
|
|
394
|
+
if (!isDeepStrictEqual(correctionAnchor(input, receipt, receipt.actor_user_id, anchor.operationId), anchor))
|
|
395
|
+
throw new Error('existing_claim_anchor_conflict');
|
|
396
|
+
const oldMaterial = { ...material, nativeJson, nativeSourceJsons: snapshots };
|
|
397
|
+
return {
|
|
398
|
+
selection: input, receipt, actorUserId: receipt.actor_user_id, source, native: {
|
|
399
|
+
sourceJson: nativeJson, nativeSourceJsons: snapshots,
|
|
400
|
+
recoveryMaterials: material.recoveryMaterials, target: selection.source.target, reports: nativeReports(oldMaterial)
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
function validateDispositionIntent(selection, history, eventId, material, occurredAt) {
|
|
405
|
+
const request = selection.disposition;
|
|
406
|
+
if (!request)
|
|
407
|
+
return;
|
|
408
|
+
if (!isDeepStrictEqual(scrubDeep(request), request))
|
|
409
|
+
throw new Error('claim_disposition_redaction_conflict');
|
|
410
|
+
const source = validateOccurrenceSource(historySource(history, selection.source));
|
|
411
|
+
const member = source.members.find(m => m.ref === selection.findingRef);
|
|
412
|
+
if (!member || member.unresolvedReason)
|
|
413
|
+
throw new Error('claim_original_mapping_unavailable');
|
|
414
|
+
if (request.mode === 'fresh' && request.originalVerdictEventId)
|
|
415
|
+
throw new Error('fresh_disposition_has_original_verdict');
|
|
416
|
+
if (selection.action !== 'split') {
|
|
417
|
+
prepareClaimDisposition(dispositionInput(selection, history, existingSplit(selection, material, history), eventId, occurredAt, history.actorUserId));
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (member.severity === 'critical' && member.gating !== 'none' && request.severity !== 'critical')
|
|
421
|
+
throw new Error('claim_critical_disposition_required');
|
|
422
|
+
if (request.mode === 'fresh')
|
|
423
|
+
return;
|
|
424
|
+
const receipt = history.histories.find(h => h.runId === selection.source.scope.run_id)?.receipts.find(r => r.id === request.originalVerdictEventId);
|
|
425
|
+
validatePreservedDispositionSubject({
|
|
426
|
+
source, member, descriptor: selection.descriptor, eventId: eventId, verdict: request.verdict,
|
|
427
|
+
severity: request.severity, reason: request.reason, originalVerdict: receipt, originalVerdictActorUserId: receipt?.actor_user_id ?? undefined
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
function dispositionInput(selection, history, split, eventId, occurredAt, actorUserId) {
|
|
431
|
+
const request = selection.disposition;
|
|
432
|
+
const rows = claimRunHistory(history, selection.source).receipts;
|
|
433
|
+
const prior = rows.filter(r => r.kind === 'finding_claim_disposition' && r.payload.claim_identity === selection.identity).at(-1);
|
|
434
|
+
const original = request.originalVerdictEventId ? rows.find(r => r.id === request.originalVerdictEventId) : undefined;
|
|
435
|
+
return {
|
|
436
|
+
eventId, occurredAt, actorUserId, split, sourceContext: historyContext(history, selection.source),
|
|
437
|
+
mode: request.mode, verdict: request.verdict, severity: request.severity, reason: request.reason,
|
|
438
|
+
previousDispositionEventId: prior?.id ?? null, ...(prior ? { previousDisposition: prior } : {}),
|
|
439
|
+
...(original ? { originalVerdict: original, originalVerdictActorUserId: original.actor_user_id ?? undefined } : {}),
|
|
440
|
+
laterSources: history.sources.filter(s => s.selector.round > selection.source.round).flatMap(s => {
|
|
441
|
+
let source;
|
|
442
|
+
try {
|
|
443
|
+
source = historySource(history, s.selector);
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
return [];
|
|
447
|
+
}
|
|
448
|
+
return validateOccurrenceSource(source).members.some(m => m.identity === selection.identity) ? [source] : [];
|
|
449
|
+
})
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
function validatePreparation(manifest, material, item, preparation, history, acceptedSplit, createdAt = manifest.createdAt) {
|
|
453
|
+
const selection = manifest.selection;
|
|
454
|
+
const carriers = claimCarriers(history, selection);
|
|
455
|
+
if (preparation.eventId !== item.id || preparation.occurredAt !== createdAt)
|
|
456
|
+
throw new Error('claim_preparation_conflict');
|
|
457
|
+
if (item.kind === 'split') {
|
|
458
|
+
const p = preparation;
|
|
459
|
+
const expected = splitInput(selection, material, { ...manifest, createdAt }, history);
|
|
460
|
+
if (!isDeepStrictEqual({ ...p, expectedEventSequence: expected.expectedEventSequence }, expected))
|
|
461
|
+
throw new Error('claim_preparation_conflict');
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
const p = preparation;
|
|
465
|
+
if (!isDeepStrictEqual(p.split, acceptedSplit) || p.actorUserId !== manifest.actorUserId ||
|
|
466
|
+
!isDeepStrictEqual({ ...p.sourceContext, eventSequence: 0 }, { ...historyContext(history, selection.source), eventSequence: 0 }))
|
|
467
|
+
throw new Error('claim_preparation_conflict');
|
|
468
|
+
if (item.kind === 'transfer') {
|
|
469
|
+
const t = p;
|
|
470
|
+
const carrier = carriers[item.carrierIndex];
|
|
471
|
+
if (t.reason !== selection.reason || t.carrierKind !== carrier.kind || t.carrierIdentity !== carrier.identity ||
|
|
472
|
+
!isDeepStrictEqual(t.carrier, historySource(history, carrier)) || !isDeepStrictEqual({ ...t.carrierContext, eventSequence: 0 }, { ...historyContext(history, carrier), eventSequence: 0 }))
|
|
473
|
+
throw new Error('claim_preparation_conflict');
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
const d = p;
|
|
477
|
+
const request = selection.disposition;
|
|
478
|
+
if (d.mode !== request.mode || d.verdict !== request.verdict || d.severity !== request.severity || d.reason !== request.reason ||
|
|
479
|
+
(d.originalVerdict?.id ?? null) !== (request.originalVerdictEventId ?? null))
|
|
480
|
+
throw new Error('claim_preparation_conflict');
|
|
481
|
+
const rows = history.histories.find(h => h.runId === selection.source.scope.run_id).receipts;
|
|
482
|
+
const prior = rows.filter(r => r.kind === 'finding_claim_disposition' && r.payload.claim_identity === selection.identity &&
|
|
483
|
+
r.sequence <= d.sourceContext.eventSequence).at(-1);
|
|
484
|
+
const original = request.originalVerdictEventId ? rows.find(r => r.id === request.originalVerdictEventId) : undefined;
|
|
485
|
+
const later = history.sources.filter(s => s.selector.round > selection.source.round).flatMap(s => {
|
|
486
|
+
let source;
|
|
487
|
+
try {
|
|
488
|
+
source = historySource(history, s.selector);
|
|
489
|
+
}
|
|
490
|
+
catch {
|
|
491
|
+
return [];
|
|
492
|
+
}
|
|
493
|
+
return validateOccurrenceSource(source).members.some(m => m.identity === selection.identity) ? [source] : [];
|
|
494
|
+
});
|
|
495
|
+
if (d.previousDispositionEventId !== (prior?.id ?? null) || !isDeepStrictEqual(d.previousDisposition, prior) ||
|
|
496
|
+
!isDeepStrictEqual(d.originalVerdict, original) || !isDeepStrictEqual(d.laterSources ?? [], later))
|
|
497
|
+
throw new Error('claim_preparation_conflict');
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function splitEvidence(material, selection, p, receipt) {
|
|
502
|
+
return { selection: p, receipt, actorUserId: material.history.actorUserId, source: historySource(material.history, selection.source), native: { sourceJson: material.nativeJson, target: selection.source.target, nativeSourceJsons: material.nativeSourceJsons, recoveryMaterials: material.recoveryMaterials, reports: nativeReports(material) } };
|
|
503
|
+
}
|
|
504
|
+
//# sourceMappingURL=recover-claim.js.map
|