ReviewOS

stacks/dtsx

fix: preserve public class members after same-line private methods

#3135
Closed chris opened this 4 hours ago ·
4 hours ago

A valid exported class can lose a later public member when an ECMAScript private method is written on the same line. This is a separate observed class-surface defect found while reviewing #3134.

Actual public Bun plugin input:

export class Calculate {
  #if(value: number): number { return value } value(): number { return this.#if(4) / 2 }
}

The equivalent one-line class used in the retained public probes is accepted by ordinary Bun.build. The declaration output from both the source-built V2 and V4 #3134 candidates is an empty exported Calculate class, omitting public value(). A control with an ordinary if method retains both public methods. V4 now correctly retains a subsequent exported function; that repaired regression is distinct from this remaining member omission.

Evidence: /tmp/dtsx-3134-v2-private-review-results.json and /tmp/dtsx-3134-v4-private-review-results.json. V2 was executed through its normally installed compiled public plugin with original payload identity verified; V4 used the owning public source plugin. The earliest affected released version is not established. Candidate metadata remains unreleased0.11.23 and must not be confused with the existing public0.11.23 artifact.

Acceptance:

  • Reproduce through the owning public generator/Bun plugin and a normally packed strict consumer that imports Calculate and calls new Calculate().value(), with no consumer aliases or installed-runtime edits.
  • Preserve all eligible public class members after private methods, including same-line and multiline forms and private names that coincide with grammar keywords. Keep private implementation details private.
  • Fix the owning class extraction/member boundary logic, not authored formatting or generated declarations. Preserve accurate signatures and ordinary/private method controls.
  • Retain actual source/payload identity, relevant full tests, types, lint, independent review and normal package release qualification before claiming downstream delivery.

Related #3134; this ticket records an observed earlier candidate behavior, not a new V4 regression or proof of a released-package fix.

14 minutes ago

Source fix delivered in b163cc45. The shared class scanner now consumes private members through the same method/accessor/property parsing paths while suppressing their emission, so following public members survive. Comment-aware contextual names and quoted accessors use existing lexical readers. Existing private-generator branding is preserved.

Maintained public regressions were red before the fix (46/60 failed). The final68 normal packed strict-consumer tests pass, including precision, privacy, and generator-brand negatives. Canonical local owning checks passed:1872tests, types, Pickier, core/all-plugin builds and unchanged native checks. Independent Standards and Spec reviews both passed.

Original exact-source CI41537916948 passed all8jobs, including declared Zig1282 build/unit/fixtures; original Benchmark41537917052 passed.

Canonical bun run release:patch created version0.11.25 at e86f98a9, then its push hit the local codex/main branch-name mismatch. The same intact generated commit/tag was preserved and the exact normal push finished from fast-forwarded localmain, without another bump or retag. Original failure and completion receipts remain retained.

Version25 CI41538968817 passed all8jobs. Releaser41538968587 is still building original native artifacts. Public package/native payload and ordinary public no-override consumer qualification remain pending, so this issue stays open.

Broader numeric/private-brand policy and the separate zig-dtsx metadata issue #3136 remain outside this patch.

14 minutes ago

Completed and qualified in v0.11.25, exact source e86f98a97, containing reviewed fix b163cc45.

The shared class-member parser consumes private implementations through its existing method, accessor, constructor and property paths, suppressing their emission while preserving subsequent public members and accurate signatures. The maintained68 public packed-consumer regressions cover same-line/multiline forms, contextual keyword names, quoted members, comments, regex/division, privacy and existing generator-brand controls. Full local1872 tests, owning builds/types/Pickier and both independent reviews passed.

Original hosted gates passed without reruns: source CI, source Benchmark, release CI, and Releaser, including the declared Zig1282 checks.

Actual public verification checked all five npm packages and215 payload files against registrySHA1/SHA512 and the original exact-source publisher integrity values. All five advertised SLSA subject/source/tag/run associations match; no independent Sigstore trust-chain claim is made. Six Pantry tarballs and all twelve original native archives were also verified against their registry/API/checksum identities and safe archive contents.

A fresh ordinary registry install and frozen install selected all five public0.11.25 tools with no overrides, aliases, source links or installed edits. Twelve normal packed strict consumers passed through the installed public core, Bun plugin and declared JavaScript CLI, with12 exactTS2322 precision negatives,12TS2339 privacy negatives and threeTS2741 existing private-generator brand controls. All251 installed tool/library payload files match their original archives.

Canonical release metadata/tag creation hit a local branch-name push precondition; the same generated candidate was preserved and normally pushed from fast-forwarded matching localmain. Original exit2 and normal completion evidence remain retained. No second bump, retag or gate waiver occurred.

Sealed proof: /tmp/dtsx-0.11.25-verification/publication-proof.json, SHA256 636e0876c31f87009b9aa30f43953f6d750b74c41ed422dd008771a889d02918; independent completion audit SHA256 edafbabe4e9a5707bd860fb92e81d0d9812eaf74d69f4327c5eb971343d15fe6.

The separate zig-dtsx types metadata defect #3136 remains open. Native archive/header checks do not claim signing, reproducible builds or cross-platform execution. This delivery qualifies the affected shared TypeScript generator and public JavaScript CLI/core/Bun plugin class path.

Sign in to comment on this issue.