Skip to content

Register Roster redirect domains - #17

Merged
jayjfletcher merged 27 commits into
mainfrom
ring-master/2026-10-29-2038-register-roster-redirect-domains
Oct 30, 2026
Merged

jayjfletcher merged 27 commits into
mainfrom
ring-master/2026-10-29-2038-register-roster-redirect-domains

Conversation

@jayjfletcher

Copy link
Copy Markdown
Member

Risk: high

What changed

  • Redirect domains on host screens: new src/Atrium/ScreenRegistrations.php registers a cortex.mcp tab or cortex.redirect-domains section on screens named in the new cortex.atrium.redirect_domains.screens config (default roster.organization tab, roster.user aside). It uses one shared view, ui/screens/redirect-domains.blade.php.
  • Controller: RedirectDomainUiController store and destroy take optional owner_type and owner_id, and redirect back only to a same-origin referrer.
  • Authorization: RedirectDomainPolicy create and delete for owned domains now ask $user->can('update', $owner). This applies to the UI, the JSON API and MCP.
  • Own screens: all 11 Cortex pages declare standard Atrium screens through Atrium\Screens::declare(), with the slots rendered in the views.
  • History and Atrium: the audit-trail components and the history nav item are removed. Atrium moves to require-dev plus suggest, with a conflict on old versions.
  • No-Atrium proof: a tests/WithoutAtrium suite, phpunit.without-atrium.xml, a composer script and a CI job.
  • Docs: README, CHANGELOG, local standard, CLAUDE.md and the Boost skill.

Why

Roster's MCP redirect-domain UI belongs in Cortex, placed on any package's screens through config, with Cortex never naming Roster. Who may manage an owner's domains is decided by the owner's own policy (D-022, D-023, D-027). Other decisions that shaped the work:

  • D-020: prove the no-Atrium case both in process and in CI, and add the conflict.
  • D-021: a malformed config entry throws in local and testing, and is reported and skipped in production.
  • D-026: same-origin redirect after owned writes.
  • D-028: no owner-type allow-list.
  • D-024: one spec, merged together with Atrium, Keen and Roster.

Look at

  • src/Domains/RedirectDomain/Policies/RedirectDomainPolicy.php:37: the behaviour change for create and delete. Guests and users without update on the owner are now refused over the API and MCP. A missing owner row fails closed.
  • src/Atrium/ScreenRegistrations.php:137: the visible() closure runs on every host render. Check that it queries nothing early and that a policy exception is swallowed.
  • src/Atrium/Http/Controllers/RedirectDomainUiController.php:117: owner resolution (owner()), and the same-origin redirect in back() at line 140.
  • composer.json:45: the Atrium conflict constraint and the require to require-dev move.
  • .github/workflows/tests.yml and tests/WithoutAtrium/bootstrap.php: the CI lane is the authoritative no-Atrium proof.

Tested

Gate round 2: PASS. phpstan and pint are clean, pest 828/828 passes with 100% coverage, and test:without-atrium 7/7 passes.

  • 1, 2: ScreenRegistrationsTest, NoRosterReferenceTest
  • 3: VisibilityTest
  • 4, 6: OwnedRedirectDomainsTest
  • 5: StylesTest
  • 7: RedirectDomainOwnerControllerTest
  • 8: OwnedRedirectDomainPolicyTest
  • 9: TestHostScreenTest
  • 10: DeclaredScreensTest
  • 11: ScreenAccessClosureTest
  • 12: ScreenLayoutTest
  • 13: NoHistoryUiTest, HistoryNavigationTest
  • 14: AuditTrailTest deleted; RedirectDomainsTest signs in a user
  • 15, 16: ComposerTest, ArchTest
  • 17: WithoutAtriumTest, plus the CI job (verified only by a workflow run)
  • 18: DocsTest

Risks

  • This is a public behaviour change. Owner models without an update policy now deny owned create and delete for API and MCP callers (CHANGELOG notes it).
  • Moving Atrium to require-dev breaks apps that relied on Cortex pulling it in.
  • Atrium has no release tag. If none exists, the conflict uses <1.0.0, so check the constraint at merge time.
  • Production: a malformed screens entry is reported once and skipped, so its UI is missing until someone acts on the report.
  • A grouped merge with Atrium, Keen and Roster is required, or Roster's MCP tab disappears in between.
  • A plain InvalidArgumentException departs from the CortexException convention, and a row was added to standards-feedback.md.
  • The CI without-atrium lane has not been run here.
  • Open findings: none (nits: 0).

Merge order

Part of the screen-extensions group (D-009). Merge after Atrium Refactor-Circus/Atrium#16 and Keen Refactor-Circus/Keen#8, together with the Roster adopt-atrium-screen-registry PR (which removes Roster's inline redirect-domain UI; this PR registers it back onto roster.organization and roster.user from config/cortex.php). composer.json conflicts with refactor-circus/atrium <0.1.0.

Breaks

The impact stage was not run.

  • Behaviour change (D-022): for an owned redirect domain, the bundled policy's create and delete now require $user->can('update', $owner). Null-owner domains are unchanged. Two existing tests in RedirectDomainsTest now sign a user in before the owned calls.
  • History: removing <x-atrium::audit-trail> and historyNavItem() drops the "Audit log" nav item. History now comes from Keen's wildcard section.

composer test re-run green on the final branch: 828 tests plus 7 without-Atrium tests. Tested against the PR branches of Atrium, Keen and PennantPlus.

Spec: docs/agent/specs/2026-10-29-2038-register-roster-redirect-domains/

🤖 Generated with Claude Code

jayjfletcher and others added 25 commits October 29, 2026 16:41
…ed policy and owner-aware UI controller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rch rule, test host and the no-Atrium proof

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed policy and owner-aware UI controller

Prefix the controller test's global helpers so they cannot clash with
other test files loaded in the same Pest process.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mains on other packages' screens

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tex's own screens and remove history UI (salvaged)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mains on other packages' screens

Retry: restore the testing environment before migrations roll back after the
production case, and throw from the fixture policy only on the owned check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tex's own screens and remove history UI

Forget scoped screen visibility before the viewAny list request in
ScreenAccessClosureTest: the direct resolve() above it remembered a
denial for the same request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flush Atrium's screen registry before tests boot CortexServiceProvider a second time, since group 3 registers screens from boot() and Atrium refuses duplicates in testing. Tick groups 3 and 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CHANGELOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CHANGELOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scope the WithoutAtrium bootstrap guard to loaders that can reach Atrium, so
Herd's prepended dump.phar loader no longer stops the suite, and sync the
Ringside generated files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jayjfletcher and others added 2 commits October 30, 2026 10:34
- Drop Atrium's provider from testbench.yaml before Composer's scripts run
  testbench package:discover.
- Apply ResetsScreenExtensions from tests/Pest.php, only when it exists:
  TestCase used it directly, and Pest loads TestCase for every suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayjfletcher
jayjfletcher merged commit 49ddf1b into main Oct 30, 2026
5 checks passed
@jayjfletcher
jayjfletcher deleted the ring-master/2026-10-29-2038-register-roster-redirect-domains branch November 11, 2026 04:13
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