lastlight-core 0.35.2 → 0.37.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.
@@ -385,28 +385,28 @@ phases:
385
385
  depends_on: [units-ingest]
386
386
  trigger_rule: all_done
387
387
  timeout_seconds: { from: seedTimeoutSeconds }
388
- # Writes `sites/plan.json` and one brief per slot, `sites/site-001.md` …
389
- # `site-016.md` (it clears `sites/` first — a reused workspace holds the
390
- # last head's). Slots 1–`siteTop` investigate the ranked sites; with
391
- # `models.review-site-pair` set, slots 9–(8+`siteTop`) investigate the
392
- # same sites again on that model. Every other slot is empty: its brief
393
- # says so and its `empty` line is written here, so `site-review`'s
394
- # `skip_satisfied_branches` starts no session for it.
388
+ # Writes `sites/plan.json`, one brief per slot (`sites/site-001.md` …) and
389
+ # `sites/branches.json`, the manifest `site-review` fans out over (it
390
+ # clears `sites/` first — a reused workspace holds the last head's). One
391
+ # slot per ranked site, up to `siteTop`; with `models.review-site-pair`
392
+ # set, a second slot per site, `site-00N-b`, on that model. A PR with two
393
+ # sites plans two investigators, not sixteen.
395
394
  command: |
396
395
  set -u
397
396
  FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
398
397
  # Test-then-flag: an absent {{key}} renders EMPTY and would swallow the
399
398
  # following flag.
400
399
  TOP="{{siteTop}}"
401
- set -- --slots 16
400
+ set --
402
401
  [ -n "$TOP" ] && set -- "$@" --top "$TOP"
403
402
  {{#if models.review-site-pair}}set -- "$@" --pair{{/if}}
404
403
  "$FACTS" sites --plan "$@" --dir .lastlight/pr-review --never-fail
405
404
  exit 0
406
405
 
407
- # One investigator per site, concurrently, in one workspace. The prompt is
408
- # slot-generic (a branch has no variables of its own): the attached brief
409
- # names the site id, the one file the branch writes
406
+ # One investigator per site, concurrently, in one workspace. The branch list
407
+ # is DYNAMIC: `branches_from` reads the manifest `site-plan` just wrote and
408
+ # renders `branch:` once per item (`{{item.id}}`, `{{item.pair}}`). The prompt
409
+ # is slot-generic: the attached brief names the site id, the one file the branch writes
410
410
  # (`sites/<site id>.findings.jsonl` — disjoint across branches, which is the
411
411
  # fan-out's isolation model) and how many probed suspicions a `none` needs.
412
412
  # The gate is the one the evals replay graded (`sites --check`), and
@@ -445,101 +445,20 @@ phases:
445
445
  Nothing outside the checkout counts.
446
446
  on_branch_soft_failure: { retries: 1, then: complete }
447
447
  on_branch_gate_failure: { retries: 1 }
448
- # `site-plan` wrote every empty slot's `empty` line, so its gate is already
449
- # closed: no session for it. Sixteen static branches, of which a PR
450
- # typically uses five (top 5, unpaired) to sixteen (top 8, paired).
451
- skip_satisfied_branches: true
452
- branches:
453
- - name: site-001
454
- context_file: .lastlight/pr-review/sites/site-001.md
455
- until_bash: |
456
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
457
- "$FACTS" sites --check site-001 --dir .lastlight/pr-review --repo .
458
- - name: site-002
459
- context_file: .lastlight/pr-review/sites/site-002.md
460
- until_bash: |
461
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
462
- "$FACTS" sites --check site-002 --dir .lastlight/pr-review --repo .
463
- - name: site-003
464
- context_file: .lastlight/pr-review/sites/site-003.md
465
- until_bash: |
466
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
467
- "$FACTS" sites --check site-003 --dir .lastlight/pr-review --repo .
468
- - name: site-004
469
- context_file: .lastlight/pr-review/sites/site-004.md
470
- until_bash: |
471
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
472
- "$FACTS" sites --check site-004 --dir .lastlight/pr-review --repo .
473
- - name: site-005
474
- context_file: .lastlight/pr-review/sites/site-005.md
475
- until_bash: |
476
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
477
- "$FACTS" sites --check site-005 --dir .lastlight/pr-review --repo .
478
- - name: site-006
479
- context_file: .lastlight/pr-review/sites/site-006.md
480
- until_bash: |
481
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
482
- "$FACTS" sites --check site-006 --dir .lastlight/pr-review --repo .
483
- - name: site-007
484
- context_file: .lastlight/pr-review/sites/site-007.md
485
- until_bash: |
486
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
487
- "$FACTS" sites --check site-007 --dir .lastlight/pr-review --repo .
488
- - name: site-008
489
- context_file: .lastlight/pr-review/sites/site-008.md
490
- until_bash: |
491
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
492
- "$FACTS" sites --check site-008 --dir .lastlight/pr-review --repo .
493
- # Slots 9–16: the second investigator of ranks 1–8, on
494
- # `models.review-site-pair`. Empty (and never started) unless it is set.
495
- - name: site-009
496
- model: "{{models.review-site-pair}}"
497
- context_file: .lastlight/pr-review/sites/site-009.md
498
- until_bash: |
499
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
500
- "$FACTS" sites --check site-009 --dir .lastlight/pr-review --repo .
501
- - name: site-010
502
- model: "{{models.review-site-pair}}"
503
- context_file: .lastlight/pr-review/sites/site-010.md
504
- until_bash: |
505
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
506
- "$FACTS" sites --check site-010 --dir .lastlight/pr-review --repo .
507
- - name: site-011
508
- model: "{{models.review-site-pair}}"
509
- context_file: .lastlight/pr-review/sites/site-011.md
510
- until_bash: |
511
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
512
- "$FACTS" sites --check site-011 --dir .lastlight/pr-review --repo .
513
- - name: site-012
514
- model: "{{models.review-site-pair}}"
515
- context_file: .lastlight/pr-review/sites/site-012.md
516
- until_bash: |
517
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
518
- "$FACTS" sites --check site-012 --dir .lastlight/pr-review --repo .
519
- - name: site-013
520
- model: "{{models.review-site-pair}}"
521
- context_file: .lastlight/pr-review/sites/site-013.md
522
- until_bash: |
523
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
524
- "$FACTS" sites --check site-013 --dir .lastlight/pr-review --repo .
525
- - name: site-014
526
- model: "{{models.review-site-pair}}"
527
- context_file: .lastlight/pr-review/sites/site-014.md
528
- until_bash: |
529
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
530
- "$FACTS" sites --check site-014 --dir .lastlight/pr-review --repo .
531
- - name: site-015
532
- model: "{{models.review-site-pair}}"
533
- context_file: .lastlight/pr-review/sites/site-015.md
534
- until_bash: |
535
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
536
- "$FACTS" sites --check site-015 --dir .lastlight/pr-review --repo .
537
- - name: site-016
538
- model: "{{models.review-site-pair}}"
539
- context_file: .lastlight/pr-review/sites/site-016.md
540
- until_bash: |
541
- FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
542
- "$FACTS" sites --check site-016 --dir .lastlight/pr-review --repo .
448
+ # `max` is the spend cap: top 8, paired. More items than that are dropped,
449
+ # loudly — `site-plan` never writes more.
450
+ branches_from:
451
+ file: .lastlight/pr-review/sites/branches.json
452
+ max: 16
453
+ branch:
454
+ name: "{{item.id}}"
455
+ # A pair slot runs on `models.review-site-pair`; a primary renders empty
456
+ # here and so takes the phase's `model:` above.
457
+ model: "{{#if item.pair}}{{models.review-site-pair}}{{/if}}"
458
+ context_file: ".lastlight/pr-review/sites/{{item.id}}.md"
459
+ until_bash: |
460
+ FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
461
+ "$FACTS" sites --check {{item.id}} --dir .lastlight/pr-review --repo .
543
462
  # Pool every site's findings for `select`: numbered `F1…Fn`, each with an
544
463
  # excerpt, and the duplicate groups line proximity PROPOSES (it cannot decide
545
464
  # "same defect"; no rule here reads prose). STDOUT is the delivery mechanism
@@ -569,6 +488,13 @@ phases:
569
488
  # merge and demote (`nit` is recorded, never posted) but never silently drop.
570
489
  # A selection that never closes is not fatal: `sites --finalize` falls back
571
490
  # to one item per finding at the investigator's own importance.
491
+ #
492
+ # Skipped when `merge` pooled nothing (its FIRST line is `SITE_MERGE_EMPTY`;
493
+ # `startsWith`, because a finding's code excerpt can quote the marker): the one
494
+ # correct selection is empty, `--finalize` falls back to the empty pool, and
495
+ # an agent asked to write it wrote the file and then an empty completion,
496
+ # failing the phase and its retry. A resumed run has no `siteMerge` output
497
+ # (a dedup skip returns none), so select runs — the safe direction.
572
498
  - name: select
573
499
  label: Sites · select
574
500
  prompt: prompts/review-select.md
@@ -577,6 +503,7 @@ phases:
577
503
  skip_if:
578
504
  - "analysisEnabled != true"
579
505
  - "scratch.reviewTriage.depth == 'light'"
506
+ - "phaseOutputs.siteMerge.startsWith('SITE_MERGE_EMPTY')"
580
507
  depends_on: [merge]
581
508
  trigger_rule: all_done
582
509
  command_policy:
@@ -4,8 +4,9 @@ no `findings.json`, and you touch no other pass's files.
4
4
 
5
5
  <!-- One prompt for every slot of pr-review's `site-review` fan-out
6
6
  (`review.analysis.reviewEngine: sites`) and for the evals `micro-site-review`
7
- replay: a fan-out branch has no per-branch variables, so the attached brief
8
- names the site id, the output file and the `none` bar
7
+ replay. The prompt stays slot-generic — it is shared with the replay, which has
8
+ no manifest — so the attached brief names the site id, the output file and the
9
+ `none` bar
9
10
  (docs/plans/pr-review-units-sites.md, "Act 6"). -->
10
11
 
11
12
  Reviewing **{{owner}}/{{repo}}#{{prNumber}}**, head `{{headSha}}` against `{{baseBranch}}`.
@@ -35,9 +36,6 @@ you write** (`.lastlight/pr-review/sites/<site id>.findings.jsonl`), your
35
36
  scratch directory, and how many probed suspicions a `none` needs. Wherever this
36
37
  prompt says `<site id>`, use the id the brief gives.
37
38
 
38
- If the brief says the slot has **no site**, write the single `empty` line it
39
- shows and stop — read no code.
40
-
41
39
  The brief may list **leads**: short subjects the survey's hypotheses named at
42
40
  this site. Treat them exactly as what they are:
43
41
 
@@ -230,7 +228,7 @@ brief names): one JSON object per line.
230
228
  For each finding (at most 3):
231
229
 
232
230
  ```
233
- {"site": "<site id>", "path": "src/file.ts", "line": 42,
231
+ {"site": "<site id>", "path": "src/file.ts", "line": 42, "startLine": 39,
234
232
  "title": "one line: what is wrong",
235
233
  "mechanism": "how the code produces the wrong behaviour, citing what you read or ran",
236
234
  "consequence": "what a user or caller sees when it happens",
@@ -243,6 +241,11 @@ For each finding (at most 3):
243
241
 
244
242
  - `path` is relative to the checkout and must be a real file; `line` must be a
245
243
  line of that file, the line where the defect is.
244
+ - `startLine` is optional: when the defect is a short stretch rather than one
245
+ line, give its first line (at most 12 lines, ending at `line`) and the comment
246
+ highlights that stretch. For a missing check or step, the stretch runs from
247
+ the code that goes unguarded to where the check belongs. Omit it for a
248
+ single line.
246
249
  - `leads` lists the brief's lead numbers the finding came from; `[]` if none.
247
250
  - `importance` is what the PR's author should do about it:
248
251
  - `must-fix`: merging as-is ships the bug to users or callers who will hit it