Skip to content

Add deprecate action and staleness check to BitLesson workflow#188

Open
LukeLIN-web wants to merge 2 commits into
PolyArch:devfrom
LukeLIN-web:bitlesson-deprecate-staleness
Open

Add deprecate action and staleness check to BitLesson workflow#188
LukeLIN-web wants to merge 2 commits into
PolyArch:devfrom
LukeLIN-web:bitlesson-deprecate-staleness

Conversation

@LukeLIN-web
Copy link
Copy Markdown

BitLesson's knowledge base was effectively append-only: the round stop gate validates only the Delta format, with no way to retire a superseded lesson and no check that an existing lesson's cited paths still resolve. After a refactor, entries silently rot, and a stale lesson handed to an implementer is worse than none.

deprecate:

  • bitlesson-validate-delta.sh accepts Action: deprecate, routed through the existing concrete-ID + Notes checks so it references a real entry.
  • Deprecation is a tombstone, not a delete: mark the entry Status: deprecated and keep it for history; bitlesson-select.sh never selects a deprecated entry.
  • Contract text updated across docs/bitlesson.md, commands/start-rlcr-loop.md, templates/bitlesson.md, setup-rlcr-loop.sh, loop-codex-stop-hook.sh, and the bitlesson-delta-{invalid,missing} block templates.

staleness:

  • New scripts/bitlesson-staleness.sh reports entries whose cited file references no longer resolve under the project root. Advisory by default, --strict exits non-zero, deprecated entries skipped.
  • Detection is extension-anchored for precision: it ignores prose slashes and ratios (GO/NO-GO, 248/275), fenced template blocks, and ellipses.

tests:

  • +4 validator cases (deprecate) and a new staleness suite (8 cases), both registered in run-all-tests.sh. Full suite: 2265 pass, 0 fail.

BitLesson's knowledge base was effectively append-only: the round stop
gate validates only the Delta format, with no way to retire a superseded
lesson and no check that an existing lesson's cited paths still resolve.
After a refactor, entries silently rot, and a stale lesson handed to an
implementer is worse than none.

deprecate:
- bitlesson-validate-delta.sh accepts `Action: deprecate`, routed through
  the existing concrete-ID + Notes checks so it references a real entry.
- Deprecation is a tombstone, not a delete: mark the entry
  `Status: deprecated` and keep it for history; bitlesson-select.sh never
  selects a deprecated entry.
- Contract text updated across docs/bitlesson.md, commands/start-rlcr-loop.md,
  templates/bitlesson.md, setup-rlcr-loop.sh, loop-codex-stop-hook.sh, and
  the bitlesson-delta-{invalid,missing} block templates.

staleness:
- New scripts/bitlesson-staleness.sh reports entries whose cited file
  references no longer resolve under the project root. Advisory by default,
  --strict exits non-zero, deprecated entries skipped.
- Detection is extension-anchored for precision: it ignores prose slashes
  and ratios (GO/NO-GO, 248/275), fenced template blocks, and ellipses.

tests:
- +4 validator cases (deprecate) and a new staleness suite (8 cases), both
  registered in run-all-tests.sh. Full suite: 2265 pass, 0 fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Behavior unchanged (same flags on the real KB, all 8 tests green); ~254 -> 132 lines.

- Drop guards now subsumed by extension-anchoring + the path charset
  (glob/special-char chain, URL `//`, ratio, leading-dash checks).
- Replace the per-token `find` + cache with a single repo scan: collect file
  basenames once, resolve bare filenames via membership test.
- Replace the report state machine with an ordered map printed at the end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant