audit-tools 0.50.21 → 0.51.0

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 (157) hide show
  1. package/dist/audit/cli/auditStep.d.ts +1 -1
  2. package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
  3. package/dist/audit/cli/charterExtractionPrompt.js +14 -1
  4. package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
  5. package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
  6. package/dist/audit/cli/conceptualDispatch.js +30 -5
  7. package/dist/audit/cli/conceptualDispatch.js.map +1 -1
  8. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  9. package/dist/audit/cli/dispatch/hostHandoff.js +10 -0
  10. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  11. package/dist/audit/cli/fanoutLanes.d.ts +7 -0
  12. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  13. package/dist/audit/cli/fanoutLanes.js +9 -1
  14. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  15. package/dist/audit/cli/laneSubmissions.d.ts +38 -27
  16. package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
  17. package/dist/audit/cli/laneSubmissions.js +129 -2
  18. package/dist/audit/cli/laneSubmissions.js.map +1 -1
  19. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  20. package/dist/audit/cli/nextStepCommand.js +27 -7
  21. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  22. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  23. package/dist/audit/cli/nextStepHelpers.js +34 -4
  24. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  25. package/dist/audit/cli/sampleRunCommand.d.ts +2 -1
  26. package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
  27. package/dist/audit/contracts/workerSchemas.d.ts +4 -4
  28. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  29. package/dist/audit/contracts/workerSchemas.js +12 -6
  30. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  31. package/dist/audit/contracts/wrapperResponse.d.ts +7 -7
  32. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  33. package/dist/audit/contracts/wrapperResponse.js +9 -1
  34. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  35. package/dist/audit/extractors/commentDecomposition.d.ts +28 -0
  36. package/dist/audit/extractors/commentDecomposition.d.ts.map +1 -1
  37. package/dist/audit/extractors/commentDecomposition.js +117 -0
  38. package/dist/audit/extractors/commentDecomposition.js.map +1 -1
  39. package/dist/audit/orchestrator/charterDeltaExecutor.d.ts.map +1 -1
  40. package/dist/audit/orchestrator/charterDeltaExecutor.js +14 -0
  41. package/dist/audit/orchestrator/charterDeltaExecutor.js.map +1 -1
  42. package/dist/audit/orchestrator/charterExtractionExecutor.d.ts +16 -6
  43. package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
  44. package/dist/audit/orchestrator/charterExtractionExecutor.js +127 -9
  45. package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
  46. package/dist/audit/orchestrator/charterPacketArchive.d.ts +51 -0
  47. package/dist/audit/orchestrator/charterPacketArchive.d.ts.map +1 -0
  48. package/dist/audit/orchestrator/charterPacketArchive.js +173 -0
  49. package/dist/audit/orchestrator/charterPacketArchive.js.map +1 -0
  50. package/dist/audit/orchestrator/charterPackets.d.ts +31 -13
  51. package/dist/audit/orchestrator/charterPackets.d.ts.map +1 -1
  52. package/dist/audit/orchestrator/charterPackets.js +433 -79
  53. package/dist/audit/orchestrator/charterPackets.js.map +1 -1
  54. package/dist/audit/orchestrator/designReviewPrompt.d.ts +20 -4
  55. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  56. package/dist/audit/orchestrator/designReviewPrompt.js +89 -12
  57. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  58. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  59. package/dist/audit/orchestrator/executorRunners.js +17 -1
  60. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  61. package/dist/audit/orchestrator/graphEnrichmentExecutor.d.ts.map +1 -1
  62. package/dist/audit/orchestrator/graphEnrichmentExecutor.js +8 -1
  63. package/dist/audit/orchestrator/graphEnrichmentExecutor.js.map +1 -1
  64. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  65. package/dist/audit/orchestrator/state.js +21 -14
  66. package/dist/audit/orchestrator/state.js.map +1 -1
  67. package/dist/audit/orchestrator/synthesisExecutors.d.ts +8 -0
  68. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  69. package/dist/audit/orchestrator/synthesisExecutors.js +10 -0
  70. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  71. package/dist/audit/reporting/synthesis.d.ts +42 -2
  72. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  73. package/dist/audit/reporting/synthesis.js +265 -12
  74. package/dist/audit/reporting/synthesis.js.map +1 -1
  75. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  76. package/dist/audit/supervisor/operatorHandoff.js +14 -6
  77. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  78. package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
  79. package/dist/audit/systemic/secondOrderAdversaryPrompt.js +7 -0
  80. package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
  81. package/dist/audit/types/analyzerCapability.d.ts +35 -11
  82. package/dist/audit/types/analyzerCapability.d.ts.map +1 -1
  83. package/dist/audit/types/analyzerCapability.js +83 -5
  84. package/dist/audit/types/analyzerCapability.js.map +1 -1
  85. package/dist/audit/types/auditState.d.ts +8 -8
  86. package/dist/audit/types/charterRegister.d.ts +33 -3
  87. package/dist/audit/types/charterRegister.d.ts.map +1 -1
  88. package/dist/audit/types/charterRegister.js +11 -1
  89. package/dist/audit/types/charterRegister.js.map +1 -1
  90. package/dist/audit/types/conceptualAdjudication.d.ts +383 -4
  91. package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
  92. package/dist/audit/types/conceptualAdjudication.js +109 -5
  93. package/dist/audit/types/conceptualAdjudication.js.map +1 -1
  94. package/dist/audit/types/designAssessment.d.ts +1 -1
  95. package/dist/audit/types/designAssessment.d.ts.map +1 -1
  96. package/dist/audit/types.d.ts +7 -2
  97. package/dist/audit/types.d.ts.map +1 -1
  98. package/dist/remediate/intent/intentOrdering.d.ts.map +1 -1
  99. package/dist/remediate/intent/intentOrdering.js +29 -1
  100. package/dist/remediate/intent/intentOrdering.js.map +1 -1
  101. package/dist/remediate/phases/grounding.d.ts +12 -4
  102. package/dist/remediate/phases/grounding.d.ts.map +1 -1
  103. package/dist/remediate/phases/grounding.js +23 -60
  104. package/dist/remediate/phases/grounding.js.map +1 -1
  105. package/dist/remediate/state/types.d.ts +5 -0
  106. package/dist/remediate/state/types.d.ts.map +1 -1
  107. package/dist/shared/analyzers/types.d.ts +17 -6
  108. package/dist/shared/analyzers/types.d.ts.map +1 -1
  109. package/dist/shared/analyzers/types.js +6 -15
  110. package/dist/shared/analyzers/types.js.map +1 -1
  111. package/dist/shared/decompose/systemicChallenge.d.ts +5 -0
  112. package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
  113. package/dist/shared/engine/obligationEngine.d.ts +23 -6
  114. package/dist/shared/engine/obligationEngine.d.ts.map +1 -1
  115. package/dist/shared/engine/obligationEngine.js +38 -3
  116. package/dist/shared/engine/obligationEngine.js.map +1 -1
  117. package/dist/shared/findings/dedupe.d.ts +10 -0
  118. package/dist/shared/findings/dedupe.d.ts.map +1 -1
  119. package/dist/shared/findings/dedupe.js +15 -0
  120. package/dist/shared/findings/dedupe.js.map +1 -1
  121. package/dist/shared/index.d.ts +14 -6
  122. package/dist/shared/index.d.ts.map +1 -1
  123. package/dist/shared/index.js +12 -5
  124. package/dist/shared/index.js.map +1 -1
  125. package/dist/shared/measurement/measuredOutcome.d.ts +61 -0
  126. package/dist/shared/measurement/measuredOutcome.d.ts.map +1 -0
  127. package/dist/shared/measurement/measuredOutcome.js +109 -0
  128. package/dist/shared/measurement/measuredOutcome.js.map +1 -0
  129. package/dist/shared/reporting/findingDisplay.d.ts +14 -2
  130. package/dist/shared/reporting/findingDisplay.d.ts.map +1 -1
  131. package/dist/shared/reporting/findingDisplay.js +29 -2
  132. package/dist/shared/reporting/findingDisplay.js.map +1 -1
  133. package/dist/shared/reporting/lensCoverage.d.ts +70 -0
  134. package/dist/shared/reporting/lensCoverage.d.ts.map +1 -0
  135. package/dist/shared/reporting/lensCoverage.js +108 -0
  136. package/dist/shared/reporting/lensCoverage.js.map +1 -0
  137. package/dist/shared/submission/submissionLedger.d.ts +24 -1
  138. package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
  139. package/dist/shared/submission/submissionLedger.js +61 -0
  140. package/dist/shared/submission/submissionLedger.js.map +1 -1
  141. package/dist/shared/types/charterPacket.d.ts +155 -0
  142. package/dist/shared/types/charterPacket.d.ts.map +1 -0
  143. package/dist/shared/types/charterPacket.js +9 -0
  144. package/dist/shared/types/charterPacket.js.map +1 -0
  145. package/dist/shared/types/finding.d.ts +275 -40
  146. package/dist/shared/types/finding.d.ts.map +1 -1
  147. package/dist/shared/types/finding.js +87 -0
  148. package/dist/shared/types/finding.js.map +1 -1
  149. package/dist/shared/validation/citationGrounding.d.ts +115 -0
  150. package/dist/shared/validation/citationGrounding.d.ts.map +1 -0
  151. package/dist/shared/validation/citationGrounding.js +347 -0
  152. package/dist/shared/validation/citationGrounding.js.map +1 -0
  153. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  154. package/dist/shared/validation/findingsReport.js +62 -0
  155. package/dist/shared/validation/findingsReport.js.map +1 -1
  156. package/package.json +1 -1
  157. package/schemas/audit-code-v1alpha1.schema.json +2 -1
@@ -0,0 +1,108 @@
1
+ import { compareCodeUnits } from "../compareCodeUnits.js";
2
+ /**
3
+ * Count findings per lens. The same `countBy` shape `lens_breakdown` uses, kept
4
+ * here so the coverage map and the breakdown can never be counted differently.
5
+ */
6
+ function countByLens(findings) {
7
+ const counts = new Map();
8
+ for (const finding of findings) {
9
+ counts.set(finding.lens, (counts.get(finding.lens) ?? 0) + 1);
10
+ }
11
+ return counts;
12
+ }
13
+ /**
14
+ * What one lens's count means, given whether ANY lens-open channel was ingested.
15
+ *
16
+ * `clean` is the load-bearing distinction: it may be read as "asked, and there
17
+ * was nothing there", so it is reachable only when a channel that carried the
18
+ * operator's selection actually came back. With no such channel, zero findings
19
+ * means the lens was never exercised — `not_run` — which is true, and is the
20
+ * whole point of the field.
21
+ */
22
+ export function lensOutcome(findingsCount, lensOpenChannelIngested) {
23
+ if (findingsCount > 0)
24
+ return "findings";
25
+ return lensOpenChannelIngested ? "clean" : "not_run";
26
+ }
27
+ /**
28
+ * Whether ONE entry's outcome contradicts its own count — the check a consumer
29
+ * holding the map but not the run that produced it can actually establish.
30
+ *
31
+ * It deliberately does NOT re-decide `clean` versus `not_run`. Which of the two
32
+ * a zero-count lens deserves depends on whether a lens-open channel was
33
+ * ingested, and that is not in the report — so a validator that picked one would
34
+ * refuse legitimate output rather than catch a defect. Abstaining there is the
35
+ * verdict; what it refuses is the contradiction: a lens with findings that is
36
+ * not `findings`, or a lens with none that is.
37
+ */
38
+ export function lensCoverageEntryContradictsCount(entry) {
39
+ return entry.findings_count > 0
40
+ ? entry.outcome !== "findings"
41
+ : entry.outcome === "findings";
42
+ }
43
+ /**
44
+ * Derive the coverage map for a resolved selection.
45
+ *
46
+ * Order is `selectedLenses`' own — `resolveIntentLensSelection` emits canonical
47
+ * registry order then the operator's custom lenses in input order, which is
48
+ * content-derived and stable. A lens that produced findings while NOT being
49
+ * selected is appended after them, sorted, so the map never silently omits a
50
+ * lens the report counts.
51
+ */
52
+ export function deriveLensCoverage(params) {
53
+ const counts = countByLens(params.findings);
54
+ const selected = new Set(params.selectedLenses);
55
+ const entries = params.selectedLenses.map((lens) => {
56
+ const findingsCount = counts.get(lens) ?? 0;
57
+ return {
58
+ lens,
59
+ selected: true,
60
+ findings_count: findingsCount,
61
+ outcome: lensOutcome(findingsCount, params.lensOpenChannelIngested),
62
+ };
63
+ });
64
+ const unselected = [...counts.keys()]
65
+ .filter((lens) => !selected.has(lens))
66
+ .sort(compareCodeUnits);
67
+ for (const lens of unselected) {
68
+ const findingsCount = counts.get(lens);
69
+ entries.push({
70
+ lens,
71
+ selected: false,
72
+ findings_count: findingsCount,
73
+ // A lens nobody selected that nonetheless produced findings is
74
+ // `findings`; it cannot be `clean`, because nothing asked for it.
75
+ outcome: findingsCount > 0 ? "findings" : "not_run",
76
+ });
77
+ }
78
+ return entries;
79
+ }
80
+ /**
81
+ * Re-derive an EXISTING map's counts and outcomes over a (possibly narrowed)
82
+ * finding set, preserving each entry's membership and `selected` flag.
83
+ *
84
+ * Used wherever the findings change but the SELECTION cannot be recovered: a
85
+ * re-synthesis of a promoted report, and the approved-subset projection. Copying
86
+ * the map through unchanged there would leave it contradicting a re-derived
87
+ * `lens_breakdown`, and the projection validates itself at the write boundary —
88
+ * so a subset that drops every finding of one lens would throw at the remediate
89
+ * intake that requests it.
90
+ *
91
+ * Whether a lens was EXERCISED is read PER ENTRY, from the outcome the parent
92
+ * map already recorded — an entry that was `findings` or `clean` was exercised,
93
+ * and filtering findings out of a subset cannot un-exercise it. Re-deciding it
94
+ * globally would turn a lens whose only finding the subset dropped into
95
+ * `not_run`, which claims the run never looked.
96
+ */
97
+ export function reprojectLensCoverage(coverage, findings) {
98
+ const counts = countByLens(findings);
99
+ return coverage.map((entry) => {
100
+ const findingsCount = counts.get(entry.lens) ?? 0;
101
+ return {
102
+ ...entry,
103
+ findings_count: findingsCount,
104
+ outcome: lensOutcome(findingsCount, entry.outcome !== "not_run"),
105
+ };
106
+ });
107
+ }
108
+ //# sourceMappingURL=lensCoverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lensCoverage.js","sourceRoot":"","sources":["../../../src/shared/reporting/lensCoverage.ts"],"names":[],"mappings":"A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ome } from "../measurement/measuredOutcome.js";
1
2
  import type { SubmissionIssueCode } from "./submissionClassifier.js";
2
3
  export declare const SUBMISSION_LEDGER_EVENT_CONTRACT_VERSION: "submission-ledger-event/v1alpha1";
3
- export declare const SUBMISSION_EVENT_KINDS: readonly ["expected", "accepted", "rejected", "recovered_by_hand", "accepted_via_recovery", "removed_by_operator"];
4
+ export declare const SUBMISSION_EVENT_KINDS: readonly ["expected", "accepted", "rejected", "recovered_by_hand", "accepted_via_recovery", "removed_by_operator", "dispatched", "lane_outcome"];
4
5
  export type SubmissionEventKind = (typeof SUBMISSION_EVENT_KINDS)[number];
6
+ /** The kinds {@link isIngestEvent} admits, in declaration order. */
7
+ export declare const INGEST_EVENT_KINDS: readonly SubmissionEventKind[];
8
+ /**
9
+ * True when this kind records the tool having ingested something. The ONE home
10
+ * for "which events change a submission's trailing state": every
11
+ * last-event-per-submission reader asks it here rather than re-spelling an
12
+ * exclusion list that the next new kind would fall through.
13
+ */
14
+ export declare function isIngestEvent(kind: SubmissionEventKind): boolean;
5
15
  /**
6
16
  * One ledger event. Generic over the DRAW's issue-code vocabulary: the base
7
17
  * parameterization carries the shared submission codes, and a draw extending
@@ -17,6 +27,19 @@ export interface SubmissionLedgerEvent<TIssueCode extends string = SubmissionIss
17
27
  readonly kind: SubmissionEventKind;
18
28
  readonly issue_code?: TIssueCode;
19
29
  readonly message?: string;
30
+ /**
31
+ * What a `lane_outcome` row observed at the bound path. Absent on every other
32
+ * kind — an ingest event's decision is its `kind`.
33
+ */
34
+ readonly outcome?: MeasuredOutcome;
35
+ /**
36
+ * The ROUND a `dispatched` (and its matching `lane_outcome`) row belongs to,
37
+ * when the emitter has one. Carried as DATA rather than parsed back out of a
38
+ * lane id, so a delivery rate is reported per round and a superseded round's
39
+ * lanes never drag the current round's rate down. Absent for lane families
40
+ * with no round of their own.
41
+ */
42
+ readonly round_id?: string;
20
43
  /** ISO-8601. A faithful event record is allowed to say when. */
21
44
  readonly recorded_at: string;
22
45
  }
@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 @@ export const SUBMISSION_EVENT_KINDS = [
48
48
  * is: a second event after a recorded withdrawal.
49
49
  */
50
50
  "removed_by_operator",
51
+ /**
52
+ * The tool WROTE this lane's prompt and declared its bound path — the lane
53
+ * was dispatched.
54
+ *
55
+ * Deliberately disjoint from `expected`. *Expecting* an artifact is a claim
56
+ * the tool will be owed something and will re-ask until it arrives;
57
+ * *dispatching* is a fact about the past. The perspective lanes of a deep
58
+ * conceptual pass are un-expected by design (P25: the tool never reads their
59
+ * findings, so an expectation against one could never be satisfied or
60
+ * dropped and accumulated as a permanent, false shortfall) — and were
61
+ * therefore invisible, so a lane that exited 0 having written nothing left no
62
+ * trace in any artifact. A dispatch row can never become a shortfall:
63
+ * shortfall is a diff over the expected SET, a path that never reads ledger
64
+ * events.
65
+ */
66
+ "dispatched",
67
+ /**
68
+ * What a dispatched lane actually delivered, observed once at the fold that
69
+ * ingests its round's terminal submission. Carries `outcome`. A `dispatched`
70
+ * row with no terminal row at all is the record of a lane that never
71
+ * delivered — the absence IS the statement — so nothing here ever mints a
72
+ * terminal row nobody observed.
73
+ */
74
+ "lane_outcome",
51
75
  ];
76
+ /**
77
+ * Which kinds mean "the TOOL ingested this submission and decided about it".
78
+ *
79
+ * Exhaustive by construction, so a new kind must be classified rather than
80
+ * defaulting into either answer. This exists because several readers asked the
81
+ * question as `kind !== "expected"` — a partition that silently absorbed every
82
+ * future kind. Under it, a `dispatched` row appended when a refused lane is
83
+ * re-materialized would have become that submission's trailing event, deleting
84
+ * the refusal from `lastRefusals` (so a host whose submission was received and
85
+ * REJECTED is told it "submitted nothing") and making the report claim the
86
+ * refusal "was later accepted or re-landed by hand" when nothing had been.
87
+ */
88
+ const EVENT_KIND_IS_INGEST = {
89
+ // A declaration, not an ingest.
90
+ expected: false,
91
+ // Facts about dispatch and delivery; the tool consumed nothing.
92
+ dispatched: false,
93
+ lane_outcome: false,
94
+ accepted: true,
95
+ rejected: true,
96
+ recovered_by_hand: true,
97
+ accepted_via_recovery: true,
98
+ // A withdrawal is a decision ABOUT an ingested submission, and it ends a
99
+ // refusal's trailing state exactly as an acceptance does.
100
+ removed_by_operator: true,
101
+ };
102
+ /** The kinds {@link isIngestEvent} admits, in declaration order. */
103
+ export const INGEST_EVENT_KINDS = SUBMISSION_EVENT_KINDS.filter((kind) => EVENT_KIND_IS_INGEST[kind]);
104
+ /**
105
+ * True when this kind records the tool having ingested something. The ONE home
106
+ * for "which events change a submission's trailing state": every
107
+ * last-event-per-submission reader asks it here rather than re-spelling an
108
+ * exclusion list that the next new kind would fall through.
109
+ */
110
+ export function isIngestEvent(kind) {
111
+ return EVENT_KIND_IS_INGEST[kind];
112
+ }
52
113
  /** `<artifactsDir>/submissions/submission-ledger.jsonl`. */
53
114
  export function submissionLedgerPath(artifactsDir) {
54
115
  return join(submissionsDir(artifactsDir), "submission-ledger.jsonl");
@@ -1 +1 @@
1
- {"version":3,"file":"submissionLedger.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionLedger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,MAAM,CAAC,MAAM,wCAAwC,GACnD,kCAA2C,CAAC;AAE9C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,yDAAyD;IACzD,UAAU;IACV,kDAAkD;IAClD,UAAU;IACV,oEAAoE;IACpE,UAAU;IACV,4EAA4E;IAC5E,mBAAmB;IACnB;;;;;;OAMG;IACH,u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,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;YACtE,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
1
+ {"version":3,"file":"submissionLedger.js","sourceRoot":"","sources":["../../../src/shared/submission/submissionLedger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,MAAM,CAAC,MAAM,wCAAwC,GACnD,kCAA2C,CAAC;AAE9C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,yDAAyD;IACzD,UAAU;IACV,kDAAkD;IAClD,UAAU;IACV,oEAAoE;IACpE,UAAU;IACV,4EAA4E;IAC5E,mBAAmB;IACnB;;;;;;OAMG;IACH,uBAAuB;IACvB;;;;;;;OAOG;IACH,qBAAqB;IACrB;;;;;;;;;;;;;;OAcG;IACH,YAAY;IACZ;;;;;;OAMG;IACH,cAAc;CACN,CAAC;AAIX;;;;;;;;;;;GAWG;AACH,MAAM,oBAAoB,GAAyC;IACjE,gCAAgC;IAChC,QAAQ,EAAE,KAAK;IACf,gEAAgE;IAChE,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,IAAI;IACd,QAAQ,E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CAAC,CAAC;gBACzD,SAAS;YACX,CAAC;YACD,MAAM,GAAG,KAA8B,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YACzD,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,8BAA8B,CAC1C,MAAM,EACN,wCAAwC,CACzC,CAAC;QACF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;YACtE,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * The charter evidence PACKET contract — what a blind lane was handed, stated in
3
+ * a shape the lane can copy a citation out of and a consumer can measure.
4
+ *
5
+ * Two defects made these types necessary, and both were invisible from inside a
6
+ * run. (1) The packet was two strings per section, so every transform that built
7
+ * it destroyed line correspondence; the prompt then forbade opening real files
8
+ * while asking for a `ref`, so a lane that OBEYED could only emit its offset into
9
+ * the concatenated packet — obedience produced the wrong answer. (2) The builder
10
+ * walked one greedy budget in doc-then-comment order, so the "stated" channel,
11
+ * whose whole job is source comments, delivered zero of 72 comment blocks and
12
+ * said so only in prose inside a file that was then deleted.
13
+ *
14
+ * LINE RUNS, NEVER A SPAN. An excerpt is deliberately non-contiguous: extracted
15
+ * comment blocks and top-level declaration lines are scattered through their
16
+ * file. A first-to-last `start_line`/`end_line` pair over such an excerpt is
17
+ * false precision of exactly the kind the 2026-07-28 citation trap rejects — it
18
+ * would let a validator CERTIFY a 238-line claim over 60 delivered lines. The
19
+ * runs are what was delivered, so the runs are what is published and checked.
20
+ */
21
+ import type { CharterKind } from "./charter.js";
22
+ /**
23
+ * Which channel of evidence an excerpt carries. A packet's coverage is reported
24
+ * per class, because a packet that delivers every doc and no comment is not
25
+ * "94% covered" — it is one class complete and one class empty.
26
+ */
27
+ export type EvidenceClass = "doc" | "comment" | "declaration" | "stripped_source";
28
+ /** Canonical class order — the one home, so every consumer sorts identically. */
29
+ export declare const EVIDENCE_CLASSES: readonly EvidenceClass[];
30
+ /**
31
+ * Why a named candidate did not reach the packet. `no_content` is the reason
32
+ * that closes the two SILENT skips: a member with no comments and a file with no
33
+ * top-level declarations used to appear in neither the delivered nor the omitted
34
+ * list, so `delivered + omitted === named` could not be reconciled at all.
35
+ *
36
+ * EVERY value here has a producer, and a contract test pins that. There is no
37
+ * `per_file_cap`: `PER_FILE_CHARS` is a delivery CLAMP, not an omission cause —
38
+ * a candidate it truncates is DELIVERED with `truncated: true`, and one the
39
+ * clamp leaves below `MIN_EXCERPT_CHARS` is omitted as `total_budget`. A
40
+ * vocabulary value with no producer is a claim the data can never make, so it
41
+ * would only ever mislead a reader of the coverage record.
42
+ */
43
+ export type OmissionReason = "total_budget" | "unreadable_or_oversized" | "no_content";
44
+ /** One delivered source line, carrying its TRUE 1-based number in its own file. */
45
+ export interface PacketExcerptLine {
46
+ line: number;
47
+ text: string;
48
+ }
49
+ /** One contiguous run of TRUE 1-based source lines actually delivered. */
50
+ export interface PacketLineRun {
51
+ start: number;
52
+ end: number;
53
+ }
54
+ /**
55
+ * One excerpt as delivered. `line_runs` is derived from `lines` and is the
56
+ * surface a lane copies a citation from: a `ref` names ONE run, never a
57
+ * first-to-last span across the gaps between them.
58
+ *
59
+ * `prefix_width` is the fixed character width of the emitted `NNN| ` prefix on
60
+ * every content line of this excerpt. A validator strips it POSITIONALLY by this
61
+ * number — never by a regex, which would eat the leading cells out of the
62
+ * markdown table rows the doc class delivers verbatim.
63
+ */
64
+ export interface PacketExcerpt {
65
+ /** `E01`, `E02`, … in emission order, which is path order. */
66
+ excerpt_id: string;
67
+ evidence_class: EvidenceClass;
68
+ /** Repo-relative, forward-slashed. */
69
+ source_path: string;
70
+ line_runs: PacketLineRun[];
71
+ lines: PacketExcerptLine[];
72
+ /** True when content existed beyond what is delivered. */
73
+ truncated: boolean;
74
+ prefix_width: number;
75
+ }
76
+ /** Per-class delivery figures. `delivered + omitted.length === named` is an invariant. */
77
+ export interface CharterPacketCoverageClass {
78
+ evidence_class: EvidenceClass;
79
+ /** Every candidate file considered for this class. */
80
+ named: number;
81
+ /** Excerpts delivered with at least one line. */
82
+ delivered: number;
83
+ /** Delivered but incomplete. */
84
+ truncated: number;
85
+ /** Path-sorted; every named candidate that did not make it, with its reason. */
86
+ omitted: {
87
+ path: string;
88
+ reason: OmissionReason;
89
+ }[];
90
+ }
91
+ /**
92
+ * What one packet delivered against what it named. It renders UNCONDITIONALLY
93
+ * into the report — unlike the submission-drift section, where clean is the
94
+ * expected case and presence is the statement. Here the measured case was
95
+ * 0-of-72, and a silent section would leave "complete" indistinguishable from
96
+ * "not measured", which is the exact false-green this contract exists to close.
97
+ */
98
+ export interface CharterPacketCoverage {
99
+ kind: CharterKind;
100
+ /** One entry per class this kind emits, sorted by canonical class order. */
101
+ classes: CharterPacketCoverageClass[];
102
+ /** The content budget after packet metadata was charged against the ceiling. */
103
+ budget_chars: number;
104
+ spent_chars: number;
105
+ }
106
+ export declare const CHARTER_PACKET_MANIFEST_SCHEMA_VERSION = "charter-packet-manifest/v1";
107
+ /** A manifest row: an excerpt's coordinates without its text. */
108
+ export interface CharterPacketManifestExcerpt {
109
+ excerpt_id: string;
110
+ source_path: string;
111
+ evidence_class: EvidenceClass;
112
+ line_runs: PacketLineRun[];
113
+ line_count: number;
114
+ truncated: boolean;
115
+ prefix_width: number;
116
+ }
117
+ /**
118
+ * The machine header at the top of every packet, and — byte-identically — the
119
+ * lane asset the emit pass persists so the INGEST pass (a different invocation)
120
+ * can fold coverage into the register and check citations against what was
121
+ * actually delivered. One value, two renderings, emitted by one function, so the
122
+ * manifest a lane reads and the manifest a validator checks against cannot drift.
123
+ */
124
+ export interface CharterPacketManifest {
125
+ schema_version: typeof CHARTER_PACKET_MANIFEST_SCHEMA_VERSION;
126
+ kind: CharterKind;
127
+ excerpts: CharterPacketManifestExcerpt[];
128
+ coverage: CharterPacketCoverage;
129
+ }
130
+ /**
131
+ * The affirmation that the citation check RAN. `validation_issues: []` is
132
+ * unfalsifiable on its own — it printed identically at 1-of-15 correct citations
133
+ * and at 75-of-75 — so an empty issue list is only ever emitted beside a stated
134
+ * status and a stated count.
135
+ *
136
+ * `not_run` is a RECORDED ABSTENTION, never an implicit pass: it means no
137
+ * repository root was available to check against. `no_citations` is the omit
138
+ * path — a pass that authored nothing has nothing to certify, and must not
139
+ * report `checked` over work it never examined.
140
+ */
141
+ export interface CitationValidationSummary {
142
+ status: "checked" | "not_run" | "no_citations";
143
+ /** Provenance refs seen. */
144
+ citation_count: number;
145
+ /** Refs parsed and validated. */
146
+ checked_count: number;
147
+ failed_count: number;
148
+ /**
149
+ * Whether the delivered-evidence leg ran. False when no packet manifest was
150
+ * available at ingest — the range was still checked against the file, but
151
+ * "was this line ever handed to the author" was not asked.
152
+ */
153
+ delivered_evidence_checked: boolean;
154
+ }
155
+ //# sourceMappingURL=charterPacket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charterPacket.d.ts","sourceRoot":"","sources":["../../../src/shared/types/charterPacket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,SAAS,GACT,aAAa,GACb,iBAAiB,CAAC;AAEtB,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAKpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB,cAAc,GACd,yBAAyB,GACzB,YAAY,CAAC;AAEjB,m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SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,OAAO,sCAAsC,CAAC;IAC9D,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,4BAA4B,EAAE,CAAC;IACzC,QAAQ,EAAE,qBAAqB,CAAC;CACjC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,cAAc,CAAC;IAC/C,4BAA4B;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,0BAA0B,EAAE,OAAO,CAAC;CACrC"}
@@ -0,0 +1,9 @@
1
+ /** Canonical class order — the one home, so every consumer sorts identically. */
2
+ export const EVIDENCE_CLASSES = [
3
+ "comment",
4
+ "declaration",
5
+ "doc",
6
+ "stripped_source",
7
+ ];
8
+ export const CHARTER_PACKET_MANIFEST_SCHEMA_VERSION = "charter-packet-manifest/v1";
9
+ //# sourceMappingURL=charterPacket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charterPacket.js","sourceRoot":"","sources":["../../../src/shared/types/charterPacket.ts"],"names":[],"mappings":"AAiCA,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,SAAS;IACT,aAAa;IACb,KAAK;IACL,iBAAiB;CAClB,CAAC;AAoFF,MAAM,CAAC,MAAM,sCAAsC,GACjD,4BAA4B,CAAC"}