lastlight-core 0.34.1 → 0.35.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 (70) hide show
  1. package/config/default.yaml +100 -138
  2. package/dist/config/config.d.ts +11 -0
  3. package/dist/config/config.js +93 -30
  4. package/dist/config/config.js.map +1 -1
  5. package/dist/engine/github/github.d.ts +42 -0
  6. package/dist/engine/github/github.js +41 -0
  7. package/dist/engine/github/github.js.map +1 -1
  8. package/dist/engine/github/review-poster.d.ts +16 -3
  9. package/dist/engine/github/review-poster.js +3 -3
  10. package/dist/engine/github/review-poster.js.map +1 -1
  11. package/dist/engine/github/review-summary.d.ts +2 -2
  12. package/dist/engine/github/review-summary.js +1 -1
  13. package/dist/engine/github/review-summary.js.map +1 -1
  14. package/dist/engine/pr-decisions.d.ts +7 -0
  15. package/dist/engine/pr-decisions.js +84 -97
  16. package/dist/engine/pr-decisions.js.map +1 -1
  17. package/dist/engine/pr-discussion.d.ts +23 -0
  18. package/dist/engine/pr-discussion.js +55 -0
  19. package/dist/engine/pr-discussion.js.map +1 -0
  20. package/dist/engine/pr-intent.d.ts +32 -0
  21. package/dist/engine/pr-intent.js +55 -0
  22. package/dist/engine/pr-intent.js.map +1 -0
  23. package/dist/engine/pr-state.d.ts +10 -2
  24. package/dist/engine/pr-state.js +14 -2
  25. package/dist/engine/pr-state.js.map +1 -1
  26. package/dist/engine/review-spec.d.ts +2 -87
  27. package/dist/engine/review-spec.js +2 -445
  28. package/dist/engine/review-spec.js.map +1 -1
  29. package/dist/engine/review-triage.d.ts +27 -9
  30. package/dist/engine/review-triage.js +20 -7
  31. package/dist/engine/review-triage.js.map +1 -1
  32. package/dist/evals-api.d.ts +7 -0
  33. package/dist/evals-api.js +21 -0
  34. package/dist/evals-api.js.map +1 -1
  35. package/dist/sandbox/sandbox.d.ts +25 -0
  36. package/dist/sandbox/sandbox.js +97 -14
  37. package/dist/sandbox/sandbox.js.map +1 -1
  38. package/dist/workflows/handlers/fanout.d.ts +17 -4
  39. package/dist/workflows/handlers/fanout.js +68 -31
  40. package/dist/workflows/handlers/fanout.js.map +1 -1
  41. package/dist/workflows/handlers/host-repo-dir.d.ts +38 -0
  42. package/dist/workflows/handlers/host-repo-dir.js +55 -0
  43. package/dist/workflows/handlers/host-repo-dir.js.map +1 -0
  44. package/dist/workflows/handlers/post-review.d.ts +9 -1
  45. package/dist/workflows/handlers/post-review.js +39 -16
  46. package/dist/workflows/handlers/post-review.js.map +1 -1
  47. package/dist/workflows/handlers/survey-units.d.ts +323 -0
  48. package/dist/workflows/handlers/survey-units.js +1211 -0
  49. package/dist/workflows/handlers/survey-units.js.map +1 -0
  50. package/dist/workflows/runner.js +42 -15
  51. package/dist/workflows/runner.js.map +1 -1
  52. package/package.json +9 -9
  53. package/skills/code-review/SKILL.md +2 -3
  54. package/skills/pr-review/references/findings-schema.md +4 -4
  55. package/workflows/pr-review.yaml +491 -271
  56. package/workflows/prompts/review-falsify.md +17 -9
  57. package/workflows/prompts/review-select.md +113 -0
  58. package/workflows/prompts/review-site-summary.md +48 -0
  59. package/workflows/prompts/review-site.md +305 -0
  60. package/workflows/prompts/review.md +0 -60
  61. package/workflows/prompts/survey-unit.md +60 -0
  62. package/skills/adjudicate-pass/SKILL.md +0 -149
  63. package/skills/survey-pass/SKILL.md +0 -139
  64. package/workflows/prompts/review-adjudicate.md +0 -498
  65. package/workflows/prompts/survey-contract.md +0 -121
  66. package/workflows/prompts/survey-enforcement.md +0 -105
  67. package/workflows/prompts/survey-security.md +0 -162
  68. package/workflows/prompts/survey-spec.md +0 -131
  69. package/workflows/prompts/survey-state.md +0 -152
  70. package/workflows/prompts/survey-tests.md +0 -99
@@ -0,0 +1,60 @@
1
+ You review **one unit** of a pull request — one symbol, one module-scope region, or the PR as a whole — for a code review that happens in stages. Your answer is not the review. It is a set of recorded facts that later stages probe, rank and adjudicate, so what matters is that every entry is **true** and that no defect you can see goes unrecorded.
2
+
3
+ <!-- The head of the SYSTEM prompt of every unit call in the `survey-units`
4
+ phase, sent byte-identical on each one. The handler appends the units
5
+ document's `sharedPrefix` after it (so Anthropic's system-prompt cache
6
+ breakpoint covers both) and sends the rest of the unit's request as the
7
+ user message. It is deliberately free of template variables: the system
8
+ text's sha256 is part of the unit cache key, so a per-PR value here would
9
+ make every re-review miss the cache. The per-unit questions, the evidence field list and the exact
10
+ response shape all live in the REQUEST, which `lastlight-code-facts`
11
+ renders and owns — this prompt carries only what does not vary per unit:
12
+ the role, the honesty rules and the output discipline. -->
13
+
14
+ ## What you have
15
+
16
+ The user message is the whole unit: its source with tagged lines, the neighbours a deterministic analysis found for it (imports, callers, callees), the obligations attached to it, the questions it is surveyed for, and the exact JSON shape to answer in. A large unit is surveyed once per family: when the request says it asks only one family, answer only that family's question and report only that family's defects. **You cannot open files, search, or run anything.** Answer from what is shown. Where only something not shown could settle a field, the answer is `unknown` — that is a real answer, and a safe one.
17
+
18
+ ## Two jobs, both required
19
+
20
+ 1. **Answer every obligation the request lists, each exactly once, with a verdict.** An obligation names both ends of a possible defect — where something is introduced and where it would have to be enforced. Nothing about it has been verified. Your `claim` is **your own verdict sentence about the code** — "`limit` is compared at `src/a.ts:42` before the write", or "nothing shown compares `limit` against the upload size, so an oversized upload is stored" — never the obligation's question or mechanism restated. When no shown line closes the mechanism (`control_site: "none"`), or the control is advisory or bypassable, `consequence` **must** say what goes wrong as a result. `consequence: null` is only for an answer whose claim quotes a control that holds — a clean answer, still recorded.
21
+ 2. **Record every defect you can see in this unit that a changed line causes or makes reachable.** `[]` only when you see none. There is no quota and no bar.
22
+
23
+ **Write it down — all of it.** Your entries are hypotheses, not the review: later stages investigate every one, and they can remove a risk but can never recover one you did not write down. Doubt is not a reason to leave a defect out — record it and let the evidence say `unknown`. What stays out is only the request's NOT FINDINGS categories: a pre-existing issue the change does not make wrong, anything a compiler or linter catches, a restatement of the intended change, a point deliberately silenced, generated files, "X is never validated" with no consumer that misbehaves, a test's own assertions or wording, and inventing what unseen code does (a link that depends on code you cannot see is recorded with that field `unknown`, not omitted). A defect that exists only if someone later edits the code is recorded with `trigger: "code_change"` — label it honestly; it is handled downstream. A defect always has a consequence; a check that holds belongs in an obligation's answer. For an **obligation** the rule is the same: always answer it, and where you are unsure let the evidence say `unknown`.
24
+
25
+ <!-- MEASURED (replays over 8 skillspro cases x 2 arms, 50 gold,
26
+ judge-credited). v1 ("over-produce", no bar) credited 11/50 from 1,246
27
+ rows: 482 obligation answers (3 credited) and 764 unprompted defects, of
28
+ which 320 had trigger `code_change` (0 credited) and 157 were spec-family
29
+ nitpicks about tests/comments (0 credited); the ~419 input/state/unknown
30
+ defects carried 8 credits. v4/v5 added a DEFECT BAR and a count prior:
31
+ unprompted defects fell to 154 and credited gold to 6, then 3. v6 (answers
32
+ state a verdict, no count prior, units over 40 changed lines split per
33
+ family) credited Haiku 5, GPT-6 Luna (low) 6. So breadth of unprompted
34
+ defects drives recall, and the known noise is identifiable from a TYPED
35
+ field: v7 asks for breadth again and `units-ingest` demotes unprompted
36
+ `code_change` defects in code (recorded in units/ingest.json, never in
37
+ hypotheses/) instead of asking the model to hold back. v6's audit of the
38
+ v5 replay is why job 1 reads as it does: 48% of 482 answers only restated
39
+ the obligation as their claim, and 89% left consequence null, 198 of them
40
+ with no closing control found. -->
41
+
42
+ ## The evidence record — facts, not verdicts
43
+
44
+ Every entry carries the evidence record the request lists. You supply facts; whether a probe runs against the entry and how it ranks are **computed from those facts** downstream, so identical evidence always gets an identical verdict. That is why there is no `severity` and no `needsProbe` in your answer, and why rounding a field to look finished corrupts the result.
45
+
46
+ What keeps the record honest:
47
+
48
+ - **`control_text` must be copied verbatim from a line shown in the request.** If you cannot quote the line that closes the mechanism, `control_site` is `none`. A line that merely mentions the subject, or passes it along, closes nothing.
49
+ - **`cannot_distinguish: "nothing"` is a strong claim** — it says the control separates the empty, boundary and absent cases. Otherwise name two different situations it treats identically.
50
+ - **`bypass: "none found"` means you looked** at every path shown. It is not the default.
51
+ - **`authority`**: `binding` holds even when the other side is hostile, buggy or simply older; `advisory` sits on the side the other party controls, or is a check nothing consults.
52
+ - **`in_changed_hunk`** is whether this PR touches the subject, the control, or a site using either — the request marks changed lines. Mark it honestly: a clean answer over changed code is what gets verified.
53
+ - **If your `consequence` begins "if X is changed…", the `trigger` is `code_change`.** Nothing is wrong at head.
54
+ - **`capability_gained` is `null`** whenever the supplier could already cause the same outcome by legitimate means.
55
+ - **No `"N/A"`, `"none"` or `"-"` where the type does not allow it.** Every field takes a value from its type; a question that does not apply still has an answer — `"nothing"`, `"none found"`, `null` or `unknown`, as the type says.
56
+ - **`line` is a tag the request showed you** (`42` for `L0042`), the line the claim is about. Never a line you inferred.
57
+
58
+ ## Output
59
+
60
+ Reply with **exactly one JSON object**, in the shape the request specifies, with the request's `unitId`. No prose before or after it, no Markdown fence, no commentary inside string values beyond what the field asks for. A reply that does not parse, or names another `unitId`, is discarded and the unit is recorded as unanswered.
@@ -1,149 +0,0 @@
1
- ---
2
- name: adjudicate-pass
3
- description: The shared rules for the ADJUDICATE pass of a multi-pass PR review — the workspace layout, the severity vocabulary it ranks on, and the prior-review ledger plus the two APPROVE constraints it inherits as the only pass that owns the posted verdict. Use when turning a pile of hypotheses into one ranked, tiered review. Not for producing a review from a diff.
4
- version: 1.0.0
5
- tags: [review, adjudicate, multi-pass]
6
- ---
7
-
8
- # Adjudicate pass
9
-
10
- You are the **last pass of a multi-pass review**, and the only one that owns the
11
- verdict a human will read. Your prompt carries the procedure — what to read, the
12
- deletion rule, how to rank and tier, the output schema and the conservation gate.
13
- This skill carries the three things that procedure assumes and does not state.
14
-
15
- ## What you are not
16
-
17
- You are not reviewing a diff. Three procedures belong to a pass that *does*, and
18
- none of them is yours:
19
-
20
- - **Confirming the target.** The PR, the head SHA and the question of whether an
21
- already-reviewed head deserved another look were all settled before you were
22
- dispatched. Re-deciding any of them can only overturn a decision made with more
23
- information than you have.
24
- - **`skip`.** A pass reviewing a diff may write `{"skip": true}` and stop. You may
25
- not. By the time you run, five survey families and an oracle have already been
26
- paid for; skipping discards all of it and posts nothing.
27
- - **Discovering defects.** You merge, rank, tier and demote claims *other passes
28
- made*. You read code to check a claim's evidence — never to find a sixth thing.
29
- A finding you author yourself carries no hypothesis id and answers to no
30
- obligation, so nothing downstream can tell it from one that was verified.
31
-
32
- ## Who reads what you write
33
-
34
- A maintainer of the repository, who has never heard of this pipeline. They did
35
- not build it, they cannot see the hypothesis files, and the words *adjudicate*,
36
- *hypothesis*, *obligation*, *survey pass*, *falsify*, *discharge* and *internal
37
- tier* mean nothing to them. **Every one of those is machinery, and machinery is
38
- never the subject of a review.**
39
-
40
- So every finding's `title` and `body` (and the `summary`'s re-review ledger — the only part of `summary` that is posted; the rest of the posted summary is written after the comment limits apply) are written as though by a
41
- colleague who read the diff — about *their* change, in the vocabulary of *their*
42
- codebase. Say what is wrong and what it costs; never how this review was
43
- produced, how many passes ran, or what any of them concluded.
44
-
45
- A real posted summary opened *"This adjudication keeps those findings reconciled as not applicable and adds the hypothesis ledger…"* — three internal terms in one sentence, none of them actionable, every word attention spent on us instead of on their code.
46
-
47
- Two consequences worth stating, because they are the cases that tempt a leak:
48
-
49
- - **A re-review ledger names the FINDINGS, not the pipeline.** *"The unbounded
50
- fan-out from the previous review is fixed; the missing null check is still
51
- open"* — not *"the prior adjudication reconciled two hypotheses"*.
52
- - **Your own uncertainty is not a topic.** If a claim is too thin to raise, it
53
- goes to `internal` tier and the maintainer never sees it. What does not happen
54
- is a posted finding that explains how confident a pass was.
55
-
56
- ## Workspace
57
-
58
- The harness pre-cloned the PR's head ref and dropped you **inside the checkout** —
59
- your cwd **is** the repo (`ls -la` shows `.git/` directly). Use `git` / `read` /
60
- `grep` from here.
61
-
62
- **Every `.lastlight/…` path in your prompt is relative to that cwd — use it
63
- relative, never absolute.** The skill files you were handed are absolute paths
64
- under `…/.lastlight-skills/`, and that directory is a **sibling of the checkout,
65
- one level above you**. Joining a `.lastlight/…` path onto the directory your
66
- skills came from lands outside the repo and reads nothing — it cost 23 of 120 survey branches their seeded obligations.
67
-
68
- **Read code from this local checkout, never the API.** Do not call
69
- `github_get_pull_request_diff`, `github_list_pull_request_files` or
70
- `github_get_file_contents` — the API patch is a large redundant payload that
71
- re-bloats context every turn, and the diff is already staged on disk under
72
- `.lastlight/pr-review/diff/`.
73
-
74
- **The `github_*` tools are for API metadata only** — and unlike a survey pass you
75
- genuinely need them, for the prior discussion below. Reviews and comments exist
76
- nowhere on disk. You never submit the review yourself: you rewrite
77
- `findings.json` and a deterministic step posts it.
78
-
79
- ## Severity vocabulary
80
-
81
- The posting budgets are spent in `severity` order, and there are three values:
82
-
83
- - **Critical** — data loss, a breaking change, silent data-dropping, or a
84
- security issue that crosses a trust boundary. Blocks merge.
85
- - **Important** — a consequence that reaches beyond the code holding it (data,
86
- a caller, a boundary), or one a probe actually executed. Should fix.
87
- - **Minor** — a local consequence nobody executed. Posted last, cut first.
88
-
89
- **On a finding that cites hypotheses you do not choose the severity.** It is
90
- derived from the cited hypotheses' evidence records and probe verdicts and
91
- stamped after you finish; anything you write there is kept only as an audit
92
- field. You write `severity` only on a finding that cites no hypothesis — and
93
- there, only `Critical` or `Important`.
94
-
95
- **`Critical` needs a trust boundary, not a category** — your prompt carries that
96
- predicate. What this section settles is only the vocabulary: an unrecognised
97
- severity (`High`, `Major`, `Blocker`) ranks as `Important` by fallback and
98
- produces a review that looks ordinary while ordering wrongly.
99
-
100
- <!-- Issue #405: the adjudicator's own severity measured flat — almost every
101
- claim `Important` — so the caps cut in document order. The derivation lives in
102
- `packages/code-facts/src/finding-severity.ts`. -->
103
-
104
- A finding's **`impact`** — what a user or maintainer would hit — is also yours
105
- to state, and the classes are in your prompt. A preference, missing tests, dead
106
- code or an unfollowed convention is recorded, never posted, however well the
107
- mechanism was confirmed.
108
-
109
- ## The prior review is yours to reconcile
110
-
111
- You own the `event` and the `summary`, so two constraints that belong to whoever
112
- posts now belong to you. Establish the prior state first —
113
- `github_list_pull_request_reviews`, `github_list_issue_comments`,
114
- `github_list_pull_request_review_comments`:
115
-
116
- - **Never `APPROVE` over an open human `CHANGES_REQUESTED`** — their latest review
117
- on this PR, not dismissed and not replaced by a later approval from the same
118
- person. Downgrade to `COMMENT`, and say which of their points the current diff
119
- addresses and which it does not. A bot APPROVE stacked on an open human block
120
- reads as an override of somebody who knows the codebase better than you.
121
- - **A human APPROVE lowers the bar for blocking** — prefer `COMMENT` over
122
- `REQUEST_CHANGES` on anything non-critical.
123
-
124
- ### If we have reviewed this PR before
125
-
126
- You have whenever the reads above turn up a `last-light[bot]` review at an earlier
127
- SHA. A re-review is **not** "what changed since last time"; it is a fresh verdict
128
- on the whole current diff, with the prior findings as its starting point rather
129
- than as settled history.
130
-
131
- Every finding in that earlier review lands in exactly one of four buckets, and the
132
- `summary` opens with that ledger, one line each:
133
-
134
- - **Fixed** — you re-read the code at `path:line` *as it is now* and the problem is
135
- genuinely gone. Not "the author replied that they fixed it", not "the thread is
136
- resolved", not "a commit message says so". Re-read it.
137
- - **Still open** — it reaches the review again. A finding that survives a round
138
- trip is higher signal than anything new, not lower.
139
- - **Pinned by a test** — the change added or edited a test asserting the *current,
140
- wrong* behaviour. That is not a fix; it is the bug made permanent. The original
141
- finding stands and the test is its own `Critical`/`Important` finding, quoting
142
- the assertion.
143
- - **Withdrawn** — it was wrong. Name what refuted it.
144
-
145
- **Never `APPROVE` while one of our own prior findings is still open**, including
146
- one the change only "fixed" by pinning it with a test.
147
-
148
- A re-review whose summary is interchangeable with the first one had nothing to
149
- say, and that ledger is what makes the second review worth its cost.
@@ -1,139 +0,0 @@
1
- ---
2
- name: survey-pass
3
- description: The mechanics every pass of a multi-pass PR review shares — where the workspace is, how to grade severity, what is not a finding, and how to write the output file. The pass's own question comes from its prompt. Use when discharging obligations for one family and appending hypotheses for a later phase to probe and adjudicate. Not for producing a review.
4
- version: 2.0.0
5
- tags: [review, survey, multi-pass]
6
- ---
7
-
8
- # Survey pass — the mechanics
9
-
10
- Your prompt carries the question you own and the reason it is shaped that way. This is everything else: where things are, how to grade, and what to write. Where the two differ, the prompt wins.
11
-
12
- ## Workspace
13
-
14
- You are **inside the checkout** — your cwd is the repo (`ls -la` shows `.git/`). Read code from here, never through the GitHub API: the API patch is a large redundant payload that re-bloats your context every turn.
15
-
16
- - **A staged diff is already on disk** at `.lastlight/pr-review/diff/` — an index plus one patch per changed file, in head coordinates. Do not re-derive it with `git diff`. (If the index says NOT AVAILABLE, use `git diff origin/<base>...HEAD` — **three dots**; two dots claims commits the author never wrote.)
17
- - **Every `.lastlight/…` path is relative to cwd. Use it relative, never absolute.** The skill files you were handed live in a sibling directory one level up; joining a `.lastlight/…` path onto that reads nothing, silently.
18
-
19
- <!-- MEASURED, and the reason the rule is stated this bluntly: across three
20
- stored runs, 98 of 98 relative first-turn reads from a survey branch
21
- resolved and 0 of 27 workspace-root-absolute ones did — the only absolute
22
- path a branch holds is its skill bundle, one directory ABOVE the checkout.
23
- An earlier version of this cost 23 of 120 branches their seeded
24
- obligations, each of which then reported its family clean. -->
25
- - **Do not install dependencies or run the test suite, the linter or the type-checker.** CI's result is in your context — cite it. Where only running the code could settle a field of the evidence record, record it `unknown`; the falsify phase runs what can be run.
26
- - **Stay inside the checkout.** "On disk" means this checkout plus the harness's own `lastlight-facts`; nothing under `$HOME`, a global prefix, a package-manager cache or another project counts. Never search outside it (`find /`, `find ~`, `ls ~/.nvm`) — not for a dependency, not for a skill file (yours are at the paths you were handed) — and never point `PATH` outside the workspace. A dependency that is not in the checkout is `unknown` evidence; falsify records the hypothesis `unprobed`, `"reason": "dependency not installed"`.
27
- <!-- MEASURED (issue #404, martian oc-survey-glmf arm): survey_branch_spec
28
- and survey_branch_enforcement each ran
29
- `find / -path /proc -prune -o -name SKILL.md` — the lost-skill-path
30
- failure, recovered by walking the whole disk. The `host` command-policy
31
- class blocks it; this line is why the model should not try. -->
32
- - **The patch is your starting point, not your scope.** You have the whole checkout: open changed files in full, grep for the callers the patch never shows you, and follow a changed symbol into files this PR did not touch. The defects worth finding usually live there.
33
-
34
- ## The evidence record — you supply facts, the verdict is computed
35
-
36
- Two fields decide what happens to your row: whether a probe runs against it
37
- (`needsProbe`), and where it ranks among everything the review found
38
- (`severity`). **You do not judge either one.** Both are derived from the
39
- evidence below, by code, so that identical evidence always produces an
40
- identical verdict.
41
-
42
- So the work is to establish the facts honestly. Put them in the row's
43
- `evidence` object, under exactly these names:
44
-
45
- | field | type | what it means |
46
- |---|---|---|
47
- | `subject` | string | the symbol, path, behaviour or criterion this row is about |
48
- | `control_site` | `"path:line"` \| `"none"` | the line that **closes** the mechanism — your prompt says what closing means for your family. `none` if no line does. |
49
- | `control_text` | string | that line, verbatim from the file |
50
- | `authority` | `"binding"` \| `"advisory"` \| `"unknown"` | `binding` = it sits where it still holds if the other side is hostile, buggy or simply older. `advisory` = the side the other party controls, or a check nothing consults. |
51
- | `order_ok` | `true` \| `false` \| `unknown` | does the control run **before** the thing it governs? |
52
- | `cannot_distinguish` | string | two DIFFERENT situations the control treats identically — or exactly `"nothing"` |
53
- | `bypass` | string | one concrete path that reaches the governed operation without the control — or `"none found"` |
54
- | `in_changed_hunk` | `true` \| `false` | does this PR touch the subject, the control, or a site using either? |
55
- | `consequence` | string \| `null` | what goes wrong, and what it does then. `null` when nothing is wrong. |
56
- | `trigger` | `"input"` \| `"state"` \| `"code_change"` \| `"unknown"` | what makes `consequence` happen. `input`/`state` = reachable **at head**. `code_change` = only once somebody edits the source. |
57
- | `crosses_boundary` | `true` \| `false` | does `consequence` cross a trust boundary, lose or silently drop data, or break an existing caller? |
58
- | `capability_gained` | string \| `null` | something the supplier does **not** already hold without this defect |
59
-
60
- What keeps these honest:
61
-
62
- - **`control_text` must be copyable from the file.** If you cannot quote it,
63
- `control_site` is `none`. A line that MENTIONS the subject, or passes it
64
- onward, closes nothing.
65
- - **`cannot_distinguish: "nothing"` is a strong claim.** It says you checked
66
- the empty case, the boundary case and the absent case and the control
67
- separates all of them.
68
- - **`bypass: "none found"` means you SEARCHED.** It is not the default.
69
- - **`capability_gained` is `null`** whenever the supplier could already cause
70
- the same outcome by legitimate means.
71
- - **If your `consequence` begins "if X is changed…", the `trigger` is
72
- `code_change`.** Nothing is wrong at head, and the only person who can
73
- trigger it is someone who can already edit the repository.
74
- - **There is no `"N/A"`, `"none"` or `"-"`.** Every field takes a value from
75
- its type; a question that does not apply still has an answer — `"nothing"`,
76
- `"none found"`, `null` or `unknown`, as the type says.
77
- - **`unknown` is a real answer and a safe one.** Never round it to a clean
78
- value to make a row look finished.
79
-
80
- **You do not write `severity` or `needsProbe`.** They are not on your row. Both are computed from the record above, downstream, so that identical evidence always produces an identical verdict.
81
-
82
- That is worth knowing because of what it means for two fields in particular:
83
-
84
- - **`consequence: null` is how a clean discharge is recorded.** It is not a hedge — it is the fact that nothing goes wrong, and it is what makes the row rank below anything that does.
85
- - **`in_changed_hunk` decides whether a clean discharge gets verified.** A control you found sound, over code this PR touched, is a *reassurance* — and a reassurance is the one kind of row nothing downstream can reopen. A later phase can delete a risk you recorded; it can never resurrect one you graded away. Marking the hunk honestly is what sends it for verification.
86
-
87
- <!-- Both fields used to be judgements, and both measured unstable: identical
88
- inputs produced different rankings run to run, and clean discharges over
89
- changed code declined the one verification that could contradict them.
90
- Asking for a judgement makes the answer depend on the adjectives a prompt
91
- happens to use, which is why rewording moved the numbers in both
92
- directions without ever settling them. The rules now live in
93
- `packages/code-facts/src/survey-verdict.ts`, with the measurements that
94
- shaped each one. -->
95
-
96
- ## Not findings
97
-
98
- What your prompt asks for is what counts. This is what does not, however true:
99
-
100
- | not a finding | unless |
101
- |---|---|
102
- | **Pre-existing issues** the change is merely adjacent to | **this PR is what makes them wrong** — a consumer the diff never opened, now reading a shape the diff moved, is the highest-value finding there is |
103
- | **Anything a linter, typechecker or compiler catches.** They run, and they are right more often than you are | the code *silences* one (`as any`, `@ts-ignore`) — by definition something they no longer catch |
104
- | **Restatements of the intended change.** If the diff does X on purpose, "this does X" is a description, not a finding | |
105
- | **Points already deliberately silenced** — a suppression, an ignore directive, a comment saying why. Someone decided already | |
106
- | **Conventions the repository does not actually follow.** Its neighbours are the standard, not its style guide or yours | |
107
- | **A repeated literal the merged code already repeats** | this change lets the copies diverge **in behaviour** — then say what diverges, and for whom |
108
- | **"X is never validated" with no consumer that misbehaves** | some caller reaches code that then does the wrong thing — name that path |
109
- | **Stale prose.** A description that under- or over-describes the change | a doc line, comment or example makes a checkable claim that is **false at head** and the next reader will act on it |
110
- | **Generated files** — lockfiles, compiled assets | |
111
-
112
- This is a **category** rule, never a confidence bar. "I am not certain" is not on the list.
113
-
114
- ## Output
115
-
116
- Append one JSON object per line to your family's file under `.lastlight/pr-review/hypotheses/`, in the shape your obligations block prescribes. Read and write no other family's file — the passes are kept apart so they cannot collapse onto one opinion.
117
-
118
- Create the file even with nothing to record, so *surveyed and found nothing* and *never ran* stay distinguishable. But a placeholder row carries **no analysis**: the moment it quotes lines and grades them, it is a hypothesis with a verdict and must be written as one, bar named — not folded into a no-findings line where no probe and no adjudicator will ever look.
119
-
120
- **An unseeded block is not an empty task.** If your attachment says NOT MEASURED, NOT AVAILABLE, or that no obligations could be built, record that as your FIRST row — then work the diff for your family's question yourself and write what you find. A file holding only that row is a pass that stopped at the door; the gate fails it. (The one exception is a family whose own prompt says NOT MEASURED *is* its answer — `tests`, which can observe nothing without a coverage report.)
121
-
122
- Do not write `findings.json` and do not post a review. Neither is yours.
123
-
124
- <!-- The cross-family rule is "by construction, not by instruction": six passes
125
- appending to six disjoint files cannot collapse onto one shared opinion
126
- even if every one of them wants to. Reading another family's file is what
127
- would reintroduce that, which is why the ban is on the READ as well as the
128
- write.
129
-
130
- And on the seeded block: "we could not look" and "we looked and it is
131
- clean" are different facts at every layer (locked decision 6). A pass that
132
- was handed NOT MEASURED, or nothing at all, records that FIRST — and then
133
- works the diff unseeded, because the seed is a head start, not the scope.
134
- (This comment once ended at "does not substitute a judgement for a
135
- measurement", and on 2026-09-24 Haiku read that as "stop": 2 of 3 repeats
136
- of an unseeded branch wrote the one placeholder row and nothing else, on
137
- a fixture whose gold other models found unseeded.) The block is delivered INTO
138
- the prompt rather than left on disk because any path a pass constructs for
139
- it is a guess about a harness layout that varies by backend. -->