Repository navigation
Direct: quick-map status, scope fallback, cross-cutting checklist, leak ratchet - #64
Merged
Merged
Conversation
- .github/workflows/test.yml: full pytest, --help/doctor smoke, wheel installed into a clean venv to prove the four data trees actually ship (test_packaged_runtime only asserts pyproject TEXT), and both knowledge linters — on every push and PR. Signal only for now: making it a merge gate needs the suite job set as a required status check in repo settings, which no commit can do. - DEVELOPMENT.md documents that workflow and its limits; CODE_TOUR updated to cover all 80 source files with the staged reading route. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tzhouam
pushed a commit
that referenced
this pull request
Aug 12, 2026
…ak ratchet - _direct_quick_map now reports ok / truncated / unavailable instead of silently serving a partial or empty excerpt (the serving page's section is 3754 chars against the 3500 cap; its request-contract rows were being dropped with no marker). Routes whose map is not ok grant exactly that many knowledge_file_reads in the execution budget, so the response never says 'read this' next to '0 knowledge reads'. - changed_files normally only validate scope; when no title/body route matches an owner they select the routes instead, declared as status: scope_fallback rather than silently. - two checklist items for failure classes measured on the wave-1 arm that no component owner can carry: test assertions bound to fixture-injected values, and new dependency kwargs checked against the lowest permitted version rather than the installed one. - test_v2_p0 repo-neutrality check becomes an explicit debt RATCHET: known leaks are recorded at today's exact counts and can only shrink; all offenders are collected before asserting so one leak no longer masks the rest. config.py resource probes drop their repo literal (glob markers). - hunyuan-image3 knowledge pages: rename the dev-entry heading so _direct_quick_map can extract it; new test pins that intra-knowledge anchor links resolve (38 today, 0 broken). Merged with upstream's frozen-head-SHA evidence binding and budget timing (9f3655d): the timed budget call now carries knowledge_file_reads, and both sides' checklist items and tests are kept. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Also restores the unsupported-repo guard that the upstream adapter-routing change lost for repos with no adapter: _adapter_changed_file_routes returns every changed file as unmatched when no adapter exists, which reported garbage repos as description_unrouted; an adapter-presence gate now keeps unsupported_exact_router for them while served adapter repos route normally. (Re-landed: the original PR #64 accidentally merged the CI/docs commit instead of this content — a branch ref was moved by a reset --hard in an attached worktree before push. This commit is the same reviewed tree rebuilt onto current main; config.py re-merged with the zero-yield hunk from #63.)
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.
What
Direct-mode routing hardening, merged with upstream's frozen-head-SHA work (#56):
_direct_quick_mapreportsok/truncated/unavailableinstead of silently serving a partial or empty excerpt. Measured case: the serving page's Direct section is 3,754 chars against the 3,500 cap — its request-contract rows were dropped with no marker while the route said the excerpt was sufficient. Routes whose map is notoknow grant exactly that manyknowledge_file_readsin the execution budget, so a response never says "read this page" next to "0 knowledge reads".changed_filesnormally only validate scope; when no title/body route matches an owner they select the routes instead — now announced asstatus: scope_fallbackrather than happening silently.test_repo_neutral_corebecomes an explicit debt ratchet — known leaks recorded at exact counts that can only shrink, all offenders collected before asserting (previously one over-ceiling file masked every later one).config.pyresource probes drop their repo literal via glob markers._direct_quick_mapcan extract it; new test pins that intra-knowledge anchor links resolve (38 today, 0 broken — neither knowledge linter checks fragments).Upstream interaction
Hand-merged with #56's evidence binding and budget timing: the timed budget call now carries
knowledge_file_reads, and both sides' checklist items and tests are kept.One behavior fix to the merged result: the adapter-routing change lost the unsupported-repo guard for repos with no adapter —
_adapter_changed_file_routesreturns every changed file as "unmatched" when no adapter exists, so unserved repos were reported asdescription_unrouted(a served-repo status) and could proceed. An adapter-presence gate restoresunsupported_exact_routerfor them while served adapter repos (afd-plugin) route exactly as #51 intended. Pinned bytest_unsupported_repo_never_routes_regardless_of_description.Validation
120 tests green on this branch:
test_thin_mcp_server.py,test_thin_mcp.py,test_imreview_output_contract.py,test_v2_p0.py,test_knowledge_source.py,test_routing.py, and all oftest_mcp.pyexcepttest_subprocess_tamper_defense, which fails identically on a cleanmaincheckout on this machine (thread-creation ulimit) and is unrelated. Both knowledge validators pass.🤖 Generated with Claude Code