test(daemon): pin the complete REST path surface and the /v1/runs absence - #606
Merged
KnockOutEZ merged 1 commit intoSep 6, 2026
Merged
Conversation
…ence The shipped rest-openapi rows were existential only: they asked whether /v1/search exists and could not see a path nobody named, so a reintroduced /v1/runs route passed green. Adds an exhaustive sorted golden over Object.keys(doc.paths) plus an independent negative computed from the live document, so pasting a runs entry into the golden does not buy silence. Both pins carry a fixture proving they red.
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.
Closes #481.
Problem
tests/unit/daemon/rest-openapi.test.tspinned only positive paths — "is/v1/searchdefined?" — which is existential and cannot see a path nobody asked about. Spec §10(d) asked for a REST regression golden after therest/runs*.tsremoval; without one, a reintroduced/v1/runsroute passes green.Change
Test-only. No route changes, no source change.
GOLDEN_REST_PATHS— the complete served path surface, sorted, hand-maintained (13 paths: 10 tools +/v1/tools+ both openapi aliases).assertExhaustivePathSurface()—Object.keys(doc.paths).sort()deep-equals the golden. Any added or removed route reds it.assertNoRunSurface()— the second, independent assert: it filters the LIVE path list for/v1/runs*, never the golden array, so editing the golden cannot silence it. It also runs over the golden array itself, so a careless paste is caught at review too.buildOpenApi()is memoized and shared — the served document is never mutated).Demo
Mutant A — a real
/v1/runsroute reintroduced inbuildPaths():Mutant B — the acceptance criterion: mutant A still in place, plus
/v1/runspasted carelessly intoGOLDEN_REST_PATHS. The exhaustive row goes green; the negative stays red:Both mutants reverted by reverse-edit;
git difftouches the test file only.Gates (local — CI deferred, quota)
CI deferred — quota.