on master help sign in
3150 files changed+108458−1015
since splitsnapshots
unifiedsplit
README.md+30−11 docs/README.md+39 docs/compiler.md+213 docs/development.md+227 docs/open-questions.md+89 docs/prelude-inventory.md+192 docs/prompts/drop-union-rune.md+182 docs/prompts/milestone-2.md+169 docs/spec/core-language.md+176 docs/spec/decisions.md+114 docs/spec/grammar.md+344 docs/spec/implementation-plan.md+103 docs/spec/overview.md+529 docs/status.md+279 jibb-dev/lib/jibb-import.hoon+2308 jibb-dev/lib/jibb.hoon+12257−252 jibb-dev/lib/jibb/internal.jibb+33 jibb-dev/lib/jibb/prelude.jibb+507 my-app/mar/label.hoon+6 my-app/mar/posts.hoon+7 my-app/mar/todo-action.hoon+7 my-app/mar/todo-item.hoon+7 my-app/mar/todo-update.hoon+7 my-app/mar/todos.hoon+7 my-app/sur/blog.hoon+6 my-app/sur/import-fixture.hoon+7 my-app/sur/todo.hoon+12 my-app/ui/api/blog.jibb+5 my-app/ui/api/todo.jibb+2−2 my-app/ui/basket.jibb+1−1 my-app/ui/components/card.jibb+5 my-app/ui/stores/cart.jibb+1−1 my-app/ui/todo-list.jibb+1−1 tests/checker/unification.txt+1 tests/clay-fixtures/bridge-expected.txt+1 tests/clay-fixtures/bridge.txt+14 tests/clay-fixtures/build.txt+11 tests/clay-fixtures/expected.txt+1 tests/clay-fixtures/ford-expected.txt+1 tests/clay-fixtures/ford-import-expected.txt+1 tests/clay-fixtures/ford-import.txt+12 tests/clay-fixtures/ford-nested-union-bridge-expected.txt+1 tests/clay-fixtures/ford-nested-union-bridge.txt+14 tests/clay-fixtures/ford-nested-union-expected.txt+1 tests/clay-fixtures/ford-nested-union.txt+9 tests/clay-fixtures/ford-recursive-expected.txt+1 tests/clay-fixtures/ford-recursive.txt+9 tests/clay-fixtures/ford.txt+13 tests/clay-fixtures/import-expected.txt+5 tests/clay-fixtures/import.txt+13 tests/clay-fixtures/mark-bridge-expected.txt+1 tests/clay-fixtures/mark-bridge.txt+11 tests/clay-fixtures/mark-import-expected.txt+1 tests/clay-fixtures/mark-import.txt+9 tests/clay-fixtures/mark-shape-expected.txt+1 tests/clay-fixtures/mark-shape.txt+14 tests/clay-fixtures/mark-update-import-expected.txt+1 tests/clay-fixtures/mark-update-import.txt+9 tests/clay-fixtures/record-bridge-expected.txt+1 tests/clay-fixtures/record-bridge.txt+11 tests/clay-fixtures/tlon-mop-expected.txt+1 tests/clay-fixtures/tlon-mop.txt+20 tests/golden/doc-core-02-update/tree.txt+77 tests/golden/doc-grammar-01-imports/tree.txt+4 tests/golden/doc-grammar-02-buttons/tree.txt+21 tests/golden/doc-grammar-03-view-day/tree.txt+20 tests/golden/doc-grammar-04-step/about.txt+2−1 tests/golden/doc-grammar-04-step/modules.txt+1 tests/golden/doc-grammar-04-step/source.jibb+2−2 tests/golden/doc-grammar-04-step/tokens.txt+2−3 tests/golden/doc-grammar-04-step/tree.txt+38 tests/golden/doc-grammar-04-step/types.txt+3 tests/golden/doc-grammar-06-cart-store/about.txt+1 tests/golden/doc-grammar-06-cart-store/modules.txt+1 tests/golden/doc-grammar-06-cart-store/source.jibb+1−1 tests/golden/doc-grammar-06-cart-store/tokens.txt−1 tests/golden/doc-grammar-06-cart-store/tree.txt+39 tests/golden/doc-grammar-06-cart-store/types.txt+2 tests/golden/doc-grammar-07-basket/source.jibb+1−1 tests/golden/doc-grammar-07-basket/tokens.txt−1 tests/golden/doc-grammar-07-basket/tree.txt+103 tests/golden/doc-overview-01-cmd-sub/about.txt+1−1 tests/golden/doc-overview-01-cmd-sub/source.jibb+2−2 tests/golden/doc-overview-01-cmd-sub/tokens.txt−2 tests/golden/doc-overview-01-cmd-sub/tree.txt+42 tests/golden/doc-overview-02-theme/tree.txt+32 tests/golden/doc-overview-04-todo-api/source.jibb+2−2 tests/golden/doc-overview-04-todo-api/tokens.txt+13−14 tests/golden/doc-overview-04-todo-api/tree.txt+16 tests/golden/doc-overview-08-about/tree.txt+24 tests/golden/doc-overview-09-blog-index/tree.txt+23 tests/golden/doc-overview-10-todo-list/source.jibb+1−1 tests/golden/doc-overview-10-todo-list/tokens.txt−1 tests/golden/doc-overview-10-todo-list/tree.txt+168 tests/golden/doc-overview-11-index/tree.txt+23 tests/golden/fixture-blog-api/about.txt+3 tests/golden/fixture-blog-api/path.txt+1 tests/golden/fixture-blog-api/source.jibb+5 tests/golden/fixture-blog-api/tokens.txt+14 tests/golden/fixture-blog-api/tree.txt+4 tests/golden/fixture-blog-card/about.txt+3 tests/golden/fixture-blog-card/path.txt+1 tests/golden/fixture-blog-card/source.jibb+5 tests/golden/fixture-blog-card/tokens.txt+14 tests/golden/fixture-blog-card/tree.txt+7 tests/golden/inline-base32/tree.txt+2 tests/golden/inline-call/tree.txt+3 tests/golden/inline-cell/tree.txt+7 tests/golden/inline-change-done/tree.txt+4 tests/golden/inline-change-draft/tree.txt+5 tests/golden/inline-crash-call/about.txt+3 tests/golden/inline-crash-call/source.jibb+4 tests/golden/inline-crash-call/tokens.txt+15 tests/golden/inline-crash-call/tree.txt+6 tests/golden/inline-crash-operands/about.txt+3 tests/golden/inline-crash-operands/source.jibb+10 tests/golden/inline-crash-operands/tokens.txt+67 tests/golden/inline-crash-operands/tree.txt+23 tests/golden/inline-crash/tree.txt+3 tests/golden/inline-ctor-typed/tree.txt+10 tests/golden/inline-date/tree.txt+3 tests/golden/inline-decimal/tree.txt+2 tests/golden/inline-duration/tree.txt+3 tests/golden/inline-fold-mold/tree.txt+7 tests/golden/inline-gate-after-definition-bad/about.txt+3 tests/golden/inline-gate-after-definition-bad/source.jibb+1 tests/golden/inline-gate-after-definition-bad/tokens.txt+4 tests/golden/inline-gate-after-definition-bad/tree.txt+3 tests/golden/inline-gate-field-bad/about.txt+3 tests/golden/inline-gate-field-bad/source.jibb+1 tests/golden/inline-gate-field-bad/tokens.txt+8 tests/golden/inline-gate-field-bad/tree.txt+3 tests/golden/inline-gate-mold/tree.txt+3 tests/golden/inline-gate-sample-binds/about.txt+3 tests/golden/inline-gate-sample-binds/source.jibb+2 tests/golden/inline-gate-sample-binds/tokens.txt+25 tests/golden/inline-gate-sample-binds/tree.txt+15 tests/golden/inline-gate-samples/tree.txt+13 tests/golden/inline-gate-wide/tree.txt+7 tests/golden/inline-generic-apply-bad/about.txt+3 tests/golden/inline-generic-apply-bad/source.jibb+1 tests/golden/inline-generic-apply-bad/tokens.txt+11 tests/golden/inline-generic-apply-bad/tree.txt+3 tests/golden/inline-generic-both-bad/about.txt+3 tests/golden/inline-generic-both-bad/source.jibb+3 tests/golden/inline-generic-both-bad/tokens.txt+13 tests/golden/inline-generic-both-bad/tree.txt+3 tests/golden/inline-generic-case-bad/about.txt+3 tests/golden/inline-generic-case-bad/source.jibb+2 tests/golden/inline-generic-case-bad/tokens.txt+10 tests/golden/inline-generic-case-bad/tree.txt+3 tests/golden/inline-generic-cast-bad/about.txt+3 tests/golden/inline-generic-cast-bad/source.jibb+1 tests/golden/inline-generic-cast-bad/tokens.txt+10 tests/golden/inline-generic-cast-bad/tree.txt+3 tests/golden/inline-generic-empty-bad/about.txt+3 tests/golden/inline-generic-empty-bad/source.jibb+2 tests/golden/inline-generic-empty-bad/tokens.txt+11 tests/golden/inline-generic-empty-bad/tree.txt+3 tests/golden/inline-generic-field-bad/about.txt+3 tests/golden/inline-generic-field-bad/source.jibb+1 tests/golden/inline-generic-field-bad/tokens.txt+12 tests/golden/inline-generic-field-bad/tree.txt+3 tests/golden/inline-generic-mold/about.txt+1−1 tests/golden/inline-generic-mold/tree.txt+3 tests/golden/inline-generic-prefix-bad/about.txt+3 tests/golden/inline-generic-prefix-bad/source.jibb+1 tests/golden/inline-generic-prefix-bad/tokens.txt+3 tests/golden/inline-generic-prefix-bad/tree.txt+3 tests/golden/inline-hex/tree.txt+2 tests/golden/inline-hoon-union-apply-bad/about.txt+3 tests/golden/inline-hoon-union-apply-bad/source.jibb+1 tests/golden/inline-hoon-union-apply-bad/tokens.txt+11 tests/golden/inline-hoon-union-apply-bad/tree.txt+3 tests/golden/inline-hoon-union-cast-bad/about.txt+3 tests/golden/inline-hoon-union-cast-bad/source.jibb+1 tests/golden/inline-hoon-union-cast-bad/tokens.txt+10 tests/golden/inline-hoon-union-cast-bad/tree.txt+3 tests/golden/inline-hoon-union-definition-bad/about.txt+3 tests/golden/inline-hoon-union-definition-bad/source.jibb+1 tests/golden/inline-hoon-union-definition-bad/tokens.txt+8 tests/golden/inline-hoon-union-definition-bad/tree.txt+3 tests/golden/inline-hoon-union-field-bad/about.txt+3 tests/golden/inline-hoon-union-field-bad/source.jibb+1 tests/golden/inline-hoon-union-field-bad/tokens.txt+12 tests/golden/inline-hoon-union-field-bad/tree.txt+3 tests/golden/inline-hoon-union-gate-bad/about.txt+3 tests/golden/inline-hoon-union-gate-bad/source.jibb+1 tests/golden/inline-hoon-union-gate-bad/tokens.txt+11 tests/golden/inline-hoon-union-gate-bad/tree.txt+3 tests/golden/inline-hoon-union-nested-sample-bad/about.txt+3 tests/golden/inline-hoon-union-nested-sample-bad/source.jibb+2 tests/golden/inline-hoon-union-nested-sample-bad/tokens.txt+19 tests/golden/inline-hoon-union-nested-sample-bad/tree.txt+3 tests/golden/inline-hoon-union-open-apply-bad/about.txt+3 tests/golden/inline-hoon-union-open-apply-bad/source.jibb+2 tests/golden/inline-hoon-union-open-apply-bad/tokens.txt+12 tests/golden/inline-hoon-union-open-apply-bad/tree.txt+3 tests/golden/inline-hoon-union-open-field-bad/about.txt+3 tests/golden/inline-hoon-union-open-field-bad/source.jibb+2 tests/golden/inline-hoon-union-open-field-bad/tokens.txt+13 tests/golden/inline-hoon-union-open-field-bad/tree.txt+3 tests/golden/inline-hoon-union-sample-bad/about.txt+3 tests/golden/inline-hoon-union-sample-bad/source.jibb+2 tests/golden/inline-hoon-union-sample-bad/tokens.txt+14 tests/golden/inline-hoon-union-sample-bad/tree.txt+3 tests/golden/inline-hoon-union-wide-sample-bad/about.txt+3 tests/golden/inline-hoon-union-wide-sample-bad/source.jibb+1 tests/golden/inline-hoon-union-wide-sample-bad/tokens.txt+13 tests/golden/inline-hoon-union-wide-sample-bad/tree.txt+3 tests/golden/inline-import-dollar-mark-bad/about.txt+3 tests/golden/inline-import-dollar-mark-bad/source.jibb+1 tests/golden/inline-import-dollar-mark-bad/tokens.txt+3 tests/golden/inline-import-dollar-mark-bad/tree.txt+3 tests/golden/inline-import-mark-face-bad/tree.txt+3 tests/golden/inline-import-root-bad/about.txt+3 tests/golden/inline-import-root-bad/source.jibb+1 tests/golden/inline-import-root-bad/tokens.txt+4 tests/golden/inline-import-root-bad/tree.txt+3 tests/golden/inline-imports-after-definition/tree.txt+3 tests/golden/inline-island/tree.txt+3 tests/golden/inline-kinds/tree.txt+18 tests/golden/inline-knot/tree.txt+2 tests/golden/inline-leftout-barcab/tree.txt+3 tests/golden/inline-leftout-barcen-2/about.txt+3 tests/golden/inline-leftout-barcen-2/source.jibb+1 tests/golden/inline-leftout-barcen-2/tokens.txt+3 tests/golden/inline-leftout-barcen-2/tree.txt+3 tests/golden/inline-leftout-barcen-3/about.txt+3 tests/golden/inline-leftout-barcen-3/source.jibb+1 tests/golden/inline-leftout-barcen-3/tokens.txt+3 tests/golden/inline-leftout-barcen-3/tree.txt+3 tests/golden/inline-leftout-barcen/tree.txt+3 tests/golden/inline-leftout-barhep/tree.txt+3 tests/golden/inline-leftout-bartar/tree.txt+3 tests/golden/inline-leftout-buc-alone/about.txt+3 tests/golden/inline-leftout-buc-alone/source.jibb+1 tests/golden/inline-leftout-buc-alone/tokens.txt+3 tests/golden/inline-leftout-buc-alone/tree.txt+3 tests/golden/inline-leftout-buc-paren-2/about.txt+3 tests/golden/inline-leftout-buc-paren-2/source.jibb+1 tests/golden/inline-leftout-buc-paren-2/tokens.txt+3 tests/golden/inline-leftout-buc-paren-2/tree.txt+3 tests/golden/inline-leftout-buc-paren-3/about.txt+3 tests/golden/inline-leftout-buc-paren-3/source.jibb+1 tests/golden/inline-leftout-buc-paren-3/tokens.txt+3 tests/golden/inline-leftout-buc-paren-3/tree.txt+3 tests/golden/inline-leftout-buc-paren/tokens.txt+2−2 tests/golden/inline-leftout-buc-paren/tree.txt+3 tests/golden/inline-leftout-buccen/about.txt+2−2 tests/golden/inline-leftout-buccen/tokens.txt+1−1 tests/golden/inline-leftout-buccen/tree.txt+3 tests/golden/inline-leftout-cencol/tokens.txt+1−1 tests/golden/inline-leftout-cencol/tree.txt+3 tests/golden/inline-leftout-cenhep/about.txt+3 tests/golden/inline-leftout-cenhep/source.jibb+1 tests/golden/inline-leftout-cenhep/tokens.txt+3 tests/golden/inline-leftout-cenhep/tree.txt+3 tests/golden/inline-leftout-centis/tree.txt+3 tests/golden/inline-leftout-colhep/about.txt+3 tests/golden/inline-leftout-colhep/source.jibb+1 tests/golden/inline-leftout-colhep/tokens.txt+3 tests/golden/inline-leftout-colhep/tree.txt+3 tests/golden/inline-leftout-colon-wing/tree.txt+3 tests/golden/inline-leftout-colsig/tree.txt+3 tests/golden/inline-leftout-coltar/tree.txt+3 tests/golden/inline-leftout-dottar/tree.txt+3 tests/golden/inline-leftout-dottis/tree.txt+3 tests/golden/inline-leftout-faslus/tree.txt+3 tests/golden/inline-leftout-hephep/tree.txt+3 tests/golden/inline-leftout-kethep-wide/tree.txt+3 tests/golden/inline-leftout-kettar/tree.txt+3 tests/golden/inline-leftout-miccol/about.txt+3 tests/golden/inline-leftout-miccol/source.jibb+1 tests/golden/inline-leftout-miccol/tokens.txt+3 tests/golden/inline-leftout-miccol/tree.txt+3 tests/golden/inline-leftout-sail/tree.txt+3 tests/golden/inline-leftout-sigbar/tree.txt+3 tests/golden/inline-leftout-signed-float-auras-2/about.txt+3 tests/golden/inline-leftout-signed-float-auras-2/source.jibb+1 tests/golden/inline-leftout-signed-float-auras-2/tokens.txt+3 tests/golden/inline-leftout-signed-float-auras-2/tree.txt+3 tests/golden/inline-leftout-signed-float-auras/tree.txt+3 tests/golden/inline-leftout-sigpam-wide/about.txt+3 tests/golden/inline-leftout-sigpam-wide/source.jibb+1 tests/golden/inline-leftout-sigpam-wide/tokens.txt+8 tests/golden/inline-leftout-sigpam-wide/tree.txt+3 tests/golden/inline-leftout-tis-paren/tree.txt+3 tests/golden/inline-leftout-tisfas/tree.txt+3 tests/golden/inline-leftout-tisgal-2/about.txt+3 tests/golden/inline-leftout-tisgal-2/source.jibb+1 tests/golden/inline-leftout-tisgal-2/tokens.txt+3 tests/golden/inline-leftout-tisgal-2/tree.txt+3 tests/golden/inline-leftout-tisgal/tokens.txt+2−2 tests/golden/inline-leftout-tisgal/tree.txt+3 tests/golden/inline-leftout-tisgar/tokens.txt+2−2 tests/golden/inline-leftout-tisgar/tree.txt+3 tests/golden/inline-leftout-tislus/about.txt+3 tests/golden/inline-leftout-tislus/source.jibb+1 tests/golden/inline-leftout-tislus/tokens.txt+9 tests/golden/inline-leftout-tislus/tree.txt+3 tests/golden/inline-leftout-tistis/tokens.txt+2−2 tests/golden/inline-leftout-tistis/tree.txt+3 tests/golden/inline-leftout-wutcol-2/about.txt+3 tests/golden/inline-leftout-wutcol-2/source.jibb+1 tests/golden/inline-leftout-wutcol-2/tokens.txt+3 tests/golden/inline-leftout-wutcol-2/tree.txt+3 tests/golden/inline-leftout-wutcol/tree.txt+3 tests/golden/inline-leftout-wuthep-wide/tree.txt+3 tests/golden/inline-leftout-wutlus/tree.txt+3 tests/golden/inline-leftout-wutsig/about.txt+3 tests/golden/inline-leftout-wutsig/source.jibb+1 tests/golden/inline-leftout-wutsig/tokens.txt+3 tests/golden/inline-leftout-wutsig/tree.txt+3 tests/golden/inline-leftout-wutzap/tree.txt+3 tests/golden/inline-leftout-zap-not-2/about.txt+3 tests/golden/inline-leftout-zap-not-2/source.jibb+1 tests/golden/inline-leftout-zap-not-2/tokens.txt+3 tests/golden/inline-leftout-zap-not-2/tree.txt+3 tests/golden/inline-leftout-zap-not/tree.txt+3 tests/golden/inline-leftout-zapgar/tree.txt+3 tests/golden/inline-list-parens/tree.txt+7 tests/golden/inline-list/tree.txt+5 tests/golden/inline-literal-defaults/tree.txt+6 tests/golden/inline-load-slug/tree.txt+7 tests/golden/inline-local-names-bodies/about.txt+3 tests/golden/inline-local-names-bodies/source.jibb+15 tests/golden/inline-local-names-bodies/tokens.txt+58 tests/golden/inline-local-names-bodies/tree.txt+29 tests/golden/inline-local-names/tree.txt+15 tests/golden/inline-loobean/tree.txt+3 tests/golden/inline-mark-digit/tree.txt+2 tests/golden/inline-module-definitions/tree.txt+3 tests/golden/inline-mold-add/about.txt+1−1 tests/golden/inline-mold-add/tree.txt+8 tests/golden/inline-mold-any-empty/tree.txt+3 tests/golden/inline-mold-atoms/tree.txt+9 tests/golden/inline-mold-constants/tree.txt+5 tests/golden/inline-mold-containers/tree.txt+17 tests/golden/inline-mold-gate/tree.txt+3 tests/golden/inline-mold-generic/about.txt+1−1 tests/golden/inline-mold-generic/source.jibb+1−1 tests/golden/inline-mold-generic/tokens.txt−1 tests/golden/inline-mold-generic/tree.txt+10 tests/golden/inline-mold-opaque/about.txt+2−2 tests/golden/inline-mold-opaque/tree.txt+4 tests/golden/inline-mold-paths/tree.txt+4 tests/golden/inline-mold-records/tree.txt+15 tests/golden/inline-namespaces/tree.txt+5 tests/golden/inline-no-operators/tree.txt+7 tests/golden/inline-no-subs/tree.txt+3 tests/golden/inline-null/tree.txt+2 tests/golden/inline-pair/tree.txt+3 tests/golden/inline-pairs-two-items/tree.txt+5 tests/golden/inline-path/about.txt+2−2 tests/golden/inline-path/tree.txt+2 tests/golden/inline-pattern-any/tree.txt+8 tests/golden/inline-pattern-cell-open-bad/about.txt+3 tests/golden/inline-pattern-cell-open-bad/source.jibb+5 tests/golden/inline-pattern-cell-open-bad/tokens.txt+21 tests/golden/inline-pattern-cell-open-bad/tree.txt+3 tests/golden/inline-pattern-cell/tree.txt+11 tests/golden/inline-pattern-crash-arm/about.txt+1−1 tests/golden/inline-pattern-crash-arm/source.jibb+4−1 tests/golden/inline-pattern-crash-arm/tokens.txt+25−20 tests/golden/inline-pattern-crash-arm/tree.txt+11 tests/golden/inline-pattern-crash-bad/about.txt+3 tests/golden/inline-pattern-crash-bad/source.jibb+7 tests/golden/inline-pattern-crash-bad/tokens.txt+26 tests/golden/inline-pattern-crash-bad/tree.txt+3 tests/golden/inline-pattern-date-bad/tree.txt+3 tests/golden/inline-pattern-duration-bad/about.txt+3 tests/golden/inline-pattern-duration-bad/source.jibb+3 tests/golden/inline-pattern-duration-bad/tokens.txt+11 tests/golden/inline-pattern-duration-bad/tree.txt+3 tests/golden/inline-pattern-eq/tree.txt+12 tests/golden/inline-pattern-face-bad/about.txt+3 tests/golden/inline-pattern-face-bad/source.jibb+3 tests/golden/inline-pattern-face-bad/tokens.txt+15 tests/golden/inline-pattern-face-bad/tree.txt+3 tests/golden/inline-pattern-head-tag/tree.txt+11 tests/golden/inline-pattern-interpolated-bad/tree.txt+3 tests/golden/inline-pattern-list-bad/tree.txt+3 tests/golden/inline-pattern-literals/tree.txt+11 tests/golden/inline-pattern-loobean/tree.txt+9 tests/golden/inline-pattern-move-any/tree.txt+11 tests/golden/inline-pattern-name/tree.txt+8 tests/golden/inline-pattern-null/tree.txt+10 tests/golden/inline-pattern-pair-bad/tree.txt+3 tests/golden/inline-pattern-tail-tag/tree.txt+11 tests/golden/inline-pattern-term/tree.txt+9 tests/golden/inline-pattern-two-tags/tree.txt+11 tests/golden/inline-pattern-unit/tree.txt+12 tests/golden/inline-qath/tree.txt+4 tests/golden/inline-requests/tree.txt+12 tests/golden/inline-scry-case/about.txt+1−1 tests/golden/inline-scry-case/source.jibb+1−1 tests/golden/inline-scry-case/tokens.txt−1 tests/golden/inline-scry-case/tree.txt+7 tests/golden/inline-self-reference/tree.txt+4 tests/golden/inline-ship/tree.txt+3 tests/golden/inline-static-image/tree.txt+4 tests/golden/inline-string/tree.txt+4 tests/golden/inline-tag-shape/tree.txt+3 tests/golden/inline-term-numeric/about.txt+3 tests/golden/inline-term-numeric/source.jibb+9 tests/golden/inline-term-numeric/tokens.txt+31 tests/golden/inline-term-numeric/tree.txt+12 tests/golden/inline-term/tree.txt+2 tests/golden/inline-text-items/tree.txt+6 tests/golden/inline-union-both-bad/about.txt+3 tests/golden/inline-union-both-bad/source.jibb+3 tests/golden/inline-union-both-bad/tokens.txt+9 tests/golden/inline-union-both-bad/tree.txt+3 tests/golden/inline-union-local/about.txt+3 tests/golden/inline-union-local/source.jibb+5 tests/golden/inline-union-local/tokens.txt+18 tests/golden/inline-union-local/tree.txt+8 tests/golden/inline-union-one-case/about.txt+3 tests/golden/inline-union-one-case/source.jibb+3 tests/golden/inline-union-one-case/tokens.txt+20 tests/golden/inline-union-one-case/tree.txt+9 tests/golden/inline-union-record-bad/about.txt+3 tests/golden/inline-union-record-bad/source.jibb+3 tests/golden/inline-union-record-bad/tokens.txt+12 tests/golden/inline-union-record-bad/tree.txt+3 tests/golden/inline-union-wide/about.txt+3−3 tests/golden/inline-union-wide/tokens.txt+3−7 tests/golden/inline-union-wide/tree.txt+3 tests/golden/inline-unit/tree.txt+3 tests/golden/inline-wide-form-rune-bad/about.txt+1−1 tests/golden/inline-wide-form-rune-bad/tree.txt+3 tests/golden/inline-wide-forms/about.txt+2−2 tests/golden/inline-wide-forms/source.jibb−1 tests/golden/inline-wide-forms/tokens.txt+5−12 tests/golden/inline-wide-forms/tree.txt+5 tests/golden/inline-wide-union-call/about.txt+3−3 tests/golden/inline-wide-union-call/source.jibb+3−1 tests/golden/inline-wide-union-call/tokens.txt+7−6 tests/golden/inline-wide-union-call/tree.txt+3 tests/golden/inline-wings/tree.txt+5 tests/golden/lex-base32-bad-1/tree.txt+3 tests/golden/lex-base32-ok-1/tree.txt+5 tests/golden/lex-blob-bad-1/about.txt+3 tests/golden/lex-blob-bad-1/source.jibb+1 tests/golden/lex-blob-bad-1/tokens.txt+3 tests/golden/lex-blob-bad-1/tree.txt+3 tests/golden/lex-call-open-bad-1/tree.txt+7 tests/golden/lex-call-open-bad-2/tree.txt+3 tests/golden/lex-call-open-bad-3/about.txt−3 tests/golden/lex-call-open-bad-4/about.txt+3 tests/golden/lex-call-open-bad-4/source.jibb+2 tests/golden/lex-call-open-bad-4/tokens.txt+8 tests/golden/lex-call-open-bad-4/tree.txt+3 tests/golden/lex-call-open-ok-1/tree.txt+14 tests/golden/lex-call-open-ok-2/about.txt+3 tests/golden/lex-call-open-bad-3/source.jibb → tests/golden/lex-call-open-ok-2/source.jibb tests/golden/lex-call-open-bad-3/tokens.txt → tests/golden/lex-call-open-ok-2/tokens.txt tests/golden/lex-call-open-ok-2/tree.txt+4 tests/golden/lex-cell-bad-1/tree.txt+3 tests/golden/lex-cell-ok-1/tree.txt+15 tests/golden/lex-closer-bad-1/about.txt+3 tests/golden/lex-closer-bad-1/source.jibb+1 tests/golden/lex-closer-bad-1/tokens.txt+8 tests/golden/lex-closer-bad-1/tree.txt+3 tests/golden/lex-closer-bad-2/about.txt+3 tests/golden/lex-closer-bad-2/source.jibb+4 tests/golden/lex-closer-bad-2/tokens.txt+3 tests/golden/lex-closer-bad-2/tree.txt+3 tests/golden/lex-closer-bad-3/about.txt+3 tests/golden/lex-closer-bad-3/source.jibb+3 tests/golden/lex-closer-bad-3/tokens.txt+9 tests/golden/lex-closer-bad-3/tree.txt+3 tests/golden/lex-closer-bad-4/about.txt+3 tests/golden/lex-closer-bad-4/source.jibb+1 tests/golden/lex-closer-bad-4/tokens.txt+5 tests/golden/lex-closer-bad-4/tree.txt+3 tests/golden/lex-codepoint-bad-1/about.txt+3 tests/golden/lex-codepoint-bad-1/source.jibb+1 tests/golden/lex-codepoint-bad-1/tokens.txt+3 tests/golden/lex-codepoint-bad-1/tree.txt+3 tests/golden/lex-comment-bad-1/tree.txt+3 tests/golden/lex-comment-ok-1/tree.txt+6 tests/golden/lex-comment-ok-2/about.txt+2−2 tests/golden/lex-comment-ok-2/tree.txt+2 tests/golden/lex-comment-ok-3/tree.txt+1 tests/golden/lex-date-bad-1/tree.txt+3 tests/golden/lex-date-bad-2/about.txt+2−2 tests/golden/lex-date-bad-2/tree.txt+3 tests/golden/lex-date-bad-3/about.txt+3 tests/golden/lex-date-bad-3/source.jibb+1 tests/golden/lex-date-bad-3/tokens.txt+3 tests/golden/lex-date-bad-3/tree.txt+3 tests/golden/lex-date-ok-1/tree.txt+5 tests/golden/lex-date-ok-2/about.txt+3 tests/golden/lex-date-ok-2/source.jibb+2 tests/golden/lex-date-ok-2/tokens.txt+8 tests/golden/lex-date-ok-2/tree.txt+3 tests/golden/lex-decimal-bad-1/about.txt+2−2 tests/golden/lex-decimal-bad-1/tree.txt+3 tests/golden/lex-decimal-bad-2/tree.txt+3 tests/golden/lex-decimal-ok-1/tree.txt+5 tests/golden/lex-duration-bad-1/tree.txt+3 tests/golden/lex-duration-bad-2/about.txt+3 tests/golden/lex-duration-bad-2/source.jibb+1 tests/golden/lex-duration-bad-2/tokens.txt+3 tests/golden/lex-duration-bad-2/tree.txt+3 tests/golden/lex-duration-ok-1/tree.txt+5 tests/golden/lex-hex-bad-1/tree.txt+3 tests/golden/lex-hex-ok-1/tree.txt+5 tests/golden/lex-indent-bad-1/tree.txt+3 tests/golden/lex-indent-bad-2/tree.txt+3 tests/golden/lex-indent-bad-3/tree.txt+3 tests/golden/lex-indent-ok-1/tree.txt+21 tests/golden/lex-indent-ok-2/tree.txt+17 tests/golden/lex-indent-ok-3/source.jibb+1−1 tests/golden/lex-indent-ok-3/tokens.txt−1 tests/golden/lex-indent-ok-3/tree.txt+11 tests/golden/lex-interp-bad-1/tree.txt+3 tests/golden/lex-interp-bad-2/tree.txt+3 tests/golden/lex-interp-bad-3/tree.txt+3 tests/golden/lex-interp-bad-4/about.txt−3 tests/golden/lex-interp-bad-5/about.txt+3 tests/golden/lex-interp-bad-5/source.jibb+1 tests/golden/lex-interp-bad-5/tokens.txt+3 tests/golden/lex-interp-bad-5/tree.txt+3 tests/golden/lex-interp-bad-6/about.txt+3 tests/golden/lex-interp-bad-6/source.jibb+1 tests/golden/lex-interp-bad-6/tokens.txt+3 tests/golden/lex-interp-bad-6/tree.txt+3 tests/golden/lex-interp-ok-1/about.txt+2−2 tests/golden/lex-interp-ok-1/tree.txt+22 tests/golden/lex-interp-ok-2/about.txt+2−2 tests/golden/lex-interp-ok-2/tree.txt+17 tests/golden/lex-interp-ok-3/about.txt+3 tests/golden/lex-interp-bad-4/source.jibb → tests/golden/lex-interp-ok-3/source.jibb tests/golden/lex-interp-bad-4/tokens.txt → tests/golden/lex-interp-ok-3/tokens.txt tests/golden/lex-interp-ok-3/tree.txt+2 tests/golden/lex-knot-bad-1/tree.txt+3 tests/golden/lex-knot-ok-1/tree.txt+4 tests/golden/lex-layout-bad-1/about.txt+1−1 tests/golden/lex-layout-bad-1/tree.txt+3 tests/golden/lex-layout-bad-10/about.txt+3 tests/golden/lex-layout-bad-10/source.jibb+2 tests/golden/lex-layout-bad-10/tokens.txt+7 tests/golden/lex-layout-bad-10/tree.txt+3 tests/golden/lex-layout-bad-2/tree.txt+3 tests/golden/lex-layout-bad-3/tree.txt+3 tests/golden/lex-layout-bad-4/tree.txt+3 tests/golden/lex-layout-bad-5/about.txt+3 tests/golden/lex-layout-bad-5/source.jibb+2 tests/golden/lex-layout-bad-5/tokens.txt+6 tests/golden/lex-layout-bad-5/tree.txt+3 tests/golden/lex-layout-bad-6/about.txt+3 tests/golden/lex-layout-bad-6/source.jibb+2 tests/golden/lex-layout-bad-6/tokens.txt+6 tests/golden/lex-layout-bad-6/tree.txt+3 tests/golden/lex-layout-bad-7/about.txt+3 tests/golden/lex-layout-bad-7/source.jibb+2 tests/golden/lex-layout-bad-7/tokens.txt+6 tests/golden/lex-layout-bad-7/tree.txt+3 tests/golden/lex-layout-bad-8/about.txt+3 tests/golden/lex-layout-bad-8/source.jibb+2 tests/golden/lex-layout-bad-8/tokens.txt+5 tests/golden/lex-layout-bad-8/tree.txt+3 tests/golden/lex-layout-bad-9/about.txt+3 tests/golden/lex-layout-bad-9/source.jibb+2 tests/golden/lex-layout-bad-9/tokens.txt+11 tests/golden/lex-layout-bad-9/tree.txt+3 tests/golden/lex-layout-ok-1/tree.txt+20 tests/golden/lex-list-bad-1/tree.txt+3 tests/golden/lex-list-ok-1/tree.txt+11 tests/golden/lex-loobean-bad-1/tree.txt+3 tests/golden/lex-loobean-ok-1/tree.txt+3 tests/golden/lex-name-bad-1/tree.txt+3 tests/golden/lex-name-bad-2/tree.txt+3 tests/golden/lex-name-bad-3/tree.txt+3 tests/golden/lex-name-bad-4/tree.txt+3 tests/golden/lex-name-bad-5/about.txt+3 tests/golden/lex-name-bad-5/source.jibb+1 tests/golden/lex-name-bad-5/tokens.txt+3 tests/golden/lex-name-bad-5/tree.txt+3 tests/golden/lex-name-bad-6/about.txt+3 tests/golden/lex-name-bad-6/source.jibb+1 tests/golden/lex-name-bad-6/tokens.txt+4 tests/golden/lex-name-bad-6/tree.txt+3 tests/golden/lex-name-ok-1/tree.txt+11 tests/golden/lex-null-bad-1/tree.txt+3 tests/golden/lex-null-bad-2/about.txt+3 tests/golden/lex-null-bad-2/source.jibb+1 tests/golden/lex-null-bad-2/tokens.txt+3 tests/golden/lex-null-bad-2/tree.txt+3 tests/golden/lex-null-ok-1/tree.txt+19 tests/golden/lex-open-bracket-bad-1/tree.txt+3 tests/golden/lex-open-bracket-bad-10/about.txt+3 tests/golden/lex-open-bracket-bad-10/source.jibb+2 tests/golden/lex-open-bracket-bad-10/tokens.txt+16 tests/golden/lex-open-bracket-bad-10/tree.txt+3 tests/golden/lex-open-bracket-bad-11/about.txt+3 tests/golden/lex-open-bracket-bad-11/source.jibb+2 tests/golden/lex-open-bracket-bad-11/tokens.txt+9 tests/golden/lex-open-bracket-bad-11/tree.txt+3 tests/golden/lex-open-bracket-bad-12/about.txt+3 tests/golden/lex-open-bracket-bad-12/source.jibb+2 tests/golden/lex-open-bracket-bad-12/tokens.txt+8 tests/golden/lex-open-bracket-bad-12/tree.txt+3 tests/golden/lex-open-bracket-bad-13/about.txt+3 tests/golden/lex-open-bracket-bad-13/source.jibb+2 tests/golden/lex-open-bracket-bad-13/tokens.txt+10 tests/golden/lex-open-bracket-bad-13/tree.txt+3 tests/golden/lex-open-bracket-bad-14/about.txt+3 tests/golden/lex-open-bracket-bad-14/source.jibb+2 tests/golden/lex-open-bracket-bad-14/tokens.txt+11 tests/golden/lex-open-bracket-bad-14/tree.txt+3 tests/golden/lex-open-bracket-bad-15/about.txt+3 tests/golden/lex-open-bracket-bad-15/source.jibb+2 tests/golden/lex-open-bracket-bad-15/tokens.txt+8 tests/golden/lex-open-bracket-bad-15/tree.txt+3 tests/golden/lex-open-bracket-bad-16/about.txt+3 tests/golden/lex-open-bracket-bad-16/source.jibb+2 tests/golden/lex-open-bracket-bad-16/tokens.txt+10 tests/golden/lex-open-bracket-bad-16/tree.txt+3 tests/golden/lex-open-bracket-bad-2/tree.txt+3 tests/golden/lex-open-bracket-bad-3/tree.txt+3 tests/golden/lex-open-bracket-bad-4/about.txt−3 tests/golden/lex-open-bracket-bad-5/about.txt+3 tests/golden/lex-open-bracket-bad-5/source.jibb+3 tests/golden/lex-open-bracket-bad-5/tokens.txt+13 tests/golden/lex-open-bracket-bad-5/tree.txt+3 tests/golden/lex-open-bracket-bad-6/about.txt+3 tests/golden/lex-open-bracket-bad-6/source.jibb+2 tests/golden/lex-open-bracket-bad-6/tokens.txt+10 tests/golden/lex-open-bracket-bad-6/tree.txt+3 tests/golden/lex-open-bracket-bad-7/about.txt+3 tests/golden/lex-open-bracket-bad-7/source.jibb+2 tests/golden/lex-open-bracket-bad-7/tokens.txt+12 tests/golden/lex-open-bracket-bad-7/tree.txt+3 tests/golden/lex-open-bracket-bad-8/about.txt+3 tests/golden/lex-open-bracket-bad-8/source.jibb+2 tests/golden/lex-open-bracket-bad-8/tokens.txt+9 tests/golden/lex-open-bracket-bad-8/tree.txt+3 tests/golden/lex-open-bracket-bad-9/about.txt+3 tests/golden/lex-open-bracket-bad-9/source.jibb+3 tests/golden/lex-open-bracket-bad-9/tokens.txt+11 tests/golden/lex-open-bracket-bad-9/tree.txt+3 tests/golden/lex-open-bracket-ok-1/tree.txt+21 tests/golden/lex-open-bracket-ok-2/tree.txt+9 tests/golden/lex-open-bracket-ok-3/about.txt+3 tests/golden/lex-open-bracket-bad-4/source.jibb → tests/golden/lex-open-bracket-ok-3/source.jibb tests/golden/lex-open-bracket-bad-4/tokens.txt → tests/golden/lex-open-bracket-ok-3/tokens.txt tests/golden/lex-open-bracket-ok-3/tree.txt+9 tests/golden/lex-open-bracket-ok-4/about.txt+3 tests/golden/lex-open-bracket-ok-4/source.jibb+12 tests/golden/lex-open-bracket-ok-4/tokens.txt+47 tests/golden/lex-open-bracket-ok-4/tree.txt+19 tests/golden/lex-open-bracket-ok-5/about.txt+3 tests/golden/lex-open-bracket-ok-5/source.jibb+7 tests/golden/lex-open-bracket-ok-5/tokens.txt+41 tests/golden/lex-open-bracket-ok-5/tree.txt+17 tests/golden/lex-open-bracket-ok-6/about.txt+3 tests/golden/lex-open-bracket-ok-6/source.jibb+5 tests/golden/lex-open-bracket-ok-6/tokens.txt+22 tests/golden/lex-open-bracket-ok-6/tree.txt+12 tests/golden/lex-open-bracket-ok-7/about.txt+3 tests/golden/lex-open-bracket-ok-7/source.jibb+6 tests/golden/lex-open-bracket-ok-7/tokens.txt+30 tests/golden/lex-open-bracket-ok-7/tree.txt+18 tests/golden/lex-open-bracket-ok-8/about.txt+3 tests/golden/lex-open-bracket-ok-8/source.jibb+3 tests/golden/lex-open-bracket-ok-8/tokens.txt+16 tests/golden/lex-open-bracket-ok-8/tree.txt+8 tests/golden/lex-open-bracket-ok-9/about.txt+3 tests/golden/lex-open-bracket-ok-9/source.jibb+6 tests/golden/lex-open-bracket-ok-9/tokens.txt+21 tests/golden/lex-open-bracket-ok-9/tree.txt+5 tests/golden/lex-open-mold-bad-1/about.txt+3 tests/golden/lex-open-mold-bad-1/source.jibb+2 tests/golden/lex-open-mold-bad-1/tokens.txt+9 tests/golden/lex-open-mold-bad-1/tree.txt+3 tests/golden/lex-open-mold-bad-10/about.txt+3 tests/golden/lex-open-mold-bad-10/source.jibb+2 tests/golden/lex-open-mold-bad-10/tokens.txt+8 tests/golden/lex-open-mold-bad-10/tree.txt+3 tests/golden/lex-open-mold-bad-11/about.txt+3 tests/golden/lex-open-mold-bad-11/source.jibb+2 tests/golden/lex-open-mold-bad-11/tokens.txt+9 tests/golden/lex-open-mold-bad-11/tree.txt+3 tests/golden/lex-open-mold-bad-12/about.txt+3 tests/golden/lex-open-mold-bad-12/source.jibb+1 tests/golden/lex-open-mold-bad-12/tokens.txt+4 tests/golden/lex-open-mold-bad-12/tree.txt+3 tests/golden/lex-open-mold-bad-13/about.txt+3 tests/golden/lex-open-mold-bad-13/source.jibb+3 tests/golden/lex-open-mold-bad-13/tokens.txt+14 tests/golden/lex-open-mold-bad-13/tree.txt+3 tests/golden/lex-open-mold-bad-14/about.txt+3 tests/golden/lex-open-mold-bad-14/source.jibb+2 tests/golden/lex-open-mold-bad-14/tokens.txt+3 tests/golden/lex-open-mold-bad-14/tree.txt+3 tests/golden/lex-open-mold-bad-15/about.txt+3 tests/golden/lex-open-mold-bad-15/source.jibb+2 tests/golden/lex-open-mold-bad-15/tokens.txt+8 tests/golden/lex-open-mold-bad-15/tree.txt+3 tests/golden/lex-open-mold-bad-16/about.txt+3 tests/golden/lex-open-mold-bad-16/source.jibb+2 tests/golden/lex-open-mold-bad-16/tokens.txt+9 tests/golden/lex-open-mold-bad-16/tree.txt+3 tests/golden/lex-open-mold-bad-2/about.txt+3 tests/golden/lex-open-mold-bad-2/source.jibb+2 tests/golden/lex-open-mold-bad-2/tokens.txt+12 tests/golden/lex-open-mold-bad-2/tree.txt+3 tests/golden/lex-open-mold-bad-3/about.txt+3 tests/golden/lex-open-mold-bad-3/source.jibb+2 tests/golden/lex-open-mold-bad-3/tokens.txt+9 tests/golden/lex-open-mold-bad-3/tree.txt+3 tests/golden/lex-open-mold-bad-4/about.txt+3 tests/golden/lex-open-mold-bad-4/source.jibb+2 tests/golden/lex-open-mold-bad-4/tokens.txt+10 tests/golden/lex-open-mold-bad-4/tree.txt+3 tests/golden/lex-open-mold-bad-5/about.txt+3 tests/golden/lex-open-mold-bad-5/source.jibb+3 tests/golden/lex-open-mold-bad-5/tokens.txt+11 tests/golden/lex-open-mold-bad-5/tree.txt+3 tests/golden/lex-open-mold-bad-6/about.txt+3 tests/golden/lex-open-mold-bad-6/source.jibb+1 tests/golden/lex-open-mold-bad-6/tokens.txt+3 tests/golden/lex-open-mold-bad-6/tree.txt+3 tests/golden/lex-open-mold-bad-7/about.txt+3 tests/golden/lex-open-mold-bad-7/source.jibb+2 tests/golden/lex-open-mold-bad-7/tokens.txt+8 tests/golden/lex-open-mold-bad-7/tree.txt+3 tests/golden/lex-open-mold-bad-8/about.txt+3 tests/golden/lex-open-mold-bad-8/source.jibb+4 tests/golden/lex-open-mold-bad-8/tokens.txt+3 tests/golden/lex-open-mold-bad-8/tree.txt+3 tests/golden/lex-open-mold-bad-9/about.txt+3 tests/golden/lex-open-mold-bad-9/source.jibb+2 tests/golden/lex-open-mold-bad-9/tokens.txt+12 tests/golden/lex-open-mold-bad-9/tree.txt+3 tests/golden/lex-open-mold-ok-1/about.txt+3 tests/golden/lex-open-mold-ok-1/source.jibb+7 tests/golden/lex-open-mold-ok-1/tokens.txt+55 tests/golden/lex-open-mold-ok-1/tree.txt+19 tests/golden/lex-open-mold-ok-2/about.txt+3 tests/golden/lex-open-mold-ok-2/source.jibb+5 tests/golden/lex-open-mold-ok-2/tokens.txt+19 tests/golden/lex-open-mold-ok-2/tree.txt+5 tests/golden/lex-open-mold-ok-3/about.txt+3 tests/golden/lex-open-mold-ok-3/source.jibb+8 tests/golden/lex-open-mold-ok-3/tokens.txt+36 tests/golden/lex-open-mold-ok-3/tree.txt+13 tests/golden/lex-open-mold-ok-4/about.txt+3 tests/golden/lex-open-mold-ok-4/source.jibb+6 tests/golden/lex-open-mold-ok-4/tokens.txt+25 tests/golden/lex-open-mold-ok-4/tree.txt+11 tests/golden/lex-open-mold-ok-5/about.txt+3 tests/golden/lex-open-mold-ok-5/source.jibb+8 tests/golden/lex-open-mold-ok-5/tokens.txt+30 tests/golden/lex-open-mold-ok-5/tree.txt+8 tests/golden/lex-open-mold-ok-6/about.txt+3 tests/golden/lex-open-mold-ok-6/source.jibb+7 tests/golden/lex-open-mold-ok-6/tokens.txt+17 tests/golden/lex-open-mold-ok-6/tree.txt+6 tests/golden/lex-pair-binding-bad-1/tree.txt+9 tests/golden/lex-pair-binding-ok-1/tree.txt+11 tests/golden/lex-path-bad-1/tree.txt+3 tests/golden/lex-path-ok-1/tree.txt+5 tests/golden/lex-rune-layout-bad-1/about.txt+1−1 tests/golden/lex-rune-layout-bad-1/tree.txt+3 tests/golden/lex-rune-layout-bad-11/about.txt+3 tests/golden/lex-rune-layout-bad-11/source.jibb+2 tests/golden/lex-rune-layout-bad-11/tokens.txt+7 tests/golden/lex-rune-layout-bad-11/tree.txt+3 tests/golden/lex-rune-layout-bad-12/about.txt+3 tests/golden/lex-rune-layout-bad-12/source.jibb+2 tests/golden/lex-rune-layout-bad-12/tokens.txt+9 tests/golden/lex-rune-layout-bad-12/tree.txt+3 tests/golden/lex-rune-layout-bad-13/about.txt+3 tests/golden/lex-rune-layout-bad-13/source.jibb+3 tests/golden/lex-rune-layout-bad-13/tokens.txt+3 tests/golden/lex-rune-layout-bad-13/tree.txt+3 tests/golden/lex-rune-layout-bad-14/about.txt+3 tests/golden/lex-rune-layout-bad-14/source.jibb+4 tests/golden/lex-rune-layout-bad-14/tokens.txt+17 tests/golden/lex-rune-layout-bad-14/tree.txt+3 tests/golden/lex-rune-layout-bad-15/about.txt+3 tests/golden/lex-rune-layout-bad-15/source.jibb+2 tests/golden/lex-rune-layout-bad-15/tokens.txt+15 tests/golden/lex-rune-layout-bad-15/tree.txt+3 tests/golden/lex-rune-layout-bad-2/about.txt+1−1 tests/golden/lex-rune-layout-bad-2/tree.txt+3 tests/golden/lex-rune-layout-bad-3/about.txt+1−1 tests/golden/lex-rune-layout-bad-3/tree.txt+3 tests/golden/lex-rune-layout-bad-4/about.txt+1−1 tests/golden/lex-rune-layout-bad-4/tree.txt+3 tests/golden/lex-rune-layout-bad-5/about.txt+3 tests/golden/lex-rune-layout-bad-5/source.jibb+2 tests/golden/lex-rune-layout-bad-5/tokens.txt+7 tests/golden/lex-rune-layout-bad-5/tree.txt+3 tests/golden/lex-rune-layout-bad-6/about.txt+3 tests/golden/lex-rune-layout-bad-6/source.jibb+2 tests/golden/lex-rune-layout-bad-6/tokens.txt+7 tests/golden/lex-rune-layout-bad-6/tree.txt+3 tests/golden/lex-rune-layout-bad-7/about.txt+3 tests/golden/lex-rune-layout-bad-7/source.jibb+2 tests/golden/lex-rune-layout-bad-7/tokens.txt+7 tests/golden/lex-rune-layout-bad-7/tree.txt+3 tests/golden/lex-rune-layout-bad-8/about.txt+3 tests/golden/lex-rune-layout-bad-8/source.jibb+2 tests/golden/lex-rune-layout-bad-8/tokens.txt+7 tests/golden/lex-rune-layout-bad-8/tree.txt+3 tests/golden/lex-rune-layout-bad-9/about.txt+3 tests/golden/lex-rune-layout-bad-9/source.jibb+2 tests/golden/lex-rune-layout-bad-9/tokens.txt+13 tests/golden/lex-rune-layout-bad-9/tree.txt+3 tests/golden/lex-rune-layout-ok-1/about.txt+2−2 tests/golden/lex-rune-layout-ok-1/source.jibb+2−3 tests/golden/lex-rune-layout-ok-1/tokens.txt+5−8 tests/golden/lex-rune-layout-ok-1/tree.txt+42 tests/golden/lex-rune-layout-ok-2/about.txt+3 tests/golden/lex-rune-layout-ok-2/source.jibb+2 tests/golden/lex-rune-layout-ok-2/tokens.txt+13 tests/golden/lex-rune-layout-ok-2/tree.txt+4 tests/golden/lex-ship-bad-1/tree.txt+3 tests/golden/lex-ship-ok-1/tree.txt+4 tests/golden/lex-spacing-bad-1/tree.txt+3 tests/golden/lex-spacing-bad-2/tree.txt+3 tests/golden/lex-spacing-bad-3/about.txt−3 tests/golden/lex-spacing-bad-4/about.txt−3 tests/golden/lex-spacing-ok-1/tree.txt+17 tests/golden/lex-spacing-ok-2/about.txt+3 tests/golden/lex-spacing-bad-3/source.jibb → tests/golden/lex-spacing-ok-2/source.jibb tests/golden/lex-spacing-bad-3/tokens.txt → tests/golden/lex-spacing-ok-2/tokens.txt tests/golden/lex-spacing-ok-2/tree.txt+3 tests/golden/lex-spacing-ok-3/about.txt+3 tests/golden/lex-spacing-bad-4/source.jibb → tests/golden/lex-spacing-ok-3/source.jibb tests/golden/lex-spacing-bad-4/tokens.txt → tests/golden/lex-spacing-ok-3/tokens.txt tests/golden/lex-spacing-ok-3/tree.txt+5 tests/golden/lex-string-bad-1/tree.txt+3 tests/golden/lex-string-bad-2/about.txt+2−2 tests/golden/lex-string-bad-2/tree.txt+3 tests/golden/lex-string-ok-1/tree.txt+4 tests/golden/lex-term-bad-1/about.txt+1−1 tests/golden/lex-term-bad-1/tree.txt+3 tests/golden/lex-term-bad-10/about.txt+3 tests/golden/lex-term-bad-10/source.jibb+1 tests/golden/lex-term-bad-10/tokens.txt+3 tests/golden/lex-term-bad-10/tree.txt+3 tests/golden/lex-term-bad-11/about.txt+3 tests/golden/lex-term-bad-11/source.jibb+1 tests/golden/lex-term-bad-11/tokens.txt+3 tests/golden/lex-term-bad-11/tree.txt+3 tests/golden/lex-term-bad-12/about.txt+3 tests/golden/lex-term-bad-12/source.jibb+2 tests/golden/lex-term-bad-12/tokens.txt+3 tests/golden/lex-term-bad-12/tree.txt+3 tests/golden/lex-term-bad-13/about.txt+3 tests/golden/lex-term-bad-13/source.jibb+2 tests/golden/lex-term-bad-13/tokens.txt+3 tests/golden/lex-term-bad-13/tree.txt+3 tests/golden/lex-term-bad-14/about.txt+3 tests/golden/lex-term-bad-14/source.jibb+1 tests/golden/lex-term-bad-14/tokens.txt+3 tests/golden/lex-term-bad-14/tree.txt+3 tests/golden/lex-term-bad-15/about.txt+3 tests/golden/lex-term-bad-15/source.jibb+1 tests/golden/lex-term-bad-15/tokens.txt+3 tests/golden/lex-term-bad-15/tree.txt+3 tests/golden/lex-term-bad-2/about.txt+2−2 tests/golden/lex-term-bad-2/tokens.txt+1−1 tests/golden/lex-term-bad-2/tree.txt+3 tests/golden/lex-term-bad-3/about.txt+3−3 tests/golden/lex-term-bad-3/tokens.txt+3−3 tests/golden/lex-term-bad-3/tree.txt+3 tests/golden/lex-term-bad-4/about.txt+3 tests/golden/lex-term-bad-4/source.jibb+1 tests/golden/lex-term-bad-4/tokens.txt+3 tests/golden/lex-term-bad-4/tree.txt+3 tests/golden/lex-term-bad-5/about.txt+3 tests/golden/lex-term-bad-5/source.jibb+1 tests/golden/lex-term-bad-5/tokens.txt+3 tests/golden/lex-term-bad-5/tree.txt+3 tests/golden/lex-term-bad-6/about.txt+3 tests/golden/lex-term-bad-6/source.jibb+1 tests/golden/lex-term-bad-6/tokens.txt+3 tests/golden/lex-term-bad-6/tree.txt+3 tests/golden/lex-term-bad-7/about.txt+3 tests/golden/lex-term-bad-7/source.jibb+1 tests/golden/lex-term-bad-7/tokens.txt+3 tests/golden/lex-term-bad-7/tree.txt+3 tests/golden/lex-term-bad-8/about.txt+3 tests/golden/lex-term-bad-8/source.jibb+1 tests/golden/lex-term-bad-8/tokens.txt+3 tests/golden/lex-term-bad-8/tree.txt+3 tests/golden/lex-term-bad-9/about.txt+3 tests/golden/lex-term-bad-9/source.jibb+1 tests/golden/lex-term-bad-9/tokens.txt+3 tests/golden/lex-term-bad-9/tree.txt+3 tests/golden/lex-term-dollar/about.txt+3 tests/golden/lex-term-dollar/source.jibb+9 tests/golden/lex-term-dollar/tokens.txt+43 tests/golden/lex-term-dollar/tree.txt+19 tests/golden/lex-term-ok-1/about.txt+3−3 tests/golden/lex-term-ok-1/source.jibb+2 tests/golden/lex-term-ok-1/tokens.txt+9−1 tests/golden/lex-term-ok-1/tree.txt+9 tests/golden/lex-tight-change-bad-1/about.txt+1−1 tests/golden/lex-tight-change-bad-1/tree.txt+6 tests/golden/lex-tight-change-bad-2/about.txt+1−1 tests/golden/lex-tight-change-bad-2/tree.txt+3 tests/golden/lex-tight-change-bad-3/about.txt+3 tests/golden/lex-tight-change-bad-3/source.jibb+1 tests/golden/lex-tight-change-bad-3/tokens.txt+8 tests/golden/lex-tight-change-bad-3/tree.txt+3 tests/golden/lex-tight-change-bad-4/about.txt+3 tests/golden/lex-tight-change-bad-4/source.jibb+1 tests/golden/lex-tight-change-bad-4/tokens.txt+7 tests/golden/lex-tight-change-bad-4/tree.txt+3 tests/golden/lex-tight-change-bad-5/about.txt+3 tests/golden/lex-tight-change-bad-5/source.jibb+1 tests/golden/lex-tight-change-bad-5/tokens.txt+9 tests/golden/lex-tight-change-bad-5/tree.txt+3 tests/golden/lex-tight-change-bad-6/about.txt+3 tests/golden/lex-tight-change-bad-6/source.jibb+3 tests/golden/lex-tight-change-bad-6/tokens.txt+12 tests/golden/lex-tight-change-bad-6/tree.txt+3 tests/golden/lex-tight-change-bad-7/about.txt+3 tests/golden/lex-tight-change-bad-7/source.jibb+1 tests/golden/lex-tight-change-bad-7/tokens.txt+7 tests/golden/lex-tight-change-bad-7/tree.txt+3 tests/golden/lex-tight-change-bad-8/about.txt+3 tests/golden/lex-tight-change-bad-8/source.jibb+1 tests/golden/lex-tight-change-bad-8/tokens.txt+3 tests/golden/lex-tight-change-bad-8/tree.txt+3 tests/golden/lex-tight-change-bad-9/about.txt+3 tests/golden/lex-tight-change-bad-9/source.jibb+1 tests/golden/lex-tight-change-bad-9/tokens.txt+3 tests/golden/lex-tight-change-bad-9/tree.txt+3 tests/golden/lex-tight-change-ok-1/about.txt+1−1 tests/golden/lex-tight-change-ok-1/tree.txt+14 tests/golden/lex-tight-ctor-bad-1/about.txt+1−1 tests/golden/lex-tight-ctor-bad-1/tree.txt+3 tests/golden/lex-tight-ctor-bad-2/about.txt+1−1 tests/golden/lex-tight-ctor-bad-2/tree.txt+5 tests/golden/lex-tight-ctor-ok-1/about.txt+1−1 tests/golden/lex-tight-ctor-ok-1/tree.txt+7 tests/golden/lex-tight-opener-bad-1/about.txt+1−1 tests/golden/lex-tight-opener-bad-1/tree.txt+5 tests/golden/lex-tight-opener-bad-2/about.txt+1−1 tests/golden/lex-tight-opener-bad-2/tree.txt+3 tests/golden/lex-tight-opener-bad-3/about.txt+3−3 tests/golden/lex-tight-opener-bad-3/tokens.txt+3−8 tests/golden/lex-tight-opener-bad-3/tree.txt+3 tests/golden/lex-tight-opener-bad-4/about.txt+1−1 tests/golden/lex-tight-opener-bad-4/tree.txt+3 tests/golden/lex-tight-opener-ok-1/about.txt+2−2 tests/golden/lex-tight-opener-ok-1/source.jibb−1 tests/golden/lex-tight-opener-ok-1/tokens.txt+5−12 tests/golden/lex-tight-opener-ok-1/tree.txt+10 tests/golden/lex-tight-pair-bad-1/about.txt+1−1 tests/golden/lex-tight-pair-bad-1/tree.txt+3 tests/golden/lex-tight-pair-bad-2/about.txt+3 tests/golden/lex-tight-pair-bad-2/source.jibb+2 tests/golden/lex-tight-pair-bad-2/tokens.txt+9 tests/golden/lex-tight-pair-bad-2/tree.txt+3 tests/golden/lex-tight-pair-bad-3/about.txt+3 tests/golden/lex-tight-pair-bad-3/source.jibb+1 tests/golden/lex-tight-pair-bad-3/tokens.txt+3 tests/golden/lex-tight-pair-bad-3/tree.txt+3 tests/golden/lex-tight-pair-ok-1/about.txt+1−1 tests/golden/lex-tight-pair-ok-1/tree.txt+18 tests/golden/lex-tight-qath-bad-1/about.txt+1−1 tests/golden/lex-tight-qath-bad-1/tree.txt+3 tests/golden/lex-tight-qath-bad-2/tree.txt+3 tests/golden/lex-tight-qath-bad-3/tree.txt+3 tests/golden/lex-tight-qath-ok-1/about.txt+1−1 tests/golden/lex-tight-qath-ok-1/tree.txt+9 tests/golden/lex-tight-unit-bad-1/about.txt+1−1 tests/golden/lex-tight-unit-bad-1/tree.txt+3 tests/golden/lex-tight-unit-ok-1/about.txt+1−1 tests/golden/lex-tight-unit-ok-1/tree.txt+13 tests/golden/lex-tight-wing-bad-1/about.txt+1−1 tests/golden/lex-tight-wing-bad-1/tree.txt+3 tests/golden/lex-tight-wing-ok-1/about.txt+1−1 tests/golden/lex-tight-wing-ok-1/tree.txt+8 tests/golden/module-cache-dag/about.txt+4 tests/golden/module-cache-dag/module-trees.txt+46 tests/golden/module-cache-dag/modules.txt+8 tests/golden/module-cache-dag/modules/ui/n0.jibb+3 tests/golden/module-cache-dag/modules/ui/n1.jibb+3 tests/golden/module-cache-dag/modules/ui/n2.jibb+3 tests/golden/module-cache-dag/modules/ui/n3.jibb+3 tests/golden/module-cache-dag/modules/ui/n4.jibb+3 tests/golden/module-cache-dag/modules/ui/n5.jibb+3 tests/golden/module-cache-dag/modules/ui/n6.jibb+3 tests/golden/module-cache-dag/modules/ui/n7.jibb+1 tests/golden/module-cache-dag/source.jibb+2 tests/golden/module-cache-dag/tokens.txt+14 tests/golden/module-cache-dag/tree.txt+5 tests/golden/module-cache-dag/types.txt+2 tests/golden/module-cache-faces/about.txt+4 tests/golden/module-cache-faces/module-trees.txt+4 tests/golden/module-cache-faces/modules.txt+1 tests/golden/module-cache-faces/modules/ui/shared.jibb+1 tests/golden/module-cache-faces/source.jibb+4 tests/golden/module-cache-faces/tokens.txt+28 tests/golden/module-cache-faces/tree.txt+9 tests/golden/module-cache-faces/types.txt+3 tests/golden/module-cache-incomplete/about.txt+4 tests/golden/module-cache-incomplete/module-trees.txt+8 tests/golden/module-cache-incomplete/modules.txt+1 tests/golden/module-cache-incomplete/modules/ui/bad.jibb+2 tests/golden/module-cache-incomplete/source.jibb+3 tests/golden/module-cache-incomplete/tokens.txt+21 tests/golden/module-cache-incomplete/tree.txt+6 tests/golden/module-cache-incomplete/types.txt+2 tests/golden/module-cache-sibling-cycle/about.txt+4 tests/golden/module-cache-sibling-cycle/module-trees.txt+15 tests/golden/module-cache-sibling-cycle/modules.txt+3 tests/golden/module-cache-sibling-cycle/modules/ui/a.jibb+3 tests/golden/module-cache-sibling-cycle/modules/ui/b.jibb+2 tests/golden/module-cache-sibling-cycle/modules/ui/safe.jibb+1 tests/golden/module-cache-sibling-cycle/source.jibb+3 tests/golden/module-cache-sibling-cycle/tokens.txt+18 tests/golden/module-cache-sibling-cycle/tree.txt+4 tests/golden/module-cache-sibling-cycle/types.txt+2 tests/golden/module-fixture-eof/about.txt+3 tests/golden/module-fixture-eof/module-trees.txt+4 tests/golden/module-fixture-eof/modules.txt+1 tests/golden/module-fixture-eof/modules/ui/incomplete.jibb+1 tests/golden/module-fixture-eof/source.jibb+1 tests/golden/module-fixture-eof/tokens.txt+4 tests/golden/module-fixture-eof/tree.txt+2 tests/golden/module-import-atom-scheme/about.txt+4 tests/golden/module-import-atom-scheme/module-trees.txt+13 tests/golden/module-import-atom-scheme/modules.txt+2 tests/golden/module-import-atom-scheme/modules/ui/base.jibb+3 tests/golden/module-import-atom-scheme/modules/ui/mid.jibb+2 tests/golden/module-import-atom-scheme/source.jibb+4 tests/golden/module-import-atom-scheme/tokens.txt+31 tests/golden/module-import-atom-scheme/tree.txt+13 tests/golden/module-import-atom-scheme/types.txt+10 tests/golden/module-import-cycle/about.txt+4 tests/golden/module-import-cycle/module-trees.txt+16 tests/golden/module-import-cycle/modules.txt+2 tests/golden/module-import-cycle/modules/ui/a.jibb+2 tests/golden/module-import-cycle/modules/ui/b.jibb+2 tests/golden/module-import-cycle/path.txt+1 tests/golden/module-import-cycle/source.jibb+2 tests/golden/module-import-cycle/tokens.txt+14 tests/golden/module-import-cycle/tree.txt+5 tests/golden/module-import-cycle/types.txt+2 tests/golden/module-import-empty/about.txt+4 tests/golden/module-import-empty/modules.txt+1 tests/golden/module-import-empty/source.jibb+2 tests/golden/module-import-empty/tokens.txt+14 tests/golden/module-import-empty/tree.txt+5 tests/golden/module-import-empty/types.txt+2 tests/golden/module-import-face-shadow/about.txt+4 tests/golden/module-import-face-shadow/module-trees.txt+4 tests/golden/module-import-face-shadow/modules.txt+1 tests/golden/module-import-face-shadow/modules/ui/lib.jibb+1 tests/golden/module-import-face-shadow/source.jibb+4 tests/golden/module-import-face-shadow/tokens.txt+19 tests/golden/module-import-face-shadow/tree.txt+8 tests/golden/module-import-face-shadow/types.txt+2 tests/golden/module-import-identity/about.txt+4 tests/golden/module-import-identity/module-trees.txt+4 tests/golden/module-import-identity/modules.txt+1 tests/golden/module-import-identity/modules/ui/lib.jibb+1 tests/golden/module-import-identity/source.jibb+3 tests/golden/module-import-identity/tokens.txt+21 tests/golden/module-import-identity/tree.txt+8 tests/golden/module-import-identity/types.txt+3 tests/golden/module-import-invalid/about.txt+4 tests/golden/module-import-invalid/module-trees.txt+4 tests/golden/module-import-invalid/modules.txt+1 tests/golden/module-import-invalid/modules/ui/lib.jibb+1 tests/golden/module-import-invalid/source.jibb+2 tests/golden/module-import-invalid/tokens.txt+14 tests/golden/module-import-invalid/tree.txt+5 tests/golden/module-import-invalid/types.txt+2 tests/golden/module-import-missing-member/about.txt+4 tests/golden/module-import-missing-member/module-trees.txt+4 tests/golden/module-import-missing-member/modules.txt+1 tests/golden/module-import-missing-member/modules/ui/lib.jibb+1 tests/golden/module-import-missing-member/source.jibb+2 tests/golden/module-import-missing-member/tokens.txt+14 tests/golden/module-import-missing-member/tree.txt+5 tests/golden/module-import-missing-member/types.txt+2 tests/golden/module-import-mold/about.txt+4 tests/golden/module-import-mold/module-trees.txt+3 tests/golden/module-import-mold/modules.txt+1 tests/golden/module-import-mold/modules/ui/lib.jibb+1 tests/golden/module-import-mold/source.jibb+2 tests/golden/module-import-mold/tokens.txt+15 tests/golden/module-import-mold/tree.txt+6 tests/golden/module-import-mold/types.txt+2 tests/golden/module-import-prelude-cross-namespace/about.txt+4 tests/golden/module-import-prelude-cross-namespace/modules.txt+1 tests/golden/module-import-prelude-cross-namespace/source.jibb+1 tests/golden/module-import-prelude-cross-namespace/tokens.txt+7 tests/golden/module-import-prelude-cross-namespace/tree.txt+3 tests/golden/module-import-prelude-cross-namespace/types.txt+2 tests/golden/module-import-prelude-mold-shadow/about.txt+4 tests/golden/module-import-prelude-mold-shadow/modules.txt+1 tests/golden/module-import-prelude-mold-shadow/source.jibb+2 tests/golden/module-import-prelude-mold-shadow/tokens.txt+8 tests/golden/module-import-prelude-mold-shadow/tree.txt+3 tests/golden/module-import-prelude-mold-shadow/types.txt+2 tests/golden/module-import-prelude-sample-shadow/about.txt+4 tests/golden/module-import-prelude-sample-shadow/module-trees.txt+4 tests/golden/module-import-prelude-sample-shadow/modules.txt+1 tests/golden/module-import-prelude-sample-shadow/modules/ui/lib.jibb+1 tests/golden/module-import-prelude-sample-shadow/source.jibb+2 tests/golden/module-import-prelude-sample-shadow/tokens.txt+14 tests/golden/module-import-prelude-sample-shadow/tree.txt+4 tests/golden/module-import-prelude-sample-shadow/types.txt+2 tests/golden/module-import-prelude-value-shadow/about.txt+4 tests/golden/module-import-prelude-value-shadow/module-trees.txt+4 tests/golden/module-import-prelude-value-shadow/modules.txt+1 tests/golden/module-import-prelude-value-shadow/modules/ui/lib.jibb+1 tests/golden/module-import-prelude-value-shadow/source.jibb+2 tests/golden/module-import-prelude-value-shadow/tokens.txt+11 tests/golden/module-import-prelude-value-shadow/tree.txt+3 tests/golden/module-import-prelude-value-shadow/types.txt+2 tests/golden/module-import-root-cycle/about.txt+4 tests/golden/module-import-root-cycle/module-trees.txt+8 tests/golden/module-import-root-cycle/modules.txt+1 tests/golden/module-import-root-cycle/modules/ui/a.jibb+2 tests/golden/module-import-root-cycle/path.txt+1 tests/golden/module-import-root-cycle/source.jibb+2 tests/golden/module-import-root-cycle/tokens.txt+17 tests/golden/module-import-root-cycle/tree.txt+7 tests/golden/module-import-root-cycle/types.txt+2 tests/golden/module-import-root-import-shadow/about.txt+4 tests/golden/module-import-root-import-shadow/imports.txt+1 tests/golden/module-import-root-import-shadow/mar/label.txt+5 tests/golden/module-import-root-import-shadow/marks.txt+1 tests/golden/module-import-root-import-shadow/modules.txt+1 tests/golden/module-import-root-import-shadow/source.jibb+4 tests/golden/module-import-root-import-shadow/sur/fixture.txt+3 tests/golden/module-import-root-import-shadow/tokens.txt+20 tests/golden/module-import-root-import-shadow/tree.txt+7 tests/golden/module-import-root-import-shadow/types.txt+3 tests/golden/module-import-separate-namespaces/about.txt+4 tests/golden/module-import-separate-namespaces/module-trees.txt+5 tests/golden/module-import-separate-namespaces/modules.txt+1 tests/golden/module-import-separate-namespaces/modules/ui/lib.jibb+2 tests/golden/module-import-separate-namespaces/source.jibb+3 tests/golden/module-import-separate-namespaces/tokens.txt+22 tests/golden/module-import-separate-namespaces/tree.txt+9 tests/golden/module-import-separate-namespaces/types.txt+3 tests/golden/module-import-sur-scope/about.txt+4 tests/golden/module-import-sur-scope/imports.txt+1 tests/golden/module-import-sur-scope/module-trees.txt+6 tests/golden/module-import-sur-scope/modules.txt+1 tests/golden/module-import-sur-scope/modules/ui/lib.jibb+1 tests/golden/module-import-sur-scope/source.jibb+4 tests/golden/module-import-sur-scope/sur/fixture.txt+3 tests/golden/module-import-sur-scope/tokens.txt+25 tests/golden/module-import-sur-scope/tree.txt+10 tests/golden/module-import-sur-scope/types.txt+2 tests/golden/module-import-transitive/about.txt+4 tests/golden/module-import-transitive/module-trees.txt+20 tests/golden/module-import-transitive/modules.txt+3 tests/golden/module-import-transitive/modules/ui/a.jibb+2 tests/golden/module-import-transitive/modules/ui/b.jibb+2 tests/golden/module-import-transitive/modules/ui/c.jibb+1 tests/golden/module-import-transitive/path.txt+1 tests/golden/module-import-transitive/source.jibb+2 tests/golden/module-import-transitive/tokens.txt+14 tests/golden/module-import-transitive/tree.txt+5 tests/golden/module-import-transitive/types.txt+2 tests/golden/module-import-unused-invalid/about.txt+4 tests/golden/module-import-unused-invalid/module-trees.txt+8 tests/golden/module-import-unused-invalid/modules.txt+2 tests/golden/module-import-unused-invalid/modules/ui/good.jibb+1 tests/golden/module-import-unused-invalid/modules/ui/unused.jibb+1 tests/golden/module-import-unused-invalid/source.jibb+2 tests/golden/module-import-unused-invalid/tokens.txt+14 tests/golden/module-import-unused-invalid/tree.txt+5 tests/golden/module-import-unused-invalid/types.txt+2 tests/golden/parser-hole-parameter-rejected/about.txt+3 tests/golden/parser-hole-parameter-rejected/source.jibb+1 tests/golden/parser-hole-parameter-rejected/tokens.txt+8 tests/golden/parser-hole-parameter-rejected/tree.txt+3 tests/golden/parser-hole-path-space/about.txt+3 tests/golden/parser-hole-path-space/source.jibb+1 tests/golden/parser-hole-path-space/tokens.txt+9 tests/golden/parser-hole-path-space/tree.txt+3 tests/golden/parser-hole-path/about.txt+3 tests/golden/parser-hole-path/source.jibb+4 tests/golden/parser-hole-path/tokens.txt+28 tests/golden/parser-hole-path/tree.txt+5 tests/golden/parser-hole-pattern-rejected/about.txt+3 tests/golden/parser-hole-pattern-rejected/source.jibb+3 tests/golden/parser-hole-pattern-rejected/tokens.txt+15 tests/golden/parser-hole-pattern-rejected/tree.txt+3 tests/golden/parser-hole-shapes/about.txt+3 tests/golden/parser-hole-shapes/source.jibb+11 tests/golden/parser-hole-shapes/tokens.txt+121 tests/golden/parser-hole-shapes/tree.txt+47 tests/golden/parser-hole-value-rejected/about.txt+3 tests/golden/parser-hole-value-rejected/source.jibb+1 tests/golden/parser-hole-value-rejected/tokens.txt+4 tests/golden/parser-hole-value-rejected/tree.txt+3 tests/golden/prelude-1c-structural/about.txt+4 tests/golden/prelude-1c-structural/source.jibb+130 tests/golden/prelude-1c-structural/tokens.txt+806 tests/golden/prelude-1c-structural/tree.txt+322 tests/golden/prelude-1c-structural/types.txt+38 tests/golden/prelude-3g-basic/about.txt+4 tests/golden/prelude-3g-basic/source.jibb+62 tests/golden/prelude-3g-basic/tokens.txt+354 tests/golden/prelude-3g-basic/tree.txt+156 tests/golden/prelude-3g-basic/types.txt+15 tests/golden/prelude-3g-like/about.txt+4 tests/golden/prelude-3g-like/source.jibb+110 tests/golden/prelude-3g-like/tokens.txt+688 tests/golden/prelude-3g-like/tree.txt+280 tests/golden/prelude-3g-like/types.txt+31 tests/golden/prelude-3g-structural/about.txt+4 tests/golden/prelude-3g-structural/source.jibb+95 tests/golden/prelude-3g-structural/tokens.txt+564 tests/golden/prelude-3g-structural/tree.txt+228 tests/golden/prelude-3g-structural/types.txt+28 tests/golden/prelude-core-functions/about.txt+4 tests/golden/prelude-core-functions/source.jibb+15 tests/golden/prelude-core-functions/tokens.txt+68 tests/golden/prelude-core-functions/tree.txt+33 tests/golden/prelude-core-functions/types.txt+5 tests/golden/prelude-list-helpers/about.txt+4 tests/golden/prelude-list-helpers/source.jibb+148 tests/golden/prelude-list-helpers/tokens.txt+928 tests/golden/prelude-list-helpers/tree.txt+378 tests/golden/prelude-list-helpers/types.txt+42 tests/golden/prelude-list-unit/about.txt+4 tests/golden/prelude-list-unit/source.jibb+51 tests/golden/prelude-list-unit/tokens.txt+279 tests/golden/prelude-list-unit/tree.txt+126 tests/golden/prelude-list-unit/types.txt+11 tests/golden/prelude-unit-list-transforms/about.txt+4 tests/golden/prelude-unit-list-transforms/source.jibb+339 tests/golden/prelude-unit-list-transforms/tokens.txt+2234 tests/golden/prelude-unit-list-transforms/tree.txt+972 tests/golden/prelude-unit-list-transforms/types.txt+72 tests/golden/types-arithmetic-combined/about.txt+4 tests/golden/types-arithmetic-combined/modules.txt+1 tests/golden/types-arithmetic-combined/source.jibb+56 tests/golden/types-arithmetic-combined/tokens.txt+511 tests/golden/types-arithmetic-combined/tree.txt+232 tests/golden/types-arithmetic-combined/types.txt+120 tests/golden/types-arithmetic-generic/about.txt+4 tests/golden/types-arithmetic-generic/modules.txt+1 tests/golden/types-arithmetic-generic/source.jibb+21 tests/golden/types-arithmetic-generic/tokens.txt+206 tests/golden/types-arithmetic-generic/tree.txt+93 tests/golden/types-arithmetic-generic/types.txt+44 tests/golden/types-arithmetic-module/about.txt+4 tests/golden/types-arithmetic-module/module-trees.txt+26 tests/golden/types-arithmetic-module/modules.txt+1 tests/golden/types-arithmetic-module/modules/ui/math.jibb+6 tests/golden/types-arithmetic-module/source.jibb+16 tests/golden/types-arithmetic-module/tokens.txt+137 tests/golden/types-arithmetic-module/tree.txt+63 tests/golden/types-arithmetic-module/types.txt+44 tests/golden/types-arithmetic-proj-qath/about.txt+4 tests/golden/types-arithmetic-proj-qath/modules.txt+1 tests/golden/types-arithmetic-proj-qath/source.jibb+18 tests/golden/types-arithmetic-proj-qath/tokens.txt+351 tests/golden/types-arithmetic-proj-qath/tree.txt+164 tests/golden/types-arithmetic-proj-qath/types.txt+33 tests/golden/types-arithmetic-scopes/about.txt+4 tests/golden/types-arithmetic-scopes/modules.txt+1 tests/golden/types-arithmetic-scopes/source.jibb+22 tests/golden/types-arithmetic-scopes/tokens.txt+221 tests/golden/types-arithmetic-scopes/tree.txt+108 tests/golden/types-arithmetic-scopes/types.txt+21 tests/golden/types-capital-distinct/about.txt+4 tests/golden/types-capital-distinct/source.jibb+6 tests/golden/types-capital-distinct/tokens.txt+73 tests/golden/types-capital-distinct/tree.txt+33 tests/golden/types-capital-distinct/types.txt+19 tests/golden/types-cell-branch-context/about.txt+4 tests/golden/types-cell-branch-context/modules.txt+1 tests/golden/types-cell-branch-context/source.jibb+37 tests/golden/types-cell-branch-context/tokens.txt+308 tests/golden/types-cell-branch-context/tree.txt+156 tests/golden/types-cell-branch-context/types.txt+11 tests/golden/types-cell-pattern-many/about.txt+4 tests/golden/types-cell-pattern-many/modules.txt+1 tests/golden/types-cell-pattern-many/source.jibb+41 tests/golden/types-cell-pattern-many/tokens.txt+315 tests/golden/types-cell-pattern-many/tree.txt+144 tests/golden/types-cell-pattern-many/types.txt+14 tests/golden/types-cell-pattern-schemes/about.txt+4 tests/golden/types-cell-pattern-schemes/modules.txt+1 tests/golden/types-cell-pattern-schemes/source.jibb+23 tests/golden/types-cell-pattern-schemes/tokens.txt+168 tests/golden/types-cell-pattern-schemes/tree.txt+70 tests/golden/types-cell-pattern-schemes/types.txt+16 tests/golden/types-cell-pattern-tail/about.txt+4 tests/golden/types-cell-pattern-tail/modules.txt+1 tests/golden/types-cell-pattern-tail/source.jibb+18 tests/golden/types-cell-pattern-tail/tokens.txt+126 tests/golden/types-cell-pattern-tail/tree.txt+59 tests/golden/types-cell-pattern-tail/types.txt+7 tests/golden/types-constructor-context/about.txt+1 tests/golden/types-constructor-context/source.jibb+37 tests/golden/types-constructor-context/tokens.txt+289 tests/golden/types-constructor-context/tree.txt+130 tests/golden/types-constructor-context/types.txt+54 tests/golden/types-deferred-call-context/about.txt+4 tests/golden/types-deferred-call-context/modules.txt+1 tests/golden/types-deferred-call-context/source.jibb+56 tests/golden/types-deferred-call-context/tokens.txt+557 tests/golden/types-deferred-call-context/tree.txt+272 tests/golden/types-deferred-call-context/types.txt+82 tests/golden/types-equal-head-disjoint/about.txt+2 tests/golden/types-equal-head-disjoint/source.jibb+25 tests/golden/types-equal-head-disjoint/tokens.txt+179 tests/golden/types-equal-head-disjoint/tree.txt+75 tests/golden/types-equal-head-disjoint/types.txt+34 tests/golden/types-flag-branch-context/about.txt+4 tests/golden/types-flag-branch-context/modules.txt+1 tests/golden/types-flag-branch-context/source.jibb+83 tests/golden/types-flag-branch-context/tokens.txt+496 tests/golden/types-flag-branch-context/tree.txt+244 tests/golden/types-flag-branch-context/types.txt+33 tests/golden/types-generic-arity/about.txt+4 tests/golden/types-generic-arity/source.jibb+4 tests/golden/types-generic-arity/tokens.txt+64 tests/golden/types-generic-arity/tree.txt+23 tests/golden/types-generic-arity/types.txt+5 tests/golden/types-generic-face-inference/about.txt+4 tests/golden/types-generic-face-inference/source.jibb+8 tests/golden/types-generic-face-inference/tokens.txt+134 tests/golden/types-generic-face-inference/tree.txt+56 tests/golden/types-generic-face-inference/types.txt+13 tests/golden/types-generic-gates/about.txt+4 tests/golden/types-generic-gates/source.jibb+4 tests/golden/types-generic-gates/tokens.txt+59 tests/golden/types-generic-gates/tree.txt+21 tests/golden/types-generic-gates/types.txt+5 tests/golden/types-generic-import-reverse/about.txt+4 tests/golden/types-generic-import-reverse/module-trees.txt+7 tests/golden/types-generic-import-reverse/modules.txt+1 tests/golden/types-generic-import-reverse/modules/ui/lib.jibb+1 tests/golden/types-generic-import-reverse/source.jibb+3 tests/golden/types-generic-import-reverse/tokens.txt+50 tests/golden/types-generic-import-reverse/tree.txt+18 tests/golden/types-generic-import-reverse/types.txt+3 tests/golden/types-generic-lexical-alias/about.txt+4 tests/golden/types-generic-lexical-alias/source.jibb+3 tests/golden/types-generic-lexical-alias/tokens.txt+35 tests/golden/types-generic-lexical-alias/tree.txt+13 tests/golden/types-generic-lexical-alias/types.txt+4 tests/golden/types-generic-local-parameter/about.txt+4 tests/golden/types-generic-local-parameter/source.jibb+3 tests/golden/types-generic-local-parameter/tokens.txt+37 tests/golden/types-generic-local-parameter/tree.txt+15 tests/golden/types-generic-local-parameter/types.txt+2 tests/golden/types-generic-local-scope/about.txt+4 tests/golden/types-generic-local-scope/source.jibb+3 tests/golden/types-generic-local-scope/tokens.txt+37 tests/golden/types-generic-local-scope/tree.txt+15 tests/golden/types-generic-local-scope/types.txt+2 tests/golden/types-generic-module/about.txt+4 tests/golden/types-generic-module/module-trees.txt+7 tests/golden/types-generic-module/modules.txt+1 tests/golden/types-generic-module/modules/ui/lib.jibb+1 tests/golden/types-generic-module/source.jibb+3 tests/golden/types-generic-module/tokens.txt+39 tests/golden/types-generic-module/tree.txt+14 tests/golden/types-generic-module/types.txt+3 tests/golden/types-generic-nested-scope/about.txt+4 tests/golden/types-generic-nested-scope/source.jibb+3 tests/golden/types-generic-nested-scope/tokens.txt+56 tests/golden/types-generic-nested-scope/tree.txt+21 tests/golden/types-generic-nested-scope/types.txt+4 tests/golden/types-generic-parameters/about.txt+4 tests/golden/types-generic-parameters/source.jibb+4 tests/golden/types-generic-parameters/tokens.txt+64 tests/golden/types-generic-parameters/tree.txt+23 tests/golden/types-generic-parameters/types.txt+5 tests/golden/types-generic-record/about.txt+4 tests/golden/types-generic-record/source.jibb+3 tests/golden/types-generic-record/tokens.txt+47 tests/golden/types-generic-record/tree.txt+18 tests/golden/types-generic-record/types.txt+4 tests/golden/types-generic-recursive-union/about.txt+4 tests/golden/types-generic-recursive-union/source.jibb+6 tests/golden/types-generic-recursive-union/tokens.txt+58 tests/golden/types-generic-recursive-union/tree.txt+24 tests/golden/types-generic-recursive-union/types.txt+5 tests/golden/types-generic-repeated/about.txt+4 tests/golden/types-generic-repeated/source.jibb+3 tests/golden/types-generic-repeated/tokens.txt+47 tests/golden/types-generic-repeated/tree.txt+18 tests/golden/types-generic-repeated/types.txt+10 tests/golden/types-generic-result-context/about.txt+1 tests/golden/types-generic-result-context/source.jibb+24 tests/golden/types-generic-result-context/tokens.txt+233 tests/golden/types-generic-result-context/tree.txt+86 tests/golden/types-generic-result-context/types.txt+22 tests/golden/types-generic-union-alias-face/about.txt+4 tests/golden/types-generic-union-alias-face/module-trees.txt+11 tests/golden/types-generic-union-alias-face/modules.txt+1 tests/golden/types-generic-union-alias-face/modules/ui/base.jibb+3 tests/golden/types-generic-union-alias-face/source.jibb+6 tests/golden/types-generic-union-alias-face/tokens.txt+75 tests/golden/types-generic-union-alias-face/tree.txt+24 tests/golden/types-generic-union-alias-face/types.txt+12 tests/golden/types-generic-union-alias/about.txt+4 tests/golden/types-generic-union-alias/source.jibb+23 tests/golden/types-generic-union-alias/tokens.txt+248 tests/golden/types-generic-union-alias/tree.txt+86 tests/golden/types-generic-union-alias/types.txt+22 tests/golden/types-generic-union-capitals/about.txt+4 tests/golden/types-generic-union-capitals/source.jibb+17 tests/golden/types-generic-union-capitals/tokens.txt+162 tests/golden/types-generic-union-capitals/tree.txt+68 tests/golden/types-generic-union-capitals/types.txt+34 tests/golden/types-generic-union-errors/about.txt+4 tests/golden/types-generic-union-errors/source.jibb+11 tests/golden/types-generic-union-errors/tokens.txt+93 tests/golden/types-generic-union-errors/tree.txt+36 tests/golden/types-generic-union-errors/types.txt+26 tests/golden/types-generic-union-escaping/about.txt+4 tests/golden/types-generic-union-escaping/module-trees.txt+16 tests/golden/types-generic-union-escaping/modules.txt+2 tests/golden/types-generic-union-escaping/modules/ui/base.jibb+3 tests/golden/types-generic-union-escaping/modules/ui/mid.jibb+3 tests/golden/types-generic-union-escaping/source.jibb+3 tests/golden/types-generic-union-escaping/tokens.txt+15 tests/golden/types-generic-union-escaping/tree.txt+4 tests/golden/types-generic-union-escaping/types.txt+3 tests/golden/types-generic-union-import/about.txt+4 tests/golden/types-generic-union-import/module-trees.txt+32 tests/golden/types-generic-union-import/modules.txt+2 tests/golden/types-generic-union-import/modules/ui/shared.jibb+4 tests/golden/types-generic-union-import/modules/ui/twin.jibb+4 tests/golden/types-generic-union-import/source.jibb+9 tests/golden/types-generic-union-import/tokens.txt+79 tests/golden/types-generic-union-import/tree.txt+27 tests/golden/types-generic-union-import/types.txt+7 tests/golden/types-generic-union-local/about.txt+4 tests/golden/types-generic-union-local/source.jibb+34 tests/golden/types-generic-union-local/tokens.txt+297 tests/golden/types-generic-union-local/tree.txt+120 tests/golden/types-generic-union-local/types.txt+22 tests/golden/types-generic-union-transitive/about.txt+4 tests/golden/types-generic-union-transitive/module-trees.txt+27 tests/golden/types-generic-union-transitive/modules.txt+2 tests/golden/types-generic-union-transitive/modules/ui/base.jibb+3 tests/golden/types-generic-union-transitive/modules/ui/mid.jibb+4 tests/golden/types-generic-union-transitive/source.jibb+5 tests/golden/types-generic-union-transitive/tokens.txt+43 tests/golden/types-generic-union-transitive/tree.txt+15 tests/golden/types-generic-union-transitive/types.txt+5 tests/golden/types-hole-concrete/about.txt+4 tests/golden/types-hole-concrete/source.jibb+6 tests/golden/types-hole-concrete/tokens.txt+54 tests/golden/types-hole-concrete/tree.txt+22 tests/golden/types-hole-concrete/types.txt+10 tests/golden/types-hole-generic-mold/about.txt+4 tests/golden/types-hole-generic-mold/source.jibb+2 tests/golden/types-hole-generic-mold/tokens.txt+26 tests/golden/types-hole-generic-mold/tree.txt+11 tests/golden/types-hole-generic-mold/types.txt+6 tests/golden/types-hole-local-boundary/about.txt+4 tests/golden/types-hole-local-boundary/source.jibb+16 tests/golden/types-hole-local-boundary/tokens.txt+118 tests/golden/types-hole-local-boundary/tree.txt+55 tests/golden/types-hole-local-boundary/types.txt+17 tests/golden/types-hole-module-boundary/about.txt+4 tests/golden/types-hole-module-boundary/module-trees.txt+6 tests/golden/types-hole-module-boundary/modules.txt+1 tests/golden/types-hole-module-boundary/modules/ui/lib.jibb+1 tests/golden/types-hole-module-boundary/source.jibb+2 tests/golden/types-hole-module-boundary/tokens.txt+14 tests/golden/types-hole-module-boundary/tree.txt+5 tests/golden/types-hole-module-boundary/types.txt+2 tests/golden/types-hole-named-complex/about.txt+4 tests/golden/types-hole-named-complex/source.jibb+2 tests/golden/types-hole-named-complex/tokens.txt+20 tests/golden/types-hole-named-complex/tree.txt+9 tests/golden/types-hole-named-complex/types.txt+3 tests/golden/types-hole-numeric-capture/about.txt+4 tests/golden/types-hole-numeric-capture/source.jibb+19 tests/golden/types-hole-numeric-capture/tokens.txt+127 tests/golden/types-hole-numeric-capture/tree.txt+62 tests/golden/types-hole-numeric-capture/types.txt+10 tests/golden/types-hole-unbound-mold/about.txt+4 tests/golden/types-hole-unbound-mold/source.jibb+2 tests/golden/types-hole-unbound-mold/tokens.txt+19 tests/golden/types-hole-unbound-mold/tree.txt+9 tests/golden/types-hole-unbound-mold/types.txt+3 tests/golden/types-hole-unsupported/about.txt+4 tests/golden/types-hole-unsupported/source.jibb+2 tests/golden/types-hole-unsupported/tokens.txt+14 tests/golden/types-hole-unsupported/tree.txt+7 tests/golden/types-hole-unsupported/types.txt+6 tests/golden/types-hole-user-generic/about.txt+4 tests/golden/types-hole-user-generic/source.jibb+6 tests/golden/types-hole-user-generic/tokens.txt+71 tests/golden/types-hole-user-generic/tree.txt+31 tests/golden/types-hole-user-generic/types.txt+10 tests/golden/types-hole-user-named/about.txt+4 tests/golden/types-hole-user-named/source.jibb+2 tests/golden/types-hole-user-named/tokens.txt+22 tests/golden/types-hole-user-named/tree.txt+11 tests/golden/types-hole-user-named/types.txt+6 tests/golden/types-hole-user-value/about.txt+4 tests/golden/types-hole-user-value/source.jibb+3 tests/golden/types-hole-user-value/tokens.txt+21 tests/golden/types-hole-user-value/tree.txt+10 tests/golden/types-hole-user-value/types.txt+7 tests/golden/types-import-duplicate-mark/about.txt+4 tests/golden/types-import-duplicate-mark/mar/duplicate.txt+5 tests/golden/types-import-duplicate-mark/marks.txt+1 tests/golden/types-import-duplicate-mark/source.jibb+2 tests/golden/types-import-duplicate-mark/tokens.txt+11 tests/golden/types-import-duplicate-mark/tree.txt+6 tests/golden/types-import-duplicate-mark/types.txt+2 tests/golden/types-import-duplicate-sur/about.txt+4 tests/golden/types-import-duplicate-sur/imports.txt+3 tests/golden/types-import-duplicate-sur/source.jibb+5 tests/golden/types-import-duplicate-sur/sur/fixture.txt+6 tests/golden/types-import-duplicate-sur/tokens.txt+35 tests/golden/types-import-duplicate-sur/tree.txt+18 tests/golden/types-import-duplicate-sur/types.txt+5 tests/golden/types-import-hoon-flags/about.txt+4 tests/golden/types-import-hoon-flags/imports.txt+4 tests/golden/types-import-hoon-flags/source.jibb+14 tests/golden/types-import-hoon-flags/sur/flags.txt+7 tests/golden/types-import-hoon-flags/tokens.txt+91 tests/golden/types-import-hoon-flags/tree.txt+41 tests/golden/types-import-hoon-flags/types.txt+24 tests/golden/types-import-hoon-noun/about.txt+4 tests/golden/types-import-hoon-noun/imports.txt+4 tests/golden/types-import-hoon-noun/source.jibb+8 tests/golden/types-import-hoon-noun/sur/fixture.txt+6 tests/golden/types-import-hoon-noun/tokens.txt+60 tests/golden/types-import-hoon-noun/tree.txt+28 tests/golden/types-import-hoon-noun/types.txt+8 tests/golden/types-import-mark-record/about.txt+4 tests/golden/types-import-mark-record/mar/choice.txt+5 tests/golden/types-import-mark-record/mar/note.txt+5 tests/golden/types-import-mark-record/marks.txt+2 tests/golden/types-import-mark-record/source.jibb+5 tests/golden/types-import-mark-record/tokens.txt+30 tests/golden/types-import-mark-record/tree.txt+15 tests/golden/types-import-mark-record/types.txt+4 tests/golden/types-import-mark/about.txt+4 tests/golden/types-import-mark/imports.txt+1 tests/golden/types-import-mark/mar/label.txt+5 tests/golden/types-import-mark/marks.txt+1 tests/golden/types-import-mark/source.jibb+4 tests/golden/types-import-mark/sur/fixture.txt+3 tests/golden/types-import-mark/tokens.txt+22 tests/golden/types-import-mark/tree.txt+11 tests/golden/types-import-mark/types.txt+3 tests/golden/types-import-missing-mold/about.txt+4 tests/golden/types-import-missing-mold/imports.txt+1 tests/golden/types-import-missing-mold/source.jibb+2 tests/golden/types-import-missing-mold/sur/fixture.txt+3 tests/golden/types-import-missing-mold/tokens.txt+11 tests/golden/types-import-missing-mold/tree.txt+6 tests/golden/types-import-missing-mold/types.txt+2 tests/golden/types-import-sur-record-graph/about.txt+4 tests/golden/types-import-sur-record-graph/imports.txt+1 tests/golden/types-import-sur-record-graph/module-trees.txt+7 tests/golden/types-import-sur-record-graph/modules.txt+1 tests/golden/types-import-sur-record-graph/modules/ui/lib.jibb+2 tests/golden/types-import-sur-record-graph/source.jibb+2 tests/golden/types-import-sur-record-graph/sur/fixture.txt+3 tests/golden/types-import-sur-record-graph/tokens.txt+32 tests/golden/types-import-sur-record-graph/tree.txt+13 tests/golden/types-import-sur-record-graph/types.txt+2 tests/golden/types-import-sur/about.txt+4 tests/golden/types-import-sur/imports.txt+2 tests/golden/types-import-sur/source.jibb+3 tests/golden/types-import-sur/sur/fixture.txt+4 tests/golden/types-import-sur/tokens.txt+19 tests/golden/types-import-sur/tree.txt+10 tests/golden/types-import-sur/types.txt+3 tests/golden/types-import-tlon-notes/about.txt+4 tests/golden/types-import-tlon-notes/imports.txt+7 tests/golden/types-import-tlon-notes/source.jibb+8 tests/golden/types-import-tlon-notes/sur/notes.txt+433 tests/golden/types-import-tlon-notes/tokens.txt+59 tests/golden/types-import-tlon-notes/tree.txt+30 tests/golden/types-import-tlon-notes/types.txt+8 tests/golden/types-list-branch/about.txt+4 tests/golden/types-list-branch/modules.txt+1 tests/golden/types-list-branch/source.jibb+81 tests/golden/types-list-branch/tokens.txt+521 tests/golden/types-list-branch/tree.txt+237 tests/golden/types-list-branch/types.txt+41 tests/golden/types-list-cons/about.txt+4 tests/golden/types-list-cons/modules.txt+1 tests/golden/types-list-cons/source.jibb+20 tests/golden/types-list-cons/tokens.txt+217 tests/golden/types-list-cons/tree.txt+85 tests/golden/types-list-cons/types.txt+29 tests/golden/types-list-context/about.txt+4 tests/golden/types-list-context/modules.txt+1 tests/golden/types-list-context/source.jibb+17 tests/golden/types-list-context/tokens.txt+143 tests/golden/types-list-context/tree.txt+59 tests/golden/types-list-context/types.txt+18 tests/golden/types-list-imported/about.txt+4 tests/golden/types-list-imported/imports.txt+2 tests/golden/types-list-imported/modules.txt+1 tests/golden/types-list-imported/source.jibb+14 tests/golden/types-list-imported/sur/fixture.txt+4 tests/golden/types-list-imported/tokens.txt+109 tests/golden/types-list-imported/tree.txt+52 tests/golden/types-list-imported/types.txt+22 tests/golden/types-list-open-constraints/about.txt+4 tests/golden/types-list-open-constraints/modules.txt+1 tests/golden/types-list-open-constraints/source.jibb+19 tests/golden/types-list-open-constraints/tokens.txt+178 tests/golden/types-list-open-constraints/tree.txt+68 tests/golden/types-list-open-constraints/types.txt+30 tests/golden/types-list-open/about.txt+4 tests/golden/types-list-open/modules.txt+1 tests/golden/types-list-open/source.jibb+13 tests/golden/types-list-open/tokens.txt+94 tests/golden/types-list-open/tree.txt+36 tests/golden/types-list-open/types.txt+18 tests/golden/types-list-pattern-imported/about.txt+4 tests/golden/types-list-pattern-imported/imports.txt+2 tests/golden/types-list-pattern-imported/modules.txt+1 tests/golden/types-list-pattern-imported/source.jibb+13 tests/golden/types-list-pattern-imported/sur/fixture.txt+5 tests/golden/types-list-pattern-imported/tokens.txt+66 tests/golden/types-list-pattern-imported/tree.txt+32 tests/golden/types-list-pattern-imported/types.txt+4 tests/golden/types-list-patterns/about.txt+4 tests/golden/types-list-patterns/modules.txt+1 tests/golden/types-list-patterns/source.jibb+64 tests/golden/types-list-patterns/tokens.txt+359 tests/golden/types-list-patterns/tree.txt+168 tests/golden/types-list-patterns/types.txt+17 tests/golden/types-list-zero-fit/about.txt+4 tests/golden/types-list-zero-fit/modules.txt+1 tests/golden/types-list-zero-fit/source.jibb+8 tests/golden/types-list-zero-fit/tokens.txt+181 tests/golden/types-list-zero-fit/tree.txt+91 tests/golden/types-list-zero-fit/types.txt+27 tests/golden/types-literal-constructor-nouns/about.txt+2 tests/golden/types-literal-constructor-nouns/source.jibb+25 tests/golden/types-literal-constructor-nouns/tokens.txt+177 tests/golden/types-literal-constructor-nouns/tree.txt+78 tests/golden/types-literal-constructor-nouns/types.txt+45 tests/golden/types-local-capitals/about.txt+4 tests/golden/types-local-capitals/modules.txt+1 tests/golden/types-local-capitals/source.jibb+73 tests/golden/types-local-capitals/tokens.txt+473 tests/golden/types-local-capitals/tree.txt+229 tests/golden/types-local-capitals/types.txt+28 tests/golden/types-local-recursive/about.txt+4 tests/golden/types-local-recursive/modules.txt+1 tests/golden/types-local-recursive/source.jibb+54 tests/golden/types-local-recursive/tokens.txt+351 tests/golden/types-local-recursive/tree.txt+170 tests/golden/types-local-recursive/types.txt+12 tests/golden/types-local-scc-adversarial/about.txt+4 tests/golden/types-local-scc-adversarial/modules.txt+1 tests/golden/types-local-scc-adversarial/source.jibb+54 tests/golden/types-local-scc-adversarial/tokens.txt+404 tests/golden/types-local-scc-adversarial/tree.txt+204 tests/golden/types-local-scc-adversarial/types.txt+17 tests/golden/types-local-scc/about.txt+4 tests/golden/types-local-scc/modules.txt+1 tests/golden/types-local-scc/source.jibb+58 tests/golden/types-local-scc/tokens.txt+434 tests/golden/types-local-scc/tree.txt+214 tests/golden/types-local-scc/types.txt+12 tests/golden/types-loobean-singleton-source/about.txt+2 tests/golden/types-loobean-singleton-source/source.jibb+22 tests/golden/types-loobean-singleton-source/tokens.txt+143 tests/golden/types-loobean-singleton-source/tree.txt+52 tests/golden/types-loobean-singleton-source/types.txt+65 tests/golden/types-loobean-union-context/about.txt+2 tests/golden/types-loobean-union-context/source.jibb+28 tests/golden/types-loobean-union-context/tokens.txt+136 tests/golden/types-loobean-union-context/tree.txt+55 tests/golden/types-loobean-union-context/types.txt+35 tests/golden/types-missing-tag-context/about.txt+4 tests/golden/types-missing-tag-context/modules.txt+1 tests/golden/types-missing-tag-context/source.jibb+17 tests/golden/types-missing-tag-context/tokens.txt+98 tests/golden/types-missing-tag-context/tree.txt+45 tests/golden/types-missing-tag-context/types.txt+38 tests/golden/types-missing-tag-imported/about.txt+4 tests/golden/types-missing-tag-imported/imports.txt+2 tests/golden/types-missing-tag-imported/source.jibb+6 tests/golden/types-missing-tag-imported/sur/fixture.txt+21 tests/golden/types-missing-tag-imported/tokens.txt+43 tests/golden/types-missing-tag-imported/tree.txt+18 tests/golden/types-missing-tag-imported/types.txt+12 tests/golden/types-missing-tag-named/about.txt+4 tests/golden/types-missing-tag-named/modules.txt+1 tests/golden/types-missing-tag-named/source.jibb+23 tests/golden/types-missing-tag-named/tokens.txt+155 tests/golden/types-missing-tag-named/tree.txt+66 tests/golden/types-missing-tag-named/types.txt+66 tests/golden/types-module-field-duplicate/about.txt+4 tests/golden/types-module-field-duplicate/module-trees.txt+6 tests/golden/types-module-field-duplicate/modules.txt+1 tests/golden/types-module-field-duplicate/modules/ui/lib.jibb+1 tests/golden/types-module-field-duplicate/source.jibb+2 tests/golden/types-module-field-duplicate/tokens.txt+11 tests/golden/types-module-field-duplicate/tree.txt+3 tests/golden/types-module-field-duplicate/types.txt+8 tests/golden/types-module-field-nonrecord/about.txt+4 tests/golden/types-module-field-nonrecord/module-trees.txt+12 tests/golden/types-module-field-nonrecord/modules.txt+1 tests/golden/types-module-field-nonrecord/modules/ui/lib.jibb+2 tests/golden/types-module-field-nonrecord/source.jibb+2 tests/golden/types-module-field-nonrecord/tokens.txt+11 tests/golden/types-module-field-nonrecord/tree.txt+3 tests/golden/types-module-field-nonrecord/types.txt+2 tests/golden/types-module-field-path/about.txt+4 tests/golden/types-module-field-path/module-trees.txt+12 tests/golden/types-module-field-path/modules.txt+1 tests/golden/types-module-field-path/modules/ui/lib.jibb+2 tests/golden/types-module-field-path/source.jibb+9 tests/golden/types-module-field-path/tokens.txt+45 tests/golden/types-module-field-path/tree.txt+14 tests/golden/types-module-field-path/types.txt+9 tests/golden/types-module-field-shadow/about.txt+4 tests/golden/types-module-field-shadow/module-trees.txt+12 tests/golden/types-module-field-shadow/modules.txt+1 tests/golden/types-module-field-shadow/modules/ui/lib.jibb+2 tests/golden/types-module-field-shadow/source.jibb+2 tests/golden/types-module-field-shadow/tokens.txt+15 tests/golden/types-module-field-shadow/tree.txt+6 tests/golden/types-module-field-shadow/types.txt+2 tests/golden/types-module-fixtures/about.txt+4 tests/golden/types-module-fixtures/module-trees.txt+13 tests/golden/types-module-fixtures/modules.txt+2 tests/golden/types-module-fixtures/modules/ui/api/blog.jibb+5 tests/golden/types-module-fixtures/modules/ui/components/card.jibb+5 tests/golden/types-module-fixtures/path.txt+1 tests/golden/types-module-fixtures/source.jibb+9 tests/golden/types-module-fixtures/tokens.txt+62 tests/golden/types-module-fixtures/tree.txt+23 tests/golden/types-module-fixtures/types.txt+2 tests/golden/types-module-mixed/about.txt+4 tests/golden/types-module-mixed/imports.txt+1 tests/golden/types-module-mixed/mar/label.txt+5 tests/golden/types-module-mixed/marks.txt+1 tests/golden/types-module-mixed/module-trees.txt+6 tests/golden/types-module-mixed/modules.txt+1 tests/golden/types-module-mixed/modules/ui/helper.jibb+1 tests/golden/types-module-mixed/source.jibb+5 tests/golden/types-module-mixed/sur/fixture.txt+3 tests/golden/types-module-mixed/tokens.txt+29 tests/golden/types-module-mixed/tree.txt+12 tests/golden/types-module-mixed/types.txt+3 tests/golden/types-multi-call/about.txt+4 tests/golden/types-multi-call/modules.txt+1 tests/golden/types-multi-call/source.jibb+42 tests/golden/types-multi-call/tokens.txt+370 tests/golden/types-multi-call/tree.txt+169 tests/golden/types-multi-call/types.txt+100 tests/golden/types-multi-import/about.txt+4 tests/golden/types-multi-import/module-trees.txt+16 tests/golden/types-multi-import/modules.txt+1 tests/golden/types-multi-import/modules/ui/lib.jibb+5 tests/golden/types-multi-import/source.jibb+5 tests/golden/types-multi-import/tokens.txt+43 tests/golden/types-multi-import/tree.txt+20 tests/golden/types-multi-import/types.txt+17 tests/golden/types-nested-missing-tag/about.txt+4 tests/golden/types-nested-missing-tag/modules.txt+1 tests/golden/types-nested-missing-tag/source.jibb+18 tests/golden/types-nested-missing-tag/tokens.txt+184 tests/golden/types-nested-missing-tag/tree.txt+79 tests/golden/types-nested-missing-tag/types.txt+71 tests/golden/types-nested-noun-context/about.txt+4 tests/golden/types-nested-noun-context/source.jibb+35 tests/golden/types-nested-noun-context/tokens.txt+363 tests/golden/types-nested-noun-context/tree.txt+162 tests/golden/types-nested-noun-context/types.txt+34 tests/golden/types-nested-shallow-preserve/about.txt+4 tests/golden/types-nested-shallow-preserve/modules.txt+1 tests/golden/types-nested-shallow-preserve/source.jibb+30 tests/golden/types-nested-shallow-preserve/tokens.txt+271 tests/golden/types-nested-shallow-preserve/tree.txt+136 tests/golden/types-nested-shallow-preserve/types.txt+33 tests/golden/types-nested-union-context/about.txt+4 tests/golden/types-nested-union-context/source.jibb+59 tests/golden/types-nested-union-context/tokens.txt+660 tests/golden/types-nested-union-context/tree.txt+302 tests/golden/types-nested-union-context/types.txt+49 tests/golden/types-null-context/about.txt+4 tests/golden/types-null-context/source.jibb+8 tests/golden/types-null-context/tokens.txt+57 tests/golden/types-null-context/tree.txt+25 tests/golden/types-null-context/types.txt+7 tests/golden/types-null-overlap/about.txt+4 tests/golden/types-null-overlap/source.jibb+3 tests/golden/types-null-overlap/tokens.txt+8 tests/golden/types-null-overlap/tree.txt+3 tests/golden/types-null-overlap/types.txt+8 tests/golden/types-null-unresolved/about.txt+4 tests/golden/types-null-unresolved/source.jibb+18 tests/golden/types-null-unresolved/tokens.txt+79 tests/golden/types-null-unresolved/tree.txt+34 tests/golden/types-null-unresolved/types.txt+9 tests/golden/types-pair-context/about.txt+4 tests/golden/types-pair-context/modules.txt+1 tests/golden/types-pair-context/source.jibb+32 tests/golden/types-pair-context/tokens.txt+217 tests/golden/types-pair-context/tree.txt+86 tests/golden/types-pair-context/types.txt+43 tests/golden/types-partial-apply/about.txt+4 tests/golden/types-partial-apply/source.jibb+1 tests/golden/types-partial-apply/tokens.txt+13 tests/golden/types-partial-apply/tree.txt+8 tests/golden/types-partial-apply/types.txt+2 tests/golden/types-partial-atom-alias/about.txt+4 tests/golden/types-partial-atom-alias/source.jibb+10 tests/golden/types-partial-atom-alias/tokens.txt+67 tests/golden/types-partial-atom-alias/tree.txt+31 tests/golden/types-partial-atom-alias/types.txt+21 tests/golden/types-partial-atom-constraint/about.txt+4 tests/golden/types-partial-atom-constraint/source.jibb+14 tests/golden/types-partial-atom-constraint/tokens.txt+91 tests/golden/types-partial-atom-constraint/tree.txt+42 tests/golden/types-partial-atom-constraint/types.txt+27 tests/golden/types-partial-atom-widening/about.txt+4 tests/golden/types-partial-atom-widening/source.jibb+9 tests/golden/types-partial-atom-widening/tokens.txt+79 tests/golden/types-partial-atom-widening/tree.txt+35 tests/golden/types-partial-atom-widening/types.txt+16 tests/golden/types-partial-aura-family/about.txt+4 tests/golden/types-partial-aura-family/source.jibb+10 tests/golden/types-partial-aura-family/tokens.txt+100 tests/golden/types-partial-aura-family/tree.txt+44 tests/golden/types-partial-aura-family/types.txt+23 tests/golden/types-partial-aura-generalization/about.txt+4 tests/golden/types-partial-aura-generalization/source.jibb+2 tests/golden/types-partial-aura-generalization/tokens.txt+16 tests/golden/types-partial-aura-generalization/tree.txt+8 tests/golden/types-partial-aura-generalization/types.txt+3 tests/golden/types-partial-aura/about.txt+4 tests/golden/types-partial-aura/source.jibb+3 tests/golden/types-partial-aura/tokens.txt+16 tests/golden/types-partial-aura/tree.txt+6 tests/golden/types-partial-aura/types.txt+10 tests/golden/types-partial-bare-atom/about.txt+4 tests/golden/types-partial-bare-atom/source.jibb+2 tests/golden/types-partial-bare-atom/tokens.txt+20 tests/golden/types-partial-bare-atom/tree.txt+12 tests/golden/types-partial-bare-atom/types.txt+3 tests/golden/types-partial-branch-widening/about.txt+4 tests/golden/types-partial-branch-widening/source.jibb+20 tests/golden/types-partial-branch-widening/tokens.txt+96 tests/golden/types-partial-branch-widening/tree.txt+49 tests/golden/types-partial-branch-widening/types.txt+12 tests/golden/types-partial-conflicting-sites/about.txt+4 tests/golden/types-partial-conflicting-sites/source.jibb+5 tests/golden/types-partial-conflicting-sites/tokens.txt+33 tests/golden/types-partial-conflicting-sites/tree.txt+15 tests/golden/types-partial-conflicting-sites/types.txt+23 tests/golden/types-partial-decimal-default/about.txt+7 tests/golden/types-partial-decimal-default/source.jibb+6 tests/golden/types-partial-decimal-default/tokens.txt+34 tests/golden/types-partial-decimal-default/tree.txt+12 tests/golden/types-partial-decimal-default/types.txt+7 tests/golden/types-partial-dependency-chain/about.txt+4 tests/golden/types-partial-dependency-chain/source.jibb+3 tests/golden/types-partial-dependency-chain/tokens.txt+12 tests/golden/types-partial-dependency-chain/tree.txt+4 tests/golden/types-partial-dependency-chain/types.txt+4 tests/golden/types-partial-explicit-capital/about.txt+4 tests/golden/types-partial-explicit-capital/source.jibb+1 tests/golden/types-partial-explicit-capital/tokens.txt+10 tests/golden/types-partial-explicit-capital/tree.txt+5 tests/golden/types-partial-explicit-capital/types.txt+2 tests/golden/types-partial-forward/about.txt+4 tests/golden/types-partial-forward/source.jibb+2 tests/golden/types-partial-forward/tokens.txt+8 tests/golden/types-partial-forward/tree.txt+3 tests/golden/types-partial-forward/types.txt+3 tests/golden/types-partial-generalization/about.txt+4 tests/golden/types-partial-generalization/source.jibb+3 tests/golden/types-partial-generalization/tokens.txt+21 tests/golden/types-partial-generalization/tree.txt+9 tests/golden/types-partial-generalization/types.txt+4 tests/golden/types-partial-identity/about.txt+4 tests/golden/types-partial-identity/source.jibb+1 tests/golden/types-partial-identity/tokens.txt+7 tests/golden/types-partial-identity/tree.txt+3 tests/golden/types-partial-identity/types.txt+2 tests/golden/types-partial-independent-atoms/about.txt+4 tests/golden/types-partial-independent-atoms/source.jibb+2 tests/golden/types-partial-independent-atoms/tokens.txt+21 tests/golden/types-partial-independent-atoms/tree.txt+11 tests/golden/types-partial-independent-atoms/types.txt+3 tests/golden/types-partial-local-molds/about.txt+10 tests/golden/types-partial-local-molds/source.jibb+39 tests/golden/types-partial-local-molds/tokens.txt+170 tests/golden/types-partial-local-molds/tree.txt+80 tests/golden/types-partial-local-molds/types.txt+11 tests/golden/types-partial-locals/about.txt+8 tests/golden/types-partial-locals/source.jibb+44 tests/golden/types-partial-locals/tokens.txt+239 tests/golden/types-partial-locals/tree.txt+122 tests/golden/types-partial-locals/types.txt+32 tests/golden/types-partial-many-atom-constraints/about.txt+4 tests/golden/types-partial-many-atom-constraints/source.jibb+13 tests/golden/types-partial-many-atom-constraints/tokens.txt+90 tests/golden/types-partial-many-atom-constraints/tree.txt+44 tests/golden/types-partial-many-atom-constraints/types.txt+26 tests/golden/types-partial-mold-bare-aura/about.txt+4 tests/golden/types-partial-mold-bare-aura/source.jibb+2 tests/golden/types-partial-mold-bare-aura/tokens.txt+10 tests/golden/types-partial-mold-bare-aura/tree.txt+4 tests/golden/types-partial-mold-bare-aura/types.txt+3 tests/golden/types-partial-mold-composite/about.txt+4 tests/golden/types-partial-mold-composite/source.jibb+4 tests/golden/types-partial-mold-composite/tokens.txt+31 tests/golden/types-partial-mold-composite/tree.txt+13 tests/golden/types-partial-mold-composite/types.txt+5 tests/golden/types-partial-mold-forward/about.txt+4 tests/golden/types-partial-mold-forward/source.jibb+2 tests/golden/types-partial-mold-forward/tokens.txt+10 tests/golden/types-partial-mold-forward/tree.txt+4 tests/golden/types-partial-mold-forward/types.txt+3 tests/golden/types-partial-mold-recursive/about.txt+4 tests/golden/types-partial-mold-recursive/source.jibb+4 tests/golden/types-partial-mold-recursive/tokens.txt+17 tests/golden/types-partial-mold-recursive/tree.txt+7 tests/golden/types-partial-mold-recursive/types.txt+3 tests/golden/types-partial-occurs/about.txt+4 tests/golden/types-partial-occurs/source.jibb+1 tests/golden/types-partial-occurs/tokens.txt+10 tests/golden/types-partial-occurs/tree.txt+6 tests/golden/types-partial-occurs/types.txt+8 tests/golden/types-partial-projection/about.txt+4 tests/golden/types-partial-projection/source.jibb+4 tests/golden/types-partial-projection/tokens.txt+31 tests/golden/types-partial-projection/tree.txt+16 tests/golden/types-partial-projection/types.txt+3 tests/golden/types-partial-shadow-global/about.txt+4 tests/golden/types-partial-shadow-global/source.jibb+2 tests/golden/types-partial-shadow-global/tokens.txt+10 tests/golden/types-partial-shadow-global/tree.txt+4 tests/golden/types-partial-shadow-global/types.txt+3 tests/golden/types-partial-shared-tvar/about.txt+4 tests/golden/types-partial-shared-tvar/source.jibb+3 tests/golden/types-partial-shared-tvar/tokens.txt+31 tests/golden/types-partial-shared-tvar/tree.txt+16 tests/golden/types-partial-shared-tvar/types.txt+10 tests/golden/types-partial-union-cases/about.txt+3 tests/golden/types-partial-union-cases/source.jibb+32 tests/golden/types-partial-union-cases/tokens.txt+121 tests/golden/types-partial-union-cases/tree.txt+38 tests/golden/types-partial-union-cases/types.txt+31 tests/golden/types-partial-union-edges/about.txt+3 tests/golden/types-partial-union-edges/source.jibb+24 tests/golden/types-partial-union-edges/tokens.txt+97 tests/golden/types-partial-union-edges/tree.txt+33 tests/golden/types-partial-union-edges/types.txt+15 tests/golden/types-partial-union-nested-nouns/about.txt+4 tests/golden/types-partial-union-nested-nouns/source.jibb+18 tests/golden/types-partial-union-nested-nouns/tokens.txt+108 tests/golden/types-partial-union-nested-nouns/tree.txt+47 tests/golden/types-partial-union-nested-nouns/types.txt+25 tests/golden/types-partial-unresolved-tag/about.txt+4 tests/golden/types-partial-unresolved-tag/source.jibb+1 tests/golden/types-partial-unresolved-tag/tokens.txt+4 tests/golden/types-partial-unresolved-tag/tree.txt+2 tests/golden/types-partial-unresolved-tag/types.txt+2 tests/golden/types-positional-faces/about.txt+4 tests/golden/types-positional-faces/source.jibb+25 tests/golden/types-positional-faces/tokens.txt+394 tests/golden/types-positional-faces/tree.txt+197 tests/golden/types-positional-faces/types.txt+42 tests/golden/types-prelude-arithmetic/about.txt+4 tests/golden/types-prelude-arithmetic/modules.txt+1 tests/golden/types-prelude-arithmetic/source.jibb+23 tests/golden/types-prelude-arithmetic/tokens.txt+201 tests/golden/types-prelude-arithmetic/tree.txt+85 tests/golden/types-prelude-arithmetic/types.txt+50 tests/golden/types-prelude-ask/about.txt+4 tests/golden/types-prelude-ask/modules.txt+1 tests/golden/types-prelude-ask/source.jibb+55 tests/golden/types-prelude-ask/tokens.txt+804 tests/golden/types-prelude-ask/tree.txt+335 tests/golden/types-prelude-ask/types.txt+41 tests/golden/types-prelude-bond/about.txt+4 tests/golden/types-prelude-bond/modules.txt+1 tests/golden/types-prelude-bond/source.jibb+6 tests/golden/types-prelude-bond/tokens.txt+57 tests/golden/types-prelude-bond/tree.txt+30 tests/golden/types-prelude-bond/types.txt+7 tests/golden/types-prelude-cmd/about.txt+4 tests/golden/types-prelude-cmd/modules.txt+1 tests/golden/types-prelude-cmd/source.jibb+21 tests/golden/types-prelude-cmd/tokens.txt+285 tests/golden/types-prelude-cmd/tree.txt+122 tests/golden/types-prelude-cmd/types.txt+56 tests/golden/types-prelude-comparison/about.txt+4 tests/golden/types-prelude-comparison/modules.txt+1 tests/golden/types-prelude-comparison/source.jibb+18 tests/golden/types-prelude-comparison/tokens.txt+175 tests/golden/types-prelude-comparison/tree.txt+71 tests/golden/types-prelude-comparison/types.txt+31 tests/golden/types-prelude-direct/about.txt+4 tests/golden/types-prelude-direct/modules.txt+1 tests/golden/types-prelude-direct/source.jibb+5 tests/golden/types-prelude-direct/tokens.txt+53 tests/golden/types-prelude-direct/tree.txt+25 tests/golden/types-prelude-direct/types.txt+6 tests/golden/types-prelude-functional/about.txt+4 tests/golden/types-prelude-functional/modules.txt+1 tests/golden/types-prelude-functional/source.jibb+18 tests/golden/types-prelude-functional/tokens.txt+145 tests/golden/types-prelude-functional/tree.txt+65 tests/golden/types-prelude-functional/types.txt+23 tests/golden/types-prelude-generic-alias/about.txt+4 tests/golden/types-prelude-generic-alias/module-trees.txt+10 tests/golden/types-prelude-generic-alias/modules.txt+1 tests/golden/types-prelude-generic-alias/modules/ui/alias-helper.jibb+2 tests/golden/types-prelude-generic-alias/source.jibb+13 tests/golden/types-prelude-generic-alias/tokens.txt+146 tests/golden/types-prelude-generic-alias/tree.txt+51 tests/golden/types-prelude-generic-alias/types.txt+13 tests/golden/types-prelude-interface/about.txt+4 tests/golden/types-prelude-interface/module-trees.txt+13 tests/golden/types-prelude-interface/modules.txt+2 tests/golden/types-prelude-interface/modules/ui/left.jibb+1 tests/golden/types-prelude-interface/modules/ui/right.jibb+1 tests/golden/types-prelude-interface/source.jibb+10 tests/golden/types-prelude-interface/tokens.txt+81 tests/golden/types-prelude-interface/tree.txt+33 tests/golden/types-prelude-interface/types.txt+9 tests/golden/types-prelude-lead-late/about.txt+4 tests/golden/types-prelude-lead-late/modules.txt+1 tests/golden/types-prelude-lead-late/source.jibb+10 tests/golden/types-prelude-lead-late/tokens.txt+151 tests/golden/types-prelude-lead-late/tree.txt+83 tests/golden/types-prelude-lead-late/types.txt+17 tests/golden/types-prelude-lent/about.txt+4 tests/golden/types-prelude-lent/modules.txt+1 tests/golden/types-prelude-lent/source.jibb+8 tests/golden/types-prelude-lent/tokens.txt+76 tests/golden/types-prelude-lent/tree.txt+38 tests/golden/types-prelude-lent/types.txt+15 tests/golden/types-prelude-like/about.txt+4 tests/golden/types-prelude-like/modules.txt+1 tests/golden/types-prelude-like/source.jibb+22 tests/golden/types-prelude-like/tokens.txt+320 tests/golden/types-prelude-like/tree.txt+163 tests/golden/types-prelude-like/types.txt+18 tests/golden/types-prelude-list-alias/about.txt+4 tests/golden/types-prelude-list-alias/modules.txt+1 tests/golden/types-prelude-list-alias/source.jibb+7 tests/golden/types-prelude-list-alias/tokens.txt+68 tests/golden/types-prelude-list-alias/tree.txt+30 tests/golden/types-prelude-list-alias/types.txt+14 tests/golden/types-prelude-list-functions/about.txt+4 tests/golden/types-prelude-list-functions/module-trees.txt+11 tests/golden/types-prelude-list-functions/modules.txt+1 tests/golden/types-prelude-list-functions/modules/ui/lib.jibb+2 tests/golden/types-prelude-list-functions/source.jibb+18 tests/golden/types-prelude-list-functions/tokens.txt+183 tests/golden/types-prelude-list-functions/tree.txt+87 tests/golden/types-prelude-list-functions/types.txt+28 tests/golden/types-prelude-list-helpers/about.txt+4 tests/golden/types-prelude-list-helpers/modules.txt+1 tests/golden/types-prelude-list-helpers/source.jibb+15 tests/golden/types-prelude-list-helpers/tokens.txt+182 tests/golden/types-prelude-list-helpers/tree.txt+98 tests/golden/types-prelude-list-helpers/types.txt+34 tests/golden/types-prelude-predicates/about.txt+4 tests/golden/types-prelude-predicates/modules.txt+1 tests/golden/types-prelude-predicates/source.jibb+6 tests/golden/types-prelude-predicates/tokens.txt+91 tests/golden/types-prelude-predicates/tree.txt+49 tests/golden/types-prelude-predicates/types.txt+19 tests/golden/types-prelude-sub-nested/about.txt+4 tests/golden/types-prelude-sub-nested/modules.txt+1 tests/golden/types-prelude-sub-nested/source.jibb+20 tests/golden/types-prelude-sub-nested/tokens.txt+211 tests/golden/types-prelude-sub-nested/tree.txt+100 tests/golden/types-prelude-sub-nested/types.txt+27 tests/golden/types-prelude-sub/about.txt+4 tests/golden/types-prelude-sub/modules.txt+1 tests/golden/types-prelude-sub/source.jibb+37 tests/golden/types-prelude-sub/tokens.txt+380 tests/golden/types-prelude-sub/tree.txt+164 tests/golden/types-prelude-sub/types.txt+32 tests/golden/types-prelude-succ/about.txt+4 tests/golden/types-prelude-succ/modules.txt+1 tests/golden/types-prelude-succ/source.jibb+4 tests/golden/types-prelude-succ/tokens.txt+32 tests/golden/types-prelude-succ/tree.txt+15 tests/golden/types-prelude-succ/types.txt+11 tests/golden/types-prelude-text/about.txt+4 tests/golden/types-prelude-text/modules.txt+1 tests/golden/types-prelude-text/source.jibb+8 tests/golden/types-prelude-text/tokens.txt+66 tests/golden/types-prelude-text/tree.txt+36 tests/golden/types-prelude-text/types.txt+26 tests/golden/types-prelude-ui/about.txt+4 tests/golden/types-prelude-ui/modules.txt+1 tests/golden/types-prelude-ui/source.jibb+77 tests/golden/types-prelude-ui/tokens.txt+710 tests/golden/types-prelude-ui/tree.txt+291 tests/golden/types-prelude-ui/types.txt+84 tests/golden/types-prelude-unit-helpers/about.txt+4 tests/golden/types-prelude-unit-helpers/modules.txt+1 tests/golden/types-prelude-unit-helpers/source.jibb+15 tests/golden/types-prelude-unit-helpers/tokens.txt+209 tests/golden/types-prelude-unit-helpers/tree.txt+115 tests/golden/types-prelude-unit-helpers/types.txt+26 tests/golden/types-prelude-zing/about.txt+4 tests/golden/types-prelude-zing/modules.txt+1 tests/golden/types-prelude-zing/source.jibb+6 tests/golden/types-prelude-zing/tokens.txt+92 tests/golden/types-prelude-zing/tree.txt+43 tests/golden/types-prelude-zing/types.txt+13 tests/golden/types-proj-explicit-context/about.txt+4 tests/golden/types-proj-explicit-context/modules.txt+1 tests/golden/types-proj-explicit-context/source.jibb+35 tests/golden/types-proj-explicit-context/tokens.txt+626 tests/golden/types-proj-explicit-context/tree.txt+287 tests/golden/types-proj-explicit-context/types.txt+31 tests/golden/types-proj-nested-no-implicit/about.txt+4 tests/golden/types-proj-nested-no-implicit/modules.txt+1 tests/golden/types-proj-nested-no-implicit/source.jibb+6 tests/golden/types-proj-nested-no-implicit/tokens.txt+119 tests/golden/types-proj-nested-no-implicit/tree.txt+56 tests/golden/types-proj-nested-no-implicit/types.txt+7 tests/golden/types-proj-reserved-imported-definition/about.txt+4 tests/golden/types-proj-reserved-imported-definition/module-trees.txt+10 tests/golden/types-proj-reserved-imported-definition/modules.txt+1 tests/golden/types-proj-reserved-imported-definition/modules/ui/lib.jibb+2 tests/golden/types-proj-reserved-imported-definition/source.jibb+2 tests/golden/types-proj-reserved-imported-definition/tokens.txt+11 tests/golden/types-proj-reserved-imported-definition/tree.txt+3 tests/golden/types-proj-reserved-imported-definition/types.txt+2 tests/golden/types-proj-reserved-jibb-import/about.txt+4 tests/golden/types-proj-reserved-jibb-import/module-trees.txt+6 tests/golden/types-proj-reserved-jibb-import/modules.txt+1 tests/golden/types-proj-reserved-jibb-import/modules/ui/lib.jibb+1 tests/golden/types-proj-reserved-jibb-import/source.jibb+2 tests/golden/types-proj-reserved-jibb-import/tokens.txt+11 tests/golden/types-proj-reserved-jibb-import/tree.txt+3 tests/golden/types-proj-reserved-jibb-import/types.txt+2 tests/golden/types-proj-reserved-local-mold/about.txt+4 tests/golden/types-proj-reserved-local-mold/modules.txt+1 tests/golden/types-proj-reserved-local-mold/source.jibb+3 tests/golden/types-proj-reserved-local-mold/tokens.txt+10 tests/golden/types-proj-reserved-local-mold/tree.txt+5 tests/golden/types-proj-reserved-local-mold/types.txt+2 tests/golden/types-proj-reserved-local/about.txt+4 tests/golden/types-proj-reserved-local/modules.txt+1 tests/golden/types-proj-reserved-local/source.jibb+3 tests/golden/types-proj-reserved-local/tokens.txt+14 tests/golden/types-proj-reserved-local/tree.txt+8 tests/golden/types-proj-reserved-local/types.txt+2 tests/golden/types-proj-reserved-mark-import/about.txt+4 tests/golden/types-proj-reserved-mark-import/modules.txt+1 tests/golden/types-proj-reserved-mark-import/source.jibb+2 tests/golden/types-proj-reserved-mark-import/tokens.txt+7 tests/golden/types-proj-reserved-mark-import/tree.txt+3 tests/golden/types-proj-reserved-mark-import/types.txt+2 tests/golden/types-proj-reserved-mold/about.txt+4 tests/golden/types-proj-reserved-mold/modules.txt+1 tests/golden/types-proj-reserved-mold/source.jibb+2 tests/golden/types-proj-reserved-mold/tokens.txt+8 tests/golden/types-proj-reserved-mold/tree.txt+3 tests/golden/types-proj-reserved-mold/types.txt+2 tests/golden/types-proj-reserved-pattern/about.txt+4 tests/golden/types-proj-reserved-pattern/modules.txt+1 tests/golden/types-proj-reserved-pattern/source.jibb+3 tests/golden/types-proj-reserved-pattern/tokens.txt+21 tests/golden/types-proj-reserved-pattern/tree.txt+11 tests/golden/types-proj-reserved-pattern/types.txt+2 tests/golden/types-proj-reserved-positive/about.txt+4 tests/golden/types-proj-reserved-positive/modules.txt+1 tests/golden/types-proj-reserved-positive/source.jibb+8 tests/golden/types-proj-reserved-positive/tokens.txt+70 tests/golden/types-proj-reserved-positive/tree.txt+31 tests/golden/types-proj-reserved-positive/types.txt+7 tests/golden/types-proj-reserved-sample/about.txt+4 tests/golden/types-proj-reserved-sample/modules.txt+1 tests/golden/types-proj-reserved-sample/source.jibb+1 tests/golden/types-proj-reserved-sample/tokens.txt+8 tests/golden/types-proj-reserved-sample/tree.txt+5 tests/golden/types-proj-reserved-sample/types.txt+2 tests/golden/types-proj-reserved-sur-import/about.txt+4 tests/golden/types-proj-reserved-sur-import/modules.txt+1 tests/golden/types-proj-reserved-sur-import/source.jibb+2 tests/golden/types-proj-reserved-sur-import/tokens.txt+7 tests/golden/types-proj-reserved-sur-import/tree.txt+3 tests/golden/types-proj-reserved-sur-import/types.txt+2 tests/golden/types-proj-reserved-unused-pattern/about.txt+4 tests/golden/types-proj-reserved-unused-pattern/modules.txt+1 tests/golden/types-proj-reserved-unused-pattern/source.jibb+6 tests/golden/types-proj-reserved-unused-pattern/tokens.txt+38 tests/golden/types-proj-reserved-unused-pattern/tree.txt+18 tests/golden/types-proj-reserved-unused-pattern/types.txt+2 tests/golden/types-proj-reserved-unused-sample/about.txt+4 tests/golden/types-proj-reserved-unused-sample/modules.txt+1 tests/golden/types-proj-reserved-unused-sample/source.jibb+4 tests/golden/types-proj-reserved-unused-sample/tokens.txt+25 tests/golden/types-proj-reserved-unused-sample/tree.txt+12 tests/golden/types-proj-reserved-unused-sample/types.txt+2 tests/golden/types-proj-reserved-unused-value/about.txt+4 tests/golden/types-proj-reserved-unused-value/modules.txt+1 tests/golden/types-proj-reserved-unused-value/source.jibb+6 tests/golden/types-proj-reserved-unused-value/tokens.txt+31 tests/golden/types-proj-reserved-unused-value/tree.txt+15 tests/golden/types-proj-reserved-unused-value/types.txt+2 tests/golden/types-proj-reserved-value/about.txt+4 tests/golden/types-proj-reserved-value/modules.txt+1 tests/golden/types-proj-reserved-value/source.jibb+2 tests/golden/types-proj-reserved-value/tokens.txt+12 tests/golden/types-proj-reserved-value/tree.txt+6 tests/golden/types-proj-reserved-value/types.txt+2 tests/golden/types-proj-single-duplicate/about.txt+4 tests/golden/types-proj-single-duplicate/modules.txt+1 tests/golden/types-proj-single-duplicate/source.jibb+1 tests/golden/types-proj-single-duplicate/tokens.txt+23 tests/golden/types-proj-single-duplicate/tree.txt+12 tests/golden/types-proj-single-duplicate/types.txt+8 tests/golden/types-proj-single-field/about.txt+4 tests/golden/types-proj-single-field/modules.txt+1 tests/golden/types-proj-single-field/source.jibb+25 tests/golden/types-proj-single-field/tokens.txt+499 tests/golden/types-proj-single-field/tree.txt+243 tests/golden/types-proj-single-field/types.txt+31 tests/golden/types-proj-single-sample-face/about.txt+4 tests/golden/types-proj-single-sample-face/modules.txt+1 tests/golden/types-proj-single-sample-face/source.jibb+22 tests/golden/types-proj-single-sample-face/tokens.txt+210 tests/golden/types-proj-single-sample-face/tree.txt+117 tests/golden/types-proj-single-sample-face/types.txt+9 tests/golden/types-proj-single-wrapped/about.txt+4 tests/golden/types-proj-single-wrapped/modules.txt+1 tests/golden/types-proj-single-wrapped/source.jibb+26 tests/golden/types-proj-single-wrapped/tokens.txt+208 tests/golden/types-proj-single-wrapped/tree.txt+107 tests/golden/types-proj-single-wrapped/types.txt+5 tests/golden/types-qath-faces/about.txt+4 tests/golden/types-qath-faces/modules.txt+1 tests/golden/types-qath-faces/source.jibb+8 tests/golden/types-qath-faces/tokens.txt+130 tests/golden/types-qath-faces/tree.txt+59 tests/golden/types-qath-faces/types.txt+18 tests/golden/types-qath-holes/about.txt+4 tests/golden/types-qath-holes/modules.txt+1 tests/golden/types-qath-holes/source.jibb+18 tests/golden/types-qath-holes/tokens.txt+178 tests/golden/types-qath-holes/tree.txt+78 tests/golden/types-qath-holes/types.txt+22 tests/golden/types-qath-module-identity/about.txt+4 tests/golden/types-qath-module-identity/module-trees.txt+44 tests/golden/types-qath-module-identity/modules.txt+3 tests/golden/types-qath-module-identity/modules/ui/mid.jibb+4 tests/golden/types-qath-module-identity/modules/ui/one.jibb+7 tests/golden/types-qath-module-identity/modules/ui/two.jibb+4 tests/golden/types-qath-module-identity/source.jibb+15 tests/golden/types-qath-module-identity/tokens.txt+171 tests/golden/types-qath-module-identity/tree.txt+70 tests/golden/types-qath-module-identity/types.txt+18 tests/golden/types-qath-recursive/about.txt+4 tests/golden/types-qath-recursive/modules.txt+1 tests/golden/types-qath-recursive/source.jibb+19 tests/golden/types-qath-recursive/tokens.txt+145 tests/golden/types-qath-recursive/tree.txt+63 tests/golden/types-qath-recursive/types.txt+14 tests/golden/types-record-bound-variable/about.txt+4 tests/golden/types-record-bound-variable/source.jibb+6 tests/golden/types-record-bound-variable/tokens.txt+65 tests/golden/types-record-bound-variable/tree.txt+33 tests/golden/types-record-bound-variable/types.txt+5 tests/golden/types-record-cast-context/about.txt+4 tests/golden/types-record-cast-context/modules.txt+1 tests/golden/types-record-cast-context/source.jibb+24 tests/golden/types-record-cast-context/tokens.txt+234 tests/golden/types-record-cast-context/tree.txt+105 tests/golden/types-record-cast-context/types.txt+49 tests/golden/types-record-change-generic/about.txt+4 tests/golden/types-record-change-generic/modules.txt+1 tests/golden/types-record-change-generic/source.jibb+9 tests/golden/types-record-change-generic/tokens.txt+145 tests/golden/types-record-change-generic/tree.txt+57 tests/golden/types-record-change-generic/types.txt+14 tests/golden/types-record-change/about.txt+4 tests/golden/types-record-change/modules.txt+1 tests/golden/types-record-change/source.jibb+19 tests/golden/types-record-change/tokens.txt+254 tests/golden/types-record-change/tree.txt+99 tests/golden/types-record-change/types.txt+42 tests/golden/types-record-faces/about.txt+4 tests/golden/types-record-faces/source.jibb+8 tests/golden/types-record-faces/tokens.txt+90 tests/golden/types-record-faces/tree.txt+41 tests/golden/types-record-faces/types.txt+15 tests/golden/types-record-field-edit-separate/about.txt+4 tests/golden/types-record-field-edit-separate/source.jibb+1 tests/golden/types-record-field-edit-separate/tokens.txt+51 tests/golden/types-record-field-edit-separate/tree.txt+22 tests/golden/types-record-field-edit-separate/types.txt+2 tests/golden/types-record-field-expr-duplicate/about.txt+4 tests/golden/types-record-field-expr-duplicate/source.jibb+2 tests/golden/types-record-field-expr-duplicate/tokens.txt+22 tests/golden/types-record-field-expr-duplicate/tree.txt+9 tests/golden/types-record-field-expr-duplicate/types.txt+8 tests/golden/types-record-field-expr-separate/about.txt+4 tests/golden/types-record-field-expr-separate/source.jibb+1 tests/golden/types-record-field-expr-separate/tokens.txt+25 tests/golden/types-record-field-expr-separate/tree.txt+11 tests/golden/types-record-field-expr-separate/types.txt+2 tests/golden/types-record-field-module-reachable/about.txt+4 tests/golden/types-record-field-module-reachable/module-trees.txt+7 tests/golden/types-record-field-module-reachable/modules.txt+1 tests/golden/types-record-field-module-reachable/modules/ui/lib.jibb+2 tests/golden/types-record-field-module-reachable/source.jibb+2 tests/golden/types-record-field-module-reachable/tokens.txt+11 tests/golden/types-record-field-module-reachable/tree.txt+3 tests/golden/types-record-field-module-reachable/types.txt+8 tests/golden/types-record-field-module-unused/about.txt+4 tests/golden/types-record-field-module-unused/module-trees.txt+10 tests/golden/types-record-field-module-unused/modules.txt+2 tests/golden/types-record-field-module-unused/modules/ui/good.jibb+1 tests/golden/types-record-field-module-unused/modules/ui/unused.jibb+2 tests/golden/types-record-field-module-unused/source.jibb+2 tests/golden/types-record-field-module-unused/tokens.txt+11 tests/golden/types-record-field-module-unused/tree.txt+3 tests/golden/types-record-field-module-unused/types.txt+2 tests/golden/types-record-field-nested-mold/about.txt+4 tests/golden/types-record-field-nested-mold/source.jibb+2 tests/golden/types-record-field-nested-mold/tokens.txt+22 tests/golden/types-record-field-nested-mold/tree.txt+9 tests/golden/types-record-field-nested-mold/types.txt+8 tests/golden/types-record-field-outer-inner/about.txt+4 tests/golden/types-record-field-outer-inner/source.jibb+2 tests/golden/types-record-field-outer-inner/tokens.txt+26 tests/golden/types-record-field-outer-inner/tree.txt+12 tests/golden/types-record-field-outer-inner/types.txt+3 tests/golden/types-record-field-sample-duplicate/about.txt+4 tests/golden/types-record-field-sample-duplicate/source.jibb+1 tests/golden/types-record-field-sample-duplicate/tokens.txt+13 tests/golden/types-record-field-sample-duplicate/tree.txt+7 tests/golden/types-record-field-sample-duplicate/types.txt+8 tests/golden/types-record-field-separate-molds/about.txt+4 tests/golden/types-record-field-separate-molds/source.jibb+2 tests/golden/types-record-field-separate-molds/tokens.txt+33 tests/golden/types-record-field-separate-molds/tree.txt+15 tests/golden/types-record-field-separate-molds/types.txt+3 tests/golden/types-record-field-unused-mold/about.txt+4 tests/golden/types-record-field-unused-mold/source.jibb+2 tests/golden/types-record-field-unused-mold/tokens.txt+15 tests/golden/types-record-field-unused-mold/tree.txt+6 tests/golden/types-record-field-unused-mold/types.txt+8 tests/golden/types-record-import/about.txt+4 tests/golden/types-record-import/module-trees.txt+9 tests/golden/types-record-import/modules.txt+1 tests/golden/types-record-import/modules/ui/lib.jibb+1 tests/golden/types-record-import/source.jibb+3 tests/golden/types-record-import/tokens.txt+36 tests/golden/types-record-import/tree.txt+16 tests/golden/types-record-import/types.txt+3 tests/golden/types-record-local-scheme/about.txt+4 tests/golden/types-record-local-scheme/source.jibb+5 tests/golden/types-record-local-scheme/tokens.txt+44 tests/golden/types-record-local-scheme/tree.txt+20 tests/golden/types-record-local-scheme/types.txt+4 tests/golden/types-record-nested/about.txt+4 tests/golden/types-record-nested/source.jibb+4 tests/golden/types-record-nested/tokens.txt+54 tests/golden/types-record-nested/tree.txt+24 tests/golden/types-record-nested/types.txt+5 tests/golden/types-record-to-tuple/about.txt+4 tests/golden/types-record-to-tuple/source.jibb+4 tests/golden/types-record-to-tuple/tokens.txt+38 tests/golden/types-record-to-tuple/tree.txt+17 tests/golden/types-record-to-tuple/types.txt+5 tests/golden/types-recursion-scc-failures/about.txt+4 tests/golden/types-recursion-scc-failures/modules.txt+1 tests/golden/types-recursion-scc-failures/source.jibb+11 tests/golden/types-recursion-scc-failures/tokens.txt+90 tests/golden/types-recursion-scc-failures/tree.txt+45 tests/golden/types-recursion-scc-failures/types.txt+10 tests/golden/types-recursion-scc-groups/about.txt+4 tests/golden/types-recursion-scc-groups/modules.txt+1 tests/golden/types-recursion-scc-groups/source.jibb+9 tests/golden/types-recursion-scc-groups/tokens.txt+91 tests/golden/types-recursion-scc-groups/tree.txt+42 tests/golden/types-recursion-scc-groups/types.txt+10 tests/golden/types-recursion-scc-import-bad/about.txt+4 tests/golden/types-recursion-scc-import-bad/module-trees.txt+16 tests/golden/types-recursion-scc-import-bad/modules.txt+1 tests/golden/types-recursion-scc-import-bad/modules/ui/lib.jibb+3 tests/golden/types-recursion-scc-import-bad/source.jibb+2 tests/golden/types-recursion-scc-import-bad/tokens.txt+14 tests/golden/types-recursion-scc-import-bad/tree.txt+5 tests/golden/types-recursion-scc-import-bad/types.txt+2 tests/golden/types-recursion-scc-import/about.txt+4 tests/golden/types-recursion-scc-import/module-trees.txt+12 tests/golden/types-recursion-scc-import/modules.txt+1 tests/golden/types-recursion-scc-import/modules/ui/lib.jibb+2 tests/golden/types-recursion-scc-import/source.jibb+3 tests/golden/types-recursion-scc-import/tokens.txt+25 tests/golden/types-recursion-scc-import/tree.txt+12 tests/golden/types-recursion-scc-import/types.txt+3 tests/golden/types-recursion-scc-local/about.txt+4 tests/golden/types-recursion-scc-local/modules.txt+1 tests/golden/types-recursion-scc-local/source.jibb+11 tests/golden/types-recursion-scc-local/tokens.txt+80 tests/golden/types-recursion-scc-local/tree.txt+39 tests/golden/types-recursion-scc-local/types.txt+4 tests/golden/types-recursion-scc-order/about.txt+4 tests/golden/types-recursion-scc-order/modules.txt+1 tests/golden/types-recursion-scc-order/source.jibb+4 tests/golden/types-recursion-scc-order/tokens.txt+33 tests/golden/types-recursion-scc-order/tree.txt+15 tests/golden/types-recursion-scc-order/types.txt+5 tests/golden/types-recursion-scc-shadow/about.txt+4 tests/golden/types-recursion-scc-shadow/modules.txt+1 tests/golden/types-recursion-scc-shadow/source.jibb+3 tests/golden/types-recursion-scc-shadow/tokens.txt+30 tests/golden/types-recursion-scc-shadow/tree.txt+15 tests/golden/types-recursion-scc-shadow/types.txt+4 tests/golden/types-recursive-branch/about.txt+4 tests/golden/types-recursive-branch/modules.txt+1 tests/golden/types-recursive-branch/source.jibb+103 tests/golden/types-recursive-branch/tokens.txt+573 tests/golden/types-recursive-branch/tree.txt+306 tests/golden/types-recursive-branch/types.txt+50 tests/golden/types-recursive-gate/about.txt+4 tests/golden/types-recursive-gate/source.jibb+55 tests/golden/types-recursive-gate/tokens.txt+355 tests/golden/types-recursive-gate/tree.txt+176 tests/golden/types-recursive-gate/types.txt+42 tests/golden/types-recursive-sample/about.txt+4 tests/golden/types-recursive-sample/source.jibb+40 tests/golden/types-recursive-sample/tokens.txt+344 tests/golden/types-recursive-sample/tree.txt+161 tests/golden/types-recursive-sample/types.txt+40 tests/golden/types-request-normal/about.txt+4 tests/golden/types-request-normal/mar/full.txt+5 tests/golden/types-request-normal/marks.txt+1 tests/golden/types-request-normal/module-trees.txt+5 tests/golden/types-request-normal/modules.txt+1 tests/golden/types-request-normal/modules/ui/api/demo.jibb+2 tests/golden/types-request-normal/source.jibb+9 tests/golden/types-request-normal/tokens.txt+95 tests/golden/types-request-normal/tree.txt+50 tests/golden/types-request-normal/types.txt+26 tests/golden/types-scope-library-poke/about.txt+4 tests/golden/types-scope-library-poke/modules.txt+1 tests/golden/types-scope-library-poke/path.txt+1 tests/golden/types-scope-library-poke/source.jibb+2 tests/golden/types-scope-library-poke/tokens.txt+8 tests/golden/types-scope-library-poke/tree.txt+3 tests/golden/types-scope-library-poke/types.txt+2 tests/golden/types-scope-root-api/about.txt+4 tests/golden/types-scope-root-api/modules.txt+1 tests/golden/types-scope-root-api/path.txt+1 tests/golden/types-scope-root-api/source.jibb+2 tests/golden/types-scope-root-api/tokens.txt+7 tests/golden/types-scope-root-api/tree.txt+3 tests/golden/types-scope-root-api/types.txt+2 tests/golden/types-scope-store-duplicate/about.txt+4 tests/golden/types-scope-store-duplicate/modules.txt+1 tests/golden/types-scope-store-duplicate/path.txt+1 tests/golden/types-scope-store-duplicate/source.jibb+3 tests/golden/types-scope-store-duplicate/tokens.txt+16 tests/golden/types-scope-store-duplicate/tree.txt+6 tests/golden/types-scope-store-duplicate/types.txt+2 tests/golden/types-scope-store-shadow/about.txt+4 tests/golden/types-scope-store-shadow/modules.txt+1 tests/golden/types-scope-store-shadow/path.txt+1 tests/golden/types-scope-store-shadow/source.jibb+3 tests/golden/types-scope-store-shadow/tokens.txt+16 tests/golden/types-scope-store-shadow/tree.txt+6 tests/golden/types-scope-store-shadow/types.txt+2 tests/golden/types-single-case-pattern/about.txt+4 tests/golden/types-single-case-pattern/modules.txt+1 tests/golden/types-single-case-pattern/source.jibb+59 tests/golden/types-single-case-pattern/tokens.txt+364 tests/golden/types-single-case-pattern/tree.txt+182 tests/golden/types-single-case-pattern/types.txt+32 tests/golden/types-string-interpolation/about.txt+4 tests/golden/types-string-interpolation/modules.txt+1 tests/golden/types-string-interpolation/source.jibb+28 tests/golden/types-string-interpolation/tokens.txt+259 tests/golden/types-string-interpolation/tree.txt+109 tests/golden/types-string-interpolation/types.txt+33 tests/golden/types-tuple-context-nested/about.txt+4 tests/golden/types-tuple-context-nested/modules.txt+1 tests/golden/types-tuple-context-nested/source.jibb+24 tests/golden/types-tuple-context-nested/tokens.txt+289 tests/golden/types-tuple-context-nested/tree.txt+140 tests/golden/types-tuple-context-nested/types.txt+49 tests/golden/types-tuple-context/about.txt+4 tests/golden/types-tuple-context/modules.txt+1 tests/golden/types-tuple-context/source.jibb+7 tests/golden/types-tuple-context/tokens.txt+109 tests/golden/types-tuple-context/tree.txt+55 tests/golden/types-tuple-context/types.txt+14 tests/golden/types-union-alias/about.txt+4 tests/golden/types-union-alias/source.jibb+5 tests/golden/types-union-alias/tokens.txt+23 tests/golden/types-union-alias/tree.txt+10 tests/golden/types-union-alias/types.txt+4 tests/golden/types-union-branch-context/about.txt+4 tests/golden/types-union-branch-context/source.jibb+54 tests/golden/types-union-branch-context/tokens.txt+237 tests/golden/types-union-branch-context/tree.txt+120 tests/golden/types-union-branch-context/types.txt+24 tests/golden/types-union-branch-pending/about.txt+4 tests/golden/types-union-branch-pending/source.jibb+24 tests/golden/types-union-branch-pending/tokens.txt+102 tests/golden/types-union-branch-pending/tree.txt+48 tests/golden/types-union-branch-pending/types.txt+6 tests/golden/types-union-constructor-shape/about.txt+4 tests/golden/types-union-constructor-shape/source.jibb+5 tests/golden/types-union-constructor-shape/tokens.txt+58 tests/golden/types-union-constructor-shape/tree.txt+24 tests/golden/types-union-constructor-shape/types.txt+12 tests/golden/types-union-context-flow/about.txt+4 tests/golden/types-union-context-flow/source.jibb+13 tests/golden/types-union-context-flow/tokens.txt+58 tests/golden/types-union-context-flow/tree.txt+26 tests/golden/types-union-context-flow/types.txt+6 tests/golden/types-union-finite-context/about.txt+4 tests/golden/types-union-finite-context/modules.txt+1 tests/golden/types-union-finite-context/source.jibb+76 tests/golden/types-union-finite-context/tokens.txt+529 tests/golden/types-union-finite-context/tree.txt+234 tests/golden/types-union-finite-context/types.txt+27 tests/golden/types-union-finite-generic/about.txt+4 tests/golden/types-union-finite-generic/modules.txt+1 tests/golden/types-union-finite-generic/source.jibb+48 tests/golden/types-union-finite-generic/tokens.txt+336 tests/golden/types-union-finite-generic/tree.txt+143 tests/golden/types-union-finite-generic/types.txt+11 tests/golden/types-union-finite-limit/about.txt+4 tests/golden/types-union-finite-limit/modules.txt+1 tests/golden/types-union-finite-limit/source.jibb+35 tests/golden/types-union-finite-limit/tokens.txt+233 tests/golden/types-union-finite-limit/tree.txt+89 tests/golden/types-union-finite-limit/types.txt+10 tests/golden/types-union-finite/about.txt+4 tests/golden/types-union-finite/modules.txt+1 tests/golden/types-union-finite/source.jibb+45 tests/golden/types-union-finite/tokens.txt+238 tests/golden/types-union-finite/tree.txt+110 tests/golden/types-union-finite/types.txt+17 tests/golden/types-union-import/about.txt+4 tests/golden/types-union-import/module-trees.txt+8 tests/golden/types-union-import/modules.txt+1 tests/golden/types-union-import/modules/ui/lib.jibb+3 tests/golden/types-union-import/source.jibb+2 tests/golden/types-union-import/tokens.txt+13 tests/golden/types-union-import/tree.txt+4 tests/golden/types-union-import/types.txt+2 tests/golden/types-union-local-pending/about.txt+4 tests/golden/types-union-local-pending/source.jibb+3 tests/golden/types-union-local-pending/tokens.txt+10 tests/golden/types-union-local-pending/tree.txt+5 tests/golden/types-union-local-pending/types.txt+2 tests/golden/types-union-nonwing-subject/about.txt+4 tests/golden/types-union-nonwing-subject/modules.txt+1 tests/golden/types-union-nonwing-subject/source.jibb+82 tests/golden/types-union-nonwing-subject/tokens.txt+593 tests/golden/types-union-nonwing-subject/tree.txt+257 tests/golden/types-union-nonwing-subject/types.txt+45 tests/golden/types-union-overlap-nested/about.txt+4 tests/golden/types-union-overlap-nested/source.jibb+4 tests/golden/types-union-overlap-nested/tokens.txt+21 tests/golden/types-union-overlap-nested/tree.txt+7 tests/golden/types-union-overlap-nested/types.txt+9 tests/golden/types-union-overlap/about.txt+4 tests/golden/types-union-overlap/source.jibb+4 tests/golden/types-union-overlap/tokens.txt+15 tests/golden/types-union-overlap/tree.txt+5 tests/golden/types-union-overlap/types.txt+9 tests/golden/types-union-pattern-result-context/about.txt+4 tests/golden/types-union-pattern-result-context/modules.txt+1 tests/golden/types-union-pattern-result-context/source.jibb+25 tests/golden/types-union-pattern-result-context/tokens.txt+205 tests/golden/types-union-pattern-result-context/tree.txt+96 tests/golden/types-union-pattern-result-context/types.txt+13 tests/golden/types-union-pattern-result-controls/about.txt+4 tests/golden/types-union-pattern-result-controls/modules.txt+1 tests/golden/types-union-pattern-result-controls/source.jibb+55 tests/golden/types-union-pattern-result-controls/tokens.txt+357 tests/golden/types-union-pattern-result-controls/tree.txt+161 tests/golden/types-union-pattern-result-controls/types.txt+30 tests/golden/types-union-patterns-generic/about.txt+4 tests/golden/types-union-patterns-generic/modules.txt+1 tests/golden/types-union-patterns-generic/source.jibb+36 tests/golden/types-union-patterns-generic/tokens.txt+255 tests/golden/types-union-patterns-generic/tree.txt+117 tests/golden/types-union-patterns-generic/types.txt+13 tests/golden/types-union-patterns-import/about.txt+4 tests/golden/types-union-patterns-import/module-trees.txt+8 tests/golden/types-union-patterns-import/modules.txt+1 tests/golden/types-union-patterns-import/modules/ui/lib.jibb+3 tests/golden/types-union-patterns-import/source.jibb+5 tests/golden/types-union-patterns-import/tokens.txt+28 tests/golden/types-union-patterns-import/tree.txt+12 tests/golden/types-union-patterns-import/types.txt+2 tests/golden/types-union-patterns/about.txt+4 tests/golden/types-union-patterns/modules.txt+1 tests/golden/types-union-patterns/source.jibb+74 tests/golden/types-union-patterns/tokens.txt+336 tests/golden/types-union-patterns/tree.txt+152 tests/golden/types-union-patterns/types.txt+25 tests/golden/types-union-phantom-generic/about.txt+4 tests/golden/types-union-phantom-generic/source.jibb+4 tests/golden/types-union-phantom-generic/tokens.txt+21 tests/golden/types-union-phantom-generic/tree.txt+8 tests/golden/types-union-phantom-generic/types.txt+3 tests/golden/types-union-polymorphic-identity/about.txt+4 tests/golden/types-union-polymorphic-identity/module-trees.txt+16 tests/golden/types-union-polymorphic-identity/modules.txt+2 tests/golden/types-union-polymorphic-identity/modules/ui/one.jibb+4 tests/golden/types-union-polymorphic-identity/modules/ui/two.jibb+4 tests/golden/types-union-polymorphic-identity/source.jibb+33 tests/golden/types-union-polymorphic-identity/tokens.txt+368 tests/golden/types-union-polymorphic-identity/tree.txt+152 tests/golden/types-union-polymorphic-identity/types.txt+36 tests/golden/types-union-print-cross-namespace/about.txt+4 tests/golden/types-union-print-cross-namespace/module-trees.txt+6 tests/golden/types-union-print-cross-namespace/modules.txt+1 tests/golden/types-union-print-cross-namespace/modules/ui/lib.jibb+4 tests/golden/types-union-print-cross-namespace/source.jibb+3 tests/golden/types-union-print-cross-namespace/tokens.txt+22 tests/golden/types-union-print-cross-namespace/tree.txt+9 tests/golden/types-union-print-cross-namespace/types.txt+3 tests/golden/types-union-print-distinct/about.txt+4 tests/golden/types-union-print-distinct/module-trees.txt+12 tests/golden/types-union-print-distinct/modules.txt+3 tests/golden/types-union-print-distinct/modules/ui/left.jibb+3 tests/golden/types-union-print-distinct/modules/ui/right.jibb+3 tests/golden/types-union-print-distinct/modules/ui/twin.jibb+3 tests/golden/types-union-print-distinct/source.jibb+11 tests/golden/types-union-print-distinct/tokens.txt+87 tests/golden/types-union-print-distinct/tree.txt+34 tests/golden/types-union-print-distinct/types.txt+9 tests/golden/types-union-print-escape/about.txt+4 tests/golden/types-union-print-escape/source.jibb+5 tests/golden/types-union-print-escape/tokens.txt+20 tests/golden/types-union-print-escape/tree.txt+8 tests/golden/types-union-print-escape/types.txt+2 tests/golden/types-union-print-local/about.txt+4 tests/golden/types-union-print-local/source.jibb+6 tests/golden/types-union-print-local/tokens.txt+28 tests/golden/types-union-print-local/tree.txt+12 tests/golden/types-union-print-local/types.txt+5 tests/golden/types-union-print-nested/about.txt+4 tests/golden/types-union-print-nested/source.jibb+7 tests/golden/types-union-print-nested/tokens.txt+42 tests/golden/types-union-print-nested/tree.txt+17 tests/golden/types-union-print-nested/types.txt+6 tests/golden/types-union-print-same-origin/about.txt+4 tests/golden/types-union-print-same-origin/module-trees.txt+4 tests/golden/types-union-print-same-origin/modules.txt+1 tests/golden/types-union-print-same-origin/modules/ui/shared.jibb+3 tests/golden/types-union-print-same-origin/source.jibb+5 tests/golden/types-union-print-same-origin/tokens.txt+35 tests/golden/types-union-print-same-origin/tree.txt+12 tests/golden/types-union-print-same-origin/types.txt+4 tests/golden/types-union-print-transitive/about.txt+4 tests/golden/types-union-print-transitive/module-trees.txt+8 tests/golden/types-union-print-transitive/modules.txt+2 tests/golden/types-union-print-transitive/modules/ui/base.jibb+3 tests/golden/types-union-print-transitive/modules/ui/mid.jibb+2 tests/golden/types-union-print-transitive/source.jibb+2 tests/golden/types-union-print-transitive/tokens.txt+15 tests/golden/types-union-print-transitive/tree.txt+6 tests/golden/types-union-print-transitive/types.txt+2 tests/golden/types-union-runtime-equality/about.txt+3 tests/golden/types-union-runtime-equality/source.jibb+16 tests/golden/types-union-runtime-equality/tokens.txt+96 tests/golden/types-union-runtime-equality/tree.txt+37 tests/golden/types-union-runtime-equality/types.txt+25 tests/golden/types-union-singleton/about.txt+4 tests/golden/types-union-singleton/source.jibb+16 tests/golden/types-union-singleton/tokens.txt+130 tests/golden/types-union-singleton/tree.txt+53 tests/golden/types-union-singleton/types.txt+33 tests/golden/types-union-source-alias/about.txt+4 tests/golden/types-union-source-alias/source.jibb+18 tests/golden/types-union-source-alias/tokens.txt+119 tests/golden/types-union-source-alias/tree.txt+41 tests/golden/types-union-source-alias/types.txt+23 tests/golden/types-union-tag-atoms/about.txt+4 tests/golden/types-union-tag-atoms/source.jibb+5 tests/golden/types-union-tag-atoms/tokens.txt+30 tests/golden/types-union-tag-atoms/tree.txt+11 tests/golden/types-union-tag-atoms/types.txt+12 tests/golden/types-union-tags/about.txt+4 tests/golden/types-union-tags/source.jibb+6 tests/golden/types-union-tags/tokens.txt+34 tests/golden/types-union-tags/tree.txt+15 tests/golden/types-union-tags/types.txt+11 tests/golden/types-union-unresolved-flow/about.txt+4 tests/golden/types-union-unresolved-flow/source.jibb+7 tests/golden/types-union-unresolved-flow/tokens.txt+31 tests/golden/types-union-unresolved-flow/tree.txt+12 tests/golden/types-union-unresolved-flow/types.txt+6 tests/golden/types-union-unresolved/about.txt+4 tests/golden/types-union-unresolved/source.jibb+1 tests/golden/types-union-unresolved/tokens.txt+4 tests/golden/types-union-unresolved/tree.txt+2 tests/golden/types-union-unresolved/types.txt+2 tests/golden/types-unit-construction/about.txt+4 tests/golden/types-unit-construction/modules.txt+1 tests/golden/types-unit-construction/source.jibb+29 tests/golden/types-unit-construction/tokens.txt+168 tests/golden/types-unit-construction/tree.txt+71 tests/golden/types-unit-construction/types.txt+32 tests/golden/types-unit-context/about.txt+4 tests/golden/types-unit-context/modules.txt+1 tests/golden/types-unit-context/source.jibb+46 tests/golden/types-unit-context/tokens.txt+489 tests/golden/types-unit-context/tree.txt+220 tests/golden/types-unit-context/types.txt+95 tests/golden/types-unit-patterns/about.txt+4 tests/golden/types-unit-patterns/source.jibb+36 tests/golden/types-unit-patterns/tokens.txt+180 tests/golden/types-unit-patterns/tree.txt+88 tests/golden/types-unit-patterns/types.txt+13 tests/golden/types-value-cycle-shadow/about.txt+4 tests/golden/types-value-cycle-shadow/modules.txt+1 tests/golden/types-value-cycle-shadow/source.jibb+6 tests/golden/types-value-cycle-shadow/tokens.txt+68 tests/golden/types-value-cycle-shadow/tree.txt+32 tests/golden/types-value-cycle-shadow/types.txt+7 tests/golden/types-value-cycle-unsupported/about.txt+4 tests/golden/types-value-cycle-unsupported/modules.txt+1 tests/golden/types-value-cycle-unsupported/source.jibb+11 tests/golden/types-value-cycle-unsupported/tokens.txt+45 tests/golden/types-value-cycle-unsupported/tree.txt+17 tests/golden/types-value-cycle-unsupported/types.txt+8 tests/golden/types-value-cycles/about.txt+4 tests/golden/types-value-cycles/modules.txt+1 tests/golden/types-value-cycles/source.jibb+13 tests/golden/types-value-cycles/tokens.txt+87 tests/golden/types-value-cycles/tree.txt+39 tests/golden/types-value-cycles/types.txt+44 tests/importer/about.txt+63 tests/importer/ford.txt+9 tests/importer/mark-gate.txt+3 tests/importer/mark-list.txt+5 tests/importer/mark-recursive.txt+5 tests/importer/mark.txt+5 tests/importer/origin-first.txt+4 tests/importer/origin-other.txt+4 tests/importer/origin-transitive.txt+6 tests/importer/shadow-static.txt+13 tests/importer/shadow.txt+14 tests/importer/small.txt+160 tests/importer/tlon-docs.txt+17 tests/importer/tlon-epic.txt+15 tests/importer/tlon-license.txt+21 tests/importer/tlon-presence.txt+35 tests/importer/tree.txt+221 tests/lib/jibb-api-evidence.hoon+258 tests/lib/jibb-api-paths.hoon+104 tests/lib/jibb-arithmetic-guards.hoon+58 tests/lib/jibb-ask-guards.hoon+63 tests/lib/jibb-bridge.hoon+168 tests/lib/jibb-cell-branch.hoon+53 tests/lib/jibb-closed-gate-guards.hoon+60 tests/lib/jibb-constructor-fit-guards.hoon+128 tests/lib/jibb-deferred-context.hoon+83 tests/lib/jibb-deferred-prepared.hoon+114 tests/lib/jibb-deferred-resolver.hoon+113 tests/lib/jibb-deferred.hoon+244 tests/lib/jibb-direct-gate-guards.hoon+172 tests/lib/jibb-direct-gate-source.hoon+46 tests/lib/jibb-empty.hoon+174 tests/lib/jibb-full-overlap-basic.hoon+143 tests/lib/jibb-full-overlap-graph.hoon+126 tests/lib/jibb-gate-free-guards.hoon+79 tests/lib/jibb-gate-free-source.hoon+95 tests/lib/jibb-generic-alias.hoon+48 tests/lib/jibb-generic-construction.hoon+141 tests/lib/jibb-generic-pattern.hoon+165 tests/lib/jibb-generic-recursion.hoon+170 tests/lib/jibb-hole-guards.hoon+77 tests/lib/jibb-import-default.hoon+50 tests/lib/jibb-import-diagnostic.hoon+59 tests/lib/jibb-import-overlap.hoon+80 tests/lib/jibb-import-structural.hoon+82 tests/lib/jibb-import.hoon+46 tests/lib/jibb-list-alias-guards.hoon+27 tests/lib/jibb-mark-bridge.hoon+28 tests/lib/jibb-module-scope.hoon+132 tests/lib/jibb-nested-union-guards.hoon+67 tests/lib/jibb-poke-bridge.hoon+88 tests/lib/jibb-positional-face-guards.hoon+38 tests/lib/jibb-program-init.hoon+134 tests/lib/jibb-program-main.hoon+141 tests/lib/jibb-program-update.hoon+139 tests/lib/jibb-program-watch.hoon+209 tests/lib/jibb-proj-guards.hoon+124 tests/lib/jibb-qath-fuel.hoon+52 tests/lib/jibb-qath-source.hoon+66 tests/lib/jibb-request-guards.hoon+149 tests/lib/jibb-sub-guards.hoon+37 tests/lib/jibb-tlon-bridge.hoon+29 tests/lib/jibb-todo-api.hoon+85 tests/lib/jibb-todo-partial.hoon+58 tests/lib/jibb-typecheck.hoon+14 tests/lib/jibb-union-alias-overlap.hoon+107 tests/lib/jibb-union-source.hoon+152 tests/lib/jibb.hoon+3645−454 tests/type-api-evidence/about.txt+3 tests/type-api-evidence/expected.txt+1 tests/type-api-paths/about.txt+3 tests/type-api-paths/api.txt+13 tests/type-api-paths/expected.txt+18 tests/type-api-paths/missing-decl.txt+12 tests/type-api-paths/poke-clash.txt+12 tests/type-api-paths/scry-bad.txt+13 tests/type-api-paths/scry.txt+13 tests/type-api-paths/todo-action.txt+6 tests/type-api-paths/todo-item.txt+6 tests/type-api-paths/todo-sur.txt+12 tests/type-api-paths/todo-update.txt+6 tests/type-api-paths/todos.txt+6 tests/type-api-paths/value-clash.txt+15 tests/type-cell-branch/about.txt+2 tests/type-cell-branch/bad.txt+3 tests/type-cell-branch/good.txt+3 tests/type-deferred-context/about.txt+3 tests/type-deferred-context/collision-early.txt+27 tests/type-deferred-context/collision-late.txt+28 tests/type-deferred-context/dangling.txt+16 tests/type-deferred-context/duplicate.txt+14 tests/type-deferred-context/missing.txt+14 tests/type-deferred-context/plain.txt+11 tests/type-deferred-context/report.txt+15 tests/type-deferred-context/rich.txt+27 tests/type-deferred-context/simple.txt+10 tests/type-deferred-context/wrong.txt+14 tests/type-deferred-prepared/expected-control.txt+7 tests/type-deferred-prepared/expected-tuple-only.txt+4 tests/type-deferred-prepared/expected.txt+8 tests/type-deferred-prepared/good.txt+9 tests/type-deferred-prepared/imported.txt+11 tests/type-deferred-prepared/main.txt+10 tests/type-deferred-prepared/mold-collision.txt+9 tests/type-deferred-prepared/no-final-cast.txt+8 tests/type-deferred-prepared/no-prelude.txt+9 tests/type-deferred-prepared/tuple-only.txt+3 tests/type-deferred-prepared/unrelated-tag.txt+11 tests/type-deferred-prepared/wrong-draft.txt+9 tests/type-deferred-prepared/wrong-unit.txt+9 tests/type-deferred-resolver/about.txt+5 tests/type-deferred-resolver/conflict.txt+12 tests/type-deferred-resolver/duplicate.txt+12 tests/type-deferred-resolver/expected.txt+42 tests/type-deferred-resolver/face.txt+6 tests/type-deferred-resolver/good.txt+11 tests/type-deferred-resolver/hole.txt+12 tests/type-deferred-resolver/missing.txt+10 tests/type-deferred-resolver/stability-early.txt+6 tests/type-deferred-resolver/stability-late.txt+6 tests/type-deferred-resolver/stability-output-early.txt+9 tests/type-deferred-resolver/stability-output-late.txt+9 tests/type-deferred-resolver/stability-simple-early.txt+6 tests/type-deferred-resolver/stability-simple-late.txt+6 tests/type-deferred-resolver/stability-slot-early.txt+9 tests/type-deferred-resolver/stability-slot-late.txt+9 tests/type-deferred-resolver/store.txt+12 tests/type-deferred/about.txt+3 tests/type-deferred/conflict-src.txt+12 tests/type-deferred/duplicate-src.txt+12 tests/type-deferred/expected.txt+38 tests/type-deferred/face-bad-src.txt+6 tests/type-deferred/face-good-src.txt+6 tests/type-deferred/hole-src.txt+12 tests/type-deferred/local-src.txt+8 tests/type-deferred/missing-src.txt+10 tests/type-deferred/mold-hole-src.txt+12 tests/type-deferred/mutual-src.txt+7 tests/type-deferred/nested-src.txt+7 tests/type-deferred/principal-src.txt+11 tests/type-direct-gate/about.txt+4 tests/type-direct-gate/expected.txt+86 tests/type-direct-gate/source.txt+96 tests/type-empty/about.txt+3 tests/type-empty/dead.txt+7 tests/type-empty/expected.txt+59 tests/type-empty/face-source.txt+2 tests/type-empty/good.txt+11 tests/type-empty/late-cap.txt+16 tests/type-empty/list-dead.txt+4 tests/type-empty/list-live.txt+3 tests/type-empty/list-open.txt+3 tests/type-empty/missing.txt+6 tests/type-empty/overlap.txt+3 tests/type-empty/standard-good.txt+11 tests/type-empty/unit-dead.txt+4 tests/type-full-overlap/about.txt+3 tests/type-full-overlap/child.txt+4 tests/type-full-overlap/distinct.txt+5 tests/type-full-overlap/duplicate-generic.txt+4 tests/type-full-overlap/duplicate.txt+5 tests/type-full-overlap/expected-basic.txt+16 tests/type-full-overlap/expected-graph.txt+8 tests/type-full-overlap/generic.txt+4 tests/type-full-overlap/invalid.txt+4 tests/type-full-overlap/parent.txt+5 tests/type-full-overlap/precedence.txt+5 tests/type-full-overlap/same.txt+4 tests/type-full-overlap/unsupported.txt+4 tests/type-full-overlap/zero.txt+4 tests/type-gate-free/about.txt+1 tests/type-gate-free/expected.txt+9 tests/type-gate-free/todo-gate.txt+40 tests/type-gate-free/todo-noun.txt+40 tests/type-gate-free/todo.txt+40 tests/type-generic-construction/about.txt+9 tests/type-generic-construction/alias-client.txt+12 tests/type-generic-construction/alias.txt+3 tests/type-generic-construction/client.txt+24 tests/type-generic-construction/expected.txt+65 tests/type-generic-construction/no-event-client.txt+8 tests/type-generic-construction/owner-negative.txt+10 tests/type-generic-construction/owner-positive.txt+9 tests/type-generic-construction/sibling-values.txt+4 tests/type-generic-construction/tree-no-event.txt+4 tests/type-generic-construction/tree.txt+6 tests/type-generic-pattern/about.txt+10 tests/type-generic-pattern/client.txt+166 tests/type-generic-pattern/expected.txt+91 tests/type-generic-pattern/no-event.txt+17 tests/type-generic-pattern/owner-bad.txt+22 tests/type-generic-pattern/owner.txt+18 tests/type-generic-pattern/poly-values.txt+2 tests/type-generic-pattern/values.txt+18 tests/type-generic-recursion/about.txt+14 tests/type-generic-recursion/alias.txt+3 tests/type-generic-recursion/bad-constructor.txt+8 tests/type-generic-recursion/bad-match.txt+10 tests/type-generic-recursion/bad-mold.txt+8 tests/type-generic-recursion/bad-parameter.txt+6 tests/type-generic-recursion/chain.txt+3 tests/type-generic-recursion/client.txt+11 tests/type-generic-recursion/expected.txt+35 tests/type-generic-recursion/list-shadow.txt+4 tests/type-generic-recursion/local-distinct.txt+11 tests/type-generic-recursion/local-only.txt+11 tests/type-generic-recursion/local-shadow.txt+11 tests/type-generic-recursion/tree-changed.txt+6 tests/type-generic-recursion/tree.txt+6 tests/type-import-default/about.txt+1 tests/type-import-default/controls.txt+16 tests/type-import-default/expected.txt+9 tests/type-import-default/parent.txt+3 tests/type-import-default/tlon.txt+18 tests/type-import-diagnostic/about.txt+15 tests/type-import-diagnostic/expected.txt+112 tests/type-import-diagnostic/mark.txt+5 tests/type-import-diagnostic/nested.txt+11 tests/type-import-diagnostic/source.txt+13 tests/type-import-diagnostic/sur.txt+5 tests/type-import-overlap/about.txt+24 tests/type-import-overlap/expected.txt+26 tests/type-import-overlap/source.txt+4 tests/type-import-overlap/sur.txt+17 tests/type-import-structural/about.txt+14 tests/type-import-structural/expected.txt+41 tests/type-import-structural/source.txt+5 tests/type-import-structural/sur.txt+12 tests/type-import/about.txt+37 tests/type-import/expected.txt+148 tests/type-import/source.txt+83 tests/type-import/sur.txt+27 tests/type-list-alias/expected.txt+36 tests/type-mark/about.txt+7 tests/type-mark/collision.txt+3 tests/type-mark/declared.txt+2 tests/type-mark/expected.txt+19 tests/type-mark/missing.txt+1 tests/type-mark/sur.txt+2 tests/type-module-scope/about.txt+16

150 more files changed are not listed.

README.md+30−11
@@ -1,26 +1,29 @@
11# Jibb
22
3−Jibb is a UI language for Urbit: a Hoon dialect with an indentation layout. Its design doc is the spec, and where this code and the doc disagree, the doc wins.
3+Jibb is a UI language for Urbit: a Hoon dialect with an indentation layout. Its design doc, [Jibb — an Elm-architecture UI language for Urbit](https://claude.ai/artifact/DMBr48qzi5z8hcwn2ccPBv), is the spec, and where this code and the doc disagree, the doc wins.
4+
5+Milestone 1 of the doc's eight, the parser and the `%jibb` mark, is done; milestone 2, types and prelude, is in progress. The type checker and Hoon importer are partial. [docs/](docs/) holds a copy of the doc's tabs, the status of each milestone, the open questions, a development guide, a map of the compiler, and the brief for milestone 2.
46
57## Layout
68
7−- `jibb-dev/`: what app desks vendor: the `%jibb` mark (`mar/jibb.hoon`) and the compiler (`lib/jibb.hoon`, one Hoon core without Ford runes); later the prelude and browser library.
9+- `jibb-dev/`: what app desks vendor: the `%jibb` mark, the compiler, the partial Hoon type reader and the beginning of the prelude; later the browser library.
810- `jibb/`: the `%jibb` desk, for the shared host (milestone 4).
911- `my-app/`: an example app desk built from the doc's worked examples.
1012- `vendor/`: pinned copies of the base-dev and landscape files the desks need.
1113- `tests/`: golden cases in `golden/<case>/`, and on-ship tests for the `-test` thread in `lib/jibb.hoon`.
12−- `tools/`: dev tooling: `golden` and `hoon`, with their self-test in `testdata/`.
14+- `tools/`: dev tooling: `golden`, `hoon` and `doc-blocks`, with their self-test in `testdata/`, and `ship`.
15+- `docs/`: the doc's tabs as Markdown in `spec/`, the status, the open questions, the development guide, the compiler's map, and briefs for milestones in `prompts/`.
1316
1417## Golden tests
1518
16−Each case, `tests/golden/<case>/`, holds `source.jibb`, `about.txt` (where it comes from, what it tests, the expected outcome), and the expected outputs: `tokens.txt` from the layout pass and `tree.txt` from the parser. A file holds the output plus one trailing newline.
19+Each case, `tests/golden/<case>/`, holds `source.jibb`, `about.txt` (where it comes from, what it tests, the expected outcome), and the expected outputs: `tokens.txt` from the layout pass and `tree.txt` from the parser. A file holds the output plus one trailing newline. A case may also have a `path.txt` specifying its logical `/ui/.../*.jibb` path. An `expect-types:` line in `about.txt` opts it into the provisional `golden-types` checker output in `types.txt`; `--update` creates it. A case can select Hoon molds in `imports.txt` and provide each module in `sur/<module>.txt`, or select marks in `marks.txt` and provide their source in `mar/<name>.txt`. `modules.txt` selects Jibb source fixtures; their trees go in `module-trees.txt`, and the partial checker can resolve a subset of library imports. See [docs/development.md](docs/development.md).
1720
1821Run them without a ship. This needs `urbit` on PATH and Python 3.
1922
2023```
21−tools/golden # every case: PASS or FAIL, a diff per failure, a summary
22−tools/golden --case 'grammar-*' # only the cases matching a glob
23−tools/golden --show --case foo # print the outputs, don't compare
24+tools/golden # every case: PASS or FAIL, a diff per failure, a summary
25+tools/golden --case 'doc-grammar-*' # only the cases matching a glob
26+tools/golden --show --case foo # print the outputs, don't compare
2427```
2528
2629When outputs change on purpose, regenerate them, then review the diff before committing:
@@ -39,7 +42,20 @@ tools/hoon '(golden /a/b/jibb (crip "++ main view"))'
3942tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
4043```
4144
42−`tools/testdata/selftest` tests both tools against a stub library.
45+`tools/testdata/selftest` tests both tools against a stub library, and `tools/doc-blocks` against Markdown it writes. `tools/importer-test` compares the partial Hoon importer's fixture projections against their golden file. `tools/type-import-test`, `tools/type-import-overlap-test`, `tools/type-import-structural-test`, `tools/type-union-source-test`, `tools/type-union-alias-overlap-test`, `tools/type-full-overlap-test`, `tools/type-generic-recursion-test`, `tools/type-generic-construction-test`, `tools/type-generic-pattern-test`, `tools/type-deferred-test`, `tools/type-deferred-prepared-test`, `tools/type-deferred-resolver-test`, `tools/type-deferred-context-test`, `tools/type-empty-test`, `tools/type-cell-branch-test`, `tools/type-tlon-test`, `tools/type-mark-test`, `tools/type-poke-test` and `tools/type-api-paths-test` check importer/checker, prelude and partial API path analysis boundaries under eval; the ship suite runs the same fixtures.
46+
47+The focused `tools/type-program-main-test` checks the narrow closed, subscription-free `main` slice and its shared fake-ship fixture. `tools/type-program-init-test` checks transactional initializer recovery for a synthetic direct program, including exact exported and imported types and rejection boundaries. `tools/type-program-update-test` checks derived result context for an unannotated two-slot update, including a union/boolean branch, downstream types and fail-closed controls under eval with a shared fake-ship arm. `tools/type-program-watch-test` uses the real todo readers with synthetic program components to check one direct request value against merged API-source evidence and reject hand-built, indirect, parameterized, diff and ambiguous subscriptions. These are static checks only: they do not run an island or establish runtime watching.
48+
49+### The doc's examples
50+
51+Every code block the design doc labels `jibb` is a golden case, `doc-<tab>-<n>-<what>`, where `<n>` counts the tab's code blocks, labelled or not. To check that none is missing or stale, export the doc's tabs as Markdown and pass the files, or a folder of them:
52+
53+```
54+tools/doc-blocks docs/spec # the snapshot in docs/spec
55+tools/doc-blocks Grammar.md Overview.md Core-language.md # fresh exports
56+```
57+
58+It matches each labelled block to the case whose `source.jibb` is the block's text plus a newline, and lists the blocks no case holds, each with a diff against the closest unmatched case, and the `doc-*` cases no block holds. Pass every tab with Jibb blocks, or the other tabs' cases count as stale. The exit status is 0 when every block has a case and every case a block, 1 when one doesn't, and 2 when the check can't run, for example because no block is labelled `jibb`.
4359
4460## Fake ship
4561
@@ -52,7 +68,7 @@ tools/ship log # the end of its log
5268tools/ship stop
5369```
5470
55−`tools/ship sync <desk>` assembles a desk from the repo's folders, creates it if it's missing (as `|new-desk` does), mounts it, makes the mount hold exactly those files, runs `|commit` and waits until the desk matches the repo, checking every file. If Clay rejects the commit, it prints Clay's error, which the log doesn't show.
71+`tools/ship sync <desk>` assembles a desk from the repo's folders, creates it if it's missing (as `|new-desk` does), mounts it, deletes from the desk through Clay the files the repo doesn't have, makes the mount hold exactly the repo's files, runs `|commit` and waits until the desk matches the repo, checking every file. If Clay rejects the commit, it prints Clay's error, which the log doesn't show.
5672
5773| Desk | Assembled from |
5874| --- | --- |
@@ -60,7 +76,7 @@ tools/ship stop
6076| `jibb` | `vendor/*`, then `jibb` |
6177| `jibb-dev` | `vendor/*`, then `jibb-dev`, then `tests/`, with `tests/lib/jibb.hoon` generated, and `jibb/sys.kelvin` |
6278
63−The `jibb-dev` desk runs the golden cases on the ship, as `-test` arms. `tools/ship gen-tests` writes `tests/lib/jibb.hoon` from `tests/golden`: for each case it imports `source.jibb`, `tokens.txt` and `tree.txt` with `/*`, and its `test-` arm compares `golden:jibb` with them. Don't edit that file; `--check` says whether it's up to date. `tools/ship test` regenerates it, syncs the desk and runs `-test /=jibb-dev=/tests`, printing each case's OK, FAILED or CRASHED and the reason. It exits 0 only when every case passes.
79+The `jibb-dev` desk runs the golden cases on the ship, as `-test` arms. `tools/ship gen-tests` writes `tests/lib/jibb.hoon` from `tests/golden`: for each case it imports `source.jibb`, `tokens.txt` and `tree.txt` with `/*`, and its `test-` arm compares `golden:jibb` with them. Cases opted into `types.txt` also compare the partial inference output. Don't edit that file; `--check` says whether it's up to date. `tools/ship test` regenerates it, syncs the desk and runs `-test /=jibb-dev=/tests`, printing each case's OK, FAILED or CRASHED and the reason. It exits 0 only when every case passes.
6480
6581```
6682tools/ship test # the library and tests/golden
@@ -68,10 +84,12 @@ tools/ship test --stub --golden tools/testdata/ship-golden
6884tools/ship test --lib some/other/jibb.hoon
6985```
7086
71−A sync with nothing to commit takes about 2 s. A commit adds 3 to 10 s, and 300 cases (900 files) sync in about 10 s. `-test` takes 1 to 3 s with the stub library. `--stub` swaps in `tools/testdata/ship-stub.hoon`, and `tools/testdata/ship-selftest` checks the generator and the runner against it with the cases in `tools/testdata/ship-golden`.
87+A sync with nothing to commit takes about 2 s. A commit adds 3 to 10 s, and 300 cases (900 files) sync in about 10 s. `-test` takes 1 to 3 s with the stub library. `--stub` swaps in `tools/testdata/ship-stub.hoon`, and `tools/testdata/ship-selftest` checks the generator and the runner against it with the cases in `tools/testdata/ship-golden`. Runs with `--stub`, `--lib`, or a custom `--golden` include only the generated golden test program: the repository's other test programs run with the default library and corpus. A subsequent default `tools/ship test` restores them.
7288
7389`tools/ship check-commit` proves that `|commit` stores `.jibb` files. It syncs `my-app`, reads every `/ui` file back with `%cx`, byte for byte, and converts `%jibb` to `%mime` and `%txt` and back. It commits half-written files, then deletes them. It merges a file that two desks changed on different lines, and checks that changes to the same line conflict. It can be rerun, and it leaves the two scratch desks it merges with (`%jibb-check-ours` and `%jibb-check-theirs`) holding only what `|new-desk` gives, unmounted.
7490
91+`tools/clay-fixtures` syncs `my-app`, builds its example `/sur` files and marks through Clay, and checks selected types read from the compiled graphs and passed to the partial checker. It compares the results with golden files under `tests/clay-fixtures/`.
92+
7593For anything else:
7694
7795```
@@ -87,4 +105,5 @@ What the ship does that you might not expect:
87105
88106- `|merge` with kiln's default strategy, `%auto`, stops at "auto merge failed on strategy %fine" whenever a fast-forward isn't possible: kiln moves on to `%meet` only on a `%bad-fine-merge` error, and this Clay reports `%merge-failed`. Pass `=gem %mate`.
89107- `%txt` keeps no final newline: vere's `+to-wain` jet ends the last line there, where the Hoon in zuse gives an empty line after it. So a `.jibb` file that a three-way merge changes, which goes through `%txt` (`grad %txt`, as `%hoon` does), loses its final newline. Likewise the ship can't tell a golden `tokens.txt` or `tree.txt` that lacks its final newline; `tools/golden` and `tools/ship test` catch it.
108+- `|commit` deletes from the desk only the files vere has seen in the mount since the ship started: the ones it wrote there and the ones an earlier `|commit` found. So after a restart, a file deleted from the mount before the next `|commit` stays on the desk. That is why `tools/ship sync` deletes such files through Clay, with a `%info` task.
90109- conn.sock closes the connection as soon as it has written a reply, so a reply bigger than the socket buffer, about 200 KB, is cut off. `tools/ship` keeps its replies small and reads big files in parts.
docs/README.mdnew file+39
@@ -0,0 +1,39 @@
1+# Docs
2+
3+Jibb's spec is a design doc by @iko, [Jibb — an Elm-architecture UI language for Urbit](https://claude.ai/artifact/DMBr48qzi5z8hcwn2ccPBv), and its repository copy in `spec/`. The repository copy records decisions made on 2026-10-30, including dropping `$?`, adding `%$` as a term literal and pattern, making `@` an unrestricted atom, treating `?` as two atoms for union disjointness, and the milestone 2 type and prelude decisions; the Claude document still needs to be synchronized. This folder also holds where the build stands, what is still open, and how to work on the code.
4+
5+| File | What it holds |
6+| --- | --- |
7+| [spec/](spec/) | The doc's tabs, as Markdown |
8+| [status.md](status.md) | The eight milestones, what milestone 1 built, and how to check it |
9+| [open-questions.md](open-questions.md) | Questions still open: the plan's, the grammar's, and those milestone 2 raises |
10+| [development.md](development.md) | Setting up a machine, the ground rules, the checks to run before pushing |
11+| [compiler.md](compiler.md) | A map of `jibb-dev/lib/jibb.hoon`: its API, data, errors and printed formats |
12+| [prelude-inventory.md](prelude-inventory.md) | Working source audit for the prelude's exported inventory |
13+| [prompts/milestone-2.md](prompts/milestone-2.md) | A brief for the developer who builds milestone 2, types and prelude |
14+| [prompts/drop-union-rune.md](prompts/drop-union-rune.md) | The completed brief for dropping `$?`, as decided on 2026-10-30, before milestone 2 |
15+
16+## The spec
17+
18+`spec/` began as a snapshot of the doc taken on 2026-10-30, after @iko's answers to the 12 grammar questions that day. It has since been edited to record decisions including dropping `$?`, local type-variable scope, cells and changes, record faces, and the noun type `*`; the Claude document still needs those edits. It also has the doc's rules of the same day for gates generic over auras. Each file corresponds to one tab:
19+
20+| File | Tab |
21+| --- | --- |
22+| [spec/overview.md](spec/overview.md) | Jibb — an Elm-architecture UI language for Urbit: the language, the stages, the mark, the host, worked examples |
23+| [spec/grammar.md](spec/grammar.md) | Grammar: lexical rules, literals, runes, imports, modules, molds, tag resolution, patterns, the EBNF |
24+| [spec/core-language.md](spec/core-language.md) | Core language: the untyped language between the checker and both backends |
25+| [spec/decisions.md](spec/decisions.md) | Decisions: every choice, with the date it was made |
26+| [spec/implementation-plan.md](spec/implementation-plan.md) | Implementation plan: the eight milestones, ground rules, architecture, risks, open questions |
27+
28+The doc has a sixth tab, "Loom on Urbit", which is empty, so it has no file.
29+
30+The overview's pipeline diagram, "Jibb pipeline · source to browser in three stages", is embedded content, so the export holds only a placeholder line for it under Architecture. The doc shows it.
31+
32+The two copies can diverge. Sync the repository decisions to the Claude document before refreshing this copy, then export each tab as Markdown again (in a Claude session, the Claude Docs connector's `export` gives each tab's Markdown), replace the files, and run:
33+
34+```
35+git diff docs/spec # what changed in the doc
36+tools/doc-blocks docs/spec # every code block labelled jibb has its golden case
37+```
38+
39+A `jibb` block that changed or is new needs its golden case, `tests/golden/doc-<tab>-<n>-<what>/`, where `<n>` counts every code block of the tab, labelled or not ([development.md](development.md)).
docs/compiler.mdnew file+213
@@ -0,0 +1,213 @@
1+# The compiler
2+
3+A map of `jibb-dev/lib/jibb.hoon`, the compiler as milestone 1 left it: the layout pass, the parser, and the printers the golden tests compare. The file explains itself in design notes at its top, numbered 1 to 4; this page says where things are and points there for the reasoning.
4+
5+The plan's Compiler architecture section gives the whole pipeline. Here it is shortened, with the milestone that builds each step; milestone 1 built the first line:
6+
7+```
8+/ui source
9+ → layout pass → parser → a syntax tree per module milestone 1
10+ → module graph: imports resolved, Hoon types read from Clay milestone 2
11+ → type checker, one module at a time, in dependency order milestone 2
12+ → core language milestone 3
13+ → Nock milestone 3
14+ → JavaScript milestone 6
15+```
16+
17+## Constraints
18+
19+- **One core, no Ford runes.** `urbit eval` runs the library as `=> <this file> <expression>`, and a ship builds it as `/lib/jibb.hoon`. So it can't import with `/-` or `/+`, and under `urbit eval` it can't scry. Anything from Clay, such as an imported module's text or a `/sur` file's type, is best passed in by the caller, which keeps every stage testable under eval.
20+- **The standard library is the subject.** Under `urbit eval`, as on a ship, the library is built against `..zuse`: `hoon.hoon`, lull and zuse. It reads literals with Hoon's own parser, `nuck:so`. Hoon's type engine, `ut`, is there for milestone 2, and under eval `ride` compiles Hoon source, such as a `/sur` file without Ford runes, into a type, which tests can use in place of Clay's builds.
21+- **The spec wins.** Where the file and the spec disagree, the spec is right, and the file's notes quote its words for each rule they implement. The repository spec records the decision to drop `$?`, pending synchronization to the Claude document.
22+
23+## API
24+
25+From the header of the file:
26+
27+| Arm | Takes | Gives |
28+| --- | --- | --- |
29+| `+layout` | `[file=path src=@t]` | `(list token)`: never fails; an error is the last token |
30+| `+layout-error` | `[file=path toks=(list token)]` | `(unit error)`: the error token's error, if any |
31+| `+parse` | `[file=path src=@t]` | `(each module error)` |
32+| `+parse-tokens` | `[file=path toks=(list token)]` | `(each module error)` |
33+| `+golden` | `[file=path src=@t]` | `[tokens=@t tree=@t]`: both stages printed, or the rendered error |
34+| `+golden-types` | `[file=path src=@t]` | A partial inference report; explicitly says the module has not been checked |
35+| `+golden-types-imports` | `[file=path src=@t externals=iexternals]` | The same partial report, with selected caller-supplied Hoon mold results |
36+| `+show-tokens` | `(list token)` | `@t` |
37+| `+show-module` | `module` | `@t` |
38+| `+show-error` | `[src=@t error]` | `@t` |
39+
40+A file is a Clay path whose last segment is the extension, as `/ui/basket/jibb`.
41+
42+## Where things are
43+
44+The core is split into chapters, `+| %name`, in this order:
45+
46+| Chapter | Holds |
47+| --- | --- |
48+| `%positions` | `loc`, `span` and `error` |
49+| `%tokens` | `token`, `lexeme`, `glyph` and `lit`: what the layout pass emits |
50+| `%tree` | The syntax tree: `module`, `import`, `def`, `expr`, `piece`, `qseg`, `item`, `edit`, `arm`, `sample`, `field`, `pattern`, `shape` and `pseg` |
51+| `%api` | The arms above that aren't printers |
52+| `%lexer` | The layout pass's door, `+lexer`, and its helpers |
53+| `%printers` | `+show-tokens`, `+show-module`, `+show-error` |
54+| `%parser-helpers` | Error building (`+fail`, `+fail-in`, `+fail-space`, `+fail-line`, `+moved`, …) and the `+then` combinator |
55+| `%parser` | The parser's door, `+parser`: one arm per EBNF rule, as `+read-module`, `+read-expr`, `+read-mold` |
56+| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
57+| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
58+
59+The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, faced and unfaced cells, cell sample binders, known record field reads, a cell pattern of two or more binders, a complete two-arm loobean branch, a complete two-arm unit-shaped branch, closed local mold aliases and acyclic forward value references. For a supported single syntactic top-level recursive gate, the checker infers the sample first and uses that exact sample, including its field faces, in a monomorphic self placeholder. The completed body must unify with the placeholder before the gate is generalized; incompatible recursive arguments can report the call and argument sites. Uses of generalized top-level definitions instantiate their schemes independently. For a complete loobean branch with one direct self-call arm, the checker can infer the other arm independently and use its closed, fully resolved type to seed the recursive result; it then checks the whole body. Open or pending base types do not seed the result, and other branch shapes still depend on the existing partial inference. A supported single local recursive gate also uses a monomorphic self reference while its body is checked, then generalizes variables free of its enclosing environment; captured variables remain shared. Acyclic local value definitions can refer forward. The checker collects written capitals per `++` before inference, excluding nested definitions: a capital used in an enclosing definition is shared with its locals, even when written later, while a capital introduced only in a local definition is generalized there. Sibling locals can introduce independent capitals with the same spelling; generic mold parameters keep their own scope. Top-level groups of syntactic gates are inferred together with monomorphic placeholders and shared substitutions, then generalized only after the whole group checks; downstream uses and library interfaces instantiate those schemes independently. A dependency graph identifies groups with two iterative depth-first passes; its conservative local-reference edges can reject otherwise valid programs. Supported local mutually recursive gate groups also use shared monomorphic placeholders and generalize only after the group checks, preserving captured outer variables. Some proven non-gate value cycles are diagnosed; other mixed gate/value cycles, polymorphic recursion, unresolved literal constraints and unresolved branch joins remain unsupported. Acyclic simple local mold aliases can also refer forward, and are scoped to the body, not its gate's sample. Nonrecursive generic aliases of supported molds can be applied at exact arity, including locally and through library interfaces; their parameters are lexical. Closed, provably disjoint nonrecursive unions and tagged single-case molds support contextual term values, `~` and `|=%tag` constructors. Literal heads compare by their runtime noun, so `|=%$` can construct an explicit null-, loobean-zero- or term-zero-headed case. Equal heads with distinct payloads can be selected when exactly one payload fit is proven; unknown or ambiguous alternatives remain unsupported. Unresolved tags and nulls remain pending, with distinct partial-inference diagnostics. Nonrecursive top-level generic union molds with provably disjoint cases also support contextual tags and constructors at exact arity; their arguments are retained through generalization and supported library interfaces. Nonrecursive generic aliases can reorder, repeat or omit parameters while preserving a supported union’s origin, including through local scopes and library interfaces. Generic unions declared directly inside a body and recursive molds outside the source-proven slices described below remain unsupported. A directly known named union can instantiate an unconstrained generic gate sample while retaining its origin, generic arguments and faces. Unnamed, pending-tag, recursive, unknown-atom and variable-bound union origins remain unsupported. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. A differing-variable face constraint remains unsupported. When inference forces two distinct explicitly written capitals equal, it reports both source sites; forcing a capital to a concrete type remains unsupported in this fragment. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, complete imports, general patterns, general deferred constraints, recursive molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`. Some known tuple and record positions acquire matching faces; other variable-dependent face merges, general branch tag context and ambiguous call-result propagation remain unsupported; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types and the source-bound gate-sample proof below. For a single recursive gate outside a group, the reporting path repeats inference rather than instantiating its generalized interface inside its own body; a group report uses its stored schemes. This adds work, and the current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
60+
61+A direct unshadowed prelude call can use checked source layouts when a positional argument is a directly named, already inferred root gate. For two-slot function samples, the checker can match a named update against an unnamed generic gate sample without confusing a binder face with a nested record face. Both explicitly named slots must agree; source boundaries are evidence for this fit, not a call-arity rule. The source gate and prelude annotation must be available from their checked bindings. Local or dynamic gates, aliases without direct evidence, recursive or SCC placeholder bodies, other sample shapes and unresolved call-sample variables remain unsupported by this proof. Ordinary inference remains the fallback.
62+
63+The checker retains a per-analysis index of finalized root gates and a prelude source table bound to the entire trusted prepared interface. A dependency screen avoids building the table when the root cannot use it; changing the interface invalidates it. The host remains responsible for supplying a prepared interface paired with its source. The matcher checks each slot and product in both directions with a shared substitution. Before returning its tentative proof it requires both complete call samples to normalize to closed, tag-free types, then repeats every slot check and requires the substitution and fresh-ID counter to remain unchanged. This keeps later argument or enclosing constraints from invalidating an earlier face check, and preserves pending constraints, capital checks and projection evidence. These scans and the bounded second proof add work; they do not establish a global linear-time bound.
64+
65+Before the empty-capital optimization below, single sequential eval runs including startup showed that 2,000 ordinary gates used 70.20 seconds of user CPU at baseline and 70.64 seconds with the cached source table. Fifty unsupported eligible scalar-slot calls used 24.75 and 25.71 seconds, while fifty function-slot failures used 24.15 and 25.36 seconds. Fifty successful calls took 26.56 seconds before the final stability replay and 26.99 seconds with it. These are synthetic measurements, not production performance limits.
66+
67+Restricted-number promotion only applies to written capital variables. If none are present, it returns immediately instead of traversing the environment. In one startup-inclusive pair of runs on 2,000 independent gates, output was byte-identical and user CPU fell from 71.67 to 38.26 seconds; wall time was 72.80 versus 51.66 seconds while other checks were running. This does not establish a bound for dependent modules or a complete-checker benchmark.
68+
69+A bounded source proof can also establish distinct literal heads when a union case is a one-hop application of a uniquely resolved local generic mold. It compares literal runtime nouns and checks the original mold normally before publishing an interface. The same source proof improves the partial report, which still says the mold is not checked. The new proof declines nested or qualified applications, opaque references, recursive-index states, holes and deferred obligations; other valid unions can remain unsupported. A 256-node source budget and a separate 256-entry inherited-state budget apply per attempt. They do not bound the existing pairwise union pass, parsing, atom or name sizes, or downstream checking. Prepared interfaces and inference state remain trusted inputs. `tools/type-union-source-test` and the shared ship guard exercise source resolution, reporting, rollback and these bounds. A separate positive witness can identify overlap in two-field, literal-headed cases when a unique one-hop local, one-parameter generic alias is applied to a concrete primitive payload. It compares the literal noun values and proves the payloads have a shared noun, so an empty or unknown payload is not a witness. The partial report identifies both original case sites. `infer-jibb-file-detailed` returns structured overlap evidence for the first failed mold, including the originating path, exact source, mold name and both case spans. Ordinary Jibb imports preserve a child’s evidence through source and cache checks; the legacy `infer-jibb-file` API remains a text-result adapter and renders both excerpts. Specialized API and prepared-prelude paths retain their existing generic or text-only error boundaries. This witness uses a shared 256-node source/pair budget per attempt; generic-wrapper parameter validation has a separate 256-entry cap. An unsupported earlier case may hide a later overlap. Existing pairwise union analysis, parsing, atom and name sizes, source-excerpt rendering, and downstream checking remain outside these budgets. `tools/type-union-alias-overlap-test` checks the source proof and partial report; `tools/type-full-overlap-test` checks the detailed and legacy full-module paths, source attribution and cache behavior.
70+
71+A single-arm cell pattern can bind two or more positions, with its last binder capturing the remaining tail. Duplicate and shadowed names are rejected. A definite non-cell spine fails; an intermediate union or collection that might contain a cell remains unsupported. For a known non-union cell, a separate one-arm rule also accepts structured patterns, including nested literal and wildcard positions, when the existing coverage proof establishes the whole pattern. It binds payloads with their original types and checks result context; unknown, partially covered, union or recursive spines stay unsupported.
72+
73+String interpolation infers its pieces in order and preserves substitutions and pending constraints. A piece with a known atom aura, unrestricted `@`, or a tape `(list @tD)` is accepted; an isolated decimal literal takes its normal `@ud` default. A known cell reports that it needs a printer, and an explicitly generic atom asks for an aura at its use site. Loobeans, term singletons, non-tape collections, open types and a type fixed only later remain unsupported in this fragment.
74+
75+The Hoon bridge translates imported `*` as the any-noun type, directly or within supported nonrecursive cells. The reader may still decline a disjoint tagged union with a noun payload, and recursive imports containing `*` remain unsupported. It accepts an exact fork of the two loobean singletons as `?`, and each singleton separately as `%.y` or `%.n`, including inside supported faced cells. Contextual loobean literals specialize against a matching singleton by noun, including a proven singleton in a direct union; named loobean singletons do not silently widen to a distinct aura. Open `%f`, other values, and other forks containing loobean singletons remain unsupported; recursive Hoon molds containing flags can also fail closed.
76+
77+A bare tag that provably matches no case of a known union reports the union and tag sites. This covers casts, single-argument calls, contextual unit payloads, list items and supported branch arms, including unnamed imported unions. For syntactic tuples, ordered fit replay can identify a missing tag in a nested position; an earlier mismatch or uncertainty stops the replay instead of guessing. Existing tags whose shape or payload does not fit retain the ordinary mismatch; unresolved tags stay pending.
78+
79+A change can replace uniquely named fields on a fully known, faced record spine, including through a nested wing. Replacements receive the field type as context, substitutions and pending constraints are retained, and the resulting type remains the original record. Missing fields, empty changes and definite replacement mismatches report sites; the expected-type site is the edit, since the original field declaration location is not retained. Unknown or partly unfaced spines, ambiguous fields and repeated edits remain unsupported. A cast to a known record also supplies field context to a tuple or record initializer, including nested list and union fields. The expected-type site is the cast mold; the original field declaration location is not retained. Isolated cart-style `init` and `update` expressions infer in this fragment. The complete cart-store source fails closed because store kind and declaration scope are not yet checked.
80+
81+For supported closed unions, the type printer keeps the union’s origin separate from its displayed name. It prints an in-scope name such as `msg` or `msg.lib`, including in records and gates; an accessible imported nongeneric alias may name a transitive union. A nongeneric body-local union that escapes its scope, or an origin without an accessible name, prints its cases separated by spaces, parenthesized when nested. That case-list form is print-only. A supported generic union prints its name and all arguments, including unused arguments; when its name is unavailable, the partial printer reports that limitation instead of dropping its arguments. Two faces for the same imported origin remain compatible; compatibility between distinct union origins, including in gate types, remains unsupported. Some comparisons of generic union arguments also remain unsupported rather than deciding equality or mismatch. The Hoon bridge also translates some imported unnamed unions into this representation; unsupported cases remain errors.
82+
83+Multi-argument calls form one right-nested sample: `f a b c` supplies `[a [b c]]`, with the last argument able to be a cell itself. The fragment fits the complete sample, preserving known faces and shared variables. Known sample positions can provide list or union context to arguments; unknown sample shapes use ordinary inference and some contextual forms remain unsupported. For a definite mismatch, the diagnostic points to a specific argument when it can establish which one failed; otherwise it reports the combined sample.
84+
85+A list literal can be inferred when a cast or known gate sample supplies a list type and the supplied prelude has the validated standard list definition. Empty, nonempty and nested literals work, including contextual union tags in elements; mismatched elements report the item and expected type. Imported Hoon lists share this representation. Under the same known context, `~` and zero-valued term literals fit an empty list, and a two-item unfaced cell `[head tail]` is a cons; cons cells and list literals can be nested. Mismatched heads or tails report both sites. A known list result also supplies context through complete loobean, unit-shaped and list-shaped branches, including recursive and nested branches. Known loobean result context can propagate through supported complete branches and binder-only cell arms, with a final directional fit; a binder-only arm over a union subject remains unsupported. A known gate with an unresolved result variable can also receive an enclosing result type before its argument is inferred, for example allowing `^- (list @t) (id ~)`; unknown callees and unresolved targets retain the conservative path. A known gate sample supplies context to corresponding positions of a single tuple or record argument, including nested cells; a zero literal can therefore fit a list position. A bound zero constant still remains unsupported rather than a definite mismatch, and an unknown callee does not supply context. Uncontextualized list literals also infer with a fresh element variable, including empty and nested lists; the resulting variable can generalize. Unresolved item tags and uncertain widening remain unsupported. Faced or longer cons cells, and a missing or altered prelude list remain unsupported. For a known standard list with a supported element type, it also infers a complete two-arm branch using `~` and `[item rest]`, in either order. The binders have the element and list types and cannot shadow or duplicate names. Unknown subjects, unsupported element types, other patterns and incomplete arms remain unsupported.
86+
87+A term-headed pair such as `gap+%s2` follows the same contextual inference as `[%gap %s2]`; its synthetic head uses the pair’s span in diagnostics.
88+
89+A backtick constructs a unit when the supplied prelude has the validated standard `unit` template. Its payload is inferred normally, retaining pending literals and generic variables; nested units work and the prelude’s `some` becomes available. With ordinary result annotations, its `bind`, `biff`, `both`, `clap`, `clef` and `flit` also infer. A known unit in a cast, call, list item or record field supplies its payload context, including nested units and lists; definite mismatches identify the payload and context. Unrelated union identities, some variable-dependent fits, and missing or altered prelude templates remain unsupported.
90+
91+A known union of `~` and a null-headed cell can be matched by `~` and `[~ value]` arms in either order. The payload binder is checked for shadowing. Unknown subjects, missing or duplicate arms, and unresolved branch results remain unsupported; this fragment infers the prelude’s `fall` and `need` signatures.
92+
93+The checked inference fragment represents the empty mold `!!` explicitly. A cell with a proven-empty field is empty, while a gate returning `!!` and the empty values of `(list !!)` and `(unit !!)` remain inhabited. Supported union matches discard proven-empty cases, reject unreachable list or unit payload arms, and require a proof of reachability for fixed opaque cases. A written capital may have an inhabited instance; the existing definition-boundary checks still reject forcing it to a concrete empty type. A directly known standard `(list !!)` permits a single null arm, including in a result context. Unknown and opaque types, other one-arm list subjects, and proofs exceeding their budgets fail closed. Emptiness checks use up to 256 type-node visits per fit or list/unit reachability proof and 4,096 visits when filtering union cases. These bounds do not cover substitution walking, parsing, normalization, source lookup or repeated attempts. This is a supported checking slice, not a proof of arbitrary recursive molds or runtime execution.
94+
95+A known closed union with two or more arms can be matched when each arm provably covers or excludes each remaining case. The checker first tries whole cases; when a pattern splits a case, it can expand known `?` positions into their two noun values, up to 64 alternatives across the union. Binders retain the original case type, and one arm may bind several refinements of that case. It reports missing alternatives and arms already covered, checks tags by noun value, and supports imported and generic union cases. Other partial patterns, expansions above the limit, binders spanning distinct cases, differing arm result types and some complex two-arm subjects remain unsupported. When a cast or known call sample supplies a result type, a known union subject accessed by a wing, a grouped wing or a supported shallow call can propagate that context through whole-case arms and supported finite loobean refinements, including nested cell and list positions. Other partial-pattern contexts and subject forms remain unsupported. The Grammar’s `step` block infers in this fragment, but its module is not yet checked.
96+
97+A known closed union can also provide context to each arm of a complete loobean or unit-shaped branch in a cast or a call with a known union sample. Nested branches and transparent groups work; a mismatch reports the expected union and the offending arm. General patterns and context through bodies with local definitions remain unsupported, and unrelated unresolved tags stay pending.
98+
99+The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. It also recognizes a direct ordered-map call with two simple named mold operands, as in Tlon `notes.log`, after validating provenance and operand source; revisiting the same map hold fails closed. It also reads ordered map fields in records when the map arguments are syntactically fixed atom molds and other fields are fixed atom molds or standard collections of static atom molds. Collection names must not be shadowed. The reader can also import a mark door sample, removing its outer sample face and validating its build subject. For a mark whose sample is exactly a named arm of its single Ford-imported `/sur` core, it can recover a source-proved nonrecursive union, including source-location wrappers around fields; recursive or unverified fallback results remain unsupported. The reader checks explicit Hoon `$%`, `$?` and `$^` unions against the Grammar’s disjointness rule, as @iko confirmed on 2026-10-30. For an explicit `$%` with distinct literal head tags, it can also prove restricted local named payload dependencies, including bare `~` fields, re-evaluate and validate each source branch, and recover the union before Hoon collapses it. The real Tlon `notes.u-note` exercises its `[%deleted ~]` case. A bounded fallback also recovers one level of local named tagged unions inside such a union, including Tlon `notes.u-notebook` and `notes.u-notes`. Source-proved tagged unions can also be wrapped in Hoon `$~` defaults, including a downstream union using Tlon `epic.saga`; the selected source and projected branches still undergo the same provenance and disjointness checks. The tagged-source helper peels up to four consecutive default wrappers, while default wrappers encountered inside dependency proofs consume the existing semantic-node budget. A source-proved nested self-recursive union retains its named owner, including Tlon `notes.import-node`; deeper, mutually recursive or unproven cases stay unsupported. The nested source proof has a 256-visit semantic-node budget, and source-location wrapper peeling is limited to four per node; Hoon evaluation and source scans are not metered. It rejects recursive or computed dependencies, inherited same-name collisions, unsupported nested unions and proofs exceeding a shared 4,096-node budget. It re-evaluates statically recognizable source branches before Hoon can collapse them, checks materialized fork cases, and rejects shapes it cannot prove disjoint. Static records may also have verified standard-collection and `path` siblings. One direct explicit union argument in a standard list, set, map or unit is accepted when its call wrapper and collection provenance are verified and its static cases are pairwise disjoint. A synthetic regression checks that forged wrapper subjects, samples and tails are rejected. Other collection-union forms, nested ordered maps, general source-level disjointness and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms, valid term singletons, Hoon's `%n` zero singleton as Jibb `~`, nested faced or unfaced cells, unions of supported, pairwise-disjoint cases, and opaque standard collections with supported arguments from caller-supplied reader results for declared `/-` imports; `+golden-types-with-marks` accepts the same shapes for declared marks. The caller must pass unchanged results from the source-aware reader: the bridge validates the supplied graph but cannot detect source cases Hoon collapsed before that graph was built. The opaque collection types retain their names and arguments for identity, unification and printing. The validated standard prelude `list` mold shares the imported list representation; other Jibb-written collection molds and most prelude collection operations remain unsupported. Other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core. The reader validates direct zuse subjects and Ford subjects consisting of faced imported cores and a validated tail, checking imported cores transitively; it rejects shadowed names, inconsistent core subjects and other subject shapes. For a recursive reference, the reader matches the exact Hoon hold against named arms in validated cores, including transitive Ford imports; it rejects missing, unlabelled or ambiguous origins. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and `tools/type-mark-test` compare bridge reports under eval and on the ship. `tools/type-tlon-test` and its ship counterpart exercise four real Tlon presence unions and a field read through the source-aware reader and partial checker. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
100+
101+An import-free Jibb library can export an opaque single-parameter recursive identity when its source has exactly two distinct term-tagged cases: a text leaf and a node containing `(list (name M))`, optionally with one `$-(@t M)` event field. A module-local index records the exact parsed source, defining path and prepared prelude interface; it is shared across that module's inference passes, and its canonical `list` must be source-backed. The normal resolver publishes an interface only after all ordinary mold and value checks succeed. Same-origin aliases retain the defining identity and independently instantiate type arguments; distinct origins remain unsupported. The opaque identity is conservatively treated as gate-bearing for numeric defaulting, and gate-freedom remains unknown. Explicit literal-headed construction uses a source-proven one-layer view: the event result receives the existing type argument and recursive children keep the defining identity. It consumes the existing shared 256-step recursive inference budget, and a per-view 4,096-visit guard bounds the new face and substitution scan; longer scans decline. These bounds do not cover parsing, existing inference, atom sizes or repeated attempts. One startup-inclusive, shared-load comparison of 100 valid and 100 invalid source definitions took 29.67 s wall / 25.14 s user CPU before this slice and 33.47 s / 26.99 s with it; the former declined all 200 while the latter inferred the valid definitions. These single runs are not a production benchmark. Matches over explicit source tags, flat binder or wildcard fields, and nonbinding catch-alls use that same one-layer view and existing binder, coverage and branch checks. Up to 128 arms are screened per attempt; longer matches decline. A single-arm match on a direct in-scope wing can report its missing case, and a contextual one-arm call subject can use a nonbinding catch-all. Recursive children retain their nominal type and arguments. Subject recognition and view validation can each scan substitutions, and the scan cap applies separately to each attempt. In one separate startup-inclusive comparison of 100 valid and 100 invalid source matches, the construction-only checker took 30.18 s wall / 29.31 s user CPU and declined all 200, while the pattern slice took 28.28 s / 27.69 s and inferred or diagnosed them. These single shared-load figures are not production benchmarks. General structural fits, whole-case binders, nested recursive patterns, uncontextualized single-arm call subjects, recursive source with imports and local recursive molds remain unsupported; the test tree does not prescribe the eventual `element` representation. Caller-supplied detached interfaces and caches retain the existing trusted-input contract.
102+
103+Self-recursive `/sur` molds can cross the bridge as opaque module-and-name identities when their supported source-aware graph passes validation, including one-argument lists containing same-origin recursive references. The real Tlon `notes.import-node` reaches this bridge; it does not unfold or construct the recursive type. Aliases, foreign references, recursive marks, unfolding, construction and field access remain unsupported; the partial printer declines recursive names that are not in scope.
104+
105+The partial checker also recognizes a source-proven Jibb recursive mold consisting of `~` and one faced cell with a fixed-aura head and direct self tail. Its identity includes the defining path and name. It unfolds this shape for supported null and cell construction and for a two-arm null/cell match; static application-path literals use the verified public `qath` alias. The internal prelude defines `qath` as a transparent knot sequence and the public prelude re-exports it. Each inference attempt has 256 unfolding and static-segment steps; parsing and separate retries are not bounded by that limit. Dynamic application-path segments, broader patterns and other recursive shapes remain unsupported. Route and static-file existence checks remain milestone 4.
106+
107+Callers that have a `/sur` core and a name can use `+read-named`: it checks for a locally declared arm before asking Hoon to evaluate the mold, and reports evaluation failures with the final Hoon trace line. `+read-mold-in` remains available when the caller already has the selected type. The opt-in `+read-named-diagnostic` and `+read-mark-diagnostic` preserve successful graphs and distinguish definite `%invalid` evidence emitted directly by the reader from `%unsupported` failures. Other failures, including unverified union disjointness and vase recognition based only on a name, remain unsupported. These entry points revalidate and re-walk failed types; the opt-in `+golden-types-with-reader-diagnostics` accepts unchanged structured reader results and reports definite aura, core or proven union-overlap errors at their imported mold use sites, when the import and supplied input are unique. Ordered replay covers direct and nested cell samples, record and function casts, and non-generic same-module aliases; it stops at an unsupported prefix, cycle or shadowing failure. Union molds, generic applications, transitive modules and unsupported reader outcomes still report generic limitations. Replay repeats inference and may add work; this entry point remains partial. Existing checker entry points continue treating failed imports as unsupported. It also fails closed on repeated field faces along an imported record spine, including recursive roots; the diagnostic remains generic. Hoon type graphs can erase unfaced nested-cell boundaries, so the check may conservatively reject a valid source with equal names in distinct erased scopes. Faced nested records and union alternatives keep separate scopes.
108+
109+For supported source-aware Hoon `$?` unions, the reader can prove a definite overlap by independently evaluating and projecting the original cases, verifying each projected head against its source tag, and finding a shared runtime noun in a pair. Its positive witness traverses faces, named nodes, forks, cells, supported atom forms and `*`; `!!`, opaque references, applications and unproved aura intersections cannot themselves establish a witness. It compares singleton noun values independently of aura, and requires inhabited positions throughout a cell. Unknown or exhausted proof remains unsupported, while existing disjoint-source recovery still handles proven distinct cases. The source screen admits at most 128 cases and 4,096 raw noun nodes; dependency checking and the pair/type witness each have their own 4,096-node budget. Hoon evaluation, projected-graph validation, chapter lookup, atom byte sizes and other type-graph walks remain outside those budgets. The error points at the Jibb use; source case locations are unavailable. This is a partial named-reader analysis, not general imported-union checking or a mark-reader overlap diagnostic.
110+
111+In single startup-inclusive runs of eight Hoon reads, a benign three-case union used 37.78 seconds of user CPU with the earlier narrow witness and 39.99 seconds with the structural witness; a repeated-head union used 39.84 and 40.97 seconds. Other checks ran concurrently, so these measurements do not establish a production bound.
112+
113+The partial report can diagnose certain non-gate value dependency cycles, including cycles through gates. It requires an explicit atom or loobean result cast and a syntactically proven dependency group with unshadowed simple samples; it identifies the value and a dependency site. Untyped results, branches, nested definitions, qualified wings and complex samples remain unsupported. The proof constructs an additional dependency graph. One 24-case recursive/generic eval run took 19.7 s with it and 18.6 s before it, including startup; these single runs do not isolate the graph cost.
114+
115+The source-backed `+api-path-analysis-source` is a separate partial analysis, not an API check: it resolves reachable Jibb imports and declared mark graphs and returns path and scry segments, full and diff mark identities and their types. It also checks derived-name collisions. Full and diff payloads must be direct declared mark names; typed scry parameters must be a same-name, same-aura subset of the watch parameters, and unknown or duplicate segment binders fail closed. It creates no request gates. The caller must pass a trusted prepared prelude and unchanged source-aware reader results.
116+
117+`+api-path-evidence-source` retains that analysis with the API source, complete prepared prelude (including reserved names), supplied reader results and resolved Jibb dependency cache. `+api-path-watchability` classifies a unique declaration as watchable or not watchable, or reports unknown when evidence is absent or ambiguous. The artifact and reader results are trusted host inputs; the host must bind them to the source versions used later. This is declaration evidence, not proof about an arbitrary request value, a checked API module, a runtime validator or an island watch.
118+
119+For a unique supported declaration, `+api-request-parts` retains that evidence with the typed path parameters in source order, the full-state reply sample, and a fold type when there is one diff mark. The fold takes the tagged diff and previous full state and returns full state. Missing or ambiguous evidence, unsupported parameter auras and multiple-diff folds fail closed. These are components for a future request gate; they do not yet fix its argument order, construct a request, or prove watchability of a value.
120+
121+`+api-support-analysis-source` additionally infers supported ordinary API molds and values, resolves every declared mark, and retains their source, dependency and path evidence. Unsupported helpers or marks fail closed. An unused `/-` core is not independently validated, ordinary definitions that need derived gates remain unsupported, and this result is not a checked API interface or an exported request.
122+
123+The ordinary import resolver can infer derived request-gate types for multiple supported API paths. A case may take one typed path parameter before its reply gate, or one diff fold after the reply; a case with both, multiple parameters or diffs, or a separate scry path remains unsupported. Each reply maps the full mark type to a fresh `M` and the request result is `(ask M)`. Checked ordinary API values and molds, declared mark molds and a supported poke constructor are exported too. Every selected `/sur` core must have a directly used, successfully read mold; unselected core bindings are not independently validated, and Jibb module imports remain unsupported in this API fragment. The unchanged todo API fits this fragment.
124+
125+A call whose direct result is a known named generic union can receive a matching same-origin, same-arity result context before its arguments are inferred. This retains the ordered generic arguments and existing capital checks; pending tags, recursive or variable-bound origins and unrestricted atom cases remain conservative. Constructor fitting reports unsupported when an unresolved or opaque case could contain the requested tagged head. It keeps definite missing-case errors for proven nonmatching cases, including an explicitly atom-only faced head. The real todo callback `|=%got` can infer when an `(ask msg)` result context fixes its message union; the uncontextualized call remains unsupported.
126+
127+A two-item tuple with an explicit term, null or loobean head can receive payload context from a known union when every alternative is a literal-headed cell and its head noun is unique. The payload must be a direct wing-headed call, optionally grouped, with literal, wing or constructor arguments. The checker first retains the original inference if it already fits; otherwise it tries the contextual path once and fits the selected case and enclosing union. It declines this path if any substitution has a structural root, because a caller may have walked away variable provenance. Duplicate heads, opaque competitors and other shapes also stay conservative. The guard scans the substitution for each eligible tuple and may perform one extra shallow inference; it does not guarantee globally linear work. This lets an explicitly typed todo subscription body infer; it does not check an island or prove request watchability.
128+
129+`+gate-free-type` is a separate three-way proof over normalized checker types: it reports a gate-free result, a gate-bearing witness with its field path, or unknown. It tracks conservative inhabitance before reporting a gate in a cell, spends one shared node budget, and treats opaque recursion, open variables, unknown collection forms and `*` conservatively. Source-proven `qath` and the recognized list/unit representations have dedicated proofs. `+gate-free-mold-source` parses and resolves one named mold with a fresh active-root graph, retaining the complete prepared prelude, source bundle, trusted reader inputs, dependency cache and inferred mold. It caps classification at 256 nodes; parsing, import resolution and type inference are not covered by that cap. The host must canonicalize paths and bind trusted sources and reader results to their versions. API, store and private roots decline; other definitions and unused imported Hoon bindings are not fully checked. This is mold analysis, not a module, kind, island, watchability or runtime check, and it does not infer general gate-free constraints.
130+
131+A full ordinary module may export a narrow checked program `main` only as a direct, unqualified `(program init update view subs)` call with four simple wing arguments, modulo transparent grouping. The canonical prepared prelude must supply both the `program` value and mold. The ordinary source-backed program fit and all normal mold, value and request-graph checks complete first. The inferred `main` must be closed and invariantly match an instantiated `program` mold from that prelude. The initializer must have a closed gate scheme; its data and model contain no open variables and share the existing 256-node gate-free budget, with `%yes` required for both. The named subscription gate may syntactically return null through transparent casts, groups and definition-free bodies. Alternatively, after a successful request-graph merge, it may return one singleton list containing an unfaced `[%watch request]` pair whose request is a direct `case.face` call with one direct constructor callback. The face must resolve to an imported interface whose member has the exact plain derived-request scheme. Exactly one merged request evidence must match its API path and case, agree with the declaration's inner name, and appear in that interface's own graph; the interface source must equal the evidence's API source. The declaration must have no scry, diffs or path parameters. Pure or hand-built requests, helpers, aliases, re-exports, typed paths, folds, multiple subscriptions and missing or ambiguous evidence fail closed. Arbitrary or aliased mains, API/store kinds, and gates or unknowns in data/model also fail closed. This retains source and graph evidence and permits ordinary downstream imports; it neither executes the program nor implements runtime watching.
132+
133+When only that program's initializer and `main` are unresolved, a bounded transactional retry can derive the initializer's expected gate from the resolved update, view and subscription components. It instantiates all schemes above the greatest variable ID in the module and prelude, reuses the source-backed positional fit and stable replay, and leaves only the initializer's data variable open. The named initializer must be a direct gate whose transparent body is a tuple ending in null. Its own sample fixes data; ordinary inference, product and whole-gate fits, pending-tag and finalization checks, and a fresh ordinary `main` inference must all succeed before the ordinary kind and graph checks publish anything. Aliases, non-main libraries, simultaneous unresolved subscriptions, nonempty subscriptions and unrelated pending tags decline.
134+
135+A sibling retry handles only a missing direct `update` and `main` with the other three components resolved. It infers the update sample ordinarily, requires exactly two right-nested positions, and derives message and model from their types rather than binder names. Canonical `cmd` and `list` templates produce the expected `[model (list (cmd message))]` result. The complete candidate gate is invariantly checked against the instantiated canonical update slot, and the whole program call must close and replay stably above a shared fresh-ID high water. Body inference uses the ordinary post-sample state with that high water and the derived product context, then ordinary result finalization and `main` inference run. Missing canonical evidence, malformed samples, inconsistent types, unrelated pending tags, aliases and non-main modules decline the transaction.
136+
137+Each case's canonical API identity and source-derived schema travel across imports in a nonrecursive graph certificate containing the exact source bundle, prelude, reserved scope and trusted reader results. Cached interfaces must match those inputs and cannot hide an active ancestor; unknown legacy entries are rebuilt from their unique supplied source. Request-bearing closures are limited to 256 paths and requests. Closed gate samples can also fit when an unnamed input slot corresponds to a named one, provided products are identical and nested value faces and ambiguous cell tails remain intact. This is type inference only: request lowering, runtime schema validation and value watchability proofs are not implemented.
138+
139+`+golden-types-with-prelude` accepts case-local Jibb module sources alongside `/sur` and mark results and the vendored prelude source. It resolves reachable ordinary library modules in dependency order, caching completed interfaces per invocation and exporting supported closed value schemes, direct generic unions, and simple or nonrecursive generic mold aliases whose bodies the fragment supports. It detects missing sources and cycles and rejects a dependency if its interface cannot be inferred by the fragment. Qualified wings can also read nested fields of an imported value, instantiating that value’s scheme independently at each use; missing, ambiguous and non-record fields remain unsupported.
140+
141+The supplied prelude is parsed into a **partial interface**: all names actually declared in the source are reserved, while only the molds and values this fragment can infer are available. These include the validated standard `list` mold, `unit`, the doc-exact generic `cmd` union, `same`, `fall`, `need`, `bond`, `lure`, `weld`, `snoc`, `turn`, `lent`, `zing`, `flop`, `rear`, `drop`, `skim`, `skip`, `murn`, `join`, `snip`, `levy`, `lien`, `cork`, `corl`, `cury`, `curr`, `lead`, `late`, `trip` and `tuba`; unsupported entries remain unavailable. The validated `list` is injected while the prelude’s gates are inferred; `weld` and `turn` use ordinary explicit result casts. An absent or altered `list` is not injected, and an altered declaration cannot leak through a direct or transitive mold alias. The same validated template is available when prelude mold aliases are prepared, so supported direct and transitive aliases can use it. A named prelude union keeps the fixed `/lib/jibb/prelude/jibb` origin in every module, and its name remains unqualified when a library exports a type containing it. The prelude inventory is incomplete, so reserving the names in this source does not establish complete shadowing coverage. The source-backed internal prelude defines `poke`, which the public prelude re-exports as an ordinary transparent type. A dedicated trusted internal-prelude preparation path also supplies private comparison, arithmetic and text-conversion schemes for the Jibb-written `gth`, `add`, `dec`, `trip` and `tuba` wrappers. Ordinary module resolution rejects that primitive path even if a caller supplies a spoofed root or bundle. The low-level prepared interface is still trusted host input; the host must select the vendored sources and canonicalize paths. Primitive execution and shape-based jet recognition are not implemented. The Jibb-written `lth`, `gte` and `lte` gates compose the source-backed `gth` and `not` gates; supported calls infer a shared atom constraint and return `?`. Their execution and jet recognition await the backend. The source-backed `add` and `dec` wrappers use private arithmetic interfaces whose shared atom variable excludes loobeans; the partial checker preserves that constraint through supported inference and prints `where A is an atom other than ?`. The partial checker resolves the supported `poke` source shape, preserves its public name, and rejects ordinary imports of the private internal path. The Jibb-written `lent` recursively counts a list using `add`; the partial checker infers its generic list argument and `@ud` result. Its execution and jet recognition remain unverified until the backend exists. The Jibb-written `zing` concatenates homogeneous lists in order using `weld`; the checker infers `(list (list A))` to `(list A)`, including for gate elements. Hoon `zing` also accepts heterogeneous noun lists, which this type does not express. `tools/hoon --raw -f tools/testdata/zing-hoon-reference.hoon` compares an equivalent Hoon recursion with Hoon `zing` on selected finite inputs; it does not execute Jibb or verify lowering or jet recognition. The Jibb-written `lead` and `late` are curried pair constructors: `((lead a) b)` returns `[a b]`, while `((late a) b)` returns `[b a]`. The checker infers independent argument types and accepts gates as ordinary values; neither helper invokes an input gate. A Hoon translation is compared with Hoon’s helpers by `tools/hoon --raw -f tools/testdata/lead-late-hoon-reference.hoon`. This does not execute Jibb or verify lowering or jet recognition. An imported API with one mark and a matching direct `+$ poke` declaration can export a derived constructor and retain agent/mark metadata when the source representation has the supported agent case. Other API shapes, complete private module checking, root API and kind checking, stores, complete `ask` and `pure` checking, lowering and runtime effects remain unfinished. A possible store or root API declaring `+$ poke` reports that kind or scope needs unsupported inference; definite duplicate declarations and unrelated shadowing still report conflicts. Prepared interfaces and caches are trusted caller inputs; the future host and linker must ensure the private source validated during preparation is the same version used to lower derived constructors. A `*` payload may contain gates, so the fragment treats it conservatively; full gate-free checks are unfinished. The shared module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship.
142+
143+`+prepare-prelude` derives the interface and declared-name inventory from the trusted vendored source. Hosts can reuse its result with `+golden-types-with-prepared-prelude`; they must pass the unchanged result of preparation, not an independently constructed value. Empty, malformed and duplicate-name prelude sources fail closed. The source-taking `+prepare-prelude` and `+golden-types-with-prelude` do not supply the internal module; their `-and-internal` or `-with-internal` variants accept its source for the supported private import. API files, modules with `main`, unsupported definitions and many other features remain outside this subset. The older `+golden-types-with-modules` entry point fails closed for imports because it has no prelude scope. None of these partial reports claims the module has been checked.
144+
145+The prepared interface includes the source-backed UI molds and constructors, the full nonrecursive `element` union, and the exact `program` and `page` records and builders. Its element union erases nested child, keyed-item and table payloads to `*`, while public constructor schemes retain typed composition and independent key parameters. `types-prelude-ui` checks those schemes and selected valid and invalid compositions. A child-message mismatch currently fails closed as an unsupported list-item constraint rather than a definite mismatch diagnostic. Raw-constructor encapsulation, duplicate-attribute checks, rendering, navigation, storage and execution remain outside this slice.
146+
147+And the design notes:
148+
149+| Note | Says |
150+| --- | --- |
151+| 1. Positions | Lines and columns count from 1, columns in characters; every token and node has a span, start and end, and the rules a node's span follows |
152+| 2. The layout pass | 2.0 where errors point, then lines, characters, blank lines, levels (INDENT, NEWLINE, DEDENT), the end of the file, tokens and tightness, paths, literals (read with `nuck:so`), strings, and what fails here |
153+| 3. The parser | Why recursive descent (the grammar is LL(2) after the layout pass), the EBNF rule by rule with the node each gives, what the EBNF leaves out and how it's filled in, spacing, and where each error points, with its message |
154+| 4. Printed formats | The token, tree and error formats the golden files hold |
155+
156+Source-backed `like` maps the product of an existing `(like A)` result while retaining its position and remaining input. The partial checker infers supported positional calls by peeling only known sample-slot faces, retaining faces belonging to values; ambiguous variable-bound spines and nested face loss remain unsupported. Backend execution remains outstanding.
157+
158+The internal prelude defines transparent `(ask M)` cases for pure, agent and store requests; the public prelude re-exports it and defines `pure` in Jibb. Preparation supplies the private module with `list.core` and `unit.core` only from validated canonical public templates. If a template is unavailable, an isolated check validates the private molds, but only molds independently inferred against the actual available templates enter the interface. The partial checker infers supported constructors and exhaustive matches; absent versus present-zero state remains distinguishable. Agent and store receiver fields carry raw nouns and cannot prove schema validity or watchability. The public prelude also defines the documented `sub` union in Jibb; supported watch payloads retain the public `(ask M)` type. A `sub` value is not itself proof that its request is watchable. Generated decoders, source-bound runtime validation, request lowering, other derived request shapes and island watch checks remain unfinished. Public prelude preparation is partial: consumers must verify that `ask` was actually exported with its source origin.
159+
160+Public identity aliases of private generic unions retain their public name when the origin, arity and argument order match exactly, including through imported values. Fixed, reordered, repeated and phantom generic aliases remain unsupported where a safe public name cannot be recovered; a fixed nongeneric alias is not printed as though it accepted type arguments.
161+
162+The partial checker reserves `proj` in module, local, sample, pattern and import bindings, including bindings inside unsupported source; a field, tag or path segment may still have that spelling. With a known expected record type, it checks selected explicit `(proj record)` calls over closed, uniquely faced records, preserving the source expression, its type, the result type and field axes in the checked interface. Imported and private-prelude dependencies retain the source needed to lower those plans. The checker does not yet lower or execute them. It supports selecting one or more fields in their original order; a single selected field keeps its face and uses one source axis. Reordered fields, unknown or open record spines, some nested contexts and recursive groups with projections remain unsupported. A directional fit of a wider faced record fails closed instead of inserting a projection, including within supported list, unit and record positions. To limit repeated work, record-spine proofs are reused along the same closed spine and stop at 1,024 fields; field boundaries and the special handling of positional calls reset the appropriate proof. Prepared interfaces and their source remain trusted host inputs.
163+
164+## The tree
165+
166+Every node is `[%tag at=span …]`, so `+span-of` finds its span in one place; the few that aren't say so in the `%tree` chapter. The kinds of node:
167+
168+- **Module**: imports (`%sur` for `/-`, `%mark` for `/%`, `%jibb` for `/=`), then definitions (`%mold` for `+$`, `%value` for `++`).
169+- **Expressions** (`expr`): `%lit`, `%str`, `%path`, `%qath`, `%wing`, `%change`, `%pair`, `%unit`, `%group`, `%list`, `%tuple`, `%gate-wide`, `%ctor`, `%call`, `%gate`, `%cast`, `%trace`, `%branch`, `%crash`, and `%body` for an indented body, with its local definitions if it has any.
170+- **Molds as written** (`shape`): `%aura`, `%hole`, `%noun`, `%void`, `%flag`, `%const`, `%ref`, `%tvar`, `%path`, `%apply`, `%cell`, `%union`, `%fn`, `%generic`. A `%hole` retains the span of `_`; an inferred typed path segment retains that span separately from its enclosing segment. A `%union` spans its first through last case and has no lead token; a single case is its own mold. `%generic` spans from the `|$` after a `+$` name through its body.
171+- **Samples, fields and patterns**: a sample is `%bind`, `%face`, `%pun`, `%cell` or `%bare`, since a bare name binds anywhere in a sample; a pattern is `%lit`, `%str`, `%any`, `%bind` or `%cell`.
172+- **Literals** (`lit`) keep the form they matched, their aura and value, and their text as written, which the printers show.
173+
174+The parser accepts type holes. The partial checker records each ordinary hole with its span and validates the obligations created in a value or local definition before generalization. A solved concrete type or an explicitly written in-scope capital resolves a hole; a later use cannot repair it. Independent decimal holes may default to `@ud` when the surrounding inferred type is gate-free; variables reachable from the environment or written capitals are protected from premature defaulting. Structural named-mold holes are diagnosed at their source, while complex named molds, inferred path segments, recursive groups with holes and unresolved constraints remain unsupported. Partial prelude and API interfaces cannot silently export unchecked holes. A separate syntax-tree pass reports duplicate names within a written record at both field sites, including in unused definitions; nested and separate records have independent scopes.
175+
176+The tree keeps everything the checker needs to report an error at the code as written: open and closed brackets give the same node, but every node keeps its span.
177+
178+## Positions and errors
179+
180+- A span runs from a node's first character to just past its last. A node ends where its last token ends, never at a layout token, and holds its children's spans in order. `+check-spans` tests both rules on every tree the golden tests print.
181+- An error is `[file=path line=@ud col=@ud msg=tape]`: a start, no end yet. Milestone 2's type errors need more, since the plan asks that "each error names both conflicting sites, with excerpts". Spans keep their ends for that.
182+- Every error points at the first character where the text stops being the start of any valid module (note 2.0). The layout pass never fails: it ends its tokens with an error token, and the parser reports whichever error comes first, its own or that one.
183+- The parser's messages read "expected <what>, found <token>", with an optional "; <hint>". The layout pass's state the rule broken, as "a tab: Jibb uses spaces only" or "`|%` is left out: modules are records". None ends with a period, and all start lowercase unless they open with a name, as "Jibb writes no @c literals". `+show-error` prints `<file>:<line>:<col>: <message>`, the line, and a caret under the column.
184+
185+## Printed formats
186+
187+Note 4 has examples of each.
188+
189+- **Tokens**: one per line, `<line>:<col>`, then `tight` if the token follows the previous one on its line with no space between, then its kind and text.
190+- **Trees**: S-expressions, `(kind line:col fields kids)`, with each node's start; a node whose kids are all leaves prints on one line. Past 64 levels the indent stops growing, so the printed tree stays linear in the text's size.
191+- **Errors**: as above. Control characters print as spaces in the excerpt, so the caret stays under its column.
192+
193+## Tests
194+
195+`tools/golden` runs `+golden` under `urbit eval` on every case and compares `tokens.txt` and `tree.txt`; opted-in cases also compare `+golden-types` with `types.txt`. `tools/ship gen-tests` writes a `-test` arm per case that does the same on the ship. The type output is provisional until the checker can check complete modules and imports.
196+
197+## Speed
198+
199+Starting `urbit eval` and building the library takes about 8 s. A 2,000-line module of 400 definitions then parses in about a second. Loops over definitions, arms, lines and items are tail calls, so a long module grows no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (note 3).
200+
201+The experimental deferred constructor path can close a small import-free library transaction when ordinary resolution stalls. It retries definitions whose earlier attempts failed from their original states, retaining only successful attempts. A transaction with at most 64 definitions makes at most 4,096 attempts; it stops after a pass with no progress. This bounds the new attempt count, not each attempt's parsing, type walks or ordinary inference. Deferred definitions are restricted to simple one-component wings, literals, static strings, gates, transparent groups and empty bodies, calls, casts and a restricted boolean branch. Each successful call or cast fit must have exactly equal normalized operands so later substitutions cannot invalidate a face check. A multi-argument call also needs closed argument, sample and product types because positional face checks depend on slot boundaries and whether the result can be a cell. Other fits fail closed. A 512-node screen bounds visited expression nodes and a separate 512-node scan bounds each stability check; neither bounds mold shapes, string-piece checks, parsing, normalization, lookup, or total repeated inference. It accepts only a direct constructor callback with a closed input, records its pending fit under the source-owned inference state, and generalizes each definition against the live environment and pending constraints. Before publication it discharges and replays every edge, rejects unresolved tags or changed replay state, and checks that all molds and values are complete. The reporter reads the committed schemes for definitions added by the transaction. API and store paths, `main`, prepared-prelude recovery, imports, recursive groups, unresolved holes or written capitals, and new projection actions remain outside this full-module path. `%grec` in the constraint or freshness scan is conservatively unsupported. This is not an island-kind, runtime, or watchability check.
202+
203+An expected cell type can supply context to both arms of a loobean branch. This slice first retains any ordinary inference that already fits. Otherwise it retries from the original state only when a syntax screen excludes nested branches, casts, gates and local bodies, and a substitution screen excludes structural bindings. Both arms must fit, their normalized results and the expected type must be closed, their result types must match, and both fits must replay without changing the final substitution or fresh-ID counter. A successful retry retains the original arm type and its written faces; a failed retry returns the original inference result. The source and substitution screens each visit at most 512 entries. This permits at most one extra attempt for an eligible branch; the screens do not bound preexisting inference, type walks, list construction, or work across separate analyses.
204+
205+In an isolated diagnostic with the real todo API and reader inputs, this cell context allowed the original update body to infer when its result type was written explicitly and experimental source-defined text helpers were supplied. The unchanged island still needs those text helpers, an actual source-backed `program` and UI interface, context propagation across definitions, island-kind checking and watchability proof. This branch change itself provides no runtime implementation or watchability evidence.
206+
207+A deferred boolean branch must use both distinct literal loobean patterns. Its subject is unified with `?`; the arms are inferred in source order without contextual retry. Equal normalized arm types are retained directly. When both written arms are direct literals that each created their own unbound pending tag, the checker can instead retain two source-owned fit obligations to a shared, monomorphic result variable. A later definition may close that variable; replay uses the ordinary literal fit, requires a closed atomic target or a union of direct constant/cell cases, and rejects faced targets and faced union cases. It replays all edges under the final substitution without adding bindings or fresh IDs. This does not support deferred list literals, union-pattern reachability, arbitrary branch expressions or prepared-prelude/imported modules. It does not establish request watchability.
208+
209+With the caller's unchanged prepared prelude, the partial report can also recover a narrow import-free, non-main ordinary library initializer. A direct tuple literal may retain one source-owned fit obligation for each newly created pending literal until a later exact result cast closes them. A separate bounded candidate screen admits a direct tuple even without a constructor call. The prepared transaction requires exact agreement among the supplied interface, value inventory and reserved molds, and retains the API, store, import and `main` exclusions. It only adds recovered entries to the partial report: the ordinary full-module resolver does not publish them. Wrong unit or draft fields, unrelated pending tags and mold-name collisions fail closed; without the later final cast, the initializer remains not checked. This does not add list-literal deferral or import-aware recovery.
210+
211+Before the no-prepared-prelude fallback, the checker screens the already parsed source for a direct single-constructor call beneath groups, gates, casts or bodies without local definitions. The screen visits at most 64 AST nodes per definition and rejects sources with more than 64 definitions or 65,536 bytes. A transaction is attempted at most once per resolver or report invocation and holds at most 64 pending edges. These limits do not bound the initial parsing, ordinary resolution, normalization, or total work across separate analyses. On the pre-recursive-index snapshot, startup-inclusive synthetic 1,000-gate comparisons had baseline/candidate user times of 25.97/29.30 seconds and 26.30/27.46 seconds in reverse order. These are limited shared-load measurements, not production benchmarks. The trimmed source-backed and direct-guard fixture passed in 28.13 seconds wall and 27.53 seconds user on one run after screening; its cases include parse-success checks in the same transaction source pass. The outer resolver and reporter each parse independently, and a fallback currently parses the source again.
212+
213+A single sequential, startup-inclusive comparison against checkpoint `c96597d` measured user CPU for an unrelated stalled library at 25.04 seconds baseline and 26.32 seconds with the screened fallback; an incompatible constructor took 25.72 and 27.16 seconds; a direct constructor that the baseline declined and the candidate resolved took 24.46 and 26.79 seconds. These are small shared-load measurements, not a production benchmark. The screen was separately checked with a trapping fallback: the unrelated source skipped it, while the eligible conflicting source reached it.
docs/development.mdnew file+227
@@ -0,0 +1,227 @@
1+# Development
2+
3+How to work on Jibb: the rules the plan sets, how to set up a machine, and what to run before pushing. The repo's [README](../README.md) describes each tool in full.
4+
5+## Ground rules
6+
7+From the plan's Setup and ground rules, and from @iko:
8+
9+- **The doc wins.** Where code and doc disagree, the doc stands until it changes. [spec/](spec/) is a snapshot; the doc itself is the authority.
10+- **Language changes are agreed first** and recorded in the Decisions tab, before the code changes.
11+- **Questions go to @iko**, as comments on the doc, on the words they're about. While one is open, follow the most likely reading, mark it "(doc question)" in the library's notes, and list it in [open-questions.md](open-questions.md). Where an error points is not a doc question: the library's section 2.0 settles it.
12+- **Every Jibb code block in the doc is a golden test**, and each stage's output is printed and compared. The doc labels its Jibb blocks `jibb`; `tools/doc-blocks` checks that each has its case.
13+- **Each milestone ends with its checks passing on a fake ship**, not only under `urbit eval`.
14+- **Push straight to `master`.** @iko reviews work in the project's chat, not in pull requests, so there are none. Run the checks below first.
15+- **Keep docs/ current**: [status.md](status.md) when a milestone moves, [open-questions.md](open-questions.md) when a question is settled or found.
16+
17+The source-backed generic-union guard can be run under eval with `tools/type-union-source-test`; its `test-union-source` arm is also assembled for the fake ship. It checks a bounded partial inference slice, not general union completeness. `tools/type-union-alias-overlap-test` exercises the separate positive overlap witness and its shared ship test arm. `tools/type-full-overlap-test` checks structured full-module overlap evidence and the legacy error text under eval; both of its test arms are assembled for the fake ship.
18+
19+## Setting up a machine
20+
21+The tools need Python 3 and `urbit` (vere) on `PATH`; the ship tools also need a fake `~zod` and click. Everything so far ran with vere 4.6 on Linux.
22+
23+On a usual machine:
24+
25+1. Install vere as [docs.urbit.org](https://docs.urbit.org) says, and get a brass pill.
26+2. Boot a fake ship where `tools/ship` expects it, or point `--pier` or `$JIBB_PIER` elsewhere. Booting takes a few minutes:
27+ ```
28+ mkdir -p /root/urbit && cd /root/urbit
29+ urbit -F zod -B brass.pill -t -x -c zod
30+ ```
31+3. Get click, the command-line client for a ship's `conn.sock`, from [urbit/tools](https://github.com/urbit/tools), at `/root/src/tools/pkg/click/click` or wherever `--click` or `$JIBB_CLICK` says.
32+4. Optionally, clone [urbit/urbit](https://github.com/urbit/urbit) to read Arvo's source. `vendor/SOURCES.txt` names the commit the vendored files come from.
33+
34+In a Claude cloud container, the network blocks urbit.org, bootstrap.urbit.org, nixos.org's installer and GitHub's release downloads. This worked on 2026-10-29, and has to be redone in each new container:
35+
36+```
37+# Nix, single-user
38+curl -sSfL -o install https://releases.nixos.org/nix/nix-2.32.4/install
39+mkdir -p /etc/nix && printf 'build-users-group =\nsandbox = false\n' > /etc/nix/nix.conf
40+sh ./install --no-daemon --no-channel-add --yes
41+. /root/.nix-profile/etc/profile.d/nix.sh
42+
43+# vere, from nixpkgs
44+nix build -I nixpkgs=https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz \
45+ --impure --expr 'with import <nixpkgs> {}; urbit'
46+# then put result/bin/urbit on PATH
47+
48+# the brass pill, from Git LFS
49+mkdir -p /root/urbit && cd /root/urbit
50+curl -sSfL -o brass.pill https://media.githubusercontent.com/media/urbit/urbit/master/bin/brass.pill
51+urbit -F zod -B brass.pill -t -x -c zod
52+
53+# click
54+git clone https://github.com/urbit/tools /root/src/tools
55+```
56+
57+`echo '(add 2 2)' | urbit eval` checks that vere works without a ship.
58+
59+## The tools
60+
61+| Tool | What it does |
62+| --- | --- |
63+| `tools/golden` | Runs the golden cases under `urbit eval`: every case, or those matching `--case`; `--update` rewrites the expected outputs; `--show` prints them |
64+| `tools/importer-test` | Compares the partial Hoon importer's diagnostic trees and errors with `tests/importer/tree.txt` under `urbit eval` |
65+| `tools/type-import-default-test` | Compares default-wrapped union source proofs and adversarial cases under eval; the same golden runs on the ship |
66+| `tools/type-import-test` | Composes the Hoon importer with the partial checker and compares `tests/type-import/expected.txt` under eval |
67+| `tools/type-import-overlap-test` | Checks source-aware Hoon union overlap, provenance and proof-budget controls under eval; the same fixture runs on the ship |
68+| `tools/type-import-structural-test` | Checks multi-case and nested Hoon union overlap witnesses under eval and on the ship |
69+| `tools/type-union-source-test` | Checks bounded local generic-alias disjointness and state guards under eval and on the ship |
70+| `tools/type-union-alias-overlap-test` | Checks source-backed generic-alias overlap witnesses under eval and on the ship |
71+| `tools/type-full-overlap-test` | Checks structured full-module overlap evidence and imported-source attribution |
72+| `tools/type-tlon-test` | Runs the real Tlon presence source through the importer and partial checker, comparing `tests/type-tlon/expected.txt` under eval |
73+| `tools/type-import-diagnostic-test` | Compares the structured reader diagnostic bridge report under eval |
74+| `tools/type-mark-test` | Checks the partial checker’s mark import boundary against `tests/type-mark/expected.txt` under eval |
75+| `tools/type-poke-test` | Checks source-backed prelude and poke-only API reports against `tests/type-poke/expected.txt` under eval |
76+| `tools/type-api-paths-test` | Checks partial API path analysis with real todo mark samples against `tests/type-api-paths/expected.txt` under eval |
77+| `tools/type-api-evidence-test` | Runs source, scope, reader-result and declaration-watchability evidence guards under eval and on the ship |
78+| `tools/type-hole-guards-test` | Runs the shared hole-defaulting and API interface guards under eval; the same checks run on the ship |
79+| `tools/type-list-alias-test` | Runs the shared prelude list-alias and provenance guards under eval and on the ship |
80+| `tools/type-generic-recursion-test` | Checks source-backed generic recursive identity and provenance under eval and on the ship |
81+| `tools/type-generic-construction-test` | Checks source-backed one-layer recursive construction, provenance and fuel under eval and on the ship |
82+| `tools/type-generic-pattern-test` | Checks source-backed recursive patterns, catch-all coverage, state and per-attempt fuel/arm limits under eval and on the ship |
83+| `tools/type-deferred-test` | Checks the bounded source-owned deferred inference transaction under eval and on the ship |
84+| `tools/type-deferred-resolver-test` | Checks deferred resolution, report consistency and atomic failure under eval and on the ship |
85+| `tools/type-deferred-context-test` | Checks deferred source order and literal branch contexts under eval and on the ship |
86+| `tools/type-deferred-prepared-test` | Checks prepared-prelude tuple initializer recovery, exact partial reports and fail-closed guards under eval and on the ship |
87+| `tools/type-cell-branch-test` | Checks closed-cell branch context, rollback and bounded retry screens under eval and on the ship |
88+| `tools/type-generic-alias-test` | Runs public/private generic union alias and provenance guards under eval and on the ship |
89+| `tools/type-positional-face-guards-test` | Runs positional-call and nested-face guards under eval and on the ship |
90+| `tools/type-qath-guards-test` | Runs source-provenance, recursive unfolding and face guards under eval and on the ship |
91+| `tools/type-todo-partial-test` | Reports partial inference of the unchanged todo island through the real API and readers under eval and on the ship |
92+| `tools/type-todo-api-test` | Exercises the actual todo API through the real Hoon readers and partial checker |
93+| `tools/type-direct-gate-test` | Checks a synthetic source-backed program report and direct gate provenance under eval and on the ship |
94+| `tools/type-program-main-test` | Checks the narrow closed subscription-free program-main interface, downstream import and rejection guards under eval and on the ship |
95+| `tools/type-program-init-test` | Checks transactional direct-program initializer recovery, exact exported/imported types and fail-closed boundaries under eval and on the ship |
96+| `tools/type-program-update-test` | Checks transactional direct-program update result recovery, union/boolean context, exact exported/imported types and fail-closed boundaries under eval and on the ship |
97+| `tools/type-program-watch-test` | Checks direct singleton request-value watchability against merged real-todo evidence, exact types/imports and rejection boundaries under eval and on the ship |
98+| `tools/type-closed-gate-guards-test` | Checks closed gate sample labels and face uncertainty under eval and on the ship |
99+| `tools/type-constructor-fit-guards-test` | Checks constructor-case uncertainty and known mismatches under eval and on the ship |
100+| `tools/type-nested-union-guards-test` | Checks nested tagged-union case selection and uncertainty under eval and on the ship |
101+| `tools/type-empty-test` | Checks source-backed empty molds, inhabitedness, coverage and proof budgets under eval and on the ship |
102+| `tools/type-gate-free-guards-test` | Checks bounded gate-free verdicts, inhabitation and witness paths under eval and on the ship |
103+| `tools/type-gate-free-source-test` | Checks source-backed todo mold analysis through the real readers under eval and on the ship |
104+| `tools/type-sub-guards-test` | Checks source-backed subscription mold dependencies under eval and on the ship |
105+| `tools/type-ask-guards-test` | Runs ask origin and canonical list/unit bootstrap guards under eval and on the ship |
106+| `tools/type-request-guards-test` | Runs request evidence, source consistency and cache provenance guards under eval and on the ship |
107+| `tools/type-proj-guards-test` | Runs projection evidence, name-scope and dependency guards under eval and on the ship |
108+| `tools/type-arithmetic-guards-test` | Runs restricted atom-variable, unification and projection guards under eval and on the ship |
109+| `tools/type-module-scope-test` | Checks the partial module checker’s prelude boundary and duplicate-source rejection against `tests/type-module-scope/expected.txt` under eval |
110+| `tools/clay-fixtures` | Syncs `my-app`, builds its example `/sur` files and marks through Clay, checks selected mold and mark projections and the partial checker, and records Ford and mark subject shapes on the fake ship |
111+| `tools/hoon` | Evaluates Hoon with the library in scope, as `tools/hoon '(golden /a/b/jibb (crip "++ main view"))'`; `--cord name=file` binds a file's text, `-f` reads the expression from a file |
112+| `tools/doc-blocks` | Checks the doc's `jibb` blocks against the `doc-*` golden cases: `tools/doc-blocks docs/spec` |
113+| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
114+| `tools/testdata/selftest` | Tests `tools/golden` and `tools/hoon` against a stub library, and `tools/doc-blocks` against Markdown it writes |
115+| `tools/testdata/ship-selftest` | Tests `tools/ship`'s test generator and runner against a stub library on the ship |
116+| `tools/testdata/clay-fixtures-selftest` | Tests temporary Clay fixture cleanup and signal handling without a ship |
117+
118+`tools/golden` starts `urbit eval` once and builds the library, which takes about 8 s, then runs every case under `mule`, so a crash fails only its own case.
119+
120+## Before pushing
121+
122+```
123+tools/golden # all cases pass
124+tools/golden --case types-prelude-ui # exact UI/program/page schemes and composition
125+tools/importer-test # Hoon importer fixture projections match
126+tools/type-import-default-test # default-wrapped source proofs match
127+tools/type-import-test # importer/checker bridge golden report matches
128+tools/type-import-overlap-test # source-aware Hoon overlap and provenance controls
129+tools/type-import-structural-test # nested and multi-case Hoon overlap controls
130+tools/type-union-source-test # local generic-alias union guards
131+tools/type-union-alias-overlap-test # local generic-alias overlap diagnostics
132+tools/type-full-overlap-test # full-module overlap evidence
133+tools/type-tlon-test # real Tlon importer/checker report matches
134+tools/type-import-diagnostic-test # direct structured reader diagnostics match
135+tools/type-mark-test # mark/checker bridge golden report matches
136+tools/type-poke-test # source-backed poke/API bridge report matches
137+tools/type-api-paths-test # partial API path analysis report matches
138+tools/type-api-evidence-test # API declaration evidence guards pass
139+tools/type-hole-guards-test # hole defaulting and API guards pass
140+tools/type-list-alias-test # prelude list-alias guards pass
141+tools/type-generic-alias-test # generic union alias guards pass
142+tools/type-positional-face-guards-test # positional sample face guards pass
143+tools/type-qath-guards-test # qath source and unfolding guards pass
144+tools/type-todo-partial-test # unchanged todo partial report and reader failure controls
145+tools/type-todo-api-test # real todo API partial inference and reader guards pass
146+tools/type-direct-gate-test # direct gate source and provenance guards pass
147+tools/type-program-main-test # closed program-main interface and rejection guards pass
148+tools/type-program-init-test # transactional direct-program initializer context guards pass
149+tools/type-program-update-test # transactional direct-program update context guards pass
150+tools/type-generic-recursion-test # source-backed recursive identities and provenance
151+tools/type-generic-construction-test # source-backed recursive construction and bounds
152+tools/type-generic-pattern-test # source-backed recursive patterns and bounds
153+tools/type-deferred-test # source-owned deferred inference guards
154+tools/type-deferred-resolver-test # resolver consistency and failure guards
155+tools/type-deferred-context-test # deferred source-order and branch guards
156+tools/type-deferred-prepared-test # prepared initializer reports and failure guards
157+tools/type-cell-branch-test # contextual branch rollback and bounds
158+tools/type-closed-gate-guards-test # closed gate fit guards pass
159+tools/type-constructor-fit-guards-test # constructor fit guards pass
160+tools/type-nested-union-guards-test # nested union selector guards pass
161+tools/type-empty-test # empty mold and uninhabited-case guards pass
162+tools/type-gate-free-guards-test # bounded gate-free classifier guards pass
163+tools/type-gate-free-source-test # real todo mold analysis and source guards pass
164+tools/type-sub-guards-test # subscription source guards pass
165+tools/type-ask-guards-test # ask source and bootstrap guards pass
166+tools/type-request-guards-test # request evidence and cache guards pass
167+tools/type-proj-guards-test # projection evidence and scope guards pass
168+tools/type-arithmetic-guards-test # arithmetic constraint guards pass
169+tools/type-module-scope-test # module/prelude scope golden report matches
170+tools/hoon check-spans-test # prints <<>>
171+tools/hoon itype-unify-test # type-unification controls pass
172+tools/hoon -f tools/testdata/zing-hoon-reference.hoon # Hoon translation agrees on four inputs
173+tools/hoon -f tools/testdata/lead-late-hoon-reference.hoon # Hoon translation agrees on selected inputs
174+tools/hoon -f tools/testdata/succ-hoon-reference.hoon # Hoon translation agrees on selected inputs
175+tools/testdata/selftest # 22 checks, 0 failed
176+tools/doc-blocks docs/spec # every jibb block has its case
177+tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
178+tools/ship test # the cases pass as -test arms on the ship
179+tools/testdata/ship-selftest # when tools/ship changed
180+tools/testdata/clay-fixtures-selftest # scratch fixture cleanup without a ship
181+tools/ship check-commit # when the mark or the desks changed
182+tools/clay-fixtures # builds example fixtures and real Tlon notes through Clay
183+```
184+
185+`tools/ship test` regenerates `tests/lib/jibb.hoon` and syncs the `jibb-dev` desk before it runs, so commit the regenerated file. Sync preflights and splits large deletion lists into bounded click requests, waiting for each Clay revision; a failure stops later batches. The ship self-test exercises this when switching from the full desk to a smaller fixture desk. A run with `--stub`, `--lib`, or a custom `--golden` isolates its generated golden tests from the repository's other test programs; run the default command afterward to restore and test those programs. It also runs the independent `tests/lib/jibb-import.hoon` test against the same importer fixtures and expected diagnostic projection as `tools/importer-test`. The projection is an internal tree, not the Jibb type printer. `tests/lib/jibb-bridge.hoon` also runs the importer/checker bridge fixture on the ship; `tools/type-import-test` runs the same report under eval. `tests/lib/jibb-tlon-bridge.hoon` and `tools/type-tlon-test` run the real Tlon presence reader/checker fixture on both. The structured reader diagnostics have their own `tests/lib/jibb-import-diagnostic.hoon` ship test and `tools/type-import-diagnostic-test` eval test. The mark bridge has its own `tests/lib/jibb-mark-bridge.hoon` ship test and `tools/type-mark-test` eval test; both compare the same fixture report. `tests/lib/jibb-poke-bridge.hoon` and `tools/type-poke-test` share the source-backed prelude and poke-only API fixture. `tests/lib/jibb-api-paths.hoon` and `tools/type-api-paths-test` share partial path analysis over the real todo marks; this does not generate request interfaces. `tests/lib/jibb-module-scope.hoon` and `tools/type-module-scope-test` compare the prelude scope report on the ship and under eval.
186+
187+## Golden cases
188+
189+A case is a folder `tests/golden/<name>/` holding:
190+
191+- `source.jibb`, the input, ending in one newline;
192+- `about.txt`: a `source:` line with the doc's words or block it comes from, a `tests:` line saying what it exercises, and an `expect:` line, either `parses` or `error at <line>:<col>` and why (one case, `inline-leftout-signed-float-auras`, says `unclear`: see grammar question 13 in [open-questions.md](open-questions.md));
193+- the expected outputs, `tokens.txt` and `tree.txt`, each the output plus one newline.
194+- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
195+- optionally, an `expect-types:` line in `about.txt` opts the case into `+golden-types`; `types.txt` holds its output plus one newline and `--update` creates it. A `types.txt` also opts in when the line is absent. This interface is provisional while the checker is under construction.
196+- optionally, `imports.txt` selects Hoon `/sur` molds, one `module mold` pair per line. Each module's source goes in `sur/<module>.txt` and is compiled against zuse by both runners. `marks.txt` selects marks, one name per line, with source in `mar/<name>.txt`; both kinds may be supplied together. The reader results go to the partial checker, and a type output is required. Both runners reconstruct fixture text from `%txt` lines and identify the fixture if its compilation crashes; a crash fails the case without discarding its successful parse output. These fixtures currently handle only sources without Ford imports.
197+- optionally, `modules.txt` lists logical `/ui/.../*.jibb` paths, one per line. The corresponding sources live below the case's `modules/ui/` directory. Both runners parse each source at its logical path and compare the combined `module-trees.txt`; `--update` writes that output. A case with type output also supplies these sources and the vendored prelude to the partial module checker. The file opts in even when it lists no sources; use a comment such as `# no module fixtures` for an empty bundle, since zero-byte `%txt` fixtures do not sync reliably on the ship. Blank lines and comment lines are ignored. Cases without `modules.txt` keep their existing no-prelude type interface.
198+
199+The runners prepare the trusted vendored public and internal prelude sources once for their generated test core and share the partial interface. Preparation reserves all names present in the public source and supplies the molds and values the fragment can infer; an unsupported declaration remains reserved but unavailable. The source and checker are incomplete, so the output still says the module has not been checked and does not claim complete shadowing coverage. `+golden-types-with-prelude-and-internal` accepts both sources directly; callers using `+golden-types-with-prepared-prelude` pass the unchanged result of `+prepare-prelude-with-internal`. The older source-only entry points remain available for preludes without imports. Missing or malformed sources fail closed.
200+
201+A zero-byte mark fixture currently fails ship synchronization validation after commit. Use a newline-only fixture to test an empty Hoon source on the ship.
202+
203+Names say what a case is for:
204+
205+| Name | For |
206+| --- | --- |
207+| `lex-<rule>-ok-<n>`, `lex-<rule>-bad-<n>` | A lexical rule, kept or broken |
208+| `inline-<topic>` | Any other rule, often from one sentence of the Grammar tab |
209+| `doc-<tab>-<n>-<what>` | The doc's `<n>`th code block of the tab, counting every block, labelled or not |
210+
211+Write `source.jibb` and `about.txt` by hand, run `tools/golden --update --case <name>`, and read the outputs against `about.txt` before committing. A changed output on purpose is reviewed with `git diff tests/golden`.
212+
213+## Code conventions
214+
215+`jibb-dev/lib/jibb.hoon` is one core with no Ford runes, so `urbit eval` can run it and Clay can build it. Its design notes open the file in numbered sections; keep them true when the code changes, since they are where the reasoning lives. [compiler.md](compiler.md) maps the file.
216+
217+- An arm's comment is `:: +name: what it is`, then details indented by four spaces.
218+- Types avoid the standard library's names (`mold`, `wing`, `gate`), hence `+shape` for a mold as written. Every type in a recursive cycle has a `$~` default that is a leaf, or Hoon can't build its default.
219+- Two arms do shadow the standard library: `+in`, a bit test, hides the set door `in`, and `+fail` hides Hoon's parser rule `fail`. Inside the library, and under `tools/hoon`, write `~(has in:..zuse s)`, or rename `+in` before code there uses sets.
220+- The parser's errors read "expected <what>, found <token>", with an optional "; <hint>"; the layout pass's state the rule broken, as "a tab: Jibb uses spaces only". No final period, lowercase except for names, and the code the error is about in backticks; example code in a hint, as m(done=%.y), isn't quoted so far. Their wording is fixed by the golden tests once written.
221+- Loops over many items are tail calls, so long inputs grow no stack; check new passes on a long module.
222+
223+## Commits
224+
225+A short subject in the imperative, then a body that says what changed and why, wrapped at 72 columns, as in `git log`. Each commit leaves every check passing.
226+
227+`tools/type-deferred-test` exercises the bounded, source-owned constructor transaction and low-level freshness/replay guards. `tools/type-deferred-resolver-test` checks the experimental import-free library resolver, report consistency, atomic failure, and that both source orders of a late face constraint decline. `tools/type-deferred-prepared-test` checks the separate partial-report-only prepared-prelude route, direct tuple-literal obligations, exact report types and its wrong-field, unrelated-tag, mold-collision and no-final-cast controls. These checks do not establish island-kind or watchability support.
docs/open-questions.mdnew file+89
@@ -0,0 +1,89 @@
1+# Open questions
2+
3+Questions the doc doesn't settle yet, as of 2026-10-30. Language questions belong to the doc's author, @iko: the plan says they go "as comments on the doc, on the words they're about", and a change to the language is "agreed first and recorded in Decisions". When one is settled, record it there, change the code if needed, and remove it here.
4+
5+## The plan's open questions
6+
7+From [spec/implementation-plan.md](spec/implementation-plan.md), Open questions:
8+
9+| Question | Needed by |
10+| --- | --- |
11+| What is the typography scale for heading levels and the `role` values? | Milestone 4 |
12+| Does the Eyre channel CSRF test reproduce on a fake ship? @iko has the write-up; if it does, it goes to Urbit privately. | Milestone 4 |
13+| What is the benchmark's bar? Proposed: a keystroke in a 500-row list island renders within one 16 ms frame on a mid-range phone. | Milestone 6 |
14+| Are the proposed loop rules adopted, along with no overlays in v1? | Milestone 6 |
15+| What do controls look like by default: buttons, toggles and fields, with their focus and disabled states? | Milestone 6 |
16+
17+On 2026-10-30, @iko adopted gate-free `eq` arguments and map and set keys, treating gates as opaque when distinguishing union cases, and rejecting a non-gate value that depends on itself even through a gate. The checker infers and generalizes the gate-free constraint. @iko also said jetted prelude functions may take gates.
18+
19+## Questions milestone 2 raises
20+
21+Found while writing [prompts/milestone-2.md](prompts/milestone-2.md), checking it against the doc's examples, and building the checker. The numbering is retained so existing references stay valid. Question 3 remains open; the field-order detail in question 32 is being clarified. The other questions are settled.
22+
23+1. **Settled: how the prelude identifies jetted functions.** On 2026-10-30, @iko said the prelude functions have working Jibb implementations, and the compiler recognizes their shapes and uses the Hoon versions so jets can fire.
24+2. **Settled: how the prelude keeps helpers private.** On 2026-10-30, @iko chose a separate internal prelude module imported by the prelude, without exposing the imported helpers.
25+3. **The prelude's inventory.** On 2026-10-30, @iko chose to include all names from the listed Hoon library sections, excluding groups the spec explicitly leaves out. All of 3g is included; its Hoon `tone` is exposed as `tone.hoon`, distinct from the styling type. Hoon 1c `step` is exposed as `step.hoon`, leaving the Grammar example's `step` name available. On 2026-10-30, @iko also approved `%$` as a term literal and pattern, so Jibb can write the `%$` case of Hoon `coin`. For parsing sections 4j and 4l, only the explicitly listed `slav` and `slaw` are included; other parser helpers are left out. Jibb's `not` negates a loobean, and Hoon's bitwise `not` is exposed as `not.bit`. @iko also agreed to specifying the complete exported inventory in the doc, building its types and gates needed by the examples in milestone 2, and doing native implementations in milestone 3. Prelude unions such as spaces, roles and tones need names that other modules cannot shadow. The actual inventory and signatures still need to be specified.
26+4. **Settled: a capital in a local `++`.** On 2026-10-30, @iko said it shares the enclosing `++`'s variable of that name if the enclosing `++` also uses it; otherwise the local `++` introduces and generalizes its own variable. For example, `++ inner |= y=A y` shares `A` with an enclosing gate whose sample is `x=A`, but generalizes its own `A` if the enclosing `++` does not use `A`. A different type uses a different capital. The Grammar and Decisions record this alongside the earlier aura rules.
27+5. **Settled: cells of no items or one.** On 2026-10-30, @iko said a single-item cell is the value and `[]` is an error. The theme's `dark=[tones=[…]]`, a record of one field, must still check.
28+6. **Settled: a change with no items.** On 2026-10-30, @iko said `m()` is an error. The parser still accepts it; the checker needs to reject it and add a golden case.
29+7. **Settled: the doc's blocks that aren't whole modules.** On 2026-10-30, @iko agreed to check each in its intended context: the `cmd` and `sub` definitions as prelude source, the Core language tab's `update` inside the todo island, and the Grammar's imports example against fixture files.
30+8. **Settled: tuples and records.** On 2026-10-30, @iko agreed that an unnamed position can unify with a faced position and take its face; two different explicit faces still conflict. The Grammar and Decisions record this rule.
31+9. **Settled: values where `*` is expected.** On 2026-10-30, @iko said `*` is the noun type, not a type variable; generic positions use proper type variables. A value already known to be `@ud` can be passed where `*` is expected. The `each` and `table` signatures use `key=K`.
32+10. **Settled: navigation commands.** On 2026-10-30, @iko chose separate declarations for application paths and unchecked cords, with `link-unsafe`, `image-unsafe` and `go-unsafe` for the unchecked forms. `image-unsafe` takes a sized URL record. Both navigation declarations produce `[%go url=@t]`; `go` converts the application path to a cord including the app's base path.
33+11. **Settled: stores and derived gates.** On 2026-10-30, @iko said a store's `+$ poke` is a declaration, like an API file's, not a mold; a derived name clashes with an import face; and an island watching a request whose case has a separate `scry=` path has a type error. The todo API's request is renamed `todo-by-id` so it does not clash with `/- todo`. The checker must account for the fact that a store's kind is determined by the type of `main`.
34+12. **Settled: how to print a union without a name.** On 2026-10-30, @iko said to print its cases separated by spaces, as `%approve %deny`. This is print-only, not Jibb syntax.
35+13. **Settled: how to print type constraints.** On 2026-10-30, @iko chose `$-([A A] A) where A is an atom` for an atom constraint and `$-([A A] ?) where A contains no gates` for a gate-free constraint. Multiple clauses are comma-separated, as `where A is an atom, B contains no gates`.
36+14. **Settled: how the prelude implements foundational operations.** On 2026-10-30, @iko chose private low-level primitives in the internal prelude module, with the public foundational gates implemented in Jibb on top of them.
37+15. **Settled: unrestricted atoms and shared auras.** On 2026-10-30, @iko said `@` means any atom, independently at each occurrence, so Hoon `dime` and `pint` keep their bare-`@` fields. A specific atom such as `@ud` fits where `@` is expected; an `@` value needs a check to fit `@ud`. Shared atom types use one capital, with the atom constraint inferred from its body, as for `add` taking `[A A]` and returning `A`.
38+16. **Settled: loobeans in union disjointness.** On 2026-10-30, @iko said `?` counts as its two atoms, `%.y` and `%.n`: it is disjoint from any cell and overlaps the constants 0 and 1.
39+17. **Settled: empty cases in union disjointness.** On 2026-10-30, @iko said `!!` is disjoint from every case. A cell containing an empty position at any depth is itself empty and is also disjoint from every case.
40+18. **Settled: the value gate `like`.** On 2026-10-31, @iko chose a gate `(like convert result)` that maps the product of an existing `(like A)` result with `convert=$-(A B)`, yielding `(like B)` while preserving its position and remaining input. An absent result stays absent. The `(like A)` mold remains available in the separate mold namespace. Hoon's wet `+like` instead builds a gate that constructs a result from an input noun; the chosen Jibb value gate is an adaptation of that behavior.
41+19. **Settled: Hoon aura families and `step.hoon`.** On 2026-10-30, @iko chose `step.hoon` for Hoon 1c `step`, avoiding a clash with the Grammar example's `step`, and chose one-way widening across Hoon aura families: for example, `@ud` and `@ux` fit `@u`, and `@tD` fits `@t`. The reverse needs a check. The `step.hoon` group representation is not implemented yet.
42+20. **Settled: the type of `clap`.** On 2026-10-30, @iko chose one shared value type for both units and the combining gate. If either unit is absent, `clap` returns the other; if both are present, it applies the gate to their values and wraps the result.
43+21. **Settled: duplicate faces in imported Hoon records.** On 2026-10-30, @iko chose to reject an imported Hoon record with duplicate field names where its type is used. Hoon permits `[a=@ud a=@t]` and picks the first `a`; Jibb rejects it.
44+22. **Settled: overlapping imported `$%` and `$?` cases.** On 2026-10-30, @iko confirmed that the general union disjointness rule rejects imported `$%` and `$?` cases that overlap as nouns where the type is used, as it does for `$^`. The importer rejects recognizable overlaps and fails closed when it cannot verify them.
45+23. **Settled: converging explicit capitals.** On 2026-10-30, @iko chose that a body cannot force two separately written capitals to be equal. For `++ repeated |= x=(choice A A) x`, `++ f |= x=(choice A B) (repeated x)` is an error; use `A` in both positions when the type must be shared. This also applies across local captures and within generic mold applications.
46+
47+24. **Settled: how the internal prelude provides `poke`.** On 2026-10-31, @iko chose to define `poke` in the source-backed private internal prelude module and re-export it through the public prelude as an ordinary transparent type. Ordinary modules can construct and inspect its values. This settles `poke`; it does not decide the representation of `ask` or `qath`.
48+
49+25. **Settled: how the prelude provides `ask` and `qath`.** On 2026-10-31, @iko chose ordinary transparent types defined in the internal prelude and re-exported normally, as for `poke`. Callers may construct and inspect their values.
50+
51+26. **Settled: the `step` example's `at` binder.** On 2026-10-31, @iko chose to rename the `describe` pattern binder to `sent-at`, keeping Hoon's `at` in the prelude and the no-shadowing rule.
52+
53+27. **Settled: duplicate fields in a Jibb-written record.** On 2026-10-31, @iko chose to reject duplicate field names, as for imported Hoon records.
54+
55+28. **Settled: arithmetic on loobeans.** On 2026-10-31, @iko chose to reject loobean operands for arithmetic. Comparison may still accept loobeans and returns `?`. The checker needs to retain this constraint through inference, generalization and instantiation before it exports `add` or `dec`.
56+
57+29. **Settled: printing the arithmetic atom constraint.** On 2026-10-31, @iko chose `where A is an atom other than ?` for a generic arithmetic type whose atom variable excludes loobeans.
58+
59+30. **Settled: a hole inferred as a generic variable.** On 2026-10-31, @iko said a hole resolved to an explicitly written type variable counts as inferred: in `++ id |= x=A ^- _ x`, the result hole is `A`. Named molds must determine their own holes without constraints from later uses; an unconstrained hole is an error.
60+
61+31. **Settled: uses of a value with a hole.** On 2026-10-31, @iko said a value definition must determine its own holes; another definition's use cannot fix an otherwise unresolved hole. For example, `++ id |= x=_ x` remains an error even if a later definition calls `id` with a cord.
62+
63+32. **Partly settled: type-directed record projection.** On 2026-10-31, @iko chose an explicit `(proj record)` whose expected result type selects the fields. There is no automatic projection, and `proj` is reserved against definitions and imports. The result contains exactly the fields of its expected type. Whether the result may reorder fields from the source remains open.
64+
65+33. **Settled: watching a request with unknown provenance.** On 2026-10-31, @iko said an island may watch a request only if the checker proves it watchable at compile time. An unknown request, including one built or passed through a gate without sufficient evidence, is rejected rather than deferred to a runtime check.
66+
67+34. **Settled: constructors and equal noun literals.** On 2026-10-31, @iko said expressions with the same runtime representation count as equal, and cases that cannot be distinguished at runtime are rejected at compile time. Thus `|=%$` matches a case headed by `%$`, `%.y` or `~`: each is the noun 0. Cases with equal heads and overlapping payloads cannot coexist in a union.
68+
69+## Grammar questions never put to the doc's author
70+
71+In milestone 1 the parser met about thirty places where the doc could be read more than one way. Twelve went to @iko on 2026-10-30 and are rows of the Decisions tab. These were not asked. For each, the parser follows the reading below, and some are marked "(doc question)" in the library's notes. None changes what a valid program means, except where a reading makes something an error.
72+
73+| # | Question | What the parser does now |
74+| --- | --- | --- |
75+| 1 | `knot` may be empty, so the EBNF admits `//`, `/a//b` and a trailing `/`. Which are paths? | A segment has at least one character, as in Hoon. `/` alone is the empty path, in expressions and molds; `%/` alone is the root application path. `//` fails at the second `/`, and a trailing `/` just past it. `inline-mold-paths` has `/` alone as a mold |
76+| 2 | Is `/` alone a valid path for a `/=` import? | No: `/=` names a module's file, so its path has a segment. `/= card /` fails just past the `/` (`inline-import-root-bad`) |
77+| 3 | The EBNF's `line = [ name "=" ] expr` lets every open bracket's lines take `name=`. What would it mean on a line of an open `(` or `~[`? | An error: `name=` lines belong to tuples and changes. "expected a space between items, found `=`; `name=value` goes in a cell, as [a=1], or a change, as m(a=1)" |
78+| 4 | Does "items named" make every item of a change need `name=`? | Yes: `m(x)` fails just past `x`, "a change's items are named, as in m(done=%.y)" (`lex-tight-change-bad-3` to `-7`; `-8` and `-9` test what follows a name there). The parser still accepts `m()`, though question 6 settled it as an error |
79+| 5 | `term` includes `%0`, `%&` and `%\|`, which no mark is called. What does `/%` take? | `%` and a name only: `/% %0` is "expected a mark's term, as `%todo-action`, found `%0`" |
80+| 6 | What does an indented first line mean? | An error: "the first line is indented: top-level lines start at column 1" (`lex-indent-bad-3`) |
81+| 7 | With levels open at columns 1 and 5, what does a line at column 3 mean? | An error naming the open columns: "this line's indentation matches no enclosing line: indent it to column 1 or 5". `lex-indent-bad-2`, with levels at 1, 5 and 7, gives "column 1, 5 or 7" |
82+| 8 | Tabs, carriage returns, other control characters, and non-ASCII text outside strings and comments? | Errors everywhere, strings and comments included, except that UTF-8 is allowed in strings and comments; a tab in a string is written `\09`. `lex-indent-bad-1` and `lex-spacing-bad-2` test tabs |
83+| 9 | Must a file be valid UTF-8? | Not checked yet: any byte from 128 up passes in strings and comments, and columns assume UTF-8. The proposed reading makes a byte that can't continue a UTF-8 sequence an error. An escape such as `\ff` still writes any byte, as in Hoon |
84+| 10 | Inside `{…}`, may `::` start a comment, which would swallow the `}` and the `"`? Is a lone `}` in a string text? May a comment follow code with no space, as in `5::note`? | A `:` inside `{…}` is "a comment can't start inside `{…}`". A lone `}` is text, as in Hoon. `5::note` is `5` and a comment |
85+| 11 | Is a type variable exactly one capital letter, as `typevar = upper` says? | Yes: `Msg` is "a type variable is one capital letter" |
86+| 12 | Hoon has more runes of the left-out kinds than the list names: `?~ ?= ?. ?@ ?^`, `:- :+ :^ :_`, `%- %+ %^ %~`, `=+ =? =.`, `;:` and `~&(…)`. Are they all left out? | Yes, with the list's reasons, as "`:-` is left out: indentation covers it; write a cell as [a b]". Naming them in the doc, or saying "Hoon's other runes", would make the messages the doc's words (`inline-leftout-*`) |
87+| 13 | `@s…` and `@r…` auras are "errors wherever used". Is that the parser's error in Jibb source, or the checker's? | An error before the checker. Where a mold goes, the layout pass's, at the `s` or `r`: "signed and floating-point auras are left out of Jibb". Where an expression goes, the parser's, at the `@`: "expected an expression, found `@`; signed and floating-point auras are left out of Jibb". Imported ones are milestone 2's importer's. The case `inline-leftout-signed-float-auras` still says "expect: unclear" |
88+
89+Where an error points is not a doc question: the doc asks only for "errors with file, line, column and an excerpt". The library puts each error at the first character where the text stops being the start of any valid module, as Hoon's parser does (its section 2.0).
docs/prelude-inventory.mdnew file+192
@@ -0,0 +1,192 @@
1+# Prelude inventory: source audit
2+
3+This is a working inventory, not a completed prelude interface. It lists top-level arms in the Hoon sections selected for inclusion, before checking each signature, unsupported mold, parser exclusion, collision, grouping or Jibb implementation. The first-level arms in selected Hoon doors are listed separately; each still needs classification and a Jibb signature. @iko chose to include all of 3g, with its `tone` exposed as `tone.hoon`, distinct from Jibb's styling type.
4+
5+The source is the fake ship's `%base` `/sys/hoon.hoon` (Hoon version 135), read through Clay with `tools/ship scry /cx/=base=/sys/hoon/hoon --raw`. SHA-256: `ef538ced0877230f02ff86f9fb7a0abc6833bb1cf0e8675742b4d6ce478fcc92`. It differs in bytes from [upstream Hoon at the inspected commit](https://github.com/urbit/urbit/blob/5a187fededc4582a34fcd6055c67bb63e0917b94/pkg/arvo/sys/hoon.hoon); verify against the actual target ship when updating this inventory.
6+
7+The vendored prelude defines `poke` in its private internal module and re-exports it as a transparent type. The partial checker resolves its supported source shape and a narrow imported API constructor; complete checking of the private body, other API shapes, effect lowering and runtime execution remain unfinished. `qath` is defined there as a transparent recursive knot sequence and re-exported by the public prelude; the partial checker supports its named identity, selected construction and matching, and static application-path literals. The internal prelude also defines a transparent generic `ask` with pure, agent and store cases; the public prelude re-exports it and defines `pure`. Supported source construction and matching infer, while derived requests, source-schema validation and execution remain unfinished.
8+
9+The prelude also declares the generic `cmd` mold exactly as in Overview, Effects. The partial checker infers its five cases and independent message types in the supported examples; complete module checking and backend validation remain outstanding. The public prelude also declares `sub`; the partial checker infers supported constructions, while request watchability and execution remain outstanding.
10+
11+The public prelude now defines the UI `length`, `align`, `role`, `tone` and `attr` molds, a nonrecursive generic `element` union with one case per UI node, and the exact `program` and `page` records with their builders. Nested child, keyed-item and table payloads in the runtime union are erased to `*`; the public constructors retain typed children and independent key types, and `island` stores `[program data]` in its erased payload. The focused `types-prelude-ui` golden infers the complete union and constructor schemes, including static and message-bearing composition. Raw-constructor encapsulation, duplicate-attribute rejection, rendering, storage, navigation and execution are not established by this slice.
12+
13+Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold generators, and need individual inspection. Jibb's loobean `not` and Hoon's bitwise `not.bit` are distinct. Parser helpers outside 3g are excluded from the intended prelude except the specifically listed `slav` and `slaw`; the raw candidates below still need to be classified.
14+
15+## 1a
16+
17+`add`, `dec`, `div`, `dvr`, `gte`, `gth`, `lte`, `lth`, `max`, `min`, `mod`, `mul`, `sub`.
18+
19+The source-backed `gth` gate calls a compiler-supplied private comparison interface. The partial checker accepts supported equal-aura atom arguments, including loobeans, and returns `?`; lowering, jet recognition and execution remain unfinished. The public `add` and `dec` gates are written in Jibb over private primitive interfaces. The partial checker infers a shared atom type that excludes loobeans, including through supported generic calls. The Jibb-written `lth`, `gte` and `lte` gates compose `gth` and `not`; supported calls infer a shared atom constraint and return `?`. Primitive execution and jet recognition remain unfinished.
20+
21+## 1c
22+
23+`bite` (mold), `bloq` (mold), `each`, `gate` (mold), `list`, `lone`, `lest`, `mold` (mold), `pair`, `pole`, `qual`, `quip`, `step`, `trap`, `tree`, `trel`, `unit`.
24+
25+@iko chose to expose Hoon `step` as `step.hoon`, so it does not clash with the Grammar's `step` example. Hoon's `step` uses `@u`. @iko chose one-way widening across Hoon aura families, such as `@ud` and `@ux` into `@u` and `@tD` into `@t`; the reverse needs a check (see [question 19](open-questions.md)). The prelude group needed to expose `step.hoon` is not implemented. Hoon's `bite` is a union of `bloq` and `[bloq=bloq step=step]`; its declaration awaits that group.
26+
27+## 2a
28+
29+`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
30+
31+The following is an audit of the Hoon 135 bodies, not a completed Jibb interface. The partial checker infers `fall`, `need`, `some`, `bind`, `biff`, `bond`, `both`, `clap`, `clef`, `drop` and `flit`; the remaining written implementations have been parsed, but complete checker validation remains outstanding. Backend validation and jet recognition remain outstanding for all of them.
32+
33+| Name | Hoon behavior | Jibb status |
34+| --- | --- | --- |
35+| `biff` | Applies a gate returning a unit to a present value; absent stays absent. | Written |
36+| `bind` | Applies a gate to a present value and wraps the result; absent stays absent. | Written |
37+| `bond` | Calls a fallback trap for an absent unit, otherwise returns its value. | Written and inferred as a curried gate; backend validation remains outstanding |
38+| `both` | Returns a unit of both values when both units are present. | Written |
39+| `clap` | Returns the present unit if only one is present; combines both values with a gate if both are present. | Written with one shared type for both units and the combining gate, as @iko chose |
40+| `clef` | Applies a gate returning a unit when both inputs are present; otherwise returns an absent unit. | Written |
41+| `drop` | Converts an absent unit to an empty list and a present unit to a singleton. | Written; inferred by the partial checker |
42+| `fall` | Returns the value of a present unit or the supplied fallback. | Written; inferred by the partial checker |
43+| `flit` | Returns a gate that wraps a value only if it satisfies the predicate. | Written |
44+| `hunt` | Returns the only present unit or chooses between two present values with an ordering gate. | Missing |
45+| `lift` | Takes a mold and a unit, then applies the mold to a present value as `bind` does. | Missing; Jibb molds are not callable values |
46+| `mate` | Returns the present unit if only one is present; when both are present it returns one if their values are equal and crashes otherwise. | Missing |
47+| `need` | Extracts a present value and crashes on an absent unit. | Written; inferred by the partial checker |
48+| `some` | Wraps a value in a present unit. | Written |
49+
50+## 2b
51+
52+`snoc`, `lure`, `fand`, `find`, `flop`, `gulf`, `homo`, `join`, `bake`, `lent`, `levy`, `lien`, `limo`, `murn`, `oust`, `reap`, `rear`, `reel`, `roll`, `scag`, `skid`, `skim`, `skip`, `slag`, `snag`, `snip`, `sort`, `spin`, `spun`, `swag`, `turn`, `weld`, `snap`, `into`, `welp`, `zing`.
53+
54+The current prelude writes `snoc`, `lure`, `flop`, `join`, `lent`, `zing`, `levy`, `lien`, `murn`, `rear`, `reel`, `roll`, `skim`, `skip`, `snip`, `turn` and `weld`. `lent` counts items by recursion and `add`; `murn` keeps the present products of its gate in order; `join` inserts a separator between items; `snip` drops the last item, and `rear` returns it or crashes on an empty list. The folds take an explicit initial value as the Prelude table specifies. The partial checker infers `snoc`, `lure`, `weld`, `turn`, `flop`, `rear`, `skim`, `skip`, `murn`, `join`, `snip`, `lent`, `zing`, `levy` and `lien` using the validated prelude `list` mold; other list helpers remain limited by that fragment. The result casts on `drop`, `skim`, `skip`, `murn`, `join`, `snip`, `levy` and `lien` state their existing result types without changing their bodies. `zing` concatenates homogeneous lists in order; Hoon’s raw `zing` can also flatten heterogeneous noun lists, which this Jibb type does not express. A Hoon translation agrees with Hoon `zing` on selected finite inputs; this is not Jibb execution. Backend validation and jet recognition remain outstanding for all of them.
55+
56+## 2c
57+
58+`bex`, `can`, `cat`, `cut`, `end`, `fil`, `hew`, `lsh`, `met`, `rap`, `rep`, `rev`, `rig`, `rip`, `rsh`, `run`, `rut`, `sew`, `swp`, `xeb`, `fe`.
59+
60+## 2d
61+
62+`con`, `clz`, `ctz`, `dis`, `ham`, `mix`, `not`.
63+
64+## 2e
65+
66+`muk`, `mug`.
67+
68+## 2f
69+
70+`aor`, `dor`, `gor`, `mor`.
71+
72+## 2g
73+
74+`pow`, `sqt`.
75+
76+## 2h
77+
78+`in`.
79+
80+## 2i
81+
82+`by`.
83+
84+## 2j
85+
86+`ja`, `ju`.
87+
88+## 2k
89+
90+`to`.
91+
92+## 2l
93+
94+`malt`, `molt`, `silt`.
95+
96+## 2m
97+
98+`ly`, `my`, `sy`, `nl`.
99+
100+## 2n
101+
102+`aftr`, `cork`, `corl`, `cury`, `curr`, `fore`, `head`, `same`, `succ`, `tail`, `test`, `lead`, `late`.
103+
104+The source-backed `cork` and `corl` compose gates forward and backward, respectively; `cury` and `curr` bind the first and second item of an unfaced pair. `succ` increments an atom through `add`; the partial checker infers a shared atom type excluding loobeans. A Hoon translation agrees with Hoon on ten selected inputs; Jibb execution and jet recognition remain unverified. `lead` and `late` are curried pair constructors: `((lead a) b)` returns `[a b]`, and `((late a) b)` returns `[b a]`. Their arguments may have independent types, including gate values, and neither constructor invokes a gate. The partial checker infers their polymorphic types. A Hoon translation agrees with Hoon’s helpers on selected inputs, but this is not Jibb execution; lowering and jet recognition remain to be validated by a backend.
105+
106+## 2o
107+
108+`jar`, `jug`, `map`, `qeu`, `set`.
109+
110+## 2q
111+
112+`axis` (mold), `bean` (mold), `flag` (mold), `char` (mold), `cord` (mold), `byts` (mold), `date` (mold), `knot` (mold), `noun` (mold), `path` (mold), `pith` (mold), `stud` (mold), `tang` (mold), `iota` (mold), `tank` (mold), `tape` (mold), `tour` (mold), `tarp` (mold), `term` (mold), `wain` (mold), `wall` (mold).
113+
114+## 3c
115+
116+`year`, `yore`, `yell`, `yule`, `yall`, `yawn`, `yelp`, `yo`.
117+
118+## 3g
119+
120+Hoon 135's `3g` section has exactly 12 exports: ten `+$` molds (`coin`, `dime`, `edge`, `hair`, `nail`, `pint`, `rule`, `spot`, `tone`, `toon`) and two wet `++` gates (`like`, `wonk`). @iko included the whole section, so the parser-related names below stay in the inventory. Hoon's compiler-result `tone` is exposed as `tone.hoon`; the styling type keeps `tone`.
121+
122+| Hoon name | Source shape and Jibb audit |
123+| --- | --- |
124+| `coin` | A union of `[%$ p=dime]`, `[%blob p=*]`, and `[%many p=(list coin)]`. Its `$~` default is dropped: Jibb molds have no default. @iko approved `%$` as a Jibb term literal and pattern on 2026-10-30; the parser implements it and its golden cases pass under eval and on the ship. Its `%$` case uses the `dime` mold below. |
125+| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
126+| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
127+| `hair` | `[p=@ud q=@ud]`: a parsing position. |
128+| `like` | A wet mold builder parameterized by a gate `a=$-(* *)`; its generated gate takes a noun, builds an `edge`-shaped result, and applies `a` to the product on success. The prelude declares the generic mold `+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]`. The Jibb value gate maps the product of an existing result and preserves its position and remaining input; the partial checker infers supported calls, while backend validation remains outstanding. |
129+| `nail` | `[p=hair q=tape]`: parsing input. |
130+| `pint` | `[p=[p=@ q=@] q=[p=@ q=@]]` in Hoon. The four positions accept atoms independently; Jibb `@` now has the same meaning. |
131+| `rule` | A gate mold `$-(nail edge)`; Hoon constructs its sample and product from the `nail` and `edge` molds. |
132+| `spot` | `[p=path q=pint]`: a file path and range. |
133+| `tone` | Three cases: `[%0 product=*]`, `[%1 block=*]`, and `[%2 trace=(list [@ta *])]`. Expose this Hoon mold as `tone.hoon`, distinct from Jibb's styling `tone`. How the prelude presents that qualified mold must agree with its eventual group implementation. |
134+| `toon` | Three cases: `[%0 p=*]`, `[%1 p=*]`, and `[%2 p=(list tank)]`. |
135+| `wonk` | A wet gate that extracts `p` from the successful `q` of an `edge` and crashes on an absent result. The prelude's Jibb gate takes `(like A)` and returns its product `A`; it has been parsed but not yet type-checked or run through a backend. |
136+
137+The following shapes can be written as Jibb declarations once their referenced prelude molds are present:
138+
139+```text
140++$ dime [p=@ta q=@]
141++$ hair [p=@ud q=@ud]
142++$ nail [p=hair q=tape]
143++$ edge [p=hair q=(unit [p=* q=nail])]
144++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
145++$ rule $-(nail edge)
146++$ spot [p=path q=pint]
147++$ coin
148+ [%$ p=dime]
149+ [%blob p=*]
150+ [%many p=(list coin)]
151++$ toon
152+ [%0 p=*]
153+ [%1 p=*]
154+ [%2 p=(list tank)]
155+```
156+
157+The compiler-result `tone.hoon` has the three cases listed above; the qualified name is a prelude group member, not a `+$` identifier containing a dot. Question 15 in [open-questions.md](open-questions.md) records @iko's decision that `@` is an unrestricted atom, resolving the `dime` and `pint` mismatch. The source-backed value form of `like` maps an existing result's product. Supported calls infer in the partial checker; complete checking and backend validation for `like` and `wonk` remain outstanding.
158+
159+## 4a
160+
161+`po`, `fa`.
162+
163+## 4b
164+
165+`at`, `cass`, `cuss`, `crip`, `mesc`, `runt`, `sand`, `sane`, `ruth`, `trim`, `trip`, `teff`, `taft`, `tuba`, `tufa`, `tuft`, `wack`, `wick`, `woad`, `wood`.
166+
167+The prelude writes `trip` and `tuba` over private primitives. Their inferred types are `$-(@t (list @tD))` and `$-((list @tD) (list @c))`, matching the target ship's Hoon 135 definitions. Composition with `lent` and invalid argument controls pass in the partial checker; primitive lowering, execution and jet recognition remain unfinished.
168+
169+## 4k
170+
171+`co`.
172+
173+## 4m
174+
175+`scot`, `scow`, `slat`, `slav`, `slaw`, `slay`, `smyt`, `spat`, `spud`, `stab`, `stap`, `stip`, `pout`, `pave`.
176+
177+## Selected door arms
178+
179+These are first-level Hoon arms for the container and base-conversion doors, before applying the parser and internal-helper exclusions or converting door operations to plain Jibb gates.
180+
181+| Hoon door | Arms |
182+| --- | --- |
183+| `in` | `all`, `any`, `apt`, `bif`, `del`, `dif`, `dig`, `gas`, `has`, `int`, `put`, `rep`, `run`, `tap`, `uni`, `wyt` |
184+| `by` | `all`, `any`, `bif`, `del`, `dif`, `dig`, `apt`, `gas`, `get`, `got`, `gut`, `has`, `int`, `jab`, `mar`, `put`, `rep`, `rib`, `run`, `tap`, `uni`, `uno`, `urn`, `wyt`, `key`, `val` |
185+| `ja` | `get`, `add`, `zip` |
186+| `ju` | `del`, `gas`, `get`, `has`, `put` |
187+| `to` | `apt`, `bal`, `dep`, `gas`, `get`, `nip`, `nap`, `put`, `run`, `tap`, `top` |
188+| `po` | `ins`, `ind`, `tos`, `tod` |
189+| `fa` | `cha`, `tok`, `pad`, `enc`, `den` |
190+| `co` | `em-co`, `ed-co`, `ox-co`, `ro-co` |
191+
192+The raw 4m candidates need special care: `slat`, `slay`, `stab`, `stap` and `stip` parse atoms or paths, while `slav` and `slaw` are the explicitly approved exceptions. Some door arms, such as `ins.po` and `ind.po`, also parse. The final inventory must classify each rather than expose this raw list wholesale.
docs/prompts/drop-union-rune.mdnew file+182
@@ -0,0 +1,182 @@
1+# Drop the `$?` rune
2+
3+A brief for the developer who removes the union rune `$?` from Jibb, as @iko decided on 2026-10-30. Paste it as the first message of a session, or hand it to a person; it assumes a fresh start in the repo `iko-soy/jibb`. Written 2026-10-30, at commit 5cc44b4. Do it before milestone 2, whose brief, [milestone-2.md](milestone-2.md), it updates.
4+
5+---
6+
7+You are making one language change to Jibb, a UI language for Urbit: a Hoon dialect with an indentation layout. Its spec is @iko's design doc, [Jibb — an Elm-architecture UI language for Urbit](https://claude.ai/artifact/DMBr48qzi5z8hcwn2ccPBv), copied into `docs/spec/`. Milestone 1 built the layout pass and the parser in Hoon, in `jibb-dev/lib/jibb.hoon`; milestone 2, the type checker, hasn't started. The change: Jibb drops `$?` in both its forms, and a `+$` takes a union's cases on the lines below its name.
8+
9+## The decision
10+
11+@iko asked whether Jibb needs `$?` at all, since it is the only way to define a union, and a `+$` without it means what a `$?` of one case means. There were three options: keep `$?`; drop its tall form but keep `$?(%a %b)` for unions inside other molds; or drop it entirely. @iko chose the last, with its costs: "Every union needs its own +$ name. Messages need a print-only notation for unnamed unions from Hoon, and the prelude must name space, role, tone and the like."
12+
13+What Jibb becomes:
14+
15+1. **A union is a `+$` with its cases below.** A `+$` takes one mold on its line, or its cases on the lines below it, one per line. Several cases make a union; one case is just that mold, as if it were on the `+$` line.
16+
17+ ```
18+ +$ msg
19+ [%noted text=@t]
20+ %add
21+ ```
22+
23+2. **Every union written in Jibb has a name.** A union used in a field, a sample, a cast, a gate's mold or an argument gets its own `+$`, at the top of the module or among an enclosing body's local definitions. A gate's sample can't use a `+$` from that gate's own body, which only the body sees.
24+3. **`|$` comes right after a `+$`'s name**, then the mold on its line or the cases below: `+$ cmd |$ [M]` above its cases. `|$` anywhere else is an error. Today the parser takes `|$` wherever a mold goes, as in `++ f ^- |$ [A] A 5`.
25+4. **A mold that isn't a union counts as a union of one case**, for tag resolution and `|=%tag`: `[%go "x"]` fits `+$ go [%go url=@t]`, and `|=%typed` works against `$-(@t M)` when `M` is `[%typed text=@t]`. Tag resolution today asks for "a union with a matching case", so without this rule a `+$` of one case would not mean what a `$?` of one case meant.
26+5. **Only `|=` and `$-` keep wide forms.** `$?`, `$?(…)` and `$%` are left out, with messages saying how to write a union.
27+6. **Unchanged**: cases must differ as nouns; tags take their union from context; `?-` is exhaustive; a record still leaves its `[` open on the `+$` line to put one field on each line below; recursive molds go by name and module; and `poke` and `paths` in an API file stay "declarations, not molds", whose lines below list poke types and path cases, as their `$?` cases did.
28+
29+Unions without a name don't go away. Hoon `/sur` files nest them inside other molds, as `c-ask=?(%approve %deny)` and `[?(%watch %unwatch) ~]` (16 of the 40 files in `tloncorp/tlon-apps`, `desk/sur`, have a `?(…)` inside another mold), and `$@` and `$^` import as unions. Jibb can import them but no longer write them, so milestone 2's messages need a notation for them. That is a question for @iko, which step 4 records; it isn't yours to settle here.
30+
31+## Read first
32+
33+1. `docs/README.md` and `docs/development.md`: the ground rules, how to set up a machine, the checks, and how golden cases work.
34+2. In `docs/spec/grammar.md`: Lexical rules, Runes, Modules, Molds, Tag resolution, the EBNF and the examples. In `docs/spec/overview.md`: Importing Hoon types, Effects, Agent APIs and worked example 3. In `docs/spec/decisions.md`: the Syntax and Unions rows.
35+3. In `jibb-dev/lib/jibb.hoon`: design notes 2 and 3; the parser's `+read-def`, `+read-mold`, `+read-union`, `+read-union-wide`, `+read-molds` and `+read-generic`; and the layout pass's `$` and `|` glyphs in `+lexer`. `grep -n '\$?' jibb-dev/lib/jibb.hoon` finds the rest.
36+
37+Then set up the machine as `docs/development.md` says and run its checks. All 344 golden cases should pass before you change anything.
38+
39+## Ground rules
40+
41+- **The doc wins.** The doc changes first (step 1), and the code follows its words. Where this brief and the doc differ, follow the doc and tell @iko.
42+- **Don't decide more of the language than this.** A question goes to @iko, as a comment on the doc's words or in the project's chat, and into `docs/open-questions.md`.
43+- **Everything is a golden test**, and every check passes on the fake ship as well as under `urbit eval`.
44+- **Push straight to `master`**, in commits that each leave every check passing. No pull requests.
45+- **Keep `docs/` current**, as step 4 says.
46+
47+## Step 1: change the doc
48+
49+Make these edits in the doc itself, replacing the quoted words. Check each against the doc before you change it: `docs/spec/` is a snapshot from 2026-10-30, and the doc may have moved since. If you can't edit the doc, send @iko this list and wait until it lands. The quotes are the doc's own words; in `docs/spec/`, a `|` inside a table row is written `\|`.
50+
51+**Decisions tab.** The tab's rule is that "a later date marks a revision", so both rows become "Decided 2026-10-30".
52+
53+- Syntax: "wide forms only for `|=`, `$?` and `$-`" becomes "wide forms only for `|=` and `$-`".
54+- Unions: "`$?` only; tags anywhere" becomes "No `$?`: a `+$` with its cases on the lines below is a union, so every union written in Jibb has a name; one case is just that mold; a mold that isn't a union counts as a union of one case for tags and `|=%tag`; a generic's `|$` comes right after the `+$`'s name; tags anywhere".
55+
56+**Grammar tab.**
57+
58+- Lexical rules, Tight forms: "the openers `~[`, `|=(`, `$?(`, `$-(` take no spaces" becomes "the openers `~[`, `|=(`, `$-(` take no spaces".
59+- Runes: "`+$` **lusbuc**: defines a mold, likewise; molds may be recursive." becomes "`+$` **lusbuc**: defines a mold, likewise: on its line, or as cases on the lines below, one per line, where several cases make a union and one is just that mold. Molds may be recursive."
60+- Runes: delete the entry "`$?` **bucwut**: a union, one case per line or `$?(%a %b)`; cases must differ as nouns."
61+- Runes: "`|$` **barbuc**: a generic mold, `|$ [A] mold`." becomes "`|$` **barbuc**: a generic mold, right after a `+$`'s name: `+$ result |$ [V E]`, then the mold on its line or the cases below."
62+- Runes: "Only `|=`, `$?` and `$-` have wide forms: `|=(sample expr)`, `$?(case case)`, `$-(mold mold)`." becomes "Only `|=` and `$-` have wide forms: `|=(sample expr)` and `$-(mold mold)`."
63+- Left out on purpose: "`$%`: `$?` covers unions." becomes "`$?`, `$%`: a union is a `+$` with its cases below."
64+- Molds, Unions: "`$?`; tags take their union from context" becomes "a `+$` with several cases below it. Every union written in Jibb has a name, so one used in a field, a sample, a cast, a gate's mold or an argument gets its own `+$`; only imports bring in unions without one. Tags take their union from context".
65+- Molds, Generic molds: "`+$ result |$ [V E] $?` with cases below." becomes "`+$ result |$ [V E]` with cases below; `|$` goes only right after a `+$`'s name."
66+- Tag resolution: after "the variable must become a union with a matching case, or an atom type the term fits.", add "A mold that isn't a union counts as a union of one case, for tags and for `|=%tag`: `[%go "x"]` fits `+$ go [%go url=@t]`, and `|=%typed` works against `$-(@t M)` when `M` is `[%typed text=@t]`."
67+- The examples: `+$ step $?`, `+$ cart-action $?` and `+$ msg $?` lose their ` $?`.
68+- The EBNF: `definition` becomes the first block below, and `mold` the second, which drops its `$?` and `$?(` lines and its `|$` line.
69+
70+ ```
71+ definition = "+$" name [ generic ] ( mold | cases )
72+ | "++" name ( expr | body ) ;
73+ generic = "|$" "[" typevar { typevar } "]" ;
74+ cases = INDENT mold { NEWLINE mold } DEDENT ; (* one case is that mold; more make a union *)
75+ ```
76+
77+ ```
78+ mold = aura | "*" | "!!" | "?" | "~" | term | loobean | ref | typevar
79+ | pathmold
80+ | "(" ref mold { mold } ")" | "(" ref { mold } mlines
81+ | "[" field { field } "]" | "[" { field } flines
82+ | "$-(" mold mold ")" ;
83+ ```
84+
85+**Overview tab.**
86+
87+- Importing Hoon types: in the table, the `$%`, `$?` row's "`$?`" becomes "A union"; "`$?` with an atom case" becomes "A union with an atom case"; and "`$?` if its cases differ as nouns, else an error where used" becomes "A union if its cases differ as nouns, else an error where used". After "Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file are fine.", add "A union without a name, as a field's `?(%approve %deny)`, imports too, though Jibb can't write one."
88+- Effects: `+$ cmd |$ [M] $?` and `+$ sub |$ [M] $?` lose their ` $?`.
89+- Agent APIs: `+$ paths $?` loses its ` $?`.
90+- Worked example 3: `+$ msg $?` loses its ` $?`.
91+
92+The Core language and Implementation plan tabs don't mention `$?`. Then export the five tabs as Markdown into `docs/spec/`, as `docs/README.md` says, and check that `git diff docs/spec` holds only these edits. `tools/doc-blocks docs/spec` will then find six blocks without a case and six cases without a block, the six whose unions changed, until step 3 updates them.
93+
94+## Step 2: change the parser
95+
96+The layout pass:
97+
98+- `$?` and `$?(` become left-out runes, an error at the `?`, as `$%` is today. Say, "`$?` is left out: a union is a `+$` with its cases below", which states the rule broken and quotes the Left out list, as the other left-out messages do. `$%` gets the same reason, and `$` alone becomes "`$` begins `$-(`".
99+- `%'$?'` and `%'$?('` leave `+glyph`. The token printer names no glyph, so it doesn't change.
100+
101+The parser:
102+
103+- `+read-def` reads, after a `+$`'s name, an optional `|$ [vars]` (today's `+read-generic`, moved here), then one mold on its line, or INDENT, cases one per line, and DEDENT (the loop of today's `+read-union`, moved here too). One case gives that mold's own node; several give `[%union at cases]`, whose span runs from its first case's start to its last case's end, since it has no token of its own. `|$` wraps either in `%generic`, from the `|$` to the end of its body. Local `+$`s go through `+read-def`, so they get the same.
104+- `+read-mold` no longer takes `$?`, `$?(` or `|$`. `|$` there is an error at it: say, "expected a mold, found `|$`; `|$` goes right after a `+$`'s name, as in +$ result |$ [V E]".
105+- `|` no longer begins a mold, except right after a `+$`'s name. Take it out of `mold-mask` and out of the table above it, which becomes "a mold a-z A-Z @ * ! ? ~ % / ( [ $", and read the place after a `+$`'s name with `mold-mask` and `|`. An error is placed just past the part of a token that could begin the place (`+prefix`), so otherwise `|$` or `|=` in a field, a sample, a cast or an application would fail at its second character. With the change, `+$ x [a=|=]` fails at 1:9, its `|`, not 1:10, while `+$ x |%` still fails at the `%`, where `|$` could have begun.
106+- `+read-union`, `+read-union-wide` and the union half of `+read-molds` go, and so does `+read-def`'s hint "a `+$` takes one mold; a union is `$?` with its cases below", with the branch it ends. `$?(` leaves the lists of openers in `+stray` and `+index-tokens`.
107+- Where each new error points follows note 2.0: the first character where the text stops being the start of any valid module. So `+$ x |$ [A]` with nothing below now fails at the next line, as `+$ x` does (`lex-layout-bad-10`), not at the end of its own line.
108+- Hints for the slips the change makes likely:
109+ - A mold on the `+$` line, or after `|$ [vars]`, with deeper lines below. Today that is "expected the end of the line, found a deeper line; only a bracket open at the end of a line, or a rune's body, takes deeper lines", at the deeper line. Say instead "a `+$` takes one mold on its line or its cases below, not both".
110+ - A case line that starts `name=`, as when a record's fields go under a bare `+$` without their `[`. Today that is "expected the end of the line, found `=`", at the `=`. Add "a `+$`'s lines below are its cases; a record's fields go in a [ left open on the `+$` line".
111+ - Two molds on one case line keep today's "a union takes one case per line".
112+ - Hoon's `?(%a %b)` in a mold. Today, at the `(`, that is "expected the end of the line, found `(`" after a `+$`'s name; "expected a space between items, found `(`" in a field, an application or a `$-(`; "expected a space after the sample, found `(`" in a gate's sample, as `|= s=?(%a %b)`; and "expected a space after the mold, found `(`" in a cast. Add "a union is a `+$` with its cases below" to each.
113+- `+check-spans`: a union's outline has no lead token now (`~`, so it starts with its first case) and ends with its last case (`%kid`). `+check-spans-test`'s entry for `+$ x $?(%a %b)` needs another source, such as a `+$` with two cases below.
114+- The notes: section 1's "$?'s cases end with their last line's code"; design notes 2 and 3, including note 3's list of the parts a rune needs on its own line, where `|$`'s mold no longer belongs, and its Errors example "`$?(]`"; section 4.2's printed cart store, whose `(union 3:16` becomes `(union 4:3`, as a union now starts at its first case; the comments on `+glyph`, `+shape` and `+stop`; and every arm comment that mentions `$?`, `$?(` or `|$` as a mold. Say in note 3 that @iko decided the change on 2026-10-30, quoting the Decisions row, as the notes do for the other decisions.
115+
116+Error wording is yours within the doc's rules and the conventions in `docs/development.md`; the golden tests fix it once written.
117+
118+## Step 3: tests
119+
120+`tools/golden --update --case <name>` rewrites a case's outputs. Read every diff against the case's `about.txt` before committing, as `docs/development.md` says under Golden cases.
121+
122+**Cases that change.** These 25 cases' sources use `$?`, `$?(` or `$%`, or a `|$` whose meaning changes:
123+
124+| Cases | What to do |
125+| --- | --- |
126+| `doc-grammar-04-step`, `doc-grammar-06-cart-store`, `doc-grammar-07-basket`, `doc-overview-01-cmd-sub`, `doc-overview-04-todo-api`, `doc-overview-10-todo-list` | Copy the doc's new block into `source.jibb` and update `about.txt`'s quotes, so `tools/doc-blocks docs/spec` matches them again |
127+| `inline-mold-generic`, `inline-scry-case`, `lex-indent-ok-3`, `lex-open-mold-ok-4` | Drop ` $?` from the `+$` line. `inline-scry-case`'s one case is now the mold itself, so its tree loses the `(union …)` |
128+| `lex-rune-layout-ok-1` | Its `+$ h` has `$?` alone on the line below it, with the cases deeper still. Delete that line and indent `%a` and `%b` two spaces, right below `+$ h`. In `about.txt`, "a `$?` whose cases" become "a `+$` whose cases" |
129+| `inline-term-numeric` | `+$ code` with its three constants on the lines below |
130+| `inline-pattern-crash-arm`, `inline-pattern-crash-bad` | Name the sample's union with a top-level `+$`; the error's line moves |
131+| `inline-wide-forms`, `lex-tight-opener-ok-1` | Drop the `$?(` line, and quote the doc's new sentence on wide forms or openers |
132+| `lex-open-bracket-ok-5` | Drop the definition of `w`, `$?(%a [`; the other three still test brackets left open together |
133+| `lex-rune-layout-bad-10` | `+$ x \|$ [A]` above `(list A)` now parses: the line below is the generic's one case. Give it the next free `lex-rune-layout-ok-` name and say why |
134+| `inline-leftout-buccen` | The new message for `$%` |
135+| `lex-rune-layout-bad-13`, `lex-tight-opener-bad-3`, `lex-open-mold-bad-6`, `inline-union-wide` | Their subject is gone. Make each a case of `$?` or `$?(` left out, or delete it; `lex-layout-bad-10` already covers a `+$` with no mold |
136+| `lex-open-bracket-ok-9` | A `(` before a `$?` with its cases below is gone, and the same lines now read as `(map %a %b)`. Delete it, or keep it saying so |
137+| `inline-wide-union-call` | Its subject, an application without parentheses where a case goes, lives on as `+$ x` above `%a` and `list @t`, which fails at `@t`, "a union takes one case per line" |
138+
139+Other `about.txt` files quote words the doc changes, such as the `lex-tight-*` cases quoting Tight forms. Update those quotes too. `grep -l '\$?\|\$%\||\$' tests/golden/*/about.txt` finds most of them, and `grep -l 'INDENT mold DEDENT' tests/golden/*/about.txt` finds six more that quote the old `definition` rule: `lex-layout-bad-5`, `lex-layout-bad-6`, `lex-layout-bad-10`, `lex-name-bad-6`, `lex-open-mold-ok-5` and `lex-term-bad-13`.
140+
141+**New cases**, at least:
142+
143+- a `+$` with one case below, whose tree is the same as with the case on its line;
144+- a local `+$` with cases, at the start of a gate's body;
145+- a generic with cases below (`inline-mold-generic` will be one) and with one mold below (the renamed `lex-rune-layout-bad-10`);
146+- `$?` with its cases below, `$?(%a %b)`, and `$?(…)` in a field, as `[dir=$?(%l %r)]`, each left out at the `?`; and `$` alone where a mold goes, as `+$ x $`, "`$` begins `$-(`" at 1:7;
147+- `|$` in a field, in a cast, in an application, and on the line under a bare `+$`, each an error at its `|`; and `|=` where a mold goes, as `+$ x [a=|=]`, at its `|` now;
148+- a mold on the `+$` line with cases below it, and the same after `|$ [A]`;
149+- a record's fields under a bare `+$`, without the `[`;
150+- Hoon's `?(%a %b)` after a `+$`'s name, in a field, in a gate's sample and in a cast.
151+
152+Each new `about.txt` quotes the doc's new words.
153+
154+**`my-app` and `tools/ship`.** `my-app/ui/` holds nine of the doc's blocks, byte for byte. Four of them change: `stores/cart.jibb`, `basket.jibb`, `api/todo.jibb` and `todo-list.jibb`. `tools/ship`'s `MERGE_BASE`, the start of worked example 3, which `check-commit` merges, loses its ` $?` too.
155+
156+**Run** every check in `docs/development.md`: `tools/golden`, `tools/hoon check-spans-test`, `tools/testdata/selftest` and `tools/doc-blocks docs/spec`; then, on the ship, `tools/ship gen-tests` (commit the regenerated `tests/lib/jibb.hoon`), `tools/ship test`, `tools/testdata/ship-selftest`, and `tools/ship check-commit`, since the `my-app` desk changed.
157+
158+## Step 4: docs
159+
160+- `docs/spec/`: the fresh export from step 1.
161+- `docs/status.md`: the change in the history table, the new case counts, and no longer listed as waiting.
162+- `docs/open-questions.md`:
163+ - In question 10, "a `$?` of a `qath` and a cord" becomes "a union of a `qath` and a cord".
164+ - Add question 12 under "Questions milestone 2 raises": how messages and `types.txt` print a union without a name, now that Jibb has no syntax for one. Hoon imports bring them in (a field's `?(%approve %deny)`, `$@` and `$^`), and so does the fold of a `(facts full d1 d2)` request. @iko's decision calls for "a print-only notation".
165+ - Add to question 3 that the prelude must name every union its elements and attributes take, such as the spaces, roles and tones, and that no module may then use those names, since no name may shadow the prelude's.
166+- `docs/prompts/milestone-2.md`:
167+ - the bullets on generic molds and on the import table;
168+ - the Unions group: every union is a named `+$`, and a mold that isn't a union is one case;
169+ - the type printer, which has no Jibb syntax for a union without a name (question 12);
170+ - the number of open questions and their list;
171+ - in the Errors list, a hint for a `+$` whose cases overlap or don't fit: a record or tuple leaves its `[` open on the `+$` line. `+$ pt` above `@t` and `[@ud @ud]` is now a valid union, where it used to be a parse error;
172+ - the note at its top that this change comes first.
173+- `docs/compiler.md`: the tree's lines on `%union` and `%generic`, if they changed.
174+- `docs/README.md` and `docs/status.md`: this brief, as done.
175+
176+## When you're done
177+
178+- The doc says what step 1 lists, `docs/spec/` matches it, and `tools/doc-blocks docs/spec` finds every block's case.
179+- No `$?`, `$?(` or `$%` is left in the Jibb the library reads or describes (its parser, messages, notes and examples), nor in the golden sources, `my-app` or `tools/ship`, except where a message or note names it as left out. The library's own Hoon keeps its `$?`, `$%` and `|$`.
180+- Every check in `docs/development.md` passes under eval and on the ship.
181+- Everything is pushed to `master`.
182+- Tell @iko in the project's chat, in a few lines: what changed, the case counts, and anything you had to decide or ask.
docs/prompts/milestone-2.mdnew file+169
@@ -0,0 +1,169 @@
1+# Milestone 2: types and prelude
2+
3+A brief for the developer who builds milestone 2 of Jibb. Paste it as the first message of a session, or hand it to a person; it assumes a fresh start in the repo `iko-soy/jibb`. Written 2026-10-30, at commit ab797a9, when milestone 1 was done.
4+
5+---
6+
7+You are building milestone 2 of Jibb, a UI language for Urbit: a Hoon dialect with an indentation layout. Its spec is @iko's design doc, [Jibb — an Elm-architecture UI language for Urbit](https://claude.ai/artifact/DMBr48qzi5z8hcwn2ccPBv), with its repository copy in `docs/spec/`; the repository records the decision to drop `$?` pending synchronization to the Claude document. Milestone 1 built the layout pass and the parser in Hoon, in `jibb-dev/lib/jibb.hoon`. Milestone 2 adds the type checker, the imports, and the prelude.
8+
9+Before milestone 2, @iko decided on 2026-10-30 to drop `$?`. The change is described in [drop-union-rune.md](drop-union-rune.md); check `docs/status.md` for its completion.
10+
11+## Read first
12+
13+1. `docs/README.md`, `docs/status.md` and `docs/development.md`: where things stand, the ground rules, how to set up a machine.
14+2. `docs/spec/implementation-plan.md`: milestone 2, the Compiler architecture section, Risks and Open questions.
15+3. `docs/spec/grammar.md`, all of it, and closely: Literals, Molds, Tag resolution, Literals by context, Patterns, Modules, Imports, Runes, Expressions. This is most of your spec.
16+4. `docs/spec/overview.md`: Importing Hoon types, Prelude, The Elm architecture on Urbit (kinds, islands, effects), Layout and styling with Links and URLs, Agent APIs, Desk layout, the worked examples.
17+5. `docs/spec/decisions.md`: every row, and closely Special rules, Inference, Unions, Branching, Hoon types, Derived gates, Type identity, Kinds, Type variables, Empty mold, Inline gates, Sample names, Binding patterns, Text, Auras, Imports and Data crossing to the browser.
18+6. `docs/spec/core-language.md`, Values and invariants: what the front end guarantees the backends. The checker's share includes "No shadowing" and island data without gates.
19+7. `docs/compiler.md`, then the design notes at the top of `jibb-dev/lib/jibb.hoon` and its `%tree` chapter: the syntax tree you will check.
20+8. `docs/open-questions.md`.
21+
22+Then set up the machine as `docs/development.md` says and run its checks. All golden cases should pass before you change anything.
23+
24+## Ground rules
25+
26+- **The spec wins.** Where code and spec disagree, the spec stands until it changes. `docs/spec/` records the decision to drop `$?`, which still needs synchronization to the Claude document; consult the document for other details as described in `docs/README.md`.
27+- **Don't decide the language.** A question about what Jibb means goes to @iko: as a comment on the doc, on the words it's about, if you can comment there, or else in the project's chat, where @iko reviews work. List it in `docs/open-questions.md` too. Meanwhile follow the most likely reading, mark it "(doc question)" in the library's notes, and keep going. A language change is agreed first and recorded in the Decisions tab.
28+- **No built-ins.** The Decisions tab's Special rules row: "No built-ins; type-directed rules are welcome, each listed in the Grammar tab". A typing rule the Grammar doesn't list, such as a special case for one gate, is a language change.
29+- **Implementation choices are yours**: data structures, algorithms, error wording within the doc's rules, test layout. Record the reasoning in the library's design notes, as milestone 1 did.
30+- **Everything is a golden test**, and every check passes on the fake ship as well as under `urbit eval`.
31+- **Push straight to `master`**, in commits that each leave every check passing. No pull requests.
32+- **Keep `docs/` current**: `status.md`, `open-questions.md`, `compiler.md` and `development.md` change with the code.
33+
34+## The milestone
35+
36+From the plan, word for word:
37+
38+> **Types and prelude**
39+> - Builds: Hindley–Milner inference with aura variables; tag and literal resolution with deferred constraints; the union disjointness check; exhaustive `?-` with dead-arm errors; `/-`, `/%` and `/=`, with the table for importing Hoon types; API files and their derived gates; the prelude's types.
40+> - Done when: the doc's examples typecheck, except those written as errors; each error the Grammar tab describes has a test with its message, such as "msg has no case %submitt"; a `/sur` file with `$%`, `$@`, maps and a recursive mold imports as the table says.
41+
42+One Grammar error waits: checking an application path "against routes and static files" needs routing, which the plan builds in milestone 4. Say so in your report.
43+
44+And from the plan's Risks:
45+
46+> **Importing Hoon types.** Hoon's types form a graph with lazy `%hold` nodes, so the importer needs Hoon's own type engine to expand them, and it must recognise maps, sets and recursive molds by name. Start it early in milestone 2, on real `/sur` files such as Tlon's.
47+
48+> **Type errors.** Hindley–Milner is known for confusing errors. Each error names both conflicting sites, with excerpts, and the messages are golden tests.
49+
50+## First steps
51+
52+1. **Specify the prelude inventory.** The checker needs the prelude's complete exported inventory and signatures; include all names from the listed Hoon library sections except explicitly excluded groups, as `docs/open-questions.md` question 3 records. The prelude imports private helpers and low-level primitives from a separate internal module without exposing them; its public foundational gates are implemented in Jibb on those primitives. The source-backed internal module defines `poke`, `ask` and `qath`; the public prelude re-exports them as ordinary transparent types that modules can construct and inspect, as questions 24 and 25 record. Their current representations and partial checker support are described in `docs/compiler.md`.
53+
54+ The plan's three core-language rules were adopted: gate-free `eq` arguments and map and set keys, with gates opaque for union matching; jetted prelude functions taking gates; and rejection of a non-gate value that depends on itself even through a gate.
55+2. **Start the importer early**, as the plan's Risks ask: first on a small `/sur` file, then on Tlon's. "Suggested design" below has a way in.
56+
57+## What the doc asks of the checker
58+
59+The rules are scattered across the tabs. This is a map of them, not a replacement: read each in place, and where this summary and the doc differ, the doc is right.
60+
61+**Types and inference** (Grammar: Molds, Modules, Runes, Expressions; Decisions: Inference, Type variables, Sample names, Inline gates)
62+- Hindley–Milner with aura variables: "every expression has a principal type, and there is no general subtyping". A specific atom fits `@`, a specific noun fits `*`, and a more specific aura fits an ancestor in its Hoon aura family, each only in that direction; the reverse needs a check. Explicit `proj` is a type-directed operation.
63+- `@` means any atom, independently at each occurrence. A specific atom such as `@ud` fits where `@` is expected; an `@` value needs a check to fit `@ud`. `@ud` and `@ux` also fit `@u`, and `@tD` fits `@t`, following Hoon aura families; the reverse needs a check. Distinct specific auras remain distinct. `add` takes `[A A]` and returns `A`, with an atom constraint inferred for the shared type variable.
64+- The reserved, explicit `(proj record)` selects fields according to its expected result type. The checker records the projection and lowering evaluates the source once and builds that layout. A direct call does not insert a projection, and a module cannot define or import another `proj`.
65+- Faces are part of record types: `[a=@ b=@]` and `[x=@ y=@]` don't unify. An unnamed position can unify with a faced one and take its face, so `[0 0]` fits `[x=@ud y=@ud]`. A single-item cell `[a]` is `a`; an empty `[]` is an error.
66+- Type variables are capitals, "generalized per `++`". A capital in a local `++` shares the enclosing `++`'s variable of that name if the enclosing `++` also uses it; otherwise the local `++` introduces and generalizes its own variable. For example, `++ inner |= y=A y` shares `A` with an enclosing gate whose sample is `x=A`, but generalizes its own `A` if the enclosing `++` does not use `A`. A different type takes a different capital. A body cannot force two distinct capitals to be equal; use the same capital where a type is shared. "A type variable used where an atom is required gains an atom constraint", so `++ clamp |= [lo=A hi=A n=A]`, calling `gth` and `max`, works on any one aura; "It can become nothing more specific: a body that makes `A` a `@ud` or a list is an error." Names "may refer to each other in any order", so infer `++` definitions in dependency order, a group of mutually recursive ones together.
67+- The checker infers a gate-free constraint for `eq` arguments and map and set keys and retains it when a type variable is generalized. The requirement applies recursively to nested values; union-case matching treats gates as opaque. Print a gate-free constraint as `$-([A A] ?) where A contains no gates` and an atom constraint as `$-([A A] A) where A is an atom`; separate multiple clauses with commas, as `where A is an atom, B contains no gates`.
68+- Gates may call themselves and their siblings; a non-gate value that depends on itself, even through a gate, is an error. Molds may be recursive, and "recursive molds go by name and module".
69+- A sample's mold may be left out: every bare name in a sample binds, at any depth, as in `|=(p title.p)` "when the call fixes the type", `|= [a=@ b]` and `|=(m ~)`.
70+- Generic molds: `+$ result |$ [V E]` with cases below, applied as `(result V E)`; `|$` goes right after a `+$`'s name, and the prelude's `cmd` and `sub` use `|$ [M]`.
71+- `!!` is the empty mold, and as an expression it has any type. `*` is the noun type, not a type variable; generic positions such as the keys in `each` and `table` use a capital. A value of a more specific noun type can be used where `*` is expected.
72+- `_` is an inferable hole wherever a mold can appear, including an inferred path-segment aura. A hole resolved to an explicitly named generic variable is resolved; an unconstrained hole is an error. A named mold or value definition must determine its own holes without constraints from later uses.
73+- `poke`, `ask` and `qath` are transparent types defined in the internal prelude and re-exported normally. Derived gates and `pure` also construct requests; application-path literals have type `qath`.
74+- The Literals table gives every other literal its type: `0x1f` a `@ux`, ships `@p`, dates `@da`, durations `@dr`, `~.knot` a `@ta`, strings `@t`, `` `x `` a `(unit A)`, `~[…]` a `(list A)`, `gap+%s2` the pair `[%gap %s2]`, `/posts/~zod` a `path`, `%/blog` a `qath`.
75+
76+**Tags, `~`, numbers and cells wait for their context** (Grammar: Tag resolution, Literals by context)
77+- A tag or `~` gets a fresh variable and a pending constraint, checked once unification fixes the variable: against a union's cases, by shape and shared tag positions, or as a constant atom for `@tas`, `@ta`, `@` or `*`. A literal that matches nothing is "an error naming the union, such as "msg has no case %submitt"".
78+- `|=%typed` is a case's constructor: "against `$-(@t M)` it is `|=(t [%typed t])`, requiring `M` to have a case `[%typed @t]`. A literal case head matches by noun value, so `|=%$` also matches `%.y` and `~` heads; a bare tag is always a value."
79+- A variable constrained by tag resolution, and any it mentions, doesn't generalize; it stays open until something in the module fixes it. An island's `main` fixes its messages. A tag constraint still open when the module is checked is an error asking for a `^-`; the checker never guesses. Gate-free constraints are retained when generalized.
80+- "Wing access, changes and `?-` on a type not yet known wait the same way." A change with no items, `m()`, is an error; the parser still accepts it. Patterns don't wait: they're checked against the subject's type.
81+- Number and cell literals each "takes a default when its `++` is checked": a number `@ud`, a cell a tuple. But "A number takes `@ud` only if nothing fixes its aura and its `++` isn't generic over it", so `++ inc |= n=A (add n 1)` stays generic: unlike a tag's, a number's variable doesn't stop its `++` from generalizing. A cell can also become a record or, where a list is expected, a cons.
82+- In `{…}`, atoms print by aura, a bare `@` as `@ud`; `@t`, `@ta`, `@tas` and tapes splice as text; "any other cell is an error asking for a printer". "Printers are picked when compiling", so an atom whose aura its `++` is generic over "is an error asking for an aura", in `{…}` and in a `(…)` segment of an application path. String literals are always cords.
83+
84+**Unions** (Grammar: Molds, Runes; Decisions: Unions)
85+- Every union written in Jibb is a named `+$` with its cases below. One case is just that mold; a mold that isn't a union counts as a union of one case for tags and `|=%tag`. Imported types can contain unnamed unions.
86+- Cases "must differ as nouns: inhabited cases must differ at some position of their right-nested cells, where one is an atom and the other a cell, or both are different constants. `*`, type variables and molds that can be either, such as `(list A)`, can overlap atoms and cells. `?` counts as the two atoms `%.y` and `%.n`: it is disjoint from cells and overlaps the constants 0 and 1. The empty mold `!!` is disjoint from every case; a cell with an empty position at any depth is itself empty and is also disjoint from every case. A union whose cases don't all differ is rejected."
87+
88+**Patterns and `?-`** (Grammar: Patterns; Decisions: Branching, Binding patterns)
89+- Exhaustive: "Every case needs an arm or a catch-all, `*` or a bare name." Leaving one out is an error naming it.
90+- "An arm that earlier arms cover, such as a second `%add` or anything after `[%move * *]`, is an error."
91+- `?-` on a loobean switches on `%.y` and `%.n`. A name in a pattern always binds anew; the last position of a cell pattern binds the rest.
92+- The Core language tab lowers `?-` "by the usual pattern-matrix algorithm", so one matrix can serve exhaustiveness, dead arms and, in milestone 3, lowering.
93+
94+**Names and modules** (Grammar: Modules, Imports, Runes, Expressions; Core language: Programs and linking)
95+- "No name may shadow one already in scope, imports and the prelude included": samples, local `++`s and pattern binders too. The backends rely on it (Core language, "No shadowing").
96+- Molds and values have separate namespaces, "told apart by position": `todo-action.todo` is a mold and its constructor.
97+- Local definitions may start any body, "visible to each other and the final expression".
98+- `/- todo` gives the molds of `/sur/todo.hoon` the module uses; `/% %todo-action` gives a mark's type, named after the mark, with no face; `/= card /ui/components/card` gives a Jibb module. API modules re-export their `/%` types, "not `/-` faces or `/=` modules". Import cycles are errors.
99+- Imports and prelude groups are records, read with `.`: `card.card`, `space.theme.theme`, `get.by`. "A module used as a whole value is a cell of its definitions, in name order."
100+- `main`'s type decides a module's kind: `(element !!)` a page, `(page R D)` a page with data, `(program D X M)` an island, `(store S)` a store; no `main`, a library.
101+
102+**Importing Hoon types** (overview: Importing Hoon types; Decisions: Hoon types)
103+- The table: `$%`, `$?` and `$^` become unions only if their cases differ as nouns, else an error where used; `$@` a union with an atom case; `$~` dropped; `map`, `set`, `qeu`, `jar`, `jug` the same, by name; `mop` as `(mop K V)`, read with `on`; other `$|` their base type; `%0`, `%&` and `%|` tags; recursive molds recursive, matched by name; imported records with duplicate field names, cores, gates, vases, signed and float auras are errors where used.
104+- "Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file are fine." A field's unnamed union imports too, although Jibb cannot write one.
105+
106+**Islands, pages and stores** (overview: The Elm architecture on Urbit; Grammar: Modules and the store example)
107+- `(page load view)`, `(program init update view subs)` and `(store init update)` build the kinds. The worked examples show their gates' shapes: `update` takes `[msg model]` and gives a model and a list of `cmd`s, `subs` gives a list of `sub`s, a store's `update` takes a poke and the state.
108+- `main.todo-list` "is a record of exactly `init`, `update`, `view` and `subs`"; in `island main.todo-list ts`, `ts` is "the island's data, checked against `init`'s sample"; `island` gives an `(element !!)`, which keeps islands out of islands.
109+- "Island data and models can't hold gates; the checker names the field."
110+
111+**API files, stores and derived gates** (overview: Agent APIs, Effects; Grammar: Modules)
112+- `/ui/api/<agent>.jibb` declares `+$ poke` and `+$ paths`; "`poke` and `paths` are declarations, not molds." "A path case is a request name, a path and a type", and "A case can name another scry path, as in `[%changes /updates (facts todos todo-update) scry=/todos]`, used only by pages." An island may watch a request only when the checker proves it is watchable; a separate `scry=` path or unknown watchability is a type error.
113+- Each poke type gives a constructor, as `todo-action.todo`, and each path case a request, as `(todos.todo |=%got)`. A path with typed segments takes them too: the overview's `(post.api slug same)` suggests they come first. A `(facts full diff …)` case's request also takes a fold, as `$-([[%todo-update todo-update] todos] todos)`.
114+- A store's `+$ poke` is a declaration, not a mold. A store exports a constructor per poke type and a `state` request. Clashing derived names are errors, including clashes with an import face. The checker must account for the fact that the type of `main` determines whether a module is a store.
115+
116+**The prelude** (overview: Prelude, Layout and styling, Links and URLs, Effects)
117+- Hoon's standard library regrouped, "written in Jibb and vendored as `/lib/jibb/prelude`", plus `eq`, `not`, `page`, `program`, `store`, `pure`, `island`, the layout elements and molds, `attr`, `theme`, and `cmd` and `sub` as the overview's Effects block writes them.
118+- Signatures change where the Prelude table says: `clap` takes two units of one value type and a combining gate over that type; the value gate `(like convert result)` maps the product of a `(like A)` to a `(like B)`, preserving position and remaining input; maps and sets are plain gates over Hoon's trees, as `(get.by m k)`; folds take a start, as `(roll xs init f)`, `rep.by` and `rep.in`; ordered maps go through lull's `on`, as `(get.on lte m k)`.
119+- Left out: signed and float gates, parser helpers outside 3g other than the explicitly listed `slav` and `slaw`, and the table's "The rest" (1b, 2p, 3d, 3f, 4c, 4n, 4o, 5a–5f); "`jam`, `cue` and `fein` run inside the runtime".
120+- Write the prelude in Jibb, enough to give every name its type. Foundational gates use private low-level primitives from the internal prelude module. Jetted functions have working Jibb implementations; the compiler recognizes their shapes and uses the Hoon versions so jets can fire. They may take gates as arguments; the Nock backend comes in milestone 3.
121+- Element signatures are in the Layout and styling table. Paths and unchecked cords have separate declarations, with `link-unsafe`, `image-unsafe` and `go-unsafe` for the unchecked forms. Both navigation declarations produce `[%go url=@t]`; `go` converts its application path to a cord including the app's base path. "The same attribute twice in a literal list is an error."
122+
123+**Errors**
124+- Each one the Grammar tab describes needs a golden case with its message. A start on the list: an aura mismatch; mismatched faces; "msg has no case %submitt"; an unresolved tag, as the Grammar's `add-button` ("nothing fixes the union of %add"); an open constraint at the end of a module; a `|=%tag` whose union has no case with an equal literal head; a union whose cases overlap; a missing `?-` case, named; an arm that earlier arms cover; a value that refers to itself; a shadowed name, including a prelude or imported one; a cell in `{…}` with no printer; an atom of a generic aura in `{…}` or a path's `(…)`; a capital that a body makes a `@ud` or a list; `~[text "hi"]`, where the checker suggests `~[(text "hi")]`; clashing derived names; an import cycle; from an import, a signed or float aura, a core, gate or vase, or a `$%`, `$?` or `$^` whose cases don't differ as nouns, or a record with duplicate field names, each where used; a `(facts …)` outside an API file's `paths`; a gate in island data or a model, naming the field; a repeated attribute in a literal list. Read the Grammar tab, and the other tabs' mentions of "error" and "the checker", and make the list complete.
125+- For a `+$` whose cases overlap or do not fit, suggest that a record or tuple leaves its `[` open on the `+$` line. `+$ pt` above `@t` and `[@ud @ud]` is a valid union.
126+- "Each error names both conflicting sites, with excerpts." Today's `error` is `[file line col msg]`, a start only; spans keep each node's end so that a type error can underline both sites.
127+- Messages name things in the doc's words and quote the code they're about in backticks, as milestone 1's do. Their wording is fixed by the golden tests once written.
128+
129+## Suggested design
130+
131+Suggestions, not rules; change them where you find better.
132+
133+- **Keep the checker a function.** `urbit eval` can't scry, so let the caller pass in what comes from Clay: the source of each imported module, or its checked interface, each imported Hoon type, and the prelude, which jibb-dev vendors beside the library as `/lib/jibb/prelude` (overview, Desk layout). On a ship the host (milestone 4) reads them; in tests the harness does, loading the prelude once per run. The plan caches "per module, with its interface and body hashed separately", so make a module's interface, its exported names, molds and types, a noun of its own.
134+- **A way into the importer.** Under `urbit eval`, this compiles a `/sur` file and reads a mold's type (checked on 2026-10-30, vere 4.6):
135+ ```hoon
136+ =/ cor=type -:(ride -:!>(..zuse) src) :: src: the /sur file's text, with no Ford runes
137+ =/ t=type (~(play ut cor) (ream '*action')) :: the type of an action
138+ ~(repo ut t) :: expands one %hold
139+ ```
140+ `..zuse` is the subject a ship builds `/sur` files against, so molds from lull and zuse, such as `json` and `mark`, resolve. Each `+$` arm's type comes as a `%hold` whose expansion is a `%hint` with a `%made` note naming the arm, then the mold: a `$%` is a `%fork` of cells headed by `%tas` constants. A `(map id item)` field is named only in its arm's own `%hold`, whose Hoon calls `map` by name. Once the arm is expanded, the field is a `%hold` whose Hoon is the body of `map`, `(tree (pair key value))` with its `apt` check, which expands to a second `%hold`, `tree`'s body, and only then to a treap's `%fork`. So recognising maps, sets and the rest by name means reading an arm's Hoon before expanding it, or comparing a `%hold`'s Hoon with the standard library molds' own bodies. On a ship, `.^(vase %ca /=my-app=/sur/todo/hoon)` builds a `/sur` file, and a mark's type is its door's sample. Most of Tlon's `/sur` files begin with `/-` or `/+` (25 of the 40 in `tloncorp/tlon-apps`, `desk/sur`, on 2026-10-30), so under eval their imports must be resolved by hand; on the ship Clay does it.
141+- **Inference**: union-find over a map of variables, levels for generalization rather than scanning the environment, and a queue of deferred constraints, retried as variables are bound and reported when the module ends. Infer `++`s in strongly connected groups. Measure early: Hoon is slow, and a 2,000-line module should check in seconds, not minutes.
142+- **Exhaustiveness**: Maranget's "Warnings for pattern matching" (Journal of Functional Programming, 2007) fits nouns: constructors are constants and cells.
143+- **A type printer** for golden output and messages. Use Jibb's mold syntax where possible; Jibb has no syntax for an unnamed union, which prints its cases separated by spaces, as `%approve %deny`.
144+- **Mind two names.** The library's `+in`, a bit test, hides the standard library's set door `in`, and `+fail` hides Hoon's parser rule `fail`. Write `in:..zuse`, or rename `+in` before the checker uses sets.
145+
146+## Tests
147+
148+- **A third golden output.** Add the checker's output to `+golden`, say `types.txt`: each definition's type (printing an unnamed union's cases separated by spaces) and the module's kind, or the rendered error. Teach `tools/golden`, `tools/ship gen-tests`, the stubs and self-tests in `tools/testdata`, README.md and `docs/development.md` about it, with an `expect:` form for the checker, then add it to the existing cases and review every one.
149+- **Cases with imports.** Six of the doc's fourteen `jibb` blocks import other modules, three of them `/sur` files or marks, and the Core language tab's `update` needs the todo API without importing it. Give a case a way to carry the files it imports, under eval and on the ship alike. A case also needs its own path under `/ui`: both runners pass the file as `/tests/golden/<case>/source/jibb`, but an API file is known by its path, `/ui/api/<agent>.jibb`, whose name is the agent its constructors poke.
150+- **Hoon files on the ship.** `tools/ship test` runs `-test` on the `jibb-dev` desk's `/tests`, which builds every `.hoon` file there as a test file. A fixture mark that starts `/- todo`, or one of Tlon's files, fails that build, and with it the run. Keep such files where `-test` won't build them, as `.txt` read with `/*`, or in a desk of their own, and keep them out of `jibb-dev/`, which app desks vendor, and `vendor/`, which goes into every desk.
151+- **Fixtures for the doc's examples.** `my-app/ui/` holds nine of the doc's blocks as modules. Add what they import that the doc doesn't show: `/sur/todo.hoon` and the marks `todo-action`, `todos`, `todo-update` and `todo-item` (the overview shows `/mar/todo-action.hoon`; `row-of` reads `id`, `done` and `text` from an item); `/sur/blog.hoon`, a mark for the posts, of type `(list post:blog)`, and `/ui/api/blog.jibb`, whose `posts` case names that type through `/%`; and `/ui/components/card.jibb`, with a `card` gate from a post to an element. Keep them as small as the examples allow, say in a comment at the top of each that it is a fixture and not from the doc, and don't change the doc's blocks.
152+- **Every doc example typechecks**, except the Grammar's buttons example, whose `add-button` is written as an error and must fail with it. The same block marks `labelled` and `wide` as fine, so show them checking too, by printing the definitions that check beside the error or in a case without `add-button`. Check the three blocks that aren't whole modules in their intended contexts: `cmd` and `sub` as prelude source, the Core language tab's `update` inside the todo island, and the imports example against fixtures.
153+- **The `/sur` import.** A test `/sur` file with `$%`, `$@`, a map and a recursive mold, imported and printed, using the print-only notation for unnamed unions when needed, under eval and on the ship. Then Tlon's real files, as the risk asks: they need not import fully, but every mold a test uses must, and any error must be the table's.
154+- **On the ship**: the golden cases as `-test` arms, and the `my-app` desk checked with its Hoon types read through Clay: every module checks except `ui/components/buttons.jibb`, which gives `add-button`'s error.
155+- **Speed**: time the corpus and the `my-app` desk, and record both in `docs/status.md`.
156+
157+## Out of scope
158+
159+- Lowering, the core language, its interpreter and the Nock backend: milestone 3.
160+- Checking application paths against routes and static files, routing, the theme's contrast check and the host: milestone 4. Type `%/blog/(slug)` as a `qath` and its segments as printable atoms, no more.
161+- `load`'s per-request behaviour and binding route parameters: milestone 5. `page`'s type and `load`'s signature are in scope.
162+- The JavaScript backend and the runtime: milestone 6. The formatter and the tree-sitter grammar: milestone 7.
163+
164+## When you're done
165+
166+- The plan's three "Done when" items hold, but for the route check, and every check in `docs/development.md` passes under eval and on the ship.
167+- `docs/status.md` shows milestone 2 done, with counts and timings; `docs/open-questions.md` lists what's still open; `docs/compiler.md`, `docs/development.md` and the library's notes describe the checker.
168+- Everything is pushed to `master`.
169+- Report to @iko in the project's chat, in a few lines: what was built, the test counts and timings, the decisions you needed and got, and what's still open.
docs/spec/core-language.mdnew file+176
@@ -0,0 +1,176 @@
1+# Core language
2+
3+Oct 29, 2026 · @iko
4+
5+After checking, every Jibb module lowers to the core language: Nock's operations on nouns, plus a lambda calculus with names. The Nock and JavaScript backends both compile it, and an interpreter for it, written in Hoon, is the reference both are tested against. Rules marked *proposed* aren't decided yet.
6+
7+## Nodes
8+
9+Fifteen kinds of node: seven that build and test nouns, each one Nock operation; five for control; and natives, crashes and traces.
10+
11+| Node | Value |
12+| --- | --- |
13+| `42`, `%add`, `"milk"` | The atom written, in Jibb's literal syntax |
14+| `x` | The value bound to `x` |
15+| `(cons e f)` | The cell of `e` and `f` |
16+| `(slot n e)` | The value at axis `n` of `e`; crashes if there is none, as Nock 0 does |
17+| `(edit n e v)` | `e` with axis `n` replaced by `v`; crashes if `e` has no axis `n`, as Nock 10 does |
18+| `(cell? e)` | `%.y` if `e` is a cell, else `%.n`, as Nock 3 |
19+| `(eq e f)` | `%.y` if the two nouns are equal, else `%.n`, as Nock 5 |
20+| `(if c t f)` | `t` if `c` is `%.y`, `f` if it's `%.n`; crashes on anything else, as Nock 6 does |
21+| `(let x e b)` | `b`, with `x` bound to `e` |
22+| `(rec ((f l) …) b)` | `b`, with each `f` bound to its `lam`, all visible to each other |
23+| `(lam x b)` | A function of one sample, bound to `x` in `b` |
24+| `(app f e)` | `f` called with `e` as its sample |
25+| `(native n)` | The native function `n` |
26+| `(crash)` | A crash, as `!!` |
27+| `(trace m b)` | Prints the cord `m`, then is `b`, as `~&` |
28+
29+Literals keep the aura they were written with, but only for printing and as a hint to the JavaScript backend. A call with several arguments passes one cell, as Nock's gates take one sample.
30+
31+## Values and invariants
32+
33+A value is a noun or a function. A function can sit inside a cell, but it isn't a noun: each backend represents it its own way, and it never crosses between ship and browser.
34+
35+The front end guarantees the backends:
36+
37+- **No shadowing.** No binding hides another: Jibb forbids it, and generated names start with `_`, which Jibb names can't.
38+- **`rec` binds functions.** Every right side of a `rec` is a `lam`.
39+- **Functions aren't taken apart.** `cell?`, `eq`, `slot` and `edit` never get a function itself, and `eq` never compares nouns that contain one. Island data and models are already first-order. So are `eq`'s arguments and map and set keys, and a gate never tells a union's cases apart.
40+- **Strict evaluation.** A call's sample is evaluated before the call, and a node's parts in text order; `if` evaluates only the branch it takes. Only `trace` and `crash` can observe the order, and differential tests compare results and whether a program crashes, not traces. So the backends may evaluate a node's parts in another order, as Nock 10 does with edit's v and e.
41+- **Crashes stay crashes.** Where types already guarantee a test, the backends still crash on a violation, as Nock does, instead of carrying on.
42+
43+## Text form
44+
45+S-expressions, so each stage's output can be printed, read back and tested on its own, and backend work can start on hand-written programs.
46+
47+```
48+expr = literal | name
49+ | "(" "cons" expr expr ")"
50+ | "(" "slot" axis expr ")"
51+ | "(" "edit" axis expr expr ")"
52+ | "(" "cell?" expr ")"
53+ | "(" "eq" expr expr ")"
54+ | "(" "if" expr expr expr ")"
55+ | "(" "let" name expr expr ")"
56+ | "(" "rec" "(" { "(" name lam ")" } ")" expr ")"
57+ | lam
58+ | "(" "app" expr expr ")"
59+ | "(" "native" name ")"
60+ | "(" "crash" ")"
61+ | "(" "trace" expr expr ")" ;
62+lam = "(" "lam" name expr ")" ;
63+module = "(" "module" path { "(" "def" name expr ")" } ")" ;
64+name = jname | path ":" jname | "_" ( letter | digit ) { letter | digit } ; (* own or prelude, imported, generated *)
65+axis = digit { digit } ; (* at least 1 *)
66+```
67+
68+- `literal` is Jibb's literal syntax, and the form a literal was written in is the aura the printer writes it back with.
69+- `jname` is a Jibb name; `path` is a module's path under `/ui`, as in `api/todo:todo-action`.
70+- Whitespace separates items, and `::` starts a comment. Source positions aren't written, so golden tests don't change when lines move; the printer can add them as comments.
71+
72+## Lowering from Jibb
73+
74+Types, faces and casts leave nothing behind. Everything else lowers by these rules.
75+
76+| Jibb | Core language |
77+| --- | --- |
78+| A number, ship, date, term, loobean, `~`, or a string without `{…}` | An atom literal, keeping its aura |
79+| `"Since {day}"` | `(app (native join) …)` on a list of the pieces, each atom printed first by its aura's native |
80+| `` `x `` | `(cons ~ x)` |
81+| `[a b c]`, `[x=a y=b]`, `~[a b]` | Right-nested `cons` in field order; a list ends in `~` |
82+| `gap+%s2` | `(cons %gap %s2)` |
83+| `/posts/~zod`, `%/blog/(slug)` | A list of knots, typed segments printed by their aura's native; the runtime adds the base path to an application path |
84+| `title.p`, `space.theme.theme` | `slot` at the field's axis, nested for longer wings |
85+| `(proj record)` | Apply a `lam` to the source once; its body constructs the expected record from the required fields using `slot` and `cons`, discarding extra fields |
86+| `card.card`, an import | The qualified name `components/card:card` |
87+| `m(draft=t error=~)` | One `edit` per item, in order: `(edit 7 (edit 6 m t) ~)` |
88+| `f a b c` | `(app f (cons a (cons b c)))`: the arguments are the sample |
89+| `\|= [a=@ b=@] body` | `(lam _1 (let a (slot 2 _1) (let b (slot 3 _1) body)))`; a single face, as in `\|= m=model`, names the `lam` itself |
90+| `\|=%got` | `(lam _1 (cons %got _1))` |
91+| `++` definitions, at top level or in a gate | A `rec` per group of gates that call each other; a `let` per other value, in dependency order |
92+| `?- s` | `(let _1 s …)` around a decision tree of `if`, `cell?`, `eq` and `slot`, built by the usual pattern-matrix algorithm; binders become `let`s, and tests the types make redundant are left out |
93+| `?-` on a loobean | `(if s yes no)` |
94+| `^- t e` | `e` |
95+| `~& v body` | `(trace (app _p v) body)`, where `_p` is a printer derived from `v`'s type |
96+| `!!` | `(crash)` |
97+| Derived gates and `pure` | `lam`s that build the cells the runtime reads |
98+| Checks on incoming facts | A validator derived from the path's type, which the runtime runs on each fact |
99+
100+## Example
101+
102+The todo island's `update`, from worked example 3:
103+
104+```jibb
105+++ update |= [=msg m=model]
106+ ?- msg
107+ [%typed t]
108+ ?- (gth (lent (tuba (trip t))) 80)
109+ %.y [m(draft=t error=`"Too long") ~]
110+ %.n [m(draft=t error=~) ~]
111+ %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
112+ [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
113+ [%got ts] [m(todos=ts) ~]
114+ [%acked err] [m(error=err) ~]
115+```
116+
117+lowers to the program below. The model `[todos draft error]` puts `todos` at axis 2, `draft` at 6 and `error` at 7, and `%submit`, the only atom case, needs no test once `cell?` fails.
118+
119+```
120+(def update
121+ (lam _1
122+ (let msg (slot 2 _1)
123+ (let m (slot 3 _1)
124+ (if (cell? msg)
125+ (let _2 (slot 2 msg)
126+ (if (eq _2 %typed)
127+ (let t (slot 3 msg)
128+ (if (app (native gth) (cons (app (native lent) (app (native tuba) (app (native trip) t))) 80))
129+ (cons (edit 7 (edit 6 m t) (cons ~ "Too long")) ~)
130+ (cons (edit 7 (edit 6 m t) ~) ~)))
131+ (if (eq _2 %toggled)
132+ (let id (slot 3 msg)
133+ (cons m (cons (cons %poke (cons (app api/todo:todo-action (cons %toggle id)) (lam _3 (cons %acked _3)))) ~)))
134+ (if (eq _2 %got)
135+ (let ts (slot 3 msg) (cons (edit 2 m ts) ~))
136+ (let err (slot 3 msg) (cons (edit 7 m err) ~))))))
137+ (cons (edit 6 m "")
138+ (cons (cons %poke (cons (app api/todo:todo-action (cons %add (slot 6 m))) (lam _4 (cons %acked _4)))) ~)))))))
139+```
140+
141+## Programs and linking
142+
143+- Each module lowers to `(module <path> (def name e) …)`, in source order. Its own and the prelude's definitions are named plainly, since no name may shadow another; imports are qualified, as in `api/todo:todo-action`.
144+- The linker builds one program per entry: on the ship, each page; in the browser, each island's `update`, `view` and `subs`, and each store. It keeps only the definitions the entry reaches, sorts them by dependency into `let`s and `rec`s, and ends with the entry.
145+- Values that aren't gates are computed once per program, before anything calls them; the Nock backend may compute them at build time. A value that depends on itself, even through a gate, is an error.
146+- A module used as a whole value is a cell of its definitions, in name order.
147+
148+## Natives
149+
150+- Jetted prelude functions have working Jibb implementations. Foundational gates use private low-level primitives from the internal prelude module. The compiler recognizes the functions' shapes and uses the corresponding Hoon versions, so their jets can fire. The JavaScript runtime supplies corresponding implementations; differential tests check their behavior.
151+- The lowering uses a few private ones: `join` for interpolation, a printer per aura, and the map and set checks in validators.
152+- Jetted prelude functions may take gates. On the ship a Jibb gate is shaped like Hoon's, so functions such as `turn`, `sort` and `skim` can call it. In JavaScript native implementations can use loops, which keeps long lists off the stack. Such a function only calls the gate and never takes it apart, so the invariant above still holds.
153+
154+## Backends
155+
156+Each node becomes a few Nock operations, or a few lines of JavaScript calling the runtime.
157+
158+| Node | Nock | JavaScript |
159+| --- | --- | --- |
160+| Literal | `[1 a]` | A number or a constant atom; a cord also keeps its string |
161+| `x` | `[0 a]`, at `x`'s axis in the subject; a name bound by `rec` is an arm of its core, `[9 a 0 c]` with `c` the core's axis | A variable |
162+| `cons` | A cell of the two formulas | `cell(e, f)` |
163+| `slot` | `[7 e 0 n]` | `slot(n, e)` |
164+| `edit` | `[10 [n v] e]` | `edit(n, e, v)` |
165+| `cell?` | `[3 e]` | `isCell(e)` |
166+| `eq` | `[5 e f]` | `same(e, f)` |
167+| `if` | `[6 c t f]` | A conditional that crashes on anything but 0 or 1 |
168+| `let` | `[8 e b]`, pushing the value onto the subject | `const` |
169+| `rec` | A core with an arm per function, as `\|%` builds | Function declarations |
170+| `lam` | A gate shaped like Hoon's: `$` at axis 2, sample at 6 | A closure of one argument |
171+| `app` | `[9 2 10 [6 e] f]` | `f(e)`; a self call in tail position becomes a loop |
172+| `native` | The native's Hoon gate | The native's runtime function |
173+| `crash` | `[0 0]` | A thrown crash |
174+| `trace` | A `%slog` hint, Nock 11, carrying `[0 leaf+(trip m)]`, since `%slog` takes a priority and a tank, not a cord | `console.log`, then `b` |
175+
176+Gates are shaped like Hoon's, so `app` calls a Jibb gate and a native's Hoon gate the same way, and Hoon code can call Jibb gates.
docs/spec/decisions.mdnew file+114
@@ -0,0 +1,114 @@
1+# Jibb decisions
2+
3+Oct 29, 2026 · @iko
4+
5+The choices behind the Language tab, made on 2026-10-23; a later date marks a revision.
6+
7+## Decisions
8+
9+| Decision | Choice | Status |
10+| --- | --- | --- |
11+| Syntax | Hoon's runes as keywords, and its literals; wide forms only for `\|=` and `$-`; changes take one or more record items, as `m(draft="x")`, so `m()` is an error; `.` reads fields, imports and prelude groups; no name may shadow another | Decided 2026-10-30 |
12+| Literals | Exactly Hoon's, including `%$` as a term literal and pattern: `1000` is an error, `~2026.2.31` is `~2026.3.3`, and years BC and sub-second groups are dates; `print-date`'s minute form is not a literal | Decided 2026-10-30 |
13+| Cells | A single-item cell `[a]` is `a`; an empty `[]` is an error, in expressions and molds | Decided 2026-10-30 |
14+| Numeric terms | `%` and a decimal as Hoon writes it: `%1.000`; `%1000` and `%007` are errors | Decided 2026-10-30 |
15+| Strings | Hoon's escapes: `\\`, `\"`, `\{`, and `\` with two lowercase hex digits; a string and each `{…}` close on the line they open; `::` in a string is text | Decided 2026-10-30 |
16+| Spacing | Style, kept by the formatter: one or more spaces between items, and spaces allowed after an opener, before a closer and at the end of a line; faces, puns and typed path segments take no spaces; a rune is followed by one | Decided 2026-10-30 |
17+| Path literals | `/posts/~zod` is an expression: `pathlit` is an operand | Decided 2026-10-30 |
18+| Crash | `!!` is an operand, so `f !!` and `~[!!]` need no parentheses | Decided 2026-10-30 |
19+| Sample names | Every bare name in a sample binds, at any depth: `\|= [a=@ b]` binds `a` and `b` | Decided 2026-10-30 |
20+| Local definitions | At the start of any body: a gate's, an arm's, a `^-`'s, a `~&`'s or a `++`'s | Decided 2026-10-30 |
21+| Value cycles | A non-gate value that depends on itself, even through a gate, is an error; mutually recursive gates are allowed | Decided 2026-10-30 |
22+| Open molds | A mold's `[` and `(` may be left open at line end, one field or mold per deeper line; a `(` keeps the mold's name on its first line | Decided 2026-10-30 |
23+| Open groups | A `(` alone at line end puts the call's head on the first deeper line | Decided 2026-10-30 |
24+| Several open brackets | The deeper lines go to the last bracket, or the last rune's body, left open on a line, and the brackets before it close with it: `(column ~ ~[` needs no `)` | Decided 2026-10-30 |
25+| Jibb code blocks | Labelled `jibb` in this doc; each is a golden test | Decided 2026-10-30 |
26+| Definitions | `++` for values, `+$` for molds; no `=/` | Decided |
27+| Unions | No `$?`: a `+$` with its cases on the lines below is a union, so every union written in Jibb has a name; one case is just that mold; a mold that isn't a union counts as a union of one case for tags and `\|=%tag`; a generic's `\|$` comes right after the `+$`'s name; tags anywhere; constructor heads and case disjointness compare literal noun values regardless of spelling, so `%$`, `%.y` and `~` are equal and overlapping cases are errors; cases differ as nouns, with `?` treated as the two atoms `%.y` and `%.n`, disjoint from cells and overlapping constants 0 and 1, and `!!` or any cell with an empty position disjoint from every case; a tag literal or `~` waits for its union, and an unresolved one is an error | Decided 2026-10-31 |
28+| Printed unnamed unions | Print the cases separated by spaces, as `%approve %deny`; this is print-only, not Jibb syntax | Decided 2026-10-30 |
29+| Printed type constraints | Print an atom constraint as `$-([A A] A) where A is an atom`, an arithmetic atom constraint as `where A is an atom other than ?`, and a gate-free constraint as `$-([A A] ?) where A contains no gates`; separate multiple clauses with commas, as `where A is an atom, B contains no gates` | Decided 2026-10-31 |
30+| Branching | `?-` only, loobeans included; exhaustive, with explicit catch-alls; covered arms are errors; failures say `!!` | Decided 2026-10-29 |
31+| Equality and negation | The gates `eq` and `not`, with Hoon's bitwise `not` exposed as `not.bit`; `eq`'s arguments and map and set keys contain no gates, even nested; the checker infers and generalizes that constraint; union matching never inspects a gate to distinguish cases | Decided 2026-10-30 |
32+| Special rules | No built-ins; type-directed rules are welcome, each listed in the Grammar tab | Decided 2026-10-29 |
33+| Inference | Hindley–Milner with aura variables; `@` is any atom, a specific atom fits `@` and a more specific aura fits an ancestor in its Hoon aura family, but each reverse needs a check, and repeated atom-constrained capitals give the same type; a number takes `@ud` only where its `++` isn't generic over its aura; distinct specific auras remain distinct; faces are part of record types, and an unnamed position can take a face but two different faces don't unify; principal types | Decided 2026-10-30 |
34+| Effects | The library unions `cmd` and `sub`; `poke`, `ask` and `qath` are transparent types defined in the internal prelude and re-exported normally; derived gates and `pure` also construct requests; islands read agents only by watching; replies get full state, and diffs take a fold; timers carry the time; `%who` gives the owner's `@p`; nacks reach replies as text | Decided 2026-10-31 |
35+| Poke representation | The source-backed private internal prelude module defines `poke`, and the public prelude re-exports it as an ordinary transparent type. Ordinary modules can construct and inspect its values | Decided 2026-10-31 |
36+| Agent APIs | `/ui/api/<agent>.jibb` with `+$ poke` and `+$ paths`, over the agent's mark types; a case is a name, a path and a type, with `(facts full diff …)` for diffs, told apart by mark; an optional scry path, for pages; an island may watch a request only when the checker proves it is watchable, so a separate scry path or unknown watchability is an error; typed segments by aura | Decided 2026-10-31 |
37+| Mark names | Any name: `/%` names types after marks, and constructors poke with their type's mark; no alias marks | Decided 2026-10-26 |
38+| Derived gates | API files and stores give a constructor per poke type and a checked request per path or store state; clashing names are errors, including a derived name that clashes with an import face | Decided 2026-10-30 |
39+| Hoon types | A fixed translation table; `map`, `set`, `qeu`, `jar`, `jug` by name; `mop` as `(mop K V)`, read with `on`; imported `$%`, `$?` and `$^` cases must differ as nouns, and records with duplicate field names are errors where used; unused molds skipped | Decided 2026-10-30 |
40+| Record fields | Duplicate field names in a Jibb-written record are an error, as they are in an imported Hoon record | Decided 2026-10-31 |
41+| Record projection | The explicit type-directed operation `proj` takes a record and uses its expected result type to select its fields; no projection is inserted automatically. `proj` is reserved and cannot be defined or imported under that name. The result has exactly the fields declared by its type | Decided 2026-10-31 |
42+| Layout | Indentation; juxtaposed calls; a bracket open at line end takes one item per line, with no closer | Decided |
43+| Elements | Ordinary gates; containers take attribute lists; `stack` switches at `wide`; `el` adds attributes and wins; headings 1 to 6; `form` sends on Enter, the innermost when nested; `image` from an application path, sized from the file, or a sized URL; no focus control for now | Decided 2026-10-29 |
44+| Long calls | One argument per line inside parentheses | Decided |
45+| Inline gates | Hoon's wide form; the mold may be inferred; a bare sample name binds; `\|=%got` is a case's constructor, typed by the gate expected; a bare tag is always a value | Decided 2026-10-29 |
46+| Empty mold | `!!`, with no values; the expression has any type; pages are `(element !!)`, which keeps islands out of islands | Decided 2026-10-29 |
47+| Noun mold | `*` is the noun type, not a type variable; use a capital for a generic type; a value of a more specific noun type can be used where `*` is expected | Decided 2026-10-30 |
48+| Type variables | Capitals, generalized per `++`; a capital in a local `++` shares the enclosing `++`'s variable of that name if the enclosing `++` also uses it; otherwise it is introduced and generalized locally; a different type takes a different capital; a body cannot force distinct capitals to be equal, so a shared type uses the same capital; one used where an atom is required gains an inferred atom constraint, and cannot be fixed to a more specific type in its body | Decided 2026-10-30 |
49+| Partial type annotations | `_` may appear wherever a mold may appear and marks that part of the type for inference; a hole inferred as a named type variable is resolved; an unconstrained hole is an error, and a named mold or value definition must determine its own holes without constraints from later uses | Decided 2026-10-31 |
50+| Loobean mold | `?`, switched with `?-` | Decided 2026-10-26 |
51+| Defaults | None | Decided |
52+| Modules | Records, not cores | Decided |
53+| Kinds | The type of `main`: `(element !!)`, `(page R D)`, `(program D X M)` or `(store S)`; other names by file kind, in the Grammar tab | Decided 2026-10-29 |
54+| Type identity | Recursive molds by name and module | Decided 2026-10-29 |
55+| Binding patterns | In `?-` arms; the last position binds the rest | Decided 2026-10-29 |
56+| Text | Strings are written only as `"…"` and are always cords; tapes come from `trip`; `{…}` prints by aura, a bare `@` as `@ud`, and an atom whose aura its `++` is generic over is an error; `print-date` prints Urbit-style to the minute in the theme's zone, from jibb-dev's zone table; numbers keep Hoon's form | Decided 2026-10-30 |
57+| Auras | Specific auras stay distinct; `@` is any atom, a more specific aura fits an ancestor in its Hoon aura family one way, with the reverse requiring a check, and shared atom-constrained type variables preserve the same aura | Decided 2026-10-30 |
58+| Loobean arithmetic | Arithmetic rejects loobean operands; comparison may accept them and returns `?` | Decided 2026-10-31 |
59+| Crashes | As in Hoon; an island keeps its model and shows the standard notice; a failing page, or one rendering a control outside an island, gets Jibb's error page; no render limit, so an endless render stalls the ship | Decided 2026-10-29 |
60+| Refinement types | None | Decided |
61+| Imports | `/-`, `/%` (a mark's type, with no face) and `/=`; no `/+`; cycles are errors | Decided 2026-10-29 |
62+| Hoon marks for Jibb types | None: wire types are the agent's marks, and Jibb's own types never cross | Decided 2026-10-26 |
63+| Core language | A small untyped core language between the checker and both backends: Nock's operations on nouns plus a lambda calculus with names; one sample per call; s-expressions as its text form; a reference interpreter in Hoon; three rules in its tab still proposed | Decided |
64+| Stages | By kind: pages without data at commit, with data in the host, islands and stores in the browser; never inferred | Decided 2026-10-29 |
65+| Page loading | `load` maps route parameters, `~` for none, to one `ask` or `pure`; pages render per request from a fresh scry of the path, or of its case's scry path; nothing is watched or kept | Decided 2026-10-29 |
66+| Compile targets | Nock on the ship, JavaScript in the browser | Decided |
67+| Optimizer | Basic lowering; holes later | Decided 2026-10-29 |
68+| Island `update` | In the browser | Decided |
69+| Island `init` | Takes the page's data, returns the model | Decided 2026-10-29 |
70+| Island rendering | `view` re-runs on model changes; a keyed diff patches the DOM; holes later | Decided 2026-10-29 |
71+| Data crossing to the browser | No gates in island data or models | Decided 2026-10-29 |
72+| Inputs | A message per input event, none mid-composition; controls reset to the latest view after every event; fields read-only until the island starts | Decided 2026-10-29 |
73+| Transactions | None; one poke per command | Decided |
74+| Reloads | Restart from the model the page is served with | Decided 2026-10-29 |
75+| Shared state | Stores: browser agents written like API files, with `state`, `+$ poke` and `(store init update)`; the store's `+$ poke` is a declaration, not a mold; derived gates provide poke constructors and state requests; one per page | Decided 2026-10-31 |
76+| Subscriptions | By agent and path, shared per page; the first fact is full state, so no paths that need a scry path | Decided 2026-10-29 |
77+| Apps | One island under a catch-all route, given the path by `pure`; `%url` delivers the path on every change; in-section links act as `go`; focus moves to the first heading | Decided 2026-10-29 |
78+| Layout vocabulary | Jibb's elements and theme tokens; the stylesheet comes from the theme alone; chars and fill are inline; `[%fill n]` below 1 counts as 1 | Decided 2026-10-29 |
79+| Responsive layout | `stack` switches at the theme's `wide` | Decided 2026-10-29 |
80+| Theme | A prelude mold with every token required: spaces, five tones with `normal` and `background`, language, zone, `wide`, and an optional static font; 4.5:1 contrast enforced | Decided 2026-10-29 |
81+| Dark mode | Hand-written dark tones under `dark`, used when the reader prefers dark | Decided 2026-10-27 |
82+| Links | All text escaped; in-app links are application paths, as `%/blog/(slug)`, with no query or fragment, checked at compile time against routes and static files; paths and unchecked `https`, `mailto` and `tel` URLs and root-relative cords such as `"/apps/groups"` have separate declarations; `link-unsafe`, `image-unsafe` and `go-unsafe` are the unchecked forms; both navigation declarations produce `[%go url=@t]`, with `go` converting the path to a cord including the app's base path; other cords render as text; a CSP on every page | Decided 2026-10-30 |
83+| Data layer | Hoon's nouns: units, treaps, loobeans | Decided |
84+| Prelude | Hoon's standard library regrouped: all names from the listed sections except explicitly excluded groups, including all of 3g, with Hoon's `tone` exposed as `tone.hoon` and Hoon's 1c `step` as `step.hoon`; arithmetic over aura variables, units, lists, maps, sets, queues, ordered maps, function helpers, text, atom printing, a zoned date printer, time and data molds; folds take a start; jetted functions have working Jibb implementations, whose shapes the compiler recognizes to use the Hoon versions, and may take gates; private helpers and low-level primitives live in a separate internal module imported without exposing them, with public foundational gates implemented in Jibb on those primitives; `clap` takes two units of the same type and a combining gate over that type; no signed or float gates, or parser gates outside 3g except `slav` and `slaw`; signed or float auras are errors | Decided 2026-10-30 |
85+| `like` | The `(like A)` mold remains available; the value gate `like` maps the product of an existing `(like A)` with a gate `$-(A B)`, preserving the position and remaining input, and returns `(like B)` | Decided 2026-10-31 |
86+| Wire format | Noun channels; Jibb's own noun codec in the browser | Decided 2026-10-29 |
87+| Hosting | One thin host agent on `%jibb` binds, caches and serves every Jibb desk; each desk vendors jibb-dev, names its base path in docket's `site+`, and builds and renders with its own copy through fixed entry points; install `%jibb` first; app agents stay plain Hoon; pokes only from the ship | Decided 2026-10-29 |
88+| Private pages | Served by the host per request and never cached; non-owners go to the login page | Decided 2026-10-29 |
89+| Cache | Eyre holds only the hashed assets, all public; the host serves every page; a desk's entries are cleared on suspend or uninstall, and all by `-jibb!clear` | Decided 2026-10-29 |
90+| Static files | Under `/ui/static/`, committed, at hashed immutable URLs; referenced by application path, so a missing file fails to compile, and images are sized from the file; no large media, since Clay keeps every version and the cache ignores `Range` | Decided 2026-10-29 |
91+| Routing | A literal beats a parameter, which beats a catch-all; parameters bind to `load`'s sample by name; `@ta` and `@tas` raw, other auras as Hoon prints them | Decided 2026-10-29 |
92+| Linking | Folder convention; the mark stores text; the host runs each desk's own compiler; modules cached by their own and their imports' hashes | Decided 2026-10-29 |
93+| Access | Every page is private to the owner; public pages come in a later version | Decided 2026-10-29 |
94+| Tests | `test-…` arms under `/ui/tests`, run by `-jibb!test`; the JavaScript side and differential tests under Node from jibb-dev | Decided 2026-10-29 |
95+| Editor support | Tree-sitter grammar | Decided |
96+| Formatter | One canonical layout | Decided |
97+| Name | Jibb | Decided |
98+
99+## Checked against the kernel
100+
101+- **Eyre's cache** is keyed by the exact request target, query included, one entry per URL, and counts against the ship's memory ([eyre.hoon](https://github.com/urbit/urbit/blob/50c7f5239610fc72263df7aa99b4d171cfe9d408/pkg/arvo/sys/vane/eyre.hoon#L922-L927), [vere #626](https://github.com/urbit/vere/issues/626)). An auth-flagged entry gives anyone but the owner a bare 403 before any agent sees the request ([vere http.c](https://github.com/urbit/vere/blob/510d5b7fe4ea81343f2364db081ce61f1d2c72d3/pkg/vere/io/http.c#L1141-L1146)), and entries outlive their agent ([gall.hoon](https://github.com/urbit/urbit/blob/50c7f5239610fc72263df7aa99b4d171cfe9d408/pkg/arvo/sys/vane/gall.hoon#L1382-L1409)).
102+
103+## Build order
104+
105+Each step ends in something usable.
106+
107+1. **Parser and mark**: the layout pass, runes, literals and patterns; the `%jibb` mark.
108+2. **Types and prelude**: inference with aura variables and tag resolution; `/-`, `/%` and `/=`; the Hoon type table; the core prelude gates.
109+3. **Core language**: lowering from the checked tree, the text form, the reference interpreter in Hoon, and the Nock backend.
110+4. **Host and static pages**: the shared host running vendored compilers, routing and application paths, layout and theme, static files, the Eyre asset cache and the owner check. First release.
111+5. **Published pages**: `load`, requests and per-request rendering.
112+6. **Islands**: first a benchmark that runs the same programs as JavaScript and in a Nock interpreter, to pick the browser backend; then that backend, `cmd` and `sub`, keyed diffing, the shared library, stores, the crash notice and URL subscriptions.
113+7. **Tooling**: tests, formatter, tree-sitter grammar and differential tests.
114+8. **Polish**: shared island modules across pages, holes, size.
docs/spec/grammar.mdnew file+344
@@ -0,0 +1,344 @@
1+# Jibb grammar
2+
3+Oct 29, 2026 · @iko
4+
5+The syntax the compiler accepts.
6+
7+## Lexical rules
8+
9+- **Indentation is structure**: a deeper line continues the line above; returning to an earlier indentation closes every block since. Spaces only; blank and comment-only lines don't count.
10+- **Layout tokens**: a deeper line emits INDENT, the same depth NEWLINE, a shallower one a DEDENT per closed level, then NEWLINE.
11+- **Open brackets**: a bracket open at line end takes one item per deeper line and closes at the first line that isn't deeper, with no closer. Brackets opened and closed on one line work as usual. A mold's `[` and `(` open the same way, with one field or mold per deeper line. A line may leave several brackets open: the deeper lines go to the last one, or to the body of the last rune, and the others close with it, so `(column ~ ~[` above its items needs no `)`.
12+- **Tight forms**: `a+b`, `a.b`, `` `x ``, `|=%got` and the openers `~[`, `|=(`, `$-(` take no spaces. A `(` right after a wing is a change: `m(note=text)` changes, `m (note text)` calls. `%/` starts an application path, `%/blog/(slug)`.
13+- **Spacing**: one space between items; more for alignment. That is style, which the formatter keeps: the parser takes one or more spaces between items, and allows spaces after an opener, before a closer and at the end of a line. Faces `name=value`, puns `=name` and typed path segments `[id=@ud]` take no spaces, and a rune is followed by one.
14+- **Comments**: `::` to the end of the line, outside strings; inside a string, `::` is text.
15+- **Names**: Hoon terms; lowercase letters, digits and hyphens, starting with a letter.
16+
17+## Literals
18+
19+| Form | Example | Type |
20+| --- | --- | --- |
21+| Decimal | `1.000` | `@ud`, or any aura by context; groups of three, as in Hoon |
22+| Hexadecimal | `0x1f` | `@ux` |
23+| Base 32 | `0v5.fdf99` | `@uv` |
24+| Ship | `~zod`, `~sampel-palnet` | `@p` |
25+| Date | `~2026.10.23`, `~2026.10.23..14.30.00` | `@da` |
26+| Duration | `~s30`, `~h1.m30` | `@dr` |
27+| Knot | `~.my-post` | `@ta` |
28+| String | `"milk"`, `"Since {day}"` | `@t`, a cord; `{…}` prints by aura; tapes come from `trip`; there is no `'…'` form |
29+| Term | `%add`, `%1.000`, `%$` | A union's case, or that constant atom where an atom is expected; a numeric term is `%` and a decimal as Hoon writes it, so `%1.000`, never `%1000` |
30+| Loobean | `%.y`, `%.n` | `?` |
31+| Null | `~` | A constant: the `~` case of any union with one, such as `(unit A)`, `(list A)`, `(map K V)` or `(set A)` |
32+| Unit | `` `x `` | `(unit A)` |
33+| Cell | `[a b c]`, `[text="milk" done=%.n]` | A tuple; a record when faced; a cons where a list is expected. `[a]` is `a`; `[]` is an error |
34+| List | `~[1 2 3]` | `(list A)` |
35+| Term-headed pair | `gap+%s2` | `[%gap %s2]`, any operand after the `+` |
36+| Path | `/posts/~zod` | `path` |
37+| Application path | `%/blog`, `%/blog/(slug)` | `qath`, checked against routes and static files; no query or fragment |
38+
39+Every literal reads exactly as Hoon reads it: `1000` is an error (write `1.000`), `~2026.2.31` is `~2026.3.3`, years BC and sub-second groups are dates, and `~2026.10.29..14.30`, the minute form `print-date` writes, is not a literal.
40+
41+## Expressions
42+
43+- **Call**: `f a b`; parentheses only group. A call open in parentheses puts its head and first arguments on the first line, then one argument per indented line; a `(` alone at the end of a line puts the head on the first indented line.
44+- **Lists**: `~[a b c]`, or `~[` at line end with one item per line. On one line, whitespace separates items, so calls need parentheses: `~[(text "hi")]`, which the checker suggests for `~[text "hi"]`. On indented lines, each line is an item.
45+- **Faced cells**: `[text="milk" done=%.n]`, or one `name=value` per line of an open bracket. A change takes one or more of the same items, as `m(done=%.y)`; `m()` is an error.
46+- **Pairs and units**: `gap+%s2` and `` `x `` bind tighter than calls, so `pad+%s3 gap+%s2` is two items.
47+- **Wing** `title.p`, also for imports and prelude groups, which are records: `card.card`, `space.theme.theme`, `get.by`. **Change** `m(draft="x" error=~)`.
48+- **Inline gate**: `|=(p=post.blog title.p)`, or `|=(p title.p)` when the call fixes the type. A bare name in a sample always binds. `|=%got` is case `%got`'s constructor, typed by the gate expected. A bare name binds at any depth of a sample, so `|= [a=@ b]` binds `a` and `b`.
49+- **Interpolation**: `{…}` holds any expression; `\{` writes a brace and `\"` a quote; no `<…>`. Strings take Hoon's escapes: `\\` writes a backslash, and `\` with two lowercase hex digits writes that byte, as `\0a` a line feed; any other `\` is an error. A string and each `{…}` close on the line they open, and `::` inside a string is text.
50+- **No operators**: `eq a b`, `not x`, `gth a b` are gates.
51+
52+## Runes
53+
54+A rune's first children sit on its line, the last taking the rest of it; the others follow, indented.
55+
56+- `++` **luslus**: defines a value, at top level or as local names at the start of any body (a gate's, an arm's, a `^-`'s, a `~&`'s or a `++`'s), visible to each other and the final expression. Gates may call themselves and their siblings; other values can't depend on themselves, even through a gate, so `++ title (trim title)` is an error.
57+- `+$` **lusbuc**: defines a mold, likewise: on its line, or as cases on the lines below, one per line, where several cases make a union and one is just that mold. Molds may be recursive.
58+- `|=` **bartis**: a gate with a faced sample, `m=model`, `=msg` (`msg=msg`) or `[a=@ b=@]`; the body on the same line or below.
59+- `?-` **wuthep**: the only branch, exhaustive; the subject on its line, then arms of a pattern and an expression or body. Conditions switch on `%.y` and `%.n`.
60+- `^-` **kethep**: a cast; the mold on its line, the expression after it or below.
61+- `~&` **sigpam**: prints the value on its line, then runs the body below; output goes to the ship's log or the browser's console.
62+- `!!` **zapzap**: a crash, an expression of any type; as a mold, the empty mold. It is an operand, so `f !!` and `~[!!]` need no parentheses.
63+- `$-` **buchep**: a gate's mold, `$-(sample product)`.
64+- `|$` **barbuc**: a generic mold, right after a `+$`'s name: `+$ result |$ [V E]`, then the mold on its line or the cases below.
65+
66+Only `|=` and `$-` have wide forms: `|=(sample expr)` and `$-(mold mold)`. Their children are operands, so calls inside need parentheses.
67+
68+Left out on purpose:
69+
70+- `|%`, `|_`, `|*`: modules are records.
71+- `$?`, `$%`: a union is a `+$` with its cases below.
72+- `?+`, `?:`: `?-` is the branch.
73+- `.=`, `?!`, `=(a b)`, `!x`: `eq` and `not` are gates.
74+- `=/`: `++` defines values.
75+- `|-`, `$(…)`: gates recurse by name.
76+- `~|`: `~&` covers debugging.
77+- `*mold`: no defaults.
78+- `=>`, `=<`, `.*` and `a:b`: names never shadow, and `.` reads imports too.
79+- `!>` and vase runes, `/+`: code also runs in the browser.
80+- Sail's `;` runes: layout is Jibb's elements.
81+- Tall forms such as `:~`, `:*`, `%:` and `%=`, the closers `==` and `--`, and other wide forms such as `^-(…)` and `?-(…)`: indentation covers them.
82+- `@s…` and `@r…` auras: errors wherever used, imports included.
83+
84+## Imports
85+
86+Imports come first:
87+
88+```jibb
89+/- todo :: the molds from /sur/todo.hoon this module uses
90+/% %todo-action :: a mark's type, named todo-action
91+/= card /ui/components/card :: a Jibb module
92+```
93+
94+An imported Hoon record with duplicate field names is an error where used; imported union cases must differ as nouns. `/%` names a type after its mark, so it takes no face, and any mark name works; Hoon's `/%` binds the mark's core instead. Derived constructors such as `todo-action.todo` supply the agent and mark, so callers need not write those details. API modules re-export their `/%` types, not `/-` faces or `/=` modules. Import cycles are errors.
95+
96+## Modules
97+
98+A file is a module: imports, then definitions.
99+
100+- `+$ name mold` defines a mold; `++ name expr` a value.
101+- Names may refer to each other in any order, and no name may shadow one already in scope, imports and the prelude included.
102+- Molds and values have separate namespaces, told apart by position: `todo-action.todo` is a mold and its constructor, `todos.todo` a mold and a request.
103+- `main`'s type decides the kind: `(element !!)` a page; `(page R D)` a page with data, from parameters `R` to data `D`; `(program D X M)` an island, with data, model and messages; `(store S)` a store with state `S`. They're built by `(page load view)`, `(program init update view subs)` and `(store init update)`. A module without `main` is a library.
104+- Everything is exported and read through the import's face, as `card.card`. The prelude keeps private helpers in a separate internal module; it imports them without exposing them.
105+- An API module, `/ui/api/<agent>.jibb`, also exports derived gates: a constructor per `poke` type, adding the agent and mark, and a request per `paths` case, taking a reply over full state, plus a fold for `(facts full diff …)`. An island may watch a request only when the checker proves it is watchable. A request whose case has a separate `scry=` path, or whose watchability cannot be proved, is a type error. A store's `+$ poke` is a declaration, not a mold; a store exports a constructor per `poke` type and a `state` request. Clashing derived names are errors, including a derived name that clashes with an import face.
106+
107+Names the host reads, by file:
108+
109+| File | Names |
110+| --- | --- |
111+| Any module | `main`, the kind |
112+| A store | `state`, `poke` |
113+| `/ui/api/<agent>.jibb` | `poke`, `paths` |
114+| `/ui/theme.jibb` | `theme` |
115+| Under `/ui/tests` | `test-…` arms, one test each |
116+
117+Every other name is free.
118+
119+## Molds
120+
121+A mold is only a type: never called on a noun, and with no default. Types are inferred, Hindley–Milner with aura variables: every expression has a principal type, and there is no general subtyping. These one-way widenings are allowed: a value of a specific atom type fits `@`, a value of a specific noun type fits `*`, and a more specific aura fits an ancestor in its Hoon aura family; the reverse of each widening needs a check. Records can also be projected explicitly, as described below.
122+
123+- **Partial annotations**: `_` may appear wherever a mold may appear. It marks a part of the type for the checker to infer, so a type annotation can specify only the parts it needs to. A hole inferred to be a named type variable is resolved: in `++ id |= x=A ^- _ x`, the result hole is `A`. An unconstrained hole is an error. A named mold or value definition must determine its own holes: `+$ box [item=_]` and `++ id |= x=_ x` do not determine their holes, and later uses cannot fix them.
124+- **Atoms**: `@` is any atom, regardless of aura; auras such as `@ud`, `@t`, `@p` and `@da` are specific atom types. An `@ud` value fits where `@` is expected, but an `@` value needs a check to fit `@ud`. A more specific aura also fits an ancestor in its Hoon aura family: `@ud` and `@ux` fit `@u`, and `@tD` fits `@t`. The reverse needs a check. Distinct specific auras remain distinct; sharing an ancestor does not make them unify. Each bare `@` independently accepts any atom: it is not an aura variable. Atoms that must share a type take one capital, as `[lo=A hi=A]`, with the atom constraint inferred from the body. `add` takes `[A A]` and returns `A`, with `A` constrained to atoms, so `(add n 1)` with `n=@ud` is a `@ud`. Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not. Comparison may take loobeans and returns `?`.
125+- **Constants**: `%add`, `~` and the loobeans have one value each.
126+- **Records and tuples**: `[text=@t done=?]`, `[@t ?]`. An empty `[]` is an error. Duplicate field names in a record are an error. Faces are part of the type, so `[a=@ b=@]` and `[x=@ y=@]` don't unify. An unnamed position can unify with a faced position and take its face, so `[0 0]` fits `[x=@ud y=@ud]`; two different faces don't unify. The explicit type-directed operation `(proj record)` selects fields from its argument according to the expected result type: `^- [x=@ud y=@ud] (proj wider)`, or `(f (proj wider))` when `f` expects that record. The source is evaluated once, and the result contains exactly the fields in the expected layout. No projection is inserted for a direct call. `proj` is reserved: a module cannot define or import another name `proj`. A record too long for one line can leave its `[` open, with one field per deeper line, as an expression's bracket does.
127+- **Unions**: a `+$` with several cases below it. Every union written in Jibb has a name, so one used in a field, a sample, a cast, a gate's mold or an argument gets its own `+$`; only imports bring in unions without one. Tags take their union from context, as Tag resolution describes. Cases must differ as nouns: inhabited cases must differ at some position of their right-nested cells, where one is an atom and the other a cell, or both are different constants. `*`, type variables and molds that can be either, such as `(list A)`, can overlap atoms and cells. `?` counts as the two atoms `%.y` and `%.n`: it is disjoint from cells and overlaps the constants 0 and 1. The empty mold `!!` is disjoint from every case; a cell with an empty position at any depth is itself empty and is also disjoint from every case. A union whose cases don't all differ is rejected.
128+- **Containers**: `(list A)`, `(unit A)`, `(set A)`, `(map K V)`, `(mop K V)`, `(qeu A)`, `(jar K V)`, `(jug K V)`.
129+- **Gates**: `$-(A B)`. Type variables are capitals, generalized per `++`. A capital in a local `++` shares the enclosing `++`'s variable of the same name if the enclosing `++` also uses it; otherwise the local `++` introduces and generalizes its own variable. For example, `++ inner |= y=A y` uses the enclosing `A` when its enclosing gate has a sample `x=A`; if the enclosing `++` does not use `A`, `inner` generalizes its own `A`. Use another capital for a different type. A body can't force two distinct capitals to be equal; use the same capital wherever a type must be shared. A type variable used where an atom is required gains an atom constraint, so `++ clamp |= [lo=A hi=A n=A]`, whose body calls `gth` and `max`, works on any one aura. It can become nothing more specific: a body that makes `A` a `@ud` or a list is an error.
130+- **Paths**: `/todos` is constant, `/` empty, and `/todo/[id=@ud]` typed by aura. A typed segment may use `_` for an inferred aura; it still must resolve to an aura that the path rules can print and parse. `%/blog/(slug)` is an `qath`, checked against routes and static files.
131+- **Generic molds**: `+$ result |$ [V E]` with cases below; `|$` goes only right after a `+$`'s name.
132+- **Noun**: `*`, not a type variable; use a capital for a generic type. A value already known to have a more specific noun type, such as `@ud`, can be used where `*` is expected. **Empty**: `!!`.
133+- **Pokes**: `poke` is defined in the source-backed private internal prelude module and re-exported by the public prelude as an ordinary transparent type. Ordinary modules can construct and inspect its values.
134+- **Effect and application-path types**: `poke`, `ask` and `qath` are transparent types, defined in the internal prelude and re-exported normally; callers can construct and inspect their values. Derived gates and `pure` also construct requests, and application-path literals have type `qath`. `(facts full diff …)` appears only in an API file's `paths`.
135+- **Identity**: recursive molds go by name and module.
136+
137+`eq`'s arguments and map and set keys must contain no gates, even nested inside another value. The checker infers this gate-free constraint on type variables and retains it when generalizing a `++`, so a generic helper that calls `eq` stays generic over gate-free types. Printed types show the constraint as `$-([A A] ?) where A contains no gates`. An inferred atom constraint prints as `$-([A A] A) where A is an atom`; an arithmetic atom constraint that excludes loobeans prints as `where A is an atom other than ?`. Multiple clauses are comma-separated, as `where A is an atom, B contains no gates`. Union-case matching treats gates as opaque and never inspects a gate to distinguish cases.
138+
139+## Tag resolution
140+
141+A tag literal or `~` gets a fresh type variable and a pending constraint: the variable must become a union with a matching case, or an atom type the term fits. A mold that isn't a union counts as a union of one case, for tags and for `|=%tag`: `[%go "x"]` fits `+$ go [%go url=@t]`, and `|=%typed` works against `$-(@t M)` when `M` is `[%typed text=@t]`. Once unification fixes the variable, each constraint is checked against the union's cases or, for `@tas`, `@ta`, `@` or `*`, makes the tag that constant atom. A literal that matches nothing is an error naming the union, such as "msg has no case %submitt".
142+
143+- A constraint records the literal's shape, such as `[@t %draft]`, and matches cases by shape and shared tag positions; a literal in a field position is checked against that field.
144+- `|=%typed` is a case's constructor: against `$-(@t M)` it is `|=(t [%typed t])`, requiring `M` to have a case `[%typed @t]`. It works for cases whose head is a literal with the same noun as the tag, regardless of how that literal is written: `|=%$` also constructs a case headed by `%.y` or `~`, since each is the noun 0. A bare tag is always a value.
145+- A variable constrained by tag resolution, and any it mentions, doesn't generalize; it stays open until something in the module fixes it. An island's `main` fixes its messages, so islands resolve their own tags. The inferred gate-free constraint is retained when a type variable is generalized.
146+- A constraint still open when its module is checked is an error asking for a `^-`; the checker never guesses. Library helpers can cast, as in `^- (list attr)`.
147+- Wing access, changes and `?-` on a type not yet known wait the same way.
148+- Patterns need none of this; they're checked against the subject's type.
149+
150+```jibb
151+:: /ui/components/buttons.jibb, a library with no main
152+++ add-button |= label=@t
153+ button label %add :: error: nothing fixes the union of %add
154+++ labelled |= [label=@t msg=M]
155+ button label msg :: fine: the caller's union
156+++ wide ^- (list attr)
157+ ~[width+[%fill 1] pad+%s2] :: fine: the cast fixes the tags
158+```
159+
160+## Literals by context
161+
162+Number and cell literals resolve like tags: each waits for its context and takes a default when its `++` is checked. A number takes `@ud` only if nothing fixes its aura and its `++` isn't generic over it, so `++ inc |= n=A (add n 1)` stays generic, while the sum in `"{(add 1 2)}"` is a `@ud`.
163+
164+| Literal | Can become | Default |
165+| --- | --- | --- |
166+| Tag `%a`, or `~` | A union's case or a constant atom | None: an error asking for a `^-` |
167+| Number `5` | Any aura | `@ud` |
168+| Cell `[x xs]` | A tuple, a record, a cons | A tuple |
169+
170+- In `{…}`, an atom prints by its aura: `@ud` as `1.000`, `@da` as a UTC date with sub-seconds, `@p` as a ship, and a bare `@` as `@ud`. `@t`, `@ta`, `@tas` and tapes splice as text; any other cell is an error asking for a printer. Printers are picked when compiling, so an atom whose aura its `++` is generic over, as `n` in `|= n=A` when `A` is constrained to atoms, is an error asking for an aura, here and in a `(…)` segment of an application path. For readers, `print-date` prints in the theme's zone, Urbit-style, to the minute, as `~2026.10.29..14.30`; numbers keep Hoon's form.
171+- String literals are always cords, so an element needs `text`, as `(text "{n} items")`.
172+- Where a list is expected, `[x xs]` is `x` in front of `xs`.
173+- A typed segment prints and parses by aura, whether `[id=@ud]` in an agent's paths, a `_` route parameter typed by `load`'s sample, or a `(…)` segment of an application path; `@ta` and `@tas` are raw text.
174+
175+```jibb
176+++ view |= [day=@da n=@ud]
177+ column ~[gap+%s1] ~[
178+ (text "Updated {day}") :: day printed as a date
179+ (text "{n} items") :: n printed as @ud
180+```
181+
182+## Patterns
183+
184+Arms are tried in order. Every case needs an arm or a catch-all, `*` or a bare name. An arm that earlier arms cover, such as a second `%add` or anything after `[%move * *]`, is an error, and a case that should fail says `!!`. A name in a pattern always binds anew, so compare values with `?- (eq a b)`. Patterns take terms, numbers, strings without `{…}`, ships, loobeans and `~`, not lists or pairs.
185+
186+| Pattern | Matches | Binds |
187+| --- | --- | --- |
188+| `%add` | The term | Nothing |
189+| `%.y`, `%.n` | Yes, no | Nothing |
190+| `[%add t]` | A cell headed by `%add` | `t`, the rest |
191+| `[t %draft]` | A pair ending in `%draft` | `t` |
192+| `[%move %left n]` | Tagged `%move`, then `%left` | `n` |
193+| `~` | Null | Nothing |
194+| `[~ x]` | A unit holding a value | `x` |
195+| `1.000`, `"milk"`, `~zod` | That literal | Nothing |
196+| `[a b]` | Any cell; `b` is the rest | `a`, `b` |
197+| `*` | Anything | Nothing |
198+| `x` | Anything | `x` |
199+
200+Tags can sit anywhere in a case, and a case can carry several:
201+
202+```jibb
203++$ step
204+ [%move %left n=@ud]
205+ [%move %right n=@ud]
206+ [text=@t %draft]
207+ [text=@t %sent at=@da]
208+ %stop
209+
210+++ describe |= s=step
211+ ?- s
212+ [%move %left n] "left {n}"
213+ [%move %right n] "right {n}"
214+ [t %draft] t
215+ [t %sent sent-at] t
216+ %stop "stop"
217+```
218+
219+Leaving out `%stop` is an error naming it; to crash instead, write `%stop !!`.
220+
221+## The grammar in EBNF
222+
223+```
224+(* Layout: a deeper line emits INDENT, a line at the same depth NEWLINE, and a
225+ shallower one a DEDENT for each level it closes, then NEWLINE. Blank and
226+ comment-only lines emit nothing. A bracket left open at the end of a line
227+ takes the deeper lines below as its items and needs no closer. When a line leaves
228+ several brackets open, the deeper lines go to the last one, or to the body
229+ of the last rune, and the others close with it. *)
230+
231+module = { import NEWLINE } { definition NEWLINE } ;
232+import = "/-" name | "/%" term | "/=" name pathlit ;
233+definition = "+$" name [ generic ] ( mold | cases )
234+ | "++" name ( expr | body ) ;
235+generic = "|$" "[" typevar { typevar } "]" ;
236+cases = INDENT mold { NEWLINE mold } DEDENT ; (* one case is that mold; more make a union *)
237+
238+body = INDENT { definition NEWLINE } expr DEDENT ;
239+expr = rune | call ;
240+call = operand { operand } ;
241+operand = literal | qath | ref | change | pair | unit | group | list | tuple
242+ | gate | ctor | pathlit | "!!" ;
243+ref = wing ;
244+wing = name { "." name } ;
245+change = wing "(" item { item } ")" | wing "(" { item } open ; (* no space before "("; items named *)
246+pair = name "+" operand ; (* [%name operand] *)
247+unit = "`" operand ; (* [~ operand] *)
248+group = "(" expr ")" | "(" { operand } open ;
249+list = "~[" { operand } "]" | "~[" { operand } open ;
250+tuple = "[" { item } "]" | "[" { item } open ;
251+item = [ name "=" ] operand ;
252+open = INDENT line { NEWLINE line } DEDENT ;
253+line = [ name "=" ] expr ;
254+qath = "%/" [ asegment { "/" asegment } ] ;
255+asegment = knot | "(" expr ")" ; (* checked against the routes *)
256+gate = "|=(" ( field | name ) operand ")" ; (* the one wide expression *)
257+ctor = "|=" term ; (* a case's constructor *)
258+
259+rune = "|=" field ( expr | body )
260+ | "^-" mold ( expr | body )
261+ | "~&" expr body
262+ | "?-" expr INDENT arm { NEWLINE arm } DEDENT ;
263+arm = pattern ( expr | body ) ; (* every case covered; see Patterns *)
264+
265+mold = aura | "_" | "*" | "!!" | "?" | "~" | term | loobean | ref | typevar
266+ | pathmold
267+ | "(" ref mold { mold } ")" | "(" ref { mold } mlines
268+ | "[" field { field } "]" | "[" { field } flines
269+ | "$-(" mold mold ")" ;
270+field = [ name "=" ] mold | "=" name ; (* =msg is msg=msg *)
271+mlines = INDENT mold { NEWLINE mold } DEDENT ; (* a mold's ( left open *)
272+flines = INDENT field { NEWLINE field } DEDENT ; (* a mold's [ left open *)
273+pathmold = "/" [ segment { "/" segment } ] ;
274+segment = knot | "[" name "=" ( aura | "_" ) "]" ;
275+
276+pattern = term | number | string | ship | loobean | "~" | "*" | name
277+ | "[" pattern { pattern } "]" ;
278+
279+literal = number | string | ship | date | duration | knotlit
280+ | term | loobean | "~" ;
281+number = decimal | "0x" hex | "0v" base32 ;
282+pathlit = "/" knot { "/" knot } ;
283+term = "%" name | "%" decimal | "%&" | "%|" | "%$" ;
284+loobean = "%.y" | "%.n" ;
285+aura = "@" { lower } [ upper ] ;
286+typevar = upper ;
287+name = lower { lower | digit | "-" } ;
288+knot = { lower | digit | "-" | "." | "~" | "_" } ;
289+```
290+
291+## Example: a store and an island
292+
293+```jibb
294+:: /ui/stores/cart.jibb
295++$ state [items=(list @t) open=?]
296++$ cart-action
297+ [%add item=@t]
298+ %toggle
299++$ poke cart-action
300+
301+++ main (store init update)
302+++ init ^- state [~ %.n]
303+++ update |= [a=cart-action s=state]
304+ ?- a
305+ [%add item] s(items=[item items.s])
306+ %toggle s(open=(not open.s))
307+```
308+
309+```jibb
310+:: /ui/basket.jibb
311+/= cart /ui/stores/cart
312+
313+++ main (program init update view subs)
314+
315++$ model [cart=state.cart note=@t]
316++$ msg
317+ [%noted text=@t]
318+ %add
319+ %toggle
320+ [%got cart=state.cart]
321+ [%acked err=(unit @t)]
322+
323+++ init |= ~
324+ [[~ %.n] ""]
325+
326+++ update |= [=msg m=model]
327+ ?- msg
328+ [%noted t] [m(note=t) ~]
329+ %add [m(note="") ~[[%poke (cart-action.cart [%add note.m]) |=%acked]]]
330+ %toggle [m ~[[%poke (cart-action.cart %toggle) |=%acked]]]
331+ [%got c] [m(cart=c) ~]
332+ [%acked err] [m ~]
333+
334+++ subs |= m=model
335+ ~[[%watch (state.cart |=%got)]]
336+
337+++ view |= m=model
338+ column ~[gap+%s1] ~[
339+ (text "{(lent items.cart.m)} items")
340+ field "Item" note.m |=%noted
341+ button "Add" %add
342+```
343+
344+A store is written like an API file: `state`, `+$ poke` and `(store init update)`. Islands can poke it with derived constructors and watch it with `(state.cart |=%got)`, whose first fact is the current state and each later fact the next. It runs in the browser, shared by the page's islands.
docs/spec/implementation-plan.mdnew file+103
@@ -0,0 +1,103 @@
1+# Implementation plan
2+
3+Oct 29, 2026 · @iko
4+
5+Build Jibb in eight milestones, each ending in something that runs on a fake ship. The first release, static pages served by the shared host, comes at milestone 4. The spec is in the other tabs: the language in Jibb — an Elm-architecture UI language for Urbit, its syntax in Grammar, the core language in Core language, and every choice in Decisions.
6+
7+## Milestones
8+
9+Each milestone ends with its checks passing on a fake ship. No dates yet: agree them after milestone 1, once it shows how fast the Hoon work goes.
10+
11+1. **Parser and mark**
12+ - Builds: the `%jibb` mark as the first tab gives it; the layout pass, emitting INDENT, DEDENT and NEWLINE; a parser for the Grammar tab's EBNF that returns a syntax tree with source positions; errors with file, line, column and an excerpt.
13+ - Done when: every Jibb code block in the doc parses; each lexical rule has a test input that breaks it; `|commit` stores `.jibb` files on a fake ship.
14+2. **Types and prelude**
15+ - Builds: Hindley–Milner inference with aura variables; tag and literal resolution with deferred constraints; the union disjointness check; exhaustive `?-` with dead-arm errors; `/-`, `/%` and `/=`, with the table for importing Hoon types; API files and their derived gates; the prelude's types.
16+ - Done when: the doc's examples typecheck, except those written as errors; each error the Grammar tab describes has a test with its message, such as "msg has no case %submitt"; a `/sur` file with `$%`, `$@`, maps and a recursive mold imports as the table says.
17+3. **Core language**
18+ - Builds: lowering from the checked syntax tree; the text form's printer and reader; the reference interpreter, in Hoon; the Nock backend, with gates shaped like Hoon's and natives calling the standard library.
19+ - Done when: the Core language tab's example lowers to the program shown there; the interpreter and the Nock backend agree on a corpus of test programs, crashes included.
20+4. **Host and static pages: the first release**
21+ - Builds: the shared host on the `%jibb` desk, which finds app desks by docket's `site+`, binds their paths, rebuilds on commit one module per Behn timer wake, and serves pages only to the owner; the compiler's `build` and `render` entry points; the renderer written in Jibb, with HTML serialized on the ship; the theme's stylesheet; routing and application paths; static files at hashed URLs in Eyre's cache; the per-module compile cache; `-jibb!clear`.
22+ - Done when: worked example 1 is served at its URL; a logged-out request is sent to the login page; a commit that changes one module recompiles only it and its dependents; a missing static file is a compile error; suspending the desk clears its cache entries.
23+5. **Published pages**
24+ - Builds: `load`, the per-request scry, route parameters parsed by aura, validators on scried data, and the 404 and 500 pages.
25+ - Done when: worked example 2 and a `_slug` route render from a fresh scry on every request; an unparseable parameter gives a 404 and a crashing render a 500, neither cached.
26+6. **Islands**
27+ - Builds, in order: the benchmark, a minimal JavaScript backend against a Nock interpreter in the browser on the same programs, with the result recorded in Decisions; then the chosen backend and the runtime library: the noun codec with `jam`, `cue` and `@uw`, natives, the channel client over `fetch`, the keyed DOM differ, `cmd` and `sub`, stores, the crash notice, URL subscriptions, and the loop rules under Browser runtime.
28+ - Done when: worked example 3 and the Grammar tab's store example run end to end in a browser; the browser code agrees with the reference interpreter on the test corpus; a keystroke in the benchmark's list island meets the bar agreed under Open questions.
29+7. **Tooling**
30+ - Builds: `-jibb!test` for `test-` arms; the Node harness that runs each test module's Nock, with nockjs, beside its JavaScript; the formatter; the tree-sitter grammar.
31+ - Done when: CI runs both test suites on every commit, and the formatter leaves every example in the doc unchanged.
32+8. **Polish**
33+ - Builds: island modules shared across pages, holes, and size work.
34+ - Done when: the shared library stays under 20 KB.
35+
36+## Setup and ground rules
37+
38+- **Code**: one repo with three folders: `jibb-dev`, which app desks vendor (the compiler, prelude, browser library and marks); `jibb`, the desk for the shared host and its threads; and an example app desk built from the doc's worked examples. The Node harness lives beside them.
39+- **Running**: a fake ship, with each folder synced into its desk and `|commit` after changes. App desks also need base-dev's `txt`, `txt-diff`, `js`, `bill` and `kelvin` marks, docket's `docket-0` and a `sys.kelvin`.
40+- **Tests**: from milestone 1 on, every Jibb code block in the doc is a golden test, and each stage's output is printed and compared, the core language in its text form.
41+- **The doc wins**: where code and doc disagree, the doc stands until it changes. A change to the language is agreed first and recorded in Decisions.
42+- **Questions** go as comments on the doc, on the words they're about.
43+
44+## Compiler architecture
45+
46+The compiler is a Hoon library, `/lib/jibb.hoon` in jibb-dev, which Clay builds once per release. The shared host checks it against two entry points, fixed across releases, and calls them: `build` on each commit, which also renders pages without data, and `render` for each request to a page with data. Until a new build links, the last one keeps serving.
47+
48+```
49+/ui source
50+ → layout pass → parser → a syntax tree per module
51+ → module graph: imports resolved, Hoon types read from Clay
52+ → type checker, one module at a time, in dependency order
53+ → core language
54+ → Nock: pages, islands' init and first view, and the libraries they use
55+ → JavaScript: islands' update, view and subs, stores, and the libraries they use
56+```
57+
58+| Decision | Choice | Why |
59+| --- | --- | --- |
60+| Nock code | Emitted directly from the core language, not through generated Hoon | Types are already checked, Hindley–Milner polymorphism has no direct Hoon form, and `mint` is slow on a ship |
61+| Browser code | JavaScript from the core language, unless milestone 6's benchmark favours a Nock interpreter | Both run the same programs, so the benchmark measures only the generated code |
62+| HTML renderer | One, written in Jibb: elements to virtual nodes, then HTML text on the ship and DOM in the browser | The server's HTML and the browser's first view agree by construction, which resuming relies on |
63+| Long compiles | One module per Behn timer wake | An event runs to completion, and moves inside it, self-pokes included, don't yield |
64+| Compile cache | Per module, with its interface and body hashed separately | A body change re-emits the module without re-checking its dependents |
65+
66+Anything that crosses between ship and browser is the same noun on both sides: records are right-nested cells in field order, `%.y` and `~` are 0, cords have their first byte lowest, and maps are treaps ordered by `mug`. Gates never cross, so each backend represents them its own way.
67+
68+## Browser runtime
69+
70+For milestone 6. An island is one loop over one model: events become messages, `update` turns each message into a new model and commands, and only `view` decides what the island shows.
71+
72+- **Start**: run `view` on the jammed model, bind the result to the server's nodes by key, and replace the subtree if they differ. `subs` then opens its watches, and each watch's first fact, full state, arrives as a message.
73+- **Messages** come from controls, command replies, facts, timers and `%url`. *Proposed*: an island handles them one at a time, in arrival order.
74+- **Rendering**: a message changes the model when `update` returns a different noun; `view` then re-runs and a keyed diff patches the DOM. An unchanged model renders nothing. *Proposed*: the patch lands before the next message, so a crash in `view` belongs to one message.
75+- **Controls**: after every event, the control that fired is reset to the latest view, even when the model didn't change. A field's text is rewritten only when it differs from the screen, which keeps the caret and any IME composition.
76+- **Commands**: each reply arrives later as a new message, never inside the `update` that sent it. *Proposed*: commands run in list order, after the patch.
77+
78+| Control | Sends | When |
79+| --- | --- | --- |
80+| `button label msg` | `msg` | On click, or Enter or Space while focused |
81+| `toggle on label msg` | `msg` | When the reader flips it; `msg` carries no new value |
82+| `field label value reply` | `(reply text)` | On every `input` event, and once per IME composition, when it ends |
83+| `form msg kids` | `msg` | On Enter in any field inside it, without reloading the page |
84+
85+*Proposed*: no overlays in v1, so no dialogs, menus, popovers or tooltips.
86+
87+## Risks
88+
89+- **Importing Hoon types.** Hoon's types form a graph with lazy `%hold` nodes, so the importer needs Hoon's own type engine to expand them, and it must recognise maps, sets and recursive molds by name. Start it early in milestone 2, on real `/sur` files such as Tlon's.
90+- **The compiler's speed in Hoon.** A parser and checker written in Hoon run far slower than native code. The cache keeps commits fast, but the first build after an install or upgrade is slow; time the example desk's first build in milestone 4.
91+- **Stack depth in JavaScript.** Most browsers have no tail calls, so self tail calls compile to loops, and list gates need native versions in JavaScript.
92+- **Atoms in JavaScript.** BigInt for every atom is slow. Keep small atoms as numbers and the rest as bytes, with cords caching their decoded string.
93+- **Type errors.** Hindley–Milner is known for confusing errors. Each error names both conflicting sites, with excerpts, and the messages are golden tests.
94+
95+## Open questions
96+
97+| Question | Needed by |
98+| --- | --- |
99+| What is the typography scale for heading levels and the `role` values? | Milestone 4 |
100+| Does the Eyre channel CSRF test reproduce on a fake ship? @iko has the write-up; if it does, it goes to Urbit privately. | Milestone 4 |
101+| What is the benchmark's bar? Proposed: a keystroke in a 500-row list island renders within one 16 ms frame on a mid-range phone. | Milestone 6 |
102+| Are the proposed loop rules adopted, along with no overlays in v1? | Milestone 6 |
103+| What do controls look like by default: buttons, toggles and fields, with their focus and disabled states? | Milestone 6 |
docs/spec/overview.mdnew file+529
@@ -0,0 +1,529 @@
1+# Jibb — an Elm-architecture UI language for Urbit
2+
3+Oct 29, 2026 · @iko
4+
5+## Summary
6+
7+Jibb is a Hoon dialect for Urbit frontends. `.jibb` files live in the desk under the `%jibb` mark; each desk's vendored Jibb compiles them, run by one shared host, so `|commit` is the only build step. Elm architecture, a small layout vocabulary, and three stages fixed by module kind:
8+
9+- **Build**, per commit: pages without data, as HTML, plus the stylesheet.
10+- **Publish**, per request, in the host: pages with data, from a fresh scry. The host serves every page, to the owner only.
11+- **Client**, in the browser: islands' `update`, `subs` and `view`, and stores, as JavaScript.
12+
13+A page without islands ships no JavaScript.
14+
15+**Goals**: no prebuild; familiar to Hoon programmers; a typed Elm architecture; Hoon's data end to end; no HTML or CSS outside the theme; static by default.
16+
17+**Non-goals**: agent logic, refinement types, transactions, JavaScript interop beyond Jibb's effects.
18+
19+*Name*: four letters like the vanes, after the jib, a boat's front sail.
20+
21+## What Urbit allows
22+
23+Everything needed exists. The one limit: marks can't follow imports, so the host compiles.
24+
25+| Mechanism | Gives Jibb | Limit |
26+| --- | --- | --- |
27+| [Marks](https://docs.urbit.org/urbit-os/kernel/clay/marks) | `%jibb` stores text, merged by line | A conversion can't scry, so can't follow imports |
28+| Clay | The host reads each desk's `/ui`, static files included, and hears of commits | Every version of every file is kept |
29+| Gall | One host agent serves every Jibb desk | Agent names are ship-wide |
30+| [Eyre `%set-response`](https://github.com/urbit/urbit/releases/tag/urbit-os-v2.139) | Responses without an Arvo event | Keyed by the full request target; entries outlive their agent; auth-flagged entries give non-owners a bare 403 |
31+| [Eyre noun channels](https://github.com/urbit/urbit/pull/6472) | Pokes and watches as nouns | Needs `jam`, `cue`, `@uw` and an event stream over `fetch` in the browser |
32+| [Docket](https://docs.urbit.org/build-on-urbit/userspace/dist/docket) | `site+/path`: an agent-served site | One `site` or glob clause per desk |
33+
34+## Prior art
35+
36+| Project | What it is | Jibb takes |
37+| --- | --- | --- |
38+| [Sail](https://docs.urbit.org/hoon/sail) | Hoon's HTML markup | Rendering in the agent |
39+| [Udon](https://docs.urbit.org/hoon/udon) | Markdown-like source under its own `%udon` mark, compiled by `;>` | A source language under its own mark |
40+| [Rudder](https://github.com/Fang-/suite) | Routing for Sail pages | Page routing |
41+| [Mast](https://github.com/R-JG/mast) | Display state in the agent, HTML diffs over a channel | One generic client script; channels as transport |
42+| [Docket](https://docs.urbit.org/build-on-urbit/userspace/dist/docket) | One agent serving every desk's front end | One shared host |
43+| [Elm architecture](https://guide.elm-lang.org/architecture/) | `Model`, `Msg`, `update`, `view`, [effects](https://guide.elm-lang.org/effects/), [keyed nodes](https://guide.elm-lang.org/optimization/keyed.html) | The program model, effects as data, keyed diffing in `each` |
44+| [elm-ui](https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/) | Layout without HTML or CSS | Rows, columns, `el`, wrapping, paragraphs, padding, fill |
45+| [elm-pages frozen views](https://elm-pages.com/docs/frozen-views/) | `Html Never` content kept out of the bundle | `(element !!)` |
46+| [Astro islands](https://docs.astro.build/en/concepts/islands/) | HTML by default; marked components hydrate | Islands |
47+| [Qwik resumability](https://qwik.dev/docs/concepts/resumable/) | State serialised into HTML; the client resumes | A jammed model; `init` never runs in the browser |
48+| [@urbit/nockjs](https://github.com/urbit/nockjs), [@urbit/aura](https://github.com/urbit/aura-js) | Nouns and aura printing in JavaScript; aura-js lacks `@dr` | References for Jibb's own codec |
49+
50+## Architecture
51+
52+Clay stores files; each desk's compiler, run by the shared host, places each module at its kind's stage; only island and store code reaches the browser.
53+
54+&#91;embedded content: Jibb pipeline · source to browser in three stages\]
55+
56+## The language
57+
58+Hoon's runes and literals in an indentation layout, over Hoon's nouns and molds, so pokes, facts and scries need no conversion. The **Grammar** tab defines it.
59+
60+### Importing Hoon types
61+
62+`/-` and `/%` translate each mold a module uses from `/sur` files and marks:
63+
64+| Hoon | Jibb |
65+| --- | --- |
66+| `$%`, `$?` | A union if its cases differ as nouns, else an error where used |
67+| `$@` | A union with an atom case |
68+| `$^` | A union if its cases differ as nouns, else an error where used |
69+| `$~` | Dropped |
70+| `map`, `set`, `qeu`, `jar`, `jug` | The same, by name, checked with `apt` on arrival |
71+| `mop` | `(mop K V)`, read with `on` |
72+| Other `$\|` | Its base type |
73+| `%0`, `%&`, `%\|` | Tags |
74+| Recursive molds, such as `json` | Recursive, matched by name |
75+| Records with duplicate field names; cores, gates, vases, signed and float auras | An error where used |
76+
77+Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file are fine. A union without a name, as a field's `?(%approve %deny)`, imports too, though Jibb can't write one. Messages and printed types show its cases separated by spaces, as `%approve %deny`; this notation is print-only.
78+
79+## Prelude
80+
81+Hoon's standard library regrouped, written in Jibb and vendored as `/lib/jibb/prelude`; an island's bundle carries only what it uses. The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out. Jetted prelude functions have working Jibb implementations; the compiler recognizes their shapes and uses the Hoon versions so jets can fire. They may take gates as arguments (Core language). Private helpers and low-level primitives live in a separate internal prelude module, imported without exposing them; foundational public gates are implemented in Jibb on top of those primitives. This source-backed internal module defines `poke`; the public prelude re-exports it as an ordinary transparent type, so ordinary modules can construct and inspect its values. The prelude also holds `eq`, `not`, `page`, `program`, `store`, `pure`, `island`, and the layout elements and molds.
82+
83+| Group | Hoon | Jibb |
84+| --- | --- | --- |
85+| Arithmetic | [1a](https://docs.urbit.org/hoon/stdlib/1a), [2g](https://docs.urbit.org/hoon/stdlib/2g) | Jibb gates over shared atom-constrained type variables, using private low-level primitives: `add`, `sub`, `div`, `mod`, `gth`, `max`, `pow` |
86+| Units | [2a](https://docs.urbit.org/hoon/stdlib/2a) | `fall`, `need`, `bind`, `biff`, `clap`; `clap` takes two units of the same type and a gate combining two values of that type into one of that type |
87+| Lists | [2b](https://docs.urbit.org/hoon/stdlib/2b) | `turn`, `weld`, `snag`, `lent`, `sort`, `skim`; `(roll xs init f)` takes a start |
88+| Maps, sets, queues | [2h](https://docs.urbit.org/hoon/stdlib/2h)–[2m](https://docs.urbit.org/hoon/stdlib/2m), [2o](https://docs.urbit.org/hoon/stdlib/2o) | Plain gates over Hoon's trees, such as `(get.by m k)`; `rep.by` and `rep.in` take a start; ordered maps through lull's `on`, as `(get.on lte m k)` |
89+| Function helpers | [2n](https://docs.urbit.org/hoon/stdlib/2n) | `same`, `head`, `tail`, `cork`, `cury` |
90+| Text | [4b](https://docs.urbit.org/hoon/stdlib/4b) | `crip`, `trip`, `cass`, `cuss`, `trim`, `tufa`, `tuba` |
91+| Atom printing | [4a](https://docs.urbit.org/hoon/stdlib/4a), [4j](https://docs.urbit.org/hoon/stdlib/4j)–[4m](https://docs.urbit.org/hoon/stdlib/4m) | `scot`, `scow`, `slav`, `slaw`. `print-date` prints Urbit-style in the theme's zone, to the minute, as `~2026.10.29..14.30`, from a zone table jibb-dev keeps current. Numbers print as Hoon does, as `1.000` |
92+| Time | [3c](https://docs.urbit.org/hoon/stdlib/3c) | `yore`, `year` |
93+| Data molds | [1c](https://docs.urbit.org/hoon/stdlib/1c), [2q](https://docs.urbit.org/hoon/stdlib/2q), [3g](https://docs.urbit.org/hoon/stdlib/3g) | `unit`, `list`, `pair`, `tape`, `path`, `coin`, `dime` and the rest; Hoon's 3g `tone` is `tone.hoon`, distinct from the styling type, and its 1c `step` is `step.hoon` |
94+| Bits | [2c](https://docs.urbit.org/hoon/stdlib/2c), [2d](https://docs.urbit.org/hoon/stdlib/2d) | Jibb's `not` negates a loobean; Hoon's bitwise `not` is exposed as `not.bit` |
95+| Hashing and ordering | [2e](https://docs.urbit.org/hoon/stdlib/2e), [2f](https://docs.urbit.org/hoon/stdlib/2f) | Natives behind maps and sets; `aor` exposed |
96+| Signed and floats | [3a](https://docs.urbit.org/hoon/stdlib/3a), [3b](https://docs.urbit.org/hoon/stdlib/3b) | Left out; `@s…` and `@r…` auras are errors, imported ones included |
97+| Parsers | [4d](https://docs.urbit.org/hoon/stdlib/4d)–[4i](https://docs.urbit.org/hoon/stdlib/4i), parser helpers in 4j and 4l | Left out, except the explicitly listed `slav` and `slaw` |
98+| The rest | [1b](https://docs.urbit.org/hoon/stdlib/1b), [2p](https://docs.urbit.org/hoon/stdlib/2p), [3d](https://docs.urbit.org/hoon/stdlib/3d), [3f](https://docs.urbit.org/hoon/stdlib/3f), [4c](https://docs.urbit.org/hoon/stdlib/4c), [4n](https://docs.urbit.org/hoon/stdlib/4n), [4o](https://docs.urbit.org/hoon/stdlib/4o), [5a](https://docs.urbit.org/hoon/stdlib/5a)–[5f](https://docs.urbit.org/hoon/stdlib/5f) | Left out; `jam`, `cue` and `fein` run inside the runtime |
99+
100+The prelude's `(like A)` mold describes a result with a product of type `A`. Its value gate `(like convert result)` maps a present product with `convert=$-(A B)` and returns `(like B)`, preserving the position and remaining input; an absent result stays absent.
101+
102+Maps are Hoon's trees on both sides, so equal maps are equal nouns. Requests check incoming maps and sets with `apt`.
103+
104+## The Elm architecture on Urbit
105+
106+A module's kind is the type of its `main`:
107+
108+| Kind | `main` | Runs | Ships JavaScript |
109+| --- | --- | --- | --- |
110+| Page | `(element !!)` | At commit | Only its islands' |
111+| Page with data | `(page load view)` | In the host, per request | Only its islands' |
112+| Island | `(program init update view subs)` | `init` and the first view with its page; the rest in the browser | Yes |
113+| Store | `(store init update)` | In the browser, shared by a page's islands | With its islands |
114+
115+A module without `main` is a library. The host reads a few other names per file kind, listed in the Grammar tab. Pages embed islands as `island main.todo-list ts`, an `(element !!)`:
116+
117+- `main.todo-list` is a record of exactly `init`, `update`, `view` and `subs`, whose types fix the data, model and messages. `subs` is required, as in Elm's `Browser.element`; `|=(m ~)` means none.
118+- `ts` is the island's data, checked against `init`'s sample.
119+- `(element !!)` means no messages reach the page. It also keeps islands out of islands, since an island's view is an `(element M)`.
120+
121+`init` runs on the ship at the page's stage, and the first view renders into the page with the model jammed in. On start, the browser runs `view` on that model, binds the result to the server's nodes by key, and replaces the subtree if they differ. Island data and models can't hold gates; the checker names the field.
122+
123+**Loading.** A page with data renders in the host per request, from a fresh scry.
124+
125+- `load`, `page`'s first argument, maps route parameters to one `ask`: `++ load |=(~ (todos.todo same))` without parameters.
126+- The host scries the ask's path per request, so the agent must answer a peek there; nothing is watched or kept. A path case can name a separate scry path.
127+- Pages read full state only; folds matter only to islands.
128+- Route parameters are `load`'s sample, bound by name and parsed by aura: `/ui/blog/_slug.jibb` has `++ load |=([slug=@ta] (post.api slug same))`.
129+- `(pure x)` is an ask without an agent; an app's catch-all page passes its path with it.
130+- A rejected path is a 404.
131+
132+Loads and renders run in Nock.
133+
134+**Access.** Every page is private: the host serves it per request, only to the owner, and sends anyone else to `/~/login?redirect=…`. Public pages are left for a later version.
135+
136+**Errors.** A rejected path, an unparseable parameter or a crashing render gets Jibb's error page, 404 or 500; no error is cached. A control rendered outside an island is rejected: at commit for pages without data, per request otherwise. There's no step limit yet, so an endless render stalls the ship, as in Hoon.
137+
138+- A crashing island shows the standard crash notice: in the page's HTML for `init` or the first view. In the browser, a crash in `update`, `view` or `subs` drops the message and keeps the model, DOM and watches.
139+
140+**Effects.** Commands and subscriptions are library values:
141+
142+```jibb
143++$ cmd |$ [M]
144+ [%poke p=poke reply=$-((unit @t) M)]
145+ [%go url=@t]
146+ [%wait gap=@dr msg=M]
147+ [%now reply=$-(@da M)]
148+ [%who reply=$-(@p M)]
149++$ sub |$ [M]
150+ [%watch a=(ask M)]
151+ [%every gap=@dr reply=$-(@da M)]
152+ [%url reply=$-(path M)]
153+```
154+
155+- `poke`, `ask` and `qath` are transparent types defined in the internal prelude and re-exported normally. Derived gates and `pure` also construct requests. A derived poke constructor such as `(todo-action.todo [%add draft.m])` checks its value and supplies the agent and mark, so one island can poke several agents. The agent's mark rechecks on the ship; a nack's `tang` reaches the reply as text. Store constructors poke the store in the browser.
156+- A request such as `(todos.todo |=%got)` comes from a declared path or a store's `state`; its reply always gets full state. A path with diffs also takes a fold, `(changes.todo |=%got apply)`, which the runtime applies first. Facts are checked; a bad one crashes the reply, which counts as a crashed `update`.
157+- Islands read agents only by watching. A watch's first fact must be full state, so watching a request whose path case has a separate `scry=` path is a type error in an island. The checker must prove a request is watchable; unknown watchability is also a type error. The runtime acks facts, rewatches after a kick or a dropped connection and reseeds from the first fact; a refused watch shows the crash notice.
158+- Watches match by agent and path, timers by gap, and the newest reply is always used. After each `update`, `subs` is diffed to start and stop watches and timers. `%now` and `%every` give the time, `%who` the owner's `@p` from `/~/name`; `%wait` is a one-shot delay.
159+
160+Inputs send a message per `input` event, and one per IME composition, so validation runs as you type; only commands reach the ship. After every event, controls reset to the latest view, so a toggle whose poke fails unchecks. A field's text is rewritten only when it differs, which keeps the caret. Fields are read-only until their island starts.
161+
162+**Island lifecycle.**
163+
164+- `init` runs on the ship with the page's data and returns only the model, jammed into the page; the browser resumes from it at start. A reload starts from the model the page is served with.
165+- A crash in `update` drops the message, keeps the model and shows the standard notice.
166+- Stores share state between a page's islands. A store module, written like an API file, has `state`, `+$ poke` and `++ main (store init update)`, where `update` applies a poke. The store's `+$ poke` is a declaration, not a mold. Islands import it with `/=` and use its derived gates: a constructor per poke type, and `(state.cart |=%got)`, whose first fact is the current state and each later fact the next.
167+- A store runs in the browser from its `init` when its first island starts, and lasts as long as the page. Islands keep what they watch in their own models.
168+- An app is a page whose view is one island under a catch-all route; its `load` passes the path with `pure`. The island's `%url` subscription delivers the path at start and after every change, back and forward included. `go` pushes history, and `go` or `link` within the section changes the island without a reload. Focus then moves to the new view's first heading, which screen readers announce.
169+
170+## Layout and styling
171+
172+Elements are ordinary gates with their own signatures. Containers take attribute lists, and `el` adds attributes to anything. Spaces and colours are theme tokens. Text elements come from `text`, as `(text "hi")`. The attribute union is `attr`, so helpers can declare `^- (list attr)`.
173+
174+| Element | Arguments | Purpose |
175+| --- | --- | --- |
176+| `row`, `column`, `wrap` | `attrs kids` | Containers |
177+| `stack` | `attrs kids` | A column, then a row from the `wide` breakpoint up |
178+| `el` | `attrs kid` | Adds attributes; `el`'s values win |
179+| `para` | `kids` | Flowing text |
180+| `text` | A cord | Text |
181+| `heading` | `level words` | `<h1>` to `<h6>` |
182+| `each` | `(list [key=K el=(element M)])` | Keyed children; repeated keys match in order |
183+| `table` | Columns `(list [header=@t width=length align=align])`, rows `(list [key=K cells=(list (element M))])` | A table with keyed rows |
184+| `image`, `image-unsafe` | Application path and description; `[url=@t width=@ud height=@ud]` and description, respectively | Boxed to its aspect ratio before loading, never wider than its container; static images are sized from the file; `""` marks it decorative |
185+| `link`, `link-unsafe` | Application path and label; unchecked cord and label, respectively | See Links and URLs |
186+| `button` | `label msg` | A control |
187+| `toggle` | `on label msg` | A control |
188+| `field` | `label value reply` | A control; `reply` turns its text into a message, as `\|=%typed` |
189+| `form` | `msg kids` | A control; Enter in a field sends the nearest form's `msg` |
190+| `island` | `program data` | Embeds an island |
191+
192+Controls work only in islands; the host rejects a page that renders one outside an island.
193+
194+| Attribute | Values |
195+| --- | --- |
196+| `pad`, `gap` | `%s0` to `%s3`; `gap` on containers only |
197+| `width` | `[%chars n]`, `[%fill n]`, `%shrink`; `[%fill n]` below 1 counts as 1 |
198+| `align` | `%start`, `%center`, `%end` |
199+| `role` | `%body`, `%caption`, `%label` |
200+| `tone` | `%normal`, `%muted`, `%accent`, `%danger`; danger is also marked `!` and announced |
201+
202+The same attribute twice in a literal list is an error; otherwise the last wins.
203+
204+- Rows lay out left to right, centred vertically; columns top to bottom. Children take their content's width unless they fill.
205+- `[%fill n]` shares leftover space in proportion to `n`, `%shrink` takes the content's width, and `[%chars n]` is `n` widths of `0`.
206+- Empty elements take no room and no gap.
207+- Nothing exceeds the page's width: long words break, and wide content scrolls in its own box.
208+
209+The theme, `++ theme` in `/ui/theme.jibb`, uses the prelude's `theme` mold, with a default for desks without one. It requires `s1` to `s3` (`s0` is zero), five tones, with `normal` the text and `background` the page colour, the page's language, and the time zone dates print in. `wide` is the breakpoint where `stack` becomes a row. Dark tones go under `dark`, used when the reader prefers dark. An optional `font` is an application path to a static font. Tokens become CSS custom properties and `wide` a media query; values must be CSS lengths or colours, and each tone needs 4.5:1 contrast with its background.
210+
211+```jibb
212+++ theme ^- theme
213+ [ space=[s1="4px" s2="8px" s3="16px"]
214+ tones=[normal="#222" background="#fff" accent="#17734f" danger="#b3261e" muted="#5f5f5f"]
215+ wide="60rem"
216+ lang="en"
217+ zone="UTC"
218+ font=`%/static/fonts/inter.woff2
219+ dark=[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
220+```
221+
222+Style attributes compile to atomic classes in one stylesheet built from the theme, so islands can't compute a missing class. `[%chars n]` and `[%fill n]` become inline styles.
223+
224+### Links and URLs
225+
226+Both backends escape all text and attributes. In-app links are application paths, `%/blog` or `%/blog/(slug.p)`, checked at compile time against routes and static files; parameters print by aura, and the base path is implicit. They carry no query or fragment, so apps keep their state in the path.
227+
228+Links, images and navigation also accept two kinds of unchecked cord, through declarations separate from the application-path forms: a root-relative path to another app on the ship, such as `"/apps/groups"`, and an `https`, `mailto` or `tel` URL. `link-unsafe`, `image-unsafe` and `go-unsafe` are the unchecked forms. Both navigation declarations produce the `[%go url=@t]` command; `go` converts the application path to a cord, including the app's base path. A cord starting `//` or `/\` is neither. Any other cord, such as `javascript:`, is drawn as text, and `go` ignores it. External links open in a new tab with `noopener`. Pages send a Content-Security-Policy allowing scripts only from the ship.
229+
230+## Stages
231+
232+A module's kind fixes where it runs; nothing infers stages.
233+
234+| Stage | Runs | Where | Output |
235+| --- | --- | --- | --- |
236+| Build | Pages without data | The host, per commit | HTML and the stylesheet |
237+| Publish | Pages with data | The host, in Nock, per request | HTML |
238+| Client | Islands' `update`, `subs` and `view`; stores | The browser, in JavaScript | DOM patches from a keyed diff |
239+
240+- **Islands follow their page**: `init` and the first view run wherever the page renders, and the model is jammed into the HTML.
241+- **Re-render, then diff**: each message that changes the model re-runs `view`, and a virtual-DOM diff patches the DOM. Children of `each` are keyed, as in Elm's `Html.Keyed`, so focus survives reordering.
242+- **Functions have no stage**: a gate compiles for whichever side calls it.
243+- **No JavaScript needed**: pages render without it, and islands show their server-rendered state, with controls `aria-disabled` and fields read-only until they start.
244+- **Holes later**: compiling views to static HTML plus small functions of the model is an optimisation that changes no types or errors, so it waits.
245+
246+## The mark
247+
248+`%jibb` stores source as text and nothing else. Conversions can't follow imports, so the host compiles, and `|commit` never loads the compiler.
249+
250+### `/mar/jibb.hoon`
251+
252+```hoon
253+|_ src=@t
254+++ grab
255+ |%
256+ ++ mime |=([p=mite q=octs] q.q) :: from Unix on |commit
257+ ++ noun @t
258+ ++ txt of-wain:format
259+ --
260+++ grow
261+ |%
262+ ++ mime [/text/x-jibb (as-octs:mimes:html src)]
263+ ++ txt (to-wain:format src)
264+ ++ noun src
265+ --
266+++ grad %txt :: line diffs and merges, as %hoon does
267+--
268+```
269+
270+- Text, like `%hoon`: `|commit` never fails on a half-written file, and Clay merges by line.
271+- Compiled modules are cached by their hash, their imports' hashes, Hoon files included, and the desk's compiler, so a commit recompiles only what changed. Import cycles are errors.
272+- Relinking prints each error with its file, line, column and an excerpt.
273+- Each app desk vendors `jibb-dev`, as with `base-dev`: compiler, prelude, browser library, and the `%jibb` and static-file marks. It also needs base-dev's `txt`, `txt-diff`, `js`, `bill` and `kelvin` marks, docket's `docket-0`, and a `sys.kelvin`. The `%jibb` desk holds only the shared host and its threads.
274+
275+### Linking
276+
277+On every commit, the host reads each Jibb desk's `/ui`, and that desk's compiler rebuilds what changed and relinks, checking modules in dependency order and resolving `/-` and `/%` through Clay. There's no other build path: marks can't follow imports, and `/~` builds only `.hoon` files.
278+
279+The host is one Gall agent on the `%jibb` desk, serving every Jibb desk, so app agents stay plain Hoon; it never reads their state. A desk opts in by vendoring Jibb and naming its base path in docket's `site+`. The host is thin: it binds paths, watches desks, caches and serves. Each desk's Jibb builds and renders everything else, HTML shell, CSP and error pages included, through a few entry points fixed across releases, so desks upgrade independently. The host clears a desk's cache entries when it's suspended or uninstalled, and accepts pokes only from the ship.
280+
281+### Agent APIs
282+
283+Each agent Jibb talks to has `/ui/api/<agent>.jibb`, declaring its pokes in `+$ poke` and its paths in `+$ paths`, over types from the agent's own marks through `/%`. Importing it gives derived gates: a constructor per poke type, which pokes with that type's mark, and a request per path, which checks what comes back. Clashing derived names are errors.
284+
285+```jibb
286+:: /ui/api/todo.jibb
287+/- todo
288+/% %todo-action
289+/% %todos
290+/% %todo-update
291+/% %todo-item
292+
293++$ item item.todo
294++$ poke todo-action
295++$ paths
296+ [%todos /todos todos]
297+ [%changes /changes (facts todos todo-update)]
298+ [%todo-by-id /todo/[id=@ud] todo-item]
299+```
300+
301+A path case is a request name, a path and a type. A plain mold is full state, which a watch's first fact must carry. `(facts full diff …)` adds diffs, told apart by mark, and its request takes a fold, here `$-([[%todo-update todo-update] todos] todos)`. Pages scry the path, so the agent must answer a peek there. A case can name another scry path, as in `[%changes /updates (facts todos todo-update) scry=/todos]`, used only by pages.
302+
303+`poke` and `paths` are declarations, not molds. An API module re-exports its `/%` types, not `/-` faces or `/=` modules.
304+
305+Any mark name works: `/% %todo-action-1` gives the type `todo-action-1`, poked with `%todo-action-1`. Helper molds such as `item` come from the `/sur` file through `/-`. The marks are the agent author's:
306+
307+```hoon
308+:: /mar/todo-action.hoon, written with the agent
309+/- todo
310+|_ a=action:todo
311+++ grab |% ++ noun action:todo --
312+++ grow |% ++ noun a --
313+++ grad %noun
314+--
315+```
316+
317+Jibb calls this type `todo-action`, after its mark. Jibb's own types never cross to the ship, so they need no marks.
318+
319+### Routing by file path
320+
321+Pages route by their path under `/ui`; islands, stores and libraries are only imported.
322+
323+| File | URL |
324+| --- | --- |
325+| `/ui/index.jibb` | `/apps/my-app` |
326+| `/ui/blog/index.jibb` | `/apps/my-app/blog` |
327+| `/ui/blog/_slug.jibb` | `/apps/my-app/blog/{slug}`; `_` marks a parameter |
328+| `/ui/settings/__rest.jibb` | `/apps/my-app/settings` and below; `__` marks a catch-all, passed to `load` as a path |
329+
330+- One URL per page, with no trailing slash; other forms and query strings get the same page.
331+- A literal beats a parameter, which beats a catch-all. Two parameters at one level, `blog.jibb` beside `blog/index.jibb`, and a catch-all beside `index.jibb` are errors. Folders can be parameters: `/ui/_user/posts.jibb`.
332+- Parameters bind to `load`'s sample by name, which must have exactly those fields; a catch-all's is a `path`.
333+- `/apps/my-app/~jibb/` and `/apps/my-app/static/` belong to the host.
334+
335+Typed segments share one notation across routes, application paths and agent paths. `@ta` and `@tas` are raw text, checked as knots, as `/blog/my-post`; other auras print and parse as Hoon does, so `@ud` is `1.000`. The host splits the raw URL, so dots stay inside segments; a segment that doesn't parse is a 404. `%/todo/(id)` and `[%todo-by-id /todo/[id=@ud] todo-item]` print the same way.
336+
337+### Desk layout
338+
339+```
340+:: an app desk
341+/mar/jibb.hoon /mar/png.hoon … marks from jibb-dev
342+/lib/jibb.hoon /lib/jibb/prelude compiler and prelude from jibb-dev
343+/lib/jibb/runtime/js browser library from jibb-dev
344+/mar/txt.hoon /mar/js.hoon … marks from base-dev
345+/mar/docket-0.hoon docket's mark from landscape
346+/sys.kelvin the desk's kelvin
347+/sur/todo.hoon /mar/todo-*.hoon the %todo agent's types and marks
348+/app/my-app.hoon your agent, unchanged
349+/ui/api/todo.jibb the %todo agent's API
350+/ui/index.jibb /ui/blog/_slug.jibb pages
351+/ui/todo-list.jibb an island
352+/ui/stores/cart.jibb a store
353+/ui/theme.jibb theme
354+/ui/static/img/logo.png static files
355+/ui/tests/todo.jibb tests: each test- arm is one test
356+desk.bill %my-app
357+desk.docket-0 site+/apps/my-app, with docket's other clauses
358+
359+:: the %jibb desk, installed once per ship
360+/app/jibb.hoon the shared host
361+/ted/clear.hoon /ted/test.hoon -jibb!clear, -jibb!test
362+```
363+
364+The `%todo` and `%blog` agents run on their own desks; this desk copies their `/sur` and `/mar` files.
365+
366+## Client runtime and Eyre
367+
368+Islands compile to small JavaScript modules sharing one hand-written library; pages without islands load neither.
369+
370+- **Two backends.** Each module lowers to the core language (Core language), which both backends compile: Nock on the ship for rendering and `init`, with natives calling jets, and JavaScript in the browser for `update`, `subs` and `view`. Differential tests under Node, from jibb-dev, keep them in agreement.
371+- **Shared library**, under 20 KB: its own noun codec (`jam`, `cue`, `@uw`, treaps, aura printing), the channel client, a keyed DOM differ, stores and URL subscriptions. It reads events over `fetch`, since `EventSource` can't send `x-channel-format`, deletes its channel on `pagehide`, and opens a fresh one when a reconnect gets a 404.
372+
373+### What a page with an island looks like
374+
375+```html
376+<!doctype html>
377+<html lang="en">
378+<head>
379+ <meta charset="utf-8">
380+ <meta name="viewport" content="width=device-width, initial-scale=1">
381+ <title>My ship</title>
382+ <link rel="stylesheet" href="/apps/my-app/~jibb/s/0v1a2b3.css">
383+</head>
384+<body>
385+<main>
386+ … server-rendered HTML …
387+ <div data-jibb-island="0v4c5d6">
388+ … initial HTML …
389+ <script type="application/x-jibb-state">… jammed model, @uw-encoded …</script>
390+ </div>
391+</main>
392+<script type="module" src="/apps/my-app/~jibb/lib.0v7e8f9.js" async></script>
393+</body>
394+</html>
395+```
396+
397+The title is the first `heading 1`, and the language comes from the theme. `data-jibb-island` names the module by hash, so a shared island loads once; each instance keeps its state block in its own element. Every island starts as soon as the library loads.
398+
399+### Eyre integration
400+
401+- The host binds each desk's base path, from its `site+` clause, with `%connect`.
402+- The host serves every page itself, per request and only to the owner, sending anyone else to the login page; no page enters Eyre's cache.
403+- CSS, the library, island modules and static files sit at content-hashed, immutable paths, cached with `%set-response` and served without an Arvo event. They're public, since only pages carry data, and each build's files stay a day after replacement so open tabs keep working.
404+- A commit re-renders every page without data, which the host then serves from its copy.
405+- The cache is ship-wide and outlives its agent. The host caches only under each desk's base path and clears a desk's entries on suspend or uninstall; run `-jibb!clear` before uninstalling `%jibb`.
406+- Cache hits skip Eyre's other handling, such as HTTPS redirects and CORS.
407+
408+### Static files
409+
410+Images and fonts live under `/ui/static/`, committed with the desk, so installers get them; jibb-dev's marks store them as they are.
411+
412+- Pages refer to them by application path, as `(image %/static/img/logo.png "The logo")`. A missing file is a compile error, and images are sized from the file.
413+- Each file is served from Eyre's cache at a URL with a short hash of its bytes, such as `/apps/my-app/static/0v1.7rq2a/img/logo.png`, marked immutable; a changed file gets a new URL.
414+- Clay keeps every version, and cache hits ignore `Range`, so audio, video and large image sets stay out for now.
415+
416+## Worked examples
417+
418+One page per stage.
419+
420+### 1. Static: `/ui/about.jibb`
421+
422+```jibb
423+++ main view
424+
425+++ view
426+ column ~[width+[%fill 1] pad+%s3 gap+%s2] ~[
427+ heading 1 "About this ship"
428+ para ~[(text "Hosted on Urbit. This page ships no JavaScript.")]
429+ el ~[tone+%accent] (link %/blog "Read the blog")
430+```
431+
432+An `(element !!)`: build stage, one HTML file plus the stylesheet, rendered on commit, titled "About this ship".
433+
434+### 2. Published: `/ui/blog/index.jibb`
435+
436+```jibb
437+/- blog
438+/= api /ui/api/blog
439+/= card /ui/components/card
440+
441+++ main (page load view)
442+++ load |=(~ (posts.api same))
443+
444+++ view |= ps=(list post.blog)
445+ column ~[gap+%s2] (turn ps card.card)
446+```
447+
448+A `page`: each request scries `%blog` and renders in Nock.
449+
450+### 3. Interactive: `/ui/todo-list.jibb` and `/ui/index.jibb`
451+
452+```jibb
453+/= todo /ui/api/todo
454+
455+++ main (program init update view subs)
456+
457++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
458++$ msg
459+ [%typed text=@t]
460+ %submit
461+ [%toggled id=@ud]
462+ [%got todos=(list item.todo)]
463+ [%acked err=(unit @t)]
464+
465+++ init |= ts=(list item.todo)
466+ [ts "" ~]
467+
468+++ update |= [=msg m=model]
469+ ?- msg
470+ [%typed t]
471+ ?- (gth (lent (tuba (trip t))) 80)
472+ %.y [m(draft=t error=`"Too long") ~]
473+ %.n [m(draft=t error=~) ~]
474+ %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
475+ [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
476+ [%got ts] [m(todos=ts) ~]
477+ [%acked err] [m(error=err) ~]
478+
479+++ subs |= m=model
480+ ~[[%watch (todos.todo |=%got)]]
481+
482+++ view |= m=model
483+ column ~[gap+%s2] ~[
484+ heading 2 "Todos"
485+ each (turn todos.m row-of)
486+ row ~[gap+%s1] ~[
487+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
488+ button "Add" %submit
489+ el ~[tone+%danger] (text (fall error.m ""))
490+
491+++ row-of |= t=item.todo
492+ [id.t (toggle done.t text.t [%toggled id.t])]
493+```
494+
495+```jibb
496+/= todo /ui/api/todo
497+/= todo-list /ui/todo-list
498+
499+++ main (page load view)
500+++ load |=(~ (todos.todo same))
501+
502+++ view |= ts=(list item.todo)
503+ column ~[pad+%s3] ~[
504+ heading 1 "My ship"
505+ island main.todo-list ts
506+```
507+
508+| Part | Stage | Becomes |
509+| --- | --- | --- |
510+| The page's view, "My ship" | Publish | HTML from a fresh scry per request, served only to the owner |
511+| The island's `init` and first view | Publish, with its page | HTML in the page, with the jammed model |
512+| `update`, `subs`, `view` | Client | A JavaScript module, loaded with the page; model changes re-run `view` and patch the DOM |
513+| `[%add …]`, `[%toggle …]` | Ship | One poke each: an Arvo event per command, not per keystroke |
514+
515+### Opting in
516+
517+A desk becomes a Jibb app by vendoring jibb-dev and naming its base path in docket, here `site+/apps/my-app`. The host on the `%jibb` desk binds it, builds `/ui` with the desk's compiler and serves it. Install `%jibb` first; until then the tile opens Eyre's 404. The app's agent, `/app/my-app.hoon`, is unchanged.
518+
519+## Sources
520+
521+- [Marks](https://docs.urbit.org/urbit-os/kernel/clay/marks) and [fas runes](https://docs.urbit.org/hoon/rune/fas), docs.urbit.org
522+- [Sail](https://docs.urbit.org/hoon/sail) and [Udon](https://docs.urbit.org/hoon/udon), docs.urbit.org
523+- [Docket files](https://docs.urbit.org/build-on-urbit/userspace/dist/docket), docs.urbit.org
524+- [urbit-os v2.139 release: Eyre cache and noun channels](https://github.com/urbit/urbit/releases/tag/urbit-os-v2.139); [eyre: add cache, PR #5927](https://github.com/urbit/urbit/pull/5927); [eyre: noun channels, PR #6472](https://github.com/urbit/urbit/pull/6472)
525+- [Publication caches for Eyre](https://gist.github.com/Fang-/1939a5b51fb2f821d960e05b74ad5f9f), an earlier design proposal; Eyre shipped `%set-response` instead
526+- [Mast](https://github.com/R-JG/mast), [Fang-/suite (Rudder)](https://github.com/Fang-/suite)
527+- [Elm architecture](https://guide.elm-lang.org/architecture/), [effects](https://guide.elm-lang.org/effects/) and [keyed nodes](https://guide.elm-lang.org/optimization/keyed.html); [elm-ui](https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/)
528+- [elm-pages frozen views](https://elm-pages.com/docs/frozen-views/), [Astro islands](https://docs.astro.build/en/concepts/islands/), [Qwik resumability](https://qwik.dev/docs/concepts/resumable/)
529+- [@urbit/nockjs](https://github.com/urbit/nockjs), [@urbit/aura](https://github.com/urbit/aura-js)
docs/status.mdnew file+279
@@ -0,0 +1,279 @@
1+# Status
2+
3+As of 2026-11-01. The plan is [spec/implementation-plan.md](spec/implementation-plan.md); each milestone ends with its checks passing on a fake ship.
4+
5+| # | Milestone | Status |
6+| --- | --- | --- |
7+| 1 | Parser and mark | Done (7c739b7; the doc's grammar decisions of 2026-10-30 in ab797a9) |
8+| 2 | Types and prelude | In progress. [prompts/milestone-2.md](prompts/milestone-2.md) briefs the developer; the checker and importer are partial |
9+| 3 | Core language | Not started |
10+| 4 | Host and static pages: the first release | Not started |
11+| 5 | Published pages | Not started |
12+| 6 | Islands | Not started |
13+| 7 | Tooling | Not started |
14+| 8 | Polish | Not started |
15+
16+The plan sets no dates: "agree them after milestone 1, once it shows how fast the Hoon work goes". They haven't been agreed yet. Milestone 1's commits run from 2026-10-29 18:13 UTC to 2026-10-30 11:50 UTC.
17+
18+On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's cases on the lines below its name. [prompts/drop-union-rune.md](prompts/drop-union-rune.md) records the change before milestone 2. The repository spec records the decision; the Claude document still needs to be synchronized.
19+
20+## Milestone 2: in progress
21+
22+The parser accepts `_` in mold positions and typed path segments, retaining each hole’s span. The partial checker tracks ordinary annotation holes through inference and requires each value or local definition to resolve its own holes before generalization. A hole can resolve to a concrete type or an explicitly written in-scope type variable; later uses cannot fix an unresolved definition. Independent decimal holes can default, but captured variables are not defaulted prematurely. Structural named molds with an unresolved hole report its site. Complex mold forms, inferred path segments, mutual recursive groups and other unsupported constraints still fail closed, and the fragment does not claim the module is checked. A syntax-tree pass rejects duplicate field names within each written record and reports both sites. The repository spec now records that `ask` and `qath` are transparent; complete request checking remains outstanding.
23+
24+On 2026-10-31, @iko chose explicit, result-directed `(proj record)` to construct a record with exactly the expected fields, and reserved `proj` against definitions and imports. The partial checker handles selected explicit calls with known, closed record types, records field-selection evidence for later lowering, and reserves the name across source bindings. Reordered fields, some nested contexts and several open or recursive cases remain unsupported; lowering and execution are not implemented yet. The field-order question remains open.
25+
26+The internal prelude also defines `qath` as a transparent recursive knot sequence, re-exported by the public prelude. The partial checker recognizes its source identity, supports selected null/cell construction and matching, and types static application-path literals. Construction and matching for other recursive shapes, broader patterns and dynamic application-path segments remain unsupported. A 256-step limit applies per inference attempt, not to parsing or retries; checking routes and static files remains milestone 4.
27+
28+The checker also recognizes a limited source-proven generic recursive tree in an import-free defining module. Its nominal identity retains the defining path, mold name and type arguments, including across supported imports and aliases. With a known expected type it can construct supported tagged cases by checking one source-proven layer at a time. Flat matches with explicit tags or nonbinding catch-alls also work for these source-proven trees, as does a missing-case diagnostic for a supported single-arm match. At most 128 arms are screened per attempt; whole-case binders and nested patterns remain unsupported. Broader pattern matching, general structural fits and gate-free proof remain unsupported; this is not yet the prelude's `element` implementation or island checking. The source index uses fixed-shape checks during mold collection. Each construction or supported pattern attempt has 256 unfolding steps and at most 4,096 face and substitution visits per scan; pattern subject recognition and view validation can each scan separately. Parsing, other inference and retries remain outside those limits. A single startup-inclusive comparison of 1,000 ordinary gates produced identical reports and used 29.12 seconds of user CPU before the shared-resolver refactor and 28.55 seconds after it, with other work running; it is not a general performance bound.
29+
30+A bounded local source proof recognizes a narrow class of generic-alias union cases with different literal heads, then applies the ordinary mold checks. Nested or qualified aliases and several open states remain unsupported, including a valid alias used during the deferred transaction; the partial report states that the mold itself has not been checked. `tools/type-union-source-test` exercises the source and state bounds and failure paths under eval and on the ship. A separate bounded witness now reports proven collisions between supported literal-headed aliases, with both original case sites; unknown payload intersections still decline. The detailed full-module result now carries the first failed mold’s source-bound overlap evidence, including through ordinary Jibb imports; the legacy text result renders both case excerpts. Specialized API and prelude paths remain limited. The shared guards pass under eval and on the ship.
31+
32+The checker can experimentally discharge a narrowly scoped direct-constructor constraint while resolving an import-free library without a prepared prelude. It preserves independent generalized schemes and publishes only after all source molds, values, and recorded constraints close. API/store paths, `main`, imports, prepared preludes, recursive groups, open constraints, projection actions, and `%grec` in the constraint graph remain unsupported by this route. The fallback also declines source shapes outside its bounded direct-call screen. It does not yet typecheck the unchanged todo island or establish watchability.
33+
34+A prepared-prelude partial report can recover a narrow import-free, non-main ordinary library initializer by deferring source-owned literals in a direct tuple until a later exact result cast. The prepared interface and declared-name inventories must agree exactly. API/store paths, `main` and imports remain excluded, and the ordinary full-module resolver does not publish the recovered interface. Wrong field types, unrelated tags and mold collisions fail closed; a no-final-cast control remains unchecked. `tools/type-deferred-prepared-test` checks the exact recovered types and unchanged `partial inference; module not checked` disclaimer under eval and on the ship. List-literal deferral and import-aware recovery remain unsupported.
35+
36+Closed cell context can now flow through a bounded loobean branch while preserving the inferred value faces and original failed-inference behavior. Open or structurally uncertain substitutions and nested retry shapes remain unsupported. This does not by itself provide the remaining cross-definition context or complete island-kind and watchability checks needed by the unchanged todo island.
37+
38+The internal prelude defines a transparent generic `ask` with pure, agent and store cases, re-exported alongside the Jibb-written `pure` gate. The partial checker infers supported constructors and exhaustive matches. Agent and store receivers operate on raw nouns; their fields do not prove schema validity or watchability. The public prelude now defines the documented source-backed `sub` union; supported `%watch` payloads retain the public `(ask M)` type. Constructing a `sub` does not prove that its request is watchable. Request lowering, checked decoding, runtime validation and general island watch checking remain unimplemented; the separate direct-program proof below covers only one narrow static value shape.
39+
40+The public prelude now contains the source-backed UI length/attribute molds, all element constructors, and exact program/page records and builders. The full 19-case generic `element` union is nonrecursive: nested child, keyed-item and table payloads are `*`, while public constructor schemes preserve typed composition and independent key types. `island` returns `(element !!)` with `[program data]` as its erased payload. The focused UI golden checks exact schemes, static and message-bearing composition, concrete programs/pages/islands, malformed inputs and selected mismatches. A child-message mismatch fails closed as an unsupported constraint. Raw-constructor encapsulation, duplicate-attribute checks, rendering, storage, navigation and execution are not claimed.
41+
42+Known same-origin generic-union result context can now constrain a call before its arguments are inferred. An unresolved or opaque constructor target stays unsupported rather than producing a definite mismatch; proven missing tags still report errors. A todo request with explicit `(ask msg)` context can infer `|=%got`; its uncontextualized form remains unsupported. A two-item literal-headed tuple can receive payload context from a known union of uniquely headed literal cells when its payload is a shallow wing-headed call with literal, wing or constructor arguments. Existing inference takes precedence when it fits; otherwise the checker tries the contextual path once. It conservatively declines that path when any substitution has a structural root, as well as for duplicate or opaque competitors. The guard scans substitutions per eligible tuple and may add one shallow inference; no global linear-time bound is claimed. This allows an explicitly typed todo subscription body to infer, but does not check the island or prove request watchability.
43+
44+A separate source-backed analysis can prove one named mold gate-free, report a definite gate with a field path, or return unknown. It retains the prepared prelude, source bundle, reader results and resolved imports; the actual todo model proves gate-free, while a callback field reports its path and `*` remains unknown. Its classifier is capped at 256 nodes, not the surrounding parse and import work. API, store and private roots are unsupported, and the artifact does not check a module or island, infer generalized constraints, or prove watchability.
45+
46+The partial checker can also match a directly named, checked root gate against a generic gate sample in a direct, unshadowed source-backed prelude call. It uses the written two-slot sample layouts to preserve nested record faces, then requires the complete call samples to be closed and tag-free and repeats the fit under the final substitution. The proof falls back to existing inference for unavailable or ambiguous source layouts, local or dynamic gates, aliases, recursive placeholders and open generic caller types. It preserves written-capital checks and projection evidence; it does not add `program`, check islands or prove request watchability. Prepared prelude source and interface remain a trusted pair.
47+
48+A narrow full-module path now checks direct four-wing `(program init update view subs)` definitions named `main`. It requires the canonical prepared `program` value and mold, reuses ordinary source-backed program fitting, and publishes only after all ordinary module and request-graph checks. The inferred `main` must be closed and invariantly match the instantiated `program` mold. Initializer data and model must be closed and gate-free with `%yes` verdicts inside a shared 256-node budget. `subs` may syntactically return null through transparent forms, or one direct imported request watch after the request graph merges. The latter is only an unfaced two-item `[%watch (case.face |=%callback)]` singleton: the imported member must have the exact plain derived-request scheme, a unique merged request must match the API path and both case names and occur in the interface's own graph, the API source must be identical, and scry, diffs and parameters must be absent. Pure or hand-built values, helpers, aliases, re-exports, typed paths, folds, multiple watches and unknown or ambiguous evidence remain rejected. Checked interfaces retain source evidence and support ordinary downstream imports; no program execution or runtime watching is claimed. A transactional extension can recover a direct initializer whose transparent tuple body ends in null when update, view and subs are already resolved. It derives the expected gate through the ordinary positional program fit with fresh IDs and stable replay, then re-infers the actual initializer and `main` under all ordinary finalization and kind checks. Non-main libraries, aliases, nonempty or simultaneously unresolved subscriptions, and unrelated pending tags remain rejected.
49+
50+A sibling transactional path recovers an unannotated two-slot direct update only when `update` and `main` are missing and the other components are resolved. It derives message/model from the inferred sample types, builds the result with canonical `cmd`/`list` templates, invariantly checks the candidate and stable whole-program call above shared fresh IDs, and finalizes through ordinary update/main inference. A synthetic union branch with a nested boolean branch and exact exported/downstream types pass; wrong constructors, inconsistent types, malformed samples, non-main modules, unrelated tags and missing canonical evidence fail closed. The unchanged full todo still fails with `module definitions need unsupported inference: /ui/todo-list/jibb`; its unchanged partial report's next blockers remain `subs` call context and `row-of` tag context, so it is not checked.
51+
52+The API path analyzer can retain its source, complete prepared prelude, reader results and resolved dependencies as evidence, and classify a unique declaration as watchable, not watchable or unknown. This remains declaration evidence rather than proof about an arbitrary request value. The narrow direct-program check above composes it with final value syntax, resolved imports and merged evidence for one plain request. Prepared artifacts and reader results remain trusted host inputs.
53+
54+For a unique supported path declaration, the request-parts analysis derives ordered typed path parameters, a full-state reply sample and a fold type for one diff mark. Multiple diffs and unsupported or ambiguous evidence fail closed. By itself it does not create request gates or establish watchability of values.
55+
56+A separate supporting-definition analysis infers supported ordinary API molds and values and resolves all declared marks, retaining their source and dependency evidence. It fails closed on unsupported helpers or marks; unused `/-` cores are not independently validated, and definitions depending on derived gates remain unsupported. This does not check or export the whole API.
57+
58+Ordinary imports can infer derived request-gate types for multiple supported API paths. A case may take one typed segment before the reply or one diff fold after it; the unchanged todo API's plain, typed and diff requests infer, including a named closed fold. Checked ordinary API definitions, mark molds and a supported poke constructor are exported. Each `/sur` core must have a directly used, successfully read mold; unselected bindings are not independently validated. Jibb module imports, scry paths, multiple parameters or diffs and a parameter together with a fold remain unsupported. Source-qualified request evidence and exact trusted graph inputs survive transitive imports and cached interfaces, while stale or ambiguous evidence fails closed. This is a type-only interface: request execution, schema validation and proof that a request value is watchable remain unimplemented. In one loaded-machine run, the real-todo eval took 195.83 s wall and 67.83 s user CPU; the prior prototype took 111.81 s wall and 64.60 s user. Both include Hoon compilation and reader setup and overlapped other work, so they are not isolated checker benchmarks.
59+
60+The Hoon reader's tagged-union source proof also handles `$~` default wrappers. A shared eval and ship golden exercises the unmodified Tlon `epic.saga` mold as a named payload in a labeled downstream extension, alongside overlap, recursive, shadow and malformed-wrapper controls. The tagged-source helper peels at most four consecutive defaults; defaults inside dependency proofs spend the existing semantic-node budget. Other unverified nested unions and dependencies remain unsupported.
61+
62+The repository spec records the subsequent type-system and prelude decisions, including the chosen `like` result-mapping gate; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass Hoon `*` in supported nonrecursive molds, selected Hoon atoms, term singletons, the null singleton, the two loobean singletons and their exact fork, nested faced or unfaced cells, supported disjoint unions and opaque standard collections from `/sur` molds and marks into inference. Collections retain their names and supported arguments for printing and unification; nested supported union arguments are retained too. The bridge trusts unchanged results from the source-aware reader; a materialized type graph alone cannot reveal cases Hoon already collapsed. The source-validated standard prelude `list` mold shares this representation with imported lists; other Jibb-written collection molds and most prelude collection operations remain unsupported; malformed names and arities fail closed. Selected self-recursive `/sur` molds, including Tlon `notes.import-node` with list-wrapped self references, cross as opaque module-and-name identities; aliases, foreign references, recursive marks, unfolding and construction remain unsupported. The reader handles mark samples, including a source-proved nonrecursive union from a single Ford-imported `/sur` core, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, including source-validated named operands such as Tlon `notes.log`, certain ordered-map fields, direct `$^` unions whose cases can be proved disjoint, and one verified explicit union argument in a list, set, map or unit. Tagged `$%` cases can additionally use restricted local named payload molds, bare `~` fields and one level of local named tagged unions, as in real Tlon `notes`, with bounded source proof; unsupported or ambiguous dependencies fail closed. Ambiguous recursive origins fail closed; recognizable explicit unions are checked from source before Hoon can collapse their cases, as @iko confirmed for imported `$%`, `$?` and `$^`, while other nested unions, nested ordered maps, general union disjointness and complete import integration remain unfinished. Opt-in structured reader APIs preserve successful graphs and distinguish definite unsupported-aura and core evidence from failures the reader cannot prove; unverified union disjointness and name-only vase recognition remain unsupported. They revalidate and re-walk failed types. An opt-in partial checker entry point consumes unchanged reader results and reports definite aura or core errors at imported mold use sites when their inputs are unique. Ordered replay covers nested cell samples, record and function casts, and non-generic same-module aliases; unsupported prefixes, cycles and shadowing stop it. Union molds, generic applications, transitive modules and unsupported reader outcomes remain generic. Replay repeats inference and may add work. The partial checker resolves a subset of ordinary library imports in dependency order using supplied Jibb sources and a source-derived partial prelude interface, caches completed interfaces per run, detects missing sources and cycles, and resolves nested fields of imported values with independent scheme instantiation. The source-backed internal prelude defines `poke` and the public prelude re-exports it as a transparent type. A dedicated trusted preparation path supplies private comparison and arithmetic schemes to the Jibb-written `gth`, `add` and `dec` wrappers; ordinary imports cannot access them. The public `add` and `dec` wrappers use private arithmetic interfaces; supported inference preserves the shared atom constraint that excludes loobeans. Primitive execution, jet recognition and length remain unfinished. The partial checker resolves its supported source shape and rejects ordinary imports of the private path. An imported API with one mark and a matching direct `+$ poke` declaration can export a constructor and retain agent/mark metadata when the representation has the supported agent case. A separate partial analysis resolves supported API path declarations and their full and diff mark types, including the todo paths; it does not by itself create requests or check an API module. Ordinary imports additionally infer the supported multi-path request-gate types described above. Complete private module checking, other API shapes, request lowering, root API and kind checking, stores, complete `ask` and `pure` checking and runtime effects remain unfinished. A possible store or root API with `+$ poke` reports unsupported kind or scope, while definite duplicates and unrelated shadowing still report conflicts. The prelude includes the doc-exact generic `cmd` union; the prelude inventory is incomplete. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, generalized atom constraints arising from explicit capitals or bare sample binders, acyclic local value definitions with captures, selected single self-recursive top-level and local gates, simple and nonrecursive generic mold aliases, selected faced record casts and field reads, and contextual tags, `~` and constructors for closed disjoint unions, including direct nonrecursive generic unions and propagation through complete loobean and unit-shaped branches in casts and known union-sample calls, including nested branches. Known loobean result context also propagates through supported complete branches and binder-only cell arms; binder-only arms over union subjects remain unsupported. A directly known named union can instantiate an unconstrained generic gate sample with its origin, generic arguments and faces preserved; unnamed, pending, recursive and variable-bound cases remain unsupported. A known gate with an unresolved result variable can receive a known enclosing result type before its arguments are inferred; unknown calls and unresolved targets remain conservative. Multi-argument calls form a right-nested sample, retain known faces and shared type variables, and can use known sample positions to contextualize list and union arguments. A definite mismatch points to the failing argument when the fragment can establish it, otherwise to the combined sample; unsupported contextual forms still fail closed. For a supported recursive gate, the checker infers the sample first and uses its exact type, including field faces, for one monomorphic self reference. It generalizes after the body is checked; subsequent uses instantiate it independently. Incompatible recursive arguments can report the gate and argument sites. For a complete loobean branch with one direct self-call arm, a separately inferred closed base type can seed the recursive result before the whole body is checked. Open or pending base types do not seed it; other branch shapes remain subject to the fragment’s existing limits. A supported single local recursive gate also uses a monomorphic self reference and generalizes variables free of the enclosing environment after checking its body; captured variables remain shared. The checker collects written capitals per `++` before inference, excluding nested definitions: a capital used in an enclosing definition is shared with its locals even when written later, while a capital introduced only in a local definition is generalized there. Sibling locals can introduce independent capitals with the same spelling; generic mold parameters keep their own scope. Top-level groups of syntactic gates are inferred together with monomorphic placeholders and shared substitutions, then generalized only after the whole group checks; downstream uses and library interfaces instantiate those schemes independently. A dependency graph identifies groups with two iterative depth-first passes; its conservative local-reference edges can reject otherwise valid programs. Supported local mutually recursive gate groups also use shared monomorphic placeholders and generalize only after the group checks, preserving captured outer variables. A bounded dependency proof reports certain non-gate cycles through values and gates when an explicit atom or loobean result cast and simple unshadowed expressions establish the cycle. Other mixed gate/value cycles, polymorphic recursion, unresolved literal constraints and unresolved branch joins remain unsupported. Reporting repeats inference for a single recursive gate outside a group; grouped reports use the stored schemes. Its performance cost remains unmeasured. A single-arm cell pattern accepts two or more binders, the last capturing the remaining tail; duplicate and shadowed binders are rejected. A structured single-arm pattern also works for a known non-union cell when coverage is proven, including nested literal and wildcard positions. Intermediate union or collection tails, nested patterns, wildcards and faced records remain unsupported. String interpolation accepts known atom auras, unrestricted `@`, tapes and isolated decimal literals; a known cell asks for a printer, and an explicitly generic atom asks for an aura. Loobeans, term singletons, non-tape collections, open types and a type fixed only later remain unsupported. A known closed union with two or more arms supports patterns that provably cover or exclude each remaining case, including payload binders, imported and generic cases, and binder-free catch-alls. Partial boolean patterns can split known `?` positions into their two noun values, up to 64 alternatives across the union; binders retain their original case type. Missing alternatives and covered arms are reported. Other partial patterns, expansions above the limit, binders spanning distinct cases, differing arm result types and some complex two-arm subjects remain unsupported. A cast or known call sample can supply result context through whole-case arms and supported finite loobean refinements for a known union accessed by a wing, a grouped wing or a supported shallow call, including nested cell and list positions; other partial-pattern contexts and subject forms remain unsupported. The Grammar’s `step` block infers in this fragment, but its module is not yet checked. A bare tag proved absent from a known union reports the union and tag sites in casts, single-argument calls, unit payloads, list items and supported branch arms; imported unnamed unions print their cases. Ordered fit replay can identify a missing tag nested in a syntactic tuple, stopping at an earlier mismatch or uncertainty. Known faced records support uniquely named field changes, including nested wings, with field context passed to replacements and the original record type retained. Missing fields, empty changes and definite mismatches report sites; the expected-type site is the edit because the original field declaration location is not retained. Unknown or partly unfaced spines, ambiguous fields and repeated edits remain unsupported. A known record cast supplies field context to its tuple or record initializer, including nested list and union fields; mismatch diagnostics use the cast mold because the original field declaration location is not retained. Isolated cart-style `init` and `update` expressions infer, while the complete cart-store fails closed because its kind and declaration scope remain unchecked. Uncontextualized list literals infer a fresh element type, including empty and nested lists, with independently generalized uses. Unresolved item tags and uncertain widening remain unsupported. Backtick unit construction uses the validated standard prelude unit template, infers its payload without losing pending constraints, and makes the prelude’s `some` available. Ordinary result annotations also let its `bind`, `biff`, `both`, `clap`, `clef` and `flit` infer. A known unit in a cast, call, list item or record field supplies context to its payload, including nested units and lists; mismatches identify the payload and context. Unrelated union identities, some variable-dependent fits, and missing or altered prelude unit templates remain unsupported. Literal singleton heads compare by runtime noun, so `|=%$` also matches explicit null- and loobean-zero-headed cases. When equal heads have disjoint payloads, the constructor selects a uniquely proven compatible payload; unknown and ambiguous candidates remain unsupported. Unresolved nulls remain pending and are reported separately from tags. A known union of `~` and a null-headed cell supports a complete `~` / `[~ value]` branch in either order, including shadow checks; unknown subjects, missing or duplicate arms, and unresolved branch results remain unsupported. This fragment infers the prelude’s `fall` and `need` signatures. With the validated prelude list and a known cast or gate sample, empty, nonempty and nested list literals infer their element types, including contextual union tags; a mismatched element names both sites. In that context `~` and zero-valued terms fit an empty list, and two-item unfaced cells form cons lists, including nested cons and imported-list contexts; invalid heads or tails name both sites. A known gate sample also supplies context to matching positions in a single tuple or record argument, including nested cells; zero literals can fit list positions. A bound zero constant remains unsupported rather than a definite mismatch, and an unknown callee does not supply context. Faced or longer cells and a missing or altered prelude list fail closed. A known list result also supplies context through complete loobean, unit-shaped and list-shaped branches, including recursive and nested branches. For a known standard list with a supported element type, a complete `~` / `[item rest]` branch infers the element and tail types in either arm order and checks binders for shadowing. Unknown subjects, unsupported element types and other or incomplete list patterns remain unsupported. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. Other variable-dependent face merges remain unsupported. Forced equality of distinct written capitals now reports both source sites, following @iko’s decision; forcing one to a concrete type remains unsupported. Imported record spines with repeated faces fail closed where used, but only with a generic unsupported diagnostic. Hoon may erase unfaced nested-cell boundaries, so the check can conservatively reject valid names in distinct erased scopes. Supported closed unions print using an in-scope name or imported alias; an unnamed nongeneric union prints its cases, parenthesized when nested. The latter is print-only. Generic union types retain all arguments in their printed name; if that name is unavailable, the partial printer reports the limitation. Different import faces for the same origin remain compatible; compatibility across distinct union origins and some generic-argument comparisons remain unsupported. Nonrecursive generic aliases can reorder, repeat or omit parameters while retaining a union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do differing-variable face constraints in a union payload. A transitive generic union whose name is unavailable is reported as unsupported instead of hiding its arguments. Unfixed decimal literals default to `@ud` in gate-free inferred types; recursive molds, general branch tag context, other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; a wrapper regression also rejects forged subjects, samples and tails. Its golden fixtures include three real Tlon files. A Clay test passes a Ford-built nested union through the reader into partial inference. The partial prelude includes `murn`, `join`, `snip`, `rear` and the agreed shared-type `clap`; supported calls infer, while backend validation remains outstanding, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
63+
64+The shared prelude interface reserves every name present in the supplied vendored source and makes only supported inferred entries available, including `list`, `unit`, `same`, `fall`, `need`, `bond`, `lure`, `weld`, `snoc`, `turn` and `lent`. The validated standard `list` mold is injected when the prelude’s own gates are inferred; `weld` and `turn` have ordinary explicit result casts. An absent or altered `list` is not injected, and an altered declaration cannot leak through direct or transitive mold aliases. The same validated template is available when prelude mold aliases are prepared, so supported direct and transitive aliases can use it. Unsupported entries such as most list helpers remain reserved but unavailable; backend validation of the helpers remains outstanding. All callers use the same prelude origin, so a library can export a type containing unqualified `(unit A)` to another module. The source-only `+prepare-prelude` rejects empty, malformed, conflicting or import-bearing source; `+prepare-prelude-with-internal` also accepts the supported private internal import. Prepared values are trusted and must come unchanged from the matching preparation arm. When canonical public list or unit templates are missing or altered, independently inferred private molds remain available, while molds that depend on those templates do not. The module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship. The source and checker remain incomplete, so this does not establish complete shadowing coverage or a checked module.
65+
66+The prelude has a Jibb-written `succ` gate that increments through `add`; partial inference retains its arithmetic atom constraint. A Hoon translation agrees with Hoon on ten selected inputs. Jibb execution and jet recognition remain unverified.
67+
68+The prelude has Jibb-written curried `lead` and `late` pair constructors, inferred with independent argument types including gate values. Their focused golden passes under eval and on the ship, and a Hoon-reference comparison covers operand order. Jibb backend execution remains unverified.
69+
70+The prelude also has a Jibb-written `zing` that concatenates homogeneous lists via `weld`. Its focused golden infers empty, nested text, ship, generic and gate-element lists and reports a non-list error; the same golden passes on the ship. A Hoon translation agrees with Hoon `zing` on selected finite inputs, not on Jibb execution. Hoon’s raw helper additionally accepts heterogeneous noun lists, which the Jibb signature does not express. Backend lowering and jet recognition remain unverified.
71+
72+The experimental deferred constructor transaction conservatively declines general structural tuple fits, most branches, field reads, nonidentical successful call/cast fits, and multi-argument calls with open argument, sample or result types. This prevents a later substitution from invalidating an earlier face-propagation check; cases requiring deferred structural fits remain unsupported. It can retry source definitions after later dependencies become available, and a two-arm boolean branch can retain separately owned literal-result obligations until a later closed context resolves them. Faced targets or union cases, list literals and general union-pattern branches remain unsupported.
73+
74+The checked inference slice now represents `!!`, proves empty cell positions and filters proven-empty union cases. List and unit payload arms whose elements are empty are rejected as unreachable; fixed opaque cases fail closed when reachability is unknown. The new shared guard covers checked interfaces, partial diagnostics and proof budgets. Its shared guard runs under eval and on the ship.
75+
76+An eval and ship fixture now reports partial inference for the unchanged todo island with its real API and Hoon readers. It verifies that the source fixtures match `my-app` and exercises missing or duplicate imports; the report does not claim the module or island has been checked. The prelude also has a Jibb-written recursive `lent` whose supported generic calls infer `@ud`. Execution and shape-based jet recognition remain future backend work. Nested union tests check equal runtime nouns, different nested tags, empty fields and unknown inhabitation.
77+
78+The prelude now writes `lth`, `gte` and `lte` in Jibb using `gth` and `not`. Supported generic and concrete calls infer, including loobeans; mismatched explicit auras fail. Execution, jet recognition and complete import checking remain unfinished.
79+
80+The prelude also writes `trip` and `tuba` over private primitives, with inferred cord, tape and UTF-32 list types matching the target ship's Hoon 135 definitions. Their composition with `lent` and invalid argument controls pass under eval and on the ship; primitive lowering, execution and jet recognition remain unfinished. In the unchanged todo report, `update` now reaches its remaining branch-context limitation instead of failing on missing text names.
81+
82+The Hoon reader can prove overlaps among supported original `$?` source cases, including nested cells and unions with more than two cases, and report them at a Jibb use site. It evaluates each case independently and compares runtime noun values. Other overlaps, Hoon case locations and mark-reader overlap diagnostics remain unfinished. The source screen allows at most 128 cases and 4,096 source noun nodes; dependency checking and pairwise witness analysis each have a separate 4,096-node budget. These budgets do not bound chapter lookup, Hoon evaluation or graph walks.
83+
84+Restricted-number promotion now skips an environment scan when a definition has no written capitals. In a single startup-inclusive pair on 2,000 independent gates, output was identical and user CPU fell from 71.67 to 38.26 seconds; wall time was 72.80 versus 51.66 seconds with other checks running. This is a partial-inference measurement, not a complete checker or a bound on dependent modules.
85+
86+## Milestone 1: parser and mark
87+
88+What the plan asks for, and where it is:
89+
90+| The plan | Where |
91+| --- | --- |
92+| The `%jibb` mark as the first tab gives it | `jibb-dev/mar/jibb.hoon`, as the doc writes it |
93+| The layout pass, emitting INDENT, DEDENT and NEWLINE | `+layout` in `jibb-dev/lib/jibb.hoon`, designed in its section 2 |
94+| A parser for the Grammar tab's EBNF that returns a syntax tree with source positions | `+parse` and `+parse-tokens`, section 3. Every node has a span, its start and end, and `+check-spans` tests the spans of every tree the golden tests print |
95+| Errors with file, line, column and an excerpt | `+show-error`, section 4.3. Each error points at the first character where the text stops being the start of any valid module (section 2.0) |
96+| Done when every Jibb code block in the doc parses | The doc labels its 14 Jibb blocks `jibb`. Each is a golden case, `tests/golden/doc-*`, and `tools/doc-blocks docs/spec` checks that they match. All parse; the one block written as an error, the Grammar's buttons example, has a type error for milestone 2 |
97+| Done when each lexical rule has a test input that breaks it | The `lex-*` golden cases: for each lexical rule, inputs that break it (`-bad-`), each with the error's expected place, and inputs that keep it (`-ok-`), except for the forms Jibb leaves out (the closers, blob and `@c` literals) |
98+| Done when `\|commit` stores `.jibb` files on a fake ship | `tools/ship check-commit`: 7 checks, from reading every file back byte for byte to three-way merges |
99+
100+Besides the plan's list:
101+
102+- 660 golden cases: 440 that parse and 220 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
103+- The 660-case corpus passed under `urbit eval` in 101.7 s while other checks were running. The fake ship passed all 711 tests, including the source-overlap, structural-overlap, generic-union source and alias-overlap, full-module overlap, deferred-context, generic-recursion, generic-construction, generic-pattern, deferred-inference, empty-mold and cell-branch fixtures, importer, importer/checker and mark/checker bridges, module scope, unification, hole, qath, ask, default-wrapper importer, projection, arithmetic, generic-alias, positional-face, API-evidence, request, closed-gate, todo API, constructor, sub, nested-union, gate-free and direct-gate guards and the unchanged todo report. Desk sync took 98.7 s while other checks were running. The importer golden compares 221 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, checks a recursive Ford import's origin, and passes Clay-built types through the Clay-built importer and partial checker.
104+- `tools/testdata/selftest` (22 checks), `tools/testdata/ship-selftest` and `tools/testdata/clay-fixtures-selftest` test the tools themselves; the last checks temporary Clay fixture cleanup and signal handling without a ship.
105+- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
106+- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
107+
108+### History
109+
110+| Commit | Date | What |
111+| --- | --- | --- |
112+| 1cb51df | 2026-10-29 | Foundation: the parser's design, the tools, the desks, the vendored base-dev and landscape files, the golden corpus |
113+| 15a5545 | 2026-10-29 | The layout pass |
114+| 3c5f50a | 2026-10-29 | The parser |
115+| 7c739b7 | 2026-10-30 | Fixes from two independent audits; milestone 1 done |
116+| 5a4aa73 | 2026-10-30 | `tools/doc-blocks`, after the doc labelled its Jibb blocks |
117+| ab797a9 | 2026-10-30 | The 12 grammar decisions of 2026-10-30: four changed the parser, eight confirmed it |
118+| aad6ddb | 2026-10-30 | Drop `$?`; `+$` takes union cases below its name |
119+| 1dd92a6 | 2026-10-30 | Begin type inference and Hoon imports |
120+| 51ce4d9 | 2026-10-30 | Extend partial inference and importer, record type and prelude decisions |
121+| be6d2a5 | 2026-10-30 | Add atom widening, nested collections and case-local Hoon import fixtures |
122+| 26554ac | 2026-10-30 | Infer an atom constraint, extend the prelude and read example molds through Clay |
123+| fbeaa83 | 2026-10-30 | Extend atom constraints and nested ordered-map imports; connect Clay types to partial inference |
124+| 47a1f49 | 2026-10-30 | Read validated Ford imports, widen aura families, and show both sites of selected errors |
125+| bd37989 | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
126+| 2d5deb2 | 2026-10-30 | Default gate-free decimal types, validate named Hoon mold lookup, and isolate fixture failures |
127+| 1b7dbae | 2026-10-30 | Infer acyclic local definitions and parse case-local Jibb module fixtures |
128+| 8b9c9ac | 2026-10-30 | Preserve recursive import origins, infer simple local molds, and supply Jibb module sources to the partial checker |
129+| 529736a | 2026-10-30 | Infer supported library import graphs and guard nested Hoon `$^` in collections |
130+| 8bf1b12 | 2026-10-30 | Infer selected record faces and check nested `$^` in static Hoon records |
131+| d8ac47d | 2026-10-30 | Cache library interfaces, preserve imported Hoon record faces, and check nested tagged unions |
132+| edd9277 | 2026-10-30 | Infer nonrecursive generic mold aliases with lexical parameters |
133+| 4406f6f | 2026-10-30 | Resolve selected contextual tags and check explicit imported unions |
134+| 5c73614 | 2026-10-30 | Print supported named and escaping union types |
135+| 0070584 | 2026-10-30 | Propagate union context through loobean branches, read selected unions in Hoon collections, and add `flit` |
136+| 250564c | 2026-10-30 | Infer selected named generic unions, test Hoon collection wrappers, and add list helpers |
137+| e95ef8f | 2026-10-30 | Bridge selected Hoon unions into partial inference and support generic union aliases |
138+| 56a899f | 2026-10-30 | Infer matching variable types in faced fields and bridge opaque Hoon collections |
139+| 4d45d2f | 2026-10-30 | Resolve selected contextual null literals |
140+| e878edc | 2026-10-30 | Infer complete unit-shaped branches and bridge selected recursive Hoon molds |
141+| 743dfd8 | 2026-10-30 | Propagate union context through unit-shaped branches |
142+| 3f90fa8 | 2026-10-30 | Share a partial prelude interface across module inference |
143+| 29bd39f | 2026-10-30 | Infer contextual list literals and validate prelude parity |
144+| a2a6ef5 | 2026-10-30 | Infer complete list-shaped branches |
145+| 671fe72 | 2026-10-30 | Infer contextual list nulls and cons cells |
146+| 7e69436 | 2026-10-30 | Infer selected self-recursive gates |
147+| 9ab52e8 | 2026-10-30 | Infer recursive branches with closed base types |
148+| d782b45 | 2026-10-30 | Propagate list context and apply settled type decisions |
149+| c7082e0 | 2026-10-30 | Infer multi-argument calls |
150+| 918acbd | 2026-10-30 | Infer recursive gates from their samples first |
151+| 1470d18 | 2026-10-30 | Infer selected prelude list helpers |
152+| 10cbf9c | 2026-10-30 | Infer selected local recursive gates and distinguish reader diagnostics |
153+| 45afb13 | 2026-10-30 | Infer local capital scopes and report direct reader diagnostics |
154+| 054e651 | 2026-10-30 | Report nested reader diagnostics |
155+| 98c19cd | 2026-10-30 | Infer known-aura string interpolation |
156+| ddba633 | 2026-10-30 | Infer top-level mutually recursive gates |
157+| 9f1517e | 2026-10-30 | Infer whole-case union patterns and prelude `turn` |
158+| 9dd35c8 | 2026-10-31 | Match finite boolean refinements of union cases |
159+| 54852d4 | 2026-10-31 | Contextualize tuple calls and infer known record changes |
160+| 0bc5113 | 2026-10-31 | Contextualize record initializers and infer unit construction |
161+| 264a436 | 2026-10-31 | Contextualize unit payloads in casts, calls and nested values |
162+| a140383 | 2026-10-31 | Report missing union tags and infer prelude unit helpers |
163+| d69cc52 | 2026-10-31 | Infer longer cell binder patterns and prelude unit helpers |
164+| ae35005 | 2026-10-31 | Import source-verified tagged Hoon unions |
165+| c8f894a | 2026-10-31 | Report nested missing tags and contextualize union branch results |
166+| ef2ea71 | 2026-10-31 | Import Hoon null singleton cases |
167+| 67f900e | 2026-10-31 | Infer local mutual gates and uncontextualized lists |
168+| 7ff15f1 | 2026-10-31 | Contextualize finite union patterns and record the initial poke decision |
169+| c790a9f | 2026-10-31 | Expose transparent `poke` from the internal prelude |
170+| ef4772a | 2026-10-31 | Bridge imported loobeans and loobean singletons |
171+| ad46655 | 2026-10-31 | Bridge selected imported any-noun molds |
172+| beada10 | 2026-10-31 | Import source-proved Ford mark unions, analyze API paths and infer list helpers |
173+| e28f7be | 2026-10-31 | Diagnose proven non-gate cycles and import Tlon null-payload union cases |
174+| fd2f288 | 2026-10-31 | Infer qualified fields of imported values |
175+| ed9291e | 2026-10-31 | Infer term-headed pairs and function helpers, and import nested named unions |
176+| ad0265e | 2026-10-31 | Infer proven single-case patterns and the prelude command union |
177+| 413b12b | 2026-10-31 | Propagate known result context into generic calls and batch ship deletions |
178+| c690076 | 2026-10-31 | Propagate loobean context, infer predicate helpers, and import named ordered-map operands |
179+| 0bf6178 | 2026-10-31 | Bridge recursive Tlon lists and prepare a private comparison interface |
180+| 4e472b5 | 2026-10-31 | Pass known named unions through polymorphic gates |
181+| e3e184f | 2026-10-31 | Parse type holes, reject duplicate written record fields, and extend partial union inference and imports |
182+| 80e221a | 2026-10-31 | Infer supported annotation holes and prelude list aliases |
183+| ba1fec4 | 2026-10-31 | Add the curried `bond` prelude gate |
184+| 0ea700d | 2026-10-31 | Infer a source-defined recursive `qath` subset and record the explicit `proj` decision |
185+| 75f5952 | 2026-10-31 | Check a subset of explicit `proj` calls and retain their lowering evidence |
186+| cf17925 | 2026-10-31 | Infer supported single-field projections |
187+| 1a891e2 | 2026-10-31 | Infer source-backed addition and decrement without loobean operands; record the watchability decision |
188+| 81af5fd | 2026-10-31 | Preserve public names of identity-generic union aliases and record the `like` decision |
189+| 640a442 | 2026-10-31 | Add the source-backed `like` result mapper and infer supported positional calls |
190+| 445a0a1 | 2026-10-31 | Retain source-backed API path evidence and classify declarations |
191+| f69493d | 2026-10-31 | Derive supported request components from API declarations |
192+| f0f6954 | 2026-10-31 | Analyze supported API helper definitions and declared marks |
193+| 3f55af7 | 2026-10-31 | Define source-backed transparent ask and pure |
194+| ae1ec26 | 2026-10-31 | Prove selected default-wrapped Hoon unions from source |
195+| dde791c | 2026-10-31 | Infer a source-backed request-gate type through ordinary imports |
196+| a1c5f35 | 2026-10-31 | Infer supported multi-path requests and named closed folds |
197+| 911ca0c | 2026-10-31 | Propagate union context, define subscriptions and match literal nouns |
198+| 72acdb3 | 2026-10-31 | Infer selected nested union payloads from context |
199+| 706035c | 2026-10-31 | Analyze gate-free source molds with field witnesses |
200+| 651b8ec | 2026-10-31 | Match source-proven gate samples in direct calls |
201+| cc8e389 | 2026-10-31 | Add source-backed list length and real todo regression |
202+| 4da6891 | 2026-10-31 | Add source-backed comparisons and nested Hoon union controls |
203+| 09db390 | 2026-10-31 | Skip unnecessary inference environment scans |
204+| 179d717 | 2026-10-31 | Diagnose source-proven Hoon union overlaps |
205+| 142f2e2 | 2026-10-31 | Prove structural overlaps across Hoon union cases |
206+| c96597d | 2026-10-31 | Track source-proven generic recursive identities |
207+| 190a9d5 | 2026-10-31 | Add source-backed list flattening |
208+| d9d51e6 | 2026-10-31 | Check source-proven recursive tree construction |
209+| 30b0a9e | 2026-10-31 | Match source-proven recursive tree cases |
210+| 72d85ab | 2026-10-31 | Add bounded deferred inference and expand runtime equality coverage |
211+| 22f3788 | 2026-10-31 | Check empty molds and propagate closed cell context into branches |
212+| 341bcb4 | 2026-10-31 | Keep deferred fits stable under later substitutions |
213+| b93a94b | 2026-10-31 | Prove local generic-alias union tags and add successor |
214+| 2826c93 | 2026-10-31 | Report generic-alias overlaps and retain deferred branch contexts |
215+| b5cdc80 | 2026-10-31 | Preserve full-module overlap source evidence |
216+| ab6fdc1 | 2026-10-31 | Add source-backed text conversion wrappers |
217+| aa277c9 | 2026-10-31 | Recover prepared tuple initializers in partial reports |
218+| b4703e7 | 2026-11-01 | Check narrow closed subscription-free program mains |
219+| 26bf7a7 | 2026-11-01 | Recover narrow direct-program initializer contexts |
220+| 642d2c0 | 2026-11-01 | Prove direct request-value watchability for program subscriptions |
221+| 2e4d582 | 2026-11-01 | Add the source-backed UI, program and page prelude slice |
222+| This change | 2026-11-01 | Recover direct-program update result contexts |
223+
224+## Checking it
225+
226+On a machine set up as [development.md](development.md) says:
227+
228+```
229+tools/golden # 660 cases under urbit eval
230+tools/importer-test # the Hoon importer fixture projection
231+tools/type-import-default-test # default-wrapped source proof golden
232+tools/type-import-test # the importer/checker bridge fixture
233+tools/type-import-overlap-test # source-aware Hoon overlap and provenance fixture
234+tools/type-import-structural-test # structural overlap and multi-case source fixture
235+tools/type-union-source-test # local generic-alias union guards
236+tools/type-union-alias-overlap-test # local generic-alias overlap diagnostics
237+tools/type-full-overlap-test # full-module overlap evidence
238+tools/type-tlon-test # the real Tlon reader/checker fixture
239+tools/type-mark-test # the mark/checker bridge fixture
240+tools/type-poke-test # the source-backed poke/API fixture
241+tools/type-api-evidence-test # API declaration evidence guards
242+tools/type-api-paths-test # partial API path metadata fixture
243+tools/type-hole-guards-test # hole defaulting and API interface guards
244+tools/type-list-alias-test # prelude list-alias guards
245+tools/type-generic-alias-test # generic union alias guards
246+tools/type-generic-recursion-test # source-proven generic recursion guards
247+tools/type-generic-construction-test # source-proven recursive construction guards
248+tools/type-generic-pattern-test # source-proven recursive pattern guards
249+tools/type-deferred-test # source-owned deferred inference guards
250+tools/type-deferred-resolver-test # resolver consistency and failure guards
251+tools/type-deferred-context-test # deferred source-order and branch guards
252+tools/type-deferred-prepared-test # prepared initializer reports and failure guards
253+tools/type-empty-test # empty molds and coverage guards
254+tools/type-cell-branch-test # branch context and rollback guards
255+tools/type-positional-face-guards-test # positional sample face guards
256+tools/type-qath-guards-test # qath source and unfolding guards
257+tools/type-ask-guards-test # ask source and bootstrap guards
258+tools/type-proj-guards-test # projection evidence and scope guards
259+tools/type-module-scope-test # module and prelude scope fixture
260+tools/type-program-main-test # closed program-main interface and rejection guards
261+tools/type-program-init-test # transactional direct-program initializer context guards
262+tools/type-program-update-test # transactional direct-program update context guards
263+tools/hoon check-spans-test # prints <<>> when the span checker works
264+tools/testdata/selftest # the tools themselves
265+tools/doc-blocks docs/spec # the doc's examples are golden cases
266+tools/ship start
267+tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
268+tools/ship test # the same 660 cases as -test arms on the ship
269+tools/testdata/ship-selftest
270+tools/testdata/clay-fixtures-selftest # scratch fixture cleanup without a ship
271+tools/ship check-commit # |commit stores .jibb files
272+tools/clay-fixtures # example /sur files and marks build through Clay
273+```
274+
275+## What milestone 1 leaves to later milestones
276+
277+- Errors carry a start only. Spans keep each node's end so that milestone 2's type errors can underline both conflicting sites with excerpts (library section 1).
278+- The parser accepts forms for the checker to judge: `[]`, `[a]`, `m()`, `!! a`, and the module kinds. `[]` and `m()` have since been decided to be errors, and `[a]` is `a`; the parser has not changed. The Grammar's buttons example parses, though the doc marks it as a type error.
279+- Grammar questions the doc's author hasn't been asked follow the readings in [open-questions.md](open-questions.md).
jibb-dev/lib/jibb-import.hoonnew file+2308
@@ -0,0 +1,2308 @@
1+:: /lib/jibb-import.hoon: a partial reader of Hoon's type graph
2+::
3+:: +read-mold accepts one selected Hoon type and its module/name, rather
4+:: than loading a whole /sur. +read-mold-in also takes the originating
5+:: /sur core and verifies the selected arm; this provenance is required
6+:: to identify collections without mistaking a local shadow for one.
7+:: The caller selects only types actually used.
8+:: Hoon's %hold nodes retain the generator's Hoon and its bound arguments.
9+:: Comparing that Hoon to the standard generators identifies collections
10+:: before they expand into trees. Recursive holds are tracked by identity;
11+:: a repeated named hold becomes a module-qualified reference. A proven
12+:: nested self-recursive tagged union retains its own named boundary.
13+::
14+:: A direct $^ is read from its original branches and accepted only when
15+:: their imported shapes prove disjoint. A single nested $^ in a
16+:: static record is checked by splitting and reassembling its branches;
17+:: other nested forms and unprovably disjoint cases remain unsupported. Source-level overlap in
18+:: other unions, general nested ordered maps, broader Ford subject
19+:: shapes, ambiguous recursive origins and full error locations still
20+:: need work. One direct union argument to a standard collection is
21+:: recovered only from its exact call wrapper, static independent cases,
22+:: proven disjoint branches and unshadowed standard names. Other source
23+:: shapes fail closed. A nested ordered map is recovered only when its key and
24+:: value are fixed atom molds and
25+:: the other fields are fixed atoms or collections of static atoms;
26+:: other source shapes fail closed.
27+::
28+:: The partial checker bridges supported nouns, atoms, cells, faces,
29+:: proven forks and collections, and keeps proven recursive roots nominal.
30+:: Unsupported shapes fail closed. Reader failures return %|; no partial
31+:: tree is returned as success.
32+::
33+|%
34++$ imported
35+ $~ [%noun ~]
36+ $% [%noun ~]
37+ [%void ~]
38+ [%atom aura=term value=(unit @)]
39+ [%cell head=imported tail=imported]
40+ [%face name=term body=imported]
41+ [%fork cases=(list imported)]
42+ [%named module=term name=term body=imported]
43+ [%apply name=term args=(list imported)]
44+ [%ref module=term name=term]
45+ [%bad reason=@t]
46+ [%invalid code=?(%aura %core) reason=@t]
47+ ==
48++$ import-diagnostic
49+ $% [%ok value=imported]
50+ [%invalid code=?(%aura %core %overlap) message=@t]
51+ [%unsupported message=@t]
52+ ==
53++$ signatures (list [name=term code=hoon])
54++$ visiting (list [typ=type name=(unit term)])
55+::
56+:: +code-of: the generator body, independent of its mold arguments.
57+::
58+++ code-of
59+ |= text=@t
60+ ^- hoon
61+ =/ typ=type (~(play ut -:!>(..zuse)) (ream text))
62+ ?> ?=([%hold *] typ)
63+ q.typ
64+::
65+++ catalog
66+ ^- signatures
67+ :~ [%map (code-of '*(map @ud @ud)')]
68+ [%set (code-of '*(set @ud)')]
69+ [%qeu (code-of '*(qeu @ud)')]
70+ [%jar (code-of '*(jar @ud @ud)')]
71+ [%jug (code-of '*(jug @ud @ud)')]
72+ [%list (code-of '*(list @ud)')]
73+ [%unit (code-of '*(unit @ud)')]
74+ [%vase (code-of '*vase')]
75+ ==
76+::
77+++ read-mold
78+ |= [module=term name=term typ=type]
79+ ^- (each imported @t)
80+ (read-with module name typ ~)
81+::
82+:: When Hoon's expanded type has lost source cases, inspect the exact
83+:: selected local arm. Restrict this fallback to distinct literal head tags
84+:: and proven-safe dependencies, then verify each projected branch again.
85++$ tagged-case [tag=@ branch=spec]
86+:: Clay and eval expose different versions of the spec union. Inspect help
87+:: and source-location wrappers as nouns before checking their contained spec.
88+++ source-gist-tail
89+ |= raw=*
90+ ^- (unit *)
91+ ?: ?=([%gist [%help *] *] raw) `+.+.raw
92+ ?: ?=([%dbug * *] raw) `+.+.raw
93+ ~
94+::
95+:: Bound metadata work separately from semantic source-node visits.
96+++ source-unwrap
97+ |= [raw=* left=@ud]
98+ ^- (unit *)
99+ =/ wrapper=(unit *) (source-gist-tail raw)
100+ ?~ wrapper `raw
101+ ?: =(left 0) ~
102+ $(raw u.wrapper, left (dec left))
103+::
104+++ tagged-term
105+ |= leaf=spec
106+ ^- (unit @)
107+ =/ plain=(unit *) (source-unwrap leaf 4)
108+ ?~ plain ~
109+ ?. ?=([%leaf %tas @] u.plain) ~
110+ `+.+.u.plain
111+::
112+++ tagged-head
113+ |= branch=spec
114+ ^- (unit @)
115+ =/ plain=(unit *) (source-unwrap branch 4)
116+ ?~ plain ~
117+ =. branch ;;(spec u.plain)
118+ ?+ branch ~
119+ [%bccl *]
120+ ?~ t.p.branch ~
121+ (tagged-term i.p.branch)
122+ ==
123+::
124+++ tagged-cases
125+ |= [cases=(list spec) tags=(list @)]
126+ ^- (unit (list tagged-case))
127+ ?~ cases `~
128+ ?: |((has-spec-cell-union i.cases) (has-spec-general-union i.cases)) ~
129+ =/ tag=(unit @) (tagged-head i.cases)
130+ ?~ tag ~
131+ ?: (lien tags |=(x=@ =(x u.tag))) ~
132+ =/ rest $(cases t.cases, tags [u.tag tags])
133+ ?~ rest ~
134+ `[[u.tag i.cases] u.rest]
135+
136+::
137+:: Bound the new $? branch screen independently of the existing $% path.
138+:: Count raw noun nodes across all cases, and cap pairwise tag comparisons.
139+++ bounded-no-spec-unions
140+ |= [h=* fuel=@ud]
141+ ^- (unit @ud)
142+ ?: =(fuel 0) ~
143+ =. fuel (dec fuel)
144+ ?@ h `fuel
145+ ?: ?=([%bckt ^ ^] h) ~
146+ ?: ?=([%bcwt [^ [^ *]]] h) ~
147+ ?: ?=([%bccn [^ [^ *]]] h) ~
148+ =/ left=(unit @ud) $(h -.h)
149+ ?~ left ~
150+ $(h +.h, fuel u.left)
151+++ tagged-bounded-cases
152+ |= [cases=(list spec) tags=(list @) fuel=@ud left=@ud]
153+ ^- (unit (list tagged-case))
154+ ?~ cases `~
155+ ?: =(left 0) ~
156+ =/ remaining=(unit @ud) (bounded-no-spec-unions i.cases fuel)
157+ ?~ remaining ~
158+ =/ tag=(unit @) (tagged-head i.cases)
159+ ?~ tag ~
160+ ?: (lien tags |=(x=@ =(x u.tag))) ~
161+ =/ rest $(cases t.cases, tags [u.tag tags], fuel u.remaining, left (dec left))
162+ ?~ rest ~
163+ `[[u.tag i.cases] u.rest]
164+::
165+:: Benign source annotations have different typed representations on
166+:: Clay and under eval. Inspect the wrapper as a noun, and validate the
167+:: contained Hoon before examining an arm.
168+++ source-note-tail
169+ |= raw=*
170+ ^- (unit *)
171+ ?: ?=([%note [%help *] *] raw) `+.+.raw
172+ ?: ?=([%dbug * *] raw) `+.+.raw
173+ ~
174+::
175+++ source-note-unwrap
176+ |= [raw=* left=@ud]
177+ ^- (unit *)
178+ =/ wrapper=(unit *) (source-note-tail raw)
179+ ?~ wrapper `raw
180+ ?: =(left 0) ~
181+ $(raw u.wrapper, left (dec left))
182+::
183+:: A bounded $~ source wrapper changes the default, not the mold.
184+:: Each annotation chain and default chain is separately bounded.
185+++ tagged-default-union
186+ |= [body=spec left=@ud]
187+ ^- (unit spec)
188+ =/ plain=(unit *) (source-unwrap body 4)
189+ ?~ plain ~
190+ =. body ;;(spec u.plain)
191+ ?. ?=([%bcsg *] body) `body
192+ ?: =(left 0) ~
193+ $(body q.body, left (dec left))
194+::
195+++ tagged-source-code
196+ |= [code=hoon name=term]
197+ ^- (unit (list tagged-case))
198+ =/ found=(unit spec) (local-mold-spec code name)
199+ ?~ found ~
200+ =/ body=(unit spec) (tagged-default-union u.found 4)
201+ ?~ body ~
202+ ?- u.body
203+ [%bccn *]
204+ =/ cases=(list spec) p.u.body
205+ ?~ cases ~
206+ ?~ t.cases ~
207+ (tagged-cases cases ~)
208+ [%bcwt *]
209+ =/ cases=(list spec) p.u.body
210+ ?~ cases ~
211+ ?~ t.cases ~
212+ (tagged-bounded-cases cases ~ 4.096 128)
213+ * ~
214+ ==
215+::
216+:: Source proof for dependencies of an explicitly tagged union. Only
217+:: simple local molds, standard collections and distinct term enums are
218+:: accepted; computed molds, nested cell unions and cycles fail closed.
219+:: One shared fuel budget bounds repeated visits through acyclic aliases;
220+:: exhaustion or an inherited same-name arm leaves the result unsupported.
221+++ local-arm-source
222+ |= [cor=type name=term]
223+ ^- (unit hoon)
224+ ?. ?=([%core *] cor) ~
225+ =/ chapters=(map term tome) q.r.q.cor
226+ =/ all=(list [term tome]) ~(tap by chapters)
227+ ?: (lien all |=(e=[term tome] &(!=(-.e %$) (chapter-unsafe +.e name)))) ~
228+ =/ chapter=(unit tome) (~(get by chapters) %$)
229+ ?~ chapter ~
230+ (chapter-source u.chapter name)
231+::
232+++ local-mold-spec
233+ |= [code=hoon name=term]
234+ ^- (unit spec)
235+ =/ plain=(unit *) (source-note-unwrap code 4)
236+ ?~ plain ~
237+ =. code ;;(hoon u.plain)
238+ ?+ code ~
239+ [%ktcl *]
240+ ?. ?=([%name * *] p.code) ~
241+ ?. =(name p.p.code) ~
242+ `q.p.code
243+ ==
244+::
245+++ safe-source-enum
246+ |= [cases=(list spec) seen=(list @) fuel=@ud]
247+ ^- (unit @ud)
248+ ?~ cases `fuel
249+ ?: =(fuel 0) ~
250+ =/ tag=(unit @) (tagged-term i.cases)
251+ ?~ tag ~
252+ ?: (lien seen |=(n=@ =(n u.tag))) ~
253+ $(cases t.cases, seen [u.tag seen], fuel (dec fuel))
254+::
255+++ safe-source-specs-mode
256+ |= [xs=(list spec) cor=type seen=(list term) fuel=@ud allow-nested=?]
257+ ^- (unit @ud)
258+ ?~ xs `fuel
259+ =/ left=(unit @ud) (safe-source-spec-mode i.xs cor seen fuel allow-nested)
260+ ?~ left ~
261+ $(xs t.xs, fuel u.left)
262+::
263+++ safe-source-name-mode
264+ |= [name=term cor=type seen=(list term) fuel=@ud allow-nested=?]
265+ ^- (unit @ud)
266+ :: Permit a direct root revisit or one proven nested self-revisit.
267+ :: Mutual cycles and inherited same-name bindings remain unavailable.
268+ ?: (lien seen |=(x=term =(name x)))
269+ ?. ?=([%core *] cor) ~
270+ ?. (scope-safe p.cor name) ~
271+ ?: =(seen ~[name]) `fuel
272+ ?. allow-nested ~
273+ ?. ?=([* [* ~]] seen) ~
274+ ?. =(i.seen name) ~
275+ =/ selected=(unit hoon) (local-arm-source cor name)
276+ ?~ selected ~
277+ =/ cases=(unit (list tagged-case)) (tagged-source-code u.selected name)
278+ ?~ cases ~
279+ `fuel
280+ =/ arm=(unit hoon) (local-arm-source cor name)
281+ ?~ arm
282+ ?. &(|(=(name %ship) =(name %path)) (scope-safe cor name)) ~
283+ `fuel
284+ ?. ?=([%core *] cor) ~
285+ ?. (scope-safe p.cor name) ~
286+ =/ body=(unit spec) (local-mold-spec u.arm name)
287+ ?~ body ~
288+ (safe-source-spec-mode u.body cor [name seen] fuel allow-nested)
289+::
290+++ safe-source-spec-mode
291+ |= [shape=spec cor=type seen=(list term) fuel=@ud allow-nested=?]
292+ ^- (unit @ud)
293+ =/ plain=(unit *) (source-unwrap shape 4)
294+ ?~ plain ~
295+ =. shape ;;(spec u.plain)
296+ ?: =(fuel 0) ~
297+ =. fuel (dec fuel)
298+ ?+ shape ~
299+ [%base *] ?:(|(?=([%atom *] p.shape) =(%flag p.shape) =(%null p.shape)) `fuel ~)
300+ [%leaf *] `fuel
301+ [%bcsg *] $(shape q.shape)
302+ [%bcts *] ?@ p.shape $(shape q.shape)
303+ ~
304+ [%bccl *] (safe-source-specs-mode p.shape cor seen fuel allow-nested)
305+ [%bccn *]
306+ :: A source proof may cross one named union dependency. Deeper
307+ :: named unions stay unsupported to bound recursive reprojection.
308+ ?. allow-nested ~
309+ ?. ?=([* [* ~]] seen) ~
310+ =/ cases=(unit (list tagged-case)) (tagged-cases p.shape ~)
311+ ?~ cases ~
312+ ?~ u.cases ~
313+ ?~ t.u.cases ~
314+ (safe-source-tagged-fuel-mode u.cases cor seen fuel allow-nested)
315+ [%bcwt *] (safe-source-enum p.shape ~ fuel)
316+ [%like *]
317+ ?. ?=([@ ~] p.shape) ~
318+ ?. ?=(~ q.shape) ~
319+ (safe-source-name-mode i.p.shape cor seen fuel allow-nested)
320+ [%make *]
321+ =/ wing=(unit term) (source-single-wing p.shape)
322+ ?~ wing ~
323+ =/ n=term u.wing
324+ ?. (lien `(list term)`~[%map %set %qeu %list %unit %jar %jug] |=(x=term =(x n))) ~
325+ ?. (scope-safe cor n) ~
326+ (safe-source-specs-mode q.shape cor seen fuel allow-nested)
327+ ==
328+::
329+++ safe-source-tagged-fuel-mode
330+ |= [cases=(list tagged-case) cor=type seen=(list term) fuel=@ud allow-nested=?]
331+ ^- (unit @ud)
332+ ?~ cases `fuel
333+ =/ left=(unit @ud) (safe-source-spec-mode branch.i.cases cor seen fuel allow-nested)
334+ ?~ left ~
335+ $(cases t.cases, fuel u.left)
336+::
337+++ safe-source-name
338+ |= [name=term cor=type seen=(list term) fuel=@ud]
339+ ^- (unit @ud)
340+ (safe-source-name-mode name cor seen fuel &)
341+::
342+++ safe-source-tagged
343+ |= [cases=(list tagged-case) cor=type seen=(list term) fuel=@ud]
344+ ^- ?
345+ ?=(^ (safe-source-tagged-fuel-mode cases cor seen fuel &))
346+::
347+++ tagged-union-fallback
348+ |= [module=term name=term cor=type]
349+ ^- (unit (each imported @t))
350+ ?. ?=([%core *] cor) ~
351+ =/ chapters=(map term tome) q.r.q.cor
352+ =/ other=(list [term tome]) ~(tap by chapters)
353+ ?: (lien other |=(e=[term tome] &(!=(-.e %$) (chapter-unsafe +.e name)))) ~
354+ =/ chapter=(unit tome) (~(get by chapters) %$)
355+ ?~ chapter ~
356+ =/ selected=(unit hoon) (chapter-source u.chapter name)
357+ ?~ selected ~
358+ =/ cases (tagged-source-code u.selected name)
359+ ?~ cases ~
360+ :: Preserve the original budget when no nested union recovery is needed.
361+ =/ plain=? ?=(^ (safe-source-tagged-fuel-mode u.cases cor ~[name] 4.096 |))
362+ ?. |(plain (safe-source-tagged u.cases cor ~[name] 256)) ~
363+ =/ tried=(each (list type) tang)
364+ (mule |.((turn u.cases |=(c=tagged-case (~(play ut cor) [%kttr branch.c])))))
365+ ?. ?=([%& *] tried) ~
366+ :: Record the selected hold before projecting branches so an exact
367+ :: recursive revisit can retain its independently verified origin.
368+ =/ selected-type=(each type tang)
369+ (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
370+ ?. ?=([%& *] selected-type) ~
371+ =/ projected=(each (list imported) tang)
372+ (mule |.((turn p.tried |=(t=type (walk module t catalog ~[[p.selected-type [~ name]]] `cor)))))
373+ ?. ?=([%& *] projected) ~
374+ ?^ (first-bads p.projected) ~
375+ ?. (all-disjoint p.projected) ~
376+ =/ xs=(list tagged-case) u.cases
377+ =/ ys=(list imported) p.projected
378+ |-
379+ ?~ xs
380+ ?^ ys ~
381+ `[%& [%fork (sort p.projected |=(pair=[imported imported] (dor -.pair +.pair)))]]
382+ ?~ ys ~
383+ ?. ?=([%cell [%atom %tas [~ @]] *] i.ys) ~
384+ ?. =(tag.i.xs u.value.head.i.ys) ~
385+ $(xs t.xs, ys t.ys)
386+
387+::
388+:: Unlike the disjoint-reader fallback, source overlap may have repeated
389+:: tags. Bound both raw case traversal and the number of pair attempts.
390+++ overlap-source-cases
391+ |= [cases=(list spec) fuel=@ud left=@ud]
392+ ^- (unit (list tagged-case))
393+ ?~ cases `~
394+ ?: =(left 0) ~
395+ =/ remaining=(unit @ud) (bounded-no-spec-unions i.cases fuel)
396+ ?~ remaining ~
397+ =/ tag=(unit @) (tagged-head i.cases)
398+ ?~ tag ~
399+ =/ rest $(cases t.cases, fuel u.remaining, left (dec left))
400+ ?~ rest ~
401+ `[[u.tag i.cases] u.rest]
402+++ overlap-repeated-tag
403+ |= cases=(list tagged-case)
404+ ^- ?
405+ ?~ cases |
406+ ?: (lien t.cases |=(c=tagged-case =(tag.c tag.i.cases))) &
407+ $(cases t.cases)
408+++ overlap-projections-match
409+ |= [xs=(list tagged-case) ys=(list imported)]
410+ ^- ?
411+ ?~ xs ?=(~ ys)
412+ ?~ ys |
413+ ?. ?=([%cell [%atom %tas [~ @]] *] i.ys) |
414+ ?. =(tag.i.xs u.value.head.i.ys) |
415+ $(xs t.xs, ys t.ys)
416+++ overlap-source-witness
417+ |= [module=term name=term cor=type]
418+ ^- ?
419+ ?. ?=([%core *] cor) |
420+ =/ selected=(unit hoon) (local-arm-source cor name)
421+ ?~ selected |
422+ =/ shape=(unit spec) (local-mold-spec u.selected name)
423+ ?~ shape |
424+ =/ body=(unit spec) (tagged-default-union u.shape 4)
425+ ?~ body |
426+ ?. ?=([%bcwt *] u.body) |
427+ =/ cases=(unit (list tagged-case)) (overlap-source-cases p.u.body 4.096 128)
428+ ?~ cases |
429+ ?. (overlap-repeated-tag u.cases) |
430+ ?. ?=(^ (safe-source-tagged-fuel-mode u.cases cor ~[name] 4.096 |)) |
431+ =/ tried=(each (list type) tang)
432+ (mule |.((turn u.cases |=(c=tagged-case (~(play ut cor) [%kttr branch.c])))))
433+ ?. ?=([%& *] tried) |
434+ =/ projected=(each (list imported) tang)
435+ (mule |.((turn p.tried |=(t=type (walk module t catalog ~ `cor)))))
436+ ?. ?=([%& *] projected) |
437+ ?^ (first-bads p.projected) |
438+ ?. (overlap-projections-match u.cases p.projected) |
439+ =/ witness=(unit overlap-proof-result) (overlap-case-pairs p.projected 4.096)
440+ ?~ witness |
441+ found.u.witness
442+::
443+:: Positive overlap evidence only: false means no proof, not disjointness.
444+:: Fuel is shared across all examined nodes and sibling alternatives.
445++$ overlap-proof-result [found=? left=@ud]
446+++ overlap-known-atom
447+ |= aura=term
448+ ^- ?
449+ (lien `(list term)`~[%t %tas %ud %f] |=(n=term =(n aura)))
450+++ overlap-inhabited-list
451+ |= [xs=(list imported) fuel=@ud]
452+ ^- (unit overlap-proof-result)
453+ ?~ xs `[| fuel]
454+ ?: =(0 fuel) ~
455+ =/ one=(unit overlap-proof-result) (overlap-inhabited i.xs (dec fuel))
456+ ?~ one ~
457+ ?: found.u.one one
458+ $(xs t.xs, fuel left.u.one)
459+++ overlap-inhabited
460+ |= [x=imported fuel=@ud]
461+ ^- (unit overlap-proof-result)
462+ ?: =(0 fuel) ~
463+ =. fuel (dec fuel)
464+ ?- x
465+ [%noun *] `[& fuel]
466+ [%void *] `[| fuel]
467+ [%atom *] `[|(?=(^ value.x) (overlap-known-atom aura.x)) fuel]
468+ [%face *] $(x body.x)
469+ [%named *] $(x body.x)
470+ [%fork *] (overlap-inhabited-list cases.x fuel)
471+ [%cell *]
472+ =/ a=(unit overlap-proof-result) $(x head.x)
473+ ?~ a ~
474+ ?. found.u.a a
475+ $(x tail.x, fuel left.u.a)
476+ * `[| fuel]
477+ ==
478+++ overlap-pair-list
479+ |= [xs=(list imported) y=imported fuel=@ud]
480+ ^- (unit overlap-proof-result)
481+ ?~ xs `[| fuel]
482+ ?: =(0 fuel) ~
483+ =/ p=(unit overlap-proof-result) (overlap-pair i.xs y (dec fuel))
484+ ?~ p ~
485+ ?: found.u.p p
486+ $(xs t.xs, fuel left.u.p)
487+++ overlap-pair
488+ |= [a=imported b=imported fuel=@ud]
489+ ^- (unit overlap-proof-result)
490+ ?: =(0 fuel) ~
491+ =. fuel (dec fuel)
492+ ?: ?=([%face *] a) $(a body.a)
493+ ?: ?=([%face *] b) $(b body.b)
494+ ?: ?=([%named *] a) $(a body.a)
495+ ?: ?=([%named *] b) $(b body.b)
496+ ?: ?=([%fork *] a) (overlap-pair-list cases.a b fuel)
497+ ?: ?=([%fork *] b) (overlap-pair-list cases.b a fuel)
498+ ?: ?=([%noun *] a) (overlap-inhabited b fuel)
499+ ?: ?=([%noun *] b) (overlap-inhabited a fuel)
500+ ?: &(?=([%cell *] a) ?=([%cell *] b))
501+ =/ p=(unit overlap-proof-result) $(a head.a, b head.b)
502+ ?~ p ~
503+ ?. found.u.p p
504+ $(a tail.a, b tail.b, fuel left.u.p)
505+ ?. &(?=([%atom *] a) ?=([%atom *] b)) `[| fuel]
506+ ?^ value.a
507+ ?^ value.b `[=(u.value.a u.value.b) fuel]
508+ `[&(=(u.value.a 0) (overlap-known-atom aura.b)) fuel]
509+ ?^ value.b `[&(=(u.value.b 0) (overlap-known-atom aura.a)) fuel]
510+ `[&((overlap-known-atom aura.a) (overlap-known-atom aura.b)) fuel]
511+++ overlap-case-pairs
512+ |= [xs=(list imported) fuel=@ud]
513+ ^- (unit overlap-proof-result)
514+ ?~ xs `[| fuel]
515+ ?: =(0 fuel) ~
516+ =/ p=(unit overlap-proof-result) (overlap-pair-list t.xs i.xs (dec fuel))
517+ ?~ p ~
518+ ?: found.u.p p
519+ $(xs t.xs, fuel left.u.p)
520+::
521+:: +read-mold-in: accept the /sur core as provenance. The core must be
522+:: built against zuse or validated Ford imports, and its selected arm
523+:: must be this type. Unknown subject shapes fail closed.
524+++ read-mold-in
525+ |= [module=term name=term typ=type cor=type]
526+ ^- (each imported @t)
527+ ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
528+ ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
529+ ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
530+ =/ chapters=(map term tome) q.r.q.cor
531+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
532+ [%| (crip "Hoon mold `{(trip name)}` is not declared")]
533+ ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
534+ [%| 'Hoon module provenance does not match the selected mold']
535+ =/ overlap=(each ? tang) (mule |.((overlap-source-witness module name cor)))
536+ ?: &(?=(%& -.overlap) p.overlap) [%| 'Hoon union cases overlap']
537+ =/ result (read-with module name typ [~ cor])
538+ ?: ?=([%& *] result) result
539+ =/ fallback=(each (unit (each imported @t)) tang)
540+ (mule |.((tagged-union-fallback module name cor)))
541+ ?: ?=(%| -.fallback) result
542+ ?~ p.fallback result
543+ u.p.fallback
544+::
545+:: +read-named is the source-aware entry point for callers that have
546+:: not selected a Hoon type yet. Check the core and the local arm
547+:: before invoking Hoon's type engine, which otherwise crashes when
548+:: the requested name is absent.
549+++ read-named
550+ |= [module=term name=term cor=type]
551+ ^- (each imported @t)
552+ ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
553+ ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
554+ ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
555+ =/ chapters=(map term tome) q.r.q.cor
556+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
557+ [%| (crip "Hoon mold `{(trip name)}` is not declared")]
558+ =/ attempted=(each type tang)
559+ (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
560+ ?- attempted
561+ [%& *] (read-mold-in module name p.attempted cor)
562+ [%| *]
563+ =/ lines=wall (zing (turn (flop p.attempted) |=(a=tank (wash [0 80] a))))
564+ =/ rev=wall (flop lines)
565+ ?~ rev [%| (crip "Hoon mold `{(trip name)}` could not be evaluated")]
566+ [%| (crip "Hoon mold `{(trip name)}` could not be evaluated: {i.rev}")]
567+ ==
568+::
569+:: A mark door's payload is [sample build-subject]. Its outer sample
570+:: face names the door sample, not the imported mark type. Collection
571+:: lookup for the sample happened against the pre-door build subject.
572+:: Fallback for a mark whose sample is exactly one arm of its only
573+:: Ford-imported /sur core. Source validation remains in read-mold-in.
574+:: Recursive results need a separate mark-origin/interface design.
575+++ mark-has-ref
576+ |= node=imported
577+ ^- ?
578+ ?- node
579+ [%ref *] &
580+ [%named *] $(node body.node)
581+ [%face *] $(node body.node)
582+ [%cell *] |($(node head.node) $(node tail.node))
583+ [%fork *] (lien cases.node |=(child=imported (mark-has-ref child)))
584+ [%apply *] (lien args.node |=(child=imported (mark-has-ref child)))
585+ * |
586+ ==
587+::
588+++ mark-union-fallback
589+ |= [raw=type context=type]
590+ ^- (unit (each imported @t))
591+ ?. ?=([%cell [%face @ [%core *]] *] context) ~
592+ ?. =(q.context -:!>(..zuse)) ~
593+ =/ alias=term p.p.context
594+ =/ core=type q.p.context
595+ ?. ?=([%hold *] raw) ~
596+ =/ name=(unit term) (hold-name q.raw)
597+ ?~ name ~
598+ =/ selected=(each type tang)
599+ (mule |.((~(play ut core) (ream (cat 3 '*' u.name)))))
600+ ?. ?=([%& *] selected) ~
601+ ?. =(p.selected raw) ~
602+ =/ result=(each imported @t) (read-mold-in alias u.name raw core)
603+ ?. ?=([%& [%fork *]] result) ~
604+ ?: (mark-has-ref p.result) ~
605+ `result
606+::
607+++ read-mark
608+ |= [name=term cor=type]
609+ ^- (each imported @t)
610+ ?. ?=([%core *] cor) [%| 'Hoon mark provenance is unavailable']
611+ ?. ?=([%cell *] p.cor) [%| 'Hoon mark sample is unavailable']
612+ ?. =(p.cor q.q.cor) [%| 'Hoon mark provenance is unavailable']
613+ ?. (scope-safe q.p.cor %$) [%| 'Hoon mark provenance is unavailable']
614+ =/ sample=type p.p.cor
615+ =/ raw=type ?:(?=([%face *] sample) q.sample sample)
616+ =/ result (read-with name name raw [~ q.p.cor])
617+ ?: ?=([%& *] result) result
618+ =/ fallback=(each (unit (each imported @t)) tang)
619+ (mule |.((mark-union-fallback raw q.p.cor)))
620+ ?: ?=(%| -.fallback) result
621+ ?~ p.fallback result
622+ u.p.fallback
623+::
624+++ read-named-diagnostic
625+ |= [module=term name=term cor=type]
626+ ^- import-diagnostic
627+ =/ result=(each imported @t) (read-named module name cor)
628+ ?: ?=(%& -.result) [%ok p.result]
629+ ?. ?=([%core *] cor) [%unsupported p.result]
630+ ?: =(cor -:!>(..zuse)) [%unsupported p.result]
631+ ?. (scope-safe cor %$) [%unsupported p.result]
632+ =/ chapters=(map term tome) q.r.q.cor
633+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
634+ [%unsupported p.result]
635+ =/ selected=(each type tang) (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
636+ ?. ?=(%& -.selected) [%unsupported p.result]
637+ =/ overlap=(each ? tang) (mule |.((overlap-source-witness module name cor)))
638+ ?: &(?=(%& -.overlap) p.overlap) [%invalid %overlap 'Hoon union cases overlap']
639+ =/ again=(each imported tang) (mule |.((walk module p.selected catalog ~ [~ cor])))
640+ ?. ?=(%& -.again) [%unsupported p.result]
641+ =/ evidence=(unit import-diagnostic) (first-invalid p.again)
642+ ?~ evidence [%unsupported p.result]
643+ u.evidence
644+::
645+++ read-mark-diagnostic
646+ |= [name=term cor=type]
647+ ^- import-diagnostic
648+ =/ result=(each imported @t) (read-mark name cor)
649+ ?: ?=(%& -.result) [%ok p.result]
650+ ?. ?=([%core *] cor) [%unsupported p.result]
651+ ?. ?=([%cell *] p.cor) [%unsupported p.result]
652+ ?. =(p.cor q.q.cor) [%unsupported p.result]
653+ ?. (scope-safe q.p.cor %$) [%unsupported p.result]
654+ =/ sample=type p.p.cor
655+ =/ raw=type ?:(?=([%face *] sample) q.sample sample)
656+ =/ again=(each imported tang) (mule |.((walk name raw catalog ~ [~ q.p.cor])))
657+ ?. ?=(%& -.again) [%unsupported p.result]
658+ =/ evidence=(unit import-diagnostic) (first-invalid p.again)
659+ ?~ evidence [%unsupported p.result]
660+ u.evidence
661+::
662+++ read-with
663+ |= [module=term name=term typ=type context=(unit type)]
664+ ^- (each imported @t)
665+ =/ out (walk module typ catalog ~ context)
666+ =/ err (first-bad out)
667+ ?~ err [%& out]
668+ [%| u.err]
669+::
670+:: +hold-name: names supplied by Hoon's %made note survive on a hold.
671+::
672+++ hold-name
673+ |= h=hoon
674+ ^- (unit term)
675+ ?: ?=([%tsls [%note [%made *] *] *] h)
676+ [~ p.p.p.h]
677+ ~
678+::
679+:: The named wrapper records an alias before Hoon reduces it to a map.
680+++ source-alias
681+ |= body=hoon
682+ ^- (unit term)
683+ ?. ?=([%cncl *] body) ~
684+ ?. ?=([%tsgr *] p.body) ~
685+ ?. ?=([%cncl *] q.p.body) ~
686+ ?. ?=([%wing *] p.q.p.body) ~
687+ =/ w=wing p.p.q.p.body
688+ ?: =(w ~[%jar]) [~ %jar]
689+ ?: =(w ~[%jug]) [~ %jug]
690+ ?: =(w ~[%map]) [~ %map]
691+ ?: =(w ~[%set]) [~ %set]
692+ ?: =(w ~[%qeu]) [~ %qeu]
693+ ?: =(w ~[%list]) [~ %list]
694+ ?: =(w ~[%unit]) [~ %unit]
695+ ~
696+::
697+++ hold-alias
698+ |= h=hoon
699+ ^- (unit term)
700+ ?. ?=([%tsls [%note * *] *] h) ~
701+ (source-alias q.p.h)
702+::
703+:: Reconcile source aliases with the expanded type in corresponding
704+:: cells and fields. Return an error unless every alias is accounted for.
705+++ recover-spec
706+ |= [src=spec out=imported]
707+ ^- (each imported @t)
708+ ?. (has-hidden-alias src) [%& out]
709+ ?. ?=([%make [%wing *] *] src)
710+ [%| 'nested collection arguments need source-aware import']
711+ =/ w=wing p.p.src
712+ =/ name=term
713+ ?: =(w ~[%jar]) %jar
714+ ?: =(w ~[%jug]) %jug
715+ ?: =(w ~[%map]) %map
716+ ?: =(w ~[%set]) %set
717+ ?: =(w ~[%qeu]) %qeu
718+ ?: =(w ~[%list]) %list
719+ ?: =(w ~[%unit]) %unit
720+ %$
721+ ?: =(%$ name) [%| 'nested collection arguments need source-aware import']
722+ =/ original=(each imported @t)
723+ ?: |(=(%jar name) =(%jug name))
724+ ?. ?=([%apply %map [* [%apply * [* ~]] ~]] out)
725+ [%| 'nested collection arguments need source-aware import']
726+ =/ inn i.args.i.t.args.out
727+ ?. |(&(?=(%jar name) ?=(%list name.i.t.args.out)) &(?=(%jug name) ?=(%set name.i.t.args.out)))
728+ [%| 'nested collection arguments need source-aware import']
729+ [%& [%apply name ~[i.args.out inn]]]
730+ [%& out]
731+ ?. ?=([%& *] original) original
732+ =/ fixed=imported p.original
733+ ?. ?=([%apply *] fixed) [%| 'nested collection arguments need source-aware import']
734+ ?. =(name name.fixed) [%| 'nested collection arguments need source-aware import']
735+ =/ args (recover-specs q.src args.fixed)
736+ ?- args
737+ [%| *] args
738+ [%& *] [%& [%apply name p.args]]
739+ ==
740+::
741+++ recover-specs
742+ |= [src=(list spec) args=(list imported)]
743+ ^- (each (list imported) @t)
744+ ?~ src ?~(args [%& ~] [%| 'collection argument count mismatch'])
745+ ?~ args [%| 'collection argument count mismatch']
746+ =/ first (recover-spec i.src i.args)
747+ ?- first
748+ [%| *] [%| p.first]
749+ [%& *]
750+ =/ rest $(src t.src, args t.args)
751+ ?- rest
752+ [%| *] rest
753+ [%& *] [%& [p.first p.rest]]
754+ ==
755+ ==
756+::
757+++ recover-hoons
758+ |= [src=(list hoon) args=(list imported)]
759+ ^- (each (list imported) @t)
760+ ?~ src ?~(args [%& ~] [%| 'collection argument count mismatch'])
761+ ?~ args [%| 'collection argument count mismatch']
762+ =/ first=(each imported @t)
763+ ?. (has-hidden-alias i.src) [%& i.args]
764+ ?. ?=([%ktcl *] i.src) [%| 'nested collection arguments need source-aware import']
765+ (recover-spec p.i.src i.args)
766+ ?- first
767+ [%| *] [%| p.first]
768+ [%& *]
769+ =/ rest $(src t.src, args t.args)
770+ ?- rest
771+ [%| *] rest
772+ [%& *] [%& [p.first p.rest]]
773+ ==
774+ ==
775+::
776+:: Replace direct mop expressions in records with a simple placeholder;
777+:: recover-alias restores each from its original source specs afterward.
778+:: Other fields must be fixed atom molds or standard collections with
779+:: statically fixed atom arguments. A dependent mold could otherwise
780+:: change when a field changes. All collection names are checked below.
781+++ static-spec
782+ |= shape=spec
783+ ^- ?
784+ ?+ shape |
785+ [%base *] ?=([%atom *] p.shape)
786+ [%make *]
787+ ?. ?=([%wing *] p.shape) |
788+ =/ w=wing p.p.shape
789+ ?. |(=(w ~[%map]) =(w ~[%set]) =(w ~[%qeu]) =(w ~[%list]) =(w ~[%unit]) =(w ~[%jar]) =(w ~[%jug])) |
790+ (levy q.shape |=(a=spec (static-spec a)))
791+ ==
792+::
793+++ static-arguments
794+ |= args=(list hoon)
795+ ^- ?
796+ ?~ args &
797+ ?. ?=([%ktcl *] i.args) |
798+ ?. (static-spec p.i.args) |
799+ $(args t.args)
800+::
801+++ static-collection
802+ |= src=hoon
803+ ^- ?
804+ =/ alias (source-alias src)
805+ ?~ alias |
806+ ?> ?=([%cncl *] src)
807+ ?> ?=([%tsgr *] p.src)
808+ ?> ?=([%cncl *] q.p.src)
809+ (static-arguments q.q.p.src)
810+::
811+++ patchable-mop-record
812+ |= src=hoon
813+ ^- ?
814+ ?^ -.src &($(src -.src) $(src +.src))
815+ ?+ src |
816+ [%note *] $(src q.src)
817+ [%ktts *] $(src q.src)
818+ [%ktls *] ?=([%sand *] p.src)
819+ [%cncl *]
820+ =/ specs (mop-specs src)
821+ ?~ specs (static-collection src)
822+ &(?=([%base [%atom *]] key.u.specs) ?=([%base [%atom *]] value.u.specs))
823+ ==
824+::
825+++ patch-mops
826+ |= src=hoon
827+ ^- hoon
828+ ?^ -.src [$(src -.src) $(src +.src)]
829+ ?+ src src
830+ [%note *] src(q $(src q.src))
831+ [%ktts *] src(q $(src q.src))
832+ [%cncl *] ?: ?=(^ (mop-specs src)) (ream '*@t')
833+ src
834+ ==
835+::
836+++ recover-alias
837+ |= [src=hoon out=imported subject=type module=term sig=signatures seen=visiting context=(unit type)]
838+ ^- (each imported @t)
839+ ?. (has-hidden-alias src) [%& out]
840+ ?^ -.src
841+ ?. ?=([%cell *] out) [%| 'a nested collection alias needs source-aware import']
842+ =/ hed $(src -.src, out head.out)
843+ ?- hed
844+ [%| *] hed
845+ [%& *]
846+ =/ tal $(src +.src, out tail.out)
847+ ?- tal
848+ [%| *] tal
849+ [%& *] [%& [%cell p.hed p.tal]]
850+ ==
851+ ==
852+ ?+ src [%| 'a nested collection alias needs source-aware import']
853+ [%note *] $(src q.src)
854+ [%ktts *]
855+ ?. ?=([%face *] out) [%| 'a nested collection alias needs source-aware import']
856+ ?. =(p.src name.out) [%| 'a nested collection alias needs source-aware import']
857+ =/ child $(src q.src, out body.out)
858+ ?- child
859+ [%| *] child
860+ [%& *] [%& [%face name.out p.child]]
861+ ==
862+ [%cncl *]
863+ =/ mop=(unit [key=spec value=spec]) (mop-specs src)
864+ ?^ mop
865+ =/ attempt=(each [type type] tang)
866+ (mule |.([(~(play ut subject) [%kttr key.u.mop]) (~(play ut subject) [%kttr value.u.mop])]))
867+ ?- attempt
868+ [%| *] [%| 'a nested Hoon mop needs source-aware import']
869+ [%& *]
870+ =/ key (walk module -.p.attempt sig seen context)
871+ =/ val (walk module +.p.attempt sig seen context)
872+ [%& [%apply %mop ~[key val]]]
873+ ==
874+ =/ alias (source-alias src)
875+ ?~ alias [%| 'a nested collection alias needs source-aware import']
876+ =/ original=(each imported @t)
877+ ?: |(=(%jar u.alias) =(%jug u.alias))
878+ ?. ?=([%apply %map [* [%apply * [* ~]] ~]] out)
879+ [%| 'a nested collection alias needs source-aware import']
880+ =/ inner i.args.i.t.args.out
881+ ?. |(&(?=(%jar u.alias) ?=(%list name.i.t.args.out)) &(?=(%jug u.alias) ?=(%set name.i.t.args.out)))
882+ [%| 'a nested collection alias needs source-aware import']
883+ [%& [%apply u.alias ~[i.args.out inner]]]
884+ [%& out]
885+ ?. ?=([%& *] original) original
886+ =/ fixed=imported p.original
887+ ?. ?=([%apply *] fixed) [%| 'a nested collection alias needs source-aware import']
888+ ?. =(name.fixed u.alias) [%| 'a nested collection alias needs source-aware import']
889+ ?> ?=([%tsgr *] p.src)
890+ ?> ?=([%cncl *] q.p.src)
891+ =/ args (recover-hoons q.q.p.src args.fixed)
892+ ?- args
893+ [%| *] [%| p.args]
894+ [%& *] [%& [%apply u.alias p.args]]
895+ ==
896+ ==
897+::
898+++ has-hidden-alias
899+ |= h=*
900+ ^- ?
901+ ?: |(=(h [%wing ~[%jar]]) =(h [%wing ~[%jug]]) =(h [%wing ~[%mop]])) &
902+ ?@ h |
903+ |($(h -.h) $(h +.h))
904+::
905+:: $^ is lowered to a conditional by Hoon's parser; conservatively
906+:: reject its distinctive test until the original branches have been
907+:: checked for disjointness. The tested axis follows the field path;
908+:: tracking that path distinguishes a nested $^ from an ordinary $@.
909+:: Other Hoon code can look the same, so some valid molds may be rejected.
910+:: Collection argument syntax retains $^ as %bckt, before Hoon
911+:: reduces the resulting type and can collapse overlapping cases. Until
912+:: argument-level disjointness is checked, reject those source forms.
913+++ has-spec-cell-union
914+ |= h=*
915+ ^- ?
916+ ?@ h |
917+ ?: ?=([%bckt ^ ^] h) &
918+ |($(h -.h) $(h +.h))
919+::
920+:: The Grammar's disjointness rule applies to imported $% and $? too;
921+:: @iko confirmed the rule for imported unions on 2026-10-30.
922+++ has-spec-general-union
923+ |= h=*
924+ ^- ?
925+ ?@ h |
926+ ?: ?=([%bcwt [^ [^ *]]] h) &
927+ ?: ?=([%bccn [^ [^ *]]] h) &
928+ |($(h -.h) $(h +.h))
929+::
930+++ has-fits-union
931+ |= h=*
932+ ^- ?
933+ ?@ h |
934+ ?: ?=([%wtcl [%fits *] * *] h) &
935+ |($(h -.h) $(h +.h))
936+::
937+++ fits-union-at
938+ |= [h=hoon axis=@ud]
939+ ^- ?
940+ ?. ?=([%fits *] h) |
941+ |(=(q.h ~[[%.y axis]]) =(q.h ~[[%.y (mul 2 axis)]]))
942+::
943+++ has-cell-union
944+ |= h=hoon
945+ ^- ?
946+ ?. ?=([%tsls [%note * *] *] h) (has-cell-union-any h)
947+ (has-cell-union-at q.p.h 6)
948+::
949+++ has-cell-union-any
950+ |= h=*
951+ ^- ?
952+ ?@ h |
953+ ?: =(h [%dtwt [%$ 12]]) &
954+ |($(h -.h) $(h +.h))
955+::
956+++ has-cell-union-at
957+ |= [h=hoon axis=@ud]
958+ ^- ?
959+ ?^ -.h
960+ |($(h -.h, axis (mul 2 axis)) $(h +.h, axis (add 1 (mul 2 axis))))
961+ ?+ h (has-cell-union-any h)
962+ [%note *] $(h q.h)
963+ [%dbug *] $(h q.h)
964+ [%ktts *] $(h q.h)
965+ [%wtcl *]
966+ ?: =(p.h [%dtwt [%$ (mul 2 axis)]]) &
967+ |($(h q.h) $(h r.h))
968+ ==
969+::
970+++ cell-branches
971+ |= h=type
972+ ^- (unit [left=type right=type])
973+ ?. ?=([%hold *] h) ~
974+ =/ original=hoon q.h
975+ ?. ?=([%tsls [%note * *] *] original) ~
976+ =/ body=hoon q.p.original
977+ ?. ?=([%wtcl *] body) ~
978+ ?. =(p.body [%dtwt [%$ 12]]) ~
979+ =/ one=hoon original(q.p q.body)
980+ =/ two=hoon original(q.p r.body)
981+ :: Branches can rely on narrowing in the original conditional. When a
982+ :: branch cannot be evaluated on its own, report it as unsupported.
983+ =/ attempt=(each [type type] tang)
984+ (mule |.([(~(play ut p.h) one) (~(play ut p.h) two)]))
985+ ?- attempt
986+ [%& *] [~ p.attempt]
987+ [%| *] ~
988+ ==
989+::
990+:: A static branch contains atom molds, exact tag constants and cells.
991+:: A tag shape must compare the current axis to the same atom it returns.
992+++ fixed-cell-mold
993+ |= [h=hoon axis=@ud]
994+ ^- ?
995+ ?^ -.h
996+ &($(h -.h, axis (mul 2 axis)) $(h +.h, axis (add 1 (mul 2 axis))))
997+ ?+ h |
998+ [%note *] $(h q.h)
999+ [%dbug *] $(h q.h)
1000+ [%ktts *] $(h q.h)
1001+ [%ktls *] ?=([%sand *] p.h)
1002+ [%cncl *]
1003+ ?: =(h [%cncl [%tsgr [%wing ~[[%.y 7]]] [%wing ~[%path]]] ~[[%$ axis]]]) &
1004+ (static-collection h)
1005+ [%wtcl *]
1006+ ?. (fits-union-at p.h axis) |
1007+ &($(h q.h) $(h r.h))
1008+ [%wtgr *]
1009+ ?: =(h [%wtgr [%dtts [%bust %noun] [%$ axis]] [%rock %n 0]]) &
1010+ ?. ?=([%dtts [%$ *] [%rock %$ *]] p.h) |
1011+ ?. ?=([%rock %tas *] q.h) |
1012+ ?^ q.q.h |
1013+ &(=(p.p.p.h axis) =(q.q.p.h q.q.h))
1014+ ==
1015+::
1016+:: Return two source records with a single $^ replaced by each branch.
1017+++ split-cell-record
1018+ |= [h=hoon axis=@ud]
1019+ ^- (unit [one=hoon two=hoon])
1020+ ?^ -.h
1021+ =/ left $(h -.h, axis (mul 2 axis))
1022+ =/ right $(h +.h, axis (add 1 (mul 2 axis)))
1023+ ?^ left
1024+ ?^ right ~
1025+ ?. (fixed-cell-mold +.h (add 1 (mul 2 axis))) ~
1026+ [~ [[one.u.left +.h] [two.u.left +.h]]]
1027+ ?~ right ~
1028+ ?. (fixed-cell-mold -.h (mul 2 axis)) ~
1029+ [~ [[-.h one.u.right] [-.h two.u.right]]]
1030+ ?+ h ~
1031+ [%note *]
1032+ =/ out $(h q.h)
1033+ ?~ out ~
1034+ [~ [h(q one.u.out) h(q two.u.out)]]
1035+ [%dbug *]
1036+ =/ out $(h q.h)
1037+ ?~ out ~
1038+ [~ [h(q one.u.out) h(q two.u.out)]]
1039+ [%ktts *]
1040+ =/ out $(h q.h)
1041+ ?~ out ~
1042+ [~ [h(q one.u.out) h(q two.u.out)]]
1043+ [%wtcl *]
1044+ ?. |(=(p.h [%dtwt [%$ (mul 2 axis)]]) (fits-union-at p.h axis)) ~
1045+ ?. &((fixed-cell-mold q.h axis) (fixed-cell-mold r.h axis)) ~
1046+ [~ [q.h r.h]]
1047+ ==
1048+::
1049+:: Reassemble a split source record. Non-union fields must have remained
1050+:: unchanged; the replaced field must have provably disjoint branches.
1051+++ merge-cell-record
1052+ |= [h=hoon axis=@ud a=imported b=imported]
1053+ ^- (each imported @t)
1054+ ?^ -.h
1055+ ?. &(?=([%cell *] a) ?=([%cell *] b))
1056+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
1057+ =/ left $(h -.h, axis (mul 2 axis), a head.a, b head.b)
1058+ ?. ?=([%& *] left) left
1059+ =/ right $(h +.h, axis (add 1 (mul 2 axis)), a tail.a, b tail.b)
1060+ ?. ?=([%& *] right) right
1061+ [%& [%cell p.left p.right]]
1062+ ?+ h
1063+ ?: =(a b) [%& a]
1064+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
1065+ [%note *] $(h q.h)
1066+ [%dbug *] $(h q.h)
1067+ [%ktts *]
1068+ ?. &(?=([%face *] a) ?=([%face *] b))
1069+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
1070+ ?. &(=(p.h name.a) =(p.h name.b))
1071+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
1072+ =/ child $(h q.h, a body.a, b body.b)
1073+ ?. ?=([%& *] child) child
1074+ [%& [%face name.a p.child]]
1075+ [%wtcl *]
1076+ ?. |(=(p.h [%dtwt [%$ (mul 2 axis)]]) (fits-union-at p.h axis))
1077+ [%| 'a Hoon union needs a source-level disjointness check']
1078+ ?. (disjoint a b)
1079+ ?: ?=([%fits *] p.h) [%| 'Hoon union disjointness could not be verified']
1080+ [%| 'Hoon $^ union disjointness could not be verified']
1081+ [%& [%fork (sort (weld (union-cases a) (union-cases b)) |=(pair=[imported imported] (dor -.pair +.pair)))]]
1082+ ==
1083+++ union-cases
1084+ |= a=imported
1085+ ^- (list imported)
1086+ ?. ?=([%fork *] a) ~[a]
1087+ (zing (turn cases.a |=(item=imported (union-cases item))))
1088+::
1089+++ all-disjoint
1090+ |= cases=(list imported)
1091+ ^- ?
1092+ ?~ cases &
1093+ ?. (levy t.cases |=(item=imported (disjoint i.cases item))) |
1094+ $(cases t.cases)
1095+::
1096+++ disjoint
1097+ |= [a=imported b=imported]
1098+ ^- ?
1099+ ?: ?=([%face *] a) $(a body.a)
1100+ ?: ?=([%face *] b) $(b body.b)
1101+ ?: ?=([%named *] a) $(a body.a)
1102+ ?: ?=([%named *] b) $(b body.b)
1103+ ?: ?=([%fork *] a)
1104+ (levy cases.a |=(item=imported (disjoint item b)))
1105+ ?: ?=([%fork *] b)
1106+ (levy cases.b |=(item=imported (disjoint a item)))
1107+ ?: |(?=([%void *] a) ?=([%void *] b)) &
1108+ ?: ?=([%atom *] a)
1109+ ?: ?=([%cell *] b) &
1110+ ?. ?=([%atom *] b) |
1111+ ?~ value.a |
1112+ ?~ value.b |
1113+ !=(u.value.a u.value.b)
1114+ ?: ?=([%cell *] a)
1115+ ?: ?=([%atom *] b) &
1116+ ?. ?=([%cell *] b) |
1117+ |($(a head.a, b head.b) $(a tail.a, b tail.b))
1118+ |
1119+::
1120+:: Source names may resolve to a local Hoon arm rather than zuse. A
1121+:: missing verified subject or any local arm with that name is unsafe.
1122+:: A chapter's +tome has different wrappers under eval and Clay. Walk
1123+:: its noun map without relying on either version's field names.
1124+++ arm-map-has
1125+ |= [m=* target=term]
1126+ ^- ?
1127+ ?@ m |
1128+ ?@ -.m |
1129+ =/ kv=* -.m
1130+ ?^ -.kv |
1131+ ?: =(-.kv target) &
1132+ =/ children=* +.m
1133+ ?@ children |
1134+ |($(m -.children) $(m +.children))
1135+::
1136+++ arm-map-valid
1137+ |= m=*
1138+ ^- ?
1139+ ?@ m =(m ~)
1140+ ?@ -.m |
1141+ =/ kv=* -.m
1142+ ?^ -.kv |
1143+ =/ children=* +.m
1144+ ?@ children |
1145+ &($(m -.children) $(m +.children))
1146+::
1147+:: ~ means this is neither supported chapter representation. The
1148+:: caller treats that as unsafe, not as a validated miss.
1149+++ chapter-has
1150+ |= [chapter=* target=term]
1151+ ^- (unit ?)
1152+ ?: (arm-map-valid chapter) [~ (arm-map-has chapter target)]
1153+ ?@ chapter ~
1154+ ?. (arm-map-valid +.chapter) ~
1155+ [~ (arm-map-has +.chapter target)]
1156+::
1157+:: Return a unique source arm from either validated tome wrapper. Walk
1158+:: the noun map rather than relying on fields that differ on Clay.
1159+++ arm-map-sources
1160+ |= [m=* target=term]
1161+ ^- (list hoon)
1162+ ?@ m ~
1163+ =/ kv=* -.m
1164+ =/ children=* +.m
1165+ =/ found=(list hoon) ?:(=(-.kv target) ~[;;(hoon +.kv)] ~)
1166+ (weld found (weld $(m -.children) $(m +.children)))
1167+::
1168+++ chapter-source
1169+ |= [chapter=* target=term]
1170+ ^- (unit hoon)
1171+ ?: (arm-map-valid chapter) (unique-arm-source chapter target)
1172+ ?@ chapter ~
1173+ ?. (arm-map-valid +.chapter) ~
1174+ (unique-arm-source +.chapter target)
1175+::
1176+++ unique-arm-source
1177+ |= [arms=* target=term]
1178+ ^- (unit hoon)
1179+ =/ sources=(list hoon) (arm-map-sources arms target)
1180+ ?. ?=([* ~] sources) ~
1181+ `i.sources
1182+::
1183+++ chapter-unsafe
1184+ |= [chapter=* target=term]
1185+ ^- ?
1186+ =/ has (chapter-has chapter target)
1187+ ?~ has &
1188+ u.has
1189+::
1190+:: Verify every lexical subject layer until the exact standard subject.
1191+:: Refuse unknown forms, malformed chapters, mismatched core payloads,
1192+:: faces that shadow the selected name, and imported arms of that name.
1193+++ scope-safe
1194+ |= [scope=type target=term]
1195+ ^- ?
1196+ ?: =(scope -:!>(..zuse)) &
1197+ ?- scope
1198+ [%cell *]
1199+ ?. ?=([%face *] p.scope) |
1200+ ?^ p.p.scope |
1201+ ?: =(p.p.scope target) |
1202+ ?. ?=([%core *] q.p.scope) |
1203+ &($(scope q.p.scope) $(scope q.scope))
1204+ [%core *]
1205+ ?. =(p.scope q.q.scope) |
1206+ =/ chapters=(map term tome) q.r.q.scope
1207+ ?: (lien ~(tap by chapters) |=(entry=[term tome] (chapter-unsafe +.entry target))) |
1208+ $(scope p.scope)
1209+ * |
1210+ ==
1211+::
1212+++ alias-safe
1213+ |= [context=(unit type) target=term]
1214+ ^- ?
1215+ ?~ context |
1216+ (scope-safe u.context target)
1217+::
1218+++ source-uses
1219+ |= [src=* target=term]
1220+ ^- ?
1221+ ?: =(src [%wing [target ~]]) &
1222+ ?@ src |
1223+ |($(src -.src) $(src +.src))
1224+::
1225+:: Clay can wrap each call component in source-location metadata.
1226+:: Peel only those wrappers; malformed casts are trapped by +mop-specs.
1227+++ mop-source-code
1228+ |= code=hoon
1229+ ^- hoon
1230+ =/ plain=(unit *) (source-unwrap code 4)
1231+ ?~ plain !!
1232+ ;;(hoon u.plain)
1233+::
1234+++ source-single-wing
1235+ |= raw=*
1236+ ^- (unit term)
1237+ =/ plain=(unit *) (source-unwrap raw 4)
1238+ ?~ plain ~
1239+ ?. ?=([%wing [@ ~]] u.plain) ~
1240+ `;;(term -.+.u.plain)
1241+::
1242+++ mop-specs-raw
1243+ |= body=hoon
1244+ ^- (unit [key=spec value=spec])
1245+ =. body (mop-source-code body)
1246+ ?. ?=([%cncl *] body) ~
1247+ ?. ?=([%tsgr *] p.body) ~
1248+ =/ b=hoon (mop-source-code q.p.body)
1249+ ?. ?=([%cncl *] b) ~
1250+ =/ call=hoon (mop-source-code p.b)
1251+ ?. ?=([%cncl *] call) ~
1252+ =/ w=(unit term) (source-single-wing p.call)
1253+ ?~ w ~
1254+ ?. =(u.w %mop) ~
1255+ =/ raw=* q.call
1256+ =/ wings=(unit [key=spec value=spec])
1257+ ?. ?=([* [* ~]] raw) ~
1258+ =/ a=(unit term) (source-single-wing -.raw)
1259+ =/ b=(unit term) (source-single-wing -.+.raw)
1260+ ?~ a ~
1261+ ?~ b ~
1262+ [~ [[%like ~[u.a] ~] [%like ~[u.b] ~]]]
1263+ ?^ wings wings
1264+ =/ specs=(list spec) ;;((list spec) raw)
1265+ ?. ?=([* [* ~]] specs) ~
1266+ [~ [i.specs i.t.specs]]
1267+::
1268+++ mop-specs
1269+ |= body=hoon
1270+ ^- (unit [key=spec value=spec])
1271+ =/ attempt=(each (unit [key=spec value=spec]) tang)
1272+ (mule |.((mop-specs-raw body)))
1273+ ?- attempt
1274+ [%& *] p.attempt
1275+ [%| *] ~
1276+ ==
1277+::
1278+++ mop-arguments-raw
1279+ |= h=type
1280+ ^- (unit [key=type value=type])
1281+ ?. ?=([%hold *] h) ~
1282+ =/ original=hoon q.h
1283+ ?. ?=([%tsls [%note * *] *] original) ~
1284+ =/ specs (mop-specs q.p.original)
1285+ ?~ specs ~
1286+ [~ [(~(play ut p.h) [%kttr key.u.specs]) (~(play ut p.h) [%kttr value.u.specs])]]
1287+::
1288+++ mop-arguments
1289+ |= h=type
1290+ ^- (unit [key=type value=type])
1291+ =/ attempt=(each (unit [key=type value=type]) tang)
1292+ (mule |.((mop-arguments-raw h)))
1293+ ?- attempt
1294+ [%& *] p.attempt
1295+ [%| *] ~
1296+ ==
1297+::
1298+++ match-signature
1299+ |= [h=hoon sig=signatures]
1300+ ^- (unit term)
1301+ ?~ sig ~
1302+ ?: =(h code.i.sig) [~ name.i.sig]
1303+ $(sig t.sig)
1304+::
1305+++ find-seen
1306+ |= [typ=type seen=visiting]
1307+ ^- (unit (unit term))
1308+ ?~ seen ~
1309+ ?: =(typ typ.i.seen) [~ name.i.seen]
1310+ $(seen t.seen)
1311+::
1312+:: Find the source module for an exact recursive hold by evaluating
1313+:: locally declared arms of each validated core in the subject. An
1314+:: unlabelled core, failed evaluation, or multiple labels is ambiguous.
1315+++ origin-candidates
1316+ |= [scope=type label=(unit term) name=term typ=type]
1317+ ^- (list (unit term))
1318+ ?: =(scope -:!>(..zuse)) ~
1319+ ?- scope
1320+ [%cell *]
1321+ ?. ?=([%face *] p.scope) ~[~]
1322+ ?^ p.p.scope ~[~]
1323+ %+ weld
1324+ $(scope q.p.scope, label [~ p.p.scope])
1325+ $(scope q.scope, label ~)
1326+ [%core *]
1327+ =/ chapters=(map term tome) q.r.q.scope
1328+ =/ present=? (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
1329+ =/ own=(list (unit term))
1330+ ?. present ~
1331+ =/ trial=(each type tang) (mule |.((~(play ut scope) (ream (cat 3 '*' name)))))
1332+ ?- trial
1333+ [%| *] ~[~]
1334+ [%& *] ?: =(p.trial typ) ~[label]
1335+ ~
1336+ ==
1337+ (weld own $(scope p.scope, label ~))
1338+ * ~[~]
1339+ ==
1340+::
1341+++ ref-origin
1342+ |= [module=term name=term typ=type context=(unit type)]
1343+ ^- (unit term)
1344+ ?~ context ~
1345+ =/ found (origin-candidates u.context [~ module] name typ)
1346+ ?~ found ~
1347+ ?~ i.found ~
1348+ =/ choice=term u.i.found
1349+ =/ same
1350+ |= item=(unit term)
1351+ ^- ?
1352+ ?~ item |
1353+ =(u.item choice)
1354+ ?. (levy t.found same) ~
1355+ [~ choice]
1356+::
1357+::
1358+:: A collection case is independent of the subject only when its
1359+:: original spec uses literal atoms, tags and finite record structure.
1360+++ static-union-spec
1361+ |= s=spec
1362+ ^- ?
1363+ ?+ s |
1364+ [%base *] ?=([%atom *] p.s)
1365+ [%leaf *] &
1366+ [%bcts *] ?@ p.s $(s q.s)
1367+ |
1368+ [%bccl *] (static-union-specs p.s)
1369+ ==
1370+::
1371+++ static-union-specs
1372+ |= parts=(list spec)
1373+ ^- ?
1374+ ?~ parts &
1375+ &((static-union-spec i.parts) $(parts t.parts))
1376+::
1377+++ union-spec-parts
1378+ |= s=spec
1379+ ^- (unit (list spec))
1380+ ?+ s ~
1381+ [%bcwt *] [~ p.s]
1382+ [%bccn *] [~ p.s]
1383+ [%bckt *] [~ ~[p.s q.s]]
1384+ ==
1385+::
1386+:: Select one direct union argument, replacing exactly that spec with
1387+:: @t. The other arguments must be static and cannot contain unions.
1388+++ safe-union-parts
1389+ |= cases=(list spec)
1390+ ^- ?
1391+ ?~ cases |
1392+ ?~ t.cases |
1393+ =/ rest=(list spec) t.cases
1394+ &((static-union-spec i.cases) (levy rest |=(part=spec (static-union-spec part))))
1395+::
1396+++ split-union-arguments
1397+ |= [args=(list hoon) index=@ud]
1398+ ^- (unit [args=(list hoon) cases=(list spec) index=@ud])
1399+ ?~ args ~
1400+ ?. ?=([%ktcl *] i.args) ~
1401+ =/ cases (union-spec-parts p.i.args)
1402+ ?^ cases
1403+ ?. (safe-union-parts u.cases) ~
1404+ ?. (static-arguments t.args) ~
1405+ [~ [[[%ktcl [%base [%atom %t]]] t.args] u.cases index]]
1406+ ?. (static-spec p.i.args) ~
1407+ =/ rest $(args t.args, index +(index))
1408+ ?~ rest ~
1409+ [~ [[i.args args.u.rest] cases.u.rest index.u.rest]]
1410+::
1411+++ replace-union-argument
1412+ |= [args=(list imported) index=@ud union=imported]
1413+ ^- (unit (list imported))
1414+ ?~ args ~
1415+ ?: =(index 0)
1416+ ?. =([%atom %t ~] i.args) ~
1417+ [~ [union t.args]]
1418+ =/ rest $(args t.args, index (dec index))
1419+ ?~ rest ~
1420+ [~ [i.args u.rest]]
1421+::
1422+:: Accept only the compiler's direct collection call wrapper.
1423+++ direct-collection-source
1424+ |= [body=hoon original=hoon]
1425+ ^- ?
1426+ ?. ?=([%cncl [%tsgr * [%cncl *]] *] body) |
1427+ ?. =(p.p.body [%wing ~[[%.y 7]]]) |
1428+ ?. =(q.body ~[[%$ 6]]) |
1429+ ?. ?=([%tsls * *] original) |
1430+ =(q.original [%tsls [%dtts [%$ 14] [%$ 2]] [%$ 6]])
1431+::
1432+++ collection-union
1433+ |= [typ=type module=term sig=signatures seen=visiting context=(unit type)]
1434+ ^- imported
1435+ ?. ?=([%hold *] typ) [%bad 'a Hoon union needs a source-level disjointness check']
1436+ =/ is-cell=? (has-spec-cell-union q.typ)
1437+ =/ unsupported=@t
1438+ ?: is-cell 'a Hoon $^ union needs a source-level disjointness check'
1439+ 'a Hoon union needs a source-level disjointness check'
1440+ =/ original=hoon q.typ
1441+ ?. ?=([%tsls [%note * *] *] original) [%bad unsupported]
1442+ =/ body=hoon q.p.original
1443+ =/ alias (source-alias body)
1444+ ?~ alias [%bad unsupported]
1445+ ?. (alias-safe context u.alias) [%bad 'Hoon collection provenance is unavailable or shadowed']
1446+ =/ names=(list term) ~[%map %set %qeu %list %unit %jar %jug]
1447+ ?: (lien names |=(n=term &((source-uses body n) !(alias-safe context n))))
1448+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1449+ ?. (direct-collection-source body original) [%bad unsupported]
1450+ ?> ?=([%cncl [%tsgr * [%cncl *]] *] body)
1451+ =/ split (split-union-arguments q.q.p.body 0)
1452+ ?~ split [%bad unsupported]
1453+ =/ tried=(each (list type) tang)
1454+ (mule |.((turn cases.u.split |=(s=spec (~(play ut p.typ) [%kttr s])))))
1455+ ?. ?=([%& *] tried) [%bad unsupported]
1456+ =/ cases=(list imported)
1457+ (turn p.tried |=(t=type (walk module t sig seen context)))
1458+ =/ err (first-bads cases)
1459+ ?^ err [%bad u.err]
1460+ ?. (all-disjoint cases)
1461+ [%bad ?:(is-cell 'Hoon $^ union disjointness could not be verified' 'Hoon union disjointness could not be verified')]
1462+ =/ rewritten=hoon original(q.p body(q.q.p args.u.split))
1463+ =/ attempt=(each type tang) (mule |.((~(play ut p.typ) rewritten)))
1464+ ?. ?=([%& *] attempt) [%bad unsupported]
1465+ =/ out=imported (walk module p.attempt sig seen context)
1466+ ?. ?=([%apply *] out) [%bad unsupported]
1467+ ?. =(name.out u.alias) [%bad unsupported]
1468+ =/ replacement=imported
1469+ [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
1470+ =/ args (replace-union-argument args.out index.u.split replacement)
1471+ ?~ args [%bad unsupported]
1472+ [%apply name.out u.args]
1473+::
1474+:: A nested named tagged union may be recovered only if its hold is
1475+:: exactly the selected arm of this core. Provenance and all original
1476+:: source cases are checked by the same fallback as a top-level arm.
1477+++ nested-tagged-union
1478+ |= [module=term typ=type context=(unit type)]
1479+ ^- (unit imported)
1480+ ?~ context ~
1481+ ?. ?=([%core *] u.context) ~
1482+ ?. ?=([%hold *] typ) ~
1483+ =/ n=(unit term) (hold-name q.typ)
1484+ ?~ n ~
1485+ :: The outer proof has a shared budget. Bound each nested re-proof as
1486+ :: well, so rebuilding a shared source DAG cannot grow without limit.
1487+ =/ source=(unit hoon) (local-arm-source u.context u.n)
1488+ ?~ source ~
1489+ =/ cases=(unit (list tagged-case)) (tagged-source-code u.source u.n)
1490+ ?~ cases ~
1491+ ?. (safe-source-tagged u.cases u.context ~[u.n] 256) ~
1492+ =/ selected=(each type tang)
1493+ (mule |.((~(play ut u.context) (ream (cat 3 '*' u.n)))))
1494+ ?. ?=([%& *] selected) ~
1495+ ?. =(p.selected typ) ~
1496+ =/ attempt=(each (unit (each imported @t)) tang)
1497+ (mule |.((tagged-union-fallback module u.n u.context)))
1498+ ?. ?=([%& *] attempt) ~
1499+ ?~ p.attempt ~
1500+ ?. ?=([%& [%fork *]] u.p.attempt) ~
1501+ `p.u.p.attempt
1502+::
1503+:: Keep the proven owner boundary when a nested union refers to itself.
1504+++ contains-named-ref
1505+ |= [node=imported module=term name=term]
1506+ ^- ?
1507+ ?- node
1508+ [%ref *] &(=(module module.node) =(name name.node))
1509+ [%named *] |
1510+ [%face *] $(node body.node)
1511+ [%cell *] |($(node head.node) $(node tail.node))
1512+ [%fork *] (lien cases.node |=(child=imported (contains-named-ref child module name)))
1513+ [%apply *] (lien args.node |=(child=imported (contains-named-ref child module name)))
1514+ * |
1515+ ==
1516+::
1517+++ walk
1518+ |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
1519+ ^- imported
1520+ ?- typ
1521+ %noun [%noun ~]
1522+ %void [%void ~]
1523+ [%atom *]
1524+ ?: |(=('s' (cut 3 [0 1] p.typ)) =('r' (cut 3 [0 1] p.typ)))
1525+ [%invalid %aura 'signed and float auras cannot be imported']
1526+ [%atom p.typ q.typ]
1527+ [%cell *] [%cell $(typ p.typ) $(typ q.typ)]
1528+ [%core *] [%invalid %core 'cores and gates cannot be imported']
1529+ [%face *]
1530+ ?@ p.typ [%face p.typ $(typ q.typ)]
1531+ [%bad 'a complex Hoon face needs translation']
1532+ [%fork *]
1533+ =/ cases=(list imported)
1534+ (turn ~(tap in:..zuse p.typ) |=(t=type ^$(typ t)))
1535+ =/ err (first-bads cases)
1536+ ?^ err [%bad u.err]
1537+ ?. (all-disjoint cases) [%bad 'Hoon union disjointness could not be verified']
1538+ [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
1539+ [%hint *] $(typ q.typ)
1540+ [%hold *]
1541+ =/ prior=(unit (unit term)) (find-seen typ seen)
1542+ ?^ prior
1543+ ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
1544+ =/ origin (ref-origin module u.u.prior typ context)
1545+ ?~ origin [%bad 'a recursive Hoon mold needs unambiguous source provenance']
1546+ [%ref u.origin u.u.prior]
1547+ =/ nested=(unit imported) (nested-tagged-union module typ context)
1548+ ?^ nested
1549+ ?: ?=(~ seen) u.nested
1550+ =/ name=(unit term) (hold-name q.typ)
1551+ ?~ name u.nested
1552+ ?. (contains-named-ref u.nested module u.name) u.nested
1553+ [%named module u.name u.nested]
1554+ ?: &(?=([%tsls [%note * *] *] q.typ) |((has-spec-cell-union q.typ) (has-spec-general-union q.typ)))
1555+ =/ nm (hold-name q.typ)
1556+ (collection-union typ module sig [[typ nm] seen] context)
1557+ =/ named=(unit term) (match-signature q.typ sig)
1558+ ?^ named
1559+ =/ name u.named
1560+ ?: =(%vase name) [%bad 'vases cannot be imported']
1561+ ?. (alias-safe context name)
1562+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1563+ =/ first=type
1564+ (~(play ut p.typ) (ream ?:(|(=(%map name) =(%jar name) =(%jug name)) '*key' '*item')))
1565+ =/ first-import $(typ first)
1566+ ?: |(=(%map name) =(%jar name) =(%jug name))
1567+ =/ second=type (~(play ut p.typ) (ream '*value'))
1568+ [%apply name ~[first-import $(typ second)]]
1569+ [%apply name ~[first-import]]
1570+ =/ nm (hold-name q.typ)
1571+ ?: =(nm [~ %vase]) [%bad 'a Hoon type named vase needs source provenance']
1572+ ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
1573+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1574+ ?: &((source-uses q.typ %jug) !(alias-safe context %jug))
1575+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1576+ ?: &((source-uses q.typ %mop) !(alias-safe context %mop))
1577+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1578+ =/ mop (mop-arguments typ)
1579+ ?^ mop
1580+ :: An exact revisit fails closed without guessing a name.
1581+ [%apply %mop ~[$(typ key.u.mop, seen [[typ ~] seen]) $(typ value.u.mop, seen [[typ ~] seen])]]
1582+ ?: (source-uses q.typ %mop)
1583+ =/ checked-names=(list term) ~[%map %set %qeu %list %unit]
1584+ ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
1585+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1586+ ?. ?=([%tsls [%note * *] *] q.typ)
1587+ [%bad 'a nested Hoon mop needs source-aware import']
1588+ =/ original=hoon q.typ
1589+ ?> ?=([%tsls [%note * *] *] original)
1590+ =/ source=hoon q.p.original
1591+ ?. (patchable-mop-record source)
1592+ [%bad 'a nested Hoon mop needs source-aware import']
1593+ =/ patched=hoon (patch-mops source)
1594+ ?: |(=(source patched) (source-uses patched %mop))
1595+ [%bad 'a nested Hoon mop needs source-aware import']
1596+ =/ replacement=hoon original(q.p patched)
1597+ =/ attempt=(each type tang) (mule |.((~(play ut p.typ) replacement)))
1598+ ?- attempt
1599+ [%| *] [%bad 'a nested Hoon mop needs source-aware import']
1600+ [%& *]
1601+ =/ projected $(typ p.attempt, seen [[typ nm] seen])
1602+ =/ corrected (recover-alias source projected p.typ module sig seen context)
1603+ ?- corrected
1604+ [%| *] [%bad p.corrected]
1605+ [%& *] p.corrected
1606+ ==
1607+ ==
1608+ =/ branches (cell-branches typ)
1609+ ?^ branches
1610+ =/ first $(typ left.u.branches, seen [[typ nm] seen])
1611+ =/ second $(typ right.u.branches, seen [[typ nm] seen])
1612+ =/ err (first-bads ~[first second])
1613+ ?^ err [%bad u.err]
1614+ ?: (disjoint first second)
1615+ [%fork (sort ~[first second] |=(pair=[imported imported] (dor -.pair +.pair)))]
1616+ [%bad 'Hoon $^ union disjointness could not be verified']
1617+ ?: |((has-cell-union q.typ) (has-fits-union q.typ))
1618+ =/ cannot=@t
1619+ ?: (has-fits-union q.typ) 'a Hoon union needs a source-level disjointness check'
1620+ 'a Hoon $^ union needs a source-level disjointness check'
1621+ =/ checked-names=(list term) ~[%map %set %qeu %list %unit %jar %jug %path]
1622+ ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
1623+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1624+ ?. ?=([%tsls [%note * *] *] q.typ)
1625+ [%bad cannot]
1626+ =/ original=hoon q.typ
1627+ ?> ?=([%tsls [%note * *] *] original)
1628+ =/ body=hoon q.p.original
1629+ =/ split (split-cell-record body 6)
1630+ ?~ split [%bad cannot]
1631+ =/ try=(each [type type] tang)
1632+ (mule |.([(~(play ut p.typ) original(q.p one.u.split)) (~(play ut p.typ) original(q.p two.u.split))]))
1633+ ?. ?=([%& *] try) [%bad cannot]
1634+ =/ first $(typ -.p.try, seen [[typ nm] seen])
1635+ =/ second $(typ +.p.try, seen [[typ nm] seen])
1636+ =/ err (first-bads ~[first second])
1637+ ?^ err [%bad u.err]
1638+ =/ combined (merge-cell-record body 6 first second)
1639+ ?- combined
1640+ [%& *] p.combined
1641+ [%| *] [%bad p.combined]
1642+ ==
1643+ =/ alias (hold-alias q.typ)
1644+ =/ hidden (has-hidden-alias q.typ)
1645+ =/ body $(typ ~(repo ut typ), seen [[typ nm] seen])
1646+ ?~ alias
1647+ ?. hidden body
1648+ ?. ?=([%tsls [%note * *] *] q.typ)
1649+ [%bad 'a nested collection alias needs source-aware import']
1650+ =/ corrected (recover-alias q.p.q.typ body p.typ module sig seen context)
1651+ ?- corrected
1652+ [%& *] p.corrected
1653+ [%| *] [%bad p.corrected]
1654+ ==
1655+ ?. ?=([%tsls [%note * *] *] q.typ)
1656+ [%bad 'a Hoon collection alias could not be recovered']
1657+ =/ corrected (recover-alias q.p.q.typ body p.typ module sig seen context)
1658+ ?- corrected
1659+ [%& *] p.corrected
1660+ [%| *] [%bad p.corrected]
1661+ ==
1662+ ==
1663+::
1664+++ first-bad
1665+ |= out=imported
1666+ ^- (unit @t)
1667+ ?- out
1668+ [%noun *] ~
1669+ [%void *] ~
1670+ [%atom *] ~
1671+ [%ref *] ~
1672+ [%bad *] [~ reason.out]
1673+ [%invalid *] [~ reason.out]
1674+ [%face *] $(out body.out)
1675+ [%named *] $(out body.out)
1676+ [%cell *]
1677+ =/ err $(out head.out)
1678+ ?~ err $(out tail.out)
1679+ err
1680+ [%fork *] (first-bads cases.out)
1681+ [%apply *] (first-bads args.out)
1682+ ==
1683+::
1684+++ first-bads
1685+ |= xs=(list imported)
1686+ ^- (unit @t)
1687+ ?~ xs ~
1688+ =/ err (first-bad i.xs)
1689+ ?~ err $(xs t.xs)
1690+ err
1691+::
1692+++ first-invalid
1693+ |= out=imported
1694+ ^- (unit import-diagnostic)
1695+ ?- out
1696+ [%noun *] ~
1697+ [%void *] ~
1698+ [%atom *] ~
1699+ [%ref *] ~
1700+ [%bad *] `[%unsupported reason.out]
1701+ [%invalid *] `[%invalid code.out reason.out]
1702+ [%face *] $(out body.out)
1703+ [%named *] $(out body.out)
1704+ [%cell *]
1705+ =/ first $(out head.out)
1706+ ?~ first $(out tail.out)
1707+ first
1708+ [%fork *] (first-invalids cases.out)
1709+ [%apply *] (first-invalids args.out)
1710+ ==
1711+::
1712+++ first-invalids
1713+ |= xs=(list imported)
1714+ ^- (unit import-diagnostic)
1715+ ?~ xs ~
1716+ =/ first (first-invalid i.xs)
1717+ ?~ first $(xs t.xs)
1718+ first
1719+::
1720+:: +fixture-test: shared golden expectations for eval and the ship.
1721+:: A synthetic hold whose first $^ branch cannot be evaluated. It tests
1722+:: that a failed branch probe is reported rather than crashing the host.
1723+++ bad-branch-fixture
1724+ ^- type
1725+ [%hold -:!>(..zuse) [%tsls [%note [%made %bad ~] [%wtcl [%dtwt [%$ 12]] [%wing ~[%jibb-no-such-branch-name]] [%rock %n 0]]] [%$ 1]]]
1726+::
1727+++ fixture-test
1728+ |= [small=@t epic=@t presence=@t docs=@t shadow=@t]
1729+ ^- (list @t)
1730+ =/ sc=type -:(ride -:!>(..zuse) small)
1731+ =/ ec=type -:(ride -:!>(..zuse) epic)
1732+ =/ pc=type -:(ride -:!>(..zuse) presence)
1733+ =/ dc=type -:(ride -:!>(..zuse) docs)
1734+ =/ hc=type -:(ride -:!>(..zuse) shadow)
1735+ =/ sample
1736+ |= name=term
1737+ (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
1738+ =/ tlon
1739+ |= name=term
1740+ (read-mold-in %epic name (~(play ut ec) (ream (cat 3 '*' name))) ec)
1741+ =/ present
1742+ |= name=term
1743+ (read-mold-in %presence name (~(play ut pc) (ream (cat 3 '*' name))) pc)
1744+ =/ shad
1745+ |= name=term
1746+ (read-mold-in %shadow name (~(play ut hc) (ream (cat 3 '*' name))) hc)
1747+ =/ docs-type
1748+ |= name=term
1749+ (read-mold-in %docs name (~(play ut dc) (ream (cat 3 '*' name))) dc)
1750+ =/ errors=(list @t) ~
1751+ =/ expect-action=imported
1752+ [%fork ~[[%cell [%atom %tas [~ %add]] [%face %text [%atom %t ~]]] [%cell [%atom %tas [~ %remove]] [%face %id [%atom %ud ~]]]]]
1753+ =/ errors ?: =((sample %action) [%& expect-action]) errors
1754+ ['union cases and faces' errors]
1755+ =/ expect-map=imported
1756+ [%apply %map ~[[%atom %ud ~] [%cell [%face %id [%atom %ud ~]] [%face %text [%atom %t ~]]]]]
1757+ =/ errors ?: =((sample %items) [%& expect-map]) errors
1758+ ['map and its arguments' errors]
1759+ =/ expect-optional=imported
1760+ [%fork ~[[%cell [%face %name [%atom %t ~]] [%face %stamp [%atom %ud ~]]] [%atom %ud ~]]]
1761+ =/ errors ?: =((sample %optional) [%& expect-optional]) errors
1762+ ['atom-or-cell union' errors]
1763+ =/ expect-containers=imported
1764+ [%cell [%apply %set ~[[%atom %ud ~]]] [%cell [%apply %qeu ~[[%atom %ud ~]]] [%cell [%apply %list ~[[%atom %t ~]]] [%apply %unit ~[[%atom %ud ~]]]]]]
1765+ =/ errors ?: =((sample %containers) [%& expect-containers]) errors
1766+ ['set queue list and unit' errors]
1767+ =/ expect-chain=imported
1768+ [%fork ~[[%cell [%face %value [%atom %ud ~]] [%face %next [%ref %small %chain]]] [%atom %n [~ 0]]]]
1769+ =/ errors ?: =((sample %chain) [%& expect-chain]) errors
1770+ ['recursive reference' errors]
1771+ =/ expect-jar=imported [%apply %jar ~[[%atom %ud ~] [%atom %t ~]]]
1772+ =/ expect-jug=imported [%apply %jug ~[[%atom %ud ~] [%atom %t ~]]]
1773+ =/ errors ?: =((sample %jar-test) [%& expect-jar]) errors
1774+ ['jar name and arguments' errors]
1775+ =/ errors ?: =((sample %jug-test) [%& expect-jug]) errors
1776+ ['jug name and arguments' errors]
1777+ =/ expect-nested-jar=imported [%face %field [%apply %jar ~[[%atom %ud ~] [%atom %t ~]]]]
1778+ =/ errors ?: =((sample %nested-jar) [%& expect-nested-jar]) errors
1779+ ['nested jar is preserved' errors]
1780+ =/ expect-paired=imported
1781+ [%cell [%face %values [%apply %jar ~[[%atom %ud ~] [%atom %t ~]]]] [%face %cache [%apply %jug ~[[%atom %ud ~] [%atom %t ~]]]]]
1782+ =/ errors ?: =((sample %paired-aliases) [%& expect-paired]) errors
1783+ ['multiple collection aliases are preserved' errors]
1784+ =/ expect-nested-alias=imported
1785+ [%apply %jar ~[[%atom %ud ~] [%apply %jug ~[[%atom %ud ~] [%atom %t ~]]]]]
1786+ =/ errors ?: =((sample %nested-alias) [%& expect-nested-alias]) errors
1787+ ['nested collection arguments preserve names' errors]
1788+ =/ expect-mop=imported [%apply %mop ~[[%atom %ud ~] [%atom %t ~]]]
1789+ =/ errors ?: =((sample %mop-test) [%& expect-mop]) errors
1790+ ['ordered map name and arguments' errors]
1791+ =/ expect-nested-mop=imported
1792+ [%cell [%face %table expect-mop] [%face %other [%atom %ud ~]]]
1793+ =/ errors ?: =((sample %nested-mop) [%& expect-nested-mop]) errors
1794+ ['ordered map field is preserved' errors]
1795+ =/ expect-mixed=imported
1796+ [%cell [%face %a expect-mop] [%face %b [%apply %list ~[[%atom %ud ~]]]]]
1797+ =/ errors ?: =((sample %mixed-mop) [%& expect-mixed]) errors
1798+ ['static list sibling is preserved' errors]
1799+ =/ errors ?: =((sample %named-mop) [%| 'a nested Hoon mop needs source-aware import']) errors
1800+ ['non-atom argument remains unsupported' errors]
1801+ =/ errors ?: =((sample %mop-list) [%| 'a nested Hoon mop needs source-aware import']) errors
1802+ ['ordered map in a list remains unsupported' errors]
1803+ =/ errors ?: =((sample %signed) [%| 'signed and float auras cannot be imported']) errors
1804+ ['signed aura rejected' errors]
1805+ =/ errors ?: =((sample %float) [%| 'signed and float auras cannot be imported']) errors
1806+ ['float aura rejected' errors]
1807+ =/ errors ?: =((sample %gate-test) [%| 'cores and gates cannot be imported']) errors
1808+ ['gate rejected' errors]
1809+ =/ errors ?: =((read-mold %std %vase (~(play ut -:!>(..zuse)) (ream '*vase'))) [%| 'vases cannot be imported']) errors
1810+ ['vase rejected' errors]
1811+ =/ expect-valid=imported
1812+ [%fork ~[[%cell [%face %x [%atom %ud ~]] [%face %y [%atom %ud ~]]] [%atom %ud ~]]]
1813+ =/ errors ?: =((sample %valid-cell) [%& expect-valid]) errors
1814+ ['disjoint cell union' errors]
1815+ =/ errors ?: =((sample %invalid-cell) [%| 'Hoon $^ union disjointness could not be verified']) errors
1816+ ['overlapping cell union is rejected' errors]
1817+ =/ errors ?: =((shad %mn) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1818+ ['local mop shadow in a field is rejected' errors]
1819+ =/ errors ?: =((shad %mm) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1820+ ['local mop shadow is rejected' errors]
1821+ =/ errors ?: =((shad %aa) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1822+ ['local jar shadow is rejected' errors]
1823+ =/ errors ?: =((shad %bb) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1824+ ['local jug shadow in a field is rejected' errors]
1825+ =/ errors ?: =((read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1826+ ['missing provenance is rejected' errors]
1827+ =/ expect-timing=imported
1828+ [%cell [%face %since [%atom %da ~]] [%face %timeout [%apply %unit ~[[%atom %dr ~]]]]]
1829+ =/ errors ?: =((present %timing) [%& expect-timing]) errors
1830+ ['Tlon presence timing' errors]
1831+ =/ errors ?: =((read-mold %external %bad bad-branch-fixture) [%| 'a Hoon $^ union needs a source-level disjointness check']) errors
1832+ ['failed branch expansion is reported' errors]
1833+ =/ expect-saga=imported
1834+ [%fork ~[[%cell [%atom %tas [~ %chi]] [%atom %n [~ 0]]] [%cell [%atom %tas [~ %lev]] [%atom %n [~ 0]]] [%cell [%atom %tas [~ %dex]] [%face %ver [%atom %ud ~]]]]]
1835+ =/ errors ?: =((tlon %saga) [%& expect-saga]) errors
1836+ ['Tlon saga union' errors]
1837+ =/ errors ?: =((tlon %epic) [%& [%atom %ud ~]]) errors
1838+ ['Tlon epic atom' errors]
1839+ errors
1840+
1841+:: A compact diagnostic projection for importer golden files. This is
1842+:: not the Jibb type printer: it exposes constants and recursive refs.
1843+++ show-import
1844+ |= out=imported
1845+ ^- tape
1846+ ?- out
1847+ [%noun *] "*"
1848+ [%void *] "!!"
1849+ [%atom *]
1850+ ?~ value.out "@{(trip aura.out)}"
1851+ ?: =(%tas aura.out) "{(trip (scot %tas u.value.out))}"
1852+ "@{(trip aura.out)}:{(trip (scot %ud u.value.out))}"
1853+ [%cell *] "[{(show-import head.out)} {(show-import tail.out)}]"
1854+ [%face *] "{(trip name.out)}={(show-import body.out)}"
1855+ [%fork *] "(union {(show-imports cases.out)})"
1856+ [%named *] "(named {(trip name.out)}.{(trip module.out)} {(show-import body.out)})"
1857+ [%apply *] "({(trip name.out)} {(show-imports args.out)})"
1858+ [%ref *] "{(trip name.out)}.{(trip module.out)}"
1859+ [%bad *] "error: {(trip reason.out)}"
1860+ [%invalid *] "error: {(trip reason.out)}"
1861+ ==
1862+::
1863+++ show-imports
1864+ |= xs=(list imported)
1865+ ^- tape
1866+ ?~ xs ""
1867+ ?~ t.xs (show-import i.xs)
1868+ "{(show-import i.xs)} {$(xs t.xs)}"
1869+::
1870+++ show-result
1871+ |= result=(each imported @t)
1872+ ^- tape
1873+ ?- result
1874+ [%& *] (show-import p.result)
1875+ [%| *] "error: {(trip p.result)}"
1876+ ==
1877+::
1878+++ show-import-diagnostic
1879+ |= result=import-diagnostic
1880+ ^- tape
1881+ ?- result
1882+ [%ok *] (show-import value.result)
1883+ [%invalid *] "invalid/{(trip code.result)}: {(trip message.result)}"
1884+ [%unsupported *] "unsupported: {(trip message.result)}"
1885+ ==
1886+::
1887+:: Clay includes debug spans around source nodes. Reproduce that
1888+:: shape without Clay so the same regression runs under eval and -test.
1889+++ decorate-union-source
1890+ |= h=hoon
1891+ ^- hoon
1892+ =/ at=spot [/tests/importer/synthetic/hoon [[1 1] [1 2]]]
1893+ ?^ -.h [%dbug at [$(h -.h) $(h +.h)]]
1894+ ?+ h [%dbug at h]
1895+ [%note *] [%dbug at h(q $(h q.h))]
1896+ [%ktts *] [%dbug at h(q $(h q.h))]
1897+ [%wtcl *] [%dbug at h(q $(h q.h), r $(h r.h))]
1898+ ==
1899+::
1900+++ debug-union-fixture
1901+ |= [cor=type name=term]
1902+ ^- (each imported @t)
1903+ =/ typ=type (~(play ut cor) (ream (cat 3 '*' name)))
1904+ ?. ?=([%hold *] typ) [%| 'synthetic union is not a hold']
1905+ =/ original=hoon q.typ
1906+ ?. ?=([%tsls [%note * *] *] original) [%| 'synthetic union source is unavailable']
1907+ =/ source=hoon original(q.p (decorate-union-source q.p.original))
1908+ (read-mold %small name typ(q source))
1909+::
1910+:: Test debug metadata at the spec boundary without assuming that the
1911+:: eval version of Hoon's spec mold itself includes Clay's %dbug tag.
1912+++ debug-spec-fixture
1913+ ^- tape
1914+ =/ location=* [/tests/importer/synthetic/hoon [[1 1] [1 2]]]
1915+ =/ wrapped=* [%dbug location [%leaf %tas %x]]
1916+ =/ got=(unit *) (source-gist-tail wrapped)
1917+ ?~ got "debug wrapper missing"
1918+ =/ leaf=(each spec tang) (mule |.(;;(spec u.got)))
1919+ ?. ?=([%& [%leaf %tas %x]] leaf) "debug leaf not recovered"
1920+ =/ branch=spec [%bccl ~[p.leaf [%base [%atom %t]]]]
1921+ ?^ (tagged-cases ~[branch branch] ~) "duplicate tags accepted"
1922+ =/ broken=(unit *) (source-gist-tail [%dbug location 42])
1923+ ?~ broken "debug wrapper missing"
1924+ =/ invalid=(each spec tang) (mule |.(;;(spec u.broken)))
1925+ ?: ?=(%& -.invalid) "malformed spec accepted"
1926+ "valid wrapper; duplicate and malformed rejected"
1927+::
1928+:: The same named-operand call with Clay-style source-location wrappers.
1929+++ debug-mop-fixture
1930+ |= cor=type
1931+ ^- tape
1932+ =/ typ=type (~(play ut cor) (ream '*mop-wing-valid'))
1933+ ?> ?=([%hold *] typ)
1934+ =/ original=hoon q.typ
1935+ ?> ?=([%tsls [%note * *] *] original)
1936+ =/ body=hoon q.p.original
1937+ ?> ?=([%cncl *] body)
1938+ ?> ?=([%tsgr *] p.body)
1939+ =/ b=hoon q.p.body
1940+ ?> ?=([%cncl *] b)
1941+ =/ call=hoon p.b
1942+ ?> ?=([%cncl *] call)
1943+ ?> ?=([* [* ~]] q.call)
1944+ =/ at=spot [/tests/importer/synthetic/hoon [[1 1] [1 2]]]
1945+ =/ inner=hoon call(p [%dbug at p.call], q ~[[%dbug at i.q.call] [%dbug at i.t.q.call]])
1946+ =/ outer=hoon body(p p.body(q b(p [%dbug at inner])))
1947+ =/ mixed=hoon body(p p.body(q b(p inner)))
1948+ =/ multi=hoon body(p p.body(q b(p call(p [%dbug at [%wing ~[%one %two]]]))))
1949+ =/ plain=(unit [key=spec value=spec]) (mop-specs body)
1950+ ?~ plain "unwrapped mop not recognized"
1951+ ?. =((mop-specs [%dbug at outer]) plain) "wrapped mop not recognized"
1952+ ?. =((mop-specs mixed) plain) "mixed mop not recognized"
1953+ ?^ (mop-specs multi) "multi-segment callee accepted"
1954+ ?^ (mop-specs [%dbug at [%sand %ud 42]]) "malformed call accepted"
1955+ ?^ (source-single-wing [%dbug at 42]) "malformed wing accepted"
1956+ ?^ (source-single-wing [%dbug at [%wing ~[%one %two]]]) "multi-segment operand accepted"
1957+ =/ four=* [%dbug at [%dbug at [%dbug at [%dbug at [%wing ~[%mop]]]]]]
1958+ =/ five=* [%dbug at four]
1959+ ?~ (source-single-wing four) "four wrappers rejected"
1960+ ?^ (source-single-wing five) "wrapper limit exceeded"
1961+ ?~ (source-note-unwrap four 4) "four note wrappers rejected"
1962+ ?^ (source-note-unwrap five 4) "note wrapper limit exceeded"
1963+ =/ selected=(unit hoon) (local-arm-source cor %tag-valid)
1964+ ?~ selected "selected union not found"
1965+ =/ arm-four=hoon [%dbug at [%dbug at [%dbug at [%dbug at u.selected]]]]
1966+ =/ arm-five=hoon [%dbug at arm-four]
1967+ ?~ (tagged-source-code arm-four %tag-valid) "four wrapped selected arms rejected"
1968+ ?^ (tagged-source-code arm-five %tag-valid) "selected arm wrapper limit exceeded"
1969+ "wrapped and mixed calls accepted; malformed, multi-segment and excessive wrappers rejected"
1970+::
1971+:: Synthetic nodes test each part of the direct collection-call proof.
1972+++ collection-wrapper-fixture
1973+ ^- tape
1974+ =/ call=hoon [%cncl [%tsgr [%wing ~[[%.y 7]]] [%cncl [%wing ~[%list]] ~]] ~[[%$ 6]]]
1975+ =/ subject=hoon [%cncl [%tsgr [%wing ~[[%.y 8]]] [%cncl [%wing ~[%list]] ~]] ~[[%$ 6]]]
1976+ =/ sample=hoon [%cncl [%tsgr [%wing ~[[%.y 7]]] [%cncl [%wing ~[%list]] ~]] ~[[%$ 2]]]
1977+ =/ good=hoon [%tsls [%note [%made %x ~] call] [%tsls [%dtts [%$ 14] [%$ 2]] [%$ 6]]]
1978+ =/ tail=hoon [%tsls [%note [%made %x ~] call] [%$ 6]]
1979+ =/ args=(list [hoon hoon]) ~[[call good] [subject good] [sample good] [call tail]]
1980+ =/ flags=(list ?) (turn args |=(pair=[hoon hoon] (direct-collection-source -.pair +.pair)))
1981+ ?: =(flags ~[& | | |]) "valid; forged subject, sample and tail rejected"
1982+ "wrapper guard failed"
1983+::
1984+++ overlap-fork-fixture
1985+ ^- type
1986+ =/ nodes=(list type) ~[[%atom %ud ~] [%atom %t ~]]
1987+ [%fork (silt nodes)]
1988+::
1989+++ invalid-fork-fixture
1990+ ^- type
1991+ =/ nodes=(list type) ~[[%atom %ud ~] [%atom %sd ~]]
1992+ [%fork (silt nodes)]
1993+::
1994+++ fixture-output
1995+ |= [small=@t epic=@t presence=@t docs=@t shadow=@t shadow-static=@t ford=@t mark=@t mark-rec=@t mark-gate=@t mark-basic=@t origin-trans=@t origin-first=@t origin-other=@t]
1996+ ^- wain
1997+ =/ sc=type -:(ride -:!>(..zuse) small)
1998+ =/ ec=type -:(ride -:!>(..zuse) epic)
1999+ =/ pc=type -:(ride -:!>(..zuse) presence)
2000+ =/ dc=type -:(ride -:!>(..zuse) docs)
2001+ =/ hc=type -:(ride -:!>(..zuse) shadow)
2002+ =/ xc=type -:(ride -:!>(..zuse) shadow-static)
2003+ =/ fp=type [%cell [%face %small sc] -:!>(..zuse)]
2004+ =/ other=type -:(ride -:!>(..zuse) origin-other)
2005+ =/ fc=type -:(ride fp ford)
2006+ ?> ?=([%core *] fc)
2007+ =/ only-list=@t '|%\0a+$ lists (list @ud)\0a--\0a'
2008+ =/ tp=type [%cell [%face %intermediate fc] -:!>(..zuse)]
2009+ =/ tc=type -:(ride tp only-list)
2010+ =/ sp=type [%cell [%face %small xc] -:!>(..zuse)]
2011+ =/ shc=type -:(ride sp only-list)
2012+ =/ mark-core=type -:(ride fp mark)
2013+ =/ mark-rec-core=type -:(ride fp mark-rec)
2014+ =/ mark-gate-core=type -:(ride -:!>(..zuse) mark-gate)
2015+ =/ mark-basic-core=type -:(ride -:!>(..zuse) mark-basic)
2016+ =/ make-mark
2017+ |= [field=@t scope=type]
2018+ ^- type
2019+ -:(ride scope (crip "|_ a={(trip field)}\0a++ grab |% ++ noun a --\0a++ grow |% ++ noun a --\0a++ grad %noun\0a--\0a"))
2020+ =/ mark-union-core=type (make-mark 'mark-flag-valid:small' fp)
2021+ =/ mark-overlap-core=type (make-mark 'mark-flag-overlap:small' fp)
2022+ =/ mark-hidden-core=type (make-mark 'mark-flag-hidden:small' fp)
2023+ =/ mark-signed-core=type (make-mark 'signed:small' fp)
2024+ =/ mark-callable-core=type (make-mark 'gate-test:small' fp)
2025+ =/ extra-subject=type [%cell [%face %other other] fp]
2026+ =/ mark-extra-core=type (make-mark 'mark-flag-valid:small' extra-subject)
2027+ =/ other-hold=type (~(play ut other) (ream '*chain'))
2028+ =/ recursive-hold=type (~(play ut sc) (ream '*chain'))
2029+ =/ fake-vase=type -:(ride -:!>(..zuse) '|%\0a+$ vase @ud\0a--\0a')
2030+ =/ spoof=(unit import-diagnostic)
2031+ (first-invalid [%bad 'signed and float auras cannot be imported'])
2032+ ?> ?=(^ spoof)
2033+ =/ mark-shadow-core=type -:(ride sp mark-basic)
2034+ =/ tshp=type [%cell [%face %intermediate shc] -:!>(..zuse)]
2035+ =/ tshc=type -:(ride tshp only-list)
2036+ =/ trans=type -:(ride tp origin-trans)
2037+ =/ ambiguous-parent=type [%cell [%face %first sc] [%cell [%face %second sc] -:!>(..zuse)]]
2038+ =/ ambiguous=type -:(ride ambiguous-parent origin-first)
2039+ =/ distinct-parent=type [%cell [%face %first sc] [%cell [%face %second other] -:!>(..zuse)]]
2040+ =/ distinct=type -:(ride distinct-parent origin-first)
2041+ =/ trans-amb-parent=type [%cell [%face %intermediate fc] [%cell [%face %second sc] -:!>(..zuse)]]
2042+ =/ trans-amb=type -:(ride trans-amb-parent origin-trans)
2043+ =/ tag-child=@t
2044+ '|%\0a+$ tag-invalid-cell @t\0a+$ choice $%([%ok a=tag-invalid-cell] [%err a=@ud])\0a--\0a'
2045+ =/ tag-collision=type -:(ride [%cell [%face %base sc] -:!>(..zuse)] tag-child)
2046+ =/ tag-clean=type -:(ride [%cell [%face %base other] -:!>(..zuse)] tag-child)
2047+ =/ tag-zuse=@t
2048+ '|%\0a+$ ship @t\0a+$ path @ud\0a+$ choice $%([%ok who=ship] [%err where=path])\0a--\0a'
2049+ =/ tag-zuse-core=type -:(ride -:!>(..zuse) tag-zuse)
2050+ =/ nest-parent-src=@t
2051+ '|%\0a+$ tag-nest-inner $%([%foreign @t] [%foreign @t])\0a--\0a'
2052+ =/ nest-parent=type -:(ride -:!>(..zuse) nest-parent-src)
2053+ =/ nest-child-src=@t
2054+ '|%\0a+$ tag-nest-inner $%([%left @t] [%right @ud])\0a+$ tag-nest-middle $%([%one x=tag-nest-inner] [%two ~])\0a--\0a'
2055+ =/ nest-collision=type -:(ride [%cell [%face %base nest-parent] -:!>(..zuse)] nest-child-src)
2056+ =/ self-parent=type
2057+ -:(ride -:!>(..zuse) '|%\0a+$ tag-self ?(%same %same)\0a--\0a')
2058+ =/ self-child=@t
2059+ '|%\0a+$ tag-self $%([%branch children=(list tag-self)] [%leaf value=@t])\0a--\0a'
2060+ =/ self-collision=type -:(ride [%cell [%face %tag-self self-parent] -:!>(..zuse)] self-child)
2061+ =/ self-other=type
2062+ -:(ride -:!>(..zuse) '|%\0a+$ tag-self $%([%branch children=(list tag-self)] [%leaf value=@ud])\0a--\0a')
2063+ =/ mop-ford-parent=type
2064+ -:(ride -:!>(..zuse) '|%\0a+$ value ?(%same %same)\0a--\0a')
2065+ =/ mop-ford-child=type
2066+ -:(ride [%cell [%face %value mop-ford-parent] -:!>(..zuse)] '|%\0a+$ key @ud\0a+$ value @t\0a+$ mm ((mop key value) lte)\0a--\0a')
2067+ =/ sample
2068+ |= name=term
2069+ (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
2070+ =/ tlon
2071+ |= name=term
2072+ (read-mold-in %epic name (~(play ut ec) (ream (cat 3 '*' name))) ec)
2073+ =/ present
2074+ |= name=term
2075+ (read-mold-in %presence name (~(play ut pc) (ream (cat 3 '*' name))) pc)
2076+ =/ shad
2077+ |= name=term
2078+ (read-mold-in %shadow name (~(play ut hc) (ream (cat 3 '*' name))) hc)
2079+ =/ docs-type
2080+ |= name=term
2081+ (read-mold-in %docs name (~(play ut dc) (ream (cat 3 '*' name))) dc)
2082+ =/ chapter-tree=(map term hoon)
2083+ (~(put by *(map term hoon)) %jar [%zpzp ~])
2084+ =/ vase (read-mold %std %vase (~(play ut -:!>(..zuse)) (ream '*vase')))
2085+ :~ (crip "action: {(show-result (sample %action))}")
2086+ (crip "optional: {(show-result (sample %optional))}")
2087+ (crip "items: {(show-result (sample %items))}")
2088+ (crip "containers: {(show-result (sample %containers))}")
2089+ (crip "chain: {(show-result (sample %chain))}")
2090+ (crip "jar: {(show-result (sample %jar-test))}")
2091+ (crip "jug: {(show-result (sample %jug-test))}")
2092+ (crip "nested-jar: {(show-result (sample %nested-jar))}")
2093+ (crip "paired-aliases: {(show-result (sample %paired-aliases))}")
2094+ (crip "nested-alias: {(show-result (sample %nested-alias))}")
2095+ (crip "compound: {(show-result (sample %compound))}")
2096+ (crip "compound-fields: {(show-result (sample %compound-fields))}")
2097+ (crip "mop: {(show-result (sample %mop-test))}")
2098+ (crip "nested-mop: {(show-result (sample %nested-mop))}")
2099+ (crip "two-mops: {(show-result (sample %two-mops))}")
2100+ (crip "mixed-mop: {(show-result (sample %mixed-mop))}")
2101+ (crip "nested-static-mop: {(show-result (sample %nested-static-mop))}")
2102+ (crip "collection-siblings: {(show-result (sample %collection-siblings))}")
2103+ (crip "dynamic-sibling-mop: {(show-result (sample %dynamic-sibling-mop))}")
2104+ (crip "mark-flag-source: {(show-result (read-named %small %mark-flag-valid sc))}")
2105+ (crip "mark-flag-union: {(show-result (read-mark %flag-union mark-union-core))}")
2106+ (crip "mark-flag-overlap: {(show-result (read-mark %flag-overlap mark-overlap-core))}")
2107+ (crip "mark-flag-hidden: {(show-result (read-mark %flag-hidden mark-hidden-core))}")
2108+ (crip "mark-flag-signed: {(show-result (read-mark %flag-signed mark-signed-core))}")
2109+ (crip "mark-flag-callable: {(show-result (read-mark %flag-callable mark-callable-core))}")
2110+ (crip "mark-flag-extra: {(show-result (read-mark %flag-extra mark-extra-core))}")
2111+ (crip "mark-flag-other-hold: {?~((mark-union-fallback other-hold fp) "unsupported" "BAD")}")
2112+ (crip "mark-flag-recursive-fallback: {?~((mark-union-fallback recursive-hold fp) "unsupported" "BAD")}")
2113+ (crip "mark-record: {(show-result (read-mark %todo-item mark-core))}")
2114+ (crip "mark-recursive: {(show-result (read-mark %recursive mark-rec-core))}")
2115+ (crip "mark-gate: {(show-result (read-mark %bad mark-gate-core))}")
2116+ (crip "mark-list: {(show-result (read-mark %list-mark mark-basic-core))}")
2117+ (crip "mark-shadow: {(show-result (read-mark %list-mark mark-shadow-core))}")
2118+ (crip "mark-not-core: {(show-result (read-mark %bad [%atom %ud ~]))}")
2119+ (crip "ford-list: {(show-result (read-mold-in %ford %lists (~(play ut fc) (ream '*lists')) fc))}")
2120+ (crip "ford-imported: {(show-result (read-mold-in %ford %wrapped (~(play ut fc) (ream '*wrapped')) fc))}")
2121+ (crip "ford-recursive: {(show-result (read-mold-in %ford %recursive (~(play ut fc) (ream '*recursive')) fc))}")
2122+ (crip "ford-local-recursive: {(show-result (read-mold-in %ford %local (~(play ut fc) (ream '*local')) fc))}")
2123+ (crip "ford-recursive-transitive: {(show-result (read-named %outer %wrapped trans))}")
2124+ (crip "ford-recursive-ambiguous: {(show-result (read-named %outer %pick-one ambiguous))}")
2125+ (crip "ford-recursive-transitive-ambiguous: {(show-result (read-named %outer %wrapped trans-amb))}")
2126+ (crip "ford-recursive-distinct-first: {(show-result (read-named %outer %pick-one distinct))}")
2127+ (crip "ford-recursive-distinct-second: {(show-result (read-named %outer %pick-two distinct))}")
2128+ (crip "ford-transitive: {(show-result (read-mold-in %ford %lists (~(play ut tc) (ream '*lists')) tc))}")
2129+ (crip "ford-shadow: {(show-result (read-mold-in %ford %lists (~(play ut shc) (ream '*lists')) shc))}")
2130+ (crip "ford-transitive-shadow: {(show-result (read-mold-in %ford %lists (~(play ut tshc) (ream '*lists')) tshc))}")
2131+ (crip "ford-shadow-face: {?:((scope-safe [%cell [%face %list sc] -:!>(..zuse)] %list) "wrong" "unsafe")}")
2132+ (crip "ford-unknown: {?:((scope-safe [%cell [%atom %ud ~] -:!>(..zuse)] %list) "wrong" "unsafe")}")
2133+ (crip "ford-mismatched-core: {?:((scope-safe fc(p -:!>(..zuse)) %list) "wrong" "unsafe")}")
2134+ (crip "shadow-list-mop: {(show-result (read-mold-in %shadow-static %bad (~(play ut xc) (ream '*bad')) xc))}")
2135+ (crip "named-mop: {(show-result (sample %named-mop))}")
2136+ (crip "mop-list: {(show-result (sample %mop-list))}")
2137+ (crip "mop-wing-valid: {(show-result (sample %mop-wing-valid))}")
2138+ (crip "mop-wing-invalid-key: {(show-result (sample %mop-wing-invalid-key))}")
2139+ (crip "mop-wing-invalid-key-alias: {(show-result (sample %mop-wing-invalid-key-alias))}")
2140+ (crip "mop-wing-invalid-value: {(show-result (sample %mop-wing-invalid-value))}")
2141+ (crip "mop-wing-invalid-value-alias: {(show-result (sample %mop-wing-invalid-value-alias))}")
2142+ (crip "mop-wing-rec-key: {(show-result (sample %mop-wing-rec-key))}")
2143+ (crip "mop-wing-rec-value: {(show-result (sample %mop-wing-rec-value))}")
2144+ (crip "mop-wing-shadow: {(show-result (read-named %shadow %mmw hc))}")
2145+ (crip "mop-wing-ford-collision: {(show-result (read-named %child %mm mop-ford-child))}")
2146+ (crip "mop-wing-debug: {(debug-mop-fixture sc)}")
2147+ (crip "signed: {(show-result (sample %signed))}")
2148+ (crip "float: {(show-result (sample %float))}")
2149+ (crip "gate: {(show-result (sample %gate-test))}")
2150+ (crip "vase: {(show-result vase)}")
2151+ (crip "failed-branch: {(show-result (read-mold %external %bad bad-branch-fixture))}")
2152+ (crip "debug-spec: {debug-spec-fixture}")
2153+ (crip "debug-union: {(show-result (debug-union-fixture sc %action))}")
2154+ (crip "debug-union-overlap: {(show-result (debug-union-fixture sc %explicit-wut-overlap))}")
2155+ (crip "debug-nested-cell: {(show-result (debug-union-fixture sc %nested-valid-cell))}")
2156+ (crip "debug-nested-cell-overlap: {(show-result (debug-union-fixture sc %nested-invalid-cell))}")
2157+ (crip "explicit-graph: {(show-result (read-mold %raw %raw overlap-fork-fixture))}")
2158+ (crip "explicit-graph-unsupported: {(show-result (read-mold %raw %raw invalid-fork-fixture))}")
2159+ (crip "explicit-wut-safe: {(show-result (sample %explicit-wut-safe))}")
2160+ (crip "explicit-percent-overlap: {(show-result (sample %explicit-percent-overlap))}")
2161+ (crip "explicit-wut-overlap: {(show-result (sample %explicit-wut-overlap))}")
2162+ (crip "explicit-collapsed: {(show-result (sample %explicit-collapsed))}")
2163+ (crip "explicit-subsumed: {(show-result (sample %explicit-subsumed))}")
2164+ (crip "explicit-three: {(show-result (sample %explicit-three))}")
2165+ (crip "explicit-unknown: {(show-result (sample %explicit-unknown))}")
2166+ (crip "explicit-nested: {(show-result (sample %explicit-nested))}")
2167+ (crip "collection-union-wrapper: {collection-wrapper-fixture}")
2168+ (crip "collection-union-list: {(show-result (sample %collection-union-list))}")
2169+ (crip "collection-union-set: {(show-result (sample %collection-union-set))}")
2170+ (crip "collection-union-map-key: {(show-result (sample %collection-union-map-key))}")
2171+ (crip "collection-union-map-value: {(show-result (sample %collection-union-map-value))}")
2172+ (crip "collection-union-unit: {(show-result (sample %collection-union-unit))}")
2173+ (crip "collection-union-collapsed: {(show-result (sample %collection-union-collapsed))}")
2174+ (crip "collection-union-multiple: {(show-result (sample %collection-union-multiple))}")
2175+ (crip "collection-union-nested: {(show-result (sample %collection-union-nested))}")
2176+ (crip "collection-union-dependent: {(show-result (sample %collection-union-dependent))}")
2177+ (crip "collection-union-shadow: {(show-result (read-named %shadow %collection-union-shadow xc))}")
2178+ (crip "explicit-list: {(show-result (sample %explicit-list))}")
2179+ (crip "explicit-set: {(show-result (sample %explicit-set))}")
2180+ (crip "explicit-faces: {(show-result (sample %explicit-faces))}")
2181+ (crip "explicit-alias: {(show-result (sample %explicit-alias))}")
2182+ (crip "explicit-ford: {(show-result (read-named %outer %bad-union trans))}")
2183+ (crip "explicit-shadow-path: {(show-result (read-named %shadow %path-shadow xc))}")
2184+ (crip "list-bckt-field: {(show-result (sample %list-bckt-field))}")
2185+ (crip "list-noun-overlap: {(show-result (sample %list-noun-overlap))}")
2186+ (crip "list-null-overlap: {(show-result (sample %list-null-overlap))}")
2187+ (crip "list-nested-atom-cell: {(show-result (sample %list-nested-atom-cell))}")
2188+ (crip "list-nested-valid-cell: {(show-result (sample %list-nested-valid-cell))}")
2189+ (crip "list-nested-invalid-cell: {(show-result (sample %list-nested-invalid-cell))}")
2190+ (crip "map-nested-invalid-cell: {(show-result (sample %map-nested-invalid-cell))}")
2191+ (crip "set-direct-invalid-cell: {(show-result (sample %set-direct-invalid-cell))}")
2192+ (crip "map-key-invalid-cell: {(show-result (sample %map-key-invalid-cell))}")
2193+ (crip "nested-atom-cell: {(show-result (sample %nested-atom-cell))}")
2194+ (crip "nested-tags: {(show-result (sample %nested-tags))}")
2195+ (crip "nested-tags-overlap: {(show-result (sample %nested-tags-overlap))}")
2196+ (crip "nested-tagged: {(show-result (sample %nested-tagged))}")
2197+ (crip "nested-tagged-bckt: {(show-result (sample %nested-tagged-bckt))}")
2198+ (crip "nested-tagged-overlap: {(show-result (sample %nested-tagged-overlap))}")
2199+ (crip "nested-tagged-alias: {(show-result (sample %nested-tagged-alias))}")
2200+ (crip "nested-tagged-ford: {(show-result (read-named %outer %tagged trans))}")
2201+ (crip "tag-static-valid: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 13] [%rock %$ %foo]] [%rock %tas %foo]] 13) "yes" "no")}")
2202+ (crip "tag-static-wrong-axis: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 12] [%rock %$ %foo]] [%rock %tas %foo]] 13) "wrong" "no")}")
2203+ (crip "tag-static-nonconstant: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 13] [%rock %$ %foo]] [%$ 13]] 13) "wrong" "no")}")
2204+ (crip "tag-static-wrong-value: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 13] [%rock %$ %foo]] [%rock %tas %bar]] 13) "wrong" "no")}")
2205+ (crip "nested-first-cell: {(show-result (sample %nested-first-cell))}")
2206+ (crip "nested-alias-cell: {(show-result (sample %nested-alias-cell))}")
2207+ (crip "nested-multiple-cell: {(show-result (sample %nested-multiple-cell))}")
2208+ (crip "nested-named-sibling: {(show-result (sample %nested-named-sibling))}")
2209+ (crip "nested-list-sibling: {(show-result (sample %nested-list-sibling))}")
2210+ (crip "nested-validated-sibling: {(show-result (sample %nested-validated-sibling))}")
2211+ (crip "nested-validated-branch: {(show-result (sample %nested-validated-branch))}")
2212+ (crip "nested-named-branch: {(show-result (sample %nested-named-branch))}")
2213+ (crip "nested-ford-cell: {(show-result (read-named %outer %nested trans))}")
2214+ (crip "nested-valid-cell: {(show-result (sample %nested-valid-cell))}")
2215+ (crip "nested-invalid-cell: {(show-result (sample %nested-invalid-cell))}")
2216+ (crip "valid-cell: {(show-result (sample %valid-cell))}")
2217+ (crip "invalid-cell: {(show-result (sample %invalid-cell))}")
2218+ (crip "chapter-malformed: {?:((chapter-unsafe [%x %y %z] %jar) "unsafe" "wrong")}")
2219+ (crip "chapter-wrapped-malformed: {?:((chapter-unsafe [~ [%x %y %z]] %jar) "unsafe" "wrong")}")
2220+ (crip "chapter-direct-hit: {?:(=((chapter-has chapter-tree %jar) [~ &]) "yes" "no")}")
2221+ (crip "chapter-wrapped-hit: {?:(=((chapter-has [~ chapter-tree] %jar) [~ &]) "yes" "no")}")
2222+ (crip "chapter-direct-miss: {?:(=((chapter-has chapter-tree %jug) [~ &]) "yes" "no")}")
2223+ (crip "chapter-wrapped-miss: {?:(=((chapter-has [~ chapter-tree] %jug) [~ &]) "yes" "no")}")
2224+ (crip "shadow-nested-mop: {(show-result (shad %mn))}")
2225+ (crip "shadow-mop: {(show-result (shad %mm))}")
2226+ (crip "shadow-jar: {(show-result (shad %aa))}")
2227+ (crip "shadow-jug: {(show-result (shad %bb))}")
2228+ (crip "no-provenance-atom: {(show-result (read-mold %small %word (~(play ut sc) (ream '*word'))))}")
2229+ (crip "no-provenance-recursive: {(show-result (read-mold %wrong %alias (~(play ut sc) (ream '*chain'))))}")
2230+ (crip "no-provenance: {(show-result (read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))))}")
2231+ (crip "named-not-mold: {(show-result (read-named %small %not-mold sc))}")
2232+ (crip "named-present: {(show-result (read-named %small %items sc))}")
2233+ (crip "named-missing: {(show-result (read-named %small %missing sc))}")
2234+ (crip "named-invalid-core: {(show-result (read-named %small %items [%atom %ud ~]))}")
2235+ (crip "named-ford-recursive: {(show-result (read-named %ford %recursive fc))}")
2236+ (crip "diagnostic-items: {(show-import-diagnostic (read-named-diagnostic %small %items sc))}")
2237+ (crip "diagnostic-signed: {(show-import-diagnostic (read-named-diagnostic %small %signed sc))}")
2238+ (crip "diagnostic-float: {(show-import-diagnostic (read-named-diagnostic %small %float sc))}")
2239+ (crip "diagnostic-overlap: {(show-import-diagnostic (read-named-diagnostic %small %explicit-percent-overlap sc))}")
2240+ (crip "diagnostic-unproved: {(show-import-diagnostic (read-named-diagnostic %small %list-nested-invalid-cell sc))}")
2241+ (crip "diagnostic-mark-gate: {(show-import-diagnostic (read-mark-diagnostic %bad mark-gate-core))}")
2242+ (crip "diagnostic-shadow-vase: {(show-import-diagnostic (read-named-diagnostic %fake %vase fake-vase))}")
2243+ (crip "diagnostic-spoof: {(show-import-diagnostic u.spoof)}")
2244+ (crip "missing-arm: {(show-result (read-mold-in %small %missing [%atom %ud ~] sc))}")
2245+ (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
2246+ (crip "unverified-subject: {(show-result (read-mold-in %std %jar (~(play ut -:!>(..zuse)) (ream '*(jar @ud @t)')) -:!>(..zuse)))}")
2247+ (crip "tag-ford-collision: {(show-result (read-named %child %choice tag-collision))}")
2248+ (crip "tag-ford-clean: {(show-result (read-named %child %choice tag-clean))}")
2249+ (crip "tag-zuse-local: {(show-result (read-named %child %choice tag-zuse-core))}")
2250+ (crip "tag-nest-inner: {(show-result (sample %tag-nest-inner))}")
2251+ (crip "tag-nest-middle: {(show-result (sample %tag-nest-middle))}")
2252+ (crip "tag-nest-diamond: {(show-result (sample %tag-nest-diamond))}")
2253+ (crip "tag-nest-deep: {(show-result (sample %tag-nest-deep))}")
2254+ (crip "tag-nest-hidden: {(show-result (sample %tag-nest-hidden))}")
2255+ (crip "tag-nest-overlap: {(show-result (sample %tag-nest-overlap))}")
2256+ (crip "tag-nest-recursive: {(show-result (sample %tag-nest-recursive-outer))}")
2257+ (crip "tag-nest-rec-list: {(show-result (sample %tag-nest-rec-list-outer))}")
2258+ (crip "tag-nest-rec-repeat: {(show-result (sample %tag-nest-rec-repeat))}")
2259+ (crip "tag-nest-rec-duplicate: {(show-result (sample %tag-nest-rec-bad-outer))}")
2260+ (crip "tag-nest-rec-hidden: {(show-result (sample %tag-nest-rec-hidden-outer))}")
2261+ (crip "tag-nest-rec-mutual: {(show-result (sample %tag-nest-rec-mutual-outer))}")
2262+ (crip "tag-nest-rec-outer-overlap: {(show-result (sample %tag-nest-rec-outer-overlap))}")
2263+ (crip "tag-nest-rec-owner: {?:(&((contains-named-ref [%ref %small %tag-self] %small %tag-self) !(contains-named-ref [%named %small %other [%ref %small %tag-self]] %small %tag-self)) "yes" "wrong")}")
2264+ (crip "tag-nest-many: {(show-result (sample %tag-nest-many))}")
2265+ (crip "tag-nest-shadow: {(show-result (read-named %shadow-static %tag-nest-shadow xc))}")
2266+ (crip "tag-nest-wrong-hold: {?~((nested-tagged-union %small (~(play ut other) (ream '*chain')) `sc) "unsupported" "BAD")}")
2267+ (crip "tag-nest-ford-collision: {(show-result (read-named %outer %tag-nest-middle nest-collision))}")
2268+ (crip "tag-self: {(show-result (sample %tag-self))}")
2269+ (crip "tag-self-tail: {(show-result (sample %tag-self-tail))}")
2270+ (crip "tag-self-duplicate: {(show-result (sample %tag-self-duplicate))}")
2271+ (crip "tag-self-hidden: {(show-result (sample %tag-self-hidden))}")
2272+ (crip "tag-self-indirect: {(show-result (sample %tag-self-indirect))}")
2273+ (crip "tag-mutual-a: {(show-result (sample %tag-mutual-a))}")
2274+ (crip "tag-mutual-b: {(show-result (sample %tag-mutual-b))}")
2275+ (crip "tag-self-pair: {(show-result (sample %tag-self-pair))}")
2276+ (crip "tag-self-ford-collision: {(show-result (read-named %child %tag-self self-collision))}")
2277+ (crip "tag-self-wrong-core: {(show-result (read-mold-in %other %tag-self (~(play ut sc) (ream '*tag-self')) self-other))}")
2278+ (crip "tag-flat-large: {?:(&(?=(~ (safe-source-name-mode %tag-fuel-7 sc ~ 256 |)) ?=(^ (safe-source-name-mode %tag-fuel-7 sc ~ 4.096 |)) ?=([%& *] (sample %tag-flat-large))) "supported above 256" "BAD")}")
2279+ (crip "tag-null-good: {(show-result (sample %tag-null-good))}")
2280+ (crip "tag-null-duplicate: {(show-result (sample %tag-null-duplicate))}")
2281+ (crip "tag-null-hidden: {(show-result (sample %tag-null-hidden))}")
2282+ (crip "tag-valid: {(show-result (sample %tag-valid))}")
2283+ (crip "tag-duplicate: {(show-result (sample %tag-duplicate))}")
2284+ (crip "tag-collapsed: {(show-result (sample %tag-collapsed))}")
2285+ (crip "tag-invalid-direct: {(show-result (sample %tag-invalid-direct))}")
2286+ (crip "tag-invalid-alias: {(show-result (sample %tag-invalid-alias))}")
2287+ (crip "tag-invalid-list: {(show-result (sample %tag-invalid-list))}")
2288+ (crip "tag-enum-good: {(show-result (sample %tag-enum-good))}")
2289+ (crip "tag-enum-bad: {(show-result (sample %tag-enum-bad))}")
2290+ (crip "tag-nested-good: {(show-result (sample %tag-nested-good))}")
2291+ (crip "tag-shadow-jar: {(show-result (read-named %shadow-static %tag-shadow-jar xc))}")
2292+ (crip "tag-shadow-jug: {(show-result (read-named %shadow-static %tag-shadow-jug xc))}")
2293+ (crip "tag-fuel-small: {?:(?=(^ (safe-source-name %tag-fuel-2 sc ~ 64)) "yes" "no")}")
2294+ (crip "tag-fuel-large: {?:(?=(~ (safe-source-name %tag-fuel-11 sc ~ 64)) "rejected" "wrong")}")
2295+ (crip "presence-action-1: {(show-result (present %action-1))}")
2296+ (crip "presence-command-1: {(show-result (present %command-1))}")
2297+ (crip "presence-update-1: {(show-result (present %update-1))}")
2298+ (crip "presence-response-1: {(show-result (present %response-1))}")
2299+ (crip "presence-topic: {(show-result (present %topic))}")
2300+ (crip "presence-timing: {(show-result (present %timing))}")
2301+ (crip "presence-places: {(show-result (present %places))}")
2302+ (crip "docs-ent: {(show-result (docs-type %ent))}")
2303+ (crip "docs-nud: {(show-result (docs-type %nud))}")
2304+ (crip "tlon-saga: {(show-result (tlon %saga))}")
2305+ (crip "tlon-epic: {(show-result (tlon %epic))}")
2306+ ==
2307+
2308+--
jibb-dev/lib/jibb.hoon+12257−252
@@ -11,6 +11,7 @@
1111:: +parse [file=path src=@t] (each module error)
1212:: +parse-tokens [file=path toks=(list token)] (each module error)
1313:: +golden [file=path src=@t] [tokens=@t tree=@t]
14+:: +golden-types [file=path src=@t] @t (partial inference)
1415:: +show-tokens (list token) @t
1516:: +show-module module @t
1617:: +show-error [src=@t error] @t
@@ -19,14 +20,20 @@
1920:: fails: an error it finds is its last token (2.0), and +layout-error
2021:: takes it out.
2122::
22−:: Status: the types, the printers, +golden and the layout pass
23−:: (+layout, +lexer) work. +parse-tokens is a stub that returns an
24−:: error; it is implemented next, against the design below. Choices the
23+:: Status: the syntax types, the printers, +golden, the layout pass (+layout,
24+:: +lexer) and the parser (+parse-tokens, +parser) work, and +golden
25+:: checks every tree's spans (+check-spans, section 1). Choices the
2526:: doc leaves open are marked "(doc question)": they follow the most
2627:: likely reading and are listed, with the doc's words, for the doc's
27−:: author to settle. The golden corpus's "expect:" lines give each
28−:: error's position. The layout pass's errors sit there, except where
29−:: the parser finds an earlier error first, as in `++ 2nd 5` (2.0, 2.8).
28+:: author to settle. Those the author has settled, in the Decisions
29+:: tab's rows of 2026-10-30, are marked "(Decisions)" beside the rule
30+:: decided. The golden corpus's "expect:" lines give each error's
31+:: position. A partial inference fragment is in %type-inference; its
32+:: output explicitly says the module has not been checked. The layout
33+:: pass's errors sit there, except where the
34+:: parser finds an earlier error first, as in `++ 2nd 5`, or moves one
35+:: back to the start of its text, as in `++ x @sd` (2.0, 2.8, and
36+:: section 3, Errors).
3037::
3138:: ===================================================================
3239:: 1. Positions
@@ -46,12 +53,18 @@
4653:: so does editor tooling later. A node starts at its first token and
4754:: ends where its last token ends: its closing token if it has one, else
4855:: its last child's last token, never a layout token. So an open
49−:: bracket, a body, ?-'s arms and $?'s cases end with their last line's
56+:: bracket, a body, ?-'s arms and a +$'s cases end with their last line's
5057:: code, not at the line that closes them. Every node's span holds its
5158:: children's spans, in source order. The printed tree shows starts
5259:: only, and milestone 1's errors use starts only, so ends are first
53−:: tested by milestone 2's excerpts; the parser's own tests should check
54−:: the two rules above on every golden tree.
60+:: used by milestone 2's excerpts. Until then +check-spans tests the two
61+:: rules above on every tree +golden prints, and a tree that breaks one
62+:: ends with a line "SPAN ERROR: (<kind> <start> to <end>) <why>". It
63+:: finds each node's end from the tokens alone, matching each opener
64+:: with its closer on the line, so a node that stops at a child where
65+:: its closer follows fails it, and +check-spans-test plants such
66+:: wrong ends to show that it does (tools/hoon check-spans-test prints
67+:: the empty list, <<>>, when it passes).
5568::
5669:: ===================================================================
5770:: 2. The layout pass (+layout)
@@ -61,17 +74,30 @@
6174:: crosses a line break, and only layout tokens join lines.
6275::
6376:: 2.0 Errors. +layout never fails. Where the text breaks a rule of this
64−:: section, it emits one error token, [%error msg], at the first
65−:: character that breaks it, and stops reading. The parser accepts no
66−:: error token, so it reports whichever comes first, its own error or
67−:: this one (section 3, Errors). Every error, from either stage, points
68−:: at the first character where the text stops being the start of any
69−:: valid module: everything before it could still be right. Hoon's
70−:: parser reports errors the same way, and the golden corpus's expect
71−:: lines assume it. It also puts `++ x ]` on line 1 before a bad string
72−:: on line 9, which a lexer that failed first would report instead. The
73−:: positions below follow from it. Messages quote code in backticks, as
74−:: the parser's do (section 3, Errors).
77+:: section, it emits one error token, [%error msg from c], at the first
78+:: character that breaks it, and stops reading. from is where the text it
79+:: was reading began, c is that text's first character, and the token is
80+:: tight when that text follows the previous token with no space. Where
81+:: the lexer has already cut a token from the front of that text, as 100
82+:: from 1000, the parser takes that token before it reaches the error, so
83+:: the text the error token stands for begins at the error: from is the
84+:: error's own place, and c the character there (2.8, +err-on). The
85+:: parser accepts no error token, so it reports whichever comes first,
86+:: its own error or this one (section 3, Errors). Every error, from
87+:: either stage, points at the first character where the text stops being
88+:: the start of any valid module: everything before it could still be
89+:: right. Hoon's parser reports errors the same way, and the golden
90+:: corpus's expect lines assume it. It also puts `++ x ]` on line 1
91+:: before a bad string on line 9, which a lexer that failed first would
92+:: report instead. The positions below follow from it, for text that
93+:: could begin a token where it stands; where the parser's place can't
94+:: begin with c at all, the parser moves the error back to from, as
95+:: `++ x @sd` at the @ (section 3, Errors). Spaces and comments emit
96+:: nothing (2.3, 2.6), so where a line ends before what it needs, the
97+:: error is just past the line's last token, not at its trailing
98+:: spaces or comment: `++ x ^- :: c` above a deeper line fails at 1:8
99+:: (section 3, Errors). Messages quote code in backticks, as the
100+:: parser's do.
75101::
76102:: 2.1 Lines. The text is split at every \0a. A final \0a ends the last
77103:: line rather than starting an empty one. Lines are numbered from 1.
@@ -120,7 +146,7 @@
120146:: The layout pass knows nothing of brackets: it emits INDENT, NEWLINE and
121147:: DEDENT by column alone. The parser decides what takes an indented
122148:: block: a bracket left open at the end of its line, a rune's body, ?-'s
123−:: arms, $?'s cases, a +$ mold on the next line. A bracket opened and
149+:: arms, and a +$'s cases on the next lines. A bracket opened and
124150:: closed on one line is just tokens.
125151::
126152:: 2.6 Tokens. After the indentation, tokens are read left to right;
@@ -143,15 +169,26 @@
143169:: else is an error at 3rd, "the loobeans are `%.y` and
144170:: `%.n`"
145171:: %& %| term literals, [%f 0] and [%f 1]
172+:: %$ the empty term, [%tas 0]
146173:: %a... term literal: % and a name [a-z][a-z0-9-]*, [%tas name];
147174:: a capital or _ right after it is an error there,
148175:: "names are lowercase letters, digits and -"
149−:: %0... term literal: % and digits [0-9]+, [%ud value]
150−:: (doc question: digits only, as the EBNF says, so
151−:: %1000 is a term and %1.000 an error at the dot); a
152−:: letter, _, - or . right after it is an error there,
153−:: "unexpected `a`: a numeric term is `%` and digits
154−:: only, as %1000"
176+:: %0... term literal: % and a decimal written as a number
177+:: literal's is, [%ud value]: %0, %42, %1.000
178+:: (Decisions). The run of [0-9a-zA-Z.] after the % is
179+:: read as a number literal's run (2.8) and fails at
180+:: the same character of the run: %1000 at its fourth
181+:: digit, as 1000 does, and %1.0 just past its run.
182+:: But %0 alone is a term, so anything in the run after
183+:: its 0 fails there, as the second 0 of %007 and the x
184+:: of %0x1f. That holds for every run of 0 and a letter,
185+:: which fails at the letter whether Hoon reads the run
186+:: as another aura or not (2.0): %0x and %0xg at the x,
187+:: as %0x1f, though 0x and 0xg as numbers fail at the
188+:: character after the x, since nothing goes on from
189+:: the 0 of %0. The message is "a numeric term is
190+:: `%` and a decimal, digits in groups of three joined
191+:: by dots, as %1.000" (+numeric-term)
155192:: % anything else after it: error at 2nd, "`%` begins a
156193:: term, a loobean or `%/`"
157194:: /- /% /= import glyphs at column 1, where imports go; anywhere
@@ -160,10 +197,11 @@
160197:: / glyph, then a path segment may follow (2.7)
161198:: ++ +$ + glyphs
162199:: |=( |= |$ glyphs
163−:: $?( $? $-( glyphs; $- followed by anything but ( is an error
200+:: $-( glyph; $- followed by anything but ( is an error
164201:: at 3rd, "`$-` has only the wide form `$-(sample
165202:: product)`"
166−:: ^- ?- !! ? glyphs (? alone is the loobean mold)
203+:: ^- ?- !! ? glyphs (? alone is the loobean mold; ? then a
204+:: character of Hoon's other ? runes is left out, below)
167205:: @ aura: @, then [a-z]*, then at most one [A-Z]; the
168206:: token holds the text after @. An aura starting @s or
169207:: @r is an error at 2nd: "signed and floating-point
@@ -183,10 +221,10 @@
183221:: at it, "this `}` closes no `{`"
184222:: | $ ^ followed by nothing above or in the table below:
185223:: an error at 2nd, "`|` begins `|=`, `|=(` or `|$`",
186−:: "`$` begins `$?`, `$?(` or `$-(`", "`^` begins `^-`"
224+:: "`$` begins `$-(`", "`^` begins `^-`"
187225:: : followed by anything but :, an error at 2nd: the
188−:: table's :~ :* and a:b, else "a comment starts with
189−:: `::`"
226+:: table's :~ :* :- :+ :^ :_ and a:b, else "a comment
227+:: starts with `::`"
190228:: anything else an error at it, naming it: "unexpected `,`", with a
191229:: hint where one helps (+unexpected): for , . - and <,
192230:: what Jibb writes instead
@@ -194,32 +232,46 @@
194232:: Hoon forms the doc leaves out are errors with the doc's reason, as
195233:: "`|%` is left out: modules are records". Each points where the text
196234:: stops being Jibb: at its second character when its first can begin
197−:: Jibb there, else at its first.
235+:: some Jibb token, else at its first. Where the parser's place can't
236+:: begin with that first character, the parser moves the error to it
237+:: (2.0): `|%` at the top of a file fails at the |, `++ x |%` at the %.
238+:: The doc's list says "such as" of the tall forms and the wide ones,
239+:: so Hoon's runes of the same kinds get the same reason (doc
240+:: question):
198241::
199242:: |% |_ |* 2nd modules are records
200243:: |- 2nd gates recurse by name
201−:: $( 1st gates recurse by name; no expression starts $
202−:: $% 2nd $? covers unions
203−:: ?+ ?: 2nd ?- is the branch (?:: is ? and a comment)
244+:: $( 2nd gates recurse by name (at the $ where an
245+:: expression goes, as no expression starts $)
246+:: $? $% 2nd a union is a +$ with its cases below
247+:: ?: ?+ 2nd ?- is the branch, and so for Hoon's other ?
248+:: runes, ?~ ?= ?. ?@ ?^ ?& ?| ?< ?> (?:: is ?
249+:: and a comment)
204250:: ?! 2nd eq and not are gates
205251:: .= 1st eq and not are gates
206252:: !x 2nd not is a gate: ! then anything but ! or >
207253:: !> /+ 2nd code also runs in the browser
208−:: =< => .* 1st names never shadow, and . reads imports too
254+:: =< => 2nd names never shadow, and . reads imports too
255+:: .* 1st the same
209256:: a:b 2nd of the :, right after a name: names never
210257:: shadow, and . reads imports too; write a.b
211258:: :~ :* 2nd indentation covers them; write ~[…] or […]
212−:: %: %= 2nd indentation covers them
213−:: == -- 1st the closers are left out: indentation covers
214−:: them
259+:: :- :+ :^ :_ 2nd indentation covers them; write a cell as [a b]
260+:: %: %- %+ 2nd indentation covers them; a call is (f a b)
261+:: %^ %~
262+:: %= 2nd indentation covers it; write a change, m(a=b)
263+:: == 2nd the closers are left out: indentation covers
264+:: -- 1st them
215265:: ~| 2nd ~& covers debugging
266+:: ;: 1st nest the calls, as (add a (add b c))
216267:: ; 1st Sail's ; runes are left out: layout is Jibb's
217268:: elements
218269:: ' 1st there is no '…' form: strings are "…"
219270::
220271:: The parser finds the doc's other left-out forms (section 3, Errors):
221−:: =(a b), =/, *mold, ^-(…) and ?-(…). The lexer can't, since =( =/ and *
222−:: begin valid Jibb too: open=(not open.s), scry=/todos, a * mold.
272+:: =(a b), =/, *mold, ^-(…), ?-(…) and ~&(…), and Hoon's =+ =? and =.
273+:: The lexer can't, since = and * begin valid Jibb too: open=(not
274+:: open.s), scry=/todos, a * mold.
223275::
224276:: 2.7 Paths. Right after a / or %/ glyph, a run of knot characters
225277:: [a-z0-9._~-] is one knot token, tight. So /posts/~zod is / knot / knot;
@@ -240,24 +292,47 @@
240292::
241293:: 2.8 Literals. The lexer takes a literal's run (2.6), then reads it
242294:: with Hoon's own parser, (nuck:so [[line col] run]), whose edge says
243−:: how much it read and how far it looked (p.edge):
295+:: how much it read and how far it looked (p.edge). Some runs never
296+:: reach it, since they begin an aura Jibb doesn't write, whatever
297+:: follows, or text Hoon's parser crashes on:
298+:: - 0b, 0c, 0i and 0w: an error at 2nd, "Jibb writes no @uw
299+:: literals" and so on. Hoon's parser would read 0b, or a 0c1 whose
300+:: checksum fails, as the number 0 and an error past the run.
301+:: - ~- (a @c), "Jibb writes no @c literals", and ~~ (a cord), "Jibb
302+:: writes no @t literals; strings are "…"", at 2nd. Hoon's reader of
303+:: @c crashes on a control character, as in ~-~1.
304+:: - ~0 and a base-32 digit, at 3rd: Hoon's parser reads a blob there
305+:: and cues it, which can run out of memory, past what mule catches.
306+:: No Jibb literal goes on so, since a year has no leading 0: after
307+:: a letter it is "Jibb writes no blob literals", after a digit the
308+:: date's message (+literal-msg). ~0.1.1 is a date (below).
309+:: - A year BC of 0 or past 292.277.024.401, as in ~0-.1.1, at the -
310+:: that makes it BC: Hoon's +year crashes on it (+year-bc).
311+:: - A fifth sub-second group, after a duration's .. or a date's
312+:: second .., at the dot that begins it: "a date or duration takes
313+:: at most four sub-second groups", as Hoon's do, since its +yule
314+:: crashes on a fifth (+fifth-group).
315+:: A date or duration is also read under mule, so that any other crash
316+:: is an error at the run's start, "Jibb can't read this literal"; other
317+:: runs aren't, since mule costs about a millisecond a call. Then:
244318:: - It read the whole run, as an aura Jibb takes: the token. Numbers
245319:: take %ud, %ux and %uv: 1.000, 0x1f, 0v5.fdf99 (Hoon reads 0x1F
246320:: too). ~ runs take %p, %da, %dr and %ta: ~zod, ~sampel-palnet,
247−:: ~2026.10.23..14.30.00, ~h1.m30, ~.my-post.
248−:: - It read the run or part of it as an aura Jibb doesn't take: 0w1,
249−:: 0i1, ~~a (a cord), ~-a (a @c). An error at 2nd, "Jibb writes no
250−:: @uw literals". A run starting 0b, 0c, 0i or 0w gets that error
251−:: before nuck:so reads it, since no Jibb literal goes on that way:
252−:: Hoon's parser would read 0b, or a 0c1 whose checksum fails, as
253−:: the number 0 and an error past the run.
321+:: ~2026.10.23..14.30.00, ~h1.m30, ~.my-post. Its value is Hoon's,
322+:: as every literal reads exactly as Hoon reads it (Decisions):
323+:: ~0.1.1 is 1 BC and prints as ~1-.1.1, ~2026.2.31 is ~2026.3.3,
324+:: and years BC and sub-second groups are dates.
325+:: - It read the run or part of it as another aura Jibb doesn't take:
326+:: an error at 2nd that names the aura, as "Jibb writes no @if
327+:: literals".
254328:: - It read only part of the run, as an aura Jibb takes: that part is
255329:: a token, then an error token at p.edge, the furthest character
256330:: Hoon's parser looked at, where Hoon reports it too. 1000 is the
257331:: token 100 and an error at its fourth digit ("a decimal is digits
258332:: in groups of three joined by dots, as 1.000": each kind of literal
259333:: has its message, +literal-msg); 0v5.fdfz9 is 0v5 and an error at the
260−:: z; ~2026.10.29..14.30 is ~2026.10.29 and an error just past the
334+:: z; ~2026.10.29..14.30, the minute form print-date writes, is no
335+:: literal (Decisions) but ~2026.10.29 and an error just past the
261336:: run. The token lets the parser report an earlier error first: in
262337:: `++ 2nd 5` it finds the number 2 where a name goes, at 1:4.
263338:: When it read a ship, or only the ~ of a run that goes on with a
@@ -266,18 +341,22 @@
266341:: d h m or s, if that is later: Hoon's parser reads a syllable's
267342:: three letters before it looks them up, so it looks past that
268343:: letter. `++ x ~x` fails at the x, 1:7, as no syllable starts with
269−:: x, and ~sampel-palnez at the z.
270−:: A run that starts as a date BC does, ~ and a year then -, fails at the
271−:: - if the year is 0 or past 292.277.024.401, before nuck:so sees it:
272−:: Hoon's +year crashes on those years, as in ~0-.1.1 (+year-bc).
273−:: The token is [%lit [form aura val]]: form names the literal rule that
274−:: matched, aura and val are the dime Hoon's parser gives. Terms,
275−:: loobeans and the bare ~ are read by hand (2.6).
276−::
277−:: 2.9 Strings. A " starts a string, which ends on the same line. Up to
278−:: the closing ":
279−:: \\ \" \{ and \ with two lowercase hex digits are escapes, as in
280−:: Hoon's tapes (doc question: the doc names only \{ and \"). Any
344+:: x, and ~sampel-palnez at the z. The error token's from is the
345+:: error's own place, not the run's start, since the parser has
346+:: taken the run's first part as a token by the time it reaches the
347+:: error (2.0, +err-on): so `+$ x ~x` fails at the x too, the ~
348+:: being a mold, and `+$ x %1.0` at 1:10, as `++ x %1.0` does.
349+:: The token is [%lit [form aura val txt]]: form names the literal rule
350+:: that matched, aura and val are the dime Hoon's parser gives, and txt
351+:: is the literal as written. A numeric term's decimal is read as a
352+:: number's run is, here, from the character after its % (2.6,
353+:: +numeric-term); the other terms, loobeans and the bare ~ are read by
354+:: hand (2.6).
355+::
356+:: 2.9 Strings. A " starts a string, which ends on the same line, as each
357+:: of its {…} does (Decisions). Up to the closing ":
358+:: \\ \" \{ and \ with two lowercase hex digits are escapes, Hoon's
359+:: (Decisions), so \\ writes a backslash and \0a a line feed. Any
281360:: other \ is an error at the first character that can't continue
282361:: the escape: the one after the \, or a bad second hex digit (2.2's
283362:: error if it is a tab or another control character)
@@ -293,18 +372,18 @@
293372:: parser reads head expr { mid expr } tail. The lexer keeps a stack of
294373:: open interpolations, since strings nest inside them. Inside an
295374:: interpolation a : is an error at it, "a comment can't start inside
296−:: `{…}`", and so is a {; inside a string, :: is text. A line that ends
297−:: inside a string or an interpolation is an error at its end, "this
298−:: string has no closing `\"` on its line" or "this `{` has no `}` on its
299−:: line". Token texts hold the decoded text. Spaces after { and before }
300−:: are allowed, as after any opener.
375+:: `{…}`", and so is a {; inside a string, :: is text (Decisions). A
376+:: line that ends inside a string or an interpolation is an error at
377+:: its end, "this string has no closing `\"` on its line" or "this `{`
378+:: has no `}` on its line". Token texts hold the decoded text. Spaces
379+:: after { and before } are allowed, as after any opener (Decisions).
301380::
302381:: 2.10 What fails here. Bad characters (2.2), an indented first line and
303382:: a dedent to no open level (2.4), characters that start no token or a
304−:: left-out form (2.6), malformed literals, auras, type variables and
305−:: wings (2.6, 2.8), a character that no token lets follow a path
306−:: segment, a ~. knot or a numeric term (2.6, 2.7), and unclosed strings
307−:: and interpolations, bad escapes and stray { or } (2.9). Everything
383+:: left-out form (2.6), malformed literals and numeric terms, auras,
384+:: type variables and wings (2.6, 2.8), a character that no token lets
385+:: follow a path segment or a ~. knot (2.7), and unclosed strings and
386+:: interpolations, bad escapes and stray { or } (2.9). Everything
308387:: else is the parser's: brackets that don't match or don't close, a
309388:: missing or extra space, a deeper line that nothing takes, a token
310389:: where it can't go.
@@ -313,14 +392,15 @@
313392:: 3. The parser (+parse-tokens)
314393:: ===================================================================
315394::
316−:: Hand-written recursive descent over the token list: one arm per EBNF
317−:: rule, each taking the remaining tokens and returning (pare node): the
318−:: node and the tokens after it, or an error. Steps chain with ;< and
319−:: +then, so an error stops the parse:
395+:: Hand-written recursive descent over the token list (+parser): one
396+:: arm per EBNF rule, each taking the remaining tokens and returning
397+:: (pare node): the node and the tokens after it, or an error. Steps
398+:: chain with ;< and +then, so an error stops the parse (+read-cast):
320399::
321−:: ;< [s=shape ts=(list token)] then (mold ts)
322−:: ;< [e=expr ts=(list token)] then (expr-or-body ts)
323−:: [%& [%cast [beg.at.rune end:(span-of e)] s e] ts]
400+:: ;< [s=shape after=(list token)] then (read-mold ts)
401+:: ;< [e=expr more=(list token)] then
402+:: (read-expr-or-body "the mold" after)
403+:: [%& [%cast [beg.at.ket end:(span-of e)] s e] more]
324404::
325405:: Why: after the layout pass the grammar is LL(2). Each choice is made by
326406:: the next token, at most with the one after it and whether it is tight:
@@ -340,11 +420,27 @@
340420:: descent is shorter, and each error names what its construct expected.
341421:: An operand that isn't where an expression starts (a call's argument,
342422:: an item, a pair's or unit's operand, the wide gate's body) can't be a
343−:: rune, so there |= is a constructor and needs its term at once:
344−:: (state.cart |= %got) is an error at the space after |=, 1:20. Loops
345−:: over many items (definitions, arms, lines, items) may recurse: vere's
346−:: stack takes ten million plain frames, so no Jibb file nests or runs
347−:: long enough to overflow it.
423+:: rune, so there |= is a constructor and needs its term at once, or
424+:: the ( of the wide gate: in ++ x (state.cart |= %got) the space after
425+:: |= is an error, 1:20. A loop over many items (definitions, arms,
426+:: lines, items) is a trap whose every step, through +then, is a tail
427+:: call, so a long module grows no stack. Nesting does, by a few frames
428+:: a level: 100.000 nested parentheses parse, closed on their line or
429+:: left open above one deeper line, and so do 100.000 nested calls,
430+:: ++ x (f (f … ~[ above one deeper line, and a 20.000-line module.
431+:: Brackets left open on one line close together at one test each
432+:: (+shut), with no look back at their tokens. +golden's tree stops
433+:: indenting past 64 levels (4.2), so its size grows with the text's,
434+:: not with its square, and its time a little faster than the nesting:
435+:: tools/golden takes 12 s, 23 s and 70 s on 10.000, 30.000 and
436+:: 100.000 such calls, 8 s of it starting urbit and building the
437+:: library, and most of the rest printing the tree, 46 MB at 100.000.
438+::
439+:: @iko decided 2026-10-30 (Decisions): "No `$?`: a `+$` with its cases
440+:: on the lines below is a union, so every union written in Jibb has a
441+:: name; one case is just that mold; a mold that isn't a union counts as
442+:: a union of one case for tags and `|=%tag`; a generic's `|$` comes right
443+:: after the `+$`'s name; tags anywhere".
348444::
349445:: The EBNF and its nodes (see the types below):
350446:: module { import NEWLINE } { definition NEWLINE }, then the end
@@ -352,38 +448,60 @@
352448:: "expected a definition, found `/-`; imports come first"
353449:: import /- name -> %sur; /% term -> %mark; /= name pathlit ->
354450:: %jibb. /% takes % and a name only: no mark is called %0,
355−:: %& or %| (doc question)
356−:: definition +$ name mold, or the mold alone on a deeper line ->
357−:: %mold (both layouts give one node); ++ name expr or body
358−:: -> %value (a body becomes a %body expr)
451+:: %& or %| (doc question). /='s path has a segment, as it
452+:: names a module's file: /= card / is an error just past
453+:: the / (doc question)
454+:: definition +$ name, optional |$ [vars], then a mold on its line or
455+:: cases below -> %mold; one case is that mold, several
456+:: are %union. The optional generic wraps either in %generic.
457+:: ++ name expr or body -> %value (a body becomes a %body expr)
359458:: body INDENT { definition NEWLINE } expr DEDENT -> %body
360459:: call one operand is that operand; more -> %call head args
361−:: operand literal -> %lit or %str; pathlit -> %path (not in the
362−:: EBNF's operand, but in the Literals table: doc
363−:: question); qath -> %qath; ref -> %wing; change -> %change;
364−:: pair -> %pair; unit -> %unit; group -> %group; list ->
365−:: %list; tuple -> %tuple; gate -> %gate-wide; ctor -> %ctor
460+:: operand literal -> %lit or %str; pathlit -> %path, as a path
461+:: literal is an expression (Decisions); !! -> %crash, as
462+:: !! is an operand (Decisions), so f !!, [a !!], ~[!!],
463+:: `!!, a+!!, m(a=!!) and |=(a !!) need no parentheses;
464+:: qath -> %qath; ref -> %wing; change -> %change; pair ->
465+:: %pair; unit -> %unit; group -> %group; list -> %list;
466+:: tuple -> %tuple; gate -> %gate-wide; ctor -> %ctor
366467:: group ( expr ) -> %group of the expr. The open form ( {operand}
367468:: open -> %group of the call whose elements are the first
368469:: line's operands, then one per line; one element alone is
369−:: just grouped. A ( followed by a rune is the closed form.
370−:: Lines of an open group or list take no name= (doc
371−:: question)
470+:: just grouped. A ( alone at the end of its line puts the
471+:: head on the first deeper line (Decisions), and needs
472+:: that line, as () is no group. A ( followed by a rune is
473+:: the closed form. Lines of an open group or list take no
474+:: name= (doc question)
372475:: change every item and line has name= (the EBNF's "items named")
373−:: rune |= -> %gate; ^- -> %cast; ~& -> %trace; ?- -> %branch;
374−:: !! -> %crash. !! is not an operand, so [a !!] needs
375−:: [a (!!)] (doc question)
476+:: rune |= -> %gate; ^- -> %cast; ~& -> %trace; ?- -> %branch.
477+:: !! is an operand, not a rune (Decisions): alone where an
478+:: expression goes it is a call of one operand, and !! a
479+:: is a call whose head is !!, for the checker to judge
376480:: sample the sample of |= and |=(…): a field, except that a bare
377481:: name binds (%bind) wherever it stands in the sample: the
378482:: whole sample, as |= x and |=(p title.p), or a field of a
379483:: cell sample at any depth, as b in |= [a=@ b], which is
380−:: a %cell of samples (doc question). A name inside a mold,
381−:: as a in (list a), $-(a b) or $?(a b), is a mold
484+:: a %cell of samples (Decisions: every bare name in a
485+:: sample binds, at any depth). A name inside a mold, as a
486+:: in (list a) or $-(a b), is a mold. A cell
487+:: sample's [ has no open form, as a cell pattern's hasn't
488+:: (Decisions)
382489:: mold aura -> %aura; * -> %noun; !! -> %void; ? -> %flag;
383490:: ~ term loobean -> %const; ref -> %ref; typevar -> %tvar;
384491:: pathmold -> %path; ( ref mold … ) -> %apply; [ field … ]
385−:: -> %cell; $? with cases below, and $?( … ) -> %union;
386−:: $-( mold mold ) -> %fn; |$ [ typevar … ] mold -> %generic
492+:: -> %cell; $-( mold mold ) -> %fn. Only a +$ definition
493+:: introduces %union or %generic.
494+:: A mold's ( and [ may be left open at the end of their
495+:: line, as an expression's brackets can (Decisions):
496+:: ( ref { mold } mlines -> %apply, the name staying on
497+:: the first line, so ( alone there is an error at the end
498+:: of its line, where the name goes; [ { field } flines ->
499+:: %cell, [ alone too.
500+:: mlines and flines are INDENT and one mold or field per
501+:: deeper line, which may itself open, to the DEDENT; a
502+:: second item on a line, or a closer, is an error. The
503+:: node is the closed form's, ending with its last item.
504+:: $-( has no open form.
387505:: field name=mold -> %face; =name -> %pun; mold -> %bare
388506:: pattern term number ship loobean ~ -> %lit (dates, durations and
389507:: knots are errors); string without {…} -> %str; * -> %any;
@@ -392,24 +510,50 @@
392510:: What the EBNF leaves out, and how this design fills it in:
393511:: - Rules it names but doesn't define: string, ship, date, duration,
394512:: knotlit, decimal, hex, base32, lower, upper and digit. They are
395−:: Hoon's literals (the Literals table; Decisions: "Hoon's runes as
396−:: keywords, and its literals"), read as 2.6, 2.8 and 2.9 say.
513+:: Hoon's literals, exactly (the Literals table; Decisions: 1000 is
514+:: an error, ~2026.2.31 is ~2026.3.3, years BC and sub-second groups
515+:: are dates, and print-date's minute form is no literal), read as
516+:: 2.6, 2.8 and 2.9 say; a numeric term's decimal is a number's.
397517:: - A string's interpolations: str alone, or str-head expr { str-mid
398518:: expr } str-tail, where each expr is a full expression.
399519:: - Spaces, comments and blank lines: the layout pass, and Spacing
400520:: below.
401−:: - pathlit as an operand (above), with / alone the empty path.
402−:: - knot may be empty: only / alone uses that, as the empty path; //
403−:: and a trailing / are errors (doc question).
404−:: - Open brackets in molds: mold has no open form, so a mold's [ or (
405−:: closes on its line, and only $? takes lines below (doc question).
406−:: - Two brackets left open on one line, as (column ~[: the last one
407−:: takes the deeper lines, and the other is then unclosed, an error
408−:: (doc question).
409−:: - Local definitions: the EBNF takes them in every body (of ++, |=,
410−:: ^-, ~& and arms), the Runes prose says "inside a gate"; the parser
411−:: takes them in every body and leaves the rest to the checker (doc
412−:: question).
521+:: - knot may be empty: only / alone uses that, as the empty path in
522+:: an expression or a mold, not in an import; // and a trailing /
523+:: are errors (doc question).
524+:: - Several brackets left open on one line, which its layout comment
525+:: allows and its productions can't say (Decisions): the deeper
526+:: lines go to the last bracket or rune left open on the line, and
527+:: every bracket open before it closes with it, at the first line
528+:: that isn't deeper, with no closer, ending where its last item
529+:: ends. So (column ~ ~[ above its items is (column ~ ~[…]), and
530+:: the next line at its depth goes to what holds that line. This
531+:: holds for every bracket before the last, whether or not it has
532+:: an open form of its own, as the Decisions say "the brackets
533+:: before it close with it": an expression's ( [ and ~[, a change's
534+:: (, |=(, a mold's ( [ and $-(, an application path's (…), and
535+:: a cell sample's [. A segment's ( holds an expression as an
536+:: expression's ( does and needs only its ), so %/a/(f ~[ above its
537+:: items is %/a/(f ~[…]), as $-(, which has no open form
538+:: either, closes so; a sample's [ that closes so leaves its gate no
539+:: body. A cell pattern's [ and |$'s [ hold no other bracket, and
540+:: an interpolation's {…} closes on its line (2.9). A rune's body
541+:: or arms that took the lines close the brackets before the rune
542+:: too: (|= a above its body is a group holding the gate. A bracket
543+:: closes so when the last item it read ends on a later line than
544+:: its opener, which needs no look back (+shut). One that still
545+:: needs a part after that item, as |=( or $-( with only its
546+:: sample, can't close so, and neither can a rune before the last
547+:: opener that needs deeper lines of its own: errors at the end of
548+:: the line (Errors below). A mold's ( never needs more than its )
549+:: once it holds its name: one that is the last opener on its line
550+:: takes the deeper lines as its open form (Decisions), and one
551+:: before a later opener holds that mold after its name and closes
552+:: with it.
553+:: - Local definitions: at the start of any body, a gate's, an arm's,
554+:: a ^-'s, a ~&'s or a ++'s, as the EBNF's body takes them
555+:: (Decisions); +$ as well as ++, as the Runes prose's "likewise"
556+:: says.
413557:: - Where errors point: the doc says only "line, column and an
414558:: excerpt"; 2.0 and Errors below say where.
415559::
@@ -419,16 +563,18 @@
419563:: lines, fields and samples), =name (pun); in a path or application
420564:: path, each / and the segment after it, and all of a typed segment,
421565:: [id=@ud]
422−:: - either way: right after an opener ( [ ~[ |=( $?( $-( or {, and
566+:: - either way: right after an opener ( [ ~[ |=( $-( or {, and
423567:: right before a closer ) ] or } (the theme example writes `[ space=`),
424568:: the ( and ) of an application path's segment included; inside
425569:: them the expression is spaced as anywhere else, as %/x/(f a)
426−:: A missing space is an error at the tight token, and so is a space
427−:: inside a tight form, at the space (Errors). A rune with children, and
428−:: an import glyph, is followed by a space (or, for $? with its cases
429−:: below, the end of the line). Items are separated by one or more
430−:: spaces; how many isn't checked. This is how the parser makes "one
431−:: space between items; more for alignment" precise (doc question).
570+:: A missing space is an error at the tight token, and a space inside
571+:: a tight form, or the end of the line there, is one where it starts
572+:: (Errors). A rune with children, and an import glyph, is followed by
573+:: a space.
574+:: Items are separated by one or more spaces; how many isn't checked,
575+:: and a line may end in spaces. Spacing beyond this is style, which
576+:: the formatter keeps: "one space between items; more for alignment"
577+:: (Decisions).
432578::
433579:: Errors. The parser stops at the first token it can't accept and
434580:: reports "expected <what>, found <token>", with an optional "; <hint>",
@@ -439,38 +585,131 @@
439585:: the same depth" (NEWLINE), "a shallower line" (DEDENT), or "the end of
440586:: the file" (an empty span, 2.5). Each error points at the first
441587:: character that can't begin a valid module (2.0):
442−:: - At the token's start; for a layout token, at the start of the
443−:: line it begins, or just past the last token at the end of the
444−:: file (+where). So `++ view` above `++ main view` is an error at
588+:: - At a token the place can't take: just past the part of it that
589+:: could still begin what the place takes (+fail-in, +prefix). That
590+:: is none when the place can't begin with its first character, so
591+:: `++ 2nd 5` fails at the 2, 1:4; a wing's first name where a name
592+:: goes, so `++ a.b 1` fails at the dot, 1:5; else one character,
593+:: as the % of %.y where a term goes, the ~ of ~zod where a mold
594+:: goes (~ alone is one), or a + or ? alone. A layout token is at
595+:: the start of the line it begins, or just past the last token at
596+:: the end of the file (+where), where another line, deeper or not,
597+:: would have done. So `++ view` above `++ main view` is an error at
445598:: 2:1, the line that isn't deeper.
446599:: - Where a tight form needs its next token at once (after name+, `,
447−:: |= in an operand, name=, the = of a pun, a path's / and %/, a
448−:: typed segment's parts) and finds a space: at the end of the
449−:: previous token, where the space starts, "expected a term right
450−:: after `|=`, found a space" (+fail-space). A wing and a ( after a
451−:: space are no error: that is a call.
452−:: - At an error token: the lexer's position and message, unchanged.
453−:: - Three pattern errors point inside their token, where it stops
454−:: being a pattern: a date, duration or knot at its second character
455−:: (~ alone is null, and no ship goes on so), ~[ at its [, and a
456−:: string with {…} at its {.
600+:: |= in an operand, name=, the = of a pun, a / after a path
601+:: segment, a typed segment's parts) and finds a space or the end
602+:: of the line: at the end of the previous token, where the space or
603+:: the line's end starts, as "expected an operand right after `+`,
604+:: found the end of the line" (+fail-space). No later line can give
605+:: a tight form its next token. A wing and a ( after a space are no
606+:: error: that is a call; nor is / or %/ alone, a whole path. A
607+:: change's item is name=, so a name there with no = right after it
608+:: fails just past the name, whatever follows: `m(b c)` at the
609+:: space, `m(b)` at the ), `m(a"x)` at the " with the layout pass's
610+:: message after the parser's (+unnamed, +moved). `m(a==1)` has its
611+:: =, and fails at the second, where the layout pass does.
612+:: - Where the place needs text on its own line and the line ends,
613+:: whatever line comes next: at the end of that line, just past its
614+:: last token, "found the end of the line" (+fail-line), as no later
615+:: line can supply it. That is a rune's part on its line (|='s
616+:: sample, ^-'s mold, ~&'s value, ?-'s subject, |$'s [), a
617+:: name after ++ or +$, an import's parts, and what a bracket that
618+:: closes on its line still needs: one with no open form ($-(
619+:: |=(, a cell sample's or cell pattern's [, |$'s [, an application
620+:: path's (…), a ( before a rune), or a mold's ( before its name,
621+:: which stays on the first line (Decisions); the bracket adds "this
622+:: bracket closes on its line" (+unclosed-want). So `++ x ^-` above
623+:: a deeper line fails at 1:8, "expected a mold, found the end of the
624+:: line". Spaces and a comment after the last token
625+:: emit nothing (2.3, 2.6), so they don't move the end of the line:
626+:: `++ x ^- :: c` fails at 1:8 too. At the end of the file the place
627+:: is the same, and the message says "the end of the file".
628+:: - At an error token: the lexer's position and message, unless the
629+:: text it was reading begins with a character the place can't
630+:: begin with. Then at that character, the lexer's message after
631+:: the parser's (+moved): `++ x @sd` is "expected an expression,
632+:: found `@`; signed and floating-point auras are left out of Jibb"
633+:: at the @, while `+$ x @sd` fails at the s. The place includes
634+:: what could still go on before it: after a call's operand and a
635+:: space, another operand, so `++ x a ?:` fails at the ? and `++ x
636+:: a |%` at the % (+read-operands), as `++ x !! |%` does, !! being
637+:: an operand; after a mold or an import that ends a line, nothing,
638+:: so `+$ x @ |%` fails at the | (+bad-end-in), and so after an
639+:: open mold bracket's line's one item; tight after an item, a
640+:: closer, or after a name the ( . + or = of a change, wing, pair
641+:: or face (+tight-error, which doesn't look at what the item was,
642+:: though it takes no = after a call's operand). A : stays where
643+:: the lexer put it, since it could begin a comment. An error token
644+:: after a space or on a later line, where a tight form needed its
645+:: next token, comes after the tight form's error (+fail-space).
646+:: - At layout tokens followed by an error token whose text begins
647+:: the line, both errors are at the line's start, and the lexer's
648+:: message, about that text, says more: a line `==` that closes a
649+:: ?- is "the closer `==` is left out: indentation covers it", not
650+:: "expected the end of the body" (+lexer-error).
651+:: - Where a line's last open bracket or rune took the deeper lines
652+:: while something before it on the line still needs more: deeper
653+:: lines of its own (a ~&'s body, a ?-'s arms, a tall |='s or ^-'s
654+:: body when nothing on the line gives one), a part after the one
655+:: that took them (|=('s body, $-('s product), or the } of an
656+:: interpolation (2.9): at the end of that line, since no later
657+:: line can supply it (+doomed). The brackets before the last close
658+:: with the deeper lines instead (What the EBNF leaves out), so a
659+:: gate whose cell sample's [ closed so still has no body.
660+:: `++ x ~& a ~[` above deeper lines is "expected `~&`'s body on
661+:: deeper lines, found the end of the line; the deeper lines go to
662+:: the last bracket or rune left open on this line", at 1:13.
663+:: - Pattern errors point inside their token, where it stops being a
664+:: pattern: a date or knot at its second character (~ alone is
665+:: null, and no ship goes on so), a duration just past its unit
666+:: letter (~d begins ships, as ~dur), ~[ at its [, and a string
667+:: with {…} at its {.
457668:: In a bracket, a closer that doesn't match is "expected `]` to close
458669:: the `~[` at 1:6, found `)`", checked before spacing; after an item, a
459670:: tight token that isn't a closer is "expected a space between items,
460−:: found `M`". Hints name the left-out forms the lexer can't see (2.6):
461−:: where an expression starts, = followed tight by ( is "=(a b) is left
462−:: out: eq is a gate", = followed tight by / is "=/ is left out: ++
463−:: defines values", and * is "*mold is left out: no defaults"; ^- or ?-
464−:: followed tight by ( is "the wide form ^-(…) is left out: indentation
465−:: covers it". Examples:
671+:: found `M`". A bracket that closes on its line names, at a closer that
672+:: doesn't match or at its line's end, what it still needs: its closer
673+:: once it holds all it needs, else its next part, as `$-(@)` and `$-(@]`
674+:: are "expected a mold, the product", and `$-(]` "expected a
675+:: mold", `|=(]` and `|= []` "expected a sample", `|=(a]` "expected the
676+:: gate's body" (+unclosed-want). So does a group's ( with nothing after
677+:: it on its line, as () is no group: `()` and `(]` are "expected an
678+:: expression", and a ( alone whose next line isn't deeper "expected the
679+:: call's head on a deeper line" (+read-group). A ) or ] that closes no
680+:: bracket opened before it on its line adds "this `)` closes no bracket"
681+:: (+stray), and a closer on a line of an open bracket "a bracket open at
682+:: the end of its line takes no closer: its items end at the first line
683+:: that isn't deeper". Hints name the left-out forms the lexer can't see
684+:: (2.6): where an expression starts, = followed tight by ( is "=(a b) is
685+:: left out: eq is a gate"; = followed tight by / is "=/ is left out: ++
686+:: defines values", and so for Hoon's =+ =? and =.; * is "*mold is left
687+:: out: no defaults"; ^-, ?- or ~& followed tight by ( is "the wide form
688+:: ^-(…) is left out: indentation covers it". Others name likely slips:
689+:: |= and a space where an operand goes, "a gate in an operand is |=(a
690+:: body)", or before a term "a case's constructor takes its term with no
691+:: space, as |=%got"; name= in a pattern, "patterns take no `name=`: a
692+:: bare name binds, as [a b]"; a capital or a wing where a name goes, "a
693+:: name starts with a lowercase letter" and "a name has no `.`"; a lone +
694+:: where a definition goes, "`+` begins `++` or `+$`"; a mold's ( alone
695+:: at the end of its line, "a `(` keeps the mold's name on its first
696+:: line"; a second item on a line of an open mold bracket, "a bracket
697+:: open at the end of its line takes one field per line" (or mold). The
698+:: messages quote that code in backticks (2.0), as in "`=(a b)` is left
699+:: out: eq is a gate".
700+:: Examples:
466701:: expected `]` or an item on a deeper line, found a line at the same
467702:: depth
703+:: expected `]` or a field on a deeper line, found a line at the same
704+:: depth
468705:: expected the end of the line, found a deeper line; only a bracket
469706:: open at the end of a line, or a rune's body, takes deeper lines
470707:: expected an expression, found `^-`; inside a call, a rune goes in
471708:: parentheses
472−:: expected a named item, found `x`; a change's items are named, as in
709+:: expected a named item, found `1`; a change's items are named, as in
473710:: m(done=%.y)
711+:: expected `=` right after `b`, found a space; a change's items are
712+:: named, as in m(done=%.y)
474713:: Messages of milestone 1 are golden-tested, so their wording is fixed
475714:: by the tests once written.
476715::
@@ -483,8 +722,8 @@
483722:: 4.1 Tokens (+show-tokens): one token per line, "<line>:<col>" at
484723:: +where, then "tight " if the token is tight, then the kind and the
485724:: text. Kinds: glyph (with its text), INDENT, DEDENT, NEWLINE, name, wing,
486−:: lit (the literal as Hoon prints its dime: 1.000, 0x1f, ~zod, ~h1.m30,
487−:: ~.knot; terms as %add, %0, %& and %|; loobeans %.y and %.n; null ~),
725+:: lit (the literal as written: 1.000, 0x1f, ~zod, ~h1.m30, ~.knot;
726+:: terms as %add, %1.000, %& and %|; loobeans %.y and %.n; null ~),
488727:: str, str-head, str-mid and str-tail (quoted, with \\ \" \{ and \XX
489728:: escapes), knot, aura (@ud), tvar, and ERROR with its message (+golden
490729:: prints the rendered error instead). A layout token prints at the
@@ -518,7 +757,10 @@
518757:: (a string's quoted text, an application path's knots). A node whose
519758:: kids are all leaves prints on one line; otherwise each kid goes on its
520759:: own line, indented two more spaces, and the closing parens end the
521−:: last kid's line. (module …) always breaks. Bare fields and samples
760+:: last kid's line. (module …) always breaks. Past 64 levels the indent
761+:: stops growing: a deeper line starts with 128 spaces and its depth
762+:: between bars, as `|65| (group 1:69`, so the printed tree's size is
763+:: linear in the text's however deep it nests. Bare fields and samples
522764:: print as their mold, and a cell sample as (cell …) of its samples, a
523765:: bare name there as (bind …); unnamed items print as their expr;
524766:: strings print text pieces quoted, between their interpolated exprs;
@@ -533,7 +775,7 @@
533775:: (apply 2:17 list (aura 2:23 @t)))
534776:: (face 2:27 open (flag 2:32))))
535777:: (mold 3:1 cart-action
536−:: (union 3:16
778+:: (union 4:3
537779:: (cell 4:3
538780:: (const 4:4 %add)
539781:: (face 4:9 item (aura 4:14 @t)))
@@ -621,7 +863,7 @@
621863 [%knot p=@ta] :: path segment
622864 [%aura p=@ta] :: @ud as 'ud', @ as ''
623865 [%tvar p=@t] :: M
624− [%error p=tape] :: 2.0: what broke
866+ [%error p=tape from=loc c=@] :: 2.0: what broke
625867 ==
626868::
627869:: +glyph: a token that is its text, and the layout tokens
@@ -629,29 +871,31 @@
629871+$ glyph
630872 $? %indent %dedent %newline :: layout
631873 %'(' %')' %'[' %']' :: brackets
632− %'~[' %'|=(' %'$?(' %'$-(' :: openers
874+ %'~[' %'|=(' %'$-(' :: openers
633875 %'%/' %'/' :: paths
634876 %'+' %'`' %'=' :: pair, unit, face
635− %'*' %'?' :: noun, loobean mold
636− %'++' %'+$' %'|=' %'|$' %'$?' :: runes
877+ %'*' %'?' %'_' :: noun, loobean, type hole
878+ %'++' %'+$' %'|=' %'|$' :: runes
637879 %'^-' %'~&' %'?-' %'!!' :: runes
638880 %'/-' %'/%' %'/=' :: imports
639881 ==
640882::
641883:: +lit: a literal other than a string, as Hoon's parsers read it
642884::
643−:: form is the literal rule that matched; aura and val are the dime
644−:: nuck:so gives, or for terms and loobeans:
885+:: form is the literal rule that matched; txt is the literal as
886+:: written, which the printers show, since Hoon's own printing of
887+:: some auras (@da) differs between Hoon versions; aura and val are
888+:: the dime nuck:so gives, or for terms and loobeans:
645889:: %number 1.000 0x1f 0v5.fdf99 %ud %ux %uv
646890:: %ship ~zod %p
647891:: %date ~2026.10.23 %da
648892:: %duration ~h1.m30 %dr
649893:: %knot ~.my-post %ta
650−:: %term %add %0 %& %| %tas 'add', %ud 0, %f 0, %f 1
894+:: %term %add %1.000 %& %| %$ %tas 'add', %ud 1.000, %f 0, %f 1, %tas 0
651895:: %loobean %.y %.n %f 0, %f 1
652896:: %null ~ %n 0
653897::
654−+$ lit [form=lit-form aura=@ta val=@]
898++$ lit [form=lit-form aura=@ta val=@ txt=@t]
655899+$ lit-form
656900 ?(%number %ship %date %duration %knot %term %loobean %null)
657901::
@@ -772,24 +1016,25 @@
7721016 [%const at=span =lit] :: ~ %add %.y
7731017 [%ref at=span names=(list term)] :: state item.todo
7741018 [%tvar at=span name=@t] :: M
1019+ [%hole at=span ~] :: _
7751020 [%path at=span segs=(list pseg)] :: / /todos /todo/[id=@ud]
7761021 [%apply at=span ref=(list term) args=(list shape)] :: (list @t)
7771022 [%cell at=span fields=(list field)] :: [text=@t done=?]
778− [%union at=span cases=(list shape)] :: $? below, or $?(%a %b)
1023+ [%union at=span cases=(list shape)] :: several +$ cases below
7791024 [%fn at=span sample=shape product=shape] :: $-(@t M)
780− [%generic at=span vars=(list @t) body=shape] :: |$ [M] $? …
1025+ [%generic at=span vars=(list @t) body=shape] :: +$ name |$ [M] …
7811026 ==
7821027::
783−:: +pseg: a path mold's segment, a knot or [name=aura]
1028+:: +pseg: a path mold's segment, a knot, [name=aura], or [name=_]
7841029::
785−+$ pseg $%([%knot p=@ta] [%typed at=span name=term aura=@ta])
1030++$ pseg $%([%knot p=@ta] [%typed at=span name=term aura=@ta] [%inferred at=span name=term hole-at=span])
7861031::
7871032+| %api
7881033::
7891034:: +layout: source to tokens (design: section 2)
7901035::
791−:: Never fails: an error it finds is its last token, [%error msg], at
792−:: the error's position (2.0). +lexer does the work.
1036+:: Never fails: an error it finds is its last token, [%error msg from
1037+:: c], at the error's position (2.0). +lexer does the work.
7931038::
7941039++ layout
7951040 |= [file=path src=@t]
@@ -816,22 +1061,21 @@
8161061:: +parse-tokens: tokens to tree (design: section 3)
8171062::
8181063:: It accepts no error token, so it fails at the first of its own
819−:: error and the layout pass's (2.0). The stub reports an error token
820−:: that comes first, as the parser will, and fails otherwise.
1064+:: error and the layout pass's (2.0). +parser does the work.
8211065::
8221066++ parse-tokens
8231067 |= [file=path toks=(list token)]
8241068 ^- (each module error)
825− ?: ?=([[* * [%error *]] *] toks)
826− (fail file toks "a module")
827− =/ at=loc ?~(toks [1 1] (where i.toks))
828− [%| file line.at col.at "parser not implemented"]
1069+ (~(read-module parser file toks) toks)
8291070::
8301071:: +golden: both stages printed, or the rendered error
8311072::
8321073:: tokens: the layout pass's tokens, or its error if it found one
8331074:: tree: the parser's tree, or the first error of either stage, which
834−:: the parser reports since it accepts no error token (2.0)
1075+:: the parser reports since it accepts no error token (2.0). A tree
1076+:: whose spans break section 1's rules (+check-spans) gets a last
1077+:: line saying how, "SPAN ERROR: …", so every golden case checks
1078+:: them.
8351079::
8361080++ golden
8371081 |= [file=path src=@t]
@@ -843,8 +1087,13 @@
8431087 =/ par (parse-tokens file toks)
8441088 ?: ?=(%| -.par) (show-error src p.par)
8451089 :: a parser that accepted an error token would be wrong; say so
846− ?^ bad (show-error src u.bad)
847− (show-module p.par)
1090+ ?^ bad
1091+ %^ cat 3 (show-error src u.bad)
1092+ '\0aPARSER ERROR: the parser accepted an error token'
1093+ =/ tree=@t (show-module p.par)
1094+ =/ why=(unit tape) (check-spans p.par toks)
1095+ ?~ why tree
1096+ (cat 3 tree (crip "\0aSPAN ERROR: {u.why}"))
8481097::
8491098+| %lexer
8501099::
@@ -952,10 +1201,37 @@
9521201 ::
9531202 :: +err: the error token, at column c of this line (2.0)
9541203 ::
1204+ :: It also records where the text it was reading began, from, and
1205+ :: that text's first character: the parser moves the error there
1206+ :: when the place it is in can't begin with that character (section
1207+ :: 3, Errors). Like any token, it is tight when that text follows the
1208+ :: last token with no space.
1209+ ::
9551210 ++ err
9561211 |= [c=@ud msg=tape]
9571212 ^+ cor
958− cor(out [[[[lin c] [lin c]] | [%error msg]] out])
1213+ (err-from c msg [lin col] ?~(cs 0 i.cs))
1214+ ::
1215+ :: +err-from: +err, where the text began at from with first
1216+ ::
1217+ ++ err-from
1218+ |= [c=@ud msg=tape from=loc first=@]
1219+ ^+ cor
1220+ cor(out [[[[lin c] [lin c]] =(from pend) [%error msg from first]] out])
1221+ ::
1222+ :: +err-on: +err after a token cut from the front of the text that
1223+ :: fails, as 100 from 1000 or %1 from %1.0: the parser has taken that
1224+ :: token by the time it reaches the error, so the error token's text
1225+ :: begins at the error, column c, and its first character is the one
1226+ :: there (0 past the end of the text). The parser then never moves
1227+ :: it back (2.0, 2.8).
1228+ ::
1229+ ++ err-on
1230+ |= [c=@ud msg=tape]
1231+ ^+ cor
1232+ ?: (lth c col) (err c msg)
1233+ =/ rest=tape (slag (sub c col) cs)
1234+ (err-from c msg [lin c] ?~(rest 0 i.rest))
9591235 ::
9601236 :: +put: a token from beg to end on this line, with rest the text
9611237 :: after it, which starts at end
@@ -1013,19 +1289,20 @@
10131289 ?: =('%' a) (percent b c)
10141290 ?: =('=' a)
10151291 ?: |(=('<' b) =('>' b))
1016− %+ err col
1292+ %+ err +(col)
10171293 "`={[b ~]}` is left out: names never shadow, and `.` reads imports too"
10181294 ?: =('=' b)
1019− (err col "the closer `==` is left out: indentation covers it")
1295+ (err +(col) "the closer `==` is left out: indentation covers it")
10201296 (emit 1 %'=')
10211297 ?: =('`' a) (emit 1 %'`')
10221298 ?: =('*' a) (emit 1 %'*')
1299+ ?: =('_' a) (emit 1 %'_')
10231300 ?: =('~' a)
10241301 ?: =('[' b) (emit 2 %'~[')
10251302 ?: =('&' b) (emit 2 %'~&')
10261303 ?: =('|' b) (err +(col) "`~|` is left out: `~&` covers debugging")
10271304 =/ n=@ud (run-len t.cs knot-mask)
1028− ?: =(0 n) (emit 1 [%lit %null %n 0])
1305+ ?: =(0 n) (emit 1 [%lit %null %n 0 '~'])
10291306 (literal +(n))
10301307 ?: =('/' a)
10311308 ?: &(=(1 col) |(=('-' b) =('%' b) =('=' b)))
@@ -1046,23 +1323,25 @@
10461323 ?: =('-' b) (err +(col) "`|-` is left out: gates recurse by name")
10471324 (err +(col) "`|` begins `|=`, `|=(` or `|$`")
10481325 ?: =('$' a)
1049− ?: &(=('?' b) =('(' c)) (emit 3 %'$?(')
1050− ?: =('?' b) (emit 2 %'$?')
1326+ ?: =('?' b)
1327+ (err +(col) "`$?` is left out: a union is a `+$` with its cases below")
10511328 ?: &(=('-' b) =('(' c)) (emit 3 %'$-(')
10521329 ?: =('-' b)
10531330 (err (add 2 col) "`$-` has only the wide form `$-(sample product)`")
1054− ?: =('(' b) (err col "`$(…)` is left out: gates recurse by name")
1055− ?: =('%' b) (err +(col) "`$%` is left out: `$?` covers unions")
1056− (err +(col) "`$` begins `$?`, `$?(` or `$-(`")
1331+ ?: =('(' b) (err +(col) "`$(…)` is left out: gates recurse by name")
1332+ ?: =('%' b) (err +(col) "`$%` is left out: a union is a `+$` with its cases below")
1333+ (err +(col) "`$` begins `$-(`")
10571334 ?: =('^' a)
10581335 ?: =('-' b) (emit 2 %'^-')
10591336 (err +(col) "`^` begins `^-`")
10601337 ?: =('?' a)
10611338 ?: =('-' b) (emit 2 %'?-')
1062− ?: =('+' b) (err +(col) "`?+` is left out: `?-` is the branch")
10631339 ?: &(=(':' b) !=(':' c))
10641340 (err +(col) "`?:` is left out: `?-` is the branch")
10651341 ?: =('!' b) (err +(col) "`?!` is left out: eq and not are gates")
1342+ :: Hoon's other ? runes; nothing in Jibb goes tight after a ? mold
1343+ ?: (in b wut-mask)
1344+ (err +(col) "`?{[b ~]}` is left out: `?-` is the branch")
10661345 (emit 1 %'?')
10671346 ?: =('!' a)
10681347 ?: =('!' b) (emit 2 %'!!')
@@ -1088,6 +1367,9 @@
10881367 (err +(col) "`:~` is left out: indentation covers it; write ~[…]")
10891368 ?: =('*' b)
10901369 (err +(col) "`:*` is left out: indentation covers it; write […]")
1370+ ?: |(=('-' b) =('+' b) =('^' b) =('_' b))
1371+ %+ err +(col)
1372+ "`:{[b ~]}` is left out: indentation covers it; write a cell as [a b]"
10911373 ?: &(=(pend [lin col]) ?=([[* * ?([%name *] [%wing *])] *] out))
10921374 %+ err +(col)
10931375 %+ weld "`a:b` is left out: names never shadow, "
@@ -1104,6 +1386,8 @@
11041386 (err col "the closer `--` is left out: indentation covers it")
11051387 (err col (unexpected a))
11061388 ?: =(';' a)
1389+ ?: =(':' b)
1390+ (err col "`;:` is left out: nest the calls, as (add a (add b c))")
11071391 (err col "Sail's `;` runes are left out: layout is Jibb's elements")
11081392 ?: =('\'' a) (err col "there is no '…' form: strings are \"…\"")
11091393 ?: =('{' a)
@@ -1136,29 +1420,58 @@
11361420 ^+ cor
11371421 ?: =('/' b) segment:(emit 2 %'%/')
11381422 ?: =('.' b)
1139− ?: =('y' c) (emit 3 [%lit %loobean %f 0])
1140− ?: =('n' c) (emit 3 [%lit %loobean %f 1])
1423+ ?: =('y' c) (emit 3 [%lit %loobean %f 0 '%.y'])
1424+ ?: =('n' c) (emit 3 [%lit %loobean %f 1 '%.n'])
11411425 (err (add 2 col) "the loobeans are `%.y` and `%.n`")
1142− ?: =('&' b) (emit 2 [%lit %term %f 0])
1143− ?: =('|' b) (emit 2 [%lit %term %f 1])
1144− ?: =(':' b) (err +(col) "`%:` is left out: indentation covers it")
1426+ ?: =('&' b) (emit 2 [%lit %term %f 0 '%&'])
1427+ ?: =('|' b) (emit 2 [%lit %term %f 1 '%|'])
1428+ ?: =('$' b) (emit 2 [%lit %term %tas 0 '%$'])
1429+ ?: |(=(':' b) =('-' b) =('+' b) =('^' b) =('~' b))
1430+ %+ err +(col)
1431+ "`%{[b ~]}` is left out: indentation covers it; a call is (f a b)"
11451432 ?: =('=' b)
11461433 %+ err +(col)
11471434 "`%=` is left out: indentation covers it; write a change, as m(a=b)"
11481435 =/ rest=tape ?~(cs ~ t.cs)
11491436 ?: (is-lower b)
11501437 =/ n=@ud (run-len rest name-mask)
1151− => (emit +(n) [%lit %term %tas (crip (scag n rest))])
1438+ =/ nam=tape (scag n rest)
1439+ => (emit +(n) [%lit %term %tas (crip nam) (crip ['%' nam])])
11521440 ?. &(?=(^ cs) |((is-upper i.cs) =('_' i.cs))) cor
11531441 (err col "names are lowercase letters, digits and -")
1154− ?: (is-digit b)
1155− =/ n=@ud (run-len rest digit-mask)
1156− => (emit +(n) [%lit %term %ud (decimal (scag n rest))])
1157− ?. &(?=(^ cs) (in i.cs term-tail-mask)) cor
1158− %+ err col
1159− "unexpected `{[i.cs ~]}`: a numeric term is `%` and digits only, as %1000"
1442+ ?: (is-digit b) (numeric-term (scag (run-len rest number-mask) rest))
11601443 (err +(col) "`%` begins a term, a loobean or `%/`")
11611444 ::
1445+ :: +numeric-term: % and a decimal, whose run, the characters a number
1446+ :: literal's run takes, is run (2.6)
1447+ ::
1448+ :: The decimal is a number literal's (2.8): nuck:so reads the run,
1449+ :: and the error, if any, is where it stopped looking, one column on
1450+ :: for the %, so %1000 fails at its fourth digit as 1000 does. %0
1451+ :: alone is a term and no decimal goes on from its 0, so anything
1452+ :: after the 0 fails at once, as the x of %0x1f. Whatever was read
1453+ :: is a term token before the error token, as a number literal's is,
1454+ :: and the error token begins at the error (+err-on), so a place
1455+ :: that takes the term keeps the error there: `+$ x %1.0` fails at
1456+ :: 1:10, as `++ x %1.0` does.
1457+ ::
1458+ ++ numeric-term
1459+ |= run=tape
1460+ ^+ cor
1461+ =/ n=@ud (lent run)
1462+ =/ red=[used=@ud val=@ud at=@ud]
1463+ ?: =('0' ?~(run 0 i.run)) [1 0 (add 2 col)]
1464+ =/ ed=(like coin) (nuck:so [[lin +(col)] run])
1465+ ?~ q.ed [0 0 q.p.ed]
1466+ =/ con=coin p.u.q.ed
1467+ ?. ?=([%$ %ud @] con) [0 0 q.p.ed]
1468+ [(sub n (lent q.q.u.q.ed)) q.p.con q.p.ed]
1469+ =/ lex=lexeme
1470+ [%lit %term %ud val.red (crip ['%' (scag used.red run)])]
1471+ ?: =(used.red n) (emit +(n) lex)
1472+ ?: =(0 used.red) (err-from at.red term-msg [lin col] '%')
1473+ (err-on:(emit +(used.red) lex) at.red term-msg)
1474+ ::
11621475 :: +name: a name, or a wing, names joined by dots (2.6)
11631476 ::
11641477 ++ name
@@ -1207,9 +1520,20 @@
12071520 =/ run=tape (scag n cs)
12081521 =/ a=@ ?~(run 0 i.run)
12091522 =/ b=@ ?~(run 0 ?~(t.run 0 i.t.run))
1210− :: 0b 0c 0i 0w begin auras Jibb doesn't write, whatever follows
1523+ :: 0b 0c 0i 0w, ~- and ~~ begin auras Jibb doesn't write, whatever
1524+ :: follows; Hoon's reader of ~- (@c) crashes on a control character
12111525 ?: &(=('0' a) |(=('b' b) =('c' b) =('i' b) =('w' b)))
12121526 (err +(col) "Jibb writes no @u{[b ~]} literals")
1527+ ?: &(=('~' a) =('-' b)) (err +(col) "Jibb writes no @c literals")
1528+ ?: &(=('~' a) =('~' b))
1529+ (err +(col) "Jibb writes no @t literals; strings are \"…\"")
1530+ :: ~0 and a base-32 digit begin a blob, which Hoon's reader cues, and
1531+ :: cue can run out of memory, which nothing catches; no Jibb literal
1532+ :: goes on so (a date's year has no leading 0)
1533+ =/ c=@ ?~(run 0 ?~(t.run 0 ?~(t.t.run 0 i.t.t.run)))
1534+ ?: &(=('~' a) =('0' b) (in c b32-mask))
1535+ ?: (is-digit c) (err (add 2 col) (literal-msg run %da))
1536+ (err (add 2 col) "Jibb writes no blob literals")
12131537 :: a year BC that Hoon's dates can't hold, which its date code
12141538 :: crashes on: an error at the - that makes it BC
12151539 =/ bc=(unit [at=@ud y=@ud]) (year-bc col run)
@@ -1217,7 +1541,18 @@
12171541 (err at.u.bc "there is no year 0 BC: 1 BC is ~1-, as ~1-.1.1")
12181542 ?: &(?=(^ bc) (gth y.u.bc 292.277.024.401))
12191543 (err at.u.bc "Hoon's dates begin in 292.277.024.401 BC")
1220− =/ ed (nuck:so [[lin col] run])
1544+ :: a fifth sub-second group, which Hoon's +yule crashes on
1545+ =/ five=(unit @ud) (fifth-group run)
1546+ ?^ five
1547+ %+ err (add col u.five)
1548+ "a date or duration takes at most four sub-second groups"
1549+ :: Hoon's date code reads dates and durations, and has crashed on
1550+ :: forms the checks above now stop; it runs under mule, in case
1551+ =/ try=(each (like coin) tang)
1552+ ?. (is-time run) [%& (nuck:so [[lin col] run])]
1553+ (mule |.((nuck:so [[lin col] run])))
1554+ ?: ?=(%| -.try) (err col "Jibb can't read this literal")
1555+ =/ ed=(like coin) p.try
12211556 ?~ q.ed (err q.p.ed (literal-msg run %$))
12221557 =/ used=@ud (sub n (lent q.q.u.q.ed))
12231558 =/ con=coin p.u.q.ed
@@ -1228,7 +1563,7 @@
12281563 %+ err +(col)
12291564 %+ weld "Jibb writes no @{(trip p.p.con)} literals"
12301565 ?:(=(%t p.p.con) "; strings are \"…\"" "")
1231− =/ lex=lexeme [%lit u.form p.p.con q.p.con]
1566+ =/ lex=lexeme [%lit u.form p.p.con q.p.con (crip (scag used run))]
12321567 ?: =(used n)
12331568 ?. =(%ta p.p.con) (emit n lex)
12341569 :: a ~. knot is followed as a path segment is (2.7)
@@ -1245,7 +1580,9 @@
12451580 =? at &(=('~' a) (is-lower b) ?=(?(%n %p) p.p.con))
12461581 =/ dur=@ud ?:(|(=('d' b) =('h' b) =('m' b) =('s' b)) 2 1)
12471582 (min at (add col (max dur (ship-stop run))))
1248− (err:(emit used lex) at (literal-msg run p.p.con))
1583+ :: the run's first part is a token, which the parser takes before
1584+ :: it reaches the error, so the error token begins at the error
1585+ (err-on:(emit used lex) at (literal-msg run p.p.con))
12491586 ::
12501587 :: +text: a string's text, from its opening " or the } that closes
12511588 :: an interpolation, through the " or { that ends it (2.9). mid: it
@@ -1306,6 +1643,9 @@
13061643 ~
13071644::
13081645++ non-ascii "non-ASCII text outside a string or comment"
1646+++ term-msg
1647+ %+ weld "a numeric term is `%` and a decimal, "
1648+ "digits in groups of three joined by dots, as %1.000"
13091649++ bad-escape "a `\\` begins `\\\\`, `\\\"`, `\\\{` or two hex digits"
13101650++ bad-hex "a `\\` escape takes two lowercase hex digits, as `\\0a`"
13111651::
@@ -1324,8 +1664,32 @@
13241664:: after a path segment (2.7): printable, but not a knot character,
13251665:: / ( [ ) ] } or :
13261666++ seg-bad-mask 0x1800.0001.57ff.ffff.f800.1cfe.0000.0000
1327−:: after a numeric term: a-z A-Z _ - .
1328−++ term-tail-mask 0x7ff.fffe.87ff.fffe.0000.6000.0000.0000
1667+:: after a ? glyph, Hoon's ? runes but ?- ?: and ?! (2.6): + ~ = . @ ^ & | < >
1668+++ wut-mask 0x5000.0000.4000.0001.7000.4840.0000.0000
1669+:: base-32 digits: 0-9 a-v
1670+++ b32-mask 0x7f.fffe.0000.0000.03ff.0000.0000.0000
1671+::
1672+:: What may begin each place the parser reads (section 3, Errors):
1673+:: an expression a-z 0-9 " ( [ ~ % / ` | ^ ? !
1674+:: an operand a-z 0-9 " ( [ ~ % / ` | !
1675+:: a mold a-z A-Z @ * ! ? ~ % / ( [ $ _
1676+:: a pattern a-z 0-9 " ~ % * [
1677+:: and what may go tight after an operand: . ( + = after a name, a
1678+:: closer ) ] }, or the : of a comment
1679+::
1680+++ expr-mask 0x57ff.ffff.4800.0000.83ff.8126.0000.0000
1681+++ operand-mask 0x57ff.ffff.0800.0000.03ff.8126.0000.0000
1682+++ mold-mask 0x47ff.fffe.8fff.ffff.8000.8532.0000.0000
1683+++ bar-mask 0x1000.0000.0000.0000.0000.0000.0000.0000
1684+++ pattern-mask 0x47ff.fffe.0800.0000.03ff.0424.0000.0000
1685+++ after-mask 0x2000.0000.2000.0000.2400.4b00.0000.0000
1686+++ plus-mask 0x800.0000.0000 :: +
1687+++ cen-mask 0x20.0000.0000 :: %
1688+++ fas-mask 0x8000.0000.0000 :: /
1689+++ tis-mask 0x2000.0000.0000.0000 :: =
1690+++ pat-mask 0x1.0000.0000.0000.0000 :: @
1691+++ sel-mask 0x800.0000.0000.0000.0000.0000 :: [
1692+++ ser-mask 0x2000.0000.0000.0000.0000.0000 :: ]
13291693::
13301694:: +cont-mask: UTF-8 continuation bytes, 10xx.xxxx, which start no
13311695:: column (1)
@@ -1427,6 +1791,62 @@
14271791 ?. ?=([%'-' *] rest) ~
14281792 `[(add col +((lent ds))) (decimal ds)]
14291793::
1794+:: +fifth-group: where in a ~ literal's run, counting from its ~, the
1795+:: dot that begins a fifth sub-second group is, if the first four are
1796+:: well formed
1797+::
1798+:: Sub-seconds follow a duration's first .. or a date's second, as in
1799+:: ~s1..0000 and ~2026.10.23..14.30.00..0000: groups of four
1800+:: lowercase hex digits joined by dots. Hoon's reader takes any
1801+:: number, and its +yule crashes on a fifth (2.8).
1802+::
1803+++ fifth-group
1804+ |= run=tape
1805+ ^- (unit @ud)
1806+ =/ b=@ ?.(?=([%'~' @ *] run) 0 i.t.run)
1807+ =/ k=@ud
1808+ ?: (is-digit b) 2
1809+ ?:(|(=('d' b) =('h' b) =('m' b) =('s' b)) 1 0)
1810+ ?: =(0 k) ~
1811+ =/ past=(unit [i=@ud cs=tape]) (past-dots k 0 run)
1812+ ?~ past ~
1813+ =/ i=@ud i.u.past
1814+ =/ cs=tape cs.u.past
1815+ =/ g=@ud 1
1816+ |- ^- (unit @ud)
1817+ =/ quad=tape (scag 4 cs)
1818+ ?. &(=(4 (lent quad)) (levy quad is-hex)) ~
1819+ =. cs (slag 4 cs)
1820+ =. i (add 4 i)
1821+ ?. ?=([%'.' *] cs) ~
1822+ ?: =(4 g) `i
1823+ $(g +(g), i +(i), cs t.cs)
1824+::
1825+:: +past-dots: where the text past the k-th .. of cs starts, counting
1826+:: from i, and that text
1827+::
1828+++ past-dots
1829+ |= [k=@ud i=@ud cs=tape]
1830+ ^- (unit [i=@ud cs=tape])
1831+ ?~ cs ~
1832+ ?. &(=('.' i.cs) ?=(^ t.cs) =('.' i.t.cs))
1833+ $(i +(i), cs t.cs)
1834+ ?: =(1 k) `[(add 2 i) t.t.cs]
1835+ $(k (dec k), i (add 2 i), cs t.t.cs)
1836+::
1837+:: +is-time: whether a ~ literal's run starts as a date or a duration
1838+:: does, which Hoon's date code reads (2.8)
1839+::
1840+++ is-time
1841+ |= run=tape
1842+ ^- ?
1843+ ?. ?=([%'~' @ *] run) |
1844+ ?: (is-digit i.t.run) &
1845+ ?& |(=('d' i.t.run) =('h' i.t.run) =('m' i.t.run) =('s' i.t.run))
1846+ ?=([@ @ @ *] run)
1847+ (is-digit i.t.t.run)
1848+ ==
1849+::
14301850:: +ship-stop: how many characters of a ~ literal's run, from its ~,
14311851:: could still begin a ship (2.8)
14321852::
@@ -1544,11 +1964,8 @@
15441964 ^- @t
15451965 =/ kids=(list sexp)
15461966 (weld (turn imports.mod sexp-import) (turn defs.mod sexp-def))
1547− =/ lines=wall
1548− ?~ kids ~["(module)"]
1549− :- "(module"
1550− (close (zing (turn kids |=(k=sexp (render 2 k)))))
1551− (of-wain:format (turn lines crip))
1967+ ?~ kids '(module)'
1968+ (of-wain:format (render kids))
15521969::
15531970:: +show-error: "<file>:<line>:<col>: <message>", the line, a caret
15541971::
@@ -1595,6 +2012,7 @@
15952012 %indent "a deeper line"
15962013 %dedent "a shallower line"
15972014 %newline "a line at the same depth"
2015+ %'`' "`` ` ``"
15982016 ==
15992017 ?- -.x
16002018 %name "`{(trip p.x)}`"
@@ -1643,24 +2061,17 @@
16432061 ?~ t.ns (trip i.ns)
16442062 "{(trip i.ns)}.{$(ns t.ns)}"
16452063::
1646−:: +show-lit: a literal as Hoon prints it
2064+:: +show-lit: a literal as written for atoms read by nuck:so, whose
2065+:: printing differs between Hoon versions (@da), and for terms, whose
2066+:: one form is as written (%1.000); loobeans and ~ in their one form
16472067::
16482068++ show-lit
16492069 |= l=lit
16502070 ^- tape
16512071 ?- form.l
1652− %number (scow aura.l val.l)
1653− %ship (scow %p val.l)
1654− %date (scow %da val.l)
1655− %duration (scow %dr val.l)
1656− %knot (scow %ta val.l)
2072+ ?(%number %ship %date %duration %knot %term) (trip txt.l)
16572073 %loobean ?:(=(0 val.l) "%.y" "%.n")
16582074 %null "~"
1659− %term
1660− ?+ aura.l (weld "%" (trip val.l))
1661− %ud (weld "%" (a-co:co val.l))
1662− %f ?:(=(0 val.l) "%&" "%|")
1663− ==
16642075 ==
16652076::
16662077:: +show-quoted: text as a Jibb string, with \\ \" \{ and \XX escapes
@@ -1698,6 +2109,7 @@
16982109 ?- -.s
16992110 %knot (weld "/" (trip p.s))
17002111 %typed "/[{(trip name.s)}=@{(trip aura.s)}]"
2112+ %inferred "/[{(trip name.s)}=_]"
17012113 ==
17022114::
17032115++ show-tvars
@@ -1715,20 +2127,60 @@
17152127 [%node head=tape kids=(list sexp)]
17162128 ==
17172129::
1718−:: +render: a node as lines, at an indent
2130+:: +render: a module's kids as the tree's lines (4.2)
17192131::
1720−:: On one line when every kid is a leaf: an atom, or a node whose kids
1721−:: are all atoms (a string's text, a path's knots). Else each kid on
1722−:: its own lines, two spaces deeper.
2132+:: A node whose kids are all leaves goes on one line; else its head,
2133+:: then each kid a level deeper, and its ) at the end of its last
2134+:: kid's last line; (module …) always breaks. Each line is built once,
2135+:: from its depth: a line deeper than 64 levels keeps 64 levels'
2136+:: indent and says its depth, as |65| (group 3:1 …), so printing is
2137+:: linear in the tree's size however deep it nests. Each line becomes
2138+:: a cord as soon as it is built: as a tape, a character takes some
2139+:: 24 bytes, and holding the lines of a tree 100.000 levels deep made
2140+:: +golden half again as slow.
17232141::
17242142++ render
1725− |= [ind=@ud s=sexp]
1726− ^- wall
1727− =/ pad=tape (reap ind ' ')
1728− ?: ?=(%atom -.s) ~[(weld pad p.s)]
1729− ?: (levy kids.s is-leaf) ~[(weld pad (flat s))]
1730− :- "{pad}({head.s}"
1731− (close (zing (turn kids.s |=(k=sexp (render (add ind 2) k)))))
2143+ |= kids=(list sexp)
2144+ ^- wain
2145+ =/ acc=(list pline) ~[[0 "(module" 0]]
2146+ =. acc
2147+ |- ^- (list pline)
2148+ ?~ kids acc
2149+ $(kids t.kids, acc (put-sexp 1 i.kids acc))
2150+ (flop (turn (shut-last acc) |=(l=pline (crip (show-pline l)))))
2151+::
2152+:: +pline: a printed line: its depth, its text, and how many )s end it
2153+::
2154++$ pline [dep=@ud txt=tape shut=@ud]
2155+::
2156+:: +put-sexp: a node's lines at depth dep, last first, onto acc
2157+::
2158+++ put-sexp
2159+ |= [dep=@ud s=sexp acc=(list pline)]
2160+ ^- (list pline)
2161+ ?: ?=(%atom -.s) [[dep p.s 0] acc]
2162+ ?: (levy kids.s is-leaf) [[dep (flat s) 0] acc]
2163+ =/ ks=(list sexp) kids.s
2164+ =. acc [[dep "({head.s}" 0] acc]
2165+ |- ^- (list pline)
2166+ ?~ ks (shut-last acc)
2167+ $(ks t.ks, acc (put-sexp +(dep) i.ks acc))
2168+::
2169+:: +shut-last: one more ) at the end of the last line
2170+::
2171+++ shut-last
2172+ |= acc=(list pline)
2173+ ^- (list pline)
2174+ ?~ acc ~
2175+ [i.acc(shut +(shut.i.acc)) t.acc]
2176+::
2177+++ show-pline
2178+ |= l=pline
2179+ ^- tape
2180+ =/ pad=tape
2181+ ?: (lte dep.l 64) (reap (mul 2 dep.l) ' ')
2182+ "{(reap 128 ' ')}|{(a-co:co dep.l)}| "
2183+ :(weld pad txt.l (reap shut.l ')'))
17322184::
17332185++ is-leaf
17342186 |= s=sexp
@@ -1742,15 +2194,6 @@
17422194 ?: ?=(%atom -.s) p.s
17432195 "({head.s}{(zing (turn kids.s |=(k=sexp (weld " " (flat k)))))})"
17442196::
1745−:: +close: end the last line with )
1746−::
1747−++ close
1748− |= w=wall
1749− ^- wall
1750− ?~ w ~
1751− ?~ t.w ~[(weld i.w ")")]
1752− [i.w $(w t.w)]
1753−::
17542197:: +nod: a node's sexp: "kind line:col extra" and its kids
17552198::
17562199++ nod
@@ -1878,6 +2321,7 @@
18782321 %const (nod "const" at.s (show-lit lit.s) ~)
18792322 %ref (nod "ref" at.s (show-names names.s) ~)
18802323 %tvar (nod "tvar" at.s (trip name.s) ~)
2324+ %hole (nod "hole" at.s "" ~)
18812325 %path (nod "path" at.s (show-psegs segs.s) ~)
18822326 %apply (nod "apply" at.s (show-names ref.s) (turn args.s sexp-shape))
18832327 %cell (nod "cell" at.s "" (turn fields.s sexp-field))
@@ -1916,35 +2360,11596 @@
19162360::
19172361:: +fail: the error "expected <want>, found <the next token>"
19182362::
1919−:: At an error token, the layout pass's error instead (2.0). The token
1920−:: list always ends with NEWLINE or an error token (2.5), and the
1921−:: parser stops at either, so it never runs out; if it did, the error
1922−:: would sit at 1:1.
2363+:: At the layout pass's error instead (+lexer-error). The token list
2364+:: always ends with NEWLINE or an error token (2.5), and the parser
2365+:: stops at either, so it never runs out; if it did, the error would
2366+:: sit at 1:1.
19232367::
19242368++ fail
19252369 |= [file=path toks=(list token) want=tape]
19262370 ^- [%| p=error]
19272371 ?~ toks [%| file 1 1 "expected {want}, found the end of the tokens"]
1928− ?: ?=([%error *] lex.i.toks)
1929− [%| file line.beg.at.i.toks col.beg.at.i.toks p.lex.i.toks]
2372+ =/ lex=(unit error) (lexer-error file toks)
2373+ ?^ lex [%| u.lex]
19302374 =/ l=loc (where i.toks)
19312375 [%| file line.l col.l "expected {want}, found {(show-found i.toks)}"]
19322376::
1933−:: +fail-space: a tight form found a space before its next token
2377+:: +lexer-error: the layout pass's error, where the parser fails at it
2378+::
2379+:: At an error token, its error. At layout tokens followed by an error
2380+:: token whose text begins the line, both errors point at the line's
2381+:: start (+where), and the layout pass's message, about that text,
2382+:: says more: a line `==` closing a ?- is "the closer `==` is left
2383+:: out", not "expected the end of the body".
2384+::
2385+++ lexer-error
2386+ |= [file=path toks=(list token)]
2387+ ^- (unit error)
2388+ ?~ toks ~
2389+ ?: ?=([%error *] lex.i.toks)
2390+ `[file line.beg.at.i.toks col.beg.at.i.toks p.lex.i.toks]
2391+ ?. (is-layout i.toks) ~
2392+ =/ l=loc (where i.toks)
2393+ =/ rest=(list token) t.toks
2394+ |- ^- (unit error)
2395+ ?~ rest ~
2396+ ?: (is-layout i.rest) $(rest t.rest)
2397+ ?. ?=([%error *] lex.i.rest) ~
2398+ ?. =(l from.lex.i.rest) ~
2399+ `[file line.l col.l p.lex.i.rest]
2400+::
2401+:: +fail-in: +fail where the next token begins a place, such as an
2402+:: expression or a mold, whose first character is one of the mask can
2403+::
2404+:: The error points at the first character where the text stops being
2405+:: the start of any valid module (2.0), so at a token the place can't
2406+:: take, just past the part of it the place could: none if the place
2407+:: can't begin with its first character; a wing's first name, as in
2408+:: `++ a.b`, where a name goes; else that first character, as the ~ of
2409+:: ~zod where a mold goes (~ alone is one). At an error token whose
2410+:: text begins with a character the place can't, the error moves to
2411+:: that character, with the layout pass's message: `++ x @sd` fails
2412+:: at the @, since no expression begins with @, while `+$ x @sd`
2413+:: fails at the s. Every place that reaches this at a layout token
2414+:: needs text on its line, so the error is at the line's end
2415+:: (+fail-line): `++ x ^-` above a deeper line fails at 1:8.
2416+::
2417+++ fail-in
2418+ |= [file=path toks=(list token) want=tape can=@]
2419+ ^- [%| p=error]
2420+ ?~ toks (fail file toks want)
2421+ =* t i.toks
2422+ ?: ?=([%error *] lex.t)
2423+ :: a : could begin a comment anywhere, which this leaves out
2424+ ?: |(=(':' c.lex.t) (in c.lex.t can)) (fail file toks want)
2425+ [%| (moved file want t)]
2426+ ?: (is-layout t) (fail-line file toks want "")
2427+ =/ n=@ud (prefix t can)
2428+ =/ e=[%| p=error] (fail file toks want)
2429+ e(col.p (add n col.p.e))
2430+::
2431+:: +prefix: how many of the first characters of a token that a place
2432+:: can't take could still begin it, the place beginning with a
2433+:: character of the mask can (+fail-in)
2434+::
2435+++ prefix
2436+ |= [t=token can=@]
2437+ ^- @ud
2438+ ?. (in (first-char t) can) 0
2439+ ?. ?=([%wing *] lex.t) 1
2440+ ?~(p.lex.t 1 (met 3 i.p.lex.t))
2441+::
2442+:: +first-char: a token's first character, or one like it: a number
2443+:: begins with a digit, ~zod with ~ and %add with %
2444+::
2445+++ first-char
2446+ |= t=token
2447+ ^- @
2448+ =/ x=lexeme lex.t
2449+ ?@ x ?:(?=(?(%indent %dedent %newline) x) 0 (end 3 x))
2450+ ?- -.x
2451+ %name (end 3 p.x)
2452+ %wing ?~(p.x 0 (end 3 i.p.x))
2453+ %str '"'
2454+ %str-head '"'
2455+ %str-mid '}'
2456+ %str-tail '}'
2457+ %knot (end 3 p.x)
2458+ %aura '@'
2459+ %tvar (end 3 p.x)
2460+ %error c.x
2461+ ::
2462+ %lit
2463+ ?- form.p.x
2464+ %number '0'
2465+ ?(%term %loobean) '%'
2466+ ?(%ship %date %duration %knot %null) '~'
2467+ ==
2468+ ==
2469+::
2470+:: +fail-space: a tight form found no next token right after prev
19342471::
1935−:: The error sits where the space starts, just past prev, the token
1936−:: that needs its next one at once (section 3, Errors). If the next
1937−:: token is a layout or error token, it is +fail's error instead.
2472+:: The error sits just past prev, the token that needs its next one
2473+:: at once, where the space or the end of the line starts (section 3,
2474+:: Errors): no deeper line can supply a tight form's next token. So
2475+:: does an error token past a space or on a later line, whose error
2476+:: comes after. A tight error token's text begins right after prev,
2477+:: and its error is +fail's. why is a hint, if not empty.
19382478::
19392479++ fail-space
1940− |= [file=path prev=token toks=(list token) want=tape]
2480+ |= [file=path prev=token toks=(list token) want=tape why=tape]
19412481 ^- [%| p=error]
1942− ?: ?| ?=(~ toks)
1943− ?=(?(%indent %dedent %newline) lex.i.toks)
1944− ?=([%error *] lex.i.toks)
2482+ =/ at=loc end.at.prev
2483+ ?: &(?=(^ toks) ?=([%error *] lex.i.toks) =(at from.lex.i.toks))
2484+ (fail file toks want)
2485+ =/ found=tape
2486+ ?~ toks "the end of the file"
2487+ =* t i.toks
2488+ ?: (is-layout t)
2489+ ?:(=(beg.at.t end.at.t) "the end of the file" "the end of the line")
2490+ ?: &(?=([%error *] lex.t) !=(line.at line.from.lex.t))
2491+ "the end of the line"
2492+ "a space"
2493+ =/ msg=tape
2494+ "expected {want} right after {(show-found prev)}, found {found}"
2495+ [%| file line.at col.at ?~(why msg "{msg}; {why}")]
2496+::
2497+:: +fail-line: +fail where the place needs text on the line that toks
2498+:: ends, as a rune's mold or what a bracket that closes on its line
2499+:: still needs: at a layout token, at the end of that line, just past
2500+:: its last token, where the token's span starts, "found the end of the
2501+:: line", since no later line can supply it (2.0, section 3, Errors).
2502+:: At the end of the file that is where +fail puts it. why is a hint,
2503+:: if not empty, given only at the end of a line.
2504+::
2505+++ fail-line
2506+ |= [file=path toks=(list token) want=tape why=tape]
2507+ ^- [%| p=error]
2508+ ?. ?& ?=(^ toks)
2509+ (is-layout i.toks)
2510+ !=(beg.at.i.toks end.at.i.toks)
19452511 ==
19462512 (fail file toks want)
1947− :+ %| file
1948− :+ line.end.at.prev col.end.at.prev
1949− "expected {want} right after {(show-found prev)}, found a space"
2513+ =/ at=loc beg.at.i.toks
2514+ =/ msg=tape "expected {want}, found the end of the line"
2515+ [%| file line.at col.at ?~(why msg "{msg}; {why}")]
2516+::
2517+:: +fail-why: +fail with a hint after its message, "; <why>"
2518+::
2519+:: The layout pass's error (+lexer-error) stays as it is (2.0).
2520+::
2521+++ fail-why
2522+ |= [file=path toks=(list token) want=tape why=tape]
2523+ ^- [%| p=error]
2524+ =/ e=[%| p=error] (fail file toks want)
2525+ ?^ (lexer-error file toks) e
2526+ e(msg.p (weld msg.p.e "; {why}"))
2527+::
2528+:: +fail-in-why: +fail-in with a hint, as +fail-why
2529+::
2530+++ fail-in-why
2531+ |= [file=path toks=(list token) want=tape can=@ why=tape]
2532+ ^- [%| p=error]
2533+ =/ e=[%| p=error] (fail-in file toks want can)
2534+ ?: &(?=(^ toks) ?=([%error *] lex.i.toks)) e
2535+ ?^ (lexer-error file toks) e
2536+ e(msg.p (weld msg.p.e "; {why}"))
2537+::
2538+:: +tight-error: the error at an error token tight after an operand or
2539+:: an item, if its text's first character can't go there: the layout
2540+:: pass's message, at that character (+fail-in)
2541+::
2542+:: What may go tight after an item is a closer, a comment's :, or,
2543+:: after a name, the ( . + or = of a change, a wing, a pair or a face
2544+:: (after-mask, which doesn't look at what the item was).
2545+::
2546+++ tight-error
2547+ |= [file=path toks=(list token)]
2548+ ^- (unit error)
2549+ (tight-error-in file toks after-mask)
2550+::
2551+:: +tight-error-in: +tight-error where what may go tight is can, as no
2552+:: = goes tight after a call's operand, which takes no face
2553+::
2554+++ tight-error-in
2555+ |= [file=path toks=(list token) can=@]
2556+ ^- (unit error)
2557+ ?. ?=([[* %& [%error *]] *] toks) ~
2558+ ?: (in c.lex.i.toks can) ~
2559+ `(moved file "a space between items" i.toks)
2560+::
2561+:: +moved: an error token's error, moved to the first character of the
2562+:: text it was reading, which can't go where it is (+fail-in): "expected
2563+:: <want>, found <that character>; <the layout pass's message>"
2564+::
2565+++ moved
2566+ |= [file=path want=tape t=token]
2567+ ^- error
2568+ ?. ?=([%error *] lex.t) [file line.beg.at.t col.beg.at.t "expected {want}"]
2569+ =* x lex.t
2570+ ?: =(from.x beg.at.t) [file line.from.x col.from.x p.x]
2571+ =/ what=tape ?:(=('"' c.x) "a string" "`{[c.x ~]}`")
2572+ [file line.from.x col.from.x "expected {want}, found {what}; {p.x}"]
2573+::
2574+:: Token tests for the parser
2575+::
2576+:: +is-layout: INDENT, DEDENT or NEWLINE
2577+::
2578+++ is-layout
2579+ |= t=token
2580+ ^- ?
2581+ ?=(?(%indent %dedent %newline) lex.t)
2582+::
2583+:: +is-closer: ) or ], or the } that ends an interpolation
2584+::
2585+++ is-closer
2586+ |= t=token
2587+ ^- ?
2588+ ?| =(%')' lex.t)
2589+ =(%']' lex.t)
2590+ ?=([?(%str-mid %str-tail) *] lex.t)
2591+ ==
2592+::
2593+:: +ends-call: a token that ends a call, or the operands on a group's
2594+:: first line, without an error of their own: a layout token, a
2595+:: closer, or the layout pass's error
2596+::
2597+++ ends-call
2598+ |= t=token
2599+ ^- ?
2600+ ?| (is-layout t)
2601+ (is-closer t)
2602+ ?=([%error *] lex.t)
2603+ ==
2604+::
2605+:: +tail-can: what may begin text that goes on, on its line, after an
2606+:: expression: more operands, as after a call or !!, or after a rune
2607+:: what may go on after its last part (+bad-end-in)
2608+::
2609+++ tail-can
2610+ |= e=expr
2611+ ^- @
2612+ ?+ -.e operand-mask
2613+ %cast $(e val.e)
2614+ %gate $(e body.e)
2615+ ==
2616+::
2617+:: +def-can: +tail-can after a definition: nothing after a mold
2618+::
2619+++ def-can
2620+ |= d=def
2621+ ^- @
2622+ ?- -.d
2623+ %mold 0
2624+ %value (tail-can val.d)
2625+ ==
2626+::
2627+:: +is-operand-start: a token an operand starts with; where an operand
2628+:: goes, |= is the constructor's (section 3)
2629+::
2630+++ is-operand-start
2631+ |= t=token
2632+ ^- ?
2633+ ?| ?=(?(%'%/' %'/' %'`' %'(' %'~[' %'[' %'|=(' %'|=' %'!!') lex.t)
2634+ ?=([?(%lit %str %str-head %name %wing) *] lex.t)
2635+ ==
2636+::
2637+:: +is-rune: a rune that is never an operand: ^- ~& ?-
2638+::
2639+++ is-rune
2640+ |= t=token
2641+ ^- ?
2642+ ?=(?(%'^-' %'~&' %'?-') lex.t)
2643+::
2644+:: +is-ctor: |= with a term tight after it, a case's constructor
2645+::
2646+++ is-ctor
2647+ |= ts=(list token)
2648+ ^- ?
2649+ ?=([[* * %'|='] [* %& [%lit %term *]] *] ts)
2650+::
2651+:: +is-rune-start: a rune where an expression starts; |= is a rune
2652+:: there unless it is the constructor
2653+::
2654+++ is-rune-start
2655+ |= ts=(list token)
2656+ ^- ?
2657+ ?~ ts |
2658+ ?| (is-rune i.ts)
2659+ &(=(%'|=' lex.i.ts) !(is-ctor ts))
2660+ ==
2661+::
2662+:: +text-piece: a string's text as its pieces: none when it is empty
2663+::
2664+++ text-piece
2665+ |= txt=@t
2666+ ^- (list piece)
2667+ ?:(=('' txt) ~ ~[[%text txt]])
2668+::
2669+:: +names-of: a name's or a wing's names
2670+::
2671+++ names-of
2672+ |= x=lexeme
2673+ ^- (list term)
2674+ ?+ x ~
2675+ [%name *] ~[p.x]
2676+ [%wing *] p.x
2677+ ==
2678+::
2679+:: +call-of: a call's elements as one expression: one alone is itself
2680+::
2681+++ call-of
2682+ |= els=(list expr)
2683+ ^- expr
2684+ ?~ els [%crash *span ~]
2685+ ?~ t.els i.els
2686+ [%call [beg:(span-of i.els) end:(span-of (rear t.els))] i.els t.els]
2687+::
2688+:: +bracket-node: a tuple, list or change from its items, ending at fin
2689+::
2690+++ bracket-node
2691+ |= $: kind=?(%tuple %list %change)
2692+ op=token
2693+ target=(unit [t=token names=(list term)])
2694+ its=(list item)
2695+ fin=loc
2696+ ==
2697+ ^- expr
2698+ ?- kind
2699+ %tuple [%tuple [beg.at.op fin] its]
2700+ %list [%list [beg.at.op fin] (turn its |=(i=item val.i))]
2701+ ::
2702+ %change
2703+ =/ beg=loc ?~(target beg.at.op beg.at.t.u.target)
2704+ :^ %change [beg fin] ?~(target ~ names.u.target)
2705+ (turn its |=(i=item ^-(edit [at.i ?~(face.i %$ u.face.i) val.i])))
2706+ ==
2707+::
2708++| %parser
2709+::
2710+:: +parser: section 3's recursive descent over one file's tokens
2711+::
2712+:: Each +read- arm reads one rule of the EBNF from the head of the
2713+:: tokens it is given and returns (pare node): the node and the
2714+:: tokens after it, or the first error. It decides by the next token,
2715+:: at most with the one after it and whether that one is tight
2716+:: (section 3), so it never backtracks. A loop over items is a trap
2717+:: whose every step, through +then, is a tail call, so a long module
2718+:: grows no stack; only nesting does, and a line's nesting is bounded
2719+:: by its length. all is the whole token list, which only errors
2720+:: read (+stray).
2721+::
2722+++ parser
2723+ |_ [file=path all=(list token)]
2724+ ::
2725+ :: +bad: "expected <want>, found <the next token>" (+fail)
2726+ ::
2727+ ++ bad
2728+ |= [ts=(list token) want=tape]
2729+ ^- [%| p=error]
2730+ (fail file ts want)
2731+ ::
2732+ :: +bad-why: +bad with a hint (+fail-why)
2733+ ::
2734+ ++ bad-why
2735+ |= [ts=(list token) want=tape why=tape]
2736+ ^- [%| p=error]
2737+ (fail-why file ts want why)
2738+ ::
2739+ :: +bad-in: +bad where a place begins whose first characters are the
2740+ :: mask can (+fail-in)
2741+ ::
2742+ ++ bad-in
2743+ |= [ts=(list token) want=tape can=@]
2744+ ^- [%| p=error]
2745+ (fail-in file ts want can)
2746+ ::
2747+ :: +bad-in-why: +bad-in with a hint (+fail-in-why)
2748+ ::
2749+ ++ bad-in-why
2750+ |= [ts=(list token) want=tape can=@ why=tape]
2751+ ^- [%| p=error]
2752+ (fail-in-why file ts want can why)
2753+ ::
2754+ :: +bad-space: a tight form that found no next token right after prev
2755+ :: (+fail-space)
2756+ ::
2757+ ++ bad-space
2758+ |= [prev=token ts=(list token) want=tape]
2759+ ^- [%| p=error]
2760+ (fail-space file prev ts want "")
2761+ ::
2762+ :: +bad-at: an error inside a token, or at the end of a line
2763+ ::
2764+ ++ bad-at
2765+ |= [at=loc msg=tape]
2766+ ^- [%| p=error]
2767+ [%| file line.at col.at msg]
2768+ ::
2769+ :: +closing: what a bracket op still needs, its closer close
2770+ ::
2771+ ++ closing
2772+ |= [op=token close=tape]
2773+ ^- tape
2774+ "`{close}` to close the {(show-found op)} at {(show-loc beg.at.op)}"
2775+ ::
2776+ :: +bad-end: a line that should end and goes on, after a call
2777+ ::
2778+ ++ bad-end
2779+ |= ts=(list token)
2780+ ^- [%| p=error]
2781+ (bad-end-in ts operand-mask)
2782+ ::
2783+ :: +bad-end-in: +bad-end after a construct that text beginning with
2784+ :: a character of the mask can could still go on, as more operands go
2785+ :: on a call; at an error token whose text can't, at that text's
2786+ :: start (+fail-in): +$ x @ ?: fails at the ?
2787+ ::
2788+ ++ bad-end-in
2789+ |= [ts=(list token) can=@]
2790+ ^- [%| p=error]
2791+ =/ want=tape "the end of the line"
2792+ ?: ?=([[* * %indent] *] ts)
2793+ %^ bad-why ts want
2794+ %+ weld "only a bracket open at the end of a line, "
2795+ "or a rune's body, takes deeper lines"
2796+ ?: &(?=(^ ts) (stray i.ts))
2797+ (bad-why ts want "this {(show-found i.ts)} closes no bracket")
2798+ ?. ?=([[* * [%error *]] *] ts) (bad ts want)
2799+ =/ ok=@ ?:(tight.i.ts after-mask can)
2800+ ?: |(=(':' c.lex.i.ts) (in c.lex.i.ts ok)) (bad ts want)
2801+ [%| (moved file want i.ts)]
2802+ ::
2803+ :: +no-gap: a token tight where a space goes, after a rune, a name, a
2804+ :: sample or a pattern; at an error token, whose text can't go tight
2805+ :: there unless it is a comment's :, at that text's start (+fail-in)
2806+ ::
2807+ ++ no-gap
2808+ |= [ts=(list token) want=tape]
2809+ ^- [%| p=error]
2810+ ?. &(?=([[* * [%error *]] *] ts) !=(':' c.lex.i.ts)) (bad ts want)
2811+ [%| (moved file want i.ts)]
2812+ ::
2813+ :: +no-space: a token tight after an item, where a space goes
2814+ ::
2815+ ++ no-space
2816+ |= ts=(list token)
2817+ ^- [%| p=error]
2818+ =/ te=(unit error) (tight-error file ts)
2819+ ?^ te [%| u.te]
2820+ ?. ?=([[* * %'='] *] ts) (bad ts "a space between items")
2821+ %^ bad-why ts "a space between items"
2822+ "`name=value` goes in a cell, as [a=1], or a change, as m(a=1)"
2823+ ::
2824+ :: +no-space-pattern: +no-space in a cell pattern
2825+ ::
2826+ ++ no-space-pattern
2827+ |= ts=(list token)
2828+ ^- [%| p=error]
2829+ ?. ?=([[* * %'='] *] ts) (no-space ts)
2830+ %^ bad-why ts "a space between items"
2831+ "patterns take no `name=`: a bare name binds, as [a b]"
2832+ ::
2833+ :: +no-operand: a token where an expression or an operand goes that
2834+ :: starts none (can: what may start one), with a hint for the left-out
2835+ :: forms the lexer can't see (2.6) and other likely slips
2836+ ::
2837+ ++ no-operand
2838+ |= [ts=(list token) can=@]
2839+ ^- [%| p=error]
2840+ =/ want=tape "an expression"
2841+ ?: ?=([[* * %'='] [* %& %'('] *] ts)
2842+ (bad-why ts want "`=(a b)` is left out: eq is a gate")
2843+ ?: ?=([[* * %'='] [* %& %'/'] *] ts)
2844+ (bad-why ts want "`=/` is left out: `++` defines values")
2845+ ?: ?=([[* * %'='] [* %& %'+'] *] ts)
2846+ (bad-why ts want "`=+` is left out: `++` defines values")
2847+ ?: ?=([[* * %'='] [* %& %'?'] *] ts)
2848+ (bad-why ts want "`=?` is left out: `++` defines values")
2849+ ?: ?& ?=([[* * %'='] [* %& [%error *]] *] ts)
2850+ =('.' c.lex.i.t.ts)
2851+ ==
2852+ (bad-why ts want "`=.` is left out: `++` defines values")
2853+ ?: ?=([[* * %'*'] *] ts)
2854+ (bad-why ts want "`*mold` is left out: no defaults")
2855+ ?: ?=([[* * %'+'] *] ts)
2856+ (bad-why ts want "a pair takes no spaces, as gap+%s2")
2857+ ?: ?=([[* * %'?'] *] ts)
2858+ %: bad-in-why ts want can
2859+ "`?` alone is the loobean mold, and `?-` the branch"
2860+ ==
2861+ ?: &(?=(^ ts) (is-rune i.ts))
2862+ (bad-in-why ts want can "a rune here goes in parentheses")
2863+ ?: &(?=(^ ts) (stray i.ts))
2864+ (bad-why ts want "this {(show-found i.ts)} closes no bracket")
2865+ (bad-in ts want can)
2866+ ::
2867+ :: +no-name: a token where a name goes that isn't one
2868+ ::
2869+ ++ no-name
2870+ |= ts=(list token)
2871+ ^- [%| p=error]
2872+ ?: ?=([[* * [%tvar *]] *] ts)
2873+ (bad-why ts "a name" "a name starts with a lowercase letter")
2874+ ?: ?=([[* * [%wing *]] *] ts)
2875+ (bad-in-why ts "a name" lower-mask "a name has no `.`")
2876+ (bad-in ts "a name" lower-mask)
2877+ ::
2878+ :: +unclosed: where the closer of the bracket op opened should be, once
2879+ :: it holds all it needs (+unclosed-want)
2880+ ::
2881+ ++ unclosed
2882+ |= [op=token close=tape ts=(list token)]
2883+ ^- [%| p=error]
2884+ (unclosed-want (closing op close) ts)
2885+ ::
2886+ :: +unclosed-want: what a bracket still needs where ts begins, want:
2887+ :: its closer once it is complete, else its next part, as "a mold,
2888+ :: the product" in $-(@. At a layout token, the bracket being one
2889+ :: that closes on its line, the error is at the end of that line,
2890+ :: as no later line can close it (+fail-line)
2891+ ::
2892+ ++ unclosed-want
2893+ |= [want=tape ts=(list token)]
2894+ ^- [%| p=error]
2895+ (fail-line file ts want "this bracket closes on its line")
2896+ ::
2897+ :: +bad-line: +bad where what is wanted goes on the line (+fail-line)
2898+ ::
2899+ ++ bad-line
2900+ |= [ts=(list token) want=tape]
2901+ ^- [%| p=error]
2902+ (fail-line file ts want "")
2903+ ::
2904+ :: +unclosed-open: a bracket that may be left open, whose line ends
2905+ :: with neither its closer nor deeper lines, nor an item that took
2906+ :: them (+shut); noun names its items
2907+ ::
2908+ ++ unclosed-open
2909+ |= [op=token close=tape noun=tape ts=(list token)]
2910+ ^- [%| p=error]
2911+ ?. ?=([[* * ?(%newline %dedent)] *] ts) (unclosed op close ts)
2912+ (bad ts "`{close}` or {noun} on a deeper line")
2913+ ::
2914+ :: +wide-rune: a rune followed tight; txt( is a left-out wide form
2915+ ::
2916+ ++ wide-rune
2917+ |= [txt=tape ts=(list token)]
2918+ ^- [%| p=error]
2919+ =/ want=tape "a space after `{txt}`"
2920+ ?. ?=([[* * %'('] *] ts) (no-gap ts want)
2921+ %^ bad-why ts want
2922+ "the wide form `{txt}(…)` is left out: indentation covers it"
2923+ ::
2924+ :: +unnamed: a change's item or line without its name=
2925+ ::
2926+ :: A name could still begin one, so the error is just past it, as
2927+ :: a tight form's is (+fail-space): `m(b c)` at the space, `m(b)`
2928+ :: at the ). So is an error token's text there, unless it begins
2929+ :: with the =: `m(a"x)` at the ", with the layout pass's message
2930+ :: after the parser's (+moved), but `m(a==1)` at the lexer's error,
2931+ :: the second =. So is a wing's first name: `m(a.b=1)` fails at the
2932+ :: dot (+fail-in). At an error token whose text can't begin a name,
2933+ :: at that text, as `m( @sd` at the @ (+fail-in).
2934+ ::
2935+ ++ unnamed
2936+ |= ts=(list token)
2937+ ^- [%| p=error]
2938+ =/ why=tape "a change's items are named, as in m(done=%.y)"
2939+ ?: ?=([[* * [%error *]] *] ts) (bad-in ts "a named item" lower-mask)
2940+ ?: ?=([[* * [%wing *]] *] ts)
2941+ (bad-in-why ts "a named item" lower-mask why)
2942+ ?. ?=([[* * [%name *]] *] ts) (bad-why ts "a named item" why)
2943+ =/ want=tape "`=` right after {(show-found i.ts)}"
2944+ ?: ?& ?=([* [* * [%error *]] *] ts)
2945+ =(end.at.i.ts from.lex.i.t.ts)
2946+ !=('=' c.lex.i.t.ts)
2947+ ==
2948+ [%| (moved file want i.t.ts)]
2949+ ?: &(?=([* [* %& *] *] ts) !?=([* [* * [%error *]] *] ts))
2950+ (bad-why t.ts want why)
2951+ (fail-space file i.ts t.ts "`=`" why)
2952+ ::
2953+ :: +doomed: where a part of a line, read from ts up to after, took
2954+ :: the deeper lines while what holds it needs more: deeper lines of
2955+ :: its own (a rune's body or arms), a part after it (the body of
2956+ :: |=(, the product of $-(), or the } of an interpolation, which
2957+ :: closes on its line (2.9). A bracket that needs none of these
2958+ :: closes with the deeper lines instead (+shut). No later line can
2959+ :: give it that, so the error is at the end of the line that took
2960+ :: them (section 3, Errors). want is what it needs. Only an error path
2961+ :: calls this, and it looks only when after begins with NEWLINE or
2962+ :: DEDENT, so it costs nothing on the way to a tree.
2963+ ::
2964+ ++ doomed
2965+ |= [ts=(list token) after=(list token) want=tape]
2966+ ^- (unit [%| p=error])
2967+ ?. ?=([[* * ?(%newline %dedent)] *] after) ~
2968+ =/ ind=(unit token) (took ts after)
2969+ ?~ ind ~
2970+ :- ~
2971+ %+ bad-at beg.at.u.ind
2972+ ;: weld
2973+ "expected {want}, found the end of the line; the deeper lines "
2974+ "go to the last bracket or rune left open on this line"
2975+ ==
2976+ ::
2977+ :: +shut: whether the bracket op closes before ts with no closer, as
2978+ :: a bracket left open before the last bracket or rune on its line
2979+ :: does: ts begins a line that isn't deeper, and the bracket's last
2980+ :: item, whose span is last, took the deeper lines (section 3)
2981+ ::
2982+ :: An item ends on a later line than op only if it read the deeper
2983+ :: lines, as no token crosses a line. So this looks at no token but
2984+ :: the next, and brackets nested on one line that close together
2985+ :: cost one test each.
2986+ ::
2987+ ++ shut
2988+ |= [op=token last=(unit span) ts=(list token)]
2989+ ^- ?
2990+ ?~ last |
2991+ ?& ?=([[* * ?(%newline %dedent)] *] ts)
2992+ (gth line.end.u.last line.beg.at.op)
2993+ ==
2994+ ::
2995+ :: +took: the INDENT among the tokens from ts up to after, if any
2996+ ::
2997+ ++ took
2998+ |= [ts=(list token) after=(list token)]
2999+ ^- (unit token)
3000+ ?~ after ~
3001+ =/ stop=loc beg.at.i.after
3002+ |- ^- (unit token)
3003+ ?~ ts ~
3004+ ?. (loc-lth beg.at.i.ts stop) ~
3005+ ?: ?=(%indent lex.i.ts) `i.ts
3006+ $(ts t.ts)
3007+ ::
3008+ :: +stray: whether a ) or ] closes no bracket opened before it on its
3009+ :: line, or none inside the interpolation it is in
3010+ ::
3011+ ++ stray
3012+ |= t=token
3013+ ^- ?
3014+ ?. ?=(?(%')' %']') lex.t) |
3015+ =| open=(list ?)
3016+ =/ ts=(list token) all
3017+ |- ^- ?
3018+ ?~ ts |
3019+ =* u i.ts
3020+ ?: =(at.u at.t) |(?=(~ open) !i.open)
3021+ ?: (is-layout u) $(ts t.ts, open ~)
3022+ ?: ?=(?(%'(' %'[' %'~[' %'|=(' %'$-(') lex.u)
3023+ $(ts t.ts, open [& open])
3024+ ?: ?=([%str-head *] lex.u) $(ts t.ts, open [| open])
3025+ ?: ?=([%str-mid *] lex.u) $(ts t.ts, open [| ?~(open ~ t.open)])
3026+ ?: |(?=(?(%')' %']') lex.u) ?=([%str-tail *] lex.u))
3027+ $(ts t.ts, open ?~(open ~ t.open))
3028+ $(ts t.ts)
3029+ ::
3030+ :: +read-module: { import NEWLINE } { definition NEWLINE }, then the
3031+ :: end of the tokens
3032+ ::
3033+ ++ read-module
3034+ |= ts=(list token)
3035+ ^- (each module error)
3036+ =| ims=(list import)
3037+ |- ^- (each module error)
3038+ ?: ?=([[* * ?(%'/-' %'/%' %'/=')] *] ts)
3039+ ;< [im=import after=(list token)] then (read-import ts)
3040+ ?. ?=([[* * %newline] *] after) (bad-end-in after 0)
3041+ $(ims [im ims], ts t.after)
3042+ =| defs=(list def)
3043+ |- ^- (each module error)
3044+ ?~ ts [%& (flop ims) (flop defs)]
3045+ ?: ?=([[* * ?(%'/-' %'/%' %'/=')] *] ts)
3046+ (bad-why ts "a definition" "imports come first")
3047+ :: what may begin the line: a definition, or before any, an import
3048+ =/ can=@ ?~(defs (con plus-mask fas-mask) plus-mask)
3049+ ;< [d=def after=(list token)] then (read-def ts can)
3050+ ?. ?=([[* * %newline] *] after) (bad-end-in after (def-can d))
3051+ $(defs [d defs], ts t.after)
3052+ ::
3053+ :: +read-import: /- name, /% term, or /= name pathlit
3054+ ::
3055+ ++ read-import
3056+ |= ts=(list token)
3057+ ^- (pare import)
3058+ ?~ ts (bad ts "an import")
3059+ =* g i.ts
3060+ =/ rest=(list token) t.ts
3061+ ?: &(?=(^ rest) tight.i.rest)
3062+ (no-gap rest "a space after {(show-found g)}")
3063+ ?: =(%'/%' lex.g)
3064+ ?: ?=([[* * [%lit %term %tas *]] *] rest)
3065+ ?: =(0 val.p.lex.i.rest)
3066+ (bad-in rest "a mark's term, as `%todo-action`" cen-mask)
3067+ [%& [%mark [beg.at.g end.at.i.rest] val.p.lex.i.rest] t.rest]
3068+ =/ want=tape "a mark's term, as `%todo-action`"
3069+ ?. ?=([[* * [%name *]] *] rest) (bad-in rest want cen-mask)
3070+ (bad-why rest want "`/%` takes no face: it names the type after its mark")
3071+ ?. ?=([[* * [%name *]] *] rest) (no-name rest)
3072+ =* nam i.rest
3073+ ?. =(%'/=' lex.g)
3074+ [%& [%sur [beg.at.g end.at.nam] p.lex.nam] t.rest]
3075+ =/ more=(list token) t.rest
3076+ ?: &(?=(^ more) tight.i.more) (no-gap more "a space after the name")
3077+ ?. ?=([[* * %'/'] *] more)
3078+ (bad-in more "a module's path, as /ui/components/card" fas-mask)
3079+ ;< [[sp=span segs=(list @ta)] after=(list token)] then
3080+ (read-pathlit i.more t.more |)
3081+ [%& [%jibb [beg.at.g end.sp] p.lex.nam segs] after]
3082+ ::
3083+ :: +read-pathlit: after a path's /, its knots, each after a tight /
3084+ :: and tight itself; / alone is the empty path where empty allows it,
3085+ :: in an expression but not an import (doc question)
3086+ ::
3087+ ++ read-pathlit
3088+ |= [sl=token ts=(list token) empty=?]
3089+ ^- (pare [span (list @ta)])
3090+ ?. ?=([[* %& [%knot *]] *] ts)
3091+ ?: &(?=(^ ts) tight.i.ts !(is-closer i.ts))
3092+ (bad ts "a path segment")
3093+ ?. empty (bad-space sl ts "a path segment")
3094+ [%& [at.sl ~] ts]
3095+ =/ segs=(list @ta) ~[p.lex.i.ts]
3096+ =/ fin=loc end.at.i.ts
3097+ =/ rest=(list token) t.ts
3098+ |- ^- (pare [span (list @ta)])
3099+ ?. ?=([[* %& %'/'] *] rest)
3100+ [%& [[beg.at.sl fin] (flop segs)] rest]
3101+ =/ nex=(list token) t.rest
3102+ ?: ?=([[* %& [%knot *]] *] nex)
3103+ $(segs [p.lex.i.nex segs], fin end.at.i.nex, rest t.nex)
3104+ ?: &(?=(^ nex) tight.i.nex) (bad nex "a path segment")
3105+ (bad-space i.rest nex "a path segment")
3106+ ::
3107+ :: +read-def: ++ name, then an expression or a body; +$ name, then a
3108+ :: mold on its line or cases on deeper lines. can is what may begin
3109+ :: a line where a definition goes (+fail-in).
3110+ ::
3111+ ++ read-def
3112+ |= [ts=(list token) can=@]
3113+ ^- (pare def)
3114+ ?~ ts (bad ts "a definition")
3115+ =* rune i.ts
3116+ ?: =(%'++' lex.rune)
3117+ ;< [nam=term after=(list token)] then (read-def-name rune t.ts)
3118+ ;< [e=expr more=(list token)] then
3119+ (read-expr-or-body "the name" after)
3120+ [%& [%value [beg.at.rune end:(span-of e)] nam e] more]
3121+ ?: (is-closer rune)
3122+ %^ bad-why ts "a definition"
3123+ "this closes no bracket, as one open at the end of its line needs none"
3124+ =/ want=tape
3125+ ?.((in '/' can) "a definition" "an import or a definition")
3126+ ?: =(%'+' lex.rune)
3127+ (bad-in-why ts want can "`+` begins `++` or `+$`")
3128+ ?. =(%'+$' lex.rune) (bad-in ts want can)
3129+ ;< [nam=term after=(list token)] then (read-def-name rune t.ts)
3130+ ?: &(?=(^ after) tight.i.after)
3131+ (no-gap after "a space after the name")
3132+ ?: ?=([[* * [%error *]] *] after)
3133+ (bad-in after "a mold" (con mold-mask bar-mask))
3134+ ?: ?=([[* * ?(%'|=' %'|=(')] *] after)
3135+ %: bad-in-why after "a mold" (con mold-mask bar-mask)
3136+ "a gate's mold is $-(sample product)"
3137+ ==
3138+ ;< [s=shape more=(list token)] then
3139+ ?: ?=([[* * %'|$'] *] after)
3140+ (read-generic i.after t.after)
3141+ (read-def-body after)
3142+ [%& [%mold [beg.at.rune end:(span-of s)] nam s] more]
3143+ ::
3144+ :: +hoon-union: a tight ( immediately after a ? mold
3145+ ::
3146+ ++ hoon-union
3147+ |= [ts=(list token) after=(list token)]
3148+ ^- ?
3149+ ?. ?=([[* %& %'('] *] after) |
3150+ |- ^- ?
3151+ ?~ ts |
3152+ ?: =(t.ts after) =(%'?' lex.i.ts)
3153+ $(ts t.ts)
3154+ ::
3155+ :: +read-def-body: one mold on the definition line or its cases below
3156+ ::
3157+ ++ read-def-body
3158+ |= ts=(list token)
3159+ ^- (pare shape)
3160+ ?. ?=([[* * %indent] *] ts)
3161+ ?: ?=([[* * ?(%newline %dedent)] *] ts)
3162+ (bad ts "a mold, on its line or a deeper one")
3163+ ;< [s=shape more=(list token)] then (read-mold ts)
3164+ ?: (hoon-union ts more)
3165+ (bad-why more "the end of the line" "a union is a `+$` with its cases below")
3166+ ?: ?=([[* * %indent] *] more)
3167+ %^ bad-why more "the end of the line"
3168+ "a `+$` takes one mold on its line or its cases below, not both"
3169+ [%& s more]
3170+ =| cs=(list shape)
3171+ =/ rest=(list token) t.ts
3172+ |- ^- (pare shape)
3173+ ;< [c=shape after=(list token)] then (read-mold rest)
3174+ ?: (hoon-union rest after)
3175+ (bad-why after "the end of the line" "a union is a `+$` with its cases below")
3176+ ?: ?=([[* * %newline] *] after) $(cs [c cs], rest t.after)
3177+ ?: ?=([[* * %dedent] *] after)
3178+ ?~ cs [%& c t.after]
3179+ =/ cases=(list shape) (flop [c cs])
3180+ [%& [%union [beg:(span-of (rear cs)) end:(span-of c)] cases] t.after]
3181+ ?: ?=([[* * %'='] *] after)
3182+ %^ bad-why after "the end of the line"
3183+ "a `+$`'s lines below are its cases; a record's fields go in a [ left open on the `+$` line"
3184+ ?: ?=([[* * %indent] *] after) (bad-end after)
3185+ ?: &(?=(^ after) (stray i.after)) (bad-end after)
3186+ (bad-why after "the end of the line" "a union takes one case per line")
3187+ ::
3188+ :: +read-def-name: after ++ or +$, a space and a name
3189+ ::
3190+ ++ read-def-name
3191+ |= [rune=token ts=(list token)]
3192+ ^- (pare term)
3193+ ?: &(?=(^ ts) tight.i.ts)
3194+ (no-gap ts "a space after {(show-found rune)}")
3195+ ?. ?=([[* * [%name *]] *] ts) (no-name ts)
3196+ [%& p.lex.i.ts t.ts]
3197+ ::
3198+ :: +read-expr-or-body: a space and an expression on the line, or a
3199+ :: body on deeper lines; what names what comes before, for errors
3200+ ::
3201+ ++ read-expr-or-body
3202+ |= [what=tape ts=(list token)]
3203+ ^- (pare expr)
3204+ ?: ?=([[* * %indent] *] ts) (read-body t.ts)
3205+ ?: ?=([[* * ?(%newline %dedent)] *] ts)
3206+ (bad ts "an expression, or a body on deeper lines")
3207+ ?: &(?=(^ ts) tight.i.ts) (no-gap ts "a space after {what}")
3208+ (read-expr ts)
3209+ ::
3210+ :: +read-body: after its INDENT, { definition NEWLINE } expr DEDENT
3211+ ::
3212+ ++ read-body
3213+ |= ts=(list token)
3214+ ^- (pare expr)
3215+ =| defs=(list def)
3216+ |- ^- (pare expr)
3217+ ?: ?=([[* * ?(%'++' %'+$')] *] ts)
3218+ ;< [d=def after=(list token)] then (read-def ts plus-mask)
3219+ ?: ?=([[* * %newline] *] after) $(defs [d defs], ts t.after)
3220+ ?. ?=([[* * %dedent] *] after) (bad-end-in after (def-can d))
3221+ (bad after "the body's final expression, after its definitions")
3222+ ?: ?=([[* * %'+'] *] ts)
3223+ %: bad-in-why ts "a definition or an expression" plus-mask
3224+ "`+` begins `++` or `+$`"
3225+ ==
3226+ ;< [e=expr after=(list token)] then (read-expr ts)
3227+ ?: ?=([[* * %dedent] *] after)
3228+ =/ ds=(list def) (flop defs)
3229+ =/ beg=loc ?~(ds beg:(span-of e) beg:(span-of i.ds))
3230+ [%& [%body [beg end:(span-of e)] ds e] t.after]
3231+ ?. ?=([[* * %newline] *] after) (bad-end-in after (tail-can e))
3232+ %^ bad-why after "the end of the body"
3233+ "a body's final expression is its last line"
3234+ ::
3235+ :: +read-expr: a rune, or a call
3236+ ::
3237+ ++ read-expr
3238+ |= ts=(list token)
3239+ ^- (pare expr)
3240+ ?~ ts (bad ts "an expression")
3241+ =* t i.ts
3242+ ?+ lex.t (read-call ts)
3243+ %'|=' ?:((is-ctor ts) (read-call ts) (read-gate t t.ts))
3244+ %'^-' (read-cast t t.ts)
3245+ %'~&' (read-trace t t.ts)
3246+ %'?-' (read-branch t t.ts)
3247+ ==
3248+ ::
3249+ :: +read-call: operand { operand }; one operand alone is itself
3250+ ::
3251+ ++ read-call
3252+ |= ts=(list token)
3253+ ^- (pare expr)
3254+ ;< [els=(list expr) after=(list token)] then (read-operands ts)
3255+ ?~ els (no-operand ts expr-mask)
3256+ [%& (call-of els) after]
3257+ ::
3258+ :: +read-operands: a call's operands, or those on a group's first
3259+ :: line, to the end of the call; each after the first follows a space
3260+ ::
3261+ ++ read-operands
3262+ |= ts=(list token)
3263+ ^- (pare (list expr))
3264+ =| els=(list expr)
3265+ |- ^- (pare (list expr))
3266+ ?~ ts [%& (flop els) ts]
3267+ =* t i.ts
3268+ ?: (ends-call t)
3269+ :: an error token whose text can't go tight after an operand
3270+ =/ te=(unit error)
3271+ :: after-mask without its =
3272+ ?~(els ~ (tight-error-in file ts (mix after-mask tis-mask)))
3273+ ?^ te [%| u.te]
3274+ :: or, past a space, can't begin one (+fail-in)
3275+ ?: ?& ?=(^ els) ?=([%error *] lex.t) !tight.t
3276+ !=(':' c.lex.t) !(in c.lex.t operand-mask)
3277+ ==
3278+ [%| (moved file "an expression" t)]
3279+ [%& (flop els) ts]
3280+ ?: &(tight.t ?=(^ els)) (no-space ts)
3281+ ?: (is-operand-start t)
3282+ ;< [e=expr more=(list token)] then (read-operand ts)
3283+ $(els [e els], ts more)
3284+ ?: &(?=(^ els) (is-rune t))
3285+ %: bad-in-why ts "an expression" operand-mask
3286+ "inside a call, a rune goes in parentheses"
3287+ ==
3288+ (no-operand ts ?~(els expr-mask operand-mask))
3289+ ::
3290+ :: +read-operand: one operand, told by its first token and, after a
3291+ :: name or a wing, by a tight ( or +
3292+ ::
3293+ ++ read-operand
3294+ |= ts=(list token)
3295+ ^- (pare expr)
3296+ ?~ ts (bad ts "an expression")
3297+ =* t i.ts
3298+ ?+ lex.t (no-operand ts operand-mask)
3299+ [%lit *] [%& [%lit at.t p.lex.t] t.ts]
3300+ [%str *] [%& [%str at.t (text-piece p.lex.t)] t.ts]
3301+ [%str-head *] (read-string t t.ts)
3302+ [%name *] (read-ref t t.ts)
3303+ [%wing *] (read-ref t t.ts)
3304+ %'%/' (read-qath t t.ts)
3305+ %'/' (read-path t t.ts)
3306+ %'`' (read-unit t t.ts)
3307+ %'(' (read-group t t.ts)
3308+ %'~[' (read-bracket %list t ~ t.ts)
3309+ %'[' (read-bracket %tuple t ~ t.ts)
3310+ %'|=(' (read-gate-wide t t.ts)
3311+ %'|=' (read-ctor t t.ts)
3312+ %'!!' [%& [%crash at.t ~] t.ts]
3313+ ==
3314+ ::
3315+ :: +read-ref: after a name or wing, a tight ( makes a change, and
3316+ :: after a name a tight + a pair; else it is a wing
3317+ ::
3318+ ++ read-ref
3319+ |= [t=token ts=(list token)]
3320+ ^- (pare expr)
3321+ =/ names=(list term) (names-of lex.t)
3322+ ?: ?=([[* %& %'('] *] ts)
3323+ (read-bracket %change i.ts `[t names] t.ts)
3324+ ?: &(?=([[* %& %'+'] *] ts) ?=([%name *] lex.t))
3325+ (read-pair t p.lex.t i.ts t.ts)
3326+ [%& [%wing at.t names] ts]
3327+ ::
3328+ :: +read-pair: name+operand, with no spaces
3329+ ::
3330+ ++ read-pair
3331+ |= [t=token tag=term lus=token ts=(list token)]
3332+ ^- (pare expr)
3333+ ?: |(?=(~ ts) !tight.i.ts) (bad-space lus ts "an operand")
3334+ ;< [v=expr after=(list token)] then (read-operand ts)
3335+ [%& [%pair [beg.at.t end:(span-of v)] tag v] after]
3336+ ::
3337+ :: +read-unit: ` and an operand, with no space
3338+ ::
3339+ ++ read-unit
3340+ |= [tic=token ts=(list token)]
3341+ ^- (pare expr)
3342+ ?: |(?=(~ ts) !tight.i.ts) (bad-space tic ts "an operand")
3343+ ;< [v=expr after=(list token)] then (read-operand ts)
3344+ [%& [%unit [beg.at.tic end:(span-of v)] v] after]
3345+ ::
3346+ :: +read-ctor: |= and a term, with no space: a case's constructor
3347+ ::
3348+ :: Where an operand goes, |= can only be a constructor or begin |=(,
3349+ :: so a tall gate there fails at the space after |=.
3350+ ::
3351+ ++ read-ctor
3352+ |= [bar=token ts=(list token)]
3353+ ^- (pare expr)
3354+ ?: |(?=(~ ts) !tight.i.ts)
3355+ %: fail-space file bar ts "`(` or a term"
3356+ ?: ?=([[* * [%lit %term *]] *] ts)
3357+ "a case's constructor takes its term with no space, as |=%got"
3358+ "a gate in an operand is |=(a body)"
3359+ ==
3360+ ?. ?=([[* * [%lit %term *]] *] ts) (bad-in ts "a term" cen-mask)
3361+ [%& [%ctor [beg.at.bar end.at.i.ts] p.lex.i.ts] t.ts]
3362+ ::
3363+ :: +read-path: a path literal, as /posts/~zod, an operand (Decisions)
3364+ ::
3365+ ++ read-path
3366+ |= [sl=token ts=(list token)]
3367+ ^- (pare expr)
3368+ ;< [[sp=span segs=(list @ta)] after=(list token)] then
3369+ (read-pathlit sl ts &)
3370+ [%& [%path sp segs] after]
3371+ ::
3372+ :: +read-qath: %/, then its segments, knots or (expr), each after a
3373+ :: tight / and tight itself; %/ alone is the root
3374+ ::
3375+ ++ read-qath
3376+ |= [cen=token ts=(list token)]
3377+ ^- (pare expr)
3378+ ?. ?=([[* %& ?([%knot *] %'(')] *] ts)
3379+ ?: &(?=(^ ts) tight.i.ts !(is-closer i.ts))
3380+ (bad ts "a path segment")
3381+ [%& [%qath at.cen ~] ts]
3382+ =| segs=(list qseg)
3383+ |- ^- (pare expr)
3384+ ;< [[s=qseg fin=loc] after=(list token)] then (read-qseg ts)
3385+ ?. ?=([[* %& %'/'] *] after)
3386+ [%& [%qath [beg.at.cen fin] (flop [s segs])] after]
3387+ =/ nex=(list token) t.after
3388+ ?: ?=([[* %& ?([%knot *] %'(')] *] nex)
3389+ $(segs [s segs], ts nex)
3390+ ?: &(?=(^ nex) tight.i.nex) (bad nex "a path segment")
3391+ (bad-space i.after nex "a path segment")
3392+ ::
3393+ :: +read-qseg: an application path's segment, a knot or (expr), and
3394+ :: where it ends: at its ), or with the deeper lines when its expr
3395+ :: took them, as any bracket before the last on its line (+shut)
3396+ ::
3397+ ++ read-qseg
3398+ |= ts=(list token)
3399+ ^- (pare [qseg loc])
3400+ ?: ?=([[* * [%knot *]] *] ts)
3401+ [%& [[%knot p.lex.i.ts] end.at.i.ts] t.ts]
3402+ ?. ?=([[* * %'('] *] ts) (bad ts "a path segment")
3403+ =* par i.ts
3404+ ?: &(?=(^ t.ts) (is-layout i.t.ts)) (unclosed-want "an expression" t.ts)
3405+ ;< [e=expr after=(list token)] then (read-expr t.ts)
3406+ ?: ?=([[* * %')'] *] after)
3407+ [%& [[%expr e] end.at.i.after] t.after]
3408+ ?: (shut par `(span-of e) after)
3409+ [%& [[%expr e] end:(span-of e)] after]
3410+ (unclosed par ")" after)
3411+ ::
3412+ :: +read-string: after its str-head, a string's interpolations and
3413+ :: text: expr { str-mid expr } str-tail
3414+ ::
3415+ ++ read-string
3416+ |= [head=token ts=(list token)]
3417+ ^- (pare expr)
3418+ =/ ps=(list piece)
3419+ ?.(?=([%str-head *] lex.head) ~ (text-piece p.lex.head))
3420+ =/ op=token head
3421+ |- ^- (pare expr)
3422+ ;< [e=expr after=(list token)] then (read-expr ts)
3423+ =. ps [[%expr e] ps]
3424+ ?: ?=([[* * [%str-mid *]] *] after)
3425+ $(ps (weld (text-piece p.lex.i.after) ps), op i.after, ts t.after)
3426+ ?. ?=([[* * [%str-tail *]] *] after)
3427+ =/ brace=loc [line.end.at.op (dec (max 2 col.end.at.op))]
3428+ =/ want=tape "`}` to close the `\{` at {(show-loc brace)}"
3429+ =/ dm (doomed ts after want)
3430+ ?^ dm u.dm
3431+ (bad after want)
3432+ =. ps (weld (text-piece p.lex.i.after) ps)
3433+ [%& [%str [beg.at.head end.at.i.after] (flop ps)] t.after]
3434+ ::
3435+ :: +read-group: ( expr ), or ( { operand } and its lines below, left
3436+ :: open
3437+ ::
3438+ :: A ( followed by a rune is the closed form. Else the group holds
3439+ :: its first line's operands and then its lines as one call, or the
3440+ :: one element alone; with ( alone, the first line below is the
3441+ :: head. Either form closes with the deeper lines, with no ), when
3442+ :: the last thing on its line took them (+shut). A ( with nothing
3443+ :: after it on its line needs those lines, as () is no group: so
3444+ :: where they don't come it wants the call's head on a deeper line,
3445+ :: and at a closer or an error token an expression (+no-operand),
3446+ :: which moves an error token whose text no expression begins
3447+ :: with to that text, as `( @sd` at the @ (+fail-in).
3448+ ::
3449+ ++ read-group
3450+ |= [par=token ts=(list token)]
3451+ ^- (pare expr)
3452+ ?: (is-rune-start ts)
3453+ ;< [e=expr after=(list token)] then (read-expr ts)
3454+ ?: ?=([[* * %')'] *] after)
3455+ [%& [%group [beg.at.par end.at.i.after] e] t.after]
3456+ ?: (shut par `(span-of e) after)
3457+ [%& [%group [beg.at.par end:(span-of e)] e] after]
3458+ (unclosed par ")" after)
3459+ ;< [els=(list expr) after=(list token)] then (read-operands ts)
3460+ ?: ?=([[* * %indent] *] after)
3461+ ;< [ls=(list item) more=(list token)] then
3462+ (read-lines %group t.after)
3463+ =/ inner=expr (call-of (weld els (turn ls |=(i=item val.i))))
3464+ [%& [%group [beg.at.par end:(span-of inner)] inner] more]
3465+ ?~ els
3466+ ?: ?=([[* * ?(%newline %dedent)] *] after)
3467+ (bad after "the call's head on a deeper line")
3468+ (no-operand after expr-mask)
3469+ ?: ?=([[* * %')'] *] after)
3470+ [%& [%group [beg.at.par end.at.i.after] (call-of els)] t.after]
3471+ =/ inner=expr (call-of els)
3472+ ?: (shut par `(span-of inner) after)
3473+ [%& [%group [beg.at.par end:(span-of inner)] inner] after]
3474+ (unclosed-open par ")" "an argument" after)
3475+ ::
3476+ :: +read-bracket: a tuple's, list's or change's items, to its closer
3477+ :: on the line, or to the end of its lines below when left open, or
3478+ :: with its last item's lines when that took the deeper lines (+shut)
3479+ ::
3480+ ++ read-bracket
3481+ |= $: kind=?(%tuple %list %change)
3482+ op=token
3483+ target=(unit [t=token names=(list term)])
3484+ ts=(list token)
3485+ ==
3486+ ^- (pare expr)
3487+ =/ close=?(%')' %']') ?:(?=(%change kind) %')' %']')
3488+ =| its=(list item)
3489+ |- ^- (pare expr)
3490+ ?~ ts (bad ts "an item")
3491+ =* t i.ts
3492+ ?: =(close lex.t)
3493+ [%& (bracket-node kind op target (flop its) end.at.t) t.ts]
3494+ ?: (is-closer t) (unclosed op (trip close) ts)
3495+ ?: ?=(%indent lex.t)
3496+ ;< [ls=(list item) more=(list token)] then (read-lines kind t.ts)
3497+ =/ every=(list item) (weld (flop its) ls)
3498+ =/ fin=loc ?~(every end.at.op end.at:(rear every))
3499+ [%& (bracket-node kind op target every fin) more]
3500+ ?: &(?=(^ its) (shut op `at.i.its ts))
3501+ [%& (bracket-node kind op target (flop its) end.at.i.its) ts]
3502+ ?: ?=(?(%newline %dedent) lex.t)
3503+ (unclosed-open op (trip close) "an item" ts)
3504+ ?: &(tight.t ?=(^ its)) (no-space ts)
3505+ ;< [i=item more=(list token)] then (read-item kind ts)
3506+ $(its [i its], ts more)
3507+ ::
3508+ :: +read-item: [ name= ] operand; a tuple's item may be named, a
3509+ :: change's must be, a list's is not
3510+ ::
3511+ ++ read-item
3512+ |= [kind=?(%tuple %list %change) ts=(list token)]
3513+ ^- (pare item)
3514+ ?: &(!?=(%list kind) ?=([[* * [%name *]] [* %& %'='] *] ts))
3515+ =* nam i.ts
3516+ =/ rest=(list token) t.t.ts
3517+ ?: |(?=(~ rest) !tight.i.rest) (bad-space i.t.ts rest "a value")
3518+ ;< [v=expr after=(list token)] then (read-operand rest)
3519+ [%& [[beg.at.nam end:(span-of v)] `p.lex.nam v] after]
3520+ ?: ?=(%change kind) (unnamed ts)
3521+ ?: &(?=(^ ts) (is-rune i.ts))
3522+ %: bad-in-why ts "an expression" operand-mask
3523+ "inside brackets, a rune goes in parentheses"
3524+ ==
3525+ ;< [v=expr after=(list token)] then (read-operand ts)
3526+ [%& [(span-of v) ~ v] after]
3527+ ::
3528+ :: +read-lines: after an open bracket's INDENT, its lines, an item
3529+ :: each, to its DEDENT
3530+ ::
3531+ ++ read-lines
3532+ |= [kind=?(%tuple %list %change %group) ts=(list token)]
3533+ ^- (pare (list item))
3534+ =| ls=(list item)
3535+ |- ^- (pare (list item))
3536+ ;< [l=item after=(list token)] then (read-line kind ts)
3537+ ?: ?=([[* * %newline] *] after) $(ls [l ls], ts t.after)
3538+ ?: ?=([[* * %dedent] *] after) [%& (flop [l ls]) t.after]
3539+ ?. ?=([[* * ?(%')' %']')] *] after) (bad-end-in after (tail-can val.l))
3540+ (closer-after after)
3541+ ::
3542+ :: +closer-after: a ) or ] after an open bracket's line's item
3543+ ::
3544+ ++ closer-after
3545+ |= ts=(list token)
3546+ ^- [%| p=error]
3547+ %^ bad-why ts "the end of the line"
3548+ "a bracket open at the end of its line takes no closer"
3549+ ::
3550+ :: +closer-first: an open bracket's line that starts with a ) or ],
3551+ :: where want, its item, goes
3552+ ::
3553+ ++ closer-first
3554+ |= [ts=(list token) want=tape]
3555+ ^- (unit [%| p=error])
3556+ ?. ?=([[* * ?(%')' %']')] *] ts) ~
3557+ :- ~
3558+ %^ bad-why ts want
3559+ %+ weld "a bracket open at the end of its line takes no closer: "
3560+ "its items end at the first line that isn't deeper"
3561+ ::
3562+ :: +read-line: an open bracket's line, [ name= ] expr; a tuple's may
3563+ :: be named, a change's must be, a list's and a group's are not
3564+ :: (doc question)
3565+ ::
3566+ ++ read-line
3567+ |= [kind=?(%tuple %list %change %group) ts=(list token)]
3568+ ^- (pare item)
3569+ =/ cf (closer-first ts "an item")
3570+ ?^ cf u.cf
3571+ ?: ?& ?=(?(%tuple %change) kind)
3572+ ?=([[* * [%name *]] [* %& %'='] *] ts)
3573+ ==
3574+ =* nam i.ts
3575+ =/ rest=(list token) t.t.ts
3576+ ?: |(?=(~ rest) !tight.i.rest) (bad-space i.t.ts rest "a value")
3577+ ;< [v=expr after=(list token)] then (read-expr rest)
3578+ [%& [[beg.at.nam end:(span-of v)] `p.lex.nam v] after]
3579+ ?: ?=(%change kind) (unnamed ts)
3580+ ;< [v=expr after=(list token)] then (read-expr ts)
3581+ [%& [(span-of v) ~ v] after]
3582+ ::
3583+ :: +read-gate-wide: |=( sample operand ), the one wide expression; it
3584+ :: closes with its body's lines when its body took the deeper lines
3585+ :: (+shut), but a sample that took them leaves it no body (+doomed)
3586+ ::
3587+ ++ read-gate-wide
3588+ |= [op=token ts=(list token)]
3589+ ^- (pare expr)
3590+ ?: &(?=(^ ts) |((is-closer i.ts) (is-layout i.ts)))
3591+ (unclosed-want "a sample" ts)
3592+ ;< [s=sample after=(list token)] then (read-sample ts)
3593+ ?: (hoon-union ts after)
3594+ (bad-why after "a space after the sample" "a union is a `+$` with its cases below")
3595+ ?: &(?=(^ after) |((is-closer i.after) (is-layout i.after)))
3596+ =/ dm (doomed ts after "the gate's body")
3597+ ?^ dm u.dm
3598+ (unclosed-want "the gate's body" after)
3599+ ?: &(?=(^ after) tight.i.after)
3600+ (no-gap after "a space after the sample")
3601+ ?: &(?=(^ after) (is-rune i.after))
3602+ %: bad-in-why after "an expression" operand-mask
3603+ "the wide gate's body is an operand, so a rune goes in parentheses"
3604+ ==
3605+ ;< [b=expr more=(list token)] then (read-operand after)
3606+ ?: ?=([[* * %')'] *] more)
3607+ [%& [%gate-wide [beg.at.op end.at.i.more] s b] t.more]
3608+ ?: (shut op `(span-of b) more)
3609+ [%& [%gate-wide [beg.at.op end:(span-of b)] s b] more]
3610+ ?. &(?=(^ more) !tight.i.more (is-operand-start i.more))
3611+ (unclosed op ")" more)
3612+ %^ bad-why more (closing op ")")
3613+ "the wide gate's body is one operand, so a call goes in parentheses"
3614+ ::
3615+ :: +read-gate: |= sample, then an expression or a body
3616+ ::
3617+ ++ read-gate
3618+ |= [bar=token ts=(list token)]
3619+ ^- (pare expr)
3620+ ?: &(?=(^ ts) tight.i.ts)
3621+ :: a % could begin a constructor's term, as |=%got
3622+ ?: =('%' (first-char i.ts)) (bad-in ts "a term" cen-mask)
3623+ (no-gap ts "a space after `|=`")
3624+ ;< [s=sample after=(list token)] then (read-sample ts)
3625+ ?: (hoon-union ts after)
3626+ (bad-why after "a space after the sample" "a union is a `+$` with its cases below")
3627+ =/ dm (doomed ts after "an expression, or a body on deeper lines")
3628+ ?^ dm u.dm
3629+ ;< [e=expr more=(list token)] then
3630+ (read-expr-or-body "the sample" after)
3631+ [%& [%gate [beg.at.bar end:(span-of e)] s e] more]
3632+ ::
3633+ :: +read-cast: ^- mold, then an expression or a body
3634+ ::
3635+ ++ read-cast
3636+ |= [ket=token ts=(list token)]
3637+ ^- (pare expr)
3638+ ?: &(?=(^ ts) tight.i.ts) (wide-rune "^-" ts)
3639+ ;< [s=shape after=(list token)] then (read-mold ts)
3640+ ?: (hoon-union ts after)
3641+ (bad-why after "a space after the mold" "a union is a `+$` with its cases below")
3642+ =/ dm (doomed ts after "an expression, or a body on deeper lines")
3643+ ?^ dm u.dm
3644+ ;< [e=expr more=(list token)] then
3645+ (read-expr-or-body "the mold" after)
3646+ [%& [%cast [beg.at.ket end:(span-of e)] s e] more]
3647+ ::
3648+ :: +read-trace: ~& expr, then its body below
3649+ ::
3650+ ++ read-trace
3651+ |= [sig=token ts=(list token)]
3652+ ^- (pare expr)
3653+ ?: &(?=(^ ts) tight.i.ts) (wide-rune "~&" ts)
3654+ ;< [v=expr after=(list token)] then (read-expr ts)
3655+ ?. ?=([[* * %indent] *] after)
3656+ =/ dm (doomed ts after "`~&`'s body on deeper lines")
3657+ ?^ dm u.dm
3658+ (bad after "`~&`'s body on deeper lines")
3659+ ;< [b=expr more=(list token)] then (read-body t.after)
3660+ [%& [%trace [beg.at.sig end:(span-of b)] v b] more]
3661+ ::
3662+ :: +read-branch: ?- expr, then its arms below, one per line
3663+ ::
3664+ ++ read-branch
3665+ |= [wut=token ts=(list token)]
3666+ ^- (pare expr)
3667+ ?: &(?=(^ ts) tight.i.ts) (wide-rune "?-" ts)
3668+ ;< [s=expr after=(list token)] then (read-expr ts)
3669+ ?. ?=([[* * %indent] *] after)
3670+ =/ dm (doomed ts after "`?-`'s arms on deeper lines")
3671+ ?^ dm u.dm
3672+ (bad after "`?-`'s arms on deeper lines")
3673+ =| arms=(list arm)
3674+ =/ rest=(list token) t.after
3675+ |- ^- (pare expr)
3676+ ;< [a=arm more=(list token)] then (read-arm rest)
3677+ ?: ?=([[* * %newline] *] more) $(arms [a arms], rest t.more)
3678+ ?. ?=([[* * %dedent] *] more) (bad-end-in more (tail-can val.a))
3679+ [%& [%branch [beg.at.wut end.at.a] s (flop [a arms])] t.more]
3680+ ::
3681+ :: +read-arm: a pattern, then an expression or a body
3682+ ::
3683+ ++ read-arm
3684+ |= ts=(list token)
3685+ ^- (pare arm)
3686+ ;< [p=pattern after=(list token)] then (read-pattern ts)
3687+ ?: ?=([[* %& %'+'] *] after)
3688+ %^ bad-why after "a space after the pattern"
3689+ "patterns take no pairs: write a cell, as [%gap %s2]"
3690+ ?: ?=([[* %& %'='] *] after)
3691+ %^ bad-why after "a space after the pattern"
3692+ "patterns take no `name=`: a bare name binds, as [a b]"
3693+ ;< [e=expr more=(list token)] then
3694+ (read-expr-or-body "the pattern" after)
3695+ [%& [[beg:(span-of p) end:(span-of e)] p e] more]
3696+ ::
3697+ :: +read-pattern: a term, number, string, ship, loobean, ~, * or name,
3698+ :: or a cell of patterns
3699+ ::
3700+ :: Where a pattern can't take a token, the error points where the
3701+ :: token stops being a pattern's start (+fail-in): a date or knot
3702+ :: at its second character, since ~ alone is null; a duration at its
3703+ :: third, as ~s could begin the ship ~sev; ~[ at its [; a string
3704+ :: with {…} at its {; a wing at its first dot.
3705+ ::
3706+ ++ read-pattern
3707+ |= ts=(list token)
3708+ ^- (pare pattern)
3709+ ?~ ts (bad ts "a pattern")
3710+ =* t i.ts
3711+ ?+ lex.t (bad-in ts "a pattern" pattern-mask)
3712+ [%lit *]
3713+ =* l p.lex.t
3714+ ?: ?=(?(%number %ship %term %loobean %null) form.l)
3715+ [%& [%lit at.t l] t.ts]
3716+ =/ what=tape
3717+ ?- form.l
3718+ %date "dates"
3719+ %duration "durations"
3720+ %knot "knots"
3721+ ==
3722+ =/ n=@ud ?:(?=(%duration form.l) 2 1)
3723+ %+ bad-at [line.beg.at.t (add n col.beg.at.t)]
3724+ ;: weld
3725+ "expected a pattern, found {(show-found t)}; patterns take no "
3726+ what
3727+ ": compare values with ?- (eq a b)"
3728+ ==
3729+ ::
3730+ [%str *] [%& [%str at.t p.lex.t] t.ts]
3731+ %'*' [%& [%any at.t ~] t.ts]
3732+ [%name *] [%& [%bind at.t p.lex.t] t.ts]
3733+ %'[' (read-cell-pattern t t.ts)
3734+ %'`' (bad-why ts "a pattern" "patterns take no units: write [~ x]")
3735+ ::
3736+ [%wing *]
3737+ %: bad-in-why ts "a pattern" pattern-mask
3738+ "a name in a pattern binds anew, so it has no `.`"
3739+ ==
3740+ ::
3741+ [%str-head *]
3742+ %+ bad-at [line.end.at.t (dec (max 2 col.end.at.t))]
3743+ %+ weld "expected a pattern, found a string with `\{…}`; "
3744+ "patterns take strings without `\{…}`"
3745+ ::
3746+ %'~['
3747+ %+ bad-at [line.beg.at.t +(col.beg.at.t)]
3748+ "expected a pattern, found `~[`; patterns take no lists"
3749+ ==
3750+ ::
3751+ :: +read-cell-pattern: [ pattern { pattern } ], closed on its line
3752+ ::
3753+ ++ read-cell-pattern
3754+ |= [op=token ts=(list token)]
3755+ ^- (pare pattern)
3756+ =| ps=(list pattern)
3757+ |- ^- (pare pattern)
3758+ ?: ?=([[* * %']'] *] ts)
3759+ ?~ ps (bad ts "a pattern")
3760+ [%& [%cell [beg.at.op end.at.i.ts] (flop ps)] t.ts]
3761+ ?: &(?=(^ ts) |((is-closer i.ts) (is-layout i.ts)))
3762+ ?~ ps (unclosed-want "a pattern" ts)
3763+ (unclosed op "]" ts)
3764+ ?: &(?=(^ ps) ?=(^ ts) tight.i.ts) (no-space-pattern ts)
3765+ ;< [p=pattern after=(list token)] then (read-pattern ts)
3766+ $(ps [p ps], ts after)
3767+ ::
3768+ :: +read-sample: a gate's sample, a field, except that a bare name
3769+ :: binds, alone or in a cell sample at any depth (section 3). A cell
3770+ :: sample's [ has no open form, but closes with the deeper lines when
3771+ :: its last item took them (+shut), which leaves the gate no body
3772+ ::
3773+ ++ read-sample
3774+ |= ts=(list token)
3775+ ^- (pare sample)
3776+ ?: ?=([[* * [%name *]] [* %& %'='] *] ts) (read-face ts)
3777+ ?: ?=([[* * [%name *]] *] ts) [%& [%bind at.i.ts p.lex.i.ts] t.ts]
3778+ ?: ?=([[* * %'='] *] ts) (read-pun i.ts t.ts)
3779+ ?: &(?=(^ ts) (is-layout i.ts)) (bad-line ts "a sample")
3780+ ?: ?=([[* * [%error *]] *] ts)
3781+ (bad-in ts "a mold" (con mold-mask tis-mask))
3782+ ?. ?=([[* * %'['] *] ts)
3783+ ;< [s=shape after=(list token)] then (read-mold ts)
3784+ [%& [%bare (span-of s) s] after]
3785+ =* op i.ts
3786+ =| ss=(list sample)
3787+ =/ rest=(list token) t.ts
3788+ |- ^- (pare sample)
3789+ ?: ?=([[* * %']'] *] rest)
3790+ ?~ ss (bad rest "a sample")
3791+ [%& [%cell [beg.at.op end.at.i.rest] (flop ss)] t.rest]
3792+ ?: &(?=(^ ss) (shut op `(span-of i.ss) rest))
3793+ [%& [%cell [beg.at.op end:(span-of i.ss)] (flop ss)] rest]
3794+ ?: &(?=(^ rest) |((is-closer i.rest) (is-layout i.rest)))
3795+ ?~ ss (unclosed-want "a sample" rest)
3796+ (unclosed op "]" rest)
3797+ ?: &(?=(^ ss) ?=(^ rest) tight.i.rest) (no-space rest)
3798+ ;< [s=sample after=(list token)] then (read-sample rest)
3799+ ?: (hoon-union rest after)
3800+ (bad-why after "a space between items" "a union is a `+$` with its cases below")
3801+ $(ss [s ss], rest after)
3802+ ::
3803+ :: +read-field: a cell mold's field: name=mold, =name, or a mold
3804+ ::
3805+ ++ read-field
3806+ |= ts=(list token)
3807+ ^- (pare field)
3808+ ?: ?=([[* * [%name *]] [* %& %'='] *] ts) (read-face ts)
3809+ ?: ?=([[* * %'='] *] ts) (read-pun i.ts t.ts)
3810+ :: = begins a pun here, as a mold's first characters begin a mold
3811+ ?: ?=([[* * [%error *]] *] ts)
3812+ (bad-in ts "a mold" (con mold-mask tis-mask))
3813+ ;< [s=shape after=(list token)] then (read-mold ts)
3814+ [%& [%bare (span-of s) s] after]
3815+ ::
3816+ :: +read-face: name=mold, with no spaces
3817+ ::
3818+ ++ read-face
3819+ |= ts=(list token)
3820+ ^- (pare field)
3821+ ?. ?=([[* * [%name *]] [* * %'='] *] ts) (bad ts "a name")
3822+ =* nam i.ts
3823+ =/ rest=(list token) t.t.ts
3824+ ?: |(?=(~ rest) !tight.i.rest) (bad-space i.t.ts rest "a mold")
3825+ ;< [s=shape after=(list token)] then (read-mold rest)
3826+ [%& [%face [beg.at.nam end:(span-of s)] p.lex.nam s] after]
3827+ ::
3828+ :: +read-pun: =name, with no space, for name=name
3829+ ::
3830+ ++ read-pun
3831+ |= [tis=token ts=(list token)]
3832+ ^- (pare field)
3833+ ?: |(?=(~ ts) !tight.i.ts) (bad-space tis ts "a name")
3834+ ?. ?=([[* * [%name *]] *] ts) (no-name ts)
3835+ [%& [%pun [beg.at.tis end.at.i.ts] p.lex.i.ts] t.ts]
3836+ ::
3837+ :: +read-mold: one mold
3838+ ::
3839+ ++ read-mold
3840+ |= ts=(list token)
3841+ ^- (pare shape)
3842+ ?~ ts (bad ts "a mold")
3843+ =* t i.ts
3844+ ?+ lex.t (bad-in ts "a mold" mold-mask)
3845+ [%aura *] [%& [%aura at.t p.lex.t] t.ts]
3846+ %'*' [%& [%noun at.t ~] t.ts]
3847+ %'!!' [%& [%void at.t ~] t.ts]
3848+ %'?' [%& [%flag at.t ~] t.ts]
3849+ %'_' [%& [%hole at.t ~] t.ts]
3850+ [%name *] [%& [%ref at.t ~[p.lex.t]] t.ts]
3851+ [%wing *] [%& [%ref at.t p.lex.t] t.ts]
3852+ [%tvar *] [%& [%tvar at.t p.lex.t] t.ts]
3853+ %'/' (read-pathmold t t.ts)
3854+ %'(' (read-apply t t.ts)
3855+ %'[' (read-cell-mold t t.ts)
3856+ %'$-(' (read-fn t t.ts)
3857+ %'|$' %: bad-in-why ts "a mold" mold-mask
3858+ "`|$` goes right after a `+$`'s name, as in +$ result |$ [V E]"
3859+ ==
3860+ ::
3861+ ?(%'|=' %'|=(')
3862+ %: bad-in-why ts "a mold" mold-mask
3863+ "a gate's mold is $-(sample product)"
3864+ ==
3865+ ::
3866+ [%lit *]
3867+ ?. ?=(?(%null %term %loobean) form.p.lex.t)
3868+ (bad-in ts "a mold" mold-mask)
3869+ [%& [%const at.t p.lex.t] t.ts]
3870+ ==
3871+ ::
3872+ :: +read-molds: molds after an application name, to its ) or its last
3873+ :: mold's deeper lines (+shut). Each follows a space; ( may be left
3874+ :: open, with one mold per deeper line (mlines).
3875+ ::
3876+ ++ read-molds
3877+ |= [op=token ts=(list token)]
3878+ ^- (pare [(list shape) loc])
3879+ =| ms=(list shape)
3880+ |- ^- (pare [(list shape) loc])
3881+ ?: ?=([[* * %')'] *] ts)
3882+ ?~ ms (bad ts "a mold")
3883+ [%& [(flop ms) end.at.i.ts] t.ts]
3884+ ?: ?=([[* * %indent] *] ts)
3885+ ;< [ls=(list shape) more=(list token)] then (read-mlines t.ts)
3886+ =/ every=(list shape) (weld (flop ms) ls)
3887+ [%& [every ?~(every end.at.op end:(span-of (rear every)))] more]
3888+ ?: (shut op ?~(ms ~ `(span-of i.ms)) ts)
3889+ [%& [(flop ms) ?~(ms end.at.op end:(span-of i.ms))] ts]
3890+ ?: ?=([[* * ?(%newline %dedent)] *] ts)
3891+ (unclosed-open op ")" "a mold" ts)
3892+ ?: &(?=(^ ts) |((is-closer i.ts) (is-layout i.ts)))
3893+ ?~ ms (unclosed-want "a mold" ts)
3894+ (unclosed op ")" ts)
3895+ ?: &(?=(^ ts) tight.i.ts) (no-space ts)
3896+ ;< [m=shape after=(list token)] then (read-mold ts)
3897+ ?: (hoon-union ts after)
3898+ (bad-why after "a space between items" "a union is a `+$` with its cases below")
3899+ $(ms [m ms], ts after)
3900+ ::
3901+ :: +read-apply: ( ref mold { mold } ), or ( ref { mold } and its
3902+ :: lines below, left open; the name stays on the first line
3903+ ::
3904+ ++ read-apply
3905+ |= [op=token ts=(list token)]
3906+ ^- (pare shape)
3907+ =/ want=tape "a mold's name, as in (list @t)"
3908+ ?: &(?=(^ ts) (is-layout i.ts))
3909+ %: fail-line file ts want
3910+ "a `(` keeps the mold's name on its first line"
3911+ ==
3912+ ?. ?=([[* * ?([%name *] [%wing *])] *] ts) (bad-in ts want lower-mask)
3913+ ;< [[ms=(list shape) fin=loc] after=(list token)] then
3914+ (read-molds op t.ts)
3915+ [%& [%apply [beg.at.op fin] (names-of lex.i.ts) ms] after]
3916+ ::
3917+ :: +read-fn: $-( mold mold ), closed on its line, or with the product
3918+ :: when that took the deeper lines (+shut); a sample that took them
3919+ :: leaves it no product (+doomed)
3920+ ::
3921+ ++ read-fn
3922+ |= [op=token ts=(list token)]
3923+ ^- (pare shape)
3924+ ?: &(?=(^ ts) |((is-closer i.ts) (is-layout i.ts)))
3925+ (unclosed-want "a mold" ts)
3926+ ;< [a=shape after=(list token)] then (read-mold ts)
3927+ ?: (hoon-union ts after)
3928+ (bad-why after "a space between items" "a union is a `+$` with its cases below")
3929+ =/ want=tape "a mold, the product"
3930+ ?: &(?=(^ after) |((is-closer i.after) (is-layout i.after)))
3931+ =/ dm (doomed ts after want)
3932+ ?^ dm u.dm
3933+ (unclosed-want want after)
3934+ ?: &(?=(^ after) tight.i.after) (no-space after)
3935+ ;< [b=shape more=(list token)] then (read-mold after)
3936+ ?: (hoon-union after more)
3937+ (bad-why more "a space between items" "a union is a `+$` with its cases below")
3938+ ?: ?=([[* * %')'] *] more)
3939+ [%& [%fn [beg.at.op end.at.i.more] a b] t.more]
3940+ ?: (shut op `(span-of b) more)
3941+ [%& [%fn [beg.at.op end:(span-of b)] a b] more]
3942+ (unclosed op ")" more)
3943+ ::
3944+ :: +read-cell-mold: [ field { field } ], or [ { field } and its lines
3945+ :: below, left open (flines), or closed with its last field's lines
3946+ :: when that took the deeper lines (+shut)
3947+ ::
3948+ ++ read-cell-mold
3949+ |= [op=token ts=(list token)]
3950+ ^- (pare shape)
3951+ =| fs=(list field)
3952+ |- ^- (pare shape)
3953+ ?: ?=([[* * %']'] *] ts)
3954+ ?~ fs (bad ts "a mold")
3955+ [%& [%cell [beg.at.op end.at.i.ts] (flop fs)] t.ts]
3956+ ?: ?=([[* * %indent] *] ts)
3957+ ;< [ls=(list field) more=(list token)] then (read-flines t.ts)
3958+ =/ every=(list field) (weld (flop fs) ls)
3959+ =/ fin=loc ?~(every end.at.op end:(span-of (rear every)))
3960+ [%& [%cell [beg.at.op fin] every] more]
3961+ ?: &(?=(^ fs) (shut op `(span-of i.fs) ts))
3962+ [%& [%cell [beg.at.op end:(span-of i.fs)] (flop fs)] ts]
3963+ ?: ?=([[* * ?(%newline %dedent)] *] ts)
3964+ (unclosed-open op "]" "a field" ts)
3965+ ?: &(?=(^ ts) |((is-closer i.ts) (is-layout i.ts)))
3966+ (unclosed op "]" ts)
3967+ ?: &(?=(^ fs) ?=(^ ts) tight.i.ts) (no-space ts)
3968+ ;< [f=field after=(list token)] then (read-field ts)
3969+ ?: (hoon-union ts after)
3970+ (bad-why after "a space between items" "a union is a `+$` with its cases below")
3971+ $(fs [f fs], ts after)
3972+ ::
3973+ :: +read-mlines: after a mold's open ('s INDENT, one mold per line, to
3974+ :: its DEDENT
3975+ ::
3976+ ++ read-mlines
3977+ |= ts=(list token)
3978+ ^- (pare (list shape))
3979+ =| ms=(list shape)
3980+ |- ^- (pare (list shape))
3981+ =/ cf (closer-first ts "a mold")
3982+ ?^ cf u.cf
3983+ ;< [m=shape after=(list token)] then (read-mold ts)
3984+ ?: (hoon-union ts after)
3985+ (bad-why after "the end of the line" "a union is a `+$` with its cases below")
3986+ ?: ?=([[* * %newline] *] after) $(ms [m ms], ts t.after)
3987+ ?: ?=([[* * %dedent] *] after) [%& (flop [m ms]) t.after]
3988+ (mold-line-end after "mold")
3989+ ::
3990+ :: +read-flines: after a mold's open ['s INDENT, one field per line, to
3991+ :: its DEDENT
3992+ ::
3993+ ++ read-flines
3994+ |= ts=(list token)
3995+ ^- (pare (list field))
3996+ =| fs=(list field)
3997+ |- ^- (pare (list field))
3998+ =/ cf (closer-first ts "a field")
3999+ ?^ cf u.cf
4000+ ;< [f=field after=(list token)] then (read-field ts)
4001+ ?: (hoon-union ts after)
4002+ (bad-why after "the end of the line" "a union is a `+$` with its cases below")
4003+ ?: ?=([[* * %newline] *] after) $(fs [f fs], ts t.after)
4004+ ?: ?=([[* * %dedent] *] after) [%& (flop [f fs]) t.after]
4005+ (mold-line-end after "field")
4006+ ::
4007+ :: +mold-line-end: what goes on after the one mold or field of an open
4008+ :: mold bracket's line (noun: which); nothing does but its end
4009+ ::
4010+ ++ mold-line-end
4011+ |= [ts=(list token) noun=tape]
4012+ ^- [%| p=error]
4013+ ?: ?=([[* * ?(%')' %']')] *] ts) (closer-after ts)
4014+ ?: |(?=(~ ts) tight.i.ts (is-layout i.ts) ?=([%error *] lex.i.ts))
4015+ (bad-end-in ts 0)
4016+ %^ bad-why ts "the end of the line"
4017+ "a bracket open at the end of its line takes one {noun} per line"
4018+ ::
4019+ :: +read-generic: |$ [ typevar { typevar } ], then a definition body
4020+ ::
4021+ ++ read-generic
4022+ |= [bar=token ts=(list token)]
4023+ ^- (pare shape)
4024+ ?: &(?=(^ ts) tight.i.ts) (wide-rune "|$" ts)
4025+ ?. ?=([[* * %'['] *] ts)
4026+ (bad-in ts "`[` and its type variables, as in |$ [M]" sel-mask)
4027+ =* op i.ts
4028+ =| vs=(list @t)
4029+ =/ rest=(list token) t.ts
4030+ |- ^- (pare shape)
4031+ ?: ?=([[* * %']'] *] rest)
4032+ ?~ vs (bad rest "a type variable")
4033+ =/ more=(list token) t.rest
4034+ ?: &(?=(^ more) tight.i.more) (no-gap more "a space after `]`")
4035+ ;< [b=shape after=(list token)] then (read-def-body more)
4036+ [%& [%generic [beg.at.bar end:(span-of b)] (flop vs) b] after]
4037+ ?: &(?=(^ rest) |((is-closer i.rest) (is-layout i.rest)))
4038+ ?~ vs (unclosed-want "a type variable" rest)
4039+ (unclosed op "]" rest)
4040+ ?: &(?=(^ vs) ?=(^ rest) tight.i.rest) (no-space rest)
4041+ ?. ?=([[* * [%tvar *]] *] rest)
4042+ (bad-in rest "a type variable" upper-mask)
4043+ $(vs [p.lex.i.rest vs], rest t.rest)
4044+ ::
4045+ :: +read-pathmold: / [ segment { / segment } ], each / and segment
4046+ :: tight; / alone is the empty path
4047+ ::
4048+ ++ read-pathmold
4049+ |= [sl=token ts=(list token)]
4050+ ^- (pare shape)
4051+ ?. ?=([[* %& ?([%knot *] %'[')] *] ts)
4052+ ?: &(?=(^ ts) tight.i.ts !(is-closer i.ts))
4053+ (bad ts "a path segment")
4054+ [%& [%path at.sl ~] ts]
4055+ =| segs=(list pseg)
4056+ |- ^- (pare shape)
4057+ ;< [[s=pseg fin=loc] after=(list token)] then (read-pseg ts)
4058+ ?. ?=([[* %& %'/'] *] after)
4059+ [%& [%path [beg.at.sl fin] (flop [s segs])] after]
4060+ =/ nex=(list token) t.after
4061+ ?: ?=([[* %& ?([%knot *] %'[')] *] nex)
4062+ $(segs [s segs], ts nex)
4063+ ?: &(?=(^ nex) tight.i.nex) (bad nex "a path segment")
4064+ (bad-space i.after nex "a path segment")
4065+ ::
4066+ :: +read-pseg: a path mold's knot, [name=aura], or [name=_] with no
4067+ :: spaces, and where it ends
4068+ ::
4069+ ++ read-pseg
4070+ |= ts=(list token)
4071+ ^- (pare [pseg loc])
4072+ ?: ?=([[* * [%knot *]] *] ts)
4073+ [%& [[%knot p.lex.i.ts] end.at.i.ts] t.ts]
4074+ ?. ?=([[* * %'['] *] ts) (bad ts "a path segment")
4075+ =* op i.ts
4076+ =/ r1=(list token) t.ts
4077+ ?: |(?=(~ r1) !tight.i.r1) (bad-space op r1 "a name")
4078+ ?. ?=([[* * [%name *]] *] r1) (no-name r1)
4079+ =/ r2=(list token) t.r1
4080+ ?: |(?=(~ r2) !tight.i.r2) (bad-space i.r1 r2 "`=`")
4081+ ?. ?=([[* * %'='] *] r2) (bad-in r2 "`=`" tis-mask)
4082+ =/ r3=(list token) t.r2
4083+ ?: |(?=(~ r3) !tight.i.r3) (bad-space i.r2 r3 "an aura or type hole")
4084+ ?. ?=([[* * ?([%aura *] %'_')] *] r3) (bad-in r3 "an aura or type hole" (con pat-mask (bex 95)))
4085+ =/ r4=(list token) t.r3
4086+ ?: |(?=(~ r4) !tight.i.r4) (bad-space i.r3 r4 "`]`")
4087+ ?. ?=([[* * %']'] *] r4) (bad-in r4 "`]`" ser-mask)
4088+ =/ at=span [beg.at.op end.at.i.r4]
4089+ =/ seg=pseg
4090+ ?: ?=(%'_' lex.i.r3) [%inferred at p.lex.i.r1 at.i.r3]
4091+ [%typed at p.lex.i.r1 p.lex.i.r3]
4092+ [%& [seg end.at.i.r4] t.r4]
4093+ --
4094+::
4095++| %span-check
4096+::
4097+:: +outline: a node as +check-spans sees it
4098+::
4099+:: lead lists the kinds (+kind-of) of token the node may start with,
4100+:: or is ~ when it starts with its first child; stop says where it
4101+:: ends (+stop).
4102+::
4103++$ outline
4104+ $~ [%$ *span ~ %kid ~]
4105+ $: kind=@tas
4106+ at=span
4107+ lead=(list @)
4108+ =stop
4109+ kids=(list outline)
4110+ ==
4111+::
4112+:: +stop: where a node ends, by the tokens of its text alone
4113+::
4114+:: %kid with its last child
4115+:: %one where its first token ends: a name, a literal
4116+:: %two where the token after its first ends: |=%got, =msg, /- todo
4117+:: %shut at the closer of its first token, an opener closed on its
4118+:: line; or with its last child, if that opener is left open
4119+:: or is a rune with its body below
4120+:: %shut2 likewise from the token after its first, a change's (
4121+:: %run at the end of the path it starts: then each tight / and
4122+:: knot, and each tight [ or ( to its closer; or with its
4123+:: last child, if a ( is left open
4124+:: %run3 likewise from its third token, an import's path
4125+:: %string at the str-tail that ends its string, past each str-mid
4126+::
4127++$ stop ?(%kid %one %two %shut %shut2 %run %run3 %string)
4128+::
4129+:: +tinfo: a token as +check-spans sees it: its kind, its end, and the
4130+:: next token's start and whether that is tight, unless it is a layout
4131+:: token
4132+::
4133++$ tinfo [kind=@ end=loc nex=(unit [beg=loc tight=?])]
4134+::
4135+:: +check-spans: whether a module's spans follow section 1's rules
4136+::
4137+:: A node starts at its first token and ends where its last token
4138+:: ends, never at a layout token: at its own token where it has one
4139+:: there (a rune, a name, an opener), else where its first child does;
4140+:: and at the token +stop names, which it finds from the tokens alone,
4141+:: matching each opener with its closer on the line. Its children's
4142+:: spans lie inside its own in source order, and so do the module's
4143+:: imports and definitions. Gives the first node that breaks a rule,
4144+:: and how, or ~. +check-spans-test checks that it catches spans a
4145+:: parser bug could give.
4146+::
4147+++ check-spans
4148+ |= [mod=module toks=(list token)]
4149+ ^- (unit tape)
4150+ %+ check-outlines toks
4151+ (weld (turn imports.mod outline-import) (turn defs.mod outline-def))
4152+::
4153+:: +check-outlines: +check-spans over the outlines of a module's nodes
4154+::
4155+++ check-outlines
4156+ |= [toks=(list token) os=(list outline)]
4157+ ^- (unit tape)
4158+ (check-kids (index-tokens toks) ~ os)
4159+::
4160+:: +index-tokens: each token that isn't a layout token, by its start,
4161+:: and each opener's closer on its line, by their starts
4162+::
4163+:: A str-head opens an interpolation that a str-mid or str-tail
4164+:: closes, and a str-mid opens the next. Openers still open at the end
4165+:: of a line have no closer.
4166+::
4167+++ index-tokens
4168+ |= toks=(list token)
4169+ ^- [info=(map loc tinfo) mat=(map loc loc)]
4170+ =| info=(map loc tinfo)
4171+ =| mat=(map loc loc)
4172+ =| open=(list loc)
4173+ |- ^- [info=(map loc tinfo) mat=(map loc loc)]
4174+ ?~ toks [info mat]
4175+ =* t i.toks
4176+ ?: (is-layout t) $(toks t.toks, open ~)
4177+ =/ k=@ (kind-of t)
4178+ =/ nex=(unit [beg=loc tight=?])
4179+ ?: |(?=(~ t.toks) (is-layout i.t.toks)) ~
4180+ `[beg.at.i.t.toks tight.i.t.toks]
4181+ =. info (~(put by info) beg.at.t [k end.at.t nex])
4182+ ?: ?=(?(%'(' %'[' %'~[' %'|=(' %'$-(' %str-head) k)
4183+ $(toks t.toks, open [beg.at.t open])
4184+ ?. ?=(?(%')' %']' %str-mid %str-tail) k) $(toks t.toks)
4185+ ?~ open $(toks t.toks)
4186+ %= $
4187+ toks t.toks
4188+ mat (~(put by mat) i.open beg.at.t)
4189+ open ?:(?=(%str-mid k) [beg.at.t t.open] t.open)
4190+ ==
4191+::
4192+:: +kind-of: a token's kind: a glyph, or its lexeme's tag
4193+::
4194+++ kind-of
4195+ |= t=token
4196+ ^- @
4197+ ?@(lex.t lex.t -.lex.t)
4198+::
4199+:: +check-kids: nodes in source order, inside the span in, each checked
4200+::
4201+++ check-kids
4202+ |= $: idx=[info=(map loc tinfo) mat=(map loc loc)]
4203+ in=(unit span)
4204+ os=(list outline)
4205+ ==
4206+ ^- (unit tape)
4207+ =| prev=(unit span)
4208+ |- ^- (unit tape)
4209+ ?~ os ~
4210+ =* o i.os
4211+ ?: &(?=(^ in) (loc-lth beg.at.o beg.u.in))
4212+ `(span-bad o "starts before its parent")
4213+ ?: &(?=(^ in) (loc-lth end.u.in end.at.o))
4214+ `(span-bad o "ends after its parent")
4215+ ?: &(?=(^ prev) (loc-lth beg.at.o end.u.prev))
4216+ `(span-bad o "starts before the node before it ends")
4217+ =/ bad=(unit tape) (check-outline idx o)
4218+ ?^ bad bad
4219+ $(prev `at.o, os t.os)
4220+::
4221+:: +check-outline: one node's start and end, then its children
4222+::
4223+++ check-outline
4224+ |= [idx=[info=(map loc tinfo) mat=(map loc loc)] o=outline]
4225+ ^- (unit tape)
4226+ =* ks kids.o
4227+ =/ head=(unit span) ?~(ks ~ `at.i.ks)
4228+ =/ tail=(unit span) ?~(ks ~ `at:(rear ks))
4229+ ?. (loc-lth beg.at.o end.at.o) `(span-bad o "is empty")
4230+ :: the start: its own token, or its first child's
4231+ =/ start=(unit tape)
4232+ ?~ lead.o
4233+ ?~ head `"has no token or child to start with"
4234+ ?: =(beg.at.o beg.u.head) ~
4235+ `"should start where its first child does, at {(show-loc beg.u.head)}"
4236+ =/ t=(unit tinfo) (~(get by info.idx) beg.at.o)
4237+ ?~ t `"starts where no token does"
4238+ ?. (lien `(list @)`lead.o |=(a=@ =(a kind.u.t)))
4239+ `"starts at a token of a kind it can't start with"
4240+ ?: &(?=(^ head) !(loc-lth beg.at.o beg.u.head))
4241+ `"should start with its own token, before its first child"
4242+ ~
4243+ ?^ start `(span-bad o u.start)
4244+ :: the end: where +stop says
4245+ =/ want=(unit loc) (stop-of idx o tail)
4246+ ?~ want `(span-bad o "has no end that its tokens give")
4247+ ?. =(u.want end.at.o)
4248+ `(span-bad o "should end at {(show-loc u.want)}")
4249+ (check-kids idx `at.o ks)
4250+::
4251+:: +stop-of: where a node should end, from its stop, the tokens, and
4252+:: its last child's span, tail
4253+::
4254+++ stop-of
4255+ |= $: idx=[info=(map loc tinfo) mat=(map loc loc)]
4256+ o=outline
4257+ tail=(unit span)
4258+ ==
4259+ ^- (unit loc)
4260+ =* info info.idx
4261+ =/ first=(unit tinfo) (~(get by info) beg.at.o)
4262+ :: the token after the one at beg, if it is on the same line
4263+ =/ after
4264+ |= beg=loc
4265+ ^- (unit loc)
4266+ =/ t=(unit tinfo) (~(get by info) beg)
4267+ ?~ t ~
4268+ ?~ nex.u.t ~
4269+ `beg.u.nex.u.t
4270+ :: the end of the token at beg
4271+ =/ end-at
4272+ |= beg=loc
4273+ ^- (unit loc)
4274+ =/ t=(unit tinfo) (~(get by info) beg)
4275+ ?~(t ~ `end.u.t)
4276+ :: the closer of the opener at beg, else the last child
4277+ =/ shut
4278+ |= beg=loc
4279+ ^- (unit loc)
4280+ =/ c=(unit loc) (~(get by mat.idx) beg)
4281+ ?^ c (end-at u.c)
4282+ ?~(tail ~ `end.u.tail)
4283+ :: a path from the token at beg: each tight / and knot after it, and
4284+ :: each tight [ or ( to its closer, or a ( left open to the end of
4285+ :: the last child, whose lines it closed with
4286+ =/ run
4287+ |= beg=loc
4288+ ^- (unit loc)
4289+ |- ^- (unit loc)
4290+ =/ t=(unit tinfo) (~(get by info) beg)
4291+ ?~ t ~
4292+ =/ n nex.u.t
4293+ ?. &(?=(^ n) tight.u.n) `end.u.t
4294+ =/ nk=(unit tinfo) (~(get by info) beg.u.n)
4295+ ?~ nk `end.u.t
4296+ ?: ?=(?(%'/' %knot) kind.u.nk) $(beg beg.u.n)
4297+ ?. ?=(?(%'[' %'(') kind.u.nk) `end.u.t
4298+ =/ c=(unit loc) (~(get by mat.idx) beg.u.n)
4299+ ?^ c $(beg u.c)
4300+ ?. &(?=(%'(' kind.u.nk) ?=(^ tail)) `end.u.t
4301+ `end.u.tail
4302+ ?- stop.o
4303+ %kid ?~(tail ~ `end.u.tail)
4304+ %one (end-at beg.at.o)
4305+ %shut (shut beg.at.o)
4306+ %run (run beg.at.o)
4307+ %two =/(n (after beg.at.o) ?~(n ~ (end-at u.n)))
4308+ %shut2 =/(n (after beg.at.o) ?~(n ~ (shut u.n)))
4309+ ::
4310+ %run3
4311+ =/ n (after beg.at.o)
4312+ ?~ n ~
4313+ =/ m (after u.n)
4314+ ?~ m ~
4315+ (run u.m)
4316+ ::
4317+ %string
4318+ =/ beg=loc beg.at.o
4319+ |- ^- (unit loc)
4320+ =/ c=(unit loc) (~(get by mat.idx) beg)
4321+ ?~ c ~
4322+ =/ t=(unit tinfo) (~(get by info) u.c)
4323+ ?~ t ~
4324+ ?: ?=(%str-tail kind.u.t) `end.u.t
4325+ $(beg u.c)
4326+ ==
4327+::
4328+:: +span-bad: a span check's error, naming the node by kind and span
4329+::
4330+++ span-bad
4331+ |= [o=outline why=tape]
4332+ ^- tape
4333+ "({(trip kind.o)} {(show-loc beg.at.o)} to {(show-loc end.at.o)}) {why}"
4334+::
4335+:: +loc-lth: whether a comes before b
4336+::
4337+++ loc-lth
4338+ |= [a=loc b=loc]
4339+ ^- ?
4340+ ?| (lth line.a line.b)
4341+ &(=(line.a line.b) (lth col.a col.b))
4342+ ==
4343+::
4344+++ outline-import
4345+ |= i=import
4346+ ^- outline
4347+ ?- -.i
4348+ %sur [%sur at.i ~[%'/-'] %two ~]
4349+ %mark [%mark at.i ~[%'/%'] %two ~]
4350+ %jibb [%jibb at.i ~[%'/='] %run3 ~]
4351+ ==
4352+::
4353+++ outline-def
4354+ |= d=def
4355+ ^- outline
4356+ ?- -.d
4357+ %mold [%mold at.d ~[%'+$'] %kid ~[(outline-shape shape.d)]]
4358+ %value [%value at.d ~[%'++'] %kid ~[(outline-expr val.d)]]
4359+ ==
4360+::
4361+++ outline-expr
4362+ |= e=expr
4363+ ^- outline
4364+ ?- -.e
4365+ %lit [%lit at.e ~[%lit] %one ~]
4366+ %str (outline-str at.e pieces.e)
4367+ %path [%path at.e ~[%'/'] %run ~]
4368+ %wing [%wing at.e ~[%name %wing] %one ~]
4369+ %pair [%pair at.e ~[%name] %kid ~[(outline-expr val.e)]]
4370+ %unit [%unit at.e ~[%'`'] %kid ~[(outline-expr val.e)]]
4371+ %group [%group at.e ~[%'('] %shut ~[(outline-expr inner.e)]]
4372+ %list [%list at.e ~[%'~['] %shut (turn items.e outline-expr)]
4373+ %tuple [%tuple at.e ~[%'['] %shut (turn items.e outline-item)]
4374+ %ctor [%ctor at.e ~[%'|='] %two ~]
4375+ %crash [%crash at.e ~[%'!!'] %one ~]
4376+ ::
4377+ %qath
4378+ =/ ks=(list outline)
4379+ %+ murn segs.e
4380+ |=(s=qseg ?.(?=(%expr -.s) ~ `(outline-expr p.s)))
4381+ [%qath at.e ~[%'%/'] %run ks]
4382+ ::
4383+ %change
4384+ =/ ks=(list outline) (turn edits.e outline-edit)
4385+ [%change at.e ~[%name %wing] %shut2 ks]
4386+ ::
4387+ %gate-wide
4388+ =/ ks=(list outline)
4389+ ~[(outline-sample sample.e) (outline-expr body.e)]
4390+ [%gate-wide at.e ~[%'|=('] %shut ks]
4391+ ::
4392+ %call
4393+ [%call at.e ~ %kid [(outline-expr head.e) (turn args.e outline-expr)]]
4394+ ::
4395+ %gate
4396+ =/ ks=(list outline)
4397+ ~[(outline-sample sample.e) (outline-expr body.e)]
4398+ [%gate at.e ~[%'|='] %kid ks]
4399+ ::
4400+ %cast
4401+ =/ ks=(list outline) ~[(outline-shape shape.e) (outline-expr val.e)]
4402+ [%cast at.e ~[%'^-'] %kid ks]
4403+ ::
4404+ %trace
4405+ =/ ks=(list outline) ~[(outline-expr val.e) (outline-expr then.e)]
4406+ [%trace at.e ~[%'~&'] %kid ks]
4407+ ::
4408+ %branch
4409+ =/ ks=(list outline)
4410+ [(outline-expr subject.e) (turn arms.e outline-arm)]
4411+ [%branch at.e ~[%'?-'] %kid ks]
4412+ ::
4413+ %body
4414+ =/ ks=(list outline)
4415+ (snoc (turn defs.e outline-def) (outline-expr final.e))
4416+ [%body at.e ~ %kid ks]
4417+ ==
4418+::
4419+++ outline-str
4420+ |= [at=span ps=(list piece)]
4421+ ^- outline
4422+ =/ ks=(list outline)
4423+ (murn ps |=(p=piece ?.(?=(%expr -.p) ~ `(outline-expr p.p))))
4424+ ?~ ks [%str at ~[%str] %one ~]
4425+ [%str at ~[%str-head] %string ks]
4426+::
4427+++ outline-item
4428+ |= i=item
4429+ ^- outline
4430+ ?~ face.i [%item at.i ~ %kid ~[(outline-expr val.i)]]
4431+ [%face at.i ~[%name] %kid ~[(outline-expr val.i)]]
4432+::
4433+++ outline-edit
4434+ |= e=edit
4435+ ^- outline
4436+ [%edit at.e ~[%name] %kid ~[(outline-expr val.e)]]
4437+::
4438+++ outline-arm
4439+ |= a=arm
4440+ ^- outline
4441+ [%arm at.a ~ %kid ~[(outline-pattern pat.a) (outline-expr val.a)]]
4442+::
4443+++ outline-sample
4444+ |= s=sample
4445+ ^- outline
4446+ ?- -.s
4447+ %bind [%bind at.s ~[%name] %one ~]
4448+ %face [%face at.s ~[%name] %kid ~[(outline-shape shape.s)]]
4449+ %pun [%pun at.s ~[%'='] %two ~]
4450+ %cell [%cell at.s ~[%'['] %shut (turn items.s outline-sample)]
4451+ %bare [%bare at.s ~ %kid ~[(outline-shape shape.s)]]
4452+ ==
4453+::
4454+++ outline-pattern
4455+ |= p=pattern
4456+ ^- outline
4457+ ?- -.p
4458+ %lit [%lit at.p ~[%lit] %one ~]
4459+ %str [%str at.p ~[%str] %one ~]
4460+ %any [%any at.p ~[%'*'] %one ~]
4461+ %bind [%bind at.p ~[%name] %one ~]
4462+ %cell [%cell at.p ~[%'['] %shut (turn items.p outline-pattern)]
4463+ ==
4464+::
4465+++ outline-shape
4466+ |= s=shape
4467+ ^- outline
4468+ ?- -.s
4469+ %aura [%aura at.s ~[%aura] %one ~]
4470+ %noun [%noun at.s ~[%'*'] %one ~]
4471+ %void [%void at.s ~[%'!!'] %one ~]
4472+ %flag [%flag at.s ~[%'?'] %one ~]
4473+ %const [%const at.s ~[%lit] %one ~]
4474+ %ref [%ref at.s ~[%name %wing] %one ~]
4475+ %tvar [%tvar at.s ~[%tvar] %one ~]
4476+ %hole [%hole at.s ~[%'_'] %one ~]
4477+ %apply [%apply at.s ~[%'('] %shut (turn args.s outline-shape)]
4478+ %cell [%cell at.s ~[%'['] %shut (turn fields.s outline-sample)]
4479+ ::
4480+ %path
4481+ =/ ks=(list outline)
4482+ %+ murn segs.s
4483+ |= g=pseg
4484+ ^- (unit outline)
4485+ ?- -.g
4486+ %knot ~
4487+ %typed `[%typed at.g ~[%'['] %shut ~]
4488+ %inferred `[%typed at.g ~[%'['] %shut ~[[%hole hole-at.g ~[%'_'] %one ~]]]
4489+ ==
4490+ [%path at.s ~[%'/'] %run ks]
4491+ ::
4492+ %union
4493+ =/ ks=(list outline) (turn cases.s outline-shape)
4494+ [%union at.s ~ %kid ks]
4495+ ::
4496+ %fn
4497+ =/ ks=(list outline)
4498+ ~[(outline-shape sample.s) (outline-shape product.s)]
4499+ [%fn at.s ~[%'$-('] %shut ks]
4500+ ::
4501+ %generic
4502+ [%generic at.s ~[%'|$'] %kid ~[(outline-shape body.s)]]
4503+ ==
4504+::
4505+:: +check-spans-test: +check-spans's own test: ~, or what went wrong
4506+::
4507+:: Each case parses a source, checks that its spans pass, then moves
4508+:: the span of every node of a kind that starts at a place, as a
4509+:: parser bug would, and checks that +check-spans says so. Run it as
4510+:: tools/hoon check-spans-test, which prints <<>> when every case
4511+:: passes.
4512+::
4513+++ check-spans-test
4514+ ^- (list tape)
4515+ =/ cases=(list [src=@t bends=(list [kind=@tas beg=loc at=span])])
4516+ :~ :: a closed bracket ending before its closer, or at its parent's
4517+ :- '++ x [a [b c]]'
4518+ ~[[%tuple [1 9] [1 9] [1 13]] [%item [1 9] [1 9] [1 13]]]
4519+ :- '++ x [a [b c]]'
4520+ ~[[%tuple [1 9] [1 9] [1 15]] [%item [1 9] [1 9] [1 15]]]
4521+ :: a bracket starting at its parent's opener
4522+ :- '++ x [[b c] a]'
4523+ ~[[%tuple [1 7] [1 6] [1 12]] [%item [1 7] [1 6] [1 12]]]
4524+ :: a group without its ), a list at the next line, a call with )
4525+ :- '++ x ~[\0a (f a)\0a++ y 1'
4526+ :~ [%group [2 3] [2 3] [2 7]]
4527+ [%list [1 6] [1 6] [2 7]]
4528+ [%value [1 1] [1 1] [2 7]]
4529+ ==
4530+ :- '++ x ~[\0a (f a)\0a++ y 1'
4531+ ~[[%list [1 6] [1 6] [3 1]] [%value [1 1] [1 1] [3 1]]]
4532+ ['++ x ~[\0a (f a)\0a++ y 1' ~[[%call [2 4] [2 4] [2 8]]]]
4533+ :: a literal running on to the next one's end
4534+ ['++ x f 1 2' ~[[%lit [1 8] [1 8] [1 11]]]]
4535+ :: a path, a string, a change and a union cut short
4536+ ['++ x f /a/b c' ~[[%path [1 8] [1 8] [1 10]]]]
4537+ ['++ x f "a{b}c" d' ~[[%str [1 8] [1 8] [1 13]]]]
4538+ ['++ x m(a=1) b' ~[[%change [1 6] [1 6] [1 11]]]]
4539+ :- '+$ x\0a %a\0a %b'
4540+ ~[[%union [2 3] [2 3] [2 5]] [%mold [1 1] [1 1] [2 5]]]
4541+ :: a mold's cell before its closer, a typed segment past its own
4542+ :- '+$ x [a=[@ @] b=@]'
4543+ ~[[%cell [1 9] [1 9] [1 13]] [%face [1 7] [1 7] [1 13]]]
4544+ :- '+$ x [p=/a/[id=@ud]]'
4545+ :~ [%typed [1 12] [1 12] [1 21]]
4546+ [%path [1 9] [1 9] [1 21]]
4547+ [%face [1 7] [1 7] [1 21]]
4548+ ==
4549+ :: an inferred path aura's hole spanning its = as well
4550+ ['+$ x /a/[id=_]' ~[[%hole [1 13] [1 12] [1 14]]]]
4551+ :: an import's path cut short
4552+ ['/= c /ui/c' ~[[%jibb [1 1] [1 1] [1 11]]]]
4553+ :: brackets that close with the deeper lines, cut at their line's
4554+ :: end: a group and a list, an application path's (, a wide gate,
4555+ :: and a mold's [ left open
4556+ ['++ x (f ~[\0a 1' ~[[%group [1 6] [1 6] [1 11]]]]
4557+ ['++ x (f ~[\0a 1' ~[[%list [1 9] [1 9] [1 11]]]]
4558+ ['++ x %/a/(f ~[\0a 1' ~[[%qath [1 6] [1 6] [1 10]]]]
4559+ ['++ g |=(a ~[\0a 1' ~[[%gate-wide [1 6] [1 6] [1 13]]]]
4560+ :- '+$ x [\0a a=@\0a b=@'
4561+ ~[[%cell [1 6] [1 6] [2 6]] [%mold [1 1] [1 1] [2 6]]]
4562+ ==
4563+ %- zing
4564+ %+ turn cases
4565+ |= [src=@t bends=(list [kind=@tas beg=loc at=span])]
4566+ ^- (list tape)
4567+ =/ name=tape "`{(trip src)}`, {<bends>}"
4568+ =/ toks=(list token) (layout /test/jibb src)
4569+ =/ res (parse-tokens /test/jibb toks)
4570+ ?: ?=(%| -.res) ~["{name}: doesn't parse: {msg.p.res}"]
4571+ =/ os=(list outline)
4572+ %+ weld (turn imports.p.res outline-import)
4573+ (turn defs.p.res outline-def)
4574+ =/ true=(unit tape) (check-outlines toks os)
4575+ ?^ true ~["{name}: its true spans fail: {u.true}"]
4576+ =/ bent=(list outline)
4577+ =/ o=(list outline) os
4578+ |- ^- (list outline)
4579+ ?~ bends o
4580+ $(bends t.bends, o (bend-outlines o kind.i.bends beg.i.bends at.i.bends))
4581+ ?: =(bent os) ~["{name}: no such node"]
4582+ ?^ (check-outlines toks bent) ~
4583+ ~["{name}: not caught"]
4584+::
4585+:: +bend-outlines: os, with the span of each node of kind kind that
4586+:: starts at beg set to at, as a parser bug could set it
4587+::
4588+++ bend-outlines
4589+ |= [os=(list outline) kind=@tas beg=loc at=span]
4590+ ^- (list outline)
4591+ ?~ os ~
4592+ =/ o=outline i.os
4593+ =? at.o &(=(kind kind.o) =(beg beg.at.o)) at
4594+ :- o(kids $(os kids.o))
4595+ $(os t.os)
4596+::
4597++| %type-inference
4598+::
4599+:: Preliminary type inference substrate. These types are internal and do
4600+:: not yet represent every Jibb mold. In particular this is not a complete
4601+:: module checker. A substitution is an association list whose first entry
4602+:: for a variable is its binding. The occurs check prevents infinite types;
4603+:: recursive named molds need their own representation, not cyclic vars.
4604+:: Each top-level inferred definition generalizes its free variables, and
4605+:: a use instantiates them afresh. Binders inside a gate stay monomorphic;
4606+:: capital variables in molds share one allocation within the definition.
4607+:: Atom constraints tied to an explicit capital or an inferred sample
4608+:: are generalized and printed. Other aura variables remain unsupported until
4609+:: their defaulting and inferred generalization are implemented.
4610+:: Restricted-number promotion considers written capitals only; if there
4611+:: are none, it skips the otherwise unnecessary environment traversal.
4612+:: Bare @ is a separate unrestricted atom type. A directional fit check
4613+:: permits concrete atoms to widen to it, never the reverse. A fit that
4614+:: needs a not-yet-implemented constraint remains unsupported. Named unions
4615+:: retain origin and ordered arguments, including phantom arguments, apart
4616+:: from their display name. Generic cases must be disjoint for all arguments.
4617+:: Unnamed union printing is informational; it is not Jibb syntax.
4618+::
4619+:: `proj` is a reserved, type-directed operation, not an ordinary gate.
4620+:: The supported fragment selects uniquely faced fields from a known record
4621+:: in source order (reordering is a doc question). It records the original
4622+:: call, source and target types, and source axes with its definition;
4623+:: A single selected field keeps its face and uses one source axis.
4624+:: Checked module interfaces retain that evidence and their source, including
4625+:: the private prelude dependency. A later lowerer must replace the call by
4626+:: an inline gate applied to the operand once; no lowering is implemented yet.
4627+:: Ordinary fits never insert a projection. Unknown or variable-origin record
4628+:: spines, nested projected fields and projections in
4629+:: recursive groups remain unsupported. Directional fits bound faced-spine
4630+:: proofs to fewer than 1,024 cells; the projection planner has a separate
4631+:: 4,096-step bound. These are inference limits, not language limits.
4632+::
4633+:: Supported API imports derive request-gate types atomically for multiple
4634+:: paths, including one typed segment or one diff fold per case. Their checked
4635+:: ordinary definitions, mark molds and supported poke constructor are also
4636+:: exported. A selected /sur mold is checked through its trusted reader result;
4637+:: unused cores and other bindings are not independently validated. APIs
4638+:: with /= imports, separate scry paths, multiple parameters or diffs, or a
4639+:: parameter together with a fold remain unsupported. The unchanged todo API
4640+:: fits this fragment, including named closed fold gates.
4641+::
4642+:: Each case's source-derived schema and canonical API identity travel in a
4643+:: dependency closure bound to the exact supplied bundle, prelude, scope and
4644+:: trusted reader results. Unknown cached entries are rebuilt. Request-bearing
4645+:: closures are limited to 256 source paths and requests. This is type
4646+:: inference only: no request lowering, runtime schema validator or proof that
4647+:: an arbitrary ask value is watchable is supplied.
4648+::
4649+:: A closed gate sample may omit one outer face from a known input slot when
4650+:: its product is identical. Distinct written names, nested value faces,
4651+:: ambiguous cell tails and raw-variable-origin fits retain their prior rules.
4652+::
4653+:: In one synthetic eval of a 48-module deep and 48-module wide request-free
4654+:: graph, baseline versus certificate inference took 21.53 s versus 23.10 s
4655+:: elapsed (21.10 s versus 22.34 s CPU), including startup. The deep cache's
4656+:: jam grew from 2,402 to 4,209 bytes (+1,807 bytes). These single-run figures
4657+:: are not production memory or performance benchmarks.
4658+::
4659++$ itype
4660+ $~ [%var 0]
4661+ $% [%var id=@ud]
4662+ [%avar id=@ud]
4663+ [%rvar id=@ud]
4664+ [%nvar id=@ud]
4665+ [%rnvar id=@ud]
4666+ [%atom aura=@ta]
4667+ [%any-atom ~]
4668+ [%flag ~]
4669+ [%noun ~]
4670+ [%empty ~]
4671+ [%tag id=@ud literal=lit constructor=?]
4672+ [%const literal=lit]
4673+ [%collection name=term args=(list itype)]
4674+ [%recursive module=term name=term label=(unit @t)]
4675+ [%jrec at=path name=term label=(unit @t) head=term aura=@ta tail=term]
4676+ [%grec at=path name=term label=(unit @t) proof=shape args=(list itype)]
4677+ [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
4678+ [%face name=term body=itype]
4679+ [%fn sample=itype product=itype]
4680+ [%cell hed=itype tal=itype]
4681+ ==
4682++$ ibinding [id=@ud val=itype]
4683++$ isub (list ibinding)
4684++$ ipending [id=@ud literal=lit]
4685+::
4686+++ itype-lookup
4687+ |= [n=@ud sub=isub]
4688+ ^- (unit itype)
4689+ ?~ sub ~
4690+ ?: =(n id.i.sub) `val.i.sub
4691+ $(sub t.sub)
4692+::
4693+++ itype-walk
4694+ |= [t=itype sub=isub]
4695+ ^- itype
4696+ ?+ -.t t
4697+ %var
4698+ =/ found=(unit itype) (itype-lookup id.t sub)
4699+ ?~ found t
4700+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4701+ $(t u.found)
4702+ %avar
4703+ =/ found=(unit itype) (itype-lookup id.t sub)
4704+ ?~ found t
4705+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4706+ $(t u.found)
4707+ %rvar
4708+ =/ found=(unit itype) (itype-lookup id.t sub)
4709+ ?~ found t
4710+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4711+ $(t u.found)
4712+ %nvar
4713+ =/ found=(unit itype) (itype-lookup id.t sub)
4714+ ?~ found t
4715+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4716+ $(t u.found)
4717+ %rnvar
4718+ =/ found=(unit itype) (itype-lookup id.t sub)
4719+ ?~ found t
4720+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4721+ $(t u.found)
4722+ %tag
4723+ =/ found=(unit itype) (itype-lookup id.t sub)
4724+ ?~ found t
4725+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4726+ $(t u.found)
4727+ ==
4728+::
4729+:: Prove only emptiness; unknown types are never treated as empty.
4730+:: A shared node budget bounds each proof attempt.
4731+++ itype-empty-cases
4732+ |= [xs=(list itype) sub=isub fuel=@ud]
4733+ ^- (unit [empty=? left=@ud])
4734+ ?~ xs `[& fuel]
4735+ =/ first=(unit [empty=? left=@ud]) (itype-empty-proof i.xs sub fuel)
4736+ ?~ first ~
4737+ ?. empty.u.first `[| left.u.first]
4738+ $(xs t.xs, fuel left.u.first)
4739+++ itype-empty-proof
4740+ |= [typ=itype sub=isub fuel=@ud]
4741+ ^- (unit [empty=? left=@ud])
4742+ ?: =(0 fuel) ~
4743+ =. fuel (dec fuel)
4744+ =. typ (itype-walk typ sub)
4745+ ?- -.typ
4746+ %empty `[& fuel]
4747+ %face $(typ body.typ)
4748+ %cell
4749+ =/ left=(unit [empty=? left=@ud]) $(typ hed.typ)
4750+ ?~ left ~
4751+ ?: empty.u.left `[& left.u.left]
4752+ $(typ tal.typ, fuel left.u.left)
4753+ %union (itype-empty-cases cases.typ sub fuel)
4754+ * `[| fuel]
4755+ ==
4756+:: Prove reachability separately from emptiness. An unresolved fixed
4757+:: recursive type is not presumed inhabited. A written, still-unconstrained
4758+:: capital is existentially inhabited for pattern reachability; the normal
4759+:: definition-boundary checks reject subsequently constrained capitals.
4760+++ itype-inhabited-cases
4761+ |= [xs=(list itype) sub=isub caps=icaps fuel=@ud pending=?]
4762+ ^- (unit [result=?(%yes %no %unknown) left=@ud])
4763+ ?~ xs `[?:(pending %unknown %no) fuel]
4764+ =/ first=(unit [result=?(%yes %no %unknown) left=@ud])
4765+ (itype-inhabited-proof i.xs sub caps fuel)
4766+ ?~ first ~
4767+ ?: =(%yes result.u.first) first
4768+ $(xs t.xs, fuel left.u.first, pending |(pending =(%unknown result.u.first)))
4769+++ itype-inhabited-proof
4770+ |= [typ=itype sub=isub caps=icaps fuel=@ud]
4771+ ^- (unit [result=?(%yes %no %unknown) left=@ud])
4772+ ?: =(0 fuel) ~
4773+ =. fuel (dec fuel)
4774+ =. typ (itype-walk typ sub)
4775+ ?- -.typ
4776+ %empty `[%no fuel]
4777+ ?(%atom %any-atom %flag %const %noun %avar %rvar %nvar %rnvar %fn %jrec) `[%yes fuel]
4778+ %var
4779+ ?: (lien caps |=(c=icap (hole-same-variable typ (itype-walk [%var id.c] sub)))) `[%yes fuel]
4780+ `[%unknown fuel]
4781+ %face $(typ body.typ)
4782+ %cell
4783+ =/ head=(unit [result=?(%yes %no %unknown) left=@ud]) $(typ hed.typ)
4784+ ?~ head ~
4785+ ?: =(%no result.u.head) head
4786+ =/ tail=(unit [result=?(%yes %no %unknown) left=@ud]) $(typ tal.typ, fuel left.u.head)
4787+ ?~ tail ~
4788+ ?: =(%no result.u.tail) tail
4789+ ?: |(=(%unknown result.u.head) =(%unknown result.u.tail)) `[%unknown left.u.tail]
4790+ `[%yes left.u.tail]
4791+ %union (itype-inhabited-cases cases.typ sub caps fuel |)
4792+ %collection
4793+ ?. &(|(=(%list name.typ) =(%unit name.typ)) ?=([* ~] args.typ)) `[%unknown fuel]
4794+ `[%yes fuel]
4795+ %grec ?:((grec-tree-proof name.typ proof.typ) `[%yes fuel] `[%unknown fuel])
4796+ * `[%unknown fuel]
4797+ ==
4798+++ itype-live-cases
4799+ |= [xs=(list itype) sub=isub caps=icaps fuel=@ud]
4800+ ^- (unit (list itype))
4801+ ?~ xs `~
4802+ =/ first=(unit [result=?(%yes %no %unknown) left=@ud])
4803+ (itype-inhabited-proof i.xs sub caps fuel)
4804+ ?~ first ~
4805+ ?: =(%unknown result.u.first) ~
4806+ =/ rest=(unit (list itype)) $(xs t.xs, fuel left.u.first)
4807+ ?~ rest ~
4808+ ?: =(%no result.u.first) rest
4809+ `[i.xs u.rest]
4810+::
4811+++ itype-occurs
4812+ |= [n=@ud t=itype sub=isub]
4813+ ^- ?
4814+ =. t (itype-walk t sub)
4815+ ?- -.t
4816+ %var =(n id.t)
4817+ %avar =(n id.t)
4818+ %rvar =(n id.t)
4819+ %nvar =(n id.t)
4820+ %rnvar =(n id.t)
4821+ %atom |
4822+ %any-atom |
4823+ %flag |
4824+ %noun |
4825+ %empty |
4826+ %tag =(n id.t)
4827+ %const |
4828+ %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
4829+ %recursive |
4830+ %jrec |
4831+ %grec (lien args.t |=(c=itype (itype-occurs n c sub)))
4832+ %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
4833+ %face $(t body.t)
4834+ %fn |($(t sample.t) $(t product.t))
4835+ %cell |($(t hed.t) $(t tal.t))
4836+ ==
4837+::
4838+:: +itype-unify: consistent substitutions, or ~ for a mismatch
4839+::
4840+:: Different concrete auras conflict. A variable may become an atom or
4841+:: a function, but cannot contain itself. Aura-only variables and faces
4842+:: require further distinctions before this supports general Jibb.
4843+::
4844+++ itype-unify
4845+ |= [a=itype b=itype sub=isub]
4846+ ^- (unit isub)
4847+ =. a (itype-walk a sub)
4848+ =. b (itype-walk b sub)
4849+ ?: =(a b) `sub
4850+ ?: &(?=(%grec -.a) ?=(%grec -.b))
4851+ ?. &(=(at.a at.b) =(name.a name.b)) ~
4852+ (itype-unify-args args.a args.b sub)
4853+ ?: &(?=(%jrec -.a) ?=(%jrec -.b))
4854+ ?:(&(=(at.a at.b) =(name.a name.b) =(head.a head.b) =(aura.a aura.b) =(tail.a tail.b)) `sub ~)
4855+ ?: &(?=(%recursive -.a) ?=(%recursive -.b))
4856+ ?:(&(=(module.a module.b) =(name.a name.b)) `sub ~)
4857+ ?: &(?=(%union -.a) ?=(%union -.b))
4858+ ?. =(origin.a origin.b) ~
4859+ ?: &(?=(~ args.a) ?=(~ args.b)) ?:(=(cases.a cases.b) `sub ~)
4860+ ?~ origin.a ~
4861+ (itype-unify-args args.a args.b sub)
4862+ ?: &(?=(%collection -.a) ?=(%collection -.b))
4863+ ?. =(name.a name.b) ~
4864+ (itype-unify-args args.a args.b sub)
4865+ ?: ?=(%var -.a)
4866+ ?: (itype-occurs id.a b sub) ~
4867+ `[[id.a b] sub]
4868+ ?: ?=(%var -.b)
4869+ ?: (itype-occurs id.b a sub) ~
4870+ `[[id.b a] sub]
4871+ :: Arithmetic's aura variable excludes loobeans; decimal literals
4872+ :: remain defaultable until a later constraint makes them concrete.
4873+ ?: &(?=(%nvar -.a) ?=(%rvar -.b))
4874+ `[[id.b [%rnvar id.a]] [id.a [%rnvar id.a]] sub]
4875+ ?: &(?=(%rvar -.a) ?=(%nvar -.b))
4876+ `[[id.a [%rnvar id.b]] [id.b [%rnvar id.b]] sub]
4877+ ?: &(?=(%rnvar -.a) ?=(%rvar -.b)) `[[id.b a] sub]
4878+ ?: &(?=(%rvar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4879+ ?: &(?=(%rnvar -.a) ?=(%nvar -.b)) `[[id.b a] sub]
4880+ ?: &(?=(%nvar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4881+ ?: &(?=(%rnvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4882+ ?: &(?=(%avar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4883+ ?: ?=(%rnvar -.a)
4884+ ?. |(?=(%rnvar -.b) ?=(%atom -.b)) ~
4885+ `[[id.a b] sub]
4886+ ?: ?=(%rnvar -.b)
4887+ ?. ?=(%atom -.a) ~
4888+ `[[id.b a] sub]
4889+ ?: &(?=(%avar -.a) ?=(%rvar -.b)) `[[id.a b] sub]
4890+ ?: &(?=(%rvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4891+ ?: ?=(%rvar -.a)
4892+ ?. |(?=(%rvar -.b) ?=(%atom -.b)) ~
4893+ `[[id.a b] sub]
4894+ ?: ?=(%rvar -.b)
4895+ ?. ?=(%atom -.a) ~
4896+ `[[id.b a] sub]
4897+ :: The narrower decimal constraint survives a match with an atom
4898+ :: variable; decimal syntax alone does not make it a loobean.
4899+ ?: &(?=(%nvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4900+ ?: &(?=(%avar -.a) ?=(%nvar -.b)) `[[id.a b] sub]
4901+ ?: ?=(%nvar -.a)
4902+ ?. |(?=(%nvar -.b) ?=(%atom -.b)) ~
4903+ `[[id.a b] sub]
4904+ ?: ?=(%nvar -.b)
4905+ ?. ?=(%atom -.a) ~
4906+ `[[id.b a] sub]
4907+ ?: ?=(%avar -.a)
4908+ ?. |(?=(%avar -.b) ?=(%atom -.b) ?=(%any-atom -.b) ?=(%flag -.b)) ~
4909+ `[[id.a b] sub]
4910+ ?: ?=(%avar -.b)
4911+ ?. |(?=(%atom -.a) ?=(%any-atom -.a) ?=(%flag -.a)) ~
4912+ `[[id.b a] sub]
4913+ ?: &(?=(%const -.a) ?=(%const -.b))
4914+ ?:(=(val.literal.a val.literal.b) `sub ~)
4915+ ?: &(?=(%atom -.a) ?=(%atom -.b)) ~
4916+ ?: &(?=(%face -.a) ?=(%face -.b))
4917+ ?. =(name.a name.b) ~
4918+ $(a body.a, b body.b)
4919+ ?: &(?=(%fn -.a) ?=(%fn -.b))
4920+ =/ first=(unit isub) $(a sample.a, b sample.b)
4921+ ?~ first ~
4922+ $(a product.a, b product.b, sub u.first)
4923+ ?: &(?=(%cell -.a) ?=(%cell -.b))
4924+ =/ first=(unit isub) $(a hed.a, b hed.b)
4925+ ?~ first ~
4926+ $(a tal.a, b tal.b, sub u.first)
4927+ ~
4928+::
4929+++ itype-unify-args
4930+ |= [as=(list itype) bs=(list itype) sub=isub]
4931+ ^- (unit isub)
4932+ ?~ as ?~(bs `sub ~)
4933+ ?~ bs ~
4934+ =/ next=(unit isub) (itype-unify i.as i.bs sub)
4935+ ?~ next ~
4936+ $(as t.as, bs t.bs, sub u.next)
4937+::
4938+:: +itype-fit: one-way widening from an actual type to an expected type
4939+::
4940+:: An unknown variable used where @ is expected gains a fresh atom
4941+:: constraint. Function compatibility involving @ remains unknown.
4942+::
4943++$ ifit $%([%ok sub=isub next=@ud] [%bad ~] [%unknown ~])
4944+++ itype-has-any-atom
4945+ |= [t=itype sub=isub]
4946+ ^- ?
4947+ =. t (itype-walk t sub)
4948+ ?- -.t
4949+ %var |
4950+ %avar |
4951+ %rvar |
4952+ %nvar |
4953+ %rnvar |
4954+ %atom |
4955+ %any-atom &
4956+ %flag |
4957+ %noun |
4958+ %empty |
4959+ %tag |
4960+ %const |
4961+ %union |((lien cases.t |=(c=itype (itype-has-any-atom c sub))) (lien args.t |=(c=itype (itype-has-any-atom c sub))))
4962+ %recursive |
4963+ %jrec |
4964+ %grec (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4965+ %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4966+ %face $(t body.t)
4967+ %fn |($(t sample.t) $(t product.t))
4968+ %cell |($(t hed.t) $(t tal.t))
4969+ ==
4970+::
4971+::
4972+:: Hoon aura families are textual prefixes: @tD is in @t, and @uvJ
4973+:: is in @uv and @u. Jibb permits widening toward the prefix only.
4974+::
4975+++ aura-prefix
4976+ |= [parent=@ta child=@ta]
4977+ ^- ?
4978+ =/ a=tape (trip parent)
4979+ =/ b=tape (trip child)
4980+ |-
4981+ ?~ a &
4982+ ?~ b |
4983+ ?. =(i.a i.b) |
4984+ $(a t.a, b t.b)
4985+::
4986+:: Related auras in a structural unification need a common-type rule;
4987+:: until that rule is implemented, report an unknown rather than error.
4988+::
4989+++ itype-family-related-collection-args
4990+ |= [as=(list itype) bs=(list itype) sub=isub]
4991+ ^- ?
4992+ ?~ as |
4993+ ?~ bs |
4994+ ?: (itype-family-related i.as i.bs sub) &
4995+ $(as t.as, bs t.bs)
4996+::
4997+++ itype-family-related
4998+ |= [a=itype b=itype sub=isub]
4999+ ^- ?
5000+ =. a (itype-walk a sub)
5001+ =. b (itype-walk b sub)
5002+ ?: &(?=(%atom -.a) ?=(%atom -.b))
5003+ ?. !=(aura.a aura.b) |
5004+ |((aura-prefix aura.a aura.b) (aura-prefix aura.b aura.a))
5005+ ?: &(?=(%collection -.a) ?=(%collection -.b))
5006+ ?. =(name.a name.b) |
5007+ (itype-family-related-collection-args args.a args.b sub)
5008+ ?: &(?=(%face -.a) ?=(%face -.b))
5009+ ?. =(name.a name.b) |
5010+ $(a body.a, b body.b)
5011+ ?: &(?=(%cell -.a) ?=(%cell -.b))
5012+ |($(a hed.a, b hed.b) $(a tal.a, b tal.b))
5013+ ?: &(?=(%fn -.a) ?=(%fn -.b))
5014+ |($(a sample.a, b sample.b) $(a product.a, b product.b))
5015+ |
5016+::
5017+:: A branch whose two result types are already concrete can use an
5018+:: explicitly present parent aura (or @) as its result. This does not
5019+:: guess a parent for sibling auras or solve variable-dependent joins.
5020+::
5021+++ itype-has-fixed-atom
5022+ |= typ=itype
5023+ ^- ?
5024+ ?- -.typ
5025+ %var |
5026+ %avar |
5027+ %rvar |
5028+ %nvar |
5029+ %rnvar |
5030+ %atom &
5031+ %any-atom &
5032+ %flag &
5033+ %noun |
5034+ %empty |
5035+ %tag &
5036+ %const &
5037+ %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
5038+ %recursive |
5039+ %jrec |
5040+ %grec (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
5041+ %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
5042+ %face $(typ body.typ)
5043+ %fn |($(typ sample.typ) $(typ product.typ))
5044+ %cell |($(typ hed.typ) $(typ tal.typ))
5045+ ==
5046+::
5047+++ itype-concrete-join
5048+ |= [a=itype b=itype sub=isub]
5049+ ^- (unit itype)
5050+ =. a (itype-walk a sub)
5051+ =. b (itype-walk b sub)
5052+ ?: &(?=(%atom -.a) ?=(%atom -.b))
5053+ ?: (aura-prefix aura.a aura.b) `a
5054+ ?: (aura-prefix aura.b aura.a) `b
5055+ ~
5056+ ?: &(?=(%any-atom -.a) |(?=(%atom -.b) ?=(%flag -.b))) `a
5057+ ?: &(?=(%any-atom -.b) |(?=(%atom -.a) ?=(%flag -.a))) `b
5058+ ~
5059+::
5060+:: Unifying an already-bound tuple with a faced position would need to
5061+:: update the bound type. Until substitutions can retain that information,
5062+:: variable-dependent face merges stay unresolved.
5063+::
5064+++ itype-has-face
5065+ |= [t=itype sub=isub]
5066+ ^- ?
5067+ =. t (itype-walk t sub)
5068+ ?- -.t
5069+ %grec (lien args.t |=(c=itype (itype-has-face c sub)))
5070+ %collection (lien args.t |=(c=itype (itype-has-face c sub)))
5071+ %face &
5072+ %cell |($(t hed.t) $(t tal.t))
5073+ %fn |($(t sample.t) $(t product.t))
5074+ * |
5075+ ==
5076+::
5077+:: Closed function samples may omit a slot face, but a known name must
5078+:: match another known name. Keep nested value faces and require exact
5079+:: invariant compatibility; a faced tail against a cell is ambiguous.
5080+++ itype-closed-slot-match
5081+ |= [a=itype b=itype]
5082+ ^- ?
5083+ ?: &(?=(%face -.a) ?=(%face -.b))
5084+ ?. =(name.a name.b) |
5085+ ?=(^ (itype-unify body.a body.b ~))
5086+ ?: ?=(%face -.a) ?=(^ (itype-unify body.a b ~))
5087+ ?: ?=(%face -.b) ?=(^ (itype-unify a body.b ~))
5088+ ?=(^ (itype-unify a b ~))
5089+++ itype-closed-sample-match
5090+ |= [a=itype b=itype fuel=@ud]
5091+ ^- ?
5092+ ?: =(0 fuel) |
5093+ ?. &(?=(%cell -.a) ?=(%cell -.b)) |
5094+ ?. (itype-closed-slot-match hed.a hed.b) |
5095+ =/ x=itype tal.a
5096+ =/ y=itype tal.b
5097+ ?: &(?=(%cell -.x) ?=(%cell -.y))
5098+ ?=(^ (itype-unify x y ~))
5099+ ?: |(&(?=(%face -.x) ?=(%cell -.y)) &(?=(%cell -.x) ?=(%face -.y))) |
5100+ (itype-closed-slot-match x y)
5101+++ itype-closed-gates-match
5102+ |= [a=itype b=itype]
5103+ ^- ?
5104+ ?. &(?=(%fn -.a) ?=(%fn -.b)) |
5105+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) |
5106+ ?. =(product.a product.b) |
5107+ ?^ (itype-vars a) |
5108+ ?^ (itype-vars b) |
5109+ ?: |((itype-has-tag a) (itype-has-tag b)) |
5110+ ?. (itype-closed-sample-match sample.a sample.b 1.024) |
5111+ ?=(^ (itype-unify product.a product.b ~))
5112+::
5113+++ itype-face-asym-collection-args
5114+ |= [as=(list itype) bs=(list itype) sub=isub]
5115+ ^- ?
5116+ ?~ as |
5117+ ?~ bs |
5118+ ?: (itype-face-asym i.as i.bs sub) &
5119+ $(as t.as, bs t.bs)
5120+::
5121+++ itype-face-asym
5122+ |= [a=itype b=itype sub=isub]
5123+ ^- ?
5124+ =. a (itype-walk a sub)
5125+ =. b (itype-walk b sub)
5126+ ?: &(?=(%grec -.a) ?=(%grec -.b))
5127+ ?. &(=(at.a at.b) =(name.a name.b)) |
5128+ (itype-face-asym-collection-args args.a args.b sub)
5129+ ?: &(?=(%collection -.a) ?=(%collection -.b))
5130+ ?. =(name.a name.b) |
5131+ (itype-face-asym-collection-args args.a args.b sub)
5132+ ?: &(?=(%face -.a) ?=(%face -.b)) $(a body.a, b body.b)
5133+ ?: ?=(%face -.a) !|(?=(%var -.b) ?=(%avar -.b) ?=(%rvar -.b) |(?=(%nvar -.b) ?=(%rnvar -.b)))
5134+ ?: ?=(%face -.b) !|(?=(%var -.a) ?=(%avar -.a) ?=(%rvar -.a) |(?=(%nvar -.a) ?=(%rnvar -.a)))
5135+ ?: &(?=(%cell -.a) ?=(%cell -.b)) |($(a hed.a, b hed.b) $(a tal.a, b tal.b))
5136+ ?: &(?=(%fn -.a) ?=(%fn -.b)) |($(a sample.a, b sample.b) $(a product.a, b product.b))
5137+ |
5138+::
5139+:: A successful cast keeps any explicit faces from either side while
5140+:: retaining the target's aura choices. Both faces have already matched.
5141+::
5142+++ itype-merge-faces
5143+ |= [actual=itype expected=itype sub=isub]
5144+ ^- itype
5145+ =. actual (itype-walk actual sub)
5146+ =. expected (itype-walk expected sub)
5147+ ?: &(?=(%face -.actual) ?=(%face -.expected))
5148+ [%face name.expected $(actual body.actual, expected body.expected)]
5149+ ?: ?=(%face -.actual)
5150+ [%face name.actual $(actual body.actual)]
5151+ ?: ?=(%face -.expected)
5152+ [%face name.expected $(expected body.expected)]
5153+ ?: &(?=(%cell -.actual) ?=(%cell -.expected))
5154+ [%cell $(actual hed.actual, expected hed.expected) $(actual tal.actual, expected tal.expected)]
5155+ expected
5156+::
5157+:: Positional call arguments do not write the sample's enclosing field
5158+:: labels. Ignore one raw sample-slot face per written argument while
5159+:: checking value faces as usual. An unknown or variable-bound cell spine
5160+:: cannot justify this distinction, so keep the existing conservative guard.
5161+++ itype-positional-slot-face-asym
5162+ |= [actual=itype expected=itype sub=isub]
5163+ ^- ?
5164+ ?: &(?=(%fn -.actual) ?=(%fn -.expected) (itype-closed-gates-match actual expected)) |
5165+ (itype-face-asym actual expected sub)
5166+::
5167+++ itype-positional-face-asym
5168+ |= [args=(list expr) actual=itype expected=itype sub=isub]
5169+ ^- ?
5170+ ?~ args &
5171+ ?~ t.args
5172+ =/ slot=itype expected
5173+ =? slot ?=(%face -.slot) body.slot
5174+ (itype-positional-slot-face-asym actual slot sub)
5175+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) &
5176+ =/ slot=itype hed.expected
5177+ =? slot ?=(%face -.slot) body.slot
5178+ ?: (itype-positional-slot-face-asym hed.actual slot sub) &
5179+ $(args t.args, actual tal.actual, expected tal.expected)
5180+::
5181+++ itype-output-may-be-cell
5182+ |= [t=itype sub=isub]
5183+ ^- ?
5184+ =. t (itype-walk t sub)
5185+ ?- -.t
5186+ %var &
5187+ %cell &
5188+ %union &
5189+ %recursive &
5190+ %jrec &
5191+ %grec &
5192+ %noun &
5193+ %collection &
5194+ %face $(t body.t)
5195+ %fn |($(t sample.t) $(t product.t))
5196+ * |
5197+ ==
5198+::
5199+++ pending-tags
5200+ |= [tags=(list ipending) sub=isub]
5201+ ^- ?
5202+ ?~ tags |
5203+ ?~ (itype-lookup id.i.tags sub) &
5204+ $(tags t.tags)
5205+::
5206+++ pending-null
5207+ |= [tags=(list ipending) sub=isub]
5208+ ^- ?
5209+ ?~ tags |
5210+ ?: &(?=(%null form.literal.i.tags) ?=(~ (itype-lookup id.i.tags sub))) &
5211+ $(tags t.tags)
5212+::
5213+:: Tags remain constrained until a mold selects a case or permitted atom
5214+:: type. Never generalize an unresolved tag through aliases or cells.
5215+::
5216+++ itype-has-tag
5217+ |= t=itype
5218+ ^- ?
5219+ ?- -.t
5220+ %tag &
5221+ %grec (lien args.t |=(c=itype (itype-has-tag c)))
5222+ %collection (lien args.t |=(c=itype (itype-has-tag c)))
5223+ %face $(t body.t)
5224+ %fn |($(t sample.t) $(t product.t))
5225+ %cell |($(t hed.t) $(t tal.t))
5226+ %union |((lien cases.t |=(c=itype (itype-has-tag c))) (lien args.t |=(c=itype (itype-has-tag c))))
5227+ * |
5228+ ==
5229+::
5230+++ itype-has-union
5231+ |= t=itype
5232+ ^- ?
5233+ ?- -.t
5234+ %union &
5235+ %grec (lien args.t |=(c=itype (itype-has-union c)))
5236+ %collection (lien args.t |=(c=itype (itype-has-union c)))
5237+ %face $(t body.t)
5238+ %fn |($(t sample.t) $(t product.t))
5239+ %cell |($(t hed.t) $(t tal.t))
5240+ * |
5241+ ==
5242+::
5243+:: Until a visible generic alias can be selected, expanding a named
5244+:: generic union would hide phantom arguments and its origin. This is a
5245+:: limitation of partial inference, not the unnamed-union print notation.
5246+::
5247+++ itype-has-hidden-generic
5248+ |= t=itype
5249+ ^- ?
5250+ ?- -.t
5251+ %union
5252+ ?: &(?=(~ label.t) ?=(^ args.t)) &
5253+ (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
5254+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-generic c))))
5255+ %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
5256+ %face $(t body.t)
5257+ %fn |($(t sample.t) $(t product.t))
5258+ %cell |($(t hed.t) $(t tal.t))
5259+ * |
5260+ ==
5261+::
5262+++ itype-has-recursive
5263+ |= t=itype
5264+ ^- ?
5265+ ?- -.t
5266+ %recursive &
5267+ %jrec &
5268+ %grec &
5269+ %collection (lien args.t |=(c=itype (itype-has-recursive c)))
5270+ %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
5271+ %face $(t body.t)
5272+ %cell |($(t hed.t) $(t tal.t))
5273+ %fn |($(t sample.t) $(t product.t))
5274+ * |
5275+ ==
5276+::
5277+++ itype-has-hidden-recursive
5278+ |= t=itype
5279+ ^- ?
5280+ ?- -.t
5281+ %recursive ?=(~ label.t)
5282+ %jrec ?=(~ label.t)
5283+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-recursive c))))
5284+ %collection (lien args.t |=(c=itype (itype-has-hidden-recursive c)))
5285+ %union (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-recursive c)))
5286+ %face $(t body.t)
5287+ %cell |($(t hed.t) $(t tal.t))
5288+ %fn |($(t sample.t) $(t product.t))
5289+ * |
5290+ ==
5291+::
5292+++ itype-fit-cases
5293+ |= [actual=itype cases=(list itype) sub=isub next=@ud]
5294+ ^- ifit
5295+ =/ good=(unit ifit) ~
5296+ =/ pending=? |
5297+ |-
5298+ ?~ cases
5299+ ?: pending [%unknown ~]
5300+ ?~ good [%bad ~]
5301+ u.good
5302+ =/ trial=ifit (itype-fit actual i.cases sub next)
5303+ ?- -.trial
5304+ %unknown $(cases t.cases, pending &)
5305+ %bad $(cases t.cases)
5306+ %ok
5307+ ?^ good [%unknown ~]
5308+ $(cases t.cases, good `trial)
5309+ ==
5310+::
5311+:: A constructor needs a case whose head has the same literal noun as its
5312+:: tag. An unresolved or opaque case may reveal one later, so it cannot
5313+:: prove a mismatch or a unique match. A broad atom mold is not a case.
5314+::
5315+++ itype-fit-ctor-cases
5316+ |= [tag=lit sample=itype cases=(list itype) sub=isub next=@ud]
5317+ ^- ifit
5318+ =/ found=(unit ifit) ~
5319+ =/ pending=? |
5320+ |-
5321+ ?~ cases
5322+ ?: pending [%unknown ~]
5323+ ?~ found [%bad ~]
5324+ u.found
5325+ =/ raw=itype i.cases
5326+ ?: ?=(%var -.raw)
5327+ $(cases t.cases, pending &)
5328+ =/ c=itype (itype-walk raw sub)
5329+ ?: ?=(?(%var %tag %recursive %jrec %grec %union %face) -.c)
5330+ $(cases t.cases, pending &)
5331+ ?. ?=(%cell -.c) $(cases t.cases)
5332+ =/ raw-head=itype hed.c
5333+ ?: ?=(%var -.raw-head)
5334+ $(cases t.cases, pending &)
5335+ =/ head=itype (itype-walk raw-head sub)
5336+ :: A single faced, explicitly atom-only head cannot be the tag case.
5337+ :: Do not follow variables or peel nested faces for this negative proof.
5338+ ?: ?=(%face -.head)
5339+ ?: ?=(?(%atom %any-atom %flag %avar %rvar %nvar %rnvar) -.body.head)
5340+ $(cases t.cases)
5341+ $(cases t.cases, pending &)
5342+ ?: ?=(?(%var %tag %recursive %jrec %grec %union) -.head)
5343+ $(cases t.cases, pending &)
5344+ ?. ?=(%const -.head) $(cases t.cases)
5345+ ?. =(val.literal.head val.tag) $(cases t.cases)
5346+ :: Equal heads can have disjoint payloads. Test each from the original
5347+ :: substitution; a unique success is usable only with no unknown rival.
5348+ =/ trial=ifit (itype-fit sample tal.c sub next)
5349+ ?- -.trial
5350+ %bad $(cases t.cases)
5351+ %unknown $(cases t.cases, pending &)
5352+ %ok
5353+ ?^ found [%unknown ~]
5354+ $(cases t.cases, found `trial)
5355+ ==
5356+::
5357+++ itype-fit
5358+ |= [actual=itype expected=itype sub=isub next=@ud]
5359+ ^- ifit
5360+ =/ result=ifit (itype-fit-inner actual expected sub next | |)
5361+ ?: ?=(%ok -.result) result
5362+ =/ source=itype (itype-walk actual sub)
5363+ ?. ?=(?(%empty %face %cell %union) -.source) result
5364+ =/ empty=(unit [empty=? left=@ud]) (itype-empty-proof actual sub 256)
5365+ ?~ empty [%unknown ~]
5366+ ?: empty.u.empty [%ok sub next]
5367+ result
5368+++ itype-fit-inner
5369+ |= [actual=itype expected=itype sub=isub next=@ud skip-width=? spine-proof=?]
5370+ ^- ifit
5371+ ?: &(!skip-width ?=(%cell -.actual) ?=(%cell -.expected) |((width-spine-exhausted actual 1.024) (width-spine-exhausted expected 1.024)))
5372+ [%unknown ~]
5373+ =/ known=(unit [source=iwfields target=iwfields])
5374+ ?: skip-width ~
5375+ (width-known-shape actual expected sub)
5376+ =/ too-wide=? ?~(known | (gth (lent order.source.u.known) (lent order.target.u.known)))
5377+ ?: too-wide [%unknown ~]
5378+ =/ spine-checked=? |(spine-proof ?=(^ known))
5379+ =/ uncertain=?
5380+ |(?=(%var -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)) ?=(%var -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected)))
5381+ =/ actual-open=?
5382+ |(?=(%var -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)))
5383+ =. actual (itype-walk actual sub)
5384+ =. expected (itype-walk expected sub)
5385+ ?: =(actual expected) [%ok sub next]
5386+ ?: &(?=(%empty -.expected) |(?=(%cell -.actual) ?=(%face -.actual) ?=(%union -.actual) ?=(%grec -.actual) ?=(%recursive -.actual))) [%unknown ~]
5387+ :: The relation of the source loobean mold to explicit @f is not yet
5388+ :: established. Keep it unsupported rather than asserting a mismatch.
5389+ ?: &(?=(%flag -.actual) ?=(%atom -.expected) =(%f aura.expected)) [%unknown ~]
5390+ :: Any value can be used where a noun is expected. An unresolved
5391+ :: bare tag is fixed as a constant; a constructor still needs a gate.
5392+ ?: ?=(%noun -.expected)
5393+ ?: ?=(%tag -.actual)
5394+ ?: constructor.actual [%unknown ~]
5395+ [%ok [[id.actual expected] sub] next]
5396+ [%ok sub next]
5397+ :: An arbitrary noun is not known to fit a narrower type.
5398+ ?: &(?=(%noun -.actual) !?=(%var -.expected)) [%unknown ~]
5399+ ?: &(!uncertain ?=(%grec -.actual) ?=(%face -.expected)) $(expected body.expected)
5400+ ?: &(!uncertain ?=(%face -.actual) ?=(%grec -.expected)) $(actual body.actual)
5401+ ?: &(?=(%grec -.actual) ?=(%grec -.expected))
5402+ ?. &(=(at.actual at.expected) =(name.actual name.expected)) [%unknown ~]
5403+ =/ matched=(unit isub) (itype-unify-args args.actual args.expected sub)
5404+ ?~ matched [%unknown ~]
5405+ [%ok u.matched next]
5406+ ?: &(|(?=(%grec -.actual) ?=(%grec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5407+ ?: &(!uncertain ?=(%jrec -.actual) ?=(%face -.expected)) $(expected body.expected)
5408+ ?: &(!uncertain ?=(%face -.actual) ?=(%jrec -.expected)) $(actual body.actual)
5409+ ?: &(?=(%jrec -.actual) ?=(%jrec -.expected))
5410+ ?:(&(=(at.actual at.expected) =(name.actual name.expected) =(head.actual head.expected) =(aura.actual aura.expected) =(tail.actual tail.expected)) [%ok sub next] [%bad ~])
5411+ ?: &(|(?=(%jrec -.actual) ?=(%jrec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5412+ ?: &(?=(%recursive -.actual) ?=(%recursive -.expected))
5413+ ?:(&(=(module.actual module.expected) =(name.actual name.expected)) [%ok sub next] [%bad ~])
5414+ ?: &(|(?=(%recursive -.actual) ?=(%recursive -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5415+ ?: &(?=(%union -.actual) ?=(%union -.expected))
5416+ ?. =(origin.actual origin.expected) [%unknown ~]
5417+ ?: &(?=(~ args.actual) ?=(~ args.expected))
5418+ ?:(=(cases.actual cases.expected) [%ok sub next] [%unknown ~])
5419+ ?~ origin.actual [%unknown ~]
5420+ =/ unified=(unit isub) (itype-unify-args args.actual args.expected sub)
5421+ ?^ unified [%ok u.unified next]
5422+ [%unknown ~]
5423+ :: A known union can instantiate an unconstrained sample directly;
5424+ :: preserve unknown results for variable-bound union origins.
5425+ ?: &(!actual-open ?=(%union -.actual) ?=(%var -.expected))
5426+ ?~ origin.actual [%unknown ~]
5427+ =/ normalized=itype (itype-normalize actual sub)
5428+ ?: |((itype-has-tag normalized) (itype-has-recursive normalized) (itype-has-any-atom actual sub)) [%unknown ~]
5429+ =/ unified=(unit isub) (itype-unify actual expected sub)
5430+ ?~ unified [%unknown ~]
5431+ [%ok u.unified next]
5432+ :: A concrete union value in a tuple may acquire the expected field's
5433+ :: face. A variable-bound union still needs face propagation support.
5434+ ?: &(!uncertain ?=(%union -.actual) ?=(%face -.expected))
5435+ $(expected body.expected)
5436+ ?: ?=(%union -.actual) [%unknown ~]
5437+ ?: &(?=(%union -.expected) |(?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)))) [%unknown ~]
5438+ ?: &(?=(%union -.expected) !?=(%var -.actual))
5439+ (itype-fit-cases actual cases.expected sub next)
5440+ ?: ?=(%tag -.actual)
5441+ ?: ?=(%var -.expected)
5442+ =/ u=(unit isub) (itype-unify actual expected sub)
5443+ ?~ u [%bad ~]
5444+ [%ok u.u next]
5445+ ?: |(?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
5446+ ?: ?=(%face -.expected) $(expected body.expected)
5447+ ?: constructor.actual
5448+ ?. ?=(%fn -.expected) [%bad ~]
5449+ =/ product=itype (itype-walk product.expected sub)
5450+ =/ cases=(list itype) ?:(?=(%union -.product) cases.product ~[product])
5451+ =/ trial=ifit (itype-fit-ctor-cases literal.actual sample.expected cases sub next)
5452+ ?. ?=(%ok -.trial) trial
5453+ [%ok [[id.actual expected] sub.trial] next.trial]
5454+ :: Zero may be the empty list. A nested cell fit lacks the context
5455+ :: needed to resolve it here, so do not report a definite mismatch.
5456+ ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5457+ [%unknown ~]
5458+ ?: ?=(%const -.expected)
5459+ ?:(=(val.literal.actual val.literal.expected) [%ok [[id.actual expected] sub] next] [%bad ~])
5460+ ?: ?=(%atom -.expected)
5461+ ?: |(=(%tas aura.expected) =(%ta aura.expected))
5462+ [%ok [[id.actual expected] sub] next]
5463+ [%bad ~]
5464+ ?: ?=(%flag -.expected)
5465+ ?:(|(=(0 val.literal.actual) =(1 val.literal.actual)) [%ok [[id.actual expected] sub] next] [%bad ~])
5466+ ?: ?=(%any-atom -.expected) [%ok [[id.actual expected] sub] next]
5467+ [%bad ~]
5468+ ?: ?=(%const -.actual)
5469+ ?: ?=(%var -.expected)
5470+ =/ u=(unit isub) (itype-unify actual expected sub)
5471+ ?~ u [%bad ~]
5472+ [%ok u.u next]
5473+ ?: |(?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
5474+ ?: ?=(%face -.expected) $(expected body.expected)
5475+ ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5476+ [%unknown ~]
5477+ ?: ?=(%const -.expected)
5478+ ?:(=(val.literal.actual val.literal.expected) [%ok sub next] [%bad ~])
5479+ ?: ?=(%atom -.expected)
5480+ :: A loobean singleton must not silently widen into another aura.
5481+ ?: =(%loobean form.literal.actual)
5482+ ?: =(%f aura.expected) [%unknown ~]
5483+ [%bad ~]
5484+ ?: |(=(%tas aura.expected) =(%ta aura.expected)) [%ok sub next]
5485+ [%bad ~]
5486+ ?: ?=(%flag -.expected)
5487+ ?:(|(=(0 val.literal.actual) =(1 val.literal.actual)) [%ok sub next] [%bad ~])
5488+ ?: ?=(%any-atom -.expected) [%ok sub next]
5489+ [%bad ~]
5490+ ?: &(uncertain (itype-face-asym actual expected sub)) [%unknown ~]
5491+ :: A known face labels the same noun. Peel it before applying the
5492+ :: directional unrestricted-atom rule, preserving raw-variable guards.
5493+ ?: &(!uncertain ?=(%any-atom -.actual) ?=(%face -.expected))
5494+ $(expected body.expected, skip-width |, spine-proof |)
5495+ ?: &(!uncertain ?=(%any-atom -.expected) ?=(%face -.actual))
5496+ $(actual body.actual, skip-width |, spine-proof |)
5497+ ?: ?=(%any-atom -.expected)
5498+ ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)) ?=(%flag -.actual)) [%ok sub next]
5499+ ?: ?=(%var -.actual)
5500+ =/ unified=(unit isub) (itype-unify actual [%avar next] sub)
5501+ ?~ unified [%bad ~]
5502+ [%ok u.unified +(next)]
5503+ [%bad ~]
5504+ ?: ?=(%any-atom -.actual)
5505+ ?: ?=(%var -.expected)
5506+ =/ unified=(unit isub) (itype-unify actual expected sub)
5507+ ?~ unified [%bad ~]
5508+ [%ok u.unified next]
5509+ ?: |(?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
5510+ [%bad ~]
5511+ ?: &(?=(%atom -.actual) ?=(%atom -.expected))
5512+ ?: (aura-prefix aura.expected aura.actual) [%ok sub next]
5513+ ?: &((aura-prefix aura.actual aura.expected) uncertain) [%unknown ~]
5514+ [%bad ~]
5515+ ?: &(?=(%cell -.actual) ?=(%cell -.expected))
5516+ =/ first=ifit $(actual hed.actual, expected hed.expected, skip-width |, spine-proof |)
5517+ ?. ?=(%ok -.first) first
5518+ $(actual tal.actual, expected tal.expected, sub sub.first, next next.first, skip-width spine-checked, spine-proof spine-checked)
5519+ :: A field may add a face to an occurrence of the very same type
5520+ :: variable. Binding that variable to a face around itself would fail
5521+ :: the occurs check, but its underlying type has already matched.
5522+ ?: &(?=(%var -.actual) ?=(%face -.expected) =(actual (itype-walk body.expected sub)))
5523+ [%ok sub next]
5524+ :: Differing variables and faces need propagation that is not yet
5525+ :: represented. Binding one to the face can create a false mismatch.
5526+ ?: &(?=(%var -.actual) ?=(%face -.expected)) [%unknown ~]
5527+ ?: &(?=(%face -.actual) ?=(%var -.expected)) [%unknown ~]
5528+ ?: &(?=(%var -.actual) (itype-has-any-atom expected sub))
5529+ [%unknown ~]
5530+ ?: |(?=(%var -.actual) ?=(%var -.expected))
5531+ =/ unified=(unit isub) (itype-unify actual expected sub)
5532+ ?~ unified
5533+ ?: |(?=(%face -.actual) ?=(%face -.expected)) [%unknown ~]
5534+ ?: |((itype-has-recursive (itype-normalize actual sub)) (itype-has-recursive (itype-normalize expected sub))) [%unknown ~]
5535+ ?: (itype-family-related actual expected sub) [%unknown ~]
5536+ [%bad ~]
5537+ [%ok u.unified next]
5538+ ?: &(?=(%face -.actual) ?=(%face -.expected))
5539+ ?. =(name.actual name.expected) [%bad ~]
5540+ $(actual body.actual, expected body.expected, skip-width |, spine-proof |)
5541+ ?: ?=(%face -.actual) $(actual body.actual, skip-width |, spine-proof |)
5542+ ?: ?=(%face -.expected) $(expected body.expected, skip-width |, spine-proof |)
5543+ ?: &(!uncertain (itype-closed-gates-match actual expected)) [%ok sub next]
5544+ ?: (itype-face-asym actual expected sub) [%unknown ~]
5545+ ?: |((itype-has-any-atom actual sub) (itype-has-any-atom expected sub))
5546+ [%unknown ~]
5547+ =/ unified=(unit isub) (itype-unify actual expected sub)
5548+ ?~ unified
5549+ ?: |((itype-has-union (itype-normalize actual sub)) (itype-has-union (itype-normalize expected sub))) [%unknown ~]
5550+ ?: |((itype-has-recursive (itype-normalize actual sub)) (itype-has-recursive (itype-normalize expected sub))) [%unknown ~]
5551+ ?: (itype-family-related actual expected sub) [%unknown ~]
5552+ [%bad ~]
5553+ [%ok u.unified next]
5554+::
5555+++ itype-unify-test
5556+ ^- (list tape)
5557+ =/ a=itype [%var 0]
5558+ =/ b=itype [%var 1]
5559+ =/ txt=itype [%atom %t]
5560+ =/ num=itype [%atom %ud]
5561+ =/ same=itype [%fn a a]
5562+ =/ mismatch=itype [%fn txt num]
5563+ =/ fine=itype [%fn txt txt]
5564+ =/ sub=(unit isub) (itype-unify a b ~)
5565+ ?~ sub ~["variables should unify"]
5566+ =/ sub2=(unit isub) (itype-unify b txt u.sub)
5567+ ?~ sub2 ~["a chained variable should unify"]
5568+ =/ problems=(list tape) ~
5569+ =? problems !=((itype-walk a u.sub2) txt)
5570+ ["substitutions should follow chains" problems]
5571+ =? problems ?=(^ (itype-unify txt num ~))
5572+ ["different concrete auras should conflict" problems]
5573+ =? problems ?=(^ (itype-unify a [%fn a txt] ~))
5574+ ["occurs check should reject an infinite type" problems]
5575+ =? problems ?=(^ (itype-unify same mismatch ~))
5576+ ["a shared type variable should reject incompatible arguments" problems]
5577+ =? problems ?=(~ (itype-unify same fine ~))
5578+ ["a shared type variable should accept equal arguments" problems]
5579+ =/ list-a=itype [%collection %list ~[a]]
5580+ =/ list-t=itype [%collection %list ~[txt]]
5581+ =/ list-n=itype [%collection %list ~[num]]
5582+ =? problems ?=(^ (itype-unify a list-a ~))
5583+ ["occurs check should look through collection arguments" problems]
5584+ =? problems !=((itype-vars list-a) ~[0])
5585+ ["generalization should see collection argument variables" problems]
5586+ =? problems !=((itype-rename list-a ~[[0 num]]) list-n)
5587+ ["instantiation should rename collection argument variables" problems]
5588+ =? problems ?=(^ (itype-unify list-t list-n ~))
5589+ ["collection arguments with different auras should conflict" problems]
5590+ =? problems ?=(^ (itype-unify list-t [%collection %unit ~[txt]] ~))
5591+ ["different collection names should conflict" problems]
5592+ =? problems !(itype-family-related list-t [%collection %list ~[[%atom 'tD']]] ~)
5593+ ["collection arguments should preserve aura-family uncertainty" problems]
5594+ =? problems !(itype-face-asym [%collection %list ~[[%face %x txt]]] list-t ~)
5595+ ["collection arguments should preserve face uncertainty" problems]
5596+ =/ recursive=itype [%recursive %fixture %chain `'chain.fixture']
5597+ =/ same-recursive=itype [%recursive %fixture %chain ~]
5598+ =/ other-recursive=itype [%recursive %other %chain `'chain.other']
5599+ =? problems ?=(~ (itype-unify recursive same-recursive ~))
5600+ ["recursive identity should not depend on its visible name" problems]
5601+ =? problems ?=(^ (itype-unify recursive other-recursive ~))
5602+ ["recursive identity should include the source module" problems]
5603+ =/ recursive-fit=ifit (itype-fit recursive txt ~ 0)
5604+ =? problems !?=(%unknown -.recursive-fit)
5605+ ["opaque recursive types should not be unfolded by a fit" problems]
5606+ =/ nested-fit=ifit
5607+ (itype-fit [%collection %list ~[a]] list-t ~[[0 recursive]] 1)
5608+ =? problems !?=(%unknown -.nested-fit)
5609+ ["recursive types behind substitutions should remain uncertain" problems]
5610+ problems
5611+::
5612+:: The expression inference below is deliberately a fragment: bindings,
5613+:: simple gates, calls, fixed-aura literals, and some interpolated strings. The
5614+:: result for unsupported syntax is a diagnostic, never a checked module.
5615+::
5616++$ ischeme [typ=itype vars=(list @ud)]
5617++$ ienv (list [name=term scheme=ischeme])
5618++$ imold-types (list [name=term template=ischeme])
5619++$ iderived [name=term agent=term mark=term]
5620++$ iwidth-definition [name=term original=expr typ=itype sub=isub projections=(list iwprojection)]
5621++$ iwidth-dependency [at=path source=(unit @t) definitions=(list iwidth-definition)]
5622+:: Nonrecursive request evidence is compiler-owned metadata, not a property
5623+:: of an arbitrary ask value. Reader graphs and source inputs are trusted.
5624++$ irequest-evidence
5625+ [api-at=path name=term path=iapi-path-typed api-source=@t public-source=@t internal-source=@t prelude-values=(list term) prelude-molds=(list term) externals=iexternals marks=imark-externals]
5626+:: A unit distinguishes a verified empty closure from a detached legacy file.
5627+:: The opaque prelude is an exact trusted input, not a recursive interface mold.
5628++$ irequest-graph
5629+ [paths=(set path) requests=(list irequest-evidence) bundle-input=* prelude-input=* prelude-values=(list term) prelude-molds=(list term) externals=iexternals marks=imark-externals]
5630++$ ifile [values=ienv molds=imold-types at=path derived=(list iderived) elaborations=(list iwidth-definition) dependencies=(list iwidth-dependency) source=(unit @t) graph=(unit irequest-graph)]
5631++$ ijimports (list [face=term interface=ifile])
5632++$ icap [name=@t id=@ud at=span]
5633++$ icaps (list icap)
5634++$ iparams (list [name=@t typ=itype])
5635++$ imolds (list [name=term body=shape])
5636+:: A caller supplies the exact noun returned by +read-mold:jibb-import.
5637+:: This core has no Ford dependencies; unrecognized payloads fail closed.
5638++$ iexternals (list [module=term name=term result=*])
5639++$ imark-externals (list [mark=term result=*])
5640+:: Hole obligations survive discarded expressions until their owning
5641+:: definition has inferred; their source spans support unresolved reports.
5642++$ ihole [id=@ud at=span]
5643+:: Recursive-mold unfolding spends fuel in the threaded inference state.
5644+:: Retries can restart from an earlier state, so this bounds an attempt,
5645+:: not all parsing or module-checking work.
5646+:: Experimental: only closed, uniquely faced records have known axes.
5647++$ iwfield [name=term axis=@ud typ=itype]
5648++$ iwfields [order=(list iwfield) index=(map term iwfield)]
5649++$ iwstep [name=term axis=@ud]
5650++$ iwidth-result [steps=(list iwstep) sub=isub next=@ud]
5651++$ iwprojection [at=span original=expr source=itype target=itype steps=(list iwstep)]
5652+++ width-scan
5653+ |= [typ=itype sub=isub axis=@ud fuel=@ud]
5654+ ^- (unit iwfields)
5655+ =/ order=(list iwfield) ~
5656+ =/ index=(map term iwfield) *(map term iwfield)
5657+ |-
5658+ ?: =(0 fuel) ~
5659+ ?: |(?=(%var -.typ) ?=(%avar -.typ) ?=(%rvar -.typ) ?=(%nvar -.typ) ?=(%rnvar -.typ)) ~
5660+ ?: ?=(%face -.typ)
5661+ =/ entry=iwfield [name.typ axis body.typ]
5662+ ?: ?=(^ (~(get by index) name.entry)) ~
5663+ `[(flop [entry order]) (~(put by index) name.entry entry)]
5664+ ?. ?=(%cell -.typ) ~
5665+ =/ head=itype hed.typ
5666+ ?: |(?=(%var -.head) ?=(%avar -.head) ?=(%rvar -.head) ?=(%nvar -.head) ?=(%rnvar -.head)) ~
5667+ ?. ?=(%face -.head) ~
5668+ =/ entry=iwfield [name.head (mul 2 axis) body.head]
5669+ ?: ?=(^ (~(get by index) name.entry)) ~
5670+ $(typ tal.typ, axis +((mul 2 axis)), fuel (dec fuel), order [entry order], index (~(put by index) name.entry entry))
5671+++ width-in-order
5672+ |= [source=(list iwfield) target=(list iwfield)]
5673+ ^- ?
5674+ ?~ target &
5675+ ?~ source |
5676+ ?: =(name.i.source name.i.target) $(source t.source, target t.target)
5677+ $(source t.source)
5678+++ width-fit-fields
5679+ |= [source=(map term iwfield) target=(list iwfield) sub=isub next=@ud]
5680+ ^- (unit iwidth-result)
5681+ ?~ target `[~ sub next]
5682+ =/ found=(unit iwfield) (~(get by source) name.i.target)
5683+ ?~ found ~
5684+ =/ fit=ifit (itype-fit typ.u.found typ.i.target sub next)
5685+ ?. ?=(%ok -.fit) ~
5686+ =/ rest=(unit iwidth-result) $(target t.target, sub sub.fit, next next.fit)
5687+ ?~ rest ~
5688+ `[[[name.i.target axis.u.found] steps.u.rest] sub.u.rest next.u.rest]
5689+++ width-spine-exhausted
5690+ |= [t=itype fuel=@ud]
5691+ ^- ?
5692+ ?: =(0 fuel) &
5693+ ?. ?=(%cell -.t) |
5694+ ?. ?=(%face -.hed.t) |
5695+ $(t tal.t, fuel (dec fuel))
5696+++ width-known-shape
5697+ |= [actual=itype expected=itype sub=isub]
5698+ ^- (unit [source=iwfields target=iwfields])
5699+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
5700+ =/ source=(unit iwfields) (width-scan actual sub 1 1.024)
5701+ =/ target=(unit iwfields) (width-scan expected sub 1 1.024)
5702+ ?~ source ~
5703+ ?~ target ~
5704+ `[u.source u.target]
5705+::
5706+++ width-shape
5707+ |= [actual=itype expected=itype sub=isub]
5708+ ^- (unit [source=iwfields target=iwfields])
5709+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
5710+ =/ source=(unit iwfields) (width-scan actual sub 1 4.096)
5711+ =/ target=(unit iwfields) (width-scan expected sub 1 4.096)
5712+ ?~ source ~
5713+ ?~ target ~
5714+ ?. (gth (lent order.u.source) (lent order.u.target)) ~
5715+ `[u.source u.target]
5716+++ width-proj-shape
5717+ |= [actual=itype expected=itype sub=isub]
5718+ ^- (unit [source=iwfields target=iwfields])
5719+ ?. &(|(?=(%cell -.actual) ?=(%face -.actual)) |(?=(%cell -.expected) ?=(%face -.expected))) ~
5720+ =/ source=(unit iwfields) (width-scan actual sub 1 4.096)
5721+ =/ target=(unit iwfields) (width-scan expected sub 1 4.096)
5722+ ?~ source ~
5723+ ?~ target ~
5724+ ?: (lth (lent order.u.source) (lent order.u.target)) ~
5725+ `[u.source u.target]
5726+::
5727+++ width-project
5728+ |= [shape=[source=iwfields target=iwfields] sub=isub next=@ud]
5729+ ^- (unit iwidth-result)
5730+ ?. (width-in-order order.source.shape order.target.shape) ~
5731+ (width-fit-fields index.source.shape order.target.shape sub next)
5732+::
5733+:: Provisional, globally budgeted gate-free proof. %no includes a
5734+:: gate-bearing witness; an uninhabited sibling could invalidate it.
5735+:: Input types must be resolved and normalized under valid substitutions,
5736+:: from trusted source-backed interfaces and reader results. Collection
5737+:: list/unit names rely on their existing identity invariant; this arm
5738+:: does not validate fabricated internal types.
5739++$ igf-segment
5740+ $% [%field name=term]
5741+ [%head ~]
5742+ [%tail ~]
5743+ [%item ~]
5744+ [%case index=@ud]
5745+ ==
5746++$ igate-free [verdict=?(%yes %no %unknown) inhabited=? left=@ud path=(unit (list igf-segment))]
5747+++ gate-free-types
5748+ |= [types=(list itype) fuel=@ud path=(list igf-segment) index=@ud]
5749+ ^- igate-free
5750+ ?~ types [%yes | fuel ~]
5751+ ?: =(0 fuel) [%unknown | 0 ~]
5752+ =/ first=igate-free (gate-free-type i.types fuel [[%case index] path])
5753+ ?: =(%no verdict.first) first
5754+ =/ rest=igate-free $(types t.types, fuel left.first, index +(index))
5755+ ?: =(%no verdict.rest) rest
5756+ =/ inhabited=? |(inhabited.first inhabited.rest)
5757+ ?: |(=(%unknown verdict.first) =(%unknown verdict.rest)) [%unknown inhabited left.rest ~]
5758+ [%yes inhabited left.rest ~]
5759+++ gate-free-type
5760+ |= [typ=itype fuel=@ud path=(list igf-segment)]
5761+ ^- igate-free
5762+ ?: =(0 fuel) [%unknown | 0 ~]
5763+ =. fuel (dec fuel)
5764+ ?- -.typ
5765+ %fn [%no & fuel `(flop path)]
5766+ %atom [%yes & fuel ~]
5767+ %any-atom [%yes & fuel ~]
5768+ %flag [%yes & fuel ~]
5769+ %const [%yes & fuel ~]
5770+ %face $(typ body.typ, path [[%field name.typ] path])
5771+ %cell
5772+ =/ head=igate-free $(typ hed.typ, path [[%head ~] path])
5773+ =/ tail=igate-free $(typ tal.typ, fuel left.head, path [[%tail ~] path])
5774+ =/ inhabited=? &(inhabited.head inhabited.tail)
5775+ ?: |(&(=(%yes verdict.head) !inhabited.head) &(=(%yes verdict.tail) !inhabited.tail)) [%yes | left.tail ~]
5776+ ?: &(=(%no verdict.head) inhabited.tail) head(left left.tail)
5777+ ?: &(=(%no verdict.tail) inhabited.head) tail
5778+ ?: |(!=(%yes verdict.head) !=(%yes verdict.tail)) [%unknown inhabited left.tail ~]
5779+ [%yes inhabited left.tail ~]
5780+ %collection
5781+ ?. |(=(%list name.typ) =(%unit name.typ)) [%unknown | fuel ~]
5782+ ?. ?=([* ~] args.typ) [%unknown | fuel ~]
5783+ =/ item=igate-free $(typ i.args.typ, path [[%item ~] path])
5784+ item(inhabited &)
5785+ %union
5786+ ?~ cases.typ [%unknown | fuel ~]
5787+ (gate-free-types cases.typ fuel path 0)
5788+ %noun [%unknown & fuel ~]
5789+ %empty [%yes | fuel ~]
5790+ %var [%unknown | fuel ~]
5791+ %avar [%yes & fuel ~]
5792+ %rvar [%yes & fuel ~]
5793+ %nvar [%yes & fuel ~]
5794+ %rnvar [%yes & fuel ~]
5795+ %tag [%unknown | fuel ~]
5796+ %recursive [%unknown | fuel ~]
5797+ %jrec [%yes & fuel ~]
5798+ %grec [%unknown | fuel ~]
5799+ ==
5800+::
5801++$ igate-prelude-evidence [iface=ifile gates=(map term def)]
5802++$ dgo [left=itype right=itype at=span context=span]
5803++$ istate [next=@ud sub=isub caps=icaps binders=(list @ud) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) params=iparams active=(list term) tags=(list ipending) in-mold=? at=path top-molds=(list term) prelude=(unit ifile) holes=(list ihole) jrec-fuel=@ud projections=(list iwprojection) gate-defs=(map term def) head-evidence=(unit igate-prelude-evidence) grec-index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)]) defer=(unit ~) obligations=(list dgo)]
5804++$ idiag [msg=tape sites=(list [at=span note=tape])]
5805++$ iresult (each [typ=itype state=istate] idiag)
5806++$ isample-result (each [typ=itype env=ienv state=istate] tape)
5807+::
5808+++ ienv-lookup
5809+ |= [name=term env=ienv]
5810+ ^- (unit ischeme)
5811+ ?~ env ~
5812+ ?: =(name name.i.env) `scheme.i.env
5813+ $(env t.env)
5814+::
5815+:: Generalized variables are renamed freshly on each use. The renaming
5816+:: substitutes only once, so an old variable and its fresh number may
5817+:: coincide without forming a substitution cycle.
5818+::
5819+++ itype-normalize
5820+ |= [t=itype sub=isub]
5821+ ^- itype
5822+ =. t (itype-walk t sub)
5823+ ?: ?=(%grec -.t) t(args (turn args.t |=(c=itype (itype-normalize c sub))))
5824+ ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5825+ ?: ?=(%union -.t)
5826+ [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5827+ ?: ?=(%face -.t)
5828+ [%face name.t $(t body.t)]
5829+ ?: ?=(%fn -.t)
5830+ [%fn $(t sample.t) $(t product.t)]
5831+ ?: ?=(%cell -.t)
5832+ [%cell $(t hed.t) $(t tal.t)]
5833+ t
5834+::
5835+::
5836+:: Default decimal variables only in types with no gates. A gate can
5837+:: generalize an aura from its sample, which requires constraint analysis
5838+:: beyond this fragment; leave those cases unresolved.
5839+::
5840+:: This helper only controls decimal defaulting in visible types. A noun
5841+:: may contain gates and is not proof of a gate-free value.
5842+++ itype-has-gate
5843+ |= t=itype
5844+ ^- ?
5845+ ?- -.t
5846+ %fn &
5847+ %cell |($(t hed.t) $(t tal.t))
5848+ %recursive |
5849+ %jrec |
5850+ %grec &
5851+ %collection (lien args.t |=(c=itype (itype-has-gate c)))
5852+ %face $(t body.t)
5853+ %union (lien cases.t |=(c=itype (itype-has-gate c)))
5854+ %tag |
5855+ %const |
5856+ %var |
5857+ %avar |
5858+ %rvar |
5859+ %nvar |
5860+ %rnvar |
5861+ %atom |
5862+ %any-atom |
5863+ %flag |
5864+ %noun |
5865+ %empty |
5866+ ==
5867+::
5868+++ default-decimals
5869+ |= t=itype
5870+ ^- itype
5871+ ?: (itype-has-gate t) t
5872+ ?- -.t
5873+ %nvar [%atom %ud]
5874+ %rnvar [%atom %ud]
5875+ %grec t(args (turn args.t |=(c=itype (default-decimals c))))
5876+ %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
5877+ %face [%face name.t $(t body.t)]
5878+ %cell [%cell $(t hed.t) $(t tal.t)]
5879+ * t
5880+ ==
5881+::
5882+:: A hole is solved only by a fully determined type or a written
5883+:: in-scope type variable. Ordinary fresh variables are not evidence.
5884+:: Compare representatives after substitution, since unification can
5885+:: orient a written capital toward the hole rather than the reverse.
5886+++ hole-variable-id
5887+ |= t=itype
5888+ ^- (unit @ud)
5889+ ?- -.t
5890+ %var `id.t
5891+ %avar `id.t
5892+ %rvar `id.t
5893+ %nvar `id.t
5894+ %rnvar `id.t
5895+ %tag `id.t
5896+ * ~
5897+ ==
5898+++ hole-same-variable
5899+ |= [a=itype b=itype]
5900+ ^- ?
5901+ =/ x=(unit @ud) (hole-variable-id a)
5902+ ?~ x |
5903+ =/ y=(unit @ud) (hole-variable-id b)
5904+ ?~ y |
5905+ =(u.x u.y)
5906+++ hole-known
5907+ |= [t=itype state=istate]
5908+ ^- ?
5909+ =. t (itype-walk t sub.state)
5910+ ?- -.t
5911+ ?(%var %avar %rvar %nvar %rnvar)
5912+ ?: (lien caps.state |=(c=icap (hole-same-variable t (itype-walk [%var id.c] sub.state)))) &
5913+ (lien params.state |=(p=[name=@t typ=itype] (hole-same-variable t (itype-walk typ.p sub.state))))
5914+ %tag |
5915+ %any-atom &
5916+ %union &((levy cases.t |=(c=itype (hole-known c state))) (levy args.t |=(c=itype (hole-known c state))))
5917+ %grec (levy args.t |=(c=itype (hole-known c state)))
5918+ %collection (levy args.t |=(c=itype (hole-known c state)))
5919+ %face $(t body.t)
5920+ %fn &($(t sample.t) $(t product.t))
5921+ %cell &($(t hed.t) $(t tal.t))
5922+ * &
5923+ ==
5924+++ promote-restricted-numbers
5925+ |= [state=istate env=ienv]
5926+ ^- istate
5927+ :: With no written capitals, there is nothing to promote.
5928+ ?~ caps.state state
5929+ =/ ids=(list @ud) (turn caps.state |=(c=icap id.c))
5930+ =/ free=(list @ud) (free-env-vars env sub.state)
5931+ |-
5932+ ?~ ids state
5933+ =/ t=itype (itype-walk [%var i.ids] sub.state)
5934+ ?: &(?=(%rnvar -.t) !(lien free |=(n=@ud =(n +.t))))
5935+ $(ids t.ids, state state(sub [[+.t [%rvar +.t]] sub.state]))
5936+ $(ids t.ids)
5937+::
5938+++ default-hole-numbers
5939+ |= [all=(list ihole) prior=(list ihole) state=istate env=ienv permit=?]
5940+ ^- istate
5941+ :: Do not default a named capital or a variable captured from env.
5942+ ?. permit state
5943+ ?: =(all prior) state
5944+ ?~ all state
5945+ =/ t=itype (itype-walk [%var id.i.all] sub.state)
5946+ =/ free=(list @ud) (free-env-vars env sub.state)
5947+ =? state &(?=(?(%nvar %rnvar) -.t) !(hole-known t state) !(lien free |=(id=@ud =(id id.t))))
5948+ state(sub [[id.t [%atom %ud]] sub.state])
5949+ $(all t.all)
5950+::
5951+:: Only obligations created inside this definition belong to it.
5952+++ holes-created
5953+ |= [all=(list ihole) prior=(list ihole)]
5954+ ^- (list ihole)
5955+ ?: =(all prior) ~
5956+ ?~ all ~
5957+ [i.all $(all t.all)]
5958+++ hole-uncertain
5959+ |= [t=itype state=istate]
5960+ ^- ?
5961+ =. t (itype-walk t sub.state)
5962+ ?- -.t
5963+ ?(%tag %nvar %rnvar %avar %rvar) !(hole-known t state)
5964+ %union |((lien cases.t |=(c=itype (hole-uncertain c state))) (lien args.t |=(c=itype (hole-uncertain c state))))
5965+ %grec (lien args.t |=(c=itype (hole-uncertain c state)))
5966+ %collection (lien args.t |=(c=itype (hole-uncertain c state)))
5967+ %face $(t body.t)
5968+ %fn |($(t sample.t) $(t product.t))
5969+ %cell |($(t hed.t) $(t tal.t))
5970+ * |
5971+ ==
5972+::
5973+++ unresolved-hole
5974+ |= [all=(list ihole) prior=(list ihole) state=istate]
5975+ ^- (unit idiag)
5976+ =/ work=(list ihole) (flop (holes-created all prior))
5977+ |-
5978+ ?~ work ~
5979+ ?: (hole-known [%var id.i.work] state) $(work t.work)
5980+ ?: (hole-uncertain [%var id.i.work] state)
5981+ `["type hole needs unsupported inference" ~[[at.i.work "type hole"]]]
5982+ `["type hole needs a determined type" ~[[at.i.work "unresolved type hole"]]]
5983+::
5984+++ itype-vars
5985+ |= t=itype
5986+ ^- (list @ud)
5987+ ?- -.t
5988+ %var ~[id.t]
5989+ %avar ~[id.t]
5990+ %rvar ~[id.t]
5991+ %nvar ~[id.t]
5992+ %rnvar ~[id.t]
5993+ %atom ~
5994+ %any-atom ~
5995+ %flag ~
5996+ %noun ~
5997+ %empty ~
5998+ %tag ~
5999+ %const ~
6000+ %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
6001+ %recursive ~
6002+ %jrec ~
6003+ %grec (zing (turn args.t |=(c=itype (itype-vars c))))
6004+ %collection (zing (turn args.t |=(c=itype (itype-vars c))))
6005+ %face $(t body.t)
6006+ %fn (weld $(t sample.t) $(t product.t))
6007+ %cell (weld $(t hed.t) $(t tal.t))
6008+ ==
6009+::
6010+++ unique-type-vars
6011+ |= ns=(list @ud)
6012+ ^- (list @ud)
6013+ =/ out=(list @ud) ~
6014+ |-
6015+ ?~ ns (flop out)
6016+ ?: (lien out |=(x=@ud =(x i.ns))) $(ns t.ns)
6017+ $(ns t.ns, out [i.ns out])
6018+::
6019+++ itype-rename
6020+ |= [t=itype ren=isub]
6021+ ^- itype
6022+ ?- -.t
6023+ %var
6024+ =/ found=(unit itype) (itype-lookup id.t ren)
6025+ ?~ found t
6026+ u.found
6027+ %avar
6028+ =/ found=(unit itype) (itype-lookup id.t ren)
6029+ ?~ found t
6030+ u.found
6031+ %rvar
6032+ =/ found=(unit itype) (itype-lookup id.t ren)
6033+ ?~ found t
6034+ u.found
6035+ %nvar
6036+ =/ found=(unit itype) (itype-lookup id.t ren)
6037+ ?~ found t
6038+ u.found
6039+ %rnvar
6040+ =/ found=(unit itype) (itype-lookup id.t ren)
6041+ ?~ found t
6042+ u.found
6043+ %atom t
6044+ %any-atom t
6045+ %flag t
6046+ %noun t
6047+ %empty t
6048+ %tag t
6049+ %const t
6050+ %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
6051+ %recursive t
6052+ %jrec t
6053+ %grec t(args (turn args.t |=(c=itype (itype-rename c ren))))
6054+ %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
6055+ %face [%face name.t $(t body.t)]
6056+ %fn [%fn $(t sample.t) $(t product.t)]
6057+ %cell [%cell $(t hed.t) $(t tal.t)]
6058+ ==
6059+::
6060+:: Variable IDs are unique across the two kinds. Inspecting the
6061+:: normalized type preserves the atom constraint when renaming.
6062+::
6063+++ itype-var-is-atom
6064+ |= [n=@ud t=itype]
6065+ ^- ?
6066+ ?- -.t
6067+ %var |
6068+ %avar =(n id.t)
6069+ %rvar =(n id.t)
6070+ %nvar =(n id.t)
6071+ %rnvar =(n id.t)
6072+ %atom |
6073+ %any-atom |
6074+ %flag |
6075+ %noun |
6076+ %empty |
6077+ %tag |
6078+ %const |
6079+ %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
6080+ %recursive |
6081+ %jrec |
6082+ %grec (lien args.t |=(c=itype (itype-var-is-atom n c)))
6083+ %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
6084+ %face $(t body.t)
6085+ %fn |($(t sample.t) $(t product.t))
6086+ %cell |($(t hed.t) $(t tal.t))
6087+ ==
6088+++ itype-var-is-restricted
6089+ |= [n=@ud t=itype]
6090+ ^- ?
6091+ ?- -.t
6092+ %var |
6093+ %avar |
6094+ %rvar =(n id.t)
6095+ %nvar |
6096+ %rnvar |
6097+ %atom |
6098+ %any-atom |
6099+ %flag |
6100+ %noun |
6101+ %empty |
6102+ %tag |
6103+ %const |
6104+ %union |((lien cases.t |=(c=itype (itype-var-is-restricted n c))) (lien args.t |=(c=itype (itype-var-is-restricted n c))))
6105+ %recursive |
6106+ %jrec |
6107+ %grec (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6108+ %collection (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6109+ %face $(t body.t)
6110+ %fn |($(t sample.t) $(t product.t))
6111+ %cell |($(t hed.t) $(t tal.t))
6112+ ==
6113+::
6114+:: Canonical numbering makes printed variables independent of the order
6115+:: the unifier happened to allocate intermediates.
6116+::
6117+++ canonical-itype
6118+ |= [t=itype vars=(list @ud)]
6119+ ^- itype
6120+ =/ ren=isub ~
6121+ =/ n=@ud 0
6122+ |-
6123+ ?~ vars (itype-rename t ren)
6124+ =/ replacement=itype ?:((itype-var-is-restricted i.vars t) [%rvar n] ?:((itype-var-is-atom i.vars t) [%avar n] [%var n]))
6125+ $(vars t.vars, ren [[i.vars replacement] ren], n +(n))
6126+::
6127+++ instantiate-scheme
6128+ |= [scheme=ischeme state=istate]
6129+ ^- [typ=itype state=istate]
6130+ =/ ren=isub ~
6131+ =/ vars=(list @ud) vars.scheme
6132+ |-
6133+ ?~ vars [(itype-rename typ.scheme ren) state]
6134+ =/ replacement=itype
6135+ ?:((itype-var-is-restricted i.vars typ.scheme) [%rvar next.state] ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state]))
6136+ :: A generalized atom variable is a valid origin for re-generalizing
6137+ :: an alias, just as a sample binder is.
6138+ =/ st=istate state(next +(next.state))
6139+ =? binders.st |(?=(%avar -.replacement) ?=(%rvar -.replacement)) [next.state binders.state]
6140+ $(vars t.vars, ren [[i.vars replacement] ren], state st)
6141+::
6142+++ icap-lookup
6143+ |= [n=@t caps=icaps]
6144+ ^- (unit @ud)
6145+ ?~ caps ~
6146+ ?: =(n name.i.caps) `id.i.caps
6147+ $(caps t.caps)
6148+::
6149+::
6150+:: Only an unambiguous local name can be expanded. Import faces and
6151+:: recursive mold identity need the full module interface.
6152+::
6153+++ find-simple-mold
6154+ |= [n=term molds=imolds]
6155+ ^- (unit shape)
6156+ =/ matches=imolds (skim molds |=(m=[name=term body=shape] =(n name.m)))
6157+ ?~ matches ~
6158+ ?^ t.matches ~
6159+ `body.i.matches
6160+::
6161+++ collect-simple-molds
6162+ |= ds=(list def)
6163+ ^- imolds
6164+ ?~ ds ~
6165+ ?: ?=(%mold -.i.ds)
6166+ [[name.i.ds shape.i.ds] $(ds t.ds)]
6167+ $(ds t.ds)
6168+::
6169+::
6170+:: The caller supplies unchanged results from the source-aware importer.
6171+:: That boundary is trusted for source provenance: a fork alone cannot
6172+:: reveal cases Hoon collapsed before it was constructed. Validate the
6173+:: supplied graph independently, including pairwise disjointness. Fixed
6174+:: atoms, term singletons, cells, faces and proven forks are decoded;
6175+:: unsupported singletons, collections and recursive references fail.
6176+::
6177+++ jibb-face-name
6178+ |= name=@
6179+ ^- ?
6180+ =/ chars=tape (trip (@t name))
6181+ ?~ chars |
6182+ ?. (is-lower i.chars) |
6183+ (levy t.chars |=(c=@tD (in c name-mask)))
6184+::
6185+:: A source-aware reader result is trusted for origin. Validate every
6186+:: supplied branch and keep the recursive mold opaque: unfolding its
6187+:: root while naming only its tail would change its type identity.
6188++$ irec-pattern [pat=upat has=?]
6189+++ rec-pattern
6190+ |= [node=* module=term name=term]
6191+ ^- (unit irec-pattern)
6192+ ?@ node ~
6193+ ?+ -.node ~
6194+ %atom
6195+ ?: ?=([%atom %n [~ @]] node)
6196+ ?. =(0 +>+.node) ~
6197+ `[[%atom `0] |]
6198+ ?: ?=([%atom %tas [~ @]] node)
6199+ =/ value=@ +>+.node
6200+ ?. |(=(value 0) (jibb-face-name value)) ~
6201+ `[[%atom `value] |]
6202+ ?. ?=([%atom @ ~] node) ~
6203+ =/ aura=@ta (@ta +<.node)
6204+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
6205+ `[[%atom ~] |]
6206+ %ref
6207+ ?. ?=([%ref @ @] node) ~
6208+ ?. &(=(module +<.node) =(name +>.node)) ~
6209+ `[[%unknown ~] &]
6210+ %apply
6211+ ?. ?=([%apply %list [* ~]] node) ~
6212+ =/ item $(node -.+>.node)
6213+ ?~ item ~
6214+ `[[%or ~[[%atom `0] [%cell pat.u.item [%unknown ~]]]] has.u.item]
6215+ %face
6216+ ?. ?=([%face @ *] node) ~
6217+ ?. (jibb-face-name +<.node) ~
6218+ $(node +>.node)
6219+ %cell
6220+ ?. ?=([%cell * *] node) ~
6221+ =/ left $(node +<.node)
6222+ ?~ left ~
6223+ =/ right $(node +>.node)
6224+ ?~ right ~
6225+ `[[%cell pat.u.left pat.u.right] |(has.u.left has.u.right)]
6226+ %fork
6227+ =/ cases (rec-patterns +.node module name)
6228+ ?~ cases ~
6229+ ?~ pats.u.cases ~
6230+ ?~ t.pats.u.cases ~
6231+ ?. (rec-patterns-disjoint pats.u.cases) ~
6232+ `[[%or pats.u.cases] has.u.cases]
6233+ ==
6234+::
6235+++ rec-patterns
6236+ |= [nodes=* module=term name=term]
6237+ ^- (unit [pats=(list upat) has=?])
6238+ ?@ nodes ?:(=(nodes 0) `[~ |] ~)
6239+ =/ first (rec-pattern -.nodes module name)
6240+ ?~ first ~
6241+ =/ rest $(nodes +.nodes)
6242+ ?~ rest ~
6243+ `[[pat.u.first pats.u.rest] |(has.u.first has.u.rest)]
6244+::
6245+++ rec-patterns-disjoint
6246+ |= pats=(list upat)
6247+ ^- ?
6248+ ?~ pats &
6249+ ?. (levy t.pats |=(p=upat =(%disjoint (union-relate i.pats p)))) |
6250+ $(pats t.pats)
6251+::
6252+::
6253+::
6254+:: Repeated faces along an imported record spine fail closed. Hoon's type
6255+:: graph can erase unfaced nested-cell boundaries, so that alone does not
6256+:: prove the original source repeated a name within one record. A faced
6257+:: body and each union alternative have separate scopes. Check recursive
6258+:: roots before making them opaque; unused molds are never inspected.
6259+::
6260+++ imported-faces-valid
6261+ |= node=*
6262+ ^- ?
6263+ ?@ node &
6264+ ?+ -.node &
6265+ %face ?:(?=([%face @ *] node) $(node +>.node) |)
6266+ %cell ?:(?=([%cell * *] node) (imported-record-faces-valid node ~) |)
6267+ %fork (imported-faces-valid-list +.node)
6268+ %apply ?:(?=([%apply @ *] node) (imported-faces-valid-list +>.node) |)
6269+ %named
6270+ ?. ?=([%named @ @ *] node) |
6271+ =/ n=[%named module=@ name=@ body=*] ;;([%named module=@ name=@ body=*] node)
6272+ (imported-faces-valid body.n)
6273+ ==
6274+::
6275+++ imported-faces-valid-list
6276+ |= nodes=*
6277+ ^- ?
6278+ ?@ nodes =(nodes 0)
6279+ ?. (imported-faces-valid -.nodes) |
6280+ $(nodes +.nodes)
6281+::
6282+++ imported-record-faces-valid
6283+ |= [node=* names=(list @)]
6284+ ^- ?
6285+ ?: ?=([%cell * *] node)
6286+ =/ head=* +<.node
6287+ =/ rest=* +>.node
6288+ ?: ?=([%face @ *] head)
6289+ ?: (lien names |=(n=@ =(n +<.head))) |
6290+ ?. (imported-faces-valid +>.head) |
6291+ $(node rest, names [+<.head names])
6292+ ?. (imported-faces-valid head) |
6293+ $(node rest)
6294+ ?: ?=([%face @ *] node)
6295+ ?: (lien names |=(n=@ =(n +<.node))) |
6296+ (imported-faces-valid +>.node)
6297+ (imported-faces-valid node)
6298+::
6299+++ import-to-itype
6300+ |= node=*
6301+ ^- (unit itype)
6302+ ?@ node ~
6303+ ?+ -.node ~
6304+ %noun ?:(=(node [%noun ~]) `[%noun ~] ~)
6305+ %atom
6306+ :: A Hoon loobean singleton is one of the two Jibb loobeans.
6307+ ?: ?=([%atom %f [~ @]] node)
6308+ =/ value=@ +>+.node
6309+ ?. |(=(value 0) =(value 1)) ~
6310+ =/ printed=@t ?:(=(value 0) '%.y' '%.n')
6311+ `[%const [%loobean %f value printed]]
6312+ :: Hoon's null singleton is the same noun as Jibb's `~` mold.
6313+ :: Other non-term singleton atoms remain unsupported here.
6314+ ?: ?=([%atom %n [~ @]] node)
6315+ ?. =(0 +>+.node) ~
6316+ `[%const [%null %n 0 '~']]
6317+ ?: ?=([%atom %tas [~ @]] node)
6318+ =/ value=@ +>+.node
6319+ ?. |(=(value 0) (jibb-face-name value)) ~
6320+ =/ printed=@t ?:(=(value 0) '%$' (cat 3 '%' value))
6321+ `[%const [%term %tas value printed]]
6322+ ?. ?=([%atom @ ~] node) ~
6323+ =/ aura=@ta (@ta +<.node)
6324+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
6325+ `[%atom aura]
6326+ %named
6327+ ?. ?=([%named @ @ *] node) ~
6328+ =/ n=[%named module=@ name=@ body=*] ;;([%named module=@ name=@ body=*] node)
6329+ ?. &((jibb-face-name module.n) (jibb-face-name name.n)) ~
6330+ ?. ?=([%fork *] body.n) ~
6331+ =/ proof=(unit irec-pattern) (rec-pattern body.n (@tas module.n) (@tas name.n))
6332+ ?~ proof ~
6333+ ?. has.u.proof ~
6334+ `[%recursive (@tas module.n) (@tas name.n) `(crip "{(trip name.n)}.{(trip module.n)}")]
6335+ %apply
6336+ ?. ?=([%apply @ *] node) ~
6337+ =/ name=term (@tas +<.node)
6338+ =/ arity=@ud
6339+ ?: |(=(%list name) =(%unit name) =(%set name) =(%qeu name)) 1
6340+ ?: |(=(%map name) =(%mop name) =(%jar name) =(%jug name)) 2
6341+ 0
6342+ ?: =(arity 0) ~
6343+ =/ args=(unit (list itype)) (import-to-itypes +>.node)
6344+ ?~ args ~
6345+ ?. =(arity (lent u.args)) ~
6346+ `[%collection name u.args]
6347+ %fork
6348+ :: Hoon's ordinary ? mold is the fork of its two %f singletons.
6349+ =/ raw=* +.node
6350+ ?: |(=(raw ~[[%atom %f `0] [%atom %f `1]]) =(raw ~[[%atom %f `1] [%atom %f `0]]))
6351+ `[%flag ~]
6352+ =/ cases=(unit (list itype)) (import-to-itypes raw)
6353+ ?~ cases ~
6354+ ?~ u.cases ~
6355+ ?~ t.u.cases ~
6356+ ?: (import-has-loobean-singleton u.cases) ~
6357+ ?. (import-cases-disjoint u.cases) ~
6358+ `[%union u.cases ~ ~ ~]
6359+ %face
6360+ ?. ?=([%face @ *] node) ~
6361+ =/ name=@ +<.node
6362+ ?. (jibb-face-name name) ~
6363+ =/ body=(unit itype) $(node +>.node)
6364+ ?~ body ~
6365+ `[%face (@tas name) u.body]
6366+ %cell
6367+ ?. ?=([%cell * *] node) ~
6368+ =/ left=(unit itype) $(node +<.node)
6369+ ?~ left ~
6370+ =/ right=(unit itype) $(node +>.node)
6371+ ?~ right ~
6372+ `[%cell u.left u.right]
6373+ ==
6374+::
6375+++ import-direct-loobean
6376+ |= t=itype
6377+ ^- ?
6378+ ?: ?=(%face -.t) $(t body.t)
6379+ ?: ?=(%union -.t) (import-has-loobean-singleton cases.t)
6380+ ?=([%const [%loobean *]] t)
6381+::
6382+++ import-has-loobean-singleton
6383+ |= cases=(list itype)
6384+ ^- ?
6385+ ?~ cases |
6386+ ?: (import-direct-loobean i.cases) &
6387+ $(cases t.cases)
6388+::
6389+++ import-to-itypes
6390+ |= nodes=*
6391+ ^- (unit (list itype))
6392+ ?@ nodes ?:(=(nodes 0) `~ ~)
6393+ =/ first (import-to-itype -.nodes)
6394+ ?~ first ~
6395+ =/ rest $(nodes +.nodes)
6396+ ?~ rest ~
6397+ `[u.first u.rest]
6398+::
6399+++ import-type-pattern
6400+ |= typ=itype
6401+ ^- upat
6402+ ?- -.typ
6403+ %noun [%all ~]
6404+ %empty [%empty ~]
6405+ %atom [%atom ~]
6406+ %flag [%or ~[[%atom `0] [%atom `1]]]
6407+ %const [%atom `val.literal.typ]
6408+ %face $(typ body.typ)
6409+ %cell [%cell $(typ hed.typ) $(typ tal.typ)]
6410+ %union [%or (turn cases.typ |=(t=itype (import-type-pattern t)))]
6411+ * [%unknown ~]
6412+ ==
6413+::
6414+++ import-cases-disjoint
6415+ |= cases=(list itype)
6416+ ^- ?
6417+ ?~ cases &
6418+ =/ first=upat (import-type-pattern i.cases)
6419+ ?. (levy t.cases |=(t=itype =(%disjoint (union-relate first (import-type-pattern t))))) |
6420+ $(cases t.cases)
6421+::
6422+++ find-imported-mold
6423+ |= [module=term name=term externals=iexternals surs=(list term)]
6424+ ^- (unit itype)
6425+ ?. (lien surs |=(n=term =(n module))) ~
6426+ =/ found=iexternals
6427+ (skim externals |=(e=[module=term name=term result=*] &(=(module module.e) =(name name.e))))
6428+ ?~ found ~
6429+ ?^ t.found ~
6430+ =/ result=* result.i.found
6431+ ?@ result ~
6432+ ?. ?=(%& -.result) ~
6433+ =/ node=* +.result
6434+ ?. (imported-faces-valid node) ~
6435+ ?@ node (import-to-itype node)
6436+ ?: ?=(%ref -.node) (import-to-itype node)
6437+ =/ pattern=(unit irec-pattern) (rec-pattern node module name)
6438+ ?~ pattern (import-to-itype node)
6439+ ?. has.u.pattern (import-to-itype node)
6440+ `[%recursive module name `(crip "{(trip name)}.{(trip module)}")]
6441+
6442+::
6443+++ collect-sur-imports
6444+ |= imports=(list import)
6445+ ^- (list term)
6446+ ?~ imports ~
6447+ ?: ?=(%sur -.i.imports)
6448+ [name.i.imports $(imports t.imports)]
6449+ $(imports t.imports)
6450+::
6451+++ collect-mark-imports
6452+ |= imports=(list import)
6453+ ^- (list term)
6454+ ?~ imports ~
6455+ ?: ?=(%mark -.i.imports)
6456+ [mark.i.imports $(imports t.imports)]
6457+ $(imports t.imports)
6458+::
6459+++ find-imported-mark
6460+ |= [name=term externals=imark-externals marks=(list term)]
6461+ ^- (unit itype)
6462+ ?. (unique-value-name name marks) ~
6463+ =/ found=imark-externals
6464+ (skim externals |=(e=[mark=term result=*] =(name mark.e)))
6465+ ?~ found ~
6466+ ?^ t.found ~
6467+ =/ result=* result.i.found
6468+ ?@ result ~
6469+ ?. ?=(%& -.result) ~
6470+ ?. (imported-faces-valid +.result) ~
6471+ (import-to-itype +.result)
6472+::
6473+++ find-jibb-interface
6474+ |= [face=term imports=ijimports]
6475+ ^- (unit ifile)
6476+ ?~ imports ~
6477+ ?: =(face face.i.imports) `interface.i.imports
6478+ $(imports t.imports)
6479+::
6480+++ find-jibb-mold
6481+ |= [name=term iface=ifile]
6482+ ^- (unit ischeme)
6483+ =/ ms=imold-types molds.iface
6484+ |-
6485+ ?~ ms ~
6486+ ?: =(name name.i.ms) `template.i.ms
6487+ $(ms t.ms)
6488+::
6489+:: An exported alias may name a union from another module. Only a
6490+:: nongeneric alias of the same origin is usable through this import face.
6491+::
6492+++ imported-union-alias
6493+ |= [origin=[at=path name=term] molds=imold-types]
6494+ ^- (unit term)
6495+ ?~ molds ~
6496+ =/ template=ischeme template.i.molds
6497+ ?: &(?=(~ vars.template) ?=(%union -.typ.template))
6498+ ?:(=(`origin origin.typ.template) `name.i.molds $(molds t.molds))
6499+ $(molds t.molds)
6500+::
6501+:: A prelude union alias is a display name, not a new union identity. An
6502+:: identity-generic alias can carry the origin's arguments only when the
6503+:: origin, arity and ordered parameters match. Swapped, repeated, fixed
6504+:: or phantom parameters cannot be printed that way and remain unsupported
6505+:: when their only available name is private. A nongeneric alias of a
6506+:: generic instantiation cannot be printed with the origin's arguments.
6507+++ identity-union-parameters
6508+ |= [vars=(list @ud) args=(list itype)]
6509+ ^- ?
6510+ ?~ vars ?=(~ args)
6511+ ?~ args |
6512+ ?. =([%var i.vars] i.args) |
6513+ $(vars t.vars, args t.args)
6514+++ prelude-union-alias
6515+ |= [origin=[at=path name=term] args=(list itype) molds=imold-types]
6516+ ^- (unit term)
6517+ ?~ molds ~
6518+ =/ template=ischeme template.i.molds
6519+ ?. ?=(%union -.typ.template) $(molds t.molds)
6520+ ?. =(`origin origin.typ.template) $(molds t.molds)
6521+ ?~ vars.template
6522+ ?^ args $(molds t.molds)
6523+ ?:(=(args args.typ.template) `name.i.molds $(molds t.molds))
6524+ ?: &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args)))
6525+ `name.i.molds
6526+ $(molds t.molds)
6527+::
6528+:: Names exported by the directly imported module are visible through its
6529+:: face; a matching prelude alias is also visible without a qualifier.
6530+::
6531+++ jrec-alias
6532+ |= [origin=path name=term molds=imold-types]
6533+ ^- (unit term)
6534+ ?~ molds ~
6535+ =/ template=ischeme template.i.molds
6536+ ?: &(?=(~ vars.template) ?=(%jrec -.typ.template) =(at.typ.template origin) =(name.typ.template name)) `name.i.molds
6537+ $(molds t.molds)
6538+::
6539+++ grec-visible-alias
6540+ |= [origin=path name=term proof=shape args=(list itype) molds=imold-types]
6541+ ^- (unit term)
6542+ ?~ molds ~
6543+ =/ template=ischeme template.i.molds
6544+ ?. ?=(%grec -.typ.template) $(molds t.molds)
6545+ ?. &(=(at.typ.template origin) =(name.typ.template name) =(proof.typ.template proof)) $(molds t.molds)
6546+ ?. &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args))) $(molds t.molds)
6547+ `name.i.molds
6548+::
6549+++ itype-in-import
6550+ |= [t=itype iface=ifile face=term prelude=(unit ifile)]
6551+ ^- itype
6552+ ?- -.t
6553+ %union
6554+ =/ label=(unit @t)
6555+ ?~ origin.t ~
6556+ ?: =(at.u.origin.t /lib/jibb/prelude/jibb) `name.u.origin.t
6557+ =/ public=(unit term)
6558+ ?~ prelude ~
6559+ (prelude-union-alias u.origin.t args.t molds.u.prelude)
6560+ ?^ public `u.public
6561+ =/ alias=(unit term) ~
6562+ =? alias &(=(at.u.origin.t at.iface) ?=(^ (find-jibb-mold name.u.origin.t iface))) `name.u.origin.t
6563+ =? alias ?=(~ alias) (imported-union-alias u.origin.t molds.iface)
6564+ ?~ alias ~
6565+ `(crip "{(trip u.alias)}.{(trip face)}")
6566+ [%union (turn cases.t |=(c=itype (itype-in-import c iface face prelude))) origin.t label (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
6567+ %recursive [%recursive module.t name.t ~]
6568+ %grec
6569+ =/ public=(unit term) ?~(prelude ~ (grec-visible-alias at.t name.t proof.t args.t molds.u.prelude))
6570+ =/ alias=(unit term) ?~(public (grec-visible-alias at.t name.t proof.t args.t molds.iface) public)
6571+ =/ label=(unit @t) ?~(alias ~ ?~(public `(crip "{(trip u.alias)}.{(trip face)}") `u.alias))
6572+ t(label label, args (turn args.t |=(c=itype (itype-in-import c iface face prelude))))
6573+ %jrec
6574+ =/ public=(unit term) ?~(prelude ~ (jrec-alias at.t name.t molds.u.prelude))
6575+ ?^ public t(label `u.public)
6576+ =/ alias=(unit term) (jrec-alias at.t name.t molds.iface)
6577+ ?~ alias t(label ~)
6578+ t(label `(crip "{(trip u.alias)}.{(trip face)}"))
6579+ %collection [%collection name.t (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
6580+ %face [%face name.t $(t body.t)]
6581+ %fn [%fn $(t sample.t) $(t product.t)]
6582+ %cell [%cell $(t hed.t) $(t tal.t)]
6583+ * t
6584+ ==
6585+::
6586+++ label-direct-union
6587+ |= [typ=itype body=shape name=term state=istate]
6588+ ^- itype
6589+ ?. ?=(%union -.typ) typ
6590+ =/ direct=? ?=(%union -.body)
6591+ =? direct ?=(%generic -.body) ?=(%union -.body.body)
6592+ ?. direct typ
6593+ ?. (lien top-molds.state |=(n=term =(n name))) typ
6594+ [%union cases.typ `[at.state name] `name args.typ]
6595+::
6596+:: Generic mold parameters are lexical and distinct from the enclosing
6597+:: value's capital variables. Arguments are substituted only once, so
6598+:: an argument's variable ID cannot be captured by a template ID.
6599+:: A generic alias of a named union keeps the underlying union's origin
6600+:: and substituted argument order; an originless union stays unsupported.
6601+::
6602+++ iparam-lookup
6603+ |= [name=@t params=iparams]
6604+ ^- (unit itype)
6605+ ?~ params ~
6606+ ?: =(name name.i.params) `typ.i.params
6607+ $(params t.params)
6608+::
6609+++ distinct-params
6610+ |= names=(list @t)
6611+ ^- ?
6612+ ?~ names &
6613+ ?: (lien t.names |=(n=@t =(n i.names))) |
6614+ $(names t.names)
6615+::
6616+++ bind-params
6617+ |= [names=(list @t) args=(list itype)]
6618+ ^- (unit iparams)
6619+ ?~ names ?~(args `~ ~)
6620+ ?~ args ~
6621+ =/ rest=(unit iparams) $(names t.names, args t.args)
6622+ ?~ rest ~
6623+ `[[i.names i.args] u.rest]
6624+::
6625+++ template-apply
6626+ |= [template=ischeme args=(list itype)]
6627+ ^- (unit itype)
6628+ =/ vars=(list @ud) vars.template
6629+ =/ ren=isub ~
6630+ |-
6631+ ?~ vars ?~(args `(itype-rename typ.template ren) ~)
6632+ ?~ args ~
6633+ $(vars t.vars, args t.args, ren [[i.vars i.args] ren])
6634+::
6635+++ infer-shape-args
6636+ |= [args=(list shape) state=istate]
6637+ ^- (unit [types=(list itype) state=istate])
6638+ ?~ args `[~ state]
6639+ =/ head=(unit [typ=itype state=istate]) (infer-simple-shape i.args state)
6640+ ?~ head ~
6641+ =/ tail=(unit [types=(list itype) state=istate]) $(args t.args, state state.u.head)
6642+ ?~ tail ~
6643+ `[[typ.u.head types.u.tail] state.u.tail]
6644+::
6645+++ fresh-mold-params
6646+ |= [names=(list @t) next=@ud]
6647+ ^- [params=iparams vars=(list @ud) next=@ud]
6648+ ?~ names [~ ~ next]
6649+ =/ rest=[params=iparams vars=(list @ud) next=@ud] $(names t.names, next +(next))
6650+ [[[i.names [%var next]] params.rest] [next vars.rest] next.rest]
6651+::
6652+:: Recognize a unique top-level source mold with exactly a null case and a
6653+:: faced atom-headed cell whose faced tail names that same mold. Its Jibb
6654+:: path and name provide nominal identity. Other recursive shapes fail closed;
6655+:: construction and matching expose the proven shape one layer at a time.
6656+++ simple-source-recursive
6657+ |= [name=term sh=shape state=istate]
6658+ ^- (unit itype)
6659+ ?. (lien top-molds.state |=(n=term =(n name))) ~
6660+ =/ original=(unit shape) (find-simple-mold name molds.state)
6661+ ?~ original ~
6662+ ?. =(u.original sh) ~
6663+ ?. ?=(%union -.sh) ~
6664+ =/ cs=(list shape) cases.sh
6665+ ?~ cs ~
6666+ ?~ t.cs ~
6667+ ?^ t.t.cs ~
6668+ ?. ?=(%const -.i.cs) ~
6669+ ?. =(%null form.lit.i.cs) ~
6670+ ?. ?=(%cell -.i.t.cs) ~
6671+ =/ fs=(list field) fields.i.t.cs
6672+ ?~ fs ~
6673+ ?~ t.fs ~
6674+ ?^ t.t.fs ~
6675+ ?. ?=(%face -.i.fs) ~
6676+ ?. ?=(%aura -.shape.i.fs) ~
6677+ ?. !=(0 aura.shape.i.fs) ~
6678+ ?. ?=(%face -.i.t.fs) ~
6679+ ?. !=(name.i.fs name.i.t.fs) ~
6680+ =/ tail=shape shape.i.t.fs
6681+ ?. ?=(%ref -.tail) ~
6682+ ?. =(names.tail ~[name]) ~
6683+ `[%jrec at.state name `name name.i.fs aura.shape.i.fs name.i.t.fs]
6684+::
6685+++ simple-source-generic-recursive
6686+ |= [name=term sh=shape args=(list itype) state=istate]
6687+ ^- (unit itype)
6688+ ?. ?=(%generic -.sh) ~
6689+ ?. ?=([@ ~] vars.sh) ~
6690+ ?. ?=([* ~] args) ~
6691+ ?~ grec-index.state ~
6692+ ?. =(at.u.grec-index.state at.state) ~
6693+ ?~ prelude.state ~
6694+ ?. =(prelude.u.grec-index.state u.prelude.state) ~
6695+ =/ proof=(unit shape) (~(get by shapes.u.grec-index.state) name)
6696+ ?~ proof ~
6697+ ?. =(u.proof sh) ~
6698+ `[%grec at.state name `name sh args]
6699+::
6700+
6701+++ infer-mold-template
6702+ |= [sh=shape state=istate]
6703+ ^- (unit [template=ischeme state=istate])
6704+ =/ generic=(unit itype)
6705+ ?. ?=([@ ~] active.state) ~
6706+ (simple-source-generic-recursive i.active.state sh ~[[%var next.state]] state)
6707+ ?^ generic `[[u.generic ~[next.state]] state(next +(next.state))]
6708+ =/ direct=(unit itype)
6709+ ?. ?=([@ ~] active.state) ~
6710+ (simple-source-recursive i.active.state sh state)
6711+ ?^ direct `[[u.direct ~] state]
6712+ ?: ?=(%generic -.sh)
6713+ ?~ vars.sh ~
6714+ ?. (distinct-params vars.sh) ~
6715+ =/ fresh=[params=iparams vars=(list @ud) next=@ud] (fresh-mold-params vars.sh next.state)
6716+ =/ out=(unit [typ=itype state=istate])
6717+ (infer-simple-shape body.sh state(next next.fresh, params params.fresh, in-mold &))
6718+ ?~ out ~
6719+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
6720+ ?: &(?=(%union -.typ.u.out) !?=(%union -.body.sh) ?=(~ origin.typ.u.out)) ~
6721+ =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.sh))
6722+ typ.u.out(args (turn vars.fresh |=(n=@ud `itype`[%var n])))
6723+ =/ used=(list @ud) (itype-vars typ.u.out)
6724+ ?. (levy used |=(n=@ud (lien vars.fresh |=(p=@ud =(p n))))) ~
6725+ `[[typ.u.out vars.fresh] state.u.out(params params.state, in-mold in-mold.state, holes holes.state)]
6726+ =/ out=(unit [typ=itype state=istate])
6727+ (infer-simple-shape sh state(params ~, in-mold &))
6728+ ?~ out ~
6729+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
6730+ ?: ?=(^ (itype-vars typ.u.out)) ~
6731+ `[[typ.u.out ~] state.u.out(params params.state, in-mold in-mold.state, holes holes.state)]
6732+::
6733+:: A direct imported reference may carry definite reader evidence. Only
6734+:: uniquely supplied, declared inputs are used; unsupported data stay generic.
6735+++ direct-import-invalid
6736+ |= [sh=shape state=istate]
6737+ ^- (unit idiag)
6738+ ?. ?=(%ref -.sh) ~
6739+ ?~ names.sh ~
6740+ =/ n=term i.names.sh
6741+ =/ raw=*
6742+ ?~ t.names.sh
6743+ ?. (unique-value-name n marks.state) ~
6744+ ?: (lien surs.state |=(x=term =(x n))) ~
6745+ ?: ?=(^ (find-jibb-interface n jimports.state)) ~
6746+ ?: (lien globals.state |=(x=term =(x n))) ~
6747+ ?: (lien reserved-molds.state |=(x=term =(x n))) ~
6748+ ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) ~
6749+ =/ found=imark-externals (skim mark-externals.state |=(e=[mark=term result=*] =(mark.e n)))
6750+ ?~ found ~
6751+ ?^ t.found ~
6752+ result.i.found
6753+ ?^ t.t.names.sh ~
6754+ =/ mod=term i.t.names.sh
6755+ ?: ?=(^ (find-jibb-interface mod jimports.state)) ~
6756+ ?. (unique-value-name mod surs.state) ~
6757+ ?: (lien marks.state |=(x=term =(x mod))) ~
6758+ ?: (lien globals.state |=(x=term =(x mod))) ~
6759+ ?: (lien reserved-molds.state |=(x=term =(x mod))) ~
6760+ ?: (lien molds.state |=(m=[name=term body=shape] =(mod name.m))) ~
6761+ =/ found=iexternals (skim externals.state |=(e=[module=term name=term result=*] &(=(module.e mod) =(name.e n))))
6762+ ?~ found ~
6763+ ?^ t.found ~
6764+ result.i.found
6765+ ?. ?=([%invalid ?(%aura %core %overlap) @] raw) ~
6766+ `["{(trip +>.raw)}" ~[[at.sh "invalid imported mold"]]]
6767+::
6768+:: Replay only the shape branches whose evaluation order we can prove.
6769+:: Successful prefixes must be checked before descending to a failure.
6770+++ nested-import-invalid
6771+ |= [sh=shape state=istate]
6772+ ^- (unit idiag)
6773+ ?: ?=(^ (infer-simple-shape sh state)) ~
6774+ ?- -.sh
6775+ %ref
6776+ =/ direct=(unit idiag) (direct-import-invalid sh state)
6777+ ?^ direct direct
6778+ ?~ names.sh ~
6779+ ?^ t.names.sh ~
6780+ =/ n=term i.names.sh
6781+ ?: (lien marks.state |=(x=term =(x n))) ~
6782+ ?: (lien active.state |=(x=term =(x n))) ~
6783+ =/ found=(unit shape) (find-simple-mold n molds.state)
6784+ ?~ found ~
6785+ $(sh u.found, state state(active [n active.state], in-mold &, params ~))
6786+ %fn
6787+ =/ first=(unit [typ=itype state=istate]) (infer-simple-shape sample.sh state)
6788+ ?~ first $(sh sample.sh)
6789+ $(sh product.sh, state state.u.first)
6790+ %cell (nested-field-invalid fields.sh state)
6791+ * ~
6792+ ==
6793+::
6794+++ nested-field-invalid
6795+ |= [fields=(list field) state=istate]
6796+ ^- (unit idiag)
6797+ ?~ fields ~
6798+ =/ sh=shape
6799+ ?- -.i.fields
6800+ %bare shape.i.fields
6801+ %face shape.i.fields
6802+ %pun [%ref at.i.fields ~[name.i.fields]]
6803+ ==
6804+ =/ out=(unit [typ=itype state=istate]) (infer-simple-shape sh state)
6805+ ?~ out (nested-import-invalid sh state)
6806+ $(fields t.fields, state state.u.out)
6807+::
6808+++ sample-import-invalid
6809+ |= [s=sample env=ienv state=istate]
6810+ ^- (unit idiag)
6811+ =/ result=isample-result (infer-sample s env state)
6812+ ?: ?=(%& -.result) ~
6813+ ?. =(p.result "sample mold is not supported by partial inference") ~
6814+ ?- s
6815+ [%face *] (nested-import-invalid shape.s state)
6816+ [%bare *] (nested-import-invalid shape.s state)
6817+ [%pun *] (nested-import-invalid [%ref at.s ~[name.s]] state)
6818+ [%cell *] (nested-samples-invalid items.s env state)
6819+ * ~
6820+ ==
6821+::
6822+++ nested-samples-invalid
6823+ |= [items=(list sample) env=ienv state=istate]
6824+ ^- (unit idiag)
6825+ ?~ items ~
6826+ =/ head=isample-result (infer-sample i.items env state)
6827+ ?: ?=(%| -.head) (sample-import-invalid i.items env state)
6828+ $(items t.items, env env.p.head, state state.p.head)
6829+::
6830+++ infer-simple-shape
6831+ |= [sh=shape state=istate]
6832+ ^- (unit [typ=itype state=istate])
6833+ ?- -.sh
6834+ %hole `[[%var next.state] state(next +(next.state), holes [[next.state at.sh] holes.state])]
6835+ %aura
6836+ ?: =(0 aura.sh) `[[%any-atom ~] state]
6837+ `[[%atom aura.sh] state]
6838+ %flag `[[%flag ~] state]
6839+ %noun `[[%noun ~] state]
6840+ %void `[[%empty ~] state]
6841+ %const
6842+ ?. |(=(%term form.lit.sh) =(%null form.lit.sh) =(%loobean form.lit.sh)) ~
6843+ ?: &(=(%loobean form.lit.sh) !|(=(0 val.lit.sh) =(1 val.lit.sh))) ~
6844+ `[[%const lit.sh] state]
6845+ %union
6846+ =/ pairs=(list upair) (union-pairs cases.sh molds.state)
6847+ ?: (lien pairs |=(p=upair =(%overlap relation.p))) ~
6848+ =/ source-proof=?
6849+ ?: (levy pairs |=(p=upair =(%disjoint relation.p))) &
6850+ &((union-source-state-safe state 256) (union-source-distinct-tags cases.sh molds.state 256))
6851+ ?. source-proof ~
6852+ =/ cs=(unit [types=(list itype) state=istate]) (infer-shape-args cases.sh state)
6853+ ?~ cs ~
6854+ `[[%union types.u.cs ~ ~ ~] state.u.cs]
6855+ %cell (infer-simple-fields fields.sh state)
6856+ %fn
6857+ =/ arg=(unit [typ=itype state=istate]) $(sh sample.sh)
6858+ ?~ arg ~
6859+ =/ out=(unit [typ=itype state=istate]) $(sh product.sh, state state.u.arg)
6860+ ?~ out ~
6861+ `[[%fn typ.u.arg typ.u.out] state.u.out]
6862+ %ref
6863+ ?~ names.sh ~
6864+ =/ n=term i.names.sh
6865+ ?^ t.names.sh
6866+ ?^ t.t.names.sh ~
6867+ =/ iface=(unit ifile) (find-jibb-interface i.t.names.sh jimports.state)
6868+ ?^ iface
6869+ =/ found=(unit ischeme) (find-jibb-mold n u.iface)
6870+ ?~ found ~
6871+ ?^ vars.u.found ~
6872+ `[(itype-in-import typ.u.found u.iface i.t.names.sh prelude.state) state]
6873+ =/ found=(unit itype)
6874+ (find-imported-mold i.t.names.sh n externals.state surs.state)
6875+ ?~ found ~
6876+ `[u.found state]
6877+ ?: (lien marks.state |=(x=term =(x n)))
6878+ ?^ (find-simple-mold n molds.state) ~
6879+ =/ imported=(unit itype) (find-imported-mark n mark-externals.state marks.state)
6880+ ?~ imported ~
6881+ `[u.imported state]
6882+ ?: (lien active.state |=(x=term =(x n))) ~
6883+ =/ found=(unit shape) (find-simple-mold n molds.state)
6884+ ?~ found
6885+ ?: (lien molds.state |=(m=[name=term body=shape] =(name.m n))) ~
6886+ ?~ prelude.state ~
6887+ =/ prelude-entry=(unit ischeme) (find-jibb-mold n u.prelude.state)
6888+ ?~ prelude-entry ~
6889+ ?^ vars.u.prelude-entry ~
6890+ `[typ.u.prelude-entry state]
6891+ =/ direct=(unit itype) (simple-source-recursive n u.found state)
6892+ ?^ direct `[u.direct state]
6893+ =/ out=(unit [typ=itype state=istate])
6894+ $(sh u.found, state state(active [n active.state], in-mold &, params ~))
6895+ ?~ out ~
6896+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
6897+ `[(label-direct-union typ.u.out u.found n state) state.u.out(active active.state, in-mold in-mold.state, params params.state, holes holes.state)]
6898+ %apply
6899+ ?~ ref.sh ~
6900+ =/ args=(unit [types=(list itype) state=istate]) (infer-shape-args args.sh state)
6901+ ?~ args ~
6902+ =/ n=term i.ref.sh
6903+ ?^ t.ref.sh
6904+ ?^ t.t.ref.sh ~
6905+ =/ iface=(unit ifile) (find-jibb-interface i.t.ref.sh jimports.state.u.args)
6906+ ?~ iface ~
6907+ =/ template=(unit ischeme) (find-jibb-mold n u.iface)
6908+ ?~ template ~
6909+ ?~ vars.u.template ~
6910+ =/ applied=(unit itype) (template-apply u.template types.u.args)
6911+ ?~ applied ~
6912+ `[(itype-in-import u.applied u.iface i.t.ref.sh prelude.state.u.args) state.u.args]
6913+ ?: (lien active.state.u.args |=(x=term =(x n))) ~
6914+ =/ found=(unit shape) (find-simple-mold n molds.state.u.args)
6915+ ?~ found
6916+ ?: (lien molds.state.u.args |=(m=[name=term body=shape] =(name.m n))) ~
6917+ ?~ prelude.state.u.args ~
6918+ =/ prelude-entry=(unit ischeme) (find-jibb-mold n u.prelude.state.u.args)
6919+ ?~ prelude-entry ~
6920+ ?~ vars.u.prelude-entry ~
6921+ =/ applied=(unit itype) (template-apply u.prelude-entry types.u.args)
6922+ ?~ applied ~
6923+ `[u.applied state.u.args]
6924+ ?. ?=(%generic -.u.found) ~
6925+ =/ grec=(unit itype) (simple-source-generic-recursive n u.found types.u.args state.u.args)
6926+ ?^ grec `[u.grec state.u.args]
6927+ ?. (distinct-params vars.u.found) ~
6928+ =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
6929+ ?~ params ~
6930+ =/ out=(unit [typ=itype state=istate])
6931+ $(sh body.u.found, state state.u.args(active [n active.state.u.args], in-mold &, params u.params))
6932+ ?~ out ~
6933+ ?^ (unresolved-hole holes.state.u.out holes.state.u.args state.u.out) ~
6934+ ?: &(?=(%union -.typ.u.out) !?=(%union -.body.u.found) ?=(~ origin.typ.u.out)) ~
6935+ ?: &(?=(%union -.typ.u.out) ?=(%union -.body.u.found) !(lien top-molds.state.u.args |=(x=term =(x n)))) ~
6936+ =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.u.found))
6937+ (label-direct-union typ.u.out(args types.u.args) u.found n state.u.args)
6938+ `[typ.u.out state.u.out(active active.state.u.args, in-mold in-mold.state.u.args, params params.state.u.args, holes holes.state.u.args)]
6939+ %tvar
6940+ =/ param=(unit itype) (iparam-lookup name.sh params.state)
6941+ ?^ param `[u.param state]
6942+ ?: in-mold.state ~
6943+ =/ n=(unit @ud) (icap-lookup name.sh caps.state)
6944+ ?^ n `[[%var u.n] state]
6945+ `[[%var next.state] state(next +(next.state), caps [[name.sh next.state at.sh] caps.state])]
6946+ * ~
6947+ ==
6948+::
6949+++ infer-simple-fields
6950+ |= [fields=(list field) state=istate]
6951+ ^- (unit [typ=itype state=istate])
6952+ ?~ fields ~
6953+ =/ field-shape=shape
6954+ ?- -.i.fields
6955+ %bare shape.i.fields
6956+ %face shape.i.fields
6957+ %pun [%ref at.i.fields ~[name.i.fields]]
6958+ ==
6959+ =/ head=(unit [typ=itype state=istate]) (infer-simple-shape field-shape state)
6960+ ?~ head ~
6961+ =/ t=itype typ.u.head
6962+ =. t
6963+ ?- -.i.fields
6964+ %bare t
6965+ %face [%face name.i.fields t]
6966+ %pun [%face name.i.fields t]
6967+ ==
6968+ ?~ t.fields `[t state.u.head]
6969+ =/ tail=(unit [typ=itype state=istate]) $(fields t.fields, state state.u.head)
6970+ ?~ tail ~
6971+ `[[%cell t typ.u.tail] state.u.tail]
6972+::
6973+++ infer-sample
6974+ |= [s=sample env=ienv state=istate]
6975+ ^- isample-result
6976+ ?- -.s
6977+ %bind
6978+ ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6979+ [%| "sample shadows a name"]
6980+ =/ t=itype [%var next.state]
6981+ [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
6982+ %face
6983+ ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6984+ [%| "sample shadows a name"]
6985+ =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
6986+ ?~ t [%| "sample mold is not supported by partial inference"]
6987+ [%& typ.u.t [[name.s [typ.u.t ~]] env] state.u.t]
6988+ %bare
6989+ =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
6990+ ?~ t [%| "sample mold is not supported by partial inference"]
6991+ [%& typ.u.t env state.u.t]
6992+ %pun
6993+ $(s [%face at.s name.s [%ref at.s ~[name.s]]])
6994+ %cell
6995+ (infer-sample-items items.s env state)
6996+ ==
6997+::
6998+:: Cell-sample binders are faces on their positions; at the top of a
6999+:: sample a binder only supplies a name for the whole sample.
7000+::
7001+++ infer-sample-items
7002+ |= [items=(list sample) env=ienv state=istate]
7003+ ^- isample-result
7004+ ?~ items [%| "empty sample is not supported by partial inference"]
7005+ =/ head=isample-result (infer-sample i.items env state)
7006+ ?: ?=(%| -.head) head
7007+ =/ ht=itype typ.p.head
7008+ =. ht
7009+ ?- -.i.items
7010+ %bind [%face name.i.items ht]
7011+ %face [%face name.i.items ht]
7012+ %pun [%face name.i.items ht]
7013+ * ht
7014+ ==
7015+ ?~ t.items [%& ht env.p.head state.p.head]
7016+ =/ tail=isample-result $(items t.items, env env.p.head, state state.p.head)
7017+ ?: ?=(%| -.tail) tail
7018+ [%& [%cell ht typ.p.tail] env.p.tail state.p.tail]
7019+::
7020+:: Local definitions generalize only variables outside their enclosing
7021+:: environment and explicit-capital scope. Recursive gate groups use
7022+:: monomorphic placeholders while their bodies are checked.
7023+::
7024++$ ilocal-result (each [env=ienv state=istate] idiag)
7025+++ free-env-vars
7026+ |= [env=ienv sub=isub]
7027+ ^- (list @ud)
7028+ ?~ env ~
7029+ =/ sc=ischeme scheme.i.env
7030+ =/ ids=(list @ud) (unique-type-vars (itype-vars typ.sc))
7031+ =/ free=(list @ud) ~
7032+ |-
7033+ ?~ ids (weld free (free-env-vars t.env sub))
7034+ ?: (lien vars.sc |=(n=@ud =(n i.ids))) $(ids t.ids)
7035+ =/ resolved=itype (itype-normalize [%var i.ids] sub)
7036+ $(ids t.ids, free (weld (itype-vars resolved) free))
7037+::
7038+++ free-cap-vars
7039+ |= [caps=icaps sub=isub]
7040+ ^- (list @ud)
7041+ ?~ caps ~
7042+ (weld (itype-vars (itype-normalize [%var id.i.caps] sub)) $(caps t.caps))
7043+::
7044+++ local-names-valid
7045+ |= [ds=(list def) env=ienv state=istate]
7046+ ^- ?
7047+ =/ names=(list term) (global-value-names ds)
7048+ |-
7049+ ?~ ds &
7050+ ?: ?=(%mold -.i.ds) $(ds t.ds)
7051+ ?: =(name.i.ds %proj) |
7052+ ?. (unique-value-name name.i.ds names) |
7053+ ?: ?=(^ (ienv-lookup name.i.ds env)) |
7054+ ?: (lien globals.state |=(n=term =(n name.i.ds))) |
7055+ $(ds t.ds)
7056+::
7057+:: The supported local molds are nonrecursive simple aliases. Validate
7058+:: all of them, including unused ones, before checking any local values.
7059+:: The enclosing gate sample was checked before this scope was entered.
7060+::
7061+++ local-value-defs
7062+ |= ds=(list def)
7063+ ^- (list def)
7064+ ?~ ds ~
7065+ ?: ?=(%mold -.i.ds) $(ds t.ds)
7066+ [i.ds $(ds t.ds)]
7067+::
7068+++ local-mold-names-valid
7069+ |= [locals=imolds state=istate]
7070+ ^- ?
7071+ =/ names=(list term) (turn locals |=(m=[name=term body=shape] name.m))
7072+ |-
7073+ ?~ locals &
7074+ =/ n=term name.i.locals
7075+ ?: =(n %proj) |
7076+ ?. (unique-value-name n names) |
7077+ ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
7078+ ?: (lien marks.state |=(m=term =(n m))) |
7079+ ?: (lien reserved-molds.state |=(m=term =(n m))) |
7080+ ?: (lien surs.state |=(m=term =(n m))) |
7081+ $(locals t.locals)
7082+::
7083+++ local-molds-supported
7084+ |= [locals=imolds state=istate]
7085+ ^- ?
7086+ ?~ locals &
7087+ =/ m=[name=term body=shape] i.locals
7088+ =/ inferred=(unit [template=ischeme state=istate])
7089+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
7090+ ?~ inferred |
7091+ $(locals t.locals)
7092+::
7093+:: Gather written capitals belonging to one ++. Nested local definitions
7094+:: establish their own scopes; inline gates remain in the enclosing scope.
7095++$ icap-site [name=@t at=span]
7096+++ scope-shape
7097+ |= s=shape
7098+ ^- (list icap-site)
7099+ ?- -.s
7100+ %tvar ~[[name.s at.s]]
7101+ %apply (zing (turn args.s scope-shape))
7102+ %cell (zing (turn fields.s scope-field))
7103+ %union (zing (turn cases.s scope-shape))
7104+ %fn (weld (scope-shape sample.s) (scope-shape product.s))
7105+ %generic
7106+ =/ inside=(list icap-site) (scope-shape body.s)
7107+ (skim inside |=(site=icap-site !(lien vars.s |=(v=@t =(v name.site)))))
7108+ * ~
7109+ ==
7110+::
7111+++ scope-field
7112+ |= f=field
7113+ ^- (list icap-site)
7114+ ?- -.f
7115+ %face (scope-shape shape.f)
7116+ %bare (scope-shape shape.f)
7117+ %pun ~
7118+ ==
7119+::
7120+++ scope-sample
7121+ |= s=sample
7122+ ^- (list icap-site)
7123+ ?- -.s
7124+ %face (scope-shape shape.s)
7125+ %bare (scope-shape shape.s)
7126+ %cell (zing (turn items.s scope-sample))
7127+ * ~
7128+ ==
7129+::
7130+++ scope-pieces
7131+ |= ps=(list piece)
7132+ ^- (list icap-site)
7133+ ?~ ps ~
7134+ =/ first=(list icap-site)
7135+ ?- -.i.ps
7136+ %expr (scope-expr p.i.ps)
7137+ %text ~
7138+ ==
7139+ (weld first $(ps t.ps))
7140+::
7141+++ scope-qsegs
7142+ |= ps=(list qseg)
7143+ ^- (list icap-site)
7144+ ?~ ps ~
7145+ =/ first=(list icap-site)
7146+ ?- -.i.ps
7147+ %expr (scope-expr p.i.ps)
7148+ %knot ~
7149+ ==
7150+ (weld first $(ps t.ps))
7151+::
7152+++ scope-edits
7153+ |= xs=(list edit)
7154+ ^- (list icap-site)
7155+ ?~ xs ~
7156+ =/ first=(list icap-site) (scope-expr val.i.xs)
7157+ (weld first $(xs t.xs))
7158+::
7159+++ scope-items
7160+ |= xs=(list item)
7161+ ^- (list icap-site)
7162+ ?~ xs ~
7163+ =/ first=(list icap-site) (scope-expr val.i.xs)
7164+ (weld first $(xs t.xs))
7165+::
7166+++ scope-arms
7167+ |= xs=(list arm)
7168+ ^- (list icap-site)
7169+ ?~ xs ~
7170+ =/ first=(list icap-site) (scope-expr val.i.xs)
7171+ (weld first $(xs t.xs))
7172+::
7173+++ scope-exprs
7174+ |= xs=(list expr)
7175+ ^- (list icap-site)
7176+ ?~ xs ~
7177+ =/ first=(list icap-site) (scope-expr i.xs)
7178+ (weld first $(xs t.xs))
7179+::
7180+++ scope-expr
7181+ |= e=expr
7182+ ^- (list icap-site)
7183+ ?- -.e
7184+ %str (scope-pieces pieces.e)
7185+ %qath (scope-qsegs segs.e)
7186+ %change (scope-edits edits.e)
7187+ %pair (scope-expr val.e)
7188+ %unit (scope-expr val.e)
7189+ %group (scope-expr inner.e)
7190+ %list (scope-exprs items.e)
7191+ %tuple (scope-items items.e)
7192+ %gate
7193+ =/ first=(list icap-site) (scope-sample sample.e)
7194+ =/ last=(list icap-site) (scope-expr body.e)
7195+ (weld first last)
7196+ %gate-wide
7197+ =/ first=(list icap-site) (scope-sample sample.e)
7198+ =/ last=(list icap-site) (scope-expr body.e)
7199+ (weld first last)
7200+ %call
7201+ =/ first=(list icap-site) (scope-expr head.e)
7202+ =/ last=(list icap-site) (scope-exprs args.e)
7203+ (weld first last)
7204+ %cast
7205+ =/ first=(list icap-site) (scope-shape shape.e)
7206+ =/ last=(list icap-site) (scope-expr val.e)
7207+ (weld first last)
7208+ %trace
7209+ =/ first=(list icap-site) (scope-expr val.e)
7210+ =/ last=(list icap-site) (scope-expr then.e)
7211+ (weld first last)
7212+ %branch
7213+ =/ first=(list icap-site) (scope-expr subject.e)
7214+ =/ last=(list icap-site) (scope-arms arms.e)
7215+ (weld first last)
7216+ %body (scope-expr final.e)
7217+ * ~
7218+ ==
7219+::
7220+++ reserve-cap-sites
7221+ |= [sites=(list icap-site) state=istate]
7222+ ^- istate
7223+ ?~ sites state
7224+ ?: ?=(^ (icap-lookup name.i.sites caps.state)) $(sites t.sites)
7225+ $(sites t.sites, state state(next +(next.state), caps [[name.i.sites next.state at.i.sites] caps.state]))
7226+::
7227+++ reserve-def-caps
7228+ |= [e=expr state=istate]
7229+ ^- istate
7230+ (reserve-cap-sites (scope-expr e) state)
7231+::
7232+++ infer-local-defs
7233+ |= [ds=(list def) env=ienv state=istate]
7234+ ^- ilocal-result
7235+ =/ remaining=(list def) ~
7236+ =/ progressed=? |
7237+ |-
7238+ ?~ ds
7239+ ?~ remaining [%& env state]
7240+ ?. progressed
7241+ =/ pending=(list def) (flop remaining)
7242+ =/ groups=icomponents (graph-components pending (global-value-names pending))
7243+ =/ grouped=(unit [rest=(list def) env=ienv state=istate])
7244+ (try-local-group pending groups env state)
7245+ ?~ grouped [%| ["local definitions need unsupported inference" ~]]
7246+ $(ds rest.u.grouped, remaining ~, env env.u.grouped, state state.u.grouped, progressed |)
7247+ $(ds (flop remaining), remaining ~, progressed |)
7248+ =/ d=def i.ds
7249+ ?> ?=(%value -.d)
7250+ =/ local-state=istate (reserve-def-caps val.d state)
7251+ =/ inferred=iresult (infer-fragment val.d env local-state)
7252+ =/ retried=? ?=(%| -.inferred)
7253+ =? inferred retried (infer-recursive-gate d env local-state)
7254+ ?: ?=(%| -.inferred) $(ds t.ds, remaining [d remaining])
7255+ ?: !=(obligations.state.p.inferred obligations.state) [%| ["deferred local definition needs unsupported inference" ~]]
7256+ =. state.p.inferred (promote-restricted-numbers state.p.inferred env)
7257+ =. state.p.inferred (default-hole-numbers holes.state.p.inferred holes.state state.p.inferred env !(itype-has-gate (itype-normalize typ.p.inferred sub.state.p.inferred)))
7258+ =/ hole=(unit idiag) (unresolved-hole holes.state.p.inferred holes.state state.p.inferred)
7259+ ?^ hole [%| u.hole]
7260+ =/ merged=(unit [first=icap second=icap])
7261+ (merged-capitals caps.state.p.inferred sub.state.p.inferred)
7262+ ?^ merged
7263+ [%| ["distinct type variables `{(trip name.first.u.merged)}` and `{(trip name.second.u.merged)}` must not be forced equal; use the same capital for a shared type" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]]
7264+ ?: (constrained-capitals caps.state.p.inferred sub.state.p.inferred)
7265+ [%| ["explicit capital constraints are not supported by partial inference" ~]]
7266+ =/ typ=itype (itype-normalize typ.p.inferred sub.state.p.inferred)
7267+ ?: |((pending-tags tags.state.p.inferred sub.state.p.inferred) (itype-has-tag typ))
7268+ $(ds t.ds, remaining [d remaining])
7269+ ?: (unsupported-atom-vars typ caps.state.p.inferred binders.state.p.inferred sub.state.p.inferred)
7270+ $(ds t.ds, remaining [d remaining])
7271+ =/ free=(list @ud)
7272+ (weld (free-env-vars env sub.state.p.inferred) (free-cap-vars caps.state sub.state.p.inferred))
7273+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
7274+ =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
7275+ $(ds t.ds, env [[name.d [typ vars]] env], state state.p.inferred(caps caps.state, holes holes.state), progressed &)
7276+::
7277+:: Try complete cyclic local groups after individual definitions stall.
7278+:: Components with non-gates or unresolved constraints stay unavailable.
7279+::
7280+++ try-local-group
7281+ |= [ds=(list def) groups=icomponents env=ienv state=istate]
7282+ ^- (unit [rest=(list def) env=ienv state=istate])
7283+ ?~ groups ~
7284+ =/ names=(list term) i.groups
7285+ ?. (gth (lent names) 1) $(groups t.groups)
7286+ =/ members=(list def)
7287+ (skim ds |=(d=def &(?=(%value -.d) (lien names |=(n=term =(n name.d))))))
7288+ ?. =((lent members) (lent names)) $(groups t.groups)
7289+ =/ result=ilocal-result (infer-gate-group members env state)
7290+ ?: ?=(%| -.result) $(groups t.groups)
7291+ =/ rest=(list def)
7292+ (skim ds |=(d=def !(lien names |=(n=term =(n name.d)))))
7293+ =/ more=(unit [rest=(list def) env=ienv state=istate])
7294+ $(ds rest, groups t.groups, env env.p.result, state state.p.result)
7295+ ?^ more more
7296+ `[rest env.p.result state.p.result]
7297+::
7298+:: Read only fields of a known record. Unresolved field constraints and
7299+:: ambiguous repeated faces are outside this fragment. Imported record
7300+:: spines with repeated names are unavailable when used.
7301+::
7302+++ record-fields-named
7303+ |= [name=term t=itype sub=isub]
7304+ ^- (list itype)
7305+ =. t (itype-walk t sub)
7306+ ?: ?=(%face -.t)
7307+ ?:(=(name name.t) ~[body.t] ~)
7308+ ?. ?=(%cell -.t) ~
7309+ =/ first=(list itype) ~
7310+ =/ head=itype (itype-walk hed.t sub)
7311+ =? first ?=(%face -.head) ?:(=(name name.head) ~[body.head] ~)
7312+ (weld first $(t tal.t))
7313+::
7314+++ infer-field-wing
7315+ |= [names=(list term) env=ienv state=istate]
7316+ ^- iresult
7317+ =/ reverse=(list term) (flop names)
7318+ ?~ reverse [%| ["empty wing" ~]]
7319+ =/ iface=(unit ifile) (find-jibb-interface i.reverse jimports.state)
7320+ =/ fields=(list term) t.reverse
7321+ ?~ fields [%| ["field access is not supported by partial inference" ~]]
7322+ =/ scheme=(unit ischeme)
7323+ ?~ iface
7324+ (ienv-lookup i.reverse env)
7325+ (ienv-lookup i.fields values.u.iface)
7326+ ?~ scheme
7327+ ?^ iface [%| ["module member is not available to partial inference" ~]]
7328+ [%| ["field access is not supported by partial inference" ~]]
7329+ =/ inst=[typ=itype state=istate]
7330+ ?~ iface (instantiate-scheme u.scheme state)
7331+ =/ imported=ischeme u.scheme
7332+ =. typ.imported (itype-in-import typ.imported u.iface i.reverse prelude.state)
7333+ (instantiate-scheme imported state)
7334+ =/ remaining=(list term) ?~(iface fields t.fields)
7335+ =/ typ=itype typ.inst
7336+ |-
7337+ ?~ remaining [%& typ state.inst]
7338+ =/ found=(list itype) (record-fields-named i.remaining typ sub.state.inst)
7339+ ?~ found [%| ["field is not available to partial inference" ~]]
7340+ ?^ t.found [%| ["field name is ambiguous in partial inference" ~]]
7341+ $(remaining t.remaining, typ i.found)
7342+::
7343+:: Propagate a known union or list through supported loobean, unit and list
7344+:: branches. Empty bodies and groups are transparent; bodies with definitions
7345+:: keep their normal scoping and wait for general bidirectional inference.
7346+::
7347+++ context-union-branch
7348+ |= e=expr
7349+ ^- ?
7350+ ?- -.e
7351+ %branch &
7352+ %group $(e inner.e)
7353+ %body ?~(defs.e $(e final.e) |)
7354+ * |
7355+ ==
7356+::
7357+++ infer-union-context
7358+ |= [e=expr expected=itype env=ienv state=istate context=span]
7359+ ^- iresult
7360+ ?: ?=(%group -.e) $(e inner.e)
7361+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
7362+ ?: &(?=(%collection -.expected) =(%list name.expected) (context-list-expression e))
7363+ (infer-list-context e expected env state context)
7364+ ?: ?=(%branch -.e)
7365+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state `[expected context])
7366+ ?^ empty-list u.empty-list
7367+ ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
7368+ ?~ t.arms.e [%| ["branch pattern is not supported by partial inference" ~]]
7369+ ?^ t.t.arms.e [%| ["branch is not supported by partial inference" ~]]
7370+ =/ x=arm i.arms.e
7371+ =/ y=arm i.t.arms.e
7372+ ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
7373+ (infer-unit-branch e env state `[expected context])
7374+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y))
7375+ [%| ["branch pattern is not supported by partial inference" ~]]
7376+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
7377+ [%| ["branch pattern is not supported by partial inference" ~]]
7378+ ?: =(val.lit.pat.x val.lit.pat.y)
7379+ [%| ["branch does not cover both loobeans" ~]]
7380+ =/ subject=iresult (infer-fragment subject.e env state)
7381+ ?: ?=(%| -.subject) subject
7382+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
7383+ ?: ?=(%union -.subject-type)
7384+ [%| ["contextual union-pattern branch is not supported by partial inference" ~]]
7385+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
7386+ ?~ su [%| ["loobean branch subject does not unify with ?" ~]]
7387+ =/ left=iresult $(e val.x, state state.p.subject(sub u.su))
7388+ ?: ?=(%| -.left) left
7389+ =/ right=iresult $(e val.y, state state.p.left)
7390+ ?: ?=(%| -.right) right
7391+ [%& expected state.p.right]
7392+ =/ value=iresult (infer-fragment e env state)
7393+ ?: ?=(%| -.value) value
7394+ =/ fit=ifit (itype-fit typ.p.value expected sub.state.p.value next.state.p.value)
7395+ ?: ?=(%unknown -.fit)
7396+ ?: &(?=(%collection -.expected) =(%list name.expected))
7397+ [%| ["branch list constraint is not supported by partial inference" ~]]
7398+ ?: ?=(%flag -.expected) [%| ["branch loobean constraint is not supported by partial inference" ~]]
7399+ [%| ["branch union constraint is not supported by partial inference" ~]]
7400+ ?: ?=(%bad -.fit)
7401+ =/ missing=(unit idiag) (missing-union-tag e expected sub.state.p.value context)
7402+ ?^ missing [%| u.missing]
7403+ =/ nested=(unit idiag) (nested-missing-tag e typ.p.value expected sub.state.p.value next.state.p.value context)
7404+ ?^ nested [%| u.nested]
7405+ ?: &(?=(%collection -.expected) =(%list name.expected))
7406+ [%| ["branch arm does not fit its expected list" ~[[context "expected list"] [(span-of e) "branch arm"]]]]
7407+ ?: ?=(%flag -.expected)
7408+ [%| ["branch arm does not fit its expected loobean" ~[[context "expected loobean"] [(span-of e) "branch arm"]]]]
7409+ [%| ["branch arm does not fit its expected union" ~[[context "expected union"] [(span-of e) "branch arm"]]]]
7410+ [%& expected state.p.value(sub sub.fit, next next.fit)]
7411+::
7412+:: A list expression needs a known list target and the validated prelude list.
7413+:: Literal items and unfaced two-item cons cells receive that target one by
7414+:: one; pending constraints elsewhere stay in the threaded state.
7415+::
7416+++ context-list-expression
7417+ |= e=expr
7418+ ^- ?
7419+ ?- -.e
7420+ %list &
7421+ %tuple &
7422+ %lit |(=(%null form.lit.e) &(=(%term form.lit.e) =(0 val.lit.e)))
7423+ %group $(e inner.e)
7424+ %body ?~(defs.e $(e final.e) |)
7425+ * |
7426+ ==
7427+::
7428+++ infer-list-context
7429+ |= [e=expr expected=itype env=ienv state=istate context=span]
7430+ ^- iresult
7431+ ?: ?=(%group -.e) $(e inner.e)
7432+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
7433+ ?~ prelude.state [%| ["list literal needs the standard prelude in partial inference" ~]]
7434+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
7435+ [%| ["list literal needs the standard prelude in partial inference" ~]]
7436+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
7437+ ?~ standard [%| ["list literal needs the standard prelude in partial inference" ~]]
7438+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
7439+ [%| ["list literal needs the standard prelude in partial inference" ~]]
7440+ =/ target=itype (itype-walk expected sub.state)
7441+ ?. ?=(%collection -.target) [%| ["list context is not supported by partial inference" ~]]
7442+ ?. =(%list name.target) [%| ["list context is not supported by partial inference" ~]]
7443+ ?~ args.target [%| ["list context is not supported by partial inference" ~]]
7444+ ?^ t.args.target [%| ["list context is not supported by partial inference" ~]]
7445+ ?: ?=(%lit -.e)
7446+ ?. |(=(%null form.lit.e) &(=(%term form.lit.e) =(0 val.lit.e)))
7447+ [%| ["list expression is not supported by partial inference" ~]]
7448+ [%& target state]
7449+ ?: ?=(%list -.e)
7450+ =/ result=iresult (infer-list-items items.e i.args.target env state context)
7451+ ?: ?=(%| -.result) result
7452+ [%& target state.p.result]
7453+ ?. ?=(%tuple -.e) [%| ["list expression is not supported by partial inference" ~]]
7454+ ?~ items.e [%| ["cons shape is not supported by partial inference" ~]]
7455+ ?~ t.items.e [%| ["cons shape is not supported by partial inference" ~]]
7456+ ?^ t.t.items.e [%| ["cons shape is not supported by partial inference" ~]]
7457+ ?^ face.i.items.e [%| ["faced cons is not supported by partial inference" ~]]
7458+ ?^ face.i.t.items.e [%| ["faced cons is not supported by partial inference" ~]]
7459+ =/ head=iresult (infer-list-items ~[val.i.items.e] i.args.target env state context)
7460+ ?: ?=(%| -.head) head
7461+ =/ target=itype (itype-walk target sub.state.p.head)
7462+ =/ tail=iresult
7463+ ?: (context-list-expression val.i.t.items.e)
7464+ (infer-list-context val.i.t.items.e target env state.p.head context)
7465+ (infer-fragment val.i.t.items.e env state.p.head)
7466+ ?: ?=(%| -.tail) tail
7467+ =/ fit=ifit (itype-fit typ.p.tail target sub.state.p.tail next.state.p.tail)
7468+ ?: ?=(%unknown -.fit) [%| ["list tail constraint is not supported by partial inference" ~]]
7469+ ?: ?=(%bad -.fit)
7470+ [%| ["list tail does not fit its expected type" ~[[context (site-type-note "expected list" target sub.state.p.tail)] [(span-of val.i.t.items.e) (site-type-note "list tail" typ.p.tail sub.state.p.tail)]]]]
7471+ [%& target state.p.tail(sub sub.fit, next next.fit)]
7472+::
7473+++ infer-open-list-items
7474+ |= [items=(list expr) expected=itype env=ienv state=istate context=span]
7475+ ^- iresult
7476+ ?~ items [%& expected state]
7477+ =/ target=itype (itype-walk expected sub.state)
7478+ =/ value=iresult (infer-call-context-arg i.items target env state context)
7479+ ?: ?=(%| -.value) value
7480+ =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7481+ ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
7482+ ?: ?=(%bad -.fit)
7483+ ?: |((itype-family-related typ.p.value target sub.state.p.value) (itype-has-any-atom typ.p.value sub.state.p.value) (itype-has-any-atom target sub.state.p.value))
7484+ [%| ["list item widening is not supported by partial inference" ~]]
7485+ [%| ["list items do not have compatible types" ~[[context (site-type-note "expected item" target sub.state.p.value)] [(span-of i.items) (site-type-note "list item" typ.p.value sub.state.p.value)]]]]
7486+ ?: (itype-has-tag (itype-normalize expected sub.fit))
7487+ [%| ["list item needs context in partial inference" ~]]
7488+ $(items t.items, state state.p.value(sub sub.fit, next next.fit))
7489+::
7490+++ infer-list-items
7491+ |= [items=(list expr) expected=itype env=ienv state=istate context=span]
7492+ ^- iresult
7493+ ?~ items [%& expected state]
7494+ =/ target=itype (itype-walk expected sub.state)
7495+ =/ value=iresult (infer-call-context-arg i.items target env state context)
7496+ ?: ?=(%| -.value) value
7497+ =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7498+ ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
7499+ ?: ?=(%bad -.fit)
7500+ =/ missing=(unit idiag) (missing-union-tag i.items target sub.state.p.value context)
7501+ ?^ missing [%| u.missing]
7502+ =/ nested=(unit idiag) (nested-missing-tag i.items typ.p.value target sub.state.p.value next.state.p.value context)
7503+ ?^ nested [%| u.nested]
7504+ [%| ["list item does not fit its expected type" ~[[context (site-type-note "expected item" target sub.state.p.value)] [(span-of i.items) (site-type-note "list item" typ.p.value sub.state.p.value)]]]]
7505+ $(items t.items, state state.p.value(sub sub.fit, next next.fit))
7506+::
7507+:: The supported unit pattern covers exactly an atom zero and a cell
7508+:: headed by zero, with a single binder for its payload. Unresolved
7509+:: subjects and all other pattern matrices stay outside this fragment.
7510+::
7511+++ unit-empty-pattern
7512+ |= p=pattern
7513+ ^- ?
7514+ ?. ?=(%lit -.p) |
7515+ =(%null form.lit.p)
7516+::
7517+++ unit-payload-pattern
7518+ |= p=pattern
7519+ ^- (unit term)
7520+ ?. ?=(%cell -.p) ~
7521+ ?~ items.p ~
7522+ ?~ t.items.p ~
7523+ ?^ t.t.items.p ~
7524+ ?. (unit-empty-pattern i.items.p) ~
7525+ ?. ?=(%bind -.i.t.items.p) ~
7526+ `name.i.t.items.p
7527+::
7528+++ unit-empty-case
7529+ |= t=itype
7530+ ^- ?
7531+ ?. ?=(%const -.t) |
7532+ =(0 val.literal.t)
7533+::
7534+++ unit-payload-case
7535+ |= t=itype
7536+ ^- (unit itype)
7537+ ?. ?=(%cell -.t) ~
7538+ ?. (unit-empty-case hed.t) ~
7539+ =/ payload=itype tal.t
7540+ =? payload ?=(%face -.payload) body.payload
7541+ `payload
7542+::
7543+++ unit-union-payload
7544+ |= t=itype
7545+ ^- (unit itype)
7546+ ?. ?=(%union -.t) ~
7547+ ?~ cases.t ~
7548+ ?~ t.cases.t ~
7549+ ?^ t.t.cases.t ~
7550+ ?: (unit-empty-case i.cases.t) (unit-payload-case i.t.cases.t)
7551+ ?: (unit-empty-case i.t.cases.t) (unit-payload-case i.cases.t)
7552+ ~
7553+::
7554+:: List matching currently covers exactly null and a cell of two binders.
7555+:: The head has the element type and the tail has the whole list type.
7556+:: Other patterns and lists whose element mold is empty remain unsupported.
7557+::
7558+++ list-payload-pattern
7559+ |= p=pattern
7560+ ^- (unit [head=term tail=term])
7561+ ?. ?=(%cell -.p) ~
7562+ ?~ items.p ~
7563+ ?~ t.items.p ~
7564+ ?^ t.t.items.p ~
7565+ ?. ?=(%bind -.i.items.p) ~
7566+ ?. ?=(%bind -.i.t.items.p) ~
7567+ `[name.i.items.p name.i.t.items.p]
7568+::
7569+++ infer-list-branch
7570+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span]) typ=itype]
7571+ ^- iresult
7572+ ?> ?=(%branch -.e)
7573+ ?> ?=(%collection -.typ)
7574+ ?. =(%list name.typ) [%| ["list pattern is not supported by partial inference" ~]]
7575+ ?~ prelude.state [%| ["list pattern needs the standard prelude in partial inference" ~]]
7576+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
7577+ [%| ["list pattern needs the standard prelude in partial inference" ~]]
7578+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
7579+ ?~ standard [%| ["list pattern needs the standard prelude in partial inference" ~]]
7580+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
7581+ [%| ["list pattern needs the standard prelude in partial inference" ~]]
7582+ ?~ args.typ [%| ["list pattern is not supported by partial inference" ~]]
7583+ ?^ t.args.typ [%| ["list pattern is not supported by partial inference" ~]]
7584+ =/ item-live=(unit [result=?(%yes %no %unknown) left=@ud])
7585+ (itype-inhabited-proof i.args.typ sub.state caps.state 256)
7586+ ?~ item-live [%| ["list element reachability needs unsupported inference" ~]]
7587+ ?: =(%unknown result.u.item-live) [%| ["list element reachability needs unsupported inference" ~]]
7588+ ?: =(%no result.u.item-live) [%| ["list nonempty pattern is unreachable" ~]]
7589+ ?~ arms.e [%| ["list branch is not supported by partial inference" ~]]
7590+ ?~ t.arms.e [%| ["list branch is not supported by partial inference" ~]]
7591+ ?^ t.t.arms.e [%| ["list branch is not supported by partial inference" ~]]
7592+ =/ x=arm i.arms.e
7593+ =/ y=arm i.t.arms.e
7594+ =/ first-empty=? (unit-empty-pattern pat.x)
7595+ =/ first-name=(unit [head=term tail=term]) (list-payload-pattern pat.x)
7596+ =/ second-name=(unit [head=term tail=term]) (list-payload-pattern pat.y)
7597+ ?. |(&(first-empty ?=(^ second-name)) &((unit-empty-pattern pat.y) ?=(^ first-name)))
7598+ [%| ["list branch pattern is not supported by partial inference" ~]]
7599+ =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
7600+ ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
7601+ ?: |(=(head.u.binder %proj) =(tail.u.binder %proj) =(head.u.binder tail.u.binder) ?=(^ (ienv-lookup head.u.binder env)) ?=(^ (ienv-lookup tail.u.binder env)) (lien globals.state |=(n=term |(=(n head.u.binder) =(n tail.u.binder)))))
7602+ [%| ["pattern binder shadows a name" ~]]
7603+ =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
7604+ =/ left=iresult
7605+ ?~ expected (infer-fragment val.x ?:(first-empty env extended) state)
7606+ (infer-union-context val.x typ.u.expected ?:(first-empty env extended) state context.u.expected)
7607+ ?: ?=(%| -.left) left
7608+ =/ right=iresult
7609+ ?~ expected (infer-fragment val.y ?:(first-empty extended env) state.p.left)
7610+ (infer-union-context val.y typ.u.expected ?:(first-empty extended env) state.p.left context.u.expected)
7611+ ?: ?=(%| -.right) right
7612+ ?^ expected [%& typ.u.expected state.p.right]
7613+ =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
7614+ ?~ joined [%| ["list branch results need unsupported inference" ~]]
7615+ [%& typ.p.left state.p.right(sub u.joined)]
7616+::
7617+++ infer-unit-branch
7618+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
7619+ ^- iresult
7620+ ?> ?=(%branch -.e)
7621+ ?~ arms.e [%| ["unit branch is not supported by partial inference" ~]]
7622+ ?~ t.arms.e [%| ["unit branch is not supported by partial inference" ~]]
7623+ ?^ t.t.arms.e [%| ["unit branch is not supported by partial inference" ~]]
7624+ =/ subject=iresult (infer-fragment subject.e env state)
7625+ ?: ?=(%| -.subject) subject
7626+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7627+ ?: &(?=(%collection -.typ) =(%list name.typ))
7628+ (infer-list-branch e env state.p.subject expected typ)
7629+ =/ x=arm i.arms.e
7630+ =/ y=arm i.t.arms.e
7631+ =/ first-empty=? (unit-empty-pattern pat.x)
7632+ =/ first-name=(unit term) (unit-payload-pattern pat.x)
7633+ =/ second-name=(unit term) (unit-payload-pattern pat.y)
7634+ ?. |(&(first-empty ?=(^ second-name)) &((unit-empty-pattern pat.y) ?=(^ first-name)))
7635+ [%| ["unit branch pattern is not supported by partial inference" ~]]
7636+ =/ binder=(unit term) ?:(first-empty second-name first-name)
7637+ ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
7638+ ?: |(=(u.binder %proj) ?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
7639+ [%| ["pattern binder shadows a name" ~]]
7640+ =/ payload=(unit itype) (unit-union-payload typ)
7641+ ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
7642+ =/ payload-live=(unit [result=?(%yes %no %unknown) left=@ud])
7643+ (itype-inhabited-proof u.payload sub.state.p.subject caps.state.p.subject 256)
7644+ ?~ payload-live [%| ["unit payload reachability needs unsupported inference" ~]]
7645+ ?: =(%unknown result.u.payload-live) [%| ["unit payload reachability needs unsupported inference" ~]]
7646+ ?: =(%no result.u.payload-live) [%| ["unit present pattern is unreachable" ~]]
7647+ =/ extended=ienv [[u.binder [u.payload ~]] env]
7648+ =/ left=iresult
7649+ ?~ expected (infer-fragment val.x ?:(first-empty env extended) state.p.subject)
7650+ (infer-union-context val.x typ.u.expected ?:(first-empty env extended) state.p.subject context.u.expected)
7651+ ?: ?=(%| -.left) left
7652+ =/ right=iresult
7653+ ?~ expected (infer-fragment val.y ?:(first-empty extended env) state.p.left)
7654+ (infer-union-context val.y typ.u.expected ?:(first-empty extended env) state.p.left context.u.expected)
7655+ ?: ?=(%| -.right) right
7656+ ?^ expected [%& typ.u.expected state.p.right]
7657+ =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
7658+ ?~ joined [%| ["unit branch results need unsupported inference" ~]]
7659+ [%& typ.p.left state.p.right(sub u.joined)]
7660+::
7661+:: Infer pieces in order, retaining their substitutions and pending tags.
7662+:: A bare decimal literal has no outside type constraint, so it takes its
7663+:: normal @ud default here. Other open numeric and aura variables wait for
7664+:: deferred constraints, which this fragment does not implement yet.
7665+++ infer-string-pieces
7666+ |= [ps=(list piece) env=ienv state=istate]
7667+ ^- iresult
7668+ ?~ ps [%& [%atom %t] state]
7669+ ?: ?=(%text -.i.ps) $(ps t.ps)
7670+ =/ item=iresult (infer-fragment p.i.ps env state)
7671+ ?: ?=(%| -.item) item
7672+ =/ t=itype (itype-normalize typ.p.item sub.state.p.item)
7673+ ?: |(?=(%atom -.t) ?=(%any-atom -.t))
7674+ $(ps t.ps, state state.p.item)
7675+ ?: &(|(?=(%nvar -.t) ?=(%rnvar -.t)) ?=(%lit -.p.i.ps) =(%number form.lit.p.i.ps))
7676+ $(ps t.ps, state state.p.item)
7677+ ?: &(?=(%collection -.t) =(%list name.t) =(~[[%atom 'tD']] args.t))
7678+ $(ps t.ps, state state.p.item)
7679+ ?: &(?=(%avar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
7680+ [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
7681+ ?: &(?=(%rvar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
7682+ [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
7683+ ?: ?=(%cell -.t)
7684+ [%| ["a cell in interpolation needs a printer" ~[[(span-of p.i.ps) "cell without a printer"]]]]
7685+ [%| ["interpolation type needs unsupported inference" ~]]
7686+::
7687+:: Whole-case coverage for a known union. When a pattern may cover only
7688+:: part of a case, finite loobean refinements are tried below; other
7689+:: partial coverage stays unsupported until the general pattern matrix.
7690++$ imatch ?(%full %none %unknown)
7691+++ union-pattern-items
7692+ |= [ps=(list pattern) t=itype]
7693+ ^- imatch
7694+ ?~ ps %unknown
7695+ ?~ t.ps (union-pattern i.ps t)
7696+ =. t ?:(?=(%face -.t) body.t t)
7697+ ?. ?=(%cell -.t)
7698+ ?: |(?=(%atom -.t) ?=(%any-atom -.t) ?=(%flag -.t) ?=(%const -.t)) %none
7699+ %unknown
7700+ =/ a=imatch (union-pattern i.ps hed.t)
7701+ =/ b=imatch $(ps t.ps, t tal.t)
7702+ ?: |(=(%none a) =(%none b)) %none
7703+ ?:(&(=(%full a) =(%full b)) %full %unknown)
7704+::
7705+++ union-pattern
7706+ |= [p=pattern t=itype]
7707+ ^- imatch
7708+ =. t ?:(?=(%face -.t) body.t t)
7709+ ?- -.p
7710+ %any %full
7711+ %bind %full
7712+ %lit
7713+ ?: ?=(%const -.t) ?:(=(val.literal.t val.lit.p) %full %none)
7714+ ?: ?=(%cell -.t) %none
7715+ ?: ?=(%flag -.t)
7716+ ?:(|(=(0 val.lit.p) =(1 val.lit.p)) %unknown %none)
7717+ %unknown
7718+ %str ?:(?=(%cell -.t) %none %unknown)
7719+ %cell (union-pattern-items items.p t)
7720+ ==
7721+::
7722+++ union-pattern-has-bind
7723+ |= p=pattern
7724+ ^- ?
7725+ ?: ?=(%bind -.p) &
7726+ ?. ?=(%cell -.p) |
7727+ (lien items.p union-pattern-has-bind)
7728+::
7729+++ union-pattern-bind-items
7730+ |= [ps=(list pattern) t=itype env=ienv globals=(list term)]
7731+ ^- (unit ienv)
7732+ ?~ ps ~
7733+ ?~ t.ps (union-pattern-bind i.ps t env globals)
7734+ =. t ?:(?=(%face -.t) body.t t)
7735+ ?. ?=(%cell -.t) ~
7736+ =/ first=(unit ienv) (union-pattern-bind i.ps hed.t env globals)
7737+ ?~ first ~
7738+ $(ps t.ps, t tal.t, env u.first)
7739+::
7740+++ union-pattern-bind
7741+ |= [p=pattern t=itype env=ienv globals=(list term)]
7742+ ^- (unit ienv)
7743+ =. t ?:(?=(%face -.t) body.t t)
7744+ ?: ?=(%bind -.p)
7745+ ?: |(=(name.p %proj) ?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
7746+ `[[name.p [t ~]] env]
7747+ ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
7748+ `env
7749+::
7750+:: Split loobean fields into finite refinements for partial patterns.
7751+:: Keep original cases for binder types and preserve whole-case matching
7752+:: before trying refinements. Cap products at 64; unknown, empty or opaque
7753+:: shapes stay unsupported rather than implying complete pattern checking.
7754++$ ifinite [origin=@ud base=itype part=itype]
7755+++ finite-product
7756+ |= [hs=(list itype) ts=(list itype) out=(list itype)]
7757+ ^- (list itype)
7758+ ?~ hs out
7759+ =/ rows=(list itype) (turn ts |=(t=itype [%cell i.hs t]))
7760+ $(hs t.hs, out (weld rows out))
7761+::
7762+++ finite-type
7763+ |= t=itype
7764+ ^- (unit (list itype))
7765+ ?- -.t
7766+ %flag
7767+ `~[[%const [%loobean %f 0 '%.y']] [%const [%loobean %f 1 '%.n']]]
7768+ %face
7769+ =/ body=(unit (list itype)) $(t body.t)
7770+ ?~ body ~
7771+ `(turn u.body |=(x=itype [%face name.t x]))
7772+ %cell
7773+ =/ hed=(unit (list itype)) $(t hed.t)
7774+ ?~ hed ~
7775+ =/ tal=(unit (list itype)) $(t tal.t)
7776+ ?~ tal ~
7777+ ?: (gth (mul (lent u.hed) (lent u.tal)) 64) ~
7778+ `(finite-product u.hed u.tal ~)
7779+ * `~[t]
7780+ ==
7781+::
7782+++ finite-cases
7783+ |= [xs=(list itype) out=(list ifinite) origin=@ud]
7784+ ^- (unit (list ifinite))
7785+ ?~ xs `out
7786+ =/ parts=(unit (list itype)) (finite-type i.xs)
7787+ ?~ parts ~
7788+ ?: (gth (add (lent out) (lent u.parts)) 64) ~
7789+ =/ rows=(list ifinite) (turn u.parts |=(t=itype [origin i.xs t]))
7790+ $(xs t.xs, out (weld out rows), origin +(origin))
7791+::
7792+++ infer-known-union-whole
7793+ |= [e=expr env=ienv subject=iresult]
7794+ ^- (unit iresult)
7795+ ?> ?=(%branch -.e)
7796+ ?: ?=(%| -.subject) `subject
7797+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7798+ ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
7799+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7800+ ?~ live ~
7801+ =/ cases=(list itype) u.live
7802+ =/ remaining=(list itype) cases
7803+ =/ arms=(list arm) arms.e
7804+ =/ st=istate state.p.subject
7805+ =/ answer=(unit itype) ~
7806+ |-
7807+ ?~ arms
7808+ ?^ remaining
7809+ `[%| ["missing union case {(show-itype i.remaining sub.st)}" ~]]
7810+ ?~ answer `[%| ["empty union branch is not supported by partial inference" ~]]
7811+ `[%& u.answer st]
7812+ =/ a=arm i.arms
7813+ ?: (lien remaining |=(c=itype =(%unknown (union-pattern pat.a c))))
7814+ ~
7815+ =/ matching=(list itype) (skim remaining |=(c=itype =(%full (union-pattern pat.a c))))
7816+ ?~ matching
7817+ ?: (lien cases |=(c=itype =(%full (union-pattern pat.a c))))
7818+ `[%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
7819+ `[%| ["union pattern is not supported by partial inference" ~]]
7820+ ?: &(?=(^ t.matching) (union-pattern-has-bind pat.a))
7821+ `[%| ["a union pattern binding several cases is not supported by partial inference" ~]]
7822+ =/ bound=(unit ienv) (union-pattern-bind pat.a i.matching env globals.st)
7823+ ?~ bound `[%| ["pattern binder shadows a name" ~]]
7824+ =/ body=iresult (infer-fragment val.a u.bound st)
7825+ ?: ?=(%| -.body) `body
7826+ =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
7827+ =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
7828+ ?: mismatch `[%| ["union branch result matching needs unsupported inference" ~]]
7829+ $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body, answer `result)
7830+::
7831+++ infer-known-union-context-whole
7832+ |= [e=expr expected=itype env=ienv subject=iresult context=span]
7833+ ^- (unit iresult)
7834+ ?> ?=(%branch -.e)
7835+ ?: ?=(%| -.subject) `subject
7836+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7837+ ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
7838+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7839+ ?~ live ~
7840+ =/ cases=(list itype) u.live
7841+ =/ remaining=(list itype) cases
7842+ =/ arms=(list arm) arms.e
7843+ =/ st=istate state.p.subject
7844+ =/ answer=(unit itype) ~
7845+ |-
7846+ ?~ arms
7847+ ?^ remaining
7848+ `[%| ["missing union case {(show-itype i.remaining sub.st)}" ~]]
7849+ ?~ answer `[%| ["empty union branch is not supported by partial inference" ~]]
7850+ `[%& expected st]
7851+ =/ a=arm i.arms
7852+ ?: (lien remaining |=(c=itype =(%unknown (union-pattern pat.a c))))
7853+ ~
7854+ =/ matching=(list itype) (skim remaining |=(c=itype =(%full (union-pattern pat.a c))))
7855+ ?~ matching
7856+ ?: (lien cases |=(c=itype =(%full (union-pattern pat.a c))))
7857+ `[%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
7858+ `[%| ["union pattern is not supported by partial inference" ~]]
7859+ ?: &(?=(^ t.matching) (union-pattern-has-bind pat.a))
7860+ `[%| ["a union pattern binding several cases is not supported by partial inference" ~]]
7861+ =/ bound=(unit ienv) (union-pattern-bind pat.a i.matching env globals.st)
7862+ ?~ bound `[%| ["pattern binder shadows a name" ~]]
7863+ =/ body=iresult (infer-call-context-arg val.a expected u.bound st context)
7864+ ?: ?=(%| -.body) `body
7865+ =/ fit=ifit (itype-fit typ.p.body expected sub.state.p.body next.state.p.body)
7866+ ?: ?=(%unknown -.fit) `[%| ["union branch result constraint is not supported by partial inference" ~]]
7867+ ?: ?=(%bad -.fit)
7868+ =/ missing=(unit idiag) (missing-union-tag val.a expected sub.state.p.body context)
7869+ ?^ missing `[%| u.missing]
7870+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body expected sub.state.p.body next.state.p.body context)
7871+ ?^ nested `[%| u.nested]
7872+ `[%| ["union branch arm does not fit its expected type" ~[[context "expected type"] [(span-of val.a) "branch arm"]]]]
7873+ ?: (itype-has-tag (itype-normalize expected sub.fit))
7874+ `[%| ["union branch result needs context in partial inference" ~]]
7875+ $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body(sub sub.fit, next next.fit), answer `expected)
7876+::
7877+++ infer-known-union-finite
7878+ |= [e=expr env=ienv subject=iresult expected=(unit [typ=itype context=span])]
7879+ ^- iresult
7880+ ?> ?=(%branch -.e)
7881+ ?: ?=(%| -.subject) subject
7882+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7883+ ?. ?=(%union -.typ) [%| ["branch is not supported by partial inference" ~]]
7884+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7885+ ?~ live [%| ["union emptiness needs unsupported inference" ~]]
7886+ =/ expanded=(unit (list ifinite)) (finite-cases u.live ~ 0)
7887+ ?~ expanded [%| ["union pattern expansion needs unsupported inference" ~]]
7888+ =/ cases=(list ifinite) u.expanded
7889+ =/ remaining=(list ifinite) cases
7890+ =/ arms=(list arm) arms.e
7891+ =/ st=istate state.p.subject
7892+ =/ answer=(unit itype) ~
7893+ |-
7894+ ?~ arms
7895+ ?^ remaining
7896+ [%| ["missing union case {(show-itype part.i.remaining sub.st)}" ~]]
7897+ ?~ answer [%| ["empty union branch is not supported by partial inference" ~]]
7898+ ?~ expected [%& u.answer st]
7899+ [%& typ.u.expected st]
7900+ =/ a=arm i.arms
7901+ ?: (lien remaining |=(c=ifinite =(%unknown (union-pattern pat.a part.c))))
7902+ [%| ["partial union pattern is not supported by partial inference" ~]]
7903+ =/ matching=(list ifinite) (skim remaining |=(c=ifinite =(%full (union-pattern pat.a part.c))))
7904+ ?~ matching
7905+ ?: (lien cases |=(c=ifinite =(%full (union-pattern pat.a part.c))))
7906+ [%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
7907+ [%| ["union pattern is not supported by partial inference" ~]]
7908+ ?: &((union-pattern-has-bind pat.a) (lien t.matching |=(c=ifinite !=(origin.c origin.i.matching))))
7909+ [%| ["a union pattern binding several cases is not supported by partial inference" ~]]
7910+ =/ bound=(unit ienv) (union-pattern-bind pat.a base.i.matching env globals.st)
7911+ ?~ bound [%| ["pattern binder shadows a name" ~]]
7912+ =/ body=iresult
7913+ ?~ expected (infer-fragment val.a u.bound st)
7914+ (infer-call-context-arg val.a typ.u.expected u.bound st context.u.expected)
7915+ ?: ?=(%| -.body) body
7916+ ?^ expected
7917+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
7918+ ?: ?=(%unknown -.fit) [%| ["union branch result constraint is not supported by partial inference" ~]]
7919+ ?: ?=(%bad -.fit)
7920+ =/ missing=(unit idiag) (missing-union-tag val.a typ.u.expected sub.state.p.body context.u.expected)
7921+ ?^ missing [%| u.missing]
7922+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body typ.u.expected sub.state.p.body next.state.p.body context.u.expected)
7923+ ?^ nested [%| u.nested]
7924+ [%| ["union branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.a) "branch arm"]]]]
7925+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
7926+ [%| ["union branch result needs context in partial inference" ~]]
7927+ $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body(sub sub.fit, next next.fit), answer `typ.u.expected)
7928+ =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
7929+ =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
7930+ ?: mismatch [%| ["union branch result matching needs unsupported inference" ~]]
7931+ $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body, answer `result)
7932+::
7933+:: Prove a one-arm record pattern covers a known, non-union subject.
7934+:: Variable or partial matches stay unsupported; binding uses the same
7935+:: scope and original payload types as the existing union matcher.
7936+++ single-structured-pattern
7937+ |= e=expr
7938+ ^- ?
7939+ ?. ?=(%branch -.e) |
7940+ ?~ arms.e |
7941+ ?^ t.arms.e |
7942+ =/ p=pattern pat.i.arms.e
7943+ ?. ?=(%cell -.p) |
7944+ !(levy items.p |=(x=pattern ?=(%bind -.x)))
7945+::
7946+++ infer-single-case-branch
7947+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
7948+ ^- iresult
7949+ ?> (single-structured-pattern e)
7950+ ?> ?=(%branch -.e)
7951+ ?> ?=(^ arms.e)
7952+ =/ a=arm i.arms.e
7953+ =/ subject=iresult (infer-fragment subject.e env state)
7954+ ?: ?=(%| -.subject) subject
7955+ =/ st=istate state.p.subject
7956+ =/ typ=itype (itype-normalize typ.p.subject sub.st)
7957+ ?: ?=(%union -.typ) [%| ["single-case pattern needs unsupported inference" ~]]
7958+ ?. =(%full (union-pattern pat.a typ))
7959+ [%| ["single-case pattern needs unsupported inference" ~]]
7960+ =/ bound=(unit ienv) (union-pattern-bind pat.a typ env globals.st)
7961+ ?~ bound [%| ["pattern binder shadows a name" ~]]
7962+ ?~ expected (infer-fragment val.a u.bound st)
7963+ =/ body=iresult (infer-call-context-arg val.a typ.u.expected u.bound st context.u.expected)
7964+ ?: ?=(%| -.body) body
7965+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
7966+ ?: ?=(%unknown -.fit) [%| ["single-case branch result constraint is not supported by partial inference" ~]]
7967+ ?: ?=(%bad -.fit)
7968+ =/ missing=(unit idiag) (missing-union-tag val.a typ.u.expected sub.state.p.body context.u.expected)
7969+ ?^ missing [%| u.missing]
7970+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body typ.u.expected sub.state.p.body next.state.p.body context.u.expected)
7971+ ?^ nested [%| u.nested]
7972+ [%| ["single-case branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.a) "branch arm"]]]]
7973+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
7974+ [%| ["single-case branch result needs context in partial inference" ~]]
7975+ [%& typ.u.expected state.p.body(sub sub.fit, next next.fit)]
7976+::
7977+:: This view is used only by pattern analysis, never exported or bound as
7978+:: the subject. Only null plus a two-binder/wildcard cell is supported; its
7979+:: tail keeps the original recursive type. Other patterns fail closed.
7980+++ jrec-match-view
7981+ |= [e=expr subject=iresult]
7982+ ^- iresult
7983+ ?: ?=(%| -.subject) subject
7984+ ?. ?=(%branch -.e) subject
7985+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7986+ ?. ?=(%jrec -.typ) subject
7987+ ?~ arms.e subject
7988+ ?~ t.arms.e subject
7989+ ?^ t.t.arms.e subject
7990+ =/ x=pattern pat.i.arms.e
7991+ =/ y=pattern pat.i.t.arms.e
7992+ =/ empty=? &(?=(%lit -.x) =(%null form.lit.x))
7993+ =/ full=pattern ?:(empty y x)
7994+ ?. |(empty &(?=(%lit -.y) =(%null form.lit.y))) subject
7995+ ?. ?=(%cell -.full) subject
7996+ ?~ items.full subject
7997+ ?~ t.items.full subject
7998+ ?^ t.t.items.full subject
7999+ ?. |(?=(%bind -.i.items.full) ?=(%any -.i.items.full)) subject
8000+ ?. |(?=(%bind -.i.t.items.full) ?=(%any -.i.t.items.full)) subject
8001+ ?: =(0 jrec-fuel.state.p.subject)
8002+ [%| ["recursive mold unfolding needs unsupported inference" ~]]
8003+ =/ nil=itype [%const [%null %n 0 '~']]
8004+ =/ cell=itype [%cell [%face head.typ [%atom aura.typ]] [%face tail.typ typ]]
8005+ [%& [%union ~[nil cell] ~ ~ ~] state.p.subject(jrec-fuel (dec jrec-fuel.state.p.subject))]
8006+::
8007+:: A bounded source-proven tree match permits flat tag patterns and
8008+:: nonbinding catch-alls. Whole-case binders cannot consume the temporary
8009+:: structural view. Pattern count and field arity are checked first.
8010+++ grec-simple-pattern
8011+ |= [pat=pattern view=itype]
8012+ ^- ?
8013+ ?. ?=(%cell -.pat) |
8014+ ?~ items.pat |
8015+ =/ first=pattern i.items.pat
8016+ ?. ?=(%lit -.first) |
8017+ ?. =(%term form.lit.first) |
8018+ =/ chosen=(unit itype) (contextual-tagged-case view val.lit.first ~)
8019+ ?~ chosen |
8020+ ?> ?=(%cell -.u.chosen)
8021+ =/ rest=(list pattern) t.items.pat
8022+ =/ arity=? ?:(?=(%cell -.tal.u.chosen) ?=([* [* ~]] rest) ?=([* ~] rest))
8023+ ?. arity |
8024+ (levy rest |=(p=pattern |(?=(%bind -.p) ?=(%any -.p))))
8025+::
8026+:: A catch-all with no binder is safe even when it covers both cases.
8027+:: A bound whole case still declines to avoid exporting the analysis view.
8028+++ grec-patterns-eligible
8029+ |= [arms=(list arm) view=itype left=@ud]
8030+ ^- ?
8031+ ?~ arms &
8032+ ?: =(0 left) |
8033+ =/ pat=pattern pat.i.arms
8034+ ?. |(?=(%any -.pat) (grec-simple-pattern pat view)) |
8035+ $(arms t.arms, left (dec left))
8036+++ grec-match-view
8037+ |= [e=expr subject=iresult]
8038+ ^- iresult
8039+ ?: ?=(%| -.subject) subject
8040+ ?. ?=(%branch -.e) subject
8041+ ?. (grec-direct-context typ.p.subject sub.state.p.subject) subject
8042+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8043+ ?. ?=(%grec -.typ) subject
8044+ ?~ arms.e subject
8045+ =/ view=(unit [view=itype left=@ud]) (grec-unfold-view typ jrec-fuel.state.p.subject)
8046+ ?~ view [%| ["recursive mold unfolding needs unsupported inference" ~]]
8047+ ?. (grec-patterns-eligible arms.e view.u.view 128) subject
8048+ [%& view.u.view state.p.subject(jrec-fuel left.u.view)]
8049+::
8050+:: A single-arm diagnostic only probes a direct, source-typed in-scope wing;
8051+:: other subjects retain the prior single-pattern inference path.
8052+++ grec-single-wing-subject
8053+ |= [e=expr env=ienv state=istate]
8054+ ^- (unit iresult)
8055+ ?. ?=(%wing -.e) ~
8056+ ?. ?=([@ ~] names.e) ~
8057+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8058+ ?~ scheme ~
8059+ ?. (grec-direct-context typ.u.scheme sub.state) ~
8060+ `(infer-fragment e env state)
8061+::
8062+++ infer-known-union-branch-subject
8063+ |= [e=expr env=ienv subject=iresult]
8064+ ^- iresult
8065+ =. subject (grec-match-view e subject)
8066+ =. subject (jrec-match-view e subject)
8067+ =/ whole=(unit iresult) (infer-known-union-whole e env subject)
8068+ ?~ whole (infer-known-union-finite e env subject ~)
8069+ u.whole
8070+::
8071+++ infer-known-union-branch
8072+ |= [e=expr env=ienv state=istate]
8073+ ^- iresult
8074+ ?> ?=(%branch -.e)
8075+ (infer-known-union-branch-subject e env (infer-fragment subject.e env state))
8076+::
8077+++ infer-known-union-context-subject
8078+ |= [e=expr expected=itype env=ienv subject=iresult context=span]
8079+ ^- iresult
8080+ =. subject (grec-match-view e subject)
8081+ =. subject (jrec-match-view e subject)
8082+ =/ whole=(unit iresult) (infer-known-union-context-whole e expected env subject context)
8083+ ?~ whole (infer-known-union-finite e env subject `[expected context])
8084+ u.whole
8085+::
8086+:: Limit speculative subject inference to wings and shallow calls;
8087+:: grouping is peeled linearly and cannot introduce a nested branch.
8088+++ simple-union-subject-arg
8089+ |= e=expr
8090+ ^- ?
8091+ ?- -.e
8092+ %wing &
8093+ %lit &
8094+ %str !(lien pieces.e |=(p=piece ?=(%expr -.p)))
8095+ * |
8096+ ==
8097+::
8098+++ safe-union-subject
8099+ |= e=expr
8100+ ^- ?
8101+ ?: ?=(%group -.e) $(e inner.e)
8102+ ?: ?=(%wing -.e) &
8103+ ?. ?=(%call -.e) |
8104+ ?. ?=(%wing -.head.e) |
8105+ (levy args.e simple-union-subject-arg)
8106+::
8107+++ duplicate-loobean-arms
8108+ |= e=expr
8109+ ^- ?
8110+ ?. ?=(%branch -.e) |
8111+ ?~ arms.e |
8112+ ?~ t.arms.e |
8113+ ?^ t.t.arms.e |
8114+ =/ x=pattern pat.i.arms.e
8115+ =/ y=pattern pat.i.t.arms.e
8116+ ?. &(?=(%lit -.x) ?=(%lit -.y)) |
8117+ ?. &(=(%loobean form.lit.x) =(%loobean form.lit.y)) |
8118+ =(val.lit.x val.lit.y)
8119+::
8120+++ union-subject-call
8121+ |= e=expr
8122+ ^- ?
8123+ ?: ?=(%group -.e) $(e inner.e)
8124+ ?=(%call -.e)
8125+::
8126+++ known-union-subject
8127+ |= [e=expr env=ienv state=istate]
8128+ ^- (unit iresult)
8129+ ?. (safe-union-subject e) ~
8130+ =/ subject=iresult (infer-fragment e env state)
8131+ ?: ?=(%| -.subject) ?:((union-subject-call e) `subject ~)
8132+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8133+ ?. |(?=(%union -.typ) ?=(%jrec -.typ) &(?=(%grec -.typ) (grec-direct-context typ.p.subject sub.state.p.subject))) ~
8134+ `subject
8135+::
8136+:: A direct wing with an already-known union may skip genuinely empty cases
8137+:: when checking a one-arm match. Other subjects keep their existing path.
8138+:: A directly known canonical list of an empty element contains only null.
8139+:: This helper never refines an opaque or variable-bound subject.
8140+++ empty-list-null-branch
8141+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
8142+ ^- (unit iresult)
8143+ ?. ?=(%branch -.e) ~
8144+ ?~ arms.e ~
8145+ ?^ t.arms.e ~
8146+ ?. (unit-empty-pattern pat.i.arms.e) ~
8147+ ?. ?=(%wing -.subject.e) ~
8148+ ?. ?=([@ ~] names.subject.e) ~
8149+ =/ scheme=(unit ischeme) (ienv-lookup i.names.subject.e env)
8150+ ?~ scheme ~
8151+ ?. ?=(%collection -.typ.u.scheme) ~
8152+ ?. =(%list name.typ.u.scheme) ~
8153+ ?~ prelude.state ~
8154+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb) ~
8155+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
8156+ ?~ standard ~
8157+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
8158+ =/ subject=iresult (infer-fragment subject.e env state)
8159+ ?: ?=(%| -.subject) ~
8160+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8161+ ?. ?=(%collection -.typ) ~
8162+ ?. =(%list name.typ) ~
8163+ ?~ args.typ ~
8164+ ?^ t.args.typ ~
8165+ =/ proof=(unit [empty=? left=@ud]) (itype-empty-proof i.args.typ sub.state.p.subject 256)
8166+ ?~ proof ~
8167+ ?. empty.u.proof ~
8168+ ?~ expected `(infer-fragment val.i.arms.e env state.p.subject)
8169+ =/ body=iresult (infer-call-context-arg val.i.arms.e typ.u.expected env state.p.subject context.u.expected)
8170+ ?: ?=(%| -.body) `body
8171+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
8172+ ?: ?=(%unknown -.fit) `[%| ["single-case branch result constraint is not supported by partial inference" ~]]
8173+ ?: ?=(%bad -.fit) `[%| ["single-case branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.i.arms.e) "branch arm"]]]]
8174+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
8175+ `[%| ["single-case branch result needs context in partial inference" ~]]
8176+ `[%& typ.p.body state.p.body(sub sub.fit, next next.fit)]
8177+::
8178+++ known-empty-union-wing
8179+ |= [e=expr env=ienv state=istate]
8180+ ^- (unit iresult)
8181+ ?. ?=(%wing -.e) ~
8182+ ?. ?=([@ ~] names.e) ~
8183+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8184+ ?~ scheme ~
8185+ ?. (contextual-direct-union typ.u.scheme) ~
8186+ =/ subject=iresult (infer-fragment e env state)
8187+ ?: ?=(%| -.subject) ~
8188+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8189+ ?. ?=(%union -.typ) ~
8190+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
8191+ ?~ live ~
8192+ ?: =(u.live cases.typ) ~
8193+ `subject
8194+::
8195+:: Infer changes only against a fully known record spine. Retain the
8196+:: target type; unknown spines and repeated edits remain unsupported.
8197+++ change-spine-known
8198+ |= [t=itype sub=isub]
8199+ ^- ?
8200+ =. t (itype-walk t sub)
8201+ ?: ?=(%face -.t) &
8202+ ?. ?=(%cell -.t) |
8203+ =/ first=itype (itype-walk hed.t sub)
8204+ ?. ?=(%face -.first) |
8205+ $(t tal.t)
8206+::
8207+++ infer-change-edits
8208+ |= [edits=(list edit) target=itype env=ienv state=istate seen=(list term)]
8209+ ^- iresult
8210+ ?~ edits [%& target state]
8211+ =/ entry=edit i.edits
8212+ ?: (lien seen |=(name=term =(name name.entry)))
8213+ [%| ["repeated change fields are not supported by partial inference" ~]]
8214+ ?. (change-spine-known target sub.state)
8215+ [%| ["change target needs a known record in partial inference" ~]]
8216+ =/ found=(list itype) (record-fields-named name.entry target sub.state)
8217+ ?~ found
8218+ [%| ["record has no field `{(trip name.entry)}`" ~[[at.entry "unknown field"]]]]
8219+ ?^ t.found [%| ["change field is ambiguous in partial inference" ~]]
8220+ =/ expected=itype i.found
8221+ =/ value=iresult (infer-call-context-arg val.entry expected env state at.entry)
8222+ ?: ?=(%| -.value) value
8223+ =/ fit=ifit (itype-fit typ.p.value expected sub.state.p.value next.state.p.value)
8224+ ?: ?=(%unknown -.fit) [%| ["change field constraint is not supported by partial inference" ~]]
8225+ ?: ?=(%bad -.fit)
8226+ [%| ["change field and replacement do not unify" ~[[at.entry (site-type-note "expected replacement" expected sub.state.p.value)] [(span-of val.entry) (site-type-note "replacement" typ.p.value sub.state.p.value)]]]]
8227+ $(edits t.edits, state state.p.value(sub sub.fit, next next.fit), seen [name.entry seen])
8228+::
8229+:: Backtick constructs the canonical prelude unit, after checking its
8230+:: prepared template has the standard null and [~ u=A] cases.
8231+++ standard-unit-template
8232+ |= [template=ischeme at=path]
8233+ ^- ?
8234+ ?. =(at /lib/jibb/prelude/jibb) |
8235+ ?~ vars.template |
8236+ ?^ t.vars.template |
8237+ =/ v=@ud i.vars.template
8238+ =/ nil=itype [%const [%null %n 0 '~']]
8239+ =/ expected=itype
8240+ [%union ~[nil [%cell nil [%face %u [%var v]]]] `[at %unit] `%unit ~[[%var v]]]
8241+ =(typ.template expected)
8242+::
8243+:: A named missing-case diagnostic needs more than a failed fit: a case
8244+:: with that tag but the wrong payload is not a missing case. Unknown
8245+:: shapes and atom types that accept terms keep the proof conservative.
8246++$ itag-presence ?(%yes %no %maybe)
8247+++ tag-presence-cases
8248+ |= [cases=(list itype) value=@ sub=isub]
8249+ ^- itag-presence
8250+ ?~ cases %no
8251+ =/ first=itag-presence (tag-presence i.cases value sub)
8252+ ?: =(%yes first) %yes
8253+ =/ rest=itag-presence $(cases t.cases)
8254+ ?: =(%yes rest) %yes
8255+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
8256+ %no
8257+::
8258+++ tag-presence
8259+ |= [t=itype value=@ sub=isub]
8260+ ^- itag-presence
8261+ =. t (itype-walk t sub)
8262+ ?- -.t
8263+ %const ?:(=(value val.literal.t) %yes %no)
8264+ %flag ?:(|(=(value 0) =(value 1)) %yes %no)
8265+ %atom ?:(|(=(%tas aura.t) =(%ta aura.t)) %maybe %no)
8266+ %face $(t body.t)
8267+ %cell
8268+ =/ first=itag-presence $(t hed.t)
8269+ ?: =(%yes first) %yes
8270+ =/ rest=itag-presence $(t tal.t)
8271+ ?: =(%yes rest) %yes
8272+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
8273+ %no
8274+ %union (tag-presence-cases cases.t value sub)
8275+ * %maybe
8276+ ==
8277+::
8278+++ missing-union-tag
8279+ |= [e=expr expected=itype sub=isub context=span]
8280+ ^- (unit idiag)
8281+ ?. ?=(%lit -.e) ~
8282+ ?. =(%term form.lit.e) ~
8283+ =. expected (itype-walk expected sub)
8284+ |-
8285+ ?: ?=(%face -.expected) $(expected (itype-walk body.expected sub))
8286+ ?. ?=(%union -.expected) ~
8287+ ?. =(%no (tag-presence-cases cases.expected val.lit.e sub)) ~
8288+ =/ label=tape
8289+ ?~ label.expected "union {(show-itype expected sub)}"
8290+ (show-itype expected sub)
8291+ `["{label} has no case `{(trip txt.lit.e)}`" ~[[context "expected union"] [(span-of e) "tag"]]]
8292+::
8293+:: Locate a missing tag inside a syntactic tuple only by replaying the
8294+:: directional fit in source order. Uncertain or earlier failures stop
8295+:: the walk, preserving the generic diagnostic rather than guessing.
8296+++ nested-missing-tag
8297+ |= [e=expr actual=itype expected=itype sub=isub next=@ud context=span]
8298+ ^- (unit idiag)
8299+ =/ original=[left=itype right=itype] [actual expected]
8300+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%rvar -.left.original) |(?=(%nvar -.left.original) ?=(%rnvar -.left.original)) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%rvar -.right.original) |(?=(%nvar -.right.original) ?=(%rnvar -.right.original))) ~
8301+ =/ fit=ifit (itype-fit actual expected sub next)
8302+ ?. ?=(%bad -.fit) ~
8303+ =. actual (itype-walk actual sub)
8304+ =. expected (itype-walk expected sub)
8305+ ?: &(?=(%face -.actual) ?=(%face -.expected))
8306+ ?. =(name.actual name.expected) ~
8307+ $(actual body.actual, expected body.expected)
8308+ ?: ?=(%face -.actual) $(actual body.actual)
8309+ ?: ?=(%face -.expected) $(expected body.expected)
8310+ =/ direct=(unit idiag) (missing-union-tag e expected sub context)
8311+ ?^ direct direct
8312+ ?. ?=(%tuple -.e) ~
8313+ (nested-missing-items items.e actual expected sub next context)
8314+::
8315+++ nested-missing-items
8316+ |= [items=(list item) actual=itype expected=itype sub=isub next=@ud context=span]
8317+ ^- (unit idiag)
8318+ ?~ items ~
8319+ ?~ t.items (nested-missing-tag val.i.items actual expected sub next context)
8320+ =/ original=[left=itype right=itype] [actual expected]
8321+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%rvar -.left.original) |(?=(%nvar -.left.original) ?=(%rnvar -.left.original)) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%rvar -.right.original) |(?=(%nvar -.right.original) ?=(%rnvar -.right.original))) ~
8322+ =. actual (itype-walk actual sub)
8323+ =. expected (itype-walk expected sub)
8324+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8325+ =/ first=ifit (itype-fit hed.actual hed.expected sub next)
8326+ ?: ?=(%bad -.first)
8327+ (nested-missing-tag val.i.items hed.actual hed.expected sub next context)
8328+ ?. ?=(%ok -.first) ~
8329+ $(items t.items, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
8330+::
8331+:: A term-headed pair is the same noun as a two-item cell. Preserve the
8332+:: whole pair span for the synthetic head and the value's own span for
8333+:: the payload; unresolved term constraints follow ordinary cell inference.
8334+++ pair-as-cell
8335+ |= e=expr
8336+ ^- expr
8337+ ?> ?=(%pair -.e)
8338+ =/ head=expr [%lit at.e [%term %tas tag.e (crip ['%' (trip tag.e)])]]
8339+ [%tuple at.e ~[[at.e ~ head] [(span-of val.e) ~ val.e]]]
8340+::
8341+:: A segment costs one shared step; dynamic segments are not handled yet.
8342+++ qath-static-fuel
8343+ |= [segs=(list qseg) fuel=@ud]
8344+ ^- (unit @ud)
8345+ ?~ segs `fuel
8346+ ?: =(0 fuel) ~
8347+ ?. ?=(%knot -.i.segs) ~
8348+ $(segs t.segs, fuel (dec fuel))
8349+::
8350+++ infer-fragment
8351+ |= [e=expr env=ienv state=istate]
8352+ ^- iresult
8353+ ?- -.e
8354+ %pair $(e (pair-as-cell e))
8355+ %lit
8356+ ?- form.lit.e
8357+ %number ?: =(%ud aura.lit.e)
8358+ [%& [%nvar next.state] state(next +(next.state))]
8359+ [%& [%atom aura.lit.e] state]
8360+ %ship [%& [%atom %p] state]
8361+ %date [%& [%atom %da] state]
8362+ %duration [%& [%atom %dr] state]
8363+ %knot [%& [%atom %ta] state]
8364+ %loobean [%& [%flag ~] state]
8365+ %term [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
8366+ %null [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
8367+ ==
8368+ %unit
8369+ ?~ prelude.state [%| ["unit construction needs the standard prelude in partial inference" ~]]
8370+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
8371+ ?~ standard [%| ["unit construction needs the standard prelude in partial inference" ~]]
8372+ ?. (standard-unit-template u.standard at.u.prelude.state)
8373+ [%| ["unit construction needs the standard prelude in partial inference" ~]]
8374+ =/ value=iresult $(e val.e)
8375+ ?: ?=(%| -.value) value
8376+ =/ result=(unit itype) (template-apply u.standard ~[typ.p.value])
8377+ ?~ result [%| ["unit construction is not supported by partial inference" ~]]
8378+ [%& u.result state.p.value]
8379+ %list
8380+ ?~ prelude.state [%| ["list literal needs the standard prelude in partial inference" ~]]
8381+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
8382+ [%| ["list literal needs the standard prelude in partial inference" ~]]
8383+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
8384+ ?~ standard [%| ["list literal needs the standard prelude in partial inference" ~]]
8385+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
8386+ [%| ["list literal needs the standard prelude in partial inference" ~]]
8387+ =/ element=itype [%var next.state]
8388+ =/ result=iresult (infer-open-list-items items.e element env state(next +(next.state)) at.e)
8389+ ?: ?=(%| -.result) result
8390+ [%& [%collection %list ~[element]] state.p.result]
8391+ %str (infer-string-pieces pieces.e env state)
8392+ %qath
8393+ ?~ prelude.state [%| ["application path needs the standard prelude in partial inference" ~]]
8394+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
8395+ [%| ["application path needs the standard prelude in partial inference" ~]]
8396+ =/ standard=(unit ischeme) (find-jibb-mold %qath u.prelude.state)
8397+ ?~ standard [%| ["application path needs the standard prelude in partial inference" ~]]
8398+ ?. ?=(~ vars.u.standard) [%| ["application path mold needs unsupported inference" ~]]
8399+ =/ typ=itype typ.u.standard
8400+ ?. ?=(%jrec -.typ) [%| ["application path mold needs unsupported inference" ~]]
8401+ ?. &(=(at.typ /lib/jibb/internal/jibb) =(%qath name.typ) =(%i head.typ) =(%ta aura.typ) =(%t tail.typ))
8402+ [%| ["application path mold needs unsupported inference" ~]]
8403+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
8404+ =/ remain=(unit @ud) (qath-static-fuel segs.e (dec jrec-fuel.state))
8405+ ?~ remain [%| ["application path segments need unsupported inference" ~]]
8406+ [%& typ state(jrec-fuel u.remain)]
8407+ %wing
8408+ ?~ names.e [%| ["empty wing" ~]]
8409+ ?^ t.names.e
8410+ ?^ t.t.names.e (infer-field-wing names.e env state)
8411+ =/ iface=(unit ifile) (find-jibb-interface i.t.names.e jimports.state)
8412+ ?~ iface (infer-field-wing names.e env state)
8413+ =/ member=(unit ischeme) (ienv-lookup i.names.e values.u.iface)
8414+ ?~ member [%| ["module member is not available to partial inference" ~]]
8415+ =. typ.u.member (itype-in-import typ.u.member u.iface i.t.names.e prelude.state)
8416+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.member state)
8417+ [%& typ.instance state.instance]
8418+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8419+ ?~ scheme
8420+ ?~ prelude.state [%| ["name is not available to partial inference" ~]]
8421+ =/ prelude-entry=(unit ischeme) (ienv-lookup i.names.e values.u.prelude.state)
8422+ ?~ prelude-entry [%| ["name is not available to partial inference" ~]]
8423+ =/ inst=[typ=itype state=istate] (instantiate-scheme u.prelude-entry state)
8424+ [%& typ.inst state.inst]
8425+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
8426+ [%& typ.instance state.instance]
8427+ %group $(e inner.e)
8428+ %change
8429+ ?~ edits.e [%| ["a change takes at least one field" ~[[at.e "empty change"]]]]
8430+ =/ target=iresult $(e [%wing at.e target.e])
8431+ ?: ?=(%| -.target) target
8432+ (infer-change-edits edits.e typ.p.target env state.p.target ~)
8433+ %ctor [%& [%tag next.state tag.e &] state(next +(next.state), tags [[next.state tag.e] tags.state])]
8434+ %trace
8435+ =/ traced=iresult $(e val.e)
8436+ ?: ?=(%| -.traced) traced
8437+ $(e then.e, state state.p.traced)
8438+ %tuple
8439+ ?: &(?=(^ defer.state) ?=(^ prelude.state))
8440+ (dg-infer-tuple-items items.e env state)
8441+ (infer-simple-items items.e env state)
8442+ %body
8443+ ?~ defs.e $(e final.e)
8444+ =/ local-names=(list term) (global-value-names defs.e)
8445+ ?. (local-names-valid defs.e env state)
8446+ [%| ["local definitions shadow a name" ~]]
8447+ =/ local-molds=imolds (collect-simple-molds defs.e)
8448+ ?. (local-mold-names-valid local-molds state)
8449+ [%| ["local molds shadow a name" ~]]
8450+ =/ local-state=istate
8451+ state(globals (weld local-names globals.state), molds (weld local-molds molds.state))
8452+ =/ mold-hole=(unit span) (simple-local-mold-hole defs.e)
8453+ ?^ mold-hole
8454+ [%| ["type hole needs a determined type" ~[[u.mold-hole "unresolved type hole"]]]]
8455+ ?. (local-molds-supported local-molds local-state)
8456+ [%| ["local molds need unsupported inference" ~]]
8457+ =/ values=(list def) (local-value-defs defs.e)
8458+ =/ locals=ilocal-result (infer-local-defs values env local-state)
8459+ ?: ?=(%| -.locals) locals
8460+ =/ result=iresult $(e final.e, env env.p.locals, state state.p.locals)
8461+ ?: ?=(%| -.result) result
8462+ [%& typ.p.result state.p.result(globals globals.state, molds molds.state)]
8463+ %branch
8464+ ?^ defer.state (dg-boolean-branch e env state)
8465+ ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
8466+ ?~ t.arms.e
8467+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state ~)
8468+ ?^ empty-list u.empty-list
8469+ =/ empty-union=(unit iresult) (known-empty-union-wing subject.e env state)
8470+ ?^ empty-union (infer-known-union-branch-subject e env u.empty-union)
8471+ =/ single=(unit iresult) (grec-single-wing-subject subject.e env state)
8472+ ?^ single (infer-known-union-branch-subject e env u.single)
8473+ ?: (single-structured-pattern e) (infer-single-case-branch e env state ~)
8474+ (infer-cell-branch e env state ~)
8475+ ?^ t.t.arms.e (infer-known-union-branch e env state)
8476+ =/ known=(unit iresult) (known-union-subject subject.e env state)
8477+ ?: &(?=(^ known) ?=(%| -.u.known) !(duplicate-loobean-arms e)) u.known
8478+ ?: &(?=(^ known) ?=(%& -.u.known) ?=(~ (unit-union-payload (itype-normalize typ.p.u.known sub.state.p.u.known))))
8479+ (infer-known-union-branch-subject e env u.known)
8480+ =/ x=arm i.arms.e
8481+ =/ y=arm i.t.arms.e
8482+ ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
8483+ (infer-unit-branch e env state ~)
8484+ ?. ?=(%lit -.pat.x) (infer-known-union-branch e env state)
8485+ ?. ?=(%lit -.pat.y) (infer-known-union-branch e env state)
8486+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
8487+ (infer-known-union-branch e env state)
8488+ ?: &(?=(^ known) ?=(%& -.u.known)) (infer-known-union-branch-subject e env u.known)
8489+ ?: =(val.lit.pat.x val.lit.pat.y)
8490+ [%| ["branch does not cover both loobeans" ~]]
8491+ =/ subject=iresult $(e subject.e)
8492+ ?: ?=(%| -.subject) subject
8493+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
8494+ ?: ?=(%union -.subject-type)
8495+ [%| ["union-pattern branch subject is not supported by partial inference" ~]]
8496+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
8497+ ?~ su [%| ["loobean branch subject does not unify with ?" ~]]
8498+ =/ left=iresult $(e val.x, state state.p.subject(sub u.su))
8499+ ?: ?=(%| -.left) left
8500+ =/ right=iresult $(e val.y, state state.p.left)
8501+ ?: ?=(%| -.right) right
8502+ =/ ltype=itype (itype-normalize typ.p.left sub.state.p.right)
8503+ =/ rtype=itype (itype-normalize typ.p.right sub.state.p.right)
8504+ ?: &(!=(ltype rtype) |(?=(^ (itype-vars ltype)) ?=(^ (itype-vars rtype))) |((itype-has-fixed-atom ltype) (itype-has-fixed-atom rtype)))
8505+ [%| ["branch widening is not supported by partial inference" ~]]
8506+ =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
8507+ ?~ joined
8508+ ?: |((itype-has-recursive ltype) (itype-has-recursive rtype))
8509+ [%| ["recursive branch matching is not supported by partial inference" ~]]
8510+ ?: |((itype-has-tag ltype) (itype-has-tag rtype) (itype-has-union ltype) (itype-has-union rtype))
8511+ [%| ["branch tag or union context is not supported by partial inference" ~]]
8512+ =/ common=(unit itype) (itype-concrete-join typ.p.left typ.p.right sub.state.p.right)
8513+ ?^ common [%& u.common state.p.right]
8514+ ?: |((itype-has-face typ.p.left sub.state.p.right) (itype-has-face typ.p.right sub.state.p.right))
8515+ [%| ["record branch matching is not supported by partial inference" ~]]
8516+ ?: |((itype-has-any-atom typ.p.left sub.state.p.right) (itype-has-any-atom typ.p.right sub.state.p.right) (itype-family-related typ.p.left typ.p.right sub.state.p.right))
8517+ [%| ["branch widening is not supported by partial inference" ~]]
8518+ [%| ["branch arms have incompatible types" ~[[(span-of val.x) (site-type-note "first arm" typ.p.left sub.state.p.right)] [(span-of val.y) (site-type-note "second arm" typ.p.right sub.state.p.right)]]]]
8519+ [%& typ.p.left state.p.right(sub u.joined)]
8520+ %cast
8521+ =/ target=(unit [typ=itype state=istate]) (infer-simple-shape shape.e state)
8522+ ?~ target
8523+ =/ diag=(unit idiag) (nested-import-invalid shape.e state)
8524+ ?^ diag [%| u.diag]
8525+ [%| ["cast mold is not supported by partial inference" ~]]
8526+ =/ value=iresult
8527+ (infer-call-context-arg val.e typ.u.target env state.u.target at.shape.e)
8528+ ?: ?=(%| -.value) value
8529+ =/ shape=(unit [source=iwfields target=iwfields])
8530+ (width-shape typ.p.value typ.u.target sub.state.p.value)
8531+ ?^ shape [%| ["record width constraint needs unsupported inference" ~]]
8532+ =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value next.state.p.value)
8533+ ?: ?=(%unknown -.fit) [%| ["cast constraint is not supported by partial inference" ~]]
8534+ ?: ?=(%bad -.fit)
8535+ =/ missing=(unit idiag) (missing-union-tag val.e typ.u.target sub.state.p.value at.shape.e)
8536+ ?^ missing [%| u.missing]
8537+ =/ nested=(unit idiag) (nested-missing-tag val.e typ.p.value typ.u.target sub.state.p.value next.state.p.value at.shape.e)
8538+ ?^ nested [%| u.nested]
8539+ [%| ["cast mold and expression type do not unify" ~[[at.shape.e (site-type-note "cast mold" typ.u.target sub.state.p.value)] [(span-of val.e) (site-type-note "expression" typ.p.value sub.state.p.value)]]]]
8540+ ?: &(?=(^ defer.state.p.value) !(dg-stable-fit typ.p.value typ.u.target sub.fit))
8541+ [%| ["deferred cast fit needs stable inference" ~]]
8542+ =/ merged=itype (itype-merge-faces typ.p.value typ.u.target sub.fit)
8543+ [%& merged state.p.value(sub sub.fit, next next.fit)]
8544+ %crash [%& [%var next.state] state(next +(next.state))]
8545+ %gate
8546+ =/ sam=isample-result (infer-sample sample.e env state)
8547+ ?: ?=(%| -.sam)
8548+ =/ diag=(unit idiag) (sample-import-invalid sample.e env state)
8549+ ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
8550+ [%| [p.sam ~]]
8551+ =/ body=iresult $(e body.e, env env.p.sam, state state.p.sam)
8552+ ?: ?=(%| -.body) body
8553+ [%& [%fn typ.p.sam typ.p.body] state.p.body]
8554+ %gate-wide
8555+ =/ sam=isample-result (infer-sample sample.e env state)
8556+ ?: ?=(%| -.sam)
8557+ =/ diag=(unit idiag) (sample-import-invalid sample.e env state)
8558+ ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
8559+ [%| [p.sam ~]]
8560+ =/ body=iresult $(e body.e, env env.p.sam, state state.p.sam)
8561+ ?: ?=(%| -.body) body
8562+ [%& [%fn typ.p.sam typ.p.body] state.p.body]
8563+ %call
8564+ ?~ args.e [%| ["call has no argument" ~]]
8565+ ?: (explicit-proj-call e env state)
8566+ [%| ["proj needs an expected record type" ~]]
8567+ (infer-call-with-head e env state (infer-fragment head.e env state))
8568+ * [%| ["expression is not supported by partial inference" ~]]
8569+ ==
8570+::
8571+:: Locate a definite failing argument after the complete sample fit has
8572+:: failed. If an intermediate fit is uncertain, retain the whole argument
8573+:: span rather than assigning blame to a particular argument.
8574+::
8575+:: Check a call using the head already inferred in this state. Keeping
8576+:: this shared avoids evaluating or instantiating a contextual head twice.
8577+++ width-has-projections
8578+ |= ps=(list iwprojection)
8579+ ^- ?
8580+ ?~ ps |
8581+ &
8582+::
8583++$ iwidth-elaboration [original=expr typ=itype sub=isub projections=(list iwprojection)]
8584+++ infer-width-elaboration
8585+ |= [e=expr env=ienv state=istate]
8586+ ^- (each iwidth-elaboration idiag)
8587+ =/ out=iresult (infer-fragment e env state)
8588+ ?: ?=(%| -.out) [%| p.out]
8589+ [%& [e typ.p.out sub.state.p.out (flop projections.state.p.out)]]
8590+::
8591+:: Source-bound gate-layout evidence, confined to checked root gate
8592+:: definitions and direct unshadowed prelude calls. The prepared prelude
8593+:: interface and its retained source are trusted as a matching artifact.
8594+:: Layouts identify sample binder faces; they do not change call arity or
8595+:: authorize stripping nested value faces. Unknown origins use ordinary fit.
8596+++ direct-written-gates
8597+ |= [ds=(list def) out=ivisited]
8598+ ^- ivisited
8599+ ?~ ds out
8600+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8601+ ?. |(?=(%gate -.val.i.ds) ?=(%gate-wide -.val.i.ds)) $(ds t.ds)
8602+ $(ds t.ds, out (~(put by out) name.i.ds &))
8603+++ direct-may-use-prelude
8604+ |= [ds=(list def) root=ivisited heads=ivisited]
8605+ ^- ?
8606+ ?~ ds |
8607+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8608+ =/ refs=(list term) (dependency-expr val.i.ds)
8609+ =/ has-root=? (lien refs |=(n=term ?=(^ (~(get by root) n))))
8610+ =/ has-head=? (lien refs |=(n=term ?=(^ (~(get by heads) n))))
8611+ ?: &(has-root has-head) &
8612+ $(ds t.ds)
8613+++ direct-unique-names
8614+ |= [names=(list term) seen=ivisited]
8615+ ^- ?
8616+ ?~ names &
8617+ ?: ?=(^ (~(get by seen) i.names)) |
8618+ $(names t.names, seen (~(put by seen) i.names &))
8619+++ direct-prelude-evidence
8620+ |= [ds=(list def) prelude=(unit ifile)]
8621+ ^- (unit igate-prelude-evidence)
8622+ ?~ prelude ~
8623+ ?~ source.u.prelude ~
8624+ =/ root=ivisited (direct-written-gates ds ~)
8625+ =/ names=(list term) (turn values.u.prelude |=(e=[name=term scheme=ischeme] name.e))
8626+ =/ heads=ivisited (graph-nameset names ~)
8627+ ?. (direct-may-use-prelude ds root heads) ~
8628+ =/ parsed (parse at.u.prelude u.source.u.prelude)
8629+ ?: ?=(%| -.parsed) ~
8630+ ?^ (duplicate-defs defs.p.parsed) ~
8631+ ?. (direct-unique-names (global-value-names defs.p.parsed) ~) ~
8632+ =/ gates=(map term def) (direct-checked-gates defs.p.parsed values.u.prelude)
8633+ `[u.prelude gates]
8634+++ direct-checked-gates
8635+ |= [ds=(list def) env=ienv]
8636+ ^- (map term def)
8637+ =/ names=(list term) (turn env |=(e=[name=term scheme=ischeme] name.e))
8638+ =/ known=ivisited (graph-nameset names ~)
8639+ =/ out=(map term def) ~
8640+ |-
8641+ ?~ ds out
8642+ =/ d=def i.ds
8643+ ?: ?=(%mold -.d) $(ds t.ds)
8644+ ?. ?=(^ (~(get by known) name.d)) $(ds t.ds)
8645+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) $(ds t.ds)
8646+ $(ds t.ds, out (~(put by out) name.d d))
8647+++ direct-find-gate
8648+ |= [n=term ds=(list def)]
8649+ ^- (unit def)
8650+ ?~ ds ~
8651+ ?: &(?=(%value -.i.ds) =(n name.i.ds)) `i.ds
8652+ $(ds t.ds)
8653+++ direct-gate-sample
8654+ |= d=def
8655+ ^- (unit sample)
8656+ ?. ?=(%value -.d) ~
8657+ ?- -.val.d
8658+ %gate `sample.val.d
8659+ %gate-wide `sample.val.d
8660+ * ~
8661+ ==
8662+++ direct-sample-name
8663+ |= sam=sample
8664+ ^- (unit term)
8665+ ?- -.sam
8666+ %bind `name.sam
8667+ %face `name.sam
8668+ %pun `name.sam
8669+ * ~
8670+ ==
8671+++ direct-field-name
8672+ |= f=field
8673+ ^- (unit term)
8674+ ?- -.f
8675+ %face `name.f
8676+ %pun `name.f
8677+ * ~
8678+ ==
8679+++ direct-slot-body
8680+ |= [typ=itype name=(unit term)]
8681+ ^- (unit itype)
8682+ ?~ name `typ
8683+ ?. ?=(%face -.typ) ~
8684+ ?. =(name.typ u.name) ~
8685+ `body.typ
8686+++ direct-invariant
8687+ |= [a=itype b=itype sub=isub next=@ud]
8688+ ^- ifit
8689+ ?: (itype-face-asym a b sub) [%unknown ~]
8690+ =/ forward=ifit (itype-fit a b sub next)
8691+ ?. ?=(%ok -.forward) [%unknown ~]
8692+ ?: (itype-face-asym a b sub.forward) [%unknown ~]
8693+ =/ reverse=ifit (itype-fit b a sub.forward next.forward)
8694+ ?. ?=(%ok -.reverse) [%unknown ~]
8695+ reverse
8696+++ direct-function-fit
8697+ |= [a=itype b=itype sam=sample sh=shape sub=isub next=@ud]
8698+ ^- ifit
8699+ ?. &(?=(%fn -.a) ?=(%fn -.b) ?=(%cell -.sam) ?=(%fn -.sh)) [%unknown ~]
8700+ ?. ?=(%cell -.sample.sh) [%unknown ~]
8701+ =/ as=(list sample) items.sam
8702+ =/ bs=(list field) fields.sample.sh
8703+ ?~ as [%unknown ~]
8704+ ?~ t.as [%unknown ~]
8705+ ?^ t.t.as [%unknown ~]
8706+ ?~ bs [%unknown ~]
8707+ ?~ t.bs [%unknown ~]
8708+ ?^ t.t.bs [%unknown ~]
8709+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) [%unknown ~]
8710+ =/ an=(unit term) (direct-sample-name i.as)
8711+ =/ bn=(unit term) (direct-field-name i.bs)
8712+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8713+ =/ x=(unit itype) (direct-slot-body hed.sample.a an)
8714+ =/ y=(unit itype) (direct-slot-body hed.sample.b bn)
8715+ ?~ x [%unknown ~]
8716+ ?~ y [%unknown ~]
8717+ =/ first=ifit (direct-invariant u.x u.y sub next)
8718+ ?. ?=(%ok -.first) [%unknown ~]
8719+ =. an (direct-sample-name i.t.as)
8720+ =. bn (direct-field-name i.t.bs)
8721+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8722+ =/ x2=(unit itype) (direct-slot-body tal.sample.a an)
8723+ =/ y2=(unit itype) (direct-slot-body tal.sample.b bn)
8724+ ?~ x2 [%unknown ~]
8725+ ?~ y2 [%unknown ~]
8726+ =/ second=ifit (direct-invariant u.x2 u.y2 sub.first next.first)
8727+ ?. ?=(%ok -.second) [%unknown ~]
8728+ (direct-invariant product.a product.b sub.second next.second)
8729+:: This is a tentative proof: its caller must require closed call samples
8730+:: and repeat every positional check under the stable final substitution.
8731+++ direct-positional-fit
8732+ |= [args=(list expr) slots=(list sample) actual=itype expected=itype env=ienv state=istate sub=isub next=@ud]
8733+ ^- ifit
8734+ ?~ args [%unknown ~]
8735+ ?~ slots [%unknown ~]
8736+ =/ last=? ?=(~ t.args)
8737+ ?: !=(last ?=(~ t.slots)) [%unknown ~]
8738+ =/ split=(unit [left=itype right=itype])
8739+ ?: last `[actual expected]
8740+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8741+ `[hed.actual hed.expected]
8742+ ?~ split [%unknown ~]
8743+ =/ x=itype left.u.split
8744+ =/ y=itype right.u.split
8745+ =/ expected-name=(unit term) (direct-sample-name i.slots)
8746+ =/ expected-body=(unit itype) (direct-slot-body y expected-name)
8747+ ?~ expected-body [%unknown ~]
8748+ =. y u.expected-body
8749+ =/ fit=ifit (itype-fit x y sub next)
8750+ =/ accepted=? &(?=(%ok -.fit) !(itype-positional-slot-face-asym x y sub.fit))
8751+ =/ result=(unit ifit)
8752+ ?: accepted `fit
8753+ ?. &(?=(%face -.i.slots) ?=(%fn -.shape.i.slots)) ~
8754+ ?. ?=(%wing -.i.args) ~
8755+ ?. ?=([@ ~] names.i.args) ~
8756+ ?. (unique-value-name i.names.i.args globals.state) ~
8757+ =/ source=(unit def) (~(get by gate-defs.state) i.names.i.args)
8758+ ?~ source ~
8759+ =/ sample=(unit sample) (direct-gate-sample u.source)
8760+ ?~ sample ~
8761+ =/ trial=ifit (direct-function-fit x y u.sample shape.i.slots sub next)
8762+ ?. ?=(%ok -.trial) ~
8763+ `trial
8764+ ?~ result [%unknown ~]
8765+ =. fit u.result
8766+ ?: last fit
8767+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) [%unknown ~]
8768+ ?. ?=(%ok -.fit) [%unknown ~]
8769+ $(args t.args, slots t.slots, actual tal.actual, expected tal.expected, sub sub.fit, next next.fit)
8770+++ direct-any-gate-arg
8771+ |= [args=(list expr) defs=(map term def)]
8772+ ^- ?
8773+ ?~ args |
8774+ =/ found=?
8775+ ?. ?=(%wing -.i.args) |
8776+ ?. ?=([@ ~] names.i.args) |
8777+ ?=(^ (~(get by defs) i.names.i.args))
8778+ ?: found &
8779+ $(args t.args)
8780+++ direct-gate-call-fit
8781+ |= [e=expr actual=itype expected=itype env=ienv state=istate]
8782+ ^- (unit ifit)
8783+ ?. ?=(%call -.e) ~
8784+ ?~ args.e ~
8785+ ?~ t.args.e ~
8786+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8787+ ?. ?=(%wing -.head.e) ~
8788+ ?. ?=([@ ~] names.head.e) ~
8789+ ?. ?=(~ (ienv-lookup i.names.head.e env)) ~
8790+ ?. (unique-value-name i.names.head.e globals.state) ~
8791+ ?. (direct-any-gate-arg args.e gate-defs.state) ~
8792+ ?~ prelude.state ~
8793+ ?~ source.u.prelude.state ~
8794+ ?~ head-evidence.state ~
8795+ ?. =(u.prelude.state iface.u.head-evidence.state) ~
8796+ ?. ?=(^ (ienv-lookup i.names.head.e values.u.prelude.state)) ~
8797+ =/ head=(unit def) (~(get by gates.u.head-evidence.state) i.names.head.e)
8798+ ?~ head ~
8799+ =/ sam=(unit sample) (direct-gate-sample u.head)
8800+ ?~ sam ~
8801+ ?. ?=(%cell -.u.sam) ~
8802+ =/ fit=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.state next.state)
8803+ ?. ?=(%ok -.fit) ~
8804+ :: Enclosing inference may add constraints after this call. Only a
8805+ :: closed call-sample proof can remain stable under those later bindings.
8806+ =/ actual-final=itype (itype-normalize actual sub.fit)
8807+ =/ expected-final=itype (itype-normalize expected sub.fit)
8808+ ?^ (itype-vars actual-final) ~
8809+ ?^ (itype-vars expected-final) ~
8810+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
8811+ :: A later argument may resolve a variable used by an earlier slot.
8812+ :: Recheck every fit and face against the completed substitution; no
8813+ :: additional binding or fresh variable is permitted in the second pass.
8814+ =/ verified=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.fit next.fit)
8815+ ?. ?=(%ok -.verified) ~
8816+ ?. &(=(sub.fit sub.verified) =(next.fit next.verified)) ~
8817+ `fit
8818+::
8819+++ infer-call-with-head
8820+ |= [e=expr env=ienv state=istate head=iresult]
8821+ ^- iresult
8822+ ?> ?=(%call -.e)
8823+ ?~ args.e [%| ["call has no argument" ~]]
8824+ ?: ?=(%| -.head) head
8825+ =/ head-type=itype (itype-walk typ.p.head sub.state.p.head)
8826+ =/ arg=iresult
8827+ ?^ t.args.e
8828+ ?: ?=(%fn -.head-type)
8829+ (infer-call-context-args args.e sample.head-type env state.p.head (span-of head.e))
8830+ (infer-simple-items (turn args.e |=(a=expr [(span-of a) ~ a])) env state.p.head)
8831+ ?: ?=(%fn -.head-type)
8832+ (infer-call-context-arg i.args.e sample.head-type env state.p.head (span-of head.e))
8833+ (infer-fragment i.args.e env state.p.head)
8834+ ?: ?=(%| -.arg) arg
8835+ =/ st=istate state.p.arg
8836+ =/ ht=itype (itype-walk typ.p.head sub.st)
8837+ ?: ?=(%fn -.ht)
8838+ =/ shape=(unit [source=iwfields target=iwfields])
8839+ ?^ t.args.e ~
8840+ (width-shape typ.p.arg sample.ht sub.st)
8841+ ?^ shape [%| ["record width constraint needs unsupported inference" ~]]
8842+ =/ fit=ifit
8843+ ?^ t.args.e (itype-fit-inner typ.p.arg sample.ht sub.st next.st & |)
8844+ (itype-fit typ.p.arg sample.ht sub.st next.st)
8845+ =/ direct=(unit ifit)
8846+ ?: ?=(%ok -.fit) ~
8847+ (direct-gate-call-fit e typ.p.arg sample.ht env st)
8848+ =. fit ?~(direct fit u.direct)
8849+ ?: ?=(%unknown -.fit)
8850+ ?~ defer.st [%| ["call constraint is not supported by partial inference" ~]]
8851+ =/ edge=(unit dgo) (dg-eligible-ctor e typ.p.head typ.p.arg sample.ht st)
8852+ ?~ edge [%| ["call constraint is not supported by partial inference" ~]]
8853+ ?: (gth (lent obligations.st) 63) [%| ["call constraint is not supported by partial inference" ~]]
8854+ [%& product.ht st(obligations [u.edge obligations.st])]
8855+
8856+ ?: ?=(%bad -.fit)
8857+ ?~ t.args.e
8858+ =/ missing=(unit idiag) (missing-union-tag i.args.e sample.ht sub.st (span-of head.e))
8859+ ?^ missing [%| u.missing]
8860+ =/ nested=(unit idiag) (nested-missing-tag i.args.e typ.p.arg sample.ht sub.st next.st (span-of head.e))
8861+ ?^ nested [%| u.nested]
8862+ [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [(span-of i.args.e) (site-type-note "argument" typ.p.arg sub.st)]]]]
8863+ =/ bad=(unit [at=span typ=itype])
8864+ (call-error-site args.e typ.p.arg sample.ht sub.st next.st)
8865+ =/ whole-args=span
8866+ [beg:(span-of i.args.e) end:(span-of (rear args.e))]
8867+ =/ arg-at=span ?~(bad whole-args at.u.bad)
8868+ =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
8869+ [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [arg-at (site-type-note "argument" arg-type sub.st)]]]]
8870+ ?: &(?=(^ defer.st) !(dg-stable-call-fit typ.p.arg sample.ht product.ht sub.fit ?=(^ t.args.e)))
8871+ [%| ["deferred call fit needs stable inference" ~]]
8872+ =/ face-asym=?
8873+ ?^ direct |
8874+ ?^ t.args.e (itype-positional-face-asym args.e typ.p.arg sample.ht sub.fit)
8875+ (itype-face-asym typ.p.arg sample.ht sub.fit)
8876+ ?: &((itype-has-face typ.p.arg sub.fit) face-asym (itype-output-may-be-cell product.ht sub.fit))
8877+ [%| ["call result face propagation is not supported by partial inference" ~]]
8878+ [%& product.ht st(sub sub.fit, next next.fit)]
8879+ =/ result=itype [%var next.st]
8880+ =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
8881+ ?~ uni
8882+ [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [(span-of i.args.e) (site-type-note "argument" typ.p.arg sub.st)]]]]
8883+ [%& result st(next +(next.st), sub u.uni)]
8884+::
8885+++ call-error-site
8886+ |= [args=(list expr) actual=itype expected=itype sub=isub next=@ud]
8887+ ^- (unit [at=span typ=itype])
8888+ ?~ args ~
8889+ =/ original=[left=itype right=itype] [actual expected]
8890+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%rvar -.left.original) |(?=(%nvar -.left.original) ?=(%rnvar -.left.original)) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%rvar -.right.original) |(?=(%nvar -.right.original) ?=(%rnvar -.right.original))) ~
8891+ =. actual (itype-walk actual sub)
8892+ =. expected (itype-walk expected sub)
8893+ ?: &(?=(%face -.expected) !?=(%face -.actual))
8894+ $(expected body.expected)
8895+ ?~ t.args
8896+ =/ fit=ifit (itype-fit actual expected sub next)
8897+ ?. ?=(%bad -.fit) ~
8898+ `[(span-of i.args) (itype-normalize actual sub)]
8899+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8900+ =/ first=ifit (itype-fit hed.actual hed.expected sub next)
8901+ ?: ?=(%bad -.first) `[(span-of i.args) (itype-normalize hed.actual sub)]
8902+ ?: ?=(%unknown -.first) ~
8903+ $(args t.args, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
8904+::
8905+:: Context can help a call argument or cast value while the final fit
8906+:: checks the complete right-nested type, including any written faces.
8907+::
8908+:: Context can resolve the payload of a canonical prelude unit, but an
8909+:: unrelated union with a similar noun shape is not the same mold.
8910+++ infer-unit-context
8911+ |= [e=expr expected=itype env=ienv state=istate context=span]
8912+ ^- iresult
8913+ ?> ?=(%unit -.e)
8914+ ?> ?=(%union -.expected)
8915+ ?~ prelude.state (infer-fragment e env state)
8916+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
8917+ ?~ standard (infer-fragment e env state)
8918+ ?. (standard-unit-template u.standard at.u.prelude.state) (infer-fragment e env state)
8919+ ?. =(origin.expected `[at.u.prelude.state %unit]) (infer-fragment e env state)
8920+ ?~ args.expected (infer-fragment e env state)
8921+ ?^ t.args.expected (infer-fragment e env state)
8922+ =/ payload=itype i.args.expected
8923+ =/ canonical=(unit itype) (template-apply u.standard ~[payload])
8924+ ?~ canonical (infer-fragment e env state)
8925+ ?> ?=(%union -.u.canonical)
8926+ ?. =((itype-normalize expected(label ~) sub.state) (itype-normalize u.canonical(label ~) sub.state))
8927+ (infer-fragment e env state)
8928+ =/ value=iresult (infer-call-context-arg val.e payload env state context)
8929+ ?: ?=(%| -.value) value
8930+ =/ fit=ifit (itype-fit typ.p.value payload sub.state.p.value next.state.p.value)
8931+ ?: ?=(%unknown -.fit) [%| ["unit payload constraint is not supported by partial inference" ~]]
8932+ ?: ?=(%bad -.fit)
8933+ =/ missing=(unit idiag) (missing-union-tag val.e payload sub.state.p.value context)
8934+ ?^ missing [%| u.missing]
8935+ =/ nested=(unit idiag) (nested-missing-tag val.e typ.p.value payload sub.state.p.value next.state.p.value context)
8936+ ?^ nested [%| u.nested]
8937+ [%| ["unit payload does not fit its expected type" ~[[context (site-type-note "expected unit payload" payload sub.state.p.value)] [(span-of val.e) (site-type-note "payload" typ.p.value sub.state.p.value)]]]]
8938+ [%& expected state.p.value(sub sub.fit, next next.fit)]
8939+::
8940+:: A known gate may receive an enclosing target before its argument is
8941+:: inferred when its result is open or a direct, matching named generic
8942+:: union. Opaque, recursive, tag-constrained and variable-bound union
8943+:: results keep the existing directional path.
8944+++ infer-contextual-call
8945+ |= [e=expr expected=itype env=ienv state=istate]
8946+ ^- iresult
8947+ ?> ?=(%call -.e)
8948+ ?~ args.e [%| ["call has no argument" ~]]
8949+ =/ head=iresult (infer-fragment head.e env state)
8950+ ?: ?=(%| -.head) head
8951+ =/ ht=itype (itype-walk typ.p.head sub.state.p.head)
8952+ ?. ?=(%fn -.ht) (infer-call-with-head e env state head)
8953+ =/ result=itype (itype-walk product.ht sub.state.p.head)
8954+ =/ eligible=?
8955+ ?: ?=(%var -.result) &
8956+ :: A direct known generic union may receive the same nominal result
8957+ :: context before its arguments are checked. Variable-bound origins,
8958+ :: pending tags, recursive identities and unknown atoms stay open.
8959+ ?. &(?=(%union -.product.ht) ?=(%union -.result) ?=(%union -.expected)) |
8960+ ?~ origin.result |
8961+ ?. =(origin.result origin.expected) |
8962+ ?~ args.result |
8963+ ?. =((lent args.result) (lent args.expected)) |
8964+ ?: |((itype-has-tag (itype-normalize result sub.state.p.head)) (itype-has-tag (itype-normalize expected sub.state.p.head))) |
8965+ ?: |((itype-has-recursive (itype-normalize result sub.state.p.head)) (itype-has-recursive (itype-normalize expected sub.state.p.head))) |
8966+ ?: |((itype-has-any-atom result sub.state.p.head) (itype-has-any-atom expected sub.state.p.head)) |
8967+ &
8968+ ?. eligible (infer-call-with-head e env state head)
8969+ ?: |(?=(%var -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected)) (itype-has-tag (itype-normalize expected sub.state.p.head)))
8970+ (infer-call-with-head e env state head)
8971+ =/ sub=(unit isub) (itype-unify result expected sub.state.p.head)
8972+ ?~ sub (infer-call-with-head e env state head)
8973+ (infer-call-with-head e env state [%& typ.p.head state.p.head(sub u.sub)])
8974+::
8975+:: An eligible fully faced literal receives context by name, in source order.
8976+++ width-literal-fields
8977+ |= [items=(list item) axis=@ud fuel=@ud]
8978+ ^- (unit iwfields)
8979+ =/ order=(list iwfield) ~
8980+ =/ index=(map term iwfield) *(map term iwfield)
8981+ |-
8982+ ?~ items ~
8983+ ?: =(0 fuel) ~
8984+ ?~ face.i.items ~
8985+ =/ at-axis=@ud ?~(t.items axis (mul 2 axis))
8986+ =/ entry=iwfield [u.face.i.items at-axis [%noun ~]]
8987+ ?: ?=(^ (~(get by index) name.entry)) ~
8988+ =. index (~(put by index) name.entry entry)
8989+ =. order [entry order]
8990+ ?~ t.items `[(flop order) index]
8991+ $(items t.items, axis +((mul 2 axis)), fuel (dec fuel))
8992+++ width-infer-items
8993+ |= [items=(list item) expected=(map term iwfield) env=ienv state=istate context=span]
8994+ ^- iresult
8995+ ?~ items [%| ["empty record is not supported" ~]]
8996+ ?~ face.i.items [%| ["record face needs unsupported inference" ~]]
8997+ =/ field=(unit iwfield) (~(get by expected) u.face.i.items)
8998+ =/ head=iresult
8999+ ?~ field (infer-fragment val.i.items env state)
9000+ (infer-call-context-arg val.i.items typ.u.field env state context)
9001+ ?: ?=(%| -.head) head
9002+ =/ typ=itype [%face u.face.i.items typ.p.head]
9003+ ?~ t.items [%& typ state.p.head]
9004+ =/ tail=iresult $(items t.items, state state.p.head)
9005+ ?: ?=(%| -.tail) tail
9006+ [%& [%cell typ typ.p.tail] state.p.tail]
9007+++ width-infer-literal
9008+ |= [e=expr expected=itype env=ienv state=istate context=span]
9009+ ^- (unit iresult)
9010+ ?. ?=(%tuple -.e) ~
9011+ ?. |(?=(%cell -.expected) ?=(%face -.expected)) ~
9012+ =/ source=(unit iwfields) (width-literal-fields items.e 1 4.096)
9013+ =/ target=(unit iwfields) (width-scan expected sub.state 1 4.096)
9014+ ?~ source ~
9015+ ?~ target ~
9016+ ?: (lth (lent order.u.source) (lent order.u.target)) ~
9017+ ?. (width-in-order order.u.source order.u.target)
9018+ `(infer-simple-items items.e env state)
9019+ `(width-infer-items items.e index.u.target env state context)
9020+::
9021+:: Experimental intrinsic recognition; real bindings retain normal calls.
9022+++ explicit-proj-call
9023+ |= [e=expr env=ienv state=istate]
9024+ ^- ?
9025+ ?. ?=(%call -.e) |
9026+ ?. ?=([* ~] args.e) |
9027+ ?. ?=(%wing -.head.e) |
9028+ ?. =(names.head.e ~[%proj]) |
9029+ ?: ?=(^ (ienv-lookup %proj env)) |
9030+ ?: (lien globals.state |=(n=term =(n %proj))) |
9031+ ?~ prelude.state &
9032+ ?:(?=(^ (ienv-lookup %proj values.u.prelude.state)) | &)
9033+++ infer-proj-source
9034+ |= [e=expr expected=itype env=ienv state=istate context=span]
9035+ ^- iresult
9036+ ?: ?=(%group -.e) $(e inner.e)
9037+ =/ literal=(unit iresult) (width-infer-literal e expected env state context)
9038+ ?^ literal u.literal
9039+ (infer-fragment e env state)
9040+++ infer-proj-context
9041+ |= [e=expr expected=itype env=ienv state=istate context=span]
9042+ ^- iresult
9043+ ?> ?=(%call -.e)
9044+ ?~ args.e [%| ["proj needs one record" ~]]
9045+ ?. |(?=(%cell -.expected) ?=(%face -.expected)) [%| ["proj needs an expected record type" ~]]
9046+ =/ value=iresult (infer-proj-source i.args.e expected env state context)
9047+ ?: ?=(%| -.value) value
9048+ =/ shape=(unit [source=iwfields target=iwfields])
9049+ (width-proj-shape typ.p.value expected sub.state.p.value)
9050+ ?~ shape [%| ["proj needs a known record containing its expected fields" ~]]
9051+ =/ project=(unit iwidth-result) (width-project u.shape sub.state.p.value next.state.p.value)
9052+ ?~ project [%| ["proj constraint needs unsupported inference" ~]]
9053+ =/ st=istate state.p.value(sub sub.u.project, next next.u.project)
9054+ [%& expected st(projections [[at.e e typ.p.value expected steps.u.project] projections.st])]
9055+::
9056+:: A known literal singleton in a direct union can contextualize a
9057+:: loobean literal of the same noun. Only explicit singleton and cell
9058+:: competitors are considered; opaque or variable cases stay unknown.
9059+++ explicit-singleton-in-union
9060+ |= [t=itype noun=@]
9061+ ^- ?
9062+ ?. ?=(%union -.t) |
9063+ =/ cases=(list itype) cases.t
9064+ =/ found=? |
9065+ |-
9066+ ?~ cases found
9067+ =/ c=itype i.cases
9068+ ?: ?=(%cell -.c) $(cases t.cases)
9069+ ?. ?=(%const -.c) |
9070+ ?: =(noun val.literal.c)
9071+ ?: found |
9072+ $(cases t.cases, found &)
9073+ $(cases t.cases)
9074+::
9075+:: Select a written literal-headed case only when every competing case is
9076+:: also an explicit singleton-headed cell and exactly one matches. Opaque,
9077+:: variable-bound and differently shaped cases keep inference unchanged.
9078+:: This first slice supplies context to a directly called payload. Plain
9079+:: literal data and other expressions retain their existing inference path.
9080+++ contextual-atomic-arguments
9081+ |= args=(list expr)
9082+ ^- ?
9083+ ?~ args &
9084+ ?. ?=(?(%lit %wing %ctor) -.i.args) |
9085+ $(args t.args)
9086+++ contextual-direct-payload-call
9087+ |= e=expr
9088+ ^- ?
9089+ ?: ?=(%group -.e) $(e inner.e)
9090+ ?. ?=(%call -.e) |
9091+ ?. ?=(%wing -.head.e) |
9092+ ?~ args.e |
9093+ (contextual-atomic-arguments args.e)
9094+::
9095+:: A walked variable may have concealed a union inside a substituted
9096+:: structure before this arm was called. Decline in that case rather than
9097+:: deriving provenance from the already-walked type.
9098+++ contextual-simple-sub
9099+ |= sub=isub
9100+ ^- ?
9101+ ?~ sub &
9102+ ?: ?=(?(%cell %face %fn %union %collection) -.val.i.sub) |
9103+ $(sub t.sub)
9104+::
9105+:: Check the syntactic root before scanning; scan substitutions once.
9106+++ grec-direct-context
9107+ |= [expected=itype sub=isub]
9108+ ^- ?
9109+ =/ left=@ud 4.096
9110+ |-
9111+ ?: ?=(%face -.expected)
9112+ ?: =(0 left) |
9113+ $(expected body.expected, left (dec left))
9114+ ?. ?=(%grec -.expected) |
9115+ ?~ sub &
9116+ ?: =(0 left) |
9117+ ?: ?=(?(%cell %face %fn %union %collection %grec) -.val.i.sub) |
9118+ $(sub t.sub, left (dec left))
9119+++ contextual-direct-union
9120+ |= target=itype
9121+ ^- ?
9122+ ?: ?=(%face -.target) $(target body.target)
9123+ ?=(%union -.target)
9124+++ contextual-tagged-case
9125+ |= [target=itype tag=@ sub=isub]
9126+ ^- (unit itype)
9127+ ?. ?=(%union -.target) ~
9128+ =/ remaining=(list itype) cases.target
9129+ =/ found=(unit itype) ~
9130+ =/ seen=(set @) *(set @)
9131+ |-
9132+ ?~ remaining found
9133+ =/ c=itype i.remaining
9134+ ?. ?=(%cell -.c) ~
9135+ =/ head=itype hed.c
9136+ ?. ?=(%const -.head) ~
9137+ ?: (~(has in:..zuse seen) val.literal.head) ~
9138+ =. seen (~(put in:..zuse seen) val.literal.head)
9139+ ?: =(tag val.literal.head)
9140+ $(remaining t.remaining, found `c)
9141+ $(remaining t.remaining)
9142+::
9143+:: A bounded syntactic screen: no nested branch, cast, gate or local body
9144+:: can re-enter cell-branch retry during either inference attempt.
9145+++ closed-cell-retry-safe
9146+ |= [todo=(list expr) fuel=@ud]
9147+ ^- ?
9148+ ?~ todo &
9149+ ?: =(0 fuel) |
9150+ =/ e=expr i.todo
9151+ =. fuel (dec fuel)
9152+ ?+ -.e |
9153+ %lit $(todo t.todo)
9154+ %wing $(todo t.todo)
9155+ %ctor $(todo t.todo)
9156+ %path $(todo t.todo)
9157+ %crash $(todo t.todo)
9158+ %str
9159+ ?. (levy pieces.e |=(p=piece ?=(%text -.p))) |
9160+ $(todo t.todo)
9161+ %group $(todo [inner.e t.todo])
9162+ %pair $(todo [val.e t.todo])
9163+ %unit $(todo [val.e t.todo])
9164+ %list $(todo (weld items.e t.todo))
9165+ %tuple $(todo (weld (turn items.e |=(i=item val.i)) t.todo))
9166+ %change $(todo (weld (turn edits.e |=(ed=edit val.ed)) t.todo))
9167+ %call $(todo [head.e (weld args.e t.todo)])
9168+ %trace $(todo [val.e then.e t.todo])
9169+ ==
9170+::
9171+++ closed-cell-sub-safe
9172+ |= [sub=isub fuel=@ud]
9173+ ^- ?
9174+ ?~ sub &
9175+ ?: =(0 fuel) |
9176+ ?: ?=(?(%cell %face %fn %union %collection %grec %jrec %recursive) -.val.i.sub) |
9177+ $(sub t.sub, fuel (dec fuel))
9178+::
9179+++ closed-cell-branch-eligible
9180+ |= [e=expr expected=itype sub=isub]
9181+ ^- ?
9182+ ?. &(?=(%branch -.e) ?=(%cell -.expected) (closed-cell-sub-safe sub 512)) |
9183+ ?~ arms.e |
9184+ ?~ t.arms.e |
9185+ ?^ t.t.arms.e |
9186+ =/ x=arm i.arms.e
9187+ =/ y=arm i.t.arms.e
9188+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) |
9189+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) |
9190+ ?: =(val.lit.pat.x val.lit.pat.y) |
9191+ (closed-cell-retry-safe ~[subject.e val.x val.y] 512)
9192+::
9193+:: Attempt ordinary inference first; retry from the same state only for
9194+:: the bounded non-reentrant syntax above. Preserve original value faces.
9195+++ infer-closed-cell-branch
9196+ |= [e=expr expected=itype env=ienv state=istate context=span]
9197+ ^- iresult
9198+ ?> (closed-cell-branch-eligible e expected sub.state)
9199+ ?> ?=(%branch -.e)
9200+ ?> ?=(^ arms.e)
9201+ ?> ?=(^ t.arms.e)
9202+ =/ ordinary=iresult (infer-fragment e env state)
9203+ =/ ordinary-good=?
9204+ ?: ?=(%| -.ordinary) |
9205+ =/ fit=ifit (itype-fit typ.p.ordinary expected sub.state.p.ordinary next.state.p.ordinary)
9206+ ?=(%ok -.fit)
9207+ ?: ordinary-good ordinary
9208+ =/ attempt=(unit iresult)
9209+ =/ x=arm i.arms.e
9210+ =/ y=arm i.t.arms.e
9211+ =/ subject=iresult (infer-fragment subject.e env state)
9212+ ?: ?=(%| -.subject) ~
9213+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
9214+ ?: ?=(%union -.subject-type) ~
9215+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
9216+ ?~ su ~
9217+ =/ left=iresult (infer-call-context-arg val.x expected env state.p.subject(sub u.su) context)
9218+ ?: ?=(%| -.left) ~
9219+ =/ lf=ifit (itype-fit typ.p.left expected sub.state.p.left next.state.p.left)
9220+ ?. ?=(%ok -.lf) ~
9221+ =/ right=iresult (infer-call-context-arg val.y expected env state.p.left(sub sub.lf, next next.lf) context)
9222+ ?: ?=(%| -.right) ~
9223+ =/ rf=ifit (itype-fit typ.p.right expected sub.state.p.right next.state.p.right)
9224+ ?. ?=(%ok -.rf) ~
9225+ =/ sub=isub sub.rf
9226+ =/ next=@ud next.rf
9227+ =/ lt=itype (itype-normalize typ.p.left sub)
9228+ =/ rt=itype (itype-normalize typ.p.right sub)
9229+ =/ et=itype (itype-normalize expected sub)
9230+ ?. =(lt rt) ~
9231+ ?: |(?=(^ (itype-vars lt)) ?=(^ (itype-vars rt)) ?=(^ (itype-vars et))) ~
9232+ ?: |((itype-has-tag lt) (itype-has-tag rt) (itype-has-tag et)) ~
9233+ =/ lcheck=ifit (itype-fit typ.p.left expected sub next)
9234+ ?. ?=(%ok -.lcheck) ~
9235+ ?. &(=(sub.lcheck sub) =(next.lcheck next)) ~
9236+ =/ rcheck=ifit (itype-fit typ.p.right expected sub next)
9237+ ?. ?=(%ok -.rcheck) ~
9238+ ?. &(=(sub.rcheck sub) =(next.rcheck next)) ~
9239+ `[%& typ.p.left state.p.right(sub sub, next next)]
9240+ ?~ attempt ordinary
9241+ u.attempt
9242+::
9243+++ infer-call-context-arg
9244+ |= [e=expr expected=itype env=ienv state=istate context=span]
9245+ ^- iresult
9246+ ?: &(?=(^ defer.state) ?=(%branch -.e)) (infer-fragment e env state)
9247+ ?: &(?=(^ defer.state) ?=(^ prelude.state) ?=(%tuple -.e))
9248+ (infer-fragment e env state)
9249+ ?: ?=(%pair -.e) $(e (pair-as-cell e))
9250+ ?: ?=(%group -.e) $(e inner.e)
9251+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
9252+ ?: ?=(%trace -.e)
9253+ =/ traced=iresult (infer-fragment val.e env state)
9254+ ?: ?=(%| -.traced) traced
9255+ $(e then.e, state state.p.traced)
9256+ =/ target=itype (itype-walk expected sub.state)
9257+ |-
9258+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9259+ ?: (explicit-proj-call e env state)
9260+ (infer-proj-context e expected env state context)
9261+ :: Experimental construction only for a source-proven direct target.
9262+ :: Decline any walked structural binding to retain raw-variable provenance.
9263+ ?: &(?=(%grec -.target) ?=(%tuple -.e) (grec-direct-context expected sub.state))
9264+ =/ unfolded=(unit [view=itype left=@ud]) (grec-unfold-view target jrec-fuel.state)
9265+ ?~ unfolded [%| ["recursive mold unfolding needs unsupported inference" ~]]
9266+ ?~ items.e [%| ["recursive mold constructor needs unsupported inference" ~]]
9267+ =/ first=item i.items.e
9268+ ?. &(?=(~ face.first) ?=(%lit -.val.first) =(%term form.lit.val.first))
9269+ [%| ["recursive mold constructor needs unsupported inference" ~]]
9270+ =/ chosen=(unit itype) (contextual-tagged-case view.u.unfolded val.lit.val.first sub.state)
9271+ ?~ chosen [%| ["recursive mold constructor has no matching case" ~]]
9272+ =/ value=iresult (infer-call-context-items items.e u.chosen env state(jrec-fuel left.u.unfolded) context)
9273+ ?: ?=(%| -.value) value
9274+ =/ fit=ifit (itype-fit typ.p.value u.chosen sub.state.p.value next.state.p.value)
9275+ ?: ?=(%unknown -.fit) [%| ["recursive mold case needs unsupported inference" ~]]
9276+ ?: ?=(%bad -.fit) [%| ["recursive mold case does not fit its source shape" ~]]
9277+ [%& target state.p.value(sub sub.fit, next next.fit)]
9278+ :: Only the source-proven one-layer cell is exposed. Each recursive
9279+ :: descent consumes one written tuple; named values use ordinary fit.
9280+ ?: &(?=(%jrec -.target) ?=(%lit -.e) =(%null form.lit.e))
9281+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
9282+ [%& target state(jrec-fuel (dec jrec-fuel.state))]
9283+ ?: &(?=(%jrec -.target) ?=(%tuple -.e))
9284+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
9285+ =. state state(jrec-fuel (dec jrec-fuel.state))
9286+ =/ shape=itype
9287+ [%cell [%face head.target [%atom aura.target]] [%face tail.target target]]
9288+ =/ value=iresult (infer-call-context-items items.e shape env state context)
9289+ ?: ?=(%| -.value) value
9290+ =/ fit=ifit (itype-fit typ.p.value shape sub.state.p.value next.state.p.value)
9291+ ?: ?=(%unknown -.fit) [%| ["recursive mold cell constraint needs unsupported inference" ~]]
9292+ ?: ?=(%bad -.fit) [%| ["recursive mold cell does not fit its source shape" ~]]
9293+ [%& target state.p.value(sub sub.fit, next next.fit)]
9294+ ?: ?=(%call -.e) (infer-contextual-call e target env state)
9295+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state `[target context])
9296+ ?^ empty-list u.empty-list
9297+ ?: (single-structured-pattern e)
9298+ ?> ?=(%branch -.e)
9299+ =/ empty-union=(unit iresult) (known-empty-union-wing subject.e env state)
9300+ ?^ empty-union (infer-known-union-context-subject e target env u.empty-union context)
9301+ =/ single=(unit iresult) (grec-single-wing-subject subject.e env state)
9302+ ?^ single (infer-known-union-context-subject e target env u.single context)
9303+ (infer-single-case-branch e env state `[target context])
9304+ ?: (cell-binder-pattern e)
9305+ (infer-cell-branch e env state `[target context])
9306+ :: In an explicit singleton context retain the written loobean noun;
9307+ :: the ordinary singleton fit compares its noun, not its spelling.
9308+ =/ singleton=(unit itype)
9309+ ?. ?=(%lit -.e) ~
9310+ ?. =(%loobean form.lit.e) ~
9311+ ?. |(?=(%const -.target) &(?=(%union -.expected) (explicit-singleton-in-union expected val.lit.e))) ~
9312+ `[%const lit.e]
9313+ ?^ singleton [%& u.singleton state]
9314+ =/ known=(unit iresult)
9315+ ?: ?=(%branch -.e) (known-union-subject subject.e env state)
9316+ ~
9317+ ?: &(?=(^ known) ?=(%| -.u.known) !(duplicate-loobean-arms e)) u.known
9318+ ?: &(?=(^ known) ?=(%& -.u.known) ?=(~ (unit-union-payload (itype-normalize typ.p.u.known sub.state.p.u.known))))
9319+ (infer-known-union-context-subject e target env u.known context)
9320+ ?: &(?=(%union -.target) ?=(%unit -.e))
9321+ (infer-unit-context e target env state context)
9322+ ?: (closed-cell-branch-eligible e expected sub.state)
9323+ (infer-closed-cell-branch e expected env state context)
9324+ ?: &(?=(%flag -.target) (context-union-branch e))
9325+ (infer-union-context e target env state context)
9326+ ?: &(?=(%union -.target) (context-union-branch e))
9327+ (infer-union-context e target env state context)
9328+ ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch e))
9329+ (infer-union-context e target env state context)
9330+ ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression e))
9331+ (infer-list-context e target env state context)
9332+ :: A literal-headed tuple can receive the unique case's payload
9333+ :: context. The ordinary final fit still checks the complete union.
9334+ =/ selected=(unit itype)
9335+ ?. &((contextual-simple-sub sub.state) (contextual-direct-union expected) ?=(%union -.target) ?=(%tuple -.e) ?=(^ items.e)) ~
9336+ ?~ t.items.e ~
9337+ ?^ t.t.items.e ~
9338+ ?. (contextual-direct-payload-call val.i.t.items.e) ~
9339+ =/ first=item i.items.e
9340+ ?. &(?=(~ face.first) ?=(%lit -.val.first) |(=(%term form.lit.val.first) =(%null form.lit.val.first) =(%loobean form.lit.val.first))) ~
9341+ (contextual-tagged-case target val.lit.val.first sub.state)
9342+ ?^ selected
9343+ ?> ?=(%tuple -.e)
9344+ :: On this bounded shallow-call shape, preserve any inference that
9345+ :: already fits before trying the new contextual path. Neither pass
9346+ :: can recursively select a nested tuple from the atomic arguments.
9347+ =/ ordinary=(unit iresult)
9348+ =/ initial=iresult (infer-fragment e env state)
9349+ ?: ?=(%| -.initial) ~
9350+ =/ fit=ifit (itype-fit typ.p.initial target sub.state.p.initial next.state.p.initial)
9351+ ?. ?=(%ok -.fit) ~
9352+ `initial
9353+ ?^ ordinary u.ordinary
9354+ =/ value=iresult (infer-call-context-items items.e u.selected env state context)
9355+ ?: ?=(%| -.value) value
9356+ =/ fit=ifit (itype-fit typ.p.value u.selected sub.state.p.value next.state.p.value)
9357+ ?: ?=(%unknown -.fit) [%| ["tagged case needs unsupported inference" ~]]
9358+ ?: ?=(%bad -.fit) [%| ["tagged case does not fit its expected type" ~[[context "expected union case"] [(span-of e) "value"]]]]
9359+ [%& typ.p.value state.p.value(sub sub.fit, next next.fit)]
9360+ ?: &(?=(%cell -.target) ?=(%tuple -.e))
9361+ (infer-call-context-items items.e target env state context)
9362+ (infer-fragment e env state)
9363+::
9364+:: Preserve each written face; the final complete sample fit checks faces.
9365+:: A tuple or positional field face belongs to the enclosing sample,
9366+:: not to the expression at that position. A second face, if present,
9367+:: is part of the value's own expected type.
9368+++ projection-field-target
9369+ |= expected=itype
9370+ ^- itype
9371+ ?:(?=(%face -.expected) body.expected expected)
9372+::
9373+++ infer-call-context-items
9374+ |= [items=(list item) expected=itype env=ienv state=istate context=span]
9375+ ^- iresult
9376+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
9377+ ?~ t.items
9378+ =/ last=iresult (infer-call-context-arg val.i.items (projection-field-target expected) env state context)
9379+ ?: ?=(%| -.last) last
9380+ =/ typ=itype typ.p.last
9381+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
9382+ [%& typ state.p.last]
9383+ =/ target=itype (itype-walk expected sub.state)
9384+ |-
9385+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9386+ ?. ?=(%cell -.target) (infer-simple-items items env state)
9387+ =/ head=iresult (infer-call-context-arg val.i.items (projection-field-target hed.target) env state context)
9388+ ?: ?=(%| -.head) head
9389+ =/ typ=itype typ.p.head
9390+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
9391+ =/ tail=iresult (infer-call-context-items t.items tal.target env state.p.head context)
9392+ ?: ?=(%| -.tail) tail
9393+ [%& [%cell typ typ.p.tail] state.p.tail]
9394+::
9395+++ infer-call-context-args
9396+ |= [args=(list expr) expected=itype env=ienv state=istate context=span]
9397+ ^- iresult
9398+ ?~ args [%| ["call has no argument" ~]]
9399+ ?~ t.args (infer-call-context-arg i.args (projection-field-target expected) env state context)
9400+ =/ target=itype (itype-walk expected sub.state)
9401+ |-
9402+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9403+ ?. ?=(%cell -.target)
9404+ (infer-simple-items (turn args |=(a=expr [(span-of a) ~ a])) env state)
9405+ =/ head=iresult (infer-call-context-arg i.args (projection-field-target hed.target) env state context)
9406+ ?: ?=(%| -.head) head
9407+ =/ tail=iresult (infer-call-context-args t.args tal.target env state.p.head context)
9408+ ?: ?=(%| -.tail) tail
9409+ [%& [%cell typ.p.head typ.p.tail] state.p.tail]
9410+::
9411+:: Tuple and record expressions preserve their explicitly written faces.
9412+::
9413+++ infer-simple-items
9414+ |= [items=(list item) env=ienv state=istate]
9415+ ^- iresult
9416+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
9417+ =/ head=iresult (infer-fragment val.i.items env state)
9418+ ?: ?=(%| -.head) head
9419+ =/ ht=itype typ.p.head
9420+ =. ht ?~(face.i.items ht [%face u.face.i.items ht])
9421+ ?~ t.items [%& ht state.p.head]
9422+ =/ tail=iresult $(items t.items, state state.p.head)
9423+ ?: ?=(%| -.tail) tail
9424+ [%& [%cell ht typ.p.tail] state.p.tail]
9425+::
9426+:: A single all-binder cell pattern covers a known cell spine; the final
9427+:: binder captures the remaining noun. Other pattern matrices stay partial.
9428+::
9429+:: Validate binders before reading the subject, preserving shadow-error
9430+:: precedence. The last binder receives the entire remaining tail.
9431+++ cell-pattern-names
9432+ |= [pats=(list pattern) env=ienv globals=(list term) seen=(list term)]
9433+ ^- (each (list term) @t)
9434+ ?~ pats [%& ~]
9435+ ?. ?=(%bind -.i.pats) [%| 'branch pattern is not supported by partial inference']
9436+ =/ name=term name.i.pats
9437+ ?: |(=(name %proj) ?=(^ (ienv-lookup name env)) (lien globals |=(n=term =(n name))) (lien seen |=(n=term =(n name))))
9438+ [%| 'pattern shadows a name']
9439+ =/ rest=(each (list term) @t) $(pats t.pats, seen [name seen])
9440+ ?: ?=(%| -.rest) rest
9441+ [%& [name p.rest]]
9442+::
9443+++ cell-pattern-types
9444+ |= [names=(list term) env=ienv next=@ud]
9445+ ^- [typ=itype env=ienv next=@ud]
9446+ ?~ names !!
9447+ =/ head=itype [%var next]
9448+ =/ scope=ienv [[i.names [head ~]] env]
9449+ ?~ t.names [head scope +(next)]
9450+ =/ tail=[typ=itype env=ienv next=@ud] $(names t.names, env scope, next +(next))
9451+ [[%cell head typ.tail] env.tail next.tail]
9452+::
9453+:: At every position that must be a cell, opaque or sum types may still
9454+:: contain cells. Do not report a definite mismatch without unfolding them.
9455+++ cell-pattern-spine-unknown
9456+ |= [typ=itype names=(list term) sub=isub]
9457+ ^- ?
9458+ ?~ names |
9459+ ?~ t.names |
9460+ =. typ (itype-walk typ sub)
9461+ ?: ?=(%cell -.typ) $(typ tal.typ, names t.names)
9462+ |(?=(%union -.typ) ?=(%collection -.typ) ?=(%recursive -.typ) ?=(%jrec -.typ) ?=(%grec -.typ) ?=(%noun -.typ) ?=(%fn -.typ) ?=(%tag -.typ))
9463+::
9464+++ cell-binder-pattern
9465+ |= e=expr
9466+ ^- ?
9467+ ?. ?=(%branch -.e) |
9468+ ?~ arms.e |
9469+ ?^ t.arms.e |
9470+ ?. ?=(%cell -.pat.i.arms.e) |
9471+ !(single-structured-pattern e)
9472+::
9473+++ infer-cell-branch
9474+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
9475+ ^- iresult
9476+ ?> ?=(%branch -.e)
9477+ ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
9478+ =/ arm=arm i.arms.e
9479+ ?. ?=(%cell -.pat.arm) [%| ["branch pattern is not supported by partial inference" ~]]
9480+ =/ pats=(list pattern) items.pat.arm
9481+ ?~ pats [%| ["branch pattern is not supported by partial inference" ~]]
9482+ ?~ t.pats [%| ["branch pattern is not supported by partial inference" ~]]
9483+ =/ names=(each (list term) @t) (cell-pattern-names pats env globals.state ~)
9484+ ?: ?=(%| -.names) [%| [(trip p.names) ~]]
9485+ =/ subject=iresult (infer-fragment subject.e env state)
9486+ ?: ?=(%| -.subject) subject
9487+ =/ st=istate state.p.subject
9488+ =/ subject-type=itype (itype-normalize typ.p.subject sub.st)
9489+ ?: (itype-has-recursive subject-type)
9490+ [%| ["recursive pattern is not supported by partial inference" ~]]
9491+ ?: (itype-has-face typ.p.subject sub.st)
9492+ [%| ["record patterns are not supported by partial inference" ~]]
9493+ ?: (cell-pattern-spine-unknown subject-type p.names sub.st)
9494+ [%| ["cell pattern subject is not supported by partial inference" ~]]
9495+ =/ binders=[typ=itype env=ienv next=@ud] (cell-pattern-types p.names env next.st)
9496+ =/ sub=(unit isub) (itype-unify typ.p.subject typ.binders sub.st)
9497+ ?~ sub [%| ["cell pattern does not match the subject type" ~]]
9498+ =. st st(next next.binders, sub u.sub)
9499+ ?~ expected (infer-fragment val.arm env.binders st)
9500+ =/ body=iresult (infer-call-context-arg val.arm typ.u.expected env.binders st context.u.expected)
9501+ ?: ?=(%| -.body) body
9502+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
9503+ ?: ?=(%unknown -.fit) [%| ["cell branch result constraint is not supported by partial inference" ~]]
9504+ ?: ?=(%bad -.fit) [%| ["cell branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.arm) "branch arm"]]]]
9505+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
9506+ [%| ["cell branch result needs context in partial inference" ~]]
9507+ [%& typ.u.expected state.p.body(sub sub.fit, next next.fit)]
9508+::
9509+++ show-itype
9510+ |= [t=itype sub=isub]
9511+ ^- tape
9512+ =. t (itype-walk t sub)
9513+ ?- -.t
9514+ %var
9515+ ?: (lth id.t 26) [(add 65 id.t) ~]
9516+ "T{<id.t>}"
9517+ %avar
9518+ ?: (lth id.t 26) [(add 65 id.t) ~]
9519+ "T{<id.t>}"
9520+ %rvar
9521+ ?: (lth id.t 26) [(add 65 id.t) ~]
9522+ "T{<id.t>}"
9523+ %nvar
9524+ ?: (lth id.t 26) [(add 65 id.t) ~]
9525+ "T{<id.t>}"
9526+ %rnvar
9527+ ?: (lth id.t 26) [(add 65 id.t) ~]
9528+ "T{<id.t>}"
9529+ %atom "@{(trip aura.t)}"
9530+ %any-atom "@"
9531+ %flag "?"
9532+ %noun "*"
9533+ %empty "!!"
9534+ %tag (trip txt.literal.t)
9535+ %const (trip txt.literal.t)
9536+ %union
9537+ ?~ label.t (show-itype-cases cases.t sub)
9538+ ?~ args.t (trip u.label.t)
9539+ "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
9540+ %recursive ?~(label.t "recursive mold" (trip u.label.t))
9541+ %jrec ?~(label.t "recursive mold" (trip u.label.t))
9542+ %grec ?~(label.t "recursive mold" "({(trip u.label.t)} {(show-itype-cases args.t sub)})")
9543+ %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
9544+ %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
9545+ %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
9546+ %cell "[{(show-itype-item hed.t sub)} {(show-itype-item tal.t sub)}]"
9547+ ==
9548+::
9549+++ show-itype-item
9550+ |= [t=itype sub=isub]
9551+ ^- tape
9552+ =. t (itype-walk t sub)
9553+ ?: ?=(%face -.t) "{(trip name.t)}={(show-itype-context body.t sub)}"
9554+ (show-itype-context t sub)
9555+::
9556+++ show-itype-context
9557+ |= [t=itype sub=isub]
9558+ ^- tape
9559+ =. t (itype-walk t sub)
9560+ ?: &(?=(%union -.t) ?=(~ label.t)) "({(show-itype t sub)})"
9561+ (show-itype t sub)
9562+::
9563+++ show-itype-cases
9564+ |= [cases=(list itype) sub=isub]
9565+ ^- tape
9566+ ?~ cases ""
9567+ ?~ t.cases (show-itype-context i.cases sub)
9568+ "{(show-itype-context i.cases sub)} {$(cases t.cases)}"
9569+::
9570+:: Include the type at a conflicting site where it can be printed.
9571+:: A lone unresolved variable or decimal variable keeps the neutral label.
9572+::
9573+++ itype-has-nvar
9574+ |= typ=itype
9575+ ^- ?
9576+ ?- -.typ
9577+ %nvar &
9578+ %rnvar &
9579+ %var |
9580+ %avar |
9581+ %rvar |
9582+ %atom |
9583+ %any-atom |
9584+ %flag |
9585+ %noun |
9586+ %empty |
9587+ %tag |
9588+ %const |
9589+ %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
9590+ %recursive |
9591+ %jrec |
9592+ %grec (lien args.typ |=(c=itype (itype-has-nvar c)))
9593+ %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
9594+ %face $(typ body.typ)
9595+ %fn |($(typ sample.typ) $(typ product.typ))
9596+ %cell |($(typ hed.typ) $(typ tal.typ))
9597+ ==
9598+::
9599+++ site-type-note
9600+ |= [label=tape typ=itype sub=isub]
9601+ ^- tape
9602+ =/ normalized=itype (itype-normalize typ sub)
9603+ ?: |(?=(%var -.normalized) ?=(%avar -.normalized) ?=(%rvar -.normalized) (itype-has-nvar normalized) (itype-has-tag normalized) (itype-has-union normalized)) label
9604+ ?: (itype-has-hidden-recursive normalized) label
9605+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
9606+ ?: (gth (lent vars) 26) label
9607+ =/ printable=itype (canonical-itype normalized vars)
9608+ "{label} has type {(show-itype printable ~)}{(show-atom-constraint printable)}"
9609+::
9610+:: A capital in a written mold is generalized with its enclosing ++.
9611+:: Atom constraints may remain generic; until full rigidity checking
9612+:: is implemented, do not report a type if one became more specific.
9613+:: Distinct written capitals cannot be forced equal; use the same
9614+:: capital where a type must be shared (Decisions 2026-10-30).
9615+::
9616+++ cap-id-in
9617+ |= [n=@ud caps=icaps sub=isub]
9618+ ^- ?
9619+ ?~ caps |
9620+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
9621+ =/ ident=(unit @ud)
9622+ ?+ -.resolved ~
9623+ %var `id.resolved
9624+ %avar `id.resolved
9625+ %rvar `id.resolved
9626+ ==
9627+ ?~ ident $(caps t.caps)
9628+ ?: =(n u.ident) &
9629+ $(caps t.caps)
9630+::
9631+++ cap-with-id
9632+ |= [n=@ud caps=icaps sub=isub]
9633+ ^- (unit icap)
9634+ ?~ caps ~
9635+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
9636+ =/ ident=(unit @ud)
9637+ ?+ -.resolved ~
9638+ %var `id.resolved
9639+ %avar `id.resolved
9640+ %rvar `id.resolved
9641+ ==
9642+ ?~ ident $(caps t.caps)
9643+ ?: =(n u.ident) `i.caps
9644+ $(caps t.caps)
9645+::
9646+++ merged-capitals
9647+ |= [caps=icaps sub=isub]
9648+ ^- (unit [first=icap second=icap])
9649+ ?~ caps ~
9650+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
9651+ =/ ident=(unit @ud)
9652+ ?+ -.resolved ~
9653+ %var `id.resolved
9654+ %avar `id.resolved
9655+ %rvar `id.resolved
9656+ ==
9657+ ?~ ident $(caps t.caps)
9658+ =/ found=(unit icap) (cap-with-id u.ident t.caps sub)
9659+ ?^ found `[u.found i.caps]
9660+ $(caps t.caps)
9661+::
9662+++ constrained-capitals
9663+ |= [caps=icaps sub=isub]
9664+ ^- ?
9665+ ?~ caps |
9666+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
9667+ =/ ident=(unit @ud)
9668+ ?+ -.resolved ~
9669+ %var `id.resolved
9670+ %avar `id.resolved
9671+ %rvar `id.resolved
9672+ ==
9673+ ?~ ident &
9674+ ?: (cap-id-in u.ident t.caps sub) &
9675+ $(caps t.caps)
9676+::
9677+:: An atom variable may be generalized when an explicit capital, sample
9678+:: binder or instantiated constraint resolves to it. Decimal variables need
9679+:: defaulting and must not be generalized as arbitrary atom types.
9680+::
9681+++ atom-var-from-cap
9682+ |= [n=@ud caps=icaps sub=isub]
9683+ ^- ?
9684+ ?~ caps |
9685+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
9686+ ?: |(?=(%avar -.resolved) ?=(%rvar -.resolved))
9687+ ?: =(n +.resolved) &
9688+ $(caps t.caps)
9689+ $(caps t.caps)
9690+::
9691+++ has-atom-var
9692+ |= [n=@ud t=itype]
9693+ ^- ?
9694+ ?- -.t
9695+ %var |
9696+ %avar =(n id.t)
9697+ %rvar =(n id.t)
9698+ %nvar |
9699+ %rnvar |
9700+ %atom |
9701+ %any-atom |
9702+ %flag |
9703+ %noun |
9704+ %empty |
9705+ %tag |
9706+ %const |
9707+ %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
9708+ %recursive |
9709+ %jrec |
9710+ %grec (lien args.t |=(c=itype (has-atom-var n c)))
9711+ %collection (lien args.t |=(c=itype (has-atom-var n c)))
9712+ %face $(t body.t)
9713+ %fn |($(t sample.t) $(t product.t))
9714+ %cell |($(t hed.t) $(t tal.t))
9715+ ==
9716+::
9717+++ atom-var-from-binder
9718+ |= [n=@ud binders=(list @ud) sub=isub]
9719+ ^- ?
9720+ ?~ binders |
9721+ =/ resolved=itype (itype-normalize [%var i.binders] sub)
9722+ :: An instantiated atom variable is not itself a substitution, so
9723+ :: its origin still walks as an unbound variable of the same ID.
9724+ ?: ?=(%var -.resolved)
9725+ ?: =(n id.resolved) &
9726+ $(binders t.binders)
9727+ ?: (has-atom-var n resolved) &
9728+ $(binders t.binders)
9729+::
9730+++ unsupported-atom-vars
9731+ |= [t=itype caps=icaps binders=(list @ud) sub=isub]
9732+ ^- ?
9733+ =/ vars=(list @ud) (unique-type-vars (itype-vars t))
9734+ |-
9735+ ?~ vars |
9736+ ?: (itype-var-is-atom i.vars t)
9737+ ?. (has-atom-var i.vars t) &
9738+ ?. |((atom-var-from-cap i.vars caps sub) (atom-var-from-binder i.vars binders sub)) &
9739+ $(vars t.vars)
9740+ $(vars t.vars)
9741+::
9742+++ show-atom-constraint
9743+ |= t=itype
9744+ ^- tape
9745+ =/ vars=(list @ud) (unique-type-vars (itype-vars t))
9746+ =/ printed=? |
9747+ =/ out=tape ""
9748+ |-
9749+ ?~ vars out
9750+ ?: (itype-var-is-restricted i.vars t)
9751+ =/ sep=tape ?:(printed ", " " where ")
9752+ =/ clause=tape "{sep}{(show-itype [%rvar i.vars] ~)} is an atom other than ?"
9753+ $(vars t.vars, printed &, out (weld out clause))
9754+ ?: (itype-var-is-atom i.vars t)
9755+ =/ sep=tape ?:(printed ", " " where ")
9756+ =/ clause=tape "{sep}{(show-itype [%avar i.vars] ~)} is an atom"
9757+ $(vars t.vars, printed &, out (weld out clause))
9758+ $(vars t.vars)
9759+::
9760+:: Build the supported part of the value environment in dependency order.
9761+:: Each pass adds successful definitions. Forward references become
9762+:: available on a later pass; unsupported syntax does not enter the
9763+:: environment. Generalized definitions are closed, so a use instantiates
9764+:: its variables afresh.
9765+::
9766+++ global-value-names
9767+ |= ds=(list def)
9768+ ^- (list term)
9769+ ?~ ds ~
9770+ ?: ?=(%value -.i.ds)
9771+ [name.i.ds $(ds t.ds)]
9772+ $(ds t.ds)
9773+::
9774+++ unique-value-name
9775+ |= [n=term names=(list term)]
9776+ ^- ?
9777+ =/ hits=(list term) (skim names |=(x=term =(x n)))
9778+ ?~ hits |
9779+ ?~ t.hits &
9780+ |
9781+::
9782+:: A top-level gate may refer to itself through one monomorphic placeholder.
9783+:: Its declared sample is inferred first and preserves its field faces.
9784+:: Unify the completed body with that placeholder before generalization;
9785+:: reporting repeats the same check instead of instantiating the gate's
9786+:: generalized interface inside its own body. Mutual groups stay unsupported.
9787+::
9788+++ direct-self-call
9789+ |= [e=expr name=term]
9790+ ^- ?
9791+ ?: ?=(%group -.e) $(e inner.e)
9792+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
9793+ ?. ?=(%call -.e) |
9794+ ?. ?=(%wing -.head.e) |
9795+ =(names.head.e ~[name])
9796+::
9797+++ branch-base-arm
9798+ |= [e=expr name=term]
9799+ ^- (unit expr)
9800+ ?: ?=(%group -.e) $(e inner.e)
9801+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
9802+ ?. ?=(%branch -.e) ~
9803+ ?~ arms.e ~
9804+ ?~ t.arms.e ~
9805+ ?^ t.t.arms.e ~
9806+ =/ x=arm i.arms.e
9807+ =/ y=arm i.t.arms.e
9808+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) ~
9809+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) ~
9810+ ?: =(val.lit.pat.x val.lit.pat.y) ~
9811+ =/ first=? (direct-self-call val.x name)
9812+ =/ second=? (direct-self-call val.y name)
9813+ ?: =(first second) ~
9814+ `?:(first val.y val.x)
9815+::
9816+:: Infer the base arm independently, with the self binding removed. Only
9817+:: a closed type whose constraints resolved can seed the recursive result.
9818+:: The regular body inference then checks both arms with shared state.
9819+::
9820+++ recursive-branch-seed
9821+ |= [d=def env=ienv state=istate]
9822+ ^- (unit itype)
9823+ ?. ?=(%value -.d) ~
9824+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) ~
9825+ =/ gate=expr val.d
9826+ =/ body=expr
9827+ ?- -.gate
9828+ %gate body.gate
9829+ %gate-wide body.gate
9830+ * !!
9831+ ==
9832+ =/ base=(unit expr) (branch-base-arm body name.d)
9833+ ?~ base ~
9834+ =/ outer=ienv (skim env |=(entry=[name=term scheme=ischeme] !=(name.entry name.d)))
9835+ =/ sam=isample-result
9836+ ?- -.gate
9837+ %gate (infer-sample sample.gate outer state)
9838+ %gate-wide (infer-sample sample.gate outer state)
9839+ * !!
9840+ ==
9841+ ?: ?=(%| -.sam) ~
9842+ =/ inferred=iresult (infer-fragment u.base env.p.sam state.p.sam)
9843+ ?: ?=(%| -.inferred) ~
9844+ ?: (pending-tags tags.state.p.inferred sub.state.p.inferred) ~
9845+ ?: (constrained-capitals caps.state.p.inferred sub.state.p.inferred) ~
9846+ =/ typ=itype (itype-normalize typ.p.inferred sub.state.p.inferred)
9847+ ?: ?=(^ (itype-vars typ)) ~
9848+ ?: (itype-has-tag typ) ~
9849+ `typ
9850+::
9851+++ infer-recursive-gate
9852+ |= [d=def env=ienv state=istate]
9853+ ^- iresult
9854+ ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
9855+ =. gate-defs.state ~
9856+ ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
9857+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
9858+ [%| ["recursive definition is not a gate" ~]]
9859+ =/ result=(unit itype) (recursive-branch-seed d env state)
9860+ =/ gate=expr val.d
9861+ =/ sam=isample-result
9862+ ?- -.gate
9863+ %gate (infer-sample sample.gate env state)
9864+ %gate-wide (infer-sample sample.gate env state)
9865+ * !!
9866+ ==
9867+ ?: ?=(%| -.sam)
9868+ =/ diag=(unit idiag)
9869+ ?- -.gate
9870+ %gate (sample-import-invalid sample.gate env state)
9871+ %gate-wide (sample-import-invalid sample.gate env state)
9872+ * ~
9873+ ==
9874+ ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
9875+ [%| [p.sam ~]]
9876+ =/ id=@ud next.state.p.sam
9877+ =/ product=itype ?~(result [%var id] u.result)
9878+ =/ st=istate state.p.sam(next +(id))
9879+ =/ seed=itype [%fn typ.p.sam product]
9880+ =/ seeded=ienv [[name.d [seed ~]] env.p.sam]
9881+ =/ body=expr
9882+ ?- -.gate
9883+ %gate body.gate
9884+ %gate-wide body.gate
9885+ * !!
9886+ ==
9887+ =/ out=iresult (infer-fragment body seeded st)
9888+ ?: ?=(%| -.out) out
9889+ =/ uni=(unit isub) (itype-unify product typ.p.out sub.state.p.out)
9890+ ?~ uni [%| ["recursive gate constraint is not supported by partial inference" ~]]
9891+ [%& [%fn typ.p.sam typ.p.out] state.p.out(sub u.uni)]
9892+::
9893+++ dependency-root
9894+ |= names=(list term)
9895+ ^- (list term)
9896+ ?~ names ~
9897+ ~[(rear names)]
9898+::
9899+++ dependency-exprs
9900+ |= xs=(list expr)
9901+ ^- (list term)
9902+ ?~ xs ~
9903+ =/ first=(list term) (dependency-expr i.xs)
9904+ (weld first $(xs t.xs))
9905+::
9906+++ dependency-pieces
9907+ |= xs=(list piece)
9908+ ^- (list term)
9909+ ?~ xs ~
9910+ =/ first=(list term)
9911+ ?- -.i.xs
9912+ %expr (dependency-expr p.i.xs)
9913+ %text ~
9914+ ==
9915+ (weld first $(xs t.xs))
9916+::
9917+++ dependency-qsegs
9918+ |= xs=(list qseg)
9919+ ^- (list term)
9920+ ?~ xs ~
9921+ =/ first=(list term)
9922+ ?- -.i.xs
9923+ %expr (dependency-expr p.i.xs)
9924+ %knot ~
9925+ ==
9926+ (weld first $(xs t.xs))
9927+::
9928+++ dependency-items
9929+ |= xs=(list item)
9930+ ^- (list term)
9931+ ?~ xs ~
9932+ =/ first=(list term) (dependency-expr val.i.xs)
9933+ (weld first $(xs t.xs))
9934+::
9935+++ dependency-edits
9936+ |= xs=(list edit)
9937+ ^- (list term)
9938+ ?~ xs ~
9939+ =/ first=(list term) (dependency-expr val.i.xs)
9940+ (weld first $(xs t.xs))
9941+::
9942+++ dependency-arms
9943+ |= xs=(list arm)
9944+ ^- (list term)
9945+ ?~ xs ~
9946+ =/ first=(list term) (dependency-expr val.i.xs)
9947+ (weld first $(xs t.xs))
9948+::
9949+++ dependency-defs
9950+ |= xs=(list def)
9951+ ^- (list term)
9952+ ?~ xs ~
9953+ =/ first=(list term)
9954+ ?: ?=(%value -.i.xs) (dependency-expr val.i.xs)
9955+ ~
9956+ (weld first $(xs t.xs))
9957+::
9958+++ dependency-expr
9959+ |= e=expr
9960+ ^- (list term)
9961+ ?- -.e
9962+ %str (dependency-pieces pieces.e)
9963+ %qath (dependency-qsegs segs.e)
9964+ %wing (dependency-root names.e)
9965+ %change
9966+ =/ first=(list term) (dependency-root target.e)
9967+ =/ last=(list term) (dependency-edits edits.e)
9968+ (weld first last)
9969+ %pair (dependency-expr val.e)
9970+ %unit (dependency-expr val.e)
9971+ %group (dependency-expr inner.e)
9972+ %list (dependency-exprs items.e)
9973+ %tuple (dependency-items items.e)
9974+ %gate (dependency-expr body.e)
9975+ %gate-wide (dependency-expr body.e)
9976+ %call
9977+ =/ first=(list term) (dependency-expr head.e)
9978+ =/ last=(list term) (dependency-exprs args.e)
9979+ (weld first last)
9980+ %cast (dependency-expr val.e)
9981+ %trace
9982+ =/ first=(list term) (dependency-expr val.e)
9983+ =/ last=(list term) (dependency-expr then.e)
9984+ (weld first last)
9985+ %branch
9986+ =/ first=(list term) (dependency-expr subject.e)
9987+ =/ last=(list term) (dependency-arms arms.e)
9988+ (weld first last)
9989+ %body
9990+ =/ first=(list term) (dependency-defs defs.e)
9991+ =/ last=(list term) (dependency-expr final.e)
9992+ (weld first last)
9993+ * ~
9994+ ==
9995+::
9996+:: Infer a cyclic component with one monomorphic seed per gate. All members
9997+:: must succeed before any scheme is available; pending constraints and
9998+:: unresolved branch joins remain partial.
9999++$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps]
10000++$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
10001+++ seed-gate-group
10002+ |= [ds=(list def) env=ienv state=istate]
10003+ ^- igate-seeds
10004+ ?~ ds [%& [~ state]]
10005+ =/ d=def i.ds
10006+ ?. ?=(%value -.d) [%| ["recursive group contains a non-gate" ~]]
10007+ =/ gate=expr val.d
10008+ ?. |(?=(%gate -.gate) ?=(%gate-wide -.gate))
10009+ [%| ["recursive group contains a non-gate" ~]]
10010+ =/ initial=istate (reserve-def-caps gate state)
10011+ =/ sam=isample-result
10012+ ?- -.gate
10013+ %gate (infer-sample sample.gate env initial)
10014+ %gate-wide (infer-sample sample.gate env initial)
10015+ * !!
10016+ ==
10017+ ?: ?=(%| -.sam) [%| [p.sam ~]]
10018+ =/ body=expr
10019+ ?- -.gate
10020+ %gate body.gate
10021+ %gate-wide body.gate
10022+ * !!
10023+ ==
10024+ =/ seed=itype [%fn typ.p.sam [%var next.state.p.sam]]
10025+ =/ entry=igate-entry [name.d seed body env.p.sam caps.state.p.sam]
10026+ =/ after=istate state.p.sam(next +(next.state.p.sam), caps caps.state)
10027+ =/ rest=igate-seeds $(ds t.ds, state after)
10028+ ?: ?=(%| -.rest) rest
10029+ [%& [[entry entries.p.rest] state.p.rest]]
10030+::
10031+++ group-seed-env
10032+ |= [entries=(list igate-entry) env=ienv]
10033+ ^- ienv
10034+ ?~ entries env
10035+ [[name.i.entries [typ.i.entries ~]] $(entries t.entries)]
10036+::
10037+++ infer-gate-group-bodies
10038+ |= [entries=(list igate-entry) seeds=ienv state=istate]
10039+ ^- igate-seeds
10040+ ?~ entries [%& [~ state]]
10041+ =/ entry=igate-entry i.entries
10042+ ?> ?=(%fn -.typ.entry)
10043+ =/ scope=ienv (weld seeds env.entry)
10044+ =/ out=iresult (infer-fragment body.entry scope state(caps caps.entry))
10045+ ?: ?=(%| -.out) out
10046+ =/ uni=(unit isub) (itype-unify product.typ.entry typ.p.out sub.state.p.out)
10047+ ?~ uni [%| ["recursive group constraint is not supported by partial inference" ~]]
10048+ =. caps.entry caps.state.p.out
10049+ =/ after=istate state.p.out(sub u.uni, caps caps.state)
10050+ =/ rest=igate-seeds $(entries t.entries, state after)
10051+ ?: ?=(%| -.rest) rest
10052+ [%& [[entry entries.p.rest] state.p.rest]]
10053+::
10054+++ group-schemes
10055+ |= [entries=(list igate-entry) env=ienv outer=istate state=istate]
10056+ ^- (each ienv idiag)
10057+ ?~ entries [%& ~]
10058+ =/ entry=igate-entry i.entries
10059+ =/ merged=(unit [first=icap second=icap]) (merged-capitals caps.entry sub.state)
10060+ ?^ merged
10061+ [%| ["distinct type variables must not be forced equal" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]]
10062+ ?: (constrained-capitals caps.entry sub.state)
10063+ [%| ["explicit capital constraints are not supported by partial inference" ~]]
10064+ =/ typ=itype (itype-normalize typ.entry sub.state)
10065+ ?: (itype-has-nvar typ) [%| ["recursive group needs unsupported inference" ~]]
10066+ ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
10067+ [%| ["recursive group needs unsupported inference" ~]]
10068+ =/ free=(list @ud) (weld (free-env-vars env sub.state) (free-cap-vars caps.outer sub.state))
10069+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
10070+ =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
10071+ ?: (gth (lent vars) 26) [%| ["recursive group needs too many type variables" ~]]
10072+ =/ rest=(each ienv idiag) $(entries t.entries)
10073+ ?: ?=(%| -.rest) rest
10074+ [%& [[name.entry [typ vars]] p.rest]]
10075+::
10076+++ infer-gate-group
10077+ |= [ds=(list def) env=ienv state=istate]
10078+ ^- ilocal-result
10079+ ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
10080+ =/ names=(list term) (global-value-names ds)
10081+ ?. (levy names |=(n=term (unique-value-name n names)))
10082+ [%| ["recursive group contains duplicate names" ~]]
10083+ ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
10084+ [%| ["recursive group shadows a name" ~]]
10085+ =/ scoped=istate state(globals (weld names globals.state), gate-defs ~)
10086+ =/ seeded=igate-seeds (seed-gate-group ds env scoped)
10087+ ?: ?=(%| -.seeded) seeded
10088+ =/ seeds=ienv (group-seed-env entries.p.seeded ~)
10089+ =/ body=igate-seeds (infer-gate-group-bodies entries.p.seeded seeds state.p.seeded)
10090+ ?: ?=(%| -.body) body
10091+ :: Per-member ownership through mutual recursion is not implemented.
10092+ ?: !=(projections.state.p.body projections.state)
10093+ [%| ["record projection in recursive groups needs unsupported inference" ~]]
10094+ ?: !=(holes.state.p.body holes.state)
10095+ [%| ["holes in recursive groups need unsupported inference" ~]]
10096+ ?: (pending-tags tags.state.p.body sub.state.p.body)
10097+ [%| ["recursive group has unresolved literal constraints" ~]]
10098+ =/ schemes=(each ienv idiag) (group-schemes entries.p.body env state state.p.body)
10099+ ?: ?=(%| -.schemes) schemes
10100+ [%& [(weld p.schemes env) state.p.body(globals globals.state)]]
10101+::
10102+++ width-finalize
10103+ |= [ps=(list iwprojection) sub=isub visible=(list @ud)]
10104+ ^- (unit (list iwprojection))
10105+ ?~ ps `~
10106+ ?: (lien t.ps |=(p=iwprojection =(at.p at.i.ps))) ~
10107+ =/ src=itype (default-decimals (itype-normalize source.i.ps sub))
10108+ =/ dst=itype (default-decimals (itype-normalize target.i.ps sub))
10109+ ?: |((itype-has-nvar src) (itype-has-nvar dst) (itype-has-tag src) (itype-has-tag dst)) ~
10110+ =/ vars=(list @ud) (weld (itype-vars src) (itype-vars dst))
10111+ ?. (levy vars |=(n=@ud (lien visible |=(v=@ud =(n v))))) ~
10112+ =/ rest=(unit (list iwprojection)) $(ps t.ps)
10113+ ?~ rest ~
10114+ =/ entry=iwprojection i.ps
10115+ =. entry entry(source src, target dst)
10116+ `[entry u.rest]
10117+::
10118+++ add-supported-defs
10119+ |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition)]
10120+ ^- [env=ienv artifacts=(list iwidth-definition)]
10121+ (add-supported-defs-core ds all-defs checked heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts ~)
10122+::
10123+
10124++$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
10125++$ iadj (map term (list term))
10126++$ ivisited (map term ?)
10127++$ iwork (list [name=term done=?])
10128++$ iwresult [seen=ivisited order=(list term)]
10129++$ icresult [seen=ivisited component=(list term)]
10130++$ icomponents (list (list term))
10131+++ graph-nameset
10132+ |= [names=(list term) seen=ivisited]
10133+ ^- ivisited
10134+ ?~ names seen
10135+ $(names t.names, seen (~(put by seen) i.names &))
10136+::
10137+++ graph-edges
10138+ |= [name=term graph=iadj]
10139+ ^- (list term)
10140+ =/ found=(unit (list term)) (~(get by graph) name)
10141+ ?~ found ~
10142+ u.found
10143+::
10144+++ graph-make-forward
10145+ |= [ds=(list def) names=ivisited graph=iadj]
10146+ ^- iadj
10147+ ?~ ds graph
10148+ ?. ?=(%value -.i.ds) $(ds t.ds)
10149+ =/ deps=(list term) (dependency-expr val.i.ds)
10150+ =. deps (skim deps |=(n=term ?=(^ (~(get by names) n))))
10151+ $(ds t.ds, graph (~(put by graph) name.i.ds deps))
10152+::
10153+++ graph-add-reverse
10154+ |= [name=term edges=(list term) reverse=iadj]
10155+ ^- iadj
10156+ ?~ edges reverse
10157+ =/ prior=(list term) (graph-edges i.edges reverse)
10158+ $(edges t.edges, reverse (~(put by reverse) i.edges [name prior]))
10159+::
10160+++ graph-reverse
10161+ |= [names=(list term) graph=iadj reverse=iadj]
10162+ ^- iadj
10163+ ?~ names reverse
10164+ =. reverse (graph-add-reverse i.names (graph-edges i.names graph) reverse)
10165+ $(names t.names)
10166+::
10167+++ graph-order
10168+ |= [todo=iwork seen=ivisited order=(list term) graph=iadj]
10169+ ^- iwresult
10170+ ?~ todo [seen order]
10171+ =/ event=[name=term done=?] i.todo
10172+ ?: done.event $(todo t.todo, order [name.event order])
10173+ ?: ?=(^ (~(get by seen) name.event)) $(todo t.todo)
10174+ =. seen (~(put by seen) name.event &)
10175+ =/ children=iwork (turn (graph-edges name.event graph) |=(n=term [n |]))
10176+ $(todo (weld children [[name.event &] t.todo]))
10177+::
10178+++ graph-collect
10179+ |= [todo=(list term) seen=ivisited component=(list term) graph=iadj]
10180+ ^- icresult
10181+ ?~ todo [seen component]
10182+ ?: ?=(^ (~(get by seen) i.todo)) $(todo t.todo)
10183+ =. seen (~(put by seen) i.todo &)
10184+ $(todo (weld (graph-edges i.todo graph) t.todo), component [i.todo component])
10185+::
10186+++ graph-collect-all
10187+ |= [order=(list term) seen=ivisited graph=iadj comps=icomponents]
10188+ ^- icomponents
10189+ ?~ order comps
10190+ ?: ?=(^ (~(get by seen) i.order)) $(order t.order)
10191+ =/ found=icresult (graph-collect ~[i.order] seen ~ graph)
10192+ $(order t.order, seen seen.found, comps [component.found comps])
10193+::
10194+:: Two depth-first passes find components before group inference. Maps
10195+:: preserve the graph identity; duplicate global names fail closed.
10196+++ graph-components
10197+ |= [ds=(list def) names=(list term)]
10198+ ^- icomponents
10199+ =/ nameset=ivisited ~
10200+ =/ pending=(list term) names
10201+ |-
10202+ ?^ pending
10203+ ?: ?=(^ (~(get by nameset) i.pending)) ~
10204+ $(pending t.pending, nameset (~(put by nameset) i.pending &))
10205+ =/ graph=iadj (graph-make-forward ds nameset ~)
10206+ =/ reverse=iadj (graph-reverse names graph ~)
10207+ =/ order=iwresult (graph-order (turn names |=(n=term [n |])) ~ ~ graph)
10208+ (graph-collect-all order.order ~ reverse ~)
10209+::
10210+++ graph-cycle
10211+ |= [component=(list term) graph=iadj]
10212+ ^- ?
10213+ ?~ component |
10214+ ?^ t.component &
10215+ (lien (graph-edges i.component graph) |=(x=term =(x i.component)))
10216+::
10217+++ add-groups
10218+ |= [ds=(list def) components=icomponents graph=iadj env=ienv grouped=(list term) artifacts=(list iwidth-definition) state=istate]
10219+ ^- iresolved
10220+ ?~ components [env grouped artifacts]
10221+ =/ component=(list term) i.components
10222+ ?. (graph-cycle component graph) $(components t.components)
10223+ ?: (lien component |=(n=term ?=(^ (ienv-lookup n env)))) $(components t.components)
10224+ =/ members=(list def)
10225+ %+ skim ds
10226+ |= d=def
10227+ &(?=(%value -.d) (lien component |=(n=term =(n name.d))))
10228+ ?. =((lent members) (lent component)) $(components t.components)
10229+ ?. (levy component |=(n=term (unique-value-name n globals.state))) $(components t.components)
10230+ =/ result=ilocal-result (infer-gate-group members env state)
10231+ ?: ?=(%| -.result) $(components t.components)
10232+ $(components t.components, env env.p.result, grouped (weld component grouped))
10233+::
10234+++ resolve-groups
10235+ |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
10236+ ^- iresolved
10237+ (resolve-groups-core ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude ~)
10238+::
10239+
10240++$ iadded-definition
10241+ [env=ienv checked=(map term def) artifacts=(list iwidth-definition)]
10242+++ add-supported-result
10243+ |= [d=def result=iresult initial=istate env=ienv checked=(map term def) artifacts=(list iwidth-definition)]
10244+ ^- (unit iadded-definition)
10245+ ?> ?=(%value -.d)
10246+ ?: ?=(%| -.result) ~
10247+ =. state.p.result (promote-restricted-numbers state.p.result env)
10248+ =. state.p.result (default-hole-numbers holes.state.p.result holes.initial state.p.result env !(itype-has-gate (itype-normalize typ.p.result sub.state.p.result)))
10249+ ?^ (unresolved-hole holes.state.p.result holes.initial state.p.result) ~
10250+ ?: (constrained-capitals caps.state.p.result sub.state.p.result) ~
10251+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
10252+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) ~
10253+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) ~
10254+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
10255+ ?: (gth (lent vars) 26) ~
10256+ =/ finalized=(unit (list iwprojection))
10257+ (width-finalize projections.state.p.result sub.state.p.result vars)
10258+ ?~ finalized ~
10259+ =? artifacts ?=(^ u.finalized)
10260+ [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
10261+ =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
10262+ `[[[name.d [typ vars]] env] checked artifacts]
10263+++ add-supported-defs-core
10264+ |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
10265+ ^- [env=ienv artifacts=(list iwidth-definition)]
10266+ ?~ ds [env artifacts]
10267+ =/ d=def i.ds
10268+ ?: ?=(%mold -.d) $(ds t.ds)
10269+ ?. (unique-value-name name.d globals) $(ds t.ds)
10270+ ?^ (ienv-lookup name.d env) $(ds t.ds)
10271+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10272+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10273+ =. grec-index.initial index
10274+ =. gate-defs.initial checked
10275+ =. head-evidence.initial heads
10276+ =. initial (reserve-def-caps val.d initial)
10277+ =/ result=iresult (infer-fragment val.d env initial)
10278+ =? result ?=(%| -.result) (infer-recursive-gate d env initial)
10279+ =/ added=(unit iadded-definition)
10280+ (add-supported-result d result initial env checked artifacts)
10281+ ?~ added $(ds t.ds)
10282+ $(ds t.ds, env env.u.added, checked checked.u.added, artifacts artifacts.u.added)
10283+::
10284+++ resolve-groups-core
10285+ |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
10286+ ^- iresolved
10287+ =/ env=ienv ~
10288+ =/ grouped=(list term) ~
10289+ =/ artifacts=(list iwidth-definition) ~
10290+ =/ names=(list term) (global-value-names ds)
10291+ =/ nameset=ivisited (graph-nameset names ~)
10292+ =/ graph=iadj (graph-make-forward ds nameset ~)
10293+ =/ components=icomponents (graph-components ds names)
10294+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10295+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
10296+ |-
10297+ =/ next=[env=ienv artifacts=(list iwidth-definition)]
10298+ (add-supported-defs-core ds ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts index)
10299+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10300+ =. grec-index.initial index
10301+ =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
10302+ ?: =(env env.out) out
10303+ $(env env.out, grouped grouped.out, artifacts artifacts.out)
10304+::
10305+++ resolve-supported-defs
10306+ |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
10307+ ^- ienv
10308+ env:(resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
10309+::
10310+:: A diagnostic-only proof for a narrow syntactic value cycle. Every
10311+:: edge is an unqualified wing in a supported expression, and samples
10312+:: may not shadow global bindings. Unknown forms yield no conclusion.
10313++$ icyclesite [name=term at=span]
10314++$ icycle [name=term first=span next=span]
10315+++ cycle-sites-list
10316+ |= [xs=(list expr) globals=(list term) locals=(list term)]
10317+ ^- (unit (list icyclesite))
10318+ ?~ xs `~
10319+ =/ first=(unit (list icyclesite)) (cycle-sites i.xs globals locals)
10320+ ?~ first ~
10321+ =/ tail=(unit (list icyclesite)) $(xs t.xs)
10322+ ?~ tail ~
10323+ `(weld u.first u.tail)
10324+::
10325+++ cycle-sample-name
10326+ |= [sam=sample globals=(list term) locals=(list term)]
10327+ ^- (unit (unit term))
10328+ ?- -.sam
10329+ %bind
10330+ ?: (lien (weld globals locals) |=(n=term =(n name.sam))) ~
10331+ ``name.sam
10332+ %face
10333+ ?: (lien (weld globals locals) |=(n=term =(n name.sam))) ~
10334+ ``name.sam
10335+ %bare `~
10336+ * ~
10337+ ==
10338+::
10339+++ cycle-sites
10340+ |= [e=expr globals=(list term) locals=(list term)]
10341+ ^- (unit (list icyclesite))
10342+ ?- -.e
10343+ %wing
10344+ ?. ?=([@ ~] names.e) ~
10345+ `~[[i.names.e at.e]]
10346+ %lit `~
10347+ %str
10348+ ?: (lien pieces.e |=(p=piece ?=(%expr -.p))) ~
10349+ `~
10350+ %group $(e inner.e)
10351+ %body ?~(defs.e $(e final.e) ~)
10352+ %cast $(e val.e)
10353+ %gate
10354+ =/ binder=(unit (unit term)) (cycle-sample-name sample.e globals locals)
10355+ ?~ binder ~
10356+ =/ nested=(list term) ?~(u.binder locals [u.u.binder locals])
10357+ $(e body.e, locals nested)
10358+ %gate-wide
10359+ =/ binder=(unit (unit term)) (cycle-sample-name sample.e globals locals)
10360+ ?~ binder ~
10361+ =/ nested=(list term) ?~(u.binder locals [u.u.binder locals])
10362+ $(e body.e, locals nested)
10363+ %call
10364+ =/ first=(unit (list icyclesite)) $(e head.e)
10365+ ?~ first ~
10366+ =/ tail=(unit (list icyclesite)) (cycle-sites-list args.e globals locals)
10367+ ?~ tail ~
10368+ `(weld u.first u.tail)
10369+ * ~
10370+ ==
10371+::
10372+++ cycle-definitely-atom
10373+ |= e=expr
10374+ ^- ?
10375+ ?: ?=(%group -.e) $(e inner.e)
10376+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
10377+ ?. ?=(%cast -.e) |
10378+ |(?=(%aura -.shape.e) ?=(%flag -.shape.e))
10379+::
10380+++ cycle-proof-group
10381+ |= [members=(list def) globals=(list term)]
10382+ ^- ?
10383+ ?~ members &
10384+ ?. ?=(%value -.i.members) |
10385+ ?. (unique-value-name name.i.members globals) |
10386+ ?. ?=(^ (cycle-sites val.i.members globals ~)) |
10387+ $(members t.members)
10388+::
10389+++ cycle-find-site
10390+ |= [sites=(list icyclesite) component=(list term)]
10391+ ^- (unit span)
10392+ ?~ sites ~
10393+ ?: (lien component |=(n=term =(n name.i.sites))) `at.i.sites
10394+ $(sites t.sites)
10395+::
10396+++ cycle-group-errors
10397+ |= [members=(list def) component=(list term) globals=(list term)]
10398+ ^- (list icycle)
10399+ ?~ members ~
10400+ =/ d=def i.members
10401+ ?> ?=(%value -.d)
10402+ =/ tail=(list icycle) $(members t.members)
10403+ ?. (cycle-definitely-atom val.d) tail
10404+ =/ sites=(unit (list icyclesite)) (cycle-sites val.d globals ~)
10405+ ?~ sites tail
10406+ =/ found=(unit span) (cycle-find-site u.sites component)
10407+ ?~ found tail
10408+ [[name.d at.d u.found] tail]
10409+::
10410+++ definite-value-cycles
10411+ |= [ds=(list def) globals=(list term)]
10412+ ^- (list icycle)
10413+ =/ names=(list term) (global-value-names ds)
10414+ =/ graph=iadj (graph-make-forward ds (graph-nameset names ~) ~)
10415+ =/ components=icomponents (graph-components ds names)
10416+ =/ out=(list icycle) ~
10417+ |-
10418+ ?~ components out
10419+ =/ component=(list term) i.components
10420+ ?. (graph-cycle component graph) $(components t.components)
10421+ =/ members=(list def)
10422+ (skim ds |=(d=def &(?=(%value -.d) (lien component |=(n=term =(n name.d))))))
10423+ ?. =((lent members) (lent component)) $(components t.components)
10424+ ?. (cycle-proof-group members globals) $(components t.components)
10425+ $(components t.components, out (weld (cycle-group-errors members component globals) out))
10426+::
10427++| %union-analysis
10428+::
10429+:: A conservative projection of written molds onto noun shapes. The
10430+:: result %unknown never establishes either overlap or disjointness.
10431+:: Gates, applications, imports and recursive references stay unknown;
10432+:: another position in a cell may nevertheless prove two cases apart.
10433+::
10434++$ upat
10435+ $~ [%unknown ~]
10436+ $% [%unknown ~]
10437+ [%all ~]
10438+ [%empty ~]
10439+ [%atom val=(unit @)]
10440+ [%flag ~]
10441+ [%cell hed=upat tal=upat]
10442+ [%or alts=(list upat)]
10443+ ==
10444++$ urelation ?(%disjoint %overlap %unknown)
10445++$ upair [first=span second=span relation=urelation]
10446+::
10447+++ project-union-mold
10448+ |= [sh=shape molds=imolds seen=(list term)]
10449+ ^- upat
10450+ ?- -.sh
10451+ %aura [%atom ~]
10452+ %noun [%all ~]
10453+ %tvar [%all ~]
10454+ %void [%empty ~]
10455+ :: ? is its two atoms, 0 and 1 (Decisions 2026-10-30).
10456+ %flag [%flag ~]
10457+ %const [%atom `val.lit.sh]
10458+ %cell (project-union-fields fields.sh molds seen)
10459+ %union [%or (turn cases.sh |=(x=shape (project-union-mold x molds seen)))]
10460+ %ref
10461+ ?~ names.sh [%unknown ~]
10462+ ?^ t.names.sh [%unknown ~]
10463+ =/ n=term i.names.sh
10464+ ?: (lien seen |=(x=term =(x n))) [%unknown ~]
10465+ =/ found=(unit shape) (find-simple-mold n molds)
10466+ ?~ found [%unknown ~]
10467+ $(sh u.found, seen [n seen])
10468+ * [%unknown ~]
10469+ ==
10470+::
10471+++ project-union-fields
10472+ |= [fields=(list field) molds=imolds seen=(list term)]
10473+ ^- upat
10474+ ?~ fields [%unknown ~]
10475+ =/ head=upat
10476+ ?- -.i.fields
10477+ %bare (project-union-mold shape.i.fields molds seen)
10478+ %face (project-union-mold shape.i.fields molds seen)
10479+ %pun (project-union-mold [%ref at.i.fields ~[name.i.fields]] molds seen)
10480+ ==
10481+ ?~ t.fields head
10482+ [%cell head $(fields t.fields)]
10483+::
10484+++ union-inhabited
10485+ |= p=upat
10486+ ^- urelation
10487+ ?- -.p
10488+ %unknown %unknown
10489+ %empty %disjoint
10490+ %all %overlap
10491+ %atom %overlap
10492+ %flag %overlap
10493+ %cell
10494+ =/ a=urelation $(p hed.p)
10495+ =/ b=urelation $(p tal.p)
10496+ ?: |(=(%disjoint a) =(%disjoint b)) %disjoint
10497+ ?: |(=(%unknown a) =(%unknown b)) %unknown
10498+ %overlap
10499+ %or
10500+ =/ alts=(list upat) alts.p
10501+ =/ result=urelation %disjoint
10502+ |-
10503+ ?~ alts result
10504+ =/ r=urelation (union-inhabited i.alts)
10505+ ?: =(%overlap r) %overlap
10506+ $(alts t.alts, result ?:(=(%unknown r) %unknown result))
10507+ ==
10508+::
10509+++ union-relate-alts
10510+ |= [alts=(list upat) b=upat]
10511+ ^- urelation
10512+ =/ result=urelation %disjoint
10513+ |-
10514+ ?~ alts result
10515+ =/ r=urelation (union-relate i.alts b)
10516+ ?: =(%overlap r) %overlap
10517+ $(alts t.alts, result ?:(=(%unknown r) %unknown result))
10518+::
10519+++ union-relate
10520+ |= [a=upat b=upat]
10521+ ^- urelation
10522+ ?: |(?=(%empty -.a) ?=(%empty -.b)) %disjoint
10523+ ?: ?=(%or -.a) (union-relate-alts alts.a b)
10524+ ?: ?=(%or -.b) (union-relate-alts alts.b a)
10525+ ?: ?=(%all -.a) (union-inhabited b)
10526+ ?: ?=(%all -.b) (union-inhabited a)
10527+ ?: |(?=(%unknown -.a) ?=(%unknown -.b)) %unknown
10528+ ?: |(&(?=(%cell -.a) |(?=(%atom -.b) ?=(%flag -.b))) &(?=(%cell -.b) |(?=(%atom -.a) ?=(%flag -.a))))
10529+ %disjoint
10530+ ?: &(?=(%flag -.a) ?=(%flag -.b)) %overlap
10531+ ?: &(?=(%flag -.a) ?=(%atom -.b))
10532+ ?~ val.b %overlap
10533+ ?:(|(=(0 u.val.b) =(1 u.val.b)) %overlap %disjoint)
10534+ ?: &(?=(%atom -.a) ?=(%flag -.b))
10535+ ?~ val.a %overlap
10536+ ?:(|(=(0 u.val.a) =(1 u.val.a)) %overlap %disjoint)
10537+ ?: &(?=(%atom -.a) ?=(%atom -.b))
10538+ ?~ val.a %overlap
10539+ ?~ val.b %overlap
10540+ ?:(=(u.val.a u.val.b) %overlap %disjoint)
10541+ ?: &(?=(%cell -.a) ?=(%cell -.b))
10542+ =/ x=urelation $(a hed.a, b hed.b)
10543+ =/ y=urelation $(a tal.a, b tal.b)
10544+ ?: |(=(%disjoint x) =(%disjoint y)) %disjoint
10545+ ?: |(=(%unknown x) =(%unknown y)) %unknown
10546+ %overlap
10547+ %unknown
10548+::
10549+:: A source-only fallback for literal-tagged cells and one-hop local
10550+:: generic applications. It screens all work before ordinary inference.
10551+++ union-simple-shape-budget
10552+ |= [s=shape fuel=@ud vars=(unit (list @t))]
10553+ ^- (unit @ud)
10554+ ?: =(0 fuel) ~
10555+ =. fuel (dec fuel)
10556+ ?- -.s
10557+ ?(%aura %noun %void %flag) `fuel
10558+ %tvar
10559+ ?~ vars `fuel
10560+ ?:((lien u.vars |=(n=@t =(n name.s))) `fuel ~)
10561+ %const
10562+ ?. |(=(%term form.lit.s) =(%null form.lit.s) =(%loobean form.lit.s)) ~
10563+ ?: &(=(%loobean form.lit.s) !|(=(0 val.lit.s) =(1 val.lit.s))) ~
10564+ `fuel
10565+ %cell (union-simple-fields-budget fields.s fuel vars)
10566+ %fn
10567+ =/ left=(unit @ud) $(s sample.s, fuel fuel)
10568+ ?~ left ~
10569+ $(s product.s, fuel u.left)
10570+ * ~
10571+ ==
10572+++ union-simple-fields-budget
10573+ |= [fields=(list field) fuel=@ud vars=(unit (list @t))]
10574+ ^- (unit @ud)
10575+ ?~ fields `fuel
10576+ ?: =(0 fuel) ~
10577+ =/ field-shape=shape
10578+ ?- -.i.fields
10579+ %bare shape.i.fields
10580+ %face shape.i.fields
10581+ %pun [%ref at.i.fields ~[name.i.fields]]
10582+ ==
10583+ =/ head=(unit @ud) (union-simple-shape-budget field-shape (dec fuel) vars)
10584+ ?~ head ~
10585+ $(fields t.fields, fuel u.head)
10586+++ union-source-find
10587+ |= [n=term molds=imolds fuel=@ud]
10588+ ^- (unit [body=shape left=@ud])
10589+ =/ found=(unit shape) ~
10590+ |-
10591+ ?~ molds
10592+ ?~ found ~
10593+ `[u.found fuel]
10594+ ?: =(0 fuel) ~
10595+ ?: =(n name.i.molds)
10596+ ?^ found ~
10597+ $(molds t.molds, fuel (dec fuel), found `body.i.molds)
10598+ $(molds t.molds, fuel (dec fuel))
10599+++ union-source-args-budget
10600+ |= [vars=(list @t) args=(list shape) fuel=@ud]
10601+ ^- (unit @ud)
10602+ =/ seen=(set @t) *(set @t)
10603+ |-
10604+ ?~ vars ?~(args `fuel ~)
10605+ ?~ args ~
10606+ ?: =(0 fuel) ~
10607+ ?: (~(has in:..zuse seen) i.vars) ~
10608+ =/ arg=(unit @ud) (union-simple-shape-budget i.args (dec fuel) ~)
10609+ ?~ arg ~
10610+ $(vars t.vars, args t.args, fuel u.arg, seen (~(put in:..zuse seen) i.vars))
10611+++ union-source-cell-tag
10612+ |= s=shape
10613+ ^- (unit @)
10614+ ?. ?=(%cell -.s) ~
10615+ ?~ fields.s ~
10616+ ?~ t.fields.s ~
10617+ ?. ?=(%bare -.i.fields.s) ~
10618+ =/ head=shape shape.i.fields.s
10619+ ?. ?=(%const -.head) ~
10620+ ?. |(=(%term form.lit.head) =(%null form.lit.head) =(%loobean form.lit.head)) ~
10621+ ?: &(=(%loobean form.lit.head) !|(=(0 val.lit.head) =(1 val.lit.head))) ~
10622+ `val.lit.head
10623+++ union-source-case-tag
10624+ |= [s=shape molds=imolds fuel=@ud]
10625+ ^- (unit [tag=@ left=@ud])
10626+ ?: ?=(%cell -.s)
10627+ =/ tag=(unit @) (union-source-cell-tag s)
10628+ ?~ tag ~
10629+ =/ left=(unit @ud) (union-simple-shape-budget s fuel ~)
10630+ ?~ left ~
10631+ `[u.tag u.left]
10632+ ?. ?=(%apply -.s) ~
10633+ ?. ?=([@ ~] ref.s) ~
10634+ ?: =(0 fuel) ~
10635+ =/ found=(unit [body=shape left=@ud]) (union-source-find i.ref.s molds (dec fuel))
10636+ ?~ found ~
10637+ ?. ?=(%generic -.body.u.found) ~
10638+ ?~ vars.body.u.found ~
10639+ =/ tag=(unit @) (union-source-cell-tag body.body.u.found)
10640+ ?~ tag ~
10641+ =/ args=(unit @ud) (union-source-args-budget vars.body.u.found args.s left.u.found)
10642+ ?~ args ~
10643+ =/ left=(unit @ud) (union-simple-shape-budget body.body.u.found u.args `vars.body.u.found)
10644+ ?~ left ~
10645+ `[u.tag u.left]
10646+++ union-source-distinct-tags
10647+ |= [cases=(list shape) molds=imolds fuel=@ud]
10648+ ^- ?
10649+ =/ seen=(set @) *(set @)
10650+ =/ has-application=? |
10651+ |-
10652+ ?~ cases has-application
10653+ ?: =(0 fuel) |
10654+ =/ item=(unit [tag=@ left=@ud]) (union-source-case-tag i.cases molds (dec fuel))
10655+ ?~ item |
10656+ ?: (~(has in:..zuse seen) tag.u.item) |
10657+ $(cases t.cases, fuel left.u.item, seen (~(put in:..zuse seen) tag.u.item), has-application |(has-application ?=(%apply -.i.cases)))
10658+::
10659+:: This inference-only screen bounds inherited work that the small source
10660+:: slice may consult. It does not authenticate a caller-created state.
10661+++ union-state-leaf
10662+ |= t=itype
10663+ ^- ?
10664+ ?=(?(%var %avar %rvar %nvar %rnvar %atom %any-atom %flag %noun %empty %const) -.t)
10665+++ union-state-params-budget
10666+ |= [params=iparams fuel=@ud]
10667+ ^- (unit @ud)
10668+ ?~ params `fuel
10669+ ?: =(0 fuel) ~
10670+ ?. (union-state-leaf typ.i.params) ~
10671+ $(params t.params, fuel (dec fuel))
10672+++ union-state-sub-budget
10673+ |= [sub=isub fuel=@ud]
10674+ ^- (unit @ud)
10675+ ?~ sub `fuel
10676+ ?: =(0 fuel) ~
10677+ ?. (union-state-leaf val.i.sub) ~
10678+ $(sub t.sub, fuel (dec fuel))
10679+++ union-state-caps-budget
10680+ |= [caps=icaps fuel=@ud]
10681+ ^- (unit @ud)
10682+ ?~ caps `fuel
10683+ ?: =(0 fuel) ~
10684+ $(caps t.caps, fuel (dec fuel))
10685+++ union-state-active-budget
10686+ |= [active=(list term) fuel=@ud]
10687+ ^- (unit @ud)
10688+ ?~ active `fuel
10689+ ?: =(0 fuel) ~
10690+ $(active t.active, fuel (dec fuel))
10691+++ union-state-tags-budget
10692+ |= [tags=(list ipending) fuel=@ud]
10693+ ^- (unit @ud)
10694+ ?~ tags `fuel
10695+ ?: =(0 fuel) ~
10696+ $(tags t.tags, fuel (dec fuel))
10697+++ union-source-state-safe
10698+ |= [state=istate fuel=@ud]
10699+ ^- ?
10700+ ?^ grec-index.state |
10701+ ?^ holes.state |
10702+ ?^ defer.state |
10703+ ?^ obligations.state |
10704+ =/ params=(unit @ud) (union-state-params-budget params.state fuel)
10705+ ?~ params |
10706+ =/ sub=(unit @ud) (union-state-sub-budget sub.state u.params)
10707+ ?~ sub |
10708+ =/ caps=(unit @ud) (union-state-caps-budget caps.state u.sub)
10709+ ?~ caps |
10710+ =/ active=(unit @ud) (union-state-active-budget active.state u.caps)
10711+ ?~ active |
10712+ ?=(^ (union-state-tags-budget tags.state u.active))
10713+::
10714+:: Positive overlap witnesses from parsed, one-hop local source only.
10715+:: Unknown or exhausted work returns no witness, never disjointness.
10716++$ uow-case [at=span head=@ payload=upat]
10717+++ union-overlap-primitive
10718+ |= s=shape
10719+ ^- (unit upat)
10720+ ?- -.s
10721+ %aura `[%atom ~]
10722+ %noun `[%all ~]
10723+ %void `[%empty ~]
10724+ %flag `[%flag ~]
10725+ %const
10726+ ?. |(=(%term form.lit.s) =(%null form.lit.s) =(%loobean form.lit.s)) ~
10727+ ?: &(=(%loobean form.lit.s) !|(=(0 val.lit.s) =(1 val.lit.s))) ~
10728+ `[%atom `val.lit.s]
10729+ * ~
10730+ ==
10731+++ union-overlap-case
10732+ |= [s=shape molds=imolds fuel=@ud]
10733+ ^- (unit [item=uow-case left=@ud])
10734+ ?: =(0 fuel) ~
10735+ =. fuel (dec fuel)
10736+ :: Each body has exactly two fields; an application has exactly one
10737+ :: parameter and one concrete primitive argument. The full mold table
10738+ :: is scanned to establish unique ownership.
10739+ =/ expanded=(unit [body=shape param=(unit [name=@t pat=upat]) left=@ud])
10740+ ?: ?=(%cell -.s) `[s ~ fuel]
10741+ ?. ?=(%apply -.s) ~
10742+ ?. ?=([@ ~] ref.s) ~
10743+ ?. ?=([* ~] args.s) ~
10744+ ?: =(0 fuel) ~
10745+ =/ found=(unit [body=shape left=@ud]) (union-source-find i.ref.s molds (dec fuel))
10746+ ?~ found ~
10747+ ?. ?=(%generic -.body.u.found) ~
10748+ ?. ?=([@ ~] vars.body.u.found) ~
10749+ ?: =(0 left.u.found) ~
10750+ =/ argument=(unit upat) (union-overlap-primitive i.args.s)
10751+ ?~ argument ~
10752+ `[body.body.u.found `[i.vars.body.u.found u.argument] (dec left.u.found)]
10753+ ?~ expanded ~
10754+ =/ body=shape body.u.expanded
10755+ ?. ?=(%cell -.body) ~
10756+ ?. ?=([* * ~] fields.body) ~
10757+ :: Charge the cell, two fields, and the head and payload nodes.
10758+ ?: (lth left.u.expanded 5) ~
10759+ =/ head=(unit @) (union-source-cell-tag body)
10760+ ?~ head ~
10761+ =/ field=field i.t.fields.body
10762+ =/ payload=shape
10763+ ?- -.field
10764+ %bare shape.field
10765+ %face shape.field
10766+ %pun [%ref at.field ~[name.field]]
10767+ ==
10768+ =/ pattern=(unit upat)
10769+ ?: ?=(%tvar -.payload)
10770+ ?~ param.u.expanded ~
10771+ ?. =(name.payload name.u.param.u.expanded) ~
10772+ `pat.u.param.u.expanded
10773+ (union-overlap-primitive payload)
10774+ ?~ pattern ~
10775+ `[[at.s u.head u.pattern] (sub left.u.expanded 5)]
10776+++ union-overlap-against
10777+ |= [first=uow-case rest=(list shape) molds=imolds fuel=@ud]
10778+ ^- (unit [witness=(unit upair) left=@ud])
10779+ ?~ rest `[~ fuel]
10780+ ?: =(0 fuel) ~
10781+ =/ other=(unit [item=uow-case left=@ud]) (union-overlap-case i.rest molds (dec fuel))
10782+ ?~ other ~
10783+ ?: &(=(head.first head.item.u.other) =(%overlap (union-relate payload.first payload.item.u.other)))
10784+ `[`[at.first at.item.u.other %overlap] left.u.other]
10785+ $(rest t.rest, fuel left.u.other)
10786+++ union-source-overlap
10787+ |= [cases=(list shape) molds=imolds fuel=@ud]
10788+ ^- (unit upair)
10789+ ?~ cases ~
10790+ ?~ t.cases ~
10791+ ?: =(0 fuel) ~
10792+ =/ first=(unit [item=uow-case left=@ud]) (union-overlap-case i.cases molds (dec fuel))
10793+ ?~ first ~
10794+ =/ found=(unit [witness=(unit upair) left=@ud])
10795+ (union-overlap-against item.u.first t.cases molds left.u.first)
10796+ ?~ found ~
10797+ ?^ witness.u.found witness.u.found
10798+ $(cases t.cases, fuel left.u.found)
10799+::
10800+++ union-pairs
10801+ |= [cases=(list shape) molds=imolds]
10802+ ^- (list upair)
10803+ ?~ cases ~
10804+ =/ first=shape i.cases
10805+ =/ a=upat (project-union-mold first molds ~)
10806+ =/ pairs=(list upair)
10807+ %+ turn t.cases
10808+ |= second=shape
10809+ ^- upair
10810+ [at.first at.second (union-relate a (project-union-mold second molds ~))]
10811+ (weld pairs $(cases t.cases))
10812+::
10813+:: A closed structural mold supplies no equation to determine a hole.
10814+:: Applications, references, unbound capitals and unions are unproved.
10815+++ simple-mold-hole
10816+ |= sh=shape
10817+ ^- (unit (unit span))
10818+ ?: ?=(%generic -.sh)
10819+ ?~ vars.sh ~
10820+ ?. (distinct-params vars.sh) ~
10821+ (simple-mold-hole-in body.sh vars.sh)
10822+ (simple-mold-hole-in sh ~)
10823+++ simple-mold-hole-in
10824+ |= [sh=shape vars=(list @t)]
10825+ ^- (unit (unit span))
10826+ ?- -.sh
10827+ %hole ``at.sh
10828+ ?(%aura %noun %void %flag %const) `~
10829+ %tvar ?:((lien vars |=(v=@t =(v name.sh))) `~ ~)
10830+ %cell (simple-mold-field-holes fields.sh vars)
10831+ %fn
10832+ =/ a=(unit (unit span)) $(sh sample.sh)
10833+ ?~ a ~
10834+ =/ b=(unit (unit span)) $(sh product.sh)
10835+ ?~ b ~
10836+ `?~(u.a u.b u.a)
10837+ %generic ~
10838+ * ~
10839+ ==
10840+++ simple-mold-field-holes
10841+ |= [fields=(list field) vars=(list @t)]
10842+ ^- (unit (unit span))
10843+ ?~ fields `~
10844+ =/ f=field i.fields
10845+ =/ first=(unit (unit span))
10846+ ?- -.f
10847+ %face (simple-mold-hole-in shape.f vars)
10848+ %bare (simple-mold-hole-in shape.f vars)
10849+ %pun ~
10850+ ==
10851+ ?~ first ~
10852+ =/ rest=(unit (unit span)) $(fields t.fields)
10853+ ?~ rest ~
10854+ `?~(u.first u.rest u.first)
10855+++ simple-local-mold-hole
10856+ |= defs=(list def)
10857+ ^- (unit span)
10858+ ?~ defs ~
10859+ ?. ?=(%mold -.i.defs) $(defs t.defs)
10860+ =/ found=(unit (unit span)) (simple-mold-hole shape.i.defs)
10861+ ?~ found $(defs t.defs)
10862+ ?^ u.found u.found
10863+ $(defs t.defs)
10864+::
10865+:: A partial prelude may omit unsupported declarations, but may not
10866+:: publish an interface while a named mold's hole remains unchecked.
10867+++ shape-has-hole
10868+ |= sh=shape
10869+ ^- ?
10870+ ?- -.sh
10871+ %hole &
10872+ %path (lien segs.sh |=(s=pseg ?=(%inferred -.s)))
10873+ %apply (lien args.sh shape-has-hole)
10874+ %union (lien cases.sh shape-has-hole)
10875+ %cell (lien fields.sh field-has-hole)
10876+ %fn |($(sh sample.sh) $(sh product.sh))
10877+ %generic $(sh body.sh)
10878+ * |
10879+ ==
10880+++ field-has-hole
10881+ |= f=field
10882+ ^- ?
10883+ ?- -.f
10884+ %face (shape-has-hole shape.f)
10885+ %bare (shape-has-hole shape.f)
10886+ %pun |
10887+ ==
10888+++ named-mold-has-hole
10889+ |= ds=(list def)
10890+ ^- ?
10891+ ?~ ds |
10892+ ?: &(?=(%mold -.i.ds) (shape-has-hole shape.i.ds)) &
10893+ $(ds t.ds)
10894+::
10895+++ sample-has-hole
10896+ |= sam=sample
10897+ ^- ?
10898+ ?- -.sam
10899+ %face (shape-has-hole shape.sam)
10900+ %bare (shape-has-hole shape.sam)
10901+ %cell (lien items.sam sample-has-hole)
10902+ * |
10903+ ==
10904+++ def-has-hole
10905+ |= d=def
10906+ ^- ?
10907+ ?- -.d
10908+ %mold (shape-has-hole shape.d)
10909+ %value (expr-has-hole val.d)
10910+ ==
10911+++ expr-has-hole
10912+ |= e=expr
10913+ ^- ?
10914+ ?- -.e
10915+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (expr-has-hole p.p) |)))
10916+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (expr-has-hole p.p) |)))
10917+ %change (lien edits.e |=(p=edit (expr-has-hole val.p)))
10918+ %pair $(e val.e)
10919+ %unit $(e val.e)
10920+ %group $(e inner.e)
10921+ %list (lien items.e expr-has-hole)
10922+ %tuple (lien items.e |=(i=item (expr-has-hole val.i)))
10923+ ?(%gate %gate-wide) |((sample-has-hole sample.e) $(e body.e))
10924+ %cast |((shape-has-hole shape.e) $(e val.e))
10925+ %call |($(e head.e) (lien args.e expr-has-hole))
10926+ %trace |($(e val.e) $(e then.e))
10927+ %branch |($(e subject.e) (lien arms.e |=(a=arm (expr-has-hole val.a))))
10928+ %body |((lien defs.e def-has-hole) $(e final.e))
10929+ * |
10930+ ==
10931+++ hole-values-present
10932+ |= [ds=(list def) env=ienv]
10933+ ^- ?
10934+ ?~ ds &
10935+ ?. ?=(%value -.i.ds) $(ds t.ds)
10936+ ?: (expr-has-hole val.i.ds)
10937+ ?. ?=(^ (ienv-lookup name.i.ds env)) |
10938+ $(ds t.ds)
10939+ $(ds t.ds)
10940+++ show-partial-mold
10941+ |= [file=path src=@t d=def molds=imolds]
10942+ ^- @t
10943+ ?> ?=(%mold -.d)
10944+ =/ sh=shape shape.d
10945+ =/ hole=(unit (unit span)) (simple-mold-hole sh)
10946+ ?: &(?=(^ hole) ?=(^ u.hole))
10947+ =/ text=@t (show-error src [file line.beg.u.u.hole col.beg.u.u.hole "unresolved type hole"])
10948+ (of-wain:format ~[(crip "+$ {(trip name.d)}: type hole needs a determined type") text])
10949+ =? sh ?=(%generic -.sh) body.sh
10950+ ?. ?=(%union -.sh) (crip "+$ {(trip name.d)}: not checked")
10951+ =/ pairs=(list upair) (union-pairs cases.sh molds)
10952+ =/ overlapping=(list upair) (skim pairs |=(p=upair =(%overlap relation.p)))
10953+ =. overlapping
10954+ ?^ overlapping overlapping
10955+ ?. (lien pairs |=(p=upair =(%unknown relation.p))) ~
10956+ =/ witness=(unit upair) (union-source-overlap cases.sh molds 256)
10957+ ?~(witness ~ ~[u.witness])
10958+ ?^ overlapping
10959+ =/ p=upair i.overlapping
10960+ =/ summary=@t (crip "+$ {(trip name.d)}: overlapping cases; mold not checked")
10961+ =/ first=@t (show-error src [file line.beg.first.p col.beg.first.p "first union case"])
10962+ =/ second=@t (show-error src [file line.beg.second.p col.beg.second.p "overlapping case"])
10963+ (of-wain:format ~[summary first second])
10964+ ?: (lien pairs |=(p=upair =(%unknown relation.p)))
10965+ ?. (union-source-distinct-tags cases.sh molds 256)
10966+ (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
10967+ (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
10968+ (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
10969+::
10970+:: +show-inference-diagnostic: a partial report with both source sites
10971+::
10972+++ show-inference-diagnostic
10973+ |= [file=path src=@t name=term diagnostic=idiag]
10974+ ^- @t
10975+ =/ summary=@t (crip "++ {(trip name)}: {msg.diagnostic}")
10976+ =/ excerpts=(list @t)
10977+ %+ turn sites.diagnostic
10978+ |= site=[at=span note=tape]
10979+ (show-error src [file line.beg.at.site col.beg.at.site note.site])
10980+ (of-wain:format [summary excerpts])
10981+::
10982+:: Both written field sites are shown in the source that declares them.
10983+++ show-duplicate-fields
10984+ |= [file=path src=@t diagnostic=idiag]
10985+ ^- @t
10986+ =/ excerpts=(list @t)
10987+ %+ turn sites.diagnostic
10988+ |= site=[at=span note=tape]
10989+ (show-error src [file line.beg.at.site col.beg.at.site note.site])
10990+ (of-wain:format [(crip msg.diagnostic) excerpts])
10991+::
10992+++ duplicate-fields-report
10993+ |= [file=path src=@t diagnostic=idiag]
10994+ ^- @t
10995+ (of-wain:format ~['partial inference; module not checked' (show-duplicate-fields file src diagnostic)])
10996+::
10997+:: +golden-types: a partial report; it does not claim the module checks
10998+::
10999+++ golden-types
11000+ |= [file=path src=@t]
11001+ ^- @t
11002+ (golden-types-imports file src ~)
11003+::
11004+:: +golden-types-imports: partial inference with caller-supplied /sur types
11005+::
11006+:: Each entry is [module mold result], where result is exactly the
11007+:: noun returned by +read-mold:jibb-import. Only imports declared with
11008+:: /- are visible. Unrecognized or failed results are unsupported.
11009+::
11010+++ golden-types-imports
11011+ |= [file=path src=@t externals=iexternals]
11012+ ^- @t
11013+ (golden-types-with-marks file src externals ~)
11014+::
11015+:: A supplied module is addressed by its logical /ui/.../name/jibb path.
11016+:: Interfaces are closed inference schemes, never raw source shapes.
11017+:: Recursive modules, APIs, derived gates and unsupported definitions do
11018+:: not yield an interface. The reachable graph is checked before the root.
11019+::
11020++$ jsource [at=path source=@t]
11021++$ jbundle (list jsource)
11022++$ jcache (list [at=path iface=ifile])
11023++$ jfile-result (each [iface=ifile cache=jcache] @t)
11024+:: Overlap evidence retains the exact source that supplied its spans.
11025+:: Ordinary Jibb imports preserve this evidence through the resolver.
11026++$ jfile-overlap [file=path source=@t name=term cases=upair]
11027++$ jfile-failure [message=@t overlap=(unit jfile-overlap)]
11028++$ jfile-detailed-result (each [iface=ifile cache=jcache] jfile-failure)
11029++$ jimports-result (each [resolved=ijimports cache=jcache] @t)
11030+:: Preserve an imported overlap's original file and source across the graph.
11031++$ jimports-detailed-result (each [resolved=ijimports cache=jcache] jfile-failure)
11032+::
11033+:: Written record fields each have their own lexical record scope.
11034++$ written-fields (map term span)
11035+++ duplicate-written-field
11036+ |= [name=term at=span seen=written-fields]
11037+ ^- (unit idiag)
11038+ =/ prior=(unit span) (~(get by seen) name)
11039+ ?~ prior ~
11040+ `["record field `{(trip name)}` is repeated" ~[[u.prior "first field"] [at "repeated field"]]]
11041+++ duplicate-shapes
11042+ |= xs=(list shape)
11043+ ^- (unit idiag)
11044+ ?~ xs ~
11045+ =/ first (duplicate-shape i.xs)
11046+ ?^ first first
11047+ $(xs t.xs)
11048+++ duplicate-fields
11049+ |= [fields=(list field) seen=written-fields]
11050+ ^- (unit idiag)
11051+ ?~ fields ~
11052+ =/ f=field i.fields
11053+ =/ n=(unit term)
11054+ ?- -.f
11055+ %face `name.f
11056+ %pun `name.f
11057+ %bare ~
11058+ ==
11059+ =/ dup=(unit idiag) ?~(n ~ (duplicate-written-field u.n at.f seen))
11060+ ?^ dup dup
11061+ =/ inner=(unit idiag)
11062+ ?- -.f
11063+ %face (duplicate-shape shape.f)
11064+ %pun ~
11065+ %bare (duplicate-shape shape.f)
11066+ ==
11067+ ?^ inner inner
11068+ $(fields t.fields, seen ?~(n seen (~(put by seen) u.n at.f)))
11069+++ duplicate-shape
11070+ |= s=shape
11071+ ^- (unit idiag)
11072+ ?- -.s
11073+ %cell (duplicate-fields fields.s ~)
11074+ %apply (duplicate-shapes args.s)
11075+ %union (duplicate-shapes cases.s)
11076+ %fn
11077+ =/ left (duplicate-shape sample.s)
11078+ ?^ left left
11079+ (duplicate-shape product.s)
11080+ %generic (duplicate-shape body.s)
11081+ * ~
11082+ ==
11083+++ duplicate-samples
11084+ |= [items=(list sample) seen=written-fields]
11085+ ^- (unit idiag)
11086+ ?~ items ~
11087+ =/ a=sample i.items
11088+ =/ n=(unit term)
11089+ ?- -.a
11090+ %bind `name.a
11091+ %face `name.a
11092+ %pun `name.a
11093+ * ~
11094+ ==
11095+ =/ dup=(unit idiag) ?~(n ~ (duplicate-written-field u.n at.a seen))
11096+ ?^ dup dup
11097+ =/ inner (duplicate-sample a)
11098+ ?^ inner inner
11099+ $(items t.items, seen ?~(n seen (~(put by seen) u.n at.a)))
11100+++ duplicate-sample
11101+ |= s=sample
11102+ ^- (unit idiag)
11103+ ?- -.s
11104+ %cell (duplicate-samples items.s ~)
11105+ %face (duplicate-shape shape.s)
11106+ %bare (duplicate-shape shape.s)
11107+ * ~
11108+ ==
11109+++ duplicate-exprs
11110+ |= xs=(list expr)
11111+ ^- (unit idiag)
11112+ ?~ xs ~
11113+ =/ first (duplicate-expr i.xs)
11114+ ?^ first first
11115+ $(xs t.xs)
11116+++ duplicate-items
11117+ |= [items=(list item) seen=written-fields]
11118+ ^- (unit idiag)
11119+ ?~ items ~
11120+ =/ a=item i.items
11121+ =/ dup=(unit idiag) ?~(face.a ~ (duplicate-written-field u.face.a at.a seen))
11122+ ?^ dup dup
11123+ =/ inner (duplicate-expr val.a)
11124+ ?^ inner inner
11125+ $(items t.items, seen ?~(face.a seen (~(put by seen) u.face.a at.a)))
11126+++ duplicate-pieces
11127+ |= pieces=(list piece)
11128+ ^- (unit idiag)
11129+ ?~ pieces ~
11130+ =/ first=(unit idiag) ?:(?=(%expr -.i.pieces) (duplicate-expr p.i.pieces) ~)
11131+ ?^ first first
11132+ $(pieces t.pieces)
11133+++ duplicate-qsegs
11134+ |= segs=(list qseg)
11135+ ^- (unit idiag)
11136+ ?~ segs ~
11137+ =/ first=(unit idiag) ?:(?=(%expr -.i.segs) (duplicate-expr p.i.segs) ~)
11138+ ?^ first first
11139+ $(segs t.segs)
11140+++ duplicate-edits
11141+ |= edits=(list edit)
11142+ ^- (unit idiag)
11143+ ?~ edits ~
11144+ =/ first (duplicate-expr val.i.edits)
11145+ ?^ first first
11146+ $(edits t.edits)
11147+++ duplicate-arms
11148+ |= arms=(list arm)
11149+ ^- (unit idiag)
11150+ ?~ arms ~
11151+ =/ first (duplicate-expr val.i.arms)
11152+ ?^ first first
11153+ $(arms t.arms)
11154+++ duplicate-defs
11155+ |= defs=(list def)
11156+ ^- (unit idiag)
11157+ ?~ defs ~
11158+ =/ first=(unit idiag)
11159+ ?- -.i.defs
11160+ %mold (duplicate-shape shape.i.defs)
11161+ %value (duplicate-expr val.i.defs)
11162+ ==
11163+ ?^ first first
11164+ $(defs t.defs)
11165+++ duplicate-expr
11166+ |= e=expr
11167+ ^- (unit idiag)
11168+ ?- -.e
11169+ %str (duplicate-pieces pieces.e)
11170+ %qath (duplicate-qsegs segs.e)
11171+ %change (duplicate-edits edits.e)
11172+ %pair (duplicate-expr val.e)
11173+ %unit (duplicate-expr val.e)
11174+ %group (duplicate-expr inner.e)
11175+ %list (duplicate-exprs items.e)
11176+ %tuple (duplicate-items items.e ~)
11177+ %gate-wide
11178+ =/ first (duplicate-sample sample.e)
11179+ ?^ first first
11180+ (duplicate-expr body.e)
11181+ %gate
11182+ =/ first (duplicate-sample sample.e)
11183+ ?^ first first
11184+ (duplicate-expr body.e)
11185+ %cast
11186+ =/ first (duplicate-shape shape.e)
11187+ ?^ first first
11188+ (duplicate-expr val.e)
11189+ %call
11190+ =/ first (duplicate-expr head.e)
11191+ ?^ first first
11192+ (duplicate-exprs args.e)
11193+ %trace
11194+ =/ first (duplicate-expr val.e)
11195+ ?^ first first
11196+ (duplicate-expr then.e)
11197+ %branch
11198+ =/ first (duplicate-expr subject.e)
11199+ ?^ first first
11200+ (duplicate-arms arms.e)
11201+ %body
11202+ =/ first (duplicate-defs defs.e)
11203+ ?^ first first
11204+ (duplicate-expr final.e)
11205+ * ~
11206+ ==
11207+++ import-binding-names
11208+ |= imports=(list import)
11209+ ^- (list term)
11210+ ?~ imports ~
11211+ =/ n=term
11212+ ?- -.i.imports
11213+ %jibb face.i.imports
11214+ %sur name.i.imports
11215+ %mark mark.i.imports
11216+ ==
11217+ [n $(imports t.imports)]
11218+::
11219+++ reserved-proj-sample
11220+ |= sam=sample
11221+ ^- ?
11222+ ?- -.sam
11223+ %bind =(name.sam %proj)
11224+ %face =(name.sam %proj)
11225+ %pun =(name.sam %proj)
11226+ %cell (lien items.sam reserved-proj-sample)
11227+ * |
11228+ ==
11229+++ reserved-proj-pattern
11230+ |= p=pattern
11231+ ^- ?
11232+ ?- -.p
11233+ %bind =(name.p %proj)
11234+ %cell (lien items.p reserved-proj-pattern)
11235+ * |
11236+ ==
11237+++ reserved-proj-def
11238+ |= d=def
11239+ ^- ?
11240+ ?: =(name.d %proj) &
11241+ ?: ?=(%value -.d) (reserved-proj-expr val.d)
11242+ |
11243+++ reserved-proj-expr
11244+ |= e=expr
11245+ ^- ?
11246+ ?- -.e
11247+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
11248+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
11249+ %change (lien edits.e |=(p=edit (reserved-proj-expr val.p)))
11250+ %pair $(e val.e)
11251+ %unit $(e val.e)
11252+ %group $(e inner.e)
11253+ %list (lien items.e reserved-proj-expr)
11254+ %tuple (lien items.e |=(i=item (reserved-proj-expr val.i)))
11255+ ?(%gate %gate-wide) |((reserved-proj-sample sample.e) $(e body.e))
11256+ %cast $(e val.e)
11257+ %call |($(e head.e) (lien args.e reserved-proj-expr))
11258+ %trace |($(e val.e) $(e then.e))
11259+ %branch |($(e subject.e) (lien arms.e |=(a=arm |((reserved-proj-pattern pat.a) (reserved-proj-expr val.a)))))
11260+ %body |((lien defs.e reserved-proj-def) $(e final.e))
11261+ * |
11262+ ==
11263+::
11264+++ module-has-reserved-proj
11265+ |= mod=module
11266+ ^- ?
11267+ =/ imported=(list term) (import-binding-names imports.mod)
11268+ =/ vals=(list term) (global-value-names defs.mod)
11269+ =/ molds=imolds (collect-simple-molds defs.mod)
11270+ =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11271+ |((lien (weld imported (weld vals mold-names)) |=(n=term =(n %proj))) (lien defs.mod reserved-proj-def))
11272+::
11273+++ module-scope-valid
11274+ |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
11275+ ^- ?
11276+ =/ imported=(list term) (import-binding-names imports.mod)
11277+ =/ vals=(list term) (global-value-names defs.mod)
11278+ =/ molds=imolds (collect-simple-molds defs.mod)
11279+ =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11280+ ?: (module-has-reserved-proj mod) |
11281+ ?. %+ levy imported
11282+ |= n=term
11283+ &((unique-value-name n imported) !(lien vals |=(v=term =(n v))) !(lien mold-names |=(m=term =(n m))) !(lien prelude-values |=(v=term =(n v))) !(lien prelude-molds |=(m=term =(n m))))
11284+ |
11285+ ?. (levy vals |=(n=term &((unique-value-name n vals) !(lien prelude-values |=(v=term =(n v)))))) |
11286+ (levy mold-names |=(n=term &((unique-value-name n mold-names) !(lien prelude-molds |=(m=term =(n m))))))
11287+::
11288+:: In an API file or before main's kind is known, a lone `+$ poke`
11289+:: may be a declaration rather than a mold that shadows the prelude. Do not call
11290+:: that one collision definite, and do not hide unrelated scope errors.
11291+++ pending-declared-poke
11292+ |= [at=path mod=module prelude-values=(list term) prelude-molds=(list term)]
11293+ ^- ?
11294+ ?. (lien prelude-molds |=(n=term =(%poke n))) |
11295+ ?. |(?=([%ui %api @ %jibb ~] at) (lien defs.mod |=(d=def &(?=(%value -.d) =(%main name.d))))) |
11296+ =/ pokes=(list def)
11297+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(%poke name.d))))
11298+ ?~ pokes |
11299+ ?^ t.pokes |
11300+ =/ remaining=(list def)
11301+ (skim defs.mod |=(d=def !&(?=(%mold -.d) =(%poke name.d))))
11302+ (module-scope-valid mod(defs remaining) prelude-values prelude-molds)
11303+::
11304+:: A detailed failure is attached only to the first mold that actually
11305+:: failed in this check, using that module's checked source mold table.
11306++$ imold-failure [message=@t overlap=(unit [name=term cases=upair])]
11307+:: Validate a generic wrapper without an unbounded duplicate-name pass.
11308+++ module-mold-params-valid
11309+ |= [vars=(list @t) seen=(set @t) fuel=@ud]
11310+ ^- ?
11311+ ?~ vars &
11312+ ?: =(0 fuel) |
11313+ ?: (~(has in:..zuse seen) i.vars) |
11314+ $(vars t.vars, seen (~(put in:..zuse seen) i.vars), fuel (dec fuel))
11315+++ module-mold-overlap
11316+ |= [m=[name=term body=shape] molds=imolds]
11317+ ^- (unit upair)
11318+ =/ sh=shape body.m
11319+ =/ valid=?
11320+ ?. ?=(%generic -.sh) &
11321+ ?~ vars.sh |
11322+ (module-mold-params-valid vars.sh *(set @t) 256)
11323+ ?. valid ~
11324+ =? sh ?=(%generic -.sh) body.sh
11325+ ?. ?=(%union -.sh) ~
11326+ (union-source-overlap cases.sh molds 256)
11327+++ module-mold-types-detail
11328+ |= [molds=imolds state=istate]
11329+ ^- (each imold-types imold-failure)
11330+ ?~ molds [%& ~]
11331+ =/ m=[name=term body=shape] i.molds
11332+ =/ t=(unit [template=ischeme state=istate])
11333+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
11334+ ?~ t
11335+ =/ overlap=(unit upair) (module-mold-overlap m molds.state)
11336+ [%| ['module mold needs unsupported inference' ?~(overlap ~ `[name.m u.overlap])]]
11337+ =. typ.template.u.t (label-direct-union typ.template.u.t body.m name.m state)
11338+ =/ rest=(each imold-types imold-failure) $(molds t.molds)
11339+ ?: ?=(%| -.rest) rest
11340+ [%& [[name.m template.u.t] p.rest]]
11341+++ module-mold-types
11342+ |= [molds=imolds state=istate]
11343+ ^- (each imold-types @t)
11344+ ?~ molds [%& ~]
11345+ =/ m=[name=term body=shape] i.molds
11346+ =/ t=(unit [template=ischeme state=istate])
11347+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
11348+ ?~ t [%| 'module mold needs unsupported inference']
11349+ =. typ.template.u.t (label-direct-union typ.template.u.t body.m name.m state)
11350+ =/ rest=(each imold-types @t) $(molds t.molds)
11351+ ?: ?=(%| -.rest) rest
11352+ [%& [[name.m template.u.t] p.rest]]
11353+::
11354+:: Prepare a provisional interface from the trusted vendored source.
11355+:: Every declared name remains reserved, but only molds and values this
11356+:: fragment can infer are usable. Unsupported bodies are not validated.
11357+:: An optional internal source supplies the prelude's one supported import;
11358+:: clients cannot import that path directly. Named unions retain their origin.
11359+::
11360+:: Recognize only the complete standard prelude list shape. Its recursive
11361+:: tail uses the same parameter and the unqualified list name. The reader
11362+:: verifies Hoon's list provenance before producing the same collection type.
11363+:: The prelude source and reader output are trusted caller inputs.
11364+::
11365+++ standard-prelude-list
11366+ |= sh=shape
11367+ ^- ?
11368+ ?. ?=(%generic -.sh) |
11369+ ?~ vars.sh |
11370+ ?^ t.vars.sh |
11371+ =/ var=@t i.vars.sh
11372+ ?. ?=(%union -.body.sh) |
11373+ =/ cs=(list shape) cases.body.sh
11374+ ?~ cs |
11375+ ?~ t.cs |
11376+ ?^ t.t.cs |
11377+ ?. ?=(%const -.i.cs) |
11378+ ?. =(%null form.lit.i.cs) |
11379+ ?. ?=(%cell -.i.t.cs) |
11380+ =/ fs=(list field) fields.i.t.cs
11381+ ?~ fs |
11382+ ?~ t.fs |
11383+ ?^ t.t.fs |
11384+ ?. ?=(%face -.i.fs) |
11385+ ?. =(%i name.i.fs) |
11386+ ?. ?=(%tvar -.shape.i.fs) |
11387+ ?. =(var name.shape.i.fs) |
11388+ ?. ?=(%face -.i.t.fs) |
11389+ ?. =(%t name.i.t.fs) |
11390+ =/ tail=shape shape.i.t.fs
11391+ ?. ?=(%apply -.tail) |
11392+ ?. =(~[%list] ref.tail) |
11393+ ?~ args.tail |
11394+ ?^ t.args.tail |
11395+ ?. ?=(%tvar -.i.args.tail) |
11396+ =(var name.i.args.tail)
11397+::
11398+++ prelude-label
11399+ |= [typ=itype name=term vars=(list @ud)]
11400+ ^- itype
11401+ ?: ?=(%jrec -.typ) typ(label `name)
11402+ ?: ?=(%grec -.typ)
11403+ ?. (identity-union-parameters vars args.typ) typ(label ~)
11404+ typ(label `name)
11405+ ?. ?=(%union -.typ) typ
11406+ ?. (identity-union-parameters vars args.typ)
11407+ ?~ origin.typ typ
11408+ ?: =(at.u.origin.typ /lib/jibb/internal/jibb) typ(label ~)
11409+ typ
11410+ typ(label `name)
11411+::
11412+++ partial-prelude-molds
11413+ |= [molds=imolds state=istate]
11414+ ^- imold-types
11415+ ?~ molds ~
11416+ =/ m=[name=term body=shape] i.molds
11417+ ?: &(=(at.state /lib/jibb/prelude/jibb) =(%list name.m))
11418+ ?. (standard-prelude-list body.m) $(molds t.molds)
11419+ [[%list [[%collection %list ~[[%var 0]]] ~[0]]] $(molds t.molds)]
11420+ =/ out=(unit [template=ischeme state=istate])
11421+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
11422+ ?~ out $(molds t.molds)
11423+ =. typ.template.u.out (label-direct-union typ.template.u.out body.m name.m state)
11424+ =. typ.template.u.out (prelude-label typ.template.u.out name.m vars.template.u.out)
11425+ [[name.m template.u.out] $(molds t.molds)]
11426+::
11427+:: A compiler-owned interface available only to the dedicated
11428+:: internal-prelude preparation path, never the ordinary module resolver.
11429+++ private-primitive-interface
11430+ ^- ifile
11431+ =/ a=itype [%avar 0]
11432+ =/ pair=itype [%cell a a]
11433+ =/ b=itype [%rvar 0]
11434+ =/ plus=ischeme [[%fn [%cell b b] b] ~[0]]
11435+ =/ minus=ischeme [[%fn b b] ~[0]]
11436+ =/ greater=ischeme [[%fn pair [%flag ~]] ~[0]]
11437+ =/ utf8=itype [%atom 'tD']
11438+ =/ tape=itype [%collection %list ~[utf8]]
11439+ =/ codepoints=itype [%collection %list ~[[%atom %c]]]
11440+ =/ text-trip=ischeme [[%fn [%atom %t] tape] ~]
11441+ =/ text-tuba=ischeme [[%fn tape codepoints] ~]
11442+ [~[[%raw-add plus] [%raw-dec minus] [%raw-gth greater] [%raw-trip text-trip] [%raw-tuba text-tuba]] ~ /lib/jibb/primitives/jibb ~ ~ ~ ~ ~]
11443+::
11444+++ infer-private-internal
11445+ |= [src=@t public-source=@t]
11446+ ^- (unit ifile)
11447+ =/ at=path /lib/jibb/internal/jibb
11448+ =/ parsed (parse at src)
11449+ ?: ?=(%| -.parsed) ~
11450+ =/ mod=module p.parsed
11451+ ?^ (duplicate-defs defs.mod) ~
11452+ ?~ imports.mod
11453+ =/ built=jfile-result (infer-jibb-file at src ~ ~ ~ ~[at] ~ ~ ~ ~)
11454+ ?: ?=(%| -.built) ~
11455+ `iface.p.built
11456+ ?. ?=([[%jibb *] ~] imports.mod) ~
11457+ ?. =(path.i.imports.mod /lib/jibb/primitives) ~
11458+ ?. (module-scope-valid mod ~ ~) ~
11459+ =/ vals=(list term) (global-value-names defs.mod)
11460+ ?: (lien vals |=(n=term =(n %main))) ~
11461+ =/ molds=imolds (collect-simple-molds defs.mod)
11462+ =/ globals=(list term) (weld (import-binding-names imports.mod) vals)
11463+ :: The private source can use the public list and unit molds before the
11464+ :: prelude is otherwise prepared. Re-read the trusted public source here
11465+ :: and admit only its validated canonical templates; do not accept schemes
11466+ :: supplied independently by the caller.
11467+ =/ public=(each module error) (parse /lib/jibb/prelude/jibb public-source)
11468+ ?: ?=(%| -.public) ~
11469+ ?^ (duplicate-defs defs.p.public) ~
11470+ ?. (module-scope-valid p.public ~ ~) ~
11471+ =/ source-molds=imolds (collect-simple-molds defs.p.public)
11472+ =/ written-list=(unit shape) (find-simple-mold %list source-molds)
11473+ =/ source-list=(unit ischeme)
11474+ ?~ written-list ~
11475+ ?. (standard-prelude-list u.written-list) ~
11476+ `[[%collection %list ~[[%var 0]]] ~[0]]
11477+ :: Derive the public unit template from its actual source, then compare
11478+ :: the complete nominal template before making it available privately.
11479+ =/ unit-decl=(unit shape) (find-simple-mold %unit source-molds)
11480+ =/ source-unit=(unit ischeme)
11481+ ?~ unit-decl ~
11482+ =/ unit-molds=imolds ~[[%unit u.unit-decl]]
11483+ =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~ ~ ~ ~ ~ ~]
11484+ =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
11485+ =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
11486+ =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
11487+ ?~ found ~
11488+ ?. (standard-unit-template u.found /lib/jibb/prelude/jibb) ~
11489+ found
11490+ =/ primitive=ifile private-primitive-interface
11491+ =? primitive ?=(^ source-list)
11492+ primitive(molds [[%list u.source-list] molds.primitive])
11493+ =? primitive ?=(^ source-unit)
11494+ primitive(molds [[%unit u.source-unit] molds.primitive])
11495+ =/ js=ijimports ~[[face.i.imports.mod primitive]]
11496+ =/ reserved=(list term) ~[face.i.imports.mod]
11497+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11498+ =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~ ~ ~ ~ ~ ~]
11499+ =/ mts=(each imold-types @t) (module-mold-types molds state)
11500+ =/ usable=(unit imold-types)
11501+ ?: ?=(%& -.mts) `p.mts
11502+ :: Missing public templates may make an unrelated internal mold
11503+ :: unavailable. Validate all molds once with isolated canonical
11504+ :: templates before admitting only those inferred using the actual
11505+ :: source-backed templates. The proof interface is never exported.
11506+ ?. |(?=(~ source-list) ?=(~ source-unit)) ~
11507+ =/ nil=itype [%const [%null %n 0 '~']]
11508+ =/ canonical-unit=ischeme
11509+ [[%union ~[nil [%cell nil [%face %u [%var 0]]]] `[/lib/jibb/prelude/jibb %unit] `%unit ~[[%var 0]]] ~[0]]
11510+ =/ canonical-list=ischeme [[%collection %list ~[[%var 0]]] ~[0]]
11511+ =/ proof-primitive=ifile private-primitive-interface
11512+ =. molds.proof-primitive ~[[%list canonical-list] [%unit canonical-unit]]
11513+ =/ proof-imports=ijimports ~[[face.i.imports.mod proof-primitive]]
11514+ =/ proof=(each imold-types @t) (module-mold-types molds state(jimports proof-imports))
11515+ ?: ?=(%| -.proof) ~
11516+ `(partial-prelude-molds molds state)
11517+ ?~ usable ~
11518+ =/ resolution=iresolved (resolve-groups defs.mod molds globals ~ ~ ~ ~ js reserved at ~)
11519+ =/ env=ienv env.resolution
11520+ ?. (module-values-complete defs.mod env) ~
11521+ `[env u.usable at ~ artifacts.resolution ~ `src ~]
11522+::
11523+++ partial-prelude-interface-with-internal
11524+ |= [src=@t internal-source=(unit @t)]
11525+ ^- (unit ifile)
11526+ ?: =(0 src) ~
11527+ =/ at=path /lib/jibb/prelude/jibb
11528+ =/ parsed (parse at src)
11529+ ?: ?=(%| -.parsed) ~
11530+ ?: (named-mold-has-hole defs.p.parsed) ~
11531+ ?^ (duplicate-defs defs.p.parsed) ~
11532+ =/ private=(unit ijimports)
11533+ ?~ imports.p.parsed `~
11534+ ?. ?=([[%jibb *] ~] imports.p.parsed) ~
11535+ ?. =(path.i.imports.p.parsed /lib/jibb/internal) ~
11536+ ?~ internal-source ~
11537+ =/ built=(unit ifile) (infer-private-internal u.internal-source src)
11538+ ?~ built ~
11539+ `~[[face.i.imports.p.parsed u.built]]
11540+ ?~ private ~
11541+ ?~ defs.p.parsed ~
11542+ ?. (module-scope-valid p.parsed ~ ~) ~
11543+ =/ ds=(list def) defs.p.parsed
11544+ =/ molds=imolds (collect-simple-molds ds)
11545+ =/ names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11546+ =/ globals=(list term) (weld (import-binding-names imports.p.parsed) (global-value-names ds))
11547+ :: Remove raw list before inferring any template, so an altered list
11548+ :: cannot leak through an alias. Its name remains reserved either way.
11549+ =/ declared=? (lien names |=(name=term =(%list name)))
11550+ =/ env-molds=imolds molds
11551+ =? env-molds declared
11552+ (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
11553+ =/ reserved=(list term) ?:(declared ~[%list] ~)
11554+ =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~ ~ ~ ~ ~ ~]
11555+ :: Other prelude molds may use list only after its source has passed
11556+ :: the standard-list check. The raw declaration remains removed.
11557+ =/ declared-list=(unit shape) (find-simple-mold %list molds)
11558+ =/ mold-prelude=(unit ifile)
11559+ ?~ declared-list ~
11560+ ?. (standard-prelude-list u.declared-list) ~
11561+ `[~ ~[[%list [[%collection %list ~[[%var 0]]] ~[0]]]] at ~ ~ ~ ~ ~]
11562+ =/ mt=imold-types (partial-prelude-molds molds state(prelude mold-prelude))
11563+ =/ partial=ifile [~ mt at ~ ~ ~ ~ ~]
11564+ :: An explicitly qualified re-export must resolve. Other unsupported
11565+ :: prelude declarations remain reserved but absent from the interface.
11566+ =/ required=imolds
11567+ %+ skim molds
11568+ |= m=[name=term body=shape]
11569+ =/ sh=shape body.m
11570+ ?. ?=(%ref -.sh) |
11571+ ?~ names.sh |
11572+ ?=(^ t.names.sh)
11573+ ?. (levy required |=(m=[name=term body=shape] ?=(^ (find-jibb-mold name.m partial)))) ~
11574+ =/ resolution=iresolved (resolve-groups ds env-molds globals ~ ~ ~ ~ u.private reserved at `partial)
11575+ =/ env=ienv env.resolution
11576+ ?. (hole-values-present ds env) ~
11577+ =/ deps=(list iwidth-dependency)
11578+ ?~ u.private ~
11579+ ~[[at.interface.i.u.private source.interface.i.u.private elaborations.interface.i.u.private]]
11580+ `[env mt at ~ artifacts.resolution deps `src ~]
11581+::
11582+++ partial-prelude-interface
11583+ |= src=@t
11584+ ^- (unit ifile)
11585+ (partial-prelude-interface-with-internal src ~)
11586+::
11587++$ iprelude [iface=ifile values=(list term) molds=(list term)]
11588+::
11589+++ prepare-prelude
11590+ |= src=@t
11591+ ^- (unit iprelude)
11592+ =/ iface=(unit ifile) (partial-prelude-interface src)
11593+ ?~ iface ~
11594+ =/ parsed (parse /lib/jibb/prelude/jibb src)
11595+ ?: ?=(%| -.parsed) ~
11596+ =/ vals=(list term) (global-value-names defs.p.parsed)
11597+ =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
11598+ `[u.iface vals ms]
11599+::
11600+++ prepare-prelude-with-internal
11601+ |= [src=@t internal-source=@t]
11602+ ^- (unit iprelude)
11603+ =/ iface=(unit ifile) (partial-prelude-interface-with-internal src `internal-source)
11604+ ?~ iface ~
11605+ =/ parsed (parse /lib/jibb/prelude/jibb src)
11606+ ?: ?=(%| -.parsed) ~
11607+ =/ vals=(list term) (global-value-names defs.p.parsed)
11608+ =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
11609+ `[u.iface vals ms]
11610+::
11611+++ module-values-complete
11612+ |= [ds=(list def) env=ienv]
11613+ ^- ?
11614+ ?~ ds &
11615+ ?: ?=(%mold -.i.ds) $(ds t.ds)
11616+ ?~ (ienv-lookup name.i.ds env) |
11617+ $(ds t.ds)
11618+::
11619+:: Cache only completed interfaces for this invocation. The source bundle,
11620+:: imported Hoon types and prelude are fixed for the whole graph. Check the
11621+:: active path and duplicate sources before consulting it, so a cache hit
11622+:: cannot hide a cycle or ambiguous source.
11623+::
11624+++ find-jibb-cache
11625+ |= [at=path cache=jcache]
11626+ ^- (unit ifile)
11627+ ?~ cache ~
11628+ ?: =(at at.i.cache) `iface.i.cache
11629+ $(cache t.cache)
11630+::
11631+:: These certificates retain the complete checked source closure. The
11632+:: trusted host must supply the identical prepared prelude and reader nouns.
11633+:: Exact bundle equality binds all source paths and versions; the set
11634+:: retains transitive paths for active-cycle checks. Request-bearing graphs
11635+:: alone have a size limit; incompatible diamond evidence fails closed.
11636+++ request-graph-requests-add
11637+ |= [pending=(list irequest-evidence) acc=(list irequest-evidence) fuel=@ud]
11638+ ^- (unit (list irequest-evidence))
11639+ ?~ pending `acc
11640+ ?: =(0 fuel) ~
11641+ =/ hit=(list irequest-evidence)
11642+ (skim acc |=(x=irequest-evidence &(=(api-at.x api-at.i.pending) =(name.x name.i.pending))))
11643+ ?^ hit
11644+ ?. ?=([* ~] hit) ~
11645+ ?. =(i.hit i.pending) ~
11646+ $(pending t.pending, fuel (dec fuel))
11647+ $(pending t.pending, acc [i.pending acc], fuel (dec fuel))
11648+++ request-graph-inputs-match
11649+ |= [g=irequest-graph externals=iexternals marks=imark-externals modules=jbundle values=(list term) molds=(list term) prelude=(unit ifile)]
11650+ ^- ?
11651+ ?& =(bundle-input.g modules)
11652+ =(prelude-input.g prelude)
11653+ =(prelude-values.g values)
11654+ =(prelude-molds.g molds)
11655+ =(externals.g externals)
11656+ =(marks.g marks)
11657+ ==
11658+++ request-graph-merge
11659+ |= [imports=ijimports g=irequest-graph fuel=@ud]
11660+ ^- (unit irequest-graph)
11661+ ?~ imports `g
11662+ ?: =(0 fuel) ~
11663+ =/ child=ifile interface.i.imports
11664+ ?~ graph.child ~
11665+ =/ cg=irequest-graph u.graph.child
11666+ ?. ?& =(bundle-input.g bundle-input.cg)
11667+ =(prelude-input.g prelude-input.cg)
11668+ =(prelude-values.g prelude-values.cg)
11669+ =(prelude-molds.g prelude-molds.cg)
11670+ =(externals.g externals.cg)
11671+ =(marks.g marks.cg)
11672+ ==
11673+ ~
11674+ =/ merged=(set path) (~(uni in:..zuse paths.g) paths.cg)
11675+ =/ rs=(unit (list irequest-evidence))
11676+ (request-graph-requests-add requests.cg requests.g (add 1 (lent requests.cg)))
11677+ ?~ rs ~
11678+ ?: &(?=(^ u.rs) |((gth (lent ~(tap in:..zuse merged)) 256) (gth (lent u.rs) 256))) ~
11679+ $(imports t.imports, g g(paths merged, requests u.rs), fuel (dec fuel))
11680+++ request-graph-reusable
11681+ |= [f=ifile src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) values=(list term) molds=(list term) prelude=(unit ifile)]
11682+ ^- ?
11683+ ?~ source.f |
11684+ ?. =(u.source.f src) |
11685+ ?~ graph.f |
11686+ =/ g=irequest-graph u.graph.f
11687+ ?. (request-graph-inputs-match g externals marks modules values molds prelude) |
11688+ ?. (~(has in:..zuse paths.g) at.f) |
11689+ !(lien active |=(p=path (~(has in:..zuse paths.g) p)))
11690+::
11691+++ resolve-jibb-imports
11692+ |= [imports=(list import) externals=iexternals mark-externals=imark-externals modules=jbundle active=(list path) prelude-values=(list term) prelude-molds=(list term) cache=jcache prelude=(unit ifile)]
11693+ ^- jimports-result
11694+ =/ result=jimports-detailed-result
11695+ (resolve-jibb-imports-detailed imports externals mark-externals modules active prelude-values prelude-molds cache prelude)
11696+ ?: ?=(%| -.result) [%| message.p.result]
11697+ [%& p.result]
11698+++ resolve-jibb-imports-detailed
11699+ |= [imports=(list import) externals=iexternals mark-externals=imark-externals modules=jbundle active=(list path) prelude-values=(list term) prelude-molds=(list term) cache=jcache prelude=(unit ifile)]
11700+ ^- jimports-detailed-result
11701+ ?~ imports [%& [~ cache]]
11702+ ?. ?=(%jibb -.i.imports) $(imports t.imports)
11703+ =/ at=path (weld path.i.imports `path`~[%jibb])
11704+ ?: =(at /lib/jibb/internal/jibb)
11705+ [%| ['the prelude internal module is private' ~]]
11706+ ?: =(at /lib/jibb/primitives/jibb)
11707+ [%| ['the prelude primitive interface is private' ~]]
11708+ ?: (lien active |=(p=path =(p at)))
11709+ [%| [(crip "import cycle at {(spud at)}") ~]]
11710+ =/ found=jbundle (skim modules |=(m=jsource =(at at.m)))
11711+ ?~ found [%| [(crip "module source missing: {(spud at)}") ~]]
11712+ ?^ t.found [%| [(crip "duplicate module sources: {(spud at)}") ~]]
11713+ =/ cached=(unit ifile) (find-jibb-cache at cache)
11714+ =/ iface=jfile-detailed-result
11715+ ?^ cached
11716+ ?. =(at.u.cached at) [%| ['cached module identity needs unsupported inference' ~]]
11717+ ?~ graph.u.cached
11718+ :: A detached legacy interface has unknown evidence. Rebuild it
11719+ :: against the current graph, without retaining any stale entry.
11720+ =/ clean=jcache (skim cache |=(x=[at=path iface=ifile] !=(at.x at)))
11721+ (infer-jibb-file-detailed at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds clean prelude)
11722+ ?. (request-graph-reusable u.cached source.i.found externals mark-externals modules active prelude-values prelude-molds prelude)
11723+ [%| ['cached module evidence needs unsupported inference' ~]]
11724+ [%& [u.cached cache]]
11725+ (infer-jibb-file-detailed at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds cache prelude)
11726+ ?: ?=(%| -.iface) [%| p.iface]
11727+ =/ rest=jimports-detailed-result $(imports t.imports, cache cache.p.iface)
11728+ ?: ?=(%| -.rest) rest
11729+ [%& [[[face.i.imports iface.p.iface] resolved.p.rest] cache.p.rest]]
11730+::
11731+:: Provisional declaration extraction only; this does not derive asks,
11732+:: validate imported types, or claim that an API module has checked.
11733++$ iapi-path [at=span name=term segments=(list pseg) full=term diffs=(list term) scry=(unit (list pseg))]
11734+++ api-path-mark
11735+ |= [sh=shape marks=(list term)]
11736+ ^- (unit term)
11737+ ?. ?=(%ref -.sh) ~
11738+ ?. ?=([@ ~] names.sh) ~
11739+ ?. (unique-value-name i.names.sh marks) ~
11740+ `i.names.sh
11741+::
11742+++ api-path-diffs
11743+ |= [shapes=(list shape) marks=(list term) used=(list term)]
11744+ ^- (unit (list term))
11745+ ?~ shapes `~
11746+ =/ n=(unit term) (api-path-mark i.shapes marks)
11747+ ?~ n ~
11748+ ?: (lien used |=(x=term =(x u.n))) ~
11749+ =/ rest=(unit (list term)) $(shapes t.shapes, used [u.n used])
11750+ ?~ rest ~
11751+ `[u.n u.rest]
11752+::
11753+++ api-path-payload
11754+ |= [sh=shape marks=(list term)]
11755+ ^- (unit [full=term diffs=(list term)])
11756+ =/ direct=(unit term) (api-path-mark sh marks)
11757+ ?^ direct `[u.direct ~]
11758+ ?. ?=(%apply -.sh) ~
11759+ ?. =(~[%facts] ref.sh) ~
11760+ ?~ args.sh ~
11761+ ?~ t.args.sh ~
11762+ =/ full=(unit term) (api-path-mark i.args.sh marks)
11763+ ?~ full ~
11764+ =/ diffs=(unit (list term)) (api-path-diffs t.args.sh marks ~[u.full])
11765+ ?~ diffs ~
11766+ `[u.full u.diffs]
11767+::
11768++$ iapi-parameter [name=term aura=@ta at=span]
11769+++ api-path-parameters
11770+ |= [segments=(list pseg) seen=(list term)]
11771+ ^- (unit (list iapi-parameter))
11772+ ?~ segments `~
11773+ ?: ?=(%knot -.i.segments) $(segments t.segments)
11774+ =/ seg=pseg i.segments
11775+ ?. ?=(%typed -.seg) ~
11776+ ?: =(0 aura.seg) ~
11777+ ?: (lien seen |=(n=term =(n name.seg))) ~
11778+ =/ rest=(unit (list iapi-parameter)) $(segments t.segments, seen [name.seg seen])
11779+ ?~ rest ~
11780+ `[[name.seg aura.seg at.seg] u.rest]
11781+::
11782+++ api-scry-parameters-compatible
11783+ |= [scry=(list iapi-parameter) watch=(list iapi-parameter)]
11784+ ^- ?
11785+ ?~ scry &
11786+ ?. (lien watch |=(p=iapi-parameter &(=(name.p name.i.scry) =(aura.p aura.i.scry)))) |
11787+ $(scry t.scry)
11788+::
11789+++ api-path-one
11790+ |= [sh=shape marks=(list term)]
11791+ ^- (unit iapi-path)
11792+ ?. ?=(%cell -.sh) ~
11793+ =/ fs=(list field) fields.sh
11794+ ?~ fs ~
11795+ ?~ t.fs ~
11796+ ?~ t.t.fs ~
11797+ ?: (gth (lent fs) 4) ~
11798+ ?. ?=(%bare -.i.fs) ~
11799+ =/ tag=shape shape.i.fs
11800+ ?. ?=(%const -.tag) ~
11801+ ?. =(%term form.lit.tag) ~
11802+ =/ name=term val.lit.tag
11803+ ?. (jibb-face-name name) ~
11804+ ?. ?=(%bare -.i.t.fs) ~
11805+ =/ path-shape=shape shape.i.t.fs
11806+ ?. ?=(%path -.path-shape) ~
11807+ ?. ?=(%bare -.i.t.t.fs) ~
11808+ =/ payload=(unit [full=term diffs=(list term)]) (api-path-payload shape.i.t.t.fs marks)
11809+ ?~ payload ~
11810+ =/ scry=(unit (unit (list pseg)))
11811+ ?~ t.t.t.fs `~
11812+ =/ entry=field i.t.t.t.fs
11813+ ?. ?=(%face -.entry) ~
11814+ ?. =(%scry name.entry) ~
11815+ ?. ?=(%path -.shape.entry) ~
11816+ ``segs.shape.entry
11817+ ?~ scry ~
11818+ =/ params=(unit (list iapi-parameter)) (api-path-parameters segs.path-shape ~)
11819+ ?~ params ~
11820+ ?^ u.scry
11821+ =/ scry-params=(unit (list iapi-parameter)) (api-path-parameters u.u.scry ~)
11822+ ?~ scry-params ~
11823+ ?. (api-scry-parameters-compatible u.scry-params u.params) ~
11824+ `[at.sh name segs.path-shape full.u.payload diffs.u.payload u.scry]
11825+ `[at.sh name segs.path-shape full.u.payload diffs.u.payload u.scry]
11826+::
11827+++ api-path-many
11828+ |= [shapes=(list shape) marks=(list term) seen=(list term)]
11829+ ^- (unit (list iapi-path))
11830+ ?~ shapes `~
11831+ =/ one=(unit iapi-path) (api-path-one i.shapes marks)
11832+ ?~ one ~
11833+ ?: (lien seen |=(n=term =(n name.u.one))) ~
11834+ =/ rest=(unit (list iapi-path)) $(shapes t.shapes, seen [name.u.one seen])
11835+ ?~ rest ~
11836+ `[u.one u.rest]
11837+::
11838+++ api-path-declaration
11839+ |= [sh=shape marks=(list term)]
11840+ ^- (unit (list iapi-path))
11841+ ?: ?=(%union -.sh) (api-path-many cases.sh marks ~)
11842+ (api-path-many ~[sh] marks ~)
11843+::
11844+:: Derived gates share the value namespace. /% marks name molds; /- and
11845+:: /= also introduce faces that cannot be shadowed by a derived value.
11846+++ api-import-faces
11847+ |= imports=(list import)
11848+ ^- (list term)
11849+ ?~ imports ~
11850+ ?- -.i.imports
11851+ %mark $(imports t.imports)
11852+ %sur [name.i.imports $(imports t.imports)]
11853+ %jibb [face.i.imports $(imports t.imports)]
11854+ ==
11855+::
11856+++ api-derived-names-valid
11857+ |= [paths=(list iapi-path) poke-names=(list term) mod=module prelude-values=(list term)]
11858+ ^- ?
11859+ =/ path-names=(list term) (turn paths |=(p=iapi-path name.p))
11860+ =/ derived=(list term) (weld path-names poke-names)
11861+ ?: (lien derived |=(n=term =(n %proj))) |
11862+ =/ outer=(list term) (weld prelude-values (weld (global-value-names defs.mod) (api-import-faces imports.mod)))
11863+ (levy derived |=(n=term &((unique-value-name n derived) !(lien outer |=(x=term =(n x))))))
11864+::
11865+:: Analysis only. Successful external entries must be unchanged results
11866+:: produced for the declared marks; no request interface is produced.
11867++$ iapi-mark-type [name=term typ=itype]
11868++$ iapi-path-typed [path=iapi-path full=itype diffs=(list iapi-mark-type)]
11869+++ api-diff-types
11870+ |= [names=(list term) externals=imark-externals declared=(list term)]
11871+ ^- (unit (list iapi-mark-type))
11872+ ?~ names `~
11873+ =/ typ=(unit itype) (find-imported-mark i.names externals declared)
11874+ ?~ typ ~
11875+ =/ tail=(unit (list iapi-mark-type)) $(names t.names)
11876+ ?~ tail ~
11877+ `[[i.names u.typ] u.tail]
11878+::
11879+++ api-path-types
11880+ |= [paths=(list iapi-path) externals=imark-externals declared=(list term)]
11881+ ^- (unit (list iapi-path-typed))
11882+ ?~ paths `~
11883+ =/ full=(unit itype) (find-imported-mark full.i.paths externals declared)
11884+ ?~ full ~
11885+ =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared)
11886+ ?~ diffs ~
11887+ =/ tail=(unit (list iapi-path-typed)) $(paths t.paths)
11888+ ?~ tail ~
11889+ `[[i.paths u.full u.diffs] u.tail]
11890+::
11891+++ api-poke-mark-names
11892+ |= [pokes=(list def) declared=(list term)]
11893+ ^- (unit (list term))
11894+ ?~ pokes `~
11895+ ?^ t.pokes ~
11896+ =/ d=def i.pokes
11897+ ?. ?=(%mold -.d) ~
11898+ =/ sh=shape shape.d
11899+ ?: ?=(%union -.sh) (api-path-diffs cases.sh declared ~)
11900+ =/ name=(unit term) (api-path-mark sh declared)
11901+ ?~ name ~
11902+ `~[u.name]
11903+::
11904+++ api-path-analysis
11905+ |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term)]
11906+ ^- (unit (list iapi-path-typed))
11907+ ?: (lien defs.mod def-has-hole) ~
11908+ ?^ (duplicate-defs defs.mod) ~
11909+ =/ ds=(list def) defs.mod
11910+ =/ declarations=(list def)
11911+ (skim ds |=(d=def &(?=(%mold -.d) =(%paths name.d))))
11912+ ?. ?=([* ~] declarations) ~
11913+ =/ pokes=(list def)
11914+ (skim ds |=(d=def &(?=(%mold -.d) =(%poke name.d))))
11915+ ?: (gth (lent pokes) 1) ~
11916+ =/ ordinary=(list def)
11917+ (skim ds |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
11918+ ?. (module-scope-valid mod(defs ordinary) prelude-values prelude-molds) ~
11919+ =/ declared=(list term) (collect-mark-imports imports.mod)
11920+ =/ poke-names=(unit (list term)) (api-poke-mark-names pokes declared)
11921+ ?~ poke-names ~
11922+ =/ decl=def i.declarations
11923+ ?> ?=(%mold -.decl)
11924+ =/ paths=(unit (list iapi-path)) (api-path-declaration shape.decl declared)
11925+ ?~ paths ~
11926+ ?. (api-derived-names-valid u.paths u.poke-names mod prelude-values) ~
11927+ (api-path-types u.paths externals declared)
11928+::
11929+:: Source/graph entry for path analysis only. The returned paths retain
11930+:: reader-derived mark types and import resolution has checked reachable
11931+:: Jibb dependencies. This is not an API interface or a module check.
11932+++ api-path-analysis-source
11933+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
11934+ ^- (each (list iapi-path-typed) @t)
11935+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path analysis requires /ui/api/<agent>.jibb']
11936+ =/ parsed (parse file src)
11937+ ?: ?=(%| -.parsed) [%| 'API path source does not parse']
11938+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
11939+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
11940+ ?~ prepared [%| 'API path analysis needs the prepared prelude']
11941+ =/ prelude=(unit ifile) `iface.u.prepared
11942+ =/ deps=jimports-result
11943+ (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ prelude)
11944+ ?: ?=(%| -.deps) [%| p.deps]
11945+ =/ paths=(unit (list iapi-path-typed))
11946+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
11947+ ?~ paths [%| 'API path declaration needs unsupported analysis']
11948+ [%& u.paths]
11949+::
11950+:: Analysis evidence retains the API source, the prepared interface, the
11951+:: caller's reader results and the resolved Jibb dependency cache alongside
11952+:: the typed path declarations. Reader results and prepared interfaces are
11953+:: trusted inputs: this does not verify their underlying Hoon source/version,
11954+:: create requests or check the provenance of arbitrary values.
11955++$ iapi-path-evidence
11956+ [at=path source=@t prepared=iprelude externals=iexternals marks=imark-externals dependencies=jcache paths=(list iapi-path-typed)]
11957+++ api-path-evidence-source
11958+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
11959+ ^- (each iapi-path-evidence @t)
11960+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path evidence requires /ui/api/<agent>.jibb']
11961+ =/ parsed (parse file src)
11962+ ?: ?=(%| -.parsed) [%| 'API path evidence source does not parse']
11963+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
11964+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
11965+ ?~ prepared [%| 'API path evidence needs the prepared prelude']
11966+ =/ public=ifile iface.u.prepared
11967+ =/ deps=jimports-result
11968+ (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
11969+ ?: ?=(%| -.deps) [%| p.deps]
11970+ =/ paths=(unit (list iapi-path-typed))
11971+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
11972+ ?~ paths [%| 'API path declaration needs unsupported analysis']
11973+ [%& [file src u.prepared externals marks cache.p.deps u.paths]]
11974+:: Graph-aware variant preserves the caller active stack and cache.
11975+++ api-path-evidence-graph
11976+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
11977+ ^- (each iapi-path-evidence @t)
11978+ ?~ active [%| 'API analysis needs an active graph']
11979+ ?. =(i.active file) [%| 'API analysis active graph does not start at the source']
11980+ ?: (lien t.active |=(p=path =(p file))) [%| 'API analysis active graph contains a cycle']
11981+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path evidence requires /ui/api/<agent>.jibb']
11982+ =/ parsed (parse file src)
11983+ ?: ?=(%| -.parsed) [%| 'API path evidence source does not parse']
11984+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
11985+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
11986+ ?~ prepared [%| 'API path evidence needs the prepared prelude']
11987+ =/ public=ifile iface.u.prepared
11988+ =/ deps=jimports-result
11989+ (resolve-jibb-imports imports.p.parsed externals marks modules active values.u.prepared molds.u.prepared cache `public)
11990+ ?: ?=(%| -.deps) [%| p.deps]
11991+ =/ paths=(unit (list iapi-path-typed))
11992+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
11993+ ?~ paths [%| 'API path declaration needs unsupported analysis']
11994+ [%& [file src u.prepared externals marks cache.p.deps u.paths]]
11995+::
11996+:: This query classifies a unique path declaration only. Missing evidence
11997+:: or a nonunique name is unknown; it proves nothing about an ask value.
11998+:: Like prepared interfaces, the supplied evidence is a trusted host input.
11999+++ api-path-watchability
12000+ |= [evidence=(unit iapi-path-evidence) case-name=term]
12001+ ^- ?(%watchable %not-watchable %unknown)
12002+ ?~ evidence %unknown
12003+ =/ found=(list iapi-path-typed)
12004+ (skim paths.u.evidence |=(p=iapi-path-typed =(name.path.p case-name)))
12005+ ?. ?=([* ~] found) %unknown
12006+ ?~ scry.path.i.found %watchable
12007+ %not-watchable
12008+::
12009+:: These are declaration-derived request components, not a callable gate,
12010+:: an ask value, or proof of a value's provenance. Keep the exact trusted
12011+:: source/reader evidence until a later checked interface and lowerer can
12012+:: attach it to a generated request. No argument ordering is claimed here.
12013++$ iapi-request-parameter [name=term typ=itype at=span]
12014++$ iapi-request-parts
12015+ [evidence=iapi-path-evidence path=iapi-path-typed parameters=(list iapi-request-parameter) reply-sample=itype fold=(unit itype) watchability=?(%watchable %not-watchable)]
12016+++ api-request-parameter-types
12017+ |= params=(list iapi-parameter)
12018+ ^- (unit (list iapi-request-parameter))
12019+ ?~ params `~
12020+ =/ aura=@ta aura.i.params
12021+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
12022+ =/ rest=(unit (list iapi-request-parameter)) $(params t.params)
12023+ ?~ rest ~
12024+ `[[name.i.params [%atom aura] at.i.params] u.rest]
12025+::
12026+:: A single diff's fold consumes the tagged diff and the previous full value.
12027+:: Multiple-diff unions need a checked union representation and remain open.
12028+++ api-request-fold-type
12029+ |= p=iapi-path-typed
12030+ ^- (unit (unit itype))
12031+ ?~ diffs.p `~
12032+ ?^ t.diffs.p ~
12033+ =/ d=iapi-mark-type i.diffs.p
12034+ =/ literal=lit [%term %tas name.d (crip ['%' (trip name.d)])]
12035+ =/ sample=itype [%cell [%cell [%const literal] typ.d] full.p]
12036+ ``[%fn sample full.p]
12037+::
12038+++ api-request-parts
12039+ |= [evidence=(unit iapi-path-evidence) case-name=term]
12040+ ^- (unit iapi-request-parts)
12041+ ?~ evidence ~
12042+ =/ found=(list iapi-path-typed)
12043+ (skim paths.u.evidence |=(p=iapi-path-typed =(name.path.p case-name)))
12044+ ?. ?=([* ~] found) ~
12045+ =/ p=iapi-path-typed i.found
12046+ =/ raw=(unit (list iapi-parameter)) (api-path-parameters segments.path.p ~)
12047+ ?~ raw ~
12048+ =/ params=(unit (list iapi-request-parameter)) (api-request-parameter-types u.raw)
12049+ ?~ params ~
12050+ =/ fold=(unit (unit itype)) (api-request-fold-type p)
12051+ ?~ fold ~
12052+ =/ watch=?(%watchable %not-watchable) ?~(scry.path.p %watchable %not-watchable)
12053+ `[u.evidence p u.params full.p u.fold watch]
12054+::
12055+:: Check ordinary API molds and values plus every declared mark type using
12056+:: the same trusted source, prepared prelude and reader inputs as path
12057+:: evidence. Keep elaborations with those inputs for a later interface.
12058+:: This is partial analysis: an unused /- core is not independently checked,
12059+:: definitions needing derived values remain unsupported, and no complete
12060+:: API, request or constructor is exported or given runtime behavior.
12061++$ iapi-support-evidence
12062+ [paths=iapi-path-evidence values=ienv molds=imold-types marks=(list iapi-mark-type) elaborations=(list iwidth-definition)]
12063+++ api-support-analysis-source
12064+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12065+ ^- (each iapi-support-evidence @t)
12066+ =/ path-result (api-path-evidence-source file src externals marks modules prepared)
12067+ ?: ?=(%| -.path-result) [%| p.path-result]
12068+ =/ evidence=iapi-path-evidence p.path-result
12069+ =/ parsed (parse file src)
12070+ ?: ?=(%| -.parsed) [%| 'API source does not parse']
12071+ =/ mod=module p.parsed
12072+ =/ ordinary=(list def)
12073+ (skim defs.mod |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12074+ =/ prep=iprelude prepared.evidence
12075+ ?. (module-scope-valid mod(defs ordinary) values.prep molds.prep) [%| 'API ordinary scope needs unsupported inference']
12076+ =/ vals=(list term) (global-value-names ordinary)
12077+ ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12078+ =/ declared=(list term) (collect-mark-imports imports.mod)
12079+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12080+ ?~ mark-types [%| 'API declared marks need unsupported inference']
12081+ =/ prelude=(unit ifile) `iface.prep
12082+ =/ deps=jimports-result
12083+ (resolve-jibb-imports imports.mod externals marks modules ~[file] values.prep molds.prep dependencies.evidence prelude)
12084+ ?: ?=(%| -.deps) [%| p.deps]
12085+ =/ molds=imolds (collect-simple-molds ordinary)
12086+ =/ globals=(list term) (weld values.prep (weld (import-binding-names imports.mod) vals))
12087+ =/ surs=(list term) (collect-sur-imports imports.mod)
12088+ =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
12089+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12090+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12091+ =/ mts=(each imold-types @t) (module-mold-types molds state)
12092+ ?: ?=(%| -.mts) [%| p.mts]
12093+ =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
12094+ ?. (module-values-complete ordinary env.resolution) [%| 'API ordinary definitions need unsupported inference']
12095+ [%& [evidence env.resolution p.mts u.mark-types artifacts.resolution]]
12096+:: Preserve the same graph context through supporting definitions.
12097+++ api-support-analysis-graph
12098+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12099+ ^- (each iapi-support-evidence @t)
12100+ =/ path-result (api-path-evidence-graph file src externals marks modules active cache prepared)
12101+ ?: ?=(%| -.path-result) [%| p.path-result]
12102+ =/ evidence=iapi-path-evidence p.path-result
12103+ =/ parsed (parse file src)
12104+ ?: ?=(%| -.parsed) [%| 'API source does not parse']
12105+ =/ mod=module p.parsed
12106+ =/ ordinary=(list def)
12107+ (skim defs.mod |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12108+ =/ prep=iprelude prepared.evidence
12109+ ?. (module-scope-valid mod(defs ordinary) values.prep molds.prep) [%| 'API ordinary scope needs unsupported inference']
12110+ =/ vals=(list term) (global-value-names ordinary)
12111+ ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12112+ =/ declared=(list term) (collect-mark-imports imports.mod)
12113+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12114+ ?~ mark-types [%| 'API declared marks need unsupported inference']
12115+ =/ prelude=(unit ifile) `iface.prep
12116+ =/ deps=jimports-result
12117+ (resolve-jibb-imports imports.mod externals marks modules active values.prep molds.prep dependencies.evidence prelude)
12118+ ?: ?=(%| -.deps) [%| p.deps]
12119+ =/ molds=imolds (collect-simple-molds ordinary)
12120+ =/ globals=(list term) (weld values.prep (weld (import-binding-names imports.mod) vals))
12121+ =/ surs=(list term) (collect-sur-imports imports.mod)
12122+ =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
12123+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12124+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12125+ =/ mts=(each imold-types @t) (module-mold-types molds state)
12126+ ?: ?=(%| -.mts) [%| p.mts]
12127+ =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
12128+ ?. (module-values-complete ordinary env.resolution) [%| 'API ordinary definitions need unsupported inference']
12129+ [%& [evidence env.resolution p.mts u.mark-types artifacts.resolution]]
12130+::
12131+:: Type-analysis artifact for one plain request. The resolver may publish
12132+:: its interface only together with trusted source and reader evidence.
12133+:: No lowering or runtime validator exists.
12134+:: Value watchability remains unproved even for a watchable declaration.
12135++$ ione-request-interface
12136+ [support=iapi-support-evidence parts=iapi-request-parts iface=ifile]
12137+++ request-compatible-ask
12138+ |= prelude=iprelude
12139+ ^- (unit ischeme)
12140+ =/ public=ifile iface.prelude
12141+ ?. =(at.public /lib/jibb/prelude/jibb) ~
12142+ =/ ask=(unit ischeme) (find-jibb-mold %ask public)
12143+ ?~ ask ~
12144+ ?. ?=([@ ~] vars.u.ask) ~
12145+ ?. ?=(%union -.typ.u.ask) ~
12146+ ?. =(origin.typ.u.ask `[/lib/jibb/internal/jibb %ask]) ~
12147+ ?. (identity-union-parameters vars.u.ask args.typ.u.ask) ~
12148+ =/ m=@ud i.vars.u.ask
12149+ ?: (itype-var-is-atom m typ.u.ask) ~
12150+ ?. (levy (itype-vars typ.u.ask) |=(n=@ud =(n m))) ~
12151+ ?: (itype-has-tag typ.u.ask) ~
12152+ =/ private=(list iwidth-dependency)
12153+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12154+ ?. ?=([* ~] private) ~
12155+ ?~ source.i.private ~
12156+ =/ path=(unit ischeme) (find-jibb-mold %path public)
12157+ ?~ path ~
12158+ ?^ vars.u.path ~
12159+ =/ path-type=itype [%collection %list ~[[%atom %ta]]]
12160+ ?. =(typ.u.path path-type) ~
12161+ =/ unit-template=(unit ischeme) (find-jibb-mold %unit public)
12162+ ?~ unit-template ~
12163+ ?. (standard-unit-template u.unit-template /lib/jibb/prelude/jibb) ~
12164+ =/ state-unit=(unit itype) (template-apply u.unit-template ~[[%noun ~]])
12165+ ?~ state-unit ~
12166+ =/ path-unit=(unit itype) (template-apply u.unit-template ~[path-type])
12167+ ?~ path-unit ~
12168+ =/ output=itype [%cell [%face %state [%noun ~]] [%face %message [%var m]]]
12169+ =/ agent-input=itype [%cell [%face %mark [%atom %tas]] [%cell [%face %state u.state-unit] [%face %fact [%noun ~]]]]
12170+ =/ store-input=itype [%cell [%face %state u.state-unit] [%face %fact [%noun ~]]]
12171+ =/ pure-case=itype [%cell [%const [%term %tas %pure '%pure']] [%face %value [%var m]]]
12172+ =/ agent-case=itype
12173+ [%cell [%const [%term %tas %agent '%agent']] [%cell [%face %api [%atom %t]] [%cell [%face %case [%atom %tas]] [%cell [%face %agent [%atom %tas]] [%cell [%face %path path-type] [%cell [%face %scry u.path-unit] [%face %receive [%fn agent-input output]]]]]]]]
12174+ =/ store-case=itype
12175+ [%cell [%const [%term %tas %store '%store']] [%cell [%face %module [%atom %t]] [%cell [%face %name [%atom %tas]] [%face %receive [%fn store-input output]]]]]
12176+ ?. =(cases.typ.u.ask ~[pure-case agent-case store-case]) ~
12177+ ask
12178+::
12179+:: The first supported standalone API has exactly one mark import and one
12180+:: plain path declaration, with no other definitions or imports. No partial
12181+:: success is published when source, schema, or a required mold is unknown.
12182+++ one-request-interface-source
12183+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12184+ ^- (each ione-request-interface @t)
12185+ =/ out (api-support-analysis-source file src externals marks modules prepared)
12186+ ?: ?=(%| -.out) [%| p.out]
12187+ =/ support=iapi-support-evidence p.out
12188+ =/ ev=iapi-path-evidence paths.support
12189+ =/ parsed (parse file src)
12190+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12191+ =/ mod=module p.parsed
12192+ ?. ?=(?([[%mark *] ~] [[%mark *] [%mark *] ~]) imports.mod) [%| 'request imports need unsupported inference']
12193+ ?. ?=([[%mold *] ~] defs.mod) [%| 'request definitions need unsupported inference']
12194+ ?. =(%paths name.i.defs.mod) [%| 'request declaration needs unsupported inference']
12195+ ?. ?=([* ~] paths.ev) [%| 'request count needs unsupported inference']
12196+ =/ p=iapi-path-typed i.paths.ev
12197+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12198+ ?~ parts [%| 'request components need unsupported inference']
12199+ ?. ?=(?(~ [* ~]) parameters.u.parts) [%| 'request parameters need unsupported inference']
12200+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) [%| 'request parameter and fold need unsupported inference']
12201+ ?^ scry.path.p [%| 'request scry needs unsupported inference']
12202+ =/ valid-marks=?
12203+ ?~ fold.u.parts ?=([* ~] marks.support)
12204+ ?=([* [* ~]] marks.support)
12205+ ?. valid-marks [%| 'request marks need unsupported inference']
12206+ =/ fold-open=?
12207+ ?~ fold.u.parts |
12208+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12209+ ?: fold-open [%| 'request fold needs unsupported inference']
12210+ ?^ (itype-vars reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12211+ ?: (itype-has-tag reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12212+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12213+ ?~ ask [%| 'request ask needs unsupported inference']
12214+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
12215+ ?~ result [%| 'request ask needs unsupported inference']
12216+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12217+ =/ sample=itype
12218+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12219+ ?~ parameters.u.parts callback
12220+ [%cell typ.i.parameters.u.parts callback]
12221+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12222+ =/ exports=imold-types
12223+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12224+ =/ prelude=iprelude prepared.ev
12225+ =/ public=ifile iface.prelude
12226+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12227+ =/ private=(list iwidth-dependency)
12228+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12229+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12230+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12231+ =/ req=irequest-evidence
12232+ [file name.path.p p src u.source.public u.source.i.private values.prelude molds.prelude externals marks]
12233+ =/ interface=ifile [~[[name.path.p scheme]] exports file ~ ~ ~ `src `[(silt `(list path)`~[file]) ~[req] modules `public values.prelude molds.prelude externals marks]]
12234+ [%& [support u.parts interface]]
12235+:: Graph-aware request artifact; resolver use remains type-only.
12236+++ one-request-interface-graph
12237+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12238+ ^- (each ione-request-interface @t)
12239+ =/ out (api-support-analysis-graph file src externals marks modules active cache prepared)
12240+ ?: ?=(%| -.out) [%| p.out]
12241+ =/ support=iapi-support-evidence p.out
12242+ =/ ev=iapi-path-evidence paths.support
12243+ =/ parsed (parse file src)
12244+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12245+ =/ mod=module p.parsed
12246+ ?. ?=(?([[%mark *] ~] [[%mark *] [%mark *] ~]) imports.mod) [%| 'request imports need unsupported inference']
12247+ ?. ?=([[%mold *] ~] defs.mod) [%| 'request definitions need unsupported inference']
12248+ ?. =(%paths name.i.defs.mod) [%| 'request declaration needs unsupported inference']
12249+ ?. ?=([* ~] paths.ev) [%| 'request count needs unsupported inference']
12250+ =/ p=iapi-path-typed i.paths.ev
12251+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12252+ ?~ parts [%| 'request components need unsupported inference']
12253+ ?. ?=(?(~ [* ~]) parameters.u.parts) [%| 'request parameters need unsupported inference']
12254+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) [%| 'request parameter and fold need unsupported inference']
12255+ ?^ scry.path.p [%| 'request scry needs unsupported inference']
12256+ =/ valid-marks=?
12257+ ?~ fold.u.parts ?=([* ~] marks.support)
12258+ ?=([* [* ~]] marks.support)
12259+ ?. valid-marks [%| 'request marks need unsupported inference']
12260+ =/ fold-open=?
12261+ ?~ fold.u.parts |
12262+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12263+ ?: fold-open [%| 'request fold needs unsupported inference']
12264+ ?^ (itype-vars reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12265+ ?: (itype-has-tag reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12266+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12267+ ?~ ask [%| 'request ask needs unsupported inference']
12268+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
12269+ ?~ result [%| 'request ask needs unsupported inference']
12270+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12271+ =/ sample=itype
12272+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12273+ ?~ parameters.u.parts callback
12274+ [%cell typ.i.parameters.u.parts callback]
12275+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12276+ =/ exports=imold-types
12277+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12278+ =/ prelude=iprelude prepared.ev
12279+ =/ public=ifile iface.prelude
12280+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12281+ =/ private=(list iwidth-dependency)
12282+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12283+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12284+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12285+ =/ req=irequest-evidence
12286+ [file name.path.p p src u.source.public u.source.i.private values.prelude molds.prelude externals marks]
12287+ =/ interface=ifile [~[[name.path.p scheme]] exports file ~ ~ ~ `src `[(silt `(list path)`~[file]) ~[req] modules `public values.prelude molds.prelude externals marks]]
12288+ [%& [support u.parts interface]]
12289+::
12290+++ api-mark-exports
12291+ |= [marks=(list term) all=(list term) externals=imark-externals]
12292+ ^- imold-types
12293+ ?~ marks ~
12294+ =/ t=(unit itype) (find-imported-mark i.marks externals all)
12295+ ?~ t $(marks t.marks)
12296+ [[i.marks [u.t ~]] $(marks t.marks)]
12297+::
12298+:: Experimental direct poke-only API. Unsupported API declarations fail
12299+:: as a whole; supplied mark reader results retain their existing boundary.
12300+++ api-poke-interface
12301+ |= [at=path mod=module mark-externals=imark-externals prelude-values=(list term) prelude-molds=(list term) prelude=(unit ifile)]
12302+ ^- (unit ifile)
12303+ ?: (lien defs.mod def-has-hole) ~
12304+ ?. ?=([%ui %api @ %jibb ~] at) ~
12305+ ?^ (duplicate-defs defs.mod) ~
12306+ ?~ prelude ~
12307+ ?. =(at.u.prelude /lib/jibb/prelude/jibb) ~
12308+ =/ poke=(unit ischeme) (find-jibb-mold %poke u.prelude)
12309+ ?~ poke ~
12310+ ?. ?=(%union -.typ.u.poke) ~
12311+ ?^ vars.u.poke ~
12312+ =/ compatible=?
12313+ %+ lien cases.typ.u.poke
12314+ |= c=itype
12315+ ?=([%cell [%const [%term %tas %agent *]] [%cell [%face %agent [%atom %tas]] [%cell [%face %mark [%atom %tas]] [%face %payload [%noun ~]]]]] c)
12316+ ?. compatible ~
12317+ ?. (module-scope-valid mod(defs ~) prelude-values prelude-molds) ~
12318+ ?. (levy imports.mod |=(i=import ?=(%mark -.i))) ~
12319+ =/ marks=(list term) (collect-mark-imports imports.mod)
12320+ ?. ?=([@ ~] marks) ~
12321+ =/ ds=(list def) defs.mod
12322+ ?. ?=([[%mold *] ~] ds) ~
12323+ ?. =(%poke name.i.ds) ~
12324+ =/ sh=shape shape.i.ds
12325+ ?. ?=([%ref *] sh) ~
12326+ ?. ?=([@ ~] names.sh) ~
12327+ =/ n=term i.names.sh
12328+ ?. (unique-value-name n marks) ~
12329+ ?: |((lien prelude-values |=(x=term =(n x))) (lien prelude-molds |=(x=term =(n x)))) ~
12330+ =/ mark=(unit itype) (find-imported-mark n mark-externals marks)
12331+ ?~ mark ~
12332+ =/ sc=ischeme [[%fn u.mark typ.u.poke] ~]
12333+ `[~[[n sc]] (api-mark-exports marks marks mark-externals) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
12334+::
12335+:: Source-proven ordinary helpers validate each selected /sur dependency.
12336+:: Unused or less direct cores remain unsupported by this first interface.
12337+++ api-sur-covered
12338+ |= [surs=(list term) defs=(list def) externals=iexternals all=(list term)]
12339+ ^- ?
12340+ ?~ surs &
12341+ =/ found=(list def)
12342+ %+ skim defs
12343+ |= d=def
12344+ ?. ?=(%mold -.d) |
12345+ ?. ?=(%ref -.shape.d) |
12346+ ?. ?=([@ [@ ~]] names.shape.d) |
12347+ =(i.t.names.shape.d i.surs)
12348+ ?~ found |
12349+ =/ selected=def i.found
12350+ ?. ?=(%mold -.selected) |
12351+ =/ sh=shape shape.selected
12352+ ?. ?=(%ref -.sh) |
12353+ ?. ?=([@ [@ ~]] names.sh) |
12354+ =/ checked=(unit itype) (find-imported-mold i.surs i.names.sh externals all)
12355+ ?~ checked |
12356+ $(surs t.surs)
12357+::
12358++$ imulti-request-gates [values=ienv requests=(list irequest-evidence)]
12359+++ api-request-gates
12360+ |= [paths=(list iapi-path-typed) ev=iapi-path-evidence ask=ischeme file=path src=@t public=@t internal=@t externals=iexternals marks=imark-externals fuel=@ud]
12361+ ^- (unit imulti-request-gates)
12362+ ?~ paths `[~ ~]
12363+ ?: =(0 fuel) ~
12364+ =/ p=iapi-path-typed i.paths
12365+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12366+ ?~ parts ~
12367+ ?. ?=(?(~ [* ~]) parameters.u.parts) ~
12368+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) ~
12369+ ?^ scry.path.p ~
12370+ ?^ (itype-vars reply-sample.u.parts) ~
12371+ ?: (itype-has-tag reply-sample.u.parts) ~
12372+ =/ open-fold=?
12373+ ?~ fold.u.parts |
12374+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12375+ ?: open-fold ~
12376+ =/ result=(unit itype) (template-apply ask ~[[%var 0]])
12377+ ?~ result ~
12378+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12379+ =/ sample=itype
12380+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12381+ ?~ parameters.u.parts callback
12382+ [%cell typ.i.parameters.u.parts callback]
12383+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12384+ =/ prep=iprelude prepared.ev
12385+ =/ req=irequest-evidence
12386+ [file name.path.p p src public internal values.prep molds.prep externals marks]
12387+ =/ rest=(unit imulti-request-gates)
12388+ $(paths t.paths, fuel (dec fuel))
12389+ ?~ rest ~
12390+ `[[[name.path.p scheme] values.u.rest] [req requests.u.rest]]
12391+::
12392+++ api-poke-from-checked
12393+ |= [file=path mod=module marks=imark-externals values=(list term) molds=(list term) prelude=(unit ifile)]
12394+ ^- (unit [values=ienv derived=(list iderived)])
12395+ =/ pokes=(list def)
12396+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(%poke name.d))))
12397+ ?~ pokes `[~ ~]
12398+ ?. ?=([* ~] pokes) ~
12399+ =/ declared=(list term) (collect-mark-imports imports.mod)
12400+ =/ ns=(unit (list term)) (api-poke-mark-names pokes declared)
12401+ ?~ ns ~
12402+ ?. ?=([@ ~] u.ns) ~
12403+ =/ matching=(list import)
12404+ %+ skim imports.mod
12405+ |= i=import
12406+ ?. ?=(%mark -.i) |
12407+ =(mark.i i.u.ns)
12408+ ?. ?=([* ~] matching) ~
12409+ =/ checked=(unit ifile)
12410+ (api-poke-interface file mod(defs pokes, imports matching) marks values molds prelude)
12411+ ?~ checked ~
12412+ `[values.u.checked derived.u.checked]
12413+::
12414+:: The partial interface is published atomically: all paths, ordinary
12415+:: source definitions, declared marks and the poke must check. Unselected
12416+:: /sur bindings, runtime validation and value watchability remain unproved.
12417+++ multi-request-interface-graph
12418+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12419+ ^- (each [iface=ifile cache=jcache] @t)
12420+ =/ out (api-support-analysis-graph file src externals marks modules active cache prepared)
12421+ ?: ?=(%| -.out) [%| p.out]
12422+ =/ support=iapi-support-evidence p.out
12423+ =/ ev=iapi-path-evidence paths.support
12424+ =/ parsed (parse file src)
12425+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12426+ =/ mod=module p.parsed
12427+ ?. (levy imports.mod |=(i=import ?=(?(%mark %sur) -.i)))
12428+ [%| 'request imports need unsupported inference']
12429+ =/ surs=(list term) (collect-sur-imports imports.mod)
12430+ ?. (api-sur-covered surs defs.mod externals surs)
12431+ [%| 'API source dependency needs unsupported inference']
12432+ ?~ paths.ev [%| 'request count needs unsupported inference']
12433+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12434+ ?~ ask [%| 'request ask needs unsupported inference']
12435+ =/ prep=iprelude prepared.ev
12436+ =/ public=ifile iface.prep
12437+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12438+ =/ private=(list iwidth-dependency)
12439+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12440+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12441+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12442+ =/ gates=(unit imulti-request-gates)
12443+ (api-request-gates paths.ev ev u.ask file src u.source.public u.source.i.private externals marks 256)
12444+ ?~ gates [%| 'request paths need unsupported inference']
12445+ =/ poke=(unit [values=ienv derived=(list iderived)])
12446+ (api-poke-from-checked file mod marks values.prep molds.prep `public)
12447+ ?~ poke [%| 'API poke needs unsupported inference']
12448+ =/ mark-molds=imold-types
12449+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12450+ =/ exports=imold-types (weld mark-molds molds.support)
12451+ =/ names=(list term) (turn exports |=(m=[name=term template=ischeme] name.m))
12452+ ?. (levy names |=(n=term (unique-value-name n names)))
12453+ [%| 'API exported molds need unsupported inference']
12454+ =/ env=ienv (weld values.u.gates (weld values.u.poke values.support))
12455+ =/ graph=irequest-graph
12456+ [(silt `(list path)`~[file]) requests.u.gates modules `public values.prep molds.prep externals marks]
12457+ =/ iface=ifile
12458+ [env exports file derived.u.poke elaborations.support ~ `src `graph]
12459+ [%& [iface dependencies.ev]]
12460+::
12461+:: A checked program main is only the direct four-component source call.
12462+:: Grouping is transparent, but aliases, qualified wings and other module
12463+:: kinds remain outside this slice.
12464+++ program-main-def
12465+ |= ds=(list def)
12466+ ^- (unit def)
12467+ ?~ ds ~
12468+ ?: &(?=(%value -.i.ds) =(%main name.i.ds)) `i.ds
12469+ $(ds t.ds)
12470+::
12471+++ program-main-wing
12472+ |= e=expr
12473+ ^- (unit term)
12474+ ?: ?=(%group -.e) $(e inner.e)
12475+ ?. ?=(%wing -.e) ~
12476+ ?. ?=([@ ~] names.e) ~
12477+ `i.names.e
12478+::
12479+++ program-main-args
12480+ |= d=def
12481+ ^- (unit (list expr))
12482+ ?. ?=(%value -.d) ~
12483+ |-
12484+ ?: ?=(%group -.val.d) $(val.d inner.val.d)
12485+ ?. ?=(%call -.val.d) ~
12486+ =/ head=(unit term) (program-main-wing head.val.d)
12487+ ?~ head ~
12488+ ?. =(%program u.head) ~
12489+ ?. ?=([* * * * ~] args.val.d) ~
12490+ `args.val.d
12491+::
12492+++ program-main-parts
12493+ |= d=def
12494+ ^- (unit [init=term update=term view=term subs=term])
12495+ ?. ?=(%value -.d) ~
12496+ |-
12497+ ?: ?=(%group -.val.d) $(val.d inner.val.d)
12498+ ?. ?=(%call -.val.d) ~
12499+ =/ head=(unit term) (program-main-wing head.val.d)
12500+ ?~ head ~
12501+ ?. =(%program u.head) ~
12502+ ?. ?=([* * * * ~] args.val.d) ~
12503+ =/ args=(list expr) args.val.d
12504+ ?> ?=([* * * * ~] args)
12505+ =/ init=(unit term) (program-main-wing i.args)
12506+ =/ update=(unit term) (program-main-wing i.t.args)
12507+ =/ view=(unit term) (program-main-wing i.t.t.args)
12508+ =/ subs=(unit term) (program-main-wing i.t.t.t.args)
12509+ ?~ init ~
12510+ ?~ update ~
12511+ ?~ view ~
12512+ ?~ subs ~
12513+ `[u.init u.update u.view u.subs]
12514+::
12515+++ program-empty-null
12516+ |= e=expr
12517+ ^- ?
12518+ ?- -.e
12519+ %lit =(%null form.lit.e)
12520+ %cast $(e val.e)
12521+ %group $(e inner.e)
12522+ %body ?~(defs.e $(e final.e) |)
12523+ * |
12524+ ==
12525+::
12526+++ program-subs-empty
12527+ |= d=def
12528+ ^- ?
12529+ ?. ?=(%value -.d) |
12530+ ?- -.val.d
12531+ %gate (program-empty-null body.val.d)
12532+ %gate-wide (program-empty-null body.val.d)
12533+ * |
12534+ ==
12535+::
12536+++ program-transparent
12537+ |= e=expr
12538+ ^- expr
12539+ ?- -.e
12540+ %group $(e inner.e)
12541+ %cast $(e val.e)
12542+ %body ?~(defs.e $(e final.e) e)
12543+ * e
12544+ ==
12545+++ program-init-tuple-null
12546+ |= d=def
12547+ ^- ?
12548+ ?. ?=(%value -.d) |
12549+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) |
12550+ =/ body=expr
12551+ ?- -.val.d
12552+ %gate body.val.d
12553+ %gate-wide body.val.d
12554+ * !!
12555+ ==
12556+ =. body (program-transparent body)
12557+ ?. ?=(%tuple -.body) |
12558+ ?~ items.body |
12559+ (program-empty-null val:(rear items.body))
12560+::
12561+:: Recover only the update of an already recognized direct program main.
12562+:: Its written sample determines the message/model relationship; the canonical
12563+:: cmd and list molds determine the result context. Every candidate is checked
12564+:: against the complete program call before an ordinary update/main retry.
12565+++ program-update-context
12566+ |= [main=def parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
12567+ ^- (unit iresolved)
12568+ =/ env=ienv env.resolution
12569+ ?^ (ienv-lookup %main env) ~
12570+ ?^ (ienv-lookup update.parts env) ~
12571+ =/ init=(unit ischeme) (ienv-lookup init.parts env)
12572+ =/ view=(unit ischeme) (ienv-lookup view.parts env)
12573+ =/ subs=(unit ischeme) (ienv-lookup subs.parts env)
12574+ ?~ init ~
12575+ ?~ view ~
12576+ ?~ subs ~
12577+ =/ updates=(list def)
12578+ (skim ds |=(d=def &(?=(%value -.d) =(update.parts name.d))))
12579+ ?. ?=([* ~] updates) ~
12580+ =/ update-def=def i.updates
12581+ ?> ?=(%value -.update-def)
12582+ =/ written-update=(unit sample) (direct-gate-sample update-def)
12583+ ?~ written-update ~
12584+ ?. ?=(%cell -.u.written-update) ~
12585+ ?. ?=([* * ~] items.u.written-update) ~
12586+ =/ args=(unit (list expr)) (program-main-args main)
12587+ ?~ args ~
12588+ ?~ prelude.initial ~
12589+ =/ program=(unit ischeme) (ienv-lookup %program values.u.prelude.initial)
12590+ ?~ program ~
12591+ =/ command=(unit ischeme) (find-jibb-mold %cmd u.prelude.initial)
12592+ =/ list-template=(unit ischeme) (find-jibb-mold %list u.prelude.initial)
12593+ ?~ command ~
12594+ ?~ list-template ~
12595+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
12596+ ?~ heads ~
12597+ =/ written=(unit def) (~(get by gates.u.heads) %program)
12598+ ?~ written ~
12599+ =/ written-sample=(unit sample) (direct-gate-sample u.written)
12600+ ?~ written-sample ~
12601+ ?. ?=(%cell -.u.written-sample) ~
12602+ ?. ?=([* * * * ~] items.u.written-sample) ~
12603+ =/ checked=(map term def)
12604+ (~(put by (direct-checked-gates ds env)) update.parts update-def)
12605+ =/ templates=ienv
12606+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
12607+ =/ scanned=(unit dgscan)
12608+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
12609+ ?~ scanned ~
12610+ =. next.initial (dg-next-id ids.u.scanned 0)
12611+ =/ update-state=istate (reserve-def-caps val.update-def initial)
12612+ =/ sam=isample-result (infer-sample u.written-update env update-state)
12613+ ?: ?=(%| -.sam) ~
12614+ =/ actual-sample=itype (itype-normalize typ.p.sam sub.state.p.sam)
12615+ ?. ?=(%cell -.actual-sample) ~
12616+ =/ message=(unit itype)
12617+ (direct-slot-body hed.actual-sample (direct-sample-name i.items.u.written-update))
12618+ =/ model=(unit itype)
12619+ (direct-slot-body tal.actual-sample (direct-sample-name i.t.items.u.written-update))
12620+ ?~ message ~
12621+ ?~ model ~
12622+ =/ cmd=(unit itype) (template-apply u.command ~[u.message])
12623+ ?~ cmd ~
12624+ =/ cmds=(unit itype) (template-apply u.list-template ~[u.cmd])
12625+ ?~ cmds ~
12626+ =/ product=itype [%cell u.model u.cmds]
12627+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.program state.p.sam)
12628+ ?. ?=(%fn -.typ.instance) ~
12629+ ?. ?=(%cell -.sample.typ.instance) ~
12630+ ?. ?=(%cell -.tal.sample.typ.instance) ~
12631+ =/ expected-update=(unit itype)
12632+ (direct-slot-body hed.tal.sample.typ.instance (direct-sample-name i.t.items.u.written-sample))
12633+ ?~ expected-update ~
12634+ ?. ?=(%fn -.u.expected-update) ~
12635+ :: Sample binders are not value faces. Strip only those two slot faces
12636+ :: for the invariant canonical-gate proof; the source-faced gate is still
12637+ :: used by the complete positional call and final ordinary result cast.
12638+ =/ canonical-candidate=itype [%fn [%cell u.message u.model] product]
12639+ =/ gate-fit=ifit
12640+ (direct-invariant canonical-candidate u.expected-update sub.state.instance next.state.instance)
12641+ ?. ?=(%ok -.gate-fit) ~
12642+ =/ st=istate state.instance(sub sub.gate-fit, next next.gate-fit)
12643+ =/ ini=[typ=itype state=istate] (instantiate-scheme u.init st)
12644+ =/ vw=[typ=itype state=istate] (instantiate-scheme u.view state.ini)
12645+ =/ sb=[typ=itype state=istate] (instantiate-scheme u.subs state.vw)
12646+ =. st state.sb(gate-defs checked, head-evidence heads)
12647+ =/ expected=itype [%fn typ.p.sam product]
12648+ =/ actual=itype [%cell typ.ini [%cell expected [%cell typ.vw typ.sb]]]
12649+ =/ fit=ifit
12650+ (direct-positional-fit u.args items.u.written-sample actual sample.typ.instance env st sub.st next.st)
12651+ ?. ?=(%ok -.fit) ~
12652+ =/ actual-final=itype (itype-normalize actual sub.fit)
12653+ =/ expected-final=itype (itype-normalize sample.typ.instance sub.fit)
12654+ ?^ (itype-vars actual-final) ~
12655+ ?^ (itype-vars expected-final) ~
12656+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
12657+ =/ replay=ifit
12658+ (direct-positional-fit u.args items.u.written-sample actual sample.typ.instance env st sub.fit next.fit)
12659+ ?. ?=(%ok -.replay) ~
12660+ ?. &(=(sub.fit sub.replay) =(next.fit next.replay)) ~
12661+ =/ closed=itype (itype-normalize expected sub.fit)
12662+ ?. ?=(%fn -.closed) ~
12663+ :: The closed product no longer needs the canonical call substitutions.
12664+ :: Start the body at its ordinary sample state so existing branch retries
12665+ :: keep their substitution guards, but retain the shared fresh-ID high water.
12666+ =. st state.p.sam(next next.fit)
12667+ =/ body=expr
12668+ ?- -.val.update-def
12669+ %gate body.val.update-def
12670+ %gate-wide body.val.update-def
12671+ * !!
12672+ ==
12673+ =/ inferred=iresult
12674+ (infer-call-context-arg body product.closed env.p.sam st (span-of body))
12675+ ?: ?=(%| -.inferred) ~
12676+ =/ product-fit=ifit
12677+ (itype-fit typ.p.inferred product.closed sub.state.p.inferred next.state.p.inferred)
12678+ ?. ?=(%ok -.product-fit) ~
12679+ =/ merged-product=itype
12680+ (itype-merge-faces typ.p.inferred product.closed sub.product-fit)
12681+ =/ actual-cast=itype [%fn typ.p.sam merged-product]
12682+ =/ cast=ifit
12683+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
12684+ ?. ?=(%ok -.cast) ~
12685+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
12686+ =/ adjusted=iresult
12687+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
12688+ =/ added=(unit iadded-definition)
12689+ (add-supported-result update-def adjusted update-state env checked artifacts.resolution)
12690+ ?~ added ~
12691+ =/ recovered=(unit ischeme) (ienv-lookup update.parts env.u.added)
12692+ ?~ recovered ~
12693+ ?. ?=(~ vars.u.recovered) ~
12694+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
12695+ =/ completed=[env=ienv artifacts=(list iwidth-definition)]
12696+ (add-supported-defs-core ~[main] ds checked.u.added heads env.u.added molds.initial globals.initial externals.initial surs.initial mark-externals.initial marks.initial jimports.initial reserved-molds.initial at.initial prelude.initial artifacts.u.added grec-index.initial)
12697+ ?~ (ienv-lookup %main env.completed) ~
12698+ `[env.completed grouped.resolution artifacts.completed]
12699+::
12700+:: Recover only the initializer of an already recognized direct program main.
12701+:: The derived call is evidence for an ordinary init/main retry, never an
12702+:: interface to publish on its own. Any failure returns the original resolution.
12703+++ program-init-context
12704+ |= [main=def parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
12705+ ^- (unit iresolved)
12706+ =/ env=ienv env.resolution
12707+ ?^ (ienv-lookup %main env) ~
12708+ ?^ (ienv-lookup init.parts env) ~
12709+ =/ update=(unit ischeme) (ienv-lookup update.parts env)
12710+ =/ view=(unit ischeme) (ienv-lookup view.parts env)
12711+ =/ subs=(unit ischeme) (ienv-lookup subs.parts env)
12712+ ?~ update ~
12713+ ?~ view ~
12714+ ?~ subs ~
12715+ =/ inits=(list def)
12716+ (skim ds |=(d=def &(?=(%value -.d) =(init.parts name.d))))
12717+ ?. ?=([* ~] inits) ~
12718+ =/ init-def=def i.inits
12719+ ?> ?=(%value -.init-def)
12720+ ?. (program-init-tuple-null init-def) ~
12721+ =/ args=(unit (list expr)) (program-main-args main)
12722+ ?~ args ~
12723+ ?~ prelude.initial ~
12724+ =/ program=(unit ischeme) (ienv-lookup %program values.u.prelude.initial)
12725+ ?~ program ~
12726+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
12727+ ?~ heads ~
12728+ =/ written=(unit def) (~(get by gates.u.heads) %program)
12729+ ?~ written ~
12730+ =/ written-sample=(unit sample) (direct-gate-sample u.written)
12731+ ?~ written-sample ~
12732+ ?. ?=(%cell -.u.written-sample) ~
12733+ ?~ items.u.written-sample ~
12734+ =/ checked=(map term def) (direct-checked-gates ds env)
12735+ =/ templates=ienv
12736+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
12737+ =/ scanned=(unit dgscan)
12738+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
12739+ ?~ scanned ~
12740+ =. next.initial (dg-next-id ids.u.scanned 0)
12741+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.program initial)
12742+ ?. ?=(%fn -.typ.instance) ~
12743+ ?. ?=(%cell -.sample.typ.instance) ~
12744+ =/ expected-init=(unit itype)
12745+ (direct-slot-body hed.sample.typ.instance (direct-sample-name i.items.u.written-sample))
12746+ ?~ expected-init ~
12747+ ?. ?=(%fn -.u.expected-init) ~
12748+ ?. ?=(%var -.sample.u.expected-init) ~
12749+ =/ data=@ud id.sample.u.expected-init
12750+ =/ init-var=itype [%var next.state.instance]
12751+ =/ st=istate state.instance(next +(next.state.instance))
12752+ =/ up=[typ=itype state=istate] (instantiate-scheme u.update st)
12753+ =/ vw=[typ=itype state=istate] (instantiate-scheme u.view state.up)
12754+ =/ sb=[typ=itype state=istate] (instantiate-scheme u.subs state.vw)
12755+ =. st state.sb(gate-defs checked, head-evidence heads)
12756+ =/ actual=itype [%cell init-var [%cell typ.up [%cell typ.vw typ.sb]]]
12757+ =/ fit=ifit
12758+ (direct-positional-fit u.args items.u.written-sample actual sample.typ.instance env st sub.st next.st)
12759+ ?. ?=(%ok -.fit) ~
12760+ =/ actual-final=itype (itype-normalize actual sub.fit)
12761+ =/ expected-final=itype (itype-normalize sample.typ.instance sub.fit)
12762+ =/ open=(list @ud)
12763+ (unique-type-vars (weld (itype-vars actual-final) (itype-vars expected-final)))
12764+ ?. (levy open |=(n=@ud =(data n))) ~
12765+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
12766+ =/ replay=ifit
12767+ (direct-positional-fit u.args items.u.written-sample actual sample.typ.instance env st sub.fit next.fit)
12768+ ?. ?=(%ok -.replay) ~
12769+ ?. &(=(sub.fit sub.replay) =(next.fit next.replay)) ~
12770+ =/ expected=itype (itype-normalize u.expected-init sub.fit)
12771+ ?. ?=(%fn -.expected) ~
12772+ =. st st(sub sub.fit, next next.fit)
12773+ =/ init-state=istate (reserve-def-caps val.init-def st)
12774+ =/ inferred=iresult (infer-fragment val.init-def env init-state)
12775+ =? inferred ?=(%| -.inferred) (infer-recursive-gate init-def env init-state)
12776+ ?: ?=(%| -.inferred) ~
12777+ ?. ?=(%fn -.typ.p.inferred) ~
12778+ =/ data-fit=ifit
12779+ (itype-fit sample.typ.p.inferred sample.expected sub.state.p.inferred next.state.p.inferred)
12780+ ?. ?=(%ok -.data-fit) ~
12781+ =/ closed=itype (itype-normalize expected sub.data-fit)
12782+ ?. ?=(%fn -.closed) ~
12783+ :: Resolve the ordinary tuple cast first, then check the complete gate.
12784+ :: General function fit remains unchanged; only this recovered candidate
12785+ :: receives the derived result context before its whole-type cast fit.
12786+ =/ product-fit=ifit
12787+ (itype-fit product.typ.p.inferred product.closed sub.data-fit next.data-fit)
12788+ ?. ?=(%ok -.product-fit) ~
12789+ =/ product=itype
12790+ (itype-merge-faces product.typ.p.inferred product.closed sub.product-fit)
12791+ =/ actual-cast=itype [%fn sample.typ.p.inferred product]
12792+ =/ cast=ifit
12793+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
12794+ ?. ?=(%ok -.cast) ~
12795+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
12796+ =/ adjusted=iresult
12797+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
12798+ =/ added=(unit iadded-definition)
12799+ (add-supported-result init-def adjusted init-state env checked artifacts.resolution)
12800+ ?~ added ~
12801+ =/ recovered=(unit ischeme) (ienv-lookup init.parts env.u.added)
12802+ ?~ recovered ~
12803+ ?. ?=(~ vars.u.recovered) ~
12804+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
12805+ =/ completed=[env=ienv artifacts=(list iwidth-definition)]
12806+ (add-supported-defs-core ~[main] ds checked.u.added heads env.u.added molds.initial globals.initial externals.initial surs.initial mark-externals.initial marks.initial jimports.initial reserved-molds.initial at.initial prelude.initial artifacts.u.added grec-index.initial)
12807+ ?~ (ienv-lookup %main env.completed) ~
12808+ `[env.completed grouped.resolution artifacts.completed]
12809+::
12810+++ program-subs-watch
12811+ |= [d=def imports=ijimports graph=irequest-graph prelude=ifile]
12812+ ^- ?
12813+ ?. ?=(%value -.d) |
12814+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) |
12815+ =/ body=expr
12816+ ?- -.val.d
12817+ %gate body.val.d
12818+ %gate-wide body.val.d
12819+ * val.d
12820+ ==
12821+ =. body (program-transparent body)
12822+ ?. ?=(%list -.body) |
12823+ ?. ?=([* ~] items.body) |
12824+ =/ watch=expr (program-transparent i.items.body)
12825+ ?. ?=(%tuple -.watch) |
12826+ ?. ?=([* * ~] items.watch) |
12827+ =/ tag=item i.items.watch
12828+ =/ payload=item i.t.items.watch
12829+ ?. &(?=(~ face.tag) ?=(~ face.payload)) |
12830+ =/ tag-expr=expr (program-transparent val.tag)
12831+ ?. ?=(%lit -.tag-expr) |
12832+ ?. &(?=(%term form.lit.tag-expr) =(%watch val.lit.tag-expr)) |
12833+ =/ request=expr (program-transparent val.payload)
12834+ ?. ?=(%call -.request) |
12835+ ?. ?=([* ~] args.request) |
12836+ =/ head=expr (program-transparent head.request)
12837+ ?. ?=(%wing -.head) |
12838+ ?. ?=([@ @ ~] names.head) |
12839+ =/ case=term i.names.head
12840+ =/ face=term i.t.names.head
12841+ =/ callback=expr (program-transparent i.args.request)
12842+ ?. ?=(%ctor -.callback) |
12843+ ?. ?=(%term form.tag.callback) |
12844+ =/ selected=(list [face=term interface=ifile])
12845+ (skim imports |=(j=[face=term interface=ifile] =(face face.j)))
12846+ ?. ?=([* ~] selected) |
12847+ =/ iface=ifile interface.i.selected
12848+ =/ member=(unit ischeme) (ienv-lookup case values.iface)
12849+ ?~ member |
12850+ ?~ source.iface |
12851+ =/ evidence=(list irequest-evidence)
12852+ (skim requests.graph |=(r=irequest-evidence &(=(api-at.r at.iface) =(name.r case))))
12853+ ?. ?=([* ~] evidence) |
12854+ =/ request-evidence=irequest-evidence i.evidence
12855+ ?. =(u.source.iface api-source.request-evidence) |
12856+ ?. =(name.path.path.request-evidence case) |
12857+ ?~ graph.iface |
12858+ ?. (lien requests.u.graph.iface |=(r=irequest-evidence =(r request-evidence))) |
12859+ ?. ?=(~ scry.path.path.request-evidence) |
12860+ ?. &(?=(~ diffs.path.request-evidence) ?=(~ diffs.path.path.request-evidence)) |
12861+ ?: (lien segments.path.path.request-evidence |=(p=pseg !?=(%knot -.p))) |
12862+ ?. ?=([@ ~] vars.u.member) |
12863+ =/ message=@ud i.vars.u.member
12864+ ?. ?=(%fn -.typ.u.member) |
12865+ ?. ?=(%fn -.sample.typ.u.member) |
12866+ ?. =(sample.sample.typ.u.member full.path.request-evidence) |
12867+ ?. =(product.sample.typ.u.member [%var message]) |
12868+ =/ prep=iprelude [prelude prelude-values.graph prelude-molds.graph]
12869+ =/ ask=(unit ischeme) (request-compatible-ask prep)
12870+ ?~ ask |
12871+ =/ result=(unit itype) (template-apply u.ask ~[[%var message]])
12872+ ?~ result |
12873+ =(product.typ.u.member u.result)
12874+::
12875+++ program-main-closed
12876+ |= [parts=[init=term update=term view=term subs=term] ds=(list def) env=ienv prelude=(unit ifile) imports=ijimports graph=irequest-graph]
12877+ ^- ?
12878+ ?~ prelude |
12879+ ?~ (ienv-lookup %program values.u.prelude) |
12880+ =/ program=(unit ischeme) (find-jibb-mold %program u.prelude)
12881+ ?~ program |
12882+ =/ main=(unit ischeme) (ienv-lookup %main env)
12883+ ?~ main |
12884+ ?. ?=(~ vars.u.main) |
12885+ ?. ?=(~ (itype-vars typ.u.main)) |
12886+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.program *istate)
12887+ =/ main-fit=ifit (direct-invariant typ.u.main typ.instance ~ next.state.instance)
12888+ ?. ?=(%ok -.main-fit) |
12889+ =/ init=(unit ischeme) (ienv-lookup init.parts env)
12890+ ?~ init |
12891+ ?. ?=(~ vars.u.init) |
12892+ ?. ?=(%fn -.typ.u.init) |
12893+ ?. ?=(~ (itype-vars sample.typ.u.init)) |
12894+ ?. ?=(~ (itype-vars product.typ.u.init)) |
12895+ =/ data=igate-free (gate-free-type sample.typ.u.init 256 ~)
12896+ ?. =(%yes verdict.data) |
12897+ =/ model=igate-free (gate-free-type product.typ.u.init left.data ~)
12898+ ?. =(%yes verdict.model) |
12899+ =/ subs=(list def)
12900+ (skim ds |=(d=def &(?=(%value -.d) =(subs.parts name.d))))
12901+ ?. ?=([* ~] subs) |
12902+ |((program-subs-empty i.subs) (program-subs-watch i.subs imports graph u.prelude))
12903+::
12904+++ infer-jibb-file
12905+ |= [at=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle active=(list path) prelude-values=(list term) prelude-molds=(list term) cache=jcache prelude=(unit ifile)]
12906+ ^- jfile-result
12907+ =/ out=jfile-detailed-result
12908+ (infer-jibb-file-detailed at src externals mark-externals modules active prelude-values prelude-molds cache prelude)
12909+ ?: ?=(%| -.out) [%| message.p.out]
12910+ [%& p.out]
12911+:: Returns structured root-source overlap evidence after the same full check.
12912+++ infer-jibb-file-detailed
12913+ |= [at=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle active=(list path) prelude-values=(list term) prelude-molds=(list term) cache=jcache prelude=(unit ifile)]
12914+ ^- jfile-detailed-result
12915+ =/ parsed (parse at src)
12916+ ?: ?=(%| -.parsed) [%| [(crip "module source does not parse: {(spud at)}") ~]]
12917+ =/ mod=module p.parsed
12918+ =/ duplicate=(unit idiag) (duplicate-defs defs.mod)
12919+ ?^ duplicate [%| [(show-duplicate-fields at src u.duplicate) ~]]
12920+ ?: &(?=([%ui %api *] at) ?=(^ (program-main-def defs.mod)))
12921+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
12922+ ?: ?=([%ui %api *] at)
12923+ =/ iface=(unit ifile) (api-poke-interface at mod mark-externals prelude-values prelude-molds prelude)
12924+ ?^ iface
12925+ =/ checked=ifile u.iface(source `src, graph `[(silt `(list path)`~[at]) ~ modules prelude prelude-values prelude-molds externals mark-externals])
12926+ [%& [checked [[at checked] cache]]]
12927+ ?~ prelude [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
12928+ =/ prepared=iprelude [u.prelude prelude-values prelude-molds]
12929+ =/ narrow=?
12930+ ?. ?=([[%mark *] ~] imports.mod) |
12931+ ?. ?=([[%mold *] ~] defs.mod) |
12932+ ?. =(%paths name.i.defs.mod) |
12933+ !?=(%union -.shape.i.defs.mod)
12934+ ?: narrow
12935+ =/ request=(each ione-request-interface @t)
12936+ (one-request-interface-graph at src externals mark-externals modules active cache `prepared)
12937+ ?: ?=(%| -.request) [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
12938+ =/ checked=ifile iface.p.request
12939+ [%& [checked [[at checked] dependencies.paths.support.p.request]]]
12940+ =/ multi=(each [iface=ifile cache=jcache] @t)
12941+ (multi-request-interface-graph at src externals mark-externals modules active cache `prepared)
12942+ ?: ?=(%| -.multi) [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
12943+ [%& [iface.p.multi [[at iface.p.multi] cache.p.multi]]]
12944+ ?. (module-scope-valid mod prelude-values prelude-molds)
12945+ ?: (pending-declared-poke at mod prelude-values prelude-molds)
12946+ [%| [(crip "module kind or scope needs unsupported inference: {(spud at)}") ~]]
12947+ [%| [(crip "module has conflicting names: {(spud at)}") ~]]
12948+ =/ vals=(list term) (global-value-names defs.mod)
12949+ =/ main=(unit def) (program-main-def defs.mod)
12950+ =/ main-parts=(unit [init=term update=term view=term subs=term])
12951+ ?~(main ~ (program-main-parts u.main))
12952+ ?. ?~(main & &(!?=([%ui %stores *] at) ?=(^ main-parts)))
12953+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
12954+ =/ js=jimports-detailed-result (resolve-jibb-imports-detailed imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
12955+ ?: ?=(%| -.js) [%| p.js]
12956+ =/ collected=grec-collected
12957+ ?^ imports.mod [(collect-simple-molds defs.mod) *(map term shape)]
12958+ (grec-collect-molds defs.mod)
12959+ =/ molds=imolds molds.collected
12960+ =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
12961+ =/ surs=(list term) (collect-sur-imports imports.mod)
12962+ =/ marks=(list term) (collect-mark-imports imports.mod)
12963+ =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
12964+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12965+ =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12966+ :: Source and scope were checked above; preserve that exact root and prelude.
12967+ :: This first integration only indexes import-free library sources.
12968+ =/ index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])
12969+ ?^ imports.mod ~
12970+ ?~ prelude ~
12971+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude)
12972+ ?~ standard ~
12973+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
12974+ =/ index=(map term shape) proofs.collected
12975+ ?. !=(index *(map term shape)) ~
12976+ ?: (lien molds |=(m=[name=term body=shape] =(%list name.m))) ~
12977+ `[at src u.prelude index]
12978+ =. grec-index.state index
12979+ =/ mts=(each imold-types imold-failure) (module-mold-types-detail molds state)
12980+ ?: ?=(%| -.mts)
12981+ ?~ overlap.p.mts [%| [(crip "{(trip message.p.mts)}: {(spud at)}") ~]]
12982+ =/ witness=[name=term cases=upair] u.overlap.p.mts
12983+ =/ first=@t (show-error src [at line.beg.first.cases.witness col.beg.first.cases.witness "first union case"])
12984+ =/ second=@t (show-error src [at line.beg.second.cases.witness col.beg.second.cases.witness "overlapping case"])
12985+ =/ msg=@t (of-wain:format ~[(crip "module mold {(trip name.witness)} has overlapping cases") first second])
12986+ [%| [msg `[at src name.witness cases.witness]]]
12987+ =/ resolution=iresolved
12988+ ?~ index
12989+ (resolve-groups defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
12990+ (resolve-groups-core defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude index)
12991+ =/ env=ienv env.resolution
12992+ =/ recovered=(unit iresolved)
12993+ ?~ main ~
12994+ ?~ main-parts ~
12995+ =/ updated=(unit iresolved)
12996+ (program-update-context u.main u.main-parts defs.mod resolution state)
12997+ ?^ updated updated
12998+ (program-init-context u.main u.main-parts defs.mod resolution state)
12999+ =. env ?~(recovered env env.u.recovered)
13000+ =. artifacts.resolution
13001+ ?~(recovered artifacts.resolution artifacts.u.recovered)
13002+ =. env
13003+ ?: (module-values-complete defs.mod env) env
13004+ ?: |(?=([%ui %stores *] at) ?=(^ imports.mod) ?=(^ prelude) ?=(^ prelude-values) ?=(^ prelude-molds)) env
13005+ ?: (gth (met 3 src) 65.536) env
13006+ ?: (gth (lent defs.mod) 64) env
13007+ ?. (dg-source-candidate defs.mod 64) env
13008+ =/ transaction=(unit dgcommit) (dg-root-source at src)
13009+ ?~ transaction env
13010+ ?: (dg-interface-safe env.u.transaction) env.u.transaction
13011+ env
13012+ ?. (module-values-complete defs.mod env)
13013+ [%| [(crip "module definitions need unsupported inference: {(spud at)}") ~]]
13014+ =/ initial=irequest-graph [(silt `(list path)`~[at]) ~ modules prelude prelude-values prelude-molds externals mark-externals]
13015+ =/ graph=(unit irequest-graph) (request-graph-merge resolved.p.js initial (add 1 (lent resolved.p.js)))
13016+ ?~ graph [%| ['module request evidence needs unsupported inference' ~]]
13017+ ?. ?~(main & ?~(main-parts | (program-main-closed u.main-parts defs.mod env prelude resolved.p.js u.graph)))
13018+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
13019+ =/ iface=ifile [env p.mts at ~ artifacts.resolution ~ `src graph]
13020+ [%& [iface [[at iface] cache.p.js]]]
13021+::
13022+:: A source-bound analysis of one named mold, not a module, island,
13023+:: request, watchability or runtime check. The host owns the trusted
13024+:: prepared prelude, canonical paths and reader/source version identities.
13025+:: The 256-node cap covers only classification, not source/graph work.
13026++$ igate-free-mold
13027+ [at=path source=@t name=term prepared=iprelude externals=iexternals marks=imark-externals modules=jbundle dependencies=jcache mold=ischeme requested=@ud budget=@ud result=igate-free]
13028+++ gate-free-mold-source
13029+ |= [file=path src=@t name=term externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude) fuel=@ud]
13030+ ^- (each igate-free-mold @t)
13031+ ?~ file [%| 'mold analysis needs a path ending in jibb']
13032+ ?. =(%jibb (rear file)) [%| 'mold analysis needs a path ending in jibb']
13033+ ?: |(=(file /lib/jibb/internal/jibb) =(file /lib/jibb/primitives/jibb))
13034+ [%| 'the prelude internal modules are private']
13035+ ?: ?=([%ui %api *] file) [%| 'API declarations need unsupported mold analysis']
13036+ ?: ?=([%ui %stores *] file) [%| 'store declarations need unsupported mold analysis']
13037+ =/ entries=jbundle (skim modules |=(m=jsource =(file at.m)))
13038+ ?: (gth (lent entries) 1) [%| 'duplicate root module sources']
13039+ =/ wrong-root=? ?~(entries | !=(source.i.entries src))
13040+ ?: wrong-root [%| 'root module source does not match bundle']
13041+ =/ parsed (parse file src)
13042+ ?: ?=(%| -.parsed) [%| 'mold source does not parse']
13043+ =/ mod=module p.parsed
13044+ =/ duplicate=(unit idiag) (duplicate-defs defs.mod)
13045+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
13046+ ?~ prepared [%| 'mold analysis needs the prepared prelude']
13047+ ?. (module-scope-valid mod values.u.prepared molds.u.prepared)
13048+ [%| 'mold source has conflicting or unsupported scope']
13049+ =/ selected=(list def)
13050+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(name.d name))))
13051+ ?~ selected [%| 'selected mold is not declared']
13052+ ?^ t.selected [%| 'selected mold is not unique']
13053+ ?> ?=(%mold -.i.selected)
13054+ =/ public=ifile iface.u.prepared
13055+ =/ js=jimports-result
13056+ (resolve-jibb-imports imports.mod externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
13057+ ?: ?=(%| -.js) [%| p.js]
13058+ =/ ms=imolds (collect-simple-molds defs.mod)
13059+ =/ vals=(list term) (global-value-names defs.mod)
13060+ =/ globals=(list term) (weld values.u.prepared (weld (import-binding-names imports.mod) vals))
13061+ =/ surs=(list term) (collect-sur-imports imports.mod)
13062+ =/ declared=(list term) (collect-mark-imports imports.mod)
13063+ =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
13064+ =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
13065+ =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~ ~ ~ ~ ~ ~]
13066+ =/ inferred=(unit [template=ischeme state=istate])
13067+ (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
13068+ ?~ inferred [%| 'selected mold needs unsupported inference']
13069+ =/ template=ischeme template.u.inferred
13070+ =. typ.template (label-direct-union typ.template shape.i.selected name state)
13071+ =. typ.template (itype-normalize typ.template sub.state.u.inferred)
13072+ =/ cap=@ud (min fuel 256)
13073+ =/ analysis=igate-free (gate-free-type typ.template cap ~)
13074+ [%& [file src name u.prepared externals marks modules cache.p.js template fuel cap analysis]]
13075+::
13076+:: +golden-types-with-modules fails closed for imports without prelude
13077+:: scope. +golden-types-with-prelude resolves supported library graphs;
13078+:: its report remains partial and unreachable sources are not examined.
13079+::
13080+++ golden-types-with-modules
13081+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle]
13082+ ^- @t
13083+ =/ parsed (parse file src)
13084+ ?: ?=(%| -.parsed) (show-error src p.parsed)
13085+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
13086+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
13087+ ?: (lien imports.p.parsed |=(i=import ?=(%jibb -.i)))
13088+ 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
13089+ (golden-types-with-marks file src externals mark-externals)
13090+::
13091+:: The caller supplies the actual prelude source. Its declared names are
13092+:: reserved, and supported inferred types are made available. The inventory
13093+:: and the checker are incomplete, so this never claims a checked module.
13094+:: Hosts may prepare the same trusted source once and reuse its interface.
13095+::
13096+++ golden-types-with-prelude
13097+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prelude-source=@t]
13098+ ^- @t
13099+ =/ parsed (parse file src)
13100+ ?: ?=(%| -.parsed) (show-error src p.parsed)
13101+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
13102+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
13103+ ?: =(0 prelude-source) 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
13104+ =/ prelude (parse /lib/jibb/prelude/jibb prelude-source)
13105+ ?: ?=(%| -.prelude) 'partial inference; module not checked\0aprelude source does not parse; module import inference unsupported'
13106+ =/ prepared=(unit iprelude) (prepare-prelude prelude-source)
13107+ ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
13108+ (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
13109+::
13110+++ golden-types-with-prelude-and-internal
13111+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prelude-source=@t internal-source=@t]
13112+ ^- @t
13113+ =/ prepared=(unit iprelude) (prepare-prelude-with-internal prelude-source internal-source)
13114+ (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
13115+::
13116+++ golden-types-with-prepared-prelude
13117+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prepared=(unit iprelude)]
13118+ ^- @t
13119+ =/ parsed (parse file src)
13120+ ?: ?=(%| -.parsed) (show-error src p.parsed)
13121+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
13122+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
13123+ ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
13124+ =/ prelude-values=(list term) values.u.prepared
13125+ =/ prelude-molds=(list term) molds.u.prepared
13126+ =/ iface=(unit ifile) `iface.u.prepared
13127+ ?. (module-scope-valid p.parsed prelude-values prelude-molds)
13128+ ?: (pending-declared-poke file p.parsed prelude-values prelude-molds)
13129+ 'partial inference; module not checked\0amodule kind or scope needs unsupported inference'
13130+ 'partial inference; module not checked\0amodule has conflicting names'
13131+ =/ js=jimports-result
13132+ (resolve-jibb-imports imports.p.parsed externals mark-externals modules ~[file] prelude-values prelude-molds ~ iface)
13133+ ?: ?=(%| -.js) (of-wain:format ~['partial inference; module not checked' p.js])
13134+ =/ scope-values=(list term)
13135+ (weld prelude-values (weld (collect-sur-imports imports.p.parsed) (collect-mark-imports imports.p.parsed)))
13136+ (golden-types-in-context-core file src externals mark-externals resolved.p.js scope-values prelude-molds iface prepared)
13137+::
13138+:: +golden-types-with-marks: supply declared mark types separately from /sur
13139+:: entries, as [mark result] with the result from +read-mark:jibb-import.
13140+:: Unknown, duplicated, failed and undeclared entries never resolve a mold.
13141+::
13142+:: Callers pass unchanged structured reader results; graph validation
13143+:: remains in the existing bridge, and failures stay available lazily.
13144+++ reader-result-for-checker
13145+ |= result=*
13146+ ^- *
13147+ ?: ?=([%ok *] result) [%& +.result]
13148+ result
13149+::
13150+++ golden-types-with-reader-diagnostics
13151+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals]
13152+ ^- @t
13153+ =/ ex=iexternals
13154+ (turn externals |=(e=[module=term name=term result=*] [module.e name.e (reader-result-for-checker result.e)]))
13155+ =/ mx=imark-externals
13156+ (turn mark-externals |=(e=[mark=term result=*] [mark.e (reader-result-for-checker result.e)]))
13157+ (golden-types-with-marks file src ex mx)
13158+::
13159+++ golden-types-with-marks
13160+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals]
13161+ ^- @t
13162+ (golden-types-in-context file src externals mark-externals ~ ~ ~ ~)
13163+::
13164+++ golden-types-in-context
13165+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals jimports=ijimports prelude-values=(list term) reserved-molds=(list term) prelude=(unit ifile)]
13166+ ^- @t
13167+ (golden-types-in-context-core file src externals mark-externals jimports prelude-values reserved-molds prelude ~)
13168+++ golden-types-in-context-core
13169+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals jimports=ijimports prelude-values=(list term) reserved-molds=(list term) prelude=(unit ifile) prepared=(unit iprelude)]
13170+ ^- @t
13171+ =. reserved-molds (weld reserved-molds (turn jimports |=(j=[face=term interface=ifile] face.j)))
13172+ =/ parsed (parse file src)
13173+ ?: ?=(%| -.parsed) (show-error src p.parsed)
13174+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
13175+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
13176+ ?: (module-has-reserved-proj p.parsed)
13177+ 'module has reserved proj name'
13178+ =/ ds=(list def) defs.p.parsed
13179+ =/ molds=imolds (collect-simple-molds ds)
13180+ =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
13181+ =/ surs=(list term) (collect-sur-imports imports.p.parsed)
13182+ =/ marks=(list term) (collect-mark-imports imports.p.parsed)
13183+ =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
13184+ =/ cycles=(list icycle) (definite-value-cycles ds globals)
13185+ =/ env=ienv env.resolution
13186+ =/ recovered=(list term) ~
13187+ =/ eligible=?
13188+ ?& ?=(~ imports.p.parsed)
13189+ ?=(~ jimports)
13190+ !?=([%ui %api *] file)
13191+ !?=([%ui %stores *] file)
13192+ !(lien (global-value-names ds) |=(n=term =(n %main)))
13193+ !(module-values-complete ds env)
13194+ (lte (met 3 src) 65.536)
13195+ (lte (lent ds) 64)
13196+ ?| &(?=(~ prepared) ?=(~ prelude) ?=(~ prelude-values) ?=(~ reserved-molds) (module-scope-valid p.parsed ~ ~) (dg-source-candidate ds 64))
13197+ ?& ?=(^ prepared)
13198+ ?=(^ prelude)
13199+ =(u.prelude iface.u.prepared)
13200+ =(prelude-values values.u.prepared)
13201+ =(reserved-molds molds.u.prepared)
13202+ (module-scope-valid p.parsed values.u.prepared molds.u.prepared)
13203+ (dg-prepared-candidate ds 64)
13204+ ==
13205+ ==
13206+ ==
13207+ =/ transaction=(unit dgcommit)
13208+ ?. eligible ~
13209+ ?~ prepared (dg-root-source file src)
13210+ (dg-root-prepared file src u.prepared)
13211+ =. recovered
13212+ ?~ transaction ~
13213+ ?. &((module-values-complete ds env.u.transaction) (dg-interface-safe env.u.transaction)) ~
13214+ (turn (skim env.u.transaction |=(entry=[name=term scheme=ischeme] ?=(~ (ienv-lookup name.entry env)))) |=(entry=[name=term scheme=ischeme] name.entry))
13215+ =. env
13216+ ?~ transaction env
13217+ ?: &((module-values-complete ds env.u.transaction) (dg-interface-safe env.u.transaction)) env.u.transaction
13218+ env
13219+ =/ source-defs=(map term def) (direct-checked-gates ds env)
13220+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
13221+ =/ lines=(list @t) ~
13222+ |-
13223+ ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
13224+ =/ d=def i.ds
13225+ ?: ?=(%mold -.d)
13226+ $(ds t.ds, lines [(show-partial-mold file src d molds) lines])
13227+ ?. (unique-value-name name.d globals)
13228+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
13229+ =/ cycle=(list icycle) (skim cycles |=(c=icycle =(name.c name.d)))
13230+ ?^ cycle
13231+ =/ diag=idiag ["non-gate value depends on itself through a cycle" ~[[first.i.cycle "value in cycle"] [next.i.cycle "dependency in cycle"]]]
13232+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d diag) lines])
13233+ ?: (lien recovered |=(n=term =(n name.d)))
13234+ =/ found=(unit ischeme) (ienv-lookup name.d env)
13235+ ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: committed definition unavailable") lines])
13236+ ?: (itype-has-hidden-recursive typ.u.found)
13237+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive mold name is not available in this scope") lines])
13238+ ?: (itype-has-hidden-generic typ.u.found)
13239+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: generic union name is not available in this scope") lines])
13240+ =/ typ=itype (canonical-itype typ.u.found vars.u.found)
13241+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
13242+ $(ds t.ds, lines [line lines])
13243+ ?: (lien grouped.resolution |=(n=term =(n name.d)))
13244+ =/ found=(unit ischeme) (ienv-lookup name.d env)
13245+ ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive group unavailable") lines])
13246+ =/ typ=itype (canonical-itype typ.u.found vars.u.found)
13247+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
13248+ $(ds t.ds, lines [line lines])
13249+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
13250+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
13251+ =. gate-defs.initial source-defs
13252+ =. head-evidence.initial heads
13253+ =. initial (reserve-def-caps val.d initial)
13254+ =/ result=iresult
13255+ ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
13256+ (infer-recursive-gate d env initial)
13257+ (infer-fragment val.d env initial)
13258+ ?: ?=(%| -.result)
13259+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
13260+ =. state.p.result (promote-restricted-numbers state.p.result env)
13261+ =. state.p.result (default-hole-numbers holes.state.p.result holes.initial state.p.result env !(itype-has-gate (itype-normalize typ.p.result sub.state.p.result)))
13262+ =/ hole=(unit idiag) (unresolved-hole holes.state.p.result holes.initial state.p.result)
13263+ ?^ hole
13264+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d u.hole) lines])
13265+ =/ merged=(unit [first=icap second=icap])
13266+ (merged-capitals caps.state.p.result sub.state.p.result)
13267+ ?^ merged
13268+ =/ diag=idiag
13269+ ["distinct type variables `{(trip name.first.u.merged)}` and `{(trip name.second.u.merged)}` must not be forced equal; use the same capital for a shared type" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]
13270+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d diag) lines])
13271+ ?: (constrained-capitals caps.state.p.result sub.state.p.result)
13272+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: explicit capital constraints are not supported by partial inference") lines])
13273+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
13274+ ?: (pending-null tags.state.p.result sub.state.p.result)
13275+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: `~` needs context in partial inference") lines])
13276+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ))
13277+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: tag needs context in partial inference") lines])
13278+ ?: (itype-has-hidden-recursive typ)
13279+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive mold name is not available in this scope") lines])
13280+ ?: (itype-has-hidden-generic typ)
13281+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: generic union name is not available in this scope") lines])
13282+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result)
13283+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: unresolved aura-variable inference") lines])
13284+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
13285+ ?: (gth (lent vars) 26)
13286+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: too many variables for partial printer") lines])
13287+ ?~ (width-finalize projections.state.p.result sub.state.p.result vars)
13288+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: record projection elaboration needs unsupported inference") lines])
13289+ =/ printable=itype (canonical-itype typ vars)
13290+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
13291+ $(ds t.ds, lines [line lines])
13292+:: Experimental module-owned pending-constraint generalization only.
13293+:: Inputs, IDs and substitution come from one checker-owned transaction.
13294++$ dgscan [ids=(list @ud) fuel=@ud]
13295+++ dg-scan
13296+ |= [todo=(list itype) sub=isub fuel=@ud ids=(list @ud)]
13297+ ^- (unit dgscan)
13298+ ?~ todo `[ids fuel]
13299+ ?: =(0 fuel) ~
13300+ =. fuel (dec fuel)
13301+ =/ t=itype i.todo
13302+ ?: ?=(?(%var %avar %rvar %nvar %rnvar %tag) -.t)
13303+ =/ node-id=@ud ?:(?=(%tag -.t) id.t +.t)
13304+ =/ found=(unit itype) (itype-lookup node-id sub)
13305+ ?~ found $(todo t.todo, ids [node-id ids])
13306+ ?: &(?=(?(%rvar %rnvar) -.u.found) =(node-id +.u.found))
13307+ $(todo t.todo, ids [node-id ids])
13308+ $(todo [u.found t.todo])
13309+ ?: ?=(%jrec -.t) $(todo t.todo)
13310+ ?+ -.t ~
13311+ %collection $(todo (weld args.t t.todo))
13312+ %union $(todo (weld args.t (weld cases.t t.todo)))
13313+ %face $(todo [body.t t.todo])
13314+ %fn $(todo [sample.t product.t t.todo])
13315+ %cell $(todo [hed.t tal.t t.todo])
13316+ %atom $(todo t.todo)
13317+ %any-atom $(todo t.todo)
13318+ %flag $(todo t.todo)
13319+ %noun $(todo t.todo)
13320+ %empty $(todo t.todo)
13321+ %const $(todo t.todo)
13322+ ==
13323+::
13324+++ dg-scan-ids
13325+ |= [ids=(list @ud) sub=isub fuel=@ud blocked=(list @ud)]
13326+ ^- (unit dgscan)
13327+ ?~ ids `[blocked fuel]
13328+ =/ one=(unit dgscan) (dg-scan ~[[%var i.ids]] sub fuel blocked)
13329+ ?~ one ~
13330+ $(ids t.ids, fuel fuel.u.one, blocked ids.u.one)
13331+::
13332+++ dg-env
13333+ |= [env=ienv sub=isub fuel=@ud blocked=(list @ud)]
13334+ ^- (unit dgscan)
13335+ ?~ env `[blocked fuel]
13336+ =/ sc=ischeme scheme.i.env
13337+ :: Quantifiers are local to the scheme: first find raw free IDs, then
13338+ :: follow those IDs in the module substitution without capturing them.
13339+ =/ raw=(unit dgscan) (dg-scan ~[typ.sc] ~ fuel ~)
13340+ ?~ raw ~
13341+ =/ free=(list @ud) (skim ids.u.raw |=(n=@ud !(lien vars.sc |=(q=@ud =(q n)))))
13342+ =/ resolved=(unit dgscan) (dg-scan-ids free sub fuel.u.raw blocked)
13343+ ?~ resolved ~
13344+ $(env t.env, fuel fuel.u.resolved, blocked ids.u.resolved)
13345+::
13346+++ dg-obligations
13347+ |= [pending=(list dgo) sub=isub fuel=@ud blocked=(list @ud)]
13348+ ^- (unit dgscan)
13349+ ?~ pending `[blocked fuel]
13350+ =/ found=(unit dgscan) (dg-scan ~[left.i.pending right.i.pending] sub fuel blocked)
13351+ ?~ found ~
13352+ $(pending t.pending, fuel fuel.u.found, blocked ids.u.found)
13353+::
13354+++ dg-tags
13355+ |= [tags=(list ipending) sub=isub fuel=@ud blocked=(list @ud)]
13356+ ^- (unit dgscan)
13357+ ?~ tags `[blocked fuel]
13358+ ?: =(0 fuel) ~
13359+ =/ found=(unit itype) (itype-lookup id.i.tags sub)
13360+ ?~ found $(tags t.tags, fuel (dec fuel), blocked [id.i.tags blocked])
13361+ :: Until this entry is explicitly discharged, retain variables reachable
13362+ :: through its binding; mere existence of a substitution is not proof.
13363+ =/ reached=(unit dgscan) (dg-scan ~[u.found] sub (dec fuel) blocked)
13364+ ?~ reached ~
13365+ $(tags t.tags, fuel fuel.u.reached, blocked ids.u.reached)
13366+::
13367+++ dg-generalize
13368+ |= [typ=itype env=ienv pending=(list dgo) tags=(list ipending) captured=(list @ud) state=istate fuel=@ud]
13369+ ^- (unit ischeme)
13370+ :: Bound the obligation list and all graph/substitution walks. The
13371+ :: substitution is assumed checker-owned and occurs-checked.
13372+ ?: (gth (lent pending) 64) ~
13373+ =/ capt=(unit dgscan) (dg-scan-ids captured sub.state fuel ~)
13374+ ?~ capt ~
13375+ =/ env-free=(unit dgscan) (dg-env env sub.state fuel.u.capt ids.u.capt)
13376+ ?~ env-free ~
13377+ =/ obligations=(unit dgscan) (dg-obligations pending sub.state fuel.u.env-free ids.u.env-free)
13378+ ?~ obligations ~
13379+ =/ tagged=(unit dgscan) (dg-tags tags sub.state fuel.u.obligations ids.u.obligations)
13380+ ?~ tagged ~
13381+ =/ bounded=(unit dgscan) (dg-scan ~[typ] sub.state fuel.u.tagged ~)
13382+ ?~ bounded ~
13383+ =/ normalized=itype (itype-normalize typ sub.state)
13384+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
13385+ =/ quantified=(list @ud) (skim vars |=(n=@ud !(lien ids.u.tagged |=(b=@ud =(b n)))))
13386+ `[[normalized quantified]]
13387+::
13388++$ dgcommit [env=ienv state=istate]
13389+:: A branch literal must not acquire a value face through replay.
13390+++ dg-literal-target-safe
13391+ |= target=itype
13392+ ^- ?
13393+ ?: ?=(%union -.target)
13394+ (levy cases.target |=(c=itype ?=(?(%const %cell) -.c)))
13395+ ?=(?(%const %atom %any-atom %flag %noun) -.target)
13396+::
13397+++ dg-replay-edges
13398+ |= [edges=(list dgo) state=istate fuel=@ud]
13399+ ^- (unit istate)
13400+ ?~ edges `state
13401+ ?: =(0 fuel) ~
13402+ =/ trial=ifit (itype-fit left.i.edges right.i.edges sub.state next.state)
13403+ ?. ?=(%ok -.trial) ~
13404+ =/ valid=?
13405+ ?: ?=(%tag -.left.i.edges)
13406+ ?. constructor.left.i.edges
13407+ =/ closed=(unit dgscan) (dg-scan ~[right.i.edges] sub.trial 512 ~)
13408+ ?~ closed |
13409+ ?^ ids.u.closed |
13410+ (dg-literal-target-safe (itype-normalize right.i.edges sub.trial))
13411+ =((itype-walk left.i.edges sub.trial) (itype-walk right.i.edges sub.trial))
13412+ =((itype-walk left.i.edges sub.trial) (itype-walk right.i.edges sub.trial))
13413+ ?. valid ~
13414+ $(edges t.edges, state state(sub sub.trial, next next.trial), fuel (dec fuel))
13415+::
13416+++ dg-close-env
13417+ |= [env=ienv sub=isub fuel=@ud]
13418+ ^- (unit ienv)
13419+ ?~ env `~
13420+ ?: =(0 fuel) ~
13421+ =/ s=ischeme scheme.i.env
13422+ :: Quantified IDs are scheme-local and cannot be rewritten on publication.
13423+ ?. (levy vars.s |=(n=@ud ?=(~ (itype-lookup n sub)))) ~
13424+ =/ bounded=(unit dgscan) (dg-scan ~[typ.s] sub (dec fuel) ~)
13425+ ?~ bounded ~
13426+ =/ normalized=itype (itype-normalize typ.s sub)
13427+ ?: (itype-has-tag normalized) ~
13428+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
13429+ ?. (levy vars |=(n=@ud (lien vars.s |=(v=@ud =(v n))))) ~
13430+ =/ rest=(unit ienv) (dg-close-env t.env sub fuel.u.bounded)
13431+ ?~ rest ~
13432+ `[[name.i.env [normalized vars.s]] u.rest]
13433+::
13434+:: A deferred boolean branch has exactly the two literal flag patterns.
13435+:: Arms are inferred in order. Equal types are retained; two direct pending
13436+:: literals may instead retain source-owned obligations for later context.
13437+++ dg-boolean-patterns
13438+ |= e=expr
13439+ ^- ?
13440+ ?. ?=(%branch -.e) |
13441+ ?~ arms.e |
13442+ ?~ t.arms.e |
13443+ ?^ t.t.arms.e |
13444+ =/ x=arm i.arms.e
13445+ =/ y=arm i.t.arms.e
13446+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) |
13447+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) |
13448+ !=(val.lit.pat.x val.lit.pat.y)
13449+:: Only a direct source literal which created its own unbound pending tag
13450+:: may create a branch edge. The caller must retain the exact source and state.
13451+++ dg-owned-arm-literal
13452+ |= [e=expr t=itype tags=(list ipending) sub=isub initial=@ud]
13453+ ^- ?
13454+ ?. ?=(%lit -.e) |
13455+ ?. ?=(%tag -.t) |
13456+ ?: constructor.t |
13457+ ?. =(lit.e literal.t) |
13458+ ?: (lth id.t initial) |
13459+ ?^ (itype-lookup id.t sub) |
13460+ (lien tags |=(x=ipending &(=(id.x id.t) =(literal.x literal.t))))
13461+++ dg-boolean-branch
13462+ |= [e=expr env=ienv state=istate]
13463+ ^- iresult
13464+ ?. (dg-boolean-patterns e) [%| ["deferred branch patterns need unsupported inference" ~]]
13465+ ?> ?=(%branch -.e)
13466+ ?> ?=(^ arms.e)
13467+ ?> ?=(^ t.arms.e)
13468+ =/ x=arm i.arms.e
13469+ =/ y=arm i.t.arms.e
13470+ =/ subject=iresult (infer-fragment subject.e env state)
13471+ ?: ?=(%| -.subject) subject
13472+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
13473+ ?~ su [%| ["deferred branch subject does not unify with ?" ~]]
13474+ =/ left=iresult (infer-fragment val.x env state.p.subject(sub u.su))
13475+ ?: ?=(%| -.left) left
13476+ =/ right=iresult (infer-fragment val.y env state.p.left)
13477+ ?: ?=(%| -.right) right
13478+ ?. (dg-stable-fit typ.p.left typ.p.right sub.state.p.right)
13479+ =/ st=istate state.p.right
13480+ ?. (dg-owned-arm-literal val.x typ.p.left tags.st sub.st next.state)
13481+ [%| ["deferred branch arm context needs unsupported inference" ~]]
13482+ ?. (dg-owned-arm-literal val.y typ.p.right tags.st sub.st next.state)
13483+ [%| ["deferred branch arm context needs unsupported inference" ~]]
13484+ ?> ?=(%tag -.typ.p.left)
13485+ ?> ?=(%tag -.typ.p.right)
13486+ ?: =(id.typ.p.left id.typ.p.right)
13487+ [%| ["deferred branch arm context needs unsupported inference" ~]]
13488+ ?: (gth (lent obligations.st) 62)
13489+ [%| ["deferred branch arm context needs unsupported inference" ~]]
13490+ =/ result=itype [%var next.st]
13491+ =/ ex=dgo [typ.p.left result (span-of val.x) (span-of e)]
13492+ =/ ey=dgo [typ.p.right result (span-of val.y) (span-of e)]
13493+ [%& result st(next +(next.st), obligations [ex ey obligations.st])]
13494+ [%& typ.p.left state.p.right]
13495+::
13496+:: A direct tuple literal may wait for a later exact result context.
13497+:: Each pending literal retains its source tag and its own fit obligation.
13498+++ dg-infer-tuple-items
13499+ |= [items=(list item) env=ienv state=istate]
13500+ ^- iresult
13501+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
13502+ =/ head=iresult (infer-fragment val.i.items env state)
13503+ ?: ?=(%| -.head) head
13504+ =/ typ=itype typ.p.head
13505+ =/ st=istate state.p.head
13506+ =/ adjusted=(unit [typ=itype state=istate])
13507+ ?. (dg-owned-arm-literal val.i.items typ tags.st sub.st next.state) `[typ st]
13508+ ?: (gth (lent obligations.st) 63) ~
13509+ =/ pending=itype [%var next.st]
13510+ =/ edge=dgo [typ pending (span-of val.i.items) at.i.items]
13511+ `[pending st(next +(next.st), obligations [edge obligations.st])]
13512+ ?~ adjusted [%| ["deferred tuple context needs unsupported inference" ~]]
13513+ =. typ typ.u.adjusted
13514+ =. st state.u.adjusted
13515+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
13516+ ?~ t.items [%& typ st]
13517+ =/ tail=iresult $(items t.items, state st)
13518+ ?: ?=(%| -.tail) tail
13519+ [%& [%cell typ typ.p.tail] state.p.tail]
13520+::
13521+:: Deferred inference uses only source forms whose successful fit sites are
13522+:: guarded below; a shared source-node budget bounds this screen.
13523+++ dg-safe-expressions
13524+ |= [todo=(list expr) fuel=@ud]
13525+ ^- (unit @ud)
13526+ ?~ todo `fuel
13527+ =/ first=(unit @ud) (dg-safe-expression i.todo fuel)
13528+ ?~ first ~
13529+ $(todo t.todo, fuel u.first)
13530+++ dg-safe-items
13531+ |= [items=(list item) fuel=@ud]
13532+ ^- (unit @ud)
13533+ ?~ items `fuel
13534+ =/ first=(unit @ud) (dg-safe-expression val.i.items fuel)
13535+ ?~ first ~
13536+ $(items t.items, fuel u.first)
13537+++ dg-safe-expression
13538+ |= [e=expr fuel=@ud]
13539+ ^- (unit @ud)
13540+ ?: =(0 fuel) ~
13541+ =. fuel (dec fuel)
13542+ ?+ -.e ~
13543+ ?(%lit %ctor) `fuel
13544+ %wing ?:(?=([@ ~] names.e) `fuel ~)
13545+ %str
13546+ ?. (levy pieces.e |=(p=piece ?=(%text -.p))) ~
13547+ `fuel
13548+ %group $(e inner.e, fuel fuel)
13549+ %body
13550+ ?^ defs.e ~
13551+ $(e final.e, fuel fuel)
13552+ %gate $(e body.e, fuel fuel)
13553+ %gate-wide $(e body.e, fuel fuel)
13554+ %tuple (dg-safe-items items.e fuel)
13555+ %branch
13556+ ?. (dg-boolean-patterns e) ~
13557+ ?> ?=(^ arms.e)
13558+ ?> ?=(^ t.arms.e)
13559+ =/ subject=(unit @ud) $(e subject.e, fuel fuel)
13560+ ?~ subject ~
13561+ (dg-safe-expressions ~[val.i.arms.e val.i.t.arms.e] u.subject)
13562+ %cast $(e val.e, fuel fuel)
13563+ %call
13564+ =/ head=(unit @ud) $(e head.e, fuel fuel)
13565+ ?~ head ~
13566+ (dg-safe-expressions args.e u.head)
13567+ ==
13568+:: Exact normalized equality is preserved by all later substitutions.
13569+:: The bounded scan declines opaque types and oversized inputs.
13570+++ dg-stable-fit
13571+ |= [actual=itype expected=itype sub=isub]
13572+ ^- ?
13573+ ?~ (dg-scan ~[actual expected] sub 512 ~) |
13574+ =((itype-normalize actual sub) (itype-normalize expected sub))
13575+::
13576+:: A positional call peels sample-slot faces during its separate face check.
13577+:: Require its argument, sample and result closed so that check stays valid.
13578+++ dg-stable-call-fit
13579+ |= [actual=itype expected=itype product=itype sub=isub positional=?]
13580+ ^- ?
13581+ =/ checked=(unit dgscan) (dg-scan ~[actual expected product] sub 512 ~)
13582+ ?~ checked |
13583+ ?: &(positional ?=(^ ids.u.checked)) |
13584+ =((itype-normalize actual sub) (itype-normalize expected sub))
13585+::
13586+:: One definition attempt retains state only when inference succeeds.
13587++$ dg-step [env=ienv state=istate pending=(list dgo)]
13588+++ dg-stage-one
13589+ |= [d=def env=ienv state=istate]
13590+ ^- (unit dg-step)
13591+ ?> ?=(%value -.d)
13592+ ?~ (dg-safe-expression val.d 512) ~
13593+ =/ local=istate (reserve-def-caps val.d state)
13594+ :: This first slice declines all written capitals and holes/projections.
13595+ ?^ caps.local ~
13596+ =/ ordinary=iresult (infer-fragment val.d env local)
13597+ ?: ?=(%| -.ordinary) ~
13598+ =/ typ=itype typ.p.ordinary
13599+ =/ after=istate state.p.ordinary
13600+ =/ edges=(list dgo) obligations.after
13601+ ?. =(binders.after binders.state) ~
13602+ ?. =(molds.after molds.state) ~
13603+ ?. =(globals.after globals.state) ~
13604+ ?. =(externals.after externals.state) ~
13605+ ?. =(surs.after surs.state) ~
13606+ ?. =(mark-externals.after mark-externals.state) ~
13607+ ?. =(marks.after marks.state) ~
13608+ ?. =(jimports.after jimports.state) ~
13609+ ?. =(reserved-molds.after reserved-molds.state) ~
13610+ ?. =(params.after params.state) ~
13611+ ?. =(active.after active.state) ~
13612+ ?. =(in-mold.after in-mold.state) ~
13613+ ?. =(at.after at.state) ~
13614+ ?. =(top-molds.after top-molds.state) ~
13615+ ?. =(prelude.after prelude.state) ~
13616+ ?. =(gate-defs.after gate-defs.state) ~
13617+ ?. =(head-evidence.after head-evidence.state) ~
13618+ ?. =(grec-index.after grec-index.state) ~
13619+ ?. =(defer.after defer.state) ~
13620+ ?. =(holes.after holes.state) ~
13621+ ?. =(caps.after caps.state) ~
13622+ ?. =(projections.after projections.state) ~
13623+ ?: (unsupported-atom-vars (itype-normalize typ sub.after) caps.after binders.after sub.after) ~
13624+ ?: (itype-has-nvar (itype-normalize typ sub.after)) ~
13625+ =/ scheme=(unit ischeme) (dg-generalize typ env edges tags.after ~ after 32.768)
13626+ ?~ scheme ~
13627+ `[[[name.d u.scheme] env] after edges]
13628+:: Retry only definitions that did not infer. Successful definitions are
13629+:: committed into the local transaction, never published until all close.
13630+++ dg-stage
13631+ |= [ds=(list def) base=ienv env=ienv state=istate pending=(list dgo) fuel=@ud]
13632+ ^- (unit dgcommit)
13633+ ?: (gth fuel 64) ~
13634+ ?: (gth (lent ds) fuel) ~
13635+ =/ remaining=(list def) ds
13636+ =/ waiting=(list def) ~
13637+ =/ progress=? |
13638+ =/ attempts=@ud (mul fuel fuel)
13639+ |-
13640+ ?~ remaining
13641+ ?^ waiting
13642+ ?. progress ~
13643+ $(remaining (flop waiting), waiting ~, progress |)
13644+ =/ replayed=(unit istate) (dg-replay-edges pending state 64)
13645+ ?~ replayed ~
13646+ ?: (pending-tags tags.u.replayed sub.u.replayed) ~
13647+ =/ closed-edges=(unit dgscan) (dg-obligations pending sub.u.replayed 32.768 ~)
13648+ ?~ closed-edges ~
13649+ ?^ ids.u.closed-edges ~
13650+ =/ rechecked=(unit istate) (dg-replay-edges pending u.replayed 64)
13651+ ?~ rechecked ~
13652+ ?. =(sub.u.rechecked sub.u.replayed) ~
13653+ ?. =(next.u.rechecked next.u.replayed) ~
13654+ =/ closed=(unit ienv) (dg-close-env env sub.u.replayed 32.768)
13655+ ?~ closed ~
13656+ `[[u.closed u.replayed(defer ~, obligations ~)]]
13657+ ?: =(0 attempts) ~
13658+ =. attempts (dec attempts)
13659+ =/ d=def i.remaining
13660+ ?: ?=(%mold -.d) $(remaining t.remaining)
13661+ ?^ (ienv-lookup name.d base) $(remaining t.remaining)
13662+ ?^ (ienv-lookup name.d env) ~
13663+ =/ done=(unit dg-step) (dg-stage-one d env state)
13664+ ?~ done $(remaining t.remaining, waiting [d waiting])
13665+ $(remaining t.remaining, env env.u.done, state state.u.done, pending pending.u.done, progress &)
13666+::
13667+:: Cheap bounded eligibility check on the already parsed source. This
13668+:: deliberately covers only direct constructor calls beneath transparent
13669+:: groups, gates, casts and definition-free bodies. Other shapes decline
13670+:: this fallback without a second parse or resolution pass.
13671+++ dg-direct-source
13672+ |= [e=expr fuel=@ud]
13673+ ^- ?
13674+ ?: =(0 fuel) |
13675+ ?+ -.e |
13676+ %group $(e inner.e, fuel (dec fuel))
13677+ %gate $(e body.e, fuel (dec fuel))
13678+ %gate-wide $(e body.e, fuel (dec fuel))
13679+ %cast $(e val.e, fuel (dec fuel))
13680+ %body ?~(defs.e $(e final.e, fuel (dec fuel)) |)
13681+ %call
13682+ ?. ?=([* ~] args.e) |
13683+ ?=(%ctor -.i.args.e)
13684+ ==
13685+++ dg-source-candidate
13686+ |= [ds=(list def) fuel=@ud]
13687+ ^- ?
13688+ ?~ ds |
13689+ ?: =(0 fuel) |
13690+ ?. ?=(%value -.i.ds) $(ds t.ds, fuel (dec fuel))
13691+ ?: (dg-direct-source val.i.ds 64) &
13692+ $(ds t.ds, fuel (dec fuel))
13693+::
13694+++ dg-prepared-source
13695+ |= [e=expr fuel=@ud]
13696+ ^- ?
13697+ ?: (dg-direct-source e fuel) &
13698+ ?: =(0 fuel) |
13699+ ?+ -.e |
13700+ %group $(e inner.e, fuel (dec fuel))
13701+ %gate $(e body.e, fuel (dec fuel))
13702+ %gate-wide $(e body.e, fuel (dec fuel))
13703+ %cast $(e val.e, fuel (dec fuel))
13704+ %body ?~(defs.e $(e final.e, fuel (dec fuel)) |)
13705+ %tuple &
13706+ ==
13707+++ dg-prepared-candidate
13708+ |= [ds=(list def) fuel=@ud]
13709+ ^- ?
13710+ ?~ ds |
13711+ ?: =(0 fuel) |
13712+ ?. ?=(%value -.i.ds) $(ds t.ds, fuel (dec fuel))
13713+ ?: (dg-prepared-source val.i.ds 64) &
13714+ $(ds t.ds, fuel (dec fuel))
13715+::
13716+++ dg-interface-safe
13717+ |= [env=ienv]
13718+ ^- ?
13719+ ?~ env &
13720+ =/ sc=ischeme scheme.i.env
13721+ ?: |((itype-has-hidden-recursive typ.sc) (itype-has-hidden-generic typ.sc)) |
13722+ ?: (gth (lent vars.sc) 26) |
13723+ $(env t.env)
13724+:: Parse status and the transaction result come from the same source parse.
13725++$ dgparse [parsed=? result=(unit dgcommit)]
13726+++ dg-root-source
13727+ |= [at=path src=@t]
13728+ ^- (unit dgcommit)
13729+ result:(dg-root-detail at src)
13730+++ dg-root-detail
13731+ |= [at=path src=@t]
13732+ ^- dgparse
13733+ =/ parsed (parse at src)
13734+ ?: ?=(%| -.parsed) [| ~]
13735+ =/ transact
13736+ |.
13737+ ?^ imports.p.parsed ~
13738+ ?. (module-scope-valid p.parsed ~ ~) ~
13739+ ?^ (duplicate-defs defs.p.parsed) ~
13740+ =/ defs=(list def) defs.p.parsed
13741+ ?: (gth (lent defs) 64) ~
13742+ =/ molds=imolds (collect-simple-molds defs)
13743+ =/ globals=(list term) (global-value-names defs)
13744+ =/ resolution=iresolved (resolve-groups defs molds globals ~ ~ ~ ~ ~ ~ at ~)
13745+ ?^ grouped.resolution ~
13746+ ?^ artifacts.resolution ~
13747+ =/ base=ienv env.resolution
13748+ =/ free=(unit dgscan) (dg-env base ~ 32.768 ~)
13749+ ?~ free ~
13750+ ?^ ids.u.free ~
13751+ =/ all=(unit dgscan) (dg-all-env-ids base 32.768 ~)
13752+ ?~ all ~
13753+ =/ fresh=@ud (dg-next-id ids.u.all 0)
13754+ =/ st=istate *istate
13755+ =. st st(next fresh, defer `~, molds molds, globals globals, at at, top-molds (turn molds |=(m=[name=term body=shape] name.m)), in-mold |, jrec-fuel 256)
13756+ =/ checked-molds=(each imold-types @t) (module-mold-types molds st)
13757+ ?: ?=(%| -.checked-molds) ~
13758+ (dg-stage defs base base st ~ 64)
13759+ ::
13760+ [& (transact)]
13761+:: The caller supplies the trusted prepared prelude. This transaction is
13762+:: only report evidence; the ordinary module resolver does not publish it.
13763+++ dg-root-prepared
13764+ |= [at=path src=@t prepared=iprelude]
13765+ ^- (unit dgcommit)
13766+ ?: ?=([%ui %api *] at) ~
13767+ ?: ?=([%ui %stores *] at) ~
13768+ ?: (gth (met 3 src) 65.536) ~
13769+ =/ parsed (parse at src)
13770+ ?: ?=(%| -.parsed) ~
13771+ ?^ imports.p.parsed ~
13772+ ?. (module-scope-valid p.parsed values.prepared molds.prepared) ~
13773+ ?^ (duplicate-defs defs.p.parsed) ~
13774+ =/ defs=(list def) defs.p.parsed
13775+ ?: (gth (lent defs) 64) ~
13776+ ?: (lien (global-value-names defs) |=(n=term =(n %main))) ~
13777+ ?. (dg-prepared-candidate defs 64) ~
13778+ =/ local-molds=imolds (collect-simple-molds defs)
13779+ =/ globals=(list term) (weld values.prepared (global-value-names defs))
13780+ =/ iface=ifile iface.prepared
13781+ =/ prelude=(unit ifile) `iface
13782+ =/ resolution=iresolved
13783+ (resolve-groups defs local-molds globals ~ ~ ~ ~ ~ molds.prepared at prelude)
13784+ ?^ grouped.resolution ~
13785+ ?^ artifacts.resolution ~
13786+ =/ base=ienv env.resolution
13787+ =/ templates=ienv
13788+ (turn molds.iface |=(x=[name=term template=ischeme] [name.x template.x]))
13789+ =/ all-env=ienv (weld base (weld values.iface templates))
13790+ =/ free=(unit dgscan) (dg-env all-env ~ 32.768 ~)
13791+ ?~ free ~
13792+ ?^ ids.u.free ~
13793+ =/ all=(unit dgscan) (dg-all-env-ids all-env 32.768 ~)
13794+ ?~ all ~
13795+ =/ fresh=@ud (dg-next-id ids.u.all 0)
13796+ =/ st=istate *istate
13797+ =. st st(next fresh, defer `~, molds local-molds, globals globals, at at, reserved-molds molds.prepared, prelude prelude, top-molds (turn local-molds |=(m=[name=term body=shape] name.m)), in-mold |, jrec-fuel 256)
13798+ =/ checked-molds=(each imold-types @t) (module-mold-types local-molds st)
13799+ ?: ?=(%| -.checked-molds) ~
13800+ (dg-stage defs base base st ~ 64)
13801+::
13802+++ dg-all-env-ids
13803+ |= [env=ienv fuel=@ud ids=(list @ud)]
13804+ ^- (unit dgscan)
13805+ ?~ env `[ids fuel]
13806+ ?: =(0 fuel) ~
13807+ =/ sc=ischeme scheme.i.env
13808+ ?: (itype-has-tag typ.sc) ~
13809+ =/ raw=(unit dgscan) (dg-scan ~[typ.sc] ~ (dec fuel) ids)
13810+ ?~ raw ~
13811+ =/ quant=(unit dgscan) (dg-scan-ids vars.sc ~ fuel.u.raw ids.u.raw)
13812+ ?~ quant ~
13813+ $(env t.env, fuel fuel.u.quant, ids ids.u.quant)
13814+::
13815+++ dg-next-id
13816+ |= [ids=(list @ud) largest=@ud]
13817+ ^- @ud
13818+ ?~ ids +(largest)
13819+ $(ids t.ids, largest (max largest i.ids))
13820+::
13821+++ dg-eligible-ctor
13822+ |= [e=expr head=itype actual=itype expected=itype state=istate]
13823+ ^- (unit dgo)
13824+ ?. ?=(%call -.e) ~
13825+ ?. ?=([* ~] args.e) ~
13826+ ?. ?=(%ctor -.i.args.e) ~
13827+ ?. ?=(%fn -.head) ~
13828+ ?. ?=(%fn -.expected) ~
13829+ ?. ?=(%tag -.actual) ~
13830+ ?. constructor.actual ~
13831+ ?. ?=(%var -.product.expected) ~
13832+ ?^ (itype-lookup id.product.expected sub.state) ~
13833+ =/ bounded=(unit dgscan) (dg-scan ~[sample.expected] sub.state 256 ~)
13834+ ?~ bounded ~
13835+ ?^ ids.u.bounded ~
13836+ `[[actual expected (span-of i.args.e) (span-of head.e)]]
13837+::
13838+:: Experimental per-module, source-derived recursive tree index.
13839+:: The two tags and the exact children/list/self layout are fixed-shape
13840+:: checks, so ordinary definitions incur no type-tree or source scans.
13841+++ grec-tagged-fields
13842+ |= sh=shape
13843+ ^- (unit [tag=@ fields=(list field)])
13844+ ?. ?=(%cell -.sh) ~
13845+ ?~ fields.sh ~
13846+ =/ head=field i.fields.sh
13847+ ?. ?=(%bare -.head) ~
13848+ ?. ?=(%const -.shape.head) ~
13849+ ?. &(?=(%term form.lit.shape.head) =(%tas aura.lit.shape.head)) ~
13850+ `[val.lit.shape.head t.fields.sh]
13851+++ grec-tree-children
13852+ |= [fs=(list field) param=@t]
13853+ ^- (unit field)
13854+ ?~ fs ~
13855+ ?~ t.fs `i.fs
13856+ ?^ t.t.fs ~
13857+ =/ event=field i.fs
13858+ =/ kids=field i.t.fs
13859+ ?. &(?=(%face -.event) ?=(%face -.kids)) ~
13860+ ?. !=(name.event name.kids) ~
13861+ ?. ?=(%fn -.shape.event) ~
13862+ ?. ?=(%aura -.sample.shape.event) ~
13863+ ?. =(%t aura.sample.shape.event) ~
13864+ ?. ?=(%tvar -.product.shape.event) ~
13865+ ?. =(param name.product.shape.event) ~
13866+ `kids
13867+::
13868+++ grec-tree-proof
13869+ |= [name=term sh=shape]
13870+ ^- ?
13871+ ?. ?=(%generic -.sh) |
13872+ ?. ?=([@ ~] vars.sh) |
13873+ =/ param=@t i.vars.sh
13874+ ?. ?=(%union -.body.sh) |
13875+ ?. ?=([* [* ~]] cases.body.sh) |
13876+ =/ a=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.cases.body.sh)
13877+ =/ b=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.t.cases.body.sh)
13878+ ?~ a |
13879+ ?~ b |
13880+ ?. !=(tag.u.a tag.u.b) |
13881+ ?. ?=([* ~] fields.u.a) |
13882+ =/ value=field i.fields.u.a
13883+ ?. ?=(%face -.value) |
13884+ ?. ?=(%aura -.shape.value) |
13885+ ?. =(%t aura.shape.value) |
13886+ =/ selected=(unit field) (grec-tree-children fields.u.b param)
13887+ ?~ selected |
13888+ =/ kids=field u.selected
13889+ ?. ?=(%face -.kids) |
13890+ ?. ?=(%apply -.shape.kids) |
13891+ ?. =(ref.shape.kids ~[%list]) |
13892+ ?. ?=([* ~] args.shape.kids) |
13893+ =/ self=shape i.args.shape.kids
13894+ ?. ?=(%apply -.self) |
13895+ ?. =(ref.self ~[name]) |
13896+ ?. ?=([* ~] args.self) |
13897+ ?. ?=(%tvar -.i.args.self) |
13898+ =(name.i.args.self param)
13899++$ grec-collected [molds=imolds proofs=(map term shape)]
13900+:: Experimental one-layer analysis view, never an exported mold identity.
13901+++ grec-unfold-view
13902+ |= [typ=itype fuel=@ud]
13903+ ^- (unit [view=itype left=@ud])
13904+ ?. ?=(%grec -.typ) ~
13905+ ?: =(fuel 0) ~
13906+ ?. ?=([* ~] args.typ) ~
13907+ =/ sh=shape proof.typ
13908+ ?. (grec-tree-proof name.typ sh) ~
13909+ ?> ?=(%generic -.sh)
13910+ ?> ?=([@ ~] vars.sh)
13911+ ?> ?=(%union -.body.sh)
13912+ ?> ?=([* [* ~]] cases.body.sh)
13913+ =/ ca=shape i.cases.body.sh
13914+ =/ cb=shape i.t.cases.body.sh
13915+ ?> ?=(%cell -.ca)
13916+ ?> ?=(%cell -.cb)
13917+ ?> ?=([* [* ~]] fields.ca)
13918+ ?> ?=([* *] fields.cb)
13919+ =/ tag-a=field i.fields.ca
13920+ =/ tag-b=field i.fields.cb
13921+ ?> ?=(%bare -.tag-a)
13922+ ?> ?=(%bare -.tag-b)
13923+ ?> ?=(%const -.shape.tag-a)
13924+ ?> ?=(%const -.shape.tag-b)
13925+ =/ text-field=field i.t.fields.ca
13926+ ?> ?=(%face -.text-field)
13927+ =/ branch=(list field) t.fields.cb
13928+ =/ kids=(unit field) (grec-tree-children branch i.vars.sh)
13929+ ?~ kids ~
13930+ ?> ?=(%face -.u.kids)
13931+ =/ children=itype [%face name.u.kids [%collection %list ~[typ]]]
13932+ ?> ?=(^ branch)
13933+ =/ payload=itype
13934+ ?~ t.branch children
13935+ =/ event=field i.branch
13936+ ?> ?=(%face -.event)
13937+ [%cell [%face name.event [%fn [%atom %t] i.args.typ]] children]
13938+ =/ leaf=itype [%cell [%const lit.shape.tag-a] [%face name.text-field [%atom %t]]]
13939+ =/ node=itype [%cell [%const lit.shape.tag-b] payload]
13940+ `[[%union ~[leaf node] ~ ~ ~] (dec fuel)]
13941+::
13942+++ grec-collect-molds
13943+ |= ds=(list def)
13944+ ^- grec-collected
13945+ ?~ ds [~ *(map term shape)]
13946+ =/ rest=grec-collected $(ds t.ds)
13947+ ?. ?=(%mold -.i.ds) rest
13948+ =/ name=term name.i.ds
13949+ =/ body=shape shape.i.ds
13950+ =/ proofs=(map term shape) proofs.rest
13951+ =? proofs (grec-tree-proof name body) (~(put by proofs) name body)
13952+ [[[name body] molds.rest] proofs]
13953+::
13954+
195013955--
jibb-dev/lib/jibb/internal.jibbnew file+33
@@ -0,0 +1,33 @@
1+/= core /lib/jibb/primitives
2+
3+:: Representation for agent and in-process store pokes.
4+:: The prelude re-exports this mold; effect lowering and the runtime must
5+:: agree on these cells when effect execution is implemented.
6++$ poke
7+ [%agent agent=@tas mark=@tas payload=*]
8+ [%store module=@t action=@tas payload=*]
9+
10+:: The compiler supplies this private interface; execution is not yet implemented.
11+++ gth-atom |= args=[A A] (raw-gth.core args)
12+
13+:: Application paths are knot sequences.
14++$ qath
15+ ~
16+ [i=@ta t=qath]
17+
18+:: Private compiler primitive wrappers; execution is a later milestone.
19+++ add-atom |= args=[A A] (raw-add.core args)
20+++ dec-atom |= atom=A (raw-dec.core atom)
21+++ trip-text |= value=@t (raw-trip.core value)
22+++ tuba-text |= values (raw-tuba.core values)
23+
24+:: Transparent request data. Identity and path fields are writable and do not
25+:: prove a schema or watchability. A future executor must bind them to checked
26+:: source evidence and validate facts and state; generated receivers must
27+:: decode before calling typed replies or folds. Runtime validation, watch
28+:: provenance and effect execution are not implemented.
29++$ agent-path (list.core @ta)
30++$ ask |$ [M]
31+ [%pure value=M]
32+ [%agent api=@t case=@tas agent=@tas path=agent-path scry=(unit.core agent-path) receive=$-([mark=@tas state=(unit.core *) fact=*] [state=* message=M])]
33+ [%store module=@t name=@tas receive=$-([state=(unit.core *) fact=*] [state=* message=M])]
jibb-dev/lib/jibb/prelude.jibbnew file+507
@@ -0,0 +1,507 @@
1+/= internal /lib/jibb/internal
2++$ poke poke.internal
3++$ qath qath.internal
4+
5+:: Initial prelude functions. The rest of the inventory is still to come.
6+
7+++ same |= x=A x
8+
9+++ head |= p=[A B]
10+ ?- p
11+ [a b] a
12+
13+++ tail |= p=[A B]
14+ ?- p
15+ [a b] b
16+
17+++ not |= b=?
18+ ?- b
19+ %.y %.n
20+ %.n %.y
21+
22++$ list |$ [A]
23+ ~
24+ [i=A t=(list A)]
25+
26++$ unit |$ [A]
27+ ~
28+ [~ u=A]
29+
30+++ fall |= args=[(unit A) A]
31+ ?- args
32+ [maybe fallback]
33+ ?- maybe
34+ ~ fallback
35+ [~ value] value
36+
37+++ need |= maybe=(unit A)
38+ ?- maybe
39+ ~ !!
40+ [~ value] value
41+
42+++ weld |= args=[(list A) (list A)]
43+ ?- args
44+ [xs ys]
45+ ^- (list A)
46+ ?- xs
47+ ~ ys
48+ [item rest] [item (weld rest ys)]
49+
50+++ turn |= args=[(list A) $-(A B)]
51+ ?- args
52+ [xs f]
53+ ^- (list B)
54+ ?- xs
55+ ~ ~
56+ [item rest] [(f item) (turn rest f)]
57+
58++$ dime [p=@ta q=@]
59+
60++$ hair [p=@ud q=@ud]
61+
62++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
63+
64++$ coin
65+ [%$ p=dime]
66+ [%blob p=*]
67+ [%many p=(list coin)]
68+
69++$ pair |$ [A B] [p=A q=B]
70+
71++$ trel |$ [A B C] [p=A q=B r=C]
72+
73++$ qual |$ [A B C D] [p=A q=B r=C s=D]
74+
75++$ cord @t
76+
77++$ knot @ta
78+
79++$ tape (list @tD)
80+
81++$ path (list knot)
82+
83++$ tank
84+ cord
85+ [%leaf p=tape]
86+ [%palm p=(qual tape tape tape tape) q=(list tank)]
87+ [%rose p=(trel tape tape tape) q=(list tank)]
88+
89++$ nail [p=hair q=tape]
90+
91++$ edge [p=hair q=(unit [p=* q=nail])]
92+
93++$ rule $-(nail edge)
94+
95++$ spot [p=path q=pint]
96+
97++$ toon
98+ [%0 p=*]
99+ [%1 p=*]
100+ [%2 p=(list tank)]
101+
102++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
103+
104+++ like |= [f=$-(A B) result=(like A)]
105+ ++ mapped
106+ ^- (unit [p=B q=nail])
107+ ?- q.result
108+ ~ ~
109+ [~ value] `[p=(f p.value) q=q.value]
110+ ^- (like B) [p=p.result q=mapped]
111+
112+++ wonk |= veq=(like A)
113+ ?- q.veq
114+ ~ !!
115+ [~ product] p.product
116+
117++$ lone |$ [A] [p=A]
118+
119++$ lest |$ [A] [i=A t=(list A)]
120+
121++$ pole |$ [A]
122+ ~
123+ [A (pole A)]
124+
125++$ quip |$ [A B] [(list A) B]
126+
127++$ tree |$ [A]
128+ ~
129+ [n=A l=(tree A) r=(tree A)]
130+
131++$ each |$ [A B]
132+ [%| p=B]
133+ [%& p=A]
134+
135++$ bloq @
136+
137+++ some |= item=A `item
138+
139+++ lure |= item=A
140+ ^- (list A) [item ~]
141+
142+++ snoc |= args=[(list A) A]
143+ ?- args
144+ [xs item] (weld xs [item ~])
145+
146+++ flop |= xs=(list A)
147+ ++ reverse-into |= args=[(list A) (list A)]
148+ ?- args
149+ [rest acc]
150+ ?- rest
151+ ~ acc
152+ [item more] (reverse-into more [item acc])
153+ (reverse-into xs ~)
154+
155+++ drop |= maybe=(unit A)
156+ ^- (list A)
157+ ?- maybe
158+ ~ ~
159+ [~ value] [value ~]
160+
161+++ bond |= fallback=$-(~ A)
162+ |= maybe=(unit A)
163+ ?- maybe
164+ ~ (fallback ~)
165+ [~ value] value
166+
167+++ bind |= args=[(unit A) $-(A B)]
168+ ?- args
169+ [maybe f] ^- (unit B)
170+ ?- maybe
171+ ~ ~
172+ [~ value] `(f value)
173+
174+++ biff |= args=[(unit A) $-(A (unit B))]
175+ ?- args
176+ [maybe f] ^- (unit B)
177+ ?- maybe
178+ ~ ~
179+ [~ value] (f value)
180+
181+++ both |= args=[(unit A) (unit B)]
182+ ?- args
183+ [first second] ^- (unit [A B])
184+ ?- first
185+ ~ ~
186+ [~ a]
187+ ?- second
188+ ~ ~
189+ [~ b] `[a b]
190+
191+++ clap |= args=[(unit A) (unit A) $-([A A] A)]
192+ ?- args
193+ [first second combine] ^- (unit A)
194+ ?- first
195+ ~ second
196+ [~ a]
197+ ?- second
198+ ~ first
199+ [~ b] `(combine a b)
200+
201+++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
202+ ?- args
203+ [first second combine] ^- (unit C)
204+ ?- first
205+ ~ ~
206+ [~ a]
207+ ?- second
208+ ~ ~
209+ [~ b] (combine a b)
210+
211+++ skim |= args=[(list A) $-(A ?)]
212+ ?- args
213+ [xs predicate] ^- (list A)
214+ ?- xs
215+ ~ ~
216+ [item rest]
217+ ?- (predicate item)
218+ %.y [item (skim rest predicate)]
219+ %.n (skim rest predicate)
220+
221+++ skip |= args=[(list A) $-(A ?)]
222+ ?- args
223+ [xs predicate] ^- (list A)
224+ ?- xs
225+ ~ ~
226+ [item rest]
227+ ?- (predicate item)
228+ %.y (skip rest predicate)
229+ %.n [item (skip rest predicate)]
230+
231+++ levy |= args=[(list A) $-(A ?)]
232+ ^- ?
233+ ?- args
234+ [xs predicate]
235+ ?- xs
236+ ~ %.y
237+ [item rest]
238+ ?- (predicate item)
239+ %.y (levy rest predicate)
240+ %.n %.n
241+
242+++ lien |= args=[(list A) $-(A ?)]
243+ ^- ?
244+ ?- args
245+ [xs predicate]
246+ ?- xs
247+ ~ %.n
248+ [item rest]
249+ ?- (predicate item)
250+ %.y %.y
251+ %.n (lien rest predicate)
252+
253+++ roll |= args=[(list A) B $-([A B] B)]
254+ ?- args
255+ [xs start combine]
256+ ?- xs
257+ ~ start
258+ [item rest] (roll rest (combine item start) combine)
259+
260+++ reel |= args=[(list A) B $-([A B] B)]
261+ ?- args
262+ [xs start combine]
263+ ?- xs
264+ ~ start
265+ [item rest] (combine item (reel rest start combine))
266+
267+++ flit |= predicate=$-(A ?)
268+ |= value=A
269+ ^- (unit A)
270+ ?- (predicate value)
271+ %.y `value
272+ %.n ~
273+
274+++ murn |= args=[(list A) $-(A (unit B))]
275+ ?- args
276+ [xs f] ^- (list B)
277+ ?- xs
278+ ~ ~
279+ [item rest]
280+ ?- (f item)
281+ ~ (murn rest f)
282+ [~ value] [value (murn rest f)]
283+
284+++ join |= args=[A (list A)]
285+ ?- args
286+ [separator xs] ^- (list A)
287+ ?- xs
288+ ~ ~
289+ [item rest]
290+ ?- rest
291+ ~ [item ~]
292+ [next more] [item [separator (join separator rest)]]
293+
294+++ snip |= xs=(list A)
295+ ^- (list A)
296+ ?- xs
297+ ~ ~
298+ [item rest]
299+ ?- rest
300+ ~ ~
301+ [next more] [item (snip rest)]
302+
303+++ rear |= xs=(list A)
304+ ?- xs
305+ ~ !!
306+ [item rest]
307+ ?- rest
308+ ~ item
309+ [next more] (rear rest)
310+
311+++ cork |= gates=[$-(A B) $-(B C)]
312+ ?- gates
313+ [f g] |= x=A (g (f x))
314+
315+++ corl |= gates=[$-(B C) $-(A B)]
316+ ?- gates
317+ [f g] |= x=A (f (g x))
318+
319+++ cury |= args=[$-([A B] C) A]
320+ ?- args
321+ [f a] |= b=B (f a b)
322+
323+++ curr |= args=[$-([A B] C) B]
324+ ?- args
325+ [f b] |= a=A (f a b)
326+
327++$ cmd |$ [M]
328+ [%poke p=poke reply=$-((unit @t) M)]
329+ [%go url=@t]
330+ [%wait gap=@dr msg=M]
331+ [%now reply=$-(@da M)]
332+ [%who reply=$-(@p M)]
333+
334+++ gth |= args=[A A] (gth-atom.internal args)
335+++ add |= args=[A A] (add-atom.internal args)
336+++ dec |= atom=A (dec-atom.internal atom)
337+
338++$ ask |$ [M] (ask.internal M)
339+++ pure |= x=M ^- (ask M) [%pure x]
340+
341+:: This mold describes the value; island watchability needs separate proof.
342++$ sub |$ [M]
343+ [%watch a=(ask M)]
344+ [%every gap=@dr reply=$-(@da M)]
345+ [%url reply=$-(path M)]
346+
347+:: Count a finite list with the source-backed addition gate.
348+++ lent |= xs=(list A)
349+ ^- @ud
350+ ?- xs
351+ ~ 0
352+ [item rest] (add 1 (lent rest))
353+
354+++ lth |= args=[A A]
355+ ?- args
356+ [x y] (gth y x)
357+
358+++ gte |= args=[A A]
359+ ?- args
360+ [x y] (not (gth y x))
361+
362+++ lte |= args=[A A]
363+ ?- args
364+ [x y] (not (gth x y))
365+
366+++ zing |= xss=(list (list A))
367+ ^- (list A)
368+ ?- xss
369+ ~ ~
370+ [xs rest] (weld xs (zing rest))
371+
372+++ lead |= first=A |= second=B [first second]
373+++ late |= second=B |= first=A [first second]
374+
375+++ succ |= x=A (add x 1)
376+
377+++ trip |= value=@t (trip-text.internal value)
378+++ tuba |= values=(list @tD) (tuba-text.internal values)
379+
380+:: UI values are source-level descriptions only. Nested element payloads are
381+:: erased in the nonrecursive union; the public constructors below retain the
382+:: typed composition boundaries. Raw-constructor encapsulation, rendering and
383+:: execution are not established by this slice.
384++$ length
385+ [%chars n=@ud]
386+ [%fill n=@ud]
387+ %shrink
388+
389++$ align
390+ %start
391+ %center
392+ %end
393+
394++$ role
395+ %body
396+ %caption
397+ %label
398+
399++$ tone
400+ %normal
401+ %muted
402+ %accent
403+ %danger
404+
405++$ attr
406+ [%pad %s0]
407+ [%pad %s1]
408+ [%pad %s2]
409+ [%pad %s3]
410+ [%gap %s0]
411+ [%gap %s1]
412+ [%gap %s2]
413+ [%gap %s3]
414+ [%width width=length]
415+ [%align align=align]
416+ [%role role=role]
417+ [%tone tone=tone]
418+
419++$ element |$ [M]
420+ [%row attrs=(list attr) kids=*]
421+ [%column attrs=(list attr) kids=*]
422+ [%wrap attrs=(list attr) kids=*]
423+ [%stack attrs=(list attr) kids=*]
424+ [%el attrs=(list attr) kid=*]
425+ [%para kids=*]
426+ [%text words=@t]
427+ [%heading level=@ud words=@t]
428+ [%each items=*]
429+ [%table columns=* rows=*]
430+ [%image source=qath description=@t]
431+ [%image-unsafe source=[url=@t width=@ud height=@ud] description=@t]
432+ [%link target=qath label=@t]
433+ [%link-unsafe target=@t label=@t]
434+ [%button label=@t message=M]
435+ [%toggle on=? label=@t message=M]
436+ [%field label=@t value=@t reply=$-(@t M)]
437+ [%form message=M kids=*]
438+ [%island payload=*]
439+
440+++ row |= [attrs=(list attr) kids=(list (element M))]
441+ ^- (element M) [%row attrs kids]
442+
443+++ column |= [attrs=(list attr) kids=(list (element M))]
444+ ^- (element M) [%column attrs kids]
445+
446+++ wrap |= [attrs=(list attr) kids=(list (element M))]
447+ ^- (element M) [%wrap attrs kids]
448+
449+++ stack |= [attrs=(list attr) kids=(list (element M))]
450+ ^- (element M) [%stack attrs kids]
451+
452+++ el |= [attrs=(list attr) kid=(element M)]
453+ ^- (element M) [%el attrs kid]
454+
455+++ para |= kids=(list (element M))
456+ ^- (element M) [%para kids]
457+
458+++ text |= words=@t
459+ ^- (element M) [%text words]
460+
461+++ heading |= [level=@ud words=@t]
462+ ^- (element M) [%heading level words]
463+
464+++ each |= items=(list [key=K el=(element M)])
465+ ^- (element M) [%each items]
466+
467+++ table |= [columns=(list [header=@t width=length align=align]) rows=(list [key=K cells=(list (element M))])]
468+ ^- (element M) [%table columns rows]
469+
470+++ image |= [source=qath description=@t]
471+ ^- (element M) [%image source description]
472+
473+++ image-unsafe |= [source=[url=@t width=@ud height=@ud] description=@t]
474+ ^- (element M) [%image-unsafe source description]
475+
476+++ link |= [target=qath label=@t]
477+ ^- (element M) [%link target label]
478+
479+++ link-unsafe |= [target=@t label=@t]
480+ ^- (element M) [%link-unsafe target label]
481+
482+++ button |= [label=@t message=M]
483+ ^- (element M) [%button label message]
484+
485+++ toggle |= [on=? label=@t message=M]
486+ ^- (element M) [%toggle on label message]
487+
488+++ field |= [label=@t value=@t reply=$-(@t M)]
489+ ^- (element M) [%field label value reply]
490+
491+++ form |= [message=M kids=(list (element M))]
492+ ^- (element M) [%form message kids]
493+
494++$ program |$ [D X M]
495+ [init=$-(D X) update=$-([M X] [X (list (cmd M))]) view=$-(X (element M)) subs=$-(X (list (sub M)))]
496+
497+++ program |= [init=$-(D X) update=$-([M X] [X (list (cmd M))]) view=$-(X (element M)) subs=$-(X (list (sub M)))]
498+ ^- (program D X M) [init update view subs]
499+
500+++ island |= [p=(program D X M) data=D]
501+ ^- (element !!) [%island [p data]]
502+
503++$ page |$ [R D]
504+ [load=$-(R (ask D)) view=$-(D (element !!))]
505+
506+++ page |= [load=$-(R (ask D)) view=$-(D (element !!))]
507+ ^- (page R D) [load view]
my-app/mar/label.hoonnew file+6
@@ -0,0 +1,6 @@
1+:: Fixture for the Hoon mark importer; not supplied by the design doc.
2+|_ a=@t
3+++ grab |% ++ noun @t --
4+++ grow |% ++ noun a --
5+++ grad %noun
6+--
my-app/mar/posts.hoonnew file+7
@@ -0,0 +1,7 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- blog
3+|_ a=(list post:blog)
4+++ grab |% ++ noun (list post:blog) --
5+++ grow |% ++ noun a --
6+++ grad %noun
7+--
my-app/mar/todo-action.hoonnew file+7
@@ -0,0 +1,7 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- todo
3+|_ a=action:todo
4+++ grab |% ++ noun action:todo --
5+++ grow |% ++ noun a --
6+++ grad %noun
7+--
my-app/mar/todo-item.hoonnew file+7
@@ -0,0 +1,7 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- todo
3+|_ a=item:todo
4+++ grab |% ++ noun item:todo --
5+++ grow |% ++ noun a --
6+++ grad %noun
7+--
my-app/mar/todo-update.hoonnew file+7
@@ -0,0 +1,7 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- todo
3+|_ a=update:todo
4+++ grab |% ++ noun update:todo --
5+++ grow |% ++ noun a --
6+++ grad %noun
7+--
my-app/mar/todos.hoonnew file+7
@@ -0,0 +1,7 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- todo
3+|_ a=(list item:todo)
4+++ grab |% ++ noun (list item:todo) --
5+++ grow |% ++ noun a --
6+++ grad %noun
7+--
my-app/sur/blog.hoonnew file+6
@@ -0,0 +1,6 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+|%
3++$ title @t
4++$ post [title=title slug=@ta]
5++$ chain $@(~ [value=@ud next=chain])
6+--
my-app/sur/import-fixture.hoonnew file+7
@@ -0,0 +1,7 @@
1+/- blog
2+:: Fixture for the Hoon importer; not supplied by the design doc.
3+|%
4++$ sample [title=title:blog values=(list @ud)]
5++$ recursive chain:blog
6++$ nested [id=@ud value=$^(@ud [a=@ud b=@t])]
7+--
my-app/sur/todo.hoonnew file+12
@@ -0,0 +1,12 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+|%
3++$ item [id=@ud done=? text=@t]
4++$ action
5+ $% [%add text=@t]
6+ [%toggle id=@ud]
7+ ==
8++$ update
9+ $% [%added item=item]
10+ [%toggled id=@ud]
11+ ==
12+--
my-app/ui/api/blog.jibbnew file+5
@@ -0,0 +1,5 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/% %posts
3+
4++$ paths
5+ [%posts /posts posts]
my-app/ui/api/todo.jibb+2−2
@@ -7,7 +7,7 @@
77
88+$ item item.todo
99+$ poke todo-action
10−+$ paths $?
10++$ paths
1111 [%todos /todos todos]
1212 [%changes /changes (facts todos todo-update)]
13− [%todo /todo/[id=@ud] todo-item]
13+ [%todo-by-id /todo/[id=@ud] todo-item]
my-app/ui/basket.jibb+1−1
@@ -4,7 +4,7 @@
44++ main (program init update view subs)
55
66+$ model [cart=state.cart note=@t]
7−+$ msg $?
7++$ msg
88 [%noted text=@t]
99 %add
1010 %toggle
my-app/ui/components/card.jibbnew file+5
@@ -0,0 +1,5 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- blog
3+
4+++ card |= p=post.blog
5+ text title.p
my-app/ui/stores/cart.jibb+1−1
@@ -1,6 +1,6 @@
11:: /ui/stores/cart.jibb
22+$ state [items=(list @t) open=?]
3−+$ cart-action $?
3++$ cart-action
44 [%add item=@t]
55 %toggle
66+$ poke cart-action
my-app/ui/todo-list.jibb+1−1
@@ -3,7 +3,7 @@
33++ main (program init update view subs)
44
55+$ model [todos=(list item.todo) draft=@t error=(unit @t)]
6−+$ msg $?
6++$ msg
77 [%typed text=@t]
88 %submit
99 [%toggled id=@ud]
tests/checker/unification.txtnew file+1
@@ -0,0 +1 @@
1+unification passed
tests/clay-fixtures/bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ identity: $-(@t @t)'
tests/clay-fixtures/bridge.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ bc=type -.blog
8+=/ title-typ=type (~(play ut bc) (ream '*title'))
9+=/ read-gate=vase (slap reader (ream 'read-mold-in'))
10+=/ title-result=vase (slym read-gate [%blog %title title-typ bc])
11+=/ title=* +.title-result
12+=/ check-gate=vase (slap jibb (ream 'golden-types-imports'))
13+=/ src=@t '/- blog\0a++ identity |= x=title.blog x\0a'
14+(pure:m (slym check-gate [/ui/test/jibb src ~[[%blog %title title]]]))
tests/clay-fixtures/build.txtnew file+11
@@ -0,0 +1,11 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ a=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/todo/hoon)
5+=/ b=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
6+=/ c=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/hoon)
7+=/ d=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todos/hoon)
8+=/ e=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-update/hoon)
9+=/ f=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-item/hoon)
10+=/ g=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/posts/hoon)
11+(pure:m !>([?=([%core *] -.a) ?=([%core *] -.b) ?=([%core *] -.c) ?=([%core *] -.d) ?=([%core *] -.e) ?=([%core *] -.f) ?=([%core *] -.g)]))
tests/clay-fixtures/expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y %.y %.y %.y %.y]
tests/clay-fixtures/ford-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y %.y %.y]
tests/clay-fixtures/ford-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"[title=@t values=(list @ud)]"
tests/clay-fixtures/ford-import.txtnew file+12
@@ -0,0 +1,12 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ cor=type -.src
7+=/ typ=type (~(play ut cor) (ream '*sample'))
8+=/ read-gate=vase (slap reader (ream 'read-mold-in'))
9+=/ got=vase (slym read-gate [%import-fixture %sample typ cor])
10+=/ show-gate=vase (slap reader (ream 'show-result'))
11+=/ result=vase (slym show-gate +.got)
12+(pure:m result)
tests/clay-fixtures/ford-nested-union-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ value: $-([id=@ud value=([a=@ud b=@t] @ud)] ([a=@ud b=@t] @ud))\0a++ values: $-([title=@t values=(list @ud)] (list @ud))\0a++ chain: $-(chain.blog chain.blog)'
tests/clay-fixtures/ford-nested-union-bridge.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
6+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
7+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
8+=/ read-gate=vase (slap reader (ream 'read-named'))
9+=/ result=vase (slym read-gate [%import-fixture %nested -.src])
10+=/ sample-result=vase (slym read-gate [%import-fixture %sample -.src])
11+=/ chain-result=vase (slym read-gate [%blog %chain -.blog])
12+=/ check-gate=vase (slap jibb (ream 'golden-types-imports'))
13+=/ text=@t '/- import-fixture\0a/- blog\0a++ value |= x=nested.import-fixture value.x\0a++ values |= x=sample.import-fixture values.x\0a++ chain |= x=chain.blog x\0a'
14+(pure:m (slym check-gate [/ui/test/jibb text ~[[%import-fixture %nested +.result] [%import-fixture %sample +.sample-result] [%blog %chain +.chain-result]]]))
tests/clay-fixtures/ford-nested-union-expected.txtnew file+1
@@ -0,0 +1 @@
1+"[id=@ud value=(union [a=@ud b=@t] @ud)]"
tests/clay-fixtures/ford-nested-union.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-named'))
7+=/ got=vase (slym read-gate [%import-fixture %nested -.src])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/ford-recursive-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [value=@ud next=chain.blog] @n:0)"
tests/clay-fixtures/ford-recursive.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-named'))
7+=/ got=vase (slym read-gate [%import-fixture %recursive -.src])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/ford.txtnew file+13
@@ -0,0 +1,13 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ cor=type -.src
6+?. ?=([%core *] cor) (pure:m !>('not a core'))
7+=/ subject=type q.q.cor
8+=/ cell=? ?=([%cell *] subject)
9+=/ face=? ?=([%cell [%face %blog *] *] subject)
10+=/ core=? ?=([%cell [%face %blog [%core *]] *] subject)
11+=/ tail=? ?:(?=([%cell *] subject) =(q.subject -:!>(..zuse)) |)
12+=/ payload=? =(p.cor subject)
13+(pure:m !>([cell face core tail payload]))
tests/clay-fixtures/import-expected.txtnew file+5
@@ -0,0 +1,5 @@
1+[ '[id=@ud [done=(union @f:0 @f:1) text=@t]]'
2+ '(union [add text=@t] [toggle id=@ud])'
3+ '[title=@t slug=@ta]'
4+ '@t'
5+]
tests/clay-fixtures/import.txtnew file+13
@@ -0,0 +1,13 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+@@READER@@
4+=/ now=@da now.bowl
5+=/ todo=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/todo/hoon)
6+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
7+=/ tc=type -.todo
8+=/ bc=type -.blog
9+=/ item (read-mold-in:reader %todo %item (~(play ut tc) (ream '*item')) tc)
10+=/ action (read-mold-in:reader %todo %action (~(play ut tc) (ream '*action')) tc)
11+=/ post (read-mold-in:reader %blog %post (~(play ut bc) (ream '*post')) bc)
12+=/ title (read-mold-in:reader %blog %title (~(play ut bc) (ream '*title')) bc)
13+(pure:m !>([(crip (show-result:reader item)) (crip (show-result:reader action)) (crip (show-result:reader post)) (crip (show-result:reader title))]))
tests/clay-fixtures/mark-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ identity: $-(@t @t)'
tests/clay-fixtures/mark-bridge.txtnew file+11
@@ -0,0 +1,11 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/label/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ read-gate=vase (slap reader (ream 'read-mark'))
8+=/ label-result=vase (slym read-gate [%label -.mark])
9+=/ check-gate=vase (slap jibb (ream 'golden-types-with-marks'))
10+=/ src=@t '/% %label\0a++ identity |= x=label x\0a'
11+(pure:m (slym check-gate [/ui/test/jibb src ~ ~[[%label +.label-result]]]))
tests/clay-fixtures/mark-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [add text=@t] [toggle id=@ud])"
tests/clay-fixtures/mark-import.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-mark'))
7+=/ got=vase (slym read-gate [%todo-action -.mark])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/mark-shape-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y %.y]
tests/clay-fixtures/mark-shape.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/hoon)
5+=/ cor=type -.mark
6+?. ?=([%core *] cor) (pure:m !>('not a core'))
7+=/ payload=type p.cor
8+?. ?=([%cell *] payload) (pure:m !>('payload is not a cell'))
9+=/ tail=type q.payload
10+=/ face=? ?=([%face %a *] p.payload)
11+=/ same=? =(payload q.q.cor)
12+=/ imported=? ?=([%cell [%face %todo [%core *]] *] tail)
13+=/ zuse=? ?:(?=([%cell *] tail) =(q.tail -:!>(..zuse)) |)
14+(pure:m !>([face same imported zuse]))
tests/clay-fixtures/mark-update-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [added item=[id=@ud [done=(union @f:0 @f:1) text=@t]]] [toggled id=@ud])"
tests/clay-fixtures/mark-update-import.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-update/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-mark'))
7+=/ got=vase (slym read-gate [%todo-update -.mark])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/record-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ title: $-([title=@t slug=@ta] @t)'
tests/clay-fixtures/record-bridge.txtnew file+11
@@ -0,0 +1,11 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ read-gate=vase (slap reader (ream 'read-named'))
8+=/ post-result=vase (slym read-gate [%blog %post -.blog])
9+=/ check-gate=vase (slap jibb (ream 'golden-types-imports'))
10+=/ src=@t '/- blog\0a++ title |= x=post.blog title.x\0a'
11+(pure:m (slym check-gate [/ui/test/jibb src ~[[%blog %post +.post-result]]]))
tests/clay-fixtures/tlon-mop-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y]
tests/clay-fixtures/tlon-mop.txtnew file+20
@@ -0,0 +1,20 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/mop-tlon-probe/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-named'))
7+=/ result=vase (slym read-gate [%notes %log -.src])
8+=/ recursive=vase (slym read-gate [%notes %import-node -.src])
9+=/ nested=vase (slym read-gate [%notes %a-notebook -.src])
10+=/ contains-ref
11+ |= node=*
12+ ?: =(node [%ref %notes %import-node]) &
13+ ?@ node |
14+ |($(node -.node) $(node +.node))
15+=/ contains-named
16+ |= node=*
17+ ?: ?=([%named %notes %import-node [%fork *]] node) (contains-ref node)
18+ ?@ node |
19+ |($(node -.node) $(node +.node))
20+(pure:m !>([?=([%& [%apply %mop [[%atom %da ~] [%fork *] ~]]] +.result) &(?=([%& [%fork *]] +.recursive) (contains-ref +.recursive)) &(?=([%& [%fork *]] +.nested) (contains-named +.nested))]))
tests/golden/doc-core-02-update/tree.txtnew file+77
@@ -0,0 +1,77 @@
1+(module
2+ (value 1:1 update
3+ (gate 1:11
4+ (cell 1:14
5+ (pun 1:15 msg)
6+ (face 1:20 m (ref 1:22 model)))
7+ (body 2:3
8+ (branch 2:3
9+ (wing 2:6 msg)
10+ (arm 3:5
11+ (cell 3:5 (lit 3:6 %typed) (bind 3:13 t))
12+ (body 4:7
13+ (branch 4:7
14+ (group 4:10
15+ (call 4:11
16+ (wing 4:11 gth)
17+ (group 4:15
18+ (call 4:16
19+ (wing 4:16 lent)
20+ (group 4:21
21+ (call 4:22
22+ (wing 4:22 tuba)
23+ (group 4:27
24+ (call 4:28 (wing 4:28 trip) (wing 4:33 t)))))))
25+ (lit 4:38 80)))
26+ (arm 5:9
27+ (lit 5:9 %.y)
28+ (tuple 5:14
29+ (change 5:15 m
30+ (edit 5:17 draft (wing 5:23 t))
31+ (edit 5:25 error
32+ (unit 5:31 (str 5:32 "Too long"))))
33+ (lit 5:44 ~)))
34+ (arm 6:9
35+ (lit 6:9 %.n)
36+ (tuple 6:14
37+ (change 6:15 m
38+ (edit 6:17 draft (wing 6:23 t))
39+ (edit 6:25 error (lit 6:31 ~)))
40+ (lit 6:34 ~))))))
41+ (arm 7:5
42+ (lit 7:5 %submit)
43+ (tuple 7:20
44+ (change 7:21 m
45+ (edit 7:23 draft (str 7:29 "")))
46+ (list 7:33
47+ (tuple 7:35
48+ (lit 7:36 %poke)
49+ (group 7:42
50+ (call 7:43
51+ (wing 7:43 todo-action.todo)
52+ (tuple 7:60 (lit 7:61 %add) (wing 7:66 draft.m))))
53+ (ctor 7:76 %acked)))))
54+ (arm 8:5
55+ (cell 8:5 (lit 8:6 %toggled) (bind 8:15 id))
56+ (tuple 8:20
57+ (wing 8:21 m)
58+ (list 8:23
59+ (tuple 8:25
60+ (lit 8:26 %poke)
61+ (group 8:32
62+ (call 8:33
63+ (wing 8:33 todo-action.todo)
64+ (tuple 8:50 (lit 8:51 %toggle) (wing 8:59 id))))
65+ (ctor 8:64 %acked)))))
66+ (arm 9:5
67+ (cell 9:5 (lit 9:6 %got) (bind 9:11 ts))
68+ (tuple 9:20
69+ (change 9:21 m
70+ (edit 9:23 todos (wing 9:29 ts)))
71+ (lit 9:33 ~)))
72+ (arm 10:5
73+ (cell 10:5 (lit 10:6 %acked) (bind 10:13 err))
74+ (tuple 10:20
75+ (change 10:21 m
76+ (edit 10:23 error (wing 10:29 err)))
77+ (lit 10:34 ~))))))))
tests/golden/doc-grammar-01-imports/tree.txtnew file+4
@@ -0,0 +1,4 @@
1+(module
2+ (sur 1:1 todo)
3+ (mark 2:1 %todo-action)
4+ (jibb 3:1 card /ui/components/card))
tests/golden/doc-grammar-02-buttons/tree.txtnew file+21
@@ -0,0 +1,21 @@
1+(module
2+ (value 2:1 add-button
3+ (gate 2:15
4+ (face 2:18 label (aura 2:24 @t))
5+ (body 3:3
6+ (call 3:3 (wing 3:3 button) (wing 3:10 label) (lit 3:16 %add)))))
7+ (value 4:1 labelled
8+ (gate 4:13
9+ (cell 4:16
10+ (face 4:17 label (aura 4:23 @t))
11+ (face 4:26 msg (tvar 4:30 M)))
12+ (body 5:3
13+ (call 5:3 (wing 5:3 button) (wing 5:10 label) (wing 5:16 msg)))))
14+ (value 6:1 wide
15+ (cast 6:10
16+ (apply 6:13 list (ref 6:19 attr))
17+ (body 7:3
18+ (list 7:3
19+ (pair 7:5 width
20+ (tuple 7:11 (lit 7:12 %fill) (lit 7:18 1)))
21+ (pair 7:21 pad (lit 7:25 %s2)))))))
tests/golden/doc-grammar-03-view-day/tree.txtnew file+20
@@ -0,0 +1,20 @@
1+(module
2+ (value 1:1 view
3+ (gate 1:9
4+ (cell 1:12
5+ (face 1:13 day (aura 1:17 @da))
6+ (face 1:21 n (aura 1:23 @ud)))
7+ (body 2:3
8+ (call 2:3
9+ (wing 2:3 column)
10+ (list 2:10
11+ (pair 2:12 gap (lit 2:16 %s1)))
12+ (list 2:21
13+ (group 3:5
14+ (call 3:6
15+ (wing 3:6 text)
16+ (str 3:11 "Updated " (wing 3:21 day))))
17+ (group 4:5
18+ (call 4:6
19+ (wing 4:6 text)
20+ (str 4:11 (wing 4:13 n) " items")))))))))
tests/golden/doc-grammar-04-step/about.txt+2−1
@@ -1,3 +1,4 @@
11source: Grammar tab, section "Patterns", code block 4 of the tab
2−tests: a union `+$ step $?` with one case per deeper line: cells with tags at the head, in the middle and at the end, faced fields, and a bare term; a blank line between definitions; a `?-` whose arms are cell patterns mixing tags and binding names, and a bare term, with their expressions aligned by extra spaces; interpolated strings and a name as arm expressions
2+tests: a union `+$ step` with one case per deeper line: cells with tags at the head, in the middle and at the end, faced fields, and a bare term; a blank line between definitions; a `?-` whose arms are cell patterns mixing tags and binding names, and a bare term, with their expressions aligned by extra spaces; interpolated strings and a name as arm expressions
33expect: parses
4+expect-types: a partial inference report
tests/golden/doc-grammar-04-step/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/doc-grammar-04-step/source.jibb+2−2
@@ -1,4 +1,4 @@
1−+$ step $?
1++$ step
22 [%move %left n=@ud]
33 [%move %right n=@ud]
44 [text=@t %draft]
@@ -10,5 +10,5 @@
1010 [%move %left n] "left {n}"
1111 [%move %right n] "right {n}"
1212 [t %draft] t
13− [t %sent at] t
13+ [t %sent sent-at] t
1414 %stop "stop"
tests/golden/doc-grammar-04-step/tokens.txt+2−3
@@ -1,6 +1,5 @@
111:1 glyph +$
221:4 name step
3−1:9 glyph $?
432:3 INDENT
542:3 glyph [
652:4 tight lit %move
@@ -75,8 +74,8 @@
757413:5 glyph [
767513:6 tight name t
777613:8 lit %sent
78−13:14 name at
79−13:16 tight glyph ]
77+13:14 name sent-at
78+13:21 tight glyph ]
807913:23 name t
818014:5 NEWLINE
828114:5 lit %stop
tests/golden/doc-grammar-04-step/tree.txtnew file+38
@@ -0,0 +1,38 @@
1+(module
2+ (mold 1:1 step
3+ (union 2:3
4+ (cell 2:3
5+ (const 2:4 %move)
6+ (const 2:10 %left)
7+ (face 2:16 n (aura 2:18 @ud)))
8+ (cell 3:3
9+ (const 3:4 %move)
10+ (const 3:10 %right)
11+ (face 3:17 n (aura 3:19 @ud)))
12+ (cell 4:3
13+ (face 4:4 text (aura 4:9 @t))
14+ (const 4:12 %draft))
15+ (cell 5:3
16+ (face 5:4 text (aura 5:9 @t))
17+ (const 5:12 %sent)
18+ (face 5:18 at (aura 5:21 @da)))
19+ (const 6:3 %stop)))
20+ (value 8:1 describe
21+ (gate 8:13
22+ (face 8:16 s (ref 8:18 step))
23+ (body 9:3
24+ (branch 9:3
25+ (wing 9:6 s)
26+ (arm 10:5
27+ (cell 10:5 (lit 10:6 %move) (lit 10:12 %left) (bind 10:18 n))
28+ (str 10:23 "left " (wing 10:30 n)))
29+ (arm 11:5
30+ (cell 11:5 (lit 11:6 %move) (lit 11:12 %right) (bind 11:19 n))
31+ (str 11:23 "right " (wing 11:31 n)))
32+ (arm 12:5
33+ (cell 12:5 (bind 12:6 t) (lit 12:8 %draft))
34+ (wing 12:23 t))
35+ (arm 13:5
36+ (cell 13:5 (bind 13:6 t) (lit 13:8 %sent) (bind 13:14 sent-at))
37+ (wing 13:23 t))
38+ (arm 14:5 (lit 14:5 %stop) (str 14:23 "stop")))))))
tests/golden/doc-grammar-04-step/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2++$ step: cases proven disjoint; mold not checked
3+++ describe: $-(step @t)
tests/golden/doc-grammar-06-cart-store/about.txt+1
@@ -1,3 +1,4 @@
11source: Grammar tab, section "Example: a store and an island", code block 6 of the tab (block 5 is the EBNF)
22tests: a store module: a record mold with a mold application and the loobean mold `?`; a union with its cases below; a mold that is a name; a blank line; `++ main (store init update)`; a cast with its mold and expression on one line, `^- state [~ %.n]`; a gate with a cell sample; `?-` arms whose expressions are changes, `s(items=[item items.s])` and `s(open=(not open.s))`
33expect: parses
4+expect-types: a partial inference report; store kind and declaration scope remain unresolved
tests/golden/doc-grammar-06-cart-store/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/doc-grammar-06-cart-store/source.jibb+1−1
@@ -1,6 +1,6 @@
11:: /ui/stores/cart.jibb
22+$ state [items=(list @t) open=?]
3−+$ cart-action $?
3++$ cart-action
44 [%add item=@t]
55 %toggle
66+$ poke cart-action
tests/golden/doc-grammar-06-cart-store/tokens.txt−1
@@ -14,7 +14,6 @@
14143:1 NEWLINE
15153:1 glyph +$
16163:4 name cart-action
17−3:16 glyph $?
18174:3 INDENT
19184:3 glyph [
20194:4 tight lit %add
tests/golden/doc-grammar-06-cart-store/tree.txtnew file+39
@@ -0,0 +1,39 @@
1+(module
2+ (mold 2:1 state
3+ (cell 2:10
4+ (face 2:11 items
5+ (apply 2:17 list (aura 2:23 @t)))
6+ (face 2:27 open (flag 2:32))))
7+ (mold 3:1 cart-action
8+ (union 4:3
9+ (cell 4:3
10+ (const 4:4 %add)
11+ (face 4:9 item (aura 4:14 @t)))
12+ (const 5:3 %toggle)))
13+ (mold 6:1 poke (ref 6:9 cart-action))
14+ (value 8:1 main
15+ (group 8:9
16+ (call 8:10 (wing 8:10 store) (wing 8:16 init) (wing 8:21 update))))
17+ (value 9:1 init
18+ (cast 9:9
19+ (ref 9:12 state)
20+ (tuple 9:18 (lit 9:19 ~) (lit 9:21 %.n))))
21+ (value 10:1 update
22+ (gate 10:11
23+ (cell 10:14
24+ (face 10:15 a (ref 10:17 cart-action))
25+ (face 10:29 s (ref 10:31 state)))
26+ (body 11:3
27+ (branch 11:3
28+ (wing 11:6 a)
29+ (arm 12:5
30+ (cell 12:5 (lit 12:6 %add) (bind 12:11 item))
31+ (change 12:18 s
32+ (edit 12:20 items
33+ (tuple 12:26 (wing 12:27 item) (wing 12:32 items.s)))))
34+ (arm 13:5
35+ (lit 13:5 %toggle)
36+ (change 13:18 s
37+ (edit 13:20 open
38+ (group 13:25
39+ (call 13:26 (wing 13:26 not) (wing 13:30 open.s)))))))))))
tests/golden/doc-grammar-06-cart-store/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module kind or scope needs unsupported inference
tests/golden/doc-grammar-07-basket/source.jibb+1−1
@@ -4,7 +4,7 @@
44++ main (program init update view subs)
55
66+$ model [cart=state.cart note=@t]
7−+$ msg $?
7++$ msg
88 [%noted text=@t]
99 %add
1010 %toggle
tests/golden/doc-grammar-07-basket/tokens.txt−1
@@ -30,7 +30,6 @@
30307:1 NEWLINE
31317:1 glyph +$
32327:4 name msg
33−7:8 glyph $?
34338:3 INDENT
35348:3 glyph [
36358:4 tight lit %noted
tests/golden/doc-grammar-07-basket/tree.txtnew file+103
@@ -0,0 +1,103 @@
1+(module
2+ (jibb 2:1 cart /ui/stores/cart)
3+ (value 4:1 main
4+ (group 4:9
5+ (call 4:10 (wing 4:10 program) (wing 4:18 init) (wing 4:23 update) (wing 4:30 view) (wing 4:35 subs))))
6+ (mold 6:1 model
7+ (cell 6:10
8+ (face 6:11 cart (ref 6:16 state.cart))
9+ (face 6:27 note (aura 6:32 @t))))
10+ (mold 7:1 msg
11+ (union 8:3
12+ (cell 8:3
13+ (const 8:4 %noted)
14+ (face 8:11 text (aura 8:16 @t)))
15+ (const 9:3 %add)
16+ (const 10:3 %toggle)
17+ (cell 11:3
18+ (const 11:4 %got)
19+ (face 11:9 cart (ref 11:14 state.cart)))
20+ (cell 12:3
21+ (const 12:4 %acked)
22+ (face 12:11 err
23+ (apply 12:15 unit (aura 12:21 @t))))))
24+ (value 14:1 init
25+ (gate 14:9
26+ (const 14:12 ~)
27+ (body 15:3
28+ (tuple 15:3
29+ (tuple 15:4 (lit 15:5 ~) (lit 15:7 %.n))
30+ (str 15:12 "")))))
31+ (value 17:1 update
32+ (gate 17:11
33+ (cell 17:14
34+ (pun 17:15 msg)
35+ (face 17:20 m (ref 17:22 model)))
36+ (body 18:3
37+ (branch 18:3
38+ (wing 18:6 msg)
39+ (arm 19:5
40+ (cell 19:5 (lit 19:6 %noted) (bind 19:13 t))
41+ (tuple 19:20
42+ (change 19:21 m
43+ (edit 19:23 note (wing 19:28 t)))
44+ (lit 19:31 ~)))
45+ (arm 20:5
46+ (lit 20:5 %add)
47+ (tuple 20:20
48+ (change 20:21 m
49+ (edit 20:23 note (str 20:28 "")))
50+ (list 20:32
51+ (tuple 20:34
52+ (lit 20:35 %poke)
53+ (group 20:41
54+ (call 20:42
55+ (wing 20:42 cart-action.cart)
56+ (tuple 20:59 (lit 20:60 %add) (wing 20:65 note.m))))
57+ (ctor 20:74 %acked)))))
58+ (arm 21:5
59+ (lit 21:5 %toggle)
60+ (tuple 21:20
61+ (wing 21:21 m)
62+ (list 21:23
63+ (tuple 21:25
64+ (lit 21:26 %poke)
65+ (group 21:32
66+ (call 21:33 (wing 21:33 cart-action.cart) (lit 21:50 %toggle)))
67+ (ctor 21:59 %acked)))))
68+ (arm 22:5
69+ (cell 22:5 (lit 22:6 %got) (bind 22:11 c))
70+ (tuple 22:20
71+ (change 22:21 m
72+ (edit 22:23 cart (wing 22:28 c)))
73+ (lit 22:31 ~)))
74+ (arm 23:5
75+ (cell 23:5 (lit 23:6 %acked) (bind 23:13 err))
76+ (tuple 23:20 (wing 23:21 m) (lit 23:23 ~)))))))
77+ (value 25:1 subs
78+ (gate 25:9
79+ (face 25:12 m (ref 25:14 model))
80+ (body 26:3
81+ (list 26:3
82+ (tuple 26:5
83+ (lit 26:6 %watch)
84+ (group 26:13
85+ (call 26:14 (wing 26:14 state.cart) (ctor 26:25 %got))))))))
86+ (value 28:1 view
87+ (gate 28:9
88+ (face 28:12 m (ref 28:14 model))
89+ (body 29:3
90+ (call 29:3
91+ (wing 29:3 column)
92+ (list 29:10
93+ (pair 29:12 gap (lit 29:16 %s1)))
94+ (list 29:21
95+ (group 30:5
96+ (call 30:6
97+ (wing 30:6 text)
98+ (str 30:11
99+ (group 30:13
100+ (call 30:14 (wing 30:14 lent) (wing 30:19 items.cart.m)))
101+ " items")))
102+ (call 31:5 (wing 31:5 field) (str 31:11 "Item") (wing 31:18 note.m) (ctor 31:25 %noted))
103+ (call 32:5 (wing 32:5 button) (str 32:12 "Add") (lit 32:18 %add))))))))
tests/golden/doc-overview-01-cmd-sub/about.txt+1−1
@@ -1,3 +1,3 @@
11source: the first tab ("Jibb — an Elm-architecture UI language for Urbit"), section "The Elm architecture on Urbit", Effects, code block 1 of the tab
2−tests: generic molds `+$ cmd |$ [M] $?` and `+$ sub |$ [M] $?` whose unions have their cases on the deeper lines; cell molds with faced fields whose molds are names, auras, type variables, a mold application `(ask M)`, and gate molds `$-((unit @t) M)`, `$-(@da M)`, `$-(@p M)` and `$-(path M)`
2+tests: generic molds `+$ cmd |$ [M]` and `+$ sub |$ [M]` whose unions have their cases on the deeper lines; cell molds with faced fields whose molds are names, auras, type variables, a mold application `(ask M)`, and gate molds `$-((unit @t) M)`, `$-(@da M)`, `$-(@p M)` and `$-(path M)`
33expect: parses
tests/golden/doc-overview-01-cmd-sub/source.jibb+2−2
@@ -1,10 +1,10 @@
1−+$ cmd |$ [M] $?
1++$ cmd |$ [M]
22 [%poke p=poke reply=$-((unit @t) M)]
33 [%go url=@t]
44 [%wait gap=@dr msg=M]
55 [%now reply=$-(@da M)]
66 [%who reply=$-(@p M)]
7−+$ sub |$ [M] $?
7++$ sub |$ [M]
88 [%watch a=(ask M)]
99 [%every gap=@dr reply=$-(@da M)]
1010 [%url reply=$-(path M)]
tests/golden/doc-overview-01-cmd-sub/tokens.txt−2
@@ -4,7 +4,6 @@
441:11 glyph [
551:12 tight tvar M
661:13 tight glyph ]
7−1:15 glyph $?
872:3 INDENT
982:3 glyph [
1092:4 tight lit %poke
@@ -66,7 +65,6 @@
66657:11 glyph [
67667:12 tight tvar M
68677:13 tight glyph ]
69−7:15 glyph $?
70688:3 INDENT
71698:3 glyph [
72708:4 tight lit %watch
tests/golden/doc-overview-01-cmd-sub/tree.txtnew file+42
@@ -0,0 +1,42 @@
1+(module
2+ (mold 1:1 cmd
3+ (generic 1:8 M
4+ (union 2:3
5+ (cell 2:3
6+ (const 2:4 %poke)
7+ (face 2:10 p (ref 2:12 poke))
8+ (face 2:17 reply
9+ (fn 2:23
10+ (apply 2:26 unit (aura 2:32 @t))
11+ (tvar 2:36 M))))
12+ (cell 3:3
13+ (const 3:4 %go)
14+ (face 3:8 url (aura 3:12 @t)))
15+ (cell 4:3
16+ (const 4:4 %wait)
17+ (face 4:10 gap (aura 4:14 @dr))
18+ (face 4:18 msg (tvar 4:22 M)))
19+ (cell 5:3
20+ (const 5:4 %now)
21+ (face 5:9 reply
22+ (fn 5:15 (aura 5:18 @da) (tvar 5:22 M))))
23+ (cell 6:3
24+ (const 6:4 %who)
25+ (face 6:9 reply
26+ (fn 6:15 (aura 6:18 @p) (tvar 6:21 M)))))))
27+ (mold 7:1 sub
28+ (generic 7:8 M
29+ (union 8:3
30+ (cell 8:3
31+ (const 8:4 %watch)
32+ (face 8:11 a
33+ (apply 8:13 ask (tvar 8:18 M))))
34+ (cell 9:3
35+ (const 9:4 %every)
36+ (face 9:11 gap (aura 9:15 @dr))
37+ (face 9:19 reply
38+ (fn 9:25 (aura 9:28 @da) (tvar 9:32 M))))
39+ (cell 10:3
40+ (const 10:4 %url)
41+ (face 10:9 reply
42+ (fn 10:15 (ref 10:18 path) (tvar 10:23 M))))))))
tests/golden/doc-overview-02-theme/tree.txtnew file+32
@@ -0,0 +1,32 @@
1+(module
2+ (value 1:1 theme
3+ (cast 1:11
4+ (ref 1:14 theme)
5+ (body 2:3
6+ (tuple 2:3
7+ (face 2:5 space
8+ (tuple 2:11
9+ (face 2:12 s1 (str 2:15 "4px"))
10+ (face 2:21 s2 (str 2:24 "8px"))
11+ (face 2:30 s3 (str 2:33 "16px"))))
12+ (face 3:5 tones
13+ (tuple 3:11
14+ (face 3:12 normal (str 3:19 "#222"))
15+ (face 3:26 background (str 3:37 "#fff"))
16+ (face 3:44 accent (str 3:51 "#17734f"))
17+ (face 3:61 danger (str 3:68 "#b3261e"))
18+ (face 3:78 muted (str 3:84 "#5f5f5f"))))
19+ (face 4:5 wide (str 4:10 "60rem"))
20+ (face 5:5 lang (str 5:10 "en"))
21+ (face 6:5 zone (str 6:10 "UTC"))
22+ (face 7:5 font
23+ (unit 7:10 (qath 7:11 static fonts inter.woff2)))
24+ (face 8:5 dark
25+ (tuple 8:10
26+ (face 8:11 tones
27+ (tuple 8:17
28+ (face 8:18 normal (str 8:25 "#eee"))
29+ (face 8:32 background (str 8:43 "#111"))
30+ (face 8:50 accent (str 8:57 "#4c9"))
31+ (face 8:64 danger (str 8:71 "#f28b82"))
32+ (face 8:81 muted (str 8:87 "#aaa")))))))))))
tests/golden/doc-overview-04-todo-api/source.jibb+2−2
@@ -7,7 +7,7 @@
77
88+$ item item.todo
99+$ poke todo-action
10−+$ paths $?
10++$ paths
1111 [%todos /todos todos]
1212 [%changes /changes (facts todos todo-update)]
13− [%todo /todo/[id=@ud] todo-item]
13+ [%todo-by-id /todo/[id=@ud] todo-item]
tests/golden/doc-overview-04-todo-api/tokens.txt+13−14
@@ -23,7 +23,6 @@
232310:1 NEWLINE
242410:1 glyph +$
252510:4 name paths
26−10:10 glyph $?
272611:3 INDENT
282711:3 glyph [
292811:4 tight lit %todos
@@ -44,16 +43,16 @@
444312:47 tight glyph ]
454413:3 NEWLINE
464513:3 glyph [
47−13:4 tight lit %todo
48−13:10 glyph /
49−13:11 tight knot todo
50−13:15 tight glyph /
51−13:16 tight glyph [
52−13:17 tight name id
53−13:19 tight glyph =
54−13:20 tight aura @ud
55−13:23 tight glyph ]
56−13:25 name todo-item
57−13:34 tight glyph ]
58−13:35 DEDENT
59−13:35 NEWLINE
46+13:4 tight lit %todo-by-id
47+13:16 glyph /
48+13:17 tight knot todo
49+13:21 tight glyph /
50+13:22 tight glyph [
51+13:23 tight name id
52+13:25 tight glyph =
53+13:26 tight aura @ud
54+13:29 tight glyph ]
55+13:31 name todo-item
56+13:40 tight glyph ]
57+13:41 DEDENT
58+13:41 NEWLINE
tests/golden/doc-overview-04-todo-api/tree.txtnew file+16
@@ -0,0 +1,16 @@
1+(module
2+ (sur 2:1 todo)
3+ (mark 3:1 %todo-action)
4+ (mark 4:1 %todos)
5+ (mark 5:1 %todo-update)
6+ (mark 6:1 %todo-item)
7+ (mold 8:1 item (ref 8:9 item.todo))
8+ (mold 9:1 poke (ref 9:9 todo-action))
9+ (mold 10:1 paths
10+ (union 11:3
11+ (cell 11:3 (const 11:4 %todos) (path 11:11 /todos) (ref 11:18 todos))
12+ (cell 12:3
13+ (const 12:4 %changes)
14+ (path 12:13 /changes)
15+ (apply 12:22 facts (ref 12:29 todos) (ref 12:35 todo-update)))
16+ (cell 13:3 (const 13:4 %todo-by-id) (path 13:16 /todo/[id=@ud]) (ref 13:31 todo-item)))))
tests/golden/doc-overview-08-about/tree.txtnew file+24
@@ -0,0 +1,24 @@
1+(module
2+ (value 1:1 main (wing 1:9 view))
3+ (value 3:1 view
4+ (body 4:3
5+ (call 4:3
6+ (wing 4:3 column)
7+ (list 4:10
8+ (pair 4:12 width
9+ (tuple 4:18 (lit 4:19 %fill) (lit 4:25 1)))
10+ (pair 4:28 pad (lit 4:32 %s3))
11+ (pair 4:36 gap (lit 4:40 %s2)))
12+ (list 4:45
13+ (call 5:5 (wing 5:5 heading) (lit 5:13 1) (str 5:15 "About this ship"))
14+ (call 6:5
15+ (wing 6:5 para)
16+ (list 6:10
17+ (group 6:12
18+ (call 6:13 (wing 6:13 text) (str 6:18 "Hosted on Urbit. This page ships no JavaScript.")))))
19+ (call 7:5
20+ (wing 7:5 el)
21+ (list 7:8
22+ (pair 7:10 tone (lit 7:15 %accent)))
23+ (group 7:24
24+ (call 7:25 (wing 7:25 link) (qath 7:30 blog) (str 7:37 "Read the blog")))))))))
tests/golden/doc-overview-09-blog-index/tree.txtnew file+23
@@ -0,0 +1,23 @@
1+(module
2+ (sur 1:1 blog)
3+ (jibb 2:1 api /ui/api/blog)
4+ (jibb 3:1 card /ui/components/card)
5+ (value 5:1 main
6+ (group 5:9
7+ (call 5:10 (wing 5:10 page) (wing 5:15 load) (wing 5:20 view))))
8+ (value 6:1 load
9+ (gate-wide 6:9
10+ (const 6:12 ~)
11+ (group 6:14
12+ (call 6:15 (wing 6:15 posts.api) (wing 6:25 same)))))
13+ (value 8:1 view
14+ (gate 8:9
15+ (face 8:12 ps
16+ (apply 8:15 list (ref 8:21 post.blog)))
17+ (body 9:3
18+ (call 9:3
19+ (wing 9:3 column)
20+ (list 9:10
21+ (pair 9:12 gap (lit 9:16 %s2)))
22+ (group 9:21
23+ (call 9:22 (wing 9:22 turn) (wing 9:27 ps) (wing 9:30 card.card))))))))
tests/golden/doc-overview-10-todo-list/source.jibb+1−1
@@ -3,7 +3,7 @@
33++ main (program init update view subs)
44
55+$ model [todos=(list item.todo) draft=@t error=(unit @t)]
6−+$ msg $?
6++$ msg
77 [%typed text=@t]
88 %submit
99 [%toggled id=@ud]
tests/golden/doc-overview-10-todo-list/tokens.txt−1
@@ -39,7 +39,6 @@
39396:1 NEWLINE
40406:1 glyph +$
41416:4 name msg
42−6:8 glyph $?
43427:3 INDENT
44437:3 glyph [
45447:4 tight lit %typed
tests/golden/doc-overview-10-todo-list/tree.txtnew file+168
@@ -0,0 +1,168 @@
1+(module
2+ (jibb 1:1 todo /ui/api/todo)
3+ (value 3:1 main
4+ (group 3:9
5+ (call 3:10 (wing 3:10 program) (wing 3:18 init) (wing 3:23 update) (wing 3:30 view) (wing 3:35 subs))))
6+ (mold 5:1 model
7+ (cell 5:10
8+ (face 5:11 todos
9+ (apply 5:17 list (ref 5:23 item.todo)))
10+ (face 5:34 draft (aura 5:40 @t))
11+ (face 5:43 error
12+ (apply 5:49 unit (aura 5:55 @t)))))
13+ (mold 6:1 msg
14+ (union 7:3
15+ (cell 7:3
16+ (const 7:4 %typed)
17+ (face 7:11 text (aura 7:16 @t)))
18+ (const 8:3 %submit)
19+ (cell 9:3
20+ (const 9:4 %toggled)
21+ (face 9:13 id (aura 9:16 @ud)))
22+ (cell 10:3
23+ (const 10:4 %got)
24+ (face 10:9 todos
25+ (apply 10:15 list (ref 10:21 item.todo))))
26+ (cell 11:3
27+ (const 11:4 %acked)
28+ (face 11:11 err
29+ (apply 11:15 unit (aura 11:21 @t))))))
30+ (value 13:1 init
31+ (gate 13:9
32+ (face 13:12 ts
33+ (apply 13:15 list (ref 13:21 item.todo)))
34+ (body 14:3
35+ (tuple 14:3 (wing 14:4 ts) (str 14:7 "") (lit 14:10 ~)))))
36+ (value 16:1 update
37+ (gate 16:11
38+ (cell 16:14
39+ (pun 16:15 msg)
40+ (face 16:20 m (ref 16:22 model)))
41+ (body 17:3
42+ (branch 17:3
43+ (wing 17:6 msg)
44+ (arm 18:5
45+ (cell 18:5 (lit 18:6 %typed) (bind 18:13 t))
46+ (body 19:7
47+ (branch 19:7
48+ (group 19:10
49+ (call 19:11
50+ (wing 19:11 gth)
51+ (group 19:15
52+ (call 19:16
53+ (wing 19:16 lent)
54+ (group 19:21
55+ (call 19:22
56+ (wing 19:22 tuba)
57+ (group 19:27
58+ (call 19:28 (wing 19:28 trip) (wing 19:33 t)))))))
59+ (lit 19:38 80)))
60+ (arm 20:9
61+ (lit 20:9 %.y)
62+ (tuple 20:14
63+ (change 20:15 m
64+ (edit 20:17 draft (wing 20:23 t))
65+ (edit 20:25 error
66+ (unit 20:31 (str 20:32 "Too long"))))
67+ (lit 20:44 ~)))
68+ (arm 21:9
69+ (lit 21:9 %.n)
70+ (tuple 21:14
71+ (change 21:15 m
72+ (edit 21:17 draft (wing 21:23 t))
73+ (edit 21:25 error (lit 21:31 ~)))
74+ (lit 21:34 ~))))))
75+ (arm 22:5
76+ (lit 22:5 %submit)
77+ (tuple 22:20
78+ (change 22:21 m
79+ (edit 22:23 draft (str 22:29 "")))
80+ (list 22:33
81+ (tuple 22:35
82+ (lit 22:36 %poke)
83+ (group 22:42
84+ (call 22:43
85+ (wing 22:43 todo-action.todo)
86+ (tuple 22:60 (lit 22:61 %add) (wing 22:66 draft.m))))
87+ (ctor 22:76 %acked)))))
88+ (arm 23:5
89+ (cell 23:5 (lit 23:6 %toggled) (bind 23:15 id))
90+ (tuple 23:20
91+ (wing 23:21 m)
92+ (list 23:23
93+ (tuple 23:25
94+ (lit 23:26 %poke)
95+ (group 23:32
96+ (call 23:33
97+ (wing 23:33 todo-action.todo)
98+ (tuple 23:50 (lit 23:51 %toggle) (wing 23:59 id))))
99+ (ctor 23:64 %acked)))))
100+ (arm 24:5
101+ (cell 24:5 (lit 24:6 %got) (bind 24:11 ts))
102+ (tuple 24:20
103+ (change 24:21 m
104+ (edit 24:23 todos (wing 24:29 ts)))
105+ (lit 24:33 ~)))
106+ (arm 25:5
107+ (cell 25:5 (lit 25:6 %acked) (bind 25:13 err))
108+ (tuple 25:20
109+ (change 25:21 m
110+ (edit 25:23 error (wing 25:29 err)))
111+ (lit 25:34 ~)))))))
112+ (value 27:1 subs
113+ (gate 27:9
114+ (face 27:12 m (ref 27:14 model))
115+ (body 28:3
116+ (list 28:3
117+ (tuple 28:5
118+ (lit 28:6 %watch)
119+ (group 28:13
120+ (call 28:14 (wing 28:14 todos.todo) (ctor 28:25 %got))))))))
121+ (value 30:1 view
122+ (gate 30:9
123+ (face 30:12 m (ref 30:14 model))
124+ (body 31:3
125+ (call 31:3
126+ (wing 31:3 column)
127+ (list 31:10
128+ (pair 31:12 gap (lit 31:16 %s2)))
129+ (list 31:21
130+ (call 32:5 (wing 32:5 heading) (lit 32:13 2) (str 32:15 "Todos"))
131+ (call 33:5
132+ (wing 33:5 each)
133+ (group 33:10
134+ (call 33:11 (wing 33:11 turn) (wing 33:16 todos.m) (wing 33:24 row-of))))
135+ (call 34:5
136+ (wing 34:5 row)
137+ (list 34:9
138+ (pair 34:11 gap (lit 34:15 %s1)))
139+ (list 34:20
140+ (call 35:7
141+ (wing 35:7 el)
142+ (list 35:10
143+ (pair 35:12 width
144+ (tuple 35:18 (lit 35:19 %fill) (lit 35:25 1))))
145+ (group 35:29
146+ (call 35:30 (wing 35:30 field) (str 35:36 "New todo") (wing 35:47 draft.m) (ctor 35:55 %typed))))
147+ (call 36:7 (wing 36:7 button) (str 36:14 "Add") (lit 36:20 %submit))))
148+ (call 37:5
149+ (wing 37:5 el)
150+ (list 37:8
151+ (pair 37:10 tone (lit 37:15 %danger)))
152+ (group 37:24
153+ (call 37:25
154+ (wing 37:25 text)
155+ (group 37:30
156+ (call 37:31 (wing 37:31 fall) (wing 37:36 error.m) (str 37:44 "")))))))))))
157+ (value 39:1 row-of
158+ (gate 39:11
159+ (face 39:14 t (ref 39:16 item.todo))
160+ (body 40:3
161+ (tuple 40:3
162+ (wing 40:4 id.t)
163+ (group 40:9
164+ (call 40:10
165+ (wing 40:10 toggle)
166+ (wing 40:17 done.t)
167+ (wing 40:24 text.t)
168+ (tuple 40:31 (lit 40:32 %toggled) (wing 40:41 id.t)))))))))
tests/golden/doc-overview-11-index/tree.txtnew file+23
@@ -0,0 +1,23 @@
1+(module
2+ (jibb 1:1 todo /ui/api/todo)
3+ (jibb 2:1 todo-list /ui/todo-list)
4+ (value 4:1 main
5+ (group 4:9
6+ (call 4:10 (wing 4:10 page) (wing 4:15 load) (wing 4:20 view))))
7+ (value 5:1 load
8+ (gate-wide 5:9
9+ (const 5:12 ~)
10+ (group 5:14
11+ (call 5:15 (wing 5:15 todos.todo) (wing 5:26 same)))))
12+ (value 7:1 view
13+ (gate 7:9
14+ (face 7:12 ts
15+ (apply 7:15 list (ref 7:21 item.todo)))
16+ (body 8:3
17+ (call 8:3
18+ (wing 8:3 column)
19+ (list 8:10
20+ (pair 8:12 pad (lit 8:16 %s3)))
21+ (list 8:21
22+ (call 9:5 (wing 9:5 heading) (lit 9:13 1) (str 9:15 "My ship"))
23+ (call 10:5 (wing 10:5 island) (wing 10:12 main.todo-list) (wing 10:27 ts))))))))
tests/golden/fixture-blog-api/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Overview, Agent APIs: "Each agent Jibb talks to has /ui/api/<agent>.jibb, declaring its pokes in +$ poke and its paths in +$ paths, over types from the agent's own marks through /%."
2+tests: A blog API fixture used by the documented published-page example; path.txt supplies its API path.
3+expect: parses; type checking and mark imports wait for milestone 2.
tests/golden/fixture-blog-api/path.txtnew file+1
@@ -0,0 +1 @@
1+/ui/api/blog.jibb
tests/golden/fixture-blog-api/source.jibbnew file+5
@@ -0,0 +1,5 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/% %posts
3+
4++$ paths
5+ [%posts /posts posts]
tests/golden/fixture-blog-api/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+2:1 glyph /%
2+2:5 lit %posts
3+4:1 NEWLINE
4+4:1 glyph +$
5+4:4 name paths
6+5:3 INDENT
7+5:3 glyph [
8+5:4 tight lit %posts
9+5:11 glyph /
10+5:12 tight knot posts
11+5:18 name posts
12+5:23 tight glyph ]
13+5:24 DEDENT
14+5:24 NEWLINE
tests/golden/fixture-blog-api/tree.txtnew file+4
@@ -0,0 +1,4 @@
1+(module
2+ (mark 2:1 %posts)
3+ (mold 4:1 paths
4+ (cell 5:3 (const 5:4 %posts) (path 5:11 /posts) (ref 5:18 posts))))
tests/golden/fixture-blog-card/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Overview, worked example 2: the published page imports /ui/components/card and calls card.card.
2+tests: A card component fixture for the documented published-page example, importing its blog mold; path.txt supplies its module path.
3+expect: parses; type checking and /sur imports wait for milestone 2.
tests/golden/fixture-blog-card/path.txtnew file+1
@@ -0,0 +1 @@
1+/ui/components/card.jibb
tests/golden/fixture-blog-card/source.jibbnew file+5
@@ -0,0 +1,5 @@
1+:: Fixture for the documented examples; not supplied by the design doc.
2+/- blog
3+
4+++ card |= p=post.blog
5+ text title.p
tests/golden/fixture-blog-card/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+2:1 glyph /-
2+2:5 name blog
3+4:1 NEWLINE
4+4:1 glyph ++
5+4:4 name card
6+4:9 glyph |=
7+4:12 name p
8+4:13 tight glyph =
9+4:14 tight wing post.blog
10+5:3 INDENT
11+5:3 name text
12+5:8 wing title.p
13+5:15 DEDENT
14+5:15 NEWLINE
tests/golden/fixture-blog-card/tree.txtnew file+7
@@ -0,0 +1,7 @@
1+(module
2+ (sur 2:1 blog)
3+ (value 4:1 card
4+ (gate 4:9
5+ (face 4:12 p (ref 4:14 post.blog))
6+ (body 5:3
7+ (call 5:3 (wing 5:3 text) (wing 5:8 title.p))))))
tests/golden/inline-base32/tree.txtnew file+2
@@ -0,0 +1,2 @@
1+(module
2+ (value 1:1 x (lit 1:6 0v5.fdf99)))
tests/golden/inline-call/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (value 1:1 x
3+ (call 1:6 (wing 1:6 f) (wing 1:8 a) (wing 1:10 b))))
tests/golden/inline-cell/tree.txtnew file+7
@@ -0,0 +1,7 @@
1+(module
2+ (value 1:1 x
3+ (tuple 1:6 (wing 1:7 a) (wing 1:9 b) (wing 1:11 c)))
4+ (value 2:1 y
5+ (tuple 2:6
6+ (face 2:7 text (str 2:12 "milk"))
7+ (face 2:19 done (lit 2:24 %.n)))))
tests/golden/inline-change-done/tree.txtnew file+4
@@ -0,0 +1,4 @@
1+(module
2+ (value 1:1 x
3+ (change 1:6 m
4+ (edit 1:8 done (lit 1:13 %.y)))))
tests/golden/inline-change-draft/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (value 1:1 x
3+ (change 1:6 m
4+ (edit 1:8 draft (str 1:14 "x"))
5+ (edit 1:18 error (lit 1:24 ~)))))
tests/golden/inline-crash-call/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Decisions, 2026-10-30: "Crash: `!!` is an operand, so `f !!` and `~[!!]` need no parentheses"; the EBNF: `call = operand { operand } ;`
2+tests: `!!` followed by another operand on its line, and as the head of a call left open in parentheses
3+expect: parses: a is the call whose head is !! and whose argument is a, as call = operand { operand } gives (the checker judges it, in milestone 2); b is the call of !! on a and b
tests/golden/inline-crash-call/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+++ a !! a
2+++ b (!!
3+ a
4+ b
tests/golden/inline-crash-call/tokens.txtnew file+15
@@ -0,0 +1,15 @@
1+1:1 glyph ++
2+1:4 name a
3+1:6 glyph !!
4+1:9 name a
5+2:1 NEWLINE
6+2:1 glyph ++
7+2:4 name b
8+2:6 glyph (
9+2:7 tight glyph !!
10+3:3 INDENT
11+3:3 name a
12+4:3 NEWLINE
13+4:3 name b
14+4:4 DEDENT
15+4:4 NEWLINE
tests/golden/inline-crash-call/tree.txtnew file+6
@@ -0,0 +1,6 @@
1+(module
2+ (value 1:1 a
3+ (call 1:6 (crash 1:6) (wing 1:9 a)))
4+ (value 2:1 b
5+ (group 2:6
6+ (call 2:7 (crash 2:7) (wing 3:3 a) (wing 4:3 b)))))
tests/golden/inline-crash-operands/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Decisions, 2026-10-30: "Crash: `!!` is an operand, so `f !!` and `~[!!]` need no parentheses"; the EBNF: `operand = literal | qath | ref | change | pair | unit | group | list | tuple | gate | ctor | pathlit | "!!" ;`
2+tests: `!!` in each place an operand goes: a call's argument, in a group's call, a list's and a cell's item, a unit, a pair's value, a change's item, the wide gate's body, an application path's segment, and alone in a group
3+expect: parses; each `!!` is a (crash …) where the operand goes, needing no parentheses (Decisions)
tests/golden/inline-crash-operands/source.jibbnew file+10
@@ -0,0 +1,10 @@
1+++ a f !!
2+++ b (f !!)
3+++ c ~[!!]
4+++ d [a !!]
5+++ e `!!
6+++ f a+!!
7+++ g m(a=!!)
8+++ h |=(a !!)
9+++ i %/x/(!!)
10+++ j (!!)
tests/golden/inline-crash-operands/tokens.txtnew file+67
@@ -0,0 +1,67 @@
1+1:1 glyph ++
2+1:4 name a
3+1:6 name f
4+1:8 glyph !!
5+2:1 NEWLINE
6+2:1 glyph ++
7+2:4 name b
8+2:6 glyph (
9+2:7 tight name f
10+2:9 glyph !!
11+2:11 tight glyph )
12+3:1 NEWLINE
13+3:1 glyph ++
14+3:4 name c
15+3:6 glyph ~[
16+3:8 tight glyph !!
17+3:10 tight glyph ]
18+4:1 NEWLINE
19+4:1 glyph ++
20+4:4 name d
21+4:6 glyph [
22+4:7 tight name a
23+4:9 glyph !!
24+4:11 tight glyph ]
25+5:1 NEWLINE
26+5:1 glyph ++
27+5:4 name e
28+5:6 glyph `
29+5:7 tight glyph !!
30+6:1 NEWLINE
31+6:1 glyph ++
32+6:4 name f
33+6:6 name a
34+6:7 tight glyph +
35+6:8 tight glyph !!
36+7:1 NEWLINE
37+7:1 glyph ++
38+7:4 name g
39+7:6 name m
40+7:7 tight glyph (
41+7:8 tight name a
42+7:9 tight glyph =
43+7:10 tight glyph !!
44+7:12 tight glyph )
45+8:1 NEWLINE
46+8:1 glyph ++
47+8:4 name h
48+8:6 glyph |=(
49+8:9 tight name a
50+8:11 glyph !!
51+8:13 tight glyph )
52+9:1 NEWLINE
53+9:1 glyph ++
54+9:4 name i
55+9:6 glyph %/
56+9:8 tight knot x
57+9:9 tight glyph /
58+9:10 tight glyph (
59+9:11 tight glyph !!
60+9:13 tight glyph )
61+10:1 NEWLINE
62+10:1 glyph ++
63+10:4 name j
64+10:6 glyph (
65+10:7 tight glyph !!
66+10:9 tight glyph )
67+10:10 NEWLINE
tests/golden/inline-crash-operands/tree.txtnew file+23
@@ -0,0 +1,23 @@
1+(module
2+ (value 1:1 a
3+ (call 1:6 (wing 1:6 f) (crash 1:8)))
4+ (value 2:1 b
5+ (group 2:6
6+ (call 2:7 (wing 2:7 f) (crash 2:9))))
7+ (value 3:1 c
8+ (list 3:6 (crash 3:8)))
9+ (value 4:1 d
10+ (tuple 4:6 (wing 4:7 a) (crash 4:9)))
11+ (value 5:1 e
12+ (unit 5:6 (crash 5:7)))
13+ (value 6:1 f
14+ (pair 6:6 a (crash 6:8)))
15+ (value 7:1 g
16+ (change 7:6 m
17+ (edit 7:8 a (crash 7:10))))
18+ (value 8:1 h
19+ (gate-wide 8:6 (bind 8:9 a) (crash 8:11)))
20+ (value 9:1 i
21+ (qath 9:6 x (crash 9:11)))
22+ (value 10:1 j
23+ (group 10:6 (crash 10:7))))
tests/golden/inline-crash/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (value 1:1 x (crash 1:6))
3+ (mold 2:1 y (void 2:6)))
tests/golden/inline-ctor-typed/tree.txtnew file+10
@@ -0,0 +1,10 @@
1+(module
2+ (value 1:1 a (ctor 1:6 %typed))
3+ (mold 2:1 b
4+ (fn 2:6 (aura 2:9 @t) (tvar 2:12 M)))
5+ (value 3:1 c
6+ (gate-wide 3:6
7+ (bind 3:9 t)
8+ (tuple 3:11 (lit 3:12 %typed) (wing 3:19 t))))
9+ (mold 4:1 d
10+ (cell 4:6 (const 4:7 %typed) (aura 4:14 @t))))
tests/golden/inline-date/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (value 1:1 x (lit 1:6 ~2026.10.23))
3+ (value 2:1 y (lit 2:6 ~2026.10.23..14.30.00)))
tests/golden/inline-decimal/tree.txtnew file+2
@@ -0,0 +1,2 @@
1+(module
2+ (value 1:1 x (lit 1:6 1.000)))
tests/golden/inline-duration/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (value 1:1 x (lit 1:6 ~s30))
3+ (value 2:1 y (lit 2:6 ~h1.m30)))
tests/golden/inline-fold-mold/tree.txtnew file+7
@@ -0,0 +1,7 @@
1+(module
2+ (mold 1:1 fold
3+ (fn 1:9
4+ (cell 1:12
5+ (cell 1:13 (const 1:14 %todo-update) (ref 1:27 todo-update))
6+ (ref 1:40 todos))
7+ (ref 1:47 todos))))
tests/golden/inline-gate-after-definition-bad/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar tab, Runes: "`|$` **barbuc**: a generic mold, right after a `+$`'s name: `+$ result |$ [V E]`, then the mold on its line or the cases below."
2+tests: `|=` immediately after a definition name, where `|$` may begin
3+expect: error at 1:7 — `|` could begin `|$`, but `=` cannot continue it
tests/golden/inline-gate-after-definition-bad/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ x |=
tests/golden/inline-gate-after-definition-bad/tokens.txtnew file+4
@@ -0,0 +1,4 @@
1+1:1 glyph +$
2+1:4 name x
3+1:6 glyph |=
4+1:8 NEWLINE
tests/golden/inline-gate-after-definition-bad/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/inline-gate-after-definition-bad/source.jibb:1:7: expected a mold, found `|=`; a gate's mold is $-(sample product)
2++$ x |=
3+ ^
tests/golden/inline-gate-field-bad/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar tab, Runes: "`+$` **lusbuc**: defines a mold, likewise: on its line, or as cases on the lines below, one per line, where several cases make a union and one is just that mold. Molds may be recursive."; "`|$` **barbuc**: a generic mold, right after a `+$`'s name: `+$ result |$ [V E]`, then the mold on its line or the cases below."
2+tests: `|=` where a field mold goes
3+expect: error at 1:9 — a mold cannot begin with `|`
tests/golden/inline-gate-field-bad/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ x [a=|=]
tests/golden/inline-gate-field-bad/tokens.txtnew file+8
@@ -0,0 +1,8 @@
1+1:1 glyph +$
2+1:4 name x
3+1:6 glyph [
4+1:7 tight name a
5+1:8 tight glyph =
6+1:9 tight glyph |=
7+1:11 tight glyph ]
8+1:12 NEWLINE
tests/golden/inline-gate-field-bad/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/inline-gate-field-bad/source.jibb:1:9: expected a mold, found `|=`; a gate's mold is $-(sample product)
2++$ x [a=|=]
3+ ^
tests/golden/inline-gate-mold/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (mold 1:1 x
3+ (fn 1:6 (ref 1:9 sample) (ref 1:16 product))))
tests/golden/inline-gate-sample-binds/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Decisions, 2026-10-30: "Sample names: Every bare name in a sample binds, at any depth: `|= [a=@ b]` binds `a` and `b`"; Grammar tab, Expressions: "A bare name binds at any depth of a sample, so `|= [a=@ b]` binds `a` and `b`."
2+tests: bare names in cell samples: the Decisions' own example, and names in a cell inside a cell
3+expect: parses: in f, b is a (bind …) beside the face a=@; in g, a and b are binds at two depths, and c=@ a face
tests/golden/inline-gate-sample-binds/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+++ f |= [a=@ b] a
2+++ g |= [a [b c=@]] b
tests/golden/inline-gate-sample-binds/tokens.txtnew file+25
@@ -0,0 +1,25 @@
1+1:1 glyph ++
2+1:4 name f
3+1:6 glyph |=
4+1:9 glyph [
5+1:10 tight name a
6+1:11 tight glyph =
7+1:12 tight aura @
8+1:14 name b
9+1:15 tight glyph ]
10+1:17 name a
11+2:1 NEWLINE
12+2:1 glyph ++
13+2:4 name g
14+2:6 glyph |=
15+2:9 glyph [
16+2:10 tight name a
17+2:12 glyph [
18+2:13 tight name b
19+2:15 name c
20+2:16 tight glyph =
21+2:17 tight aura @
22+2:18 tight glyph ]
23+2:19 tight glyph ]
24+2:21 name b
25+2:22 NEWLINE
tests/golden/inline-gate-sample-binds/tree.txtnew file+15
@@ -0,0 +1,15 @@
1+(module
2+ (value 1:1 f
3+ (gate 1:6
4+ (cell 1:9
5+ (face 1:10 a (aura 1:12 @))
6+ (bind 1:14 b))
7+ (wing 1:17 a)))
8+ (value 2:1 g
9+ (gate 2:6
10+ (cell 2:9
11+ (bind 2:10 a)
12+ (cell 2:12
13+ (bind 2:13 b)
14+ (face 2:15 c (aura 2:17 @))))
15+ (wing 2:21 b))))
tests/golden/inline-gate-samples/tree.txtnew file+13
@@ -0,0 +1,13 @@
1+(module
2+ (value 1:1 f
3+ (gate 1:6
4+ (face 1:9 m (ref 1:11 model))
5+ (wing 1:17 m)))
6+ (value 2:1 g
7+ (gate 2:6 (pun 2:9 msg) (wing 2:14 msg)))
8+ (value 3:1 h
9+ (gate 3:6
10+ (cell 3:9
11+ (face 3:10 a (aura 3:12 @))
12+ (face 3:14 b (aura 3:16 @)))
13+ (body 4:3 (wing 4:3 a)))))
tests/golden/inline-gate-wide/tree.txtnew file+7
@@ -0,0 +1,7 @@
1+(module
2+ (value 1:1 x
3+ (gate-wide 1:6
4+ (face 1:9 p (ref 1:11 post.blog))
5+ (wing 1:21 title.p)))
6+ (value 2:1 y
7+ (gate-wide 2:6 (bind 2:9 p) (wing 2:11 title.p))))
tests/golden/inline-generic-apply-bad/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar tab, Runes: "`+$` **lusbuc**: defines a mold, likewise: on its line, or as cases on the lines below, one per line, where several cases make a union and one is just that mold. Molds may be recursive."; "`|$` **barbuc**: a generic mold, right after a `+$`'s name: `+$ result |$ [V E]`, then the mold on its line or the cases below."
2+tests: `|$` in a mold application
3+expect: error at 1:12 — `|$` goes right after a `+$` name
tests/golden/inline-generic-apply-bad/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ x (list |$ [A] A)
tests/golden/inline-generic-apply-bad/tokens.txtnew file+11
@@ -0,0 +1,11 @@
1+1:1 glyph +$
2+1:4 name x
3+1:6 glyph (
4+1:7 tight name list
5+1:12 glyph |$
6+1:15 glyph [
7+1:16 tight tvar A
8+1:17 tight glyph ]
9+1:19 tvar A
10+1:20 tight glyph )
11+1:21 NEWLINE
tests/golden/inline-generic-apply-bad/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/inline-generic-apply-bad/source.jibb:1:12: expected a mold, found `|$`; `|$` goes right after a `+$`'s name, as in +$ result |$ [V E]
2++$ x (list |$ [A] A)
3+ ^
tests/golden/inline-generic-both-bad/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar tab, Runes: "`+$` **lusbuc**: defines a mold, likewise: on its line, or as cases on the lines below, one per line, where several cases make a union and one is just that mold. Molds may be recursive."; "`|$` **barbuc**: a generic mold, right after a `+$`'s name: `+$ result |$ [V E]`, then the mold on its line or the cases below."
2+tests: a generic mold on the definition line and cases below
3+expect: error at 2:3 — a `+$` takes one mold on its line or its cases below, not both
tests/golden/inline-generic-both-bad/source.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ x |$ [A] A
2+ %a
3+ %b
tests/golden/inline-generic-both-bad/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/inline-generic-both-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-case-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-case-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/inline-generic-case-bad/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/inline-generic-case-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-cast-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-cast-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-generic-cast-bad/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/inline-generic-cast-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-empty-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-empty-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/inline-generic-empty-bad/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/inline-generic-empty-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-field-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-field-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-generic-field-bad/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/inline-generic-field-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-mold/about.txt+1−1

This diff is too big to show here.

tests/golden/inline-generic-mold/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-prefix-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-prefix-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-generic-prefix-bad/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-generic-prefix-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hex/tree.txtnew file+2

This diff is too big to show here.

tests/golden/inline-hoon-union-apply-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-apply-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-hoon-union-apply-bad/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/inline-hoon-union-apply-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-cast-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-cast-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-hoon-union-cast-bad/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/inline-hoon-union-cast-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-definition-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-definition-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-hoon-union-definition-bad/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/inline-hoon-union-definition-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-field-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-field-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-hoon-union-field-bad/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/inline-hoon-union-field-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-gate-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-gate-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-hoon-union-gate-bad/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/inline-hoon-union-gate-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-nested-sample-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-nested-sample-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/inline-hoon-union-nested-sample-bad/tokens.txtnew file+19

This diff is too big to show here.

tests/golden/inline-hoon-union-nested-sample-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-open-apply-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-open-apply-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/inline-hoon-union-open-apply-bad/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/inline-hoon-union-open-apply-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-open-field-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-open-field-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/inline-hoon-union-open-field-bad/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/inline-hoon-union-open-field-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-sample-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-sample-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/inline-hoon-union-sample-bad/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/inline-hoon-union-sample-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-wide-sample-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-hoon-union-wide-sample-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-hoon-union-wide-sample-bad/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/inline-hoon-union-wide-sample-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-import-dollar-mark-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-import-dollar-mark-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-import-dollar-mark-bad/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-import-dollar-mark-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-import-mark-face-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-import-root-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-import-root-bad/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-import-root-bad/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/inline-import-root-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-imports-after-definition/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-island/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-kinds/tree.txtnew file+18

This diff is too big to show here.

tests/golden/inline-knot/tree.txtnew file+2

This diff is too big to show here.

tests/golden/inline-leftout-barcab/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-barcen-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen-3/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-barcen-3/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barcen/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-barhep/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-bartar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-alone/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-alone/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-buc-alone/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-alone/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-3/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-3/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren/tokens.txt+2−2

This diff is too big to show here.

tests/golden/inline-leftout-buc-paren/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-buccen/about.txt+2−2

This diff is too big to show here.

tests/golden/inline-leftout-buccen/tokens.txt+1−1

This diff is too big to show here.

tests/golden/inline-leftout-buccen/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-cencol/tokens.txt+1−1

This diff is too big to show here.

tests/golden/inline-leftout-cencol/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-cenhep/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-cenhep/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-cenhep/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-cenhep/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-centis/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-colhep/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-colhep/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-colhep/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-colhep/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-colon-wing/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-colsig/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-coltar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-dottar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-dottis/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-faslus/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-hephep/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-kethep-wide/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-kettar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-miccol/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-miccol/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-miccol/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-miccol/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-sail/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-sigbar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-signed-float-auras-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-signed-float-auras-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-signed-float-auras-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-signed-float-auras-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-signed-float-auras/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-sigpam-wide/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-sigpam-wide/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-sigpam-wide/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/inline-leftout-sigpam-wide/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tis-paren/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tisfas/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tisgal-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tisgal-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-tisgal-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tisgal-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tisgal/tokens.txt+2−2

This diff is too big to show here.

tests/golden/inline-leftout-tisgal/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tisgar/tokens.txt+2−2

This diff is too big to show here.

tests/golden/inline-leftout-tisgar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tislus/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tislus/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-tislus/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/inline-leftout-tislus/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-tistis/tokens.txt+2−2

This diff is too big to show here.

tests/golden/inline-leftout-tistis/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutcol-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutcol-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-wutcol-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutcol-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutcol/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wuthep-wide/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutlus/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutsig/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutsig/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-wutsig/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutsig/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-wutzap/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-zap-not-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-zap-not-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/inline-leftout-zap-not-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-zap-not-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-zap-not/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-leftout-zapgar/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-list-parens/tree.txtnew file+7

This diff is too big to show here.

tests/golden/inline-list/tree.txtnew file+5

This diff is too big to show here.

tests/golden/inline-literal-defaults/tree.txtnew file+6

This diff is too big to show here.

tests/golden/inline-load-slug/tree.txtnew file+7

This diff is too big to show here.

tests/golden/inline-local-names-bodies/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-local-names-bodies/source.jibbnew file+15

This diff is too big to show here.

tests/golden/inline-local-names-bodies/tokens.txtnew file+58

This diff is too big to show here.

tests/golden/inline-local-names-bodies/tree.txtnew file+29

This diff is too big to show here.

tests/golden/inline-local-names/tree.txtnew file+15

This diff is too big to show here.

tests/golden/inline-loobean/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-mark-digit/tree.txtnew file+2

This diff is too big to show here.

tests/golden/inline-module-definitions/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-mold-add/about.txt+1−1

This diff is too big to show here.

tests/golden/inline-mold-add/tree.txtnew file+8

This diff is too big to show here.

tests/golden/inline-mold-any-empty/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-mold-atoms/tree.txtnew file+9

This diff is too big to show here.

tests/golden/inline-mold-constants/tree.txtnew file+5

This diff is too big to show here.

tests/golden/inline-mold-containers/tree.txtnew file+17

This diff is too big to show here.

tests/golden/inline-mold-gate/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-mold-generic/about.txt+1−1

This diff is too big to show here.

tests/golden/inline-mold-generic/source.jibb+1−1

This diff is too big to show here.

tests/golden/inline-mold-generic/tokens.txt−1

This diff is too big to show here.

tests/golden/inline-mold-generic/tree.txtnew file+10

This diff is too big to show here.

tests/golden/inline-mold-opaque/about.txt+2−2

This diff is too big to show here.

tests/golden/inline-mold-opaque/tree.txtnew file+4

This diff is too big to show here.

tests/golden/inline-mold-paths/tree.txtnew file+4

This diff is too big to show here.

tests/golden/inline-mold-records/tree.txtnew file+15

This diff is too big to show here.

tests/golden/inline-namespaces/tree.txtnew file+5

This diff is too big to show here.

tests/golden/inline-no-operators/tree.txtnew file+7

This diff is too big to show here.

tests/golden/inline-no-subs/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-null/tree.txtnew file+2

This diff is too big to show here.

tests/golden/inline-pair/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pairs-two-items/tree.txtnew file+5

This diff is too big to show here.

tests/golden/inline-path/about.txt+2−2

This diff is too big to show here.

tests/golden/inline-path/tree.txtnew file+2

This diff is too big to show here.

tests/golden/inline-pattern-any/tree.txtnew file+8

This diff is too big to show here.

tests/golden/inline-pattern-cell-open-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-cell-open-bad/source.jibbnew file+5

This diff is too big to show here.

tests/golden/inline-pattern-cell-open-bad/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/inline-pattern-cell-open-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-cell/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-crash-arm/about.txt+1−1

This diff is too big to show here.

tests/golden/inline-pattern-crash-arm/source.jibb+4−1

This diff is too big to show here.

tests/golden/inline-pattern-crash-arm/tokens.txt+25−20

This diff is too big to show here.

tests/golden/inline-pattern-crash-arm/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-crash-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-crash-bad/source.jibbnew file+7

This diff is too big to show here.

tests/golden/inline-pattern-crash-bad/tokens.txtnew file+26

This diff is too big to show here.

tests/golden/inline-pattern-crash-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-date-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-duration-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-duration-bad/source.jibbnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-duration-bad/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-duration-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-eq/tree.txtnew file+12

This diff is too big to show here.

tests/golden/inline-pattern-face-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-face-bad/source.jibbnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-face-bad/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/inline-pattern-face-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-head-tag/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-interpolated-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-list-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-literals/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-loobean/tree.txtnew file+9

This diff is too big to show here.

tests/golden/inline-pattern-move-any/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-name/tree.txtnew file+8

This diff is too big to show here.

tests/golden/inline-pattern-null/tree.txtnew file+10

This diff is too big to show here.

tests/golden/inline-pattern-pair-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-pattern-tail-tag/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-term/tree.txtnew file+9

This diff is too big to show here.

tests/golden/inline-pattern-two-tags/tree.txtnew file+11

This diff is too big to show here.

tests/golden/inline-pattern-unit/tree.txtnew file+12

This diff is too big to show here.

tests/golden/inline-qath/tree.txtnew file+4

This diff is too big to show here.

tests/golden/inline-requests/tree.txtnew file+12

This diff is too big to show here.

tests/golden/inline-scry-case/about.txt+1−1

This diff is too big to show here.

tests/golden/inline-scry-case/source.jibb+1−1

This diff is too big to show here.

tests/golden/inline-scry-case/tokens.txt−1

This diff is too big to show here.

tests/golden/inline-scry-case/tree.txtnew file+7

This diff is too big to show here.

tests/golden/inline-self-reference/tree.txtnew file+4

This diff is too big to show here.

tests/golden/inline-ship/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-static-image/tree.txtnew file+4

This diff is too big to show here.

tests/golden/inline-string/tree.txtnew file+4

This diff is too big to show here.

tests/golden/inline-tag-shape/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-term-numeric/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-term-numeric/source.jibbnew file+9

This diff is too big to show here.

tests/golden/inline-term-numeric/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/inline-term-numeric/tree.txtnew file+12

This diff is too big to show here.

tests/golden/inline-term/tree.txtnew file+2

This diff is too big to show here.

tests/golden/inline-text-items/tree.txtnew file+6

This diff is too big to show here.

tests/golden/inline-union-both-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-union-both-bad/source.jibbnew file+3

This diff is too big to show here.

tests/golden/inline-union-both-bad/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/inline-union-both-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-union-local/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-union-local/source.jibbnew file+5

This diff is too big to show here.

tests/golden/inline-union-local/tokens.txtnew file+18

This diff is too big to show here.

tests/golden/inline-union-local/tree.txtnew file+8

This diff is too big to show here.

tests/golden/inline-union-one-case/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-union-one-case/source.jibbnew file+3

This diff is too big to show here.

tests/golden/inline-union-one-case/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/inline-union-one-case/tree.txtnew file+9

This diff is too big to show here.

tests/golden/inline-union-record-bad/about.txtnew file+3

This diff is too big to show here.

tests/golden/inline-union-record-bad/source.jibbnew file+3

This diff is too big to show here.

tests/golden/inline-union-record-bad/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/inline-union-record-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-union-wide/about.txt+3−3

This diff is too big to show here.

tests/golden/inline-union-wide/tokens.txt+3−7

This diff is too big to show here.

tests/golden/inline-union-wide/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-unit/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-wide-form-rune-bad/about.txt+1−1

This diff is too big to show here.

tests/golden/inline-wide-form-rune-bad/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-wide-forms/about.txt+2−2

This diff is too big to show here.

tests/golden/inline-wide-forms/source.jibb−1

This diff is too big to show here.

tests/golden/inline-wide-forms/tokens.txt+5−12

This diff is too big to show here.

tests/golden/inline-wide-forms/tree.txtnew file+5

This diff is too big to show here.

tests/golden/inline-wide-union-call/about.txt+3−3

This diff is too big to show here.

tests/golden/inline-wide-union-call/source.jibb+3−1

This diff is too big to show here.

tests/golden/inline-wide-union-call/tokens.txt+7−6

This diff is too big to show here.

tests/golden/inline-wide-union-call/tree.txtnew file+3

This diff is too big to show here.

tests/golden/inline-wings/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-base32-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-base32-ok-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-blob-bad-1/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-blob-bad-1/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-blob-bad-1/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-blob-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-call-open-bad-1/tree.txtnew file+7

This diff is too big to show here.

tests/golden/lex-call-open-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-call-open-bad-3/about.txtdeleted−3

This diff is too big to show here.

tests/golden/lex-call-open-bad-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-call-open-bad-4/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-call-open-bad-4/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-call-open-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-call-open-ok-1/tree.txtnew file+14

This diff is too big to show here.

tests/golden/lex-call-open-ok-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-call-open-bad-3/source.jibb → tests/golden/lex-call-open-ok-2/source.jibbrenamed

The content is the same.

tests/golden/lex-call-open-bad-3/tokens.txt → tests/golden/lex-call-open-ok-2/tokens.txtrenamed

The content is the same.

tests/golden/lex-call-open-ok-2/tree.txtnew file+4

This diff is too big to show here.

tests/golden/lex-cell-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-cell-ok-1/tree.txtnew file+15

This diff is too big to show here.

tests/golden/lex-closer-bad-1/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-1/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-closer-bad-1/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-closer-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-2/source.jibbnew file+4

This diff is too big to show here.

tests/golden/lex-closer-bad-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-3/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-3/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-closer-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-closer-bad-4/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-closer-bad-4/tokens.txtnew file+5

This diff is too big to show here.

tests/golden/lex-closer-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-codepoint-bad-1/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-codepoint-bad-1/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-codepoint-bad-1/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-codepoint-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-comment-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-comment-ok-1/tree.txtnew file+6

This diff is too big to show here.

tests/golden/lex-comment-ok-2/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-comment-ok-2/tree.txtnew file+2

This diff is too big to show here.

tests/golden/lex-comment-ok-3/tree.txtnew file+1

This diff is too big to show here.

tests/golden/lex-date-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-date-bad-2/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-date-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-date-bad-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-date-bad-3/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-date-bad-3/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-date-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-date-ok-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-date-ok-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-date-ok-2/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-date-ok-2/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-date-ok-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-decimal-bad-1/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-decimal-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-decimal-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-decimal-ok-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-duration-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-duration-bad-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-duration-bad-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-duration-bad-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-duration-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-duration-ok-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-hex-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-hex-ok-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-indent-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-indent-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-indent-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-indent-ok-1/tree.txtnew file+21

This diff is too big to show here.

tests/golden/lex-indent-ok-2/tree.txtnew file+17

This diff is too big to show here.

tests/golden/lex-indent-ok-3/source.jibb+1−1

This diff is too big to show here.

tests/golden/lex-indent-ok-3/tokens.txt−1

This diff is too big to show here.

tests/golden/lex-indent-ok-3/tree.txtnew file+11

This diff is too big to show here.

tests/golden/lex-interp-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-4/about.txtdeleted−3

This diff is too big to show here.

tests/golden/lex-interp-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-5/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-interp-bad-5/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-6/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-interp-bad-6/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-ok-1/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-interp-ok-1/tree.txtnew file+22

This diff is too big to show here.

tests/golden/lex-interp-ok-2/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-interp-ok-2/tree.txtnew file+17

This diff is too big to show here.

tests/golden/lex-interp-ok-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-interp-bad-4/source.jibb → tests/golden/lex-interp-ok-3/source.jibbrenamed

The content is the same.

tests/golden/lex-interp-bad-4/tokens.txt → tests/golden/lex-interp-ok-3/tokens.txtrenamed

The content is the same.

tests/golden/lex-interp-ok-3/tree.txtnew file+2

This diff is too big to show here.

tests/golden/lex-knot-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-knot-ok-1/tree.txtnew file+4

This diff is too big to show here.

tests/golden/lex-layout-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-layout-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-10/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-10/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-layout-bad-10/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-layout-bad-10/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-5/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-layout-bad-5/tokens.txtnew file+6

This diff is too big to show here.

tests/golden/lex-layout-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-6/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-layout-bad-6/tokens.txtnew file+6

This diff is too big to show here.

tests/golden/lex-layout-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-7/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-layout-bad-7/tokens.txtnew file+6

This diff is too big to show here.

tests/golden/lex-layout-bad-7/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-8/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-layout-bad-8/tokens.txtnew file+5

This diff is too big to show here.

tests/golden/lex-layout-bad-8/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-bad-9/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-layout-bad-9/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/lex-layout-bad-9/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-layout-ok-1/tree.txtnew file+20

This diff is too big to show here.

tests/golden/lex-list-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-list-ok-1/tree.txtnew file+11

This diff is too big to show here.

tests/golden/lex-loobean-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-loobean-ok-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-5/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-name-bad-5/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-bad-6/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-name-bad-6/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/lex-name-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-name-ok-1/tree.txtnew file+11

This diff is too big to show here.

tests/golden/lex-null-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-null-bad-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-null-bad-2/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-null-bad-2/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-null-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-null-ok-1/tree.txtnew file+19

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-10/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-10/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-10/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-10/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-11/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-11/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-11/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-11/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-12/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-12/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-12/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-12/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-13/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-13/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-13/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-13/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-14/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-14/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-14/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-14/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-15/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-15/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-15/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-15/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-16/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-16/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-16/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-16/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-4/about.txtdeleted−3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-5/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-5/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-6/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-6/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-7/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-7/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-7/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-8/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-8/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-8/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-9/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-9/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-9/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-1/tree.txtnew file+21

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-2/tree.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-bad-4/source.jibb → tests/golden/lex-open-bracket-ok-3/source.jibbrenamed

The content is the same.

tests/golden/lex-open-bracket-bad-4/tokens.txt → tests/golden/lex-open-bracket-ok-3/tokens.txtrenamed

The content is the same.

tests/golden/lex-open-bracket-ok-3/tree.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-4/source.jibbnew file+12

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-4/tokens.txtnew file+47

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-4/tree.txtnew file+19

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-5/source.jibbnew file+7

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-5/tokens.txtnew file+41

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-5/tree.txtnew file+17

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-6/source.jibbnew file+5

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-6/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-6/tree.txtnew file+12

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-7/source.jibbnew file+6

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-7/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-7/tree.txtnew file+18

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-8/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-8/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-8/tree.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-9/source.jibbnew file+6

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-9/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/lex-open-bracket-ok-9/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-open-mold-bad-1/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-1/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-1/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-mold-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-10/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-10/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-10/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-mold-bad-10/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-11/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-11/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-11/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-mold-bad-11/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-12/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-12/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-open-mold-bad-12/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/lex-open-mold-bad-12/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-13/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-13/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-13/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/lex-open-mold-bad-13/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-14/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-14/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-14/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-14/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-15/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-15/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-15/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-mold-bad-15/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-16/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-16/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-16/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-mold-bad-16/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-2/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-2/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/lex-open-mold-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-3/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-3/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-open-mold-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-4/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-4/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/lex-open-mold-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-5/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-5/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/lex-open-mold-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-6/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-open-mold-bad-6/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-7/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-7/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-mold-bad-7/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-8/source.jibbnew file+4

This diff is too big to show here.

tests/golden/lex-open-mold-bad-8/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-8/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-bad-9/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-open-mold-bad-9/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/lex-open-mold-bad-9/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-1/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-1/source.jibbnew file+7

This diff is too big to show here.

tests/golden/lex-open-mold-ok-1/tokens.txtnew file+55

This diff is too big to show here.

tests/golden/lex-open-mold-ok-1/tree.txtnew file+19

This diff is too big to show here.

tests/golden/lex-open-mold-ok-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-2/source.jibbnew file+5

This diff is too big to show here.

tests/golden/lex-open-mold-ok-2/tokens.txtnew file+19

This diff is too big to show here.

tests/golden/lex-open-mold-ok-2/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-open-mold-ok-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-3/source.jibbnew file+8

This diff is too big to show here.

tests/golden/lex-open-mold-ok-3/tokens.txtnew file+36

This diff is too big to show here.

tests/golden/lex-open-mold-ok-3/tree.txtnew file+13

This diff is too big to show here.

tests/golden/lex-open-mold-ok-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-4/source.jibbnew file+6

This diff is too big to show here.

tests/golden/lex-open-mold-ok-4/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/lex-open-mold-ok-4/tree.txtnew file+11

This diff is too big to show here.

tests/golden/lex-open-mold-ok-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-5/source.jibbnew file+8

This diff is too big to show here.

tests/golden/lex-open-mold-ok-5/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/lex-open-mold-ok-5/tree.txtnew file+8

This diff is too big to show here.

tests/golden/lex-open-mold-ok-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-open-mold-ok-6/source.jibbnew file+7

This diff is too big to show here.

tests/golden/lex-open-mold-ok-6/tokens.txtnew file+17

This diff is too big to show here.

tests/golden/lex-open-mold-ok-6/tree.txtnew file+6

This diff is too big to show here.

tests/golden/lex-pair-binding-bad-1/tree.txtnew file+9

This diff is too big to show here.

tests/golden/lex-pair-binding-ok-1/tree.txtnew file+11

This diff is too big to show here.

tests/golden/lex-path-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-path-ok-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-11/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-11/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-11/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-11/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-12/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-12/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-12/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-12/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-13/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-13/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-13/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-13/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-14/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-14/source.jibbnew file+4

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-14/tokens.txtnew file+17

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-14/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-15/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-15/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-15/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-15/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-2/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-3/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-4/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-5/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-5/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-6/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-6/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-7/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-7/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-7/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-8/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-8/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-8/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-9/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-9/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/lex-rune-layout-bad-9/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-1/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-1/source.jibb+2−3

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-1/tokens.txt+5−8

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-1/tree.txtnew file+42

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-2/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-2/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/lex-rune-layout-ok-2/tree.txtnew file+4

This diff is too big to show here.

tests/golden/lex-ship-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-ship-ok-1/tree.txtnew file+4

This diff is too big to show here.

tests/golden/lex-spacing-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-spacing-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-spacing-bad-3/about.txtdeleted−3

This diff is too big to show here.

tests/golden/lex-spacing-bad-4/about.txtdeleted−3

This diff is too big to show here.

tests/golden/lex-spacing-ok-1/tree.txtnew file+17

This diff is too big to show here.

tests/golden/lex-spacing-ok-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-spacing-bad-3/source.jibb → tests/golden/lex-spacing-ok-2/source.jibbrenamed

The content is the same.

tests/golden/lex-spacing-bad-3/tokens.txt → tests/golden/lex-spacing-ok-2/tokens.txtrenamed

The content is the same.

tests/golden/lex-spacing-ok-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-spacing-ok-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-spacing-bad-4/source.jibb → tests/golden/lex-spacing-ok-3/source.jibbrenamed

The content is the same.

tests/golden/lex-spacing-bad-4/tokens.txt → tests/golden/lex-spacing-ok-3/tokens.txtrenamed

The content is the same.

tests/golden/lex-spacing-ok-3/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-string-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-string-bad-2/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-string-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-string-ok-1/tree.txtnew file+4

This diff is too big to show here.

tests/golden/lex-term-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-term-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-10/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-10/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-10/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-10/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-11/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-11/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-11/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-11/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-12/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-12/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-term-bad-12/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-12/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-13/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-13/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-term-bad-13/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-13/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-14/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-14/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-14/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-14/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-15/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-15/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-15/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-15/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-2/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-term-bad-2/tokens.txt+1−1

This diff is too big to show here.

tests/golden/lex-term-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-3/about.txt+3−3

This diff is too big to show here.

tests/golden/lex-term-bad-3/tokens.txt+3−3

This diff is too big to show here.

tests/golden/lex-term-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-4/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-4/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-5/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-5/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-6/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-6/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-7/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-7/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-7/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-8/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-8/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-8/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-9/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-term-bad-9/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-bad-9/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-dollar/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-term-dollar/source.jibbnew file+9

This diff is too big to show here.

tests/golden/lex-term-dollar/tokens.txtnew file+43

This diff is too big to show here.

tests/golden/lex-term-dollar/tree.txtnew file+19

This diff is too big to show here.

tests/golden/lex-term-ok-1/about.txt+3−3

This diff is too big to show here.

tests/golden/lex-term-ok-1/source.jibb+2

This diff is too big to show here.

tests/golden/lex-term-ok-1/tokens.txt+9−1

This diff is too big to show here.

tests/golden/lex-term-ok-1/tree.txtnew file+9

This diff is too big to show here.

tests/golden/lex-tight-change-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-1/tree.txtnew file+6

This diff is too big to show here.

tests/golden/lex-tight-change-bad-2/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-3/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-3/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/lex-tight-change-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-4/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-4/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-4/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-tight-change-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-5/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-5/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-5/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-tight-change-bad-5/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-6/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-6/source.jibbnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-6/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/lex-tight-change-bad-6/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-7/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-7/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-7/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/lex-tight-change-bad-7/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-8/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-8/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-8/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-8/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-9/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-9/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-change-bad-9/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-bad-9/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-change-ok-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-change-ok-1/tree.txtnew file+14

This diff is too big to show here.

tests/golden/lex-tight-ctor-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-ctor-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-ctor-bad-2/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-ctor-bad-2/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-tight-ctor-ok-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-ctor-ok-1/tree.txtnew file+7

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-1/tree.txtnew file+5

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-2/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-3/about.txt+3−3

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-3/tokens.txt+3−8

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-4/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-opener-bad-4/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-opener-ok-1/about.txt+2−2

This diff is too big to show here.

tests/golden/lex-tight-opener-ok-1/source.jibb−1

This diff is too big to show here.

tests/golden/lex-tight-opener-ok-1/tokens.txt+5−12

This diff is too big to show here.

tests/golden/lex-tight-opener-ok-1/tree.txtnew file+10

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-2/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-2/source.jibbnew file+2

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-2/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-3/about.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-3/source.jibbnew file+1

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-3/tokens.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-pair-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-pair-ok-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-pair-ok-1/tree.txtnew file+18

This diff is too big to show here.

tests/golden/lex-tight-qath-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-qath-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-qath-bad-2/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-qath-bad-3/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-qath-ok-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-qath-ok-1/tree.txtnew file+9

This diff is too big to show here.

tests/golden/lex-tight-unit-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-unit-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-unit-ok-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-unit-ok-1/tree.txtnew file+13

This diff is too big to show here.

tests/golden/lex-tight-wing-bad-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-wing-bad-1/tree.txtnew file+3

This diff is too big to show here.

tests/golden/lex-tight-wing-ok-1/about.txt+1−1

This diff is too big to show here.

tests/golden/lex-tight-wing-ok-1/tree.txtnew file+8

This diff is too big to show here.

tests/golden/module-cache-dag/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-cache-dag/module-trees.txtnew file+46

This diff is too big to show here.

tests/golden/module-cache-dag/modules.txtnew file+8

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n0.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n1.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n2.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n3.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n4.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n5.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n6.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-dag/modules/ui/n7.jibbnew file+1

This diff is too big to show here.

tests/golden/module-cache-dag/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-cache-dag/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-cache-dag/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-cache-dag/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-cache-faces/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-cache-faces/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-cache-faces/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-cache-faces/modules/ui/shared.jibbnew file+1

This diff is too big to show here.

tests/golden/module-cache-faces/source.jibbnew file+4

This diff is too big to show here.

tests/golden/module-cache-faces/tokens.txtnew file+28

This diff is too big to show here.

tests/golden/module-cache-faces/tree.txtnew file+9

This diff is too big to show here.

tests/golden/module-cache-faces/types.txtnew file+3

This diff is too big to show here.

tests/golden/module-cache-incomplete/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-cache-incomplete/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/module-cache-incomplete/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-cache-incomplete/modules/ui/bad.jibbnew file+2

This diff is too big to show here.

tests/golden/module-cache-incomplete/source.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-incomplete/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/module-cache-incomplete/tree.txtnew file+6

This diff is too big to show here.

tests/golden/module-cache-incomplete/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/module-trees.txtnew file+15

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/modules.txtnew file+3

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/modules/ui/a.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/modules/ui/b.jibbnew file+2

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/modules/ui/safe.jibbnew file+1

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/source.jibbnew file+3

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/tokens.txtnew file+18

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/tree.txtnew file+4

This diff is too big to show here.

tests/golden/module-cache-sibling-cycle/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-fixture-eof/about.txtnew file+3

This diff is too big to show here.

tests/golden/module-fixture-eof/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-fixture-eof/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-fixture-eof/modules/ui/incomplete.jibbnew file+1

This diff is too big to show here.

tests/golden/module-fixture-eof/source.jibbnew file+1

This diff is too big to show here.

tests/golden/module-fixture-eof/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/module-fixture-eof/tree.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-atom-scheme/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-atom-scheme/module-trees.txtnew file+13

This diff is too big to show here.

tests/golden/module-import-atom-scheme/modules.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-atom-scheme/modules/ui/base.jibbnew file+3

This diff is too big to show here.

tests/golden/module-import-atom-scheme/modules/ui/mid.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-atom-scheme/source.jibbnew file+4

This diff is too big to show here.

tests/golden/module-import-atom-scheme/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/module-import-atom-scheme/tree.txtnew file+13

This diff is too big to show here.

tests/golden/module-import-atom-scheme/types.txtnew file+10

This diff is too big to show here.

tests/golden/module-import-cycle/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-cycle/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/module-import-cycle/modules.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-cycle/modules/ui/a.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-cycle/modules/ui/b.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-cycle/path.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-cycle/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-cycle/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-cycle/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-cycle/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-empty/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-empty/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-empty/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-empty/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-empty/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-empty/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-face-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-face-shadow/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-face-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-face-shadow/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-face-shadow/source.jibbnew file+4

This diff is too big to show here.

tests/golden/module-import-face-shadow/tokens.txtnew file+19

This diff is too big to show here.

tests/golden/module-import-face-shadow/tree.txtnew file+8

This diff is too big to show here.

tests/golden/module-import-face-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-identity/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-identity/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-identity/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-identity/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-identity/source.jibbnew file+3

This diff is too big to show here.

tests/golden/module-import-identity/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/module-import-identity/tree.txtnew file+8

This diff is too big to show here.

tests/golden/module-import-identity/types.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-invalid/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-invalid/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-invalid/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-invalid/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-invalid/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-invalid/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-invalid/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-invalid/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-missing-member/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-missing-member/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-missing-member/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-missing-member/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-missing-member/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-missing-member/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-missing-member/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-missing-member/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-mold/module-trees.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-mold/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-mold/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-mold/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/module-import-mold/tree.txtnew file+6

This diff is too big to show here.

tests/golden/module-import-mold/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-cross-namespace/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-cross-namespace/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-cross-namespace/source.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-cross-namespace/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/module-import-prelude-cross-namespace/tree.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-prelude-cross-namespace/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-mold-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-mold-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-mold-shadow/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-mold-shadow/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/module-import-prelude-mold-shadow/tree.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-prelude-mold-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/tree.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-sample-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/tree.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-prelude-value-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-root-cycle/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-root-cycle/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/module-import-root-cycle/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-root-cycle/modules/ui/a.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-root-cycle/path.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-root-cycle/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-root-cycle/tokens.txtnew file+17

This diff is too big to show here.

tests/golden/module-import-root-cycle/tree.txtnew file+7

This diff is too big to show here.

tests/golden/module-import-root-cycle/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/imports.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/mar/label.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/marks.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/source.jibbnew file+4

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/tree.txtnew file+7

This diff is too big to show here.

tests/golden/module-import-root-import-shadow/types.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/module-trees.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/source.jibbnew file+3

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/tree.txtnew file+9

This diff is too big to show here.

tests/golden/module-import-separate-namespaces/types.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-sur-scope/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-sur-scope/imports.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-sur-scope/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/module-import-sur-scope/modules.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-sur-scope/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-sur-scope/source.jibbnew file+4

This diff is too big to show here.

tests/golden/module-import-sur-scope/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-sur-scope/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/module-import-sur-scope/tree.txtnew file+10

This diff is too big to show here.

tests/golden/module-import-sur-scope/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-transitive/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-transitive/module-trees.txtnew file+20

This diff is too big to show here.

tests/golden/module-import-transitive/modules.txtnew file+3

This diff is too big to show here.

tests/golden/module-import-transitive/modules/ui/a.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-transitive/modules/ui/b.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-transitive/modules/ui/c.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-transitive/path.txtnew file+1

This diff is too big to show here.

tests/golden/module-import-transitive/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-transitive/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-transitive/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-transitive/types.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-unused-invalid/about.txtnew file+4

This diff is too big to show here.

tests/golden/module-import-unused-invalid/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/module-import-unused-invalid/modules.txtnew file+2

This diff is too big to show here.

tests/golden/module-import-unused-invalid/modules/ui/good.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-unused-invalid/modules/ui/unused.jibbnew file+1

This diff is too big to show here.

tests/golden/module-import-unused-invalid/source.jibbnew file+2

This diff is too big to show here.

tests/golden/module-import-unused-invalid/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/module-import-unused-invalid/tree.txtnew file+5

This diff is too big to show here.

tests/golden/module-import-unused-invalid/types.txtnew file+2

This diff is too big to show here.

tests/golden/parser-hole-parameter-rejected/about.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-parameter-rejected/source.jibbnew file+1

This diff is too big to show here.

tests/golden/parser-hole-parameter-rejected/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/parser-hole-parameter-rejected/tree.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-path-space/about.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-path-space/source.jibbnew file+1

This diff is too big to show here.

tests/golden/parser-hole-path-space/tokens.txtnew file+9

This diff is too big to show here.

tests/golden/parser-hole-path-space/tree.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-path/about.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-path/source.jibbnew file+4

This diff is too big to show here.

tests/golden/parser-hole-path/tokens.txtnew file+28

This diff is too big to show here.

tests/golden/parser-hole-path/tree.txtnew file+5

This diff is too big to show here.

tests/golden/parser-hole-pattern-rejected/about.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-pattern-rejected/source.jibbnew file+3

This diff is too big to show here.

tests/golden/parser-hole-pattern-rejected/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/parser-hole-pattern-rejected/tree.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-shapes/about.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-shapes/source.jibbnew file+11

This diff is too big to show here.

tests/golden/parser-hole-shapes/tokens.txtnew file+121

This diff is too big to show here.

tests/golden/parser-hole-shapes/tree.txtnew file+47

This diff is too big to show here.

tests/golden/parser-hole-value-rejected/about.txtnew file+3

This diff is too big to show here.

tests/golden/parser-hole-value-rejected/source.jibbnew file+1

This diff is too big to show here.

tests/golden/parser-hole-value-rejected/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/parser-hole-value-rejected/tree.txtnew file+3

This diff is too big to show here.

tests/golden/prelude-1c-structural/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-1c-structural/source.jibbnew file+130

This diff is too big to show here.

tests/golden/prelude-1c-structural/tokens.txtnew file+806

This diff is too big to show here.

tests/golden/prelude-1c-structural/tree.txtnew file+322

This diff is too big to show here.

tests/golden/prelude-1c-structural/types.txtnew file+38

This diff is too big to show here.

tests/golden/prelude-3g-basic/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-3g-basic/source.jibbnew file+62

This diff is too big to show here.

tests/golden/prelude-3g-basic/tokens.txtnew file+354

This diff is too big to show here.

tests/golden/prelude-3g-basic/tree.txtnew file+156

This diff is too big to show here.

tests/golden/prelude-3g-basic/types.txtnew file+15

This diff is too big to show here.

tests/golden/prelude-3g-like/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-3g-like/source.jibbnew file+110

This diff is too big to show here.

tests/golden/prelude-3g-like/tokens.txtnew file+688

This diff is too big to show here.

tests/golden/prelude-3g-like/tree.txtnew file+280

This diff is too big to show here.

tests/golden/prelude-3g-like/types.txtnew file+31

This diff is too big to show here.

tests/golden/prelude-3g-structural/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-3g-structural/source.jibbnew file+95

This diff is too big to show here.

tests/golden/prelude-3g-structural/tokens.txtnew file+564

This diff is too big to show here.

tests/golden/prelude-3g-structural/tree.txtnew file+228

This diff is too big to show here.

tests/golden/prelude-3g-structural/types.txtnew file+28

This diff is too big to show here.

tests/golden/prelude-core-functions/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-core-functions/source.jibbnew file+15

This diff is too big to show here.

tests/golden/prelude-core-functions/tokens.txtnew file+68

This diff is too big to show here.

tests/golden/prelude-core-functions/tree.txtnew file+33

This diff is too big to show here.

tests/golden/prelude-core-functions/types.txtnew file+5

This diff is too big to show here.

tests/golden/prelude-list-helpers/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-list-helpers/source.jibbnew file+148

This diff is too big to show here.

tests/golden/prelude-list-helpers/tokens.txtnew file+928

This diff is too big to show here.

tests/golden/prelude-list-helpers/tree.txtnew file+378

This diff is too big to show here.

tests/golden/prelude-list-helpers/types.txtnew file+42

This diff is too big to show here.

tests/golden/prelude-list-unit/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-list-unit/source.jibbnew file+51

This diff is too big to show here.

tests/golden/prelude-list-unit/tokens.txtnew file+279

This diff is too big to show here.

tests/golden/prelude-list-unit/tree.txtnew file+126

This diff is too big to show here.

tests/golden/prelude-list-unit/types.txtnew file+11

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/about.txtnew file+4

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/source.jibbnew file+339

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/tokens.txtnew file+2234

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/tree.txtnew file+972

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/types.txtnew file+72

This diff is too big to show here.

tests/golden/types-arithmetic-combined/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-arithmetic-combined/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-arithmetic-combined/source.jibbnew file+56

This diff is too big to show here.

tests/golden/types-arithmetic-combined/tokens.txtnew file+511

This diff is too big to show here.

tests/golden/types-arithmetic-combined/tree.txtnew file+232

This diff is too big to show here.

tests/golden/types-arithmetic-combined/types.txtnew file+120

This diff is too big to show here.

tests/golden/types-arithmetic-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-arithmetic-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-arithmetic-generic/source.jibbnew file+21

This diff is too big to show here.

tests/golden/types-arithmetic-generic/tokens.txtnew file+206

This diff is too big to show here.

tests/golden/types-arithmetic-generic/tree.txtnew file+93

This diff is too big to show here.

tests/golden/types-arithmetic-generic/types.txtnew file+44

This diff is too big to show here.

tests/golden/types-arithmetic-module/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-arithmetic-module/module-trees.txtnew file+26

This diff is too big to show here.

tests/golden/types-arithmetic-module/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-arithmetic-module/modules/ui/math.jibbnew file+6

This diff is too big to show here.

tests/golden/types-arithmetic-module/source.jibbnew file+16

This diff is too big to show here.

tests/golden/types-arithmetic-module/tokens.txtnew file+137

This diff is too big to show here.

tests/golden/types-arithmetic-module/tree.txtnew file+63

This diff is too big to show here.

tests/golden/types-arithmetic-module/types.txtnew file+44

This diff is too big to show here.

tests/golden/types-arithmetic-proj-qath/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-arithmetic-proj-qath/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-arithmetic-proj-qath/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-arithmetic-proj-qath/tokens.txtnew file+351

This diff is too big to show here.

tests/golden/types-arithmetic-proj-qath/tree.txtnew file+164

This diff is too big to show here.

tests/golden/types-arithmetic-proj-qath/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-arithmetic-scopes/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-arithmetic-scopes/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-arithmetic-scopes/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-arithmetic-scopes/tokens.txtnew file+221

This diff is too big to show here.

tests/golden/types-arithmetic-scopes/tree.txtnew file+108

This diff is too big to show here.

tests/golden/types-arithmetic-scopes/types.txtnew file+21

This diff is too big to show here.

tests/golden/types-capital-distinct/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-capital-distinct/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-capital-distinct/tokens.txtnew file+73

This diff is too big to show here.

tests/golden/types-capital-distinct/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-capital-distinct/types.txtnew file+19

This diff is too big to show here.

tests/golden/types-cell-branch-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-cell-branch-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-cell-branch-context/source.jibbnew file+37

This diff is too big to show here.

tests/golden/types-cell-branch-context/tokens.txtnew file+308

This diff is too big to show here.

tests/golden/types-cell-branch-context/tree.txtnew file+156

This diff is too big to show here.

tests/golden/types-cell-branch-context/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-cell-pattern-many/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-cell-pattern-many/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-cell-pattern-many/source.jibbnew file+41

This diff is too big to show here.

tests/golden/types-cell-pattern-many/tokens.txtnew file+315

This diff is too big to show here.

tests/golden/types-cell-pattern-many/tree.txtnew file+144

This diff is too big to show here.

tests/golden/types-cell-pattern-many/types.txtnew file+14

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/source.jibbnew file+23

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/tokens.txtnew file+168

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/tree.txtnew file+70

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/types.txtnew file+16

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/tokens.txtnew file+126

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/tree.txtnew file+59

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-constructor-context/about.txtnew file+1

This diff is too big to show here.

tests/golden/types-constructor-context/source.jibbnew file+37

This diff is too big to show here.

tests/golden/types-constructor-context/tokens.txtnew file+289

This diff is too big to show here.

tests/golden/types-constructor-context/tree.txtnew file+130

This diff is too big to show here.

tests/golden/types-constructor-context/types.txtnew file+54

This diff is too big to show here.

tests/golden/types-deferred-call-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-deferred-call-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-deferred-call-context/source.jibbnew file+56

This diff is too big to show here.

tests/golden/types-deferred-call-context/tokens.txtnew file+557

This diff is too big to show here.

tests/golden/types-deferred-call-context/tree.txtnew file+272

This diff is too big to show here.

tests/golden/types-deferred-call-context/types.txtnew file+82

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/tokens.txtnew file+179

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/tree.txtnew file+75

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/types.txtnew file+34

This diff is too big to show here.

tests/golden/types-flag-branch-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-flag-branch-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-flag-branch-context/source.jibbnew file+83

This diff is too big to show here.

tests/golden/types-flag-branch-context/tokens.txtnew file+496

This diff is too big to show here.

tests/golden/types-flag-branch-context/tree.txtnew file+244

This diff is too big to show here.

tests/golden/types-flag-branch-context/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-generic-arity/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-arity/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-generic-arity/tokens.txtnew file+64

This diff is too big to show here.

tests/golden/types-generic-arity/tree.txtnew file+23

This diff is too big to show here.

tests/golden/types-generic-arity/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-generic-face-inference/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-face-inference/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-generic-face-inference/tokens.txtnew file+134

This diff is too big to show here.

tests/golden/types-generic-face-inference/tree.txtnew file+56

This diff is too big to show here.

tests/golden/types-generic-face-inference/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-generic-gates/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-gates/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-generic-gates/tokens.txtnew file+59

This diff is too big to show here.

tests/golden/types-generic-gates/tree.txtnew file+21

This diff is too big to show here.

tests/golden/types-generic-gates/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-generic-import-reverse/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-import-reverse/module-trees.txtnew file+7

This diff is too big to show here.

tests/golden/types-generic-import-reverse/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-generic-import-reverse/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-generic-import-reverse/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-import-reverse/tokens.txtnew file+50

This diff is too big to show here.

tests/golden/types-generic-import-reverse/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-generic-import-reverse/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-generic-lexical-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-lexical-alias/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-lexical-alias/tokens.txtnew file+35

This diff is too big to show here.

tests/golden/types-generic-lexical-alias/tree.txtnew file+13

This diff is too big to show here.

tests/golden/types-generic-lexical-alias/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-local-parameter/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-local-parameter/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-local-parameter/tokens.txtnew file+37

This diff is too big to show here.

tests/golden/types-generic-local-parameter/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-generic-local-parameter/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-generic-local-scope/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-local-scope/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-local-scope/tokens.txtnew file+37

This diff is too big to show here.

tests/golden/types-generic-local-scope/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-generic-local-scope/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-generic-module/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-module/module-trees.txtnew file+7

This diff is too big to show here.

tests/golden/types-generic-module/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-generic-module/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-generic-module/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-module/tokens.txtnew file+39

This diff is too big to show here.

tests/golden/types-generic-module/tree.txtnew file+14

This diff is too big to show here.

tests/golden/types-generic-module/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-generic-nested-scope/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-nested-scope/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-nested-scope/tokens.txtnew file+56

This diff is too big to show here.

tests/golden/types-generic-nested-scope/tree.txtnew file+21

This diff is too big to show here.

tests/golden/types-generic-nested-scope/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-parameters/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-parameters/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-generic-parameters/tokens.txtnew file+64

This diff is too big to show here.

tests/golden/types-generic-parameters/tree.txtnew file+23

This diff is too big to show here.

tests/golden/types-generic-parameters/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-generic-record/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-record/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-record/tokens.txtnew file+47

This diff is too big to show here.

tests/golden/types-generic-record/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-generic-record/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-recursive-union/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-recursive-union/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-generic-recursive-union/tokens.txtnew file+58

This diff is too big to show here.

tests/golden/types-generic-recursive-union/tree.txtnew file+24

This diff is too big to show here.

tests/golden/types-generic-recursive-union/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-generic-repeated/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-repeated/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-repeated/tokens.txtnew file+47

This diff is too big to show here.

tests/golden/types-generic-repeated/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-generic-repeated/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-generic-result-context/about.txtnew file+1

This diff is too big to show here.

tests/golden/types-generic-result-context/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-generic-result-context/tokens.txtnew file+233

This diff is too big to show here.

tests/golden/types-generic-result-context/tree.txtnew file+86

This diff is too big to show here.

tests/golden/types-generic-result-context/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/module-trees.txtnew file+11

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/modules/ui/base.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/tokens.txtnew file+75

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/tree.txtnew file+24

This diff is too big to show here.

tests/golden/types-generic-union-alias-face/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-generic-union-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-alias/source.jibbnew file+23

This diff is too big to show here.

tests/golden/types-generic-union-alias/tokens.txtnew file+248

This diff is too big to show here.

tests/golden/types-generic-union-alias/tree.txtnew file+86

This diff is too big to show here.

tests/golden/types-generic-union-alias/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-generic-union-capitals/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-capitals/source.jibbnew file+17

This diff is too big to show here.

tests/golden/types-generic-union-capitals/tokens.txtnew file+162

This diff is too big to show here.

tests/golden/types-generic-union-capitals/tree.txtnew file+68

This diff is too big to show here.

tests/golden/types-generic-union-capitals/types.txtnew file+34

This diff is too big to show here.

tests/golden/types-generic-union-errors/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-errors/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-generic-union-errors/tokens.txtnew file+93

This diff is too big to show here.

tests/golden/types-generic-union-errors/tree.txtnew file+36

This diff is too big to show here.

tests/golden/types-generic-union-errors/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-generic-union-escaping/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-escaping/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-generic-union-escaping/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-generic-union-escaping/modules/ui/base.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-union-escaping/modules/ui/mid.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-union-escaping/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-union-escaping/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-generic-union-escaping/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-escaping/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-generic-union-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-import/module-trees.txtnew file+32

This diff is too big to show here.

tests/golden/types-generic-union-import/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-generic-union-import/modules/ui/shared.jibbnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-import/modules/ui/twin.jibbnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-import/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-generic-union-import/tokens.txtnew file+79

This diff is too big to show here.

tests/golden/types-generic-union-import/tree.txtnew file+27

This diff is too big to show here.

tests/golden/types-generic-union-import/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-generic-union-local/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-local/source.jibbnew file+34

This diff is too big to show here.

tests/golden/types-generic-union-local/tokens.txtnew file+297

This diff is too big to show here.

tests/golden/types-generic-union-local/tree.txtnew file+120

This diff is too big to show here.

tests/golden/types-generic-union-local/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-generic-union-transitive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-transitive/module-trees.txtnew file+27

This diff is too big to show here.

tests/golden/types-generic-union-transitive/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-generic-union-transitive/modules/ui/base.jibbnew file+3

This diff is too big to show here.

tests/golden/types-generic-union-transitive/modules/ui/mid.jibbnew file+4

This diff is too big to show here.

tests/golden/types-generic-union-transitive/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-generic-union-transitive/tokens.txtnew file+43

This diff is too big to show here.

tests/golden/types-generic-union-transitive/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-generic-union-transitive/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-hole-concrete/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-concrete/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-hole-concrete/tokens.txtnew file+54

This diff is too big to show here.

tests/golden/types-hole-concrete/tree.txtnew file+22

This diff is too big to show here.

tests/golden/types-hole-concrete/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-generic-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-generic-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-generic-mold/tokens.txtnew file+26

This diff is too big to show here.

tests/golden/types-hole-generic-mold/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-hole-generic-mold/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-hole-local-boundary/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-local-boundary/source.jibbnew file+16

This diff is too big to show here.

tests/golden/types-hole-local-boundary/tokens.txtnew file+118

This diff is too big to show here.

tests/golden/types-hole-local-boundary/tree.txtnew file+55

This diff is too big to show here.

tests/golden/types-hole-local-boundary/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-hole-module-boundary/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-module-boundary/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-hole-module-boundary/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-hole-module-boundary/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-hole-module-boundary/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-module-boundary/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-hole-module-boundary/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-hole-module-boundary/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-hole-named-complex/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-named-complex/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-named-complex/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/types-hole-named-complex/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-hole-named-complex/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/tokens.txtnew file+127

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/tree.txtnew file+62

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/tokens.txtnew file+19

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-hole-unsupported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-unsupported/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-unsupported/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-hole-unsupported/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-hole-unsupported/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-hole-user-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-user-generic/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-hole-user-generic/tokens.txtnew file+71

This diff is too big to show here.

tests/golden/types-hole-user-generic/tree.txtnew file+31

This diff is too big to show here.

tests/golden/types-hole-user-generic/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-user-named/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-user-named/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-user-named/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-hole-user-named/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-hole-user-named/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-hole-user-value/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-user-value/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-hole-user-value/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-hole-user-value/tree.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-user-value/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/mar/duplicate.txtnew file+5

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/marks.txtnew file+1

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-import-duplicate-mark/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/imports.txtnew file+3

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/sur/fixture.txtnew file+6

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/tokens.txtnew file+35

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-import-duplicate-sur/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-import-hoon-flags/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-hoon-flags/imports.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-hoon-flags/source.jibbnew file+14

This diff is too big to show here.

tests/golden/types-import-hoon-flags/sur/flags.txtnew file+7

This diff is too big to show here.

tests/golden/types-import-hoon-flags/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-import-hoon-flags/tree.txtnew file+41

This diff is too big to show here.

tests/golden/types-import-hoon-flags/types.txtnew file+24

This diff is too big to show here.

tests/golden/types-import-hoon-noun/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-hoon-noun/imports.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-hoon-noun/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-import-hoon-noun/sur/fixture.txtnew file+6

This diff is too big to show here.

tests/golden/types-import-hoon-noun/tokens.txtnew file+60

This diff is too big to show here.

tests/golden/types-import-hoon-noun/tree.txtnew file+28

This diff is too big to show here.

tests/golden/types-import-hoon-noun/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-import-mark-record/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-mark-record/mar/choice.txtnew file+5

This diff is too big to show here.

tests/golden/types-import-mark-record/mar/note.txtnew file+5

This diff is too big to show here.

tests/golden/types-import-mark-record/marks.txtnew file+2

This diff is too big to show here.

tests/golden/types-import-mark-record/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-import-mark-record/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/types-import-mark-record/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-import-mark-record/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-mark/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-mark/imports.txtnew file+1

This diff is too big to show here.

tests/golden/types-import-mark/mar/label.txtnew file+5

This diff is too big to show here.

tests/golden/types-import-mark/marks.txtnew file+1

This diff is too big to show here.

tests/golden/types-import-mark/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-import-mark/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/types-import-mark/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-import-mark/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-import-mark/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-import-missing-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-missing-mold/imports.txtnew file+1

This diff is too big to show here.

tests/golden/types-import-missing-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-import-missing-mold/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/types-import-missing-mold/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-import-missing-mold/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-import-missing-mold/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/imports.txtnew file+1

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/module-trees.txtnew file+7

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/tokens.txtnew file+32

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/tree.txtnew file+13

This diff is too big to show here.

tests/golden/types-import-sur-record-graph/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-import-sur/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-sur/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-import-sur/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-import-sur/sur/fixture.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-sur/tokens.txtnew file+19

This diff is too big to show here.

tests/golden/types-import-sur/tree.txtnew file+10

This diff is too big to show here.

tests/golden/types-import-sur/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-import-tlon-notes/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-tlon-notes/imports.txtnew file+7

This diff is too big to show here.

tests/golden/types-import-tlon-notes/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-import-tlon-notes/sur/notes.txtnew file+433

This diff is too big to show here.

tests/golden/types-import-tlon-notes/tokens.txtnew file+59

This diff is too big to show here.

tests/golden/types-import-tlon-notes/tree.txtnew file+30

This diff is too big to show here.

tests/golden/types-import-tlon-notes/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-list-branch/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-branch/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-branch/source.jibbnew file+81

This diff is too big to show here.

tests/golden/types-list-branch/tokens.txtnew file+521

This diff is too big to show here.

tests/golden/types-list-branch/tree.txtnew file+237

This diff is too big to show here.

tests/golden/types-list-branch/types.txtnew file+41

This diff is too big to show here.

tests/golden/types-list-cons/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-cons/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-cons/source.jibbnew file+20

This diff is too big to show here.

tests/golden/types-list-cons/tokens.txtnew file+217

This diff is too big to show here.

tests/golden/types-list-cons/tree.txtnew file+85

This diff is too big to show here.

tests/golden/types-list-cons/types.txtnew file+29

This diff is too big to show here.

tests/golden/types-list-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-context/source.jibbnew file+17

This diff is too big to show here.

tests/golden/types-list-context/tokens.txtnew file+143

This diff is too big to show here.

tests/golden/types-list-context/tree.txtnew file+59

This diff is too big to show here.

tests/golden/types-list-context/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-list-imported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-imported/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-list-imported/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-imported/source.jibbnew file+14

This diff is too big to show here.

tests/golden/types-list-imported/sur/fixture.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-imported/tokens.txtnew file+109

This diff is too big to show here.

tests/golden/types-list-imported/tree.txtnew file+52

This diff is too big to show here.

tests/golden/types-list-imported/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-list-open-constraints/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-open-constraints/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-open-constraints/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-list-open-constraints/tokens.txtnew file+178

This diff is too big to show here.

tests/golden/types-list-open-constraints/tree.txtnew file+68

This diff is too big to show here.

tests/golden/types-list-open-constraints/types.txtnew file+30

This diff is too big to show here.

tests/golden/types-list-open/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-open/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-open/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-list-open/tokens.txtnew file+94

This diff is too big to show here.

tests/golden/types-list-open/tree.txtnew file+36

This diff is too big to show here.

tests/golden/types-list-open/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-list-pattern-imported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-pattern-imported/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-list-pattern-imported/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-pattern-imported/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-list-pattern-imported/sur/fixture.txtnew file+5

This diff is too big to show here.

tests/golden/types-list-pattern-imported/tokens.txtnew file+66

This diff is too big to show here.

tests/golden/types-list-pattern-imported/tree.txtnew file+32

This diff is too big to show here.

tests/golden/types-list-pattern-imported/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-patterns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-patterns/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-patterns/source.jibbnew file+64

This diff is too big to show here.

tests/golden/types-list-patterns/tokens.txtnew file+359

This diff is too big to show here.

tests/golden/types-list-patterns/tree.txtnew file+168

This diff is too big to show here.

tests/golden/types-list-patterns/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-list-zero-fit/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-zero-fit/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-zero-fit/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-list-zero-fit/tokens.txtnew file+181

This diff is too big to show here.

tests/golden/types-list-zero-fit/tree.txtnew file+91

This diff is too big to show here.

tests/golden/types-list-zero-fit/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/tokens.txtnew file+177

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/tree.txtnew file+78

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/types.txtnew file+45

This diff is too big to show here.

tests/golden/types-local-capitals/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-local-capitals/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-local-capitals/source.jibbnew file+73

This diff is too big to show here.

tests/golden/types-local-capitals/tokens.txtnew file+473

This diff is too big to show here.

tests/golden/types-local-capitals/tree.txtnew file+229

This diff is too big to show here.

tests/golden/types-local-capitals/types.txtnew file+28

This diff is too big to show here.

tests/golden/types-local-recursive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-local-recursive/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-local-recursive/source.jibbnew file+54

This diff is too big to show here.

tests/golden/types-local-recursive/tokens.txtnew file+351

This diff is too big to show here.

tests/golden/types-local-recursive/tree.txtnew file+170

This diff is too big to show here.

tests/golden/types-local-recursive/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/source.jibbnew file+54

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/tokens.txtnew file+404

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/tree.txtnew file+204

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-local-scc/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-local-scc/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-local-scc/source.jibbnew file+58

This diff is too big to show here.

tests/golden/types-local-scc/tokens.txtnew file+434

This diff is too big to show here.

tests/golden/types-local-scc/tree.txtnew file+214

This diff is too big to show here.

tests/golden/types-local-scc/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/tokens.txtnew file+143

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/tree.txtnew file+52

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/types.txtnew file+65

This diff is too big to show here.

tests/golden/types-loobean-union-context/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-loobean-union-context/source.jibbnew file+28

This diff is too big to show here.

tests/golden/types-loobean-union-context/tokens.txtnew file+136

This diff is too big to show here.

tests/golden/types-loobean-union-context/tree.txtnew file+55

This diff is too big to show here.

tests/golden/types-loobean-union-context/types.txtnew file+35

This diff is too big to show here.

tests/golden/types-missing-tag-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-missing-tag-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-missing-tag-context/source.jibbnew file+17

This diff is too big to show here.

tests/golden/types-missing-tag-context/tokens.txtnew file+98

This diff is too big to show here.

tests/golden/types-missing-tag-context/tree.txtnew file+45

This diff is too big to show here.

tests/golden/types-missing-tag-context/types.txtnew file+38

This diff is too big to show here.

tests/golden/types-missing-tag-imported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-missing-tag-imported/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-missing-tag-imported/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-missing-tag-imported/sur/fixture.txtnew file+21

This diff is too big to show here.

tests/golden/types-missing-tag-imported/tokens.txtnew file+43

This diff is too big to show here.

tests/golden/types-missing-tag-imported/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-missing-tag-imported/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-missing-tag-named/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-missing-tag-named/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-missing-tag-named/source.jibbnew file+23

This diff is too big to show here.

tests/golden/types-missing-tag-named/tokens.txtnew file+155

This diff is too big to show here.

tests/golden/types-missing-tag-named/tree.txtnew file+66

This diff is too big to show here.

tests/golden/types-missing-tag-named/types.txtnew file+66

This diff is too big to show here.

tests/golden/types-module-field-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-field-duplicate/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-module-field-duplicate/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-field-duplicate/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-module-field-duplicate/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-duplicate/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-module-field-duplicate/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-module-field-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-module-field-path/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-field-path/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-module-field-path/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-field-path/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-path/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-module-field-path/tokens.txtnew file+45

This diff is too big to show here.

tests/golden/types-module-field-path/tree.txtnew file+14

This diff is too big to show here.

tests/golden/types-module-field-path/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-module-field-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-field-shadow/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-module-field-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-field-shadow/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-shadow/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-shadow/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-module-field-shadow/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-module-field-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-module-fixtures/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-fixtures/module-trees.txtnew file+13

This diff is too big to show here.

tests/golden/types-module-fixtures/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-module-fixtures/modules/ui/api/blog.jibbnew file+5

This diff is too big to show here.

tests/golden/types-module-fixtures/modules/ui/components/card.jibbnew file+5

This diff is too big to show here.

tests/golden/types-module-fixtures/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-fixtures/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-module-fixtures/tokens.txtnew file+62

This diff is too big to show here.

tests/golden/types-module-fixtures/tree.txtnew file+23

This diff is too big to show here.

tests/golden/types-module-fixtures/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-module-mixed/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-mixed/imports.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/mar/label.txtnew file+5

This diff is too big to show here.

tests/golden/types-module-mixed/marks.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-module-mixed/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/modules/ui/helper.jibbnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-module-mixed/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/types-module-mixed/tokens.txtnew file+29

This diff is too big to show here.

tests/golden/types-module-mixed/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-module-mixed/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-multi-call/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-multi-call/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-multi-call/source.jibbnew file+42

This diff is too big to show here.

tests/golden/types-multi-call/tokens.txtnew file+370

This diff is too big to show here.

tests/golden/types-multi-call/tree.txtnew file+169

This diff is too big to show here.

tests/golden/types-multi-call/types.txtnew file+100

This diff is too big to show here.

tests/golden/types-multi-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-multi-import/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-multi-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-multi-import/modules/ui/lib.jibbnew file+5

This diff is too big to show here.

tests/golden/types-multi-import/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-multi-import/tokens.txtnew file+43

This diff is too big to show here.

tests/golden/types-multi-import/tree.txtnew file+20

This diff is too big to show here.

tests/golden/types-multi-import/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-nested-missing-tag/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-nested-missing-tag/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-nested-missing-tag/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-nested-missing-tag/tokens.txtnew file+184

This diff is too big to show here.

tests/golden/types-nested-missing-tag/tree.txtnew file+79

This diff is too big to show here.

tests/golden/types-nested-missing-tag/types.txtnew file+71

This diff is too big to show here.

tests/golden/types-nested-noun-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-nested-noun-context/source.jibbnew file+35

This diff is too big to show here.

tests/golden/types-nested-noun-context/tokens.txtnew file+363

This diff is too big to show here.

tests/golden/types-nested-noun-context/tree.txtnew file+162

This diff is too big to show here.

tests/golden/types-nested-noun-context/types.txtnew file+34

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/source.jibbnew file+30

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/tokens.txtnew file+271

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/tree.txtnew file+136

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-nested-union-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-nested-union-context/source.jibbnew file+59

This diff is too big to show here.

tests/golden/types-nested-union-context/tokens.txtnew file+660

This diff is too big to show here.

tests/golden/types-nested-union-context/tree.txtnew file+302

This diff is too big to show here.

tests/golden/types-nested-union-context/types.txtnew file+49

This diff is too big to show here.

tests/golden/types-null-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-null-context/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-null-context/tokens.txtnew file+57

This diff is too big to show here.

tests/golden/types-null-context/tree.txtnew file+25

This diff is too big to show here.

tests/golden/types-null-context/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-null-overlap/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-null-overlap/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-null-overlap/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-null-overlap/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-null-overlap/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-null-unresolved/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-null-unresolved/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-null-unresolved/tokens.txtnew file+79

This diff is too big to show here.

tests/golden/types-null-unresolved/tree.txtnew file+34

This diff is too big to show here.

tests/golden/types-null-unresolved/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-pair-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-pair-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-pair-context/source.jibbnew file+32

This diff is too big to show here.

tests/golden/types-pair-context/tokens.txtnew file+217

This diff is too big to show here.

tests/golden/types-pair-context/tree.txtnew file+86

This diff is too big to show here.

tests/golden/types-pair-context/types.txtnew file+43

This diff is too big to show here.

tests/golden/types-partial-apply/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-apply/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-partial-apply/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/types-partial-apply/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-partial-apply/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-partial-atom-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-atom-alias/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-partial-atom-alias/tokens.txtnew file+67

This diff is too big to show here.

tests/golden/types-partial-atom-alias/tree.txtnew file+31

This diff is too big to show here.

tests/golden/types-partial-atom-alias/types.txtnew file+21

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/source.jibbnew file+14

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/tree.txtnew file+42

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-partial-atom-widening/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-atom-widening/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-partial-atom-widening/tokens.txtnew file+79

This diff is too big to show here.

tests/golden/types-partial-atom-widening/tree.txtnew file+35

This diff is too big to show here.

tests/golden/types-partial-atom-widening/types.txtnew file+16

This diff is too big to show here.

tests/golden/types-partial-aura-family/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-aura-family/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-partial-aura-family/tokens.txtnew file+100

This diff is too big to show here.

tests/golden/types-partial-aura-family/tree.txtnew file+44

This diff is too big to show here.

tests/golden/types-partial-aura-family/types.txtnew file+23

This diff is too big to show here.

tests/golden/types-partial-aura-generalization/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-aura-generalization/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-aura-generalization/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/types-partial-aura-generalization/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-partial-aura-generalization/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-aura/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-aura/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-partial-aura/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/types-partial-aura/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-partial-aura/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-bare-atom/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-bare-atom/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-bare-atom/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/types-partial-bare-atom/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-partial-bare-atom/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-branch-widening/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-branch-widening/source.jibbnew file+20

This diff is too big to show here.

tests/golden/types-partial-branch-widening/tokens.txtnew file+96

This diff is too big to show here.

tests/golden/types-partial-branch-widening/tree.txtnew file+49

This diff is too big to show here.

tests/golden/types-partial-branch-widening/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/tokens.txtnew file+33

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/types.txtnew file+23

This diff is too big to show here.

tests/golden/types-partial-decimal-default/about.txtnew file+7

This diff is too big to show here.

tests/golden/types-partial-decimal-default/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-partial-decimal-default/tokens.txtnew file+34

This diff is too big to show here.

tests/golden/types-partial-decimal-default/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-partial-decimal-default/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-partial-dependency-chain/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-dependency-chain/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-partial-dependency-chain/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/types-partial-dependency-chain/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-dependency-chain/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-explicit-capital/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-explicit-capital/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-partial-explicit-capital/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-explicit-capital/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-partial-explicit-capital/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-partial-forward/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-forward/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-forward/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-partial-forward/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-forward/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-generalization/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-generalization/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-partial-generalization/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-partial-generalization/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-partial-generalization/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-identity/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-identity/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-partial-identity/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-partial-identity/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-identity/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-local-molds/about.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-local-molds/source.jibbnew file+39

This diff is too big to show here.

tests/golden/types-partial-local-molds/tokens.txtnew file+170

This diff is too big to show here.

tests/golden/types-partial-local-molds/tree.txtnew file+80

This diff is too big to show here.

tests/golden/types-partial-local-molds/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-partial-locals/about.txtnew file+8

This diff is too big to show here.

tests/golden/types-partial-locals/source.jibbnew file+44

This diff is too big to show here.

tests/golden/types-partial-locals/tokens.txtnew file+239

This diff is too big to show here.

tests/golden/types-partial-locals/tree.txtnew file+122

This diff is too big to show here.

tests/golden/types-partial-locals/types.txtnew file+32

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/tokens.txtnew file+90

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/tree.txtnew file+44

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-mold-composite/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-composite/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-composite/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-partial-mold-composite/tree.txtnew file+13

This diff is too big to show here.

tests/golden/types-partial-mold-composite/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-partial-mold-forward/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-forward/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-mold-forward/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-mold-forward/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-forward/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-mold-recursive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-recursive/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-partial-mold-recursive/tokens.txtnew file+17

This diff is too big to show here.

tests/golden/types-partial-mold-recursive/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-partial-mold-recursive/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-occurs/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-occurs/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-partial-occurs/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-occurs/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-partial-occurs/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-partial-projection/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-projection/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-partial-projection/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-partial-projection/tree.txtnew file+16

This diff is too big to show here.

tests/golden/types-partial-projection/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-shadow-global/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-shadow-global/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-shadow-global/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-shadow-global/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-shadow-global/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-shared-tvar/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-shared-tvar/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-partial-shared-tvar/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-partial-shared-tvar/tree.txtnew file+16

This diff is too big to show here.

tests/golden/types-partial-shared-tvar/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-union-cases/about.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-union-cases/source.jibbnew file+32

This diff is too big to show here.

tests/golden/types-partial-union-cases/tokens.txtnew file+121

This diff is too big to show here.

tests/golden/types-partial-union-cases/tree.txtnew file+38

This diff is too big to show here.

tests/golden/types-partial-union-cases/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-partial-union-edges/about.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-union-edges/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-partial-union-edges/tokens.txtnew file+97

This diff is too big to show here.

tests/golden/types-partial-union-edges/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-partial-union-edges/types.txtnew file+15

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/tokens.txtnew file+108

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/tree.txtnew file+47

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/types.txtnew file+25

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/tree.txtnew file+2

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-positional-faces/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-positional-faces/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-positional-faces/tokens.txtnew file+394

This diff is too big to show here.

tests/golden/types-positional-faces/tree.txtnew file+197

This diff is too big to show here.

tests/golden/types-positional-faces/types.txtnew file+42

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/source.jibbnew file+23

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/tokens.txtnew file+201

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/tree.txtnew file+85

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/types.txtnew file+50

This diff is too big to show here.

tests/golden/types-prelude-ask/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-ask/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-ask/source.jibbnew file+55

This diff is too big to show here.

tests/golden/types-prelude-ask/tokens.txtnew file+804

This diff is too big to show here.

tests/golden/types-prelude-ask/tree.txtnew file+335

This diff is too big to show here.

tests/golden/types-prelude-ask/types.txtnew file+41

This diff is too big to show here.

tests/golden/types-prelude-bond/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-bond/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-bond/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-prelude-bond/tokens.txtnew file+57

This diff is too big to show here.

tests/golden/types-prelude-bond/tree.txtnew file+30

This diff is too big to show here.

tests/golden/types-prelude-bond/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-prelude-cmd/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-cmd/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-cmd/source.jibbnew file+21

This diff is too big to show here.

tests/golden/types-prelude-cmd/tokens.txtnew file+285

This diff is too big to show here.

tests/golden/types-prelude-cmd/tree.txtnew file+122

This diff is too big to show here.

tests/golden/types-prelude-cmd/types.txtnew file+56

This diff is too big to show here.

tests/golden/types-prelude-comparison/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-comparison/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-comparison/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-prelude-comparison/tokens.txtnew file+175

This diff is too big to show here.

tests/golden/types-prelude-comparison/tree.txtnew file+71

This diff is too big to show here.

tests/golden/types-prelude-comparison/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-prelude-direct/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-direct/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-direct/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-prelude-direct/tokens.txtnew file+53

This diff is too big to show here.

tests/golden/types-prelude-direct/tree.txtnew file+25

This diff is too big to show here.

tests/golden/types-prelude-direct/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-prelude-functional/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-functional/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-functional/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-prelude-functional/tokens.txtnew file+145

This diff is too big to show here.

tests/golden/types-prelude-functional/tree.txtnew file+65

This diff is too big to show here.

tests/golden/types-prelude-functional/types.txtnew file+23

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/module-trees.txtnew file+10

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/modules/ui/alias-helper.jibbnew file+2

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/tokens.txtnew file+146

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/tree.txtnew file+51

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-prelude-interface/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-interface/module-trees.txtnew file+13

This diff is too big to show here.

tests/golden/types-prelude-interface/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-prelude-interface/modules/ui/left.jibbnew file+1

This diff is too big to show here.

tests/golden/types-prelude-interface/modules/ui/right.jibbnew file+1

This diff is too big to show here.

tests/golden/types-prelude-interface/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-prelude-interface/tokens.txtnew file+81

This diff is too big to show here.

tests/golden/types-prelude-interface/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-prelude-interface/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-prelude-lead-late/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-lead-late/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-lead-late/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-prelude-lead-late/tokens.txtnew file+151

This diff is too big to show here.

tests/golden/types-prelude-lead-late/tree.txtnew file+83

This diff is too big to show here.

tests/golden/types-prelude-lead-late/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-prelude-lent/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-lent/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-lent/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-prelude-lent/tokens.txtnew file+76

This diff is too big to show here.

tests/golden/types-prelude-lent/tree.txtnew file+38

This diff is too big to show here.

tests/golden/types-prelude-lent/types.txtnew file+15

This diff is too big to show here.

tests/golden/types-prelude-like/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-like/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-like/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-prelude-like/tokens.txtnew file+320

This diff is too big to show here.

tests/golden/types-prelude-like/tree.txtnew file+163

This diff is too big to show here.

tests/golden/types-prelude-like/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-prelude-list-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-list-alias/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-list-alias/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-prelude-list-alias/tokens.txtnew file+68

This diff is too big to show here.

tests/golden/types-prelude-list-alias/tree.txtnew file+30

This diff is too big to show here.

tests/golden/types-prelude-list-alias/types.txtnew file+14

This diff is too big to show here.

tests/golden/types-prelude-list-functions/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-list-functions/module-trees.txtnew file+11

This diff is too big to show here.

tests/golden/types-prelude-list-functions/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-list-functions/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-prelude-list-functions/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-prelude-list-functions/tokens.txtnew file+183

This diff is too big to show here.

tests/golden/types-prelude-list-functions/tree.txtnew file+87

This diff is too big to show here.

tests/golden/types-prelude-list-functions/types.txtnew file+28

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/source.jibbnew file+15

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/tokens.txtnew file+182

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/tree.txtnew file+98

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/types.txtnew file+34

This diff is too big to show here.

tests/golden/types-prelude-predicates/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-predicates/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-predicates/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-prelude-predicates/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-prelude-predicates/tree.txtnew file+49

This diff is too big to show here.

tests/golden/types-prelude-predicates/types.txtnew file+19

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/source.jibbnew file+20

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/tokens.txtnew file+211

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/tree.txtnew file+100

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-prelude-sub/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-sub/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-sub/source.jibbnew file+37

This diff is too big to show here.

tests/golden/types-prelude-sub/tokens.txtnew file+380

This diff is too big to show here.

tests/golden/types-prelude-sub/tree.txtnew file+164

This diff is too big to show here.

tests/golden/types-prelude-sub/types.txtnew file+32

This diff is too big to show here.

tests/golden/types-prelude-succ/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-succ/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-succ/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-prelude-succ/tokens.txtnew file+32

This diff is too big to show here.

tests/golden/types-prelude-succ/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-prelude-succ/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-prelude-text/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-text/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-text/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-prelude-text/tokens.txtnew file+66

This diff is too big to show here.

tests/golden/types-prelude-text/tree.txtnew file+36

This diff is too big to show here.

tests/golden/types-prelude-text/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-prelude-ui/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-ui/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-ui/source.jibbnew file+77

This diff is too big to show here.

tests/golden/types-prelude-ui/tokens.txtnew file+710

This diff is too big to show here.

tests/golden/types-prelude-ui/tree.txtnew file+291

This diff is too big to show here.

tests/golden/types-prelude-ui/types.txtnew file+84

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/source.jibbnew file+15

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/tokens.txtnew file+209

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/tree.txtnew file+115

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-prelude-zing/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-zing/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-zing/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-prelude-zing/tokens.txtnew file+92

This diff is too big to show here.

tests/golden/types-prelude-zing/tree.txtnew file+43

This diff is too big to show here.

tests/golden/types-prelude-zing/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-proj-explicit-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-explicit-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-explicit-context/source.jibbnew file+35

This diff is too big to show here.

tests/golden/types-proj-explicit-context/tokens.txtnew file+626

This diff is too big to show here.

tests/golden/types-proj-explicit-context/tree.txtnew file+287

This diff is too big to show here.

tests/golden/types-proj-explicit-context/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/tokens.txtnew file+119

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/tree.txtnew file+56

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/module-trees.txtnew file+10

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-local/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-local/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-local/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-local/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-proj-reserved-local/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-local/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/tokens.txtnew file+70

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/tree.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/tokens.txtnew file+38

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-value/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-value/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-value/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-value/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/types-proj-reserved-value/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-value/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/tokens.txtnew file+23

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-single-field/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-field/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-field/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-proj-single-field/tokens.txtnew file+499

This diff is too big to show here.

tests/golden/types-proj-single-field/tree.txtnew file+243

This diff is too big to show here.

tests/golden/types-proj-single-field/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/tokens.txtnew file+210

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/tree.txtnew file+117

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/source.jibbnew file+26

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/tokens.txtnew file+208

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/tree.txtnew file+107

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-qath-faces/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-qath-faces/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-qath-faces/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-qath-faces/tokens.txtnew file+130

This diff is too big to show here.

tests/golden/types-qath-faces/tree.txtnew file+59

This diff is too big to show here.

tests/golden/types-qath-faces/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-qath-holes/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-qath-holes/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-qath-holes/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-qath-holes/tokens.txtnew file+178

This diff is too big to show here.

tests/golden/types-qath-holes/tree.txtnew file+78

This diff is too big to show here.

tests/golden/types-qath-holes/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-qath-module-identity/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-qath-module-identity/module-trees.txtnew file+44

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules.txtnew file+3

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules/ui/mid.jibbnew file+4

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules/ui/one.jibbnew file+7

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules/ui/two.jibbnew file+4

This diff is too big to show here.

tests/golden/types-qath-module-identity/source.jibbnew file+15

This diff is too big to show here.

tests/golden/types-qath-module-identity/tokens.txtnew file+171

This diff is too big to show here.

tests/golden/types-qath-module-identity/tree.txtnew file+70

This diff is too big to show here.

tests/golden/types-qath-module-identity/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-qath-recursive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-qath-recursive/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-qath-recursive/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-qath-recursive/tokens.txtnew file+145

This diff is too big to show here.

tests/golden/types-qath-recursive/tree.txtnew file+63

This diff is too big to show here.

tests/golden/types-qath-recursive/types.txtnew file+14

This diff is too big to show here.

tests/golden/types-record-bound-variable/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-bound-variable/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-record-bound-variable/tokens.txtnew file+65

This diff is too big to show here.

tests/golden/types-record-bound-variable/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-record-bound-variable/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-record-cast-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-cast-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-cast-context/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-record-cast-context/tokens.txtnew file+234

This diff is too big to show here.

tests/golden/types-record-cast-context/tree.txtnew file+105

This diff is too big to show here.

tests/golden/types-record-cast-context/types.txtnew file+49

This diff is too big to show here.

tests/golden/types-record-change-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-change-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-change-generic/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-record-change-generic/tokens.txtnew file+145

This diff is too big to show here.

tests/golden/types-record-change-generic/tree.txtnew file+57

This diff is too big to show here.

tests/golden/types-record-change-generic/types.txtnew file+14

This diff is too big to show here.

tests/golden/types-record-change/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-change/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-change/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-record-change/tokens.txtnew file+254

This diff is too big to show here.

tests/golden/types-record-change/tree.txtnew file+99

This diff is too big to show here.

tests/golden/types-record-change/types.txtnew file+42

This diff is too big to show here.

tests/golden/types-record-faces/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-faces/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-record-faces/tokens.txtnew file+90

This diff is too big to show here.

tests/golden/types-record-faces/tree.txtnew file+41

This diff is too big to show here.

tests/golden/types-record-faces/types.txtnew file+15

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/tokens.txtnew file+51

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/tree.txtnew file+22

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/module-trees.txtnew file+7

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-module-unused/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-module-unused/module-trees.txtnew file+10

This diff is too big to show here.

tests/golden/types-record-field-module-unused/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-unused/modules/ui/good.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-module-unused/modules/ui/unused.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-unused/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-unused/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-record-field-module-unused/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-module-unused/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/tokens.txtnew file+26

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/tokens.txtnew file+33

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-import/module-trees.txtnew file+9

This diff is too big to show here.

tests/golden/types-record-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-import/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-import/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-record-import/tokens.txtnew file+36

This diff is too big to show here.

tests/golden/types-record-import/tree.txtnew file+16

This diff is too big to show here.

tests/golden/types-record-import/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-local-scheme/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-local-scheme/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-record-local-scheme/tokens.txtnew file+44

This diff is too big to show here.

tests/golden/types-record-local-scheme/tree.txtnew file+20

This diff is too big to show here.

tests/golden/types-record-local-scheme/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-nested/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-record-nested/tokens.txtnew file+54

This diff is too big to show here.

tests/golden/types-record-nested/tree.txtnew file+24

This diff is too big to show here.

tests/golden/types-record-nested/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-record-to-tuple/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-to-tuple/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-record-to-tuple/tokens.txtnew file+38

This diff is too big to show here.

tests/golden/types-record-to-tuple/tree.txtnew file+17

This diff is too big to show here.

tests/golden/types-record-to-tuple/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/tokens.txtnew file+90

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/tree.txtnew file+45

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/tree.txtnew file+42

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/modules/ui/lib.jibbnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-recursion-scc-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-import/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-recursion-scc-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-import/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-recursion-scc-import/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-import/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/types-recursion-scc-import/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-recursion-scc-import/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-local/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-local/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-local/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-recursion-scc-local/tokens.txtnew file+80

This diff is too big to show here.

tests/golden/types-recursion-scc-local/tree.txtnew file+39

This diff is too big to show here.

tests/golden/types-recursion-scc-local/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-order/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-order/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-order/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-order/tokens.txtnew file+33

This diff is too big to show here.

tests/golden/types-recursion-scc-order/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-recursion-scc-order/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-branch/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-branch/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursive-branch/source.jibbnew file+103

This diff is too big to show here.

tests/golden/types-recursive-branch/tokens.txtnew file+573

This diff is too big to show here.

tests/golden/types-recursive-branch/tree.txtnew file+306

This diff is too big to show here.

tests/golden/types-recursive-branch/types.txtnew file+50

This diff is too big to show here.

tests/golden/types-recursive-gate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-gate/source.jibbnew file+55

This diff is too big to show here.

tests/golden/types-recursive-gate/tokens.txtnew file+355

This diff is too big to show here.

tests/golden/types-recursive-gate/tree.txtnew file+176

This diff is too big to show here.

tests/golden/types-recursive-gate/types.txtnew file+42

This diff is too big to show here.

tests/golden/types-recursive-sample/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-sample/source.jibbnew file+40

This diff is too big to show here.

tests/golden/types-recursive-sample/tokens.txtnew file+344

This diff is too big to show here.

tests/golden/types-recursive-sample/tree.txtnew file+161

This diff is too big to show here.

tests/golden/types-recursive-sample/types.txtnew file+40

This diff is too big to show here.

tests/golden/types-request-normal/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-request-normal/mar/full.txtnew file+5

This diff is too big to show here.

tests/golden/types-request-normal/marks.txtnew file+1

This diff is too big to show here.

tests/golden/types-request-normal/module-trees.txtnew file+5

This diff is too big to show here.

tests/golden/types-request-normal/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-request-normal/modules/ui/api/demo.jibbnew file+2

This diff is too big to show here.

tests/golden/types-request-normal/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-request-normal/tokens.txtnew file+95

This diff is too big to show here.

tests/golden/types-request-normal/tree.txtnew file+50

This diff is too big to show here.

tests/golden/types-request-normal/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-scope-library-poke/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-library-poke/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-library-poke/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-library-poke/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-scope-library-poke/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-scope-library-poke/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-scope-library-poke/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-scope-root-api/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-root-api/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-root-api/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-root-api/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-scope-root-api/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-scope-root-api/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-scope-root-api/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-scope-store-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-store-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-shadow/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-shadow/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-scope-store-shadow/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/types-scope-store-shadow/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-scope-store-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-single-case-pattern/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-single-case-pattern/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-single-case-pattern/source.jibbnew file+59

This diff is too big to show here.

tests/golden/types-single-case-pattern/tokens.txtnew file+364

This diff is too big to show here.

tests/golden/types-single-case-pattern/tree.txtnew file+182

This diff is too big to show here.

tests/golden/types-single-case-pattern/types.txtnew file+32

This diff is too big to show here.

tests/golden/types-string-interpolation/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-string-interpolation/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-string-interpolation/source.jibbnew file+28

This diff is too big to show here.

tests/golden/types-string-interpolation/tokens.txtnew file+259

This diff is too big to show here.

tests/golden/types-string-interpolation/tree.txtnew file+109

This diff is too big to show here.

tests/golden/types-string-interpolation/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-tuple-context-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-tuple-context-nested/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-tuple-context-nested/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-tuple-context-nested/tokens.txtnew file+289

This diff is too big to show here.

tests/golden/types-tuple-context-nested/tree.txtnew file+140

This diff is too big to show here.

tests/golden/types-tuple-context-nested/types.txtnew file+49

This diff is too big to show here.

tests/golden/types-tuple-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-tuple-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-tuple-context/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-tuple-context/tokens.txtnew file+109

This diff is too big to show here.

tests/golden/types-tuple-context/tree.txtnew file+55

This diff is too big to show here.

tests/golden/types-tuple-context/types.txtnew file+14

This diff is too big to show here.

tests/golden/types-union-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-alias/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-alias/tokens.txtnew file+23

This diff is too big to show here.

tests/golden/types-union-alias/tree.txtnew file+10

This diff is too big to show here.

tests/golden/types-union-alias/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-branch-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-branch-context/source.jibbnew file+54

This diff is too big to show here.

tests/golden/types-union-branch-context/tokens.txtnew file+237

This diff is too big to show here.

tests/golden/types-union-branch-context/tree.txtnew file+120

This diff is too big to show here.

tests/golden/types-union-branch-context/types.txtnew file+24

This diff is too big to show here.

tests/golden/types-union-branch-pending/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-branch-pending/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-union-branch-pending/tokens.txtnew file+102

This diff is too big to show here.

tests/golden/types-union-branch-pending/tree.txtnew file+48

This diff is too big to show here.

tests/golden/types-union-branch-pending/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-constructor-shape/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-constructor-shape/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-constructor-shape/tokens.txtnew file+58

This diff is too big to show here.

tests/golden/types-union-constructor-shape/tree.txtnew file+24

This diff is too big to show here.

tests/golden/types-union-constructor-shape/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-context-flow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-context-flow/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-union-context-flow/tokens.txtnew file+58

This diff is too big to show here.

tests/golden/types-union-context-flow/tree.txtnew file+26

This diff is too big to show here.

tests/golden/types-union-context-flow/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-finite-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite-context/source.jibbnew file+76

This diff is too big to show here.

tests/golden/types-union-finite-context/tokens.txtnew file+529

This diff is too big to show here.

tests/golden/types-union-finite-context/tree.txtnew file+234

This diff is too big to show here.

tests/golden/types-union-finite-context/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-union-finite-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite-generic/source.jibbnew file+48

This diff is too big to show here.

tests/golden/types-union-finite-generic/tokens.txtnew file+336

This diff is too big to show here.

tests/golden/types-union-finite-generic/tree.txtnew file+143

This diff is too big to show here.

tests/golden/types-union-finite-generic/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-union-finite-limit/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite-limit/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite-limit/source.jibbnew file+35

This diff is too big to show here.

tests/golden/types-union-finite-limit/tokens.txtnew file+233

This diff is too big to show here.

tests/golden/types-union-finite-limit/tree.txtnew file+89

This diff is too big to show here.

tests/golden/types-union-finite-limit/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-union-finite/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite/source.jibbnew file+45

This diff is too big to show here.

tests/golden/types-union-finite/tokens.txtnew file+238

This diff is too big to show here.

tests/golden/types-union-finite/tree.txtnew file+110

This diff is too big to show here.

tests/golden/types-union-finite/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-union-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-import/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-import/modules/ui/lib.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-union-import/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/types-union-import/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-local-pending/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-local-pending/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-local-pending/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-union-local-pending/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-union-local-pending/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/source.jibbnew file+82

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/tokens.txtnew file+593

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/tree.txtnew file+257

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/types.txtnew file+45

This diff is too big to show here.

tests/golden/types-union-overlap-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap-nested/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap-nested/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-union-overlap-nested/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-union-overlap-nested/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-overlap/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-union-overlap/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-union-overlap/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/tokens.txtnew file+205

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/tree.txtnew file+96

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/source.jibbnew file+55

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/tokens.txtnew file+357

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/tree.txtnew file+161

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/types.txtnew file+30

This diff is too big to show here.

tests/golden/types-union-patterns-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-patterns-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-patterns-generic/source.jibbnew file+36

This diff is too big to show here.

tests/golden/types-union-patterns-generic/tokens.txtnew file+255

This diff is too big to show here.

tests/golden/types-union-patterns-generic/tree.txtnew file+117

This diff is too big to show here.

tests/golden/types-union-patterns-generic/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-union-patterns-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-patterns-import/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-patterns-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-patterns-import/modules/ui/lib.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-patterns-import/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-patterns-import/tokens.txtnew file+28

This diff is too big to show here.

tests/golden/types-union-patterns-import/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-patterns-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-patterns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-patterns/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-patterns/source.jibbnew file+74

This diff is too big to show here.

tests/golden/types-union-patterns/tokens.txtnew file+336

This diff is too big to show here.

tests/golden/types-union-patterns/tree.txtnew file+152

This diff is too big to show here.

tests/golden/types-union-patterns/types.txtnew file+25

This diff is too big to show here.

tests/golden/types-union-phantom-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-phantom-generic/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-phantom-generic/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-union-phantom-generic/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-phantom-generic/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/modules/ui/one.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/modules/ui/two.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/source.jibbnew file+33

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/tokens.txtnew file+368

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/tree.txtnew file+152

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/types.txtnew file+36

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/modules/ui/lib.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-distinct/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules/ui/left.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules/ui/right.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules/ui/twin.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-union-print-distinct/tokens.txtnew file+87

This diff is too big to show here.

tests/golden/types-union-print-distinct/tree.txtnew file+34

This diff is too big to show here.

tests/golden/types-union-print-distinct/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-print-escape/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-escape/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-print-escape/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/types-union-print-escape/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-print-escape/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-print-local/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-local/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-union-print-local/tokens.txtnew file+28

This diff is too big to show here.

tests/golden/types-union-print-local/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-print-local/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-union-print-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-nested/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-union-print-nested/tokens.txtnew file+42

This diff is too big to show here.

tests/golden/types-union-print-nested/tree.txtnew file+17

This diff is too big to show here.

tests/golden/types-union-print-nested/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-print-same-origin/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-same-origin/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-same-origin/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-print-same-origin/modules/ui/shared.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-same-origin/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-print-same-origin/tokens.txtnew file+35

This diff is too big to show here.

tests/golden/types-union-print-same-origin/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-print-same-origin/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-transitive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-transitive/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-print-transitive/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-print-transitive/modules/ui/base.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-transitive/modules/ui/mid.jibbnew file+2

This diff is too big to show here.

tests/golden/types-union-print-transitive/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-union-print-transitive/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-union-print-transitive/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-print-transitive/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-runtime-equality/about.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-runtime-equality/source.jibbnew file+16

This diff is too big to show here.

tests/golden/types-union-runtime-equality/tokens.txtnew file+96

This diff is too big to show here.

tests/golden/types-union-runtime-equality/tree.txtnew file+37

This diff is too big to show here.

tests/golden/types-union-runtime-equality/types.txtnew file+25

This diff is too big to show here.

tests/golden/types-union-singleton/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-singleton/source.jibbnew file+16

This diff is too big to show here.

tests/golden/types-union-singleton/tokens.txtnew file+130

This diff is too big to show here.

tests/golden/types-union-singleton/tree.txtnew file+53

This diff is too big to show here.

tests/golden/types-union-singleton/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-union-source-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-source-alias/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-union-source-alias/tokens.txtnew file+119

This diff is too big to show here.

tests/golden/types-union-source-alias/tree.txtnew file+41

This diff is too big to show here.

tests/golden/types-union-source-alias/types.txtnew file+23

This diff is too big to show here.

tests/golden/types-union-tag-atoms/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-tag-atoms/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-tag-atoms/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/types-union-tag-atoms/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-union-tag-atoms/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-tags/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-tags/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-union-tags/tokens.txtnew file+34

This diff is too big to show here.

tests/golden/types-union-tags/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-union-tags/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-unresolved/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-unresolved/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-union-unresolved/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-unresolved/tree.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-unresolved/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-unit-construction/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-unit-construction/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-unit-construction/source.jibbnew file+29

This diff is too big to show here.

tests/golden/types-unit-construction/tokens.txtnew file+168

This diff is too big to show here.

tests/golden/types-unit-construction/tree.txtnew file+71

This diff is too big to show here.

tests/golden/types-unit-construction/types.txtnew file+32

This diff is too big to show here.

tests/golden/types-unit-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-unit-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-unit-context/source.jibbnew file+46

This diff is too big to show here.

tests/golden/types-unit-context/tokens.txtnew file+489

This diff is too big to show here.

tests/golden/types-unit-context/tree.txtnew file+220

This diff is too big to show here.

tests/golden/types-unit-context/types.txtnew file+95

This diff is too big to show here.

tests/golden/types-unit-patterns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-unit-patterns/source.jibbnew file+36

This diff is too big to show here.

tests/golden/types-unit-patterns/tokens.txtnew file+180

This diff is too big to show here.

tests/golden/types-unit-patterns/tree.txtnew file+88

This diff is too big to show here.

tests/golden/types-unit-patterns/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/tokens.txtnew file+68

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/tree.txtnew file+32

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/tokens.txtnew file+45

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/tree.txtnew file+17

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-value-cycles/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-value-cycles/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-value-cycles/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-value-cycles/tokens.txtnew file+87

This diff is too big to show here.

tests/golden/types-value-cycles/tree.txtnew file+39

This diff is too big to show here.

tests/golden/types-value-cycles/types.txtnew file+44

This diff is too big to show here.

tests/importer/about.txtnew file+63

This diff is too big to show here.

tests/importer/ford.txtnew file+9

This diff is too big to show here.

tests/importer/mark-gate.txtnew file+3

This diff is too big to show here.

tests/importer/mark-list.txtnew file+5

This diff is too big to show here.

tests/importer/mark-recursive.txtnew file+5

This diff is too big to show here.

tests/importer/mark.txtnew file+5

This diff is too big to show here.

tests/importer/origin-first.txtnew file+4

This diff is too big to show here.

tests/importer/origin-other.txtnew file+4

This diff is too big to show here.

tests/importer/origin-transitive.txtnew file+6

This diff is too big to show here.

tests/importer/shadow-static.txtnew file+13

This diff is too big to show here.

tests/importer/shadow.txtnew file+14

This diff is too big to show here.

tests/importer/small.txtnew file+160

This diff is too big to show here.

tests/importer/tlon-docs.txtnew file+17

This diff is too big to show here.

tests/importer/tlon-epic.txtnew file+15

This diff is too big to show here.

tests/importer/tlon-license.txtnew file+21

This diff is too big to show here.

tests/importer/tlon-presence.txtnew file+35

This diff is too big to show here.

tests/importer/tree.txtnew file+221

This diff is too big to show here.

tests/lib/jibb-api-evidence.hoonnew file+258

This diff is too big to show here.

tests/lib/jibb-api-paths.hoonnew file+104

This diff is too big to show here.

tests/lib/jibb-arithmetic-guards.hoonnew file+58

This diff is too big to show here.

tests/lib/jibb-ask-guards.hoonnew file+63

This diff is too big to show here.

tests/lib/jibb-bridge.hoonnew file+168

This diff is too big to show here.

tests/lib/jibb-cell-branch.hoonnew file+53

This diff is too big to show here.

tests/lib/jibb-closed-gate-guards.hoonnew file+60

This diff is too big to show here.

tests/lib/jibb-constructor-fit-guards.hoonnew file+128

This diff is too big to show here.

tests/lib/jibb-deferred-context.hoonnew file+83

This diff is too big to show here.

tests/lib/jibb-deferred-prepared.hoonnew file+114

This diff is too big to show here.

tests/lib/jibb-deferred-resolver.hoonnew file+113

This diff is too big to show here.

tests/lib/jibb-deferred.hoonnew file+244

This diff is too big to show here.

tests/lib/jibb-direct-gate-guards.hoonnew file+172

This diff is too big to show here.

tests/lib/jibb-direct-gate-source.hoonnew file+46

This diff is too big to show here.

tests/lib/jibb-empty.hoonnew file+174

This diff is too big to show here.

tests/lib/jibb-full-overlap-basic.hoonnew file+143

This diff is too big to show here.

tests/lib/jibb-full-overlap-graph.hoonnew file+126

This diff is too big to show here.

tests/lib/jibb-gate-free-guards.hoonnew file+79

This diff is too big to show here.

tests/lib/jibb-gate-free-source.hoonnew file+95

This diff is too big to show here.

tests/lib/jibb-generic-alias.hoonnew file+48

This diff is too big to show here.

tests/lib/jibb-generic-construction.hoonnew file+141

This diff is too big to show here.

tests/lib/jibb-generic-pattern.hoonnew file+165

This diff is too big to show here.

tests/lib/jibb-generic-recursion.hoonnew file+170

This diff is too big to show here.

tests/lib/jibb-hole-guards.hoonnew file+77

This diff is too big to show here.

tests/lib/jibb-import-default.hoonnew file+50

This diff is too big to show here.

tests/lib/jibb-import-diagnostic.hoonnew file+59

This diff is too big to show here.

tests/lib/jibb-import-overlap.hoonnew file+80

This diff is too big to show here.

tests/lib/jibb-import-structural.hoonnew file+82

This diff is too big to show here.

tests/lib/jibb-import.hoonnew file+46

This diff is too big to show here.

tests/lib/jibb-list-alias-guards.hoonnew file+27

This diff is too big to show here.

tests/lib/jibb-mark-bridge.hoonnew file+28

This diff is too big to show here.

tests/lib/jibb-module-scope.hoonnew file+132

This diff is too big to show here.

tests/lib/jibb-nested-union-guards.hoonnew file+67

This diff is too big to show here.

tests/lib/jibb-poke-bridge.hoonnew file+88

This diff is too big to show here.

tests/lib/jibb-positional-face-guards.hoonnew file+38

This diff is too big to show here.

tests/lib/jibb-program-init.hoonnew file+134

This diff is too big to show here.

tests/lib/jibb-program-main.hoonnew file+141

This diff is too big to show here.

tests/lib/jibb-program-update.hoonnew file+139

This diff is too big to show here.

tests/lib/jibb-program-watch.hoonnew file+209

This diff is too big to show here.

tests/lib/jibb-proj-guards.hoonnew file+124

This diff is too big to show here.

tests/lib/jibb-qath-fuel.hoonnew file+52

This diff is too big to show here.

tests/lib/jibb-qath-source.hoonnew file+66

This diff is too big to show here.

tests/lib/jibb-request-guards.hoonnew file+149

This diff is too big to show here.

tests/lib/jibb-sub-guards.hoonnew file+37

This diff is too big to show here.

tests/lib/jibb-tlon-bridge.hoonnew file+29

This diff is too big to show here.

tests/lib/jibb-todo-api.hoonnew file+85

This diff is too big to show here.

tests/lib/jibb-todo-partial.hoonnew file+58

This diff is too big to show here.

tests/lib/jibb-typecheck.hoonnew file+14

This diff is too big to show here.

tests/lib/jibb-union-alias-overlap.hoonnew file+107

This diff is too big to show here.

tests/lib/jibb-union-source.hoonnew file+152

This diff is too big to show here.

tests/lib/jibb.hoon+3645−454

This diff is too big to show here.

tests/type-api-evidence/about.txtnew file+3

This diff is too big to show here.

tests/type-api-evidence/expected.txtnew file+1

This diff is too big to show here.

tests/type-api-paths/about.txtnew file+3

This diff is too big to show here.

tests/type-api-paths/api.txtnew file+13

This diff is too big to show here.

tests/type-api-paths/expected.txtnew file+18

This diff is too big to show here.

tests/type-api-paths/missing-decl.txtnew file+12

This diff is too big to show here.

tests/type-api-paths/poke-clash.txtnew file+12

This diff is too big to show here.

tests/type-api-paths/scry-bad.txtnew file+13

This diff is too big to show here.

tests/type-api-paths/scry.txtnew file+13

This diff is too big to show here.

tests/type-api-paths/todo-action.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/todo-item.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/todo-sur.txtnew file+12

This diff is too big to show here.

tests/type-api-paths/todo-update.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/todos.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/value-clash.txtnew file+15

This diff is too big to show here.

tests/type-cell-branch/about.txtnew file+2

This diff is too big to show here.

tests/type-cell-branch/bad.txtnew file+3

This diff is too big to show here.

tests/type-cell-branch/good.txtnew file+3

This diff is too big to show here.

tests/type-deferred-context/about.txtnew file+3

This diff is too big to show here.

tests/type-deferred-context/collision-early.txtnew file+27

This diff is too big to show here.

tests/type-deferred-context/collision-late.txtnew file+28

This diff is too big to show here.

tests/type-deferred-context/dangling.txtnew file+16

This diff is too big to show here.

tests/type-deferred-context/duplicate.txtnew file+14

This diff is too big to show here.

tests/type-deferred-context/missing.txtnew file+14

This diff is too big to show here.

tests/type-deferred-context/plain.txtnew file+11

This diff is too big to show here.

tests/type-deferred-context/report.txtnew file+15

This diff is too big to show here.

tests/type-deferred-context/rich.txtnew file+27

This diff is too big to show here.

tests/type-deferred-context/simple.txtnew file+10

This diff is too big to show here.

tests/type-deferred-context/wrong.txtnew file+14

This diff is too big to show here.

tests/type-deferred-prepared/expected-control.txtnew file+7

This diff is too big to show here.

tests/type-deferred-prepared/expected-tuple-only.txtnew file+4

This diff is too big to show here.

tests/type-deferred-prepared/expected.txtnew file+8

This diff is too big to show here.

tests/type-deferred-prepared/good.txtnew file+9

This diff is too big to show here.

tests/type-deferred-prepared/imported.txtnew file+11

This diff is too big to show here.

tests/type-deferred-prepared/main.txtnew file+10

This diff is too big to show here.

tests/type-deferred-prepared/mold-collision.txtnew file+9

This diff is too big to show here.

tests/type-deferred-prepared/no-final-cast.txtnew file+8

This diff is too big to show here.

tests/type-deferred-prepared/no-prelude.txtnew file+9

This diff is too big to show here.

tests/type-deferred-prepared/tuple-only.txtnew file+3

This diff is too big to show here.

tests/type-deferred-prepared/unrelated-tag.txtnew file+11

This diff is too big to show here.

tests/type-deferred-prepared/wrong-draft.txtnew file+9

This diff is too big to show here.

tests/type-deferred-prepared/wrong-unit.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/about.txtnew file+5

This diff is too big to show here.

tests/type-deferred-resolver/conflict.txtnew file+12

This diff is too big to show here.

tests/type-deferred-resolver/duplicate.txtnew file+12

This diff is too big to show here.

tests/type-deferred-resolver/expected.txtnew file+42

This diff is too big to show here.

tests/type-deferred-resolver/face.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/good.txtnew file+11

This diff is too big to show here.

tests/type-deferred-resolver/hole.txtnew file+12

This diff is too big to show here.

tests/type-deferred-resolver/missing.txtnew file+10

This diff is too big to show here.

tests/type-deferred-resolver/stability-early.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-late.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-output-early.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/stability-output-late.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/stability-simple-early.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-simple-late.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-slot-early.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/stability-slot-late.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/store.txtnew file+12

This diff is too big to show here.

tests/type-deferred/about.txtnew file+3

This diff is too big to show here.

tests/type-deferred/conflict-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/duplicate-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/expected.txtnew file+38

This diff is too big to show here.

tests/type-deferred/face-bad-src.txtnew file+6

This diff is too big to show here.

tests/type-deferred/face-good-src.txtnew file+6

This diff is too big to show here.

tests/type-deferred/hole-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/local-src.txtnew file+8

This diff is too big to show here.

tests/type-deferred/missing-src.txtnew file+10

This diff is too big to show here.

tests/type-deferred/mold-hole-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/mutual-src.txtnew file+7

This diff is too big to show here.

tests/type-deferred/nested-src.txtnew file+7

This diff is too big to show here.

tests/type-deferred/principal-src.txtnew file+11

This diff is too big to show here.

tests/type-direct-gate/about.txtnew file+4

This diff is too big to show here.

tests/type-direct-gate/expected.txtnew file+86

This diff is too big to show here.

tests/type-direct-gate/source.txtnew file+96

This diff is too big to show here.

tests/type-empty/about.txtnew file+3

This diff is too big to show here.

tests/type-empty/dead.txtnew file+7

This diff is too big to show here.

tests/type-empty/expected.txtnew file+59

This diff is too big to show here.

tests/type-empty/face-source.txtnew file+2

This diff is too big to show here.

tests/type-empty/good.txtnew file+11

This diff is too big to show here.

tests/type-empty/late-cap.txtnew file+16

This diff is too big to show here.

tests/type-empty/list-dead.txtnew file+4

This diff is too big to show here.

tests/type-empty/list-live.txtnew file+3

This diff is too big to show here.

tests/type-empty/list-open.txtnew file+3

This diff is too big to show here.

tests/type-empty/missing.txtnew file+6

This diff is too big to show here.

tests/type-empty/overlap.txtnew file+3

This diff is too big to show here.

tests/type-empty/standard-good.txtnew file+11

This diff is too big to show here.

tests/type-empty/unit-dead.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/about.txtnew file+3

This diff is too big to show here.

tests/type-full-overlap/child.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/distinct.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/duplicate-generic.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/duplicate.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/expected-basic.txtnew file+16

This diff is too big to show here.

tests/type-full-overlap/expected-graph.txtnew file+8

This diff is too big to show here.

tests/type-full-overlap/generic.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/invalid.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/parent.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/precedence.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/same.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/unsupported.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/zero.txtnew file+4

This diff is too big to show here.

tests/type-gate-free/about.txtnew file+1

This diff is too big to show here.

tests/type-gate-free/expected.txtnew file+9

This diff is too big to show here.

tests/type-gate-free/todo-gate.txtnew file+40

This diff is too big to show here.

tests/type-gate-free/todo-noun.txtnew file+40

This diff is too big to show here.

tests/type-gate-free/todo.txtnew file+40

This diff is too big to show here.

tests/type-generic-construction/about.txtnew file+9

This diff is too big to show here.

tests/type-generic-construction/alias-client.txtnew file+12

This diff is too big to show here.

tests/type-generic-construction/alias.txtnew file+3

This diff is too big to show here.

tests/type-generic-construction/client.txtnew file+24

This diff is too big to show here.

tests/type-generic-construction/expected.txtnew file+65

This diff is too big to show here.

tests/type-generic-construction/no-event-client.txtnew file+8

This diff is too big to show here.

tests/type-generic-construction/owner-negative.txtnew file+10

This diff is too big to show here.

tests/type-generic-construction/owner-positive.txtnew file+9

This diff is too big to show here.

tests/type-generic-construction/sibling-values.txtnew file+4

This diff is too big to show here.

tests/type-generic-construction/tree-no-event.txtnew file+4

This diff is too big to show here.

tests/type-generic-construction/tree.txtnew file+6

This diff is too big to show here.

tests/type-generic-pattern/about.txtnew file+10

This diff is too big to show here.

tests/type-generic-pattern/client.txtnew file+166

This diff is too big to show here.

tests/type-generic-pattern/expected.txtnew file+91

This diff is too big to show here.

tests/type-generic-pattern/no-event.txtnew file+17

This diff is too big to show here.

tests/type-generic-pattern/owner-bad.txtnew file+22

This diff is too big to show here.

tests/type-generic-pattern/owner.txtnew file+18

This diff is too big to show here.

tests/type-generic-pattern/poly-values.txtnew file+2

This diff is too big to show here.

tests/type-generic-pattern/values.txtnew file+18

This diff is too big to show here.

tests/type-generic-recursion/about.txtnew file+14

This diff is too big to show here.

tests/type-generic-recursion/alias.txtnew file+3

This diff is too big to show here.

tests/type-generic-recursion/bad-constructor.txtnew file+8

This diff is too big to show here.

tests/type-generic-recursion/bad-match.txtnew file+10

This diff is too big to show here.

tests/type-generic-recursion/bad-mold.txtnew file+8

This diff is too big to show here.

tests/type-generic-recursion/bad-parameter.txtnew file+6

This diff is too big to show here.

tests/type-generic-recursion/chain.txtnew file+3

This diff is too big to show here.

tests/type-generic-recursion/client.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/expected.txtnew file+35

This diff is too big to show here.

tests/type-generic-recursion/list-shadow.txtnew file+4

This diff is too big to show here.

tests/type-generic-recursion/local-distinct.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/local-only.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/local-shadow.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/tree-changed.txtnew file+6

This diff is too big to show here.

tests/type-generic-recursion/tree.txtnew file+6

This diff is too big to show here.

tests/type-import-default/about.txtnew file+1

This diff is too big to show here.

tests/type-import-default/controls.txtnew file+16

This diff is too big to show here.

tests/type-import-default/expected.txtnew file+9

This diff is too big to show here.

tests/type-import-default/parent.txtnew file+3

This diff is too big to show here.

tests/type-import-default/tlon.txtnew file+18

This diff is too big to show here.

tests/type-import-diagnostic/about.txtnew file+15

This diff is too big to show here.

tests/type-import-diagnostic/expected.txtnew file+112

This diff is too big to show here.

tests/type-import-diagnostic/mark.txtnew file+5

This diff is too big to show here.

tests/type-import-diagnostic/nested.txtnew file+11

This diff is too big to show here.

tests/type-import-diagnostic/source.txtnew file+13

This diff is too big to show here.

tests/type-import-diagnostic/sur.txtnew file+5

This diff is too big to show here.

tests/type-import-overlap/about.txtnew file+24

This diff is too big to show here.

tests/type-import-overlap/expected.txtnew file+26

This diff is too big to show here.

tests/type-import-overlap/source.txtnew file+4

This diff is too big to show here.

tests/type-import-overlap/sur.txtnew file+17

This diff is too big to show here.

tests/type-import-structural/about.txtnew file+14

This diff is too big to show here.

tests/type-import-structural/expected.txtnew file+41

This diff is too big to show here.

tests/type-import-structural/source.txtnew file+5

This diff is too big to show here.

tests/type-import-structural/sur.txtnew file+12

This diff is too big to show here.

tests/type-import/about.txtnew file+37

This diff is too big to show here.

tests/type-import/expected.txtnew file+148

This diff is too big to show here.

tests/type-import/source.txtnew file+83

This diff is too big to show here.

tests/type-import/sur.txtnew file+27

This diff is too big to show here.

tests/type-list-alias/expected.txtnew file+36

This diff is too big to show here.

tests/type-mark/about.txtnew file+7

This diff is too big to show here.

tests/type-mark/collision.txtnew file+3

This diff is too big to show here.

tests/type-mark/declared.txtnew file+2

This diff is too big to show here.

tests/type-mark/expected.txtnew file+19

This diff is too big to show here.

tests/type-mark/missing.txtnew file+1

This diff is too big to show here.

tests/type-mark/sur.txtnew file+2

This diff is too big to show here.

tests/type-module-scope/about.txtnew file+16

This diff is too big to show here.