Skip to content

Agent capabilities

Capabilities are checked at the workflow boundary. A node declares one required capability; the caller supplies a set in x-novelgraph-capabilities. The harness filters ready nodes, checks begin, complete, and fail, and records denied access as an error. Capabilities are permissions, not evidence that a proposed result is canon.

The registry is the AgentCapabilitySchema enum in packages/core/src/studio/domain.ts.

CapabilityBoundary
researchGeneral research node
writeGeneral drafting, validation, audit, reader, and revision nodes
canonGeneral outline, scene-plan, and graph-update nodes
publishGeneral approval node
story:readRead story state needed by validation or prose analysis
reader-view:readRead the chapter-bounded reader projection
solution:readRead sealed mystery solution data and solution-authorized artifacts
solution:writeWrite the sealed mystery solution
research:webUse the research-source boundary in a mystery workflow
draft:writeWrite a mystery draft from the reader-visible projection
canon:proposePropose policy, canon, or revision changes; it does not approve them
approval:requestRequest an approval record
publish:exportComplete the mystery closure/export node
discovery:readRead discovery session state
discovery:writeWrite discovery turns or observations
scratchpad:readRead run scratchpad entries
scratchpad:writeAdd run scratchpad entries
literary:readRead cited literary guidance
series:readRead linked series knowledge
book:readRead approved book knowledge
charter:proposePropose a Story Charter

The broader research, write, canon, and publish values remain in the general workflow for compatibility. The narrower values are used by discovery and the Fair-Play Detective workflow.

DiscoveryEngine.dossier() exposes these role-specific sets:

RoleGranted capabilitiesExplicitly not granted
sol-orchestratorDiscovery read/write, scratchpad read, literary/series/book read, charter and canon proposal, approval requestsolution:read, solution:write, publish:export unless separately supplied to a job
terra-specialistDiscovery read, scratchpad read/write, literary/series/book read, charter proposalDiscovery write and canon approval
luna-workerDiscovery read, scratchpad read/write, literary/book readSeries read, charter proposal, canon proposal, approval request

The role name does not bypass the header or the harness. The caller must still provide the capability required by the node.

The current MYSTERY_WORKFLOW assigns capabilities in this order:

NodesRequired capabilityArtifact visibility
Policy setupcanon:proposeAuthor-only
Researchresearch:webAuthor-only
Solution architectsolution:writeSolution-authorized
Evidence and timeline/accesssolution:readSolution-authorized
Solution approvalapproval:requestAuthor-only
Scene planreader-view:readReader-visible
Draftdraft:writeReader-visible
Deterministic validationstory:readAuthor-only
Adversarial solverreader-view:readAuthor-only
Fairness auditsolution:readAuthor-only
Realism auditresearch:webAuthor-only
Reader panelreader-view:readAuthor-only
Prose analysisstory:readAuthor-only
Mystery revisioncanon:proposeAuthor-only
Re-auditsolution:readAuthor-only
Closure approvalpublish:exportAuthor-only

Artifact reads are separate from node execution. reader-visible can be read with reader-view:read, story:read, or solution:read; solution-authorized requires solution:read; author-only artifacts are not returned to agent nodes by WorkflowHarness.readArtifacts().

A worker asks what it can run:

Terminal window
curl http://127.0.0.1:4567/api/v1/jobs/<job-id>/ready \
-H 'x-novelgraph-capabilities: reader-view:read'

The same header is required to begin or complete the returned node:

Terminal window
curl -X POST http://127.0.0.1:4567/api/v1/jobs/<job-id>/nodes/<node-id>/begin \
-H 'content-type: application/json' \
-H 'x-novelgraph-capabilities: reader-view:read' \
-d '{"input":{}}'

An absent header, an unknown capability, or a capability that does not match the node produces a request error such as Capability denied: solution:read. A cancelled job rejects further node work. A completed job cannot be driven as running work. A budget overrun is rejected inside the transaction.

The solution routes use a separate singular header, x-novelgraph-capability, and require exactly solution:read for GET or solution:write for PUT. Write permission does not imply read permission. Ordinary book, graph, workbench, and reader-projection routes must not expose the sealed solution.

Open the rendered agent-boundaries diagram · Read the canonical Mermaid source

Accessible equivalent: the author supplies intent; Sol coordinates; Terra performs bounded specialist analysis; Luna performs bounded extraction and scratchpad work; the dossier carries selected context; an approval decision is required before material enters approved canon. The run scratchpad is not canon, and a reader projection is not sealed solution data.