Skip to content

test(e2e): cover session relation lifecycle end to end - #583

Merged
wibus-wee merged 2 commits into
mainfrom
test/session-relation-lifecycle-e2e
Sep 11, 2026
Merged

test(e2e): cover session relation lifecycle end to end#583
wibus-wee merged 2 commits into
mainfrom
test/session-relation-lifecycle-e2e

Conversation

@wibus-wee

@wibus-wee wibus-wee commented Sep 10, 2026

Copy link
Copy Markdown
Member

Related issue

Refs #531

Problem / pressure

The session-relation contract fixed by #569 had action-level coverage, but no real Desktop journey proved the complete user sequence across archive, permanent deletion, independent worktrees, dangling provenance presentation, and exact cleanup before metadata hydration finishes.

Summary

  • add LODY-SESSION-004, a real Desktop journey for containment, opened-by provenance, and independent worktree lifecycle
  • verify archiving and permanently deleting A affects direct child tab T but preserves opened Sessions B/C and both worktrees
  • verify B/C retain non-navigable Deleted session provenance after A/T are gone
  • verify exact deleteSessions(T) cleanup remains available while the metadata cache is intentionally held incomplete
  • wait for blocked metadata scans and canonical routing before teardown, and make transient menu selection deterministic on macOS CI
  • update the existing lifecycle Agent Note and generated E2E coverage indexes

Visual explanation

flowchart TD
  A[Session A] -->|parentSessionId| T[Tab T]
  A -. openedBySessionId .-> B[Session B + own worktree]
  T -. openedBySessionId; root A .-> C[Session C + own worktree]
  Archive[Archive A] --> Archived[A and T archived]
  Archive --> Active[B and C active]
  Delete[Delete A permanently] --> Gone[A and T gone]
  Delete --> Alive[B and C docs and worktrees survive]
  Alive --> Provenance[Deleted session label; no Back navigation]
  Cold[Metadata hydration held incomplete] --> Exact[deleteSessions T]
  Exact --> Clean[T document removed]
Loading

Before / after

Before After
Unit/action tests covered relation target selection and side effects Desktop E2E proves the complete A/T/B/C user-visible and durable-state sequence
Cold-hydration exact cleanup was inferred from action tests Desktop E2E blocks metadata scans and proves the child document is still removed
Menu and hydration transitions could outlive Playwright actions/teardown Page objects wait on observable state, completed scans, and canonical routing

Test plan

  • pnpm --filter @lody/e2e check (16 scenarios, 16 unique IDs; typecheck and 43 harness tests passed)
  • pnpm --dir apps/electron build:app
  • assertion ablation: inverted the root archive expectation, observed deterministic failure at the archive checkpoint, then restored the file byte-for-byte
  • three consecutive affected-journey runs: LODY-ROLE-001, LODY-FORK-001, LODY-SESSION-003, and LODY-SESSION-004 all passed (4 scenarios, 33 steps per run)
  • pnpm --filter @lody/e2e full (16 scenarios, 129 steps passed)
  • pnpm run docs check (no errors)
  • changed files pass Prettier and git diff --check

Context handoff

Instructions for reviewing agents

  • Review focus: Check session-relation-lifecycle-page.ts checkpoints and fixture metadata/worktree setup against specs/session-relations.md, including the hydration barrier release.
  • Decisions to challenge: Confirm that one journey should own both the A/T/B/C transition and cold-hydration exact cleanup, and that already-satisfied menu state is a valid E2E precondition.
  • Plausible failures / evidence gaps: CI timing can synchronously unmount menu items; the revised page objects assert resulting state and the affected group passed three consecutive runs.

Authoring context

  • User goal / directives: Prove the full archive-to-delete user chain and cold-hydration exact cleanup with Desktop E2E, without adding supervised-worker product scope.
  • Constraints / non-goals: No product lifecycle semantics, tombstones, worker panels, or generic relation abstractions are changed here.
  • Risk-bearing decisions: The fixture creates B/C through real worktree forks, writes only synthetic relation metadata, and blocks full metadata scans until exact deletion is observed.
  • Destructive or irreversible behavior: Deletion is confined to isolated E2E session documents, ACP processes, and temporary worktrees; teardown verifies cleanup.
  • Deliberately not done or tested: Product behavior is unchanged; this PR covers the already-merged contract and stabilizes only the E2E interactions exercised by CI.
  • Unknowns / confidence: Confidence is high after assertion ablation, three consecutive affected-group passes, and a green 16-scenario full run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T11:58:19.595848Z 46bd08d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@wibus-wee wibus-wee added the e2e-full Run the full desktop E2E suite label Sep 11, 2026
@wibus-wee
wibus-wee force-pushed the test/session-relation-lifecycle-e2e branch from 9142774 to bd3de7f Compare September 11, 2026 10:20
@wibus-wee
wibus-wee force-pushed the test/session-relation-lifecycle-e2e branch from bd3de7f to 46bd08d Compare September 11, 2026 11:53
@wibus-wee
wibus-wee merged commit 2f11f09 into main Sep 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-full Run the full desktop E2E suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant