Skip to content

Commit ef903fd

Browse files
committed
yama: tighten the hidden-fake criterion to curb false positives (review note)
Per review on #58: the 'fake string inside a shared *Types.res entry' blocking criterion is judgment-heavy — an LLM could flag legitimately-string fields. Add an explicit guard: only BLOCK after VERIFYING against the source .d.ts that the TS type was genuinely richer and got narrowed; a field that is legitimately `string` in TypeScript is not a violation.
1 parent a7870ef commit ef903fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

yama.config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ review:
181181
- condition: "Generated ReScript introduces a type variable ('a) that does NOT round-trip — it appears only in OUTPUT positions (a getter/method return, or a callback param the consumer receives) and never in a consumer-supplied input, so it unifies with anything (e.g. an `any` field surfacing as `routes(): RouterRoute<'a>[]`)"
182182
action: "BLOCK"
183183
reason: "An output-only 'a is an unsound cast (rule #4: a type var is only for a genuine round-tripping generic) — strictly worse than a flagged placeholder, and it compiles, so no other gate catches it"
184-
- condition: "A fake / plausible-but-wrong type (e.g. `string` where the TS type was richer) is emitted UNFLAGGED inside a shared *Types.res entry (an @unboxed arm, a record field, or a views-module member) — no ⚪/🔍/🛑 bucket comment, because the prop only holds a typeRef and the imperfection does not bubble up"
184+
- condition: "A fake / plausible-but-wrong type is emitted UNFLAGGED inside a shared *Types.res entry (an @unboxed arm, a record field, or a views-module member) — no ⚪/🔍/🛑 bucket comment, because the prop only holds a typeRef and the imperfection does not bubble up. ONLY block after VERIFYING against the original .d.ts that the TS type was genuinely richer (e.g. a union, object, or callback) and got silently narrowed to `string` — a field that is legitimately `string` in TypeScript is NOT a violation"
185185
action: "BLOCK"
186-
reason: "'Flag, don't fake' must hold even when the fake hides behind a shared type reference and the report shows the prop as usable"
186+
reason: "'Flag, don't fake' must hold even when the fake hides behind a shared type reference and the report shows the prop as usable — but only when the source .d.ts confirms the type was actually narrowed (do not block genuine string fields)"
187187
- condition: "A change makes generated output nondeterministic (same input → differing output across runs) — e.g. unordered iteration, time, or randomness reaching emitted code"
188188
action: "BLOCK"
189189
reason: "Determinism is a core product guarantee; nondeterministic output is unshippable"

0 commit comments

Comments
 (0)