Commit 64f402d
Decline [2.9]: the opaque TypeScript AST handles are the boundary working
Raised off "low priority" earlier today so it could be CONSIDERED rather than
deferred again. Considered; the answer is no, on the merits.
The gap is real but has no consumer. index.d.ts is 1,169 hand-written lines and
already rich for everything the facade returns; only the 19 branded node handles
are structureless. riddl-vscode -- the TypeScript consumer -- calls
parseToTokens 14x, parseString 11x, getTree, validateString, inspectRoot,
getMessageFlow and getHandlerCompleteness, and touches a raw AST handle ZERO
times. An editor extension wants highlighting, diagnostics and an outline, and
the facade serves all three. The consumer that genuinely walks the AST is
Synapify, which is Scala.js and has the real objects with their methods.
What settled it was measuring the proposed implementation rather than arguing
about it. Generating the .d.ts from JsonModel sounds economical -- JSON is
already a complete, gated, zero-divergence surface -- but JSON serializes STATE
and this AST's value is substantially BEHAVIOUR. AST.scala carries ~540
def/lazy val members that do not serialize: 182 `format`, 67 `kind`, the 34
WithX accessor traits, and derived answers like effectiveShape,
Connector.isPersistent (which accepts both spellings), Statement.canFail,
NumericLiteral.asLong and Function.input/output. JsonModel has zero references
to refMap, symTab or usedBy, so no resolution output crosses at all.
The disqualifying detail is smaller and worse: JSON preserves Include and
BASTImport as CONTENT ENTRIES, so a TypeScript consumer walking `contents` sees
the wrapper rather than through it. That is precisely the defect that had
riddl-generator emit 582 files for reactive-bbq with no entity class among
them, at exit 0. A JSON-derived TS AST would not be "the AST minus methods" --
it would be an AST that invites every consumer to reimplement
include-transparency and alias resolution, which is the pair two separate
consumers have already got wrong.
It would also add a fifth reflective surface to keep in lockstep with parse,
prettify, BAST and JSON, for a consumer population of zero, and nothing would
fail when it drifted.
Recorded in CLAUDE.md so the next session does not re-propose it. If it ever
returns the trigger is DEMAND, not opacity: a TS consumer hits a wall the facade
cannot answer, and the facade gains one accessor inside the conversion layer.
BACKLOG is now down to a single open item, [0.2], which is blocked by design
until 2.0.0 exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent f8fc465 commit 64f402d
2 files changed
Lines changed: 55 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1722 | 1722 | | |
1723 | 1723 | | |
1724 | 1724 | | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
1733 | 1759 | | |
1734 | 1760 | | |
1735 | 1761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2493 | 2493 | | |
2494 | 2494 | | |
2495 | 2495 | | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
2496 | 2517 | | |
2497 | 2518 | | |
2498 | 2519 | | |
| |||
0 commit comments