ReviewOS

home-lang/home

fix(ts): match isolated ambient const-enum diagnostic locations

#844
Open chris opened this 8 days ago ·
8 days ago

Current status (2026-10-08 UTC)

Published as Chris directly to origin/main, without coauthors: 4e8ee8637, fix(ts): preserve ambient enum option and access diagnostics (#844).

The checker now reports ambient enum value import/re-export errors under verbatimModuleSyntax, and actual imported member/element accesses under isolatedModules. Unused isolated-only bindings remain legal; genuine TS2748 is preserved. Config verbatimModuleSyntax was parsed but dropped by the driver; it now reaches checker flags.

The original mismatch was independently verified on shallow source 30d3824: TS2748 at index.ts(2,31), while Home wrongly reported the import and re-export bindings. Deep missing-export failures were separate under #843. Initial failed oracle/config runs remain in evidence rather than being relabeled successful.

Verification and remaining acceptance

  • All 24 no-flag / isolated / verbatim / both × unused / member / alias / element / namespace / type cases exactly match TS 6.0.3 diagnostic codes, counts, primary positions, messages and success/error exit classes.
  • Six 1/8/32-layer valid/isolated cases also match, on combined published source 929d46a with #843's traversal. The 32-layer graph includes a cycle.
  • Full checker 4493, driver 199, Program 237, CLI 74 and entrypoint 33 tests passed; final Program/CLI/entrypoint reruns passed after the last #843 edge change. Harness 128 passed, no named test exclusions.
  • Zod's complete 196 TS + 3 HM9002 diagnostic multiset is unchanged; this is not Zod admission. Pickier fails on the unchanged repository-wide 22,074 problems, not a lint pass.
  • Keep open pending broader module-mode/ambient/import-equals and nested namespace acceptance review. Separate real .ts default-import checking remains a failing oracle under #845; it is not among the 30 passing cases.

Documentation / costs

aed1dad3b publishes detailed docs, the brief README cost table and raw evidence: 592 pair rounds, 448 passing admissions, 6,206 verified checksums. Archive SHA-256 705bcf5818d80aaf4138ee9afc0efbe894af8049233dc2056a5f830ebf0e09cf.

Exact integrated-parent graph/scale confirmation medians are 2.9%/1.5% slower; both saving intervals span zero. Large-predicate 3.1% slower screen and 0.5% slower independent recheck are both retained. No speedup, equivalence or universal no-regression claim. Full report. Related #416, #843, #845, #548.

8 days ago

The #843 complete-traversal prototype removes depth-related TS2305 on the valid 8/32-layer graphs, but does not fix this shallow diagnostic-location contract: TS 6 reports TS2748 only at index.ts(2,31), while both shallow parent/candidate report re-export chain0.ts(1,16) plus import index.ts(1,10). At 32 layers the complete candidate exposes 18 TS2748 reports versus oracle one, so #843 acceptance is held rather than normalizing away the additional failures. Corrected fixtures use explicit export type { Shape }, eliminating unrelated TS1205 errors. All initial/corrected input hashes and raw diagnostic identities are retained in /Users/chris/.cache/home-ts-843.3BeUMH. No diagnostic fix or accepted performance claim yet.

8 days ago

A 24-case same-input oracle matrix now distinguishes none/isolated/verbatim/both flags across unused bindings, actual member access, aliases, string element access, namespace imports and type-only imports. The actual TS 6 contract differs by flag: isolated-only reports access errors, verbatim reports binding/re-export errors, both reports both; with neither flag all six cases pass. The uncommitted draft preserves verbatim binding/re-export reports and moves isolated access handling to actual expressions, resolving imported aliases/namespace-owner paths and respecting type-only imports/local shadows. Two new full-checker controls cover access-node diagnostics plus shadowing and unused-binding acceptance. Formatting/AST checks pass; candidate compiler builds under the unchanged guard, peak 2962 MiB. Complete checker suite is live, and candidate mode/depth oracles are queued. No result parity, acceptance, source commit, or performance claim yet.

8 days ago

First diagnostic draft passes full checker 4485/4485 (new alias/namespace/member/element/shadow/unused controls) and Program 232/232. Exact CLI diagnostic identity comparison matches all six cleaned depth controls and isolated-only/no-flag cases, but fails twelve verbatim/both cases: legitimate binding/re-export TS2748 reports are absent. Source inspection identifies a concrete propagation bug: tsconfig parses verbatim_module_syntax, but the driver config-to-StrictFlags initializer omits it. A one-field propagation fix plus config-backed driver regression control is drafted; it does not change oracle options, fixtures or expected diagnostics. Candidate rebuild, full Program and full driver suites are queued behind a confirmed live shared-runner job. Source remains uncommitted and acceptance HELD until all 24 mode cases match codes/counts/primary positions/messages, not merely internal tests. Earlier 12 mismatches and raw records are retained. No benchmark claim or resource relaxation.

8 days ago

Config propagation fix now builds successfully (stripped ReleaseFast peak 2906 MiB) and exact CLI parity verifies: all 24 mode cases plus all six depth cases match TS 6 diagnostic code/count/primary position/message and success-vs-error status. Full checker 4485, Program 232, driver 198, core CLI 74, entrypoint 33 and harness 128 tests pass. Driver first guard attempt exited 121 before execution; only its later real full-suite pass is counted. Pinned full Zod identity multisets remain equal (196 TS + 3 HM9002, zero additions/removals), final candidate observed peak 971 MiB. Frozen candidate SHA-256 bbdd5d51e9c2a5ed4b1ffc2bae968b4cee25e17fe69e32354a6f16326a16603c; combined source patch 5538e44767669afd089f62a034636e3f18efd03f6078e4ed4acf66d80b75ba7a is uncommitted. Performance screen on unchanged admitted workloads and repository Pickier are queued; no deep-chain speed comparison uses the parent that fails those new controls. Remaining cycle/provenance coverage and accepted evidence/documentation are required before closing #843/#844; no source push yet.

8 days ago

Exact parity is now verified for all 24 mode cases plus six cleaned depth cases, including diagnostic code/count/primary position/message and success/error status. Full checker 4485, Program 232, driver 198, core CLI 74, entrypoint 33, harness 128 and complete pinned Zod identity gate pass. The driver config omission is fixed and exercised through real config-backed diagnostics, not a source directive workaround. Combined patch remains uncommitted; source/issue acceptance is held for additional #843 graph controls and performance/lint evidence. Guarded screen and lint attempts repeatedly refuse BEFORE execution under the unchanged disk floor (#732). No source push or new speed claim, and no pass is inferred from those refusals.

8 days ago

Final same-input verification in this draft: 24 mode cases and six shallow/boundary/deep cases match TS 6 exact diagnostic code/count/primary position/message and success/error status after the config flag propagation fix. Full checker 4485, Program 232, driver 198, core CLI 74, entrypoint 33 and harness 128 pass, and pinned Zod complete identities remain 196 TS + 3 HM9002 with zero changes. None/isolated/verbatim/both modes retain distinct legal-import vs access semantics; no blanket TS2748 suppression. This remains uncommitted with #843 while remaining graph-specific controls/documentation are completed; no closure or performance lead is claimed.

8 days ago

Draft is now integrated onto main 53167b7. Checker 4493/4493, driver 199/199, CLI 74/74 and entrypoint 33/33 passed. All 24 option/access cases and six depth/mode oracle cases match TS 6.0.3 exact diagnostic identities/messages and error versus success exits. The fix distinguishes verbatim binding/re-export diagnostics from isolated actual-access diagnostics, and forwards config verbatimModuleSyntax into checker flags (previously dropped). Full Zod diagnostic multiset remains unchanged at 196 TS + 3 HM9002. Final export-star control exposed a separate default propagation error under #843; fixed, Program 237/237. Final CLI rebuild/gates and exact integrated-parent costs are pending; no source push or performance claim yet.

8 days ago

Published as Chris directly to origin/main: 4e8ee86, fix(ts): preserve ambient enum option and access diagnostics (#844), no coauthors. Integrated full checker 4493, driver 199, CLI 74, entrypoint 33 passed; Program final 237. All 24 flag/access + 6 deep/cyclic mode cases exactly match TS diagnostic identities/messages and success/error exit classes. Final Zod retains 196 TS errors + 3 HM9002, zero adds/removals (not production admission). No performance win claimed. Separate real-project default-import gate fails unchanged and is tracked in #845. Evidence/docs publication is next; keep issue open pending broader module-mode acceptance.

8 days ago

Pushed 28989d9f8 directly to origin/main as glennmichael123 (4 files, no coauthors): the Program ambient-module graph now retains resolved const-enum provenance, including declare module in .d.ts and .ts files. This fixes the previously missing TS2748 for import pkg = require("pkg"); pkg.Mode.One in a real project under isolatedModules.

Verification: guarded Program 355/355; tsc_main 61/61; focused checker regression green; rebuilt production home-tsc. For a real two-file project, Home, pinned TS 6.0.3, and pinned native TS 7.0.2 all report exactly main.ts(2,22): error TS2748: Cannot access ambient const enums when isolatedModules is enabled. (with the option name quoted in the actual message). All three are clean when the tsconfig explicitly disables isolatedModules. Zig format and diff checks pass. This covers the cross-file import-equals case but not the whole broader acceptance list, so this issue remains open.

A separate verified CLI false-over-true override mismatch is tracked in #937; it is not claimed fixed by this commit.

8 days ago

Follow-up: the separate CLI option-precedence gap found while verifying this issue is now fixed/pushed as b2282cf4a and tracked/closed in #937. The broader #844 ambient/module-mode acceptance remains open.

8 days ago

New bounded real-project probe on current main b2282cf: ambient.d.ts declares module "pkg" with exported namespace Nested containing export const enum Mode { One = 1 }; main.ts uses import pkg = require("pkg"); export const value = pkg.Nested.Mode.One; under isolatedModules: true. Home exits 0, while pinned TS 6.0.3 and native TS 7.0.2 both report TS2748 at main.ts(2,22). Negative Mode.Missing is more revealing: pinned TS6 reports TS2748 at (2,22) plus TS2339 at (2,38), whereas Home reports neither. This is not merely missing TS2748 annotation: nested enum type/value facts are absent from the consumer. No source changes or parity claim were made for this probe; any fix needs to transfer the nested enum meaning and retain the negative member check, not just add a diagnostic special case.

8 days ago

Current-main follow-up (771c052): the standalone home-tsc binary built after the checker/Program sources still exits 0 for two-file declare module "pkg" { export namespace Nested { export const enum Mode { One=1 } } } + import pkg = require("pkg"); pkg.Nested.Mode.One; pkg.Nested.Mode.Missing; under strict/isolatedModules/noEmit/skipLibCheck. The installed official TypeScript 5.9.3 control on the same files reports TS2748 at main.ts(2,1) and (3,1), plus TS2339 at (3,17); the old nested TypeScript checkout lacks its built tsc.js, so this is NOT a fresh pinned TS6 run. Source-path finding (inference, not yet a patch): importedAmbientConstEnumForAccess traverses nested components only through namespace_module_path; Program ambient-module export facts store a source module path for a namespace owner, not a nested namespace route, so the traversal cannot resolve Nested.Mode as an enum. The missing-member silence shows this is a type/value fact gap, not merely a TS2748 placement issue. A fix needs source-owned nested namespace/enum member facts and Program/checker coverage, not a diagnostic-only special case. No code changed in this checkpoint.

8 days ago

Additional source-graph audit for the nested ambient case: packages/ts_program/src/declaration_graph.zig currently omits .enum_decl from declarationName, appendNamespaceValueRoute admits only fn/var/let/const leaves, and appendNamespaceTypeRoute admits only interface/type-alias/class leaves. The direct ambient-module export collector can identify a top-level ambient enum, but the nested namespace route never carries Nested.Mode or its members into Program facts. This explains why the checker cannot distinguish Mode.One from Mode.Missing through an import-equals namespace. A faithful fix must extend the source-owned namespace/enum graph (including member identity/value and merge/visibility rules) before consulting it from imported member/type resolution. I am leaving #844 open; no code or broad parity claim from this audit.

8 days ago

Pushed 8f1d08a6b directly to main as glennmichael123 (five files, no coauthors). The Program graph now carries exact literal numeric/string members of nested ambient const enums through require-alias namespaces; the checker uses those source-owned members for value typing, missing-member TS2339, and isolatedModules TS2748. Equal-value aliases retain the whole-enum TS2322 name, while distinct values retain member names. Verification under HOME_RUN_MAX_MB=3840: full ts_program target succeeded, full ts_checker target succeeded, ts_driver 222/222 passed, and rebuilt home-tsc matched installed TypeScript 5.9.3 diagnostic locations/codes/messages on require-alias singleton, multi-value, alias, negative/auto-increment, and escaped-string fixtures (with and without isolatedModules where applicable). This is not closure: named import of Nested still reports TS2748 but misses TS2322 and TS2339, and merged ambient module declarations still lose Nested. The pinned Bun WebKit artifact is absent, so this is TypeScript-checker verification only, not native Bun runtime parity.

8 days ago

Follow-up pushed to main as ca0f34cfb (glennmichael123, three files, no coauthors). Named imports such as import { Nested as Selected } from "pkg" now project the source-owned nested ambient namespace values rather than falling through to any. The guarded Program regression covers named and require-alias forms with isolatedModules on/off; the complete checker target passed 4,678/4,678, driver passed 222/222, and rebuilt home-tsc matched installed TypeScript 5.9.3 diagnostic positions/codes/messages on an aliased named-import fixture in both modes (TS2322, TS2339, TS2748). The parity plan records this exact scope. Pickier on that existing plan still reports 3 errors and 196 warnings at unrelated old lines; none point to the new paragraph. Keep #844 open: merged ambient module declarations and unsupported computed enum initializers are not handled by this route. Pinned Bun WebKit is absent, so no native runtime parity claim.

8 days ago

Pushed 0bc914711 (fix(ts): merge ambient const enum namespace fragments (#844)) to origin/main as glennmichael123. The declaration graph now combines exact literal const-enum members from nested namespaces split across ambient module blocks, in one file or across files, for both require aliases and named imports. It withholds the entire merged route when a contributing initializer is unsupported or member names conflict; no partial member type is published.

Verification: guarded Program suite 358/358 (2,357 MB peak), guarded CLI suite 89/89 (2,023 MB peak), and rebuilt home-tsc diagnostics matched TypeScript 5.9.3 exactly on same-file require and cross-file named-import fixtures, including four TS2748 accesses under isolatedModules, TS2322, and TS2339. Zig formatting and diff checks pass. The CLI test guard had one transient memory-probe deadline but retried and completed below the 3,840 MB ceiling.

This does not close #844: mixed declaration kinds, re-export conflicts, and computed enum initializers still need full source-graph handling. The pinned Bun WebKit artifact was unavailable, so these TypeScript checks do not establish native Bun-runtime parity. Tracking in #66.

8 days ago

Pushed 17dcfeb65 directly to origin/main as glennmichael123 (four files, no coauthors). The Program graph now merges exact interface/type-alias routes alongside literal const-enum routes across ambient namespace fragments in one or several files. Named and require-alias imports resolve those type routes through the actual ambient module specifier. A type-only merged namespace has no runtime value: value use reports TS2708, and verbatimModuleSyntax additionally reports TS1484 for a value import. Incomplete runtime facts remain unknown rather than being classified type-only. Unsupported/conflicting fragments still withhold the entire merge. Verification under HOME_RUN_MAX_MB=3840: Program 360/360 (2,305 MB peak), checker 4,679/4,679 (2,260 MB), CLI 89/89, entrypoint 62/62, Zig format and diff checks. Rebuilt home-tsc matched TypeScript 5.9.3 diagnostic codes, locations, and messages on mixed, type-only, import type, and verbatimModuleSyntax fixtures. Error exit codes differ (Home 1, TypeScript 2), so this is diagnostic parity only. Keep #844 open for class/function/value leaves, duplicate-interface merging, re-export conflicts, and computed enum initializers. The pinned Bun WebKit artifact is absent; this does not establish native Bun runtime parity. Tracking overall parity in #66.

8 days ago

Pushed e7e7770dc directly to origin/main as glennmichael123 (three files, no coauthors). The exact ambient-namespace merge now accepts source-owned function and variable value routes alongside supported type aliases/interfaces and literal const-enums. It rejects projection-only or incomplete value schemas, preserving the all-or-nothing merge rule. New Program regressions cover same-file and cross-file function/constant/type fragments with named and require-alias imports, plus an unsupported template-type leaf that must not publish a partial function route. Verification under HOME_RUN_MAX_MB=3840: Program 362/362 (2,257 MB peak), driver 222/222 (1,971 MB), CLI 89/89 (1,954 MB), entrypoint 62/62 (2,085 MB). The checker target remained cache-valid from the preceding full 4,679/4,679 run; it did not rerun for this graph-only edit. Rebuilt home-tsc matched installed TypeScript 5.9.3 diagnostic codes, locations, and messages on the checked function/constant fixture (TS2322 twice, TS2345 once); compiler error exit codes differ. Zig formatting and diff checks pass. Pickier on the existing parity-plan document still reports its pre-existing 199 problems (3 errors, 196 warnings), not a lint pass. #844 remains open for nested class leaves, declaration overload/merge semantics, re-export conflicts, and computed enum initializers. Pinned Bun WebKit was unavailable, so this is not native runtime parity; overall tracking remains in #66.

8 days ago

Progress on broader ambient namespace acceptance: 51bf5e5c4 ports nested ambient class instance, constructor, and source-owned static contracts through merged namespace fragments. Same-file and cross-file Program regressions pass. Full Program 364/364, checker 4679/4679, and CLI 89/89 pass under the 3840 MB guard. A Home CLI fixture matches TypeScript 5.9.3 exactly on four TS2322/TS2345 diagnostic positions and messages; nested Box does not leak as a top-level import. This is not full class-plus-namespace augmentation parity: the separately verified missing TS2322 is tracked in #938. The pinned Bun WebKit artifact is absent on this host; these were TypeScript-path builds against system JavaScriptCore.

8 days ago

Ambient namespace follow-up: c5385107b adds exact nested class-plus-namespace augmentation value merging to the broader acceptance surface. Three source layouts and source-order static collisions are covered. Program 366/366, checker 4679/4679, CLI 89/89 under the 3840 MB guard; seven Home diagnostics match TypeScript 5.9.3 exactly in both file orders. #938 remains open for the missing TS2451 declaration diagnostics and unverified overload forms. This is not a full ambient/module parity claim.

8 days ago

Related nested ambient acceptance progress: df37c2e (https://github.com/home-lang/home/commit/df37c2e1c) adds source-owned class-static versus namespace-value declaration diagnostics and publishes them through the streaming CLI. Differential checks against TypeScript 5.9.3 cover const, var, function/method, non-exported const, overloaded method, same-file/cross-file, and skipLibCheck cases. Guarded Program 368/368 and CLI 89/89 pass. #938 tracks remaining class augmentation breadth; #844 stays open for its wider module/enum/import acceptance. No full TypeScript or native Bun parity claim.

8 days ago

Computed ambient const-enum progress is on origin/main as 4341646 (https://github.com/home-lang/home/commit/43416467a), a three-file conventional commit by glennmichael123 with no coauthors. The declaration graph now transfers source-owned numeric constant expressions it can evaluate exactly: local prior-member references, arithmetic, bitwise and signed/unsigned shifts. It still withholds the entire partial route when an operand is unsupported or a member name conflicts; no any erasure or diagnostic suppression. TypeScript 5.9.3 and Home CLI match the expanded nine-member fixture: eight valid literal assignments and one TS2322 at the same position/message. A separate cross-file reduction changed from Home silence to the TypeScript TS2322, and Program tests cover same-file plus split/reversed declaration order. Guarded Program 370/370, driver 222/222, CLI 89/89, tsc_main 62/62 passed; checker was cache-valid, not a fresh rerun. Zig formatting and diff checks pass. This is an exact supported subset, not all enum expressions or full ambient namespace parity. Pinned Bun WebKit remains absent; #844 and #66 stay open.

8 days ago

Differential follow-up after 4341646: a merged ambient const enum with One = 1 in one declaration file and Two = One << 1 in another is accepted by TypeScript 5.9.3 in either file order; its consumer reports only the expected TS2322 for assigning Mode.Two to literal 1. Current Home instead reports TS2474 at the cross-file initializer and lacks the consumer TS2322. A forward reference across separate fragments also succeeds in TypeScript, while the same forward reference within one declaration reports TS2474. Thus a correct repair must resolve member values across declaration owners without making same-declaration forward references legal; a blanket forward-name fallback would be wrong. No code or parity claim from this probe. #844 remains open.

8 days ago

Split the confirmed cross-fragment const-enum dependency gap into #940 with exact positive/negative, qualified/unqualified, source-order and ownership acceptance. #844 remains the broader ambient namespace tracker.

8 days ago

Follow-up #940 is now implemented and closed via a45a93bdb on origin/main. Merged ambient const-enum numeric references work across declaration fragments (including dependency-free declaration files); same-declaration forward references, cycles and duplicates retain TypeScript diagnostics. Program 378/378, CLI 89/89 and entrypoint 62/62 passed under the 3840 MB guard. Exact positive/negative CLI fixture results match TypeScript 5.9.3. This does not close the broader module-mode and ambient-import work tracked in #844. Overall parity remains #66.

8 days ago

#938 follow-up: b5c9236c3 is on origin/main. Typed getter-only instance and static accessors now survive exact ambient class/namespace merging; same-file, split-file, reverse-order and streaming Program controls pass. Home CLI matches the TypeScript 5.9.3 five-error getter fixture by code, message and location. Guarded Program 379/379, CLI 89/89 and entrypoint 62/62 passed. Setter-only and paired accessors remain withheld until the schema can preserve separate read/write types; #938 and this parent remain open. Overall #66 remains open.

Sign in to comment on this issue.