Skip to content

test: cover plan UI ownership and profile handoffs - #75

Closed
jefft72 wants to merge 2 commits into
stack/native-plan-12-resolution-lifecycle-testsfrom
stack/native-plan-13-ui-handoff-tests
Closed

jefft72 wants to merge 2 commits into
stack/native-plan-12-resolution-lifecycle-testsfrom
stack/native-plan-13-ui-handoff-tests

Conversation

@jefft72

@jefft72 jefft72 commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds virtual-terminal regression coverage for native-plan editor ownership and ambiguous implementation-profile handoffs.
The suite drives real TUI components through focus changes, overlays, delayed asynchronous completion, session rebind teardown, selector input, and narrow viewports to verify the behavior users actually see during plan acceptance.

Reasoning

Plan decisions and implementation handoffs temporarily replace the normal editor while authentication dialogs, extension selectors, overlays, runtime routing, and lifecycle rebinds can all compete for the same focus.
Token-based ownership is only safe if stale asynchronous completions cannot restore old UI, every abort path settles once, and accepted-plan input remains blocked until the continuation has synchronously acquired prompt ownership.

The profile chooser also exposes trusted descriptions, safeguards, and tool policies that may contain terminal control sequences or exceed the available viewport.
End-to-end component coverage is needed to prove that this information stays legible and safe while the selected option still maps to the correct stable profile identity.

Changes

  • Verifies that replacing an unresolved plan selector settles the old decision before a delayed editor takes ownership and does not resolve a plan against the displaced session UI.
  • Confirms that delayed login completion cannot restore over a newer selector and that closing a capturing overlay returns focus to the still-active plan selector.
  • Exercises session-rebind teardown to ensure the exclusive implementation loader survives when marked rebind-safe and restores the normal editor only when its owning token closes.
  • Renders ambiguous profile choices at 80 and 60 columns and checks the recommended marker, concise descriptions, wrapped safeguards, summarized tool policy, navigation hints, terminal height, and per-line width bounds.
  • Strips terminal sequences from profile names, descriptions, safeguard summaries, and tool identifiers before rendering any chooser consequence.
  • Verifies that truncated duplicate profile names still resolve to the selected stable profile ID instead of relying on visible text equality.
  • Covers Escape cancellation, runtime abort, owner teardown, and session-rebind invalidation, asserting single settlement and the correct restoration of either the implementation handoff or the normal editor.
  • Keeps keystrokes, slash commands, and competing selectors away from the normal editor until accepted-continuation preflight reports ownership, then permits new UI once the handoff releases focus.
  • Confirms that hook-provided before_agent_start UI can mount after synchronous prompt ownership and remains focused after the continuation starts.
  • Checks that Implement, Keep planning, and Discard all remain visible and within width in pending-plan selectors at both tested terminal sizes.

Testing

  • npm run check passed against the final rebased 14-PR stack.
  • Focused Vitest validation passed against the final rebased stack with 451 tests across 28 affected files.
  • This intermediate PR branch was not checked independently after stack reconstruction.

@jefft72
jefft72 requested review from Issacboy123 and Pepps233 and removed request for Issacboy123 August 16, 2026 00:11
@Issacboy123
Issacboy123 force-pushed the stack/native-plan-13-ui-handoff-tests branch from 7b866c2 to 43e19c0 Compare August 16, 2026 03:14
Exercise serialized editor ownership, delayed login completion, overlay focus, rebind-safe handoffs, and bounded profile rendering.
Verify cancellation restoration, duplicate profile mapping, teardown settlement, prompt locking, hook UI, and compact decision actions.
@Pepps233
Pepps233 force-pushed the stack/native-plan-13-ui-handoff-tests branch from 43e19c0 to ce1f61a Compare August 16, 2026 04:19
@jefft72

jefft72 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing to rebuild on a clean base.

This stack does not build. Two separate defects are present, and the first masks the second:

  1. A stray closing brace committed in feat: enforce native plan collaboration policy #64 stops packages/coding-agent/src/core/agent-session.ts from parsing at all.
  2. From feat: activate accepted plans in routed sessions #65 onward the stack imports five modules that exist only on the task profile stack: evolved.ts, harness-descriptors.ts, profile-router.ts, profiles.ts, and runtime-telemetry.ts.

Replacement stacks:

  • plan/* for native plan mode standing alone on main
  • plan-harness/* for the plan and profile integration

The branch behind this PR is retained unchanged as a backup.

@jefft72 jefft72 closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant