Skip to content

[codex] Harden Staff identity provisioning anchors - #12

Draft
SadPossum wants to merge 8 commits into
devfrom
codex/staff-identity-provisioning-anchors
Draft

[codex] Harden Staff identity provisioning anchors#12
SadPossum wants to merge 8 commits into
devfrom
codex/staff-identity-provisioning-anchors

Conversation

@SadPossum

@SadPossum SadPossum commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

Hardens Staff identity provisioning for Workspace onboarding as an exact, durable, fail-closed cross-module protocol.

The implementation gives Staff ownership of the provisioning anchor and its one-time resolution coordinate, gives Workspaces ownership of the continuation coordinate and local convergence ledger, and serializes lifecycle/access mutations so retries, crashes, stale events, subject changes, and concurrent suspend/resume/depart paths cannot silently grant or resurrect access.

What changed

  • Persist Staff-owned random resolution event coordinates and Workspaces-owned random continuation coordinates; remove algebraically derived cross-domain IDs.
  • Enforce exact anchor, target, event, application-version, disposition, and causal-time relationships in application code and PostgreSQL.
  • Add two-pass onboarding convergence with redaction before property reconciliation/grant, exact replay, terminal resolution, and later Staff observation.
  • Fence Staff lifecycle and Workspaces access processes across Active, Suspended, Departed, Anonymised, mismatch, and missing-authority outcomes.
  • Persist restoration disposition (NotApplicable, RestoreSnapshot, Suppressed) and prevent automatic access resurrection after negative subject-bound resolution.
  • Block Staff auth-subject changes while any Workspace-onboarding anchor exists; retain governed resolved anonymisation as the narrow exception.
  • Add the bounded recurring identity-anchor sweep with monotonic ordinals, fixed high-water cycles, fresh transaction scopes, repair of lost continuation/resolution delivery, status, worker wiring, and crash/retry isolation.
  • Add exact Staff/Workspaces cutover inspection and bounded Organizations evidence export for migration/backfill reconciliation.
  • Add serialized onboarding profile-read/mutation authority checks, privacy-minimal actionable projections, tenant-wide subject mutation fences, and fail-closed bulk export preflight.
  • Add governed historical no-provision review receipts, Admin CLI operations, append-only proof, cutover/sweep exclusions, export, and destruction lifecycle.
  • Extend personal-data catalogs, inventories, Data Rights exports, tenant-termination exports, retention/destruction stages, module metadata, and operational documentation.
  • Add provider-level concurrency, migration, replay, rollback, lifecycle, cutover, export, anonymisation, and destruction proofs.

Dependencies and stacking

All four dependency PRs (#11, Organizations #14/#15, Framework #22) are currently draft/open with green checks. This PR does not merge them.

Current draft CI state

Database and deployment contract

New protocol migrations:

  • Staff: 20260811110753_AddStaffIdentityProvisioningAnchors
  • Workspaces: 20260811205004_AddWorkspaceStaffIdentityProvisioningAnchors

This is intentionally not rolling-compatible with predecessor writers. Production rollout must follow the stop/drain contract in docs/architecture/workspaces-and-onboarding.md:

  1. stop and drain all affected API, Admin, Worker, and direct-writer processes;
  2. apply the Staff migration, then the Workspaces migration, from the same artifact;
  3. deploy all affected processes together and prohibit old binaries after cutover;
  4. verify anchor/sweep/ledger/backlog exit criteria before reopening writes;
  5. retain backup/restore and guarded downgrade evidence.

The repository documents this procedure, but this PR contains no evidence that it has been executed in a hosted environment. No deployment or migration was performed by this work.

Verification on final commit b4e3865b

  • Fresh solution build: 0 warnings, 0 errors.
  • All 42 test projects with fresh builds and Category!=Docker: 5,482/5,482 passed, 0 failed, 0 skipped.
  • Affected real-PostgreSQL matrix: 41/41 passed, including both migrations, writer races, lifecycle interleavings, subject/profile fences, sweep transaction isolation, cutover, Data Rights, anonymisation, and destruction.
  • Architecture: 103/103 passed.
  • EF migration drift: 21/21 projects clean.
  • Solution sync, source-package, repository-security, release, and diff gates passed.
  • NuGet vulnerability scan: all 296/296 projects reported no known vulnerable direct or transitive packages.
  • Submodule gate: 9/10 aligned with module dev; the only intentional nonzero is Organizations [codex] Pin patched SSH.NET across backend test harness #14 described above.

The final Workspaces migration body is pinned by SHA-256 54517bfd15b9a2ba4f54eca8c6afcbfe25ae514e412643b595f52af8991a671f in the local verification record.

Readiness boundary

This is a code-and-local-provider proof, not a production-readiness or launch claim. Before marking ready, resolve the stacked/dependency PRs, refresh the Organizations/Framework pointers, execute and record the stop/drain migration rehearsal, backup/restore proof, deployed smoke tests, worker/sweep health, and operational approval.

Draft only. Do not merge or deploy from this PR yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant