Skip to content

feat(authoring): absorb staleness modules; repoint help_data in-process (T2a)#1205

Merged
silversurfer562 merged 2 commits into
mainfrom
feat/authoring-staleness-t2a
Jul 1, 2026
Merged

feat(authoring): absorb staleness modules; repoint help_data in-process (T2a)#1205
silversurfer562 merged 2 commits into
mainfrom
feat/authoring-staleness-t2a

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

T2a — absorb staleness modules; repoint help_data in-process

Executes T2a of the attune-author consolidation
(docs/specs/attune-author-consolidation/). Absorbs the staleness trio
into attune.authoring and severs help_data's subprocess dependency on
the attune-author CLI.

What changed

  • Absorb symbols.py + manifest.py + staleness.py into
    attune.authoring (verbatim from upstream attune-author — imports
    repointed, provenance headers). The semantic-hash algorithm is preserved
    byte-for-byte so existing .help/ stored hashes stay valid.
  • Tests: brought the upstream test suites into tests/unit/authoring/
    (83 tests). Coverage — manifest 96% · staleness 85% · symbols 88%.
  • Repoint help_data._stale_features (renamed from
    _attune_author_stale_features) to the in-process
    attune.authoring.staleness.check_staleness, on top of fix(ops): treat attune-author status non-zero exit as "unknown", not "clean" #1203. Removes the
    attune-author status subprocess, the shutil/subprocess imports, and
    the _parse_status_output markdown parser.
  • Manual→N/A filter (D9b): features with no files: globs are reported
    untracked (N/A), not stale. Dogfooded against the real .help/ — all 27
    single-sourced features are glob-less, so a faithful check flags all 27
    (noise); the filter yields 0. A regression test guards this.

Why

The old subprocess path had a latent masked-crash bug (a broken CLI shim
read as "nothing stale"); #1203 guarded it, and this PR removes the class
at the root by severing the CLI. See decisions D8 (the reframing),
D9 (both blockers resolved), D10 (LLM polish moves upstream —
executed later by T3), all landed here.

Scope note

The spec's T2 resolver fold-in (#1191 — extract audit_doc_imports's
src-on-sys.path resolver into fact_check/imports.py) is split out
of this PR: it touches disjoint files (fact_check/, scripts/) and needs
its own line-115 regression test. Tracked in decisions.md → Open.

Verification

  • tests/unit/authoring/ + tests/unit/ops/test_help_data.py — 330 passed
  • Full pre-commit hook set green (black, ruff, bandit, help-regen — no churn)
  • Dogfooded _stale_features against the live repo .help/frozenset()
    (correct: all-manual repo, zero drift)

🤖 Generated with Claude Code

…ss (T2a)

T2a of the attune-author consolidation. Absorbs the staleness trio into
attune.authoring and severs help_data's subprocess dependency on the
attune-author CLI.

- Absorb `symbols.py`, `manifest.py`, `staleness.py` into
  attune.authoring (verbatim from upstream attune-author; imports
  repointed, provenance headers). Byte-compatible hashing preserved.
- Bring the upstream tests into tests/unit/authoring/ (83 tests;
  manifest 96% / staleness 85% / symbols 88% coverage).
- Repoint `help_data._stale_features` (was `_attune_author_stale_features`)
  to the in-process `attune.authoring.staleness.check_staleness`, on top
  of #1203. Removes the `attune-author status` subprocess, `shutil` /
  `subprocess` imports, and the `_parse_status_output` markdown parser —
  eliminating the masked-crash bug class at the root (D9a).
- Manual→N/A filter (D9b): features with no `files:` globs are reported
  untracked, not stale. Guards the all-manual single-sourced repo from a
  wall of 27 false positives that a faithful hash check produces.
- decisions.md: port D8 forward + append D9 (both blockers resolved) and
  D10 (LLM polish moves upstream onto the master; executed by T3).

Resolver fold-in (spec T2 / #1191) split out to keep this focused — it
touches disjoint files with its own regression test; tracked in Open.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
attune-ai.dev Ready Ready Preview, Comment Jul 1, 2026 3:49pm
website Ready Ready Preview, Comment Jul 1, 2026 3:49pm

) -> None:
"""A second call within the TTL returns the cached set without
re-running ``check_staleness``."""
import attune.authoring.staleness as staleness_mod
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.84296% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/attune/authoring/staleness.py 91.27% 11 Missing and 4 partials ⚠️
src/attune/authoring/symbols.py 97.19% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Raises patch coverage on the absorbed modules from ~79-85% to 90-100%
(Codecov flagged 72 missing lines / partials on #1205). The brought
upstream suites cover mainline paths; this adds the branch edges they
miss:

- symbols.py 83% -> 98%: posonly / *args / bare-* kwonly / **kwargs /
  async signature variants + class public-attr and method extraction.
- staleness.py 85% -> 93%: mixed-content byte hash, SyntaxError->byte
  fallback, frontmatter parse edges, unsafe-name / missing-template
  guards, check_workspace_staleness (with + without manifest), _infer_kind.
- manifest.py 95% -> 100%: load-validation raises (non-mapping, bad
  features, unsafe name, non-mapping spec), version-mismatch warn,
  save_manifest full-field round-trip.
- help_data.py: _stale_features import-unavailable and check_staleness-
  raises fallback branches (both -> None -> age fallback).

Remaining staleness gaps are the project-doc footer paths that help_data
does not use (help templates only).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@silversurfer562

Copy link
Copy Markdown
Member Author

Addressed the Codecov coverage feedback in 219d0a929:

File Before After
authoring/manifest.py 95% 100%
authoring/symbols.py 83% 98%
authoring/staleness.py 85% 93%
ops/help_data.py 88% 90%

Added tests/unit/authoring/test_authoring_edges.py (signature variants, byte-hash fallbacks, frontmatter/kind helpers, manifest load-validation + save round-trip) plus two _stale_features error-branch tests. Remaining staleness gaps are the project-doc footer paths help_data doesn't exercise (help templates only).

Note: the red Run Security Scanner check is the known cosmetic dependabot-guard skip (1s, zero steps) — it is not in required_status_checks, so it does not block merge.

) -> None:
"""A raising ``check_staleness`` falls back to age-based (advisory,
never 500-ing the dashboard)."""
import attune.authoring.staleness as staleness_mod
@silversurfer562 silversurfer562 merged commit 9ca40de into main Jul 1, 2026
50 of 51 checks passed
@silversurfer562 silversurfer562 deleted the feat/authoring-staleness-t2a branch July 1, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant