feat: workaround decision logs — detection, template, @WA tags, lifecycle (closes #22) - #50
Merged
Merged
Conversation
- new evidence type marker:"<added line>" — the mirror of removed: over a commit's + lines; pins a workaround's own HACK/pin comment to the commit that introduced it - ADRs declare a record type in frontmatter (type: workaround); the verifier selects the section to check per type: Considered Options for MADRs, Evidence for workaround logs. Unknown/absent -> madr. - verify_adr/verify_options results carry record_type; empty workaround Evidence collapses to "No verifiable evidence recorded." Part 1/4 of #22 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- scan_workarounds: deterministic per-candidate scan — marker patterns (HACK/WORKAROUND/KLUDGE/XXX, monkeypatch, polyfill, shim, FIXME/TODO + until/upstream/temporary) over ADDED diff lines, workaround-shaped file additions (shim/adapter/polyfill/patches/*.patch), and message wording (supporting signal only — never flips alone) - candidates carry record_type (decision | workaround) + workaround_signals; an architectural candidate with markers stays a decision with an also-workaround note - bounded scan (20 commits / 4000 added lines per candidate); config knobs detect_workarounds + extra_workaround_markers - repo_workaround fixture with planted marker / structural / dual cases Part 2/4 of #22 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- references/workaround-log-template.md: template (Trigger / Workaround / Evidence / Scope / Removal Condition), worked example, status lifecycle, tagging guidance - SKILL.MD: record_type routing in the core loop and quick mode; new Workaround Logs section — single docs/decisions/ pool, single numbering, NNNN-wa-<slug>.md filenames, type/status frontmatter, @Wa tag prefix, marker:-cited Evidence verified by the same verify-adr call - README: workaround logs section Part 3/4 of #22 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- find_workaround_records: NNNN-*.md under any docs/decisions dir with
type: workaround frontmatter (deny-list-bounded walk)
- check_workarounds: for active records, grep each Evidence marker:
citation in the working tree (markdown excluded so a record's own
citation never satisfies its check) — vanished line => "possibly
removed; update status"; no marker citations => untrackable flag;
--check-upstream queries linked GitHub issues via gh and flags CLOSED
ones ("removal condition may be met")
- report-only by design: status transitions stay a human call
- CLI: check-workarounds <repo> [--check-upstream] [--strict] [--json];
--strict exits 1 when flagged, for CI
Part 4/4 of #22
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full implementation of #22 in four commits matching the agreed plan. Design as confirmed: single
docs/decisions/pool, single numbering sequence,type: workaroundfrontmatter as the contract,NNNN-wa-<slug>.mdfilename convention, distinct@WAtag prefix (no separate docs directory).1. judge.py —
marker:citations + type-aware sectionsmarker:"<added line>"— the mirror ofremoved:over a commit's+lines; pins a workaround's own HACK/pin comment to the commit that introduced it.type:in frontmatter; the verifier selects the verifiable section per type (Considered Options for MADRs, Evidence for workaround logs). Absent/unknown →madr, fully backward compatible.2. analyze.py — detection + record_type routing
scan_workarounds: deterministic, bounded (20 commits / 4000 added lines per candidate). Strong signals — marker patterns (HACK|WORKAROUND|KLUDGE|XXX,monkey.?patch, polyfill, shim,FIXME/TODO …until/upstream/temporary) in added diff lines, or workaround-shaped file additions (shim/adapter/polyfill,patches/,*.patch) — fliprecord_typetoworkaround. Message wording alone is recorded but never flips (prose is too weak).WORKAROUND: markers presentnote — the ADR mentions it; no double records.detect_workarounds(default on),extra_workaround_markers(project regexes). CLI shows[WA]per candidate.repo_workaroundfixture with planted marker / structural / dual / clean cases.3. Template + docs
references/workaround-log-template.md: Trigger / Workaround / Evidence / Scope / Removal Condition + worked example + status lifecycle. The Removal Condition is the point — a decision records why, a workaround records until when.4. judge.py —
check-workaroundslifecycle commandstatus: activerecord: greps itsmarker:citations in the working tree (markdown excluded so the record's own citation can't satisfy the check) → flags "possibly removed — update status"; flags records with no trackable citations;--check-upstream(opt-in, needsgh) flags linked GitHub issues that have CLOSED → "removal condition may be met".--strictexits 1 for CI.Test plan
madr), detection routing on all four planted fixture cases, detection disable + extra-markers config, check-workarounds present/removed/non-active/untrackable/madr-exclusion, end-to-end verify of a record citing the fixture's real HACK line.analyze.pyshows[WA]on exactly the two planted workarounds;check-workaroundsgoes ok → FLAG when the marker is deleted from the tree;--strictexit codes verified.Closes #22
🤖 Generated with Claude Code