lastlight 0.8.0 → 0.10.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 (29) hide show
  1. package/dist/cli/setup.d.ts +14 -4
  2. package/dist/cli/setup.js +91 -30
  3. package/dist/cli/setup.js.map +1 -1
  4. package/dist/config/config.d.ts +24 -0
  5. package/dist/config/config.js +12 -0
  6. package/dist/config/config.js.map +1 -1
  7. package/dist/connectors/github-webhook.d.ts +11 -1
  8. package/dist/connectors/github-webhook.js +10 -17
  9. package/dist/connectors/github-webhook.js.map +1 -1
  10. package/dist/engine/agent-executor.js +16 -0
  11. package/dist/engine/agent-executor.js.map +1 -1
  12. package/dist/engine/chat/chat.d.ts +14 -0
  13. package/dist/engine/chat/chat.js +38 -0
  14. package/dist/engine/chat/chat.js.map +1 -1
  15. package/dist/engine/github/github-tools.d.ts +8 -2
  16. package/dist/engine/github/github-tools.js +4 -2
  17. package/dist/engine/github/github-tools.js.map +1 -1
  18. package/dist/index.js +71 -26
  19. package/dist/index.js.map +1 -1
  20. package/package.json +1 -1
  21. package/plugins/lastlight/.claude-plugin/plugin.json +1 -1
  22. package/plugins/lastlight/README.md +1 -0
  23. package/plugins/lastlight/skills/lastlight-evals/SKILL.md +11 -0
  24. package/plugins/lastlight/skills/lastlight-evals-loop/SKILL.md +210 -0
  25. package/plugins/lastlight/skills/lastlight-evals-loop/references/approach.md +47 -0
  26. package/plugins/lastlight/skills/lastlight-evals-loop/references/guardrails.md +100 -0
  27. package/plugins/lastlight/skills/lastlight-evals-loop/references/journal-format.md +65 -0
  28. package/plugins/lastlight/skills/lastlight-evals-loop/references/levers.md +80 -0
  29. package/plugins/lastlight/skills/lastlight-guide/SKILL.md +7 -1
@@ -0,0 +1,80 @@
1
+ # The three levers — what to edit, and the escalation ladder
2
+
3
+ All three levers change eval outcomes **without touching core** — the real
4
+ production workflow always runs unmodified. You only edit the deployment overlay
5
+ (`instance/`) and, with sign-off, the dataset. Prefer the lowest lever that can
6
+ move the whole failure cluster; escalate only with a written reason.
7
+
8
+ ## Pattern → lever map
9
+
10
+ | Diagnosed pattern (from TRAIN traces) | Most likely lever |
11
+ |---|---|
12
+ | Posts noise / nits the rubric says to suppress (precision loss) | (a) tighten the severity/precision bar in `code-review` skill |
13
+ | Misses a whole class of real issues, e.g. security, concurrency (recall loss) | (a) add that class to the reviewer's what-to-check rubric/prompt |
14
+ | Reviews against the wrong conventions for a repo | (a) generic repo-context, or (b) per-repo context |
15
+ | Wrong-fit findings because it lacks a repo's build/test/domain norms | (b) per-repo `AGENTS.md` (a portable recommendation) |
16
+ | A gold comment is a non-actionable nit, or a clear real finding scores as a false positive because gold omits it | (c) fix the gold — rare, evidence required |
17
+
18
+ ## (a) Prompts / skills / persona + generic repo-context — *generic, auto*
19
+
20
+ The preferred lever. A change here must generalize to every repo. Edit copies in
21
+ the overlay (fork with `lastlight fork <workflow>` / `lastlight fork agent-context`,
22
+ or create the shadowing file at the same logical path — see the **lastlight-overlay**
23
+ skill). Common targets:
24
+
25
+ - `instance/skills/code-review/SKILL.md` — the severity rubric + precision bar
26
+ (what findings survive). The highest-leverage file for precision problems.
27
+ - `instance/skills/pr-review/SKILL.md` — the review procedure (confidence gate,
28
+ findings-file contract).
29
+ - `instance/workflows/prompts/reviewer.md` — the reviewer prompt text.
30
+ - `instance/workflows/pr-review.yaml` — phase wiring (which skills a phase loads).
31
+ - `instance/agent-context/rules.md` / `soul.md` — global persona/rules the agent
32
+ reads via the workspace `AGENTS.md`.
33
+ - `instance/repo-context/AGENTS.md` — **generic** synthetic repo context the
34
+ harness injects into *every* seeded pr-review repo. Use for guidance that would
35
+ help a reviewer on any codebase (e.g. "prefer concrete, line-anchored findings;
36
+ suppress pure style nits"). Held-out gates a keep, so it must genuinely
37
+ generalize.
38
+
39
+ ## (b) Per-repo injected context — *portable finding, signed-off*
40
+
41
+ A dataset sidecar the harness injects **only for that case's repo**:
42
+
43
+ ```
44
+ datasets/pr-review/context/<instance_id>/AGENTS.md (or CLAUDE.md)
45
+ ```
46
+
47
+ This is the *"add this to your repo and your reviews improve by X"* recommendation
48
+ — honest because it's exactly what a maintainer could commit. It is **case-scoped**,
49
+ so the held-out generalization gate doesn't apply; instead it needs human sign-off
50
+ and must pass the no-gold-leak auditor (it must NOT describe this PR's specific
51
+ findings — only standing repo conventions, architecture, and review priorities).
52
+
53
+ How injection works (so you can trust it lands): the harness writes the block into
54
+ the file the agent's runtime actually reads — it appends to an existing
55
+ `AGENTS.md`, else an existing `CLAUDE.md` (never creating an `AGENTS.md` that would
56
+ shadow it), else creates a fresh `AGENTS.md`. Pi auto-loads that file walking up
57
+ from the agent's cwd, so it reaches the model every phase with no prompt change.
58
+ Toggle off for a clean control run with `--no-inject-context` (or
59
+ `EVAL_INJECT_CONTEXT=0`). Provenance is recorded on each result
60
+ (`injectedContext`).
61
+
62
+ ## (c) The eval itself — *rare, signed-off*
63
+
64
+ Edit the case in `datasets/pr-review/instances.json`:
65
+
66
+ - `review_gold[]` (`{ file?, line?, severity, description }`) — the correct answer.
67
+ - `pr.body` / `problem_statement` — what the agent is told about the PR.
68
+
69
+ Only when the gold is **demonstrably wrong or incomplete** — never to force a
70
+ failing case to pass. The justification must name the evidence (e.g. "the human
71
+ PR review made this exact point; gold omitted it, so a correct finding scored as a
72
+ false positive"). Martian's gold set is known-incomplete by design, so a
73
+ real-but-unlisted finding scoring as a false positive is expected — that is *not*
74
+ on its own grounds to edit gold; it's why the headline metric is F1, not F0.5.
75
+
76
+ ## Escalation ladder
77
+
78
+ Try (a) first. Escalate to (b) only when the pattern is genuinely repo-specific
79
+ (a convention that doesn't generalize). Escalate to (c) only when the eval is
80
+ wrong. Record the reason for every escalation in the journal.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lastlight-guide
3
- description: Orientation & router for the Last Light skills. Use ONLY when the user has NOT named a concrete Last Light task — i.e. they're unsure which skill/flow they need, ask "what can Last Light do / where do I start", say "help me with Last Light" with no specific goal, or want a guided tour across server / client / overlay / evals. Do NOT use when the ask already names a task — "set up/deploy a server" → lastlight-server, "connect/log in my CLI" → lastlight-client, "customize a workflow/prompt/persona/config" → lastlight-overlay, "run evals / compare models / author a case / build a PR-review dataset" → lastlight-evals: invoke that skill directly. This skill only routes and, when the goal is ambiguous, asks. Also invocable as /lastlight-guide.
3
+ description: Orientation & router for the Last Light skills. Use ONLY when the user has NOT named a concrete Last Light task — i.e. they're unsure which skill/flow they need, ask "what can Last Light do / where do I start", say "help me with Last Light" with no specific goal, or want a guided tour across server / client / overlay / evals. Do NOT use when the ask already names a task — "set up/deploy a server" → lastlight-server, "connect/log in my CLI" → lastlight-client, "customize a workflow/prompt/persona/config" → lastlight-overlay, "run evals / compare models / author a case / build a PR-review dataset" → lastlight-evals, "iteratively improve an eval toward a target score" → lastlight-evals-loop: invoke that skill directly. This skill only routes and, when the goal is ambiguous, asks. Also invocable as /lastlight-guide.
4
4
  version: 1.0.0
5
5
  tags: [lastlight, guide, router, orientation, help]
6
6
  ---
@@ -66,6 +66,11 @@ exactly what you ship. The loop that ties it together:
66
66
  > customize in **`lastlight-overlay`** → measure the change with
67
67
  > **`lastlight-evals --overlay .`** → keep it or revert.
68
68
 
69
+ To run that loop *toward a target score* — automatically, and without overfitting
70
+ to specific cases — use **`lastlight-evals-loop`**: it diagnoses on a train split,
71
+ validates on a blind held-out split, and proposes one generic overlay fix at a
72
+ time (stopping for sign-off before it touches a gold answer).
73
+
69
74
  ## Quick menu — "I want to…"
70
75
 
71
76
  | …do this | go to |
@@ -76,6 +81,7 @@ exactly what you ship. The loop that ties it together:
76
81
  | Run evals, compare models, browse past runs | **`lastlight-evals`** |
77
82
  | Author an eval case from a GitHub PR or issue | **`lastlight-evals`** (§6) |
78
83
  | Build a PR-review eval dataset from a list of gold PRs | **`lastlight-evals`** (§6) |
84
+ | Iteratively improve a workflow/prompt to raise an eval score | **`lastlight-evals-loop`** |
79
85
 
80
86
  ## Preconditions (what every flow assumes)
81
87