Skip to content

refactor(ts): TS-7 — final sweep: cycle-free proof, static audit, cleanups - #70

Closed
gocanto wants to merge 5 commits into
refactor/ts6-cli-unificationfrom
refactor/ts7-sweep
Closed

refactor(ts): TS-7 — final sweep: cycle-free proof, static audit, cleanups#70
gocanto wants to merge 5 commits into
refactor/ts6-cli-unificationfrom
refactor/ts7-sweep

Conversation

@gocanto

@gocanto gocanto commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Stage 8/8 (stacks on TS-6). FormatAllCommand extracted to its own module (dissolves the TS-6 deferred import cycle; Tarjan SCC proof over all 50 modules: zero cycles). Static-namespace audit: VueScript, MarkdownFences, FileTargets converted to injected instances (FileTargetPolicy; PassCliDto.parse takes it explicitly); every remaining static surface is a sanctioned value-type factory or documented exception. The TS-2 double-cast eliminated via a properly-typed failure union. Stale JSDoc and transitional comments swept. 187 tests, 98.34% lines, ts-infra 18/18, smoke + self-format clean.

@gocanto
gocanto force-pushed the refactor/ts6-cli-unification branch from 68c5443 to 605c1ba Compare July 24, 2026 03:06
@gocanto
gocanto force-pushed the refactor/ts7-sweep branch from dbf908e to e6fecb3 Compare July 24, 2026 03:06
@gocanto
gocanto force-pushed the refactor/ts6-cli-unification branch from 605c1ba to 689cb5a Compare July 24, 2026 03:13
@gocanto
gocanto force-pushed the refactor/ts7-sweep branch from e6fecb3 to 9685bfc Compare July 24, 2026 03:13
@gocanto
gocanto force-pushed the refactor/ts6-cli-unification branch from 689cb5a to f426a87 Compare July 24, 2026 03:19
@gocanto
gocanto force-pushed the refactor/ts7-sweep branch from 9685bfc to 29170fe Compare July 24, 2026 03:19
gocanto added 5 commits July 24, 2026 11:20
Extract FormatAllCommand into cli/format-all-command.ts (importing only its
direct deps), matching format-pass-command.ts/validate-syntax-command.ts.
cli/format-all.ts is now a pure entry (main + run-as-main guard importing only
CompositionRoot); composition-root.ts imports the command module. sidecar.ts
still imports #sidecar/cli/format-all.
…d instances

Removes the last static-namespace classes in the sidecar. VueScript and
MarkdownFences become instances injected into EmbeddedBlockSplitter. The
static FileTargets class (and its module-private EmbeddedBlockSplitter
singleton, the TS-3 compromise) becomes FileTargetPolicy, an instance holding
its splitter, constructed once in PipelineFactory and injected into the
declaration-aware passes (ExpandedCallPass, DrizzleQueryPass) and the CLI
commands. PassCliDto.parse now takes the policy as an explicit argument.
Widen the failure branch of ParsedSourceDto.from to carry an unparameterised
z.ZodError. The schema output omits the DTO's own methods, so the previous
`parsed.error as unknown as z.ZodError<ParsedSourceDto>` bridged the phantom
generic; since the only caller (SourceParser.parse) discards the typed payload
and raises a fresh SourceUnparsable, the unparameterised error is exact and the
double cast is gone.
Reword two test comments that named the pre-refactor BlankLines.insert and
FluentChains.format classes to describe the current BlankLinePass reference
behaviour and the fluent pipeline order. Make EmbeddedBlockSplitter's scanner
imports type-only now that they are used solely as constructor parameter types.
Runs `make format-all` (the repo's own pipeline) over the stage's edits: the
new FileTargetPolicy parameter pushes several constructor signatures past the
width threshold, so the formatter expands their inline dependency-object types
to one member per line and splits the delegated extractBlocks chains. Pure
whitespace normalisation, no behaviour change.
@gocanto
gocanto force-pushed the refactor/ts6-cli-unification branch from f426a87 to 357392c Compare July 24, 2026 03:20
@gocanto
gocanto force-pushed the refactor/ts7-sweep branch from 29170fe to 88b9db4 Compare July 24, 2026 03:20
@gocanto
gocanto deleted the branch refactor/ts6-cli-unification July 24, 2026 03:21
@gocanto gocanto closed this Jul 24, 2026
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