Skip to content

[WIP] Add LC-17 canvas protocol and presentation clarifications - #447

Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 6 commits into
mainfrom
ulugbekna/improved-invention
Draft

Ulugbek Abdullaev (ulugbekna) wants to merge 6 commits into
mainfrom
ulugbekna/improved-invention

Conversation

@ulugbekna

@ulugbekna Ulugbek Abdullaev (ulugbekna) commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Publishes the proposed LC-17 canvas protocol contract, presentation clarifications and generated-client corrections on the recorded main integration.

  • Adds canvas state, actions, commands, schemas, generated client mirrors, reducers, fixtures and release metadata.
  • Defines native-open admission correlation: discovery does not execute a canvas, admission correlates to the bounded requestId, and a provider must not perform a duplicate native open.
  • Clarifies transient credential renewal without changing provider lifecycle, canvas state, revision or incarnation, and restricts transient URLs to the documented short-lived presentation flow.
  • Adds strictly revisioned canvas/iconChanged presentation metadata. icon: null removes the icon; omission is not equivalent to removal. The action does not replace an endpoint, change incarnation or replay a canvas effect.
  • Keeps canonical TypeScript and generated .NET, Go, Kotlin, Rust and Swift client/reducer behavior aligned, including stale-revision rejection and removal of stale catalogue icons.
  • Corrects Kotlin required-null handling in both direct payload and StateAction serialization: explicit null is preserved and a missing required field is rejected. The generator produces the correction; generated output is not independently patched.

Current provenance

Canonical head: cd05c63ceb7ec951608834d8846cdf71d1288294.

Stage Commit
LC-17 baseline 569a2867d325f1101939e0027a53c23f00203d36
Initial admission/credential clarification b5d7170f5fe1d4c9e8b1c71a4c94dc44feba00fd
Initial publication merge 86b08fe855d81601787b9dfaa1a710110081ebc8
Subsequent main integration fb6bfdd1dfef0944c2689e3d14593dd33422976a
Icon contract and generated client/reducer parity 9683981a7cf5ceccb8424f928e2f5e806a88788a
Direct and union Kotlin required-null correction cd05c63ceb7ec951608834d8846cdf71d1288294

The initial publication merge combined main d1a2b199cdb493e914165322a925c1a5f0113616 with the initial qualified clarification commit. At that stage, the only tree difference from the clarification was the already-merged Hono 4.13.7 dependency update in plugins/copilot-plugin/mcp-server/package-lock.json. That statement describes the initial merge only, not the later corrections listed above.

The byte-identical ulugbekna/scaling-couscous clarification copy had no distinct contribution and was neither edited nor published. A separate publication session was necessary because the original app-stored base was a fork-only ref; the normal main merge preserved that earlier work instead of rewriting it.

The earlier #443 remains a separate draft at its recorded 40b27012d3d6ea1705ff182e8c95ad643dc02b4e head on ulugbekna/agent-host-protocol:ulugbekna/local-canvas-protocol. This PR does not alter that reference implementation or manufacture its fork-only branch in this repository.

Validation

At the current canonical head, CI run 34712357768 passes all seven executable jobs: check, TypeScript, .NET, Go, Kotlin, Rust and Swift. The CLA check also passes. The separate VS Code PR Check is a collaborator-approval policy gate, not an unfinished test run.

Coverage includes canonical reducers and cross-language fixture dispatch, generated mirrors, icon replacement/removal and stale revisions, required-null round trips, and Kotlin direct-payload and StateAction serializers. VS Code's consumer imports this exact canonical cd05c63c revision through microsoft/vscode#335951 rather than maintaining an independent protocol patch.

The initial publication's local validation is historical: generation was clean, change-fragment/generated checks passed, and the downstream command passed 482 tests with full reducer branch coverage, while the original top-level test command stopped at the then-missing 0.10.0 changelog gate. The later parity correction adds an explicit 0.10.0 — Unreleased heading, and the current executable CI results above supersede that earlier pending validation status. Earlier failures are not relabeled as passes.

Scope limits

This remains a proposed protocol contract, not a published protocol release or approval to merge. The 0.10.0 changelog entry is explicitly unreleased. Runtime/SDK implementation, consumer qualification and production enablement are separate responsibilities; the later runtime correction's ongoing qualification is not implied by this protocol CI result. No native Office integration or new execution authority is conferred by the contract.

Introduces a versioned, renderer-neutral `ahp-canvas:` channel for local
extension/package-rendered canvas surfaces, promoting the VS Code PoC
transport into the canonical AHP contract.

- Stable identity: CanvasIdentityKey (chat, source, canvasType, instanceId)
  plus a host-assigned, opaque `incarnation` token that is never reused for
  a superseded logical instance; CanvasPackageSource carries a dedicated
  `sourceId` distinct from display-only `packageName`/`version`.
- Lifecycle state: CanvasTrustState (trusted/pending/blocked) and
  CanvasAvailabilityState (unsupported/notLoaded/loading/empty/ready/failed)
  are independent axes; SessionState.canvases is durable membership,
  distinct from the new read-only listCanvasTypes discovery catalogue.
- Commands: listCanvasTypes (read-only type discovery), openCanvas
  (requestId-scoped idempotency; a new requestId for an already-open
  identity may re-invoke the provider without creating a second identity),
  resolveCanvasSource (read-only current-state/live-URL read, never
  opens/resumes/restarts), invokeCanvasAction (required incarnation
  precondition, no exactly-once-across-crash promise), restartCanvasProvider
  (the only operation that bumps incarnation), and closeCanvas (required
  revision precondition; logical close, distinct from hiding a tab).
- Capability: new server/runtime-side CanvasCapabilities /
  InitializeResult.canvases, independent of the existing client-side
  ClientCapabilities.canvases and of protocol-version negotiation alone.
- Bounds: declared, enforceable size/depth limits (request id length,
  identity field length, schema property/depth, declared-action count,
  input/result length) plus an isCanvasSchemaWithinLimits helper.
- canvasReducer and sessionReducer's session/canvasSet consistently reject
  stale-revision actions rather than special-casing incarnation.

Bumps PROTOCOL_VERSION to 0.10.0 and regenerates all client mirrors (Rust,
Kotlin, Swift, Go, .NET, TypeScript), JSON schemas, and docs via
`npm run generate`. Adds reducer fixtures and boundary tests for the new
channel; CHANGELOG.md heading and fragment collapse remain a release-time
step per RELEASING.md, not part of this change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build on the pinned LC-17 snapshot without changing wire shapes or versions. Clarify correlated native-open publication and transient presentation credential renewal, add focused conformance cases, and regenerate derived documentation.

Normalize the affected canonical guards and inherited canvas EOF whitespace for consumer hygiene without changing execution behavior. The existing protocol 0.10.0 changelog-heading gate remains a draft blocker.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant