From e0462e7e384745dd125d4dc2bc1de261a0978460 Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Thu, 24 Sep 2026 14:10:36 +1200 Subject: [PATCH] context: round-2 brief for spec-revocation-check --- context/briefs/spec-revocation-check-r2.md | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 context/briefs/spec-revocation-check-r2.md diff --git a/context/briefs/spec-revocation-check-r2.md b/context/briefs/spec-revocation-check-r2.md new file mode 100644 index 0000000..562e1af --- /dev/null +++ b/context/briefs/spec-revocation-check-r2.md @@ -0,0 +1,30 @@ +# Round 2: spec-revocation-check — `--tag` must scope the malformed-marker check + +## Rules +Same as round 1 (context/briefs/spec-revocation-check.md): stay in the worktree, don't push, don't work +around permission prompts, stdlib only, spec-first (update specs/spec-revocation-check.spec.md in the same +commit). Do not commit `scripts/__pycache__/*` changes (a tracked .pyc gets regenerated by run-all — +`git checkout -- scripts/__pycache__` before committing; the supervisor gate fails on a dirty tree). + +## Defect (found by running round 1 on a real repo) +Run against a real amended repo with `--tag M33`, the script reported 57 "malformed markers" — every one a +valid revocation of a DIFFERENT tag or the untagged form, e.g. +`*(Amended M23: … — Revokes prior text: "the values.yaml `accelerator:` key is informational only …".)*` +or `> **Revokes prior text:** the pre-2026-09-23 wording named the keys` (an older free-prose style). +With `--tag X`, the user is asking to check tag X's amendment only. + +## Required behaviour +1. With `--tag X`: only lines containing the literal `Revokes prior text (X)` are parsed; such a line that + does not parse is malformed. Lines with other tags, untagged markers or free-prose styles are ignored + entirely (not counted, not reported), and their quotes are NOT used to cover deletions either. +2. Without `--tag`: current behaviour (any tag + untagged form), but free-prose markers with no quote + (e.g. `**Revokes prior text:** the pre-… wording`) are reported as malformed only with `--strict`; + default is to count them in the summary as `ignored (unquoted-style)` without failing. +3. Summary line gains the ignored count. +4. Tests: add a fixture reproducing the real case (an older untagged mid-line marker, an M23-tagged marker + and a free-prose `**Revokes prior text:**` line alongside a valid `(M33)` amendment) → `--tag M33` + exits 0; a malformed `(M33)` line → exits 1; no `--tag` → the free-prose line is ignored by default and + malformed with `--strict`. Prove the new negatives fail with the check disabled, as in round 1. + +## Done when +`./tests/test-spec-revocation-check.sh` passes on a CLEAN tree; report files, tests, open questions.