refactor(help): shim manifest/staleness/freshness; add rag adapter#6
Merged
silversurfer562 merged 1 commit intomainfrom May 8, 2026
Merged
Conversation
Phase B2 of the architecture-realignment spec
(specs/architecture-realignment/{requirements,design,tasks}.md).
The authoring modules manifest.py, staleness.py, freshness/ moved to
attune-author in B1 (#14). This change replaces the help-side files
with thin re-export shims that emit DeprecationWarning, preserves
existing import paths for one minor release, and adds the
HelpCorpusAdapter implementation that pairs with attune-rag's
typed protocol from Phase A (attune-rag #10).
Net change: ~914 lines removed, ~176 added. Three internal modules
(~1063 lines total) collapse to four ~30-line shims that re-export
their replacements.
Closes finding #1 (ADR-002 violation) of the 2026-05-07 architecture
review. Finding #3 (ADR-001 leak in discovery.py) is intentionally
deferred in this PR — see PR body.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 tasks
Member
Author
|
attune-author 0.7.0 just published — CI dep resolution should now succeed. Re-running checks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase B2 of the architecture-realignment spec. The authoring modules
manifest.py,staleness.py,freshness/moved to attune-author in PR #14 (B1). This PR collapses the help-side originals into thin re-export shims that emitDeprecationWarningand adds the rag-adapter that pairs with attune-rag PR #10 (Phase A).attune_help/manifest.py,staleness.py,freshness/__init__.py,freshness/symbols.pywith shims (from attune_author.X import *+DeprecationWarning).attune_help.__init__so a plainimport attune_helpis warning-free during the deprecation window. Engine-related re-exports preserved.attune_help/adapters/rag.py::AttuneHelpAdapter— a frozen dataclass that satisfies attune-rag'sHelpCorpusAdapterprotocol (templates_root,version).attune-helpto 0.11.0 and declareattune-author>=0.7.0as a transitional dep (see Coordination notes below).tests/test_authoring_shims.py) verify symbol identity through the shim AND theDeprecationWarningfires per module.Net diff: +300 / −1090 (~790-line shrink in
attune_help).Closes / does not close
discovery.py) — see "Course-correction" below.Course-correction: B2.3 deferred
design.mddescribesattune_help/discovery.pyas duplicating retrieval scoring that ADR-001 reserves for attune-rag, and proposes routing throughattune_rag.KeywordRetriever. After reading the actual code, I think this misidentifies whatdiscovery.pyis doing:discovery.search()does typo-tolerant fuzzy slug match viadifflib.SequenceMatcherplus a substring bonus — its job is autocomplete / "did you mean X?".attune_rag.KeywordRetrieverdoes token-overlap content scoring weighted across path / summary / content / aliases / related — its job is RAG retrieval.tests/test_discovery.py::test_search_finds_misspellingasserts thatsearch("secrity-audit")findssecurity-audit. KeywordRetriever doesn't (and shouldn't) do character-level fuzz; it would tokenize both inputs and find no overlap. Replacing discovery's loop withKeywordRetriever().retrieve(...)would be a behavior break, not a duplication removal.Recommendation: leave
discovery.pyas-is in this PR. If finding #3 still feels like the right call, scope a follow-up that either (a) adoptsKeywordRetrieveras a second mode for content-based search while keeping fuzzy slug autocomplete, or (b) revises the finding now that the code is closer to scope. Happy to course-correct if you'd rather close it now.Coordination required before merge
attune-author>=0.7.0, but the latest published is 0.6.2 — without the relocatedmanifest/staleness/freshnessmodules. Need a 0.7.0 (or 0.6.3) release of attune-author that ships the B1 changes BEFORE this PR is published to PyPI. Local dev install (pip install -e ../attune-author) works againstmain.attune-help>=0.10.0dep inpyproject.tomlthat's a leftover from the pre-B1 era (nofrom attune_helpimports inattune-author/srcanymore). Worth a separate one-line cleanup PR on attune-author so we don't have a circular package-metadata edge.attune-author>=0.7.0as a transitional required dep. Carried forward in CHANGELOG; constraint restored when shims are removed (target 2026-07-07, tracked by RemoteTrigger01Vuq4AiaKLspV2wNVpCQN1o).Test plan
tests/test_authoring_shims.py— 7 tests: 4 parametrized DeprecationWarning checks + 3 symbol-identity checks (Feature is attune_author.manifest.Feature, etc).ruff check src/ tests/clean.pip install attune-help==0.11.0resolves cleanly.🤖 Generated with Claude Code