Skip to content

test: cover machine callers, input rules and route validation e2e - #59

Merged
TheGreatAxios merged 2 commits into
cl-9127-memory-delete-mocked-embed-client-and-rerank-client-testsfrom
cl-9118-memory-delete-fake-backed-routestestts
Sep 27, 2026
Merged

TheGreatAxios merged 2 commits into
cl-9127-memory-delete-mocked-embed-client-and-rerank-client-testsfrom
cl-9118-memory-delete-fake-backed-routestestts

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #58; merge that first.

  • Ports every meaningful case from src/memory.test.ts (mock-heavy) and src/routes/routes.test.ts (fake-backed) into the real-Postgres end-to-end suite, then deletes both files:
    • tests/caller-resolver.test.ts: an unidentified caller gets 401; a throwing, empty or whitespace resolver gets 500 with nothing written; grants are still required; reads use only the resolved tenant; retention actions are limited to the resolved creator.
    • tests/context-rows.test.ts: authorization reads only .id/.tenantId from synthesized context rows.
    • tests/plane.test.ts: limit bounds, the content/file rule, text extraction, share tags, kind filters and evidence, capability reporting, re-adding identical content, and rerank budget validation.
    • tests/grants.test.ts: legacy grants, 401 without a session, body and limit validation, list and search visibility, forget versus purge, unknown and whitespace ids, retention-class, and kinds/entity_ids passthrough.
  • Also deletes the log formatter, table-name, grant-requirement constant, resident-distiller wiring and memory-plane error-type tests, which asserted nothing a host can observe.
  • The capture tests import the module directly, now that nothing uses mock.module.
  • The fail-closed guard for a search hit whose row disappears mid-query (if (!meta) continue; in src/memory.ts) is not covered; reproducing it needs a concurrent delete between two internal queries.

Verification

  • TEST_DATABASE_URL=… bun run test: 356 pass against local Postgres 17 with pgvector.
  • Without the variable: 316 pass, and the Postgres suites skip.
  • bun run typecheck passes.

Closes CL-9117
Closes CL-9118

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review, three passes. Each pass compared the deleted files case by case against tests/.

Verdict: ready for review.

  • The third pass found three small gaps: search visibility within a tenant, purge on an unknown document returning 404, and the file placement of the synthesized-row test. All three are fixed in this branch and the suite passes, but there was no fourth review pass after those fixes.
  • A mutation that reads the URL tenant fails the tenant-scoping test.
  • The one waiver is listed in the description.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9118-memory-delete-fake-backed-routestestts branch 2 times, most recently from 8d61be2 to fb1a11f Compare September 26, 2026 00:00
@TheGreatAxios
TheGreatAxios force-pushed the cl-9118-memory-delete-fake-backed-routestestts branch 2 times, most recently from c21b4b8 to a89638d Compare September 26, 2026 00:53
@TheGreatAxios
TheGreatAxios force-pushed the cl-9118-memory-delete-fake-backed-routestestts branch from a89638d to 63c5d5b Compare September 26, 2026 01:32
@TheGreatAxios TheGreatAxios changed the title Port the mocked memory and route tests to the end-to-end suite and delete them test: cover machine callers, input rules and route validation e2e Sep 26, 2026
@TheGreatAxios
TheGreatAxios force-pushed the cl-9118-memory-delete-fake-backed-routestestts branch from 63c5d5b to b739359 Compare September 26, 2026 01:36
@TheGreatAxios
TheGreatAxios added this pull request to stack #61 September 26, 2026 01:57
New end-to-end suites exercise the callerResolver trust boundary (401 on
an unidentified caller, 500 on a throwing or malformed resolver, grants
still required, reads scoped to the resolved tenant, retention limited
to the resolved creator, and synthesized context rows read only for
their ids), the in-process input rules (limit bounds, content or file,
text extraction, share tags, kind filters, evidence, capability
reporting, rerank budget validation), and the remaining route checks
(legacy grants, 401 without a session, body and limit validation,
private list visibility, forget versus purge, unknown and whitespace
ids, retention-class).
Their cases now run against real Postgres in the end-to-end suite. The
capture tests import the module directly now that nothing replaces it
with mock.module.

Also deleted: the log formatter, table-name, grant-requirement constant,
resident-distiller wiring and memory-plane error-type tests, which
asserted nothing a host can observe.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9118-memory-delete-fake-backed-routestestts branch from b739359 to 57d896c Compare September 27, 2026 00:32
@TheGreatAxios
TheGreatAxios merged commit 778847b into main Sep 27, 2026
4 checks passed
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