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
Add a language-neutral rule to the type-discipline contract for values that share a primitive #15840
The type-discipline contract says, in language-neutral words, that two values sharing a primitive type that must never be swapped each get their own type.
Demo: read the contract; the rule is there once, names no language, and its three synced copies match.
Source: Lauren Tan's pstack (cursor/plugins, MIT), pstack/skills/principle-type-system-discipline/SKILL.md:11: "If two arguments share a primitive type but mean different things, brand them".
Decisions
Owner, 2026-11-12: a take must land in its proper home. The contract is the home: its rules depend on no particular language. The rule exists today only in a TypeScript file.
Wording without a language: a distinct nominal type (a newtype, a branded type, a single-field wrapper) that only its parse produces.
It sits with the contract's existing line that a wrapper around values no code mixes up costs ceremony: this is the mixed-up case that line allows.
It takes no side on the open decision between a cast and a type guard.
Nothing here is a consumer setting.
Key interfaces
The type-discipline contract and its synced copies in planning, implementation and review.
Done when
The contract carries the rule, as one new row or an extension of the existing wrapper row.
The three synced copies are regenerated and the sync check passes, with a changelog fragment per carrier.
A search finds the neutral rule in exactly one source.
The pull request body names this repository's dogfooding step.
Out of scope
Editing or removing the TypeScript idioms page (the ecosystem-specifics cut owns that).
Activity
kyle-sexton commentedon Nov 13, 2026