Give workspace names, herdr ids and commands their own opaque types #429
Labels
No labels
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#429
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The terminal workspace port addresses everything with bare
String. Threedifferent things share that one type, and the compiler cannot tell them apart.
<project>-<key>, e.g.iw-cli-IW-422. tmuxaccepts this directly as a session name.
workspace by id only and does not accept a label, which is why
HerdrLookupexists: it turns a checkout path or a label into an id.Two consequences, both already met in IW-422:
RunInWorkspace.apply(workspace: String, command: String)takes two Strings.Transposing them compiles cleanly and fails only at runtime — it would run the
workspace name as a command, inside a workspace named after a command.
issue documented this trap and worked around it in
HerdrLookup; the typesystem does not enforce it.
Proposal
Introduce opaque types in
core/model/and thread them through the port.The design content is not the typing — it is deciding where each type starts and
stops. Specifically: at which boundary a
WorkspaceNamebecomes aHerdrWorkspaceId, whetherHerdrWorkspaceIdbelongs inmodel/or beside theherdr adapter, and where the raw
Stringis recovered foros.proc.Estimated blast radius (measured 2026-08-21)
core/model/TerminalWorkspaceOpssignaturesLiveTmuxOps,LiveHerdrOps,UnavailableWorkspaceOpsnamereferencesFakeTerminalWorkspaceOpsTmux.scalaargv builders.valueat the process boundaryHerdr.scalaRoughly half a day. The work is mechanical and compiler-driven — it does not
compile until every boundary is converted, so nothing is silent.
Origin
Raised while triaging LESSONS.md for IW-422, from the entry on narrowing
SessionHooksto the capability it calls. Naming the capability(
RunInWorkspace, commit69b2c64) restored the parameter roles in the type butleft both parameters as
String. This issue closes the remaining gap.