fix(boringstack): re-wire the API route on every attempt (build13 knip-unused park root cause)#154
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).