lastlight-core 0.37.0 → 0.38.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.
@@ -37,6 +37,15 @@ phases:
37
37
  # matches the guard and the phase skips — leaving a full review. The
38
38
  # quoted-string form has the opposite behaviour and must not be used here.
39
39
  #
40
+ # NOT with the evidence pipeline on (issue #429): a light run is one
41
+ # agent pass over the diff with no ledger and no convergence gate — exactly
42
+ # the unbounded re-review that re-opens code the last review already had.
43
+ # The pipeline scopes a re-review in code instead (`units --prior`): a
44
+ # small push is a few changed units, so few sites, and a push that changed
45
+ # nothing the last review had plans no site at all. `analysisEnabled == true`
46
+ # is the bare-boolean form, so an absent key does NOT match and triage runs
47
+ # as before on a deployment without the pipeline.
48
+ #
40
49
  # The phase ends with one `REVIEW_DEPTH: full|light` line, which
41
50
  # `engine/review-triage.ts` harvests onto `scratch.reviewTriage` from the same
42
51
  # `onPhaseEnd` hook the fix markers ride. On `light`, the seven phases below
@@ -50,6 +59,7 @@ phases:
50
59
  skip_if:
51
60
  - "triageEnabled != true"
52
61
  - "reviewIsRereview != true"
62
+ - "analysisEnabled == true"
53
63
  timeout_seconds: { from: triageTimeoutSeconds }
54
64
  # NO `on_output.requires_marker`, deliberately — see AC2 in
55
65
  # `tests/workflows/pr-review-probes.test.ts`: nothing in this workflow may
@@ -244,11 +254,33 @@ phases:
244
254
  FACTS="${LASTLIGHT_FACTS_BIN:-$(command -v lastlight-facts || echo /opt/lastlight/bin/lastlight-facts)}"
245
255
  OUT=.lastlight/pr-review/units.json
246
256
  SPEC=.lastlight/pr-review/spec-obligations.json
257
+ PRIOR=.lastlight/pr-review/prior-review.json
258
+ RISK=.lastlight/pr-review/risk-rules.json
247
259
  mkdir -p .lastlight/pr-review
248
260
  # A reused per-PR workspace still holds the LAST head's document. Remove
249
261
  # it first, so a process that dies before writing leaves no stale units
250
- # for `survey-units` to spend money on.
251
- rm -f "$OUT" "$SPEC"
262
+ # for `survey-units` to spend money on — and no stale prior review or
263
+ # risk rules for this run to scope by.
264
+ rm -f "$OUT" "$SPEC" "$PRIOR" "$RISK"
265
+
266
+ # Issue #429 — the units the LAST review had (the PR's review ledger),
267
+ # so each unit gets a `delta` (new / changed / affected / unchanged) and
268
+ # the sites skip what is unchanged. Absent on a first review: nothing is
269
+ # scoped. Same QUOTED heredoc as the spec obligations below.
270
+ {{#if priorReviewJson}}
271
+ cat > "$PRIOR" <<'LASTLIGHT_PRIOR_EOF'
272
+ {{priorReviewJson}}
273
+ LASTLIGHT_PRIOR_EOF
274
+ {{/if}}
275
+ # …and the configured risk rules (the repo's, then the operator's).
276
+ {{#if riskRulesJson}}
277
+ cat > "$RISK" <<'LASTLIGHT_RISK_EOF'
278
+ {{riskRulesJson}}
279
+ LASTLIGHT_RISK_EOF
280
+ {{/if}}
281
+ set --
282
+ [ -s "$RISK" ] && set -- --risk-rules "$RISK"
283
+ if [ -s "$PRIOR" ]; then echo "units: re-review — scoping against the last review's units"; fi
252
284
 
253
285
  # The spec obligations are built HARNESS-side (the PR body and the issues
254
286
  # it closes; `review-spec.ts`), so they reach the sandbox only through
@@ -280,7 +312,7 @@ phases:
280
312
  # that DIES (OOM, a segfault in the native parser). The fallback is
281
313
  # written only when nothing was — a document the CLI wrote on its way to
282
314
  # a non-zero exit carries more than this one can.
283
- "$FACTS" units --dir .lastlight/pr-review --repo . --never-fail
315
+ "$FACTS" units --dir .lastlight/pr-review --repo . "$@" --never-fail
284
316
  CODE=$?
285
317
  if [ ! -s "$OUT" ]; then
286
318
  fallback "the units process exited $CODE without writing units.json (OOM, a segfault in the native parser, or a CLI that could not be executed) — NOTHING here may be read as 'no findings'"
@@ -44,6 +44,16 @@ you write an item:
44
44
  The discussion is context for deciding what is new. It is never a reason to
45
45
  drop or demote a finding the investigators grounded in code.
46
46
  {{/if}}
47
+ {{#if priorLedger}}
48
+ ## What our earlier reviews of this pull request found
49
+
50
+ {{priorLedger}}
51
+
52
+ The first list was **posted** and is still open: a finding that is the same
53
+ defect as one of those gets `"alreadyRaised"` (`"an earlier review, src/a.ts:42"`)
54
+ — the author already has it. The second list was found but **never posted**:
55
+ re-raising one of those is a choice, not a duplicate, so judge it on its merits.
56
+ {{/if}}
47
57
 
48
58
  ## What to do
49
59