Repository navigation
docs(plan): define Studio chat approvals and exact plan control - #1888
Conversation
9c2dc42 to
870c40b
Compare
Directing-human-authorized amendment from plan PR #1888 commit 0ed45ac. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Plan and ADR review: #1888A dedicated, identity-bound Needs changes
Nits
|
Address the #1888 and #1909 review with a run-start opt-in and a correlated continuation-start failure event. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Signed-off-by: Samuele Verzi <[email protected]> Co-Authored-By: Codex <[email protected]>
Record the directing-human-approved public call ID projection and safe unanchored fallback after AC1.1 contract drift. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Address the #1888 and #1909 review with a run-start opt-in and a correlated continuation-start failure event. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Keep daemon failed_precondition at HTTP 412 and let Studio map it to the product 409 response. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Keep known start failures durable under a held session lease. After ownership loss, the former daemon leaves the outcome uncertain and publishes no unrecorded failure. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Use ADR 0366 and allocate PermissionAsk.call_id and Event.plan_continuation_failure after existing protocol fields. Signed-off-by: Samuele Verzi <[email protected]> Co-Authored-By: Codex <[email protected]>
4025bec to
740e23e
Compare
Directing-human-authorized amendment from plan PR #1888 commit 0ed45ac. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Mirror the authorized #1888 review amendment on the implementation stack and align the plan index. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Directing-human-authorized amendment from plan PR #1888 commit 0ed45ac. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Mirror the authorized #1888 review amendment on the implementation stack and align the plan index. Co-Authored-By: Codex <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
peppescg
left a comment
There was a problem hiding this comment.
Approving. Both design gaps from my earlier review are resolved in ADR 0366:
- Double continuation: continuation ownership is now an explicit run-start opt-in (
server_owned_plan_continuation). mecatui and SDKquery()runs stay client-owned, and a second client can't force a competing continuation through the strict control. - Failed continuation start: it is now a durable, published, content-safe
plan.continuation_failedevent, with no append after lease loss.
The rest also checks out:
- The reservation is released exactly once on every terminal or removal path.
- ADR 0347's
Superseded by:line is updated. - 0366 is free on main.
- ADR 0366 and the ADR README are byte-identical to the copies in #1909. The plan differs only in its Status line, so whichever PR lands second gets a trivial conflict there.
One non-blocking suggestion
Decision 3 and AC2.2 give the reserved continuation priority over "a competing prompt or scheduler start". #1909 shows a third entry path: RetryFailedRun deregisters the terminal plan run without honouring the reservation (see my review there). Please word it as "any run-entry path (prompt, scheduler, failed-step retry)", so the implementation and its proofs are held to the complete set.
…mit-coauthor-guidance * origin/main: (32 commits) docs: plan optional native Kubernetes execution provider (#1579) feat(mecatui): restore session status metrics (#1891) docs(plan): bound agent inventory viewport (#1946) docs: include user-docs in matlatl and use local documentation links (#1934) feat(mecatui): bound sessions inventory (#1944) feat(studio): show session delegation activity (#1907) docs(plan): define Studio session activity (#1885) Release TypeScript SDK v0.4.0 (#1940) Release v0.0.41 (#1941) docs(mecatui): plan bounded sessions inventory (#1906) feat(studio): add exact plan control and authorization review prerequisite (#1909) test(app): eliminate real ToolHive probe deadline wait (#1937) docs(plan): define Studio chat approvals and exact plan control (#1888) test(sdk): enforce SDK/TUI high-level parity (#1471) (#1917) docs(plan): propose SDK high-level parity coverage (#1471) (#1916) docs: improve gRPC schema table readability (#1842) test(app): eliminate real waits in durable learning tests (#1933) feat(studio): align chat transcript and composer (#1886) docs(plan): define Studio chat transcript and composer (#1880) feat: correlate provider requests with the root session (#1883) ...
Tracking: #1848
Summary
This independent Plan / Interface PR defines the Architectural, Split contract for Studio's inline tool approvals, plan review, external authorization panels, and layered Escape behavior. It adds the acceptance plan and ADR 0366, and updates ADR 0347's supersession note. This PR contains no implementation.
The plan consumes #1847's transcript and composer interface, now merged through #1880 and #1886: run deliveries, transcript anchors, preview callback, and exact active-run target. #1847 owns the base transcript and composer; #1848 owns approval and review interactions within them. #1850 owns the shared side-panel frame. #1776 owns the offline Playwright harness for the browser approval journey.
Architectural decision
A session-only
Session.resolvePlan(verdict)can select a newer parked ask after a browser card goes stale. ADR 0366 addsResolvePlanAskwith the authorized session ID, expected durable run ID, exact ask ID, and explicit verdict. The daemon validates all three identities and plan origin before consuming the ask. Duplicate, stale, ordinary, and retracted asks cannot fall forward to a successor.The review identified a second risk: mecatui and SDK
query()already send their own proceed prompt after a liveplan_approvedresult. A normal prompt therefore defaults to client-owned continuation. Studio opts into server-owned continuation at run start throughPrompt.server_owned_plan_continuation = 4, its HTTP mirror, and the published SDK run option. An exact live plan verdict is refused on a run without that opt-in; an in-stream plan verdict is refused on an opted-in run. Restored awaiting asks have no live stream owner and use the server-owned exact control. The reserved proceed run takes priority over a competing prompt or scheduler start, and its reservation is released on every path.If an accepted server-owned approval reaches
StopPlanApprovedbut the proceed run cannot start while the daemon still holds the session lease, activity records and publishes one safe, session-scopedplan.continuation_failedevent (Event.plan_continuation_failure = 26) correlated to the approved plan run and ask. It carries no raw error or content and does not invent a second terminal result. If the process or session lease is lost before the event can be recorded, the former owner publishes no failure and the outcome remains uncertain. The daemon featureexact_plan_ask_controlis advertised only when the strict control, run-start opt-in, and failure projection work on both transports. Studio uses the npm-published SDK and never falls back to session-only approval.Interaction contract
PermissionAsk.call_id = 6and SDKcallIdattach an ask to a tool row only on an exact same-run match. Unmatched child and older-server asks use separate cards. This ID affects presentation only. Ordinary Allow once, Always allow, and Deny use the existing exact run-and-ask route.PresentPlantext and note. Approve & run, Auto-accept edits, and Iterate map to distinct verdicts. Missing plan text disables approval. Studio claims execution only after observing the new run; a known start failure is shown from activity.Delivery and verification
The directing human waived #1848's plan-merge gate and requested implementation stacked on #1886 above #1880; both parent PRs have since merged, so #1909 now targets main. They separately authorized the optional call-ID projection and, after the #1888/#1909 review, the direct continuation-ownership and failure-event amendment to this still-proposed plan and ADR. Further explicit identifier amendments assign ADR 0366,
PermissionAsk.call_id = 6, andEvent.plan_continuation_failure = 26after other in-flight work claimed the earlier numbers. A subsequent explicit review amendment clarifies that lease loss leaves an uncertain handoff; the former owner cannot write or publish an authoritative failure after losing ownership. The implementation remains partial in #1909; the new daemon/SDK surface must land and be published before Studio enables plan verdicts. #1885 is independent delegated-activity planning.The amended plan retains 13 acceptance criteria across five scenarios. The acceptance-plan checker,
git diff --check, andCGO_ENABLED=0 task docspassed, including the strict links and anchors. The CGO-free docs command avoids a local macOS SDK linker fault in an existing Go example test. Runtime, SDK release, Studio, browser, site, and race gates belong to the implementation candidate.user-docs/building/deployment/studio.mdowns the eventual public behavior. A human merges this PR; it does not close #1848.