Concept · graph
A workspace (the App calls it a review) holds proposed Graph changes under a name, and nothing reaches the Graph until you submit it.
Use when
You add, change or delete several entities or relationships, or you review what an extraction found.
Looking for something else?
One change to one entity (card Entity). Text you write and edit as a document (card Document). Starting an extraction, which opens its own workspace (card Extraction).
For
A workspace is a named working set. You stage entities and relationships in it. You can change what is staged. You can check out existing entities to change or delete them. You can validate the whole set, and then you submit it. An extraction opens its own new workspace for its findings, so a person can review them before anything reaches the Graph. A workspace has one status:open, submitted, applied or closed.
Changes to the workspace raise its revision number. A submit can use that
number as its guard.
Use when
- You create several entities or relationships together.
- You change or delete existing entities, alone or together with new ones.
- An extraction finished and a person must review what it found.
- You want to stop now and continue later. Close it, and restore it by id.
Not this
- One change to one entity: use
penumbra graph update(card Entity). - Text a person reads as a document: use a document (card Document).
Rules
workspace.1A workspace name stands for one working set. Open the same name again to continue an open workspace. An applied workspace opens again with its staged items cleared and the entities it created checked out for update. Enforced: opening the name of a closed workspace is refused withworkspace_closed, which namesworkspace_restoreand the id. Your job: use a new name for new work, and restore a closed workspace by its id.workspace.2Staging changes the workspace only. Capture, modify and check out leave the Graph as it was. Your job: do not tell the person that a change is saved until a submit returnsapplied.workspace.3Validate before you submit.penumbra graph workspace validateapplies nothing and lists diagnostics. Enforced: a submit checks the workspace again, and any error diagnostic gives the outcomerejectedwith nothing applied. A warning, such asduplicate_name, does not stop a submit.workspace.4Submit the revision you reviewed. Pass it topenumbra graph workspace submitas--revision. Enforced when you ask: a different current revision is refused withworkspace_review_conflictand nothing is applied. Without--revision, nothing checks which revision applies.workspace.5A submit can commit in up to three phases. The phases are changes to existing entities and relationships, new entities and relationships, and relationships from new entities to existing ones. Each phase is one commit, but the workspace is not. The outcome isapplied,partial,rejectedorunknown. A workspace read showsunknownassubmission: unresolved. Your job: do not assume all or nothing. When a Shape in the project has rules, the whole submit runs as one transaction instead, and a failure keeps nothing from it.workspace.6Never readpartialorunknownas a rollback.rejectedmeans nothing was applied. Your job: resume the same workspace with the same credential that submitted it, as problem submit-partly-applied says. Another credential cannot resume it, and the workspace read shows no resume line to it.workspace.7A workspace has size limits. Enforced: a workspace holds at most 1,000 staged items (workspace_full). One submit creates at most 1,000 entities and relationships (create_plan_too_large). One submit changes at most 100 existing entities and relationships (lifecycle_plan_too_large). One submit adds at most 100 relationships from new entities to existing ones (link_plan_too_large). Validate and submit both refuse an excess, and the workspace stays open.workspace.8To change or delete an existing entity, check it out first withpenumbra graph workspace hydrate. Use--intent deleteto delete it. Enforced: if the entity changed after you checked it out, validate and submit reportwitness_stalefor that item and apply nothing. Checking out an entity that is already checked out does not refresh it. Usepenumbra graph workspace refresh(rule workspace.13).workspace.9Only an open workspace takes new staged work. Enforced: a workspace that isclosed,appliedorsubmittedrefuses staging withworkspace_not_open. Restore aclosedone, open anappliedone by name, or resume the submission if it issubmitted.workspace.10A submit from an API key or a connected agent waits for approval under the default policy. Enforced: the result ispendingwith an approval URL. Rules approval.1 and approval.3 say what to do.workspace.11Closing sets a workspace aside. The App calls this discarding a review. Enforced:penumbra graph workspace closecloses only an open workspace, and any other status is refused withworkspace_not_open. Nothing reaches the Graph, and no staged item is deleted. Your job: tell the person that nothing was added. Restore brings the workspace back with its items (rule workspace.12), so use a new name to start clean.workspace.12Restore brings a closed workspace back by its id. Enforced:penumbra graph workspace restorerefuses a workspace that is not closed withworkspace_not_closed. Extracted entities are compared with the Graph again, so one that matches an entity added since updates that entity and makes no duplicate. An entity or relationship you pulled in that changed or was removed while the workspace was closed carries a flag. So does an item written under a Shape that has a newer version. Nothing refreshes on its own, and a submit still refuses a changed entity withwitness_stale. Your job: read the flags before you submit, then refresh or remove each flagged item (rule workspace.13).workspace.13Refresh brings one pulled-in entity up to date. Enforced:penumbra graph workspace refresh <workspace> <handle>reads the entity again at its current revision. Your change stays only on fields that did not change since you read the entity. A field that changed loses your change and is named in arefresh_conflictflag, and you set it again withpenumbra graph workspace modify. An item that extraction linked to an entity is compared with the Graph again. An entity that was removed is refused withrefresh_unavailable. Your job: read the conflict flag before you submit.
Failure signs
- A submit is refused with
workspace_review_conflict: problem workspace-changed-since-you-read. - A submit exits with code 4 and an approval URL: problem change-waits-for-approval.
- A submit ends with outcome
partialorunknown: problem submit-partly-applied. - A command ended with no reply, or with
outcome: unknown: problem reply-lost. - A write is refused with
graph_write_busy: problem graph-busy.
Doors
The default catalog has no call that closes or restores a workspace. Use the CLI,
the SDK or the full catalog.
The CLI word
The CLI calls an entity a node in its workspace output.HTTP reference
- List review workspaces
- Open review workspace
- Get review workspace
- Stage records
- Stage existing records
- Edit staged records
- Validate review workspace
- Submit review workspace
- Close review workspace
- Restore review workspace
- List workspace extractions
- Stop workspace extraction