Skip to content

Deliver: Premise-Freshness Lint - #83

Merged
seanrreid merged 8 commits into
mainfrom
rad/premise-freshness-lint
Jul 24, 2026
Merged

Deliver: Premise-Freshness Lint#83
seanrreid merged 8 commits into
mainfrom
rad/premise-freshness-lint

Conversation

@seanrreid

Copy link
Copy Markdown
Owner

Closes #74.

Summary

Adds a premise-freshness check so a plan anchored to deleted/renamed code is caught before deliver time (the "develop-drift" failure class, upstreamed from BEAKON green-lane criterion 10). Cited path:line anchors, per-task File: paths, and Files-in-Scope entries must exist on origin/<default_branch> — unless the plan itself creates them.

  • scripts/lib/plan-paths.sh — three new shared helpers (one source of truth for both consumers): plan_cited_anchors (inline anchor extractor, real-path-shape filtered), plan_created_paths (CREATE-exempt set from the Files-in-Scope table), path_exists_on_ref (existence-only, fail-closed return codes: 0 present / 1 absent / 2 unresolvable ref). — 68152af
  • scripts/lint-plan.sh — advisory freshness block (warns, never errors; exit 0 preserved). — b66675f
  • scripts/classify-low-risk.sh — Rule 0.5 stale-premise eligibility (any absent non-exempt path ⇒ not-low; a stale-premise plan is never auto-clearable). — 64ac5fa

Design decisions

  • No implicit git fetch — both checks query the locally-known origin/<default_branch> ref only, keeping lint-plan.sh offline-pure. An unresolvable ref fails closed (advisory in lint, not-low in classify).
  • Existence only — line numbers are never verified (they drift too easily to gate on); the :NNN suffix is stripped before the query.
  • CREATE-exemption reads the Files-in-Scope table (col-3 new file / col-4 ^New), since there is no per-task Creates: field.

Test coverage

New co-located tests, all green (216/216 harness + all script suites):

  • scripts/test-plan-paths.sh (new) — unit tests for all three helpers incl. suffix-strip, non-anchor rejection, present/absent/unresolvable-ref return codes, created-path detection.
  • scripts/test-lint-plan.sh — freshness advisory: existing path (no warn), absent path (warn + exit 0), created-file exempt, exit 0 throughout.
  • scripts/test-classify-low-risk.sh — stale premise: all-present stays low, absent ⇒ not-low, created file stays eligible.

Notes for review

🤖 Generated with Claude Code

Author: architect
Waves: 2
Tasks: 3
Out-of-scope deps: no
Plan:  .agents/plans/premise-freshness-lint.md
(Status + approved event written by: node harness/cli.js approve)
…lpers + unit tests

Wave 1, Tasks 1.1 + 1.2
Validated: AC#1, AC#4, AC#6 — bash scripts/test-plan-paths.sh (ALL PASS)
Wave 2, Task 2.1
Validated: AC#2, AC#4, AC#5, AC#6 — bash scripts/test-lint-plan.sh (ALL PASS)
…y-low-risk.sh

Wave 2, Task 2.2
Validated: AC#3, AC#4, AC#5 — bash scripts/test-classify-low-risk.sh (ALL PASS)
@seanrreid seanrreid added the rad:deliver RAD delivery PR label Jul 24, 2026
@seanrreid
seanrreid merged commit f1ac9a6 into main Jul 24, 2026
7 checks passed
@seanrreid
seanrreid deleted the rad/premise-freshness-lint branch July 24, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rad:deliver RAD delivery PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Premise-freshness lint: path anchors cited in a plan must exist on the base ref (kills the stale-plan drift class)

1 participant