fix(slice-05): align workflow_specs router target to live scanner contract (guard B1 repair on 08a74cea) (OPR.0.3.2.5)

Per velocity-guard BLOCKING-CONCERN on 08a74cea (qitem-…8056b750): the
router's documented default + test fixture TARGET pointed at
~/.openrig/workflow-specs, but the live spec-library-workflow-scanner
reads from <workspace.specs_root>/workflows (see startup.ts:903-916 +
spec-library-workflow-scanner.ts:320-342). Writing anywhere else would
have routed workflow specs to a location the workflow scanner does not
read — operator dead-end: install succeeds but specs invisible. Guard
caught this BEFORE step 3 integration baked the wrong target into the
/install path.

Fix is contract-realignment, not algorithmic — the router is parametric
on targetWorkflowSpecsDir, so the bug is in the documented contract +
test fixture, not the logic:

bundle-workflow-specs-router.ts: RouteWorkflowSpecsInput.targetWorkflow
SpecsDir doc upgraded to a full **CALLER CONTRACT** block. Explicitly
names the live scanner location (`<workspace.specs_root>/workflows`),
points to the startup.ts deps.workflowsFolderDir resolution
(ContextPackSettingsStore: env > config > workspace-default, default
`<openrigHome>/specs/workflows`), and explicitly calls out the failure
mode ("writing anywhere else will succeed silently but be invisible to
the live workflow scanner — operator dead-end"). Step 3 integration is
explicitly named as the resolution site that must obey this contract.

bundle-workflow-specs-router.test.ts: TARGET fixture changed from
"/operator/.openrig/workflow-specs" to "/operator/.openrig/specs/workflows"
to reflect the canonical operator-host layout. W2/W3/W8 installedAt
assertions adjusted automatically (interpolation of TARGET). Comment
above TARGET pins WHY this path was chosen + where the contract is
documented + that step 3 cannot drift.

No algorithmic change to routeWorkflowSpecs; product code only touched
in the type doc comment + the test fixture string. 8/8
bundle-workflow-specs-router tests green with the corrected TARGET.
25/25 across all 3 router test files unchanged (skills 8 + plugins 9 +
workflow_specs 8).

Discriminator-flip not relevant for a contract-realignment commit (no
new code path to assert). The proof is: the doc now points at the
scanner-reachable location, and step 3 will obey it.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
mvschwarzandClaude Opus 4.7 committed 2026-05-31 18:59:17 -07:00
1 parent 08a74ceacb
commit a2726e8f51
2 files changed
+25 -2

No files matched your search

@@ -42,7 +42,21 @@ export interface RouteWorkflowSpecsInput {
bundleRoot: string;
/** Relative workflow_spec paths declared in the manifest's workflow_specs[] block. */
declaredWorkflowSpecs: string[];
/** Absolute path to the operator workflow-specs library (default ~/.openrig/workflow-specs). */
/**
* Absolute path to the operator workflow-specs library that the
* spec-library-workflow-scanner ACTUALLY reads from. **CALLER CONTRACT**:
* this MUST be `<workspace.specs_root>/workflows` — the folder discovered
* by `scanWorkflowSpecFolder` in
* `packages/daemon/src/domain/spec-library-workflow-scanner.ts:320-342`
* and exposed via `deps.workflowsFolderDir` in
* `packages/daemon/src/startup.ts:903-916` (resolved from
* ContextPackSettingsStore: env > config > workspace-default, default
* `<openrigHome>/specs/workflows`). Writing anywhere else (e.g.
* `~/.openrig/workflow-specs/`) will succeed silently but be invisible
* to the live workflow scanner — operator dead-end. The /install
* integration helper (Checkpoint 7.3e step 3) MUST resolve this path
* before calling routeWorkflowSpecs.
*/
targetWorkflowSpecsDir: string;
}
@@ -24,7 +24,16 @@ function mockFs(initialFiles: Record<string, string> = {}): WorkflowSpecsRouterF
}
const BUNDLE_ROOT = "/bundle/root";
const TARGET = "/operator/.openrig/workflow-specs";
// TARGET reflects the CALLER CONTRACT documented in
// bundle-workflow-specs-router.ts RouteWorkflowSpecsInput.targetWorkflowSpecsDir:
// the operator workflow-specs library is `<workspace.specs_root>/workflows`,
// the path the live spec-library-workflow-scanner reads from
// (see daemon startup.ts:903-916 + scanner.ts:320-342). Default
// workspace.specs_root layout = <openrigHome>/specs, so the workflows folder
// resolves to <openrigHome>/specs/workflows. The router itself is parametric
// on targetWorkflowSpecsDir; this test fixture pins the contract so step 3
// integration cannot drift to an unscanned location.
const TARGET = "/operator/.openrig/specs/workflows";
function makeInput(overrides?: Partial<RouteWorkflowSpecsInput>): RouteWorkflowSpecsInput {
return {