audit-tools 0.30.3 → 0.30.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.
Files changed (145) hide show
  1. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  2. package/dist/audit/cli/auditStep.js +24 -13
  3. package/dist/audit/cli/auditStep.js.map +1 -1
  4. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  5. package/dist/audit/cli/nextStepHelpers.js +11 -6
  6. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  7. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  8. package/dist/audit/cli/reviewRun.js +9 -4
  9. package/dist/audit/cli/reviewRun.js.map +1 -1
  10. package/dist/audit/contracts/schemaEnforcedEmit.d.ts +75 -0
  11. package/dist/audit/contracts/schemaEnforcedEmit.d.ts.map +1 -0
  12. package/dist/audit/contracts/schemaEnforcedEmit.js +131 -0
  13. package/dist/audit/contracts/schemaEnforcedEmit.js.map +1 -0
  14. package/dist/audit/contracts/workerSchemas.d.ts +22 -4
  15. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  16. package/dist/audit/contracts/wrapperResponse.d.ts +18 -18
  17. package/dist/audit/extractors/analyzers/acquisitionEngine.d.ts +140 -0
  18. package/dist/audit/extractors/analyzers/acquisitionEngine.d.ts.map +1 -0
  19. package/dist/audit/extractors/analyzers/acquisitionEngine.js +262 -0
  20. package/dist/audit/extractors/analyzers/acquisitionEngine.js.map +1 -0
  21. package/dist/audit/extractors/analyzers/registry.d.ts +2 -0
  22. package/dist/audit/extractors/analyzers/registry.d.ts.map +1 -1
  23. package/dist/audit/extractors/analyzers/registry.js +5 -0
  24. package/dist/audit/extractors/analyzers/registry.js.map +1 -1
  25. package/dist/audit/extractors/gitHistory.d.ts +46 -0
  26. package/dist/audit/extractors/gitHistory.d.ts.map +1 -0
  27. package/dist/audit/extractors/gitHistory.js +97 -0
  28. package/dist/audit/extractors/gitHistory.js.map +1 -0
  29. package/dist/audit/extractors/graph.d.ts +19 -1
  30. package/dist/audit/extractors/graph.d.ts.map +1 -1
  31. package/dist/audit/extractors/graph.js +31 -0
  32. package/dist/audit/extractors/graph.js.map +1 -1
  33. package/dist/audit/extractors/risk.d.ts +16 -0
  34. package/dist/audit/extractors/risk.d.ts.map +1 -1
  35. package/dist/audit/extractors/risk.js +28 -0
  36. package/dist/audit/extractors/risk.js.map +1 -1
  37. package/dist/audit/io/artifacts.d.ts +3 -1
  38. package/dist/audit/io/artifacts.d.ts.map +1 -1
  39. package/dist/audit/io/artifacts.js +1 -0
  40. package/dist/audit/io/artifacts.js.map +1 -1
  41. package/dist/audit/orchestrator/artifactFreshness.d.ts +2 -1
  42. package/dist/audit/orchestrator/artifactFreshness.d.ts.map +1 -1
  43. package/dist/audit/orchestrator/artifactFreshness.js +5 -15
  44. package/dist/audit/orchestrator/artifactFreshness.js.map +1 -1
  45. package/dist/audit/orchestrator/artifactMetadata.d.ts.map +1 -1
  46. package/dist/audit/orchestrator/artifactMetadata.js +24 -3
  47. package/dist/audit/orchestrator/artifactMetadata.js.map +1 -1
  48. package/dist/audit/orchestrator/dependencyMap.d.ts +7 -0
  49. package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
  50. package/dist/audit/orchestrator/dependencyMap.js +5 -1
  51. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  52. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  53. package/dist/audit/orchestrator/executorRunners.js +10 -9
  54. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  55. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  56. package/dist/audit/orchestrator/ingestionExecutors.js +5 -1
  57. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  58. package/dist/audit/orchestrator/intentCheckpointGate.d.ts +129 -0
  59. package/dist/audit/orchestrator/intentCheckpointGate.d.ts.map +1 -0
  60. package/dist/audit/orchestrator/intentCheckpointGate.js +193 -0
  61. package/dist/audit/orchestrator/intentCheckpointGate.js.map +1 -0
  62. package/dist/audit/orchestrator/ledger.d.ts +30 -0
  63. package/dist/audit/orchestrator/ledger.d.ts.map +1 -0
  64. package/dist/audit/orchestrator/ledger.js +126 -0
  65. package/dist/audit/orchestrator/ledger.js.map +1 -0
  66. package/dist/audit/orchestrator/nextStep.d.ts +11 -29
  67. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  68. package/dist/audit/orchestrator/nextStep.js +11 -29
  69. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  70. package/dist/audit/orchestrator/resultBaseline.d.ts +136 -0
  71. package/dist/audit/orchestrator/resultBaseline.d.ts.map +1 -0
  72. package/dist/audit/orchestrator/resultBaseline.js +138 -0
  73. package/dist/audit/orchestrator/resultBaseline.js.map +1 -0
  74. package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
  75. package/dist/audit/orchestrator/staleness.js +25 -1
  76. package/dist/audit/orchestrator/staleness.js.map +1 -1
  77. package/dist/audit/quota/index.d.ts +32 -32
  78. package/dist/audit/types/artifactMetadata.d.ts +34 -0
  79. package/dist/audit/types/artifactMetadata.d.ts.map +1 -1
  80. package/dist/audit/types/artifactMetadata.js +10 -1
  81. package/dist/audit/types/artifactMetadata.js.map +1 -1
  82. package/dist/audit/types.d.ts +13 -4
  83. package/dist/audit/types.d.ts.map +1 -1
  84. package/dist/audit/types.js +8 -0
  85. package/dist/audit/types.js.map +1 -1
  86. package/dist/remediate/steps/nextStep.d.ts +11 -23
  87. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  88. package/dist/remediate/steps/nextStep.js +45 -43
  89. package/dist/remediate/steps/nextStep.js.map +1 -1
  90. package/dist/shared/contentKey.d.ts +83 -0
  91. package/dist/shared/contentKey.d.ts.map +1 -0
  92. package/dist/shared/contentKey.js +163 -0
  93. package/dist/shared/contentKey.js.map +1 -0
  94. package/dist/shared/friction/captureFrictionEvent.d.ts +50 -0
  95. package/dist/shared/friction/captureFrictionEvent.d.ts.map +1 -0
  96. package/dist/shared/friction/captureFrictionEvent.js +34 -0
  97. package/dist/shared/friction/captureFrictionEvent.js.map +1 -0
  98. package/dist/shared/friction/triage.d.ts +126 -0
  99. package/dist/shared/friction/triage.d.ts.map +1 -0
  100. package/dist/shared/friction/triage.js +149 -0
  101. package/dist/shared/friction/triage.js.map +1 -0
  102. package/dist/shared/git.d.ts +41 -0
  103. package/dist/shared/git.d.ts.map +1 -1
  104. package/dist/shared/git.js +119 -0
  105. package/dist/shared/git.js.map +1 -1
  106. package/dist/shared/index.d.ts +17 -5
  107. package/dist/shared/index.d.ts.map +1 -1
  108. package/dist/shared/index.js +11 -4
  109. package/dist/shared/index.js.map +1 -1
  110. package/dist/shared/io/auditToolsPaths.d.ts +9 -0
  111. package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
  112. package/dist/shared/io/auditToolsPaths.js +11 -0
  113. package/dist/shared/io/auditToolsPaths.js.map +1 -1
  114. package/dist/shared/io/frictionCapture.d.ts +2 -0
  115. package/dist/shared/io/frictionCapture.d.ts.map +1 -1
  116. package/dist/shared/io/frictionCapture.js +1 -1
  117. package/dist/shared/io/frictionCapture.js.map +1 -1
  118. package/dist/shared/providers/providerFactory.d.ts +16 -1
  119. package/dist/shared/providers/providerFactory.d.ts.map +1 -1
  120. package/dist/shared/providers/providerFactory.js +43 -0
  121. package/dist/shared/providers/providerFactory.js.map +1 -1
  122. package/dist/shared/providers/types.d.ts +40 -0
  123. package/dist/shared/providers/types.d.ts.map +1 -1
  124. package/dist/shared/quota/capacity.d.ts +12 -12
  125. package/dist/shared/quota/quotaSource.d.ts +2 -2
  126. package/dist/shared/quota/types.d.ts +4 -4
  127. package/dist/shared/repair/brokeredDispatch.d.ts +147 -0
  128. package/dist/shared/repair/brokeredDispatch.d.ts.map +1 -0
  129. package/dist/shared/repair/brokeredDispatch.js +220 -0
  130. package/dist/shared/repair/brokeredDispatch.js.map +1 -0
  131. package/dist/shared/repair/emitValidateRepair.d.ts +124 -0
  132. package/dist/shared/repair/emitValidateRepair.d.ts.map +1 -0
  133. package/dist/shared/repair/emitValidateRepair.js +179 -0
  134. package/dist/shared/repair/emitValidateRepair.js.map +1 -0
  135. package/dist/shared/repair/index.d.ts +10 -0
  136. package/dist/shared/repair/index.d.ts.map +1 -0
  137. package/dist/shared/repair/index.js +3 -0
  138. package/dist/shared/repair/index.js.map +1 -0
  139. package/dist/shared/stableStringify.d.ts +14 -0
  140. package/dist/shared/stableStringify.d.ts.map +1 -0
  141. package/dist/shared/stableStringify.js +28 -0
  142. package/dist/shared/stableStringify.js.map +1 -0
  143. package/package.json +1 -1
  144. package/schemas/audit_result.schema.json +9 -0
  145. package/schemas/audit_results.schema.json +9 -0
@@ -1,5 +1,5 @@
1
1
  import { findFirstActionableObligation } from "audit-tools/shared";
2
- import { frictionCaptured, persistFrictionCapture, frictionCapturePath, } from "audit-tools/shared";
2
+ import { decideFrictionTriage, } from "audit-tools/shared";
3
3
  import { EXECUTOR_REGISTRY } from "./executors.js";
4
4
  import { deriveAuditState } from "./state.js";
5
5
  /**
@@ -74,35 +74,17 @@ export function decideNextStep(bundle) {
74
74
  };
75
75
  }
76
76
  /**
77
- * Resolve (and, on first fire, satisfy) the terminal friction-capture close-out for
78
- * the audit half. This is the audit analog of remediate-code's friction gate in
79
- * `handleComplete`:
80
- *
81
- * - DETERMINISTIC: keyed only off the on-disk record at `(artifactsDir, runId)` via
82
- * the SINGLE shared helper never host discretion or a bundle flag.
83
- * - DEGRADE-CLEANLY: on first fire it persists a zero-friction record up front, so
84
- * the close-out is immediately satisfiable and can NEVER block completion.
85
- * - NEVER RE-LOOP: once a record exists, returns "captured" and the run proceeds —
86
- * the close-out fires at most once per run.
87
- * - PARITY: identical shape + persist helper to the remediate side (single-sourced
88
- * in `audit-tools/shared`), so the two halves cannot drift.
89
- * - NEVER couples to any repo's backlog doc — the record lives under the run's own
90
- * artifacts dir.
91
- *
92
- * Returns "capture" the first time (the host should be prompted to optionally enrich
93
- * the persisted record), "captured" thereafter.
77
+ * The terminal friction-TRIAGE close-out for the audit half. Thin delegation to the
78
+ * single-sourced `decideFrictionTriage` (`audit-tools/shared`) so the triage shape,
79
+ * disposition vocabulary, blocking semantics, and close-out logic cannot drift from
80
+ * the remediate half. Drops the former false-green (an empty up-front record no
81
+ * longer satisfies): the close-out blocks ("dispose") until every captured
82
+ * mechanical event AND every surfaced agent-feedback reflection carries a
83
+ * disposition; an empty set (zero events AND zero reflections) is trivially
84
+ * "disposed". Keyed only off `(artifactsDir, runId)`; never coupled to any repo's
85
+ * backlog doc.
94
86
  */
95
87
  export async function decideAuditFrictionCloseout(artifactsDir, runId) {
96
- const recordPath = frictionCapturePath(artifactsDir, runId);
97
- if (await frictionCaptured(artifactsDir, runId)) {
98
- return { action: "captured", recordPath };
99
- }
100
- await persistFrictionCapture({
101
- artifactsDir,
102
- runId,
103
- tool: "audit-code",
104
- frictions: [],
105
- });
106
- return { action: "capture", recordPath };
88
+ return decideFrictionTriage(artifactsDir, runId, "audit-code");
107
89
  }
108
90
  //# sourceMappingURL=nextStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nextStep.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/nextStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAS9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,0BAA0B,CAAC;AAEzE,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,uBAAuB;IACvB,eAAe;IACf,kBAAkB;IAClB,oBAAoB;IACpB,iBAAiB;IACjB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,2BAA2B;IAC3B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AAmB,EAAE,IAAI,CAAC,EAAE;QAC5B,iBAAiB,EAAE,QAAQ,EAAE,EAAE,IAAI,IAAI;QACvC,MAAM,EAAE,QAAQ;YACd,CAAC,CAAC,mDAAmD,IAAI,CAAC,EAAE,GAAG;YAC/D,CAAC,CAAC,oCAAoC,IAAI,CAAC,EAAE,8IAA8I;KAC9L,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,YAAoB,EACpB,KAAa;IAEb,OAAO,oBAAoB,CAAC,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * O2 ↔ F1 residual-risk fix for judge-accepted CE-011: element-staleness for an
3
+ * already-ingested logical result must compare a FRESHLY-COMPUTED current
4
+ * `contentKey` (derived from the LIVE `task_content_signature` at advance time)
5
+ * against a prior BASELINE `contentKey` — and that baseline must live OUTSIDE the
6
+ * immutable per-record ledger instance.
7
+ *
8
+ * Why not read the contentKey off the ledger record? The append-only ledger
9
+ * (INV-O2-1) keys records on `idempotency_key`, which is signature-STABLE: a
10
+ * benign content edit (C1 → C2) does NOT move it, so idempotent re-ingest of the
11
+ * already-ingested result stays a no-op (no duplicate record is appended). If
12
+ * staleness ALSO read its prior contentKey from that same immutable record, the
13
+ * record would still carry C1 and a benign edit could never fire staleness — the
14
+ * exact CE-011 residual hole. So the baseline contentKey is persisted in a
15
+ * SEPARATE store (`artifact_metadata.result_baselines`, keyed by
16
+ * `idempotency_key`) that the staleness gate updates as the live signature moves,
17
+ * while the ledger record itself is never mutated. Append-only ledger invariants
18
+ * are therefore untouched.
19
+ *
20
+ * The comparison driver is the seam's `contentKey` (signature-SENSITIVE), so:
21
+ * live C2 != baseline C1 ⟹ staleness FIRES,
22
+ * while the seam's signature-STABLE `idempotencyKey` keeps idempotent re-ingest a
23
+ * no-op. The two are reconciled by construction (see src/shared/contentKey.ts).
24
+ */
25
+ import { type ResultEmitSource } from "audit-tools/shared";
26
+ import { type ArtifactMetadataManifest } from "../types/artifactMetadata.js";
27
+ /**
28
+ * The baseline store — the per-logical-result contentKey snapshot, keyed by the
29
+ * signature-STABLE `idempotency_key`. Persisted in `artifact_metadata` OUTSIDE
30
+ * the per-record ledger, so updating a baseline never mutates an immutable ledger
31
+ * record (INV-O2-1 untouched).
32
+ */
33
+ export type ResultBaselineStore = Record<string, string>;
34
+ /** The live coordinate + signature needed to freshly compute the current keys. */
35
+ export interface LiveResultKeyInput {
36
+ unit_id: string;
37
+ lens: string;
38
+ pass_id: string;
39
+ /** Tool-owned emit source (base | deepening | steward | redispatch). */
40
+ source: ResultEmitSource;
41
+ /** Required when `source === 'redispatch'`. */
42
+ attempt?: number;
43
+ /**
44
+ * The LIVE task-content signature derived from the current task content at
45
+ * advance time — NEVER a value read off a stored ledger record.
46
+ */
47
+ task_content_signature: string;
48
+ }
49
+ /**
50
+ * Freshly derive the {idempotency_key, content_key} pair for a live result from
51
+ * the seam — both computed from the live `task_content_signature` at advance
52
+ * time. `idempotency_key` is the baseline-store key (signature-STABLE);
53
+ * `content_key` is the staleness driver (signature-SENSITIVE).
54
+ */
55
+ export declare function deriveLiveResultKeys(input: LiveResultKeyInput): {
56
+ idempotency_key: string;
57
+ content_key: string;
58
+ };
59
+ /**
60
+ * Is the already-ingested logical result stale, given its LIVE keys? Stale iff a
61
+ * baseline exists for the idempotency_key AND the freshly-computed live
62
+ * content_key differs from it. A result with no recorded baseline is NOT stale —
63
+ * it has simply never been compared (the first ingest establishes the baseline).
64
+ *
65
+ * The caller supplies live keys via `deriveLiveResultKeys` (freshly computed from
66
+ * the live signature) — this function NEVER reads a contentKey off a ledger
67
+ * record.
68
+ */
69
+ export declare function isResultStaleAgainstBaseline(baselines: ResultBaselineStore | undefined, liveKeys: {
70
+ idempotency_key: string;
71
+ content_key: string;
72
+ }): boolean;
73
+ /**
74
+ * Return an updated baseline store with this logical result's baseline set to its
75
+ * live content_key. Pure: returns a new object, never mutates the input — so a
76
+ * caller persists the result through the normal artifact_metadata write path.
77
+ * Idempotent: recording the same content_key again yields an equal store.
78
+ */
79
+ export declare function recordResultBaseline(baselines: ResultBaselineStore | undefined, liveKeys: {
80
+ idempotency_key: string;
81
+ content_key: string;
82
+ }): ResultBaselineStore;
83
+ /**
84
+ * The FULL per-result staleness coordinate (F1). The grouping fields
85
+ * {unit_id, lens, pass_id} (and even with task_id) are NON-UNIQUE per pass —
86
+ * base vs deepening/steward, or an O3 stage-3 re-dispatch reuse the same
87
+ * coordinate — so the `result_content_discriminator` (tool-owned,
88
+ * buildResultContentDiscriminator) MUST be part of the key (CE-009). It is
89
+ * carried here as `source` (+ `attempt` for re-dispatch); a caller that cannot
90
+ * supply the discriminating source is handled by the fail-safe path below.
91
+ */
92
+ export interface ElementCoordinate {
93
+ unit_id: string;
94
+ lens: string;
95
+ pass_id: string;
96
+ task_id?: string;
97
+ /**
98
+ * Tool-owned emit source feeding the discriminator. OMITTED ⇒ the coordinate
99
+ * is under-discriminated and the element fails safe to stale (CE-009) — it is
100
+ * NEVER silently keyed at the non-unique grouping granularity.
101
+ */
102
+ source?: ResultEmitSource;
103
+ /** Required when `source === 'redispatch'`. */
104
+ attempt?: number;
105
+ /** LIVE task-content signature derived at advance time (never off a record). */
106
+ task_content_signature: string;
107
+ }
108
+ export type ElementVerdict = 'skipped' | 're-derive';
109
+ /**
110
+ * Per-element (per discriminated-result-coordinate) staleness verdict (F1). The
111
+ * driver is the CONSUMED contentKey seam (FC-002 tool-owned signatures) over the
112
+ * DISCRIMINATED coordinate — never the bare grouping/identity_key, and never a
113
+ * parallel hashing of element identity here.
114
+ *
115
+ * Fail-safe to `re-derive` (CE-009 / fail-safe staleness) when:
116
+ * - the coordinate lacks a discriminating `source` (under-discriminated), OR
117
+ * - the live keys cannot be derived (e.g. a missing/empty signature throws in
118
+ * the seam), OR
119
+ * - the freshly-computed live content_key differs from the persisted baseline.
120
+ *
121
+ * `skipped` ONLY when a baseline exists for the idempotency_key AND the live
122
+ * content_key equals it (unchanged element ⇒ skipped by construction). An
123
+ * element with no recorded baseline is `re-derive` (first compare establishes it
124
+ * — never a false skip).
125
+ */
126
+ export declare function perElementStalenessVerdict(baselines: ResultBaselineStore | undefined, coordinate: ElementCoordinate): ElementVerdict;
127
+ /**
128
+ * Metadata-migration fail-safe (CE-007). An on-disk manifest is recognized as
129
+ * F1-current ONLY when it carries `metadata_schema_version >= METADATA_SCHEMA_VERSION`.
130
+ * An absent/older tag (a pre-F1, whole-artifact-only manifest) is NOT recognized,
131
+ * so its still-matching whole-artifact hashes must NEVER be trusted to skip a
132
+ * changed element — every element is treated as stale (all re-derived). Pure
133
+ * predicate; never throws.
134
+ */
135
+ export declare function isMetadataManifestCurrent(manifest: ArtifactMetadataManifest | undefined): boolean;
136
+ //# sourceMappingURL=resultBaseline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resultBaseline.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/resultBaseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzD,kFAAkF;AAClF,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,MAAM,EAAE,gBAAgB,CAAC;IACzB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB,CAkBA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAC1C,QAAQ,EAAE;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzD,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAC1C,QAAQ,EAAE;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzD,mBAAmB,CAKrB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,WAAW,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAC1C,UAAU,EAAE,iBAAiB,GAC5B,cAAc,CAuBhB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,wBAAwB,GAAG,SAAS,GAC7C,OAAO,CAKT"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * O2 ↔ F1 residual-risk fix for judge-accepted CE-011: element-staleness for an
3
+ * already-ingested logical result must compare a FRESHLY-COMPUTED current
4
+ * `contentKey` (derived from the LIVE `task_content_signature` at advance time)
5
+ * against a prior BASELINE `contentKey` — and that baseline must live OUTSIDE the
6
+ * immutable per-record ledger instance.
7
+ *
8
+ * Why not read the contentKey off the ledger record? The append-only ledger
9
+ * (INV-O2-1) keys records on `idempotency_key`, which is signature-STABLE: a
10
+ * benign content edit (C1 → C2) does NOT move it, so idempotent re-ingest of the
11
+ * already-ingested result stays a no-op (no duplicate record is appended). If
12
+ * staleness ALSO read its prior contentKey from that same immutable record, the
13
+ * record would still carry C1 and a benign edit could never fire staleness — the
14
+ * exact CE-011 residual hole. So the baseline contentKey is persisted in a
15
+ * SEPARATE store (`artifact_metadata.result_baselines`, keyed by
16
+ * `idempotency_key`) that the staleness gate updates as the live signature moves,
17
+ * while the ledger record itself is never mutated. Append-only ledger invariants
18
+ * are therefore untouched.
19
+ *
20
+ * The comparison driver is the seam's `contentKey` (signature-SENSITIVE), so:
21
+ * live C2 != baseline C1 ⟹ staleness FIRES,
22
+ * while the seam's signature-STABLE `idempotencyKey` keeps idempotent re-ingest a
23
+ * no-op. The two are reconciled by construction (see src/shared/contentKey.ts).
24
+ */
25
+ import { buildResultContentDiscriminator, contentKey, idempotencyKey, } from "audit-tools/shared";
26
+ import { METADATA_SCHEMA_VERSION, } from "../types/artifactMetadata.js";
27
+ /**
28
+ * Freshly derive the {idempotency_key, content_key} pair for a live result from
29
+ * the seam — both computed from the live `task_content_signature` at advance
30
+ * time. `idempotency_key` is the baseline-store key (signature-STABLE);
31
+ * `content_key` is the staleness driver (signature-SENSITIVE).
32
+ */
33
+ export function deriveLiveResultKeys(input) {
34
+ const discriminator = buildResultContentDiscriminator({
35
+ source: input.source,
36
+ attempt: input.attempt,
37
+ });
38
+ const coordinate = {
39
+ unit_id: input.unit_id,
40
+ lens: input.lens,
41
+ pass_id: input.pass_id,
42
+ result_content_discriminator: discriminator,
43
+ };
44
+ return {
45
+ idempotency_key: idempotencyKey(coordinate),
46
+ content_key: contentKey({
47
+ ...coordinate,
48
+ task_content_signature: input.task_content_signature,
49
+ }),
50
+ };
51
+ }
52
+ /**
53
+ * Is the already-ingested logical result stale, given its LIVE keys? Stale iff a
54
+ * baseline exists for the idempotency_key AND the freshly-computed live
55
+ * content_key differs from it. A result with no recorded baseline is NOT stale —
56
+ * it has simply never been compared (the first ingest establishes the baseline).
57
+ *
58
+ * The caller supplies live keys via `deriveLiveResultKeys` (freshly computed from
59
+ * the live signature) — this function NEVER reads a contentKey off a ledger
60
+ * record.
61
+ */
62
+ export function isResultStaleAgainstBaseline(baselines, liveKeys) {
63
+ const baseline = baselines?.[liveKeys.idempotency_key];
64
+ if (baseline === undefined)
65
+ return false;
66
+ return baseline !== liveKeys.content_key;
67
+ }
68
+ /**
69
+ * Return an updated baseline store with this logical result's baseline set to its
70
+ * live content_key. Pure: returns a new object, never mutates the input — so a
71
+ * caller persists the result through the normal artifact_metadata write path.
72
+ * Idempotent: recording the same content_key again yields an equal store.
73
+ */
74
+ export function recordResultBaseline(baselines, liveKeys) {
75
+ return {
76
+ ...(baselines ?? {}),
77
+ [liveKeys.idempotency_key]: liveKeys.content_key,
78
+ };
79
+ }
80
+ /**
81
+ * Per-element (per discriminated-result-coordinate) staleness verdict (F1). The
82
+ * driver is the CONSUMED contentKey seam (FC-002 tool-owned signatures) over the
83
+ * DISCRIMINATED coordinate — never the bare grouping/identity_key, and never a
84
+ * parallel hashing of element identity here.
85
+ *
86
+ * Fail-safe to `re-derive` (CE-009 / fail-safe staleness) when:
87
+ * - the coordinate lacks a discriminating `source` (under-discriminated), OR
88
+ * - the live keys cannot be derived (e.g. a missing/empty signature throws in
89
+ * the seam), OR
90
+ * - the freshly-computed live content_key differs from the persisted baseline.
91
+ *
92
+ * `skipped` ONLY when a baseline exists for the idempotency_key AND the live
93
+ * content_key equals it (unchanged element ⇒ skipped by construction). An
94
+ * element with no recorded baseline is `re-derive` (first compare establishes it
95
+ * — never a false skip).
96
+ */
97
+ export function perElementStalenessVerdict(baselines, coordinate) {
98
+ if (coordinate.source === undefined) {
99
+ // Under-discriminated coordinate (CE-009): refuse to compare at the
100
+ // non-unique grouping granularity — fail safe to re-derive.
101
+ return 're-derive';
102
+ }
103
+ let liveKeys;
104
+ try {
105
+ liveKeys = deriveLiveResultKeys({
106
+ unit_id: coordinate.unit_id,
107
+ lens: coordinate.lens,
108
+ pass_id: coordinate.pass_id,
109
+ source: coordinate.source,
110
+ attempt: coordinate.attempt,
111
+ task_content_signature: coordinate.task_content_signature,
112
+ });
113
+ }
114
+ catch {
115
+ // Uncomparable element state (missing/unreadable signature) ⇒ fail safe.
116
+ return 're-derive';
117
+ }
118
+ const baseline = baselines?.[liveKeys.idempotency_key];
119
+ if (baseline === undefined)
120
+ return 're-derive';
121
+ return baseline === liveKeys.content_key ? 'skipped' : 're-derive';
122
+ }
123
+ /**
124
+ * Metadata-migration fail-safe (CE-007). An on-disk manifest is recognized as
125
+ * F1-current ONLY when it carries `metadata_schema_version >= METADATA_SCHEMA_VERSION`.
126
+ * An absent/older tag (a pre-F1, whole-artifact-only manifest) is NOT recognized,
127
+ * so its still-matching whole-artifact hashes must NEVER be trusted to skip a
128
+ * changed element — every element is treated as stale (all re-derived). Pure
129
+ * predicate; never throws.
130
+ */
131
+ export function isMetadataManifestCurrent(manifest) {
132
+ if (!manifest || typeof manifest !== 'object')
133
+ return false;
134
+ const version = manifest
135
+ .metadata_schema_version;
136
+ return typeof version === 'number' && version >= METADATA_SCHEMA_VERSION;
137
+ }
138
+ //# sourceMappingURL=resultBaseline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resultBaseline.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/resultBaseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,+BAA+B,EAC/B,UAAU,EACV,cAAc,GAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,uBAAuB,GAExB,MAAM,8BAA8B,CAAC;AA0BtC;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAy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,CAAC;YAC9B,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,sBAAsB,EAAE,UAAU,CAAC,sBAAsB;SAC1D,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;QACzE,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IACvD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAC/C,OAAO,QAAQ,KAAK,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;AACrE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA8C;IAE9C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5D,MAAM,OAAO,GAAI,QAAkD;SAChE,uBAAuB,CAAC;IAC3B,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,uBAAuB,CAAC;AAC3E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"staleness.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/staleness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA0BzD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,CAqGzE"}
1
+ {"version":3,"file":"staleness.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/staleness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA4BzD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,CA6HzE"}
@@ -1,6 +1,7 @@
1
1
  import { getArtifactValue } from "../io/artifacts.js";
2
- import { ARTIFACT_DEPENDENTS_MAP, ARTIFACT_DEPENDS_ON_MAP, } from "./dependencyMap.js";
2
+ import { ALL_DAG_ARTIFACTS, ARTIFACT_DEPENDENTS_MAP, ARTIFACT_DEPENDS_ON_MAP, } from "./dependencyMap.js";
3
3
  import { present } from "./artifactMetadata.js";
4
+ import { isMetadataManifestCurrent } from "./resultBaseline.js";
4
5
  import { hashArtifactValue, stableStringify, } from "./artifactFreshness.js";
5
6
  function computeContentHash(artifactName, bundle) {
6
7
  const value = getArtifactValue(bundle, artifactName);
@@ -14,6 +15,29 @@ const ARTIFACT_DEPENDENCIES_MAP = ARTIFACT_DEPENDS_ON_MAP;
14
15
  export function computeStaleArtifacts(bundle) {
15
16
  const stale = new Set();
16
17
  const metadata = bundle.artifact_metadata;
18
+ // Metadata-migration fail-safe (CE-007): an old-shape (pre-F1) manifest —
19
+ // present but absent/older `metadata_schema_version`, or that would not decode
20
+ // to the F1 shape — must NOT be trusted to skip work off its still-matching
21
+ // whole-artifact hashes. Degrade to ALL-STALE (every present DAG artifact),
22
+ // never false-skip and never throw on a shape mismatch. A genuinely-absent
23
+ // manifest stays "nothing to compare ⇒ nothing stale" (handled below).
24
+ if (metadata && !isMetadataManifestCurrent(metadata)) {
25
+ for (const artifactName of ALL_DAG_ARTIFACTS) {
26
+ if (artifactName === "artifact_metadata.json")
27
+ continue;
28
+ if (present(bundle, artifactName))
29
+ stale.add(artifactName);
30
+ }
31
+ if (stale.size > 0) {
32
+ process.stderr.write(JSON.stringify({
33
+ kind: "staleness",
34
+ stale_artifacts: [...stale].sort(),
35
+ reason: "metadata_schema_version_migration",
36
+ ts: new Date().toISOString(),
37
+ }) + "\n");
38
+ }
39
+ return stale;
40
+ }
17
41
  if (metadata) {
18
42
  for (const [artifactName, entry] of Object.entries(metadata.artifacts)) {
19
43
  if (!present(bundle, artifactName))
@@ -1 +1 @@
1
- {"version":3,"file":"staleness.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/staleness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,SAAS,kBAAkB,CACzB,YAAoB,EACpB,MAAsB;IAEtB,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,OAAO,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,8EAA8E;AAC9E,iDAAiD;AACjD,MAAM,yBAAyB,GAC7B,uBAAuB,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CAAC,MAAsB;IAC1D,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,MAAM,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAE1C,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACvE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC;gBAAE,SAAS;YAC7C,MAAM,oBAAoB,GAAG,CAAC,GAAG,CAAC,yBAAyB,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;iBAC9E,MAAM,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,cA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