feat(canvas): persist improvement actions and synchronization by lukasoppermann · Pull Request #41 · github/replica · GitHub
Skip to content

feat(canvas): persist improvement actions and synchronization - #41

Open
lukasoppermann wants to merge 6 commits into
lukasoppermann-improvement-persistence-contractsfrom
lukasoppermann-improvement-actions-and-sync
Open

lukasoppermann wants to merge 6 commits into
lukasoppermann-improvement-persistence-contractsfrom
lukasoppermann-improvement-actions-and-sync

Conversation

@lukasoppermann

@lukasoppermann lukasoppermann commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

Pick & polish needs to retain authors' requests across canvas reloads and pass only explicitly selected work to Copilot. This is the second extraction from #13, built on the Hub persistence contracts in #39.

What changes

The extension stores notes in private local files, preserves conversation history and saved author identity, and synchronizes revisions with Hub without registering or publishing a prototype. Guarded HTTP and canvas actions reject stale checkout, account and note state. Explicit legacy ownership claims retain an audit rather than attributing older notes automatically.

Clients capture the local source before selecting a target. New notes stay local until a successful published Build matches that exact source and was published after the note was saved. Capture failures and older notes without provenance remain usable locally, with an explicit synchronization limitation. The client saves the chosen Build before its first upload, so an uncertain result or restart cannot bind another Build; follow-ups, status changes and deletion retain it.

Explicit fix requests save immutable batches before handing work to Copilot. Results update only captured requests still awaiting answers and return a bounded acknowledgment; later follow-ups remain separate work. Existing format-2 stores, version-1 threads and older Hub capability limits remain supported. The anchor validator is generated from readable Hub source and minified with the existing Vite pipeline used by the preview bridge and Controls validator. Renderer, selection bridge and visible UI changes remain in #42; this PR does not enable a new canvas interface.

Extract the local improvement runtime, guarded actions, immutable batches and Hub synchronization from the frozen Pick & polish source. Keep renderer changes for the next layer.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved synchronization and batch-state defects can reject valid work or apply stale results.

9 open issues
What changed in this PR

Adds persistent Pick & polish requests to the canvas extension, building on Hub’s note API without introducing a new interface.

Changes:

  • Store private note threads and author snapshots across reloads.
  • Add guarded synchronization and immutable Copilot work batches.
  • Bundle shared anchor validation and add regression coverage.
File Description
hub/​script/​build-prototype-preview-bridge.mjs Bundles shared anchor validation.
hub/​docs/​prototype-canvas.md Documents persistence and handoff contracts.
hub/​app/​javascript/​utils/​review-anchor/​validate-anchor.ts Exposes the canonical anchor validator.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.test.mjs Covers protected storage and reopening.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.mjs Exposes guarded note endpoints.
.github/​extensions/​replica-prototype/​render-canvas-html/​index.test.mjs Checks explicit compatibility flags.
.github/​extensions/​replica-prototype/​render-canvas-html/​index.mjs Transports canvas feature flags.
.github/​extensions/​replica-prototype/​register-prototype-canvas/​index.test.mjs Covers batch pagination and flags.
.github/​extensions/​replica-prototype/​register-prototype-canvas/​index.mjs Registers batch and result actions.
.github/​extensions/​replica-prototype/​read-canvas-author-profile/​index.test.mjs Checks profile lookup safeguards.
.github/​extensions/​replica-prototype/​read-canvas-author-profile/​index.mjs Retrieves verified author avatars.
.github/​extensions/​replica-prototype/​improvement-notes/​index.test.mjs Covers persistence, synchronization and batches.
.github/​extensions/​replica-prototype/​improvement-notes/​index.mjs Implements the note lifecycle.
.github/​extensions/​replica-prototype/​improvement-note-thread/​index.mjs Validates threads and answer capacity.
.github/​extensions/​replica-prototype/​improvement-batch-result/​index.mjs Produces bounded, trust-labeled batch pages.
.github/​extensions/​replica-prototype/​hub-client/​index.test.mjs Covers non-registering status reads.
.github/​extensions/​replica-prototype/​hub-client/​index.mjs Adds guarded identity discovery.
.github/​extensions/​replica-prototype/​hub-client/​authorization.test.mjs Checks undiscovered-branch identity handling.
.github/​extensions/​replica-prototype/​create-canvas-context/​index.test.mjs Covers flag validation and retention.
.github/​extensions/​replica-prototype/​create-canvas-context/​index.mjs Preserves flags across checkout refreshes.

Review effort: Max

Comment thread .github/extensions/replica-prototype/create-hub-client/index.mjs
Comment thread .github/extensions/replica-prototype/improvement-note-thread/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/improvement-notes/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/improvement-notes/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/improvement-notes/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/improvement-notes/index.mjs
Comment thread .github/extensions/replica-prototype/improvement-notes/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/improvement-notes/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/register-prototype-canvas/index.mjs Outdated
lukasoppermann and others added 5 commits October 20, 2026 15:11
Reserve serialized answers, preserve unattributed originals, invalidate retried batch requests, isolate per-note sync conflicts and traverse complete paginated collections before synchronizing. Keep canonical anchor geometry and explicit URL reopen semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c
Merge the updated lower-layer contracts to resolve the reported PR base conflict and validate the runtime against bounded collection reads and historical owner snapshots.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c
Merge shipped main fixes while retaining both the protected-note persistence regression and publishing-failure regression at their shared insertion point.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture source before target selection and require a matching successful published Build. Save the initial Build before dispatching an upload and retain it for later changes. Minify the generated anchor validator through the existing Vite build.

Co-authored-by: Copilot <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.

3 participants