Skip to content

Commit e18936a

Browse files
docs(CLAUDE.md): three lessons — pygments fix landed, LLM hallucination shapes, stash pop silent-skip
- Updated the mkdocs/pygments lesson to note the fix landed in PR #346: pymdown-extensions>=10.21,<11.0 in the docs extra. 10.21.0 is the upstream fix; CI was never broken, only stale local venvs locked to 10.20.x via uv.lock hit the crash. - New lesson: attune-author polish-pass hallucinations have six distinct shapes (CLI flag with inverted semantics, private-module imports, See-also cross-refs, numeric counts, route paths, missing security callouts). Three of six actively break readers. Root cause: LLM filling in surrounding scaffolding from priors rather than being constrained to source. Four-intervention ladder lives in attune-author#27 umbrella spec. - New lesson: 'git stash pop' silently skips overwriting tracked files when the destination branch tracks files the stash treated as untracked. No conflict marker, no warning. Hit this session during ops-dashboard regen — 3 of 11 regenerated files silently dropped onto a fresh branch. Diagnostic: 'git diff stash@{0} -- <path>' after pop catches the silent skip. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 723a17e commit e18936a

1 file changed

Lines changed: 74 additions & 5 deletions

File tree

.claude/CLAUDE.md

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,11 +2870,17 @@ attune_redis/ # attune-redis plugin (pip install attune-redis)
28702870
fence). Before wasting time investigating local doc
28712871
changes, check with `git stash && mkdocs build` on
28722872
the pre-change tree — if it still crashes, you've
2873-
ruled out the current PR. Fix direction (not done
2874-
this session): pin compatible `pygments` /
2875-
`pymdown-extensions` versions in the docs extra, or
2876-
find the specific markdown file whose fence
2877-
triggers the None filename.
2873+
ruled out the current PR. **Fix landed in PR #346
2874+
(2026-05-14): bump `pymdown-extensions>=10.21,<11.0`
2875+
in the docs extra. 10.20.x passes `title=None`
2876+
through as `filename`; 10.21.0 is the upstream fix.**
2877+
Companion finding: CI was never broken — PyPI fresh
2878+
installs picked up 10.21.3 cleanly. Only stale local
2879+
venvs locked to 10.20.x via `uv.lock` hit the crash.
2880+
Diagnostic when troubleshooting: read the CI build's
2881+
install log for the pymdown-extensions version; if
2882+
it's ≥ 10.21 and the build succeeded, your local
2883+
venv is the problem, not the repo.
28782884

28792885
- **Orphan top-level `docs/` directories stay
28802886
invisible to readers until wired into `mkdocs.yml`
@@ -4124,3 +4130,66 @@ attune_redis/ # attune-redis plugin (pip install attune-redis)
41244130
worktree's slug. Works for any `python -m <pkg>`
41254131
invocation where you want sibling-venv deps +
41264132
non-installed source.
4133+
4134+
- **attune-author polish-pass hallucinations have six
4135+
distinct shapes — automated verification beats manual
4136+
editorial review at scale**: empirical regression
4137+
fixture from a single feature regen (ops-dashboard,
4138+
15 templates + 4 published docs, 2026-05-14 via
4139+
attune-ai PR #351). The polish pass invented (1) a
4140+
CLI flag with inverted semantics (`--allow-run` when
4141+
real is `--read-only`), (2) two private-module
4142+
imports (`from attune.ops._readers import …`,
4143+
`_models` — both `ModuleNotFoundError`), (3) four
4144+
"See also" cross-references to non-existent docs,
4145+
(4) a numeric count (`498 templates` vs real 259),
4146+
(5) two wrong route paths (`POST /run` vs real
4147+
`POST /workflows/{name}/run`), and (6) an insecure
4148+
example (`host="0.0.0.0"` without an auth callout).
4149+
Three of the six actively break readers who follow
4150+
the docs literally. **Root cause: the polish pass
4151+
has source as context but isn't *constrained* to
4152+
it — the LLM is free to invent surrounding
4153+
scaffolding from priors that "sounds right."** Four
4154+
interventions ranked by leverage (see
4155+
attune-author#27 umbrella spec for full design):
4156+
(a) AST-based post-generation fact-check
4157+
(Python-import resolution + CLI-flag-vs-`--help` +
4158+
Markdown-link-target + numeric-claim verification —
4159+
cheapest, no LLM cost, catches 5 of 6 fixture
4160+
errors); (b) inject ground-truth context (rendered
4161+
`--help`, `__all__`, dataclass fields) into the
4162+
polish prompt under sentinel tags; (c) reuse
4163+
`attune_rag.eval.faithfulness.FaithfulnessJudge` as
4164+
a post-step (catches missing-content errors like
4165+
the security callout that AST can't see); (d)
4166+
static-analysis (`mypy --strict`) of tutorial code
4167+
fences specifically — execution of LLM-generated
4168+
code is explicitly deferred for security reasons.
4169+
Pattern generalizes beyond attune-author: any
4170+
LLM-driven content-generation pipeline (doc gen,
4171+
README polish, blog draft) needs post-generation
4172+
verification proportional to how much surface
4173+
detail (names, flags, paths) the output references.
4174+
4175+
- **`git stash pop` silently skips overwriting tracked
4176+
files when the destination branch tracks files the
4177+
stash treated as untracked**: hit 2026-05-14 when
4178+
stashing untracked-on-branch-A files (because branch
4179+
A predated their addition to main), switching to a
4180+
new branch off origin/main (where they ARE tracked),
4181+
and popping. The stash entry was retained ("kept in
4182+
case you need it again") but 3 of 11 files in the
4183+
stash were silently dropped from the working tree —
4184+
the tracked versions from the new branch's HEAD
4185+
stayed in place, my stashed regenerated versions
4186+
vanished. No conflict marker, no warning. Diagnostic
4187+
to catch the silent skip: after `git stash pop`,
4188+
diff the affected files against the stash with
4189+
`git diff stash@{0} -- <path>` before dropping. If
4190+
there's a non-empty diff and `git status` shows the
4191+
file unchanged, the pop silently skipped it.
4192+
Mitigation when planning the stash: if you know the
4193+
destination branch tracks files your source branch
4194+
doesn't, pop with `git checkout stash@{0} -- <files>`
4195+
to force the overwrite, then drop manually.

0 commit comments

Comments
 (0)