Document lifecycle: states, Save vs Publish

Every systemHUB document — whether a System, Policy, or Training — moves through a defined lifecycle. An AI agent must understand this before authoring, or it will create content nobody can see, or overwrite an approved document.

Document states

A document’s state is an integer with a fixed meaning and colour:

stateColourMeaning
0GREYDraft — being written, not yet reviewed
1ORANGENeeds review — drafted, awaiting approval
2REDOverdue — past its review date
3GREENApproved — current, reviewed, live
4PURPLEArchived — retired, kept for reference

These values are returned on every tree node, search result, and get_*_details call, and are accepted by the state parameter on create/edit tools.

Save vs Publish (the distinction that matters most)

Save records your changes. Publish is what your team sees — until you publish, assigned members keep viewing the last published version.

For agents, the practical rules are:

⚠️ The practical consequence: there is no “work quietly then release” mode by default. Any write to a live document — including one that only touches metadata — is visible to the whole team immediately. Before editing an approved document, be sure the user wants the change live now.

Canonical wording: the summary line above is the current agreed phrasing; the app empty-state copy is being finalised from the internal content audit and will be reconciled here so the docs and the product never disagree.

View vs Edit

Access to a document is not all-or-nothing:

What a given person can do is a function of their role and any direct assignment on the document. See Roles & seats. An agent connected with a user’s token inherits exactly that user’s view/edit scope.

How systemHUB behaves over time (the model to reason with)

The sequence an agent should hold in its head:

You doWhat happensWhen
create_system with contentDocument saved AND published — assigned members can see itImmediately
create_system with publish: falseDocument saved as a hidden draftVisible to no one until published
edit_systemContent updated at the API layer, stored verbatimImmediately; a new published version only when you cut one
publish_systemA named version released to assigned membersImmediately
A human opens the doc in the editor and savesThe editor filters the stored HTML to its supported feature setFirst human save — this is when out-of-contract formatting silently changes

That last row is the one that surprises agents: the API stores whatever HTML you send, but the editor is the filter, applied on the next human save — which may be days later. Author within the supported set and the document is stable forever; author outside it and the document changes under the owner’s feet the first time they touch it.

Master templates

Some content is a master template — read-only reference content supplied from the master workspace (isMasterTemplate: true). It appears in trees and search so it can be browsed and copied, but it cannot be edited, moved, published, or deleted, and get_*_details returns 404 for it. Treat master templates as immutable.

Next: Roles & seats →