docs(pilot): Phase 9 handoff + migration spec update

Marks open items #1 (NoTemplateDialog narrow-lane) and #3 (Tabbed
Script Builder) as resolved. Records the applied_at semantics
correction as shipped. Final Phase 9 row added to the 'What shipped'
table.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 06:14:41 -04:00
parent faf1d8dd12
commit 65a831bf9a
2 changed files with 44 additions and 42 deletions

View File

@@ -2,8 +2,8 @@
> **Target:** Transform `/assistant` (ResolutionAssist) into the new unified `/pilot` (FlowPilot) surface.
> **Audience:** Claude Code (implementation) and Codex (review) reviewed by Michael (owner).
> **Status:** Phases 08 implemented. Phase 8 replaced the task-lane `SuggestedFix` card CTA with a chat-composer-anchored `ProposalBanner`, added six columns to `session_suggested_fixes` (`status`, `applied_at`, `verified_at`, `partial_notes`, `failure_reason`, `ai_outcome_proposal`), `PATCH /api/v1/ai-sessions/{session_id}/suggested-fixes/{fix_id}/outcome` endpoint, `[FIX_OUTCOME]` marker, and `EscalateInterceptDialog`. `tsc -b` and `npm run build` both clean.
> **Last updated:** April 23, 2026 (Phase 8Fix Outcome Banner — committed; handoff and migration spec updated)
> **Status:** Phases 09 implemented. Phase 9 shipped the tabbed Script Builder integration (chat-region tab strip, `ScriptBuilderTab` in ephemeral mode, `InlineNoTemplateDialog` chat-region relocation, `PATCH /script` endpoint, `origin`/`parent_pilot_session_id` migration, `applied_at` semantics correction, and `EscalateInterceptDialog` fourth "partial attempt" choice). `tsc -b` and `npm run build` both clean.
> **Last updated:** April 24, 2026 (Phase 9Tabbed Script Builder — committed; handoff and migration spec updated)
---
@@ -914,6 +914,31 @@ git commit -m "feat(pilot): visual polish, empty/loading states, keyboard shortc
git commit -m "feat(pilot): Phase 8 — fix outcome banner replaces task-lane SuggestedFix CTA"
```
### Phase 9 — Tabbed Script Builder
**Spec:** [phase-9-script-builder-tab.md](phase-9-script-builder-tab.md)
**Implementation plan:** [phase-9-implementation-plan.md](phase-9-implementation-plan.md)
**What this phase does:** Resolves open items #1 (NoTemplateDialog narrow-lane bug) and #3 (Tabbed Script Builder) from the Phase 6/7 backlog. The chat region gains a `[Chat] [Script Builder ●]` tab strip (`ChatTabStrip` + `ScriptBuilderTab`) that embeds `ScriptBuilderChat` in ephemeral mode — the generated script is returned to the caller and written back to `session_suggested_fixes.ai_drafted_script` via a new endpoint, which then unlocks the three-option dialog. Tabs use `display: none` toggling so chat scroll position, draft message, and history are fully preserved. `InlineNoTemplateDialog` is relocated from the task-lane `bottomSlot` into a dedicated chat-region placement wrapper, eliminating the narrow-lane viewport-breakpoint collision that made the three-option grid unusable.
**Key backend additions:**
- `PATCH /api/v1/ai-sessions/{session_id}/suggested-fixes/{fix_id}/script` — writes `ai_drafted_script` + `ai_drafted_parameters` back to the fix record
- Alembic migration: `origin VARCHAR(20) NOT NULL DEFAULT 'standalone'` and `parent_pilot_session_id UUID NULL REFERENCES ai_sessions(id) ON DELETE SET NULL` added to `script_builder_sessions`; partial unique index `uq_script_builder_sessions_active_inline` prevents duplicate active inline sessions per pilot session
- `applied_at` semantics corrected: the field now stamps only when an action declares that the fix was run (e.g. `status='verified'` or `status='failed'`), not on the initial "Apply" click
**Key frontend additions:**
- `ChatTabStrip` — tab strip rendered in the chat column header when an inline script session is active
- `ScriptBuilderTab` — wraps `ScriptBuilderChat` in ephemeral mode; calls the `/script` PATCH endpoint on completion
- `InlineNoTemplateDialog` — chat-region placement wrapper replacing the previous task-lane `bottomSlot` rendering
- `EscalateInterceptDialog` gains a fourth "partial attempt" choice (escalating mid-fix with partial notes)
**Commit range:** `5bcb7aa` (Phase 9 Task 1 start) through `faf1d8d`
```
git commit -m "feat(pilot): Phase 9 — tabbed Script Builder + InlineNoTemplateDialog relocation"
```
---
## 10. Design system reference