Repository navigation
STE-34: search, filter and sort /skills on the server, over the whole registry - #54
Merged
Merged
Conversation
… whole registry GET /skills takes verdict, q, stale_audit, sort and order. Filtering and sorting run over every row before the page is cut, and total counts the filtered rows, so a client never offers empty pages or a "highest trust first" that only ranks the rows it happened to fetch. Rows are chosen from a view of the whole registry read from chain, not from the SQLite index the ticket suggested. The index is filled from getEvents, which only reaches back as far as the RPC node retains events: a rebuilt index silently lacks older skills and verdict=SAFE would return fewer rows than exist, breaking "deleting the cache never changes an answer". The view is at most 30 s old (inside the 60 s section 6 allows) and is dropped whenever the indexer stores a registry event. Decisions the ticket asked to be made explicitly: - the returned page is re-read live; a row whose live verdict no longer matches the verdict filter is left out, counted in excluded_stale, and the view dropped; - rows with no trust score sort last in both directions; - an unreadable row matches no verdict, not even UNAUDITED; - stale_audit=true includes never-audited rows; - ties break on skill_id, so pages are stable; - invalid values, and the rejected verified/owner parameters, are 400 with a reason, never ignored. With none of the new parameters the response is the original one, so the live dashboard is unaffected. as_of and excluded_stale are additive fields. conftest carries the same rate-limiter line as STE-42: this suite also passes 100 requests against the shared app.
…ient-side Every filtered answer is recomputed from the plain listing, every filtered row's verdict is confirmed through /check, and paging, sort orders and 400s are checked. Passed against testnet (66 skills): SAFE 48 and DANGEROUS 18 all confirmed on chain, WARNING and UNAUDITED empty with total 0, six sort orders exact, 66 rows in pages of 7 with no overlap.
…is chain-read Parameters, the two listings, total semantics, null placement, what an unreadable row matches, where rows come from and why the index was rejected, what happens when the view and the chain disagree, and the rejected parameters.
…try v2 and v1 Rebased on dc0a0c6. STE-18 landed a test-namespace filter on the plain listing while this branch was open; the two now share one scan (skills.scan_registry, MAX_SCAN) and one rule (is_test_skill_id). Decision: test rows are removed after the other filters, so hidden_test_entries on a filtered page counts only test rows that matched everything else. Counting every test row on chain would tell a client that verdict=WARNING hid 47 rows when it hid none. verify_skills_filters.py section 7 grades that client-side. Registry v2 (production) has no test rows, so the run is repeated read-only on v1, which has 47: both PASS, 57 checks each.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Linear: STE-34 · ACC by Axel 2026-09-17 · reviewers @axelmatsama @fable
Problem
GET /skillscould only page the registry in registration order. On production today,?verdict=SAFEanswers 200 but ignores the filter and returns every row.Fix
verdict,q(substring ofskill_id),stale_audit,sort(registered_at/trust_score/skill_id) andorderare applied over the whole registry, before paging.totalis the filtered count.excluded_stale.hidden_test_entriescounts only test rows that matched the other filters.verifiedandownerare refused with400 INVALID_PARAMETERand a reason, instead of being silently ignored.Tests
E2E
api/scripts/verify_skills_filters.pycomputes the expected answer client-side and confirms every filtered verdict through/check:Evidence:
docs/evidence/ste-34-e2e-skills-filters-2026-09-16.json.