Skip to content

fix(boringstack): re-wire the API route on every attempt (build13 knip-unused park root cause)#154

Merged
agjs merged 1 commit into
mainfrom
fix/wire-resource-idempotent-remount
Jul 20, 2026
Merged

fix(boringstack): re-wire the API route on every attempt (build13 knip-unused park root cause)#154
agjs merged 1 commit into
mainfrom
fix/wire-resource-idempotent-remount

Conversation

@agjs

@agjs agjs commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Stacked on the park-fix PR. build13 parked on knip 'unused file' for the route — never mounted. Root cause (panel-corrected from an earlier scope misdiagnosis): generateResource gated wireResource inside if(!existsSync(dir)), so once the dir existed the route was never wired again; the UI side already re-wires unconditionally. Fix: move wireResource out of the scaffold branch (runs every attempt) + make wireRoutesFile/wireAppFile/wireSwaggerFile idempotent with independent import/entry guards (self-heals partial states). Panel PASS; full suite green (2832).

…p-unused park root cause)

build13 built the full slice (i18n + api-client clean) then parked on knip 'unused file'
for supplier.routes.ts/schemas.ts — the route was never MOUNTED. Root cause (panel-found,
correcting an earlier scope-based misdiagnosis): generateResource gated wireResource inside
`if (!existsSync(resourceDir))`, so once the dir existed — a pre-existing dir, or a
near-green rollback that reverted the mount — the route was NEVER wired again. The UI side
(generateFeature) already re-wires unconditionally via wireUiFeature; the API didn't.

Fix (mirrors the UI): move wireResource OUT of the scaffold branch so it runs on EVERY
attempt, and make wireRoutesFile/wireAppFile/wireSwaggerFile IDEMPOTENT (each returns the
source unchanged when its import/mount/tag is already present — matching wireUiRouteFile/
wireTestHelperFile). This self-heals a lost or absent mount (routes map + app .group +
swagger, all three) without double-inserting. The harness keeps ownership of wiring — no
model-owned mount path, no widened scope (the rejected earlier approach).

Tests: idempotency for all three wire* fns; generateResource on a pre-existing dir now
mounts the route (routesSrc contains the entry) and a double-run does not double-mount.
Full core suite green (2830), lint + typecheck clean.
Base automatically changed from fix/expert-rescue-empty-fingerprint to main July 20, 2026 21:02
@agjs
agjs merged commit 52cd49c into main Jul 20, 2026
1 check passed
@agjs
agjs deleted the fix/wire-resource-idempotent-remount branch July 20, 2026 21:02
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