Skip to content

test: cover plan resolution and lifecycle recovery - #74

Closed
jefft72 wants to merge 2 commits into
stack/native-plan-11-profile-contextfrom
stack/native-plan-12-resolution-lifecycle-tests
Closed

jefft72 wants to merge 2 commits into
stack/native-plan-11-profile-contextfrom
stack/native-plan-12-resolution-lifecycle-tests

Conversation

@jefft72

@jefft72 jefft72 commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds focused regression coverage for the complete native-plan resolution lifecycle without changing production behavior in this stack entry.
The new suites exercise durable implement, keep-planning, discard, retry, cancellation, admission, startup, rebind, navigation, and transcript-restoration paths against the interactive-mode contracts introduced earlier in the stack.

Reasoning

Plan resolution crosses persisted session state, runtime routing, prompt preflight, editor admission, and transcript rendering.
A race or stale reference at any one of those boundaries can lose an accepted continuation, submit it twice, resolve the wrong session after a rebind, hide a pending plan, or send startup input before the user has decided what to do.

The tests lock down both event ordering and the user-visible recovery messages around those boundaries.
They also distinguish expected cancellation from implementation failure and verify that durable state remains the source of truth when the interactive session is restored, compacted, navigated, or rebound.

Changes

  • Verifies that Implement persists the selected resolution and submits the returned continuation through the runtime with the interactive source, profile-selection resolver, and prompt-preflight callback.
  • Covers Keep planning, selector dismissal, Discard, selector invalidation, and automatic-reopen suppression, including explicit reopening and replacement plans with different identities.
  • Asserts that failed preflight, incomplete persistence, and intentional profile cancellation retain the exact accepted continuation for /plan retry while producing the correct error or non-error status.
  • Verifies that retry reads the continuation from the currently rebound session, blocks mode toggles while implementation is waiting, and never leaves the implementation loader mounted when durable acceptance itself fails.
  • Exercises pending-plan admission around active editor UI, capturing overlays, streaming preflight, and multiple queued submissions so the decision opens only after the final in-flight submission settles.
  • Covers serialized startup prompts, including early plan submission, restored pending plans, accepted continuations, queued text preservation, and explicit notices for startup images that must be reattached.
  • Verifies rebind and tree-navigation recovery notices, preservation of a harness-switch notice during an owned handoff, and the rule that a generic agent_settled event does not independently reopen the plan selector.
  • Exercises live plan_submitted rendering, persisted plan-entry replay, and recovery of a pending plan omitted from compaction-filtered transcript entries without duplicating an artifact already present.
  • Confirms that normalized plan titles and Markdown render within both 80-column and 60-column terminal widths after control-sequence removal.

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-12-resolution-lifecycle-tests branch from 5f22f49 to 222e375 Compare August 16, 2026 03:14
Verify durable acceptance, retries, selector suppression, cancellation, streaming admission, and transcript plan rendering.
Exercise startup serialization, restored continuations, session rebinds, navigation notices, and settled-event behavior.
@Pepps233
Pepps233 force-pushed the stack/native-plan-12-resolution-lifecycle-tests branch from 222e375 to aae4a3f 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.

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