Skip to content

test(e2e): characterization matrix for the nine untested tools, viewer routes, and the compaction hook (#241) - #243

Merged
abogartz merged 2 commits into
mainfrom
test/e2e-241-characterization
Nov 1, 2026
Merged

abogartz merged 2 commits into
mainfrom
test/e2e-241-characterization

Conversation

@abogartz

@abogartz abogartz commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Closes #241.

What lands

  • e2e/characterization.test.ts — 10 real-host scenarios pinning the host-facing contract of the nine never-e2e-tested tools: memory_update, memory_undo (list → check-refuses → merge-restores), memory_export, memory_import, memory_decay (dry-run default vs explicit apply), memory_consolidate, memory_merge_review, memory_evidence, memory_init (scripts→gate, idempotent at same head).
  • e2e/viewer.test.ts — no viewer route had any e2e coverage. The real viewer server is booted against an isolated store and driven over raw HTTP: page, /api/data, edit/delete/block/unblock/restore-entry, plus the DNS-rebinding Host 403, cross-origin 403, and text/plain 415 guards.
  • e2e/compaction.test.ts — the session.compaction hook on a service host via the host's own POST /api/session/:id/compact: the provider request log proves the durable-memory anchor rides into the summarizer. The README's memory-aware-compaction claim now has an e2e receipt.
  • e2e/coverage.test.ts — the mechanical gate the ticket asked for: registrations are parsed out of src/index.ts; every tool must have a scripted call() in the suite, every event hook an @covers hook:-tagged scenario, tags referencing unregistered hooks fail, and MEMORY_TOOLS is pinned to the registration set.
  • harness fix — MEMORY_TOOLS was missing memory_update: the load smoke verified 13 of 14 registered tools.

Skeptical-review answers (not happy-path-only)

  • Error paths: ambiguous update selector (refusal names the rival ts's), unmatched selector, empty-reason and ghost-survivor merge reviews, export destination escaping exports/ (refused, no existence oracle), import of a missing file, import of a hand-written open row (downgraded to settled, then blocked as ungrounded), malformed import line tally, impossible-but-well-shaped evidence date, viewer schema rejects (bad ts, empty audit reason, empty body) and the JSON 404.
  • Final-row verification: every scenario ends by asserting the store files — row counts, superseded_by pointer identity, status=open survival, exact-once placement after the merge restore (proving merge is a deliberate superset, not a rollback), refused calls writing nothing, and zero \.lock residue after the race.
  • Races: one scenario races two independent real hosts (own processes, own scripted models) appending to one shared store: both win, each row lands as one intact record, nothing interleaves or is lost, no lock leaks. The deeper race matrix (lock stealing, update-order lock, supersede-vs-writer) stays pinned deterministically in the unit layer (concurrency.test.ts, lock*.test.ts, scenarios-consistency.test.ts) — nondeterministic host interleavings cannot be characterized without becoming flake factories.

Known residual gaps (deliberate)

  • memory_consolidate's propose path needs replayed recorded reads to produce a plan; that logic is unit-pinned. The e2e pins the read-only, writes-nothing, honest-none contract.
  • Zod arg-shape rejection for plugin tools lives at the unit schema layer; the e2e drives in-tool verdicts (host would surface arg-schema failure as an error event, which every scenario asserts absent).

Host findings captured

  • POST /api/session/:id/compact accepts {}/{delivery}; id must be a msg_* anchor — a UUID 400s with Expected a string starting with "msg_".
  • Scripted turns execute all steps before the test regains control: mid-turn invariants (decay dry-run purity) must be asserted between turns.

Gates

tsc clean · biome exit 0 · unit 842 pass / 12 skip / 0 fail · e2e 30 pass / 0 fail (8 files, 28.7s).

…r routes, and the compaction hook (#241)

- e2e/characterization.test.ts: real-host scenarios pinning the current
  host-facing contract of memory_update, memory_undo, memory_export,
  memory_import, memory_decay, memory_consolidate, memory_merge_review,
  memory_evidence and memory_init - including the fail-closed paths
  (ambiguous and unmatched selectors, empty-reason and ghost-survivor merge
  reviews, export containment rejects, missing and header-vouch-less
  imports, impossible evidence dates) and a final-store row audit in every
  scenario. One scenario races two real hosts against one shared store and
  pins atomic appends plus lock cleanup.
- e2e/viewer.test.ts: the real viewer server over raw HTTP against an
  isolated store - page, /api/data, edit/delete/block/unblock/restore-entry,
  schema and audit-reason rejections, the 404 route, and the
  rebinding-Host, cross-origin and content-type guards.
- e2e/compaction.test.ts: session.compaction over the service host proves
  the durable-memory anchor rides into the summarizer request - the README
  claim now has a receipt.
- e2e/coverage.test.ts: mechanical gate - every registered tool must have a
  scripted call and every registered event hook an @covers-tagged scenario;
  tags cannot rot, and MEMORY_TOOLS is pinned to the registration set.
- harness: MEMORY_TOOLS was missing memory_update (14 tools are registered).
@abogartz
abogartz merged commit 054815a into main Nov 1, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.15.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@abogartz
abogartz deleted the test/e2e-241-characterization branch November 19, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E covers 5 of 14 tools on a real host: characterization matrix for the nine untested tools and viewer routes

1 participant