Skip to content

fix: tenancy compatibility and cluster management gaps #465

Open
1 of 1 issue completed
Open

Description

@stakach

Tenancy P1/P2 implementation

Approved by Steve 2026-11-17; implement regression-first. Existing PRs: models#332, REST#451, Staff#390, init#105. Parent REST#463; Staff#396. No force pushes, merges, deployments, driver or interface changes.

  • Refresh expected branches/dependencies and establish regression-first baselines.
  • P1 REST: default all roles to authenticated domain owner; preserve explicit selector permission checks and discovery metadata.
  • P1 REST: authorise zone execution against zone ONLY (Operate + OAuth/key Write), validate target ownership/aliases and scope clearance without extra descendant grants.
  • P1 REST: preserve booked-room prompt HTTP path/payload with an owner/capability-validated narrow legacy bridge; never restore arbitrary global signal publishing.
  • P1 Staff: exact grants/verbs/authority scope, management partner_staff, destination-domain checks; retain domain/calendar identity.
  • P1 models: unknown/shared reference quarantine in real backfill tests; additive repair/report for already-applied migrations, no silent reassignment.
  • P1/P2 init: preserve existing organisation configuration/ownership; explicit management bootstrap; no heuristic promotion/deletion of customer orgs.
  • P2: safe reconciliation inventory, preview and atomic/idempotent audited apply; claim/reassign/domain/tree moves, reviewed org merges, stale-preview and privilege/conflict protection.
  • P2: user metadata scope/counts, atomic last-admin transitions, flag-off uniqueness/duplicate-domain upgrade compatibility.
  • P2: live MCP revocation, tenant-scoped WebRTC codes, standalone owned module debugging, Staff spaces/asset destination isolation.
  • Format/lint and generated OpenAPI/MCP; all changed repositories' latest/unstable suites and image builds green; update PR review/tracking; clean pushed branches.

Driver ledger: confirmed booking_check_in_helper global prompted signal; audit staff_api generic signal wrapper; retain secret-validated Bookings/WorkplaceSubscription bus; audit HealthRooms/SignageMailer authority configuration and external metadata/MQTT consumers. Driver updates deferred.

Regression-first contracts: unchanged single-tenant users/admin/support/keys/guests, both enforcement modes, extra grants do not change defaults, zone-only authorisation positive vs Create/Read-only denial, bounded dispatch, Staff exact read/authority grants and destination checks, real migration mixed known/unknown refs, existing edited organisation preservation, reconciliation stale/repeated/concurrent apply and no privilege widening.

Review

Final heads: models716ca76, REST1507d3a, Staffa9b8a21, init2a986f8. Every required PR check is successful, including both compiler variants and current-head multiarch images. Runtime counts per variant: models970/0fail/0error; REST1538/0/0/1existingpending; Staff654/0/0/12existingpending plus browser e2e; init18/0/0.

Native full application/spec code generation, formatter/lint and generated OpenAPI/MCP contracts pass. Tests-first failing runs and final CI links are in the four draft PR Review sections and issue465. Branches are clean, pushed, on expected branches and contain current master. All three downstream model locks use716ca76. Drivers are unchanged.

Rollout remains separate: enforcement off by default; operator ownership/configuration review, management bootstrap and test-cluster smoke before enabling; merge models first then replace branch pins with its release; support UI/driver updates deferred. Reconciliation is intentionally bounded (5000 snapshot rows/16MiB) and blocks unsafe/ambiguous moves, staff conversion and colliding grants. Domain claims with unknown owners are outside its estate-claim operation; source-owned single-domain moves and explicit organisation merges are supported.

Activity

  1. added this to the Multi-tenancy milestone on Nov 16, 2026
  2. self-assigned this
    on Nov 16, 2026
  3. stakach commented on Nov 16, 2026

    @stakach
    MemberAuthor

    Implementation status: REST P1 compatibility, zone-only execution and booking prompt regressions now pass. Staff domain isolation is green (654 examples in both compiler variants plus browser checks); init is green (18 examples each). REST search/admin P2 regressions pass. Reconciliation review and live-stream final CI are in progress. Tests-first commits and failing assertion runs precede the fixes; final downstream model pins will be refreshed together.

    Deferred driver ledger (no driver files changed):

    • place/booking_check_in_helper.cr:152: existing <system>/guest/bookings/prompted consumer. REST now preserves this exact HTTP channel/payload through an ownership/capability-checked bridge; driver update deferred.
    • place/staff_api.cr:1405: generic signal wrapper; audit cross-domain callers when updating drivers.
    • place/bookings.cr:913 and place/models/workplace_subscriptions.cr:134: <subscription-id>/event trusted bus retained with client_secret validation. Check integriti_user_sync and Orbility parking consumers in the driver follow-up.
    • place/chat/health_rooms.cr:62: authority-configuration audit.
    • place/signage/mailer.cr:46: current authority channel retained; configuration audit deferred.
    • Custom metadata/MQTT deployment consumers: audit during driver/client rollout; no additional confirmed source break identified.

    Ownership: root integrates REST and final dependency/CI proof; models/init and Staff domain changes are separately checked within this issue. Staff remains domain/calendar based. No merges, deployments, enforcement activation or interface updates are included.

  4. stakach commented on Nov 17, 2026

    @stakach
    MemberAuthor

    All four final pinned runtime matrices are green, including each unstable job (not just the reusable workflow conclusion):

    Repository Head Examples per variant CI
    models 716ca76 970, zero failures/errors/pending https://github.com/PlaceOS/models/actions/runs/43981875372
    rest-api 1507d3a 1,538, zero failures/errors, 1 existing pending https://github.com/PlaceOS/rest-api/actions/runs/43986049224
    staff-api a9b8a21 654, zero failures/errors, 12 existing pending; browser checks green https://github.com/PlaceOS/staff-api/actions/runs/43982964653
    init 2a986f8 18, zero failures/errors/pending https://github.com/PlaceOS/init/actions/runs/43983142584

    Final native application and focused full-codegen spec builds pass; generated REST/Staff OpenAPI and MCP YAML validate, with every local schema reference resolved. All four expected branches are clean, pushed, and contain current master. Staff remains domain-based, drivers are unchanged, and enforcement remains off by default.

    Final multiarch image builds are still running. Implementation is complete; final verification remains open until those current-head builds pass. No merge/deployment has been performed.

  5. stakach commented on Nov 17, 2026

    @stakach
    MemberAuthor

    Final verification is complete. All required checks are green on the four current heads, including each compiler variant and all current-head multiarch image builds:

    • Models 716ca76: CI, 970 examples each.
    • REST 1507d3a: CI, 1,538 examples each; image.
    • Staff a9b8a21: CI, 654 examples each plus browser checks; image.
    • Init 2a986f8: CI, 18 examples each; image.

    Zero failures/errors. Existing pending specs are unchanged (REST1, Staff12). Formatting/Ameba and final native builds/contracts pass. All four branches are clean, pushed and contain current master; downstream models pins agree. Draft PR descriptions/reviews and parent plan463 reflect the current contract. Staff remains domain-based, zone execution authorises only the zone, and drivers remain unchanged with the deferred ledger recorded above.

    Reconciliation safely blocks oversized snapshots, ambiguous multi-domain moves, unowned domain claims, staff-scope conversions and colliding grants; supported estate claims, source-owned single-domain moves and merges require reviewed previews. Operator review/management bootstrap and test-cluster rollout remain prerequisites before enabling enforcement. No merge, deployment or enforcement activation is performed here.

  6. stakach commented on Nov 18, 2026

    @stakach
    MemberAuthor

    Status: Done. All13 Docker Hub images are published under multi-tenancy with verified amd64 and arm64 manifests and source/version labels. Build manifest/receipts include immutable pull references.

    Original run44216582470 built12 images; init-only recovery44225358298 succeeded with one concurrent BuildKit operation, preserving approved source cca78ae5. Crystal workers were already limited to1. Both runs skipped release/tagging/notification steps.

    REST/Staff binaries run on both architectures. Both init images contain149 database files byte-matching models716ca76, and pg_dump18.7 starts. Temporary release branch permission67207274 has been removed; original protections remain intact. No cluster migration ran. Source PRs remain unmerged and drivers/interfaces are unchanged.

    Ready for the separate test-cluster migration task. Existing platform-info display-label issue is tracked in #468; Docker tags and OCI version labels are verified correct.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions