Skip to content

Route GET /api/search and prove the harvest end-to-end#102

Merged
jpr5 merged 2 commits into
blitz/atlas-seed-harvest/integrationfrom
blitz/atlas-search-route/integration
Jun 10, 2026
Merged

Route GET /api/search and prove the harvest end-to-end#102
jpr5 merged 2 commits into
blitz/atlas-seed-harvest/integrationfrom
blitz/atlas-search-route/integration

Conversation

@jpr5

@jpr5 jpr5 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Mounts GET /api/search on the server (registered with the atlas ratification routes, behind the same ANALYTICS_TOKEN bearer auth): lexical search over the indexed corpus via textSearchChunks, response shape exactly matching the pinned AtlasHttpClient SearchHit contract ({hits:[{id,content,sourceUrl,title,sourceName,score}]}, hits always present).
  • Param conventions match the module: text required (400 atlas_search_text_required), limit via parseLimitOrError (default 50, max 200), empty source treated as absent, and array-shaped text/source rejected with the analytics 400 envelope instead of silently dropping the filter.
  • End-to-end proof: the new e2e test boots the real server over HTTP (PGlite-backed), seeds corpus + 5 fragments, and drives the full harvest through the real AtlasHttpClient. Red (pre-route): rag-dedup probe failed 5 consecutive times … HTTP 404: Cannot GET /api/search. Green: 5 fragments → 5 candidates → 5 pending upserts, live rag-corpus-overlap: annotation in validated_against + fused_from, zero swallowed probe failures.
  • README Step-6/7 fix: the type: atlas source block is a Step-6 prerequisite (reindex 400s unknown_source otherwise); stale "unrouted endpoint" caveats swept now that the route is live.

Test plan

  • Full suite: 5928/5928 (324 files), including 17 new endpoint/e2e tests
  • tsc --noEmit + tsc -p tsconfig.scripts.json --noEmit clean
  • Build green

CR record

7-agent review round → 1 fix round (array-param hardening, README ordering, test pins) → 7-agent byte-identical confirmation round → triage: CONVERGED, zero new behavioral findings; review rulings pinned in comments.

Follow-ups (pre-existing, out of scope)

  • shutdown() exits 0 on fatal server errors (e.g. EADDRINUSE) — defeats supervisor restart policies (triple-flagged)
  • ipLimiter counter leak in the defensive session-init race branch
  • AtlasHttpClient has no request timeout/AbortSignal
  • 409 idempotency detection substring-matches the body instead of parsing error
  • e2e probe-failure log-prefix should be a shared exported constant
  • Allowlist IPv4 regex accepts octal/short/long notations that parse to a different address
  • Unauthenticated /analytics + /api/analytics/auth-mode call config readers unguarded

@jpr5 jpr5 merged commit 0161b11 into blitz/atlas-seed-harvest/integration Jun 10, 2026
3 checks passed
@jpr5 jpr5 deleted the blitz/atlas-search-route/integration branch June 10, 2026 19:40
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.

1 participant