lastlight-core 0.33.2 → 0.34.1
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.
- package/config/default.yaml +137 -48
- package/dist/admin/routes.js +3 -0
- package/dist/admin/routes.js.map +1 -1
- package/dist/config/config.d.ts +1 -1
- package/dist/config/config.js +45 -29
- package/dist/config/config.js.map +1 -1
- package/dist/engine/event-shim.d.ts +22 -0
- package/dist/engine/event-shim.js +98 -0
- package/dist/engine/event-shim.js.map +1 -1
- package/dist/engine/executors/orchestrator.d.ts +13 -0
- package/dist/engine/executors/orchestrator.js +42 -3
- package/dist/engine/executors/orchestrator.js.map +1 -1
- package/dist/engine/github/review-poster.d.ts +249 -40
- package/dist/engine/github/review-poster.js +332 -54
- package/dist/engine/github/review-poster.js.map +1 -1
- package/dist/engine/github/review-summary.d.ts +61 -0
- package/dist/engine/github/review-summary.js +101 -0
- package/dist/engine/github/review-summary.js.map +1 -0
- package/dist/engine/pr-decisions.d.ts +16 -0
- package/dist/engine/pr-decisions.js +127 -11
- package/dist/engine/pr-decisions.js.map +1 -1
- package/dist/engine/review-spec.d.ts +1 -1
- package/dist/engine/review-spec.js +69 -38
- package/dist/engine/review-spec.js.map +1 -1
- package/dist/sandbox/docker.d.ts +8 -0
- package/dist/sandbox/docker.js +31 -0
- package/dist/sandbox/docker.js.map +1 -1
- package/dist/sandbox/k8s/kubernetes-sandbox.d.ts +5 -0
- package/dist/sandbox/k8s/kubernetes-sandbox.js +46 -2
- package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
- package/dist/sandbox/k8s/run-agent-script.d.ts +3 -1
- package/dist/sandbox/k8s/run-agent-script.js +10 -2
- package/dist/sandbox/k8s/run-agent-script.js.map +1 -1
- package/dist/sandbox/resource-usage.d.ts +64 -0
- package/dist/sandbox/resource-usage.js +115 -0
- package/dist/sandbox/resource-usage.js.map +1 -0
- package/dist/sandbox/sandbox.d.ts +20 -0
- package/dist/sandbox/sandbox.js +22 -0
- package/dist/sandbox/sandbox.js.map +1 -1
- package/dist/sandbox/smol.js +6 -0
- package/dist/sandbox/smol.js.map +1 -1
- package/dist/session-log.js +4 -0
- package/dist/session-log.js.map +1 -1
- package/dist/state/execution-store.d.ts +33 -1
- package/dist/state/execution-store.js +54 -12
- package/dist/state/execution-store.js.map +1 -1
- package/dist/state/schema/pg.d.ts +51 -0
- package/dist/state/schema/pg.js +7 -1
- package/dist/state/schema/pg.js.map +1 -1
- package/dist/state/schema/sqlite.d.ts +51 -0
- package/dist/state/schema/sqlite.js +6 -0
- package/dist/state/schema/sqlite.js.map +1 -1
- package/dist/state/workflow-run-store.d.ts +5 -2
- package/dist/state/workflow-run-store.js +10 -4
- package/dist/state/workflow-run-store.js.map +1 -1
- package/dist/telemetry/openinference.d.ts +13 -0
- package/dist/telemetry/openinference.js +13 -0
- package/dist/telemetry/openinference.js.map +1 -1
- package/dist/telemetry/pi-events.js +16 -1
- package/dist/telemetry/pi-events.js.map +1 -1
- package/dist/workflows/handlers/fanout.d.ts +54 -7
- package/dist/workflows/handlers/fanout.js +197 -21
- package/dist/workflows/handlers/fanout.js.map +1 -1
- package/dist/workflows/handlers/post-review.d.ts +17 -0
- package/dist/workflows/handlers/post-review.js +137 -50
- package/dist/workflows/handlers/post-review.js.map +1 -1
- package/dist/workflows/runner.js +1 -1
- package/dist/workflows/runner.js.map +1 -1
- package/drizzle/pg/0002_luxuriant_screwball.sql +3 -0
- package/drizzle/pg/meta/0002_snapshot.json +1894 -0
- package/drizzle/pg/meta/_journal.json +7 -0
- package/drizzle/sqlite/0003_first_namorita.sql +3 -0
- package/drizzle/sqlite/meta/0003_snapshot.json +1725 -0
- package/drizzle/sqlite/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/skills/adjudicate-pass/SKILL.md +24 -20
- package/skills/pr-review/SKILL.md +3 -2
- package/skills/pr-review/references/findings-schema.md +1 -1
- package/skills/survey-pass/SKILL.md +121 -130
- package/workflows/pr-review.yaml +210 -7
- package/workflows/prompts/review-adjudicate.md +413 -264
- package/workflows/prompts/review-falsify.md +185 -44
- package/workflows/prompts/review.md +10 -10
- package/workflows/prompts/survey-contract.md +48 -48
- package/workflows/prompts/survey-enforcement.md +102 -134
- package/workflows/prompts/survey-security.md +53 -56
- package/workflows/prompts/survey-spec.md +52 -37
- package/workflows/prompts/survey-state.md +54 -53
- package/workflows/prompts/survey-tests.md +48 -48
|
@@ -7,46 +7,31 @@ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{bas
|
|
|
7
7
|
|
|
8
8
|
## What this pass is, and what it is not
|
|
9
9
|
|
|
10
|
-
A deterministic layer
|
|
11
|
-
questions that each name BOTH ENDS of a possible defect mechanism: where
|
|
12
|
-
something is introduced, and where it would have to be enforced. Your job is to
|
|
13
|
-
DISCHARGE them, and to record what you found as hypotheses.
|
|
10
|
+
A deterministic layer analysed this diff and wrote **obligations** — questions that each name BOTH ENDS of a possible defect mechanism: where something is introduced, and where it would have to be enforced. Discharge them, and record what you found as hypotheses.
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
and a stronger model adjudicates. Both of them can only REMOVE. Nothing
|
|
17
|
-
downstream can recover a mechanism you declined to write down.
|
|
12
|
+
> **Nothing downstream can recover a mechanism you declined to write down.**
|
|
18
13
|
|
|
19
|
-
So the
|
|
20
|
-
plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
|
|
21
|
-
apply a confidence gate — you are not being scored on precision, and the
|
|
22
|
-
guardrail is elsewhere.
|
|
14
|
+
So: **over-produce** — see the `survey-pass` skill for why the precision gate does not fire on you.
|
|
23
15
|
|
|
24
16
|
## Hard limits on this pass
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
working directory — open them exactly as written and never join them onto an
|
|
38
|
-
absolute path. Re-deriving the range is how a two-dot diff creeps back in and
|
|
39
|
-
claims commits the author never wrote; if the index says NOT AVAILABLE, derive
|
|
40
|
-
it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
|
|
18
|
+
| do NOT | why |
|
|
19
|
+
|---|---|
|
|
20
|
+
| **Do NOT read or write any other family's file** | another pass owns each; appending to disjoint files makes a consensus collapse impossible **by construction**, not by instruction |
|
|
21
|
+
| **Do NOT re-derive this PR's range with `git diff` or `git show`.** | it is already staged — see below |
|
|
22
|
+
|
|
23
|
+
**The range is already resolved.** `.lastlight/pr-review/diff/index.md` lists every changed file with its status, its changed line ranges, and the per-file patch under `.lastlight/pr-review/diff/`. Read those. Paths are relative to your working directory — open them exactly as written, never joined onto an absolute path.
|
|
24
|
+
|
|
25
|
+
If the index says NOT AVAILABLE, derive it yourself as `git diff origin/{{baseBranch}}...HEAD` — **three dots**.
|
|
26
|
+
|
|
27
|
+
<!-- Re-deriving is how a two-dot diff creeps back in and claims commits the
|
|
28
|
+
author never wrote. -->
|
|
41
29
|
|
|
42
30
|
## What you have: the whole checkout
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
references the patch never shows you, follow a changed symbol out into the files
|
|
48
|
-
this PR did not touch. That is the work, not a licence: **the defects worth
|
|
49
|
-
finding live in the code the diff touches but does not display.**
|
|
32
|
+
The staged diff is your STARTING POINT, not your scope: open the changed files whole, grep for the callers the patch never shows you, and follow a changed symbol out into files this PR did not touch.
|
|
33
|
+
|
|
34
|
+
**The defects worth finding live in the code the diff touches but does not display.**
|
|
50
35
|
|
|
51
36
|
## Your family: `state`
|
|
52
37
|
|
|
@@ -69,23 +54,27 @@ contract and you must follow it exactly.
|
|
|
69
54
|
path you construct for it is a guess about a harness layout that varies by
|
|
70
55
|
backend, and earlier passes have lost their seed to exactly that guess.
|
|
71
56
|
|
|
72
|
-
Read the attachment before anything else. It
|
|
73
|
-
three different facts:
|
|
57
|
+
Read the attachment before anything else. It says one of these, and they are different facts:
|
|
74
58
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
| it says | you do |
|
|
60
|
+
|---|---|
|
|
61
|
+
| **obligations** | discharge every one, exactly as its contract says |
|
|
62
|
+
| **NOT MEASURED**, or **no obligations could be built** | make that your FIRST row, then work the diff for this family's question yourself. It is not a result and not a licence to stop: a pass that writes only that row surveyed nothing, and the gate fails it |
|
|
63
|
+
| **NOT AVAILABLE** (or a path to open yourself) | do exactly what it tells you to |
|
|
64
|
+
|
|
65
|
+
A block that was never delivered is **not** a clean result, and not a finding about the code either. Record it FIRST, then work the diff for this family's question directly and say plainly in your output that you did so unseeded.
|
|
78
66
|
|
|
79
67
|
Rank your attention by how much of the impact cone lies OUTSIDE the diff. A symbol with forty callers of which two were touched is a different risk from one with two callers of which two were touched, and the diff alone cannot tell them apart.
|
|
80
68
|
|
|
81
69
|
## The questions an innocent quote cannot answer
|
|
82
70
|
|
|
83
71
|
Phrase every discharge so that a QUOTED LINE is the only honest answer and an
|
|
84
|
-
innocent quote is not available. "The line exists" is not a discharge
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
72
|
+
innocent quote is not available. **"The line exists" is not a discharge.** Ask what the quoted line cannot tell apart, what runs before it, and what happens after it trips.
|
|
73
|
+
|
|
74
|
+
<!-- Every never-matched real defect within reach of an obligation was read,
|
|
75
|
+
quoted, and signed off as fine. -->
|
|
76
|
+
|
|
77
|
+
The recurring shapes for THIS family:
|
|
89
78
|
|
|
90
79
|
1. **Hook / phase ordering.** "This route registers `<hook>` at `<line>`. Name
|
|
91
80
|
the framework's phase order, then quote the earliest line that rejects an
|
|
@@ -122,19 +111,31 @@ recurring shapes for THIS family:
|
|
|
122
111
|
— the lock, the reservation, the single-use credential — or state that the
|
|
123
112
|
failure path leaves it live."
|
|
124
113
|
|
|
114
|
+
|
|
115
|
+
## What closes the mechanism, for `state`
|
|
116
|
+
|
|
117
|
+
The `survey-pass` skill's evidence record is shared by every pass; `control_site` is the
|
|
118
|
+
only field whose meaning is yours to fix. For this family the control is an **invalidation, guard or ordering constraint** — the line that resets the entry, releases the lock, or makes the second call behave like the first. Ask what runs on the SECOND call, not the first.
|
|
119
|
+
|
|
120
|
+
**Every row carries an `evidence` object**, in the shape the `survey-pass` skill defines. It is
|
|
121
|
+
how the verdict is computed, and a row without one cannot be ranked by anything — it falls back
|
|
122
|
+
to a guess. Add it to every row you write.
|
|
123
|
+
|
|
124
|
+
**You do not write `severity` or `needsProbe`.** If the attached block's example row shows them,
|
|
125
|
+
ignore those two fields: they are derived from your evidence, not chosen by you. Everything else
|
|
126
|
+
the attachment prescribes still applies.
|
|
127
|
+
|
|
128
|
+
Worked example — invented, for SHAPE only, showing the fields this family fills:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{"id": "state-001", "obligation": "O-001", "family": "state", "evidence": {"subject": "rosterCache", "control_site": "none", "control_text": "", "authority": "unknown", "order_ok": "unknown", "cannot_distinguish": "nothing", "bypass": "none found", "in_changed_hunk": true, "consequence": "the second request after a member is removed still reads the cached roster; nothing clears it and no TTL bounds it", "trigger": "state", "crosses_boundary": false, "capability_gained": null}, "claim": "nothing invalidates the roster cache when membership changes, so the second call serves a removed member"}
|
|
132
|
+
```
|
|
133
|
+
|
|
125
134
|
## State the residual risk, not the reassurance
|
|
126
135
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
graded against: who or what can reach this code WITHOUT the check, and what
|
|
131
|
-
happens then. Two invariants can both be true of the same quoted line — "the
|
|
132
|
-
check runs before the handler" and "the check runs before any request-derived
|
|
133
|
-
value is read" are different bars — and this family's question is always the
|
|
134
|
-
strongest bar it cares about, never the weakest true statement. If you cannot
|
|
135
|
-
name the bar, record the mechanism with `needsProbe: true` and no verdict: the
|
|
136
|
-
probe and the adjudicator can remove a risk you wrote down, but they will never
|
|
137
|
-
see the one you graded away as fine.
|
|
136
|
+
The `survey-pass` skill carries this rule and its examples. The family-specific half: your bar is what the quoted line **cannot tell apart**, not that the line exists.
|
|
137
|
+
|
|
138
|
+
Name that bar before you write "correct". In a changed hunk, the falsifiable risk goes in `claim` with `needsProbe: true`.
|
|
138
139
|
|
|
139
140
|
## Output
|
|
140
141
|
|
|
@@ -7,46 +7,31 @@ Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{bas
|
|
|
7
7
|
|
|
8
8
|
## What this pass is, and what it is not
|
|
9
9
|
|
|
10
|
-
A deterministic layer
|
|
11
|
-
questions that each name BOTH ENDS of a possible defect mechanism: where
|
|
12
|
-
something is introduced, and where it would have to be enforced. Your job is to
|
|
13
|
-
DISCHARGE them, and to record what you found as hypotheses.
|
|
10
|
+
A deterministic layer analysed this diff and wrote **obligations** — questions that each name BOTH ENDS of a possible defect mechanism: where something is introduced, and where it would have to be enforced. Discharge them, and record what you found as hypotheses.
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
and a stronger model adjudicates. Both of them can only REMOVE. Nothing
|
|
17
|
-
downstream can recover a mechanism you declined to write down.
|
|
12
|
+
> **Nothing downstream can recover a mechanism you declined to write down.**
|
|
18
13
|
|
|
19
|
-
So the
|
|
20
|
-
plausible mechanism you cannot yet refute is a hypothesis, not noise. Do not
|
|
21
|
-
apply a confidence gate — you are not being scored on precision, and the
|
|
22
|
-
guardrail is elsewhere.
|
|
14
|
+
So: **over-produce** — see the `survey-pass` skill for why the precision gate does not fire on you.
|
|
23
15
|
|
|
24
16
|
## Hard limits on this pass
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
working directory — open them exactly as written and never join them onto an
|
|
38
|
-
absolute path. Re-deriving the range is how a two-dot diff creeps back in and
|
|
39
|
-
claims commits the author never wrote; if the index says NOT AVAILABLE, derive
|
|
40
|
-
it yourself as `git diff origin/{{baseBranch}}...HEAD`, three dots.
|
|
18
|
+
| do NOT | why |
|
|
19
|
+
|---|---|
|
|
20
|
+
| **Do NOT read or write any other family's file** | another pass owns each; appending to disjoint files makes a consensus collapse impossible **by construction**, not by instruction |
|
|
21
|
+
| **Do NOT re-derive this PR's range with `git diff` or `git show`.** | it is already staged — see below |
|
|
22
|
+
|
|
23
|
+
**The range is already resolved.** `.lastlight/pr-review/diff/index.md` lists every changed file with its status, its changed line ranges, and the per-file patch under `.lastlight/pr-review/diff/`. Read those. Paths are relative to your working directory — open them exactly as written, never joined onto an absolute path.
|
|
24
|
+
|
|
25
|
+
If the index says NOT AVAILABLE, derive it yourself as `git diff origin/{{baseBranch}}...HEAD` — **three dots**.
|
|
26
|
+
|
|
27
|
+
<!-- Re-deriving is how a two-dot diff creeps back in and claims commits the
|
|
28
|
+
author never wrote. -->
|
|
41
29
|
|
|
42
30
|
## What you have: the whole checkout
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
references the patch never shows you, follow a changed symbol out into the files
|
|
48
|
-
this PR did not touch. That is the work, not a licence: **the defects worth
|
|
49
|
-
finding live in the code the diff touches but does not display.**
|
|
32
|
+
The staged diff is your STARTING POINT, not your scope: open the changed files whole, grep for the callers the patch never shows you, and follow a changed symbol out into files this PR did not touch.
|
|
33
|
+
|
|
34
|
+
**The defects worth finding live in the code the diff touches but does not display.**
|
|
50
35
|
|
|
51
36
|
## Your family: `tests`
|
|
52
37
|
|
|
@@ -61,28 +46,43 @@ contract and you must follow it exactly.
|
|
|
61
46
|
path you construct for it is a guess about a harness layout that varies by
|
|
62
47
|
backend, and earlier passes have lost their seed to exactly that guess.
|
|
63
48
|
|
|
64
|
-
Read the attachment before anything else. It
|
|
65
|
-
three different facts:
|
|
49
|
+
Read the attachment before anything else. It says one of three things, and they are three different facts:
|
|
66
50
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
| it says | you do |
|
|
52
|
+
|---|---|
|
|
53
|
+
| **obligations** | discharge every one, exactly as its contract says |
|
|
54
|
+
| **NOT MEASURED** | record that and stop — do not substitute a judgement for a measurement |
|
|
55
|
+
| **NOT AVAILABLE** (or a path to open yourself) | do exactly what it tells you to |
|
|
56
|
+
|
|
57
|
+
A block that was never delivered is **not** a clean result, and not a finding about the code either. Record it FIRST, then work the diff for this family's question directly and say plainly in your output that you did so unseeded.
|
|
70
58
|
|
|
71
59
|
This family reads a coverage report. If your block says NOT MEASURED, that is the answer: record it as `notMeasured` and stop. Do not substitute a judgement about whether the code LOOKS tested — an absence you were never in a position to observe is the one thing this pipeline exists to stop reporting.
|
|
72
60
|
|
|
61
|
+
|
|
62
|
+
## What closes the mechanism, for `tests`
|
|
63
|
+
|
|
64
|
+
The `survey-pass` skill's evidence record is shared by every pass; `control_site` is the
|
|
65
|
+
only field whose meaning is yours to fix. For this family the control is an **assertion that would fail if the behaviour changed** — the line that checks the result. A test that exercises a path without asserting on it closes nothing.
|
|
66
|
+
|
|
67
|
+
**Every row carries an `evidence` object**, in the shape the `survey-pass` skill defines. It is
|
|
68
|
+
how the verdict is computed, and a row without one cannot be ranked by anything — it falls back
|
|
69
|
+
to a guess. Add it to every row you write.
|
|
70
|
+
|
|
71
|
+
**You do not write `severity` or `needsProbe`.** If the attached block's example row shows them,
|
|
72
|
+
ignore those two fields: they are derived from your evidence, not chosen by you. Everything else
|
|
73
|
+
the attachment prescribes still applies.
|
|
74
|
+
|
|
75
|
+
Worked example — invented, for SHAPE only, showing the fields this family fills:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{"id": "tests-001", "obligation": "O-001", "family": "tests", "evidence": {"subject": "retryWithBackoff()", "control_site": "none", "control_text": "", "authority": "unknown", "order_ok": "unknown", "cannot_distinguish": "nothing", "bypass": "none found", "in_changed_hunk": true, "consequence": "the changed backoff arithmetic is executed by no test, so an off-by-one in the delay ships unnoticed", "trigger": "code_change", "crosses_boundary": false, "capability_gained": null}, "claim": "the changed lines run in no test; the suite exercises the caller but asserts nothing about the delay"}
|
|
79
|
+
```
|
|
80
|
+
|
|
73
81
|
## State the residual risk, not the reassurance
|
|
74
82
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
graded against: who or what can reach this code WITHOUT the check, and what
|
|
79
|
-
happens then. Two invariants can both be true of the same quoted line — "the
|
|
80
|
-
check runs before the handler" and "the check runs before any request-derived
|
|
81
|
-
value is read" are different bars — and this family's question is always the
|
|
82
|
-
strongest bar it cares about, never the weakest true statement. If you cannot
|
|
83
|
-
name the bar, record the mechanism with `needsProbe: true` and no verdict: the
|
|
84
|
-
probe and the adjudicator can remove a risk you wrote down, but they will never
|
|
85
|
-
see the one you graded away as fine.
|
|
83
|
+
The `survey-pass` skill carries this rule and its examples. The family-specific half: your bar is what the test **would still pass with broken**, not that a test is present.
|
|
84
|
+
|
|
85
|
+
Name that bar before you write "correct". In a changed hunk, the falsifiable risk goes in `claim` with `needsProbe: true`.
|
|
86
86
|
|
|
87
87
|
## Output
|
|
88
88
|
|