ushman-lab-types
v0.1.0
Published
Minimal workspace path resolver for local ushman sister-package development.
Readme
ushman-lab-types
Minimal v4 workspace path resolver used by local ushman sister packages.
What ushman-lab-types actually does
It's a leaf package that resolves v4 workspace paths. Three things, total:
- Path resolver — given a workspace root, returns ~30 paths (
asl/,asl/donor/,.lab/lab.json,.lab/capture/,.lab/parity/, candidatesrc//public//package.json/etc.). That'sresolveWorkspacePaths(root). - Layout detector — returns
'v3' | 'v4' | 'unknown'based on whether.lab/lab.jsonexists with the rightschemaVersion. - The v3→v4 migration error —
assertV4Workspace(root)throws a typed error with the canned "v3 workspaces are no longer supported, here's why" message and exit code 3.
That's it. 124 lines of JS + 65 lines of .d.ts.
Why it exists (the honest reason)
To break a circular dependency. Per its own AGENTS.md:
Sister packages (
@ushman/equiv,@ushman/client, future@ushman/verify,@ushman/characterize,@ushman/recover, …) need a workspace path resolver, but they cannot depend onushmanbecauseushmanalready depends on them — that would be a dependency cycle.
Today only two packages actually consume it:
@ushman/equivre-exports the whole surface fromsrc/workspace.ts(lines 8/17/57).@ushman/clientusesbuildV3MigrationMessageandresolveWorkspacePathsinsrc/server/workspaces.server.ts.
ushman itself reimplements the same shape internally in src/core/workspace.ts (buildV4Paths at line 153) with extra internal-only fields the sister packages don't need. So you have two parallel implementations kept manually in sync via the AGENTS.md rule "any field added to lab-types must already exist in ushman's buildV4Paths at the same path."
