Skip to content

chore: import the shared query declared-name walk in Middleware.ts #297

Closed

Description

@thomasfosterau

Split out of #296 (the follow-up to #291, refs #278).

Problem

#296 moved the query declared-name walk (declaredNames / familyPrefix) into src/internal/declaredQuery.ts, so the conformance kit's discovery reads a query the way Middleware.SchemaErrors does. src/Middleware.ts was deliberately left alone because open PRs #294 and #295 both edit it, and #294's hunk at L731 uses familyPrefix's closing lines as context. So Middleware.ts still carries its own private copy (~L700-733), identical in behaviour. fallow audit reports it as a clone group (dup:3004cff5, src/Middleware.ts:702-732 / src/internal/declaredQuery.ts:27-59), and the two copies can drift. If they drift, the kit could again probe an endpoint the middleware lets a parameter through to.

Proposal

Once #294 and #295 have merged:

  • delete declaredNames and familyPrefix from src/Middleware.ts;
  • import declaredNames from ./internal/declaredQuery.js there;
  • drop any effect imports that become unused.

No behaviour change, so no changeset.

Done when

  • src/Middleware.ts imports declaredNames from src/internal/declaredQuery.ts and defines no copy of it.
  • fallow audit no longer reports the Middleware.ts / declaredQuery.ts clone group.
  • All AGENTS.md gates pass.

Generated by Claude Code

Activity

  1. added a commit that references this issue on Oct 9, 2026
    e4867f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions