lastlight-core 0.26.0 → 0.28.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.
- package/config/default.yaml +302 -5
- package/dist/admin/docker.js.map +1 -1
- package/dist/admin/sessions.js.map +1 -1
- package/dist/admin/tail.js.map +1 -1
- package/dist/config/config.d.ts +18 -4
- package/dist/config/config.js +122 -9
- package/dist/config/config.js.map +1 -1
- package/dist/config/repo-config.js.map +1 -1
- package/dist/connectors/messaging/session-manager.js.map +1 -1
- package/dist/connectors/slack/connector.js.map +1 -1
- package/dist/cron/dependabot-discovery.js.map +1 -1
- package/dist/cron/review-discovery.js.map +1 -1
- package/dist/engine/agent-executor.d.ts +25 -1
- package/dist/engine/agent-executor.js +41 -1
- package/dist/engine/agent-executor.js.map +1 -1
- package/dist/engine/chat/chat-prompt.js.map +1 -1
- package/dist/engine/chat/chat-runner.js.map +1 -1
- package/dist/engine/dispatcher.js +17 -0
- package/dist/engine/dispatcher.js.map +1 -1
- package/dist/engine/event-shim.d.ts +18 -0
- package/dist/engine/event-shim.js +2 -0
- package/dist/engine/event-shim.js.map +1 -1
- package/dist/engine/executors/orchestrator.d.ts +92 -1
- package/dist/engine/executors/orchestrator.js +144 -46
- package/dist/engine/executors/orchestrator.js.map +1 -1
- package/dist/engine/executors/shared.js.map +1 -1
- package/dist/engine/fix-harvest.js.map +1 -1
- package/dist/engine/github/github.d.ts +59 -0
- package/dist/engine/github/github.js +72 -0
- package/dist/engine/github/github.js.map +1 -1
- package/dist/engine/github/installations.js.map +1 -1
- package/dist/engine/github/review-poster.d.ts +403 -9
- package/dist/engine/github/review-poster.js +619 -52
- package/dist/engine/github/review-poster.js.map +1 -1
- package/dist/engine/github/team-visibility.js.map +1 -1
- package/dist/engine/llm.js.map +1 -1
- package/dist/engine/pr-decisions.d.ts +85 -5
- package/dist/engine/pr-decisions.js +331 -5
- package/dist/engine/pr-decisions.js.map +1 -1
- package/dist/engine/pr-state.d.ts +82 -0
- package/dist/engine/pr-state.js +71 -1
- package/dist/engine/pr-state.js.map +1 -1
- package/dist/engine/review-spec.d.ts +264 -0
- package/dist/engine/review-spec.js +723 -0
- package/dist/engine/review-spec.js.map +1 -0
- package/dist/engine/router.js.map +1 -1
- package/dist/engine/screen/classifier.js.map +1 -1
- package/dist/engine/screen/screen.js.map +1 -1
- package/dist/evals-api.d.ts +3 -0
- package/dist/evals-api.js +20 -0
- package/dist/evals-api.js.map +1 -1
- package/dist/index.js +76 -11
- package/dist/index.js.map +1 -1
- package/dist/notify/digest-blocks.js.map +1 -1
- package/dist/notify/model.js.map +1 -1
- package/dist/notify/transports/github.js.map +1 -1
- package/dist/notify/transports/slack.js.map +1 -1
- package/dist/sandbox/artifact-backend.js.map +1 -1
- package/dist/sandbox/artifact-store.js.map +1 -1
- package/dist/sandbox/docker.d.ts +23 -4
- package/dist/sandbox/docker.js +1 -1
- package/dist/sandbox/docker.js.map +1 -1
- package/dist/sandbox/egress-allowlist.js.map +1 -1
- package/dist/sandbox/k8s/agent-context-registry.js.map +1 -1
- package/dist/sandbox/k8s/client.js.map +1 -1
- package/dist/sandbox/k8s/kubernetes-sandbox.js.map +1 -1
- package/dist/sandbox/k8s/resource-name.js.map +1 -1
- package/dist/sandbox/k8s/run-id.js.map +1 -1
- package/dist/sandbox/k8s/run-secrets.js.map +1 -1
- package/dist/sandbox/k8s/skill-bundle.js.map +1 -1
- package/dist/sandbox/k8s/workspace-provisioner.js +10 -2
- package/dist/sandbox/k8s/workspace-provisioner.js.map +1 -1
- package/dist/sandbox/sandbox.d.ts +20 -0
- package/dist/sandbox/sandbox.js +27 -6
- package/dist/sandbox/sandbox.js.map +1 -1
- package/dist/session-log.js.map +1 -1
- package/dist/state/approval-store.js.map +1 -1
- package/dist/state/build-assets.js.map +1 -1
- package/dist/state/cron-run-store.js.map +1 -1
- package/dist/state/data-migrate.d.ts +135 -0
- package/dist/state/data-migrate.js +309 -0
- package/dist/state/data-migrate.js.map +1 -0
- package/dist/state/db.d.ts +24 -3
- package/dist/state/db.js +41 -11
- package/dist/state/db.js.map +1 -1
- package/dist/state/execution-store.js.map +1 -1
- package/dist/state/feedback-store.js.map +1 -1
- package/dist/state/pg-client.d.ts +44 -0
- package/dist/state/pg-client.js +81 -0
- package/dist/state/pg-client.js.map +1 -0
- package/dist/state/schema/pg.d.ts +15 -15
- package/dist/state/schema/sqlite.d.ts +15 -15
- package/dist/state/state-cli.d.ts +8 -0
- package/dist/state/state-cli.js +247 -0
- package/dist/state/state-cli.js.map +1 -0
- package/dist/state/team-store.js.map +1 -1
- package/dist/state/user-store.js.map +1 -1
- package/dist/state/workflow-run-store.js.map +1 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/workflows/handlers/fanout.d.ts +157 -0
- package/dist/workflows/handlers/fanout.js +663 -0
- package/dist/workflows/handlers/fanout.js.map +1 -0
- package/dist/workflows/handlers/post-review.d.ts +111 -10
- package/dist/workflows/handlers/post-review.js +531 -39
- package/dist/workflows/handlers/post-review.js.map +1 -1
- package/dist/workflows/runner.js +33 -0
- package/dist/workflows/runner.js.map +1 -1
- package/dist/workflows/simple.js.map +1 -1
- package/docker-compose.yml +50 -0
- package/package.json +22 -12
- package/sandbox.Dockerfile +54 -0
- package/skills/adjudicate-pass/SKILL.md +117 -0
- package/skills/code-review/SKILL.md +114 -15
- package/skills/pr-review/SKILL.md +113 -24
- package/skills/pr-review/references/findings-schema.md +38 -7
- package/skills/survey-pass/SKILL.md +148 -0
- package/workflows/pr-review.yaml +626 -0
- package/workflows/prompts/dependabot-pr-merge.md +22 -2
- package/workflows/prompts/review-adjudicate.md +340 -0
- package/workflows/prompts/review-falsify.md +167 -0
- package/workflows/prompts/review.md +80 -0
- package/workflows/prompts/survey-contract.md +121 -0
- package/workflows/prompts/survey-enforcement.md +137 -0
- package/workflows/prompts/survey-security.md +165 -0
- package/workflows/prompts/survey-spec.md +116 -0
- package/workflows/prompts/survey-state.md +151 -0
- package/workflows/prompts/survey-tests.md +99 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: survey-pass
|
|
3
|
+
description: The shared rules for ONE pass of a multi-pass PR review — the workspace layout, the finding tiers, what is not a finding, and the one rule that separates a survey pass from a reviewer (the precision gate does not fire on you; over-produce). 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: 1.0.0
|
|
5
|
+
tags: [review, survey, multi-pass]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Survey pass
|
|
9
|
+
|
|
10
|
+
You are **one pass of a multi-pass review**. You discharge one family's
|
|
11
|
+
obligations and append hypotheses to that family's file. A later phase probes
|
|
12
|
+
what you record and a stronger model adjudicates it; **both can only remove**.
|
|
13
|
+
|
|
14
|
+
This skill is what every family's pass shares. Your prompt carries the family's
|
|
15
|
+
question and its obligations, and it wins wherever the two differ.
|
|
16
|
+
|
|
17
|
+
## What you are not
|
|
18
|
+
|
|
19
|
+
You are not producing the review, and three whole procedures therefore do not
|
|
20
|
+
apply to you: posting, `findings.json`, and deciding what is worth a maintainer's
|
|
21
|
+
attention. A later phase owns all three.
|
|
22
|
+
|
|
23
|
+
That is not a restriction on what you may notice. It is the reason you should
|
|
24
|
+
notice more.
|
|
25
|
+
|
|
26
|
+
## The precision gate does not fire on you
|
|
27
|
+
|
|
28
|
+
The `code-review` rubric a reviewer follows is precision-first: *"if you cannot
|
|
29
|
+
name the concrete impact, do not post it"*, and a confidence gate before
|
|
30
|
+
finalising. **None of that is yours to do.** Yours is not the last hand on the
|
|
31
|
+
work — every downstream stage can only *remove*, so nothing there can recover a
|
|
32
|
+
hypothesis you declined to write down, and a pass that self-censors is deleting
|
|
33
|
+
evidence on behalf of a stage that has not run yet.
|
|
34
|
+
|
|
35
|
+
**Record the mechanism you cannot yet refute.** Unease is not a refutation, and
|
|
36
|
+
here it is not even a reason to hesitate: write it down with what you do and do
|
|
37
|
+
not know.
|
|
38
|
+
|
|
39
|
+
The split is measured, not stylistic. Google's AutoCommenter found a single
|
|
40
|
+
**global** confidence threshold (`t = 0.98`) catastrophic — roughly **80% of the
|
|
41
|
+
predictions it discarded as below-threshold were correct anyway**. Replacing it
|
|
42
|
+
with per-check thresholds raised recall without costing precision. The gate is
|
|
43
|
+
worth having at the one point where a wrong finding is actually paid for, and is
|
|
44
|
+
expensive everywhere upstream of it. You are upstream of it.
|
|
45
|
+
|
|
46
|
+
## Workspace
|
|
47
|
+
|
|
48
|
+
The harness pre-clones the PR's head ref and drops you **inside the checkout** —
|
|
49
|
+
your cwd **is** the repo (`ls -la` shows `.git/` directly). Use `git` / `read` /
|
|
50
|
+
`grep` from here.
|
|
51
|
+
|
|
52
|
+
**Every `.lastlight/…` path in your prompt is relative to that cwd — use it
|
|
53
|
+
relative, never absolute.** The skill files you were handed are absolute paths
|
|
54
|
+
under `…/.lastlight-skills/`, and that directory is a **sibling of the checkout,
|
|
55
|
+
one level above you**. Joining a `.lastlight/…` path onto the directory your
|
|
56
|
+
skills came from lands outside the repo and reads nothing. Measured, not
|
|
57
|
+
hypothetical: it cost 23 of 120 survey branches their seeded obligations across
|
|
58
|
+
three runs.
|
|
59
|
+
|
|
60
|
+
**Read code from this local checkout, never the API.** Do not call
|
|
61
|
+
`github_get_pull_request_diff`, `github_list_pull_request_files` or
|
|
62
|
+
`github_get_file_contents` — the API patch is a large redundant payload that
|
|
63
|
+
re-bloats context every turn.
|
|
64
|
+
|
|
65
|
+
A **staged diff** is already on disk under `.lastlight/pr-review/diff/` — an
|
|
66
|
+
index plus one patch per changed file, in head coordinates. Do not re-derive the
|
|
67
|
+
range with `git diff`; it is written down. But the patch is your **starting
|
|
68
|
+
point, not your scope**: you are in the full checkout, and the highest-value
|
|
69
|
+
findings live in the files the diff never opened.
|
|
70
|
+
|
|
71
|
+
## Finding tiers
|
|
72
|
+
|
|
73
|
+
Categorise every hypothesis into exactly one tier. You post nothing, so this is
|
|
74
|
+
vocabulary for the adjudicator, not a filter on you:
|
|
75
|
+
|
|
76
|
+
- **Critical** — data loss, breaking changes, silent data-dropping, or a security
|
|
77
|
+
issue that crosses a trust boundary (see below). Blocks merge.
|
|
78
|
+
- **Important** — missing tests, performance problems, type errors, avoidable
|
|
79
|
+
duplication, excessive complexity, compiler-silencing assertions. Should fix.
|
|
80
|
+
- **Minor** — everything below that bar, including a clean discharge. Record it;
|
|
81
|
+
the tier is what stops it competing for attention.
|
|
82
|
+
|
|
83
|
+
**Critical needs a trust boundary, not a category.** "This input is attacker
|
|
84
|
+
controlled" is not enough on its own — name the boundary the input crosses and a
|
|
85
|
+
capability the supplier does not already have. A local CLI parsing a file the
|
|
86
|
+
user themselves wrote is codegen robustness, not a security boundary: the
|
|
87
|
+
supplier of the input already holds every capability the finding would grant.
|
|
88
|
+
Severity feeds the adjudicator's ranking and therefore what occupies a
|
|
89
|
+
maintainer's top slots, so an inflated one spends attention that a real Critical
|
|
90
|
+
needed.
|
|
91
|
+
|
|
92
|
+
## Not findings
|
|
93
|
+
|
|
94
|
+
The list your prompt gives you is what *counts*. This is what does **not**,
|
|
95
|
+
however real it may be. It is a **category** rule, not a confidence bar: "I am
|
|
96
|
+
not certain this is enforced" is not on it, and nothing here narrows the
|
|
97
|
+
instruction to over-produce. The only thing it removes is noise you were never
|
|
98
|
+
supposed to produce, never a mechanism you could not refute.
|
|
99
|
+
|
|
100
|
+
- **Pre-existing issues.** The change is adjacent to them; it did not cause them.
|
|
101
|
+
- **Anything a linter, typechecker or compiler would catch.** They already run,
|
|
102
|
+
and they are right more often than you are. The exception is an assertion that
|
|
103
|
+
*silences* one — `as any`, `@ts-ignore` — which is by definition something the
|
|
104
|
+
compiler does not catch.
|
|
105
|
+
- **Real issues on lines this PR did not touch — unless this PR is what makes
|
|
106
|
+
them wrong.** A consumer the diff never opened, now reading a shape the diff
|
|
107
|
+
moved, IS a finding and is the highest-value one there is. What is excluded is
|
|
108
|
+
a defect that was already there and still is.
|
|
109
|
+
- **Changes that are clearly intentional and part of the broader change.** If the
|
|
110
|
+
diff is doing X on purpose, "this does X" is a restatement, not a finding.
|
|
111
|
+
- **Points already deliberately silenced in the code** — an explicit suppression,
|
|
112
|
+
an ignore directive, a comment saying why. Someone already decided.
|
|
113
|
+
- **Conventions the reviewed repository does not actually follow.** **The
|
|
114
|
+
repository's conventions govern — not yours, and not the ones it aspires to.**
|
|
115
|
+
If the merged code does not follow a convention, that convention is aspirational
|
|
116
|
+
and departing from it is not a finding. Read the neighbours of the file you are
|
|
117
|
+
reviewing; they are the standard, not the style guide.
|
|
118
|
+
- **A repeated literal the merged code already repeats.** If the copies agree and
|
|
119
|
+
this change does not make them observably diverge, sharing the constant is a
|
|
120
|
+
suggestion, not a finding. The moment this change DOES let them disagree in
|
|
121
|
+
behaviour it becomes real — but then say what diverges and for whom.
|
|
122
|
+
- **"X is never validated" with no consumer that misbehaves.** A missing check is
|
|
123
|
+
a finding when some input or caller reaches code that then does the wrong
|
|
124
|
+
thing — name that path. Validation nobody's misbehaviour depends on is a design
|
|
125
|
+
note.
|
|
126
|
+
- **Description staleness — though a doc's claims are checkable.** A PR
|
|
127
|
+
description that under- or over-describes the change is not a finding. But a
|
|
128
|
+
doc line, comment or example asserting something checkable about the code's
|
|
129
|
+
behaviour which is **false at head** IS one — the next reader will act on it.
|
|
130
|
+
The test: does the sentence make a claim the code can falsify?
|
|
131
|
+
|
|
132
|
+
Two more, which are about cost rather than category:
|
|
133
|
+
|
|
134
|
+
- Don't nitpick generated files (lockfiles, compiled assets).
|
|
135
|
+
- Don't repeat what linters and CI already catch.
|
|
136
|
+
|
|
137
|
+
## State the residual risk, not the reassurance
|
|
138
|
+
|
|
139
|
+
A discharge that concludes "correctly handled", "properly ordered" or "enforced"
|
|
140
|
+
is a **claim, not a measurement** — and its direction is the one thing no
|
|
141
|
+
downstream stage can flip. A probe and an adjudicator can remove a risk you wrote
|
|
142
|
+
down; they will never see one you graded away as fine.
|
|
143
|
+
|
|
144
|
+
So before you write "correct", name the bar you graded against. Two invariants
|
|
145
|
+
can both be true of the same quoted line, and your family's question is always
|
|
146
|
+
the **strongest** bar it cares about, never the weakest true statement. If you
|
|
147
|
+
cannot name the bar, record the mechanism with no verdict and let the probe
|
|
148
|
+
settle it.
|