Align station contracts with peer-stations 1.1 replication - #157
Conversation
Replace topology solo|pair|peer with replication single|peer and update tray, drop client, and badge rendering to match Theorem's amended station fields.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe console replaces station topology fields with replication fields in client requests, preset displays, badges, and related tests. ChangesStation replication updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: ✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
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_topology → requested_replication) by updating the generated program contracts and rewiring UI/client/test call sites accordingly.
Changes:
- Update
@commonplace/program-contractsstation/preset/drop types to usereplication/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
stationBadgeFornow formats the badge text as "<compiled_replication> station (<preset_id>)", which no longer ends with "station". The existing E2E testapps/console/e2e/model-program-canvas.live.spec.ts:80assertsgetByText(/station$/), so this change will break that test (and is also a user-visible regression in the badge copy). Keep the badge text ending withstationand rely ontitle(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.
There was a problem hiding this comment.
💡 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".
| 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, }; |
There was a problem hiding this comment.
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})`, |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
@commonplace/program-contractsforProgramStationReplication(single|peer).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
Bug Fixes