Repository navigation
Date an Anchored intentRef by Its Section and Let a driftNote Acknowledge a Verified Intent Advisory - #3811
Conversation
…edge a Verified Intent Advisory An anchored intentRef now dates by the section its anchor names, falling back to the whole file when the anchor resolves to no heading (#1819). The intent staleness advisory moves to its own check, files.intent, which a driftNote naming `<path>@<sha>` clears until the canonical changes again (#727). section_key's docstring says ASCII folding is intended (#3710), validate.py says why its section-name match is exact (#3706), and PlexCleaner's driftNote drops its stale RegressionTests clause (#3623). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode-Span Reader Answers the local review pass: hub_last_change takes the anchor itself, intent_ref parses an intent unit's canonical and anchor in one place, spanned_notes serves both the file-naming exemption and the intent acknowledgement, found is required where it is always known, and the section_key, sections, and fidelity-model wording now say what the code does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…spanned_notes Answers the second local review pass: check_files_intent no longer re-derives the canonical intent_trail already resolved, spanned_notes returns only the matches its callers read, and fidelity-model.md says a unit naming a reference is dated by that file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Anchored canonical-date resolution spec/fidelity_text.py, spec/audit.py, spec/fidelity-model.md, spec/validate.py, tests/test_fidelity_text.py, tests/test_audit_helpers.py |
Heading regions determine scoped change dates for anchored intent references. Unresolved anchors use whole-file history. Tests cover heading extraction, section dates, and reference resolution. |
Intent trail detection and check wiring spec/audit.py, spec/checks.json, tests/test_audit_helpers.py |
Baseline reads record the path used. The files.intent check compares intent-copy commit dates with canonical changes and validates acknowledgements. Tests cover alternatives, stale acknowledgements, and check registration. |
Drift-note validation and guidance spec/audit.py, AUDIT.md, registry/repos.json |
Drift-note spans are parsed for check-specific acknowledgements and file-naming exemptions. Audit guidance and the PlexCleaner registry note are updated. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Possibly related issues
- ptr727/ProjectTemplate#727: Adds per-file
files.intentacknowledgements using path-and-SHA spans. - ptr727/ProjectTemplate#1819: Dates anchored
intentRefvalues from the named section, with whole-file fallback. - ptr727/ProjectTemplate#3706: Documents exact heading-name matching in the validator.
- ptr727/ProjectTemplate#3710: Documents the existing strip-and-lowercase
section_keybehavior. - ptr727/ProjectTemplate#3813: Updates the PlexCleaner registry drift note’s test-related claim.
Possibly related PRs
- ptr727/ProjectTemplate#3417: Introduced the audit and registry contracts that this change extends with
files.intentand its acknowledgements.
Merge Risk: 
Minimal · up to 7bff4
-
No specific issue remains that calls for a change before merging; proceed with normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 41.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 24 functions across 5 files. (4 skipped: 4 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
|
A recorded local strict-review pass covers head |
Answers the open local findings listed on the pull request: a test pins that intent_trail dates by its intentRef's anchor, another that files.intent runs after the files.presence read it depends on, and the heading_slug docstring says `_` survives too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by an unresolved moderate issue in required file-check stage ordering, with additional documentation and regression-test gaps still active.
3 open issues
What changed in this PR
This pull request updates intent-fidelity auditing to date anchored references by their Markdown sections and allow verified intent advisories to be acknowledged through registry driftNote entries.
Changes:
- Adds heading slugging and anchored region extraction for section-scoped history comparisons.
- Introduces the repository-level
files.intentcheck with SHA-based acknowledgement and stale-note handling. - Updates validation comments, documentation, tests, and audit guidance.
- Removes PlexCleaner's obsolete
RegressionTestsdrift-note clause.
| File | Description |
|---|---|
tests/test_fidelity_text.py |
Tests heading slugs, anchored extraction, and lowercased section keys. |
tests/test_audit_helpers.py |
Tests intent advisories, acknowledgements, alternatives, and anchored history dating. |
spec/validate.py |
Documents exact section-name validation and updates intent helper terminology. |
spec/fidelity-model.md |
Documents anchored intent dating and acknowledgement behavior. |
spec/fidelity_text.py |
Adds heading slugging and any-level anchored region extraction. |
spec/checks.json |
Registers the repository-scoped files.intent check. |
spec/audit.py |
Implements anchored history dating, intent trails, acknowledgements, and shared note parsing. |
registry/repos.json |
Removes PlexCleaner's resolved regression-test drift-note clause. |
AUDIT.md |
Documents recording and reconciling verified intent advisories. |
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3811 +/- ##
===========================================
+ Coverage 82.72% 82.90% +0.17%
===========================================
Files 29 29
Lines 9629 9700 +71
===========================================
+ Hits 7966 8042 +76
+ Misses 1663 1658 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…d At A test now drives check_files_intent with a copy read at a declared alternative, so passing the baseline path instead of the found one, in the commit query or the acknowledgement key, fails a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
The order test now covers the class rather than files.intent alone: each repo-scope check whose function reads run.content, run.found, run.docs, or the README through _readme must sit after the first baseline check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
@coderabbitai review |
Action performed
|
|
CodeRabbit pre-merge warning on head 7bff4e5, "Docstring coverage is 41.67% which is insufficient. The required threshold is 80.00%": No change needed. Every helper this change adds with any logic carries a docstring: |
…rge on a Running Hosted Review, and Gate Skill Description Length (#3843) Promotes the changes merged into `develop` since promotion #3797 to `main`, the end of an away-mode backlog burndown. - [#3803](#3803) exempts the Roslyn embedded-language marker (`// lang=json`, `language=`) from the prose gate's comment rules as a tool directive. - [#3807](#3807) has `local_review.py record` take `--report`, the file the reviewer wrote, bind the pass to its sha256, and derive the finding count from it. `status` gains `reportPath`. - [#3809](#3809) holds `pr_review.py merge` while a hosted review is still running on the head, and routes a declined Qodo finding to a dismiss request. - [#3811](#3811) dates an anchored `intentRef` by the section its anchor names, and lets a `driftNote` acknowledge a verified intent advisory. - [#3816](#3816) moves the null GraphQL node check into the shared `gh_graphql` transport as `NullNodeError`. - [#3818](#3818) explains the workspace-edit default in `GOVERNANCE.md` and names the aggregator's expression form. - [#3822](#3822) moves the abandon discard to the `backlog-burndown` orchestrator, aligns the abandoned-branch delete, and holds a grown agent-safety set. - [#3823](#3823) scopes the Husky prose gate to staged paths and adds `--skip-generated` so a named file inside a generated tree is skipped. - [#3828](#3828) reads Copilot's `Open findings:` label, drops the duplicate `null_node`, and matches `scripts/README.md` to the Merge Gate. - [#3829](#3829) bumps the two stale hub caller snippet pins and documents the fallback's mixed-pair refusal. - [#3831](#3831) keeps an inherited `GIT_DIR` from rerooting the prose gate's subdirectory git reads. - [#3832](#3832) gives `backlog-burndown` a disposition for a worker's standalone clone and keeps the agent-safety hold past a park. - [#3835](#3835) makes `carry.py check-sections` refuse what `apply-sections` would, and name an open fence. - [#3836](#3836) pins the reusable-workflow stubs by placeholder and ticks the PlexCleaner gates item. - [#3838](#3838) has the `runtime-secrets` audit dimension detect a bare `secrets/` directory from the tracked files that name it. - [#3839](#3839) gates skill descriptions at the 1024-character limit and trims every one over it. - [#3846](#3846) fixes an adjacent doc, an in-file pre-existing defect, and an edge case on new code in the open pull request instead of filing an issue for each, and keeps filing for code that runs elsewhere. - [#3847](#3847) refuses skill frontmatter that parses to a list or a scalar, so the description length gate cannot be bypassed. Fixes #3770 Fixes #3699 Fixes #3705 Fixes #3789 Fixes #1819 Fixes #727 Fixes #3710 Fixes #3706 Fixes #3623 Fixes #3687 Fixes #3617 Fixes #3757 Fixes #3790 Fixes #3786 Fixes #3785 Fixes #3772 Fixes #1657 Fixes #3443 Fixes #3824 Fixes #3817 Fixes #3805 Fixes #1666 Fixes #3700 Fixes #3821 Fixes #3771 Fixes #3794 Fixes #3825 Fixes #3690 Fixes #1472 Fixes #3813 Fixes #3719 Fixes #1592 Fixes #3845 🤖 Generated with [Claude Code](https://claude.com/claude-code)


Summary
Each of the five issues is implemented the way the maintainer answered it on 2026-11-01.
spec/audit.pyhub_last_changenow takes the anchor and dates an anchoredintentRefby the section its anchor names. It narrows each revision to that region and then runs_last_effective_change, the waycheck_verbatimnarrows a section's history. When the anchor names no heading in the current canonical, it dates the whole file.spec/fidelity_text.pygainsheading_slugandextract_anchored, a slug-keyed region extract that works at any heading level (both live anchors are H3). A new test checks that every anchoredintentRefinspec/files.jsonresolves in the hub. That way a typo cannot fall back to whole-file dating without anyone noticing.files.intent.intent_refparses an intent unit's canonical and anchor in one place. It is a repo-scope check that runs after the file stage, withhub: falseandsuppression: { endsWithType: null }inspec/checks.json. Before this, the advisory sat insidefiles.presence. A registrydriftNotenaming(files.intent)acknowledges a copy with a`<path>@<sha>`code span. That clears the copy until its intent canonical changes again. The note reader,spanned_notes, is shared with thefilenaming.scriptsexemption, so the file-naming check now goes through it too. The check reports a stale acknowledgement, meaning one the advisory no longer raises at that sha, and it also reports a note that names no such span.AUDIT.mdsection 7 describes the acknowledgement, and section 8's list of suppression notes now names it.section_keykeepsstrip().lower(). Its docstring now sayslower()rather thancasefold()is intended, since fleet headings are ASCII and the two agree there.spec/validate.pykeeps the exact section-name match. A comment at the comparison says why: the declared name is the verbatim disposition label.RegressionTestsclause is dropped from PlexCleaner's driftNote. PlexCleaner#1064's merge commit is on PlexCleanermain, which carriesRegressionTests/tests/and passespython-directories: RegressionTestsfrom both validator callers.Verification
tests/suite passed on the first commit.spec/validate.pypasses.commentslabel for two comment lines inspec/validate.py: the one Make validate.py's files.json Section-Name Match Agree With section_key #3706 asks for, and the existing comment that now namesintent_ref().23c7d784no longer flags.editorconfig,.editorconfig-checker.json, or.gitattributesagainst the latest whole-fileGOVERNANCE.mdchange.version.jsonis still flagged, but against the change that actually editedWORKFLOW.md"D3 - Versioning and Classification", not the whole file's latest edit.Local findings fixed after opening
The third local pass raised three
introducedfindings once the first push's edit budget was spent. Commit 0ac4676 fixes all three under a fresh pass:tests/test_audit_helpers.pynow pins thatfiles.intentruns afterfiles.presence, the read it depends on, sincespec/validate.py's ordering guard covers only file checks. Commit 7bff4e5 widens that test to the whole class. Every repo check whose function readsrun.content,run.found,run.docs, or the README through_readmemust sit after the first baseline check.intent_trailpasses the intentRef's anchor tohub_last_change.heading_slugdocstring now says_is kept as well as-.The fourth local pass found one more
introducedgap: no test drovecheck_files_intentwith a copy read at a declared alternative. Commit d014dcd adds that test. The fifth pass found that no test pinnedfiles.intent's suppression role, and commit b3a8d04 adds one.Declined local findings
spec/audit.pyhub_last_changeanchored narrowing no longer catches an edit to the hub's own.gitattributes,.editorconfig,.editorconfig-checker.jsonorversion.jsonunless the anchored section also moves (local pass,introduced): declined. The maintainer's 2026-11-01 answer on An Anchored intentRef Is Dated by Its Whole File, So Unrelated Doc Edits Flag Line-Ending and Versioning Copies #1819 chose option 1, dating the anchored section only. The decision record says option 2, adding the file's own hub canonical, "still takes the noisy doc date unless combined with option 1", and option 2 was not chosen. An intent finding verified satisfied cannot be cleared, so a correct resync can never produce a clean run #727's 2026-08-15 comment shows hub-only edits to those files, such as a CRLF default or a hub-tree pin, are exactly the noise a downstream copy must not be dated by. The content-identical shortcut against the hub file atpathstays, and it only ever clears.spec/fidelity_text.pyextract_anchored's extent againstsections()(local pass,introduced, design): declined.sections()is the manifest's level-two unit, which ends only at the next H2, and every verbatim section and the carry depend on that extent. An anchor names a GitHub section, which ends at the next heading of its own level or above, and that is what bounds an H3 such as "Line Endings" at all. If one primitive served both, it would either move the H2 unit's extent or lose the H3 case. So thesections()docstring now claims only the level-two extent. The any-level duplicate insidescripts/build_dist.pyis Share One Any-Level Heading Region Primitive Between build_dist heading_body and fidelity_text extract_anchored #3810.spec/audit.pyspanned_notesshares only the no-span half of a code-span driftNote (local pass,introduced, consolidation): declined. The stale half matches differently at each site. A file-naming path is checked against what the check reports. An intentpath@shais checked by sha prefix against the change the advisory cites. Folding the two would mean passing the matcher in, which costs more than the few lines it saves.spec/validate.pyMake validate.py's files.json Section-Name Match Agree With section_key #3706 comment gives the verbatim disposition label as the reason for the exact match, but the match also covers intent-fidelity and string-form sections (local pass,introduced): declined. The comment states the reason the maintainer's 2026-11-01 answer on Make validate.py's files.json Section-Name Match Agree With section_key #3706 recorded, "the files.json name is the verbatim disposition label". A section's fidelity is a one-field manifest edit, and an exact rule that holds for every declared section means flipping one to verbatim never needs a spelling fix first.Pre-existing findings, filed
docs/reusable-workflows.mdtracker: the PlexCleaner item is a sibling of Drop the Stale RegressionTests Clause From PlexCleaner's driftNote Once PlexCleaner #1064 Reaches main #3623's stale claim (local pass,pre-existing), filed as Re-Check the PlexCleaner Item in the Reusable-Workflows Tracker Against Its main #3813.Pre-existing findings, not filed
registry/repos.jsonPlexCleaner driftNote: the clause this change keeps still says "uvx scripts profile", a term the python-codestyle build-versus-lint-only split no longer uses (local pass,pre-existing).Dropped findings
spec/fidelity_text.pysection_spanandextract_sectiondocstrings, andscripts/build_dist.pyheading_body, say "case-folded" or "folded" (local pass,pre-existing, wording on text this change did not touch).Deferred
RESYNC.mdsection 5, "What a Resync Cannot Detect", still summarizes the advisory without the anchor and acknowledgement cases.RESYNC.mdis outside this change's file claim, so it is filed as Bring RESYNC.md's Intent Advisory Summary in Line With Anchored Dating and driftNote Acknowledgements #3808 (local pass,introduced, deferred).GOVERNANCE.md#line-endings, which is a one-paragraph pointer to thecomment-and-doc-styleSkill. Dated by that section alone, their advisory fires only when the pointer itself is reworded. Re-pointing them is aspec/files.jsondecision outside this change's claim, filed as Decide Whether the Line-Ending intentRefs Should Name the Section Holding the Policy #3812 (local pass,introduced, deferred).spec/fidelity_text.pyextract_anchoredandscripts/build_dist.pyheading_bodycompute the same any-level region.scripts/build_dist.pyis outside this change's file claim, so it is filed as Share One Any-Level Heading Region Primitive Between build_dist heading_body and fidelity_text extract_anchored #3810 (local pass,introduced, consolidation, deferred).Closes on promotion: #1819, #727, #3710, #3706, #3623
🤖 Generated with Claude Code
Summary by CodeRabbit