Skip to content

Exports the decompile result type by name - #159

Merged
johnnyt merged 2 commits into
mainfrom
pts-shdy-export-decompile-result
Oct 1, 2026
Merged

johnnyt merged 2 commits into
mainfrom
pts-shdy-export-decompile-result

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

What

decompile's result type was a module-local alias, so a host could only derive it from the function, while the other entry points' results have exported names. It is now exported from the main entry as DecompileResult, beside ParseResult and CompileResult, and listed in test/export-surface.json. The type itself is unchanged. Exporting it was ruled by the operator, 2026-10-01.

  • src/decompile.ts: DecompileResult gains export.
  • src/index.ts: the name joins the type re-export from ./decompile.js.
  • test/export-surface.json: one sorted entry.
  • changelog.d/pts-shdy.md: an Added fragment.
  • docs/adr/0004-the-compiler-surface.md: a dated Amendment at proposed, at the foot (below).

Refs: pts-shdy

Evidence

  • Test first: with the name added to test/export-surface.json alone, test/export-surface.test.ts failed on its assertion, the diff naming exactly DecompileResult; with the export in place it passes.
  • Sabotage: removing DecompileResult from the re-export in src/index.ts turns "the declared export surface > pins the names . declares" red on the assertion; the file was restored from a copy, byte-equal.
  • The built declarations for both module formats list type DecompileResult in their export statement, and decompile is declared returning it.
  • Full gate green on the committed tree.

Direction check of the record text

The entry is an Amendment at proposed, inserted at the foot of ADR-0004, and removes no line (git diff origin/main...HEAD -- docs/adr/ shows no removed line). It is an Amendment rather than a Note because it supersedes an accepted sentence and adds a public name, which changes what the record decides; its Typespecs section quotes DecompileResult as src/decompile.ts declares it, and the decompile declaration that names it. Each claim checked at this branch's head: the amendment headed "decompile refuses a tree past the source depth bound, as a value" ends its "What changed" section with the sentence the entry quotes; DecompileResult in src/decompile.ts is the union that amendment quotes, member for member; the note on that amendment's acceptance reads the export state at 1ddd46b, which this change does not alter; the statement-grammar amendment's sentence about unexported result types is about the two located program results, which this change does not export.

Provenance

  • The brief's file map named the four code and fragment files only. The accepted amendment's sentence that no name is exported for the result type became false with this change, so the Amendment recording that it is superseded rides in the same request rather than leaving an accepted record wrong.
  • src/index.ts is also edited by a sibling change to the execute entry points; this change touches only the one re-export line.
  • Rebased over Notes ADR-0004's minus sentence and block brace #158, which appended its own foot Note to docs/adr/0004-the-compiler-surface.md (that request's body names the file). Both sides only added at the foot; resolved keep-both, Notes ADR-0004's minus sentence and block brace #158's Note first and this entry after it, and the full gate ran green on the rebased head. The rebase also made this entry's own "branch cut from" clause false, so the clause was dropped before the push.
  • The entry was first written as a Note; review classed it as an Amendment, since it changes what the record decides, and it was recast in a follow-up commit (the heading, a Status line, a Typespecs section, and the opening sentence reworded to fit an Amendment).

decompile's result was a module-local alias, so a host could only
derive it from the function, while every other entry point's result
has a name. It is now exported from the main entry as
DecompileResult, beside ParseResult and CompileResult, and pinned in
the export surface list; the shape is unchanged.

ADR-0004 gains a foot Note: the accepted amendment on decompile's
depth refusal said no name is exported for its result type, and the
Note records that this change supersedes that sentence.

Refs: pts-shdy
@johnnyt
johnnyt force-pushed the pts-shdy-export-decompile-result branch from 4bc487e to 6c7ad42 Compare October 1, 2026 12:46
The entry on ADR-0004 supersedes an accepted sentence and adds a
public name, so it changes what the record decides: it is recast
from a Note to an Amendment at proposed, with a Typespecs section
quoting DecompileResult and the decompile declaration that names
it. No line above the entry is removed.

Refs: pts-shdy
@johnnyt
johnnyt merged commit 929bcb7 into main Oct 1, 2026
1 check passed
@johnnyt
johnnyt deleted the pts-shdy-export-decompile-result branch October 1, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant