Skip to content

Add request-wide organisation selection #464

Open

Description

@stakach

Implemented request-wide REST organisation selection in #451 (722722a), following the approved contract in #463. Owner: stakach; milestone: Multi-tenancy. Depends on PlaceOS/models#332. Staff API remains domain-based.

  • Add regression specs first and reproduce selection/reach/permission gaps on CI.
  • Default ordinary callers to their home organisation; require explicit partner/management-staff selection.
  • Keep login Host/token identity separate from selected resources and enforce exact grant verbs and authority scope.
  • Require partner_staff for structural management reach and return safe organisation discovery metadata.
  • Apply context to IDs, references, collections, counts/search, domain resources, history and sockets.
  • Classify platform/shared and domain/capability protocols; close unrestricted metrics/MQTT paths.
  • Cover sensitive configuration/credentials, cross-owner cascades and stale runtime aliases with regression-first changes.
  • Regenerate OpenAPI/MCP descriptions and document compatibility/rollout.
  • Pass full latest/unstable GitHub CI and branch image build; fix all suite failures.
  • Record final review results and verify the branch is clean and pushed.

Review

Final CI passed on 722722a: latest and unstable each ran 1,481 examples, 0 failures, 0 errors, 1 existing pending (Edges::ConnectionManager). Ameba, Crystal/Dockerfile style and PR checks passed. Final image build passed. The branch is clean, matches upstream and contains origin/master.

The regression-first commit d1e681f reproduced 42 failing new cases with the existing 1,378 examples passing. The final suite includes 103 additional regression examples. A legacy root-zone test's dependence on the first default page was fixed by tagging its fixtures and retaining every positive/negative assertion; production pagination behavior is unchanged.

Native application compilation and focused spec semantic compilation pass. Tracked Crystal formatting, Ameba and Dockerfile checks pass. Final application-generated OpenAPI/MCP schemas validate, and generated OpenAPI matches the committed contract. Local Docker compilation exceeded the 8 GB VM before executing examples, so GitHub's full matrix provides runtime verification.

PLACE_TENANCY_ENFORCE remains off by default pending ownership reconciliation and test-cluster rollout. Replace the models branch pin after models#332 releases. Staff's independent domain-isolation review, client selector integration, rollout and coordinated squash merges remain tracked in #463. No PR was merged or enforcement enabled here.

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 approved by Steve. Organisation selection applies only to rest-api; staff-api remains domain-based.

    Owner: stakach. Starting with failing regression tests, then request context/precise grants, controller and socket integration, generated API docs and CI verification. Work continues on PR #451 without rewriting history. Local suites run sequentially through one test agent.

  4. stakach commented on Nov 16, 2026

    @stakach
    MemberAuthor

    Regression-first commit d1e681f adds47 tests before any production edits. Covers home defaults, partner selection, precise grants, domain ownership, credential/reference mutation, history, metrics, live sockets and MCP selection.

    Baseline run: https://github.com/PlaceOS/rest-api/actions/runs/43800013827
    Two local Docker compiler runs exceeded the VM’s8GB memory before examples; GitHub provides the assertion baseline. Production implementation drafts remain separate until failures are captured. Staff API stays domain-based and unchanged.

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