Commit Graph
539 Commits
Author SHA1 Message Date
Chris Tate 5d4171f548 async_free gate: the IR-level detector behind SC4005
- moduleCoreAsyncSurface finds the first async/timer/event-loop/ambient-process reach with its source anchor (async/generator functions named; libCall prefix table over timers/child/net/http/streams/signals; refused value kinds)
- coarse moduleUses* predicates as the entry-anchored safety net behind the fine-grained table
- six-program detection test (sync graph clean; async fn, generator, setTimeout, spawnSync, process.on refused)
2026-07-23 01:06:51 -05:00
Chris Tate 4e88c0d920 Parity bookkeeping for the new fixtures
- order-parity baselines re-record for corpus 2426-2430 (new entries only, no behavior moves)
- multiple-errors pins mixed-kind loose equality (same-kind == lowers now)
2026-07-23 01:05:22 -05:00
Chris Tate 8dcf831cea Core-mode profile loader and the SC4xxx refusal block
- loadCoreProfile parses/validates the ratified profile shape (prefix discipline, pairwise-distinct symbols, meaning-changing unknown-field refusal, both arena postures, the collect entry)
- u8/u32/i32 plumbing classes accepted in parameter position only; integer returns name ask 4 in the refusal
- SC4001–SC4007 factories in the diagnostics registry, with the SC4004/SC4005 profile-teaching rider
- 17-case validation test
2026-07-23 01:00:42 -05:00
Chris Tate deca3c2590 npm-static: a node:module import marks the package an offender
- esbundled's esbuild banner runs createRequire(import.meta.url) at module init; a static compile would fence at load where the island runs the package as shipped, so the opt-in falls back with the reason naming the pattern
- the ambient allowlist made node:module non-bare, so the check keys canonicalBuiltinModule alone
2026-07-23 00:54:25 -05:00
Chris Tate df07833e12 Same-kind loose equality lowers as strict equality
- == and != between two strings, two numbers, or two booleans dispatch to === per the spec (typeof guards spelled ==, n != 0); mixed kinds keep the SC1040 fence
- corpus 2430 pins typeof/number/string/bool forms and the == null idiom on both backends
2026-07-23 00:49:01 -05:00
Chris Tate fc84780ebe Deferred-init fields: stream!-style classes lower with typed extraction reads
- a !-asserted (or SPI-off) field first assigned past the constructor's top level rides an undefined-armed union slot: allocation writes the interned undefined, writes wrap, reads extract the declared type
- scalar reads take unit defaults where JS-undefined behavior survives (bool false, f64 NaN — conditions and arithmetic exact); string/ref reads keep the checked-extraction trap, JS's own first-member-use TypeError named earlier
- union/map/dyn-typed ! fields keep the fence; deferral propagates down the base chain with the fields map
- diagnostics fixtures re-pin the surviving fences; corpus 2429 pins the Output.initialize idiom on both backends; SEMANTICS.md 372-375
2026-07-23 00:40:54 -05:00
Chris Tate 0cb45afc27 Fixture and manifest bookkeeping for the graduated lowerings
- default-export.ts diagnostics fixture repoints to the surviving export= fence (the mutable-default form graduated to corpus 2426)
- destructuring-fences.ts pins the class-instance residue: method extraction, rest elements, setter-only reads (field/getter destructures graduated to corpus 2429)
- surface-manifest sc1031 sample moves to the method-extraction refusal; manifest regenerated for the new builtin list and hint text
- order-parity baselines re-recorded: new fixtures 2426-2430, create-require, npm-reexport, and the SC1010 hint text
2026-07-23 00:37:25 -05:00
Chris Tate 37b8632cf8 As-const command tables lower: the readonly-[] panic repair and width lifts
- tsgo panics computing readonly [] (the empty as-const array) and the facade answers any; the syntax pins the truth, so the record member walk, lowerArrayLiteral, the island-literal route, and lowerAsExpression each repair the shape to the unit-element array
- func arms now map beside data arms in unions (typeof narrows, unionEq compares closures per tag); the diagnostics pin updates
- widthLiftPlan learns tupleArr (tuple fields into array slots, per-position) and emptyArr (unit-only-element arrays reshape to a fresh empty array behind a runtime non-empty trap), so Pick-style {name, aliases} flows lift
- corpus 2428 pins the command-table idiom end to end on both backends
2026-07-23 00:25:48 -05:00
Chris Tate 121bf73f35 JS function-level poisons defer as fence-bodied functions
- a parameter-pattern/default poison in a JS source no longer fails the build: the function compiles as a single runtimeFence body (calling it throws the first captured diagnostic at its source position), the statement-deferral stance applied one level up
- signatures whose ABI names an unregistered class emit no function (the emitter would name a nonexistent struct); the diagnostics still move to the runtime-fence ledger — no call site can lower such a value (brokenGlobals family, validator backstop)
- prettier's source CLI graph now measures blocker-free; the real build proceeds to the IR validator, exposing ~61 latent SC9001 ICEs as the next burn-down list
2026-07-23 00:22:24 -05:00
Chris Tate 009a24b469 Field redeclares, class destructuring, unknown-field completion, node:module fence
- redeclaring an inherited field WITH an initializer lowers as the [[Define]]-equivalent assignment into the base slot at the subclass's field-init position (builtin Error prefix included — prettier's errors.js `name = "ConfigError"`); bare and type-changing redeclares keep sharpened fences (corpus 2428, diagnostics inheritance re-record)
- object destructuring of CLASS instances desugars to one member read per element, left to right: fields read slots, accessors call getters through the fieldGetExpr dispatch, renames/parameter patterns/defaults included (corpus 2429 — prettier's AstPath { previous, next })
- an object literal missing an 'unknown' field completes with the DOM undefined (the absent-property read's answer), at literal completion and in the record width relation (corpus 2430 — prettier's getFileInfo(file, {}))
- node:module joins the supported builtins prefix-only as an admit-then-fence surface: createRequire keeps a per-member fence that defers to a catchable runtime error in JS sources (diagnostics create-require pins the hint naming the pattern)
2026-07-22 23:48:01 -05:00
Chris Tate 2fc897751e Generic members: instance-field arrows and async bodies monomorphize
- class fields initialized with a generic arrow/function expression collect as generic members (no field slot, static per-instantiation dispatch, this as param 0); value reads and writes keep fencing at their sites, which enforces never-reassigned by construction
- the async fence in collectGenericMember lifts: generic async methods, statics, and field arrows lower as async IrFunctions through lowerGenericInstance's existing spawn-wrapper path
- Awaited<T> over a bound type parameter resolves against the binding (promise kinds unwrap recursively), so async generic bodies can bind their await results
- shadowing fences both ways: fields over inherited generic members and redeclared generic field members
- corpus 2427 pins the Output.time idiom, async generic methods, and async generic statics on both backends
2026-07-22 23:31:35 -05:00
Chris Tate 871284a382 Mutable-default snapshots, npm named re-exports, and perf_hooks performance.now
- export default <mutable let> registers Node's snapshot as const storage keyed by the default alias symbol; resolveValueSymbol's default-hop walk stops importer reads there instead of chasing to the live let (corpus 2426 pins the snapshot/live split against export { x as default })
- named re-exports from installed npm packages lower as import-plus-export plumbing: the island load registers at the statement's position and bindings key the aliased symbols direct imports use (npm case npm-reexport covers named, renamed, CJS, and as-default spellings)
- node:perf_hooks joins the supported builtins: performance.now() lowers to scr_perf_now (the uptime anchor's monotonic clock, fractional ms), and performance.now.bind(performance) lowers as a () => number function value (corpus 2427); both backends
2026-07-22 23:21:59 -05:00
Chris Tate 8afa2d986e String/Number/Boolean as values: interned coercion closures
- StringConstructor/NumberConstructor/BooleanConstructor (stdlib provenance) map to the one concrete signature (value: string) => primitive
- bare String/Number/Boolean identifiers lower to interned %builtin.* closures (String identity, Number via num.fromString, Boolean emptiness), so === is JS function identity
- union func arms relax to func/unit siblings (unionFuncSetArmsOk, shared frontend/validator): closure pointer identity per tag is the narrowing
- the unionKeyGet join guards against unbuildable arm kinds instead of interning them
- corpus 2426 pins the option-table idiom on both backends
2026-07-22 23:18:27 -05:00
Chris Tate 50ab17b313 Release 0.0.3
- The supported-surface manifest ships with the release artifacts
v0.0.3
2026-07-22 22:31:02 -05:00
Chris Tate dd61b85ba6 Supported-surface manifest per release
- 302 entries generated from the diagnostics registry and lowering tables
- Non-static entries carry their SC code; compilerVersion is the release string
- Committed, shipped in the compiler package, attached to GitHub releases
- Sampling harness asserts refusal codes equal listed codes
2026-07-22 22:29:39 -05:00
Chris Tate 93fdc9fbc6 Adversarial flow-narrowing corpus: 34 fixtures
- Narrowing establishment/containment, kill routing, sibling-arm restoration
- Terminality, do-while, ternary lowering, nullish and IEEE corners
- All byte-exact against Node on both backends; two fixtures renumbered 2424/2425
2026-07-22 22:09:48 -05:00
Chris Tate 6a78f9a96b Release 0.0.2
- Number(string), Array.from(string), dot specifiers, workspace registration
- Coverage renders full diagnostics; LLVM declares guarded against the runtime header
v0.0.2
2026-07-22 22:02:28 -05:00
Chris Tate d66c36b020 Ship a per-release surface manifest with stable ids and refusal codes
- packages/compiler/surface-manifest.json is generated (pnpm manifest), committed, and shipped in @scriptc/compiler; entries project mechanically from the diagnostics registry, the unsupported-syntax dispatch tables, the stdlib/builtin lowering tables, and the supported-builtin-module list
- every non-static entry carries the SC code the compiler raises for it, and the version spine is the exact published release version
- FENCE_CODES joins the diagnostics registry so factory-minted construct fences are enumerable
- the sampling harness compiles listed-static probes and asserts each sampled non-static entry refuses with exactly its listed code, beside a byte-identical staleness guard
- the release workflow regenerates the manifest, fails on drift, and attaches it to the GitHub release
2026-07-22 22:01:45 -05:00
Chris Tate b9662a34a1 Pin flow-narrowing state routing across merges, loop edges, and do-while (corpus 2390-2423)
- Establishment/containment: miss-first ternary polarity, else-if head exits, bare-block vs alias guards, break/continue exit guards, post-loop re-tests, while-condition guards, born-narrowed declarations (2390-2396)
- Kill routing: branch/switch-arm/reassignment-polarity kills at merges, and kills riding return/break/labeled-break/continue/throw edges (2397-2406)
- Terminality: infinite-loop sealing and re-opening, loop-body returns, stacked and trailing-empty case labels, defaultless exhaustive switches (2407-2411)
- do-while trailing tests under body guards, kills, continue, and break, plus spread-arm ternary lowering shapes, ?? null identity, float-lane bounds, IEEE remainder corners, and parameter null reassignment (2412-2423)
- Order-parity baselines re-recorded for the new entries (pure addition)
2026-07-22 21:40:11 -05:00
Chris Tate 3b5bbc7eaa Vercel CLI source ladder: five frontend fixes from the typecheck gate
- Bare '.' and '..' specifiers resolve as relative directory imports
- TS default imports of supported builtins pass under the project's interop knobs
- Workspace packages register eagerly before the tsc gate; their shipped JS never gates
- Benign-cycle admission accepts d.ts-rooted callable arguments in the init window
- npm-static auto probes from the importing file's realm; ladder fixtures renumbered 2390/2391
2026-07-22 21:35:46 -05:00
Chris Tate 46febafe93 Parity bookkeeping for the new dot-specifier fixtures
- resolver-parity routes bare '.' and '..' through the relative arm (ts5 resolves them relative too)
- order-parity baselines recorded for corpus 2386/2387 and the workspace-unclean npm case
2026-07-22 21:12:38 -05:00
Chris Tate 235709a53d Agent-driven release process: RELEASING.md, changelog, version stamp
- RELEASING.md makes 'prepare X release' a complete prompt; AGENTS.md points at it
- CHANGELOG.md carries the marked 0.0.1 entry; the marked block is the release body
- sync-versions.mjs stamps the three packages in lockstep
- A github-release job tags and publishes the body after npm publish
2026-07-22 21:04:18 -05:00
Chris Tate 9deedfd074 Add the agent-driven release process: docs, sync script, tag job
- RELEASING.md documents the lockstep three-package prepare flow and the marked-changelog convention
- CHANGELOG.md starts with an Unreleased section and the marked 0.0.1 entry that becomes the GitHub release body
- AGENTS.md states repo-wide build/test conventions and defers docs-site specifics to docs/AGENTS.md
- scripts/sync-versions.mjs stamps runtime and compiler from the CLI version; the workflow's sync check now hints at it
- release.yml gains a github-release job that tags v<version> after a successful publish, never gating npm
2026-07-22 21:03:10 -05:00
Chris Tate 5d25bdb004 Vercel CLI source ladder: five frontend fixes from the typecheck gate
- workspace-linked untyped dists register before the tsc gate and take the node_modules-JS island treatment (errors suppressed, out of userFiles)
- bare '.' and '..' specifiers resolve as relative directory imports (corpus 2386, coverage fixture dot-parent, SEMANTICS 362)
- TS default imports of supported builtins pass under the project's adopted interop knobs (corpus 2387)
- benign-cycle admission accepts d.ts-rooted callable arguments — promisify(fs.readFile) at a cycle member's top level (SEMANTICS 363)
- --npm-static auto probes runtime JS from the importing file's realm, not the entry's (nested-realm fixture)
2026-07-22 20:57:56 -05:00
Chris Tate 8af0ae65f3 Number(string) lowers statically: JS-exact ToNumber in the runtime
- ECMA StringNumericLiteral exactly; 1M-string fuzz bit-exact against Node
- Unary + on strings and %d over strings ride the same libCall on both backends
- 50k-case oracle file under ASan; size canaries re-based one page
2026-07-22 20:40:05 -05:00
Chris Tate 855e80910c Re-base the static size canaries and order-parity baselines
- StringToNumber (~1.3KB in the always-linked string TU) tipped the Mach-O static class one 16KB page: hello-world measured 336,328 before and 353,000 after, so both canary arms move to 361,000 with the under-a-page cushion kept
- order-parity baselines record the three new tonumber corpus fixtures
2026-07-22 20:19:15 -05:00
Chris Tate e53dc344a5 Lower Number(aString), unary + on strings, and %d over strings
- num.fromString rides both backends: the C emitter case and the LLVM declare table entry (declare double @scr_string_to_number(ptr), the C prototype exactly)
- Number(string) retires its fence; the union hint now points at narrowing (numbers, booleans, and strings lower)
- unary + on string operands and util.format %d string arguments take the same libCall
- corpus 2387 (argv-style CLI parsing), 2388 (the grammar zoo edge by edge), 2389 (+str idioms and %d) — differential-verified on both backends
2026-07-22 20:02:21 -05:00
Chris Tate 5d6abeaefe JS-exact StringToNumber in the runtime, fuzz-verified against Node
- scr_string_to_number: ECMA-262 StringNumericLiteral exactly — StrWhiteSpace trim (empty → +0), signed decimals through strtod over the validated span, unsigned 0x/0o/0b through the exact bignum rounding, trailing garbage → NaN
- oracle suite mirrors the formatting precedent: gen-tonumber-cases.mjs (Node is the oracle), 50k committed cases asserting bit-equal doubles under ASan + RC audit
- fuzzed once against Node on 1,000,000 mixed-shape strings: 1000000/1000000 bit-exact
2026-07-22 20:02:10 -05:00
Chris Tate 349ea4f51c LLVM runtime ABI guard and the differential scratch race fix
- Unique per-lane binary basenames end the shared-scratch race behind the CI failures
- Two latent emitter declare mismatches fixed; a header-parsed ABI guard test pins the class
2026-07-22 19:53:45 -05:00
Chris Tate e6b75ed803 Array.from and spread split strings by code points
- One interned helper walks the UTF-16 cursor; astral characters stay whole
- Both spellings share the lowering; corpus 2386 pins both backends against Node
2026-07-22 19:53:18 -05:00
Chris Tate 1e9b966894 llvm-differential: unique binary basenames end the shared-scratch race
- fs corpus programs derive scratch paths from tail(process.argv[1]); both native lanes were named "program" and run concurrently, so they raced on the same scratch tree
- reproduced locally by racing the two same-named binaries (6-9 of 10 runs diverge); distinct basenames run clean
- explains the seven fs/path failures of CI run 29965245855, including a C-lane empty stdout no LLVM codegen bug could produce
- the basename also carries the flavor so a plain and sanitized full run cannot collide either
2026-07-22 19:25:30 -05:00
Chris Tate bfc415ab59 Match LLVM runtime declares to scr_runtime.h and guard the ABI
- fsp.readFile now passes only the path: the C prototype has no encoding parameter, so the generic path declared an argument the runtime never had
- net.serverAddress: family is a +1 ScrStr* ("IPv4"/"IPv6"), not a double — the declare, call, and field store all read it through the wrong register class
- new llvm-runtime-abi test parses scr_runtime.h and cross-checks every literal backend declare plus every declare emitted for an fs/path corpus slice
2026-07-22 19:25:22 -05:00
Chris Tate 7fca9785ea Coverage renders the diagnostics it stops on
- A type-error stop prints the same code frames a build prints
- The import-site stop renders its diagnostics below the blocker table
- Coverage is the first command reached for; the verdict line alone swallowed the fix
2026-07-22 19:23:23 -05:00
Chris Tate 005a54caa2 Default OG and tagline: TypeScript-to-Native Compiler 2026-07-22 19:04:55 -05:00
Chris Tate bcc094862b Docs: TypeScript-to-Native Compiler hero, npm install quickstart
- Quickstart installs from npm; from-source moves to a pointer at the repo
- Node floor matches the package engines field
2026-07-22 18:45:02 -05:00
Chris Tate 60a135f505 Publish with provenance only from a public repository
- npm rejects provenance from internal-visibility repos; the flag now follows repo visibility
2026-07-22 18:38:28 -05:00
Chris Tate 6439e2aa85 Pin the pnpm version in the release workflow 2026-07-22 18:35:17 -05:00
Chris Tate 8e6a20d59f Release workflow: npm trusted publishing on version change
- OIDC id-token in the Release environment; no npm token secret
- pnpm pack rewrites workspace deps; npm publish adds provenance
- Publishes runtime, compiler, cli in dependency order; re-runs skip published versions
2026-07-22 18:31:33 -05:00
Chris Tate 23d5918a53 init 2026-07-22 18:08:04 -05:00