Repository navigation
feat(t27mcp): find.t27 -- t27_find, intent to ranked corpus specs or an honest miss - #10194
Merged
Merged
Conversation
…an honest miss (Refs #10066) First step of the validated-code contract: before anything is written, look for a spec that already answers the intent. verdict() decides per manifest row (name, path, tags); rank_key() orders the admitted rows. A row is served only when it covers the intent (every word up to three words, two thirds of a longer intent, and the file name carries at least half of them), compiles clean (health/ok) and carries tests (has/tests). Words are matched at the start of a name or path token, so "count" is not found in "account". Below the threshold the answer is a miss, not the nearest neighbour. Reuses has() from t27mcp::check_hints. Evidence (lab, t27c 0.5.2): test-report 13 of 13 pass, 0 vacuous; removing covers() fails 7 tests, loosening the ratio fails 2, dropping the name-half rule fails 1, matching inside a word fails 1, treating numbers as noise fails 2; dupe_scan --like: nothing in this file is written elsewhere. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
gHashTag
enabled auto-merge (squash)
October 18, 2026 04:00
This was referenced Oct 18, 2026
gHashTag
added a commit
that referenced
this pull request
Oct 18, 2026
…ind as pass (Closes #10212) (#10214) #10198, #10202 and #10194 added these three specs without a row in docs/reports/t27b_expectations.json, so t27b-native-ratchet reads "UNLISTED 3" on master and on every open PR (run 39096977680 on #10185): "the reference passes it and the ledger does not name it (t27b pass)". Adds the three rows in path order with the verdict the run measured. No other row moves. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
specs/t27mcp/find.t27-- the ranking behind the MCP toolt27_find(epic #10066, first step of the validated-code contract: reuse a validated spec when one exists, write a new one only on a miss).An agent that needs "a clocked counter" does not know the file is called
clocked_counter.t27.verdict(intent, name, path, tags)decides for one manifest row;rank_key(...)orders the rows it admits. The server (gHashTag/t27-mcp) only feeds rows in and sorts by the key.Rules, all in the spec:
countis not found inaccount.health/okandhas/tests. A relevant row that is not served is counted (skipped.unhealthy,skipped.untested), not returned.clocked_counterandreset_syncas two specs.summarytext is never matched on (it is boilerplate).has/testsis a manifest tag, not a receipt. The reply says so and points to the next tool,t27_validate.Reuses
hasfromt27mcp::check_hints(no copy).Evidence (Railway lab, t27c 0.5.2, rebased on 290ff17)
t27c test-report specs/t27mcp/find.t27: 13 of 13 pass, vacuous passes 0 of 13.covers()check removed fromverdict: 7 tests fail3*m < 2*n->3*m < 1*n): 2 failsha-256weak hit below): 2 failreturn V_HIT;as the first line ofverdict) is refused by the compiler ("unreachable code"), so that check is a compile error rather than a failing test.python3 tools/dupe_scan.py --like specs/t27mcp/find.t27: nothing in this file is written elsewhere.python3 tools/dupe_scan.pyprintsa body written under byte_sum is now copied [2] time(s) and was in no ledger(specs/ml/file_io_contract.t27). It is identical on master without this file; this PR adds no duplicate group. Not touched here.Real manifest (2402 specs), same wasm the server loads, 5-20 ms per call:
specs/ternary/clocked_counter.t27specs/ternary/ternary_full_adder.t27onlyuart_echo*specsspecs/tri/crypto/sha256.t27,tri-net/specs/tri_sha256.t27(a thirdsha256spec is skipped: nothealth/ok)Known limits (honest)
duplicate_rules.t27) is not found.SHA-256(with the hyphen) is a miss whilesha256hits: the hyphen splits the word and256is not the start of any token.SHA-256 implementationis a miss too. A miss beats a weak hit (before the last edit of this PR,SHA-256returnedshaping.t27,sha512.t27,blog-share.t27), but this is the first thing to improve.specs/tri/graph/topological_sort.t27andspecs/tri/collections/priority_queue.t27arehealth/okwith tests that assert only!= undefined.t27_validateis the planned answer.Companion PR (artifacts + glue): see the gHashTag/t27-mcp PR from branch
claude/exciting-gauss-9cbc6e.Refs #10066
🤖 Generated with Claude Code