Skip to content

Align station contracts with peer-stations 1.1 replication - #157

Merged
Travis-Gilbert merged 1 commit into
mainfrom
feat/peer-stations-1.1-contracts
Aug 2, 2026
Merged

Align station contracts with peer-stations 1.1 replication#157
Travis-Gilbert merged 1 commit into
mainfrom
feat/peer-stations-1.1-contracts

Conversation

@Travis-Gilbert

@Travis-Gilbert Travis-Gilbert commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Updates @commonplace/program-contracts for ProgramStationReplication (single|peer).
  • Wires tray, drop client, badge, and tests to replication / requested_replication.

Test plan

  • pnpm --filter @commonplace/console exec vitest run src/views/program/programClient.test.ts src/views/program/BindingStationTray.test.ts (7 passed)

Companion to Theorem peer-stations 1.1 amendment for #388.

Summary by CodeRabbit

  • Improvements

    • Updated binding station preset cards to display replication settings.
    • Station badges now show the compiled replication mode and preset identifier.
    • Updated preset application and drop interactions to use replication-based options, providing clearer single- and peer-station behavior.
  • Bug Fixes

    • Corrected station display and interaction details to distinguish requested replication from the resulting compiled replication mode.

Replace topology solo|pair|peer with replication single|peer and update tray, drop client, and badge rendering to match Theorem's amended station fields.
Copilot AI review requested due to automatic review settings August 2, 2026 18:45
@Travis-Gilbert
Travis-Gilbert merged commit 59c64c4 into main Aug 2, 2026
7 of 10 checks passed
@Travis-Gilbert
Travis-Gilbert deleted the feat/peer-stations-1.1-contracts branch August 2, 2026 18:45
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 89b44cd0-f5a9-448c-bc7f-80e3b64b47cf

📥 Commits

Reviewing files that changed from the base of the PR and between 4216f01 and f81492f.

⛔ Files ignored due to path filters (1)
  • packages/program-contracts/src/program.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (5)
  • apps/console/src/views/program/BindingStationTray.test.ts
  • apps/console/src/views/program/BindingStationTray.tsx
  • apps/console/src/views/program/programClient.test.ts
  • apps/console/src/views/program/programClient.ts
  • apps/console/src/views/program/programNodeKind.tsx

📝 Walkthrough

Walkthrough

The console replaces station topology fields with replication fields in client requests, preset displays, badges, and related tests.

Changes

Station replication updates

Layer / File(s) Summary
Client replication request contract
apps/console/src/views/program/programClient.ts, apps/console/src/views/program/programClient.test.ts
The client accepts requestedReplication and sends requested_replication. Fixtures and assertions use replication-based station contracts.
Station replication display
apps/console/src/views/program/BindingStationTray.tsx, apps/console/src/views/program/programNodeKind.tsx, apps/console/src/views/program/BindingStationTray.test.ts
Preset cards display replication values. Station badges display compiled replication and preset identifiers. Tests cover the updated output.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/peer-stations-1.1-contracts

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Console “binding station” surfaces to align with the peer-stations 1.1 contract shift from topology to replication (and requested_topologyrequested_replication) by updating the generated program contracts and rewiring UI/client/test call sites accordingly.

Changes:

  • Update @commonplace/program-contracts station/preset/drop types to use replication / compiled_replication.
  • Update Console UI/client code paths (tray display, drop request payload, station badge text) to the new contract fields.
  • Update unit tests to assert the new request/response shapes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/program-contracts/src/program.generated.ts Replaces station “topology” types/fields with ProgramStationReplication and updates preset/station/drop request types.
apps/console/src/views/program/programNodeKind.tsx Updates station badge formatting to use compiled_replication (note: currently introduces an E2E-breaking badge text change).
apps/console/src/views/program/programClient.ts Renames drop input to requestedReplication and sends requested_replication in the apply payload.
apps/console/src/views/program/programClient.test.ts Updates mocked presets/receipt and asserts requested_replication request payload.
apps/console/src/views/program/BindingStationTray.tsx Displays preset.replication instead of preset.topology.
apps/console/src/views/program/BindingStationTray.test.ts Updates fixture + badge expectation for replication-based fields/copy.
Suppressed comments (1)

apps/console/src/views/program/programNodeKind.tsx:141

  • stationBadgeFor now formats the badge text as "<compiled_replication> station (<preset_id>)", which no longer ends with "station". The existing E2E test apps/console/e2e/model-program-canvas.live.spec.ts:80 asserts getByText(/station$/), so this change will break that test (and is also a user-visible regression in the badge copy). Keep the badge text ending with station and rely on title (already includes the preset id) for the extra detail.
export function stationBadgeFor(station: ProgramStationFields | undefined): NodeBadge | null {
  return station
    ? {
        id: 'station',
        text: `${station.compiled_replication} station (${station.preset_id})`,
        mono: true,
        tone: 'gold',
        title: `Binding preset ${station.preset_id}`,
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f81492f058

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +92 to +94
export type ProgramBindingPreset = { preset_id: string, display_name: string, binding_ref: string, peer_binding_ref?: string | null, replication: ProgramStationReplication, capability_pack: Array<string>, budget_units: number, sealed: boolean, owner_principal_id?: string | null, roster?: Array<ProgramBindingPresetHead> | null, };
export type ProgramStationReplication = "single" | "peer";
export type ProgramStationFields = { preset_id: string, binding_ref: string, capability_pack: Array<string>, budget_units: number, peer_binding_ref?: string | null, replication: ProgramStationReplication, compiled_replication: ProgramStationReplication, sealed: boolean, };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Repin the generated contract to its actual source commit

When THEOREM_REPO_TOKEN is configured, .github/workflows/console-ci.yml reads the unchanged SOURCE COMMIT: 84f35a121, checks out that revision of Theorem, and runs check:generated. Since the parent version of this file was already generated from that revision and contains the old topology contract, regenerating it will disagree with these new replication declarations and fail the merge-blocking drift check. Regenerate this file from the amended Theorem revision so the source marker and declarations advance together.

Useful? React with 👍 / 👎.

? {
id: 'station',
text: `${station.compiled_topology} station`,
text: `${station.compiled_replication} station (${station.preset_id})`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the live station assertion for the new badge text

When THEOREM_RUN_CANVAS_LIVE=1, the deployed canvas test in apps/console/e2e/model-program-canvas.live.spec.ts still waits for text matching /station$/ after a successful preset drop. The badge now renders strings such as single station (preset:principal), which end in ) rather than station, so this acceptance test times out even though the drop succeeded; update its assertion alongside the new badge contract.

AGENTS.md reference: apps/console/AGENTS.md:L187-L195

Useful? React with 👍 / 👎.

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.

2 participants