3.7 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-host-api | Expose scoped Host and canvas reads | done | 2 |
|
plan.md |
|
|
|
Task 02: Expose scoped Host and canvas reads
Summary
Add typed plugin Host reads and equivalent canvas browser routes for task trails and workflow route groups. Enforce grants and scope before a ledger query, then document the additive public contract.
In scope
- Extend the v1 proto, generated stubs, SDK interfaces and mappings, Plugin Host adapter, and browser JSON routing.
- Reuse
api_read:tasksfor a scoped task trail. Require both task and workflow read grants plus workspace canvas scope for route groups. - Test forbidden task/workflow IDs, task-scope summary denial, pagination, missing steps, null endpoints, and omission of actor/session identifiers.
- Update the embedded canvas authoring API reference and public plugin/canvas reference pages.
Out of scope
- Canvas layout and publication, task writes, and new permission kinds.
Acceptance
- gRPC/SDK and browser reads expose the same ordered facts and bounded groups, with no unscoped or unpublished identifier leaked through an error.
- Effective grants and current canvas scope gate every browser request; task scope can read only its own trail and cannot read route groups.
- The authoring bundle and public docs name the new routes, fields, limits, permission requirements, and workspace-promotion boundary.
Verification
make -C apps/backend proto
(cd apps/backend && go test ./internal/plugins ./pkg/pluginsdk ./internal/mcp/canvasskill)
node --test scripts/validate-public-docs.test.mjs
node scripts/validate-public-docs.mjs
Files likely touched
apps/backend/proto/kandev/plugin/v1/plugin.protoand generated Go stubsapps/backend/pkg/pluginsdk/host.goand testsapps/backend/internal/plugins/host_data.goapps/backend/internal/plugins/webapp_protocol.goapps/backend/internal/plugins/webapp_protocol_data.goand testsapps/backend/internal/mcp/canvasskill/files/references/browser-api.mddocs/public/plugins-authoring.mddocs/public/canvases.md
Dependencies
Task 01's task-service read methods.
Risks
The Host gRPC API is additive-only in protocol v1. A browser route that checks only a resource grant but misses canvas scope could expose other tasks' moves.
Parallelism
sequential
Inputs
Results
Added task-history and workflow-group RPCs to protocol v1, generated stubs, the optional SDK Host extension, the real Host adapter, and scoped canvas browser routes. Browser tests cover task-scope refusal, missing grants, foreign workflows, and workflows beyond the first list page. The bundled browser reference and public canvas/plugin guides document both routes.
Passed after the final implementation edit:
make -C apps/backend proto
(cd apps/backend && go test ./internal/plugins ./pkg/pluginsdk ./internal/mcp/canvasskill)
node --test scripts/validate-public-docs.test.mjs
node scripts/validate-public-docs.mjs