Update draft version rules in place
Autosave-style mutation of an in-flight draft version. expected_revision must match the current draft_revision; a successful write increments it atomically. Replaces the rules JSONB on the existing draft row — does NOT create a new version and does NOT write an audit entry. Returns 409 with STALE_DRAFT_REVISION and the current candidate after a conflicting write, or if the target version is not a draft; returns 404 if the version does not exist for the caller’s tenant.
Two callers are admitted, on different grounds: the draft’s own author, and an authoring-capability principal whose capability names this exact version id (the draft shell minted when the capability was issued). Everyone else receives 403 FORBIDDEN_NOT_AUTHOR.
Bounded write (MCP-034): the server abandons this write if any one lock wait exceeds 2000 ms, or if it is not ready to commit 4000 ms after the server began handling the request. An abandoned write is rolled back — nothing is written — and answered 503 AUTHORING_WRITE_CONTENDED with details.committed: false and a Retry-After header. That answer is a definite non-commit, safe to retry; it is distinct from a lost response or any other 5xx, whose outcome is unknown. The bound is counted from when THIS SERVER began handling the request, which a client cannot observe, and nothing bounds how late a request reaches the server: a client whose request timed out cannot conclude from any wait that it did not commit.
Authorizations
MeshQu API key passed as a bearer token: Authorization: Bearer mqu_…. Mint one in the console (Settings → API keys).
Tenant UUID for multi-tenant isolation. Required on all authenticated routes — validated before authentication (middleware/tenant.ts), so a missing or non-UUID header returns 400 (MISSING_TENANT_ID / INVALID_TENANT_ID) before the API key is checked.
Body
Response
Default Response
x >= 0SHA-256 hex of projectActiveRules(rules) — the same projection and hash the review-submission seal's active_rules_hash and the ratification receipt's policy_rules_hash use. Compare against a sealed subject's active_rules_hash to tell whether the ACTIVE RULES' EVALUATED CONTENT (code/condition/severity/when, in stored order) is unchanged since that seal — not whether the rule objects as a whole (name, description, source_ref, an added inactive rule) are unchanged.
^[0-9a-f]{64}$Lifecycle status: draft → submitted → ratified → (activated, then) superseded (or back to draft on reject); discarded = soft-discarded draft (PWB-039). A pending version that ends without governing is closed: reopened (a ratified version whose content continues as a new draft), set_aside (put aside with a reason), replaced (a draft whose correction continues as a new draft) — PAL-004/005.
draft Present only on a version created by draft supersession: the id of the replaced draft this version continues. Written when the version is created and never changed. Absent on every other version, including one started after a set-aside or a reopen.
What the codification that produced this version accounted for. Unsigned and unhashed; NOT a sealed review package.