Repository navigation
docs(js): don't check at runtime what TypeScript rules out - #8985
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: fbfb6cbc70f87a2efcc337b130b2860307fd9bd2.
The TypeScript-only policy matches the decision in #8961. I’d narrow “Validate only data that crosses a trust boundary” to avoid telling future agents to remove checks for invalid values that TypeScript does allow, such as a negative sequence number typed as number, or a write after close. Keep runtime checks for invariants the types cannot express, and validate untrusted inputs at the boundary. No runtime change in this PR.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: single-commit docs change to js/AGENTS.md.
- No runtime type-check rule: adds one Conventions bullet saying only TypeScript callers are supported, so the code shouldn't check at runtime for misuse the types rule out. Validation stays for data crossing a trust boundary (wire, JSON via zod, element attributes).
claude-sonnet-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughAdds a convention for TypeScript callers. The convention advises against runtime checks for misuse already excluded by types. It limits validation to data crossing trust boundaries, such as wire data, JSON, and user input. Merge Risk:
|

Problem
The maintainer decided on moq-dev/moq#8961 that the JS API does not check at runtime what TypeScript already rules out, and asked for that rule in
js/AGENTS.md. Nothing there says so yet.Approach
One rule in
js/AGENTS.mdConventions: only TypeScript callers are supported, so no runtime checks for misuse the types rule out; validate only data crossing a trust boundary. The boundary wording matches how the code already parses: zod schemas on the catalog, auth, and JSON inputs, and element attributes that throw on an invalid value.Impact
None: internal agent docs only. Existing runtime type guards (for example
net/src/util/sequence.ts) are not touched here.Alternatives
None. No existing rule was close enough to tighten.
Follow-ups
None.
Validation
Docs change with no behavior to exercise.
just checkpasses;quest review --harness codexround 1 found nothing.Models
Size: S
Implementer: Claude Code, claude-sonnet-5-5, unknown effort
(Written by Claude Sonnet 5.5)
Review
Rewritten by
quest reviewafter each round.Head: fbfb6cb
Base: origin/main at 73d65ed
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e791-b5b6-7f51-ba16-c69b57f4d26c, round 1Score: 10/10,
The change only documents a validation policy consistent with existing review rules, changes no runtime behavior, and has no actionable defects.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none