Skip to content

feat(doop): project binding table; refuse a second canvas for a bound project (CHE-5860) [squash] - #87

Open
congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-5860-6f689a3eb827
Open

congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-5860-6f689a3eb827

Conversation

@congvc-bot-x99

Copy link
Copy Markdown

Refs CHE-5793 (plan r9 step 13) and CHE-5860.

What

doop refuses an agent create_canvas when the Multica project already has a bound canvas.

  • New table project_bindings (migration 0043), primary key = Multica project UUID. The key makes "bind only a project with no binding" atomic.
  • REST: PUT /api/projects/:projectId/canvas {canvasId} (needs canvas edit; 409 project-bound with the bound canvasId if bound), GET same path (needs canvas view). Project id must be a UUID, lower-cased.
  • MCP create_canvas gets optional project_id:
    • a bound project is refused with project-bound, naming the bound canvas;
    • an agent key (dpk_) that can edit any bound canvas and names no project is refused with project-required;
    • an unbound project creates the canvas as before (it does not bind it; binding is the step 13a API call).
  • Deleting a canvas removes its bindings. Canvases with no binding row stay legacy: readable and writable, unchanged.
  • Not here: the Multica design project's own binding and legacy list (step 13a).

Blast Radius

Proof level: observed on a real server (spawned doop, PGlite, real /mcp with an agent key, real REST).

  • New table + migration only; no existing column touched. create_canvas behaviour changes only when project_id is passed, or for an agent key that can edit a bound canvas (none exist until step 13a binds one).
  • OAuth (non-key) MCP sessions and REST canvas creation are unchanged.
  • Rollback: revert the PR; the table can stay unused.

Test-first evidence

Test: tests/projectBinding.test.ts.

Red (before implementation), bunx vitest run tests/projectBinding.test.ts:

 ❯ tests/projectBinding.test.ts (8 tests | 5 failed)
     × lets a canvas editor bind a project once, and only a canvas editor   (expected 404 to be 403)
     × refuses a second create_canvas for a bound project ... project-bound  (expected undefined to be true)
     × refuses an agent key that can edit a bound canvas ... project-required (expected undefined to be true)
     × finds a binding by project UUID, never by canvas name
     × rejects a project id that is not a UUID                               (expected 404 to be 400)
 Tests  5 failed | 3 passed (8)

Green (after):

 Test Files  1 passed (1)
      Tests  9 passed (9)

(9th test, upper-case UUID, was added after the red run.) Also green: agentKeys, agentToolParity, reconMcp, writePolicy tests; bun run typecheck, bun run lint, bun run format:check.

Done-when still open

Merge, then doop auto-deploy read-back (health, digest, rollback by digest) after a cross-lab review (RGS-1) and non-author merge.

… project (CHE-5860)

Refs CHE-5793 step 13.
@congvc-dev congvc-dev changed the title feat(doop): project binding table; refuse a second canvas for a bound project (CHE-5860) feat(doop): project binding table; refuse a second canvas for a bound project (CHE-5860) [squash] Nov 19, 2026
@congvc-dev
congvc-dev marked this pull request as ready for review November 19, 2026 07:23
@congvc-dev
congvc-dev enabled auto-merge November 19, 2026 07:24

This branch has not been deployed

No deployments
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.

0 participants