Skip to content

refactor(domain): desk/host naming out of partner namespace - #47

Merged
brendadeeznuts1111 merged 2 commits into
mainfrom
feat/domain-host-rename
Aug 10, 2026
Merged

refactor(domain): desk/host naming out of partner namespace#47
brendadeeznuts1111 merged 2 commits into
mainfrom
feat/domain-host-rename

Conversation

@brendadeeznuts1111

@brendadeeznuts1111 brendadeeznuts1111 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Outcome

Desk identity (host → book → skin) is no longer labeled as “partner.” Operators use DESK_DOMAIN and domain:* CLIs; seat partners (SPEN/outs) stay under partner:*.

What changed

  • Env: DESK_DOMAIN preferred; dual-read legacy PARTNER_DOMAIN
  • CLIs: domain:status · domain:skins · domain:books · domain:host-discover · domain:map (legacy partner:* aliases kept)
  • Modules: seat-ops map → src/partner/architecture.ts (OPS_LAYERS); thin re-export from domain.ts; tools renamed to domain-cli / host-discover-cli
  • Docs: PARTNER-DOMAIN.md, domain README, Fantasy Ultra / Proton Pass / partners.toml examples
  • Tests: asBookId branded expects; fantasy402 fixtures with real host; sport-mapping dual-write count
  • Side fix: create skin_events.competition_id index only after column migration (unblocks local event-store open)

Safety and compatibility

  • Fail-closed host→skin path unchanged; discovery still suggest-only
  • Dual-read / aliases avoid breaking existing env and scripts
  • No seat-partner entity rename; no schema migration for partners tables
  • Index order fix is additive and safe for existing DBs

Validation

  • Pre-commit: bun run guard · tsc --noEmit · full bun test --isolate (pass on commit)
  • Focused: 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 fix

Follow-up

  • Optional: move host-discover source under src/domain/ or src/host/
  • Optional: rename doc hub PARTNER-DOMAIN.md → seat-ops title
  • Do not rename full src/partner/ package in this lane

Summary by CodeRabbit

  • New Features

    • Added desk-domain commands for status, book/skin matrices, host discovery, and expansion mapping.
    • Added seat-operations status reporting with layered architecture visibility.
    • Added support for normalized book identifiers across domain tools.
  • Improvements

    • DESK_DOMAIN is now preferred for domain configuration, with PARTNER_DOMAIN retained as a legacy fallback.
    • Updated provider-specific domain and skin handling.
  • Bug Fixes

    • Prevented event-store startup failures when required columns are not yet available.
  • Documentation

    • Updated configuration, command, and vault guidance for the new terminology and compatibility behavior.

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
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brendadeeznuts1111, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ebebc144-f364-423f-9046-b54da806dafd

📥 Commits

Reviewing files that changed from the base of the PR and between 3fb3eb6 and 3a946f9.

📒 Files selected for processing (19)
  • docs/PARTNER-DOMAIN.md
  • docs/PARTNER-FANTASY-ULTRA.md
  • package.json
  • src/domain/README.md
  • src/domain/books.ts
  • src/domain/index.ts
  • src/partner/architecture.ts
  • src/partner/dashboard-data.ts
  • src/partner/domain.ts
  • src/partner/index.ts
  • tests/domain/sports-skins-books.test.ts
  • tests/partner/domain.test.ts
  • tests/partner/out-identity.test.ts
  • tests/partner/registry.test.ts
  • tests/partner/skin-events-store.test.ts
  • tests/partner/toml-config.test.ts
  • tools/domain-cli.ts
  • tools/ops-cli.ts
  • tools/partner-health.ts
📝 Walkthrough

Walkthrough

The PR introduces DESK_DOMAIN with legacy PARTNER_DOMAIN fallback, relocates seat-ops architecture reporting, updates domain CLI commands and documentation, exports asBookId, adjusts provider fixtures, and guards event-store index creation.

Changes

Desk Domain and Seat-Ops Compatibility

Layer / File(s) Summary
Desk-domain resolution and typed identifiers
config/partners.example.toml, src/domain/*, src/partner/toml-config.ts, tests/domain/*, tests/partner/*, docs/*, tools/provision-fantasy402-vault.ts
DESK_DOMAIN is resolved before legacy PARTNER_DOMAIN and the default Ultra URL. The resolver and asBookId are publicly exported. Tests cover precedence and branded book IDs.
Seat-ops architecture module and compatibility exports
src/partner/architecture.ts, src/partner/domain.ts, src/partner/index.ts, tests/partner/domain.test.ts
The five-layer architecture map and status formatters move to architecture.ts. domain.ts re-exports them for compatibility.
Domain CLI commands and documentation
package.json, tools/domain-cli.ts, tools/host-discover-cli.ts, tools/partner-health.ts, docs/PARTNER-DOMAIN.md, docs/PARTNER-FANTASY-ULTRA.md
The project documents and exposes domain:* commands while retaining legacy partner:* aliases.
Provider fixture and mapping validation
tests/partner/execution/kalshi-live.test.ts, tests/partner/widget-odds.test.ts, tests/research/trading-order.test.ts
Fantasy402 fixtures now include provider-specific host, skin, book, and environment metadata. Mapping tests accept plive, ezlive, and legacy targets.

Event-Store Index Migration

Layer / File(s) Summary
Conditional competition index creation
src/institutions/event-store/open-db.ts
The competition_id index is created after migrations and only when the column exists.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main refactor from partner terminology to desk and host domain terminology.
Description check ✅ Passed The description includes all required sections and clearly covers outcomes, changes, compatibility, validation, and follow-up work.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/domain-host-rename

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
tests/partner/widget-odds.test.ts (1)

38-39: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert mapping coverage per provider, not only the aggregate row count.

The lower-bound count can pass when one of plive, ezlive, or legacy fantasy402 mappings is missing and duplicate or unrelated rows make up the difference. Group the seeded rows by provider and compare each group with FANTASY_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 win

Consider covering the compatibility shim and renaming the test file.

The import now targets architecture.ts. No assertion in this file imports src/partner/domain.ts. The deprecated re-export path is therefore untested. If a symbol is dropped from domain.ts, no test fails.

Add one import-level assertion against src/partner/domain.ts, and rename the file to architecture.test.ts to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9952f46 and 3fb3eb6.

📒 Files selected for processing (29)
  • config/partners.example.toml
  • docs/PARTNER-DOMAIN.md
  • docs/PARTNER-FANTASY-ULTRA.md
  • docs/PROTONPASS.md
  • package.json
  • src/domain/README.md
  • src/domain/books.ts
  • src/domain/index.ts
  • src/domain/live-product-endpoints.ts
  • src/domain/skins.ts
  • src/institutions/event-store/open-db.ts
  • src/partner/account-profile.ts
  • src/partner/architecture.ts
  • src/partner/domain.ts
  • src/partner/index.ts
  • src/partner/toml-config.ts
  • tests/domain/sports-skins-books.test.ts
  • tests/partner/domain.test.ts
  • tests/partner/execution/kalshi-live.test.ts
  • tests/partner/out-identity.test.ts
  • tests/partner/registry.test.ts
  • tests/partner/skin-events-store.test.ts
  • tests/partner/toml-config.test.ts
  • tests/partner/widget-odds.test.ts
  • tests/research/trading-order.test.ts
  • tools/domain-cli.ts
  • tools/host-discover-cli.ts
  • tools/partner-health.ts
  • tools/provision-fantasy402-vault.ts

Comment thread docs/PARTNER-DOMAIN.md
desk matrix [`src/domain/`](../src/domain/) · inventory:
[`PARTNER-FANTASY-ULTRA.md`](PARTNER-FANTASY-ULTRA.md)

### Naming split (desk vs seat)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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.

Suggested change
### 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

Comment thread tools/domain-cli.ts Outdated
Comment on lines +3 to +18
* 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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.

Suggested change
* 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.

@brendadeeznuts1111
brendadeeznuts1111 merged commit 0f491af into main Aug 10, 2026
2 of 3 checks passed
@brendadeeznuts1111
brendadeeznuts1111 deleted the feat/domain-host-rename branch August 10, 2026 05:03
brendadeeznuts1111 added a commit that referenced this pull request Aug 10, 2026
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>
brendadeeznuts1111 added a commit that referenced this pull request Aug 10, 2026
Close #47-#53 review findings: domain:books error path, dual-read-only
docs, live-product capacity labels (no skins.ts shim), normalize
LIVE_PRODUCTS_JSON wire names, and UI/risk copy that conflated seat
capacity with desk skins.

Co-authored-by: nolarose <nolarose@factory-wager.com>
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