refactor(domain): desk/host naming out of partner namespace - #47
Conversation
Split seat-partner (SPEN/outs) from desk identity (host → book → skin). - DESK_DOMAIN env (dual-read legacy PARTNER_DOMAIN) - domain:status|skins|books|host-discover|map CLIs; partner:* aliases - partner/domain.ts → architecture.ts (OPS_LAYERS); thin re-export kept - tools: domain-cli + host-discover-cli - export asBookId; fix BookId brand expects in tests - create competition_id index only after column migration
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThe PR introduces ChangesDesk Domain and Seat-Ops Compatibility
Event-Store Index Migration
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Address PR review: domain: is desk matrix only; seat-ops is ops:status/map. - domain-cli: skins/books only (errors without a flag) - ops-cli: seat-ops status + expansion map - Ops* types + buildOpsStatusReport; Domain* aliases deprecated - PARTNER_DOMAIN_LAYERS only on deprecated partner/domain.ts path - asBookId private again; tests use String() / resolveBookId
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
tests/partner/widget-odds.test.ts (1)
38-39: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert mapping coverage per provider, not only the aggregate row count.
The lower-bound count can pass when one of
plive,ezlive, or legacyfantasy402mappings is missing and duplicate or unrelated rows make up the difference. Group the seeded rows by provider and compare each group withFANTASY_SPORT_MAPPINGS. Keep the aggregate count only as an additional check if extra rows are intentional.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/partner/widget-odds.test.ts` around lines 38 - 39, Update the test assertion near the aggregate count to group seeded rows by provider and verify each of plive, ezlive, and legacy fantasy402 has coverage matching FANTASY_SPORT_MAPPINGS.length. Retain the aggregate lower-bound assertion only as an additional check if intentional extra rows remain.tests/partner/domain.test.ts (1)
4-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider covering the compatibility shim and renaming the test file.
The import now targets
architecture.ts. No assertion in this file importssrc/partner/domain.ts. The deprecated re-export path is therefore untested. If a symbol is dropped fromdomain.ts, no test fails.Add one import-level assertion against
src/partner/domain.ts, and rename the file toarchitecture.test.tsto match the module under test.♻️ Proposed addition to cover the deprecated re-export path
+import { OPS_LAYERS as LEGACY_OPS_LAYERS } from '../../src/partner/domain.ts'; + describe('seat-ops architecture (not desk domain matrix)', () => { test('five layers with honest maturity counts', () => { expect(OPS_LAYERS).toBe(PARTNER_DOMAIN_LAYERS); + expect(LEGACY_OPS_LAYERS).toBe(OPS_LAYERS);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/partner/domain.test.ts` around lines 4 - 15, Rename the test file to architecture.test.ts and add an import-level assertion that loads the deprecated src/partner/domain.ts compatibility shim, verifying it re-exports the expected architecture symbols from architecture.ts. Keep the existing architecture behavior assertions unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/PARTNER-DOMAIN.md`:
- Line 25: Change the “Naming split (desk vs seat)” heading from h3 to h2 to
satisfy the document’s heading hierarchy and markdownlint MD001; do not add a
parent heading.
In `@tools/domain-cli.ts`:
- Around line 3-18: Update the legacy aliases list in the header comment for the
domain CLI to include partner:host-discover alongside the existing aliases,
matching the documented domain:host-discover command and package script.
---
Nitpick comments:
In `@tests/partner/domain.test.ts`:
- Around line 4-15: Rename the test file to architecture.test.ts and add an
import-level assertion that loads the deprecated src/partner/domain.ts
compatibility shim, verifying it re-exports the expected architecture symbols
from architecture.ts. Keep the existing architecture behavior assertions
unchanged.
In `@tests/partner/widget-odds.test.ts`:
- Around line 38-39: Update the test assertion near the aggregate count to group
seeded rows by provider and verify each of plive, ezlive, and legacy fantasy402
has coverage matching FANTASY_SPORT_MAPPINGS.length. Retain the aggregate
lower-bound assertion only as an additional check if intentional extra rows
remain.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e9c9746b-b785-4fe2-b9e7-0a2ae04f8dd5
📒 Files selected for processing (29)
config/partners.example.tomldocs/PARTNER-DOMAIN.mddocs/PARTNER-FANTASY-ULTRA.mddocs/PROTONPASS.mdpackage.jsonsrc/domain/README.mdsrc/domain/books.tssrc/domain/index.tssrc/domain/live-product-endpoints.tssrc/domain/skins.tssrc/institutions/event-store/open-db.tssrc/partner/account-profile.tssrc/partner/architecture.tssrc/partner/domain.tssrc/partner/index.tssrc/partner/toml-config.tstests/domain/sports-skins-books.test.tstests/partner/domain.test.tstests/partner/execution/kalshi-live.test.tstests/partner/out-identity.test.tstests/partner/registry.test.tstests/partner/skin-events-store.test.tstests/partner/toml-config.test.tstests/partner/widget-odds.test.tstests/research/trading-order.test.tstools/domain-cli.tstools/host-discover-cli.tstools/partner-health.tstools/provision-fantasy402-vault.ts
| desk matrix [`src/domain/`](../src/domain/) · inventory: | ||
| [`PARTNER-FANTASY-ULTRA.md`](PARTNER-FANTASY-ULTRA.md) | ||
|
|
||
| ### Naming split (desk vs seat) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the heading level at Line 25.
### Naming split (desk vs seat) skips the required h2 level. markdownlint-cli2 reports MD001. Change this heading to ##, or add the missing parent heading.
Proposed fix
-### Naming split (desk vs seat)
+## Naming split (desk vs seat)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### Naming split (desk vs seat) | |
| ## Naming split (desk vs seat) |
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 25-25: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/PARTNER-DOMAIN.md` at line 25, Change the “Naming split (desk vs seat)”
heading from h3 to h2 to satisfy the document’s heading hierarchy and
markdownlint MD001; do not add a parent heading.
Source: Linters/SAST tools
| * Desk domain matrices + seat-ops architecture status. | ||
| * | ||
| * bun run partner:domain | ||
| * bun run partner:domain -- --json | ||
| * bun run partner:domain -- --skins | ||
| * bun run partner:domain -- --skins --json | ||
| * bun run partner:domain -- --books | ||
| * bun run partner:domain -- --books --json | ||
| * bun run partner:map | ||
| * bun run partner:map -- --output=artifacts/partner-expansion.mmd | ||
| * Desk matrix (skins / books / hosts): | ||
| * bun run domain:status | ||
| * bun run domain:status -- --json | ||
| * bun run domain:skins | ||
| * bun run domain:skins -- --json | ||
| * bun run domain:books | ||
| * bun run domain:books -- --json | ||
| * bun run domain:map | ||
| * bun run domain:map -- --output=artifacts/partner-expansion.mmd | ||
| * | ||
| * Legacy aliases: partner:domain · partner:skins · partner:books · partner:map | ||
| * | ||
| * @see docs/PARTNER-DOMAIN.md | ||
| * @see src/partner/domain.ts | ||
| * @see src/partner/architecture.ts |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the missing legacy alias to the header.
Line 15 lists four legacy aliases. package.json also defines partner:host-discover. Line 118 documents the new domain:host-discover command, so the alias list is incomplete.
📝 Proposed doc fix
- * Legacy aliases: partner:domain · partner:skins · partner:books · partner:map
+ * Legacy aliases: partner:domain · partner:skins · partner:books · partner:map · partner:host-discover📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * Desk domain matrices + seat-ops architecture status. | |
| * | |
| * bun run partner:domain | |
| * bun run partner:domain -- --json | |
| * bun run partner:domain -- --skins | |
| * bun run partner:domain -- --skins --json | |
| * bun run partner:domain -- --books | |
| * bun run partner:domain -- --books --json | |
| * bun run partner:map | |
| * bun run partner:map -- --output=artifacts/partner-expansion.mmd | |
| * Desk matrix (skins / books / hosts): | |
| * bun run domain:status | |
| * bun run domain:status -- --json | |
| * bun run domain:skins | |
| * bun run domain:skins -- --json | |
| * bun run domain:books | |
| * bun run domain:books -- --json | |
| * bun run domain:map | |
| * bun run domain:map -- --output=artifacts/partner-expansion.mmd | |
| * | |
| * Legacy aliases: partner:domain · partner:skins · partner:books · partner:map | |
| * | |
| * @see docs/PARTNER-DOMAIN.md | |
| * @see src/partner/domain.ts | |
| * @see src/partner/architecture.ts | |
| * Desk domain matrices + seat-ops architecture status. | |
| * | |
| * Desk matrix (skins / books / hosts): | |
| * bun run domain:status | |
| * bun run domain:status -- --json | |
| * bun run domain:skins | |
| * bun run domain:skins -- --json | |
| * bun run domain:books | |
| * bun run domain:books -- --json | |
| * bun run domain:map | |
| * bun run domain:map -- --output=artifacts/partner-expansion.mmd | |
| * | |
| * Legacy aliases: partner:domain · partner:skins · partner:books · partner:map · partner:host-discover | |
| * | |
| * `@see` docs/PARTNER-DOMAIN.md | |
| * `@see` src/partner/architecture.ts |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tools/domain-cli.ts` around lines 3 - 18, Update the legacy aliases list in
the header comment for the domain CLI to include partner:host-discover alongside
the existing aliases, matching the documented domain:host-discover command and
package script.
Post-#47 cleanup: architecture is Ops*-only; deprecated Domain* aliases live solely on partner/domain.ts (kill 2026-09-01). Dashboard/health use opsStatus locals and ops maturity field; operator catalog points at ops:status. Co-authored-by: nolarose <nolarose@factory-wager.com>
Outcome
Desk identity (host → book → skin) is no longer labeled as “partner.” Operators use
DESK_DOMAINanddomain:*CLIs; seat partners (SPEN/outs) stay underpartner:*.What changed
DESK_DOMAINpreferred; dual-read legacyPARTNER_DOMAINdomain:status·domain:skins·domain:books·domain:host-discover·domain:map(legacypartner:*aliases kept)src/partner/architecture.ts(OPS_LAYERS); thin re-export fromdomain.ts; tools renamed todomain-cli/host-discover-cliPARTNER-DOMAIN.md, domain README, Fantasy Ultra / Proton Pass / partners.toml examplesasBookIdbranded expects; fantasy402 fixtures with real host; sport-mapping dual-write countskin_events.competition_idindex only after column migration (unblocks local event-store open)Safety and compatibility
Validation
bun run guard·tsc --noEmit· fullbun test --isolate(pass on commit)tests/domain/sports-skins-books.test.ts,tests/partner/domain.test.ts,tests/partner/toml-config.test.ts, host-discover, liquidity board routes after schema fixFollow-up
host-discoversource undersrc/domain/orsrc/host/PARTNER-DOMAIN.md→ seat-ops titlesrc/partner/package in this laneSummary by CodeRabbit
New Features
Improvements
DESK_DOMAINis now preferred for domain configuration, withPARTNER_DOMAINretained as a legacy fallback.Bug Fixes
Documentation