ReviewOS

home-lang/home

fix(ts): finish imported JSDoc index signatures and CLI parity

#950
Closed glennmichael123 opened this 7 days ago ·
7 days ago

Related: #846. Reproducer: a checked JS module exports /** @type */ const counts = { known: 1 };; a TS consumer writes strings to counts["other"] and counts.known. TypeScript 5.7.3 reports TS2322 at both writes (main.ts:5:1 and :6:1), while current Home exits 0 with no diagnostics. When the identical invalid write is placed inside the JS owner, both TypeScript and Home report TS2322, so the checker understands the index signature locally; the Program source-owned JSDoc transfer currently rejects the entire indexed-object expression. Implement the index signature in the transferable schema, preserve read/write constraints, and add owner/importer regression and negative controls. Fixture: packages/ts_cli/testdata/issue846-index/. No workaround or blanket admission.

7 days ago

Checkpoint on origin/main: 4d3974a adds source-owned JSDoc indexed-object transfer for string and number domains, with parser/Program/production-adapter regressions. 72620f3 saves the exact three-file reproducer under packages/ts_cli/testdata/issue846-index/. Both commits are authored and committed as glennmichael123 without coauthors. TypeScript 5.7.3 reports TS2322 at owner.js:4:1 and main.ts:5:1, :6:1, :8:1. Freshly rebuilt Home reports the same four codes, positions and messages; valid indexed reads add no errors. Guarded zig build test -Dfilter=ts_program, zig build test -Dfilter=tsc_main, and zig build home-tsc pass under HOME_RUN_MAX_MB=3840; zig fmt and diff checks pass. Limits: diagnostic print order differs (tsc lists main before owner; Home lists owner before main), and error exits differ (tsc 2, Home 1). The source schema cannot yet represent readonly index writes, and the consuming checker cannot lower symbol-indexed objects, so those forms remain unsupported rather than being modeled unsoundly. Keep this issue open for those cases and the remaining output/exit parity; #846 remains open.

7 days ago

Follow-up on origin/main: 64e1dbb transfers imported JSDoc symbol index value types through ProgramClassSchema and the checker’s native symbol-indexed object representation; 6199493 expands the production fixture and documents its oracle. Both commits are glennmichael123 author+committer, no coauthors. TypeScript 5.7.3 and the freshly rebuilt Home CLI now report the same five TS2322 codes, locations and messages: owner.js:4:1; main.ts:5:1, :6:1, :8:1, :11:1. Guarded Program and CLI suites and fresh home-tsc build pass under the 3,840 MB cap. The fixture README records commands and the limits. Remaining: readonly string index writes still require source-schema write-protection metadata (TypeScript TS2542 at both computed and property writes); diagnostic print order and process exit codes still differ. This supersedes the prior comment that symbol indexes remained unsupported. Keep #950 open.

7 days ago

Readonly-index checkpoint on origin/main: f6946a9 carries JSDoc readonly and declared index-parameter names through the source-owned Program schema into imported checker types; 3b58b50 adds a production-adapter regression and expands the issue846-index CLI oracle. Both commits have glennmichael123 as author and committer, with no coauthors. TypeScript 5.7.3 and freshly built Home agree on seven codes, locations, and messages: five TS2322 (owner.js:4:1; main.ts:5:1, :6:1, :12:1, :15:1) and two TS2542 (main.ts:8:1, :9:1). The mutable same-domain control remains writable and readonly reads remain valid. Guarded full Program and tsc_main suites, focused checker readonly-index tests, and fresh home-tsc build pass below 3,840 MB; zig fmt and git diff checks pass. Keep #950 open: CLI diagnostic print order and error exit codes still differ; broader #846 admission/config/revision acceptance is not established.

7 days ago

Follow-up correcting the preceding checkpoint: 25ec88a is now pushed to origin/main as glennmichael123 (author+committer, no coauthors). TypeScript 5.7.3 whole-program --noEmit reports diagnostics exit code 2 because its emitBuildInfo path normally has emitSkipped=false; Home previously inferred emitSkipped from noEmit and returned 1. The CLI now uses the actual emit-block outcome, and the saved seven-diagnostic issue846-index fixture exits 2 in both compilers. Guarded test-tsc-streams and ts_cli suites pass; the stream assertion for --listFilesOnly now checks the exact absolute file path Home and TypeScript print. Remaining #950 gap: cross-file diagnostic print order (TypeScript main.ts before owner.js; Home owner.js before main.ts). #846 broader admission/revision/config acceptance remains open.

7 days ago

Cross-file order update: ec1ceee is on origin/main as glennmichael123 without coauthors. The one-shot CLI now sorts already-owned Program diagnostics by normalized source path after dependency-order compilation; watch and the Program streaming API remain streaming. A build regression pins the exact seven-line TypeScript 5.7.3 stdout and exit 2 of issue846-index. Guarded test-tsc-streams and full tsc_main suites pass; fresh Home output is byte-for-byte identical for that fixture. #950 stays open because a new mixed-domain counterexample is now tracked separately in #951: TypeScript emits three TS2542 while Home emits six. The red oracle is committed in 52d88ac and is not counted as a pass.

7 days ago

Mixed readonly index subcase #951 now has two pushed commits on main: 3794e05 (per-domain checker/Program metadata) and 119396d (15-diagnostic TypeScript 5.7.3 CLI oracle). Guarded checker, Program, stream, and tsc_main suites exited 0. #951 remains open for the generic-interface refresh audit, so this parent remains open too; no broad #846 completion claim.

7 days ago

TypeScript index-signature subissues #951 and #953 are now fixed, tested, pushed directly to main, and closed: 3794e05/119396d/9c0b6e2 preserve string/number/symbol readonly permissions through checked-JS imports and forward-generic refresh; b8e0c64/3f35e62 fix generic T-to-union index compatibility while retaining a real TS2413 negative control. TypeScript 5.7.3 and Home exact CLI fixtures match for both. This does not close #950: imported JSDoc and the rest of its acceptance criteria still need their own evidence. Parent #846 also remains open.

7 days ago

Correction to my prior keep-open note: #950’s concrete imported-JSDoc index-signature acceptance is now verified, not merely inferred. On the freshly rebuilt origin/main Home CLI, packages/ts_cli/testdata/issue846-index matches TypeScript 5.7.3 exactly: seven diagnostic lines, order, messages, and exit 2. The extension packages/ts_cli/testdata/issue846-mixed-index likewise matches all 15 lines and exit 2, with mutable-domain writes accepted. #951 and #953 are closed; checker, Program, and CLI regressions cover the related relations. Closing #950 as its scoped requirements are met. This is not a closure claim for parent #846, whose explicit-root/import-closure/dependency-depth, implicit-checkJs, revision/LSP, and negative config/JSX/untyped-package acceptance remain open.

Sign in to comment on this issue.