audit-tools 0.40.1 → 0.41.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 (114) hide show
  1. package/dist/audit/cli/auditStep.d.ts +1 -1
  2. package/dist/audit/cli/conceptualDispatch.d.ts +3 -0
  3. package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
  4. package/dist/audit/cli/conceptualDispatch.js +82 -24
  5. package/dist/audit/cli/conceptualDispatch.js.map +1 -1
  6. package/dist/audit/cli/dispatch/hostHandoff.d.ts +12 -0
  7. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  8. package/dist/audit/cli/dispatch/hostHandoff.js +84 -56
  9. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  10. package/dist/audit/cli/fanoutLanes.d.ts +47 -11
  11. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  12. package/dist/audit/cli/fanoutLanes.js +15 -7
  13. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  14. package/dist/audit/cli/laneSubmissions.d.ts +241 -0
  15. package/dist/audit/cli/laneSubmissions.d.ts.map +1 -0
  16. package/dist/audit/cli/laneSubmissions.js +438 -0
  17. package/dist/audit/cli/laneSubmissions.js.map +1 -0
  18. package/dist/audit/cli/laneValidators.d.ts +65 -0
  19. package/dist/audit/cli/laneValidators.d.ts.map +1 -0
  20. package/dist/audit/cli/laneValidators.js +145 -0
  21. package/dist/audit/cli/laneValidators.js.map +1 -0
  22. package/dist/audit/cli/nextStepCommand.d.ts +1 -1
  23. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  24. package/dist/audit/cli/nextStepCommand.js +118 -69
  25. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  26. package/dist/audit/cli/nextStepHelpers.d.ts +73 -42
  27. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  28. package/dist/audit/cli/nextStepHelpers.js +389 -253
  29. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  30. package/dist/audit/cli/recoverSubmissionCommand.d.ts +16 -0
  31. package/dist/audit/cli/recoverSubmissionCommand.d.ts.map +1 -0
  32. package/dist/audit/cli/recoverSubmissionCommand.js +73 -0
  33. package/dist/audit/cli/recoverSubmissionCommand.js.map +1 -0
  34. package/dist/audit/cli/semanticReviewStep.d.ts +3 -0
  35. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  36. package/dist/audit/cli/semanticReviewStep.js +26 -1
  37. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  38. package/dist/audit/cli/steps.d.ts +75 -2
  39. package/dist/audit/cli/steps.d.ts.map +1 -1
  40. package/dist/audit/cli/steps.js +14 -0
  41. package/dist/audit/cli/steps.js.map +1 -1
  42. package/dist/audit/cli.d.ts.map +1 -1
  43. package/dist/audit/cli.js +5 -1
  44. package/dist/audit/cli.js.map +1 -1
  45. package/dist/audit/contracts/wrapperResponse.d.ts +7 -7
  46. package/dist/audit/contracts/wrapperResponse.js +1 -1
  47. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  48. package/dist/audit/io/artifacts.d.ts +12 -1
  49. package/dist/audit/io/artifacts.d.ts.map +1 -1
  50. package/dist/audit/io/artifacts.js +28 -1
  51. package/dist/audit/io/artifacts.js.map +1 -1
  52. package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
  53. package/dist/audit/orchestrator/synthesisExecutors.js +2 -0
  54. package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
  55. package/dist/audit/reporting/synthesis.d.ts +9 -1
  56. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  57. package/dist/audit/reporting/synthesis.js +69 -1
  58. package/dist/audit/reporting/synthesis.js.map +1 -1
  59. package/dist/audit/supervisor/operatorHandoff.d.ts +9 -2
  60. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  61. package/dist/audit/supervisor/operatorHandoff.js +17 -10
  62. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  63. package/dist/audit/types/designAssessment.d.ts +9 -5
  64. package/dist/audit/types/designAssessment.d.ts.map +1 -1
  65. package/dist/remediate/index.d.ts.map +1 -1
  66. package/dist/remediate/index.js +48 -1
  67. package/dist/remediate/index.js.map +1 -1
  68. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +38 -6
  69. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  70. package/dist/remediate/steps/dispatch/hostHandoff.js +87 -75
  71. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  72. package/dist/shared/decompose/charterClarification.d.ts +1 -1
  73. package/dist/shared/decompose/charterClarification.js +1 -1
  74. package/dist/shared/decompose/charterExtraction.js +1 -1
  75. package/dist/shared/decompose/charterExtraction.js.map +1 -1
  76. package/dist/shared/decompose/systemicChallenge.js +1 -1
  77. package/dist/shared/decompose/systemicChallenge.js.map +1 -1
  78. package/dist/shared/index.d.ts +11 -1
  79. package/dist/shared/index.d.ts.map +1 -1
  80. package/dist/shared/index.js +6 -1
  81. package/dist/shared/index.js.map +1 -1
  82. package/dist/shared/io/auditToolsPaths.d.ts +24 -4
  83. package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
  84. package/dist/shared/io/auditToolsPaths.js +29 -5
  85. package/dist/shared/io/auditToolsPaths.js.map +1 -1
  86. package/dist/shared/io/schemaVersion.d.ts +5 -4
  87. package/dist/shared/io/schemaVersion.d.ts.map +1 -1
  88. package/dist/shared/io/schemaVersion.js +17 -5
  89. package/dist/shared/io/schemaVersion.js.map +1 -1
  90. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  91. package/dist/shared/loopCorePaths.js +8 -2
  92. package/dist/shared/loopCorePaths.js.map +1 -1
  93. package/dist/shared/submission/expectedSubmissions.d.ts +88 -0
  94. package/dist/shared/submission/expectedSubmissions.d.ts.map +1 -0
  95. package/dist/shared/submission/expectedSubmissions.js +84 -0
  96. package/dist/shared/submission/expectedSubmissions.js.map +1 -0
  97. package/dist/shared/submission/handRecovery.d.ts +37 -0
  98. package/dist/shared/submission/handRecovery.d.ts.map +1 -0
  99. package/dist/shared/submission/handRecovery.js +123 -0
  100. package/dist/shared/submission/handRecovery.js.map +1 -0
  101. package/dist/shared/submission/submissionClassifier.d.ts +48 -0
  102. package/dist/shared/submission/submissionClassifier.d.ts.map +1 -0
  103. package/dist/shared/submission/submissionClassifier.js +83 -0
  104. package/dist/shared/submission/submissionClassifier.js.map +1 -0
  105. package/dist/shared/submission/submissionIdentity.d.ts +49 -0
  106. package/dist/shared/submission/submissionIdentity.d.ts.map +1 -0
  107. package/dist/shared/submission/submissionIdentity.js +90 -0
  108. package/dist/shared/submission/submissionIdentity.js.map +1 -0
  109. package/dist/shared/submission/submissionLedger.d.ts +37 -0
  110. package/dist/shared/submission/submissionLedger.d.ts.map +1 -0
  111. package/dist/shared/submission/submissionLedger.js +81 -0
  112. package/dist/shared/submission/submissionLedger.js.map +1 -0
  113. package/docs/audit-pkg/product.md +0 -2
  114. package/package.json +1 -1
@@ -1,54 +1,90 @@
1
+ import { type LaneSubmissionShortfall } from "./laneSubmissions.js";
1
2
  /**
2
3
  * Always-materialized fan-out lanes (design resolution 2, 2026-08-05).
3
4
  *
4
5
  * A fan-out step never inlines lane work into its step prompt and never
5
6
  * branches on host capability: every lane's prompt is a FILE on disk and every
6
- * lane's result is a FILE on disk, identical across IDEs/providers, so a run is
7
- * resumable and parallelizable regardless of who executes the lanes. Lane
7
+ * lane's submission is a FILE on disk, identical across IDEs/providers, so a run
8
+ * is resumable and parallelizable regardless of who executes the lanes. Lane
8
9
  * prompt files are ADVANCE-FREE — the continue-command lives in the step
9
10
  * prompt, never inside a lane file, so no lane executor can become a second
10
11
  * orchestrator driver (the same property `prepareContractDispatch` pins for
11
12
  * design review).
12
13
  *
13
- * K-of-N resume: a lane whose RESULT file already exists under `incoming/` is
14
+ * This is also the MINTING CHOKEPOINT: a lane declares an id and a prompt, and
15
+ * the tool derives where the answer goes. A lane spec cannot name its own
16
+ * result file, so a host-typed filename is not expressible here or in any
17
+ * caller.
18
+ *
19
+ * K-of-N resume: a lane whose submission already exists at its bound path is
14
20
  * complete — its prompt is not rewritten and it is excluded from the pending
15
21
  * set, so a re-emitted step instructs only the missing lanes and never
16
22
  * regenerates or overwrites completed lane results.
17
23
  */
18
24
  export interface FanoutLaneSpec {
19
- /** Stable lane id — becomes the `artifact_paths` key prefix. */
25
+ /**
26
+ * Stable lane id — the `artifact_paths` key prefix AND the identity the
27
+ * lane's submission path is derived from, so it must be unique across the
28
+ * whole audit and stable across re-emissions of the same lane.
29
+ */
20
30
  id: string;
21
31
  /** Human label rendered into the step's lane list. */
22
32
  label: string;
23
- /** Lane prompt filename under `incoming/`. */
33
+ /** Lane prompt filename under the tool-owned lane-asset dir. */
24
34
  promptFilename: string;
25
- /** Lane result filename under `incoming/`. */
26
- resultFilename: string;
27
35
  /** Advance-free lane prompt body (no continue-command). */
28
36
  promptText: string;
37
+ /**
38
+ * False for a lane whose submission the TOOL never reads — a host-side
39
+ * intermediate another lane consumes (the conceptual perspectives, which
40
+ * only the judge reads). Its bound path is still minted, declared, and
41
+ * rendered so the worker has a tool-named place to write; but nothing is
42
+ * ever owed to the tool, so it is not an expected submission, appears in no
43
+ * expected set, and produces no ledger expectation the run can never
44
+ * satisfy. Defaults to true — a lane owes the tool a submission unless it
45
+ * says otherwise.
46
+ */
47
+ expected?: boolean;
29
48
  }
30
49
  export interface MaterializedFanoutLane {
31
50
  id: string;
32
51
  label: string;
33
52
  promptPath: string;
53
+ /** Tool-computed bound path this lane's submission must land at. */
34
54
  resultPath: string;
35
- /** True when the lane's result file already exists (K-of-N resume). */
55
+ /** True when the lane's submission already exists (K-of-N resume). */
36
56
  resultExists: boolean;
37
57
  }
38
58
  export interface MaterializedFanout {
39
59
  lanes: MaterializedFanoutLane[];
40
- /** Lanes still owed a result — the only lanes the step instructs. */
60
+ /** Lanes still owed a submission — the only lanes the step instructs. */
41
61
  pendingLanes: MaterializedFanoutLane[];
42
62
  /** `<id>_prompt` / `<id>_results` entries for the step contract. */
43
63
  artifactPaths: Record<string, string>;
44
64
  /** Pending lanes' prompt paths (step `access.read_paths`). */
45
65
  readPaths: string[];
46
- /** Pending lanes' result paths (step `access.write_paths`). */
66
+ /** Pending lanes' bound submission paths (step `access.write_paths`). */
47
67
  writePaths: string[];
68
+ /**
69
+ * What a PREVIOUS emission of these lanes is still owed — empty on a first
70
+ * emission. Rendered into the re-emitted step prompt and persisted on the
71
+ * step contract so a dropped lane is reported by name instead of showing up
72
+ * as the same step arriving twice.
73
+ */
74
+ shortfall: LaneSubmissionShortfall;
48
75
  }
49
- /** Write the pending lanes' prompt files and describe the whole fan-out. */
76
+ /**
77
+ * Write the pending lanes' prompt files, record what the emission owes, and
78
+ * describe the whole fan-out.
79
+ */
50
80
  export declare function materializeFanoutLanes(params: {
51
81
  artifactsDir: string;
82
+ /**
83
+ * The scope the lane submissions belong to. Audit gate emitters pass
84
+ * `AUDIT_GATE_SUBMISSION_SCOPE` — see `laneSubmissions.ts` for why the gates
85
+ * have no run id of their own.
86
+ */
87
+ runId: string;
52
88
  lanes: FanoutLaneSpec[];
53
89
  }): Promise<MaterializedFanout>;
54
90
  //# sourceMappingURL=fanoutLanes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fanoutLanes.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/fanoutLanes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAA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MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,yEAAyE;IACzE,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,8DAA8D;IAC9D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,yEAAyE;IACzE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;;OAKG;IACH,SAAS,EAAE,uBAAuB,CAAC;CACpC;AAWD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAmD9B"}
@@ -1,6 +1,7 @@
1
- import { mkdir, writeFile } from "node:fs/promises";
2
- import { access } from "node:fs/promises";
1
+ import { access, mkdir, writeFile } from "node:fs/promises";
3
2
  import { join } from "node:path";
3
+ import { laneAssetsDir } from "audit-tools/shared";
4
+ import { laneSubmissionPath, recordExpectedLanes, } from "./laneSubmissions.js";
4
5
  async function fileExists(path) {
5
6
  try {
6
7
  await access(path);
@@ -10,14 +11,17 @@ async function fileExists(path) {
10
11
  return false;
11
12
  }
12
13
  }
13
- /** Write the pending lanes' prompt files and describe the whole fan-out. */
14
+ /**
15
+ * Write the pending lanes' prompt files, record what the emission owes, and
16
+ * describe the whole fan-out.
17
+ */
14
18
  export async function materializeFanoutLanes(params) {
15
- const incoming = join(params.artifactsDir, "incoming");
16
- await mkdir(incoming, { recursive: true });
19
+ const promptDir = laneAssetsDir(params.artifactsDir);
20
+ await mkdir(promptDir, { recursive: true });
17
21
  const lanes = [];
18
22
  for (const spec of params.lanes) {
19
- const promptPath = join(incoming, spec.promptFilename);
20
- const resultPath = join(incoming, spec.resultFilename);
23
+ const promptPath = join(promptDir, spec.promptFilename);
24
+ const resultPath = laneSubmissionPath(params.artifactsDir, spec.id, params.runId);
21
25
  const resultExists = await fileExists(resultPath);
22
26
  // Pending lanes always get a fresh prompt. A COMPLETED lane's prompt is
23
27
  // left untouched (its content matches the result that was produced) —
@@ -34,6 +38,9 @@ export async function materializeFanoutLanes(params) {
34
38
  resultExists,
35
39
  });
36
40
  }
41
+ const shortfall = await recordExpectedLanes(params.artifactsDir, params.runId, params.lanes
42
+ .filter((spec) => spec.expected !== false)
43
+ .map((spec) => ({ lane: spec.id, promptText: spec.promptText })));
37
44
  const pendingLanes = lanes.filter((lane) => !lane.resultExists);
38
45
  const artifactPaths = {};
39
46
  for (const lane of lanes) {
@@ -46,6 +53,7 @@ export async function materializeFanoutLanes(params) {
46
53
  artifactPaths,
47
54
  readPaths: pendingLanes.map((lane) => lane.promptPath),
48
55
  writePaths: pendingLanes.map((lane) => lane.resultPath),
56
+ shortfall,
49
57
  };
50
58
  }
51
59
  //# sourceMappingURL=fanoutLanes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fanoutLanes.js","sourceRoot":"","sources":["../../../src/audit/cli/fanoutLanes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqDjC,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,MAG5C;IACC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC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ACb,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;QACtD,UAAU,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC;QACvD,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,241 @@
1
+ /**
2
+ * The audit draw of the shared submission core: how a GATE lane's bound path is
3
+ * computed, and where the expected-set / ledger for those lanes are persisted.
4
+ *
5
+ * Two facts about the audit gates shape everything here:
6
+ *
7
+ * 1. **They carry no run id.** `NextStepParams` has none, and threading one
8
+ * into every gate would change ten signatures to carry a value the gates
9
+ * never use. Their submissions are therefore ARTIFACTS-DIR-scoped: the
10
+ * constant `AUDIT_GATE_SUBMISSION_SCOPE` stands in for run identity, so the
11
+ * same gate lane in the same artifacts dir denotes the same submission
12
+ * across `next-step` calls. That is not a shortcut — it is exactly the
13
+ * K-of-N resume property, which requires a re-emitted step to re-declare
14
+ * the identical bound path rather than mint a new one and re-ask for work
15
+ * the host already delivered.
16
+ *
17
+ * 2. **The lane id is the only join key.** The emitter and the gate reader
18
+ * never meet; they agree because both derive the id from the lane id
19
+ * through this module. A lane id is declared once in
20
+ * `HOST_GATE_DESCRIPTORS` and used verbatim on both sides.
21
+ *
22
+ * The bound path is DERIVED, not looked up. The persisted expected set states
23
+ * what is owed (and feeds the diff and the ledger), but a gate that could only
24
+ * read a submission when a bookkeeping file happened to exist would lose a
25
+ * valid submission the first time that file was absent — so derivation is the
26
+ * mechanism and the record is the record.
27
+ */
28
+ import { z } from "zod";
29
+ import { type CharterKind, type SubmissionIssue, type SubmissionIssueCode, type SubmissionRoots } from "audit-tools/shared";
30
+ /**
31
+ * Gate lane ids — the single join key between an emitter and its gate reader.
32
+ *
33
+ * The two never meet: an emitter writes a lane's prompt and declares where the
34
+ * answer goes, and (possibly several `next-step` calls later) the gate reader
35
+ * looks for it. They agree because both derive the bound path from the lane id
36
+ * through this module. Declared once, here, so no site can spell a lane one way
37
+ * on the emit side and another on the read side.
38
+ */
39
+ export declare const GATE_LANES: {
40
+ readonly analyzer_consent: "analyzer_consent";
41
+ readonly analyzer_decisions: "analyzer_decisions";
42
+ readonly edge_reasoning: "edge_reasoning";
43
+ readonly design_review_legacy: "design_review_legacy";
44
+ readonly design_review_contract: "design_review_contract";
45
+ readonly design_review_conceptual: "design_review_conceptual";
46
+ readonly critical_flow_fallback: "critical_flow_fallback";
47
+ readonly intent_equivalence: "intent_equivalence";
48
+ readonly synthesis_narrative: "synthesis_narrative";
49
+ readonly charter_delta: "charter_delta";
50
+ readonly charter_clarification: "charter_clarification";
51
+ readonly systemic_challenge: "systemic_challenge";
52
+ };
53
+ /** The blind per-kind charter lanes (one per estimator channel). */
54
+ export declare function charterExtractionLane(kind: CharterKind): string;
55
+ /** Recover the charter kind a `charter_extraction_*` lane id denotes. */
56
+ export declare function charterKindForLane(lane: string): CharterKind | undefined;
57
+ export declare const CONCEPTUAL_PERSPECTIVE_LANE_PREFIX = "design_review_conceptual_p";
58
+ /**
59
+ * The deep conceptual pass's independent perspective lanes. Their COUNT is
60
+ * resolved at emit from confirmed intent, so the ids are generated rather than
61
+ * enumerated.
62
+ *
63
+ * The id carries the ROUND — a digest of the upstream content the round asks
64
+ * about — because a perspective is the one lane class whose reuse is WRONG.
65
+ * Every other lane's identity is deliberately stable so a re-emitted step
66
+ * re-declares the same bound path (K-of-N resume); a perspective, though, is a
67
+ * fresh independent reading of the artifacts as they now stand. Keyed on the
68
+ * index alone, a re-review after staleness would find the PREVIOUS round's
69
+ * submission at the bound path, skip the lane, leave its prompt unrewritten,
70
+ * and hand the judge the old round's findings as if they were this round's.
71
+ * Same round, same digest, same id — so resume WITHIN a round still works.
72
+ */
73
+ export declare function conceptualPerspectiveLane(index: number, roundToken: string): string;
74
+ /**
75
+ * The round token every perspective lane in one deep conceptual emission
76
+ * shares: a digest of exactly what this round asks. Deterministic in its inputs
77
+ * — never a timestamp or a counter, which would mint new ids (and re-ask for
78
+ * already-delivered work) on every re-emission of an unchanged round.
79
+ */
80
+ export declare function conceptualRoundToken(inputs: readonly string[]): string;
81
+ /**
82
+ * The per-kind evidence packet a charter lane reads. TOOL-written, so it lives
83
+ * under the lane-asset dir with the lane prompts — a host only ever reads it.
84
+ */
85
+ export declare function charterExtractionPacketFilename(kind: CharterKind): string;
86
+ /**
87
+ * The tool-side merge of the per-kind charter lanes, handed to the extraction
88
+ * executor by path and deleted once ingested. Tool-written, so it is a lane
89
+ * asset and not a submission.
90
+ */
91
+ export declare const CHARTER_EXTRACTION_MERGED_FILENAME = "charter-extraction-merged.json";
92
+ /**
93
+ * The submission FAMILY every audit gate lane belongs to. Distinguishes these
94
+ * from the host-handoff work-item submissions, which mint through the same rule
95
+ * under their own run id.
96
+ */
97
+ export declare const AUDIT_LANE_SUBMISSION_KIND = "audit_host_lane";
98
+ /** See the module comment: the audit gates' stand-in for run identity. */
99
+ export declare const AUDIT_GATE_SUBMISSION_SCOPE = "audit-host-gates";
100
+ /**
101
+ * Bound paths for gate lanes are expressed relative to the artifact tree root
102
+ * (`.audit-tools/`), not the repository root: the gates are handed an artifacts
103
+ * dir and nothing else, and a recorded path must be derivable from exactly what
104
+ * the reader has.
105
+ */
106
+ export declare function laneSubmissionRoots(artifactsDir: string): SubmissionRoots;
107
+ /** The tool-minted id for one lane. Deterministic in the lane id alone. */
108
+ export declare function laneSubmissionId(lane: string, runId?: string): string;
109
+ /**
110
+ * Absolute on-disk path a lane's submission must land at.
111
+ *
112
+ * `runId` is threaded rather than defaulted-and-forgotten: the bound path and
113
+ * the recorded expectation must come from ONE derivation. They were two — the
114
+ * path taking the module constant while the record took the caller's scope —
115
+ * which coincided only because every caller happened to pass the constant, i.e.
116
+ * the invariant held by the caller remembering.
117
+ */
118
+ export declare function laneSubmissionPath(artifactsDir: string, lane: string, runId?: string): string;
119
+ /** One lane an emission owes, as the emitter knows it. */
120
+ export interface DeclaredLane {
121
+ readonly lane: string;
122
+ readonly promptText: string;
123
+ }
124
+ export declare const LaneSubmissionShortfallSchema: z.ZodObject<{
125
+ /** Lanes CARRIED into this emission (a prior emission already asked). */
126
+ expected: z.ZodNumber;
127
+ /** How many of those have a readable submission at their bound path. */
128
+ accepted: z.ZodNumber;
129
+ outstanding: z.ZodArray<z.ZodObject<{
130
+ lane: z.ZodString;
131
+ submission_id: z.ZodString;
132
+ /**
133
+ * The tool-computed bound path, ABSOLUTE — the same form (and the same
134
+ * file) as the step's `access.write_paths` entry for this lane, so the two
135
+ * compare directly. Deliberately NOT the expected set's recorded form:
136
+ * that one is relative to the artifact tree root, a base the step contract
137
+ * declares nowhere, so a consumer joining it against `repo_root` or
138
+ * `artifacts_dir` would build a path that never existed. `extraFields` ride
139
+ * through `writeStepContract` un-normalized (only prompt_path / repo_root /
140
+ * artifacts_dir / artifact_paths are), exactly as `access` does.
141
+ */
142
+ submission_path: z.ZodString;
143
+ issue_code: z.ZodString;
144
+ message: z.ZodString;
145
+ }, "strict", z.ZodTypeAny, {
146
+ message: string;
147
+ submission_path: string;
148
+ lane: string;
149
+ submission_id: string;
150
+ issue_code: string;
151
+ }, {
152
+ message: string;
153
+ submission_path: string;
154
+ lane: string;
155
+ submission_id: string;
156
+ issue_code: string;
157
+ }>, "many">;
158
+ }, "strict", z.ZodTypeAny, {
159
+ expected: number;
160
+ accepted: number;
161
+ outstanding: {
162
+ message: string;
163
+ submission_path: string;
164
+ lane: string;
165
+ submission_id: string;
166
+ issue_code: string;
167
+ }[];
168
+ }, {
169
+ expected: number;
170
+ accepted: number;
171
+ outstanding: {
172
+ message: string;
173
+ submission_path: string;
174
+ lane: string;
175
+ submission_id: string;
176
+ issue_code: string;
177
+ }[];
178
+ }>;
179
+ export type LaneSubmissionShortfall = z.infer<typeof LaneSubmissionShortfallSchema>;
180
+ /**
181
+ * Record what this emission owes, and report what a PREVIOUS one is still owed.
182
+ *
183
+ * Merges into the current statement (a step that materializes several lane
184
+ * groups accumulates them) and appends one `expected` event per NEWLY declared
185
+ * lane, so a re-emission does not spam the arrival record.
186
+ *
187
+ * The returned shortfall diffs only the lanes CARRIED into this emission — the
188
+ * ones an earlier emission already asked for and that are still not on disk.
189
+ * Restricting it to carried lanes is what makes the report meaningful: on a
190
+ * first emission every lane is legitimately absent (it is being asked for right
191
+ * now), so counting those would make every fan-out look like a failure.
192
+ */
193
+ export declare function recordExpectedLanes(artifactsDir: string, runId: string, lanes: readonly DeclaredLane[]): Promise<LaneSubmissionShortfall>;
194
+ /** Merge the shortfalls of a step that materializes several lane groups. */
195
+ export declare function mergeLaneShortfalls(shortfalls: readonly LaneSubmissionShortfall[]): LaneSubmissionShortfall;
196
+ /**
197
+ * The host-facing statement of an unmet expectation, by lane and issue code.
198
+ * Empty when nothing was carried or everything carried has arrived — a clean
199
+ * emission says nothing, so the notice's presence is itself the signal.
200
+ */
201
+ export declare function renderLaneShortfallLines(shortfall: LaneSubmissionShortfall): string[];
202
+ /**
203
+ * Record the outcome of one lane. An accepted lane stops being owed; a rejected
204
+ * one stays owed (the host is asked again) but the refusal is on the record
205
+ * with its reason, which is what makes a repaired run distinguishable from a
206
+ * clean one.
207
+ */
208
+ export declare function recordLaneOutcome(artifactsDir: string, lane: string, outcome: {
209
+ readonly kind: "accepted";
210
+ readonly message?: string;
211
+ } | {
212
+ readonly kind: "rejected";
213
+ readonly issueCode: SubmissionIssueCode;
214
+ readonly message: string;
215
+ }): Promise<void>;
216
+ /**
217
+ * Record what the host-handoff ingest just decided about each work item, on the
218
+ * same ledger the gate lanes use — so a submission that never arrived (or
219
+ * arrived unreadable) is a durable fact rather than a value that died inside
220
+ * the call that computed it.
221
+ *
222
+ * Two rules keep the record drift-focused and arithmetically honest:
223
+ *
224
+ * • Deduped against the LAST recorded event for each submission. Ingest runs
225
+ * on every `next-step`, so a host still working through its workload would
226
+ * otherwise append the same "missing" line every poll, burying the state
227
+ * CHANGES the ledger exists to preserve. A changed classification still
228
+ * appends, in arrival order.
229
+ * • An acceptance is recorded ONLY where a refusal precedes it. A work item
230
+ * the host got right first try says nothing (the ledger is not an inventory
231
+ * of work), but one that was refused and later accepted must close its own
232
+ * story — otherwise a run where every failure was repaired reports its
233
+ * refusals with no matching repairs, and the report reads as a run that
234
+ * never recovered.
235
+ */
236
+ export declare function recordHostResultOutcomes(artifactsDir: string, runId: string, outcomes: {
237
+ readonly issues: readonly SubmissionIssue[];
238
+ /** Work items whose results this run has accepted (ingest's completed set). */
239
+ readonly acceptedIds: readonly string[];
240
+ }): Promise<void>;
241
+ //# sourceMappingURL=laneSubmissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"laneSubmissions.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/laneSubmissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAoBL,KAAK,WAAW,EAGhB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAGxB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAab,CAAC;AAEX,oEAAoE;AACpE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAE/D;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAMxE;AAID,eAAO,MAAM,kCAAkC,+BAA+B,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,WAAW,GAA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