Staff permissions: prepare, activate and recover
Staff permissions replace legacy staff authority with current database grants. Preparation records explicitly reviewed grants and immutable published owners; it does not activate them. Activation must hold all writers, replace database credentials, clear old sessions and verify the new consumers before reopening. Recovery must preserve later revocations or use the explicitly reviewed terminal revocation and trusted-root reset path. This implementation has not yet passed its complete cutover, recovery and load acceptance; use the isolated rehearsal environment until the evidence packet is complete.
To try granting and revoking a permission in a persistent local browser environment, see See staff permissions working. That demonstration is separate from the release evidence below.
Current command availability
| Command | Implemented behavior | Evidence still required |
|---|---|---|
preflight | Compares the installed target, source, host, environment, database consumers and proxy observations with the reviewed declaration. | A complete real-host rehearsal. |
prepare | Takes a complete backup, applies the reviewed additive schema, prepares explicit authority and records the dedicated probe. | Real backup, schema and identity preparation against the final candidate. |
status | Reads the independently retained operation and journal. | It deliberately reports current_safety_verified: false; a journal stage alone proves no current hold. |
apply, resume | Execute the bound preparation, credential barrier, consumer replacement and verification sequence; resume uses retained inputs. | Complete real-host cutover and interrupted-effect rehearsal. |
export-authority | Captures the encrypted authority and audit history under a continuous all-writer hold. Reopening invalidates completeness. | Real export and recovery rehearsal. |
capture-recovery-bundle | Captures a complete active-state backup with an independently retained receipt for explicit recovery selection. | Real backup/restore rehearsal. |
recover | Connects backup restoration, authority reconciliation, explicit root trust, fresh probes and reopening; bounded independent source review is complete. | Actual interrupted recovery and all three recovery lifetimes. |
Review inputs before preparation
Run the operator from its own installed checkout on the deployment host. Keep the deployment artifact and all authority reports private. Reports contain personal and authority information even though they contain no credentials.
The artifact contains three strict, versioned input documents:
staff-permissions.local.jsonidentifies the exact Compose sources, immutable baseline and target images, database consumers, proxy, maintenance service, host observations and SOPS sources. Its schema isStaffPermissionsDeploymentinscripts/permissions_deployment.py.staff-permissions.prepare.jsonbinds the separate immutable build snapshot and installed operator sources, the read-only identity-directory connection, and the dedicated probe request and actual identity receipt. Secret values stay in SOPS; this document names their keys. Its schema isPreparationDeclarationinscripts/permissions_prepare.py.staff-permissions.schema.jsonnames the reviewed additive migration transition and its exact source and installed digests. Its schema isReviewedAdditiveSchemainscripts/permissions_prepare_schema.py.
The separately reviewed grants file uses ApprovedAuthorityInput in scripts/permissions_reports.py. Every grant identifies its source, recipient, immutable role revision, anchor and exact exercise and delegation pairs. Every published-version mapping names the fixed institution and review reason. Job titles and existing registrar roles never substitute for reviewed grants.
Create the operation-owned probe identity before preparation using the explicit identity adapter in scripts/permissions_probe_identity.py. Retain its receipt and generated password privately. Preparation verifies the live identity through the declared directory connection. Its SQL probe uses the explicitly selected prepared root, issuer and dedicated subject; it never borrows or revokes a real staff member’s grant.
Run preflight and preparation
The commands below take absolute local paths. Replace the variables with the exact reviewed artifact, image ID and private report paths.
.venv/bin/python -m scripts.permissions_cutover preflight \
--artifact-dir "$artifact_directory" --target-image "$target_image_id" \
--report "$preflight_report"
.venv/bin/python -m scripts.permissions_cutover prepare \
--artifact-dir "$artifact_directory" --approved-grants "$approved_grants" \
--out "$prepared_report"
.venv/bin/python -m scripts.permissions_cutover status \
--artifact-dir "$artifact_directory"
The host-operation lock spans each command’s effects and durable records. Preparation stores the operation’s credential-generation identifier once and retains it across retries. A completed backup can be adopted after interruption only when its complete retained receipt and every member verify; a partial or changed capture is refused.
A successful preparation returns the private report’s digest. It does not certify a safe live deployment. Keep the exact report and operation records for the subsequent activation command. A nonzero result must be investigated against the retained evidence; do not edit a journal stage to advance the operation.
Activation and recovery requirements
The activation sequence is PREPARED, HELD, SECRET_STAGED, CREDENTIAL_ROTATED, SESSIONS_CLEARED, ACTIVATED, CONSUMERS_READY, VERIFIED, then OPEN. Each recorded transition follows the corresponding observed effect. Resume must inspect a partially completed effect before repeating it.
Password rotation alone does not terminate existing PostgreSQL sessions. The rehearsal must demonstrate an old harmless connection surviving password rotation, then being terminated before activation, with a new login using the old credential refused. Every declared consumer must restart with its exact compatible image and current credential generation.
Before reopening, the dedicated identity must obtain a real token and successfully read its own probe roster. The worker must execute the exact harmless queued probe. Revoke the dedicated grant, prove the same token is refused, and remove the operation’s seat, roster, unit and identity. Retain the evidence of these actions.
An authority export is complete only while its independently recorded all-writer hold remains continuous. Reopening the source invalidates that completeness receipt. An old backup or periodic audit export cannot prove the absence of later revocations. Missing history requires the approved terminal revocation/reissue procedure and an explicitly reviewed trusted root before reopening.
Recovery has two separate private review documents. staff-permissions.recovery.json selects verified history or terminal reissue, identifies the explicitly trusted roots and binds the exact source digest. staff-permissions.recovery-bundle.json selects the complete backup receipt, member directory and digest. Verified history binds the authenticated export snapshot; terminal reissue binds the backup archive and accepts no authority export. The original preparation backup and a separately captured active-state backup remain distinct choices. Do not substitute an old authority report for a current completeness receipt.
The public recovery command’s --operation-id names the original retained source operation. The two review documents carry a separate, fresh recovery operation identifier. Keep those identities distinct so recovery uses the original independent host lock and records its new review and effects without rewriting the cutover history.
Release evidence
The execution checklist is docs/plans/2026-09-06-staff-permissions-execution/remaining-work-2026-09-10.md. All A01–A19 cases need actual passing evidence, including cutover/recovery and the declared load fixture. Controlled adapter tests and test collection do not replace those cases.
Final delivery also requires the normal backend selector with traceability enforcement, affected frontend tests and builds, migration and static gates, independent assembled review, and a GREEN make verify-diff. This task ends with commits and a draft pull request; merging, releasing and changing a live deployment are outside its authorization.