Skip to content

test(router): accept array-valued schema types and report ref cycles in the gate walker - #446

Merged
dayvidpham merged 4 commits into
developfrom
village-445--test--harden-gate-schema-walker
Nov 29, 2026
Merged

dayvidpham merged 4 commits into
developfrom
village-445--test--harden-gate-schema-walker

Conversation

@dayvidpham

@dayvidpham dayvidpham commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #445.

What and why

The contract gates from #444 walk the served document's schemas. The walker made three simplifying assumptions, none of which matters for today's document:

  • Array-valued type. "type": ["array","null"] failed to decode, and the route dropped out of the gate silently. type now accepts a string or an array of strings, and a schema that cannot be decoded fails the test with its operation.
  • $ref cycles. References now resolve one hop at a time, with each hop tracked, so a cycle of two or more hops is reported.
  • One document parser. declaredContractRoutes reuses the shared parser and method check.

Scope boundary

Tests only. The closed-body set and the list-route set derived from the served document are unchanged.

Acceptance

A synthetic-document fixture (schema_walker_cases.yaml, with a required-name manifest) covers four cases:

  • a ["array","null"] response is derived as a list route;
  • a ["object","null"] closed request body is derived as closed;
  • a two-hop $ref cycle is reported;
  • a type that is neither a string nor a string array is reported.

Verification (head f2605f0c)

  • go build, go vet (with and without the integration tag), gofmt and go test -count=1 ./... pass.
  • scripts/run-integration-gates.sh passes every package, with PostgreSQL, RustFS and the CI key ring.
  • make check-unstring has no findings.
  • Mutations: removing the array-type decoding fails the two nullable cases; removing cycle reporting fails the cycle case.

Merge dependencies

  • Must land first: nothing.
  • Safe to merge alone: yes.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dayvidpham

Copy link
Copy Markdown
Contributor Author

Review — curated report

Three independent reviewers (correctness, tests, elegance): three ACCEPT, zero blockers.

Checked:

  • The served document derives the same closed-body and list-route sets.
  • Cycles are caught across one-hop, multi-hop and branch-mediated references, with no false positive on a shared reference.
  • Each fixture case exercises the same derivation function its gate uses, and fails for the intended reason.

Noted, not fixed: an OpenAPI 3.1 boolean schema (true/false) or a $ref outside #/components/... would now fail the walker rather than be skipped. The served contract uses neither, and failing closed is the safer default for a gate.

Gates on f2605f0c: go test ./..., go vet (with and without the integration tag), scripts/run-integration-gates.sh with PostgreSQL, RustFS and the key ring, and make check-unstring all pass.

@dayvidpham
dayvidpham enabled auto-merge November 29, 2026 10:31
@dayvidpham-agent

Copy link
Copy Markdown

journey results: all passed

workflow run: 46252616249
commit: 2c56c75

no screenshots or clips: the report lists 468, but none of them is in the downloaded artifact.

account-settings.journey › opens from the account menu and shows every row — passed

validation media

account-settings.journey › says peasant is signed in nowhere — passed

validation media

account-settings.journey › refuses a handle somebody else holds — passed

validation media

collective-settings.journey › walks the sections from the section bar, and draws no check-mode radios — passed

validation media

collective-settings.journey › keeps its section bar on a phone — passed

validation media

collective-settings.journey › edits a text field only after edit, and saves it — passed

validation media

collective-settings.journey › saves who can publish the moment a card is pressed — passed

validation media

collective-settings.journey › settles a switch the moment it changes — passed

validation media

collective-settings.journey › says github connected after the install handshake, and lands on the github section — passed

validation media

collective-settings.journey › retains github user search and confirms the selected invitation — passed

validation media

collective-settings.journey › deletes the collective only after the owner says they understand — passed

validation media

collective.journey › lists the collectives the viewer belongs to in a table — passed

validation media

collective.journey › shows the owner the chips, the tabs, the table and the github org — passed

validation media

collective.journey › shows the owner of a curated collective what waits for approval — passed

validation media

collective.journey › retains transcript grouping and private contribution withdrawal on the mounted detail page — passed

validation media

collective.journey › shows a member the org without manage, and leave — passed

validation media

collective.journey › sends a signed-out reader of a public collective to the marketing log-in, coming back to it — passed

validation media

collective.journey › uses the inline repo picker, links a repository and says what it saved — passed

validation media

discover.journey › discovers, searches and joins collectives — passed

validation media

discover.journey › creates a collective and reports who was invited — passed

validation media

explore.journey › browses, searches, and opens a transcript — passed

validation media

explore.journey › filters the list by provider — passed

validation media

explore.journey › reorders the list by turn count — passed

validation media

explore.journey › switches between grid and list — passed

validation media

explore.journey › search surfaces a matching collective and opens it — passed

validation media

explore.journey › renders no rows when the server returns an empty list — passed

validation media

home.journey › lists your transcripts once, with totals and one searchable library — passed

validation media

home.journey › remembers how the table is arranged — passed

validation media

home.journey › searches your transcripts — passed

validation media

home.journey › fits a phone, with the table scrolling in its own box — passed

validation media

home.journey › teaches publishing when nothing is published yet — passed

validation media

positioned-transcript.journey › journey-capability-absent-content-page — passed

validation media

positioned-transcript.journey › journey-deeplink-request-set — passed

validation media

positioned-transcript.journey › journey-v2-failure-no-content-request — passed

validation media

positioned-transcript.journey › journey-number-far-target — passed

validation media

positioned-transcript.journey › journey-number-history-section — passed

validation media

positioned-transcript.journey › journey-turn-requested-row-filtered — passed

validation media

positioned-transcript.journey › journey-restore-reading-position — passed

validation media

positioned-transcript.journey › journey-download-after-segment-failure — passed

validation media

positioned-transcript.journey › journey-preview-readonly — passed

validation media

positioned-transcript.journey › journey-referrer-policy-and-no-id-in-logs — passed

validation media

positioned-transcript.journey › browser-revalidation-then-revoked — passed

validation media

positioned-transcript.journey › withheld-fields-not-rendered — passed

validation media

project.journey › expands the orphan group and opens a session — passed

validation media

pull-request.journey › the author sees what matches and who can read it — passed

validation media

pull-request.journey › reads the attached transcripts beside the code — passed

validation media

pull-request.journey › moves through the split list with j and k — passed

validation media

pull-request.journey › lists them newest first, by the day they were asked for — passed

validation media

pull-request.journey › says nothing is waiting, and how a pull request comes to wait — passed

validation media

pull-request.journey › asks a signed-out visitor to sign in and come back — passed

validation media

sign-in.journey › a visitor with no session at the root is sent to the marketing log-in popup — passed

validation media

sign-in.journey › a stale session at the root also leaves for the marketing log-in popup — passed

validation media

sign-in.journey › a signed-out deep link comes back to its page, query and all — passed

validation media

sign-in.journey › a signed-out page links home to the marketing site and fetches nothing cross-origin — passed

validation media

sign-in.journey › the app's own fetch of the root is served, not sent to another origin — passed

validation media

sign-in.journey › with no stored choice the theme follows a light system from the first paint — passed

validation media

sign-in.journey › with no stored choice the theme follows a dark system from the first paint — passed

validation media

sign-in.journey › the public privacy notice hydrates without an error on a light system — passed

validation media

sign-in.journey › the public privacy notice hydrates without an error on a dark system — passed

validation media

sign-in.journey › the sign-in page hands off to the marketing log-in popup, keeping where to return — passed

validation media

sign-in.journey › the sign-in page drops a foreign return address — passed

validation media

sign-in.journey › signing in from a page comes back to it — passed

validation media

sign-in.journey › a provider hand-off never follows a foreign return address — passed

validation media

sign-in.journey › the public privacy notice fits a phone — passed

validation media

sign-in.journey › the public privacy notice is accessible signed out — passed

validation media

sign-in.journey › a signed-in sidebar is home, discover, pull requests and collectives — passed

validation media

sign-in.journey › the account menu holds profile, settings and sign out — passed

validation media

sign-in.journey › sign-out announces pending and failed requests with retry — passed

validation media

transcript.journey › home-control: full root, header and zen — passed

validation media

transcript.journey › direct-collective: full root, header and zen — passed

validation media

transcript.journey › inferred-collective: full root, header and zen — passed

validation media

transcript.journey › collective-with-pending-notice: full root, header and zen — passed

validation media

transcript.journey › compact-home: native controls and footer focus — passed

validation media

transcript.journey › compact-pending-collective: native controls and footer focus — passed

validation media

transcript.journey › unverified source opens the original call from another tab — passed

validation media

transcript.journey › home-short: mobile utilities and exits — passed

validation media

transcript.journey › home-long: mobile utilities and exits — passed

validation media

transcript.journey › collective-short: mobile utilities and exits — passed

validation media

transcript.journey › collective-long-pending: mobile utilities and exits — passed

validation media

transcript.journey › home-compact-laptop: mobile utilities and exits — passed

validation media

transcript.journey › home-clipboard-denied: mobile utilities and exits — passed

validation media

transcript.journey › opens a stored transcript — passed

validation media

transcript.journey › the header copies the address and keeps more — passed

validation media

transcript.journey › the more menu, open — passed

validation media

transcript.journey › manage access, open — passed

validation media

transcript.journey › pull requests, collapsed — passed

validation media

transcript.journey › pull requests, expanded — passed

validation media

@dayvidpham
dayvidpham added this pull request to the merge queue Nov 29, 2026
Merged via the queue into develop with commit 8f17d67 Nov 29, 2026
18 of 21 checks passed
@dayvidpham
dayvidpham deleted the village-445--test--harden-gate-schema-walker branch November 29, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden the contract-gate schema walker for array-valued types and ref cycles

2 participants