Skip to content

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

Merged
lukasoppermann merged 16 commits into
mainfrom
lukasoppermann-improvement-actions-and-sync
Oct 22, 2026
Merged

lukasoppermann merged 16 commits into
mainfrom
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. Shared identity validators accept Enterprise Managed User logins containing underscores. Notes without saved author snapshots remain unattributed rather than being claimed 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 small acknowledgment; later follow-ups remain separate work. Synchronization and batch retrieval read complete collections. Local storage and Hub use one current conversation shape without legacy conversion, version negotiation, screenshots or speculative collection and history limits. 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.

lukasoppermann and others added 2 commits October 20, 2026 11:59
Keep creator note synchronization separate from review conversations and learning. Preserve append-only thread history, owner snapshots, revision guards, and deletion tombstones.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b55e539f-c9ba-4320-b39f-bf94f18c0f33
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 8 commits October 20, 2026 15:11
Paginate note-bearing collections within a 2 MiB JSON budget before loading capture payloads. Reject malformed scalars, reflect write access in note capabilities, and accept immutable owner snapshots captured before a login rename.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b55e539f-c9ba-4320-b39f-bf94f18c0f33
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
Copilot AI and others added 5 commits October 21, 2026 19:14
Remove unshipped conversation versions and collection limits. Keep complete-feed consumers aligned with the persistence contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integrate the updated persistence layer and use one current conversation contract. Remove legacy conversion, collection budgets and paginated batch retrieval while preserving identity, revision and source guards.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the persistence UUID validation and main's reviewer-profile import, then regenerate renderer assets from the combined source.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b55e539f-c9ba-4320-b39f-bf94f18c0f33
Regenerate the renderer from combined persistence and current main source after the review layout update.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b55e539f-c9ba-4320-b39f-bf94f18c0f33
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c
Base automatically changed from lukasoppermann-improvement-persistence-contracts to main October 22, 2026 14:54
lukasoppermann added a commit that referenced this pull request Oct 22, 2026
<!-- Use a conventional commit-style title, such as "fix(hub): retain
prototype history". -->

## Why

<!-- Explain the problem and why this change matters in a short,
plain-English paragraph. Link the issue when applicable. -->

Prototype authors need to retain Pick & polish requests and Copilot
answers without turning private improvement work into team review
conversations. This is the server foundation of the Pick & polish stack,
extracted from #13; local synchronization and the canvas interface
follow separately.

## What changes

<!-- Describe what becomes different for a first-time reader. Explain
necessary terms. Include accurate Mermaid diagrams when they clarify the
proposal, using before/after diagrams when helpful. Add screenshots for
meaningful UI changes. -->
<!-- Omit validation sections, checklists, and routine test/CI summaries
such as "CI is green" or "tests passed". Mention only known verification
gaps that affect the change, not disclaimers about drafting this
description. -->

Hub stores each request or agent response in a separate
`ImprovementComment` row, not in `ReviewComment`. Foreign keys connect
replies to their original request, and `ImprovementCommentReply` links
an agent response to the requests it answers. The API returns one
current `thread` shape, assembled from these records rather than stored
as a JSON conversation or lists of IDs. Synchronization validates and
saves the conversation in one transaction.

Initial uploads require a successful Build. Unpublished notes remain on
the author's device until the client verifies that their captured source
was published; later changes retain the original Build. The paired API
checks repository access, saves only the authenticated creator's notes,
and rejects stale or conflicting revisions. Notes remain outside
ordinary review interfaces, summaries, unread state, notifications,
analytics and learning. Paired comment lists must explicitly request
them.

Conversations preserve the original request, follow-ups, answers and
immutable owner snapshots without legacy conversions, version
negotiation or speculative collection limits. Creator and raw comment
feeds return complete collections; existing browser and agent readers
use that contract. Compact agent output retains its separate pagination.
Deletion clears message text and author snapshots while retaining
tombstones. The unshipped relational migration and API guide are updated
together; development databases that ran an earlier copy need a fresh
database or a deliberate rollback and reapply after preserving needed
data. Local synchronization and the canvas interface remain in #41 and
#42.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b55e539f-c9ba-4320-b39f-bf94f18c0f33
Preserve improvement runtime documentation and sample flag transport in the canonical TypeScript context while adopting the shared extension module build.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c
@lukasoppermann
lukasoppermann merged commit ca3f2c8 into main Oct 22, 2026
40 checks passed
@lukasoppermann
lukasoppermann deleted the lukasoppermann-improvement-actions-and-sync branch October 22, 2026 15:12
lukasoppermann added a commit that referenced this pull request Oct 22, 2026
<!-- Use a conventional commit-style title, such as "fix(hub): retain
prototype history". -->

## Why

<!-- Explain the problem and why this change matters in a short,
plain-English paragraph. Link the issue when applicable. -->

Prototype authors need to select improvements in the live preview and
discuss follow-ups without losing earlier requests or Copilot answers.
This is the final UI layer over #41, extracted from #13 without changing
its backend or local-storage contracts.

## What changes

<!-- Describe what becomes different for a first-time reader. Explain
necessary terms. Include accurate Mermaid diagrams when they clarify the
proposal, using before/after diagrams when helpful. Add screenshots for
meaningful UI changes. -->
<!-- Omit validation sections, checklists, and routine test/CI summaries
such as "CI is green" or "tests passed". Mention only known verification
gaps that affect the change, not disclaimers about drafting this
description. -->

Pick & polish adds element and region selection, saved pins,
conversations, human follow-ups, and explicit Fix all requests. Pins and
conversations render the complete collection without silent truncation
or legacy conversion. Shared conversation components preserve ordinary
review metadata and actions. The accepted toolbar, Controls help link,
avatars, and draft protections are included with regenerated extension
assets and the complete guide.

Starting target selection captures the source through #41's runtime API.
Saving never replaces that capture. New improvements stay local until a
matching successful Build is published; later follow-ups and deletion
retain the same Build.

Fix all uses the bundled, discoverable `/replica-pick-and-polish` skill.
Its request contains checkout and batch metadata; the skill retrieves
all captured notes and conversation history in one response. Notes
retain target metadata, not screenshots. Sessions without an available
skill use the same bundled procedure inline. Preparation errors stop
dispatch without leaving a pending batch.

The standalone Storybook prototype app is removed. Small fixtures use
the real conversation component rather than recreating selection,
storage and agent behavior. The packaged-renderer check covers one
functional flow instead of asserting colors, spacing or pixels. Human
visual review uses the screenshots below.

The retained live conversation and sidebar, captured through the
packaged renderer with a local fixture preview and simulated agent
answers:

![Pick and polish with the saved request, follow-up and two Copilot
answers](https://github.com/user-attachments/assets/4d180b40-8204-4881-b9b5-323e5a6c5ac5)

![Disabled Fix all counter inherits the light-theme label
color](https://github.com/user-attachments/assets/2a2cf769-31d1-49f7-82f4-908064817823)

![Disabled Fix all counter inherits the dark-theme label
color](https://github.com/user-attachments/assets/6d96cac9-f586-4ba2-a122-71e1e0f05498)

![Inset error messages in the Improvement sidebar, conversation, and
deletion
dialog](https://github.com/user-attachments/assets/0ad65037-064b-4d3d-998c-2ac0d03e91e1)

These screenshots use the packaged renderer in an isolated fixture. The
independent connection identity change in #40 remains outside this
stack; unavailable immutable viewer identity is reported as an
attribution error. Formal accessibility review remains deferred as
requested. Native-host rendering and deployed authenticated Build
behavior are not established by the isolated fixture checks.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b55e539f-c9ba-4320-b39f-bf94f18c0f33
Copilot-Session: 9f678139-aaa7-4c9a-90a4-2f091027b85c
Copilot-Session: 96b94d6f-ee24-4ed6-861e-c1005213ed83
Copilot-Session: 03c141fe-2f30-4317-81df-1051bac1d3ab
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.

4 participants