DUNIN7 · LOOMWORKS · RECORD
record.dunin7.com
Status Current
Path phases/phase-20-frontend-test-framework/e2e-test-isolation-fix-v0_1.md

E2E test isolation fix — v0.1

Version. 0.1 Date. 2026-04-27 Status. Standalone fix. Execute before or alongside Phase 21 frontend steps. Problem. Test data leaked into the Loomworks engagement's real Memory.


What happened

The Phase 20 contribution E2E test (Section 6.2 of CR-2026-034 v0.1) commits a test assertion to the live Loomworks engagement. The CR's §6.2 cleanup instruction said: "retract the test assertion (or leave it — it becomes part of the engagement's Memory)." CC followed the permissive path. A test assertion — "Phase 20 E2E test assertion — 1777332825502," contributed by "Contrib Persona 1777332822818" — is now assertion #13 in the Loomworks engagement's committed Memory.

This is test residue in production data. It must be removed and the "or leave it" path must be closed.


Root cause

The Phase 20 CR treated the Loomworks engagement as disposable test data. It is not. The Loomworks engagement is DUNIN7's live engagement with real contributed knowledge (founding assertions #1–#5, contribution guidance #6–#12). E2E tests that mutate state against a real engagement must clean up after themselves. "Leave it" is never acceptable for committed assertions in a real engagement.


Fix — two parts

Part 1 — Clean up existing test residue

Remove assertion #13 from the Loomworks engagement's committed Memory. The substrate supports retraction — retract the assertion with rationale "E2E test residue cleanup."

Steps (CC executes against the substrate API):

  1. Identify the assertion by display number #13 in the Loomworks engagement (engagement ID 00000000-0000-0000-0000-000000000002).
  2. Retract it via the retraction endpoint with rationale: "E2E test residue — Phase 20 contribution E2E committed a test assertion to the live engagement. Retracted as cleanup."
  3. Verify: the Loomworks engagement's committed Memory shows 12 non-retracted assertions (#1–#12). Assertion #13 appears as retracted.

Note on display numbers. Retraction does not reclaim display number #13. Display numbers are permanent. The next real assertion committed will be #14. This is correct behavior — display numbers are identifiers, not sequence positions.

Part 2 — Fix the E2E contribution test to clean up after itself

Modify the contribution E2E test (tests/e2e/contribution.spec.ts) so that it retracts the test assertion after the test verifies the commit worked. The test flow becomes:

  1. Contribute text → see held assertion.
  2. Commit → see committed assertion with display number.
  3. Retract the committed assertion → verify retraction appears.
  4. Test ends with no residue in the engagement's Memory.

The retraction step also serves as an implicit test of the retraction flow.

The "or leave it" language from Phase 20 CR §6.2 is retired. Any E2E test that commits an assertion to a real engagement must retract it in the same test. This applies to all future E2E tests that modify state in real engagements.


Standing rule for future E2E tests

E2E tests that create, commit, or modify data in the Loomworks engagement (or any real engagement) must clean up after themselves within the test. Cleanup means reverting the mutation — retracting committed assertions, discarding held assertions, etc. If a test cannot clean up (because the substrate operation is not reversible), the test must use a dedicated test engagement created in the test setup and torn down afterward.

"Or leave it" is never acceptable for mutations against real engagement data.


DUNIN7 — Done In Seven LLC — Miami, Florida E2E test isolation fix — v0.1 — 2026-04-27