lastlight-core 0.25.9 → 0.27.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 (234) hide show
  1. package/config/default.yaml +317 -1
  2. package/dist/admin/chat-session-reader.d.ts +3 -3
  3. package/dist/admin/chat-session-reader.js +8 -8
  4. package/dist/admin/chat-session-reader.js.map +1 -1
  5. package/dist/admin/docker.js.map +1 -1
  6. package/dist/admin/routes.js +97 -99
  7. package/dist/admin/routes.js.map +1 -1
  8. package/dist/admin/sessions.d.ts +7 -7
  9. package/dist/admin/sessions.js +6 -4
  10. package/dist/admin/sessions.js.map +1 -1
  11. package/dist/admin/tail.js.map +1 -1
  12. package/dist/config/config.d.ts +29 -0
  13. package/dist/config/config.js +141 -0
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/repo-config.js +6 -7
  16. package/dist/config/repo-config.js.map +1 -1
  17. package/dist/connectors/messaging/base.js +2 -2
  18. package/dist/connectors/messaging/base.js.map +1 -1
  19. package/dist/connectors/messaging/session-manager.d.ts +29 -31
  20. package/dist/connectors/messaging/session-manager.js +156 -189
  21. package/dist/connectors/messaging/session-manager.js.map +1 -1
  22. package/dist/connectors/messaging/thread-transcript.d.ts +2 -2
  23. package/dist/connectors/messaging/thread-transcript.js +14 -8
  24. package/dist/connectors/messaging/thread-transcript.js.map +1 -1
  25. package/dist/connectors/slack/connector.js +5 -5
  26. package/dist/connectors/slack/connector.js.map +1 -1
  27. package/dist/cron/dependabot-discovery.js.map +1 -1
  28. package/dist/cron/feedback-poll.js +6 -6
  29. package/dist/cron/feedback-poll.js.map +1 -1
  30. package/dist/cron/handlers.js +3 -3
  31. package/dist/cron/handlers.js.map +1 -1
  32. package/dist/cron/jobs.d.ts +1 -1
  33. package/dist/cron/jobs.js +2 -2
  34. package/dist/cron/jobs.js.map +1 -1
  35. package/dist/cron/repo-digest.js +4 -4
  36. package/dist/cron/repo-digest.js.map +1 -1
  37. package/dist/cron/review-discovery.js.map +1 -1
  38. package/dist/cron/runner.js +2 -2
  39. package/dist/cron/runner.js.map +1 -1
  40. package/dist/cron/scheduler.js +1 -1
  41. package/dist/cron/scheduler.js.map +1 -1
  42. package/dist/engine/agent-executor.d.ts +25 -1
  43. package/dist/engine/agent-executor.js +41 -1
  44. package/dist/engine/agent-executor.js.map +1 -1
  45. package/dist/engine/chat/chat-prompt.d.ts +11 -4
  46. package/dist/engine/chat/chat-prompt.js.map +1 -1
  47. package/dist/engine/chat/chat-runner.d.ts +3 -2
  48. package/dist/engine/chat/chat-runner.js +9 -7
  49. package/dist/engine/chat/chat-runner.js.map +1 -1
  50. package/dist/engine/dispatcher.js +29 -25
  51. package/dist/engine/dispatcher.js.map +1 -1
  52. package/dist/engine/event-shim.d.ts +18 -0
  53. package/dist/engine/event-shim.js +2 -0
  54. package/dist/engine/event-shim.js.map +1 -1
  55. package/dist/engine/executors/orchestrator.d.ts +120 -1
  56. package/dist/engine/executors/orchestrator.js +214 -47
  57. package/dist/engine/executors/orchestrator.js.map +1 -1
  58. package/dist/engine/executors/shared.js.map +1 -1
  59. package/dist/engine/feedback/ingest.d.ts +4 -4
  60. package/dist/engine/feedback/ingest.js +13 -13
  61. package/dist/engine/feedback/ingest.js.map +1 -1
  62. package/dist/engine/feedback/slack.d.ts +2 -2
  63. package/dist/engine/feedback/slack.js +6 -6
  64. package/dist/engine/feedback/slack.js.map +1 -1
  65. package/dist/engine/fix-harvest.d.ts +1 -1
  66. package/dist/engine/fix-harvest.js +3 -3
  67. package/dist/engine/fix-harvest.js.map +1 -1
  68. package/dist/engine/github/github.d.ts +59 -0
  69. package/dist/engine/github/github.js +72 -0
  70. package/dist/engine/github/github.js.map +1 -1
  71. package/dist/engine/github/installations.js.map +1 -1
  72. package/dist/engine/github/review-poster.d.ts +388 -9
  73. package/dist/engine/github/review-poster.js +550 -50
  74. package/dist/engine/github/review-poster.js.map +1 -1
  75. package/dist/engine/github/team-visibility.js +7 -7
  76. package/dist/engine/github/team-visibility.js.map +1 -1
  77. package/dist/engine/llm.js.map +1 -1
  78. package/dist/engine/pr-decisions.d.ts +13 -5
  79. package/dist/engine/pr-decisions.js +204 -5
  80. package/dist/engine/pr-decisions.js.map +1 -1
  81. package/dist/engine/pr-escalation.js +7 -7
  82. package/dist/engine/pr-escalation.js.map +1 -1
  83. package/dist/engine/pr-state.d.ts +59 -1
  84. package/dist/engine/pr-state.js +76 -10
  85. package/dist/engine/pr-state.js.map +1 -1
  86. package/dist/engine/review-check.d.ts +1 -1
  87. package/dist/engine/review-check.js +5 -5
  88. package/dist/engine/review-check.js.map +1 -1
  89. package/dist/engine/review-spec.d.ts +264 -0
  90. package/dist/engine/review-spec.js +723 -0
  91. package/dist/engine/review-spec.js.map +1 -0
  92. package/dist/engine/router.js +3 -3
  93. package/dist/engine/router.js.map +1 -1
  94. package/dist/engine/screen/classifier.js.map +1 -1
  95. package/dist/engine/screen/screen.js.map +1 -1
  96. package/dist/evals-api.d.ts +3 -0
  97. package/dist/evals-api.js +20 -0
  98. package/dist/evals-api.js.map +1 -1
  99. package/dist/index.js +145 -67
  100. package/dist/index.js.map +1 -1
  101. package/dist/notify/digest-blocks.js.map +1 -1
  102. package/dist/notify/model.js.map +1 -1
  103. package/dist/notify/transports/github.js.map +1 -1
  104. package/dist/notify/transports/slack.js.map +1 -1
  105. package/dist/sandbox/artifact-backend.js.map +1 -1
  106. package/dist/sandbox/artifact-store.js.map +1 -1
  107. package/dist/sandbox/docker.d.ts +56 -5
  108. package/dist/sandbox/docker.js +96 -2
  109. package/dist/sandbox/docker.js.map +1 -1
  110. package/dist/sandbox/egress-allowlist.js.map +1 -1
  111. package/dist/sandbox/k8s/agent-context-registry.js.map +1 -1
  112. package/dist/sandbox/k8s/client.js.map +1 -1
  113. package/dist/sandbox/k8s/kubernetes-sandbox.d.ts +3 -0
  114. package/dist/sandbox/k8s/kubernetes-sandbox.js +9 -0
  115. package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
  116. package/dist/sandbox/k8s/pod.d.ts +11 -0
  117. package/dist/sandbox/k8s/pod.js +11 -6
  118. package/dist/sandbox/k8s/pod.js.map +1 -1
  119. package/dist/sandbox/k8s/resource-name.js.map +1 -1
  120. package/dist/sandbox/k8s/run-id.js.map +1 -1
  121. package/dist/sandbox/k8s/run-secrets.js.map +1 -1
  122. package/dist/sandbox/k8s/service-containers.d.ts +43 -0
  123. package/dist/sandbox/k8s/service-containers.js +87 -0
  124. package/dist/sandbox/k8s/service-containers.js.map +1 -0
  125. package/dist/sandbox/k8s/skill-bundle.js.map +1 -1
  126. package/dist/sandbox/k8s/workspace-provisioner.js +10 -2
  127. package/dist/sandbox/k8s/workspace-provisioner.js.map +1 -1
  128. package/dist/sandbox/reap.d.ts +9 -0
  129. package/dist/sandbox/reap.js +36 -0
  130. package/dist/sandbox/reap.js.map +1 -1
  131. package/dist/sandbox/sandbox.d.ts +34 -0
  132. package/dist/sandbox/sandbox.js +36 -6
  133. package/dist/sandbox/sandbox.js.map +1 -1
  134. package/dist/sandbox/service-containers-docker.d.ts +45 -0
  135. package/dist/sandbox/service-containers-docker.js +78 -0
  136. package/dist/sandbox/service-containers-docker.js.map +1 -0
  137. package/dist/session-log.js.map +1 -1
  138. package/dist/state/approval-store.d.ts +23 -14
  139. package/dist/state/approval-store.js +137 -86
  140. package/dist/state/approval-store.js.map +1 -1
  141. package/dist/state/build-assets.js.map +1 -1
  142. package/dist/state/client.d.ts +105 -0
  143. package/dist/state/client.js +68 -0
  144. package/dist/state/client.js.map +1 -0
  145. package/dist/state/cron-run-store.d.ts +32 -12
  146. package/dist/state/cron-run-store.js +105 -39
  147. package/dist/state/cron-run-store.js.map +1 -1
  148. package/dist/state/data-migrate.d.ts +135 -0
  149. package/dist/state/data-migrate.js +309 -0
  150. package/dist/state/data-migrate.js.map +1 -0
  151. package/dist/state/db.d.ts +82 -23
  152. package/dist/state/db.js +201 -105
  153. package/dist/state/db.js.map +1 -1
  154. package/dist/state/dialect.d.ts +77 -0
  155. package/dist/state/dialect.js +129 -0
  156. package/dist/state/dialect.js.map +1 -0
  157. package/dist/state/execution-store.d.ts +124 -103
  158. package/dist/state/execution-store.js +569 -374
  159. package/dist/state/execution-store.js.map +1 -1
  160. package/dist/state/feedback-store.d.ts +20 -20
  161. package/dist/state/feedback-store.js +241 -187
  162. package/dist/state/feedback-store.js.map +1 -1
  163. package/dist/state/legacy-sqlite.d.ts +15 -0
  164. package/dist/state/legacy-sqlite.js +131 -0
  165. package/dist/state/legacy-sqlite.js.map +1 -0
  166. package/dist/state/pg-client.d.ts +44 -0
  167. package/dist/state/pg-client.js +81 -0
  168. package/dist/state/pg-client.js.map +1 -0
  169. package/dist/state/repo-ref.d.ts +9 -4
  170. package/dist/state/repo-ref.js +12 -6
  171. package/dist/state/repo-ref.js.map +1 -1
  172. package/dist/state/schema/pg.d.ts +2788 -0
  173. package/dist/state/schema/pg.js +301 -0
  174. package/dist/state/schema/pg.js.map +1 -0
  175. package/dist/state/schema/sqlite.d.ts +3063 -0
  176. package/dist/state/schema/sqlite.js +391 -0
  177. package/dist/state/schema/sqlite.js.map +1 -0
  178. package/dist/state/state-cli.d.ts +8 -0
  179. package/dist/state/state-cli.js +247 -0
  180. package/dist/state/state-cli.js.map +1 -0
  181. package/dist/state/team-store.d.ts +26 -13
  182. package/dist/state/team-store.js +140 -93
  183. package/dist/state/team-store.js.map +1 -1
  184. package/dist/state/user-store.d.ts +31 -13
  185. package/dist/state/user-store.js +180 -80
  186. package/dist/state/user-store.js.map +1 -1
  187. package/dist/state/workflow-run-store.d.ts +95 -56
  188. package/dist/state/workflow-run-store.js +419 -314
  189. package/dist/state/workflow-run-store.js.map +1 -1
  190. package/dist/telemetry/index.js.map +1 -1
  191. package/dist/workflows/admission.d.ts +4 -3
  192. package/dist/workflows/admission.js +34 -10
  193. package/dist/workflows/admission.js.map +1 -1
  194. package/dist/workflows/handlers/fanout.d.ts +157 -0
  195. package/dist/workflows/handlers/fanout.js +663 -0
  196. package/dist/workflows/handlers/fanout.js.map +1 -0
  197. package/dist/workflows/handlers/post-review.d.ts +98 -8
  198. package/dist/workflows/handlers/post-review.js +394 -23
  199. package/dist/workflows/handlers/post-review.js.map +1 -1
  200. package/dist/workflows/resume.js +22 -15
  201. package/dist/workflows/resume.js.map +1 -1
  202. package/dist/workflows/runner.js +60 -12
  203. package/dist/workflows/runner.js.map +1 -1
  204. package/dist/workflows/simple.d.ts +23 -0
  205. package/dist/workflows/simple.js +40 -16
  206. package/dist/workflows/simple.js.map +1 -1
  207. package/docker-compose.yml +50 -0
  208. package/drizzle/pg/0000_init.sql +235 -0
  209. package/drizzle/pg/meta/0000_snapshot.json +1751 -0
  210. package/drizzle/pg/meta/_journal.json +13 -0
  211. package/drizzle/sqlite/0000_baseline.sql +257 -0
  212. package/drizzle/sqlite/0001_backfill_repo_refs.sql +74 -0
  213. package/drizzle/sqlite/meta/0000_snapshot.json +1593 -0
  214. package/drizzle/sqlite/meta/0001_snapshot.json +1593 -0
  215. package/drizzle/sqlite/meta/_journal.json +20 -0
  216. package/package.json +31 -15
  217. package/sandbox.Dockerfile +54 -0
  218. package/skills/code-review/SKILL.md +98 -13
  219. package/skills/pr-review/SKILL.md +97 -21
  220. package/skills/pr-review/references/findings-schema.md +37 -6
  221. package/workflows/pr-review.yaml +567 -0
  222. package/workflows/prompts/dependabot-pr-merge.md +22 -2
  223. package/workflows/prompts/review-adjudicate.md +323 -0
  224. package/workflows/prompts/review-falsify.md +149 -0
  225. package/workflows/prompts/review.md +80 -0
  226. package/workflows/prompts/survey-contract.md +109 -0
  227. package/workflows/prompts/survey-enforcement.md +126 -0
  228. package/workflows/prompts/survey-security.md +118 -0
  229. package/workflows/prompts/survey-spec.md +110 -0
  230. package/workflows/prompts/survey-state.md +143 -0
  231. package/workflows/prompts/survey-tests.md +99 -0
  232. package/dist/state/migrate.d.ts +0 -15
  233. package/dist/state/migrate.js +0 -518
  234. package/dist/state/migrate.js.map +0 -1
@@ -0,0 +1,264 @@
1
+ /**
2
+ * The `spec` obligation family — "does this change do what was asked?".
3
+ *
4
+ * Issue #271's fix 6, and the one axis nothing has tried. All nine "what to
5
+ * check" items in `skills/code-review/SKILL.md` (correctness, contracts, edge
6
+ * cases, security, complexity, duplication, type safety, regression risk, test
7
+ * coverage, fit) are STANDARDS checks, and candidates v1, v2 and v3 all
8
+ * targeted that same axis between them for a total movement of one gold finding
9
+ * (`docs/plans/deterministic-pr-levers.md` §"Evidence base").
10
+ *
11
+ * ## The rule that shapes every line below
12
+ *
13
+ * > **A seed naming one end of a defect mechanism is worse than no seed.**
14
+ *
15
+ * IRIS's ablation, in numbers: CodeQL sources + LLM sinks = +9 over CodeQL
16
+ * alone; **LLM sources + CodeQL sinks = −3, actively worse than seeding
17
+ * nothing**; both ends = +28. So an obligation here names both ends or it is
18
+ * not emitted:
19
+ *
20
+ * | End | Where it comes from |
21
+ * |---|---|
22
+ * | **what was asked** | a criterion quoted VERBATIM out of the linked issue or the PR body |
23
+ * | **where it could live** | {@link SpecObligation.candidates} — the PR's own changed files, with `found: false` |
24
+ *
25
+ * The second end is mechanical on purpose. *"The issue asks for rate limiting —
26
+ * check that"* is the one-ended shape, and it will not merely under-perform: it
27
+ * will degrade the arm and be read as evidence that the spec axis does not work
28
+ * (§D7's "risk to respect"). The changed-file list is the same set
29
+ * `git diff --name-only origin/<base>...HEAD` yields, and `found: false` is the
30
+ * literal claim we are entitled to make — we have looked nowhere.
31
+ *
32
+ * ## And the rule that shapes the QUESTION
33
+ *
34
+ * v3's lesson 1: seeding works only at **question granularity**. *"Check this
35
+ * area"* earns an honest CLEAN, because an obligation one abstraction level too
36
+ * high gets discharged AT THAT LEVEL and the defect lives below it. *"Quote the
37
+ * line that enforces THIS constant"* produced the only gold match the whole
38
+ * investigation has. So {@link SpecObligation.question} is always answerable by
39
+ * quoting one line, or by stating that no such line exists.
40
+ *
41
+ * ## Purity
42
+ *
43
+ * Everything here is a pure transform over strings the harness already read, so
44
+ * the extraction rules are exercised directly in `review-spec.test.ts` rather
45
+ * than through a GitHub mock. The impure half — actually reading the linked
46
+ * issues and the changed-file list — is `resolveSpecContext` in
47
+ * `./pr-state.ts`, and the projection into the prompt is `renderContext` in
48
+ * `./pr-decisions.ts`.
49
+ */
50
+ /**
51
+ * Which obligation block this family renders — the harness-side half of
52
+ * `review.analysis.obligationContract`.
53
+ *
54
+ * Structurally identical to `ObligationContract` in
55
+ * `packages/code-facts/src/seed-render.ts`'s `seed.ts`, and DECLARED here rather
56
+ * than imported for the reason this module has no imports at all: it is pure,
57
+ * dependency-free and testable without a GitHub mock, and `lastlight-core` has
58
+ * no dependency edge to `lastlight-code-facts` to import it across anyway. The
59
+ * union is two literals; `ReviewAnalysisConfig.obligationContract` in
60
+ * `lastlight-shared` declares the same two, and `review-spec.test.ts` pins the
61
+ * two renderers against each other under BOTH values, which is the check that
62
+ * actually matters.
63
+ */
64
+ export type ObligationContract = "full" | "minimal";
65
+ /** One issue the PR says it closes, as the spec extractor needs it. */
66
+ export interface SpecLinkedIssue {
67
+ number: number;
68
+ title: string;
69
+ body: string;
70
+ url?: string;
71
+ state?: string;
72
+ }
73
+ /** Where a criterion was quoted from — rendered so the agent can go and re-read it. */
74
+ export type CriterionSource = {
75
+ kind: "issue";
76
+ issue: number;
77
+ } | {
78
+ kind: "pr-body";
79
+ };
80
+ /** One acceptance criterion, quoted verbatim, with its provenance and rank. */
81
+ export interface AcceptanceCriterion {
82
+ /** The criterion as written, trimmed of markdown scaffolding. Never paraphrased. */
83
+ text: string;
84
+ source: CriterionSource;
85
+ /**
86
+ * How it was recognised. Ordered strongest-first in {@link CRITERION_RANK} —
87
+ * a task-list item under an "Acceptance criteria" heading is a far better
88
+ * criterion than a stray sentence containing "should".
89
+ */
90
+ kind: "checklist" | "criteria-section" | "modal";
91
+ }
92
+ /**
93
+ * One obligation. **Both ends, every time** — see the module header.
94
+ *
95
+ * `found` is typed as the literal `false` rather than a boolean: nothing in WP0
96
+ * can set it true (that needs `code-facts`, which is WP1), and a field that
97
+ * could flip would invite a caller to emit a half-verified obligation.
98
+ */
99
+ export interface SpecObligation {
100
+ /**
101
+ * `S-1`, `S-2`, … — stable within one PR, and the id a hypothesis row names in
102
+ * its `obligation` field. Never the row's own id: that is `spec-001`,
103
+ * `spec-002`, … , assigned from the FILENAME by
104
+ * `packages/code-facts/src/hypotheses.ts` whatever the model writes.
105
+ */
106
+ id: string;
107
+ /** END ONE: what was asked, quoted. */
108
+ criterion: string;
109
+ /** Human-readable provenance for end one, e.g. `issue #1587`. */
110
+ source: string;
111
+ /**
112
+ * END TWO: the changed files that could satisfy it, best match first, and
113
+ * never empty — an obligation with no candidates is one-ended and is dropped
114
+ * by {@link buildSpecObligations} rather than emitted.
115
+ */
116
+ candidates: string[];
117
+ /** How many changed files exist in total, so the agent knows what the shortlist is a shortlist OF. */
118
+ changedFileCount: number;
119
+ /** Always false. We have verified nothing; this is the claim, not a placeholder. */
120
+ found: false;
121
+ /** Answerable by quoting ONE line, or by stating that no such line exists. */
122
+ question: string;
123
+ }
124
+ /**
125
+ * The whole set, plus why it is the size it is.
126
+ *
127
+ * `dropped` and `degraded` exist because of locked decision 6: an empty
128
+ * obligation list and an unavailable input must never be indistinguishable. A
129
+ * silently truncated list is the dependency-cruiser failure — a green gate that
130
+ * saw nothing.
131
+ */
132
+ export interface SpecObligationSet {
133
+ obligations: SpecObligation[];
134
+ /** How many criteria were extracted but did not fit inside the budget. */
135
+ dropped: number;
136
+ /** Total changed files the candidates were drawn from. */
137
+ changedFileCount: number;
138
+ /**
139
+ * Why the set is empty or partial, in the words the block renders. Empty when
140
+ * nothing degraded.
141
+ */
142
+ degraded: string[];
143
+ }
144
+ /** Inputs the extractor works from. All of it is already on the `PrState` snapshot. */
145
+ export interface SpecInputs {
146
+ /** The PR's own body. */
147
+ prBody: string;
148
+ /** The issues the PR declares it closes, with their bodies. */
149
+ closes: SpecLinkedIssue[];
150
+ /** The PR's changed paths, or `null` when the read FAILED (not "there are none"). */
151
+ changedFiles: string[] | null;
152
+ /** `review.analysis.maxSpecObligations`. */
153
+ max: number;
154
+ }
155
+ /**
156
+ * Pull the acceptance criteria out of one markdown body.
157
+ *
158
+ * Three recognisers, strongest first, and a line is claimed by the first that
159
+ * matches so one requirement never becomes two obligations:
160
+ *
161
+ * 1. **checklist** — `- [ ] …`. The most explicit statement of intent a body
162
+ * can carry.
163
+ * 2. **criteria-section** — bullets under an "Acceptance criteria"-style
164
+ * heading, up to the next heading.
165
+ * 3. **modal** — a sentence carrying must/should/shall. Weakest, and last.
166
+ *
167
+ * Exported for its own tests: the recognisers are where a false positive turns
168
+ * a spec obligation into noise, and noise here costs a discharge.
169
+ */
170
+ export declare function extractAcceptanceCriteria(body: string, source: CriterionSource): AcceptanceCriterion[];
171
+ /**
172
+ * Rank the changed files by how likely each is to be where this criterion
173
+ * landed, and take the top {@link MAX_CANDIDATES}.
174
+ *
175
+ * The ranking is a convenience, not the mechanism: the second end is the changed
176
+ * file set, and a shortlist of it is still that set narrowed by a rule the agent
177
+ * can see. Ties keep the diff's own order, so a criterion that matches nothing
178
+ * still yields the first few changed files rather than an empty list — which
179
+ * would make the obligation one-ended, and a one-ended obligation is worse than
180
+ * none at all.
181
+ */
182
+ export declare function rankCandidates(criterion: string, changedFiles: string[]): string[];
183
+ /**
184
+ * Build the obligation set for one PR.
185
+ *
186
+ * Ranking, and why the linked issue beats the PR body: the issue is **what was
187
+ * asked**, the PR body is **what the author says they did**. An obligation
188
+ * drawn from the second is much closer to asking the reviewer to confirm the
189
+ * author's own summary, which is the failure mode this axis exists to avoid.
190
+ * Within a source, the recogniser's strength decides
191
+ * ({@link CRITERION_RANK}).
192
+ */
193
+ export declare function buildSpecObligations(inputs: SpecInputs): SpecObligationSet;
194
+ /**
195
+ * Render the block the reviewing agent reads as `{{specObligations}}`.
196
+ *
197
+ * **Emitted from code, not from a prompt template**, for the same reason
198
+ * `renderPrNotes` emits its own fence and trust statement: the instruction and
199
+ * the mechanism it governs must not be separable. A fork that kept the
200
+ * obligations and dropped the "quote a line or say it is absent" rule would
201
+ * produce exactly the discharge v3 measured — a 17-row ledger, honestly
202
+ * completed, zero findings — and the arm would read as "the spec axis does not
203
+ * work".
204
+ *
205
+ * ── What this family legitimately does differently, and what it does not ────
206
+ *
207
+ * It is the sixth branch of a six-branch survey and everything about *how a
208
+ * question is answered* is now `renderFamilyBlock`'s, verbatim where it can be:
209
+ * the four codes, the prescribed row and its field names, `failureScenario`
210
+ * REQUIRED but `null` on a clean QUOTE, the un-truncated id checklist, one
211
+ * worked exemplar, the id namespacing, and the hard limits. Three things stay
212
+ * different **because the inputs are**:
213
+ *
214
+ * 1. The obligations come from the PR body and the linked issues, not from
215
+ * `facts.json` — so an obligation carries a `criterion` + `source` rather
216
+ * than a `mechanism` + `introducedAt`, and there is no `expects:` line
217
+ * (nothing predicts whether a criterion is quote- or probe-answerable).
218
+ * 2. They are built harness-side and never reach `obligations.json`, so there
219
+ * is no `lastlight-facts discharge --ledger` to point at. The block says
220
+ * that in those words — otherwise the missing pointer reads as an
221
+ * oversight — and the id list below IS the checklist.
222
+ * 3. It is delivered as `{{specObligations}}` template context rather than a
223
+ * `context_file`, because there is no file on disk to attach. That is why
224
+ * nothing in this block may contain `{{` or `}}`: unlike its five siblings
225
+ * it goes through `renderTemplate`, whose leftover-marker guard would flag
226
+ * them.
227
+ *
228
+ * Returns `""` when there is nothing to say AND nothing degraded, so the caller
229
+ * can omit the key entirely; a degraded set still renders, because
230
+ * "we could not look" and "we looked and it is fine" are different facts
231
+ * (locked decision 6). This is the one place `renderFamilyBlock`'s never-empty
232
+ * rule is not copied, and the reason is that its purpose is served elsewhere: a
233
+ * family block's ABSENCE is ambiguous because it is a FILE, while this key's
234
+ * absence fires `survey-spec.md`'s own fallback. **It is also unreachable from
235
+ * {@link buildSpecObligations}**, which pushes a `degraded[]` reason on every
236
+ * path that returns no obligation.
237
+ *
238
+ * ── `contract` — the sixth axis moves with the five ─────────────────────────
239
+ *
240
+ * `review.analysis.obligationContract`, the control for 2026-08-23's result
241
+ * (recall 4-of-5 → 0-of-5 while compliance went 0/33 → 33/33, two variables at
242
+ * once). Its argument, its measurement and the five siblings' implementation are
243
+ * in `packages/code-facts/src/seed-render.ts`; this parameter is the same switch
244
+ * so that the arm changes six blocks and not five. Under `minimal` this block
245
+ * drops the pointer at the row's `discharge` field, the `discharge` and
246
+ * `failureScenario` fields themselves, the un-truncated id checklist (and the
247
+ * note explaining why there is no `--ledger` for it), the worked exemplar and
248
+ * the `ROW_RULES` that only exist to govern those two fields. Nothing else
249
+ * moves — see {@link SPEC_DISCHARGE_MINIMAL} for why this is not a revert of
250
+ * this file to its own pre-2026-08-23 text.
251
+ *
252
+ * The default is `full`, so every existing caller — including every test that
253
+ * passes one argument — renders exactly what it rendered before.
254
+ */
255
+ export declare function renderSpecObligations(set: SpecObligationSet, contract?: ObligationContract): string;
256
+ /**
257
+ * Render the linked issues as `{{linkedIssues}}` — the prose behind the
258
+ * criteria, so the agent can go and read the ask rather than only the extract.
259
+ *
260
+ * A fenced block for the same reason `renderPrNotes` fences: this is untrusted
261
+ * text written by whoever opened the issue, and it must read as evidence the
262
+ * agent is looking at, never as instructions addressed to it.
263
+ */
264
+ export declare function renderLinkedIssues(issues: SpecLinkedIssue[]): string;