Skip to content

test(e2e): data-integrity tier - concurrency, traversal, no-op#221

Merged
vreshch merged 1 commit into
masterfrom
feature/e2e-integrity
Jul 6, 2026
Merged

test(e2e): data-integrity tier - concurrency, traversal, no-op#221
vreshch merged 1 commit into
masterfrom
feature/e2e-integrity

Conversation

@vreshch

@vreshch vreshch commented Jul 6, 2026

Copy link
Copy Markdown
Member

What

Adds e2e/integrity.test.ts (@p0, fully offline): a data-integrity tier that proves store guarantees the docs claim but no existing tier verifies. 7 tests, ~6s locally.

Why

The single-writer serialization guarantee, path-traversal rejection, and no-op idempotence were asserted in docs but unproven end-to-end. Each test fails if the behavior regresses.

Tests

  1. 10 concurrent writes serialize into 10 clean commits - starts a managed daemon on an ephemeral port, fires 10 parallel memory write to distinct paths; asserts all exit 0, all readable, exactly 10 commits, clean working tree, no index.lock, git fsck clean.
  2. 5 concurrent writes to one path stay consistent - 5 parallel writes to the same path; final content is exactly one of the 5 bodies (no torn blend), 5 commits, clean tree, fsck clean.
  3. Path traversal + absolute paths refused - ../escape.md, @<vault>/../escape.md, and an absolute path are all rejected with a canonical invalid path error; the escaped file is never created.
  4. No-op write adds no commit - writing identical content twice: second write exits 0, mints no new commit, and the reported rev equals current HEAD (regression guard for the byte-identical write path).
  5. stdin body round-trips - echo body | memory write ... --body - writes and reads back.
  6. Offline update check degrades gracefully - endpoint pointed at an unresolvable host; update --check exits 0 with a calm verdict, no hang (hard timeout), no stack trace. Behavior-based so it survives the in-flight update-check rework.
  7. vault remove is non-destructive - files, .git, and full commit history stay on disk; only the registry entry is removed.

Notes

  • Follows existing harness patterns (createCliMachine, freePort, isolated AGENTAGE_CONFIG_DIR, ephemeral ports, NO_COLOR). Local-only helpers live in the spec; helpers.ts untouched (sibling PRs in flight).
  • Concurrency + serialization are exercised through the managed daemon (single shared engine); traversal/no-op/stdin/remove use the in-process engine with egress blackholed.
  • Verified: spec 3x consecutively clean; full offline e2e set green together (no interference); npm run verify green.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: 47369f3ed5a95011451d2f10a68ef399fc4f47e8
Branch: feature/e2e-integrity

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-07-06T09:17:32.345Z

@vreshch vreshch marked this pull request as ready for review July 6, 2026 09:18
@vreshch vreshch merged commit c5703a1 into master Jul 6, 2026
2 checks passed
@vreshch vreshch deleted the feature/e2e-integrity branch July 6, 2026 09:28
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