lastlight-core 0.28.0 → 0.28.2

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 (83) hide show
  1. package/dist/activity.d.ts +19 -0
  2. package/dist/activity.js +28 -0
  3. package/dist/activity.js.map +1 -0
  4. package/dist/admin/activity.d.ts +16 -0
  5. package/dist/admin/activity.js +21 -0
  6. package/dist/admin/activity.js.map +1 -0
  7. package/dist/admin/auth.d.ts +10 -0
  8. package/dist/admin/auth.js +22 -1
  9. package/dist/admin/auth.js.map +1 -1
  10. package/dist/admin/routes.js +211 -7
  11. package/dist/admin/routes.js.map +1 -1
  12. package/dist/cron/dependabot-discovery.d.ts +1 -1
  13. package/dist/cron/handlers.js +20 -0
  14. package/dist/cron/handlers.js.map +1 -1
  15. package/dist/cron/runner.js +24 -2
  16. package/dist/cron/runner.js.map +1 -1
  17. package/dist/engine/dispatcher.js +77 -2
  18. package/dist/engine/dispatcher.js.map +1 -1
  19. package/dist/engine/fix-harvest.js +2 -2
  20. package/dist/engine/fix-harvest.js.map +1 -1
  21. package/dist/engine/github/review-poster.d.ts +21 -0
  22. package/dist/engine/github/review-poster.js +71 -3
  23. package/dist/engine/github/review-poster.js.map +1 -1
  24. package/dist/engine/pr-decisions.js +3 -3
  25. package/dist/engine/pr-decisions.js.map +1 -1
  26. package/dist/engine/pr-state.d.ts +1 -1
  27. package/dist/engine/pr-state.js +3 -3
  28. package/dist/engine/pr-state.js.map +1 -1
  29. package/dist/index.js +47 -6
  30. package/dist/index.js.map +1 -1
  31. package/dist/sandbox/reap.d.ts +1 -1
  32. package/dist/sandbox/reap.js +1 -1
  33. package/dist/state/activity-store.d.ts +118 -0
  34. package/dist/state/activity-store.js +173 -0
  35. package/dist/state/activity-store.js.map +1 -0
  36. package/dist/state/data-migrate.js +3 -0
  37. package/dist/state/data-migrate.js.map +1 -1
  38. package/dist/state/db.d.ts +9 -0
  39. package/dist/state/db.js +9 -0
  40. package/dist/state/db.js.map +1 -1
  41. package/dist/state/schema/pg.d.ts +171 -0
  42. package/dist/state/schema/pg.js +16 -0
  43. package/dist/state/schema/pg.js.map +1 -1
  44. package/dist/state/schema/sqlite.d.ts +197 -0
  45. package/dist/state/schema/sqlite.js +30 -0
  46. package/dist/state/schema/sqlite.js.map +1 -1
  47. package/dist/workflows/handlers/post-review.js +13 -1
  48. package/dist/workflows/handlers/post-review.js.map +1 -1
  49. package/dist/workflows/runner.d.ts +11 -0
  50. package/dist/workflows/runner.js +17 -33
  51. package/dist/workflows/runner.js.map +1 -1
  52. package/dist/workflows/simple.d.ts +3 -4
  53. package/dist/workflows/simple.js +32 -25
  54. package/dist/workflows/simple.js.map +1 -1
  55. package/dist/workflows/target-policy.d.ts +95 -73
  56. package/dist/workflows/target-policy.js +147 -96
  57. package/dist/workflows/target-policy.js.map +1 -1
  58. package/drizzle/pg/0001_brief_gargoyle.sql +15 -0
  59. package/drizzle/pg/meta/0001_snapshot.json +1876 -0
  60. package/drizzle/pg/meta/_journal.json +7 -0
  61. package/drizzle/sqlite/0002_aromatic_vector.sql +15 -0
  62. package/drizzle/sqlite/meta/0002_snapshot.json +1704 -0
  63. package/drizzle/sqlite/meta/_journal.json +8 -1
  64. package/package.json +6 -6
  65. package/skills/adjudicate-pass/SKILL.md +28 -0
  66. package/workflows/answer.yaml +4 -0
  67. package/workflows/build.yaml +8 -0
  68. package/workflows/demo.yaml +10 -0
  69. package/workflows/dependabot-ci-fix.yaml +7 -0
  70. package/workflows/dependabot-pr-merge.yaml +7 -0
  71. package/workflows/explore.yaml +4 -0
  72. package/workflows/issue-comment.yaml +4 -0
  73. package/workflows/issue-triage.yaml +4 -0
  74. package/workflows/pr-comment.yaml +4 -0
  75. package/workflows/pr-fix.yaml +7 -0
  76. package/workflows/pr-review.yaml +9 -0
  77. package/workflows/prompts/review-adjudicate.md +9 -0
  78. package/workflows/prompts/review.md +6 -0
  79. package/workflows/qa-test.yaml +10 -0
  80. package/workflows/repo-health.yaml +5 -0
  81. package/workflows/security-feedback.yaml +4 -0
  82. package/workflows/security-review.yaml +4 -0
  83. package/workflows/verify.yaml +10 -0
@@ -15,6 +15,13 @@
15
15
  "when": 1787040069970,
16
16
  "tag": "0001_backfill_repo_refs",
17
17
  "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "6",
22
+ "when": 1787758571818,
23
+ "tag": "0002_aromatic_vector",
24
+ "breakpoints": true
18
25
  }
19
26
  ]
20
- }
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lastlight-core",
3
- "version": "0.28.0",
3
+ "version": "0.28.2",
4
4
  "description": "GitHub repository maintenance agent — Agent SDK harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,7 @@
45
45
  "node": ">=22.12"
46
46
  },
47
47
  "dependencies": {
48
- "@earendil-works/pi-ai": "^0.84.2",
48
+ "@earendil-works/pi-ai": "^0.84.3",
49
49
  "@hono/node-server": "^2.1.1",
50
50
  "@kubernetes/client-node": "1.4.0",
51
51
  "@libsql/client": "^0.17.4",
@@ -64,11 +64,11 @@
64
64
  "@opentelemetry/semantic-conventions": "^1.41.1",
65
65
  "@sinclair/typebox": "^0.34.49",
66
66
  "@slack/bolt": "^5.0.0",
67
- "@slack/web-api": "^8.0.0",
67
+ "@slack/web-api": "^8.1.1",
68
68
  "arctic": "^3.7.0",
69
69
  "croner": "^10.0.1",
70
70
  "drizzle-orm": "^0.45.2",
71
- "hono": "^4.13.3",
71
+ "hono": "^4.13.5",
72
72
  "octokit": "^5.0.5",
73
73
  "pg": "^8.23.0",
74
74
  "pino": "10.3.1",
@@ -76,8 +76,8 @@
76
76
  "yaml": "^2.8.3",
77
77
  "zod": "^4.3.6",
78
78
  "agentic-pi": "0.4.4",
79
- "lastlight-workflow-engine": "0.5.0",
80
- "lastlight-shared": "0.5.0"
79
+ "lastlight-shared": "0.5.0",
80
+ "lastlight-workflow-engine": "0.5.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@electric-sql/pglite": "^0.5.5",
@@ -29,6 +29,34 @@ none of them is yours:
29
29
  A finding you author yourself carries no hypothesis id and answers to no
30
30
  obligation, so nothing downstream can tell it from one that was verified.
31
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 `summary`, and every finding's `title` and `body`, 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
+ Measured on a real pull request, where a posted summary opened: *"This
46
+ adjudication keeps those findings reconciled as not applicable and adds the
47
+ hypothesis ledger…"*. Three internal terms in one sentence, on a PR about a
48
+ search box. The author cannot act on any of it, and every word of it is
49
+ attention spent on us instead of on their code.
50
+
51
+ Two consequences worth stating, because they are the cases that tempt a leak:
52
+
53
+ - **A re-review ledger names the FINDINGS, not the pipeline.** *"The unbounded
54
+ fan-out from the previous review is fixed; the missing null check is still
55
+ open"* — not *"the prior adjudication reconciled two hypotheses"*.
56
+ - **Your own uncertainty is not a topic.** If a claim is too thin to raise, it
57
+ goes to `internal` tier and the maintainer never sees it. What does not happen
58
+ is a posted finding that explains how confident a pass was.
59
+
32
60
  ## Workspace
33
61
 
34
62
  The harness pre-cloned the PR's head ref and dropped you **inside the checkout** —
@@ -1,5 +1,9 @@
1
1
  kind: answer
2
2
  name: answer
3
+ # Runtime policy (issue #368) — read + post the answer as a comment; never
4
+ # pushes code. Full prose for each key is in the workflow schema
5
+ # (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: issues-write
3
7
  classification:
4
8
  intent: question
5
9
  description: |
@@ -1,5 +1,13 @@
1
1
  kind: build
2
2
  name: build
3
+ # Runtime policy (issue #368) — pushes code, and recreates its workspace from
4
+ # the default branch so an incomplete build is disposable (issue #153).
5
+ # Pre-populates despite synthesizing its own `lastlight/N-slug` branch — it
6
+ # CREATES that branch off the default. Full prose for each key is in the
7
+ # workflow schema (packages/workflow-engine/src/core/schema.ts).
8
+ git_access: repo-write
9
+ workspace: per-target-recreate
10
+ prepopulate_synth_branch: true
3
11
  classification:
4
12
  intent: build
5
13
  description: |
@@ -1,5 +1,15 @@
1
1
  kind: demo
2
2
  name: demo
3
+ # Runtime policy (issue #368) — reads the repo and posts the demo comment (the
4
+ # mp4 is an artifact, not a push). Pre-populates its synthesized branch so
5
+ # `demo.mp4` lands under `.lastlight/<key>/` where `serverArtifacts()`
6
+ # harvests it; against a real PR it pins to the PR's head ref, or the "after"
7
+ # would collapse onto the default branch and match "before". Full prose for
8
+ # each key is in the workflow schema
9
+ # (packages/workflow-engine/src/core/schema.ts).
10
+ git_access: issues-write
11
+ prepopulate_synth_branch: true
12
+ prepopulate_pr_head_ref: true
3
13
  classification:
4
14
  intent: demo
5
15
  description: |
@@ -7,6 +7,13 @@ name: dependabot-ci-fix
7
7
  # drops the key silently loses all four; `validateAssets` warns when a
8
8
  # `routes.github.pr_*` target is missing it.
9
9
  pr_scoped: true
10
+ # Runtime policy (issue #368) — pushes a fix to the PR's head branch, through
11
+ # `handlePrFix`. Shares the fix family's one workspace per PR
12
+ # (`${repo}-${N}-fix`). Full prose for each key is in the workflow schema
13
+ # (packages/workflow-engine/src/core/schema.ts).
14
+ git_access: repo-write
15
+ workspace: per-target-reuse
16
+ pr_fix_shaped: true
10
17
  description: |
11
18
  Fix a dependency-update PR (Dependabot / Renovate) that can't merge on its
12
19
  own — CI is red, or it's `behind` its base / `dirty` (merge conflict) /
@@ -7,6 +7,13 @@ name: dependabot-pr-merge
7
7
  # drops the key silently loses all four; `validateAssets` warns when a
8
8
  # `routes.github.pr_*` target is missing it.
9
9
  pr_scoped: true
10
+ # Runtime policy (issue #368) — never pushes code, but
11
+ # `github_enable_auto_merge` lives in the repo-write tool profile. Always
12
+ # single-PR, so it keys its (checkout-free) run by (repo, PR) and a repeated
13
+ # webhook + the daily cron backstop dedup onto one run. Full prose for each
14
+ # key is in the workflow schema (packages/workflow-engine/src/core/schema.ts).
15
+ git_access: repo-write
16
+ workspace: per-target-reuse
10
17
  description: |
11
18
  Assess an already-GREEN dependency-update PR (Dependabot / Renovate) and, when
12
19
  the change is trivial, enable GitHub auto-merge (squash) so it lands once its
@@ -1,5 +1,9 @@
1
1
  kind: explore
2
2
  name: explore
3
+ # Runtime policy (issue #368) — reads, researches and publishes a spec as an
4
+ # issue/comment; never pushes code. Full prose for each key is in the workflow
5
+ # schema (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: issues-write
3
7
  classification:
4
8
  intent: explore
5
9
  description: |
@@ -1,5 +1,9 @@
1
1
  kind: comment
2
2
  name: issue-comment
3
+ # Runtime policy (issue #368) — replies in-thread; never pushes code. Full
4
+ # prose for each key is in the workflow schema
5
+ # (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: issues-write
3
7
  description: |
4
8
  Respond conversationally to a comment on an issue. Used when a maintainer
5
9
  comments on an issue without explicitly asking for a build — the bot
@@ -1,5 +1,9 @@
1
1
  kind: triage
2
2
  name: issue-triage
3
+ # Runtime policy (issue #368) — labels the issue and comments; never pushes
4
+ # code. Full prose for each key is in the workflow schema
5
+ # (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: issues-write
3
7
  classification:
4
8
  intent: triage
5
9
  description: |
@@ -1,5 +1,9 @@
1
1
  kind: comment
2
2
  name: pr-comment
3
+ # Runtime policy (issue #368) — answers on the PR; never pushes code. Full
4
+ # prose for each key is in the workflow schema
5
+ # (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: issues-write
3
7
  description: |
4
8
  Answer a maintainer's question about an open PR with concrete, code-cited
5
9
  evidence. The PR-side counterpart to `issue-comment` — distinguished
@@ -7,6 +7,13 @@ name: pr-fix
7
7
  # drops the key silently loses all four; `validateAssets` warns when a
8
8
  # `routes.github.pr_*` target is missing it.
9
9
  pr_scoped: true
10
+ # Runtime policy (issue #368) — pushes a fix to the PR's head branch, through
11
+ # `handlePrFix`. Shares the fix family's one workspace per PR
12
+ # (`${repo}-${N}-fix`). Full prose for each key is in the workflow schema
13
+ # (packages/workflow-engine/src/core/schema.ts).
14
+ git_access: repo-write
15
+ workspace: per-target-reuse
16
+ pr_fix_shaped: true
10
17
  description: "Lightweight PR fix — no architect/reviewer, just fix and push"
11
18
  trigger: pr-fix
12
19
  # Single in-place task-list comment/message instead of a comment per phase.
@@ -7,6 +7,15 @@ name: pr-review
7
7
  # drops the key silently loses all four; `validateAssets` warns when a
8
8
  # `routes.github.pr_*` target is missing it.
9
9
  pr_scoped: true
10
+ # Runtime policy (issue #368) — SUBMITS a formal review, which is its own
11
+ # profile above issues-write. Reuses one warm workspace per PR across
12
+ # re-reviews (issue #107), pinned to the PR's real head ref — the synthesized
13
+ # branch name never matches it, so without the pin the review would silently
14
+ # read the BASE branch. Full prose for each key is in the workflow schema
15
+ # (packages/workflow-engine/src/core/schema.ts).
16
+ git_access: review-write
17
+ workspace: per-target-reuse
18
+ prepopulate_pr_head_ref: true
10
19
  classification:
11
20
  intent: review
12
21
  description: |
@@ -255,6 +255,15 @@ sits, so put them where the work is.
255
255
 
256
256
  Rewrite `.lastlight/pr-review/findings.json` **in full**. You own this file now.
257
257
 
258
+ **`summary`, `title` and `body` are POSTED VERBATIM to a maintainer who has never
259
+ heard of this pipeline** — see `adjudicate-pass`. Write about their change in
260
+ their vocabulary; never name a phase, a hypothesis, an obligation, a discharge
261
+ or a tier. *"This adjudication keeps those findings reconciled as not applicable
262
+ and adds the hypothesis ledger"* is a real posted summary and it is the failure
263
+ this paragraph exists to prevent. Everything else in the schema below —
264
+ `family`, `obligation`, `confidence`, `hypotheses`, `mechanism`, `evidence` — is
265
+ machine-read and never rendered, so that is where the bookkeeping belongs.
266
+
258
267
  ```jsonc
259
268
  {
260
269
  "summary": "…",
@@ -55,6 +55,12 @@ skill's format (`skip?` / `summary` / `event` / `findings[]`): the posting step
55
55
  and the adjudicator both require that file to exist even when `findings` is
56
56
  empty. The **code-review** skill's precision bar applies to anything you do
57
57
  report.
58
+
59
+ **Your `summary`, `title` and `body` may be posted verbatim to the maintainer.**
60
+ This prompt has told you about survey families, hypotheses and an adjudicating
61
+ phase so you know what NOT to duplicate — none of it is vocabulary the author
62
+ shares. Write about their change in their words; a review that explains how it
63
+ was produced has spent the reader's attention on us instead of on their code.
58
64
  {{/if}}
59
65
 
60
66
  Context:
@@ -1,5 +1,15 @@
1
1
  kind: qa-test
2
2
  name: qa-test
3
+ # Runtime policy (issue #368) — reads the repo and posts a step-level QA
4
+ # report; never pushes code. Pre-populates its synthesized branch so
5
+ # browser-QA screenshots land under `.lastlight/<key>/` where
6
+ # `serverArtifacts()` harvests them; against a real PR it pins to the PR's
7
+ # head ref, or it would QA the base branch and report the PR's feature
8
+ # missing. Full prose for each key is in the workflow schema
9
+ # (packages/workflow-engine/src/core/schema.ts).
10
+ git_access: issues-write
11
+ prepopulate_synth_branch: true
12
+ prepopulate_pr_head_ref: true
3
13
  classification:
4
14
  intent: qa-test
5
15
  description: |
@@ -1,5 +1,10 @@
1
1
  kind: health
2
2
  name: repo-health
3
+ # Runtime policy (issue #368) — the report is delivered by the harness, not
4
+ # written to GitHub by the agent, so this workflow needs nothing beyond
5
+ # contents:read. Full prose for each key is in the workflow schema
6
+ # (packages/workflow-engine/src/core/schema.ts).
7
+ git_access: read
3
8
  chat:
4
9
  summary: A weekly repo health report
5
10
  deflect:
@@ -1,5 +1,9 @@
1
1
  kind: health
2
2
  name: security-feedback
3
+ # Runtime policy (issue #368) — opens issues AND pushes a SECURITY.md
4
+ # suppression PR, so it needs contents:write. Full prose for each key is in
5
+ # the workflow schema (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: repo-write
3
7
  description: |
4
8
  Process maintainer feedback on a security-labelled issue (usually a
5
9
  per-run scan summary). Classifies the comment and acts:
@@ -1,5 +1,9 @@
1
1
  kind: health
2
2
  name: security-review
3
+ # Runtime policy (issue #368) — scans and files findings as issues/comments;
4
+ # never pushes code. Full prose for each key is in the workflow schema
5
+ # (packages/workflow-engine/src/core/schema.ts).
6
+ git_access: issues-write
3
7
  classification:
4
8
  intent: security
5
9
  description: |
@@ -1,5 +1,15 @@
1
1
  kind: verify
2
2
  name: verify
3
+ # Runtime policy (issue #368) — reads the repo and posts a CONFIRMED/REFUTED
4
+ # verdict; never pushes code. Pre-populates its synthesized branch so
5
+ # browser-QA artifacts land under `.lastlight/<key>/` where
6
+ # `serverArtifacts()` harvests them; against a real PR it pins to the PR's
7
+ # head ref, or it would verify the base branch and refute a claim the PR
8
+ # actually satisfies. Full prose for each key is in the workflow schema
9
+ # (packages/workflow-engine/src/core/schema.ts).
10
+ git_access: issues-write
11
+ prepopulate_synth_branch: true
12
+ prepopulate_pr_head_ref: true
3
13
  classification:
4
14
  intent: verify
5
15
  description: |