Skip to content

Commit 3758d38

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 8e2e630 commit 3758d38

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`
@@ -4454,3 +4460,66 @@ attune_redis/ # attune-redis plugin (pip install attune-redis)
44544460
its exit-code semantics before downstream
44554461
consumers (dashboards, CI scripts, IDE
44564462
integrations) inherit the bug.
4463+
4464+
- **attune-author polish-pass hallucinations have six
4465+
distinct shapes — automated verification beats manual
4466+
editorial review at scale**: empirical regression
4467+
fixture from a single feature regen (ops-dashboard,
4468+
15 templates + 4 published docs, 2026-05-14 via
4469+
attune-ai PR #351). The polish pass invented (1) a
4470+
CLI flag with inverted semantics (`--allow-run` when
4471+
real is `--read-only`), (2) two private-module
4472+
imports (`from attune.ops._readers import …`,
4473+
`_models` — both `ModuleNotFoundError`), (3) four
4474+
"See also" cross-references to non-existent docs,
4475+
(4) a numeric count (`498 templates` vs real 259),
4476+
(5) two wrong route paths (`POST /run` vs real
4477+
`POST /workflows/{name}/run`), and (6) an insecure
4478+
example (`host="0.0.0.0"` without an auth callout).
4479+
Three of the six actively break readers who follow
4480+
the docs literally. **Root cause: the polish pass
4481+
has source as context but isn't *constrained* to
4482+
it — the LLM is free to invent surrounding
4483+
scaffolding from priors that "sounds right."** Four
4484+
interventions ranked by leverage (see
4485+
attune-author#27 umbrella spec for full design):
4486+
(a) AST-based post-generation fact-check
4487+
(Python-import resolution + CLI-flag-vs-`--help` +
4488+
Markdown-link-target + numeric-claim verification —
4489+
cheapest, no LLM cost, catches 5 of 6 fixture
4490+
errors); (b) inject ground-truth context (rendered
4491+
`--help`, `__all__`, dataclass fields) into the
4492+
polish prompt under sentinel tags; (c) reuse
4493+
`attune_rag.eval.faithfulness.FaithfulnessJudge` as
4494+
a post-step (catches missing-content errors like
4495+
the security callout that AST can't see); (d)
4496+
static-analysis (`mypy --strict`) of tutorial code
4497+
fences specifically — execution of LLM-generated
4498+
code is explicitly deferred for security reasons.
4499+
Pattern generalizes beyond attune-author: any
4500+
LLM-driven content-generation pipeline (doc gen,
4501+
README polish, blog draft) needs post-generation
4502+
verification proportional to how much surface
4503+
detail (names, flags, paths) the output references.
4504+
4505+
- **`git stash pop` silently skips overwriting tracked
4506+
files when the destination branch tracks files the
4507+
stash treated as untracked**: hit 2026-05-14 when
4508+
stashing untracked-on-branch-A files (because branch
4509+
A predated their addition to main), switching to a
4510+
new branch off origin/main (where they ARE tracked),
4511+
and popping. The stash entry was retained ("kept in
4512+
case you need it again") but 3 of 11 files in the
4513+
stash were silently dropped from the working tree —
4514+
the tracked versions from the new branch's HEAD
4515+
stayed in place, my stashed regenerated versions
4516+
vanished. No conflict marker, no warning. Diagnostic
4517+
to catch the silent skip: after `git stash pop`,
4518+
diff the affected files against the stash with
4519+
`git diff stash@{0} -- <path>` before dropping. If
4520+
there's a non-empty diff and `git status` shows the
4521+
file unchanged, the pop silently skipped it.
4522+
Mitigation when planning the stash: if you know the
4523+
destination branch tracks files your source branch
4524+
doesn't, pop with `git checkout stash@{0} -- <files>`
4525+
to force the overwrite, then drop manually.

0 commit comments

Comments
 (0)