@telora/daemon 0.22.169 → 0.22.187

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 (254) hide show
  1. package/build-info.json +9 -3
  2. package/dist/audit/audit-floor-policy.d.ts +188 -0
  3. package/dist/audit/audit-floor-policy.d.ts.map +1 -0
  4. package/dist/audit/audit-floor-policy.js +353 -0
  5. package/dist/audit/audit-floor-policy.js.map +1 -0
  6. package/dist/audit/audit-prompt.d.ts +4 -177
  7. package/dist/audit/audit-prompt.d.ts.map +1 -1
  8. package/dist/audit/audit-prompt.js +6 -329
  9. package/dist/audit/audit-prompt.js.map +1 -1
  10. package/dist/completion/commit-verdict-release.d.ts +37 -1
  11. package/dist/completion/commit-verdict-release.d.ts.map +1 -1
  12. package/dist/completion/commit-verdict-release.js +90 -15
  13. package/dist/completion/commit-verdict-release.js.map +1 -1
  14. package/dist/completion/escalations.d.ts.map +1 -1
  15. package/dist/completion/escalations.js +3 -1
  16. package/dist/completion/escalations.js.map +1 -1
  17. package/dist/completion/review-exit-verdict-gate.d.ts +11 -5
  18. package/dist/completion/review-exit-verdict-gate.d.ts.map +1 -1
  19. package/dist/completion/review-exit-verdict-gate.js +6 -3
  20. package/dist/completion/review-exit-verdict-gate.js.map +1 -1
  21. package/dist/delivery/commit-verdict-hold.d.ts.map +1 -1
  22. package/dist/delivery/commit-verdict-hold.js +2 -1
  23. package/dist/delivery/commit-verdict-hold.js.map +1 -1
  24. package/dist/directive/stranded-review-reroute.js +1 -1
  25. package/dist/directive/stranded-review-reroute.js.map +1 -1
  26. package/dist/focus/focus-executor.d.ts.map +1 -1
  27. package/dist/focus/focus-executor.js +2 -0
  28. package/dist/focus/focus-executor.js.map +1 -1
  29. package/dist/focus/pending-review-approved-head.d.ts +1 -1
  30. package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
  31. package/dist/focus/pending-review-approved-head.js +4 -3
  32. package/dist/focus/pending-review-approved-head.js.map +1 -1
  33. package/dist/focus/session-health.d.ts.map +1 -1
  34. package/dist/focus/session-health.js +2 -1
  35. package/dist/focus/session-health.js.map +1 -1
  36. package/dist/focus-stage-lifecycle/planning-release.d.ts +52 -17
  37. package/dist/focus-stage-lifecycle/planning-release.d.ts.map +1 -1
  38. package/dist/focus-stage-lifecycle/planning-release.js +58 -70
  39. package/dist/focus-stage-lifecycle/planning-release.js.map +1 -1
  40. package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts +108 -0
  41. package/dist/focus-stage-lifecycle/ratify-bar-gate.d.ts.map +1 -0
  42. package/dist/focus-stage-lifecycle/ratify-bar-gate.js +174 -0
  43. package/dist/focus-stage-lifecycle/ratify-bar-gate.js.map +1 -0
  44. package/dist/git/merge-to-main.d.ts.map +1 -1
  45. package/dist/git/merge-to-main.js.map +1 -1
  46. package/dist/nexus/index.d.ts.map +1 -1
  47. package/dist/nexus/index.js +2 -1
  48. package/dist/nexus/index.js.map +1 -1
  49. package/dist/nexus/intake-prompt-sections.d.ts +70 -0
  50. package/dist/nexus/intake-prompt-sections.d.ts.map +1 -0
  51. package/dist/nexus/intake-prompt-sections.js +145 -0
  52. package/dist/nexus/intake-prompt-sections.js.map +1 -0
  53. package/dist/nexus/intake-spawn.d.ts +49 -13
  54. package/dist/nexus/intake-spawn.d.ts.map +1 -1
  55. package/dist/nexus/intake-spawn.js +45 -122
  56. package/dist/nexus/intake-spawn.js.map +1 -1
  57. package/dist/nexus/intake.d.ts +55 -0
  58. package/dist/nexus/intake.d.ts.map +1 -1
  59. package/dist/nexus/intake.js +62 -1
  60. package/dist/nexus/intake.js.map +1 -1
  61. package/dist/prd/arm-readiness.d.ts +93 -0
  62. package/dist/prd/arm-readiness.d.ts.map +1 -0
  63. package/dist/prd/arm-readiness.js +254 -0
  64. package/dist/prd/arm-readiness.js.map +1 -0
  65. package/dist/prd/arm-refusal.d.ts +149 -0
  66. package/dist/prd/arm-refusal.d.ts.map +1 -0
  67. package/dist/prd/arm-refusal.js +219 -0
  68. package/dist/prd/arm-refusal.js.map +1 -0
  69. package/dist/prd/controller-shared.d.ts +111 -0
  70. package/dist/prd/controller-shared.d.ts.map +1 -1
  71. package/dist/prd/controller-shared.js +3 -1
  72. package/dist/prd/controller-shared.js.map +1 -1
  73. package/dist/prd/controller.d.ts +16 -10
  74. package/dist/prd/controller.d.ts.map +1 -1
  75. package/dist/prd/controller.js +28 -35
  76. package/dist/prd/controller.js.map +1 -1
  77. package/dist/prd/frontier-arming.d.ts +151 -0
  78. package/dist/prd/frontier-arming.d.ts.map +1 -0
  79. package/dist/prd/frontier-arming.js +315 -0
  80. package/dist/prd/frontier-arming.js.map +1 -0
  81. package/dist/prd/index.d.ts +10 -1
  82. package/dist/prd/index.d.ts.map +1 -1
  83. package/dist/prd/index.js +9 -1
  84. package/dist/prd/index.js.map +1 -1
  85. package/dist/prd/scoping-prompt.d.ts +68 -0
  86. package/dist/prd/scoping-prompt.d.ts.map +1 -0
  87. package/dist/prd/scoping-prompt.js +86 -0
  88. package/dist/prd/scoping-prompt.js.map +1 -0
  89. package/dist/prompt/prompt-contradictions.d.ts +20 -1
  90. package/dist/prompt/prompt-contradictions.d.ts.map +1 -1
  91. package/dist/prompt/prompt-contradictions.js +35 -0
  92. package/dist/prompt/prompt-contradictions.js.map +1 -1
  93. package/dist/prompt/team-prompt-base.d.ts +18 -0
  94. package/dist/prompt/team-prompt-base.d.ts.map +1 -1
  95. package/dist/prompt/team-prompt-base.js +56 -11
  96. package/dist/prompt/team-prompt-base.js.map +1 -1
  97. package/dist/prompt-sections/persona-sections.d.ts +36 -13
  98. package/dist/prompt-sections/persona-sections.d.ts.map +1 -1
  99. package/dist/prompt-sections/persona-sections.js +93 -16
  100. package/dist/prompt-sections/persona-sections.js.map +1 -1
  101. package/dist/prompt-sections/scoping-sections.d.ts +19 -5
  102. package/dist/prompt-sections/scoping-sections.d.ts.map +1 -1
  103. package/dist/prompt-sections/scoping-sections.js +45 -38
  104. package/dist/prompt-sections/scoping-sections.js.map +1 -1
  105. package/dist/prompt-sections/shared.d.ts +8 -0
  106. package/dist/prompt-sections/shared.d.ts.map +1 -1
  107. package/dist/prompt-sections/shared.js.map +1 -1
  108. package/dist/queries/delivery-gate-state.js +1 -1
  109. package/dist/queries/focus-criteria-standing.d.ts +170 -7
  110. package/dist/queries/focus-criteria-standing.d.ts.map +1 -1
  111. package/dist/queries/focus-criteria-standing.js +143 -8
  112. package/dist/queries/focus-criteria-standing.js.map +1 -1
  113. package/dist/queries/focus-ratify-release.d.ts +43 -0
  114. package/dist/queries/focus-ratify-release.d.ts.map +1 -0
  115. package/dist/queries/focus-ratify-release.js +45 -0
  116. package/dist/queries/focus-ratify-release.js.map +1 -0
  117. package/dist/queries/focuses.d.ts +0 -10
  118. package/dist/queries/focuses.d.ts.map +1 -1
  119. package/dist/queries/focuses.js +2 -15
  120. package/dist/queries/focuses.js.map +1 -1
  121. package/dist/queries/prd.d.ts +31 -0
  122. package/dist/queries/prd.d.ts.map +1 -1
  123. package/dist/queries/prd.js +26 -1
  124. package/dist/queries/prd.js.map +1 -1
  125. package/dist/queries/shared.js +1 -1
  126. package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -1
  127. package/dist/resolvers/focus-criteria-standing.js +324 -25
  128. package/dist/resolvers/focus-criteria-standing.js.map +1 -1
  129. package/dist/resolvers/shared/review-window-commits.d.ts.map +1 -1
  130. package/dist/resolvers/shared/review-window-commits.js +2 -1
  131. package/dist/resolvers/shared/review-window-commits.js.map +1 -1
  132. package/dist/security/security-auto-inject.d.ts +51 -0
  133. package/dist/security/security-auto-inject.d.ts.map +1 -1
  134. package/dist/security/security-auto-inject.js +101 -11
  135. package/dist/security/security-auto-inject.js.map +1 -1
  136. package/dist/security/security-scan-engine.d.ts +4 -4
  137. package/dist/security/security-scan-engine.d.ts.map +1 -1
  138. package/dist/security/security-scan-engine.js +6 -0
  139. package/dist/security/security-scan-engine.js.map +1 -1
  140. package/dist/session/session-lineage.d.ts.map +1 -1
  141. package/dist/session/session-lineage.js +2 -0
  142. package/dist/session/session-lineage.js.map +1 -1
  143. package/dist/shell/constants.d.ts +5 -0
  144. package/dist/shell/constants.d.ts.map +1 -1
  145. package/dist/shell/constants.js +5 -0
  146. package/dist/shell/constants.js.map +1 -1
  147. package/dist/shell/daemon-instance.d.ts +74 -64
  148. package/dist/shell/daemon-instance.d.ts.map +1 -1
  149. package/dist/shell/daemon-instance.js +16 -121
  150. package/dist/shell/daemon-instance.js.map +1 -1
  151. package/dist/shell/health-events.js +1 -1
  152. package/dist/shell/health-events.js.map +1 -1
  153. package/dist/shell/instance-liveness.d.ts +112 -0
  154. package/dist/shell/instance-liveness.d.ts.map +1 -0
  155. package/dist/shell/instance-liveness.js +205 -0
  156. package/dist/shell/instance-liveness.js.map +1 -0
  157. package/dist/shell/schema-version-gate.d.ts +22 -0
  158. package/dist/shell/schema-version-gate.d.ts.map +1 -1
  159. package/dist/shell/schema-version-gate.js +116 -6
  160. package/dist/shell/schema-version-gate.js.map +1 -1
  161. package/dist/shell/worker-pidfile.d.ts +21 -8
  162. package/dist/shell/worker-pidfile.d.ts.map +1 -1
  163. package/dist/shell/worker-pidfile.js +38 -9
  164. package/dist/shell/worker-pidfile.js.map +1 -1
  165. package/dist/spawn/lead-launch.d.ts.map +1 -1
  166. package/dist/spawn/lead-launch.js +2 -1
  167. package/dist/spawn/lead-launch.js.map +1 -1
  168. package/dist/spawn/one-shot-scoping-spawn.d.ts +51 -0
  169. package/dist/spawn/one-shot-scoping-spawn.d.ts.map +1 -0
  170. package/dist/spawn/one-shot-scoping-spawn.js +156 -0
  171. package/dist/spawn/one-shot-scoping-spawn.js.map +1 -0
  172. package/dist/spawn/process-spawn.d.ts +12 -0
  173. package/dist/spawn/process-spawn.d.ts.map +1 -1
  174. package/dist/spawn/process-spawn.js +1 -1
  175. package/dist/spawn/process-spawn.js.map +1 -1
  176. package/dist/spawn/prompt-assembly.d.ts +8 -0
  177. package/dist/spawn/prompt-assembly.d.ts.map +1 -1
  178. package/dist/spawn/prompt-assembly.js +15 -3
  179. package/dist/spawn/prompt-assembly.js.map +1 -1
  180. package/dist/spawn/worktree-session.d.ts +24 -6
  181. package/dist/spawn/worktree-session.d.ts.map +1 -1
  182. package/dist/spawn/worktree-session.js +37 -14
  183. package/dist/spawn/worktree-session.js.map +1 -1
  184. package/dist/testing/arm-coverage-model.d.ts +75 -0
  185. package/dist/testing/arm-coverage-model.d.ts.map +1 -0
  186. package/dist/testing/arm-coverage-model.js +114 -0
  187. package/dist/testing/arm-coverage-model.js.map +1 -0
  188. package/dist/testing/fixtures/index.js +1 -1
  189. package/dist/types/index.js +1 -1
  190. package/dist/verify/commit-gate-configured.d.ts.map +1 -1
  191. package/dist/verify/commit-gate-configured.js +1 -1
  192. package/dist/verify/commit-gate-configured.js.map +1 -1
  193. package/dist/verify/commit-verdict-pull.d.ts +48 -0
  194. package/dist/verify/commit-verdict-pull.d.ts.map +1 -0
  195. package/dist/verify/commit-verdict-pull.js +148 -0
  196. package/dist/verify/commit-verdict-pull.js.map +1 -0
  197. package/dist/verify/commit-verdict-record.js +1 -1
  198. package/dist/verify/credit-rearm.js +1 -1
  199. package/dist/verify/credit-rearm.js.map +1 -1
  200. package/dist/verify/default-on-guards.d.ts +74 -0
  201. package/dist/verify/default-on-guards.d.ts.map +1 -0
  202. package/dist/verify/default-on-guards.js +305 -0
  203. package/dist/verify/default-on-guards.js.map +1 -0
  204. package/dist/verify/explicit-rearm.d.ts.map +1 -1
  205. package/dist/verify/explicit-rearm.js +1 -0
  206. package/dist/verify/explicit-rearm.js.map +1 -1
  207. package/dist/verify/gate-run-registry.d.ts.map +1 -1
  208. package/dist/verify/gate-run-registry.js +1 -0
  209. package/dist/verify/gate-run-registry.js.map +1 -1
  210. package/dist/verify/judged-ancestor.d.ts +41 -0
  211. package/dist/verify/judged-ancestor.d.ts.map +1 -0
  212. package/dist/verify/judged-ancestor.js +101 -0
  213. package/dist/verify/judged-ancestor.js.map +1 -0
  214. package/dist/verify/no-own-delta-verdict.d.ts +7 -2
  215. package/dist/verify/no-own-delta-verdict.d.ts.map +1 -1
  216. package/dist/verify/no-own-delta-verdict.js +14 -17
  217. package/dist/verify/no-own-delta-verdict.js.map +1 -1
  218. package/dist/verify/rework-attribution.d.ts +71 -0
  219. package/dist/verify/rework-attribution.d.ts.map +1 -0
  220. package/dist/verify/rework-attribution.js +263 -0
  221. package/dist/verify/rework-attribution.js.map +1 -0
  222. package/dist/verify/shortfall-rulings.d.ts.map +1 -1
  223. package/dist/verify/shortfall-rulings.js +3 -2
  224. package/dist/verify/shortfall-rulings.js.map +1 -1
  225. package/dist/verify/verification-boundary-env.d.ts +70 -17
  226. package/dist/verify/verification-boundary-env.d.ts.map +1 -1
  227. package/dist/verify/verification-boundary-env.js +88 -14
  228. package/dist/verify/verification-boundary-env.js.map +1 -1
  229. package/dist/verify/verification-commit-sharing.d.ts.map +1 -1
  230. package/dist/verify/verification-commit-sharing.js +2 -1
  231. package/dist/verify/verification-commit-sharing.js.map +1 -1
  232. package/dist/verify/verification-config.d.ts.map +1 -1
  233. package/dist/verify/verification-config.js +1 -0
  234. package/dist/verify/verification-config.js.map +1 -1
  235. package/dist/verify/verification-default-on.d.ts +0 -32
  236. package/dist/verify/verification-default-on.d.ts.map +1 -1
  237. package/dist/verify/verification-default-on.js +10 -234
  238. package/dist/verify/verification-default-on.js.map +1 -1
  239. package/dist/verify/verification-deps-default.d.ts.map +1 -1
  240. package/dist/verify/verification-deps-default.js +9 -0
  241. package/dist/verify/verification-deps-default.js.map +1 -1
  242. package/dist/verify/verification-engine.d.ts +2 -1
  243. package/dist/verify/verification-engine.d.ts.map +1 -1
  244. package/dist/verify/verification-engine.js +12 -4
  245. package/dist/verify/verification-engine.js.map +1 -1
  246. package/dist/verify/verification-feedback.d.ts +1 -1
  247. package/dist/verify/verification-feedback.d.ts.map +1 -1
  248. package/dist/verify/verification-feedback.js +5 -0
  249. package/dist/verify/verification-feedback.js.map +1 -1
  250. package/dist/verify/verification-rework-issue.d.ts +48 -7
  251. package/dist/verify/verification-rework-issue.d.ts.map +1 -1
  252. package/dist/verify/verification-rework-issue.js +111 -9
  253. package/dist/verify/verification-rework-issue.js.map +1 -1
  254. package/package.json +2 -2
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * Split out of audit-phase.ts (which owns the phase's orchestration: spawn,
5
5
  * session lineage, audit_runs persistence, summary parsing). This module is the
6
- * prompt half and is deliberately dependency-free -- pure string constants and
7
- * composition, no imports -- so the phase logic and the prompt text can be read
8
- * and changed independently.
6
+ * prompt half -- string constants and composition -- so the phase logic and the
7
+ * prompt text can be read and changed independently. Its ONE import is the
8
+ * rendered round-5 floor section (`audit-floor-policy.ts`), which carries the
9
+ * floor's normative content as typed data rather than as prose here.
9
10
  *
10
11
  * The posture-neutral discipline block below is kept BYTE-IDENTICAL to the MCP
11
12
  * package's copy and is gated by audit-guide-sync.test.ts (which reads THIS
@@ -26,180 +27,6 @@
26
27
  * (Bell CSN 2026-07-27).
27
28
  */
28
29
  export type AuditPosture = 'read_only' | 'live';
29
- /**
30
- * Round-5 pre-condition: the focus's own declared floor.
31
- *
32
- * Deliberately OUTSIDE the SHARED-AUDIT-GUIDE sentinels, for the same reason
33
- * the residue hold below is: it states a precondition that only a pass holding
34
- * the daemon's `focus.criteria_standing` section can satisfy, and the MCP
35
- * guide's readers have no such section.
36
- *
37
- * WHY IT EXISTS. Round 5 anchors one remediation delivery per injection, and
38
- * nothing in that loop ever asked what the focus SAID IT WAS FOR. An
39
- * elaboration loop with no stated stopping condition does not stop -- it runs
40
- * until someone gets tired -- so a focus grows deliveries while its declared
41
- * criteria sit close to met. The standing section is the stated condition; this
42
- * text is what makes the pass CONSULT it before it anchors, rather than after.
43
- *
44
- * The bases are given distinct instructions on purpose. The one that must not
45
- * collapse into the others is `no_criteria_declared`: an empty criteria set is
46
- * UNMEASURED, not arrived, and a pass that read it as a floor would stop
47
- * hardest on exactly the focuses that declared nothing to be measured against.
48
- *
49
- * WHAT THE FLOOR IS NOT (round-5 correction, 2026-09-18). An earlier wording
50
- * made CRITERION COVERAGE the test for whether a new root cause could be
51
- * anchored, which converts the floor into the freeze the request rules out: a
52
- * genuinely new root cause is perfectly capable of sitting inside an
53
- * already-addressed criterion, and suppressing it there loses real signal to a
54
- * bookkeeping fact about which criteria have deliveries pointing at them. The
55
- * floor turns on RESIDUE (or restatement) vs GENUINELY NEW ROOT CAUSE, which
56
- * is orthogonal to coverage: coverage answers "is there open declared work?",
57
- * never "is this cause new?".
58
- *
59
- * WHY THE FLOOR IS DATA (rounds 6-7, 2026-09-19). Two earlier guards READ the
60
- * hand-written floor prose looking for a restriction -- one sentence at a time,
61
- * then across a wider window -- and both lost the same way: the restriction
62
- * moved to a sentence the reading missed, or a wording its vocabulary lacked.
63
- * So the normative content became the structure below, the prose became its
64
- * rendering, and no rule carries a sentence of its own. The normative sentence
65
- * is COMPOSED from the rule's typed fields against a CLOSED lexicon
66
- * (`CANDIDATE_SUBJECT`, `DISPOSITION_VERB`, `UNCONDITIONAL_SCOPE`): subject
67
- * from `candidate`, verb from `disposition`, scope from `conditions`, where an
68
- * empty `conditions` renders an explicit "in every case this basis can present"
69
- * rather than a silence a reader fills with the old freeze. Keep that: it makes
70
- * a CONDITION countable instead of something to read prose for.
71
- *
72
- * WHY THE REMAINING PROSE IS PINNED BY EQUALITY (round-8 correction,
73
- * 2026-09-19). Round 7 left the context prose -- leads, situations, caveats,
74
- * obligations, and the two paragraphs `renderFloorSection` writes directly --
75
- * guarded by `findFloorProseViolations`, and the commit that shipped it called
76
- * that "a whitelist of CHANNEL, not an enumeration of wording". THAT CLAIM WAS
77
- * FALSE, and review demonstrated it. `CANDIDATE_NOUN` and
78
- * `DISPOSITION_VERB_IN_PROSE` are finite regex vocabularies, so the guard only
79
- * recognised a normative claim written in words it already knew: appending
80
- * "Fresh findings wait for review." or "A genuinely new root cause proceeds
81
- * after every existing delivery is reviewed." draws NO violation and renders a
82
- * contradictory restriction. Fourth iteration of one lesson, now unmistakable:
83
- * ANY guard asking "does this text MEAN something normative?" loses, because
84
- * meaning is open-ended.
85
- *
86
- * So the floor stops asking. This policy is a static constant, so the strings
87
- * it can put in front of an assessor are a fixed, finite set, and the PRIMARY
88
- * GUARANTEE is an equality pin on the whole rendered section:
89
- * `FLOOR_SECTION_PIN` in audit-phase.test.ts holds an independent copy and the
90
- * suite asserts `renderFloorSection()` equals it line for line. A synonym, an
91
- * unlisted vocabulary and a wording nobody imagined then fail identically --
92
- * not because a rule recognises them, but because none of them are the pinned
93
- * string. It covers EVERY string the assessor reads here, the two paragraphs
94
- * `renderFloorSection` writes among them, which no field-level guard ever saw.
95
- *
96
- * The cost is the intended one: editing floor prose is a TWO-PLACE, VISIBLE act
97
- * -- the author updates the pin in the same change and a reviewer reads both
98
- * halves. The pin is literal text rather than a checksum precisely so that
99
- * second half stays readable. Its LIMIT, plainly: the pin is scoped to this
100
- * floor section. It does not cover `AUDIT_UNREVIEWED_RESIDUE`, the posture
101
- * sections, or `AUDIT_GUIDE_SHARED` (which carries its own byte pin against the
102
- * MCP copy, in audit-guide-sync.test.ts).
103
- */
104
- /** A candidate for anchoring, in the floor's own terms. */
105
- export type AnchorCandidate = 'residue_or_restatement' | 'new_root_cause';
106
- /** What the floor does with a candidate. */
107
- export type AnchorDisposition = 'withhold' | 'anchor';
108
- /**
109
- * A fact a pass could mistake for the test. A factor named here is rendered as
110
- * explicitly NOT deciding; it may never appear as a condition (tests pin that).
111
- */
112
- export type NonDecidingFactor = 'criterion_coverage';
113
- /**
114
- * One normative rule of the floor: what happens to a candidate, and on what.
115
- *
116
- * Every field is a typed enum or a DECLARED list. There is deliberately no
117
- * sentence field: the rule's sentence is composed from these fields, because a
118
- * hand-written sentence is the one place a restriction can sit where no
119
- * structural channel sees it.
120
- */
121
- export interface AnchoringRule {
122
- readonly candidate: AnchorCandidate;
123
- readonly disposition: AnchorDisposition;
124
- /**
125
- * Conditions the disposition genuinely depends on. EMPTY means
126
- * UNCONDITIONAL. This is the ONLY door through which a condition on
127
- * anchoring can reach the rendered prompt.
128
- */
129
- readonly conditions: readonly string[];
130
- /** Facts that never decide this disposition; rendered as "not the test". */
131
- readonly nonDeciding: readonly NonDecidingFactor[];
132
- /** What is OWED when the disposition is exercised. An obligation is not a gate. */
133
- readonly obligations: readonly string[];
134
- }
135
- /** One basis the criteria-standing section can report, with its own rules. */
136
- export interface FloorBasis {
137
- /** Machine token the standing section reports (or `read_failed`). */
138
- readonly basis: string;
139
- /** Whether this basis IS a floor. `no_criteria_declared` is NOT one. */
140
- readonly isFloor: boolean;
141
- /** Bolded opening of the rendered bullet. Context, never a disposition. */
142
- readonly lead: string;
143
- /** What the basis means, before any rule applies. Context, never a disposition. */
144
- readonly situation: string;
145
- readonly rules: readonly AnchoringRule[];
146
- /** Closing clarification for the basis. Context, never a disposition. */
147
- readonly caveat?: string;
148
- }
149
- /** The floor's whole normative content, in one declarable structure. */
150
- export interface FloorPolicy {
151
- /** Bolded opening of the universal paragraph. */
152
- readonly universalLead: string;
153
- /** Rules that hold at EVERY basis. */
154
- readonly universal: readonly AnchoringRule[];
155
- /** Closing prose of the universal paragraph. Context, never a disposition. */
156
- readonly universalClosing: readonly string[];
157
- readonly bases: readonly FloorBasis[];
158
- }
159
- /**
160
- * The declared floor. Everything normative the floor says about what may be
161
- * anchored is in the TYPED fields here; the prose below is generated from
162
- * them, and the free-text fields carry context only.
163
- */
164
- export declare const AUDIT_FLOOR_POLICY: FloorPolicy;
165
- /** Where a rule is being stated: the universal paragraph, or one basis. */
166
- export type RuleScope = 'universal' | 'basis';
167
- /** A free-text field of the policy, with the path it sits at. */
168
- export interface ProseField {
169
- readonly path: string;
170
- readonly text: string;
171
- }
172
- /** A prose field that has strayed into stating the floor's normative content. */
173
- export interface FloorProseViolation {
174
- readonly path: string;
175
- readonly text: string;
176
- readonly reason: string;
177
- }
178
- /**
179
- * Every free-text field of the policy. `conditions` is deliberately absent: it
180
- * IS the declared channel for a scope, and it is counted rather than banned.
181
- *
182
- * Exported so the suite can prove the equality pin COVERS this set (every
183
- * field's exact text appears verbatim inside the pinned render) rather than
184
- * trusting a hand-maintained field list that goes stale on the next addition.
185
- */
186
- export declare function floorProseFields(policy?: FloorPolicy): readonly ProseField[];
187
- /**
188
- * Prose fields that state normative content IN A WORDING THESE LISTS KNOW. An
189
- * empty result means "nothing recognised", NEVER "nothing normative" -- see the
190
- * BACKSTOP note above for why no wording list can mean the latter. The
191
- * completeness guarantee is the equality pin in audit-phase.test.ts; this only
192
- * makes the recognised cases fail earlier, at load, with a named path. Exported
193
- * so a test can demonstrate rejection on a mutated policy.
194
- */
195
- export declare function findFloorProseViolations(policy?: FloorPolicy): readonly FloorProseViolation[];
196
- /** Render the policy: the universal paragraph, then one bullet per basis. */
197
- export declare function renderFloorPolicy(policy?: FloorPolicy): readonly string[];
198
- /**
199
- * The composed floor section: the pointer at the standing section (which
200
- * states no rule about what may be anchored), then the rendered policy.
201
- */
202
- export declare function renderFloorSection(policy?: FloorPolicy): readonly string[];
203
30
  /**
204
31
  * Compose the audit assessor prompt for a given posture. The read-only and live
205
32
  * postures differ ONLY in the posture section; the discipline (AUDIT_GUIDE_SHARED)
@@ -1 +1 @@
1
- {"version":3,"file":"audit-prompt.d.ts","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AA4LhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,wBAAwB,GAAG,gBAAgB,CAAC;AAE1E,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAErD;;;;;;;GAOG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I,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,WAAgC,GAAG,SAAS,UAAU,EAAE,CAkBhG;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,GAAE,WAAgC,GACvC,SAAS,mBAAmB,EAAE,CAwBhC;AA2ED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,WAAgC,GAAG,SAAS,MAAM,EAAE,CAS7F;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,WAAgC,GAAG,SAAS,MAAM,EAAE,CAS9F;AAmCD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAU9D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,QAAgC,CAAC"}
1
+ {"version":3,"file":"audit-prompt.d.ts","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC;AAmOhD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAU9D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,QAAgC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/audit/audit-guide-sync.test.ts,
3
- // packages/daemon/src/audit/audit-phase.test.ts,
4
3
  // packages/daemon/src/prompt/decision-rule-replaces-escalation.test.ts
5
4
  // PINNED-BY-END
5
+ import { renderFloorSection } from './audit-floor-policy.js';
6
6
  /**
7
7
  * Posture-independent intro. The first line is stable across postures (a spawn
8
8
  * test asserts the composed prompt begins with it). "READ-ONLY with respect to
@@ -183,336 +183,13 @@ injection-anchored plan inverts that: remediation is scoped one root cause at a
183
183
  time from an injection, with acceptance pinned to a desired effect, so there is
184
184
  nothing to over-complete. The structured CRT + FRT make a wrong root cause
185
185
  legible as a plan -- catchable up front rather than only after code has moved.`;
186
+ // SHARED-AUDIT-GUIDE:END
186
187
  /**
187
- * The withhold half of the test, identical wherever it is stated: the same
188
- * candidate, the same disposition, no conditions anywhere.
188
+ * The round-5 floor section, rendered from the declared policy. The policy, its
189
+ * closed lexicon and its renderers live in `audit-floor-policy.ts`; this file
190
+ * only embeds the rendered lines, so the floor's normative content stays one
191
+ * structure with one pin.
189
192
  */
190
- const WITHHOLD_RESIDUE = {
191
- candidate: 'residue_or_restatement',
192
- disposition: 'withhold',
193
- conditions: [],
194
- nonDeciding: [],
195
- obligations: [],
196
- };
197
- /**
198
- * The declared floor. Everything normative the floor says about what may be
199
- * anchored is in the TYPED fields here; the prose below is generated from
200
- * them, and the free-text fields carry context only.
201
- */
202
- export const AUDIT_FLOOR_POLICY = {
203
- universalLead: 'The floor stops ELABORATION, not new work.',
204
- universal: [
205
- WITHHOLD_RESIDUE,
206
- {
207
- candidate: 'new_root_cause',
208
- disposition: 'anchor',
209
- conditions: [],
210
- nonDeciding: ['criterion_coverage'],
211
- obligations: ['why the cause is new rather than residue or a restatement'],
212
- },
213
- ],
214
- universalClosing: [
215
- 'Anchoring past a reached floor is a DECLARED act, never a silent one -- but it is declared by what you DRAW, not by what you write. On an armed focus a delivery that serves no effect the arm covers is recorded and waits for the next arm; to have it run now, draw the causal edge that makes it means. There is no reason field that substitutes for the edge.',
216
- ],
217
- bases: [
218
- {
219
- basis: 'all_criteria_addressed',
220
- isFloor: true,
221
- lead: 'Basis `all_criteria_addressed` -- the floor is REACHED.',
222
- situation: 'Every criterion the focus declared already has a delivery pointing at it, so there is no OPEN declared work to elaborate against.',
223
- rules: [
224
- WITHHOLD_RESIDUE,
225
- {
226
- candidate: 'new_root_cause',
227
- disposition: 'anchor',
228
- conditions: [],
229
- nonDeciding: ['criterion_coverage'],
230
- obligations: [
231
- 'why the cause is new rather than residue or a restatement',
232
- 'which criterion it touches',
233
- ],
234
- },
235
- ],
236
- caveat: 'Note what the basis does NOT mean: addressed is not MET. Whether the work satisfies a criterion is the focus review\'s judgement, not yours, so "the floor is reached" is never "the focus is done" -- it is "there is nothing further for THIS pass to ELABORATE".',
237
- },
238
- {
239
- basis: 'open_criteria_remain',
240
- isFloor: false,
241
- lead: 'Basis `open_criteria_remain` -- the open criteria ARE the remaining work.',
242
- situation: 'Work against them by name: each injection you author should trace to an OPEN criterion, and your audit summary should say which.',
243
- rules: [
244
- {
245
- candidate: 'new_root_cause',
246
- disposition: 'anchor',
247
- conditions: [],
248
- nonDeciding: [],
249
- obligations: [],
250
- },
251
- ],
252
- caveat: 'A new delivery that addresses no open criterion needs an explicit reason for existing, stated in the summary.',
253
- },
254
- {
255
- basis: 'no_criteria_declared',
256
- isFloor: false,
257
- lead: 'Basis `no_criteria_declared` -- this is NOT a floor.',
258
- situation: 'A focus that declared no acceptance criteria has gone UNMEASURED, not arrived.',
259
- rules: [
260
- WITHHOLD_RESIDUE,
261
- {
262
- candidate: 'new_root_cause',
263
- disposition: 'anchor',
264
- conditions: [],
265
- nonDeciding: [],
266
- obligations: [
267
- 'that this focus declares no criteria, so no floor could be computed for it',
268
- ],
269
- },
270
- ],
271
- caveat: 'Do not read the empty set as "everything is addressed", and do not read it as licence to elaborate without limit: judge each candidate on the tree\'s own evidence.',
272
- },
273
- {
274
- basis: 'read_failed',
275
- isFloor: false,
276
- lead: 'If that section says READ FAILED, you have NO floor.',
277
- situation: 'An unreadable standing is not evidence that every criterion is addressed.',
278
- rules: [
279
- WITHHOLD_RESIDUE,
280
- {
281
- candidate: 'new_root_cause',
282
- disposition: 'anchor',
283
- conditions: [],
284
- nonDeciding: [],
285
- obligations: ['that the standing was unreadable on this pass'],
286
- },
287
- ],
288
- },
289
- ],
290
- };
291
- /**
292
- * CLOSED LEXICON (1/4): the subject of the normative sentence, chosen by the
293
- * rule's `candidate`. Stated in full where the test is introduced, and short
294
- * at each basis so the definition is given once rather than four times.
295
- */
296
- const CANDIDATE_SUBJECT = {
297
- universal: {
298
- new_root_cause: 'A GENUINELY NEW ROOT CAUSE -- one no existing delivery already covers --',
299
- residue_or_restatement: 'RESIDUE of work still in flight -- or a RESTATEMENT or refinement of a cause an existing delivery already covers --',
300
- },
301
- basis: {
302
- new_root_cause: 'A genuinely new root cause',
303
- residue_or_restatement: 'Residue, or a restatement or refinement of a cause already covered,',
304
- },
305
- };
306
- /** CLOSED LEXICON (2/4): the same candidate named as the side of the test. */
307
- const CANDIDATE_LABEL = {
308
- new_root_cause: 'NEW ROOT CAUSE',
309
- residue_or_restatement: 'RESIDUE OR RESTATEMENT',
310
- };
311
- /** CLOSED LEXICON (3/4): what the floor DOES, chosen by `disposition`. */
312
- const DISPOSITION_VERB = {
313
- anchor: 'is ANCHORED',
314
- withhold: 'is WITHHELD',
315
- };
316
- /**
317
- * CLOSED LEXICON (4/4): how a disposition with NO declared conditions states
318
- * its own scope. An unconditional rule must SAY it is unconditional: a
319
- * sentence that merely omits the scope is one a reader fills with the last
320
- * rule they were taught.
321
- */
322
- const UNCONDITIONAL_SCOPE = {
323
- universal: {
324
- anchor: 'at every basis below, in every case those bases can present, with nothing further to satisfy first',
325
- withhold: 'at every basis below, in every case those bases can present',
326
- },
327
- basis: {
328
- anchor: 'here, in every case this basis can present, with nothing further to satisfy first',
329
- withhold: 'here, in every case this basis can present',
330
- },
331
- };
332
- /**
333
- * Prose for each non-deciding factor. One sentence per factor, stated once
334
- * here, so "coverage is not the test" cannot drift from rule to rule.
335
- */
336
- const NON_DECIDING_PROSE = {
337
- criterion_coverage: 'Whether a declared criterion already covers the ground a cause sits on is NOT the test and never decides it: coverage tells you whether declared work remains OPEN, it cannot tell you whether a cause is NEW.',
338
- };
339
- /** How an obligation sentence opens, per disposition. */
340
- const OBLIGATION_LEAD = {
341
- anchor: 'When you anchor, say in your audit summary',
342
- withhold: 'When you withhold, say in your audit summary',
343
- };
344
- // ---- BACKSTOP: a fast, INCOMPLETE check on the policy's remaining prose ----
345
- //
346
- // Read this before trusting the rules below. They are an ENUMERATION of
347
- // wordings, NOT the guarantee that context prose carries no restriction -- the
348
- // equality pin on the rendered section is (round-8 note above). What they buy
349
- // is EARLINESS and a NAMED reason: a claim in vocabulary they happen to know
350
- // fails at module load with the offending path, instead of surfacing later as
351
- // an unexplained diff against the pin. Stated limits:
352
- // - the lists are finite, and no list can be complete. The two escapes review
353
- // filed -- "Fresh findings wait for review." and "A genuinely new root
354
- // cause proceeds after every existing delivery is reviewed." -- carry no
355
- // listed noun/verb pair and no scope marker, so these rules PASS them. The
356
- // pin rejects them.
357
- // - they can only ADD rejections. Nothing reads a green result as evidence
358
- // that prose is clean: a green backstop over a changed render is still RED.
359
- // Widening the lists is allowed and harmless. It is not progress, and it must
360
- // never be written up as closing the class.
361
- /** Nouns that name one of the floor's candidates. Finite; not exhaustive. */
362
- const CANDIDATE_NOUN = /\b(root causes?|residue|restatements?|refinements?)\b/i;
363
- /** Verbs that state what the floor DOES with a candidate. Finite; not exhaustive. */
364
- const DISPOSITION_VERB_IN_PROSE = /\b(anchors?|anchored|anchoring|withholds?|withheld|suppress(?:es|ed)?|defers?|deferred|skips?|skipped|omits?|omitted|excludes?|excluded)\b/i;
365
- /** Markers that narrow a claim's scope. A scope is declared, never written. */
366
- const SCOPE_MARKER = /\b(only|unless|except|solely|provided that|so long as|as long as|conditional on|contingent on)\b/i;
367
- /**
368
- * Every free-text field of the policy. `conditions` is deliberately absent: it
369
- * IS the declared channel for a scope, and it is counted rather than banned.
370
- *
371
- * Exported so the suite can prove the equality pin COVERS this set (every
372
- * field's exact text appears verbatim inside the pinned render) rather than
373
- * trusting a hand-maintained field list that goes stale on the next addition.
374
- */
375
- export function floorProseFields(policy = AUDIT_FLOOR_POLICY) {
376
- const obligationsOf = (at, rules) => rules.flatMap((rule, j) => rule.obligations.map((text, k) => ({ path: `${at}.rules[${j}].obligations[${k}]`, text })));
377
- const fields = [
378
- { path: 'universalLead', text: policy.universalLead },
379
- ...policy.universalClosing.map((text, i) => ({ path: `universalClosing[${i}]`, text })),
380
- ...obligationsOf('universal', policy.universal),
381
- ];
382
- policy.bases.forEach((basis, i) => {
383
- const at = `bases[${i}]`;
384
- fields.push({ path: `${at}.lead`, text: basis.lead });
385
- fields.push({ path: `${at}.situation`, text: basis.situation });
386
- if (basis.caveat !== undefined)
387
- fields.push({ path: `${at}.caveat`, text: basis.caveat });
388
- fields.push(...obligationsOf(at, basis.rules));
389
- });
390
- return fields;
391
- }
392
- /**
393
- * Prose fields that state normative content IN A WORDING THESE LISTS KNOW. An
394
- * empty result means "nothing recognised", NEVER "nothing normative" -- see the
395
- * BACKSTOP note above for why no wording list can mean the latter. The
396
- * completeness guarantee is the equality pin in audit-phase.test.ts; this only
397
- * makes the recognised cases fail earlier, at load, with a named path. Exported
398
- * so a test can demonstrate rejection on a mutated policy.
399
- */
400
- export function findFloorProseViolations(policy = AUDIT_FLOOR_POLICY) {
401
- const violations = [];
402
- for (const field of floorProseFields(policy)) {
403
- if (CANDIDATE_NOUN.test(field.text) && DISPOSITION_VERB_IN_PROSE.test(field.text)) {
404
- violations.push({
405
- path: field.path,
406
- text: field.text,
407
- reason: 'states a DISPOSITION for a CANDIDATE in prose. That claim is composed from '
408
- + '`candidate` + `disposition` + `conditions`; written by hand it is the one place a '
409
- + 'restriction sits where no structural channel sees it.',
410
- });
411
- }
412
- if (SCOPE_MARKER.test(field.text)) {
413
- violations.push({
414
- path: field.path,
415
- text: field.text,
416
- reason: 'narrows a claim with a scope marker. A scope on the floor is declared in a rule\'s '
417
- + '`conditions`, where it is rendered as one clause and counted; context prose states none.',
418
- });
419
- }
420
- }
421
- return violations;
422
- }
423
- /**
424
- * Fail LOUDLY rather than compose a prompt that contradicts its own structure.
425
- * The policy is a static constant, so a green test run is proof this can never
426
- * throw at runtime; it throws at module load if someone edits prose into a
427
- * normative claim THE BACKSTOP RECOGNISES. Prose it does not recognise composes
428
- * fine here and is caught by the equality pin instead.
429
- */
430
- function assertFloorProseIsContextOnly(policy) {
431
- const violations = findFloorProseViolations(policy);
432
- if (violations.length === 0)
433
- return;
434
- const detail = violations
435
- .map((v) => ` ${v.path}: ${v.reason}\n text: ${v.text}`)
436
- .join('\n');
437
- throw new Error('audit floor policy: free-text field(s) carry normative content. The floor\'s normative '
438
- + 'claims are composed from the typed fields (candidate, disposition, conditions, '
439
- + 'nonDeciding); prose carries context only.\n' + detail);
440
- }
441
- /** Join clauses into one readable list ("a, b, and c"). */
442
- function joinClauses(items) {
443
- if (items.length < 2)
444
- return items[0] ?? '';
445
- return `${items.slice(0, -1).join(', ')}, and ${items[items.length - 1] ?? ''}`;
446
- }
447
- /**
448
- * Render one rule as prose, entirely from its typed fields. A CONDITIONAL
449
- * clause is emitted if and only if the rule declares conditions -- that
450
- * one-to-one correspondence is what the tests count, so a freeze cannot be
451
- * smuggled in as an extra sentence, and there is no sentence to write it in.
452
- */
453
- function renderRule(rule, scope) {
454
- const dispositionScope = rule.conditions.length > 0
455
- ? `only where ${joinClauses(rule.conditions)}`
456
- : UNCONDITIONAL_SCOPE[scope][rule.disposition];
457
- const parts = [
458
- `${CANDIDATE_SUBJECT[scope][rule.candidate]} ${DISPOSITION_VERB[rule.disposition]} ${dispositionScope}.`,
459
- ];
460
- for (const factor of rule.nonDeciding)
461
- parts.push(NON_DECIDING_PROSE[factor]);
462
- if (rule.obligations.length > 0) {
463
- parts.push(`${OBLIGATION_LEAD[rule.disposition]} ${joinClauses(rule.obligations)}.`);
464
- }
465
- return parts.join(' ');
466
- }
467
- /**
468
- * Name the test, and state whether it holds everywhere. The "same test at
469
- * every basis" half is COMPUTED against the bases rather than asserted, so a
470
- * basis that departed from the universal rule would change this sentence
471
- * instead of being contradicted by it.
472
- */
473
- function renderTestSentence(policy) {
474
- const universalDisposition = new Map(policy.universal.map((rule) => [rule.candidate, rule.disposition]));
475
- const uniform = policy.bases.every((basis) => basis.rules.every((rule) => {
476
- const declared = universalDisposition.get(rule.candidate);
477
- return declared === undefined || (declared === rule.disposition && rule.conditions.length === 0);
478
- }));
479
- const sameness = uniform
480
- ? 'and it is the SAME test at every basis below'
481
- : 'and the bases below depart from it -- read each one on its own terms';
482
- return `The test is ${CANDIDATE_LABEL.residue_or_restatement} vs ${CANDIDATE_LABEL.new_root_cause}, ${sameness}.`;
483
- }
484
- /** Render one basis as a markdown bullet. */
485
- function renderBasis(basis) {
486
- const body = [basis.situation, ...basis.rules.map((rule) => renderRule(rule, 'basis'))];
487
- if (basis.caveat !== undefined)
488
- body.push(basis.caveat);
489
- return `- **${basis.lead}** ${body.join(' ')}`;
490
- }
491
- /** Render the policy: the universal paragraph, then one bullet per basis. */
492
- export function renderFloorPolicy(policy = AUDIT_FLOOR_POLICY) {
493
- assertFloorProseIsContextOnly(policy);
494
- const universal = [
495
- `**${policy.universalLead}**`,
496
- renderTestSentence(policy),
497
- ...policy.universal.map((rule) => renderRule(rule, 'universal')),
498
- ...policy.universalClosing,
499
- ].join(' ');
500
- return [universal, '', ...policy.bases.map(renderBasis)];
501
- }
502
- /**
503
- * The composed floor section: the pointer at the standing section (which
504
- * states no rule about what may be anchored), then the rendered policy.
505
- */
506
- export function renderFloorSection(policy = AUDIT_FLOOR_POLICY) {
507
- return [
508
- '',
509
- '## Before you anchor (round 5): has this focus reached its declared floor?',
510
- '',
511
- 'The "Focus acceptance criteria standing" section of your context lists this focus\'s OWN declared acceptance criteria, states for each whether a current delivery addresses it, and states the FLOOR with the basis it rests on. READ IT BEFORE YOU ANCHOR ANYTHING. It is the only thing in your context that says what this focus was for, and therefore the only thing that can tell you there is nothing left to anchor.',
512
- '',
513
- ...renderFloorPolicy(policy),
514
- ];
515
- }
516
193
  const AUDIT_CRITERIA_FLOOR = renderFloorSection();
517
194
  /**
518
195
  * Round-5 pre-condition: attribute the fact, then let the structure decide.
@@ -1 +1 @@
1
- {"version":3,"file":"audit-prompt.js","sourceRoot":"","sources":["../../src/audit/audit-prompt.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,iEAAiE;AACjE,mDAAmD;AACnD,yEAAyE;AACzE,gBAAgB;AAgChB;;;;;GAKG;AACH,MAAM,WAAW,GAAsB;IACrC,uEAAuE;IACvE,EAAE;IACF,ujBAAujB;CACxjB,CAAC;AAEF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,4EAA4E;AAC5E,6CAA6C;AAC7C,kCAAkC;AAClC,MAAM,yBAAyB,GAAG,0/BAA0/B,CAAC;AAC7hC,gCAAgC;AAEhC;;;;;;GAMG;AACH,SAAS,mBAAmB,CAAC,OAAqB;IAChD,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,OAAO;YACL,EAAE;YACF,6RAA6R;SAC9R,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE;QACF,6DAA6D,GAAG,yBAAyB,GAAG,2TAA2T;KACxZ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,kBAAkB,GAAsB;IAC5C,EAAE;IACF,yIAAyI;IACzI,EAAE;IACF,kBAAkB;IAClB,0BAA0B;IAC1B,0BAA0B;IAC1B,YAAY;IACZ,4IAA4I;IAC5I,KAAK;IACL,EAAE;IACF,6LAA6L;CAC9L,CAAC;AAEF,+EAA+E;AAC/E,uEAAuE;AACvE,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,2BAA2B;AAC3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qF;IACrF,EAAE;IACF,wVAAwV;IACxV,EAAE;IACF,qyBAAqyB;IACryB,wjBAAwjB;IACxjB,4oBAA4oB;IAC5oB,gMAAgM;IAChM,+MAA+M;CAChN,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAqB;IACpD,OAAO;QACL,GAAG,WAAW;QACd,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC/B,EAAE;QACF,kBAAkB;QAClB,GAAG,oBAAoB;QACvB,GAAG,wBAAwB;QAC3B,GAAG,kBAAkB;KACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC"}
@@ -28,22 +28,58 @@ export interface CommitVerdictReleaseDeps extends Required<Pick<CommitVerdictGat
28
28
  createEscalation: typeof createEscalation;
29
29
  hasOpenFocusEscalation: (focusId: string, escalationKind: string) => Promise<boolean>;
30
30
  now: () => number;
31
+ /**
32
+ * Whether `head` adds nothing of the focus's OWN work on top of the held commit
33
+ * `anchor` (git/focus-own-delta.ts isForeignOnlyExtension) -- the one advance a
34
+ * held review survives (module doc). Every unreadable input answers false, so the
35
+ * review re-fires; a deps object omitting it carries nothing forward.
36
+ */
37
+ headAddsNoOwnWork?: (args: CarryForwardQuestion) => boolean;
31
38
  }
39
+ /** What the carry-forward proof is asked about. */
40
+ export interface CarryForwardQuestion {
41
+ focusId: string;
42
+ /** Pinned focus branch identity (product_focuses.branch_name), or null. */
43
+ branchName: string | null;
44
+ integrationBranch: string;
45
+ /** The commit the held review judged. */
46
+ anchor: string;
47
+ /** The focus worktree HEAD now. */
48
+ head: string;
49
+ /** The focus's delivery ids: what "the focus's own work" means to the trailer read. */
50
+ ownDeliveryIds: ReadonlySet<string>;
51
+ }
52
+ /**
53
+ * The production proof: provenance is read from the focus WORKTREE, where the focus
54
+ * branch is checked out and the gate ran. A focus with no live worktree entry
55
+ * (a restart before the focus was spawned) answers false -- carry nothing.
56
+ */
57
+ export declare function headAddsNoOwnWork(q: CarryForwardQuestion): boolean;
32
58
  /** What one pass did. */
33
59
  export interface CommitVerdictReleaseCounts {
34
60
  /** Held deliveries whose review exit was replayed. */
35
61
  released: number;
36
62
  /** Held deliveries whose held commit is no longer the focus HEAD (evidence dropped). */
37
63
  superseded: number;
64
+ /** Held deliveries whose held review was carried to a HEAD that added no work of the focus's own. */
65
+ carried: number;
38
66
  /** Held deliveries still waiting (no verdict yet, or a failed verdict being routed by feedback). */
39
67
  waiting: number;
40
68
  }
41
69
  /** Test seam: forget reported overdue waits. */
42
70
  export declare function __resetCommitVerdictReleaseForTests(): void;
71
+ /**
72
+ * The product-scoped config a release pass reads. `integrationBranch` is what the
73
+ * carry-forward proof compares against; without it (a partial test config) no held
74
+ * review is carried and every HEAD advance discards, as it did before.
75
+ */
76
+ export type ReleaseConfig = Pick<DaemonConfig, 'organizationId' | 'productId'> & {
77
+ integrationBranch?: string;
78
+ };
43
79
  /**
44
80
  * One release pass over a product's active focuses. `config` must be
45
81
  * product-scoped. Best-effort: a failure on one focus is logged and the next
46
82
  * focus still runs; nothing throws.
47
83
  */
48
- export declare function releaseCommitVerdictHolds(config: Pick<DaemonConfig, 'organizationId' | 'productId'>, overrides?: Partial<CommitVerdictReleaseDeps>): Promise<CommitVerdictReleaseCounts>;
84
+ export declare function releaseCommitVerdictHolds(config: ReleaseConfig, overrides?: Partial<CommitVerdictReleaseDeps>): Promise<CommitVerdictReleaseCounts>;
49
85
  //# sourceMappingURL=commit-verdict-release.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commit-verdict-release.d.ts","sourceRoot":"","sources":["../../src/completion/commit-verdict-release.ts"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB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