You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cc78639
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: dead-code removal and de-duplication (#64)
* refactor(backend): remove the dead output-emit "plan" API
`planOutput`, `planScope`, `isGated`, `isIterated`, `compactTokens`, and
`OutputEmitPlan` were exported (and tested) but no backend consumed them - every
real consumer uses only the re-exported `outputGate`. Drop the unused cluster
and its tests; keep `outputGate` as the single entry point. Not part of the
hub public-API surface, so no consumer is affected.
* refactor(boutiques): collapse two identical union-descriptor builders
`buildSubCommandUnion` and `buildMixedUnionAsSubCommands` were byte-for-byte
identical, so the `allStruct` split in `mapUnion` chose between two copies of the
same logic. Collapse them into one `buildUnionSubCommands` and drop the dead
branch distinction.
* refactor(backend): share collectDefaults/rootFieldDefault across backends
The field-default collection and root-field-default lookup were copy-pasted four
times (each backend's arg-builder and outputs-emit, mirrored across Python and
TypeScript), differing only in the literal renderer. Extract them into
`field-defaults.ts` parameterized by a `renderLiteral` hook. Generated output is
byte-identical (verified by the snapshot/execution tests and the codegen gate).
* refactor(backend): inline the vestigial `emitOutputs` flag
Both codegen backends set `const emitOutputs = true` and then guarded every
outputs-related emit with it, and passed `true` to `emitImports`. Every tool
emits an Outputs object, so the flag was dead flexibility. Inline it (guards
become unconditional, `emitImports` drops the parameter). Output order preserved.
* refactor: drop unreachable branches and an unused parameter
- `isBooleanLiteralPair`: the `"0"`/`"1"` string comparisons are unreachable -
`literalFromNode` canonicalizes clean-int literals to the numbers 0/1, so only
"false"/"true" ever arrive as strings.
- argdump `applyMutualExclusion`: the `actionsByDest` map was built, threaded in,
and never read. Remove the map, the population, the parameter, and the argument.
0 commit comments