Skip to content

Commit bb27443

Browse files
patrozaclaude
andcommitted
docs: correctness fix too — facade removes silent unknown/any degradations
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 01ae23c commit bb27443

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/effect-schema-facade-emit.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ saving **scales with the number of programs / project references / parallel chec
9090
them, the larger the absolute win. A monorepo with many project references is the worst case for
9191
stock and the best case for the facade.
9292

93+
### Not just performance — correctness
94+
95+
This is **also a correctness fix**, not only a speed-up. When the schema generics get deep/complex
96+
enough, the checker hits its instantiation/depth limits and **silently** falls back to `unknown` /
97+
`any` for whole views — `DecodingServices` / `EncodingServices`, constructor / `make` members, the
98+
decoded `Type` and `Encoded`. There is **no error**: the program type-checks green against a degraded
99+
type. In large projects this is worse, and it is **non-deterministic** — it depends on checker /
100+
project / worker state, so it shows up most under **tsgo's default multi-threaded mode** (each worker
101+
hits the wall independently) and can differ run-to-run.
102+
103+
Because the facade materializes every view as a **named literal interface once at emit**, consumers
104+
read fully-resolved types instead of re-deriving (and giving up on) them — the views are stable and
105+
correct regardless of program count or worker. Switching the scanner onto this surfaced **several
106+
real bugs** that the silent `any`/`unknown` had been masking (missing required services, wrong
107+
make-input shapes, fields that had silently widened). So the facade both cuts instantiations and
108+
**removes a class of silent, non-deterministic type degradations**.
109+
93110
---
94111

95112
## How

0 commit comments

Comments
 (0)