Skip to content

Shared TypeScript HiveLaunchConfig is missing tier_policy; hiveLaunch.ts works around it with a local intersection type #277

Description

@rdfitted

Follow-up from #268 (PR #275). Found by the T7 worker during implementation and confirmed.

The problem

#271 added tier_policy to the backend HiveExecutionPolicy (src-tauri/src/domain/execution.rs), and #275 emits it from buildHiveLaunchConfig() in src/lib/components/hiveLaunch.ts.

But the shared TypeScript type HiveLaunchConfig in src/lib/types/domain.ts never gained the field. Confirmed: grep tier_policy src/lib/types/domain.ts returns nothing.

Why it was left alone

src/lib/types/domain.ts was outside T7's owned paths under the epic's one-owner-per-file rule, so rather than widen scope the worker used a local intersection return type in hiveLaunch.ts to represent the now-emitted backend contract. That was the right call at the time — but it means the shared type is now knowingly incomplete, and the workaround is invisible to anyone reading domain.ts.

Why it matters

The shared type is what other call sites reason about. Any future code that builds a launch config from HiveLaunchConfig will not know tier_policy exists, and TypeScript will not help them. The local intersection only protects the one function that declares it.

Suggested fix

Add tier_policy to HiveLaunchConfig in src/lib/types/domain.ts, mirroring the backend shape (enabled, ceiling_percent, review_floor, ladder), then drop the local intersection in hiveLaunch.ts.

Worth checking at the same time whether any other execution-policy field has drifted between domain.ts and domain/execution.rs — this one went unnoticed through a whole epic, so it is unlikely to be the only one.

Acceptance

  • HiveLaunchConfig carries tier_policy.
  • hiveLaunch.ts returns the plain shared type with no intersection.
  • npm run check clean; hiveLaunch.test.ts's full-shape toEqual assertion still passes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions