Skip to content

feat: workaround decision logs — detection, template, @WA tags, lifecycle (closes #22) - #50

Merged
hailcpy merged 4 commits into
mainfrom
feat/issue-22-workaround-logs
Jun 10, 2026
Merged

hailcpy merged 4 commits into
mainfrom
feat/issue-22-workaround-logs

Conversation

@hailcpy

@hailcpy hailcpy commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Full implementation of #22 in four commits matching the agreed plan. Design as confirmed: single docs/decisions/ pool, single numbering sequence, type: workaround frontmatter as the contract, NNNN-wa-<slug>.md filename convention, distinct @WA tag prefix (no separate docs directory).

1. judge.py — marker: citations + type-aware sections

  • 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 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) — flip record_type to workaround. Message wording alone is recorded but never flips (prose is too weak).
  • An architectural candidate with markers stays a decision with a WORKAROUND: markers present note — the ADR mentions it; no double records.
  • Config: detect_workarounds (default on), extra_workaround_markers (project regexes). CLI shows [WA] per candidate.
  • New repo_workaround fixture 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.
  • SKILL.MD routing table + lifecycle section; README section.

4. judge.py — check-workarounds lifecycle command

  • For each status: active record: greps its marker: 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, needs gh) flags linked GitHub issues that have CLOSED → "removal condition may be met".
  • Report-only by design; --strict exits 1 for CI.

Test plan

  • 174 passed, 1 xfailed (was 156 on main — 18 new tests).
  • New coverage: marker verify pass/fail, record-type frontmatter parsing, workaround Evidence kept/dropped/collapse, MADR regression (Evidence section ignored for 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.
  • CLI smoke-tested: analyze.py shows [WA] on exactly the two planted workarounds; check-workarounds goes ok → FLAG when the marker is deleted from the tree; --strict exit codes verified.

Closes #22

🤖 Generated with Claude Code

jaditya8889 and others added 4 commits June 10, 2026 01:26
- 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>
@hailcpy
hailcpy merged commit 04ab4dc into main Jun 10, 2026
3 checks passed
@hailcpy
hailcpy deleted the feat/issue-22-workaround-logs branch June 10, 2026 06:11
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.

Feature: generate decision logs for significant workarounds, adapters, proxies, and monkey patches

2 participants