Skip to content

fix(contracts): dedupe Environment types into a shared contract#169

Closed
OnlyTerp wants to merge 1 commit into
sybil-solutions:mainfrom
OnlyTerp:fix/environment-contract-dup
Closed

fix(contracts): dedupe Environment types into a shared contract#169
OnlyTerp wants to merge 1 commit into
sybil-solutions:mainfrom
OnlyTerp:fix/environment-contract-dup

Conversation

@OnlyTerp

@OnlyTerp OnlyTerp commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

npm run check:contracts currently fails on main:

Duplicate exported type/interface declarations found:
- Environment
- EnvironmentEngineId
  controller/src/modules/environments/types.ts
  frontend/src/lib/types.ts

Same playbook as #159: one declaration, re-exports everywhere else.

  • New shared/contracts/environments.ts holds the single Environment + EnvironmentEngineId declarations (registered in validate-shared-contracts.mjs contract names + allowed files).
  • controller/src/modules/environments/types.ts and frontend/src/lib/types.ts become re-exports.
  • The controller-only EnvironmentId brand + asEnvironmentId are dropped — they were used in exactly one place (the serializer's return cast) and the wire shape is id: string on both sides anyway.

Test plan

  • node scripts/validate-shared-contracts.mjs passes
  • bun run typecheck (controller), tsc --noEmit + typecheck:desktop (frontend)
  • environments-routes integration tests 4/4
  • knip, jscpd, ui-structure, cycles, depcheck, production build (pre-push check:quality)

@OnlyTerp
OnlyTerp requested a review from 0xSero as a code owner July 2, 2026 01:24
@OnlyTerp

OnlyTerp commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Closing — you beat me to it: 6532ce7 + 4fba584 landed the same consolidation into shared/contracts/environments (including dropping the id brand, 80fc4fa) while this was in flight. Race conditions of parallel agent loops.

@OnlyTerp OnlyTerp closed this Jul 2, 2026
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