Skip to content

Date an Anchored intentRef by Its Section and Let a driftNote Acknowledge a Verified Intent Advisory - #3811

Merged
ptr727 merged 7 commits into
developfrom
burndown/1819-audit-intent
Nov 2, 2026
Merged

ptr727 merged 7 commits into
developfrom
burndown/1819-audit-intent

Conversation

@ptr727

@ptr727 ptr727 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Each of the five issues is implemented the way the maintainer answered it on 2026-11-01.

  • An Anchored intentRef Is Dated by Its Whole File, So Unrelated Doc Edits Flag Line-Ending and Versioning Copies #1819, anchored intentRef dating. spec/audit.py hub_last_change now takes the anchor and dates an anchored intentRef by the section its anchor names. It narrows each revision to that region and then runs _last_effective_change, the way check_verbatim narrows a section's history. When the anchor names no heading in the current canonical, it dates the whole file. spec/fidelity_text.py gains heading_slug and extract_anchored, a slug-keyed region extract that works at any heading level (both live anchors are H3). A new test checks that every anchored intentRef in spec/files.json resolves in the hub. That way a typo cannot fall back to whole-file dating without anyone noticing.
  • An intent finding verified satisfied cannot be cleared, so a correct resync can never produce a clean run #727, clearing a verified intent finding. The advisory now has its own check id, files.intent. intent_ref parses an intent unit's canonical and anchor in one place. It is a repo-scope check that runs after the file stage, with hub: false and suppression: { endsWithType: null } in spec/checks.json. Before this, the advisory sat inside files.presence. A registry driftNote naming (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 the filenaming.scripts exemption, 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.md section 7 describes the acknowledgement, and section 8's list of suppression notes now names it.
  • Decide Whether section_key Should Casefold Rather Than Lowercase #3710. section_key keeps strip().lower(). Its docstring now says lower() rather than casefold() is intended, since fleet headings are ASCII and the two agree there.
  • Make validate.py's files.json Section-Name Match Agree With section_key #3706. spec/validate.py keeps the exact section-name match. A comment at the comparison says why: the declared name is the verbatim disposition label.
  • Drop the Stale RegressionTests Clause From PlexCleaner's driftNote Once PlexCleaner #1064 Reaches main #3623. The stale RegressionTests clause is dropped from PlexCleaner's driftNote. PlexCleaner#1064's merge commit is on PlexCleaner main, which carries RegressionTests/tests/ and passes python-directories: RegressionTests from both validator callers.

Verification

  • The owned test files pass on the head. The full tests/ suite passed on the first commit.
  • spec/validate.py passes.
  • The pre-commit gate passes: ruff format, ruff check, mypy, and the prose gate. The prose gate needs the comments label for two comment lines in spec/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 names intent_ref().
  • A live audit of one fleet repo on hub 23c7d784 no longer flags .editorconfig, .editorconfig-checker.json, or .gitattributes against the latest whole-file GOVERNANCE.md change. version.json is still flagged, but against the change that actually edited WORKFLOW.md "D3 - Versioning and Classification", not the whole file's latest edit.

Local findings fixed after opening

The third local pass raised three introduced findings once the first push's edit budget was spent. Commit 0ac4676 fixes all three under a fresh pass:

  • tests/test_audit_helpers.py now pins that files.intent runs after files.presence, the read it depends on, since spec/validate.py's ordering guard covers only file checks. Commit 7bff4e5 widens that test to the whole class. Every repo check whose function reads run.content, run.found, run.docs, or the README through _readme must sit after the first baseline check.
  • A test now pins that intent_trail passes the intentRef's anchor to hub_last_change.
  • The heading_slug docstring now says _ is kept as well as -.

The fourth local pass found one more introduced gap: no test drove check_files_intent with a copy read at a declared alternative. Commit d014dcd adds that test. The fifth pass found that no test pinned files.intent's suppression role, and commit b3a8d04 adds one.

Declined local findings

  • spec/audit.py hub_last_change anchored narrowing no longer catches an edit to the hub's own .gitattributes, .editorconfig, .editorconfig-checker.json or version.json unless 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 at path stays, and it only ever clears.

  • spec/fidelity_text.py extract_anchored's extent against sections() (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 the sections() docstring now claims only the level-two extent. The any-level duplicate inside scripts/build_dist.py is Share One Any-Level Heading Region Primitive Between build_dist heading_body and fidelity_text extract_anchored #3810.

  • spec/audit.py spanned_notes shares 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 intent path@sha is 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.py Make 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

Pre-existing findings, not filed

  • registry/repos.json PlexCleaner 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.py section_span and extract_section docstrings, and scripts/build_dist.py heading_body, say "case-folded" or "folded" (local pass, pre-existing, wording on text this change did not touch).

Deferred

Closes on promotion: #1819, #727, #3710, #3706, #3623

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a repository check that flags outdated intent copies and supports acknowledgements tied to a cited change.
    • Intent checks can now focus on a named section and ignore changes limited to formatting or workflow normalization.
  • Documentation
    • Clarified how to record verified intent advisories and how acknowledged copies are checked.
    • Updated the PlexCleaner advisory to reflect that Python lockfile pinning does not apply.

ptr727 and others added 3 commits November 2, 2026 08:35
…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>
Copilot AI lite review requested due to automatic review settings November 2, 2026 16:55
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 2, 2026
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6dfcc04 and 7bff4e5.

Files selected for processing: 9
  • AUDIT.md
  • registry/repos.json
  • spec/audit.py
  • spec/checks.json
  • spec/fidelity-model.md
  • spec/fidelity_text.py
  • spec/validate.py
  • tests/test_audit_helpers.py
  • tests/test_fidelity_text.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Adds anchored intentRef dating and a repository-scoped files.intent check. The check compares intent copies with canonical changes and accepts path-and-SHA drift-note acknowledgements. Baseline reads record the path used, and drift-note span parsing is shared with file-naming exemptions.

Changes: Intent freshness audit

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

Possibly related PRs

  • ptr727/ProjectTemplate#3417: Introduced the audit and registry contracts that this change extends with files.intent and 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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and specifically describes the main changes: section-based dating for anchored intentRef values and driftNote acknowledgement of verified intent advisories.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full 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.

Share

@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 591ffffbbc20d951e860233546c448d750709350, the content this pull request carries at that commit against develop, and it recorded 6 findings.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.intent check with SHA-based acknowledgement and stale-note handling.
  • Updates validation comments, documentation, tests, and audit guidance.
  • Removes PlexCleaner's obsolete RegressionTests drift-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

Comment thread spec/checks.json Resolved
Comment thread spec/fidelity_text.py Resolved
Comment thread tests/test_audit_helpers.py Resolved
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.36842% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.90%. Comparing base (23c7d78) to head (7bff4e5).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
spec/audit.py 96.96% 2 Missing ⚠️
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     
Flag Coverage Δ
python-3.13 82.90% <97.36%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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>
@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head b3a8d042769fd800026a1455780a5a860c2e0c96, the content this pull request carries at that commit against develop, and it recorded 1 finding.

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>
@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 7bff4e50fbf05c9f6210d5dce84e3affd4b433ba, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

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: hub_last_change, intent_ref, intent_trail, intent_findings, spanned_notes, heading_slug, and extract_anchored. The one that does not is check_files_intent, a registry-dispatched check_<id> wrapper. In spec/audit.py, 28 of 38 check_ functions carry no docstring, because spec/checks.json's description field documents each check. The 80% figure is CodeRabbit's default threshold, not a rule this repository sets. Its review otherwise reported no actionable comments.

ptr727 added a commit that referenced this pull request Nov 3, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants