on master help sign in
1455 files changed+72311−7214
since splitsnapshots
unifiedsplit
README.md+13−1 docs/README.md+4 docs/compiler.md+111−9 docs/development.md+108−3 docs/open-questions.md+25−3 docs/prelude-inventory.md+24−8 docs/prompts/milestone-2.md+12−10 docs/reviews/2026-11-02-questions.md+342 docs/reviews/2026-11-02-repo-review.md+294 docs/spec/core-language.md+4−3 docs/spec/decisions.md+15−8 docs/spec/grammar.md+20−19 docs/spec/implementation-plan.md+1−1 docs/spec/overview.md+13−9 docs/status.md+190−9 jibb-dev/lib/jibb-import.hoon+791−21 jibb-dev/lib/jibb.hoon+7861−291 jibb-dev/lib/jibb/internal.jibb+34 jibb-dev/lib/jibb/prelude.jibb+329−64 my-app/ui/basket.jibb+2−2 my-app/ui/stores/cart.jibb+2−3 my-app/ui/theme.jibb+1−1 my-app/ui/todo-list.jibb+2−2 tests/clay-fixtures/mark-update-import-expected.txt+1 tests/clay-fixtures/mark-update-import.txt+9 tests/clay-fixtures/tlon-mop-expected.txt+1 tests/clay-fixtures/tlon-mop.txt+20 tests/golden/doc-core-02-update/source.jibb+2−2 tests/golden/doc-core-02-update/tokens.txt+22−28 tests/golden/doc-core-02-update/tree.txt+10−14 tests/golden/doc-grammar-02-buttons/modules.txt+1 tests/golden/doc-grammar-02-buttons/types.txt+4 tests/golden/doc-grammar-04-step/about.txt+1 tests/golden/doc-grammar-04-step/modules.txt+1 tests/golden/doc-grammar-04-step/source.jibb+1−1 tests/golden/doc-grammar-04-step/tokens.txt+2−2 tests/golden/doc-grammar-04-step/tree.txt+1−1 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+2−3 tests/golden/doc-grammar-06-cart-store/tokens.txt+56−60 tests/golden/doc-grammar-06-cart-store/tree.txt+25−26 tests/golden/doc-grammar-06-cart-store/types.txt+6 tests/golden/doc-grammar-07-basket/source.jibb+2−2 tests/golden/doc-grammar-07-basket/tokens.txt+19−25 tests/golden/doc-grammar-07-basket/tree.txt+7−12 tests/golden/doc-overview-01-cmd-sub/source.jibb+1−1 tests/golden/doc-overview-01-cmd-sub/tokens.txt+11−11 tests/golden/doc-overview-01-cmd-sub/tree.txt+5−5 tests/golden/doc-overview-02-theme/source.jibb+1−1 tests/golden/doc-overview-02-theme/tokens.txt+24−23 tests/golden/doc-overview-02-theme/tree.txt+9−8 tests/golden/doc-overview-10-todo-list/source.jibb+2−2 tests/golden/doc-overview-10-todo-list/tokens.txt+22−28 tests/golden/doc-overview-10-todo-list/tree.txt+10−14 tests/golden/inline-mold-opaque/about.txt+2−2 tests/golden/inline-mold-opaque/source.jibb+1−1 tests/golden/inline-mold-opaque/tokens.txt+1−1 tests/golden/inline-mold-opaque/tree.txt+1−1 tests/golden/inline-namespaces/about.txt+1−1 tests/golden/inline-namespaces/source.jibb+1−1 tests/golden/inline-namespaces/tokens.txt+1−1 tests/golden/inline-namespaces/tree.txt+1−1 tests/golden/inline-requests/about.txt+2−2 tests/golden/inline-requests/source.jibb+1−1 tests/golden/inline-requests/tokens.txt+7−6 tests/golden/inline-requests/tree.txt+3−2 tests/golden/module-import-cycle/source.jibb+1−1 tests/golden/module-import-cycle/tokens.txt+6−6 tests/golden/module-import-cycle/tree.txt+3−3 tests/golden/module-import-identity/source.jibb+1−1 tests/golden/module-import-identity/tokens.txt+5−5 tests/golden/module-import-identity/tree.txt+3−3 tests/golden/module-import-identity/types.txt+1−1 tests/golden/module-import-transitive/source.jibb+1−1 tests/golden/module-import-transitive/tokens.txt+6−6 tests/golden/module-import-transitive/tree.txt+3−3 tests/golden/module-import-transitive/types.txt+1−1 tests/golden/module-import-unused-invalid/source.jibb+1−1 tests/golden/module-import-unused-invalid/tokens.txt+6−6 tests/golden/module-import-unused-invalid/tree.txt+3−3 tests/golden/module-import-unused-invalid/types.txt+1−1 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/source.jibb+12−3 tests/golden/prelude-1c-structural/tokens.txt+529−447 tests/golden/prelude-1c-structural/tree.txt+200−165 tests/golden/prelude-1c-structural/types.txt+1 tests/golden/prelude-3g-basic/source.jibb+4−3 tests/golden/prelude-3g-basic/tokens.txt+101−94 tests/golden/prelude-3g-basic/tree.txt+41−38 tests/golden/prelude-3g-like/about.txt+3−3 tests/golden/prelude-3g-like/source.jibb+12−3 tests/golden/prelude-3g-like/tokens.txt+414−332 tests/golden/prelude-3g-like/tree.txt+159−124 tests/golden/prelude-3g-like/types.txt+1 tests/golden/prelude-3g-structural/source.jibb+4−3 tests/golden/prelude-3g-structural/tokens.txt+290−283 tests/golden/prelude-3g-structural/tree.txt+107−104 tests/golden/prelude-list-helpers/source.jibb+12−3 tests/golden/prelude-list-helpers/tokens.txt+648−566 tests/golden/prelude-list-helpers/tree.txt+255−220 tests/golden/prelude-list-helpers/types.txt+2−1 tests/golden/prelude-list-unit/source.jibb+4−3 tests/golden/prelude-list-unit/tokens.txt+32−25 tests/golden/prelude-list-unit/tree.txt+13−10 tests/golden/prelude-unit-list-transforms/about.txt+2−2 tests/golden/prelude-unit-list-transforms/source.jibb+147−64 tests/golden/prelude-unit-list-transforms/tokens.txt+2343−1694 tests/golden/prelude-unit-list-transforms/tree.txt+1035−753 tests/golden/prelude-unit-list-transforms/types.txt+25−8 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-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-face-inference/types.txt+7−1 tests/golden/types-generic-gates/about.txt+1−1 tests/golden/types-generic-gates/source.jibb+2 tests/golden/types-generic-gates/tokens.txt+43−1 tests/golden/types-generic-gates/tree.txt+18−1 tests/golden/types-generic-gates/types.txt+2 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-errors/types.txt+3−3 tests/golden/types-generic-union-escaping/module-trees.txt+4−4 tests/golden/types-generic-union-escaping/modules/ui/mid.jibb+1−1 tests/golden/types-generic-union-escaping/source.jibb+1−1 tests/golden/types-generic-union-escaping/tokens.txt+1−1 tests/golden/types-generic-union-escaping/tree.txt+1−1 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+16 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-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-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-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-patterns/about.txt+1−1 tests/golden/types-list-patterns/types.txt+1−1 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-recursive/about.txt+1−1 tests/golden/types-local-recursive/types.txt+1−1 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-multi-call/types.txt+1−1 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+1−1 tests/golden/types-null-context/source.jibb+1−1 tests/golden/types-null-context/tokens.txt+8−8 tests/golden/types-null-context/tree.txt+4−4 tests/golden/types-null-context/types.txt+1−7 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-aura-family/source.jibb+1−1 tests/golden/types-partial-aura-family/tokens.txt+8−8 tests/golden/types-partial-aura-family/tree.txt+4−4 tests/golden/types-partial-aura-family/types.txt+1−1 tests/golden/types-partial-locals/source.jibb+2−2 tests/golden/types-partial-locals/tokens.txt+10−10 tests/golden/types-partial-locals/tree.txt+5−5 tests/golden/types-partial-locals/types.txt+1−1 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-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+1−1 tests/golden/types-prelude-direct/source.jibb+1−1 tests/golden/types-prelude-direct/tokens.txt+11−11 tests/golden/types-prelude-direct/tree.txt+7−7 tests/golden/types-prelude-direct/types.txt+1−1 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+1−1 tests/golden/types-prelude-interface/source.jibb+1−1 tests/golden/types-prelude-interface/tokens.txt+11−11 tests/golden/types-prelude-interface/tree.txt+7−7 tests/golden/types-prelude-interface/types.txt+1−1 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+1−1 tests/golden/types-prelude-list-functions/module-trees.txt+7−1 tests/golden/types-prelude-list-functions/modules/ui/lib.jibb+1 tests/golden/types-prelude-list-functions/source.jibb+7 tests/golden/types-prelude-list-functions/tokens.txt+102−3 tests/golden/types-prelude-list-functions/tree.txt+48−1 tests/golden/types-prelude-list-functions/types.txt+13 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+78 tests/golden/types-prelude-ui/tokens.txt+728 tests/golden/types-prelude-ui/tree.txt+300 tests/golden/types-prelude-ui/types.txt+85 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+31 tests/golden/types-prelude-unit-helpers/tokens.txt+427 tests/golden/types-prelude-unit-helpers/tree.txt+231 tests/golden/types-prelude-unit-helpers/types.txt+78 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-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-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-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-gate/about.txt+1−1 tests/golden/types-recursive-gate/types.txt+2−2 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+3 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-branch-context/types.txt+4−4 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-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-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-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-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-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-tags/types.txt+3−3 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+2−2 tests/golden/types-unit-context/modules.txt+1 tests/golden/types-unit-context/source.jibb+44−68 tests/golden/types-unit-context/tokens.txt+458−343 tests/golden/types-unit-context/tree.txt+218−180 tests/golden/types-unit-context/types.txt+90−22 tests/golden/types-unit-patterns/types.txt+4−1 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+37−1 tests/importer/shadow-static.txt+6 tests/importer/shadow.txt+3 tests/importer/small.txt+82 tests/importer/tree.txt+75−3 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+97−2 tests/lib/jibb-buttons.hoon+81 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-doc-examples.hoon+166 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+143 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+6−3 tests/lib/jibb-import-overlap.hoon+80 tests/lib/jibb-import-structural.hoon+82 tests/lib/jibb-list-alias-guards.hoon+27 tests/lib/jibb-module-scope.hoon+52−3 tests/lib/jibb-nested-union-guards.hoon+67 tests/lib/jibb-page-main.hoon+168 tests/lib/jibb-poke-bridge.hoon+88 tests/lib/jibb-positional-face-guards.hoon+38 tests/lib/jibb-program-init.hoon+140 tests/lib/jibb-program-main.hoon+141 tests/lib/jibb-program-update.hoon+140 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-store.hoon+285 tests/lib/jibb-sub-guards.hoon+37 tests/lib/jibb-theme.hoon+86 tests/lib/jibb-tlon-bridge.hoon+29 tests/lib/jibb-todo-api.hoon+85 tests/lib/jibb-todo-full.hoon+157 tests/lib/jibb-todo-partial.hoon+58 tests/lib/jibb-union-alias-overlap.hoon+107 tests/lib/jibb-union-source.hoon+152 tests/lib/jibb.hoon+1592−662 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+14 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-buttons/error.txt+3 tests/type-buttons/expected.txt+2 tests/type-buttons/valid.txt+4 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+5−3 tests/type-import-diagnostic/expected.txt+38−2 tests/type-import-diagnostic/nested.txt+11 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+23−4 tests/type-import/expected.txt+67−9 tests/type-import/source.txt+26 tests/type-import/sur.txt+6 tests/type-list-alias/expected.txt+36 tests/type-module-scope/expected.txt+18 tests/type-page-main/about.txt+3 tests/type-page-main/arbitrary-main.txt+1 tests/type-page-main/blog-api.txt+5 tests/type-page-main/blog-index.txt+9 tests/type-page-main/blog-sur.txt+6 tests/type-page-main/card.txt+5 tests/type-page-main/ctor-page.txt+10 tests/type-page-main/diff-load.txt+11 tests/type-page-main/hand-built-load.txt+14 tests/type-page-main/index.txt+10 tests/type-page-main/indirect-load.txt+11 tests/type-page-main/page-alias.txt+11 tests/type-page-main/posts-mark.txt+6 tests/type-page-main/pure-load.txt+10 tests/type-page-main/static.txt+7 tests/type-page-main/todo-api.txt+13 tests/type-page-main/todo-island.txt+40 tests/type-page-main/typed-load.txt+8 tests/type-page-main/wrong-static.txt+1 tests/type-poke/about.txt+7 tests/type-poke/alias.txt+2 tests/type-poke/api.txt+2 tests/type-poke/client.txt+23 tests/type-poke/direct.txt+2 tests/type-poke/expected.txt+66 tests/type-poke/exported.txt+9 tests/type-poke/fake.txt+4 tests/type-poke/impostor-client.txt+2 tests/type-poke/impostor.txt+1 tests/type-poke/inner.txt+2 tests/type-poke/mark.txt+5 tests/type-poke/public.txt+2 tests/type-poke/transitive.txt+2 tests/type-program-main/about.txt+1 tests/type-program-main/alias-main.txt+11 tests/type-program-main/arbitrary-main.txt+10 tests/type-program-main/consumer.txt+2 tests/type-program-main/gate-data.txt+10 tests/type-program-main/gate-model.txt+11 tests/type-program-main/initializer-consumer.txt+2 tests/type-program-main/initializer-earlier.txt+10 tests/type-program-main/initializer-error.txt+10 tests/type-program-main/initializer-generic.txt+10 tests/type-program-main/initializer-message.txt+13 tests/type-program-main/initializer-missing.txt+9 tests/type-program-main/initializer-model.txt+11 tests/type-program-main/initializer-no-main.txt+10 tests/type-program-main/initializer-subs.txt+10 tests/type-program-main/initializer-tag.txt+13 tests/type-program-main/initializer-unfaced.txt+10 tests/type-program-main/initializer.txt+12 tests/type-program-main/mismatched-model.txt+10 tests/type-program-main/nonempty-subs.txt+12 tests/type-program-main/open-message.txt+7 tests/type-program-main/source.txt+12 tests/type-program-update/consumer.txt+2 tests/type-program-update/malformed-sample.txt+9 tests/type-program-update/missing-list.txt+15 tests/type-program-update/non-main.txt+14 tests/type-program-update/source.txt+15 tests/type-program-update/three-slot-sample.txt+9 tests/type-program-update/unrelated-tag.txt+16 tests/type-program-update/wrong-message.txt+10 tests/type-program-update/wrong-model.txt+12 tests/type-program-update/wrong-result.txt+12 tests/type-program-watch/about.txt+1 tests/type-store/basket.txt+32 tests/type-store/cart.txt+12 tests/type-theme/dark-absent.txt+8 tests/type-theme/missing-field.txt+7 tests/type-theme/source.txt+8 tests/type-theme/wrong-dark.txt+8 tests/type-theme/wrong-font.txt+8 tests/type-theme/wrong-nested-aura.txt+8 tests/type-tlon/about.txt+6 tests/type-tlon/expected.txt+6 tests/type-tlon/source.txt+6 tests/type-todo-api/about.txt+1 tests/type-todo-api/expected.txt+17 tests/type-todo-api/negative-expected.txt+26 tests/type-todo-api/negative.txt+12 tests/type-todo-api/source.txt+21 tests/type-todo-api/unsupported.txt+13 tests/type-todo-full/about.txt+3 tests/type-todo-full/alias.txt+42 tests/type-todo-full/ambiguous-mapper.txt+41 tests/type-todo-full/expected.txt+2 tests/type-todo-full/non-gate-view.txt+33 tests/type-todo-full/open-key.txt+40 tests/type-todo-full/wrong-message.txt+40 tests/type-todo-full/wrong-model.txt+40 tests/type-todo-full/wrong-result.txt+40 tests/type-todo-full/wrong-watch.txt+40 tests/type-todo-partial/about.txt+4 tests/type-todo-partial/expected.txt+17 tests/type-union-alias-overlap/duplicate.txt+5 tests/type-union-alias-overlap/expected.txt+25 tests/type-union-alias-overlap/flag-source.txt+7 tests/type-union-alias-overlap/multi.txt+5 tests/type-union-alias-overlap/negative.txt+16 tests/type-union-alias-overlap/nonzero.txt+4 tests/type-union-alias-overlap/opaque.txt+4 tests/type-union-alias-overlap/positive.txt+8 tests/type-union-alias-overlap/qualified.txt+5 tests/type-union-alias-overlap/wrong.txt+5 tests/type-union-source/direct-source.txt+3 tests/type-union-source/duplicate-params.txt+4 tests/type-union-source/duplicate.txt+5 tests/type-union-source/expected.txt+36 tests/type-union-source/free-source.txt+4 tests/type-union-source/good.txt+9 tests/type-union-source/hidden-ref.txt+5 tests/type-union-source/late-source.txt+4 tests/type-union-source/mixed-source.txt+8 tests/type-union-source/nested.txt+4 tests/type-union-source/qualified.txt+4 tests/type-union-source/same.txt+5 tests/type-union-source/shadow-source.txt+7 tests/type-union-source/wide-source.txt+4 tests/type-union-source/wrong.txt+5 tests/type-union-source/zero.txt+5 tools/clay-fixtures+56 tools/golden+12−2 tools/importer-test+1−1 tools/ship+46−8 tools/testdata/clay-fixtures-selftest+109 tools/testdata/lead-late-hoon-reference.hoon+24 tools/testdata/selftest+10−10 tools/testdata/ship-selftest+221−3 tools/testdata/succ-hoon-reference.hoon+9 tools/testdata/zing-hoon-reference.hoon+17 tools/type-api-evidence-test+40 tools/type-api-paths-test+52 tools/type-arithmetic-guards-test+28 tools/type-ask-guards-test+31 tools/type-buttons-test+40 tools/type-cell-branch-test+43 tools/type-closed-gate-guards-test+29 tools/type-constructor-fit-guards-test+29 tools/type-deferred-context-test+31 tools/type-deferred-prepared-test+49 tools/type-deferred-resolver-test+33 tools/type-deferred-test+32 tools/type-direct-gate-test+64 tools/type-doc-examples-test+49 tools/type-empty-test+55 tools/type-full-overlap-test+49 tools/type-gate-free-guards-test+29 tools/type-gate-free-source-test+50 tools/type-generic-alias-test+28 tools/type-generic-construction-test+49 tools/type-generic-pattern-test+52 tools/type-generic-recursion-test+61 tools/type-hole-guards-test+32 tools/type-import-default-test+38 tools/type-import-diagnostic-test+3−1 tools/type-import-overlap-test+33 tools/type-import-structural-test+36 tools/type-list-alias-test+33 tools/type-module-scope-test+2−1 tools/type-nested-union-guards-test+29 tools/type-page-main-test+86 tools/type-poke-test+50 tools/type-positional-face-guards-test+29 tools/type-program-init-test+49 tools/type-program-main-test+46 tools/type-program-update-test+46 tools/type-program-watch-test+48 tools/type-proj-guards-test+32 tools/type-qath-guards-test+31 tools/type-request-guards-test+31 tools/type-store-test+41 tools/type-sub-guards-test+31 tools/type-theme-test+44 tools/type-tlon-test+39 tools/type-todo-api-test+62 tools/type-todo-full-test+98 tools/type-todo-partial-test+55 tools/type-union-alias-overlap-test+52 tools/type-union-source-test+55
README.md+13−1
@@ -42,7 +42,19 @@ tools/hoon '(golden /a/b/jibb (crip "++ main view"))'
4242tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
4343```
4444
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` and `tools/type-mark-test` check the importer/checker bridges under eval; the ship suite runs the same fixtures.
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-page-main-test` fully checks the byte-identical static about page and direct blog/todo data pages through the real readers, with exact main types, downstream imports and fail-closed syntax/evidence controls; the same fixture runs on the fake ship. It does not render pages or execute requests.
48+
49+The focused `tools/type-buttons-test` fully checks the documented `labelled` and `wide` definitions and the unchanged module's exact source-located unresolved-`%add` error through detailed and legacy inference. The eval test and fake-ship arm share the valid source, schemes and error fixtures. It does not render or execute UI.
50+
51+The focused `tools/type-doc-examples-test` fully checks the import-only example with real Hoon readers and the card module, the `view-day` and `step` modules, and the `cmd`/`sub` molds at their prelude path through detailed and legacy inference. The same fixture runs on the fake ship.
52+
53+The focused `tools/type-theme-test` fully checks the byte-identical real theme against the exact prelude mold, including its exported type, structural downstream import, dark absent/present forms and malformed-field negatives under eval with a shared fake-ship arm. It does not check contrast, render themes or route fonts.
54+
55+The focused `tools/type-store-test` checks the byte-identical cart store and basket through detailed and legacy inference, exact main and derived schemes, structural imports, direct store watch evidence and rejection controls under eval with a shared fake-ship arm. It does not lower or execute stores, support multi-action declarations, or permit store requests in page loads.
56+
57+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. `tools/type-todo-full-test` additionally checks the byte-identical todo island through both full-module APIs, verifies its exact closed `main` type and structural downstream import, and runs rejection controls.
4658
4759### The doc's examples
4860
docs/README.md+4
@@ -2,6 +2,8 @@
22
33Jibb'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.
44
5+The current full-module checker also has a narrow static/data-page slice, documented in [compiler.md](compiler.md) and [status.md](status.md). Its shared eval/ship fixture checks the real about, blog index and todo index sources without claiming rendering or request execution. The shared theme fixture likewise full-checks the byte-identical real theme and its exact type without implementing theme behavior.
6+
57| File | What it holds |
68| --- | --- |
79| [spec/](spec/) | The doc's tabs, as Markdown |
@@ -12,6 +14,8 @@ Jibb's spec is a design doc by @iko, [Jibb — an Elm-architecture UI language f
1214| [prelude-inventory.md](prelude-inventory.md) | Working source audit for the prelude's exported inventory |
1315| [prompts/milestone-2.md](prompts/milestone-2.md) | A brief for the developer who builds milestone 2, types and prelude |
1416| [prompts/drop-union-rune.md](prompts/drop-union-rune.md) | The completed brief for dropping `$?`, as decided on 2026-10-30, before milestone 2 |
17+| [reviews/2026-11-02-repo-review.md](reviews/2026-11-02-repo-review.md) | A review of the whole repository on 2026-11-02: bugs, gaps and simplifications, each checked by a second reviewer |
18+| [reviews/2026-11-02-questions.md](reviews/2026-11-02-questions.md) | The 45 decisions that review raises, with options and recommendations |
1519
1620## The spec
1721
docs/compiler.md+111−9
@@ -56,29 +56,107 @@ The core is split into chapters, `+| %name`, in this order:
5656| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
5757| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
5858
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 two-binder cell pattern, 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. Mutual recursive groups, polymorphic recursion and value cycles 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. A null-headed cell can match a union case but does not supply a `|=%$` constructor; 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. A generic union declared directly inside a body remains unsupported, as do mutually recursive local groups and recursive molds. 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. The reporting path repeats inference of a recursive gate rather than instantiating its generalized interface inside its own body. 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.
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.
6080
6181For 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.
6282
6383Multi-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.
6484
65−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. Faced or longer cells, uncontextualized construction, 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.
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.
6690
6791A 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.
6892
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+
6997A 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.
7098
71−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 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. The reader checks explicit Hoon `$%`, `$?` and `$^` unions against the Grammar’s disjointness rule, as @iko confirmed on 2026-10-30. 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, 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/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
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 generic poke command helper 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.
72124
73−Self-recursive `/sur` molds can cross the bridge as opaque module-and-name identities when their supported source-aware graph passes validation. Aliases, foreign references, recursive marks, unfolding, construction and field access remain unsupported; the partial printer declines recursive names that are not in scope.
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.
74126
75−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` aura and core 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 or core errors at direct imported `%ref` casts or whole-sample mold use sites, when the import and supplied input are unique. Nested shapes, local aliases, transitive modules and unsupported reader outcomes still report generic limitations; 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.
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.
76128
77−`+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.
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 is separate from the generalized constraint solver below.
78130
79−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`, `same`, `fall`, `need`, `lure`, `weld` and `snoc`; unsupported entries, such as most list helpers, remain unavailable. The validated `list` is injected while the prelude’s gates are inferred; `weld` uses an ordinary explicit result cast. An absent or altered `list` is not injected, and an altered declaration cannot leak through a direct or transitive mold alias. List-dependent prelude mold aliases remain unsupported because their templates are prepared before this injection. 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. Prelude imports, including the planned private internal module, are not supported by preparation. 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.
131+A dedicated `%fvar` form retains the `contains no gates` constraint inside schemes. Unification resolves and updates nested substitutions, so existing or later gate injection fails rather than bypassing the constraint; atom-constrained variables remain the stronger form. Constraint propagation covers open cells, faces, collections and unions with a 256-node bound. Canonicalization and instantiation preserve the constraint, template application validates constrained arguments, and an exhausted variable scan never chooses the unconstrained fallback. `set`, `map`, `mop`, `jar` and `jug` apply the same bounded propagation only to their key positions, leaving values independent. Public `eq` uses the private primitive interface, and generic `mate` retains the same constraint.
80132
81−`+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, duplicate-name or import-bearing prelude sources fail closed. `+golden-types-with-prelude` remains the source-taking wrapper. 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.
133+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.
134+
135+The same post-inference, post-request-graph kind boundary accepts a static `main` by instantiating its ordinary scheme, fitting it to canonical `(element !!)`, requiring the specialized result closed, and publishing that closed canonical scheme. Thus `main view` works when `view` is generic only in its element message. A data page must instead be a direct `(page load view)` call with simple wing arguments and a closed main type invariant against the instantiated canonical `page` mold. Its named load must be a direct gate whose transparent body is exactly `case.face reply`, with a simple wing or direct constructor reply. Page loads and direct program watches share the exact plain derived-member/request-evidence check: unique evidence in the selected interface's own graph, matching API source and inner case name, no typed path segments, diffs or scry. Page aliases, indirect or hand-built/pure/unknown requests, other main types and store paths fail closed. These are interface checks only, not rendering or runtime request claims.
136+
137+A store `main` is recognized only as a direct, unqualified `(store init update)` call with two simple wing arguments, modulo grouping, independently of its directory. Its module must declare exactly one ordinary `state` mold and one ordinary, nongeneric local `+$ poke` action mold. Both remain in ordinary mold/value inference and are exported. `+store-main-closed` checks the canonical closed store main, exact init/state equality, and an invariant `$-([action state] state)` update after erasing only the two outer binder faces. It deliberately performs no gate-free-state check. The direct form can recover a missing main from checked components; aliases and hand-built records cannot.
138+
139+The store interface adds a derived `$-([action $-((unit @t) M)] (cmd M))` poke helper and a generic `$-($-(state M) (ask M))` state request after validating the exact internal `raw-poke`, canonical `cmd`, standard `unit` and `ask` representations. Derived names must not collide with values, imports or other derived names. Store request certificates are distinct from API certificates and retain the exact store path, source, state and action identities across graph merges. `+derived-store-request-member` requires the selected interface's unique state member and action constructor to match freshly derived canonical schemes and the same certificate to occur in both interface and consumer graphs. Store state is watchable by definition only after those checks; page loads continue to accept API evidence alone. Multi-action declarations, lowering and execution are outside this slice.
140+
141+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.
142+
143+A component-local recovery sequence handles a recognized direct program whose context-dependent definitions cannot resolve ordinarily. Update first derives its result from its inferred two-slot sample and canonical `cmd`/`list` templates. Subscription recovery then checks the same message/model relation and the canonical fourth slot. A narrow keyed-view proof finds exactly one direct `each (turn xs mapper)` site, derives the mapper from the actual `each` and `turn` schemes, and recovers the view before the existing initializer and ordinary `main` retries. Every recovered scheme must be closed and freshly allocated above the current environment and prelude IDs. A source screen skips doomed ordinary attempts only for this keyed shape and never skips final `main` inference; non-gate views and aliases decline without crashing. Final publication still requires all module definitions, the program-mold and gate-free checks, and request-value watchability.
144+
145+Canonical `element` composition has two tightly scoped accommodations. Recursive result context is allowed only when every recursive side has the prepared prelude's `element` origin. When ordinary list-item fitting fails, an `element` target may instead prove its message argument invariantly or select one exact literal case with a full payload fit; a successful ordinary fit always takes precedence. This covers the unchanged todo's union controls and raw constructors without opening those paths to other unions. `tools/type-todo-full-test` checks the byte-identical island through both full APIs, the exact closed `main` type, structural downstream import, and model/message/mapper/watch rejection controls. It does not execute Jibb or implement runtime watching.
146+
147+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.
148+
149+`+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.
150+
151+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.
152+
153+`+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.
154+
155+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.
156+
157+The Grammar's buttons example has a shared full-check fixture. Without `add-button`, `labelled` and `wide` export their exact generic `(element A)` and `(list attr)` schemes through detailed and legacy inference. The ordinary call fit handles this by unifying a variable actual argument with the body of an expected faced slot, rather than putting the sample face on the argument's type. With the unchanged `add-button`, final incompleteness triggers a diagnostic-only retry bounded to 64 missing definitions. A pending tag retains its literal span, so the error says that nothing fixes the union of `%add` at the literal and includes its source excerpt. Other incomplete modules keep the generic error, and successful modules never run the retry. This checks types only; it does not render or execute buttons.
158+
159+The prepared interface also includes the exact documented `theme` mold. Full checking covers the unchanged real `/ui/theme.jibb`, its exact exported record and a structural downstream import, with dark absent/present and field/type rejection controls. The documented present dark record uses explicit backtick unit syntax, as the Decisions tab records; there is no theme-specific inference exception. This is type checking only: contrast validation, theme rendering and routing remain unimplemented.
82160
83161And the design notes:
84162
@@ -89,16 +167,26 @@ And the design notes:
89167| 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 |
90168| 4. Printed formats | The token, tree and error formats the golden files hold |
91169
170+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.
171+
172+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.
173+
174+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.
175+
176+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.
177+
92178## The tree
93179
94180Every 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:
95181
96182- **Module**: imports (`%sur` for `/-`, `%mark` for `/%`, `%jibb` for `/=`), then definitions (`%mold` for `+$`, `%value` for `++`).
97183- **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.
98−- **Molds as written** (`shape`): `%aura`, `%noun`, `%void`, `%flag`, `%const`, `%ref`, `%tvar`, `%path`, `%apply`, `%cell`, `%union`, `%fn`, `%generic`. 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.
184+- **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.
99185- **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`.
100186- **Literals** (`lit`) keep the form they matched, their aura and value, and their text as written, which the printers show.
101187
188+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.
189+
102190The 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.
103191
104192## Positions and errors
@@ -123,3 +211,17 @@ Note 4 has examples of each.
123211## Speed
124212
125213Starting `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).
214+
215+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.
216+
217+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.
218+
219+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.
220+
221+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.
222+
223+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.
224+
225+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.
226+
227+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.md+108−3
@@ -14,6 +14,8 @@ From the plan's Setup and ground rules, and from @iko:
1414- **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.
1515- **Keep docs/ current**: [status.md](status.md) when a milestone moves, [open-questions.md](open-questions.md) when a question is settled or found.
1616
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+
1719## Setting up a machine
1820
1921The 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.
@@ -60,9 +62,56 @@ git clone https://github.com/urbit/tools /root/src/tools
6062| --- | --- |
6163| `tools/golden` | Runs the golden cases under `urbit eval`: every case, or those matching `--case`; `--update` rewrites the expected outputs; `--show` prints them |
6264| `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 |
6366| `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 |
6473| `tools/type-import-diagnostic-test` | Compares the structured reader diagnostic bridge report under eval |
6574| `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-page-main-test` | Fully checks byte-identical static and direct data pages through real readers, exact main types, downstream imports and rejection guards under eval and on the ship |
95+| `tools/type-buttons-test` | Checks the documented valid button helpers and the unchanged unresolved-`%add` module through detailed and legacy inference under eval and on the ship |
96+| `tools/type-doc-examples-test` | Fully checks the import-only, view-day, step and cmd/sub doc fragments in their intended contexts through detailed and legacy inference under eval and on the ship |
97+| `tools/type-theme-test` | Fully checks the byte-identical real theme, its exact exported type, structural downstream import, dark absent/present forms and rejection guards under eval and on the ship |
98+| `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 |
99+| `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 |
100+| `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 |
101+| `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 |
102+| `tools/type-store-test` | Checks the unchanged cart/basket through detailed and legacy inference, exact store/derived schemes, malformed-prelude guards, structural imports, source-bound state watch evidence and rejection guards under eval and on the ship |
103+| `tools/type-todo-full-test` | Fully checks the byte-identical todo island through real readers, exact main type, structural downstream import and rejection controls under eval and on the ship |
104+| `tools/type-closed-gate-guards-test` | Checks closed gate sample labels and face uncertainty under eval and on the ship |
105+| `tools/type-constructor-fit-guards-test` | Checks constructor-case uncertainty and known mismatches under eval and on the ship |
106+| `tools/type-nested-union-guards-test` | Checks nested tagged-union case selection and uncertainty under eval and on the ship |
107+| `tools/type-empty-test` | Checks source-backed empty molds, inhabitedness, coverage and proof budgets under eval and on the ship |
108+| `tools/type-gate-free-guards-test` | Checks bounded gate-free verdicts, persistent constraints, substitution safeguards, collection keys and witness paths under eval and on the ship |
109+| `tools/type-gate-free-source-test` | Checks source-backed todo mold analysis through the real readers under eval and on the ship |
110+| `tools/type-sub-guards-test` | Checks source-backed subscription mold dependencies under eval and on the ship |
111+| `tools/type-ask-guards-test` | Runs ask origin and canonical list/unit bootstrap guards under eval and on the ship |
112+| `tools/type-request-guards-test` | Runs request evidence, source consistency and cache provenance guards under eval and on the ship |
113+| `tools/type-proj-guards-test` | Runs projection evidence, name-scope and dependency guards under eval and on the ship |
114+| `tools/type-arithmetic-guards-test` | Runs restricted atom-variable, unification and projection guards under eval and on the ship |
66115| `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 |
67116| `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 |
68117| `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 |
@@ -70,6 +119,7 @@ git clone https://github.com/urbit/tools /root/src/tools
70119| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
71120| `tools/testdata/selftest` | Tests `tools/golden` and `tools/hoon` against a stub library, and `tools/doc-blocks` against Markdown it writes |
72121| `tools/testdata/ship-selftest` | Tests `tools/ship`'s test generator and runner against a stub library on the ship |
122+| `tools/testdata/clay-fixtures-selftest` | Tests temporary Clay fixture cleanup and signal handling without a ship |
73123
74124`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.
75125
@@ -77,22 +127,75 @@ git clone https://github.com/urbit/tools /root/src/tools
77127
78128```
79129tools/golden # all cases pass
130+tools/golden --case types-prelude-ui # exact UI/program/page schemes and composition
80131tools/importer-test # Hoon importer fixture projections match
132+tools/type-import-default-test # default-wrapped source proofs match
81133tools/type-import-test # importer/checker bridge golden report matches
134+tools/type-import-overlap-test # source-aware Hoon overlap and provenance controls
135+tools/type-import-structural-test # nested and multi-case Hoon overlap controls
136+tools/type-union-source-test # local generic-alias union guards
137+tools/type-union-alias-overlap-test # local generic-alias overlap diagnostics
138+tools/type-full-overlap-test # full-module overlap evidence
139+tools/type-tlon-test # real Tlon importer/checker report matches
82140tools/type-import-diagnostic-test # direct structured reader diagnostics match
83141tools/type-mark-test # mark/checker bridge golden report matches
142+tools/type-poke-test # source-backed poke/API bridge report matches
143+tools/type-api-paths-test # partial API path analysis report matches
144+tools/type-api-evidence-test # API declaration evidence guards pass
145+tools/type-hole-guards-test # hole defaulting and API guards pass
146+tools/type-list-alias-test # prelude list-alias guards pass
147+tools/type-generic-alias-test # generic union alias guards pass
148+tools/type-positional-face-guards-test # positional sample face guards pass
149+tools/type-qath-guards-test # qath source and unfolding guards pass
150+tools/type-todo-partial-test # unchanged todo partial report and reader failure controls
151+tools/type-todo-api-test # real todo API partial inference and reader guards pass
152+tools/type-direct-gate-test # direct gate source and provenance guards pass
153+tools/type-page-main-test # static/data pages, exact types, imports and rejection guards pass
154+tools/type-buttons-test # documented buttons schemes and exact pending-tag error
155+tools/type-doc-examples-test # remaining doc fragments fully check in context
156+tools/type-theme-test # real theme, exact type, structural import and rejection guards pass
157+tools/type-program-main-test # closed program-main interface and rejection guards pass
158+tools/type-program-init-test # transactional direct-program initializer context guards pass
159+tools/type-program-update-test # transactional direct-program update context guards pass
160+tools/type-program-watch-test # direct request-value watchability guards pass
161+tools/type-store-test # unchanged cart/basket, store evidence and rejection guards pass
162+tools/type-todo-full-test # byte-identical full todo, downstream import and rejection guards pass
163+tools/type-generic-recursion-test # source-backed recursive identities and provenance
164+tools/type-generic-construction-test # source-backed recursive construction and bounds
165+tools/type-generic-pattern-test # source-backed recursive patterns and bounds
166+tools/type-deferred-test # source-owned deferred inference guards
167+tools/type-deferred-resolver-test # resolver consistency and failure guards
168+tools/type-deferred-context-test # deferred source-order and branch guards
169+tools/type-deferred-prepared-test # prepared initializer reports and failure guards
170+tools/type-cell-branch-test # contextual branch rollback and bounds
171+tools/type-closed-gate-guards-test # closed gate fit guards pass
172+tools/type-constructor-fit-guards-test # constructor fit guards pass
173+tools/type-nested-union-guards-test # nested union selector guards pass
174+tools/type-empty-test # empty mold and uninhabited-case guards pass
175+tools/type-gate-free-guards-test # bounded gate-free classifier guards pass
176+tools/type-gate-free-source-test # real todo mold analysis and source guards pass
177+tools/type-sub-guards-test # subscription source guards pass
178+tools/type-ask-guards-test # ask source and bootstrap guards pass
179+tools/type-request-guards-test # request evidence and cache guards pass
180+tools/type-proj-guards-test # projection evidence and scope guards pass
181+tools/type-arithmetic-guards-test # arithmetic constraint guards pass
84182tools/type-module-scope-test # module/prelude scope golden report matches
85183tools/hoon check-spans-test # prints <<>>
184+tools/hoon itype-unify-test # type-unification controls pass
185+tools/hoon -f tools/testdata/zing-hoon-reference.hoon # Hoon translation agrees on four inputs
186+tools/hoon -f tools/testdata/lead-late-hoon-reference.hoon # Hoon translation agrees on selected inputs
187+tools/hoon -f tools/testdata/succ-hoon-reference.hoon # Hoon translation agrees on selected inputs
86188tools/testdata/selftest # 22 checks, 0 failed
87189tools/doc-blocks docs/spec # every jibb block has its case
88190tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
89191tools/ship test # the cases pass as -test arms on the ship
90192tools/testdata/ship-selftest # when tools/ship changed
193+tools/testdata/clay-fixtures-selftest # scratch fixture cleanup without a ship
91194tools/ship check-commit # when the mark or the desks changed
92−tools/clay-fixtures # when the my-app Hoon fixtures or importer changed
195+tools/clay-fixtures # builds example fixtures and real Tlon notes through Clay
93196```
94197
95−`tools/ship test` regenerates `tests/lib/jibb.hoon` and syncs the `jibb-dev` desk before it runs, so commit the regenerated file. 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. 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-module-scope.hoon` and `tools/type-module-scope-test` compare the prelude scope report on the ship and under eval.
198+`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.
96199
97200## Golden cases
98201
@@ -106,7 +209,7 @@ A case is a folder `tests/golden/<name>/` holding:
106209- 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.
107210- 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.
108211
109−The runners prepare the trusted vendored prelude once for their generated test core and share its partial interface. Preparation reserves all names present in that source and supplies the molds and values the fragment can infer; an unsupported declaration remains reserved but unavailable. The source and the 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` accepts source directly; callers using `+golden-types-with-prepared-prelude` must pass the unchanged result of `+prepare-prelude`. Missing, malformed or conflicting source fails closed, and prelude imports are not supported yet.
212+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.
110213
111214A 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.
112215
@@ -133,3 +236,5 @@ Write `source.jibb` and `about.txt` by hand, run `tools/golden --update --case <
133236## Commits
134237
135238A 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.
239+
240+`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.md+25−3
@@ -18,7 +18,7 @@ On 2026-10-30, @iko adopted gate-free `eq` arguments and map and set keys, treat
1818
1919## Questions milestone 2 raises
2020
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. Questions 3 and 18 remain open; the other questions are settled.
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.
2222
23231. **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.
24242. **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.
@@ -30,20 +30,42 @@ Found while writing [prompts/milestone-2.md](prompts/milestone-2.md), checking i
30308. **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.
31319. **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`.
323210. **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`.
33+11. **Settled: stores and derived gates.** On 2026-11-01, @iko said a store's local `+$ poke` is an ordinary action mold and the runtime envelope is `raw-poke`; 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`.
343412. **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.
353513. **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`.
363614. **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.
373715. **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`.
383816. **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.
393917. **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. **The two uses of Hoon `like`.** Hoon `+like` is a wet mold builder, but the gate it returns is callable and applies its supplied gate to the product. In a verified Hoon 135 example, applying `(like f)` to `[[1 2] [7 8 ~]]` produces an edge whose product is `8` when `f` is identity and `42` when `f` returns `42`; the resulting nail is the original input. Jibb molds are types, not callable values. The prelude now declares a generic `(like A)` mold and a `wonk` extractor; both parse, but their full type and backend validation remain outstanding. Should it also expose a value gate under `like`? If so, should the value preserve Hoon's input shape and behavior, or instead map the product of an already constructed edge? @iko is reviewing these alternatives; the exact public signature is not yet decided.
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.
414119. **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.
424220. **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.
434321. **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.
444422. **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.
454523. **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.
4646
47+24. **Settled: how the internal prelude provides `raw-poke`.** On 2026-11-01, @iko chose to define `raw-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, while derived API/store `poke` helpers return commands. This settles `raw-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 `raw-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+
4769## Grammar questions never put to the doc's author
4870
4971In 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.
docs/prelude-inventory.md+24−8
@@ -4,12 +4,24 @@ This is a working inventory, not a completed prelude interface. It lists top-lev
44
55The 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.
66
7+The vendored prelude defines `raw-poke` in its private internal module and re-exports it as a transparent type. Derived API/store `poke` helpers take an action and reply and return `(cmd M)` after checking the canonical `raw-poke`, `cmd` and `unit` shapes; 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; the doc's `cmd`/`sub` block also passes full detailed and legacy checking at the prelude path with matching printed schemes. Backend validation, 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+The public prelude defines the approved generic `store` record `[init=S update=*]` and its builder, whose update argument is `$-([A S] S)` while the result exposes only `S`. Focused store coverage checks both exact schemes, the unchanged cart's closed main and derived generic poke/state gates, malformed-prelude controls and downstream structural imports. The local `+$ poke` remains an ordinary action mold. Store declaration checking and watch evidence are implemented; multi-action declarations, lowering and runtime execution are not.
14+
15+The public prelude also defines the exact `theme` mold: three space cords, five normal tone cords, `wide`, `lang` and `zone` cords, `(unit qath)` for `font`, and a unit containing the same five dark tone cords. The shared `type-theme` fixture fully checks the byte-identical real theme and its structural downstream import, including dark absent/present and malformed-field negatives. It does not implement contrast checking, rendering, routing or any other theme behavior.
16+
717Hoon `+$` 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.
818
919## 1a
1020
1121`add`, `dec`, `div`, `dvr`, `gte`, `gth`, `lte`, `lth`, `max`, `min`, `mod`, `mul`, `sub`.
1222
23+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.
24+
1325## 1c
1426
1527`bite` (mold), `bloq` (mold), `each`, `gate` (mold), `list`, `lone`, `lest`, `mold` (mold), `pair`, `pole`, `qual`, `quip`, `step`, `trap`, `tree`, `trel`, `unit`.
@@ -20,22 +32,22 @@ Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold
2032
2133`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
2234
23−The following is an audit of the Hoon 135 bodies, not a completed Jibb interface. The partial checker infers `fall` and `need`; the remaining written implementations have been parsed, but complete checker validation remains outstanding. Backend validation remains outstanding for all of them.
35+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`, `flit`, `hunt` and `mate`; the remaining written implementations have been parsed, but complete checker validation remains outstanding. Backend validation and jet recognition remain outstanding for all of them.
2436
2537| Name | Hoon behavior | Jibb status |
2638| --- | --- | --- |
2739| `biff` | Applies a gate returning a unit to a present value; absent stays absent. | Written |
2840| `bind` | Applies a gate to a present value and wraps the result; absent stays absent. | Written |
29−| `bond` | Calls a fallback trap for an absent unit, otherwise returns its value. | Missing |
41+| `bond` | Calls a fallback trap for an absent unit, otherwise returns its value. | Written and inferred as a curried gate; backend validation remains outstanding |
3042| `both` | Returns a unit of both values when both units are present. | Written |
3143| `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 |
3244| `clef` | Applies a gate returning a unit when both inputs are present; otherwise returns an absent unit. | Written |
33−| `drop` | Converts an absent unit to an empty list and a present unit to a singleton. | Written |
45+| `drop` | Converts an absent unit to an empty list and a present unit to a singleton. | Written; inferred by the partial checker |
3446| `fall` | Returns the value of a present unit or the supplied fallback. | Written; inferred by the partial checker |
3547| `flit` | Returns a gate that wraps a value only if it satisfies the predicate. | Written |
36−| `hunt` | Returns the only present unit or chooses between two present values with an ordering gate. | Missing |
48+| `hunt` | Returns the only present unit or chooses between two present values with an ordering gate. | Written with the ordering gate first, as `(hunt ord a b)`; both ordering outcomes and absent units are inferred |
3749| `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 |
38−| `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 |
50+| `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. | Written over `eq`; its generic payload retains the gate-free constraint |
3951| `need` | Extracts a present value and crashes on an absent unit. | Written; inferred by the partial checker |
4052| `some` | Wraps a value in a present unit. | Written |
4153
@@ -43,7 +55,7 @@ The following is an audit of the Hoon 135 bodies, not a completed Jibb interface
4355
4456`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`.
4557
46−The current prelude writes `snoc`, `lure`, `flop`, `join`, `levy`, `lien`, `murn`, `rear`, `reel`, `roll`, `skim`, `skip`, `snip`, `turn` and `weld`. `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` and `weld` using the validated prelude `list` mold; most other list helpers remain unsupported by that fragment. Backend validation remains outstanding for all of them.
58+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.
4759
4860## 2c
4961
@@ -93,6 +105,8 @@ The current prelude writes `snoc`, `lure`, `flop`, `join`, `levy`, `lien`, `murn
93105
94106`aftr`, `cork`, `corl`, `cury`, `curr`, `fore`, `head`, `same`, `succ`, `tail`, `test`, `lead`, `late`.
95107
108+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.
109+
96110## 2o
97111
98112`jar`, `jug`, `map`, `qeu`, `set`.
@@ -115,7 +129,7 @@ Hoon 135's `3g` section has exactly 12 exports: ten `+$` molds (`coin`, `dime`,
115129| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
116130| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
117131| `hair` | `[p=@ud q=@ud]`: a parsing position. |
118−| `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])]`. A callable Jibb value form remains open in question 18. |
132+| `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. |
119133| `nail` | `[p=hair q=tape]`: parsing input. |
120134| `pint` | `[p=[p=@ q=@] q=[p=@ q=@]]` in Hoon. The four positions accept atoms independently; Jibb `@` now has the same meaning. |
121135| `rule` | A gate mold `$-(nail edge)`; Hoon constructs its sample and product from the `nail` and `edge` molds. |
@@ -144,7 +158,7 @@ The following shapes can be written as Jibb declarations once their referenced p
144158 [%2 p=(list tank)]
145159```
146160
147−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 callable value form of `like` remains unresolved. The new `like` mold and `wonk` gate parse, but full type and backend validation remain outstanding.
161+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.
148162
149163## 4a
150164
@@ -154,6 +168,8 @@ The compiler-result `tone.hoon` has the three cases listed above; the qualified
154168
155169`at`, `cass`, `cuss`, `crip`, `mesc`, `runt`, `sand`, `sane`, `ruth`, `trim`, `trip`, `teff`, `taft`, `tuba`, `tufa`, `tuft`, `wack`, `wick`, `woad`, `wood`.
156170
171+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.
172+
157173## 4k
158174
159175`co`.
docs/prompts/milestone-2.md+12−10
@@ -49,7 +49,7 @@ And from the plan's Risks:
4949
5050## First steps
5151
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.
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 `raw-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`.
5353
5454 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.
55552. **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.
@@ -59,8 +59,9 @@ And from the plan's Risks:
5959The 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.
6060
6161**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.
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.
6363- `@` 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`.
6465- 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.
6566- 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.
6667- 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,12 +69,13 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
6869- 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 ~)`.
6970- 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]`.
7071- `!!` 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.
71−- `poke`, `ask` and `qath` are opaque, built only by derived gates, `pure` and application-path literals.
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+- `raw-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`. A store's local `poke` is an ordinary action mold.
7274- 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`.
7375
7476**Tags, `~`, numbers and cells wait for their context** (Grammar: Tag resolution, Literals by context)
7577- 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"".
76−- `|=%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 tagged at their head; a bare tag is always a value."
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."
7779- 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.
7880- "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.
7981- 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.
@@ -91,7 +93,7 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
9193
9294**Names and modules** (Grammar: Modules, Imports, Runes, Expressions; Core language: Programs and linking)
9395- "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").
94−- Molds and values have separate namespaces, "told apart by position": `todo-action.todo` is a mold and its constructor.
96+- Molds and values have separate namespaces, "told apart by position": `todo-action.todo` is a mold and `poke.todo` is its derived command helper.
9597- Local definitions may start any body, "visible to each other and the final expression".
9698- `/- 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.
9799- 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."
@@ -107,19 +109,19 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
107109- "Island data and models can't hold gates; the checker names the field."
108110
109111**API files, stores and derived gates** (overview: Agent APIs, Effects; Grammar: Modules)
110−- `/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 watching a request whose case has `scry=` has a type error.
111−- 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)`.
112−- 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.
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 API gives a generic `poke` command helper taking an action and reply, 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 local `+$ poke` is an ordinary action mold. A store exports a generic `poke` command helper 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.
113115
114116**The prelude** (overview: Prelude, Layout and styling, Links and URLs, Effects)
115117- 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.
116−- Signatures change where the Prelude table says: `clap` takes two units of one value type and a combining gate over that type; 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)`.
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)`.
117119- 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".
118120- 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.
119121- 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."
120122
121123**Errors**
122−- 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 such case tagged at its 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.
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.
123125- 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.
124126- "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.
125127- 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.
docs/reviews/2026-11-02-questions.mdnew file+342
@@ -0,0 +1,342 @@
1+# Questions from the 2026-11-02 review
2+
3+Every decision that [the review](2026-11-02-repo-review.md) raises, with options. Each **Answer** is prefilled with the recommended option, so only the ones you disagree with need changing. A-numbers point into the review's appendix.
4+
5+Questions 16 to 28 are language or spec rulings. Under the ground rules they are @iko's to make and are recorded in decisions.md before the code changes.
6+
7+## Scope and process
8+
9+**1. Where should the review land?** It is on `claude/project-thread-7prdcx` now.
10+
11+- a) Push it to `master`, as development.md's "push straight to master" rule says.
12+- b) Open a pull request.
13+- c) Leave it on the branch.
14+
15+**Answer:** a
16+
17+**2. What should be done first?**
18+
19+- a) The eight "fix first" bugs.
20+- b) The simplifications, starting with the test runner.
21+- c) The docs cleanup.
22+- d) Nothing more for now.
23+
24+**Answer:** a, then c
25+
26+**3. How should fixes land?**
27+
28+- a) Commits straight to `master` once every check passes, as development.md says.
29+- b) One pull request per theme.
30+- c) A branch you merge yourself.
31+
32+**Answer:** a
33+
34+**4. Should a fake ship be set up in the cloud container**, so the ship checks run too? That needs the brass pill from GitHub LFS and a few minutes to boot.
35+
36+- a) Yes, before any fix that touches tools/ship, the desks or the mark.
37+- b) No, eval checks are enough.
38+
39+**Answer:** a
40+
41+## Direction
42+
43+**5. How should the checker grow from here?** (A121)
44+
45+- a) Build the general core first: union-find bindings with levels, a deferred-constraint queue and Maranget's usefulness check, with `main = (program …)` checked as an ordinary application.
46+- b) Keep adding recovery paths until milestone 2's examples pass, and refactor after.
47+- c) Both: make today's recovery fall back to ordinary inference now, and plan the core as the next milestone-2 task.
48+
49+**Answer:** c
50+
51+**6. Should the partial `golden-types` report be rendered from the full checker's per-definition results**, so there is one pipeline? (A122) About 283 `types.txt` outputs would change once.
52+
53+- a) Yes.
54+- b) No, keep the two pipelines.
55+
56+**Answer:** a
57+
58+## Checker fixes
59+
60+**7. How should the keyed-view screen be fixed?** (A119, A38)
61+
62+- a) Run ordinary inference first, and recovery only for components it leaves unresolved. Some todo diagnostics may change.
63+- b) Keep recovery first, and fall back to ordinary inference when it declines.
64+
65+**Answer:** a
66+
67+**8. Should the narrow initializer recovery go?** Deleting the null-sample gate and `program-init-context` (about 140 lines) lets the general path handle reordered models, and the seven negative init fixtures still fail. (A39)
68+
69+- a) Yes, once the todo, store and program tests pass.
70+- b) No.
71+
72+**Answer:** a
73+
74+**9. How should an imported Hoon `(unit T)` be handled?** (A10)
75+
76+- a) Translate it to the prelude's `unit` union, passing the prelude template into the import bridge.
77+- b) For now, make it fit as unknown, so it fails closed instead of giving a false error.
78+
79+**Answer:** a
80+
81+**10. Should printed types say `ask` and `qath` instead of `ask.internal` and `qath.internal`?** Two expected outputs change. (A134)
82+
83+- a) Yes.
84+- b) No.
85+
86+**Answer:** a
87+
88+**11. Should every `?-` branch kind join its arm results by one rule:** unify, and if that fails, widen to an explicitly present parent aura or `@`? Then `?- b %.y n %.n 0` with `n=@ud` checks. (A133)
89+
90+- a) Yes.
91+- b) No, keep the per-kind rules.
92+
93+**Answer:** a
94+
95+**12. Should top-level resolution make one pass in dependency order**, keeping the fixpoint as a fallback, with a 400-definition timing check added to the suite? (A135)
96+
97+- a) Yes.
98+- b) Only the fix.
99+- c) No.
100+
101+**Answer:** a
102+
103+**13. Should the checker keep the errors it already finds?** That means the real error inside a local `++`, the name of the failing definition, the API reasons, and a definite error for a derived-name clash. Boundary strings that tests lock in would change. (A12, A40, A24)
104+
105+- a) Yes.
106+- b) No.
107+
108+**Answer:** a
109+
110+**14. Should the 26-variable printer limit stop gating which modules check?** The printer would print `T27` and on, as it already can. (A124)
111+
112+- a) Yes.
113+- b) No.
114+
115+**Answer:** a
116+
117+**15. Should the 32,768-node freshness scan be replaced** by a fresh-ID high-water mark computed once, with `%recursive` treated as a leaf? (A37)
118+
119+- a) Yes.
120+- b) Keep the scan and document its budget.
121+
122+**Answer:** a
123+
124+## Language and spec rulings
125+
126+**16. Which auras may a term literal fit?** Today `^- @tas %1.000` and `^- @tas %&` are accepted and `^- @ud %1.000` is rejected, the opposite of Hoon. grammar.md:141 supports the code; grammar.md:29 and "Literals: exactly Hoon's" don't. (A20)
127+
128+- a) Follow Hoon: a term literal fits its own aura family, so `%1.000` is `@ud` and `%&` is `?`.
129+- b) Keep grammar.md:141 as written.
130+
131+**Answer:** a
132+
133+**17. May a name term fit `@t`, as `@tas` nests in `@t` in Hoon?** grammar.md:141 lists only `@tas`, `@ta`, `@` and `*`. (A20)
134+
135+- a) Yes.
136+- b) No.
137+
138+**Answer:** a
139+
140+**18. May a gate fit `*`?** core-language.md says a function isn't a noun, but the prelude's `element` erases gates into `*`. (A23)
141+
142+- a) Yes: say in the spec that `*` may hold gates.
143+- b) No: design a typed erasure first.
144+
145+**Answer:** a
146+
147+**19. Where should `[]` and `m()` be rejected?** Both are decided errors. Today the parser accepts them, and the checker calls `[]` "not supported". (A6, A100)
148+
149+- a) In the parser, at the closer, with new golden cases.
150+- b) In the checker, as definite errors.
151+
152+**Answer:** a
153+
154+**20. Is `[a=@ud [a=@t b=?]]` one record or two scopes?** Hoon treats it as flat, and field access already does. Today the duplicate `a` is accepted and `a.x` is "ambiguous". (A30)
155+
156+- a) One record: the duplicate is an error.
157+- b) Two scopes, as compiler.md says now.
158+
159+**Answer:** a
160+
161+**21. Should `/% %foo` together with `++ foo 1` be allowed?** `/%` binds only a mold, and molds and values have separate namespaces (grammar.md:94 and :102), but the scope check rejects it. (A25)
162+
163+- a) Yes.
164+- b) No.
165+
166+**Answer:** a
167+
168+**22. Should a `?-` arm that matches no remaining case be a definite error** ("arm matches no case"), as grammar.md:184 implies, instead of "not supported"? (A15)
169+
170+- a) Yes.
171+- b) No.
172+
173+**Answer:** a
174+
175+**23. Should `(mop K V)` carry its comparator,** so that `get.on gth` on an `lte` mop is an error? Neither Hoon nor decisions.md:39 does this. (A55)
176+
177+- a) No, match Hoon.
178+- b) Yes.
179+
180+**Answer:** a
181+
182+**24. Should Hoon's `each` mold be renamed to `each.hoon`**, since the prelude also has the element gate `each`? They live in separate namespaces. (A64)
183+
184+- a) No, keep both.
185+- b) Yes.
186+
187+**Answer:** a
188+
189+**25. When should `eq` and the gate-free type-variable constraint be built?** Both are decided, neither exists, and no doc tracks them. (A98)
190+
191+- a) In milestone 2.
192+- b) Later, and list them as outstanding.
193+
194+**Answer:** a
195+
196+**26. Which Hoon unions should the importer learn?** Today `$%` with `%&`, `%|` or `%0` tags, `(each a b)` and `json` all fail, though the spec's import table lists them. (A50)
197+
198+- a) The non-`%tas` tags now, then `each` and `json` as catalog entries.
199+- b) Only the tags.
200+- c) Later.
201+
202+**Answer:** a
203+
204+**27. Should the `%jibb` mark keep dropping the final newline on a `%txt` round trip**, as `%hoon` does? (A61)
205+
206+- a) Keep it, like `%hoon`.
207+- b) Preserve the newline, and change tools/ship's assertion.
208+
209+**Answer:** a
210+
211+**28. Should the printer flatten `[a [b c]]` to `[a b c]` and print named molds by name**, such as `theme` and `item.todo`? (A136)
212+
213+- a) Yes.
214+- b) No.
215+
216+**Answer:** a
217+
218+## Tests and tooling
219+
220+**29. Should one runner over the `tests/lib` test arms replace the 49 `tools/type-*-test` scripts and `importer-test`?** A prototype ran them in 681 s instead of 2,591 s. The `my-app` byte guards would move to a manifest. (A82, A120)
221+
222+- a) Yes.
223+- b) No.
224+
225+**Answer:** a
226+
227+**30. Should there be one `tools/check` command, and CI?** (A92, A96)
228+
229+- a) `tools/check` now, and a CI job for the eval checks now.
230+- b) `tools/check` now, CI at milestone 7 as planned.
231+- c) Neither.
232+
233+**Answer:** b
234+
235+**31. How should the 28 copies of `my-app` files under `tests/` be handled?** (A108, A109)
236+
237+- a) Map `my-app` into the `jibb-dev` desk outside `/tests` and read it directly, removing the copies.
238+- b) Keep the copies, and guard them all from one manifest.
239+
240+**Answer:** a
241+
242+**32. Should the generated `tests/lib/jibb.hoon` (3,949 lines) stop being committed?** Assembly drops it and regenerates it anyway. (A83)
243+
244+- a) Yes, and add it to .gitignore.
245+- b) No.
246+
247+**Answer:** a
248+
249+**33. Should the importer's test fixtures (about 550 lines) move out of `jibb-import.hoon`**, which app desks vendor, into `tests/lib/jibb-import.hoon`? (A52)
250+
251+- a) Yes.
252+- b) No.
253+
254+**Answer:** a
255+
256+**34. Should the import-only fixtures move off `my-app`** (`sur/import-fixture.hoon`, `mar/label.hoon`, the Tlon probe) to a fixtures desk? (A113)
257+
258+- a) Yes.
259+- b) No.
260+
261+**Answer:** a
262+
263+**35. Should the five `tools/hoon` checks that exit 0 whatever they print become test arms?** (A91)
264+
265+- a) Yes.
266+- b) No.
267+
268+**Answer:** a
269+
270+**36. Should type-checker golden cases keep their full token and tree outputs?** They are 73% of all parser golden lines. (A94)
271+
272+- a) Keep them: each stage's output is compared.
273+- b) Let type cases opt out.
274+
275+**Answer:** a
276+
277+**37. Should the tests keep calling internal library arms (137 of them)?** (A126)
278+
279+- a) Keep them for now, and revisit after the checker core changes.
280+- b) Move them behind a small public facade.
281+
282+**Answer:** a
283+
284+**38. Should `my-app` keep the failing buttons example and the doc theme's static font?** Milestone 4 will treat both as errors. (A112)
285+
286+- a) Keep them through milestone 2, and list it as a milestone-4 open question.
287+- b) Move the error example out now.
288+
289+**Answer:** a
290+
291+**39. Should every vendored package keep going into every desk?** (A117)
292+
293+- a) Yes, as designed.
294+- b) Make it per desk.
295+
296+**Answer:** a
297+
298+**40. Should `tools/hoon` get a `--no-debug` mode** for timings, with the docs' figures re-measured? Every eval runs with `!:`, which makes checker work 2.2 to 2.6 times slower. (A137)
299+
300+- a) Yes.
301+- b) No.
302+
303+**Answer:** a
304+
305+## Docs and repository
306+
307+**41. Should status.md become a capability table** (area, status, the test that proves it) plus a short list of gaps, with the history table replaced by `git log`? (A97, A95)
308+
309+- a) Yes.
310+- b) Only fix the contradictions.
311+
312+**Answer:** a
313+
314+**42. Until the Claude design doc is synced, which spec wins?** (A104)
315+
316+- a) The repository copy, with a "synced" column in decisions.md.
317+- b) The Claude doc, as development.md says now.
318+
319+**Answer:** a
320+
321+**43. Who syncs the Claude design doc with the repository's decisions?**
322+
323+- a) Me, if you give me edit access to it.
324+- b) @iko.
325+- c) Leave it for now.
326+
327+**Answer:** b
328+
329+**44. Should open-questions.md hold only open questions**, with settled ones moved to decisions.md? (A103)
330+
331+- a) Yes.
332+- b) No.
333+
334+**Answer:** a
335+
336+**45. Which licence should the repository have?** It has none, and doesn't state the licences of `vendor/` or the Tlon fixtures. (A107)
337+
338+- a) MIT, like urbit/urbit.
339+- b) Another licence.
340+- c) None: keep it private.
341+
342+**Answer:** a
docs/reviews/2026-11-02-repo-review.mdnew file+294
@@ -0,0 +1,294 @@
1+# Repository review, 2026-11-02
2+
3+A review of the whole repository at [`4bf477e`](https://github.com/iko-soy/jibb/commit/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36), asked for in the project chat: look for issues and gaps, and for what could be simpler or more elegant.
4+
5+How it was done: ten reviewers each took one area (the lexer and parser, three slices of the checker, the importer with the mark and prelude, the Python tooling, the test harness, the docs, the example desks, and the architecture as a whole). A second reviewer then tried to refute every finding, by reading the code and by reproducing it with `tools/hoon` where that was cheap. A final pass looked for what the ten had missed. Every eval-based check in [development.md](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L124-L194) was also run, with vere 4.6 built from nixpkgs.
6+
7+Four commits reached `master` while the review ran (`2d74861` to `5ccd150`). The fix-first items 1 to 3 were rechecked at `5ccd150` and still hold there. Line numbers below are links into `4bf477e`. Findings are numbered A1 to A137 in the [appendix](#appendix-every-finding).
8+
9+## Summary
10+
11+- **Everything that can run without a ship passes.** All 60 eval checks pass, including 660 of 660 golden cases. The ship checks were not run, because this container has no fake ship.
12+- **137 findings survived verification: 2 high, 31 medium and 104 low.** 75 held exactly as reported and 62 held with corrections to scope, numbers or severity. None was refuted outright. Most of the low ones are polish.
13+- **The real bugs are in the full checker, and they reject valid code.** A program that is one step away from the todo island's exact shape is rejected, an imported Hoon `(unit T)` doesn't fit the prelude's `unit`, and private prelude names leak into printed types. None of them accepts a wrong program.
14+- **The test and docs scaffolding is heavier than it needs to be.** The push checklist is about 65 commands and 49 minutes. 49 copy-paste test scripts rebuild the library 81 times. `my-app` files are copied 28 times under `tests/`, several with no guard. `status.md` is a 59 KB log that contradicts itself on whether the cart store checks.
15+- **The checker grows one example at a time.** Each new example gets a narrow recovery path, a script, a fixture folder and a paragraph of docs, where a few shared mechanisms would remove code. That trend is the main thing worth deciding on (see [Direction](#direction)).
16+
17+## Check run
18+
19+| Check | Result | Time |
20+| --- | --- | --- |
21+| `tools/golden` | 660 of 660 pass | 74 s |
22+| 49 `tools/type-*-test` scripts and `tools/importer-test` | All pass | 2,591 s together. The slowest are `type-todo-full-test` (581 s) and `type-deferred-prepared-test` (411 s) |
23+| `tools/testdata/selftest` | 22 checks, 0 failed | 141 s |
24+| `tools/doc-blocks docs/spec` | 14 `jibb` blocks, 14 `doc-*` cases, none missing | under 1 s |
25+| `tools/ship gen-tests --check` | Up to date, 660 cases | under 1 s |
26+| The 5 `tools/hoon` checks (`check-spans-test`, `itype-unify-test`, three reference files) | Print the expected values. They exit 0 whatever they print (A91) | about 23 s each |
27+| `tools/testdata/clay-fixtures-selftest` | Pass | 4 s |
28+| `tools/ship test`, `check-commit`, `clay-fixtures`, `ship-selftest` | Not run: they need a fake ship | |
29+
30+The checks ran three at a time on four CPUs and took 2,924 s of check time in all. Every eval rebuilds the 15,172-line library, which now takes about 22 s, not the 8 s the docs quote (A102).
31+
32+## Fix first
33+
34+These are the bugs and gaps with the most effect on users of the checker or the tools. Each was reproduced by the second reviewer.
35+
36+| # | Problem | Evidence | Fix | Refs |
37+| --- | --- | --- | --- | --- |
38+| 1 | **Valid programs are rejected when their view has one keyed `each (turn …)` site.** The screen that skips "doomed" ordinary inference also skips attempts that would succeed | A program whose `init` is ``^- model [0 input `"x"]`` is rejected with "module definitions need unsupported inference". Listing the same `each` site twice turns the screen off, and the same program then passes. [`add-supported-defs-core`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10293) skips every name from [`program-recovery-names`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12997-L13038). Only the [recovery chain](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14152-L14173) can add them back, and its init recoveries accept only a tuple ending in `~` or a `~` sample ([13667](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13667), [13595](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13595)) | Run ordinary inference first, then recover only the components it left unresolved. Separately, deleting the null-sample gate at 13595 makes reordered models pass and keeps all seven negative init fixtures failing, which removes about 140 lines | A119, A38, A39 |
39+| 2 | **An imported Hoon `(unit T)` does not fit the prelude's `unit`.** `fall`, `need` and `^- (unit @t)` on an imported unit give definite "do not unify" errors | [`import-to-itype`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6339-L6350) builds `[%collection %unit …]`, while the prelude's unit is an origin-tagged union ([8245-8255](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8245-L8255)). [`itype-fit-inner`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5437-L5439) answers `%bad`. No fixture passes an imported unit to `fall` or `need` | Translate Hoon `unit` to the prelude's union, as `list` already shares its representation. At the least, make a collection against a prelude-origin union fit as `%unknown`. Add a golden case | A10 |
40+| 3 | **Printed types name the private prelude module**, as `(ask.internal @ud)` and `(unit qath.internal)` inside every `page` and `theme` type | [`prelude-label`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11423-L11436) relabels only a mold's top level. Two expected outputs lock the leak in: [types-prelude-ui/types.txt:85](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/golden/types-prelude-ui/types.txt#L85) and [jibb-theme.hoon:66](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-theme.hoon#L66). [grammar.md:104](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/grammar.md#L104) says the prelude does not expose its internal module | Relabel internal origins with the public re-export name while preparing the prelude | A134 |
41+| 4 | **`?-` branches join their results by three different rules.** `?- b %.y n %.n 0` with `n=@ud` fails with "branch widening is not supported", even under `^- @ud`. A unit branch can't widen, and a union branch compares types with `!=` | Loobean pre-check at [8518](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8518), plain unify for unit and list at [7671](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7671), syntactic inequality for unions at [7841](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7841) and [7943](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7943) | One join helper for every branch kind: unify, then widen to an explicitly present parent aura or `@` | A133 |
42+| 5 | **Diagnostics the checker already has are thrown away** | An error inside a local `++` becomes the site-less "local definitions need unsupported inference" ([7236-7258](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7236-L7258)). Full-check failures don't name the definition, and the API branch drops reasons it computed ([14087](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14087), [14092](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14092)). A derived-name clash, an error in the spec, is reported as "unsupported". The full module check reports a plain `@t`/`@ud` overlap as "unsupported" while the partial report proves it ([11340-11351](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11340-L11351)) | Thread a reason, or the failing definition's name, through the resolver and recoveries. Use one overlap witness for both paths | A12, A40, A24 |
43+| 6 | **Forward references cost near-cubic time.** A 400-definition chain written top-down takes about 26 s of checker work, against about 1 s written bottom-up. The brief asks for "a 2,000-line module in seconds" | [`resolve-groups-core`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10309-L10328) is a fixpoint that resolves one link per pass and re-infers every unresolved definition each time. The dependency-ordered SCCs at [10318](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10318) are used only for cycles | Resolve in one pass over the components already computed, keeping the fixpoint as a fallback. Compute `program-recovery-names` once per module, not per definition per pass | A135, A33 |
44+| 7 | **`tools/ship` and `tools/golden` bugs** | `tools/ship --pier /abs/path stop` can SIGTERM itself, because [`processes()`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L285-L305) takes any process naming the pier for the king. The zero-byte `.txt` sync failure that [development.md:206](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L206) blames on the ship is a `MANIFEST` and `verify()` bug in `tools/ship` ([693](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L693), [1438](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1438)). When a batch dies, `tools/golden` reruns all 660 cases one by one, each rebuilding the library, and Ctrl-C doesn't stop the queue ([363-396](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L363-L396)) | Identify the king from `.vere.lock`. Test `%txt` before `?@` in `MANIFEST`. Bisect failing batches and cancel queued futures | A65, A66, A67 |
45+| 8 | **A trailing `\` in a string says "a control character"**, and the lexer's character rules have no tests | [`+bad-char`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1637-L1643) treats the line feed as a control character. No golden source holds a CR, a control byte or any byte at or above 0x80, so UTF-8 column counting and about 20 hints are untested | Make `+bad-char` return `~` for 10 (verified to give the end-of-file messages). Add `lex-char-*` and `lex-utf8-*` cases | A1, A3 |
46+
47+Medium gaps that fail closed, so nothing wrong is accepted, but common code is refused:
48+
49+| Gap | Refs |
50+| --- | --- |
51+| A union reached through two import faces stops matching once one of its cases holds another named union, because cases are compared with their display labels ([4859](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4859)) | A11 |
52+| Union matches on cases holding an imported `map`, `set`, `qeu`, `mop`, `jar` or `jug` fail, because inhabitation and gate-free proofs know only `list` and `unit` ([4793](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4793), [5785](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5785)) | A13 |
53+| An imported bare `@`, and auras such as `@uw`, are rejected, and the aura whitelist is written twice ([6326](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6326-L6329), [6198-6209](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6198-L6209)) | A14 |
54+| An undocumented 32,768-node freshness scan, run in up to six recovery arms, turns recovery off silently. The prelude alone uses 57% of it, and any imported recursive type makes it decline ([dg-scan](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14512-L14539)) | A37 |
55+| The importer accepts only `%tas` head tags and knows no standard unions, so `$%` with `%&`, `%\|` or `%0` tags, `(each a b)` and `json` fail, although the spec's import table lists them ([jibb-import.hoon:104-110](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L104-L110)) | A50 |
56+| The full todo, page and API checks read five copies of the todo `/sur` and marks that nothing compares with `my-app`. Changing `my-app/sur/todo.hoon` leaves `type-todo-partial-test` passing | A109, A81 |
57+| `eq` is decided but missing from the prelude, the checker has no gate-free type-variable constraint, and no doc tracks either | A98 |
58+
59+## Simplify
60+
61+Each row was checked to be behaviour-preserving, or the table says what it would change.
62+
63+| Opportunity | Today | Proposed | Payoff | Refs |
64+| --- | --- | --- | --- | --- |
65+| One test runner | 49 `tools/type-*-test` scripts and `importer-test`, 2,154 lines. Each one slices a `tests/lib` file at `'\n\|%\n'` or at arm names, rebinds its fixtures under new names, and starts its own eval. Several keep Python copies of the check lists in the ship arms, so eval and ship run different wrappers | One runner that reads each `tests/lib/jibb-*.hoon` header, binds `/+` and `/*` as Ford would, and runs every `test-` arm under `mule`. Keep the `my-app` byte guards, diffs and `--update` somewhere else | A 90-line prototype ran all 55 ship test arms under eval in 681 s, against 2,591 s for the scripts, and removes the eval/ship drift | A82, A120, A80, A84 |
66+| One check command | About 65 commands, kept in four lists that disagree. `status.md` misses 18 and the README names 27 of the 49 type tools | `tools/check`, with `--ship` for the ship steps. Point every doc at it | One list, and a base for the CI that milestone 7 plans | A96, A92 |
67+| One source of `my-app` | 28 byte copies of 13 `my-app` files, plus 5 marks with the `/-` line removed. Eight tools hard-code their own guard pairs, and several copies have no guard | Map `my-app` into the `jibb-dev` desk outside `/tests` and read it directly, or keep one manifest checked by one tool | Removes the copies, and the drift they allow | A108, A128, A81, A109 |
68+| One checker pipeline | The partial report ([`golden-types-in-context-core`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14385-L14510)) repeats the finalization of [`add-supported-result`](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10266-L10286) and runs none of the kind checks. The todo island gets a partial report but passes the full check | Have `infer-jibb-file-detailed` return a scheme or an error per definition, and render the report from that | Finalization in one place, and typed goldens that test the real checker | A122, A46, A42 |
69+| Program recovery | Six recovery arms repeat a preamble and a 25-35 line tail, and the copies have drifted. Four copies of the `main` walk | A `recover-def` helper and one `main-call-args` walk | A few hundred lines | A48, A39 |
70+| AST and type walkers | 56 arms, about 650 lines, in the `scope-*`, `dependency-*`, `duplicate-*`, `reserved-proj-*`, `*-has-hole` and `program-view-sites-*` families | One `node-kids` enumeration and a fold. The printers and `infer-fragment` still need their own dispatch | Fewer places to edit per new node kind | A129, A32, A21 |
71+| `%gate` and `%gate-wide` | Identical fields. 40 uses in the checker, 10 `\|(?=(%gate …) ?=(%gate-wide …))` tests and two duplicated 9-line branches | `?=(?(%gate %gate-wide) -.x)`, or one node with a `wide` flag | Noise removed without changing goldens | A123, A34 |
72+| Dead code | Five unreferenced arms and a type (A26). `one-request-interface-source`, and the narrow API branch, which gives an identical interface for `blog.jibb` (A44). `golden-types-with-modules`. The importer's `+fixture-test`. The committed, generated `tests/lib/jibb.hoon` (3,949 lines), which assembly drops and regenerates. `my-app` assembly skipping a `jibb-dev/tests` that doesn't exist | Delete them, and drop `gen-tests --check` from the checklist | Less to read and keep current | A26, A31, A44, A42, A51, A83, A111 |
73+| Test code in shipped libraries | About 550 lines, nearly a quarter of `jibb-import.hoon`, are fixtures used only by tests, and app desks vendor the file | Move them into `tests/lib/jibb-import.hoon`, as `jibb-api-paths.hoon` already does | A smaller vendored library | A52, A127 |
74+| Named state and limits | `istate`'s 27 fields are built positionally at 10 sites, `add-supported-defs-core` takes 19 positional arguments, and budgets are literals (256 ×32, 64 ×18, 32,768 ×13). The printer's 26-variable cap also rejects modules with 27 type variables | An `icontext` record with a `fresh-state` constructor, a `limits` core, and one `deferred-eligible` arm in place of three copies | Safer edits, and no printer limit on what checks | A28, A125, A124 |
75+| Parser helpers | The `?(` check is a backward token walk at 12 call sites. `+in` and `+fail` shadow the standard library, which costs 16 `in:..zuse` workarounds | One lexer branch for `?(` (verified to keep every error column). Rename `+in` and move the `+fail*` helpers into `+parser` | Smaller parser, no shadowing | A7, A8 |
76+
77+## Direction
78+
79+The checker is growing as narrow recovery paths fitted to the example files: the todo island, the cart store, the theme. In the 50 commits this clone holds, `jibb.hoon` grew by 6,199 lines, and the seven commits that add a kind of module added 1,816 of them. There are now three representations of recursive types (`%recursive`, `%jrec`, `%grec`), about 50 branch and pattern arms, and 257 strings that report something as "unsupported" or "not supported". Each slice also brings a test script, a fixture folder and a paragraph in `compiler.md`, which is now 75 KB. Fix-first item 1 shows the cost: a program one edit away from the todo's shape is rejected.
80+
81+The milestone-2 brief suggests, without requiring it, a different core: union-find bindings with levels, a queue of deferred constraints, and Maranget's usefulness check for matches ([milestone-2.md:130-142](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prompts/milestone-2.md#L130-L142)). With it, `main = (program init update view subs)` would be an ordinary application whose sample unifies with its components, and much of the 1,180 lines of program recovery could go. Whether to build that core before adding the next slice is the main decision this review raises. (A121)
82+
83+## Docs
84+
85+| Doc | Problem | Fix | Refs |
86+| --- | --- | --- | --- |
87+| [status.md](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md) | 59 KB, with a 16,412-character paragraph at line 68 and a 115-row table that repeats `git log`. It says the cart store passes ([54](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L54)) and that it fails closed ([68](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L68)). Both are true, for different entry points, and the doc says neither | A capability table (area, status, the test that proves it), a short list of known gaps, and milestone commits instead of the history table | A97, A95 |
88+| Check lists in README, development.md and status.md | They disagree. [development.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L3) says the README describes each tool in full, but only development.md's table is complete | One `tools/check`, and one list | A96 |
89+| [compiler.md](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md) and the [`jibb.hoon` header](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1-L36) | Both still say milestone 1, and the chapter map leaves out `%union-analysis`, about 4,700 lines. The program-recovery chain is described inaccurately: the "doomed attempts" the screen skips can succeed | Update the header, the chapter map and the recovery paragraph | A60, A101, A131, A41 |
90+| The library's design notes | Sections 2.6, 3 and 4.2 don't mention the `_` type hole or the `?(` hint | Add both | A2 |
91+| [open-questions.md](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/open-questions.md) | Mostly settled questions, against its own rule. Question 6 is stale. `eq` reads as implemented | Move settled ones to decisions; mark `eq` as decided, not built | A103, A100, A98 |
92+| decisions.md, prelude-inventory.md | The core-language row still says "proposed". The inventory lists shapes as future work that now exist | Update | A99, A54, A105 |
93+| Timings | "About 8 s" to build the library is now about 22 s. Every figure is measured with `!:`, which makes checker work 2.2 to 2.6 times slower than on a ship, and no doc says so | Update the figure, and say which mode each figure uses | A102, A137 |
94+| Licence | No LICENSE, and the licences of `vendor/` and the Tlon fixtures are unstated | Add a LICENSE and a line in the README | A107 |
95+
96+## Not covered
97+
98+The ship checks weren't run, so ship-only behaviour, such as `tools/ship test`, `check-commit` and `clay-fixtures`, is reviewed from the code only. The spec in `docs/spec/` was checked for internal consistency and against the code, not as language design. The findings come from targeted reading and probes, not a line-by-line audit of all 15,172 lines.
99+
100+## Appendix: every finding
101+
102+"Confirmed" means the second reviewer reproduced the finding as stated. "Partly" means the core holds but the scope, numbers or severity were corrected; the title shown is the corrected one. Severity is the second reviewer's, judged for a project in the middle of milestone 2. Some problems were found independently by two reviewers and appear in both areas, for example A38 and A119, A82 and A120, A108 and A128.
103+
104+### Lexer, parser and printers (`jibb.hoon` 1–4597)
105+
106+| # | Finding | Severity | Verdict | Kind | Where |
107+| --- | --- | --- | --- | --- | --- |
108+| A1 | A `\` or `\X` escape cut off by the end of the line reports "a control character", which contradicts 2.2 and differs from the same text at the end of the file | Medium | Confirmed | bug | [jibb.hoon:1609-1625](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1609-L1625), [jibb.hoon:1637-1643](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1637-L1643), [jibb.hoon:105-110](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L105-L110) and 1 more |
109+| A2 | Design notes 2.6, 3 and 4.2 never mention the `_` type hole or the `?(` union hint; the header still says milestone 1 | Medium | Confirmed | inconsistency | [jibb.hoon:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1), [jibb.hoon:162-231](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L162-L231), [jibb.hoon:489-505](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L489-L505) and 7 more |
110+| A3 | Section 2.2's CR/control/non-ASCII errors, UTF-8 column counting and about 20 lexer and parser hints have no golden case | Medium | Confirmed | test-gap | [jibb.hoon:1637-1645](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1637-L1645), [jibb.hoon:1630](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1630), [jibb.hoon:1709-1712](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1709-L1712) and 3 more |
111+| A4 | +read-string's +doomed call, and the notes' "or the } of an interpolation" case, can never trigger | Low | Confirmed | dead-code | [jibb.hoon:3426-3431](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L3426-L3431), [jibb.hoon:2953-2975](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L2953-L2975), [jibb.hoon:651-657](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L651-L657) and 2 more |
112+| A5 | Left-out Hoon runes get the doc's reason only sometimes, and second-character messages override 2.2's character errors | Low | Confirmed | inconsistency | [jibb.hoon:238-240](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L238-L240), [jibb.hoon:270-274](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L270-L274), [jibb.hoon:1317-1324](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1317-L1324) and 3 more |
113+| A6 | `[]` in an expression reaches the checker as "not supported", not the decided error, and open question 6 is stale; the parser's acceptance of `[]`/`m()` is a documented milestone-1 choice | Low | Partly | gap | [jibb.hoon:3492-3493](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L3492-L3493), [jibb.hoon:9400](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9400), [jibb.hoon:9440](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9440) and 4 more |
114+| A7 | The `?(` check is a backward token walk repeated at 12 parser call sites, where one lexer branch would do (verified to keep every column) | Low | Partly | simplification | [jibb.hoon:3144-3153](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L3144-L3153), [jibb.hoon:1337-1345](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1337-L1345), [jibb.hoon:3164](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L3164) and 2 more |
115+| A8 | Renaming +in and moving the +fail* helpers into +parser would remove both standard-library shadowings, the 16 `in:..zuse` workarounds and the `file` forwarders | Low | Partly | simplification | [jibb.hoon:2368-2572](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L2368-L2572), [jibb.hoon:2727-2759](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L2727-L2759), [jibb.hoon:2892-2902](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L2892-L2902) and 3 more |
116+| A9 | Path-segment loops, open-mold-line loops and item/line name branches are near copies; some proposed merges are not clearly simpler | Low | Partly | duplication | [jibb.hoon:3087-3105](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L3087-L3105), [jibb.hoon:3375-3391](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L3375-L3391), [jibb.hoon:4048-4064](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4048-L4064) and 6 more |
117+
118+### Checker core (`jibb.hoon` 4597–8364)
119+
120+| # | Finding | Severity | Verdict | Kind | Where |
121+| --- | --- | --- | --- | --- | --- |
122+| A10 | An imported Hoon (unit T) is a %collection, but the prelude unit is an origin-tagged union, so fall, need and (unit T) casts give false definite errors | High | Confirmed | bug | [jibb.hoon:6339-6350](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6339-L6350), [jibb.hoon:5437-5439](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5437-L5439), [jibb.hoon:8245-8255](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8245-L8255) and 3 more |
123+| A11 | Same-origin, non-generic unions are compared by raw case equality, so a union reached through two import faces fails once a case contains a relabelled nested union | Medium | Confirmed | bug | [jibb.hoon:4857-4860](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4857-L4860), [jibb.hoon:5415-5418](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5415-L5418), [jibb.hoon:6553-6582](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6553-L6582) and 1 more |
124+| A12 | Definite errors inside local `++` definitions are deferred and then replaced by the site-less 'local definitions need unsupported inference' | Medium | Confirmed | gap | [jibb.hoon:7236-7258](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7236-L7258), [jibb.hoon:7284-7300](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7284-L7300) |
125+| A13 | Union inhabitation and gate-free proofs only recognize list/unit collections, so union matches on cases holding imported map/set/qeu/mop/jar/jug fail closed | Medium | Confirmed | gap | [jibb.hoon:4792-4794](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4792-L4794), [jibb.hoon:5784-5788](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5784-L5788), [jibb.hoon:6342-6350](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6342-L6350) |
126+| A14 | The import bridge rejects bare `@` and other unsigned auras, and recursive molds with `?` or `*` fields; the aura whitelist is duplicated | Medium | Confirmed | gap | [jibb.hoon:6326-6329](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6326-L6329), [jibb.hoon:6198-6209](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6198-L6209), [jibb-import.hoon:1522-1526](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1522-L1526) |
127+| A15 | A ?- arm that matches no remaining case is reported as 'union pattern is not supported' instead of a definite unreachable-arm error | Low | Confirmed | gap | [jibb.hoon:7830-7833](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7830-L7833), [jibb.hoon:7869-7872](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7869-L7872), [jibb.hoon:7918-7921](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7918-L7921) and 1 more |
128+| A16 | Variable-kind refinement relies on self-bindings that itype-walk special-cases in six copied arms (plus a seventh copy at 14523) | Low | Confirmed | robustness | [jibb.hoon:4693-4727](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4693-L4727), [jibb.hoon:4873-4876](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4873-L4876), [jibb.hoon:5939](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5939) and 1 more |
129+| A17 | Union-branch coverage loop exists in three copies; list/unit branch, list-item, standard-list and fit-and-diagnose code is also duplicated, and one copy has drifted | Low | Confirmed | duplication | [jibb.hoon:7806-7945](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7806-L7945), [jibb.hoon:7583-7673](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7583-L7673), [jibb.hoon:7477-7519](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7477-L7519) and 1 more |
130+| A18 | Dead fuel and sub parameters, an always-true unify, and two dead find-imported-mold lines | Low | Confirmed | dead-code | [jibb.hoon:5089-5111](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5089-L5111), [jibb.hoon:5656-5730](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5656-L5730), [jibb.hoon:6439-6440](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L6439-L6440) |
131+| A19 | The record-width guard counts faced spine entries, so a flat faced tuple cast to a record with a faced nested tail is refused as unsupported | Low | Confirmed | gap | [jibb.hoon:5373-5377](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5373-L5377), [jibb.hoon:5656-5675](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5656-L5675) |
132+| A20 | Term-literal fit into an atom ignores the literal's aura: `%1.000`, `%&` and `%1` fit @tas or ?, and `%1.000` never fits @ud, unlike Hoon; the spec is ambiguous | Low | Partly | bug | [jibb.hoon:5459-5465](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5459-L5465), [jibb.hoon:5477-5486](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5477-L5486), [jibb.hoon:8279](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8279) and 2 more |
133+| A21 | Many hand-written itype 'contains X' traversals and a repeated variable-kind disjunction could share one children/fold helper | Low | Partly | simplification | [jibb.hoon:5064-5075](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5064-L5075), [jibb.hoon:5216-5290](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5216-L5290), [jibb.hoon:5846-5870](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5846-L5870) and 1 more |
134+| A22 | The noun-fit comment says a bare tag is 'fixed as a constant', but the tag is bound to `*` or to the expected aura | Low | Partly | inconsistency | [jibb.hoon:5390-5396](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5390-L5396), [jibb.hoon:5460-5463](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5460-L5463) |
135+| A23 | Gates fit `*`, in tension with core-language.md ('a function isn't a noun'), but the prelude relies on it | Low | Partly | inconsistency | [jibb.hoon:5390-5396](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5390-L5396), [docs/spec/core-language.md:33](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/core-language.md#L33), [docs/compiler.md:149](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L149) and 1 more |
136+
137+### Expression inference, unions, API analysis (`jibb.hoon` 8364–12535)
138+
139+| # | Finding | Severity | Verdict | Kind | Where |
140+| --- | --- | --- | --- | --- | --- |
141+| A24 | Full module check reports overlaps that the partial report proves (atoms, ? vs a loobean, nested tags) as 'unsupported', with no overlap evidence | Medium | Confirmed | inconsistency | [jibb.hoon:11340-11351](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11340-L11351), [jibb.hoon:11352-11365](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11352-L11365), [jibb.hoon:10965-10993](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10965-L10993) and 3 more |
142+| A25 | module-scope-valid checks /% mark names against the value namespace, though /% binds only a mold | Low | Confirmed | inconsistency | [jibb.hoon:11232-11242](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11232-L11242), [jibb.hoon:11298-11311](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11298-L11311), [jibb.hoon:11893-11903](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11893-L11903) and 2 more |
143+| A26 | Five unreferenced arms (plus the iwidth-elaboration type) and header comments sitting above unrelated arms | Low | Confirmed | dead-code | [jibb.hoon:8585-8603](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8585-L8603), [jibb.hoon:8919-8920](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8919-L8920), [jibb.hoon:9099-9104](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9099-L9104) and 4 more |
144+| A27 | request-graph-merge re-inlines input matching and the bound check; its fuel arguments never limit; the unconditional bound contradicts 'request-bearing graphs alone have a size limit' | Low | Confirmed | inconsistency | [jibb.hoon:11656-11728](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11656-L11728), [jibb.hoon:14192](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14192), [jibb.hoon:14234-14235](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14234-L14235) and 1 more |
145+| A28 | istate (27 fields) is built as a positional tuple at 10 sites | Low | Confirmed | robustness | [jibb.hoon:5807](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5807), [jibb.hoon:10297](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10297), [jibb.hoon:10324](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10324) and 8 more |
146+| A29 | prepare-prelude*, module-mold-types*, union-state budgets and several small predicates are near-copies | Low | Confirmed | duplication | [jibb.hoon:11614-11634](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11614-L11634), [jibb.hoon:11352-11377](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11352-L11377), [jibb.hoon:10704-10721](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10704-L10721) and 5 more |
147+| A30 | Nested unfaced tail brackets get their own duplicate-field scope (documented), while field reads treat the whole spine as one record, so [a=@ud [a=@t b=?]] is accepted but a.x is 'ambiguous' | Low | Partly | bug | [jibb.hoon:11058](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11058), [jibb.hoon:11098](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11098), [jibb.hoon:11141-11150](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11141-L11150) and 4 more |
148+| A31 | API analysis duplicates its -source/-graph gates, keeps a dead one-request-interface-source and a narrow branch that multi-request nearly subsumes | Low | Partly | duplication | [jibb.hoon:12006-12043](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12006-L12043), [jibb.hoon:12112-12178](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12112-L12178), [jibb.hoon:12253-12359](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12253-L12359) and 3 more |
149+| A32 | Expression and itype walkers repeat the same per-kind dispatch and per-container helpers | Low | Partly | duplication | [jibb.hoon:9917-10018](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9917-L10018), [jibb.hoon:10936-10955](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10936-L10955), [jibb.hoon:11134-11231](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11134-L11231) and 5 more |
150+| A33 | infer-recursive-gate is retried for every failed definition, including non-self-referencing gates, and a failed single self-loop is retried again via infer-gate-group | Low | Partly | performance | [jibb.hoon:10287-10307](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10287-L10307), [jibb.hoon:10234-10256](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10234-L10256), [jibb.hoon:10309-10328](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10309-L10328) and 3 more |
151+| A34 | %gate and %gate-wide get separate ?- arms with identical bodies in the inference chapter | Low | Partly | simplification | [jibb.hoon:8559-8576](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8559-L8576), [jibb.hoon:9850-9910](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9850-L9910), [jibb.hoon:10031-10047](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10031-L10047) and 2 more |
152+| A35 | Four capital helpers repeat the same resolve-to-ident block; show-itype has five identical variable arms; 'is a variable' tests are inlined in several places | Low | Partly | simplification | [jibb.hoon:9640-9699](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9640-L9699), [jibb.hoon:9537-9552](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9537-L9552), [jibb.hoon:8904](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8904) and 4 more |
153+| A36 | infer-call-context-args and infer-fragment's two-name %wing branch duplicate existing gates; raw-expected use at the 'direct' context sites is deliberate but uncommented | Low | Partly | simplification | [jibb.hoon:9419-9433](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9419-L9433), [jibb.hoon:8840-8844](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8840-L8844), [jibb.hoon:8423-8431](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8423-L8431) and 2 more |
154+
155+### Program, page and store mains; entry points; deferred inference (`jibb.hoon` 12535–15172)
156+
157+| # | Finding | Severity | Verdict | Kind | Where |
158+| --- | --- | --- | --- | --- | --- |
159+| A37 | An undocumented 32,768-node freshness scan, repeated in up to six recovery arms, silently turns off program recovery when it runs out or meets a %recursive type | Medium | Confirmed | robustness | [jibb.hoon:12747](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12747), [jibb.hoon:12909](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12909), [jibb.hoon:13302](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13302) and 6 more |
160+| A38 | The keyed-view screen also skips ordinary inference of init, so an init that would check ordinarily is rejected unless it matches the tuple-ending-null or null-sample recovery shape | Medium | Partly | bug | [jibb.hoon:10293](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10293), [jibb.hoon:12997-13037](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12997-L13037), [jibb.hoon:14152-14173](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14152-L14173) and 4 more |
161+| A39 | Unannotated init recovery is limited to a tuple ending in `~` or a `~` sample; dropping the null-sample gate in program-plain-init-context covers reordered models and keeps the init guards | Medium | Partly | gap | [jibb.hoon:13595](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13595), [jibb.hoon:13650-13752](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13650-L13752), [jibb.hoon:12692-12706](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12692-L12706) and 4 more |
162+| A40 | Full-check failures collapse to generic boundary messages: no definition named, API reasons discarded, and a derived-name clash (a spec error) reported as unsupported | Medium | Partly | gap | [jibb.hoon:14189-14190](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14189-L14190), [jibb.hoon:14087](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14087), [jibb.hoon:14092](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14092) and 4 more |
163+| A41 | compiler.md and status.md describe the program-recovery chain inaccurately (nonempty subscriptions, 'doomed' screen, missing null-sample and plain-view recoveries), and a comment points the wrong way | Low | Confirmed | docs | [docs/compiler.md:139](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L139), [docs/compiler.md:141](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L141), [docs/status.md:50](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L50) and 2 more |
164+| A42 | The golden-types entry chain parses and duplicate-checks the source up to three times, the deferred paths parse and resolve again, eligibility guards are repeated, and golden-types-with-modules has no callers | Low | Confirmed | simplification | [jibb.hoon:14297-14392](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14297-L14392), [jibb.hoon:14943-15017](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14943-L15017), [jibb.hoon:14176-14185](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14176-L14185) and 3 more |
165+| A43 | The no-prelude report prints a bare 'module has reserved proj name' without the partial-inference header, the prepared path reports 'module has conflicting names', and the no-prelude branch is untested | Low | Confirmed | inconsistency | [jibb.hoon:14393-14394](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14393-L14394), [jibb.hoon:14344-14347](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14344-L14347), [jibb.hoon:11305](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11305) |
166+| A44 | The 'narrow' API branch with one-request-interface-graph is redundant for blog.jibb: multi-request-interface-graph produces the identical interface and cache | Low | Confirmed | simplification | [jibb.hoon:14078-14093](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14078-L14093), [jibb.hoon:12307-12362](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12307-L12362), [jibb.hoon:12488-12531](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12488-L12531) and 1 more |
167+| A45 | Unused parameters, no-op scans and defensive or unreachable checks in the recovery and dg arms | Low | Confirmed | dead-code | [jibb.hoon:12713](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12713), [jibb.hoon:14585-14591](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14585-L14591), [jibb.hoon:14842](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14842) and 6 more |
168+| A46 | The partial golden-types report uses its own resolver, with no program recovery and no grec index, so it disagrees with the full checker; this is deliberate, labelled and tested | Low | Partly | inconsistency | [jibb.hoon:14385-14508](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14385-L14508), [jibb.hoon:14400](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14400), [jibb.hoon:14152-14173](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14152-L14173) and 1 more |
169+| A47 | The experimental deferred (dg-*) transaction cannot affect a prelude-backed full check; this is already documented, and the cost is maintenance | Low | Partly | gap | [jibb.hoon:14176-14185](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14176-L14185), [jibb.hoon:14972](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14972), [jibb.hoon:15014](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L15014) and 4 more |
170+| A48 | Program recovery arms repeat the same preamble and a 25-35 line tail, which has drifted slightly; a shared helper would remove a few hundred lines, not most of 1,000 | Low | Partly | duplication | [jibb.hoon:12712-12816](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12712-L12816), [jibb.hoon:12874-12972](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12874-L12972), [jibb.hoon:13266-13341](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13266-L13341) and 4 more |
171+| A49 | grec proves one fixed recursive-tree layout on purpose; unfolding re-proves it and re-asserts its shape with 16 ?> checks instead of reusing the parts the proof found | Low | Partly | simplification | [jibb.hoon:15085-15115](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L15085-L15115), [jibb.hoon:15118-15157](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L15118-L15157), [tests/type-generic-recursion/about.txt:1-12](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/type-generic-recursion/about.txt#L1-L12) and 1 more |
172+
173+### Hoon importer, `%jibb` mark and prelude
174+
175+| # | Finding | Severity | Verdict | Kind | Where |
176+| --- | --- | --- | --- | --- | --- |
177+| A50 | The source fallback accepts only %tas head tags, and the catalog has no hoon.hoon or zuse unions, so $% or $? with %&, %\| or %0 tags, (each a b) and json all fail closed, although the spec's import table lists them | Medium | Partly | gap | [jibb-import.hoon:104-110](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L104-L110), [jibb-import.hoon:383](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L383), [jibb-import.hoon:413](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L413) and 5 more |
178+| A51 | +fixture-test is never called, but tests/importer/about.txt says it checks the structured values | Low | Confirmed | dead-code | [jibb-import.hoon:1720](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1720), [jibb-import.hoon:1727-1839](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1727-L1839), [tests/importer/about.txt:57-58](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/importer/about.txt#L57-L58) |
179+| A52 | About 540 lines (about 23%) of test-only fixture arms live in the importer library that app desks vendor | Low | Confirmed | simplification | [jibb-import.hoon:1720-1839](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1720-L1839), [jibb-import.hoon:1887-2306](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1887-L2306), [tests/lib/jibb-import.hoon:42](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-import.hoon#L42) and 1 more |
180+| A53 | The importer header and two jibb.hoon comments name +read-mold, which no caller uses and which cannot import collections, instead of +read-named or +read-mark | Low | Confirmed | inconsistency | [jibb-import.hoon:1-31](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1-L31), [jibb.hoon:5640](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5640), [jibb.hoon:11032](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11032) |
181+| A54 | prelude-inventory.md still lists the 3g shapes as future work and contradicts itself on the 2a inference status | Low | Confirmed | docs | [docs/prelude-inventory.md:141-157](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prelude-inventory.md#L141-L157), [docs/prelude-inventory.md:35](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prelude-inventory.md#L35), [docs/prelude-inventory.md:39-52](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prelude-inventory.md#L39-L52) and 1 more |
182+| A55 | The importer drops a mop's comparator, as the spec's (mop K V) decision implies, so lte and gth mops import identically; whether the order should be checked is a design question, not an importer bug | Low | Partly | gap | [jibb-import.hoon:1242-1266](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1242-L1266), [jibb-import.hoon:1578-1581](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1578-L1581), [docs/spec/decisions.md:39](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/decisions.md#L39) and 2 more |
183+| A56 | The definite-overlap witness covers only a top-level $? of tagged cells, as documented; duplicate $% tags, ?(%a %a) and nested overlaps report 'could not be verified' | Low | Partly | inconsistency | [jibb-import.hoon:416-441](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L416-L441), [jibb-import.hoon:390-401](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L390-L401), [tests/importer/tree.txt:76-78](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/importer/tree.txt#L76-L78) and 1 more |
184+| A57 | The provenance preamble, the local-chapter scan and the standard-collection name list are copied in many places | Low | Partly | duplication | [jibb-import.hoon:527-532](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L527-L532), [jibb-import.hoon:552-557](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L552-L557), [jibb-import.hoon:629-634](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L629-L634) and 12 more |
185+| A58 | Several helpers are near-copies; the $% and $? case scans differ only in a budget that was deliberately added to the $? path alone | Low | Partly | simplification | [jibb-import.hoon:88-102](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L88-L102), [jibb-import.hoon:168-181](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L168-L181), [jibb-import.hoon:124-163](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L124-L163) and 8 more |
186+| A59 | The opt-in diagnostic readers re-run provenance, the overlap witness and the walk after a failure; this is documented | Low | Partly | performance | [jibb-import.hoon:624-660](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L624-L660), [jibb-import.hoon:535-536](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L535-L536), [docs/compiler.md:107](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L107) and 1 more |
187+| A60 | jibb.hoon's header still says milestone 1 and lists a partial API; compiler.md's 'From the header' table and its %api chapter row do not match the file | Low | Partly | docs | [jibb.hoon:1-36](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1-L36), [docs/compiler.md:25-38](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L25-L38), [docs/compiler.md:51](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L51) and 3 more |
188+| A61 | The %jibb mark's %txt round trip drops the final newline, deliberately mirroring %hoon; changing grab txt would also require changing tools/ship's assertion | Low | Partly | robustness | [mar/jibb.hoon:6](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/mar/jibb.hoon#L6), [mar/jibb.hoon:11](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/mar/jibb.hoon#L11), [mar/jibb.hoon:14](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/mar/jibb.hoon#L14) and 2 more |
189+| A62 | +$ attr spells pad and gap as eight constant cases where a spacing mold and two cases would match the other attributes | Low | Partly | simplification | [prelude.jibb:405-417](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/prelude.jibb#L405-L417), [docs/spec/overview.md:198](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/overview.md#L198), [docs/spec/overview.md:204](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/overview.md#L204) |
190+| A63 | internal.jibb has no comment saying that list.core and unit.core are the public prelude's validated molds, which the compiler injects; tuba-text has no sample mold | Low | Partly | docs | [internal.jibb:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/internal.jibb#L1), [internal.jibb:22](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/internal.jibb#L22), [internal.jibb:29-33](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/internal.jibb#L29-L33) and 2 more |
191+| A64 | The prelude's mold each (Hoon 1c) and the element gate each are unrelated, as the spec requires; whether to rename is a spec question | Low | Partly | inconsistency | [prelude.jibb:131-133](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/prelude.jibb#L131-L133), [prelude.jibb:464-465](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/prelude.jibb#L464-L465), [docs/spec/overview.md:184](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/overview.md#L184) and 2 more |
192+
193+### Python tooling
194+
195+| # | Finding | Severity | Verdict | Kind | Where |
196+| --- | --- | --- | --- | --- | --- |
197+| A65 | Ship.processes() treats any process whose argv names the absolute pier path as the king, tools/ship itself included, so `tools/ship --pier /abs/pier stop` can SIGTERM itself and `start` reports 'already running' with no ship | Medium | Confirmed | bug | [tools/ship:285-305](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L285-L305), [tools/ship:340-344](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L340-L344), [tools/ship:388-409](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L388-L409) and 2 more |
198+| A66 | sync's verify reports a zero-byte .txt file as different: %txt stores ~ (an atom) for it, MANIFEST classifies any atom as %cord before checking for %txt, and verify() requires 'wain' for .txt; docs blame the ship | Medium | Confirmed | bug | [tools/ship:693-696](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L693-L696), [tools/ship:1437-1439](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1437-L1439), [docs/development.md:206](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L206) and 1 more |
199+| A67 | When the batched eval dies, tools/golden reruns every case alone, each compiling the whole library (no bisection), under the same 600 s timeout, and Ctrl-C does not stop the queued reruns | Medium | Confirmed | robustness | [tools/golden:363-396](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L363-L396), [tools/golden:285-286](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L285-L286), [tools/golden:522-526](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L522-L526) |
200+| A68 | jibb-import.hoon is spliced into the '(harness)' segment, so its compile errors get the 'golden harness doesn't compile / golden arm must be' headline with harness line numbers, and crash frames inside the reader are dropped | Low | Confirmed | bug | [tools/golden:243-247](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L243-L247), [tools/golden:287-294](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L287-L294), [tools/golden:311-316](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L311-L316) and 1 more |
201+| A69 | tools/ship test/sync/gen-tests accept a nonexistent --golden folder: zero cases are generated, the other tests/lib programs are dropped as 'isolated', and -test passes with 0 tests | Low | Confirmed | gap | [tools/ship:1018-1021](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1018-L1021), [tools/ship:877-898](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L877-L898), [tools/ship:1754-1778](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1754-L1778) and 1 more |
202+| A70 | ship-selftest hard-codes 44 tests/lib program names (11 of the 55 are missing) and dozens of fixture names that assemble() copies generically | Low | Confirmed | test-gap | [tools/testdata/ship-selftest:301-345](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/ship-selftest#L301-L345), [tools/testdata/ship-selftest:346-448](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/ship-selftest#L346-L448) |
203+| A71 | check_fixture_crash_isolated in tools/testdata/selftest runs the real 15k-line compiler and asserts on checker output, contradicting the 'about half a minute' docstring | Low | Confirmed | inconsistency | [tools/testdata/selftest:373-410](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/selftest#L373-L410), [tools/testdata/selftest:5](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/selftest#L5) |
204+| A72 | tools/golden embeds the prelude and internal prelude twice per module-types program (as arms and inline in prepare-prelude) and repeats the read-to-rap-literal code several times | Low | Confirmed | simplification | [tools/golden:201-222](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L201-L222), [tools/golden:263-286](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L263-L286) |
205+| A73 | delete_batches keeps an empty-list special case (`batches or partition([])`) that only a selftest relies on; sync never calls it with no paths | Low | Confirmed | simplification | [tools/ship:1512-1538](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1512-L1538), [tools/testdata/ship-selftest:550-554](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/ship-selftest#L550-L554) |
206+| A74 | A non-UTF-8 about.txt makes tools/golden and tools/ship gen-tests die with a UnicodeDecodeError traceback and exit 1 instead of a report and exit 2 | Low | Confirmed | robustness | [tools/golden_case.py:34-41](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden_case.py#L34-L41), [tools/golden:160-168](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L160-L168), [tools/ship:1114](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1114) and 1 more |
207+| A75 | tools/golden substitutes harness placeholders after splicing in case sources, so a Jibb source that interpolates {types-expr}, {import-helper}, {modules-expr}, {module-helper} or {prelude-helper} is silently rewritten or breaks the harness (latent: nothing in the corpus triggers it) | Low | Partly | bug | [tools/golden:287-294](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L287-L294), [tools/golden:243-247](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L243-L247), [tools/golden:285-286](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L285-L286) and 1 more |
208+| A76 | The eval and ship runners duplicate per-case metadata handling and the fixture-compiling Hoon helpers, and crash isolation has drifted (the ship's plain check-types is not under mule); the per-batch/per-case entry-point choice is equivalent and keeps stub libraries minimal | Low | Partly | duplication | [tools/golden:103-143](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L103-L143), [tools/golden:248-262](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L248-L262), [tools/ship:1058-1168](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1058-L1168) and 5 more |
209+| A77 | tools/ship keeps its own copies of noun decoding, cord-literal escaping, display paths and KNOT/TERM; some are not drop-in replaceable (tuple vs Cell nouns, pier-first urbit lookup) | Low | Partly | duplication | [tools/ship:121-228](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L121-L228), [tools/ship:83-84](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L83-L84), [tools/ship:266-273](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L266-L273) and 6 more |
210+| A78 | tools/clay-fixtures repeats one run/compare/print block for 11 fixtures (plus build, import and Tlon variants), and the Tlon step clones tools/ship into a scratch repo just to add one /sur file; the restore has no timeout | Low | Partly | simplification | [tools/clay-fixtures:54-145](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/clay-fixtures#L54-L145), [tools/clay-fixtures:188-238](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/clay-fixtures#L188-L238), [tools/clay-fixtures:147-186](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/clay-fixtures#L147-L186) and 1 more |
211+| A79 | tools/ship defaults to /root/urbit/zod and /root/src/tools/pkg/click/click (documented and overridable), and its find_urbit ignores $URBIT | Low | Partly | tooling | [tools/ship:53-54](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L53-L54), [tools/ship:18-24](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L18-L24), [tools/noun.py:5-6](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/noun.py#L5-L6) and 2 more |
212+
213+### Test harness
214+
215+| # | Finding | Severity | Verdict | Kind | Where |
216+| --- | --- | --- | --- | --- | --- |
217+| A80 | Eval scripts cut or bypass the ship's test- arms and keep their own copies of the check lists, so eval and ship run different wrapper code | Medium | Confirmed | inconsistency | [tools/type-store-test:19-34](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-store-test#L19-L34), [tests/lib/jibb-store.hoon:256-260](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-store.hoon#L256-L260), [tools/type-todo-full-test:21-32](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-full-test#L21-L32) and 6 more |
218+| A81 | Test copies of my-app files are guarded inconsistently: the todo /sur and mark copies and all 14 golden copies are unchecked, and no check parses my-app's own .jibb files | Medium | Confirmed | gap | [tests/type-api-paths/about.txt:2](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/type-api-paths/about.txt#L2), [tests/type-api-paths/todo-sur.txt](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/type-api-paths/todo-sur.txt), [tests/type-api-paths/todo-action.txt](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/type-api-paths/todo-action.txt) and 3 more |
219+| A82 | The 49 tools/type-*-test scripts and importer-test rebuild by hand the bindings each ship test file already declares; a generic runner over tests/lib could replace most of them and run several times faster | Medium | Partly | simplification | [tools/type-deferred-prepared-test:10-48](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-deferred-prepared-test#L10-L48), [tools/type-todo-full-test:16-97](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-full-test#L16-L97), [tools/type-arithmetic-guards-test:13-28](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-arithmetic-guards-test#L13-L28) and 1 more |
220+| A83 | The committed, generated tests/lib/jibb.hoon (3,949 lines) is never used: assembly drops it and regenerates it | Low | Confirmed | simplification | [tools/ship:887-898](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L887-L898), [tools/ship:1754-1778](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L1754-L1778), [docs/development.md:186](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L186) and 1 more |
221+| A84 | Each new test is registered by hand in several places, and some of those lists are incomplete | Low | Confirmed | duplication | [tools/testdata/ship-selftest:304-346](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/ship-selftest#L304-L346), [tools/testdata/ship-selftest:348-446](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/ship-selftest#L348-L446), [docs/development.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L3) and 2 more |
222+| A85 | Some checks test little: a one-line pass/fail golden file for unification, and three Hoon-versus-Hoon reference files that build the full library for nothing | Low | Confirmed | simplification | [tests/checker/unification.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/checker/unification.txt#L1), [tests/lib/jibb-typecheck.hoon:5-13](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-typecheck.hoon#L5-L13), [tools/testdata/succ-hoon-reference.hoon:1-9](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/testdata/succ-hoon-reference.hoon#L1-L9) and 3 more |
223+| A86 | 36 tests/lib files repeat the same lines-to-cord helper, and many suites build Jibb sources inline from '\0a' cords | Low | Confirmed | duplication | [tests/lib/jibb-store.hoon:8-45](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-store.hoon#L8-L45), [tests/lib/jibb-program-watch.hoon:12-55](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-program-watch.hoon#L12-L55) |
224+| A87 | The golden naming table documents only lex-, inline- and doc- prefixes, and 10 about.txt files miss required lines; nothing lints them | Low | Confirmed | docs | [docs/development.md:212-218](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L212-L218), [tests/golden/types-constructor-context/about.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/golden/types-constructor-context/about.txt#L1), [tests/golden/types-partial-locals/about.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/golden/types-partial-locals/about.txt#L1) and 1 more |
225+| A88 | Fixture folders, script names, arm names and flags follow no consistent mapping | Low | Confirmed | inconsistency | [tests/type-program-watch/about.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/type-program-watch/about.txt#L1), [tools/type-gate-free-source-test:13](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-gate-free-source-test#L13), [tools/type-program-init-test:27-32](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-program-init-test#L27-L32) and 3 more |
226+| A89 | tools/clay-fixtures repeats one run-and-compare block per fixture, and the importer fixture list is spread over several places with a hand-kept count | Low | Confirmed | duplication | [tools/clay-fixtures:15-238](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/clay-fixtures#L15-L238), [tools/importer-test:10-37](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/importer-test#L10-L37), [tests/lib/jibb-import.hoon:3-42](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-import.hoon#L3-L42) and 1 more |
227+| A90 | The docs' claims about 2,000-line modules and 100,000 nested brackets have no automated test | Low | Confirmed | test-gap | [docs/compiler.md:209](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L209), [docs/development.md:230](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L230) |
228+| A91 | Five 'Before pushing' checks run through tools/hoon are eyeball checks: they exit 0 whatever value they print | Low | Partly | bug | [docs/development.md:179-183](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L179-L183), [tools/hoon:149-171](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/hoon#L149-L171) |
229+| A92 | No single command runs the ~65-command push checklist (about 49 minutes serially); CI is planned only for milestone 7 | Low | Partly | gap | [docs/development.md:124-192](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L124-L192), [docs/development.md:234](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L234), [docs/spec/implementation-plan.md:31](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/implementation-plan.md#L31) |
230+| A93 | The importer's +fixture-test is never run although tests/importer/about.txt says it checks structured values; test-support arms live in the shipped libraries | Low | Partly | dead-code | [jibb-import.hoon:1720-1842](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1720-L1842), [tests/importer/about.txt:58](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/importer/about.txt#L58), [jibb.hoon:4505-4595](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4505-L4595) and 2 more |
231+| A94 | Type-checker golden cases also carry full token and tree outputs (about 73% of all parser golden lines), a deliberate trade-off that adds churn when sources or printers change | Low | Partly | simplification | [docs/spec/implementation-plan.md:40](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/implementation-plan.md#L40), [docs/development.md:12](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L12), [tools/ship:947](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L947) |
232+
233+### Documentation
234+
235+| # | Finding | Severity | Verdict | Kind | Where |
236+| --- | --- | --- | --- | --- | --- |
237+| A95 | status.md says the cart store fully checks (line 54) and also that it fails closed (line 68), because the golden-types path and the full-module path disagree and status.md never says which it means | Medium | Confirmed | inconsistency | [docs/status.md:54](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L54), [docs/status.md:68](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L68), [tests/golden/doc-grammar-06-cart-store/types.txt:2](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/golden/doc-grammar-06-cart-store/types.txt#L2) and 2 more |
238+| A96 | The hand-maintained check lists have drifted: status.md's 'Checking it' misses 18 checks, the README names 27 of the 49 type-* tools, and development.md:3 points to the README as the full reference | Medium | Confirmed | tooling | [docs/status.md:234-286](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L234-L286), [docs/development.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L3), [docs/development.md:124-194](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L124-L194) and 3 more |
239+| A97 | status.md is a 59 KB append-only log: a 16,412-character paragraph, a 115-row history table that repeats git log, and stale dates | Medium | Confirmed | docs | [docs/status.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L3), [docs/status.md:68](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L68), [docs/status.md:90](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L90) and 2 more |
240+| A98 | `eq` is absent from the prelude and the checker has no gate-free type-variable constraint, and no doc lists either as outstanding | Medium | Partly | gap | [docs/open-questions.md:17](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/open-questions.md#L17), [docs/spec/decisions.md:31](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/decisions.md#L31), [docs/spec/grammar.md:137](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/grammar.md#L137) and 4 more |
241+| A99 | decisions.md's Core language row still says three rules are proposed, but core-language.md marks none and the decisions rows record them as adopted | Low | Confirmed | inconsistency | [docs/spec/decisions.md:63](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/decisions.md#L63), [docs/spec/core-language.md:5](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/core-language.md#L5), [docs/spec/decisions.md:21](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/decisions.md#L21) and 2 more |
242+| A100 | The EBNF admits `[]` but not `m()`, the checker reports `[]` as unsupported rather than as the decided error, nothing tests `[]`, and open-questions Q6 is stale | Low | Confirmed | inconsistency | [docs/spec/grammar.md:245](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/grammar.md#L245), [docs/spec/grammar.md:250](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/grammar.md#L250), [docs/spec/decisions.md:13](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/decisions.md#L13) and 6 more |
243+| A101 | compiler.md's chapter table omits `%union-analysis`, which holds the golden-types and module-checking entry points; the page and the file header still say milestone 1 | Low | Confirmed | docs | [docs/compiler.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L3), [docs/compiler.md:23-38](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L23-L38), [docs/compiler.md:44-57](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L44-L57) and 4 more |
244+| A102 | Three docs say starting urbit eval and building the library takes about 8 s; it takes about 23 s now | Low | Confirmed | docs | [docs/development.md:122](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L122), [docs/compiler.md:209](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L209), [docs/status.md:112](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L112) |
245+| A103 | open-questions.md mostly holds settled questions, against its own stated rule, its 'as of' date is stale, and status.md cites a nonexistent 'corpus question 3' | Low | Confirmed | docs | [docs/open-questions.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/open-questions.md#L3), [docs/open-questions.md:21](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/open-questions.md#L21), [docs/status.md:108](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/status.md#L108) and 1 more |
246+| A104 | 'The doc itself is the authority' conflicts with the repo spec, which records decisions the Claude doc does not yet have | Low | Confirmed | inconsistency | [docs/development.md:9](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L9), [README.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/README.md#L3), [docs/README.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/README.md#L3) and 2 more |
247+| A105 | prelude-inventory.md says nine molds already in the prelude 'can be written once present', and its 2a table disagrees with its own paragraph | Low | Confirmed | docs | [docs/prelude-inventory.md:141-159](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prelude-inventory.md#L141-L159), [docs/prelude-inventory.md:35-52](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prelude-inventory.md#L35-L52), [prelude.jibb:58-97](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/prelude.jibb#L58-L97) |
248+| A106 | Tool narratives have been appended under Ground rules and Commits in development.md, and status content sits in the docs/README.md index | Low | Confirmed | docs | [docs/development.md:17](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L17), [docs/development.md:236](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/development.md#L236), [docs/README.md:5](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/README.md#L5) |
249+| A107 | The repo has no licence and does not state the licences of its vendored code; CI is deliberately deferred to milestone 7 | Low | Partly | gap | [README.md:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/README.md#L1), [vendor/SOURCES.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/vendor/SOURCES.txt#L1), [tests/importer/tlon-license.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/importer/tlon-license.txt#L1) and 1 more |
250+
251+### Example desk, host desk and vendored files
252+
253+| # | Finding | Severity | Verdict | Kind | Where |
254+| --- | --- | --- | --- | --- | --- |
255+| A108 | my-app files are copied 28 times under tests/, with sync pairs hand-coded in 8 tools and several copies never checked | Medium | Confirmed | duplication | [tools/type-page-main-test:15-30](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-page-main-test#L15-L30), [tools/type-todo-full-test:16-19](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-full-test#L16-L19), [tools/type-todo-partial-test:18-21](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-partial-test#L18-L21) and 9 more |
256+| A109 | Nothing compares the five todo reader copies (todo-sur.txt and four mark copies) with my-app. Clay checks cover only item, action and the todo-action mark | Medium | Partly | test-gap | [tools/type-todo-partial-test:18-34](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-partial-test#L18-L34), [tools/type-todo-full-test:16-43](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-full-test#L16-L43), [tools/type-page-main-test:15-40](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-page-main-test#L15-L40) and 5 more |
257+| A110 | The example marks are built only as Hoon cores (%ca); no test builds them as marks (%cb) or checks their vale | Low | Confirmed | test-gap | [tests/clay-fixtures/build.txt:6-11](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/clay-fixtures/build.txt#L6-L11), [tests/clay-fixtures/mark-shape.txt:4](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/clay-fixtures/mark-shape.txt#L4), [tools/ship:685](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L685) |
258+| A111 | The my-app assembly skips jibb-dev/tests, which does not exist | Low | Confirmed | dead-code | [tools/ship:63](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L63), [README.md:81](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/README.md#L81), [tools/ship:2261](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L2261) |
259+| A112 | Milestone-4 tension: my-app deliberately holds the failing buttons example, and its doc-identical theme names a static font that milestone 4 will treat as missing | Low | Partly | gap | [my-app/ui/components/buttons.jibb:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/ui/components/buttons.jibb#L3), [my-app/ui/theme.jibb:7](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/ui/theme.jibb#L7), [docs/prompts/milestone-2.md:154](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prompts/milestone-2.md#L154) and 4 more |
260+| A113 | Importer-only fixtures (sur/import-fixture.hoon, mar/label.hoon) sit on the example desk, and the Tlon probe needs a temp-copy, sync and restore of my-app | Low | Partly | simplification | [my-app/sur/import-fixture.hoon:1-7](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/sur/import-fixture.hoon#L1-L7), [my-app/mar/label.hoon:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/mar/label.hoon#L1), [tools/clay-fixtures:144-187](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/clay-fixtures#L144-L187) and 2 more |
261+| A114 | The importer fixture's $^(@ud [a=@ud b=@t]) is a malformed $^ whose mold accepts only atom-headed cells, though its type (and the import) admits atoms | Low | Partly | bug | [my-app/sur/import-fixture.hoon:6](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/sur/import-fixture.hoon#L6), [tests/clay-fixtures/ford-nested-union-expected.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/clay-fixtures/ford-nested-union-expected.txt#L1), [tests/clay-fixtures/ford-nested-union-bridge-expected.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/clay-fixtures/ford-nested-union-bridge-expected.txt#L1) and 1 more |
262+| A115 | my-app/mar/todo-action.hoon claims it is 'not supplied by the design doc', but apart from that comment line it is the overview's block | Low | Partly | inconsistency | [my-app/mar/todo-action.hoon:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/mar/todo-action.hoon#L1), [docs/spec/overview.md:310-316](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/overview.md#L310-L316), [tests/type-api-paths/todo-action.txt:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/type-api-paths/todo-action.txt#L1) and 1 more |
263+| A116 | No %todo/%blog fixture agents and no page embedding basket exist yet for milestones 5-6, and my-app's agentless desk.bill `~` is undocumented | Low | Partly | gap | [my-app/desk.bill:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/my-app/desk.bill#L1), [docs/spec/overview.md:350](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/overview.md#L350), [docs/spec/overview.md:358](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/overview.md#L358) and 4 more |
264+| A117 | Every desk gets all vendor packages by documented design (so app desks carry lib/test.hoon), and the zuse kelvin is hand-copied in two desks | Low | Partly | simplification | [tools/ship:59-69](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L59-L69), [tools/ship:881-884](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/ship#L881-L884), [vendor/SOURCES.txt:9-10](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/vendor/SOURCES.txt#L9-L10) and 3 more |
265+| A118 | SOURCES.txt credits the docket files to urbit/urbit's legacy pkg/landscape and records a machine-local path; the files themselves are current | Low | Partly | docs | [vendor/SOURCES.txt:1-15](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/vendor/SOURCES.txt#L1-L15) |
266+
267+### Architecture (cross-cutting)
268+
269+| # | Finding | Severity | Verdict | Kind | Where |
270+| --- | --- | --- | --- | --- | --- |
271+| A119 | The one-site keyed-view screen skips ordinary inference for all five program components, so a fully annotated, valid program is rejected | High | Confirmed | bug | [jibb.hoon:10293](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10293), [jibb.hoon:12975-13038](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L12975-L13038), [jibb.hoon:13595](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L13595) and 3 more |
272+| A120 | 49 near-identical type-*-test scripts each start an eval and rebuild the library | Medium | Confirmed | tooling | [tools/type-closed-gate-guards-test:1-29](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-closed-gate-guards-test#L1-L29), [tools/type-todo-full-test:19-98](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-todo-full-test#L19-L98), [tools/golden:61](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/golden#L61) |
273+| A121 | The checker grows by example-fitted recovery slices rather than a module-wide deferred-constraint core; the brief suggests that core but does not prescribe it | Medium | Partly | gap | [docs/prompts/milestone-2.md:130-142](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/prompts/milestone-2.md#L130-L142), [docs/spec/implementation-plan.md:15](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/spec/implementation-plan.md#L15), [jibb.hoon:4674-4691](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L4674-L4691) and 2 more |
274+| A122 | The partial golden report and the full-module interface are separate pipelines with duplicated finalization, and the typed goldens exercise only the report | Medium | Partly | inconsistency | [jibb.hoon:14385-14510](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14385-L14510), [jibb.hoon:10266-10286](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10266-L10286), [jibb.hoon:14176-14184](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14176-L14184) and 1 more |
275+| A123 | %gate and %gate-wide carry identical fields and the checker handles both identically | Low | Confirmed | simplification | [jibb.hoon:945-948](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L945-L948), [jibb.hoon:8559-8575](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8559-L8575), [jibb.hoon:9848-9862](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9848-L9862) |
276+| A124 | Hard-coded budgets are scattered, and the printer's 26-variable cap also gates interface acceptance | Low | Confirmed | robustness | [jibb.hoon:10279](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10279), [jibb.hoon:10095](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10095), [jibb.hoon:14939](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L14939) and 3 more |
277+| A125 | The 27-field istate is built from positional literals in 10 places, and resolver arms take up to 19 positional arguments | Low | Confirmed | robustness | [jibb.hoon:5807](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5807), [jibb.hoon:10287-10297](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10287-L10297), [jibb.hoon:10309-10324](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10309-L10324) |
278+| A126 | Tests call 137 internal library arms directly, coupling guards to the current code shape | Low | Confirmed | test-gap | [tests/lib/jibb-deferred.hoon:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-deferred.hoon#L1), [tests/lib/jibb-cell-branch.hoon:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-cell-branch.hoon#L1), [tests/lib/jibb-generic-pattern.hoon:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/lib/jibb-generic-pattern.hoon#L1) |
279+| A127 | About 586 lines of jibb-import.hoon, which app desks vendor, are test fixtures and printers | Low | Confirmed | simplification | [jibb-import.hoon:1720-2308](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb-import.hoon#L1720-L2308), [jibb.hoon:5555-5615](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L5555-L5615), [README.md:11](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/README.md#L11) |
280+| A128 | my-app sources are copied 28 times under tests, with 9 hand-written byte checks in 8 tools | Low | Confirmed | duplication | [tools/type-page-main-test:14-31](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/type-page-main-test#L14-L31), [tests/golden/types-module-fixtures/modules/ui/api/blog.jibb:1](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/golden/types-module-fixtures/modules/ui/api/blog.jibb#L1) |
281+| A129 | Several AST walker families and itype predicates repeat the same recursion skeleton | Low | Partly | simplification | [jibb.hoon:7097-7223](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7097-L7223), [jibb.hoon:9917-10022](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9917-L10022), [jibb.hoon:11059-11297](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11059-L11297) and 2 more |
282+| A130 | Dead arms, copy-pasted -source/-graph twins and many golden-types wrappers | Low | Partly | duplication | [jibb.hoon:8591-8603](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8591-L8603), [jibb.hoon:8661-8666](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8661-L8666), [jibb.hoon:10142-10145](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10142-L10145) and 6 more |
283+| A131 | The library header and compiler.md chapter map are stale (milestone 1, no %union-analysis), and %union-analysis mislabels about 4,700 lines | Low | Partly | inconsistency | [jibb.hoon:1-36](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L1-L36), [jibb.hoon:10452](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10452), [docs/compiler.md:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L3) and 2 more |
284+| A132 | The prelude source is reparsed on each direct-prelude-evidence call, and program-recovery-names is recomputed for every definition | Low | Partly | performance | [jibb.hoon:8633-8647](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8633-L8647), [jibb.hoon:10293](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10293), [jibb.hoon:11488-11492](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11488-L11492) and 2 more |
285+
286+### Found by the completeness pass
287+
288+| # | Finding | Severity | Verdict | Kind | Where |
289+| --- | --- | --- | --- | --- | --- |
290+| A133 | Loobean, unit/list and union ?- branches join arm results by three different rules: a loobean branch rejects a decimal literal against @ud even under ^- @ud, a unit/list branch unifies them but cannot widen, and a union branch requires syntactically equal normalized types | Medium | Confirmed | inconsistency | [jibb.hoon:8518-8519](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L8518-L8519), [jibb.hoon:7671-7672](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7671-L7672), [jibb.hoon:7841-7842](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L7841-L7842) and 2 more |
291+| A134 | Printed types name the private prelude module: `(ask.internal @ud)` and `(unit qath.internal)` appear when ask or qath is reached through page or theme, and a golden and a ship test lock this in | Medium | Confirmed | bug | [jibb.hoon:11423-11436](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L11423-L11436), [prelude.jibb:3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/prelude.jibb#L3), [prelude.jibb:338](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb/prelude.jibb#L338) and 6 more |
292+| A135 | Top-level resolution is a whole-module fixpoint that resolves one link of a forward chain per pass. It re-infers every unresolved definition and rescans the module on each pass, giving roughly cubic cost, and the SCC order it already computes is used only for cycles. | Medium | Partly | performance | [jibb.hoon:10309-10328](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10309-L10328), [jibb.hoon:10293](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10293), [jibb.hoon:10303](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L10303) and 6 more |
293+| A136 | The type printer leaves right-nested tuples unflattened and does not name non-recursive records or imported non-recursive Hoon molds; the missing-tag error for a named imported union lists its cases instead of naming it | Low | Partly | inconsistency | [jibb.hoon:9570](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9570), [jibb.hoon:9562-9565](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/jibb-dev/lib/jibb.hoon#L9562-L9565), [tests/golden/types-missing-tag-imported/types.txt:2-3](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tests/golden/types-missing-tag-imported/types.txt#L2-L3) and 5 more |
294+| A137 | Every eval tool compiles with `!:`, which makes checker work about 2.2-2.6x slower and library build about 20% slower than a ship build; docs/ never says so, though the published figures are caveated A/B comparisons and status.md's 8 s startup figure is stale | Low | Partly | docs | [tools/urbit_eval.py:176-185](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/tools/urbit_eval.py#L176-L185), [docs/compiler.md:65](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L65), [docs/compiler.md:67](https://github.com/iko-soy/jibb/blob/4bf477e2c4a093f7d2d6aa2bff1ce5858bd98e36/docs/compiler.md#L67) and 5 more |
docs/spec/core-language.md+4−3
@@ -71,7 +71,7 @@ axis = digit { digit } ; (* at least 1 *)
7171
7272## Lowering from Jibb
7373
74−Types, faces and casts leave nothing behind; everything else lowers by these rules.
74+Types, faces and casts leave nothing behind. Everything else lowers by these rules.
7575
7676| Jibb | Core language |
7777| --- | --- |
@@ -82,6 +82,7 @@ Types, faces and casts leave nothing behind; everything else lowers by these rul
8282| `gap+%s2` | `(cons %gap %s2)` |
8383| `/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 |
8484| `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 |
8586| `card.card`, an import | The qualified name `components/card:card` |
8687| `m(draft=t error=~)` | One `edit` per item, in order: `(edit 7 (edit 6 m t) ~)` |
8788| `f a b c` | `(app f (cons a (cons b c)))`: the arguments are the sample |
@@ -107,8 +108,8 @@ The todo island's `update`, from worked example 3:
107108 ?- (gth (lent (tuba (trip t))) 80)
108109 %.y [m(draft=t error=`"Too long") ~]
109110 %.n [m(draft=t error=~) ~]
110− %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
111− [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
111+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
112+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
112113 [%got ts] [m(todos=ts) ~]
113114 [%acked err] [m(error=err) ~]
114115```
docs/spec/decisions.md+15−8
@@ -24,18 +24,21 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
2424| 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 |
2525| Jibb code blocks | Labelled `jibb` in this doc; each is a golden test | Decided 2026-10-30 |
2626| 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; 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-30 |
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 |
2828| 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` 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-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 |
3030| Branching | `?-` only, loobeans included; exhaustive, with explicit catch-alls; covered arms are errors; failures say `!!` | Decided 2026-10-29 |
3131| 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 |
3232| Special rules | No built-ins; type-directed rules are welcome, each listed in the Grammar tab | Decided 2026-10-29 |
3333| 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`; pokes and requests are opaque, from derived gates and `pure`; 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-29 |
35−| 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 watching such a request has a type error; typed segments by aura | Decided 2026-10-30 |
34+| Effects | The library unions `cmd` and `sub`; `raw-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-11-01 |
35+| Poke representation | The source-backed private internal prelude module defines `raw-poke`, and the public prelude re-exports it as an ordinary transparent type. A store's local `poke` action remains an ordinary mold; derived helpers produce the runtime envelope | Decided 2026-11-01 |
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 |
3637| Mark names | Any name: `/%` names types after marks, and constructors poke with their type's mark; no alias marks | Decided 2026-10-26 |
37−| 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 |
38+| Derived gates | API files and stores give a generic `poke` command helper taking an action and reply, 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-11-01 |
3839| 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 |
3942| Layout | Indentation; juxtaposed calls; a bracket open at line end takes one item per line, with no closer | Decided |
4043| 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 |
4144| Long calls | One argument per line inside parentheses | Decided |
@@ -43,6 +46,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
4346| Empty mold | `!!`, with no values; the expression has any type; pages are `(element !!)`, which keeps islands out of islands | Decided 2026-10-29 |
4447| 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 |
4548| 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 |
4650| Loobean mold | `?`, switched with `?-` | Decided 2026-10-26 |
4751| Defaults | None | Decided |
4852| Modules | Records, not cores | Decided |
@@ -51,6 +55,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
5155| Binding patterns | In `?-` arms; the last position binds the rest | Decided 2026-10-29 |
5256| 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 |
5357| 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 |
5459| 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 |
5560| Refinement types | None | Decided |
5661| Imports | `/-`, `/%` (a mark's type, with no face) and `/=`; no `/+`; cycles are errors | Decided 2026-10-29 |
@@ -60,23 +65,25 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
6065| 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 |
6166| Compile targets | Nock on the ship, JavaScript in the browser | Decided |
6267| Optimizer | Basic lowering; holes later | Decided 2026-10-29 |
63−| Island `update` | In the browser | Decided |
68+| Island `update` | In the browser; returns the model and a list of commands, which the runtime processes one at a time in list order | Decided 2026-11-02 |
6469| Island `init` | Takes the page's data, returns the model | Decided 2026-10-29 |
6570| Island rendering | `view` re-runs on model changes; a keyed diff patches the DOM; holes later | Decided 2026-10-29 |
6671| Data crossing to the browser | No gates in island data or models | Decided 2026-10-29 |
6772| 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 |
6873| Transactions | None; one poke per command | Decided |
6974| Reloads | Restart from the model the page is served with | Decided 2026-10-29 |
70−| 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; poked and watched through derived gates; one per page | Decided 2026-10-30 |
75+| Shared state | Stores: browser agents written like API files, with `state`, a local `+$ poke` action mold and `(store init update)`; derived gates provide the generic `poke` command helper and state requests; one per page | Decided 2026-11-01 |
76+| Store builder | `+$ store |$ [S] [init=S update=*]`, with `++ store |= [init=S update=$-([A S] S)] ^- (store S) [init update]`: the builder checks action `A`, while `main` exposes only state `S`; the store kind check verifies `A` against the poke declaration | Decided 2026-11-01 |
7177| 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 |
7278| 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 |
7379| 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 |
7480| Responsive layout | `stack` switches at the theme's `wide` | Decided 2026-10-29 |
75−| 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+| Theme | A prelude mold with every token required: spaces, five tones with `normal` and `background`, language, zone, `wide`, and an optional static font; optional values such as dark tones use explicit backtick unit syntax; 4.5:1 contrast enforced | Decided 2026-11-01 |
7682| Dark mode | Hand-written dark tones under `dark`, used when the reader prefers dark | Decided 2026-10-27 |
7783| 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 |
7884| Data layer | Hoon's nouns: units, treaps, loobeans | Decided |
7985| 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 |
86+| `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 |
8087| Wire format | Noun channels; Jibb's own noun codec in the browser | Decided 2026-10-29 |
8188| 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 |
8289| Private pages | Served by the host per request and never cached; non-owners go to the login page | Decided 2026-10-29 |
docs/spec/grammar.md+20−19
@@ -91,7 +91,7 @@ Imports come first:
9191/= card /ui/components/card :: a Jibb module
9292```
9393
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 code never writes one. API modules re-export their `/%` types, not `/-` faces or `/=` modules. Import cycles are errors.
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 helpers such as `poke.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.
9595
9696## Modules
9797
@@ -99,10 +99,10 @@ A file is a module: imports, then definitions.
9999
100100- `+$ name mold` defines a mold; `++ name expr` a value.
101101- 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.
102+- Molds and values have separate namespaces, told apart by position: `todo-action.todo` is a mold, `poke.todo` its command helper, and `todos.todo` a mold and a request.
103103- `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.
104104- 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 that watches a request whose case has a separate `scry=` path has 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.
105+- An API module, `/ui/api/<agent>.jibb`, also exports derived gates: a generic `poke` command helper, adding the agent and mark and taking a reply, 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 local `+$ poke` is its ordinary action mold; a store exports a generic `poke` command helper and a `state` request. Clashing derived names are errors, including a derived name that clashes with an import face.
106106
107107Names the host reads, by file:
108108
@@ -118,28 +118,30 @@ Every other name is free.
118118
119119## Molds
120120
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.
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.
122122
123−- **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`. `?` is a loobean.
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 `?`.
124125- **Constants**: `%add`, `~` and the loobeans have one value each.
125−- **Records and tuples**: `[text=@t done=?]`, `[@t ?]`. An empty `[]` is 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. A record too long for one line can leave its `[` open, with one field per deeper line, as an expression's bracket does.
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.
126127- **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.
127128- **Containers**: `(list A)`, `(unit A)`, `(set A)`, `(map K V)`, `(mop K V)`, `(qeu A)`, `(jar K V)`, `(jug K V)`.
128129- **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.
129−- **Paths**: `/todos` is constant, `/` empty, and `/todo/[id=@ud]` typed by aura. `%/blog/(slug)` is an `qath`, checked against routes and static files.
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.
130131- **Generic molds**: `+$ result |$ [V E]` with cases below; `|$` goes only right after a `+$`'s name.
131132- **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**: `!!`.
132−- **Opaque**: `poke`, `ask` and `qath`, built only by derived gates, `pure` and application-path literals. `(facts full diff …)` appears only in an API file's `paths`.
133+- **Pokes**: `raw-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; derived `poke` helpers return commands.
134+- **Effect and application-path types**: `raw-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`.
133135- **Identity**: recursive molds go by name and module.
134136
135−`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`. 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.
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.
136138
137139## Tag resolution
138140
139141A 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".
140142
141143- 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.
142−- `|=%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 tagged at their head; a bare tag is always a value.
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.
143145- 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.
144146- 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)`.
145147- Wing access, changes and `?-` on a type not yet known wait the same way.
@@ -210,7 +212,7 @@ Tags can sit anywhere in a case, and a case can carry several:
210212 [%move %left n] "left {n}"
211213 [%move %right n] "right {n}"
212214 [t %draft] t
213− [t %sent at] t
215+ [t %sent sent-at] t
214216 %stop "stop"
215217```
216218
@@ -260,7 +262,7 @@ rune = "|=" field ( expr | body )
260262 | "?-" expr INDENT arm { NEWLINE arm } DEDENT ;
261263arm = pattern ( expr | body ) ; (* every case covered; see Patterns *)
262264
263−mold = aura | "*" | "!!" | "?" | "~" | term | loobean | ref | typevar
265+mold = aura | "_" | "*" | "!!" | "?" | "~" | term | loobean | ref | typevar
264266 | pathmold
265267 | "(" ref mold { mold } ")" | "(" ref { mold } mlines
266268 | "[" field { field } "]" | "[" { field } flines
@@ -269,7 +271,7 @@ field = [ name "=" ] mold | "=" name ; (* =msg is msg=msg *)
269271mlines = INDENT mold { NEWLINE mold } DEDENT ; (* a mold's ( left open *)
270272flines = INDENT field { NEWLINE field } DEDENT ; (* a mold's [ left open *)
271273pathmold = "/" [ segment { "/" segment } ] ;
272−segment = knot | "[" name "=" aura "]" ;
274+segment = knot | "[" name "=" ( aura | "_" ) "]" ;
273275
274276pattern = term | number | string | ship | loobean | "~" | "*" | name
275277 | "[" pattern { pattern } "]" ;
@@ -291,14 +293,13 @@ knot = { lower | digit | "-" | "." | "~" | "_" } ;
291293```jibb
292294:: /ui/stores/cart.jibb
293295+$ state [items=(list @t) open=?]
294−+$ cart-action
296++$ poke
295297 [%add item=@t]
296298 %toggle
297−+$ poke cart-action
298299
299300++ main (store init update)
300301++ init ^- state [~ %.n]
301−++ update |= [a=cart-action s=state]
302+++ update |= [a=poke s=state]
302303 ?- a
303304 [%add item] s(items=[item items.s])
304305 %toggle s(open=(not open.s))
@@ -324,8 +325,8 @@ knot = { lower | digit | "-" | "." | "~" | "_" } ;
324325++ update |= [=msg m=model]
325326 ?- msg
326327 [%noted t] [m(note=t) ~]
327− %add [m(note="") ~[[%poke (cart-action.cart [%add note.m]) |=%acked]]]
328− %toggle [m ~[[%poke (cart-action.cart %toggle) |=%acked]]]
328+ %add [m(note="") ~[(poke.cart [%add note.m] |=%acked)]]
329+ %toggle [m ~[(poke.cart %toggle |=%acked)]]
329330 [%got c] [m(cart=c) ~]
330331 [%acked err] [m ~]
331332
@@ -339,4 +340,4 @@ knot = { lower | digit | "-" | "." | "~" | "_" } ;
339340 button "Add" %add
340341```
341342
342−A store is written like an API file: `state`, `+$ poke` and `(store init update)`. Islands 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.
343+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.md+1−1
@@ -73,7 +73,7 @@ For milestone 6. An island is one loop over one model: events become messages, `
7373- **Messages** come from controls, command replies, facts, timers and `%url`. *Proposed*: an island handles them one at a time, in arrival order.
7474- **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.
7575- **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.
76+- **Commands**: an update may return several commands. The runtime processes them one at a time, in list order, after the patch. Each reply arrives later as a new message, never inside the `update` that sent it.
7777
7878| Control | Sends | When |
7979| --- | --- | --- |
docs/spec/overview.md+13−9
@@ -78,7 +78,7 @@ Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file a
7878
7979## Prelude
8080
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. The prelude also holds `eq`, `not`, `page`, `program`, `store`, `pure`, `island`, and the layout elements and molds.
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.
8282
8383| Group | Hoon | Jibb |
8484| --- | --- | --- |
@@ -97,6 +97,8 @@ Hoon's standard library regrouped, written in Jibb and vendored as `/lib/jibb/pr
9797| 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` |
9898| 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 |
9999
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+
100102Maps are Hoon's trees on both sides, so equal maps are equal nouns. Requests check incoming maps and sets with `apt`.
101103
102104## The Elm architecture on Urbit
@@ -139,7 +141,7 @@ Loads and renders run in Nock.
139141
140142```jibb
141143+$ cmd |$ [M]
142− [%poke p=poke reply=$-((unit @t) M)]
144+ [%poke p=raw-poke reply=$-((unit @t) M)]
143145 [%go url=@t]
144146 [%wait gap=@dr msg=M]
145147 [%now reply=$-(@da M)]
@@ -150,9 +152,11 @@ Loads and renders run in Nock.
150152 [%url reply=$-(path M)]
151153```
152154
153−- `poke` and `ask` are opaque, built only by derived gates and `pure`. A 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.
155+An island's `update` returns `[model (list (cmd M))]`, so one message may produce several commands. The runtime processes the returned commands one at a time, in list order. A store's `update` consumes exactly one poke with the current state and returns the next state.
156+
157+- `raw-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 helper such as `(poke.todo [%add draft.m] |=%acked)` checks its value and supplies the agent and mark, returning a command whose reply becomes an island message, 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 helpers poke the store in the browser.
154158- 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`.
155−- 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 runtime acks facts, rewatches after a kick or a dropped connection and reseeds from the first fact; a refused watch shows the crash notice.
159+- 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.
156160- 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.
157161
158162Inputs 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,7 +165,7 @@ Inputs send a message per `input` event, and one per IME composition, so validat
161165
162166- `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.
163167- A crash in `update` drops the message, keeps the model and shows the standard notice.
164−- 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.
168+- 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 local `+$ poke` is an ordinary action mold; the runtime envelope is `raw-poke`. The builder is `+$ store |$ [S] [init=S update=*]` with `++ store |= [init=S update=$-([A S] S)] ^- (store S) [init update]`: it checks action `A`, while `main` exposes only state `S`; the store kind check verifies `A` against the declaration. Islands import it with `/=` and use its derived gates: the generic `poke` command helper, and `(state.cart |=%got)`, whose first fact is the current state and each later fact the next.
165169- 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.
166170- 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.
167171
@@ -214,7 +218,7 @@ The theme, `++ theme` in `/ui/theme.jibb`, uses the prelude's `theme` mold, with
214218 lang="en"
215219 zone="UTC"
216220 font=`%/static/fonts/inter.woff2
217− dark=[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
221+ dark=`[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
218222```
219223
220224Style 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.
@@ -278,7 +282,7 @@ The host is one Gall agent on the `%jibb` desk, serving every Jibb desk, so app
278282
279283### Agent APIs
280284
281−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.
285+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 generic `poke` command helper, which checks the action and reply and pokes with the action's mark, and a request per path, which checks what comes back. Clashing derived names are errors.
282286
283287```jibb
284288:: /ui/api/todo.jibb
@@ -469,8 +473,8 @@ A `page`: each request scries `%blog` and renders in Nock.
469473 ?- (gth (lent (tuba (trip t))) 80)
470474 %.y [m(draft=t error=`"Too long") ~]
471475 %.n [m(draft=t error=~) ~]
472− %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
473− [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
476+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
477+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
474478 [%got ts] [m(todos=ts) ~]
475479 [%acked err] [m(error=err) ~]
476480
docs/status.md+190−9
@@ -1,6 +1,6 @@
11# Status
22
3−As of 2026-10-30. The plan is [spec/implementation-plan.md](spec/implementation-plan.md); each milestone ends with its checks passing on a fake ship.
3+As of 2026-11-02. The plan is [spec/implementation-plan.md](spec/implementation-plan.md); each milestone ends with its checks passing on a fake ship.
44
55| # | Milestone | Status |
66| --- | --- | --- |
@@ -19,9 +19,83 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
1919
2020## Milestone 2: in progress
2121
22−The repository spec records the subsequent type-system and prelude decisions; 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 selected Hoon atoms, term singletons, 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 cross as opaque module-and-name identities; aliases, foreign references, recursive marks, unfolding and construction remain unsupported. The reader handles mark samples, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, 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. 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 direct imported cast and whole-sample references when their inputs are unique; nested shapes, aliases, transitive modules and unsupported reader outcomes remain generic. 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, and detects missing sources and cycles. It does not yet check API or kind semantics, and 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. 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. Mutual groups, polymorphic recursion and value cycles remain unsupported. Reporting repeats inference for a recursive gate, so its performance cost remains unmeasured. Contextual null-headed cells fit their cases, but do not supply a `|=%$` constructor; 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. 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. Uncontextualized list construction, 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; mutually recursive local groups and 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 newly agreed shared-type `clap`, parsed but still awaiting checker and backend validation, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
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.
2323
24−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`, `lure`, `weld` and `snoc`. The validated standard `list` mold is injected when the prelude’s own gates are inferred; `weld` has an ordinary explicit result cast. An absent or altered `list` is not injected, and an altered declaration cannot leak through direct or transitive mold aliases. List-dependent prelude mold aliases remain unsupported because their templates are prepared before injection. 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. Preparation rejects empty, malformed, conflicting or import-bearing source; the prepared value is trusted and must come unchanged from `+prepare-prelude`. 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.
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+The remaining doc fragments now also have full detailed and legacy checks: the import-only module resolves its real `/sur`, mark and Jibb-module inputs; `view-day` and `step` check with their exact exported schemes; and the `cmd`/`sub` block checks at the prelude path against the canonical printed schemes. Additional consumers use all three imported names, and the shared eval/ship fixture rejects missing `/sur`, mark and Jibb-module inputs.
43+
44+The documented buttons library now fully checks its valid `labelled` and `wide` definitions with their exact generic element and attribute-list schemes. Ordinary positional calls unify a variable argument with the body of an expected faced sample slot without propagating that slot face. When full checking would otherwise reject an incomplete module, a failure-only retry of at most 64 missing definitions can report a still-pending tag at its source; the unchanged buttons module thus reports that nothing fixes the union of `%add`, with the actual excerpt, through both detailed and legacy inference. Successful checks do not run that retry. The shared eval/ship fixture is type checking only and claims no UI runtime.
45+
46+The public prelude now defines the exact documented `theme` record, including required text tokens, an optional `qath` font and optional dark tones. A shared eval/ship fixture fully checks the byte-identical `my-app/ui/theme.jibb`, checks its exact exported type and structural downstream import, and covers absent dark tones plus wrong nested auras, missing fields and wrong font/dark types. On 2026-11-01, @iko chose explicit backtick syntax for present units, and the documented dark record now uses it. No contrast check, rendering, routing or other theme behavior is implemented.
47+
48+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.
49+
50+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.
51+
52+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.
53+
54+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.
55+
56+Static and direct data-page `main` checking now completes the unchanged about page, blog index and todo index through the real Hoon readers. Static generic element mains specialize to closed canonical `(element !!)`; direct pages require a closed invariant `page` type and a direct plain derived-request load. Page loads reuse the strict source/member/evidence identity checks used by program watches, rejecting aliases, indirect/hand-built/pure/unknown requests, typed paths, diffs and store paths. The shared eval and ship fixture asserts exact main types and structural downstream imports. Rendering, runtime loading and request execution remain unimplemented.
57+
58+The prelude now has the approved `store` mold and action-checking builder. The runtime envelope is the transparent `raw-poke`; a store's local `+$ poke` remains its ordinary action mold throughout inference. Direct two-wing store mains require closed state and action molds, exact init/state and update relations, and no gate-free-state restriction. Stores export those molds plus derived generic `poke` command and state-request gates. The command helper checks the canonical `raw-poke`, `cmd` and `unit` shapes, takes an action and reply, and returns `(cmd M)` directly. Separate source-bound store certificates prove only the actual imported state member watchable; API evidence checks and page-load rejection remain intact. The unchanged cart and basket pass detailed and legacy checking with exact mains, derived schemes and structural imports, including non-keyed view and null-sample initializer recovery. Multi-action declarations, lowering and runtime execution remain unsupported.
59+
60+The component-local program recovery now covers update, subscriptions, one direct keyed `each`/`turn` mapper and its view, then the existing initializer and ordinary `main` path. Each recovered scheme is closed and freshly allocated; a keyed source screen avoids repeated doomed ordinary attempts without skipping final `main`, and non-gate views decline safely. Canonical `element` recursion and exact singleton-case list fits are narrowly guarded, with successful ordinary fits taking precedence. The byte-identical unchanged todo now passes both detailed and legacy full-module checks with an exact closed `main` type and structural downstream import. Wrong models, messages, results, mappers, keys, aliases, non-gate views and watches fail closed. This is static checking only: no Jibb execution or runtime watching is claimed.
61+
62+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.
63+
64+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.
65+
66+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.
67+
68+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 generic poke command helper 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.
69+
70+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.
71+
72+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.
73+
74+The prelude now writes `hunt` with the ordering gate first, matching the target Hoon's `(hunt ord a b)`. Its focused golden infers both ordering outcomes and absent units, and reports mismatched unit payloads and ordering-gate samples. Execution and jet recognition remain unverified.
75+
76+The prelude now also writes `eq` and `mate`. A dedicated constrained variable retains `A contains no gates` through nested unification, canonicalization, instantiation and imports; atom constraints remain stronger. Direct and nested gate arguments fail, while open cell, face, collection and union members receive the constraint with bounded traversal and substitution updates. `set`, `map`, `mop`, `jar` and `jug` constrain only their key positions, leaving map values independent. The shared solver guards cover existing and later gate injection, exact traversal budgets and conservative budget fallback; backend equality and crash behavior remain unverified.
77+
78+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.
79+
80+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.
81+
82+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.
83+
84+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.
85+
86+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.
87+
88+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.
89+
90+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.
91+
92+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.
93+
94+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.
95+
96+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.
97+
98+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.
2599
26100## Milestone 1: parser and mark
27101
@@ -39,9 +113,9 @@ What the plan asks for, and where it is:
39113
40114Besides the plan's list:
41115
42−- 514 golden cases: 298 that parse and 216 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.
43−- The 514-case corpus passed under `urbit eval` in 57.0 s. The fake ship passed all 520 tests, including the importer, importer/checker and mark/checker bridges, module scope and unification checks, with 31.8 s for sync and 35.3 s for tests. The importer golden compares 149 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.
44−- `tools/testdata/selftest` (22 checks) and `tools/testdata/ship-selftest` test the tools themselves.
116+- 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.
117+- The 660-case corpus passed under `urbit eval` in 108.0 s while other checks were running. The fake ship passed all 717 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 111.2 s and the ship's `-test` run took 316.7 s. 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.
118+- `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.
45119- 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.
46120- 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).
47121
@@ -90,25 +164,132 @@ Besides the plan's list:
90164| 918acbd | 2026-10-30 | Infer recursive gates from their samples first |
91165| 1470d18 | 2026-10-30 | Infer selected prelude list helpers |
92166| 10cbf9c | 2026-10-30 | Infer selected local recursive gates and distinguish reader diagnostics |
93−| This change | 2026-10-30 | Infer local capital scopes and report direct reader diagnostics |
167+| 45afb13 | 2026-10-30 | Infer local capital scopes and report direct reader diagnostics |
168+| 054e651 | 2026-10-30 | Report nested reader diagnostics |
169+| 98c19cd | 2026-10-30 | Infer known-aura string interpolation |
170+| ddba633 | 2026-10-30 | Infer top-level mutually recursive gates |
171+| 9f1517e | 2026-10-30 | Infer whole-case union patterns and prelude `turn` |
172+| 9dd35c8 | 2026-10-31 | Match finite boolean refinements of union cases |
173+| 54852d4 | 2026-10-31 | Contextualize tuple calls and infer known record changes |
174+| 0bc5113 | 2026-10-31 | Contextualize record initializers and infer unit construction |
175+| 264a436 | 2026-10-31 | Contextualize unit payloads in casts, calls and nested values |
176+| a140383 | 2026-10-31 | Report missing union tags and infer prelude unit helpers |
177+| d69cc52 | 2026-10-31 | Infer longer cell binder patterns and prelude unit helpers |
178+| ae35005 | 2026-10-31 | Import source-verified tagged Hoon unions |
179+| c8f894a | 2026-10-31 | Report nested missing tags and contextualize union branch results |
180+| ef2ea71 | 2026-10-31 | Import Hoon null singleton cases |
181+| 67f900e | 2026-10-31 | Infer local mutual gates and uncontextualized lists |
182+| 7ff15f1 | 2026-10-31 | Contextualize finite union patterns and record the initial poke decision |
183+| c790a9f | 2026-10-31 | Expose transparent `poke` from the internal prelude |
184+| ef4772a | 2026-10-31 | Bridge imported loobeans and loobean singletons |
185+| ad46655 | 2026-10-31 | Bridge selected imported any-noun molds |
186+| beada10 | 2026-10-31 | Import source-proved Ford mark unions, analyze API paths and infer list helpers |
187+| e28f7be | 2026-10-31 | Diagnose proven non-gate cycles and import Tlon null-payload union cases |
188+| fd2f288 | 2026-10-31 | Infer qualified fields of imported values |
189+| ed9291e | 2026-10-31 | Infer term-headed pairs and function helpers, and import nested named unions |
190+| ad0265e | 2026-10-31 | Infer proven single-case patterns and the prelude command union |
191+| 413b12b | 2026-10-31 | Propagate known result context into generic calls and batch ship deletions |
192+| c690076 | 2026-10-31 | Propagate loobean context, infer predicate helpers, and import named ordered-map operands |
193+| 0bf6178 | 2026-10-31 | Bridge recursive Tlon lists and prepare a private comparison interface |
194+| 4e472b5 | 2026-10-31 | Pass known named unions through polymorphic gates |
195+| e3e184f | 2026-10-31 | Parse type holes, reject duplicate written record fields, and extend partial union inference and imports |
196+| 80e221a | 2026-10-31 | Infer supported annotation holes and prelude list aliases |
197+| ba1fec4 | 2026-10-31 | Add the curried `bond` prelude gate |
198+| 0ea700d | 2026-10-31 | Infer a source-defined recursive `qath` subset and record the explicit `proj` decision |
199+| 75f5952 | 2026-10-31 | Check a subset of explicit `proj` calls and retain their lowering evidence |
200+| cf17925 | 2026-10-31 | Infer supported single-field projections |
201+| 1a891e2 | 2026-10-31 | Infer source-backed addition and decrement without loobean operands; record the watchability decision |
202+| 81af5fd | 2026-10-31 | Preserve public names of identity-generic union aliases and record the `like` decision |
203+| 640a442 | 2026-10-31 | Add the source-backed `like` result mapper and infer supported positional calls |
204+| 445a0a1 | 2026-10-31 | Retain source-backed API path evidence and classify declarations |
205+| f69493d | 2026-10-31 | Derive supported request components from API declarations |
206+| f0f6954 | 2026-10-31 | Analyze supported API helper definitions and declared marks |
207+| 3f55af7 | 2026-10-31 | Define source-backed transparent ask and pure |
208+| ae1ec26 | 2026-10-31 | Prove selected default-wrapped Hoon unions from source |
209+| dde791c | 2026-10-31 | Infer a source-backed request-gate type through ordinary imports |
210+| a1c5f35 | 2026-10-31 | Infer supported multi-path requests and named closed folds |
211+| 911ca0c | 2026-10-31 | Propagate union context, define subscriptions and match literal nouns |
212+| 72acdb3 | 2026-10-31 | Infer selected nested union payloads from context |
213+| 706035c | 2026-10-31 | Analyze gate-free source molds with field witnesses |
214+| 651b8ec | 2026-10-31 | Match source-proven gate samples in direct calls |
215+| cc8e389 | 2026-10-31 | Add source-backed list length and real todo regression |
216+| 4da6891 | 2026-10-31 | Add source-backed comparisons and nested Hoon union controls |
217+| 09db390 | 2026-10-31 | Skip unnecessary inference environment scans |
218+| 179d717 | 2026-10-31 | Diagnose source-proven Hoon union overlaps |
219+| 142f2e2 | 2026-10-31 | Prove structural overlaps across Hoon union cases |
220+| c96597d | 2026-10-31 | Track source-proven generic recursive identities |
221+| 190a9d5 | 2026-10-31 | Add source-backed list flattening |
222+| d9d51e6 | 2026-10-31 | Check source-proven recursive tree construction |
223+| 30b0a9e | 2026-10-31 | Match source-proven recursive tree cases |
224+| 72d85ab | 2026-10-31 | Add bounded deferred inference and expand runtime equality coverage |
225+| 22f3788 | 2026-10-31 | Check empty molds and propagate closed cell context into branches |
226+| 341bcb4 | 2026-10-31 | Keep deferred fits stable under later substitutions |
227+| b93a94b | 2026-10-31 | Prove local generic-alias union tags and add successor |
228+| 2826c93 | 2026-10-31 | Report generic-alias overlaps and retain deferred branch contexts |
229+| b5cdc80 | 2026-10-31 | Preserve full-module overlap source evidence |
230+| ab6fdc1 | 2026-10-31 | Add source-backed text conversion wrappers |
231+| aa277c9 | 2026-10-31 | Recover prepared tuple initializers in partial reports |
232+| b4703e7 | 2026-11-01 | Check narrow closed subscription-free program mains |
233+| 26bf7a7 | 2026-11-01 | Recover narrow direct-program initializer contexts |
234+| 642d2c0 | 2026-11-01 | Prove direct request-value watchability for program subscriptions |
235+| 2e4d582 | 2026-11-01 | Add the source-backed UI, program and page prelude slice |
236+| a163965 | 2026-11-01 | Recover direct-program update result contexts |
237+| 46748b0 | 2026-11-01 | Check the unchanged todo island through component recovery |
238+| 1e17d5f | 2026-11-01 | Check static and direct data-page mains |
239+| 0517053 | 2026-11-01 | Add the theme mold and require explicit unit syntax |
240+| This change | 2026-11-01 | Check the unchanged cart store and basket |
94241
95242## Checking it
96243
97244On a machine set up as [development.md](development.md) says:
98245
99246```
100−tools/golden # 514 cases under urbit eval
247+tools/golden # 660 cases under urbit eval
101248tools/importer-test # the Hoon importer fixture projection
249+tools/type-import-default-test # default-wrapped source proof golden
102250tools/type-import-test # the importer/checker bridge fixture
251+tools/type-import-overlap-test # source-aware Hoon overlap and provenance fixture
252+tools/type-import-structural-test # structural overlap and multi-case source fixture
253+tools/type-union-source-test # local generic-alias union guards
254+tools/type-union-alias-overlap-test # local generic-alias overlap diagnostics
255+tools/type-full-overlap-test # full-module overlap evidence
256+tools/type-tlon-test # the real Tlon reader/checker fixture
103257tools/type-mark-test # the mark/checker bridge fixture
258+tools/type-poke-test # the source-backed poke/API fixture
259+tools/type-api-evidence-test # API declaration evidence guards
260+tools/type-api-paths-test # partial API path metadata fixture
261+tools/type-hole-guards-test # hole defaulting and API interface guards
262+tools/type-list-alias-test # prelude list-alias guards
263+tools/type-generic-alias-test # generic union alias guards
264+tools/type-generic-recursion-test # source-proven generic recursion guards
265+tools/type-generic-construction-test # source-proven recursive construction guards
266+tools/type-generic-pattern-test # source-proven recursive pattern guards
267+tools/type-deferred-test # source-owned deferred inference guards
268+tools/type-deferred-resolver-test # resolver consistency and failure guards
269+tools/type-deferred-context-test # deferred source-order and branch guards
270+tools/type-deferred-prepared-test # prepared initializer reports and failure guards
271+tools/type-empty-test # empty molds and coverage guards
272+tools/type-cell-branch-test # branch context and rollback guards
273+tools/type-positional-face-guards-test # positional sample face guards
274+tools/type-qath-guards-test # qath source and unfolding guards
275+tools/type-ask-guards-test # ask source and bootstrap guards
276+tools/type-proj-guards-test # projection evidence and scope guards
277+tools/type-buttons-test # documented buttons schemes and exact pending-tag error
278+tools/type-theme-test # byte-identical real theme, exact type and rejection guards
104279tools/type-module-scope-test # module and prelude scope fixture
280+tools/type-program-main-test # closed program-main interface and rejection guards
281+tools/type-program-init-test # transactional direct-program initializer context guards
282+tools/type-program-update-test # transactional direct-program update context guards
283+tools/type-program-watch-test # direct request-value watchability guards
284+tools/type-todo-full-test # byte-identical full todo and rejection guards
105285tools/hoon check-spans-test # prints <<>> when the span checker works
106286tools/testdata/selftest # the tools themselves
107287tools/doc-blocks docs/spec # the doc's examples are golden cases
108288tools/ship start
109289tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
110−tools/ship test # the same 514 cases as -test arms on the ship
290+tools/ship test # the same 660 cases as -test arms on the ship
111291tools/testdata/ship-selftest
292+tools/testdata/clay-fixtures-selftest # scratch fixture cleanup without a ship
112293tools/ship check-commit # |commit stores .jibb files
113294tools/clay-fixtures # example /sur files and marks build through Clay
114295```
jibb-dev/lib/jibb-import.hoon+791−21
@@ -8,7 +8,8 @@
88:: Hoon's %hold nodes retain the generator's Hoon and its bound arguments.
99:: Comparing that Hoon to the standard generators identifies collections
1010:: before they expand into trees. Recursive holds are tracked by identity;
11−:: a repeated named hold becomes a module-qualified reference.
11+:: a repeated named hold becomes a module-qualified reference. A proven
12+:: nested self-recursive tagged union retains its own named boundary.
1213::
1314:: A direct $^ is read from its original branches and accepted only when
1415:: their imported shapes prove disjoint. A single nested $^ in a
@@ -24,9 +25,10 @@
2425:: the other fields are fixed atoms or collections of static atoms;
2526:: other source shapes fail closed.
2627::
27−:: The checker has a small bridge for successful unfaced atom and cell
28−:: results; it rejects other importer shapes. Failures return %|; no
29−:: partial tree is returned as success.
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.
3032::
3133|%
3234+$ imported
@@ -37,6 +39,7 @@
3739 [%cell head=imported tail=imported]
3840 [%face name=term body=imported]
3941 [%fork cases=(list imported)]
42+ [%named module=term name=term body=imported]
4043 [%apply name=term args=(list imported)]
4144 [%ref module=term name=term]
4245 [%bad reason=@t]
@@ -44,7 +47,7 @@
4447 ==
4548+$ import-diagnostic
4649 $% [%ok value=imported]
47− [%invalid code=?(%aura %core) message=@t]
50+ [%invalid code=?(%aura %core %overlap) message=@t]
4851 [%unsupported message=@t]
4952 ==
5053+$ signatures (list [name=term code=hoon])
@@ -76,6 +79,445 @@
7679 ^- (each imported @t)
7780 (read-with module name typ ~)
7881::
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+::
79521:: +read-mold-in: accept the /sur core as provenance. The core must be
80522:: built against zuse or validated Ford imports, and its selected arm
81523:: must be this type. Unknown subject shapes fail closed.
@@ -90,9 +532,15 @@
90532 [%| (crip "Hoon mold `{(trip name)}` is not declared")]
91533 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
92534 [%| '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']
93537 =/ result (read-with module name typ [~ cor])
94− ?. ?=([%& *] result) result
95− result
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
96544::
97545:: +read-named is the source-aware entry point for callers that have
98546:: not selected a Hoon type yet. Check the core and the local arm
@@ -121,6 +569,41 @@
121569:: A mark door's payload is [sample build-subject]. Its outer sample
122570:: face names the door sample, not the imported mark type. Collection
123571:: 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+::
124607++ read-mark
125608 |= [name=term cor=type]
126609 ^- (each imported @t)
@@ -131,8 +614,12 @@
131614 =/ sample=type p.p.cor
132615 =/ raw=type ?:(?=([%face *] sample) q.sample sample)
133616 =/ result (read-with name name raw [~ q.p.cor])
134− ?. ?=([%& *] result) result
135− result
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
136623::
137624++ read-named-diagnostic
138625 |= [module=term name=term cor=type]
@@ -147,6 +634,8 @@
147634 [%unsupported p.result]
148635 =/ selected=(each type tang) (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
149636 ?. ?=(%& -.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']
150639 =/ again=(each imported tang) (mule |.((walk module p.selected catalog ~ [~ cor])))
151640 ?. ?=(%& -.again) [%unsupported p.result]
152641 =/ evidence=(unit import-diagnostic) (first-invalid p.again)
@@ -609,6 +1098,8 @@
6091098 ^- ?
6101099 ?: ?=([%face *] a) $(a body.a)
6111100 ?: ?=([%face *] b) $(b body.b)
1101+ ?: ?=([%named *] a) $(a body.a)
1102+ ?: ?=([%named *] b) $(b body.b)
6121103 ?: ?=([%fork *] a)
6131104 (levy cases.a |=(item=imported (disjoint item b)))
6141105 ?: ?=([%fork *] b)
@@ -663,6 +1154,32 @@
6631154 ?. (arm-map-valid +.chapter) ~
6641155 [~ (arm-map-has +.chapter target)]
6651156::
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+::
6661183++ chapter-unsafe
6671184 |= [chapter=* target=term]
6681185 ^- ?
@@ -705,17 +1222,46 @@
7051222 ?@ src |
7061223 |($(src -.src) $(src +.src))
7071224::
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+::
7081242++ mop-specs-raw
7091243 |= body=hoon
7101244 ^- (unit [key=spec value=spec])
1245+ =. body (mop-source-code body)
7111246 ?. ?=([%cncl *] body) ~
7121247 ?. ?=([%tsgr *] p.body) ~
713− =/ b=hoon q.p.body
1248+ =/ b=hoon (mop-source-code q.p.body)
7141249 ?. ?=([%cncl *] b) ~
715− ?. ?=([%cncl *] p.b) ~
716− ?. ?=([%wing *] p.p.b) ~
717− ?. =(p.p.p.b ~[%mop]) ~
718− =/ specs=(list spec) ;;((list spec) q.p.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)
7191265 ?. ?=([* [* ~]] specs) ~
7201266 [~ [i.specs i.t.specs]]
7211267::
@@ -925,6 +1471,49 @@
9251471 ?~ args [%bad unsupported]
9261472 [%apply name.out u.args]
9271473::
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+::
9281517++ walk
9291518 |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
9301519 ^- imported
@@ -949,6 +1538,19 @@
9491538 [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
9501539 [%hint *] $(typ q.typ)
9511540 [%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]
9521554 ?: &(?=([%tsls [%note * *] *] q.typ) |((has-spec-cell-union q.typ) (has-spec-general-union q.typ)))
9531555 =/ nm (hold-name q.typ)
9541556 (collection-union typ module sig [[typ nm] seen] context)
@@ -965,12 +1567,6 @@
9651567 =/ second=type (~(play ut p.typ) (ream '*value'))
9661568 [%apply name ~[first-import $(typ second)]]
9671569 [%apply name ~[first-import]]
968− =/ prior=(unit (unit term)) (find-seen typ seen)
969− ?^ prior
970− ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
971− =/ origin (ref-origin module u.u.prior typ context)
972− ?~ origin [%bad 'a recursive Hoon mold needs unambiguous source provenance']
973− [%ref u.origin u.u.prior]
9741570 =/ nm (hold-name q.typ)
9751571 ?: =(nm [~ %vase]) [%bad 'a Hoon type named vase needs source provenance']
9761572 ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
@@ -981,7 +1577,8 @@
9811577 [%bad 'Hoon collection provenance is unavailable or shadowed']
9821578 =/ mop (mop-arguments typ)
9831579 ?^ mop
984− [%apply %mop ~[$(typ key.u.mop) $(typ value.u.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])]]
9851582 ?: (source-uses q.typ %mop)
9861583 =/ checked-names=(list term) ~[%map %set %qeu %list %unit]
9871584 ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
@@ -1075,6 +1672,7 @@
10751672 [%bad *] [~ reason.out]
10761673 [%invalid *] [~ reason.out]
10771674 [%face *] $(out body.out)
1675+ [%named *] $(out body.out)
10781676 [%cell *]
10791677 =/ err $(out head.out)
10801678 ?~ err $(out tail.out)
@@ -1102,6 +1700,7 @@
11021700 [%bad *] `[%unsupported reason.out]
11031701 [%invalid *] `[%invalid code.out reason.out]
11041702 [%face *] $(out body.out)
1703+ [%named *] $(out body.out)
11051704 [%cell *]
11061705 =/ first $(out head.out)
11071706 ?~ first $(out tail.out)
@@ -1254,6 +1853,7 @@
12541853 [%cell *] "[{(show-import head.out)} {(show-import tail.out)}]"
12551854 [%face *] "{(trip name.out)}={(show-import body.out)}"
12561855 [%fork *] "(union {(show-imports cases.out)})"
1856+ [%named *] "(named {(trip name.out)}.{(trip module.out)} {(show-import body.out)})"
12571857 [%apply *] "({(trip name.out)} {(show-imports args.out)})"
12581858 [%ref *] "{(trip name.out)}.{(trip module.out)}"
12591859 [%bad *] "error: {(trip reason.out)}"
@@ -1307,6 +1907,67 @@
13071907 =/ source=hoon original(q.p (decorate-union-source q.p.original))
13081908 (read-mold %small name typ(q source))
13091909::
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+::
13101971:: Synthetic nodes test each part of the direct collection-call proof.
13111972++ collection-wrapper-fixture
13121973 ^- tape
@@ -1352,6 +2013,19 @@
13522013 =/ mark-rec-core=type -:(ride fp mark-rec)
13532014 =/ mark-gate-core=type -:(ride -:!>(..zuse) mark-gate)
13542015 =/ 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'))
13552029 =/ fake-vase=type -:(ride -:!>(..zuse) '|%\0a+$ vase @ud\0a--\0a')
13562030 =/ spoof=(unit import-diagnostic)
13572031 (first-invalid [%bad 'signed and float auras cannot be imported'])
@@ -1366,6 +2040,30 @@
13662040 =/ distinct=type -:(ride distinct-parent origin-first)
13672041 =/ trans-amb-parent=type [%cell [%face %intermediate fc] [%cell [%face %second sc] -:!>(..zuse)]]
13682042 =/ 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')
13692067 =/ sample
13702068 |= name=term
13712069 (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
@@ -1403,6 +2101,15 @@
14032101 (crip "nested-static-mop: {(show-result (sample %nested-static-mop))}")
14042102 (crip "collection-siblings: {(show-result (sample %collection-siblings))}")
14052103 (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")}")
14062113 (crip "mark-record: {(show-result (read-mark %todo-item mark-core))}")
14072114 (crip "mark-recursive: {(show-result (read-mark %recursive mark-rec-core))}")
14082115 (crip "mark-gate: {(show-result (read-mark %bad mark-gate-core))}")
@@ -1427,11 +2134,22 @@
14272134 (crip "shadow-list-mop: {(show-result (read-mold-in %shadow-static %bad (~(play ut xc) (ream '*bad')) xc))}")
14282135 (crip "named-mop: {(show-result (sample %named-mop))}")
14292136 (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)}")
14302147 (crip "signed: {(show-result (sample %signed))}")
14312148 (crip "float: {(show-result (sample %float))}")
14322149 (crip "gate: {(show-result (sample %gate-test))}")
14332150 (crip "vase: {(show-result vase)}")
14342151 (crip "failed-branch: {(show-result (read-mold %external %bad bad-branch-fixture))}")
2152+ (crip "debug-spec: {debug-spec-fixture}")
14352153 (crip "debug-union: {(show-result (debug-union-fixture sc %action))}")
14362154 (crip "debug-union-overlap: {(show-result (debug-union-fixture sc %explicit-wut-overlap))}")
14372155 (crip "debug-nested-cell: {(show-result (debug-union-fixture sc %nested-valid-cell))}")
@@ -1526,6 +2244,58 @@
15262244 (crip "missing-arm: {(show-result (read-mold-in %small %missing [%atom %ud ~] sc))}")
15272245 (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
15282246 (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))}")
15292299 (crip "presence-topic: {(show-result (present %topic))}")
15302300 (crip "presence-timing: {(show-result (present %timing))}")
15312301 (crip "presence-places: {(show-result (present %places))}")
jibb-dev/lib/jibb.hoon+7861−291
@@ -774,39 +774,38 @@
774774:: (face 2:11 items
775775:: (apply 2:17 list (aura 2:23 @t)))
776776:: (face 2:27 open (flag 2:32))))
777−:: (mold 3:1 cart-action
777+:: (mold 3:1 poke
778778:: (union 4:3
779779:: (cell 4:3
780780:: (const 4:4 %add)
781781:: (face 4:9 item (aura 4:14 @t)))
782782:: (const 5:3 %toggle)))
783−:: (mold 6:1 poke (ref 6:9 cart-action))
784−:: (value 8:1 main
785−:: (group 8:9
786−:: (call 8:10 (wing 8:10 store) (wing 8:16 init) (wing 8:21 update))))
787−:: (value 9:1 init
788−:: (cast 9:9
789−:: (ref 9:12 state)
790−:: (tuple 9:18 (lit 9:19 ~) (lit 9:21 %.n))))
791−:: (value 10:1 update
792−:: (gate 10:11
793−:: (cell 10:14
794−:: (face 10:15 a (ref 10:17 cart-action))
795−:: (face 10:29 s (ref 10:31 state)))
796−:: (body 11:3
797−:: (branch 11:3
798−:: (wing 11:6 a)
783+:: (value 7:1 main
784+:: (group 7:9
785+:: (call 7:10 (wing 7:10 store) (wing 7:16 init) (wing 7:21 update))))
786+:: (value 8:1 init
787+:: (cast 8:9
788+:: (ref 8:12 state)
789+:: (tuple 8:18 (lit 8:19 ~) (lit 8:21 %.n))))
790+:: (value 9:1 update
791+:: (gate 9:11
792+:: (cell 9:14
793+:: (face 9:15 a (ref 9:17 poke))
794+:: (face 9:22 s (ref 9:24 state)))
795+:: (body 10:3
796+:: (branch 10:3
797+:: (wing 10:6 a)
798+:: (arm 11:5
799+:: (cell 11:5 (lit 11:6 %add) (bind 11:11 item))
800+:: (change 11:18 s
801+:: (edit 11:20 items
802+:: (tuple 11:26 (wing 11:27 item) (wing 11:32 items.s)))))
799803:: (arm 12:5
800−:: (cell 12:5 (lit 12:6 %add) (bind 12:11 item))
804+:: (lit 12:5 %toggle)
801805:: (change 12:18 s
802−:: (edit 12:20 items
803−:: (tuple 12:26 (wing 12:27 item) (wing 12:32 items.s)))))
804−:: (arm 13:5
805−:: (lit 13:5 %toggle)
806−:: (change 13:18 s
807−:: (edit 13:20 open
808−:: (group 13:25
809−:: (call 13:26 (wing 13:26 not) (wing 13:30 open.s)))))))))))
806+:: (edit 12:20 open
807+:: (group 12:25
808+:: (call 12:26 (wing 12:26 not) (wing 12:30 open.s)))))))))))
810809::
811810:: 4.3 Errors (+show-error): "<file>:<line>:<col>: <message>", then the
812811:: source line, then a caret under the column (col - 1 spaces, then ^).
@@ -874,7 +873,7 @@
874873 %'~[' %'|=(' %'$-(' :: openers
875874 %'%/' %'/' :: paths
876875 %'+' %'`' %'=' :: pair, unit, face
877− %'*' %'?' :: noun, loobean mold
876+ %'*' %'?' %'_' :: noun, loobean, type hole
878877 %'++' %'+$' %'|=' %'|$' :: runes
879878 %'^-' %'~&' %'?-' %'!!' :: runes
880879 %'/-' %'/%' %'/=' :: imports
@@ -1016,6 +1015,7 @@
10161015 [%const at=span =lit] :: ~ %add %.y
10171016 [%ref at=span names=(list term)] :: state item.todo
10181017 [%tvar at=span name=@t] :: M
1018+ [%hole at=span ~] :: _
10191019 [%path at=span segs=(list pseg)] :: / /todos /todo/[id=@ud]
10201020 [%apply at=span ref=(list term) args=(list shape)] :: (list @t)
10211021 [%cell at=span fields=(list field)] :: [text=@t done=?]
@@ -1024,9 +1024,9 @@
10241024 [%generic at=span vars=(list @t) body=shape] :: +$ name |$ [M] …
10251025 ==
10261026::
1027−:: +pseg: a path mold's segment, a knot or [name=aura]
1027+:: +pseg: a path mold's segment, a knot, [name=aura], or [name=_]
10281028::
1029−+$ pseg $%([%knot p=@ta] [%typed at=span name=term aura=@ta])
1029++$ pseg $%([%knot p=@ta] [%typed at=span name=term aura=@ta] [%inferred at=span name=term hole-at=span])
10301030::
10311031+| %api
10321032::
@@ -1295,6 +1295,7 @@
12951295 (emit 1 %'=')
12961296 ?: =('`' a) (emit 1 %'`')
12971297 ?: =('*' a) (emit 1 %'*')
1298+ ?: =('_' a) (emit 1 %'_')
12981299 ?: =('~' a)
12991300 ?: =('[' b) (emit 2 %'~[')
13001301 ?: =('&' b) (emit 2 %'~&')
@@ -1670,14 +1671,14 @@
16701671:: What may begin each place the parser reads (section 3, Errors):
16711672:: an expression a-z 0-9 " ( [ ~ % / ` | ^ ? !
16721673:: an operand a-z 0-9 " ( [ ~ % / ` | !
1673−:: a mold a-z A-Z @ * ! ? ~ % / ( [ $
1674+:: a mold a-z A-Z @ * ! ? ~ % / ( [ $ _
16741675:: a pattern a-z 0-9 " ~ % * [
16751676:: and what may go tight after an operand: . ( + = after a name, a
16761677:: closer ) ] }, or the : of a comment
16771678::
16781679++ expr-mask 0x57ff.ffff.4800.0000.83ff.8126.0000.0000
16791680++ operand-mask 0x57ff.ffff.0800.0000.03ff.8126.0000.0000
1680−++ mold-mask 0x47ff.fffe.0fff.ffff.8000.8532.0000.0000
1681+++ mold-mask 0x47ff.fffe.8fff.ffff.8000.8532.0000.0000
16811682++ bar-mask 0x1000.0000.0000.0000.0000.0000.0000.0000
16821683++ pattern-mask 0x47ff.fffe.0800.0000.03ff.0424.0000.0000
16831684++ after-mask 0x2000.0000.2000.0000.2400.4b00.0000.0000
@@ -2107,6 +2108,7 @@
21072108 ?- -.s
21082109 %knot (weld "/" (trip p.s))
21092110 %typed "/[{(trip name.s)}=@{(trip aura.s)}]"
2111+ %inferred "/[{(trip name.s)}=_]"
21102112 ==
21112113::
21122114++ show-tvars
@@ -2318,6 +2320,7 @@
23182320 %const (nod "const" at.s (show-lit lit.s) ~)
23192321 %ref (nod "ref" at.s (show-names names.s) ~)
23202322 %tvar (nod "tvar" at.s (trip name.s) ~)
2323+ %hole (nod "hole" at.s "" ~)
23212324 %path (nod "path" at.s (show-psegs segs.s) ~)
23222325 %apply (nod "apply" at.s (show-names ref.s) (turn args.s sexp-shape))
23232326 %cell (nod "cell" at.s "" (turn fields.s sexp-field))
@@ -3842,6 +3845,7 @@
38423845 %'*' [%& [%noun at.t ~] t.ts]
38433846 %'!!' [%& [%void at.t ~] t.ts]
38443847 %'?' [%& [%flag at.t ~] t.ts]
3848+ %'_' [%& [%hole at.t ~] t.ts]
38453849 [%name *] [%& [%ref at.t ~[p.lex.t]] t.ts]
38463850 [%wing *] [%& [%ref at.t p.lex.t] t.ts]
38473851 [%tvar *] [%& [%tvar at.t p.lex.t] t.ts]
@@ -4058,7 +4062,7 @@
40584062 ?: &(?=(^ nex) tight.i.nex) (bad nex "a path segment")
40594063 (bad-space i.after nex "a path segment")
40604064 ::
4061− :: +read-pseg: a path mold's segment, a knot or [name=aura] with no
4065+ :: +read-pseg: a path mold's knot, [name=aura], or [name=_] with no
40624066 :: spaces, and where it ends
40634067 ::
40644068 ++ read-pseg
@@ -4075,13 +4079,16 @@
40754079 ?: |(?=(~ r2) !tight.i.r2) (bad-space i.r1 r2 "`=`")
40764080 ?. ?=([[* * %'='] *] r2) (bad-in r2 "`=`" tis-mask)
40774081 =/ r3=(list token) t.r2
4078− ?: |(?=(~ r3) !tight.i.r3) (bad-space i.r2 r3 "an aura")
4079− ?. ?=([[* * [%aura *]] *] r3) (bad-in r3 "an aura" pat-mask)
4082+ ?: |(?=(~ r3) !tight.i.r3) (bad-space i.r2 r3 "an aura or type hole")
4083+ ?. ?=([[* * ?([%aura *] %'_')] *] r3) (bad-in r3 "an aura or type hole" (con pat-mask (bex 95)))
40804084 =/ r4=(list token) t.r3
40814085 ?: |(?=(~ r4) !tight.i.r4) (bad-space i.r3 r4 "`]`")
40824086 ?. ?=([[* * %']'] *] r4) (bad-in r4 "`]`" ser-mask)
40834087 =/ at=span [beg.at.op end.at.i.r4]
4084− [%& [[%typed at p.lex.i.r1 p.lex.i.r3] end.at.i.r4] t.r4]
4088+ =/ seg=pseg
4089+ ?: ?=(%'_' lex.i.r3) [%inferred at p.lex.i.r1 at.i.r3]
4090+ [%typed at p.lex.i.r1 p.lex.i.r3]
4091+ [%& [seg end.at.i.r4] t.r4]
40854092 --
40864093::
40874094+| %span-check
@@ -4465,6 +4472,7 @@
44654472 %const [%const at.s ~[%lit] %one ~]
44664473 %ref [%ref at.s ~[%name %wing] %one ~]
44674474 %tvar [%tvar at.s ~[%tvar] %one ~]
4475+ %hole [%hole at.s ~[%'_'] %one ~]
44684476 %apply [%apply at.s ~[%'('] %shut (turn args.s outline-shape)]
44694477 %cell [%cell at.s ~[%'['] %shut (turn fields.s outline-sample)]
44704478 ::
@@ -4473,8 +4481,11 @@
44734481 %+ murn segs.s
44744482 |= g=pseg
44754483 ^- (unit outline)
4476− ?. ?=(%typed -.g) ~
4477− `[%typed at.g ~[%'['] %shut ~]
4484+ ?- -.g
4485+ %knot ~
4486+ %typed `[%typed at.g ~[%'['] %shut ~]
4487+ %inferred `[%typed at.g ~[%'['] %shut ~[[%hole hole-at.g ~[%'_'] %one ~]]]
4488+ ==
44784489 [%path at.s ~[%'/'] %run ks]
44794490 ::
44804491 %union
@@ -4534,6 +4545,8 @@
45344545 [%path [1 9] [1 9] [1 21]]
45354546 [%face [1 7] [1 7] [1 21]]
45364547 ==
4548+ :: an inferred path aura's hole spanning its = as well
4549+ ['+$ x /a/[id=_]' ~[[%hole [1 13] [1 12] [1 14]]]]
45374550 :: an import's path cut short
45384551 ['/= c /ui/c' ~[[%jibb [1 1] [1 1] [1 11]]]]
45394552 :: brackets that close with the deeper lines, cut at their line's
@@ -4593,6 +4606,8 @@
45934606:: Atom constraints tied to an explicit capital or an inferred sample
45944607:: are generalized and printed. Other aura variables remain unsupported until
45954608:: their defaulting and inferred generalization are implemented.
4609+:: Restricted-number promotion considers written capitals only; if there
4610+:: are none, it skips the otherwise unnecessary environment traversal.
45964611:: Bare @ is a separate unrestricted atom type. A directional fit check
45974612:: permits concrete atoms to widen to it, never the reverse. A fit that
45984613:: needs a not-yet-implemented constraint remains unsupported. Named unions
@@ -4600,18 +4615,65 @@
46004615:: from their display name. Generic cases must be disjoint for all arguments.
46014616:: Unnamed union printing is informational; it is not Jibb syntax.
46024617::
4618+:: `proj` is a reserved, type-directed operation, not an ordinary gate.
4619+:: The supported fragment selects uniquely faced fields from a known record
4620+:: in source order (reordering is a doc question). It records the original
4621+:: call, source and target types, and source axes with its definition;
4622+:: A single selected field keeps its face and uses one source axis.
4623+:: Checked module interfaces retain that evidence and their source, including
4624+:: the private prelude dependency. A later lowerer must replace the call by
4625+:: an inline gate applied to the operand once; no lowering is implemented yet.
4626+:: Ordinary fits never insert a projection. Unknown or variable-origin record
4627+:: spines, nested projected fields and projections in
4628+:: recursive groups remain unsupported. Directional fits bound faced-spine
4629+:: proofs to fewer than 1,024 cells; the projection planner has a separate
4630+:: 4,096-step bound. These are inference limits, not language limits.
4631+::
4632+:: Supported API imports derive request-gate types atomically for multiple
4633+:: paths, including one typed segment or one diff fold per case. Their checked
4634+:: ordinary definitions, mark molds and supported poke constructor are also
4635+:: exported. A selected /sur mold is checked through its trusted reader result;
4636+:: unused cores and other bindings are not independently validated. APIs
4637+:: with /= imports, separate scry paths, multiple parameters or diffs, or a
4638+:: parameter together with a fold remain unsupported. The unchanged todo API
4639+:: fits this fragment, including named closed fold gates.
4640+::
4641+:: Each case's source-derived schema and canonical API identity travel in a
4642+:: dependency closure bound to the exact supplied bundle, prelude, scope and
4643+:: trusted reader results. Unknown cached entries are rebuilt. Request-bearing
4644+:: closures are limited to 256 source paths and requests. This is type
4645+:: inference only: no request lowering, runtime schema validator or proof that
4646+:: an arbitrary ask value is watchable is supplied.
4647+::
4648+:: A closed gate sample may omit one outer face from a known input slot when
4649+:: its product is identical. Distinct written names, nested value faces,
4650+:: ambiguous cell tails and raw-variable-origin fits retain their prior rules.
4651+::
4652+:: In one synthetic eval of a 48-module deep and 48-module wide request-free
4653+:: graph, baseline versus certificate inference took 21.53 s versus 23.10 s
4654+:: elapsed (21.10 s versus 22.34 s CPU), including startup. The deep cache's
4655+:: jam grew from 2,402 to 4,209 bytes (+1,807 bytes). These single-run figures
4656+:: are not production memory or performance benchmarks.
4657+::
46034658+$ itype
46044659 $~ [%var 0]
4605− $% [%var id=@ud]
4660+ $% [%var id=@ud]
4661+ [%fvar id=@ud]
46064662 [%avar id=@ud]
4663+ [%rvar id=@ud]
46074664 [%nvar id=@ud]
4665+ [%rnvar id=@ud]
46084666 [%atom aura=@ta]
46094667 [%any-atom ~]
46104668 [%flag ~]
4669+ [%noun ~]
4670+ [%empty ~]
46114671 [%tag id=@ud literal=lit constructor=?]
46124672 [%const literal=lit]
46134673 [%collection name=term args=(list itype)]
46144674 [%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)]
46154677 [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
46164678 [%face name=term body=itype]
46174679 [%fn sample=itype product=itype]
@@ -4619,7 +4681,7 @@
46194681 ==
46204682+$ ibinding [id=@ud val=itype]
46214683+$ isub (list ibinding)
4622−+$ ipending [id=@ud literal=lit]
4684++$ ipending [id=@ud literal=lit at=span]
46234685::
46244686++ itype-lookup
46254687 |= [n=@ud sub=isub]
@@ -4632,39 +4694,143 @@
46324694 |= [t=itype sub=isub]
46334695 ^- itype
46344696 ?+ -.t t
4635− %var
4697+ ?(%var %fvar)
46364698 =/ found=(unit itype) (itype-lookup id.t sub)
46374699 ?~ found t
4700+ ?: &(|(?=(%fvar -.u.found) ?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
46384701 $(t u.found)
46394702 %avar
46404703 =/ found=(unit itype) (itype-lookup id.t sub)
46414704 ?~ found t
4705+ ?: &(|(?=(%fvar -.u.found) ?=(%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+ ?: &(|(?=(%fvar -.u.found) ?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
46424711 $(t u.found)
46434712 %nvar
46444713 =/ found=(unit itype) (itype-lookup id.t sub)
46454714 ?~ found t
4715+ ?: &(|(?=(%fvar -.u.found) ?=(%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+ ?: &(|(?=(%fvar -.u.found) ?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
46464721 $(t u.found)
46474722 %tag
46484723 =/ found=(unit itype) (itype-lookup id.t sub)
46494724 ?~ found t
4725+ ?: &(|(?=(%fvar -.u.found) ?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
46504726 $(t u.found)
46514727 ==
46524728::
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+ %fvar `[%unknown fuel]
4779+ %var
4780+ ?: (lien caps |=(c=icap (hole-same-variable typ (itype-walk [%var id.c] sub)))) `[%yes fuel]
4781+ `[%unknown fuel]
4782+ %face $(typ body.typ)
4783+ %cell
4784+ =/ head=(unit [result=?(%yes %no %unknown) left=@ud]) $(typ hed.typ)
4785+ ?~ head ~
4786+ ?: =(%no result.u.head) head
4787+ =/ tail=(unit [result=?(%yes %no %unknown) left=@ud]) $(typ tal.typ, fuel left.u.head)
4788+ ?~ tail ~
4789+ ?: =(%no result.u.tail) tail
4790+ ?: |(=(%unknown result.u.head) =(%unknown result.u.tail)) `[%unknown left.u.tail]
4791+ `[%yes left.u.tail]
4792+ %union (itype-inhabited-cases cases.typ sub caps fuel |)
4793+ %collection
4794+ ?. &(|(=(%list name.typ) =(%unit name.typ)) ?=([* ~] args.typ)) `[%unknown fuel]
4795+ `[%yes fuel]
4796+ %grec ?:((grec-tree-proof name.typ proof.typ) `[%yes fuel] `[%unknown fuel])
4797+ * `[%unknown fuel]
4798+ ==
4799+++ itype-live-cases
4800+ |= [xs=(list itype) sub=isub caps=icaps fuel=@ud]
4801+ ^- (unit (list itype))
4802+ ?~ xs `~
4803+ =/ first=(unit [result=?(%yes %no %unknown) left=@ud])
4804+ (itype-inhabited-proof i.xs sub caps fuel)
4805+ ?~ first ~
4806+ ?: =(%unknown result.u.first) ~
4807+ =/ rest=(unit (list itype)) $(xs t.xs, fuel left.u.first)
4808+ ?~ rest ~
4809+ ?: =(%no result.u.first) rest
4810+ `[i.xs u.rest]
4811+::
46534812++ itype-occurs
46544813 |= [n=@ud t=itype sub=isub]
46554814 ^- ?
46564815 =. t (itype-walk t sub)
46574816 ?- -.t
46584817 %var =(n id.t)
4818+ %fvar =(n id.t)
46594819 %avar =(n id.t)
4820+ %rvar =(n id.t)
46604821 %nvar =(n id.t)
4822+ %rnvar =(n id.t)
46614823 %atom |
46624824 %any-atom |
46634825 %flag |
4826+ %noun |
4827+ %empty |
46644828 %tag =(n id.t)
46654829 %const |
46664830 %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
46674831 %recursive |
4832+ %jrec |
4833+ %grec (lien args.t |=(c=itype (itype-occurs n c sub)))
46684834 %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
46694835 %face $(t body.t)
46704836 %fn |($(t sample.t) $(t product.t))
@@ -4683,6 +4849,11 @@
46834849 =. a (itype-walk a sub)
46844850 =. b (itype-walk b sub)
46854851 ?: =(a b) `sub
4852+ ?: &(?=(%grec -.a) ?=(%grec -.b))
4853+ ?. &(=(at.a at.b) =(name.a name.b)) ~
4854+ (itype-unify-args args.a args.b sub)
4855+ ?: &(?=(%jrec -.a) ?=(%jrec -.b))
4856+ ?:(&(=(at.a at.b) =(name.a name.b) =(head.a head.b) =(aura.a aura.b) =(tail.a tail.b)) `sub ~)
46864857 ?: &(?=(%recursive -.a) ?=(%recursive -.b))
46874858 ?:(&(=(module.a module.b) =(name.a name.b)) `sub ~)
46884859 ?: &(?=(%union -.a) ?=(%union -.b))
@@ -4699,6 +4870,38 @@
46994870 ?: ?=(%var -.b)
47004871 ?: (itype-occurs id.b a sub) ~
47014872 `[[id.b a] sub]
4873+ ?: ?=(%fvar -.a)
4874+ ?: (itype-occurs id.a b sub) ~
4875+ (itype-bind-gate-free id.a b sub)
4876+ ?: ?=(%fvar -.b)
4877+ ?: (itype-occurs id.b a sub) ~
4878+ (itype-bind-gate-free id.b a sub)
4879+ :: Arithmetic's aura variable excludes loobeans; decimal literals
4880+ :: remain defaultable until a later constraint makes them concrete.
4881+ ?: &(?=(%nvar -.a) ?=(%rvar -.b))
4882+ `[[id.b [%rnvar id.a]] [id.a [%rnvar id.a]] sub]
4883+ ?: &(?=(%rvar -.a) ?=(%nvar -.b))
4884+ `[[id.a [%rnvar id.b]] [id.b [%rnvar id.b]] sub]
4885+ ?: &(?=(%rnvar -.a) ?=(%rvar -.b)) `[[id.b a] sub]
4886+ ?: &(?=(%rvar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4887+ ?: &(?=(%rnvar -.a) ?=(%nvar -.b)) `[[id.b a] sub]
4888+ ?: &(?=(%nvar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4889+ ?: &(?=(%rnvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4890+ ?: &(?=(%avar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4891+ ?: ?=(%rnvar -.a)
4892+ ?. |(?=(%rnvar -.b) ?=(%atom -.b)) ~
4893+ `[[id.a b] sub]
4894+ ?: ?=(%rnvar -.b)
4895+ ?. ?=(%atom -.a) ~
4896+ `[[id.b a] sub]
4897+ ?: &(?=(%avar -.a) ?=(%rvar -.b)) `[[id.a b] sub]
4898+ ?: &(?=(%rvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4899+ ?: ?=(%rvar -.a)
4900+ ?. |(?=(%rvar -.b) ?=(%atom -.b)) ~
4901+ `[[id.a b] sub]
4902+ ?: ?=(%rvar -.b)
4903+ ?. ?=(%atom -.a) ~
4904+ `[[id.b a] sub]
47024905 :: The narrower decimal constraint survives a match with an atom
47034906 :: variable; decimal syntax alone does not make it a loobean.
47044907 ?: &(?=(%nvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
@@ -4731,6 +4934,69 @@
47314934 $(a tal.a, b tal.b, sub u.first)
47324935 ~
47334936::
4937++$ igf-form [typ=itype sub=isub left=@ud]
4938++$ igf-forms [types=(list itype) sub=isub left=@ud]
4939+++ itype-gate-free-forms
4940+ |= [xs=(list itype) sub=isub fuel=@ud]
4941+ ^- (unit igf-forms)
4942+ ?~ xs `[~ sub fuel]
4943+ =/ head=(unit igf-form) (itype-gate-free-form i.xs sub fuel)
4944+ ?~ head ~
4945+ =/ tail=(unit igf-forms) $(xs t.xs, sub sub.u.head, fuel left.u.head)
4946+ ?~ tail ~
4947+ `[[typ.u.head types.u.tail] sub.u.tail left.u.tail]
4948+::
4949+++ itype-gate-free-form
4950+ |= [t=itype sub=isub fuel=@ud]
4951+ ^- (unit igf-form)
4952+ ?: =(0 fuel) ~
4953+ =. fuel (dec fuel)
4954+ =. t (itype-walk t sub)
4955+ ?- -.t
4956+ %var
4957+ =/ free=itype [%fvar id.t]
4958+ `[free [[id.t free] sub] fuel]
4959+ %fvar `[t sub fuel]
4960+ ?(%atom %any-atom %flag %const %empty %avar %rvar %nvar %rnvar %jrec) `[t sub fuel]
4961+ %face
4962+ =/ body=(unit igf-form) $(t body.t, sub sub, fuel fuel)
4963+ ?~ body ~
4964+ `[[%face name.t typ.u.body] sub.u.body left.u.body]
4965+ %cell
4966+ =/ head=(unit igf-form) $(t hed.t, sub sub, fuel fuel)
4967+ ?~ head ~
4968+ =/ tail=(unit igf-form) $(t tal.t, sub sub.u.head, fuel left.u.head)
4969+ ?~ tail ~
4970+ `[[%cell typ.u.head typ.u.tail] sub.u.tail left.u.tail]
4971+ %collection
4972+ =/ args=(unit igf-forms) (itype-gate-free-forms args.t sub fuel)
4973+ ?~ args ~
4974+ `[[%collection name.t types.u.args] sub.u.args left.u.args]
4975+ %union
4976+ =/ cases=(unit igf-forms) (itype-gate-free-forms cases.t sub fuel)
4977+ ?~ cases ~
4978+ =/ args=(unit igf-forms) (itype-gate-free-forms args.t sub.u.cases left.u.cases)
4979+ ?~ args ~
4980+ `[[%union types.u.cases origin.t label.t types.u.args] sub.u.args left.u.args]
4981+ * ~
4982+ ==
4983+::
4984+++ itype-collection-keys
4985+ |= [name=term args=(list itype) sub=isub]
4986+ ^- (unit [types=(list itype) sub=isub])
4987+ ?~ args `[~ sub]
4988+ ?. |(?=(?(%set %map %mop %jar %jug) name)) `[args sub]
4989+ =/ key=(unit igf-form) (itype-gate-free-form i.args sub 256)
4990+ ?~ key ~
4991+ `[[typ.u.key t.args] sub.u.key]
4992+::
4993+++ itype-bind-gate-free
4994+ |= [n=@ud t=itype sub=isub]
4995+ ^- (unit isub)
4996+ =/ constrained=(unit igf-form) (itype-gate-free-form t sub 256)
4997+ ?~ constrained ~
4998+ `[[n typ.u.constrained] sub.u.constrained]
4999+::
47345000++ itype-unify-args
47355001 |= [as=(list itype) bs=(list itype) sub=isub]
47365002 ^- (unit isub)
@@ -4752,15 +5018,22 @@
47525018 =. t (itype-walk t sub)
47535019 ?- -.t
47545020 %var |
5021+ %fvar |
47555022 %avar |
5023+ %rvar |
47565024 %nvar |
5025+ %rnvar |
47575026 %atom |
47585027 %any-atom &
47595028 %flag |
5029+ %noun |
5030+ %empty |
47605031 %tag |
47615032 %const |
47625033 %union |((lien cases.t |=(c=itype (itype-has-any-atom c sub))) (lien args.t |=(c=itype (itype-has-any-atom c sub))))
47635034 %recursive |
5035+ %jrec |
5036+ %grec (lien args.t |=(c=itype (itype-has-any-atom c sub)))
47645037 %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
47655038 %face $(t body.t)
47665039 %fn |($(t sample.t) $(t product.t))
@@ -4822,15 +5095,22 @@
48225095 ^- ?
48235096 ?- -.typ
48245097 %var |
5098+ %fvar |
48255099 %avar |
5100+ %rvar |
48265101 %nvar |
5102+ %rnvar |
48275103 %atom &
48285104 %any-atom &
48295105 %flag &
5106+ %noun |
5107+ %empty |
48305108 %tag &
48315109 %const &
48325110 %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
48335111 %recursive |
5112+ %jrec |
5113+ %grec (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
48345114 %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
48355115 %face $(typ body.typ)
48365116 %fn |($(typ sample.typ) $(typ product.typ))
@@ -4859,6 +5139,7 @@
48595139 ^- ?
48605140 =. t (itype-walk t sub)
48615141 ?- -.t
5142+ %grec (lien args.t |=(c=itype (itype-has-face c sub)))
48625143 %collection (lien args.t |=(c=itype (itype-has-face c sub)))
48635144 %face &
48645145 %cell |($(t hed.t) $(t tal.t))
@@ -4866,6 +5147,42 @@
48665147 * |
48675148 ==
48685149::
5150+:: Closed function samples may omit a slot face, but a known name must
5151+:: match another known name. Keep nested value faces and require exact
5152+:: invariant compatibility; a faced tail against a cell is ambiguous.
5153+++ itype-closed-slot-match
5154+ |= [a=itype b=itype]
5155+ ^- ?
5156+ ?: &(?=(%face -.a) ?=(%face -.b))
5157+ ?. =(name.a name.b) |
5158+ ?=(^ (itype-unify body.a body.b ~))
5159+ ?: ?=(%face -.a) ?=(^ (itype-unify body.a b ~))
5160+ ?: ?=(%face -.b) ?=(^ (itype-unify a body.b ~))
5161+ ?=(^ (itype-unify a b ~))
5162+++ itype-closed-sample-match
5163+ |= [a=itype b=itype fuel=@ud]
5164+ ^- ?
5165+ ?: =(0 fuel) |
5166+ ?. &(?=(%cell -.a) ?=(%cell -.b)) |
5167+ ?. (itype-closed-slot-match hed.a hed.b) |
5168+ =/ x=itype tal.a
5169+ =/ y=itype tal.b
5170+ ?: &(?=(%cell -.x) ?=(%cell -.y))
5171+ ?=(^ (itype-unify x y ~))
5172+ ?: |(&(?=(%face -.x) ?=(%cell -.y)) &(?=(%cell -.x) ?=(%face -.y))) |
5173+ (itype-closed-slot-match x y)
5174+++ itype-closed-gates-match
5175+ |= [a=itype b=itype]
5176+ ^- ?
5177+ ?. &(?=(%fn -.a) ?=(%fn -.b)) |
5178+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) |
5179+ ?. =(product.a product.b) |
5180+ ?^ (itype-vars a) |
5181+ ?^ (itype-vars b) |
5182+ ?: |((itype-has-tag a) (itype-has-tag b)) |
5183+ ?. (itype-closed-sample-match sample.a sample.b 1.024) |
5184+ ?=(^ (itype-unify product.a product.b ~))
5185+::
48695186++ itype-face-asym-collection-args
48705187 |= [as=(list itype) bs=(list itype) sub=isub]
48715188 ^- ?
@@ -4879,12 +5196,15 @@
48795196 ^- ?
48805197 =. a (itype-walk a sub)
48815198 =. b (itype-walk b sub)
5199+ ?: &(?=(%grec -.a) ?=(%grec -.b))
5200+ ?. &(=(at.a at.b) =(name.a name.b)) |
5201+ (itype-face-asym-collection-args args.a args.b sub)
48825202 ?: &(?=(%collection -.a) ?=(%collection -.b))
48835203 ?. =(name.a name.b) |
48845204 (itype-face-asym-collection-args args.a args.b sub)
48855205 ?: &(?=(%face -.a) ?=(%face -.b)) $(a body.a, b body.b)
4886− ?: ?=(%face -.a) !|(?=(%var -.b) ?=(%avar -.b) ?=(%nvar -.b))
4887− ?: ?=(%face -.b) !|(?=(%var -.a) ?=(%avar -.a) ?=(%nvar -.a))
5206+ ?: ?=(%face -.a) !|(?=(%var -.b) ?=(%fvar -.b) ?=(%avar -.b) ?=(%rvar -.b) |(?=(%nvar -.b) ?=(%rnvar -.b)))
5207+ ?: ?=(%face -.b) !|(?=(%var -.a) ?=(%fvar -.a) ?=(%avar -.a) ?=(%rvar -.a) |(?=(%nvar -.a) ?=(%rnvar -.a)))
48885208 ?: &(?=(%cell -.a) ?=(%cell -.b)) |($(a hed.a, b hed.b) $(a tal.a, b tal.b))
48895209 ?: &(?=(%fn -.a) ?=(%fn -.b)) |($(a sample.a, b sample.b) $(a product.a, b product.b))
48905210 |
@@ -4907,6 +5227,30 @@
49075227 [%cell $(actual hed.actual, expected hed.expected) $(actual tal.actual, expected tal.expected)]
49085228 expected
49095229::
5230+:: Positional call arguments do not write the sample's enclosing field
5231+:: labels. Ignore one raw sample-slot face per written argument while
5232+:: checking value faces as usual. An unknown or variable-bound cell spine
5233+:: cannot justify this distinction, so keep the existing conservative guard.
5234+++ itype-positional-slot-face-asym
5235+ |= [actual=itype expected=itype sub=isub]
5236+ ^- ?
5237+ ?: &(?=(%fn -.actual) ?=(%fn -.expected) (itype-closed-gates-match actual expected)) |
5238+ (itype-face-asym actual expected sub)
5239+::
5240+++ itype-positional-face-asym
5241+ |= [args=(list expr) actual=itype expected=itype sub=isub]
5242+ ^- ?
5243+ ?~ args &
5244+ ?~ t.args
5245+ =/ slot=itype expected
5246+ =? slot ?=(%face -.slot) body.slot
5247+ (itype-positional-slot-face-asym actual slot sub)
5248+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) &
5249+ =/ slot=itype hed.expected
5250+ =? slot ?=(%face -.slot) body.slot
5251+ ?: (itype-positional-slot-face-asym hed.actual slot sub) &
5252+ $(args t.args, actual tal.actual, expected tal.expected)
5253+::
49105254++ itype-output-may-be-cell
49115255 |= [t=itype sub=isub]
49125256 ^- ?
@@ -4916,6 +5260,9 @@
49165260 %cell &
49175261 %union &
49185262 %recursive &
5263+ %jrec &
5264+ %grec &
5265+ %noun &
49195266 %collection &
49205267 %face $(t body.t)
49215268 %fn |($(t sample.t) $(t product.t))
@@ -4929,6 +5276,13 @@
49295276 ?~ (itype-lookup id.i.tags sub) &
49305277 $(tags t.tags)
49315278::
5279+++ pending-tag-diagnostic
5280+ |= [tags=(list ipending) sub=isub]
5281+ ^- (unit [at=span msg=tape])
5282+ ?~ tags ~
5283+ ?^ (itype-lookup id.i.tags sub) $(tags t.tags)
5284+ `[at.i.tags (weld "nothing fixes the union of " (show-lit literal.i.tags))]
5285+::
49325286++ pending-null
49335287 |= [tags=(list ipending) sub=isub]
49345288 ^- ?
@@ -4944,6 +5298,7 @@
49445298 ^- ?
49455299 ?- -.t
49465300 %tag &
5301+ %grec (lien args.t |=(c=itype (itype-has-tag c)))
49475302 %collection (lien args.t |=(c=itype (itype-has-tag c)))
49485303 %face $(t body.t)
49495304 %fn |($(t sample.t) $(t product.t))
@@ -4957,6 +5312,7 @@
49575312 ^- ?
49585313 ?- -.t
49595314 %union &
5315+ %grec (lien args.t |=(c=itype (itype-has-union c)))
49605316 %collection (lien args.t |=(c=itype (itype-has-union c)))
49615317 %face $(t body.t)
49625318 %fn |($(t sample.t) $(t product.t))
@@ -4975,6 +5331,7 @@
49755331 %union
49765332 ?: &(?=(~ label.t) ?=(^ args.t)) &
49775333 (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
5334+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-generic c))))
49785335 %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
49795336 %face $(t body.t)
49805337 %fn |($(t sample.t) $(t product.t))
@@ -4987,6 +5344,8 @@
49875344 ^- ?
49885345 ?- -.t
49895346 %recursive &
5347+ %jrec &
5348+ %grec &
49905349 %collection (lien args.t |=(c=itype (itype-has-recursive c)))
49915350 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
49925351 %face $(t body.t)
@@ -5000,6 +5359,8 @@
50005359 ^- ?
50015360 ?- -.t
50025361 %recursive ?=(~ label.t)
5362+ %jrec ?=(~ label.t)
5363+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-recursive c))))
50035364 %collection (lien args.t |=(c=itype (itype-has-hidden-recursive c)))
50045365 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-recursive c)))
50055366 %face $(t body.t)
@@ -5027,34 +5388,107 @@
50275388 $(cases t.cases, good `trial)
50285389 ==
50295390::
5030−:: A constructor needs a case with its tag at the head and a payload
5031−:: compatible with the expected gate sample. Other case forms do not
5032−:: identify a constructor.
5391+:: A constructor needs a case whose head has the same literal noun as its
5392+:: tag. An unresolved or opaque case may reveal one later, so it cannot
5393+:: prove a mismatch or a unique match. A broad atom mold is not a case.
50335394::
50345395++ itype-fit-ctor-cases
50355396 |= [tag=lit sample=itype cases=(list itype) sub=isub next=@ud]
50365397 ^- ifit
50375398 =/ found=(unit ifit) ~
5399+ =/ pending=? |
50385400 |-
5039− ?~ cases ?~(found [%bad ~] u.found)
5040− =/ c=itype (itype-walk i.cases sub)
5401+ ?~ cases
5402+ ?: pending [%unknown ~]
5403+ ?~ found [%bad ~]
5404+ u.found
5405+ =/ raw=itype i.cases
5406+ ?: ?=(%var -.raw)
5407+ $(cases t.cases, pending &)
5408+ =/ c=itype (itype-walk raw sub)
5409+ ?: ?=(?(%var %tag %recursive %jrec %grec %union %face) -.c)
5410+ $(cases t.cases, pending &)
50415411 ?. ?=(%cell -.c) $(cases t.cases)
5042− =/ head=itype (itype-walk hed.c sub)
5412+ =/ raw-head=itype hed.c
5413+ ?: ?=(%var -.raw-head)
5414+ $(cases t.cases, pending &)
5415+ =/ head=itype (itype-walk raw-head sub)
5416+ :: A single faced, explicitly atom-only head cannot be the tag case.
5417+ :: Do not follow variables or peel nested faces for this negative proof.
5418+ ?: ?=(%face -.head)
5419+ ?: ?=(?(%atom %any-atom %flag %avar %rvar %nvar %rnvar) -.body.head)
5420+ $(cases t.cases)
5421+ $(cases t.cases, pending &)
5422+ ?: ?=(?(%var %tag %recursive %jrec %grec %union) -.head)
5423+ $(cases t.cases, pending &)
50435424 ?. ?=(%const -.head) $(cases t.cases)
5044− ?. =(%term form.literal.head) $(cases t.cases)
50455425 ?. =(val.literal.head val.tag) $(cases t.cases)
5046− ?^ found [%unknown ~]
5426+ :: Equal heads can have disjoint payloads. Test each from the original
5427+ :: substitution; a unique success is usable only with no unknown rival.
50475428 =/ trial=ifit (itype-fit sample tal.c sub next)
5048− $(cases t.cases, found `trial)
5429+ ?- -.trial
5430+ %bad $(cases t.cases)
5431+ %unknown $(cases t.cases, pending &)
5432+ %ok
5433+ ?^ found [%unknown ~]
5434+ $(cases t.cases, found `trial)
5435+ ==
50495436::
50505437++ itype-fit
50515438 |= [actual=itype expected=itype sub=isub next=@ud]
50525439 ^- ifit
5440+ =/ result=ifit (itype-fit-inner actual expected sub next | |)
5441+ ?: ?=(%ok -.result) result
5442+ =/ source=itype (itype-walk actual sub)
5443+ ?. ?=(?(%empty %face %cell %union) -.source) result
5444+ =/ empty=(unit [empty=? left=@ud]) (itype-empty-proof actual sub 256)
5445+ ?~ empty [%unknown ~]
5446+ ?: empty.u.empty [%ok sub next]
5447+ result
5448+++ itype-fit-inner
5449+ |= [actual=itype expected=itype sub=isub next=@ud skip-width=? spine-proof=?]
5450+ ^- ifit
5451+ ?: &(!skip-width ?=(%cell -.actual) ?=(%cell -.expected) |((width-spine-exhausted actual 1.024) (width-spine-exhausted expected 1.024)))
5452+ [%unknown ~]
5453+ =/ known=(unit [source=iwfields target=iwfields])
5454+ ?: skip-width ~
5455+ (width-known-shape actual expected sub)
5456+ =/ too-wide=? ?~(known | (gth (lent order.source.u.known) (lent order.target.u.known)))
5457+ ?: too-wide [%unknown ~]
5458+ =/ spine-checked=? |(spine-proof ?=(^ known))
50535459 =/ uncertain=?
5054− |(?=(%var -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%var -.expected) ?=(%avar -.expected) ?=(%nvar -.expected))
5460+ |(?=(%var -.actual) ?=(%fvar -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)) ?=(%var -.expected) ?=(%fvar -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected)))
5461+ =/ actual-open=?
5462+ |(?=(%var -.actual) ?=(%fvar -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)))
50555463 =. actual (itype-walk actual sub)
50565464 =. expected (itype-walk expected sub)
50575465 ?: =(actual expected) [%ok sub next]
5466+ ?: &(?=(%empty -.expected) |(?=(%cell -.actual) ?=(%face -.actual) ?=(%union -.actual) ?=(%grec -.actual) ?=(%recursive -.actual))) [%unknown ~]
5467+ :: The relation of the source loobean mold to explicit @f is not yet
5468+ :: established. Keep it unsupported rather than asserting a mismatch.
5469+ ?: &(?=(%flag -.actual) ?=(%atom -.expected) =(%f aura.expected)) [%unknown ~]
5470+ :: Any value can be used where a noun is expected. An unresolved
5471+ :: bare tag is fixed as a constant; a constructor still needs a gate.
5472+ ?: ?=(%noun -.expected)
5473+ ?: ?=(%tag -.actual)
5474+ ?: constructor.actual [%unknown ~]
5475+ [%ok [[id.actual expected] sub] next]
5476+ [%ok sub next]
5477+ :: An arbitrary noun is not known to fit a narrower type.
5478+ ?: &(?=(%noun -.actual) !?=(%var -.expected)) [%unknown ~]
5479+ ?: &(!uncertain ?=(%grec -.actual) ?=(%face -.expected)) $(expected body.expected)
5480+ ?: &(!uncertain ?=(%face -.actual) ?=(%grec -.expected)) $(actual body.actual)
5481+ ?: &(?=(%grec -.actual) ?=(%grec -.expected))
5482+ ?. &(=(at.actual at.expected) =(name.actual name.expected)) [%unknown ~]
5483+ =/ matched=(unit isub) (itype-unify-args args.actual args.expected sub)
5484+ ?~ matched [%unknown ~]
5485+ [%ok u.matched next]
5486+ ?: &(|(?=(%grec -.actual) ?=(%grec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5487+ ?: &(!uncertain ?=(%jrec -.actual) ?=(%face -.expected)) $(expected body.expected)
5488+ ?: &(!uncertain ?=(%face -.actual) ?=(%jrec -.expected)) $(actual body.actual)
5489+ ?: &(?=(%jrec -.actual) ?=(%jrec -.expected))
5490+ ?:(&(=(at.actual at.expected) =(name.actual name.expected) =(head.actual head.expected) =(aura.actual aura.expected) =(tail.actual tail.expected)) [%ok sub next] [%bad ~])
5491+ ?: &(|(?=(%jrec -.actual) ?=(%jrec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
50585492 ?: &(?=(%recursive -.actual) ?=(%recursive -.expected))
50595493 ?:(&(=(module.actual module.expected) =(name.actual name.expected)) [%ok sub next] [%bad ~])
50605494 ?: &(|(?=(%recursive -.actual) ?=(%recursive -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
@@ -5066,8 +5500,21 @@
50665500 =/ unified=(unit isub) (itype-unify-args args.actual args.expected sub)
50675501 ?^ unified [%ok u.unified next]
50685502 [%unknown ~]
5503+ :: A known union can instantiate an unconstrained sample directly;
5504+ :: preserve unknown results for variable-bound union origins.
5505+ ?: &(!actual-open ?=(%union -.actual) ?=(%var -.expected))
5506+ ?~ origin.actual [%unknown ~]
5507+ =/ normalized=itype (itype-normalize actual sub)
5508+ ?: |((itype-has-tag normalized) (itype-has-recursive normalized) (itype-has-any-atom actual sub)) [%unknown ~]
5509+ =/ unified=(unit isub) (itype-unify actual expected sub)
5510+ ?~ unified [%unknown ~]
5511+ [%ok u.unified next]
5512+ :: A concrete union value in a tuple may acquire the expected field's
5513+ :: face. A variable-bound union still needs face propagation support.
5514+ ?: &(!uncertain ?=(%union -.actual) ?=(%face -.expected))
5515+ $(expected body.expected)
50695516 ?: ?=(%union -.actual) [%unknown ~]
5070− ?: &(?=(%union -.expected) |(?=(%avar -.actual) ?=(%nvar -.actual))) [%unknown ~]
5517+ ?: &(?=(%union -.expected) |(?=(%fvar -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)))) [%unknown ~]
50715518 ?: &(?=(%union -.expected) !?=(%var -.actual))
50725519 (itype-fit-cases actual cases.expected sub next)
50735520 ?: ?=(%tag -.actual)
@@ -5075,7 +5522,7 @@
50755522 =/ u=(unit isub) (itype-unify actual expected sub)
50765523 ?~ u [%bad ~]
50775524 [%ok u.u next]
5078− ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5525+ ?: |(?=(%fvar -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
50795526 ?: ?=(%face -.expected) $(expected body.expected)
50805527 ?: constructor.actual
50815528 ?. ?=(%fn -.expected) [%bad ~]
@@ -5084,6 +5531,10 @@
50845531 =/ trial=ifit (itype-fit-ctor-cases literal.actual sample.expected cases sub next)
50855532 ?. ?=(%ok -.trial) trial
50865533 [%ok [[id.actual expected] sub.trial] next.trial]
5534+ :: Zero may be the empty list. A nested cell fit lacks the context
5535+ :: needed to resolve it here, so do not report a definite mismatch.
5536+ ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5537+ [%unknown ~]
50875538 ?: ?=(%const -.expected)
50885539 ?:(=(val.literal.actual val.literal.expected) [%ok [[id.actual expected] sub] next] [%bad ~])
50895540 ?: ?=(%atom -.expected)
@@ -5099,20 +5550,39 @@
50995550 =/ u=(unit isub) (itype-unify actual expected sub)
51005551 ?~ u [%bad ~]
51015552 [%ok u.u next]
5102− ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5553+ ?: |(?=(%fvar -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
51035554 ?: ?=(%face -.expected) $(expected body.expected)
5555+ ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5556+ [%unknown ~]
51045557 ?: ?=(%const -.expected)
51055558 ?:(=(val.literal.actual val.literal.expected) [%ok sub next] [%bad ~])
51065559 ?: ?=(%atom -.expected)
5560+ :: A loobean singleton must not silently widen into another aura.
5561+ ?: =(%loobean form.literal.actual)
5562+ ?: =(%f aura.expected) [%unknown ~]
5563+ [%bad ~]
51075564 ?: |(=(%tas aura.expected) =(%ta aura.expected)) [%ok sub next]
51085565 [%bad ~]
51095566 ?: ?=(%flag -.expected)
51105567 ?:(|(=(0 val.literal.actual) =(1 val.literal.actual)) [%ok sub next] [%bad ~])
51115568 ?: ?=(%any-atom -.expected) [%ok sub next]
51125569 [%bad ~]
5570+ :: A field on an expected sample slot labels the value's type; it does
5571+ :: not become a face on the actual argument. Unify with the slot body
5572+ :: rather than binding either variable to the face around the other.
5573+ ?: &(?=(%var -.actual) ?=(%face -.expected))
5574+ =/ unified=(unit isub) (itype-unify actual body.expected sub)
5575+ ?~ unified [%unknown ~]
5576+ [%ok u.unified next]
51135577 ?: &(uncertain (itype-face-asym actual expected sub)) [%unknown ~]
5578+ :: A known face labels the same noun. Peel it before applying the
5579+ :: directional unrestricted-atom rule, preserving raw-variable guards.
5580+ ?: &(!uncertain ?=(%any-atom -.actual) ?=(%face -.expected))
5581+ $(expected body.expected, skip-width |, spine-proof |)
5582+ ?: &(!uncertain ?=(%any-atom -.expected) ?=(%face -.actual))
5583+ $(actual body.actual, skip-width |, spine-proof |)
51145584 ?: ?=(%any-atom -.expected)
5115− ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%flag -.actual)) [%ok sub next]
5585+ ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)) ?=(%flag -.actual)) [%ok sub next]
51165586 ?: ?=(%var -.actual)
51175587 =/ unified=(unit isub) (itype-unify actual [%avar next] sub)
51185588 ?~ unified [%bad ~]
@@ -5123,28 +5593,20 @@
51235593 =/ unified=(unit isub) (itype-unify actual expected sub)
51245594 ?~ unified [%bad ~]
51255595 [%ok u.unified next]
5126− ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5596+ ?: |(?=(%fvar -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
51275597 [%bad ~]
51285598 ?: &(?=(%atom -.actual) ?=(%atom -.expected))
51295599 ?: (aura-prefix aura.expected aura.actual) [%ok sub next]
51305600 ?: &((aura-prefix aura.actual aura.expected) uncertain) [%unknown ~]
51315601 [%bad ~]
51325602 ?: &(?=(%cell -.actual) ?=(%cell -.expected))
5133− =/ first=ifit $(actual hed.actual, expected hed.expected)
5603+ =/ first=ifit $(actual hed.actual, expected hed.expected, skip-width |, spine-proof |)
51345604 ?. ?=(%ok -.first) first
5135− $(actual tal.actual, expected tal.expected, sub sub.first, next next.first)
5136− :: A field may add a face to an occurrence of the very same type
5137− :: variable. Binding that variable to a face around itself would fail
5138− :: the occurs check, but its underlying type has already matched.
5139− ?: &(?=(%var -.actual) ?=(%face -.expected) =(actual (itype-walk body.expected sub)))
5140− [%ok sub next]
5141− :: Differing variables and faces need propagation that is not yet
5142− :: represented. Binding one to the face can create a false mismatch.
5143− ?: &(?=(%var -.actual) ?=(%face -.expected)) [%unknown ~]
5605+ $(actual tal.actual, expected tal.expected, sub sub.first, next next.first, skip-width spine-checked, spine-proof spine-checked)
51445606 ?: &(?=(%face -.actual) ?=(%var -.expected)) [%unknown ~]
51455607 ?: &(?=(%var -.actual) (itype-has-any-atom expected sub))
51465608 [%unknown ~]
5147− ?: |(?=(%var -.actual) ?=(%var -.expected))
5609+ ?: |(?=(%var -.actual) ?=(%var -.expected) ?=(%fvar -.expected))
51485610 =/ unified=(unit isub) (itype-unify actual expected sub)
51495611 ?~ unified
51505612 ?: |(?=(%face -.actual) ?=(%face -.expected)) [%unknown ~]
@@ -5154,9 +5616,10 @@
51545616 [%ok u.unified next]
51555617 ?: &(?=(%face -.actual) ?=(%face -.expected))
51565618 ?. =(name.actual name.expected) [%bad ~]
5157− $(actual body.actual, expected body.expected)
5158− ?: ?=(%face -.actual) $(actual body.actual)
5159− ?: ?=(%face -.expected) $(expected body.expected)
5619+ $(actual body.actual, expected body.expected, skip-width |, spine-proof |)
5620+ ?: ?=(%face -.actual) $(actual body.actual, skip-width |, spine-proof |)
5621+ ?: ?=(%face -.expected) $(expected body.expected, skip-width |, spine-proof |)
5622+ ?: &(!uncertain (itype-closed-gates-match actual expected)) [%ok sub next]
51605623 ?: (itype-face-asym actual expected sub) [%unknown ~]
51615624 ?: |((itype-has-any-atom actual sub) (itype-has-any-atom expected sub))
51625625 [%unknown ~]
@@ -5223,16 +5686,61 @@
52235686 (itype-fit [%collection %list ~[a]] list-t ~[[0 recursive]] 1)
52245687 =? problems !?=(%unknown -.nested-fit)
52255688 ["recursive types behind substitutions should remain uncertain" problems]
5689+ =/ free=itype [%fvar 40]
5690+ =/ open-cell=itype [%cell [%var 41] [%face %x [%var 42]]]
5691+ =/ constrained=(unit isub) (itype-unify free open-cell ~)
5692+ =/ expected-cell=itype [%cell [%fvar 41] [%face %x [%fvar 42]]]
5693+ =? problems !=(constrained [~ [[40 expected-cell] [[42 [%fvar 42]] [[41 [%fvar 41]] ~]]]])
5694+ ["gate-free constraints should propagate through cells and faces" problems]
5695+ =? problems ?=(^ (itype-unify free open-cell ~[[41 [%fn txt txt]]]))
5696+ ["an existing nested gate substitution should be rejected" problems]
5697+ =/ shared-sub=isub [[42 [%fvar 42]] [[41 [%fvar 41]] ~]]
5698+ =? problems ?=(^ (itype-unify [%var 41] [%fn txt txt] shared-sub))
5699+ ["a later nested gate substitution should be rejected" problems]
5700+ =? problems ?=(^ (itype-unify free [%fn txt txt] ~))
5701+ ["a gate-free variable should reject a gate" problems]
5702+ =? problems ?=(^ (itype-unify free [%noun ~] ~))
5703+ ["a gate-free variable should reject an opaque noun" problems]
5704+ =/ atom-strong=(unit isub) (itype-unify [%avar 43] free ~)
5705+ =? problems !=(atom-strong [~ [[40 [%avar 43]] ~]])
5706+ ["the atom constraint should be stronger than gate-free" problems]
5707+ =/ free-fit=ifit (itype-fit txt free ~ 44)
5708+ =? problems !?=(%ok -.free-fit)
5709+ ["a concrete atom should fit a gate-free variable" problems]
5710+ =/ gate-fit=ifit (itype-fit [%fn txt txt] free ~ 44)
5711+ =? problems !?=(%bad -.gate-fit)
5712+ ["a gate should not fit a gate-free variable" problems]
5713+ =/ free-scheme=ischeme [[%fn free free] ~[40]]
5714+ =/ canonical-free=itype (canonical-itype typ.free-scheme vars.free-scheme)
5715+ =? problems !=(canonical-free [%fn [%fvar 0] [%fvar 0]])
5716+ ["canonicalization should retain gate-free variables" problems]
5717+ =? problems !=((show-atom-constraint canonical-free) " where A contains no gates")
5718+ ["the printer should show gate-free constraints" problems]
52265719 problems
52275720::
52285721:: The expression inference below is deliberately a fragment: bindings,
5229−:: simple gates, calls, fixed-aura literals, and plain strings. The
5722+:: simple gates, calls, fixed-aura literals, and some interpolated strings. The
52305723:: result for unsupported syntax is a diagnostic, never a checked module.
52315724::
52325725+$ ischeme [typ=itype vars=(list @ud)]
52335726+$ ienv (list [name=term scheme=ischeme])
52345727+$ imold-types (list [name=term template=ischeme])
5235−+$ ifile [values=ienv molds=imold-types at=path]
5728++$ iderived [name=term agent=term mark=term]
5729++$ iwidth-definition [name=term original=expr typ=itype sub=isub projections=(list iwprojection)]
5730++$ iwidth-dependency [at=path source=(unit @t) definitions=(list iwidth-definition)]
5731+:: Nonrecursive request evidence is compiler-owned metadata, not a property
5732+:: of an arbitrary ask value. Reader graphs and source inputs are trusted.
5733++$ irequest-evidence
5734+ [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]
5735+:: Store requests have their own source-bound evidence. In particular, an
5736+:: API path certificate cannot make a store state member watchable, or vice versa.
5737++$ istore-request-evidence
5738+ [store-at=path source=@t state=itype action-name=term action=itype]
5739+:: A unit distinguishes a verified empty closure from a detached legacy file.
5740+:: The opaque prelude is an exact trusted input, not a recursive interface mold.
5741++$ irequest-graph
5742+ [paths=(set path) requests=(list irequest-evidence) stores=(list istore-request-evidence) bundle-input=* prelude-input=* prelude-values=(list term) prelude-molds=(list term) externals=iexternals marks=imark-externals]
5743++$ 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)]
52365744+$ ijimports (list [face=term interface=ifile])
52375745+$ icap [name=@t id=@ud at=span]
52385746+$ icaps (list icap)
@@ -5242,7 +5750,171 @@
52425750:: This core has no Ford dependencies; unrecognized payloads fail closed.
52435751+$ iexternals (list [module=term name=term result=*])
52445752+$ imark-externals (list [mark=term result=*])
5245−+$ 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)]
5753+:: Hole obligations survive discarded expressions until their owning
5754+:: definition has inferred; their source spans support unresolved reports.
5755++$ ihole [id=@ud at=span]
5756+:: Recursive-mold unfolding spends fuel in the threaded inference state.
5757+:: Retries can restart from an earlier state, so this bounds an attempt,
5758+:: not all parsing or module-checking work.
5759+:: Experimental: only closed, uniquely faced records have known axes.
5760++$ iwfield [name=term axis=@ud typ=itype]
5761++$ iwfields [order=(list iwfield) index=(map term iwfield)]
5762++$ iwstep [name=term axis=@ud]
5763++$ iwidth-result [steps=(list iwstep) sub=isub next=@ud]
5764++$ iwprojection [at=span original=expr source=itype target=itype steps=(list iwstep)]
5765+++ width-scan
5766+ |= [typ=itype sub=isub axis=@ud fuel=@ud]
5767+ ^- (unit iwfields)
5768+ =/ order=(list iwfield) ~
5769+ =/ index=(map term iwfield) *(map term iwfield)
5770+ |-
5771+ ?: =(0 fuel) ~
5772+ ?: |(?=(%var -.typ) ?=(%avar -.typ) ?=(%rvar -.typ) ?=(%nvar -.typ) ?=(%rnvar -.typ)) ~
5773+ ?: ?=(%face -.typ)
5774+ =/ entry=iwfield [name.typ axis body.typ]
5775+ ?: ?=(^ (~(get by index) name.entry)) ~
5776+ `[(flop [entry order]) (~(put by index) name.entry entry)]
5777+ ?. ?=(%cell -.typ) ~
5778+ =/ head=itype hed.typ
5779+ ?: |(?=(%var -.head) ?=(%avar -.head) ?=(%rvar -.head) ?=(%nvar -.head) ?=(%rnvar -.head)) ~
5780+ ?. ?=(%face -.head) ~
5781+ =/ entry=iwfield [name.head (mul 2 axis) body.head]
5782+ ?: ?=(^ (~(get by index) name.entry)) ~
5783+ $(typ tal.typ, axis +((mul 2 axis)), fuel (dec fuel), order [entry order], index (~(put by index) name.entry entry))
5784+++ width-in-order
5785+ |= [source=(list iwfield) target=(list iwfield)]
5786+ ^- ?
5787+ ?~ target &
5788+ ?~ source |
5789+ ?: =(name.i.source name.i.target) $(source t.source, target t.target)
5790+ $(source t.source)
5791+++ width-fit-fields
5792+ |= [source=(map term iwfield) target=(list iwfield) sub=isub next=@ud]
5793+ ^- (unit iwidth-result)
5794+ ?~ target `[~ sub next]
5795+ =/ found=(unit iwfield) (~(get by source) name.i.target)
5796+ ?~ found ~
5797+ =/ fit=ifit (itype-fit typ.u.found typ.i.target sub next)
5798+ ?. ?=(%ok -.fit) ~
5799+ =/ rest=(unit iwidth-result) $(target t.target, sub sub.fit, next next.fit)
5800+ ?~ rest ~
5801+ `[[[name.i.target axis.u.found] steps.u.rest] sub.u.rest next.u.rest]
5802+++ width-spine-exhausted
5803+ |= [t=itype fuel=@ud]
5804+ ^- ?
5805+ ?: =(0 fuel) &
5806+ ?. ?=(%cell -.t) |
5807+ ?. ?=(%face -.hed.t) |
5808+ $(t tal.t, fuel (dec fuel))
5809+++ width-known-shape
5810+ |= [actual=itype expected=itype sub=isub]
5811+ ^- (unit [source=iwfields target=iwfields])
5812+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
5813+ =/ source=(unit iwfields) (width-scan actual sub 1 1.024)
5814+ =/ target=(unit iwfields) (width-scan expected sub 1 1.024)
5815+ ?~ source ~
5816+ ?~ target ~
5817+ `[u.source u.target]
5818+::
5819+++ width-shape
5820+ |= [actual=itype expected=itype sub=isub]
5821+ ^- (unit [source=iwfields target=iwfields])
5822+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
5823+ =/ source=(unit iwfields) (width-scan actual sub 1 4.096)
5824+ =/ target=(unit iwfields) (width-scan expected sub 1 4.096)
5825+ ?~ source ~
5826+ ?~ target ~
5827+ ?. (gth (lent order.u.source) (lent order.u.target)) ~
5828+ `[u.source u.target]
5829+++ width-proj-shape
5830+ |= [actual=itype expected=itype sub=isub]
5831+ ^- (unit [source=iwfields target=iwfields])
5832+ ?. &(|(?=(%cell -.actual) ?=(%face -.actual)) |(?=(%cell -.expected) ?=(%face -.expected))) ~
5833+ =/ source=(unit iwfields) (width-scan actual sub 1 4.096)
5834+ =/ target=(unit iwfields) (width-scan expected sub 1 4.096)
5835+ ?~ source ~
5836+ ?~ target ~
5837+ ?: (lth (lent order.u.source) (lent order.u.target)) ~
5838+ `[u.source u.target]
5839+::
5840+++ width-project
5841+ |= [shape=[source=iwfields target=iwfields] sub=isub next=@ud]
5842+ ^- (unit iwidth-result)
5843+ ?. (width-in-order order.source.shape order.target.shape) ~
5844+ (width-fit-fields index.source.shape order.target.shape sub next)
5845+::
5846+:: Provisional, globally budgeted gate-free proof. %no includes a
5847+:: gate-bearing witness; an uninhabited sibling could invalidate it.
5848+:: Input types must be resolved and normalized under valid substitutions,
5849+:: from trusted source-backed interfaces and reader results. Collection
5850+:: list/unit names rely on their existing identity invariant; this arm
5851+:: does not validate fabricated internal types.
5852++$ igf-segment
5853+ $% [%field name=term]
5854+ [%head ~]
5855+ [%tail ~]
5856+ [%item ~]
5857+ [%case index=@ud]
5858+ ==
5859++$ igate-free [verdict=?(%yes %no %unknown) inhabited=? left=@ud path=(unit (list igf-segment))]
5860+++ gate-free-types
5861+ |= [types=(list itype) fuel=@ud path=(list igf-segment) index=@ud]
5862+ ^- igate-free
5863+ ?~ types [%yes | fuel ~]
5864+ ?: =(0 fuel) [%unknown | 0 ~]
5865+ =/ first=igate-free (gate-free-type i.types fuel [[%case index] path])
5866+ ?: =(%no verdict.first) first
5867+ =/ rest=igate-free $(types t.types, fuel left.first, index +(index))
5868+ ?: =(%no verdict.rest) rest
5869+ =/ inhabited=? |(inhabited.first inhabited.rest)
5870+ ?: |(=(%unknown verdict.first) =(%unknown verdict.rest)) [%unknown inhabited left.rest ~]
5871+ [%yes inhabited left.rest ~]
5872+++ gate-free-type
5873+ |= [typ=itype fuel=@ud path=(list igf-segment)]
5874+ ^- igate-free
5875+ ?: =(0 fuel) [%unknown | 0 ~]
5876+ =. fuel (dec fuel)
5877+ ?- -.typ
5878+ %fn [%no & fuel `(flop path)]
5879+ %atom [%yes & fuel ~]
5880+ %any-atom [%yes & fuel ~]
5881+ %flag [%yes & fuel ~]
5882+ %const [%yes & fuel ~]
5883+ %face $(typ body.typ, path [[%field name.typ] path])
5884+ %cell
5885+ =/ head=igate-free $(typ hed.typ, path [[%head ~] path])
5886+ =/ tail=igate-free $(typ tal.typ, fuel left.head, path [[%tail ~] path])
5887+ =/ inhabited=? &(inhabited.head inhabited.tail)
5888+ ?: |(&(=(%yes verdict.head) !inhabited.head) &(=(%yes verdict.tail) !inhabited.tail)) [%yes | left.tail ~]
5889+ ?: &(=(%no verdict.head) inhabited.tail) head(left left.tail)
5890+ ?: &(=(%no verdict.tail) inhabited.head) tail
5891+ ?: |(!=(%yes verdict.head) !=(%yes verdict.tail)) [%unknown inhabited left.tail ~]
5892+ [%yes inhabited left.tail ~]
5893+ %collection
5894+ ?. |(=(%list name.typ) =(%unit name.typ)) [%unknown | fuel ~]
5895+ ?. ?=([* ~] args.typ) [%unknown | fuel ~]
5896+ =/ item=igate-free $(typ i.args.typ, path [[%item ~] path])
5897+ item(inhabited &)
5898+ %union
5899+ ?~ cases.typ [%unknown | fuel ~]
5900+ (gate-free-types cases.typ fuel path 0)
5901+ %noun [%unknown & fuel ~]
5902+ %empty [%yes | fuel ~]
5903+ %var [%unknown | fuel ~]
5904+ %fvar [%yes & fuel ~]
5905+ %avar [%yes & fuel ~]
5906+ %rvar [%yes & fuel ~]
5907+ %nvar [%yes & fuel ~]
5908+ %rnvar [%yes & fuel ~]
5909+ %tag [%unknown | fuel ~]
5910+ %recursive [%unknown | fuel ~]
5911+ %jrec [%yes & fuel ~]
5912+ %grec [%unknown | fuel ~]
5913+ ==
5914+::
5915++$ igate-prelude-evidence [iface=ifile gates=(map term def)]
5916++$ dgo [left=itype right=itype at=span context=span]
5917++$ 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)]
52465918+$ idiag [msg=tape sites=(list [at=span note=tape])]
52475919+$ iresult (each [typ=itype state=istate] idiag)
52485920+$ isample-result (each [typ=itype env=ienv state=istate] tape)
@@ -5262,6 +5934,7 @@
52625934 |= [t=itype sub=isub]
52635935 ^- itype
52645936 =. t (itype-walk t sub)
5937+ ?: ?=(%grec -.t) t(args (turn args.t |=(c=itype (itype-normalize c sub))))
52655938 ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
52665939 ?: ?=(%union -.t)
52675940 [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
@@ -5278,6 +5951,8 @@
52785951:: generalize an aura from its sample, which requires constraint analysis
52795952:: beyond this fragment; leave those cases unresolved.
52805953::
5954+:: This helper only controls decimal defaulting in visible types. A noun
5955+:: may contain gates and is not proof of a gate-free value.
52815956++ itype-has-gate
52825957 |= t=itype
52835958 ^- ?
@@ -5285,17 +5960,24 @@
52855960 %fn &
52865961 %cell |($(t hed.t) $(t tal.t))
52875962 %recursive |
5963+ %jrec |
5964+ %grec &
52885965 %collection (lien args.t |=(c=itype (itype-has-gate c)))
52895966 %face $(t body.t)
52905967 %union (lien cases.t |=(c=itype (itype-has-gate c)))
52915968 %tag |
52925969 %const |
52935970 %var |
5971+ %fvar |
52945972 %avar |
5973+ %rvar |
52955974 %nvar |
5975+ %rnvar |
52965976 %atom |
52975977 %any-atom |
52985978 %flag |
5979+ %noun |
5980+ %empty |
52995981 ==
53005982::
53015983++ default-decimals
@@ -5304,26 +5986,138 @@
53045986 ?: (itype-has-gate t) t
53055987 ?- -.t
53065988 %nvar [%atom %ud]
5989+ %rnvar [%atom %ud]
5990+ %grec t(args (turn args.t |=(c=itype (default-decimals c))))
53075991 %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
53085992 %face [%face name.t $(t body.t)]
53095993 %cell [%cell $(t hed.t) $(t tal.t)]
53105994 * t
53115995 ==
53125996::
5997+:: A hole is solved only by a fully determined type or a written
5998+:: in-scope type variable. Ordinary fresh variables are not evidence.
5999+:: Compare representatives after substitution, since unification can
6000+:: orient a written capital toward the hole rather than the reverse.
6001+++ hole-variable-id
6002+ |= t=itype
6003+ ^- (unit @ud)
6004+ ?- -.t
6005+ %var `id.t
6006+ %fvar `id.t
6007+ %avar `id.t
6008+ %rvar `id.t
6009+ %nvar `id.t
6010+ %rnvar `id.t
6011+ %tag `id.t
6012+ * ~
6013+ ==
6014+++ hole-same-variable
6015+ |= [a=itype b=itype]
6016+ ^- ?
6017+ =/ x=(unit @ud) (hole-variable-id a)
6018+ ?~ x |
6019+ =/ y=(unit @ud) (hole-variable-id b)
6020+ ?~ y |
6021+ =(u.x u.y)
6022+++ hole-known
6023+ |= [t=itype state=istate]
6024+ ^- ?
6025+ =. t (itype-walk t sub.state)
6026+ ?- -.t
6027+ ?(%var %fvar %avar %rvar %nvar %rnvar)
6028+ ?: (lien caps.state |=(c=icap (hole-same-variable t (itype-walk [%var id.c] sub.state)))) &
6029+ (lien params.state |=(p=[name=@t typ=itype] (hole-same-variable t (itype-walk typ.p sub.state))))
6030+ %tag |
6031+ %any-atom &
6032+ %union &((levy cases.t |=(c=itype (hole-known c state))) (levy args.t |=(c=itype (hole-known c state))))
6033+ %grec (levy args.t |=(c=itype (hole-known c state)))
6034+ %collection (levy args.t |=(c=itype (hole-known c state)))
6035+ %face $(t body.t)
6036+ %fn &($(t sample.t) $(t product.t))
6037+ %cell &($(t hed.t) $(t tal.t))
6038+ * &
6039+ ==
6040+++ promote-restricted-numbers
6041+ |= [state=istate env=ienv]
6042+ ^- istate
6043+ :: With no written capitals, there is nothing to promote.
6044+ ?~ caps.state state
6045+ =/ ids=(list @ud) (turn caps.state |=(c=icap id.c))
6046+ =/ free=(list @ud) (free-env-vars env sub.state)
6047+ |-
6048+ ?~ ids state
6049+ =/ t=itype (itype-walk [%var i.ids] sub.state)
6050+ ?: &(?=(%rnvar -.t) !(lien free |=(n=@ud =(n +.t))))
6051+ $(ids t.ids, state state(sub [[+.t [%rvar +.t]] sub.state]))
6052+ $(ids t.ids)
6053+::
6054+++ default-hole-numbers
6055+ |= [all=(list ihole) prior=(list ihole) state=istate env=ienv permit=?]
6056+ ^- istate
6057+ :: Do not default a named capital or a variable captured from env.
6058+ ?. permit state
6059+ ?: =(all prior) state
6060+ ?~ all state
6061+ =/ t=itype (itype-walk [%var id.i.all] sub.state)
6062+ =/ free=(list @ud) (free-env-vars env sub.state)
6063+ =? state &(?=(?(%nvar %rnvar) -.t) !(hole-known t state) !(lien free |=(id=@ud =(id id.t))))
6064+ state(sub [[id.t [%atom %ud]] sub.state])
6065+ $(all t.all)
6066+::
6067+:: Only obligations created inside this definition belong to it.
6068+++ holes-created
6069+ |= [all=(list ihole) prior=(list ihole)]
6070+ ^- (list ihole)
6071+ ?: =(all prior) ~
6072+ ?~ all ~
6073+ [i.all $(all t.all)]
6074+++ hole-uncertain
6075+ |= [t=itype state=istate]
6076+ ^- ?
6077+ =. t (itype-walk t sub.state)
6078+ ?- -.t
6079+ ?(%tag %nvar %rnvar %fvar %avar %rvar) !(hole-known t state)
6080+ %union |((lien cases.t |=(c=itype (hole-uncertain c state))) (lien args.t |=(c=itype (hole-uncertain c state))))
6081+ %grec (lien args.t |=(c=itype (hole-uncertain c state)))
6082+ %collection (lien args.t |=(c=itype (hole-uncertain c state)))
6083+ %face $(t body.t)
6084+ %fn |($(t sample.t) $(t product.t))
6085+ %cell |($(t hed.t) $(t tal.t))
6086+ * |
6087+ ==
6088+::
6089+++ unresolved-hole
6090+ |= [all=(list ihole) prior=(list ihole) state=istate]
6091+ ^- (unit idiag)
6092+ =/ work=(list ihole) (flop (holes-created all prior))
6093+ |-
6094+ ?~ work ~
6095+ ?: (hole-known [%var id.i.work] state) $(work t.work)
6096+ ?: (hole-uncertain [%var id.i.work] state)
6097+ `["type hole needs unsupported inference" ~[[at.i.work "type hole"]]]
6098+ `["type hole needs a determined type" ~[[at.i.work "unresolved type hole"]]]
6099+::
53136100++ itype-vars
53146101 |= t=itype
53156102 ^- (list @ud)
53166103 ?- -.t
53176104 %var ~[id.t]
6105+ %fvar ~[id.t]
53186106 %avar ~[id.t]
6107+ %rvar ~[id.t]
53196108 %nvar ~[id.t]
6109+ %rnvar ~[id.t]
53206110 %atom ~
53216111 %any-atom ~
53226112 %flag ~
6113+ %noun ~
6114+ %empty ~
53236115 %tag ~
53246116 %const ~
53256117 %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
53266118 %recursive ~
6119+ %jrec ~
6120+ %grec (zing (turn args.t |=(c=itype (itype-vars c))))
53276121 %collection (zing (turn args.t |=(c=itype (itype-vars c))))
53286122 %face $(t body.t)
53296123 %fn (weld $(t sample.t) $(t product.t))
@@ -5347,21 +6141,37 @@
53476141 =/ found=(unit itype) (itype-lookup id.t ren)
53486142 ?~ found t
53496143 u.found
6144+ %fvar
6145+ =/ found=(unit itype) (itype-lookup id.t ren)
6146+ ?~ found t
6147+ u.found
53506148 %avar
53516149 =/ found=(unit itype) (itype-lookup id.t ren)
53526150 ?~ found t
53536151 u.found
6152+ %rvar
6153+ =/ found=(unit itype) (itype-lookup id.t ren)
6154+ ?~ found t
6155+ u.found
53546156 %nvar
53556157 =/ found=(unit itype) (itype-lookup id.t ren)
53566158 ?~ found t
53576159 u.found
6160+ %rnvar
6161+ =/ found=(unit itype) (itype-lookup id.t ren)
6162+ ?~ found t
6163+ u.found
53586164 %atom t
53596165 %any-atom t
53606166 %flag t
6167+ %noun t
6168+ %empty t
53616169 %tag t
53626170 %const t
53636171 %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
53646172 %recursive t
6173+ %jrec t
6174+ %grec t(args (turn args.t |=(c=itype (itype-rename c ren))))
53656175 %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
53666176 %face [%face name.t $(t body.t)]
53676177 %fn [%fn $(t sample.t) $(t product.t)]
@@ -5376,24 +6186,79 @@
53766186 ^- ?
53776187 ?- -.t
53786188 %var |
6189+ %fvar |
53796190 %avar =(n id.t)
6191+ %rvar =(n id.t)
53806192 %nvar =(n id.t)
6193+ %rnvar =(n id.t)
53816194 %atom |
53826195 %any-atom |
53836196 %flag |
6197+ %noun |
6198+ %empty |
53846199 %tag |
53856200 %const |
53866201 %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
53876202 %recursive |
6203+ %jrec |
6204+ %grec (lien args.t |=(c=itype (itype-var-is-atom n c)))
53886205 %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
53896206 %face $(t body.t)
53906207 %fn |($(t sample.t) $(t product.t))
53916208 %cell |($(t hed.t) $(t tal.t))
53926209 ==
6210+++ itype-var-is-restricted
6211+ |= [n=@ud t=itype]
6212+ ^- ?
6213+ ?- -.t
6214+ %var |
6215+ %fvar |
6216+ %avar |
6217+ %rvar =(n id.t)
6218+ %nvar |
6219+ %rnvar |
6220+ %atom |
6221+ %any-atom |
6222+ %flag |
6223+ %noun |
6224+ %empty |
6225+ %tag |
6226+ %const |
6227+ %union |((lien cases.t |=(c=itype (itype-var-is-restricted n c))) (lien args.t |=(c=itype (itype-var-is-restricted n c))))
6228+ %recursive |
6229+ %jrec |
6230+ %grec (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6231+ %collection (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6232+ %face $(t body.t)
6233+ %fn |($(t sample.t) $(t product.t))
6234+ %cell |($(t hed.t) $(t tal.t))
6235+ ==
53936236::
53946237:: Canonical numbering makes printed variables independent of the order
53956238:: the unifier happened to allocate intermediates.
53966239::
6240+++ itype-var-is-gate-free-fuel
6241+ |= [n=@ud t=itype fuel=@ud]
6242+ ^- ?
6243+ ?: =(0 fuel) &
6244+ =. fuel (dec fuel)
6245+ ?- -.t
6246+ %var |
6247+ %fvar =(n id.t)
6248+ %union |((lien cases.t |=(c=itype (itype-var-is-gate-free-fuel n c fuel))) (lien args.t |=(c=itype (itype-var-is-gate-free-fuel n c fuel))))
6249+ %grec (lien args.t |=(c=itype (itype-var-is-gate-free-fuel n c fuel)))
6250+ %collection (lien args.t |=(c=itype (itype-var-is-gate-free-fuel n c fuel)))
6251+ %face $(t body.t, fuel fuel)
6252+ %fn |($(t sample.t, fuel fuel) $(t product.t, fuel fuel))
6253+ %cell |($(t hed.t, fuel fuel) $(t tal.t, fuel fuel))
6254+ * |
6255+ ==
6256+::
6257+++ itype-var-is-gate-free
6258+ |= [n=@ud t=itype]
6259+ ^- ?
6260+ (itype-var-is-gate-free-fuel n t 256)
6261+::
53976262++ canonical-itype
53986263 |= [t=itype vars=(list @ud)]
53996264 ^- itype
@@ -5401,7 +6266,7 @@
54016266 =/ n=@ud 0
54026267 |-
54036268 ?~ vars (itype-rename t ren)
5404− =/ replacement=itype ?:((itype-var-is-atom i.vars t) [%avar n] [%var n])
6269+ =/ replacement=itype ?:((itype-var-is-restricted i.vars t) [%rvar n] ?:((itype-var-is-atom i.vars t) [%avar n] ?:((itype-var-is-gate-free i.vars t) [%fvar n] [%var n])))
54056270 $(vars t.vars, ren [[i.vars replacement] ren], n +(n))
54066271::
54076272++ instantiate-scheme
@@ -5412,11 +6277,11 @@
54126277 |-
54136278 ?~ vars [(itype-rename typ.scheme ren) state]
54146279 =/ replacement=itype
5415− ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state])
6280+ ?:((itype-var-is-restricted i.vars typ.scheme) [%rvar next.state] ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] ?:((itype-var-is-gate-free i.vars typ.scheme) [%fvar next.state] [%var next.state])))
54166281 :: A generalized atom variable is a valid origin for re-generalizing
54176282 :: an alias, just as a sample binder is.
54186283 =/ st=istate state(next +(next.state))
5419− =? binders.st ?=(%avar -.replacement) [next.state binders.state]
6284+ =? binders.st |(?=(%fvar -.replacement) ?=(%avar -.replacement) ?=(%rvar -.replacement)) [next.state binders.state]
54206285 $(vars t.vars, ren [[i.vars replacement] ren], state st)
54216286::
54226287++ icap-lookup
@@ -5487,6 +6352,11 @@
54876352 ?. ?=([%ref @ @] node) ~
54886353 ?. &(=(module +<.node) =(name +>.node)) ~
54896354 `[[%unknown ~] &]
6355+ %apply
6356+ ?. ?=([%apply %list [* ~]] node) ~
6357+ =/ item $(node -.+>.node)
6358+ ?~ item ~
6359+ `[[%or ~[[%atom `0] [%cell pat.u.item [%unknown ~]]]] has.u.item]
54906360 %face
54916361 ?. ?=([%face @ *] node) ~
54926362 ?. (jibb-face-name +<.node) ~
@@ -5541,6 +6411,10 @@
55416411 %cell ?:(?=([%cell * *] node) (imported-record-faces-valid node ~) |)
55426412 %fork (imported-faces-valid-list +.node)
55436413 %apply ?:(?=([%apply @ *] node) (imported-faces-valid-list +>.node) |)
6414+ %named
6415+ ?. ?=([%named @ @ *] node) |
6416+ =/ n=[%named module=@ name=@ body=*] ;;([%named module=@ name=@ body=*] node)
6417+ (imported-faces-valid body.n)
55446418 ==
55456419::
55466420++ imported-faces-valid-list
@@ -5572,7 +6446,19 @@
55726446 ^- (unit itype)
55736447 ?@ node ~
55746448 ?+ -.node ~
6449+ %noun ?:(=(node [%noun ~]) `[%noun ~] ~)
55756450 %atom
6451+ :: A Hoon loobean singleton is one of the two Jibb loobeans.
6452+ ?: ?=([%atom %f [~ @]] node)
6453+ =/ value=@ +>+.node
6454+ ?. |(=(value 0) =(value 1)) ~
6455+ =/ printed=@t ?:(=(value 0) '%.y' '%.n')
6456+ `[%const [%loobean %f value printed]]
6457+ :: Hoon's null singleton is the same noun as Jibb's `~` mold.
6458+ :: Other non-term singleton atoms remain unsupported here.
6459+ ?: ?=([%atom %n [~ @]] node)
6460+ ?. =(0 +>+.node) ~
6461+ `[%const [%null %n 0 '~']]
55766462 ?: ?=([%atom %tas [~ @]] node)
55776463 =/ value=@ +>+.node
55786464 ?. |(=(value 0) (jibb-face-name value)) ~
@@ -5582,6 +6468,15 @@
55826468 =/ aura=@ta (@ta +<.node)
55836469 ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
55846470 `[%atom aura]
6471+ %named
6472+ ?. ?=([%named @ @ *] node) ~
6473+ =/ n=[%named module=@ name=@ body=*] ;;([%named module=@ name=@ body=*] node)
6474+ ?. &((jibb-face-name module.n) (jibb-face-name name.n)) ~
6475+ ?. ?=([%fork *] body.n) ~
6476+ =/ proof=(unit irec-pattern) (rec-pattern body.n (@tas module.n) (@tas name.n))
6477+ ?~ proof ~
6478+ ?. has.u.proof ~
6479+ `[%recursive (@tas module.n) (@tas name.n) `(crip "{(trip name.n)}.{(trip module.n)}")]
55856480 %apply
55866481 ?. ?=([%apply @ *] node) ~
55876482 =/ name=term (@tas +<.node)
@@ -5593,12 +6488,19 @@
55936488 =/ args=(unit (list itype)) (import-to-itypes +>.node)
55946489 ?~ args ~
55956490 ?. =(arity (lent u.args)) ~
5596− `[%collection name u.args]
6491+ =/ keyed=(unit [types=(list itype) sub=isub]) (itype-collection-keys name u.args ~)
6492+ ?~ keyed ~
6493+ `[%collection name types.u.keyed]
55976494 %fork
5598− =/ cases=(unit (list itype)) (import-to-itypes +.node)
6495+ :: Hoon's ordinary ? mold is the fork of its two %f singletons.
6496+ =/ raw=* +.node
6497+ ?: |(=(raw ~[[%atom %f `0] [%atom %f `1]]) =(raw ~[[%atom %f `1] [%atom %f `0]]))
6498+ `[%flag ~]
6499+ =/ cases=(unit (list itype)) (import-to-itypes raw)
55996500 ?~ cases ~
56006501 ?~ u.cases ~
56016502 ?~ t.u.cases ~
6503+ ?: (import-has-loobean-singleton u.cases) ~
56026504 ?. (import-cases-disjoint u.cases) ~
56036505 `[%union u.cases ~ ~ ~]
56046506 %face
@@ -5617,6 +6519,20 @@
56176519 `[%cell u.left u.right]
56186520 ==
56196521::
6522+++ import-direct-loobean
6523+ |= t=itype
6524+ ^- ?
6525+ ?: ?=(%face -.t) $(t body.t)
6526+ ?: ?=(%union -.t) (import-has-loobean-singleton cases.t)
6527+ ?=([%const [%loobean *]] t)
6528+::
6529+++ import-has-loobean-singleton
6530+ |= cases=(list itype)
6531+ ^- ?
6532+ ?~ cases |
6533+ ?: (import-direct-loobean i.cases) &
6534+ $(cases t.cases)
6535+::
56206536++ import-to-itypes
56216537 |= nodes=*
56226538 ^- (unit (list itype))
@@ -5631,7 +6547,10 @@
56316547 |= typ=itype
56326548 ^- upat
56336549 ?- -.typ
6550+ %noun [%all ~]
6551+ %empty [%empty ~]
56346552 %atom [%atom ~]
6553+ %flag [%or ~[[%atom `0] [%atom `1]]]
56356554 %const [%atom `val.literal.typ]
56366555 %face $(typ body.typ)
56376556 %cell [%cell $(typ hed.typ) $(typ tal.typ)]
@@ -5726,25 +6645,85 @@
57266645 ?:(=(`origin origin.typ.template) `name.i.molds $(molds t.molds))
57276646 $(molds t.molds)
57286647::
5729−:: Only names exported by this directly imported module are visible through
5730−:: its face. Other origins retain identity but print as unnamed unions.
6648+:: A prelude union alias is a display name, not a new union identity. An
6649+:: identity-generic alias can carry the origin's arguments only when the
6650+:: origin, arity and ordered parameters match. Swapped, repeated, fixed
6651+:: or phantom parameters cannot be printed that way and remain unsupported
6652+:: when their only available name is private. A nongeneric alias of a
6653+:: generic instantiation cannot be printed with the origin's arguments.
6654+++ identity-union-parameters
6655+ |= [vars=(list @ud) args=(list itype)]
6656+ ^- ?
6657+ ?~ vars ?=(~ args)
6658+ ?~ args |
6659+ ?. =([%var i.vars] i.args) |
6660+ $(vars t.vars, args t.args)
6661+++ prelude-union-alias
6662+ |= [origin=[at=path name=term] args=(list itype) molds=imold-types]
6663+ ^- (unit term)
6664+ ?~ molds ~
6665+ =/ template=ischeme template.i.molds
6666+ ?. ?=(%union -.typ.template) $(molds t.molds)
6667+ ?. =(`origin origin.typ.template) $(molds t.molds)
6668+ ?~ vars.template
6669+ ?^ args $(molds t.molds)
6670+ ?:(=(args args.typ.template) `name.i.molds $(molds t.molds))
6671+ ?: &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args)))
6672+ `name.i.molds
6673+ $(molds t.molds)
6674+::
6675+:: Names exported by the directly imported module are visible through its
6676+:: face; a matching prelude alias is also visible without a qualifier.
6677+::
6678+++ jrec-alias
6679+ |= [origin=path name=term molds=imold-types]
6680+ ^- (unit term)
6681+ ?~ molds ~
6682+ =/ template=ischeme template.i.molds
6683+ ?: &(?=(~ vars.template) ?=(%jrec -.typ.template) =(at.typ.template origin) =(name.typ.template name)) `name.i.molds
6684+ $(molds t.molds)
6685+::
6686+++ grec-visible-alias
6687+ |= [origin=path name=term proof=shape args=(list itype) molds=imold-types]
6688+ ^- (unit term)
6689+ ?~ molds ~
6690+ =/ template=ischeme template.i.molds
6691+ ?. ?=(%grec -.typ.template) $(molds t.molds)
6692+ ?. &(=(at.typ.template origin) =(name.typ.template name) =(proof.typ.template proof)) $(molds t.molds)
6693+ ?. &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args))) $(molds t.molds)
6694+ `name.i.molds
57316695::
57326696++ itype-in-import
5733− |= [t=itype iface=ifile face=term]
6697+ |= [t=itype iface=ifile face=term prelude=(unit ifile)]
57346698 ^- itype
57356699 ?- -.t
57366700 %union
57376701 =/ label=(unit @t)
57386702 ?~ origin.t ~
57396703 ?: =(at.u.origin.t /lib/jibb/prelude/jibb) `name.u.origin.t
6704+ =/ public=(unit term)
6705+ ?~ prelude ~
6706+ (prelude-union-alias u.origin.t args.t molds.u.prelude)
6707+ ?^ public `u.public
57406708 =/ alias=(unit term) ~
57416709 =? alias &(=(at.u.origin.t at.iface) ?=(^ (find-jibb-mold name.u.origin.t iface))) `name.u.origin.t
57426710 =? alias ?=(~ alias) (imported-union-alias u.origin.t molds.iface)
57436711 ?~ alias ~
57446712 `(crip "{(trip u.alias)}.{(trip face)}")
5745− [%union (turn cases.t |=(c=itype (itype-in-import c iface face))) origin.t label (turn args.t |=(c=itype (itype-in-import c iface face)))]
6713+ [%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)))]
57466714 %recursive [%recursive module.t name.t ~]
5747− %collection [%collection name.t (turn args.t |=(c=itype (itype-in-import c iface face)))]
6715+ %grec
6716+ =/ public=(unit term) ?~(prelude ~ (grec-visible-alias at.t name.t proof.t args.t molds.u.prelude))
6717+ =/ alias=(unit term) ?~(public (grec-visible-alias at.t name.t proof.t args.t molds.iface) public)
6718+ =/ label=(unit @t) ?~(alias ~ ?~(public `(crip "{(trip u.alias)}.{(trip face)}") `u.alias))
6719+ t(label label, args (turn args.t |=(c=itype (itype-in-import c iface face prelude))))
6720+ %jrec
6721+ =/ public=(unit term) ?~(prelude ~ (jrec-alias at.t name.t molds.u.prelude))
6722+ ?^ public t(label `u.public)
6723+ =/ alias=(unit term) (jrec-alias at.t name.t molds.iface)
6724+ ?~ alias t(label ~)
6725+ t(label `(crip "{(trip u.alias)}.{(trip face)}"))
6726+ %collection [%collection name.t (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
57486727 %face [%face name.t $(t body.t)]
57496728 %fn [%fn $(t sample.t) $(t product.t)]
57506729 %cell [%cell $(t hed.t) $(t tal.t)]
@@ -5790,15 +6769,27 @@
57906769 ?~ rest ~
57916770 `[[i.names i.args] u.rest]
57926771::
5793−++ template-apply
5794− |= [template=ischeme args=(list itype)]
5795− ^- (unit itype)
6772+++ template-apply-sub
6773+ |= [template=ischeme args=(list itype) sub=isub]
6774+ ^- (unit [typ=itype sub=isub])
57966775 =/ vars=(list @ud) vars.template
57976776 =/ ren=isub ~
57986777 |-
5799− ?~ vars ?~(args `(itype-rename typ.template ren) ~)
6778+ ?~ vars ?~(args `[(itype-rename typ.template ren) sub] ~)
58006779 ?~ args ~
5801− $(vars t.vars, args t.args, ren [[i.vars i.args] ren])
6780+ =/ replacement=(unit igf-form)
6781+ ?: (itype-var-is-gate-free i.vars typ.template)
6782+ (itype-gate-free-form i.args sub 256)
6783+ `[i.args sub 256]
6784+ ?~ replacement ~
6785+ $(vars t.vars, args t.args, ren [[i.vars typ.u.replacement] ren], sub sub.u.replacement)
6786+::
6787+++ template-apply
6788+ |= [template=ischeme args=(list itype)]
6789+ ^- (unit itype)
6790+ =/ applied=(unit [typ=itype sub=isub]) (template-apply-sub template args ~)
6791+ ?~ applied ~
6792+ `typ.u.applied
58026793::
58036794++ infer-shape-args
58046795 |= [args=(list shape) state=istate]
@@ -5817,9 +6808,66 @@
58176808 =/ rest=[params=iparams vars=(list @ud) next=@ud] $(names t.names, next +(next))
58186809 [[[i.names [%var next]] params.rest] [next vars.rest] next.rest]
58196810::
6811+:: Recognize a unique top-level source mold with exactly a null case and a
6812+:: faced atom-headed cell whose faced tail names that same mold. Its Jibb
6813+:: path and name provide nominal identity. Other recursive shapes fail closed;
6814+:: construction and matching expose the proven shape one layer at a time.
6815+++ simple-source-recursive
6816+ |= [name=term sh=shape state=istate]
6817+ ^- (unit itype)
6818+ ?. (lien top-molds.state |=(n=term =(n name))) ~
6819+ =/ original=(unit shape) (find-simple-mold name molds.state)
6820+ ?~ original ~
6821+ ?. =(u.original sh) ~
6822+ ?. ?=(%union -.sh) ~
6823+ =/ cs=(list shape) cases.sh
6824+ ?~ cs ~
6825+ ?~ t.cs ~
6826+ ?^ t.t.cs ~
6827+ ?. ?=(%const -.i.cs) ~
6828+ ?. =(%null form.lit.i.cs) ~
6829+ ?. ?=(%cell -.i.t.cs) ~
6830+ =/ fs=(list field) fields.i.t.cs
6831+ ?~ fs ~
6832+ ?~ t.fs ~
6833+ ?^ t.t.fs ~
6834+ ?. ?=(%face -.i.fs) ~
6835+ ?. ?=(%aura -.shape.i.fs) ~
6836+ ?. !=(0 aura.shape.i.fs) ~
6837+ ?. ?=(%face -.i.t.fs) ~
6838+ ?. !=(name.i.fs name.i.t.fs) ~
6839+ =/ tail=shape shape.i.t.fs
6840+ ?. ?=(%ref -.tail) ~
6841+ ?. =(names.tail ~[name]) ~
6842+ `[%jrec at.state name `name name.i.fs aura.shape.i.fs name.i.t.fs]
6843+::
6844+++ simple-source-generic-recursive
6845+ |= [name=term sh=shape args=(list itype) state=istate]
6846+ ^- (unit itype)
6847+ ?. ?=(%generic -.sh) ~
6848+ ?. ?=([@ ~] vars.sh) ~
6849+ ?. ?=([* ~] args) ~
6850+ ?~ grec-index.state ~
6851+ ?. =(at.u.grec-index.state at.state) ~
6852+ ?~ prelude.state ~
6853+ ?. =(prelude.u.grec-index.state u.prelude.state) ~
6854+ =/ proof=(unit shape) (~(get by shapes.u.grec-index.state) name)
6855+ ?~ proof ~
6856+ ?. =(u.proof sh) ~
6857+ `[%grec at.state name `name sh args]
6858+::
6859+
58206860++ infer-mold-template
58216861 |= [sh=shape state=istate]
58226862 ^- (unit [template=ischeme state=istate])
6863+ =/ generic=(unit itype)
6864+ ?. ?=([@ ~] active.state) ~
6865+ (simple-source-generic-recursive i.active.state sh ~[[%var next.state]] state)
6866+ ?^ generic `[[u.generic ~[next.state]] state(next +(next.state))]
6867+ =/ direct=(unit itype)
6868+ ?. ?=([@ ~] active.state) ~
6869+ (simple-source-recursive i.active.state sh state)
6870+ ?^ direct `[[u.direct ~] state]
58236871 ?: ?=(%generic -.sh)
58246872 ?~ vars.sh ~
58256873 ?. (distinct-params vars.sh) ~
@@ -5827,17 +6875,19 @@
58276875 =/ out=(unit [typ=itype state=istate])
58286876 (infer-simple-shape body.sh state(next next.fresh, params params.fresh, in-mold &))
58296877 ?~ out ~
6878+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
58306879 ?: &(?=(%union -.typ.u.out) !?=(%union -.body.sh) ?=(~ origin.typ.u.out)) ~
58316880 =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.sh))
58326881 typ.u.out(args (turn vars.fresh |=(n=@ud `itype`[%var n])))
58336882 =/ used=(list @ud) (itype-vars typ.u.out)
58346883 ?. (levy used |=(n=@ud (lien vars.fresh |=(p=@ud =(p n))))) ~
5835− `[[typ.u.out vars.fresh] state.u.out(params params.state, in-mold in-mold.state)]
6884+ `[[typ.u.out vars.fresh] state.u.out(params params.state, in-mold in-mold.state, holes holes.state)]
58366885 =/ out=(unit [typ=itype state=istate])
58376886 (infer-simple-shape sh state(params ~, in-mold &))
58386887 ?~ out ~
6888+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
58396889 ?: ?=(^ (itype-vars typ.u.out)) ~
5840− `[[typ.u.out ~] state.u.out(params params.state, in-mold in-mold.state)]
6890+ `[[typ.u.out ~] state.u.out(params params.state, in-mold in-mold.state, holes holes.state)]
58416891::
58426892:: A direct imported reference may carry definite reader evidence. Only
58436893:: uniquely supplied, declared inputs are used; unsupported data stay generic.
@@ -5871,33 +6921,93 @@
58716921 ?~ found ~
58726922 ?^ t.found ~
58736923 result.i.found
5874− ?. ?=([%invalid ?(%aura %core) @] raw) ~
6924+ ?. ?=([%invalid ?(%aura %core %overlap) @] raw) ~
58756925 `["{(trip +>.raw)}" ~[[at.sh "invalid imported mold"]]]
58766926::
5877−++ direct-sample-invalid
5878− |= [s=sample state=istate]
6927+:: Replay only the shape branches whose evaluation order we can prove.
6928+:: Successful prefixes must be checked before descending to a failure.
6929+++ nested-import-invalid
6930+ |= [sh=shape state=istate]
6931+ ^- (unit idiag)
6932+ ?: ?=(^ (infer-simple-shape sh state)) ~
6933+ ?- -.sh
6934+ %ref
6935+ =/ direct=(unit idiag) (direct-import-invalid sh state)
6936+ ?^ direct direct
6937+ ?~ names.sh ~
6938+ ?^ t.names.sh ~
6939+ =/ n=term i.names.sh
6940+ ?: (lien marks.state |=(x=term =(x n))) ~
6941+ ?: (lien active.state |=(x=term =(x n))) ~
6942+ =/ found=(unit shape) (find-simple-mold n molds.state)
6943+ ?~ found ~
6944+ $(sh u.found, state state(active [n active.state], in-mold &, params ~))
6945+ %fn
6946+ =/ first=(unit [typ=itype state=istate]) (infer-simple-shape sample.sh state)
6947+ ?~ first $(sh sample.sh)
6948+ $(sh product.sh, state state.u.first)
6949+ %cell (nested-field-invalid fields.sh state)
6950+ * ~
6951+ ==
6952+::
6953+++ nested-field-invalid
6954+ |= [fields=(list field) state=istate]
6955+ ^- (unit idiag)
6956+ ?~ fields ~
6957+ =/ sh=shape
6958+ ?- -.i.fields
6959+ %bare shape.i.fields
6960+ %face shape.i.fields
6961+ %pun [%ref at.i.fields ~[name.i.fields]]
6962+ ==
6963+ =/ out=(unit [typ=itype state=istate]) (infer-simple-shape sh state)
6964+ ?~ out (nested-import-invalid sh state)
6965+ $(fields t.fields, state state.u.out)
6966+::
6967+++ sample-import-invalid
6968+ |= [s=sample env=ienv state=istate]
58796969 ^- (unit idiag)
6970+ =/ result=isample-result (infer-sample s env state)
6971+ ?: ?=(%& -.result) ~
6972+ ?. =(p.result "sample mold is not supported by partial inference") ~
58806973 ?- s
5881− [%face *] (direct-import-invalid shape.s state)
5882− [%bare *] (direct-import-invalid shape.s state)
5883− [%pun *] (direct-import-invalid [%ref at.s ~[name.s]] state)
6974+ [%face *] (nested-import-invalid shape.s state)
6975+ [%bare *] (nested-import-invalid shape.s state)
6976+ [%pun *] (nested-import-invalid [%ref at.s ~[name.s]] state)
6977+ [%cell *] (nested-samples-invalid items.s env state)
58846978 * ~
58856979 ==
58866980::
6981+++ nested-samples-invalid
6982+ |= [items=(list sample) env=ienv state=istate]
6983+ ^- (unit idiag)
6984+ ?~ items ~
6985+ =/ head=isample-result (infer-sample i.items env state)
6986+ ?: ?=(%| -.head) (sample-import-invalid i.items env state)
6987+ $(items t.items, env env.p.head, state state.p.head)
6988+::
58876989++ infer-simple-shape
58886990 |= [sh=shape state=istate]
58896991 ^- (unit [typ=itype state=istate])
58906992 ?- -.sh
6993+ %hole `[[%var next.state] state(next +(next.state), holes [[next.state at.sh] holes.state])]
58916994 %aura
58926995 ?: =(0 aura.sh) `[[%any-atom ~] state]
58936996 `[[%atom aura.sh] state]
58946997 %flag `[[%flag ~] state]
6998+ %noun `[[%noun ~] state]
6999+ %void `[[%empty ~] state]
58957000 %const
5896− ?. |(=(%term form.lit.sh) =(%null form.lit.sh)) ~
7001+ ?. |(=(%term form.lit.sh) =(%null form.lit.sh) =(%loobean form.lit.sh)) ~
7002+ ?: &(=(%loobean form.lit.sh) !|(=(0 val.lit.sh) =(1 val.lit.sh))) ~
58977003 `[[%const lit.sh] state]
58987004 %union
58997005 =/ pairs=(list upair) (union-pairs cases.sh molds.state)
5900− ?. (levy pairs |=(p=upair =(%disjoint relation.p))) ~
7006+ ?: (lien pairs |=(p=upair =(%overlap relation.p))) ~
7007+ =/ source-proof=?
7008+ ?: (levy pairs |=(p=upair =(%disjoint relation.p))) &
7009+ &((union-source-state-safe state 256) (union-source-distinct-tags cases.sh molds.state 256))
7010+ ?. source-proof ~
59017011 =/ cs=(unit [types=(list itype) state=istate]) (infer-shape-args cases.sh state)
59027012 ?~ cs ~
59037013 `[[%union types.u.cs ~ ~ ~] state.u.cs]
@@ -5918,7 +7028,7 @@
59187028 =/ found=(unit ischeme) (find-jibb-mold n u.iface)
59197029 ?~ found ~
59207030 ?^ vars.u.found ~
5921− `[(itype-in-import typ.u.found u.iface i.t.names.sh) state]
7031+ `[(itype-in-import typ.u.found u.iface i.t.names.sh prelude.state) state]
59227032 =/ found=(unit itype)
59237033 (find-imported-mold i.t.names.sh n externals.state surs.state)
59247034 ?~ found ~
@@ -5937,15 +7047,29 @@
59377047 ?~ prelude-entry ~
59387048 ?^ vars.u.prelude-entry ~
59397049 `[typ.u.prelude-entry state]
7050+ =/ direct=(unit itype) (simple-source-recursive n u.found state)
7051+ ?^ direct `[u.direct state]
59407052 =/ out=(unit [typ=itype state=istate])
59417053 $(sh u.found, state state(active [n active.state], in-mold &, params ~))
59427054 ?~ out ~
5943− `[(label-direct-union typ.u.out u.found n state) state.u.out(active active.state, in-mold in-mold.state, params params.state)]
7055+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
7056+ `[(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)]
59447057 %apply
59457058 ?~ ref.sh ~
59467059 =/ args=(unit [types=(list itype) state=istate]) (infer-shape-args args.sh state)
59477060 ?~ args ~
59487061 =/ n=term i.ref.sh
7062+ =/ keyed=(unit [types=(list itype) sub=isub])
7063+ ?: ?=(^ (find-simple-mold n molds.state.u.args))
7064+ `[types.u.args sub.state.u.args]
7065+ ?~ prelude.state.u.args
7066+ (itype-collection-keys n types.u.args sub.state.u.args)
7067+ ?: ?=(^ (find-jibb-mold n u.prelude.state.u.args))
7068+ `[types.u.args sub.state.u.args]
7069+ (itype-collection-keys n types.u.args sub.state.u.args)
7070+ ?~ keyed ~
7071+ =. types.u.args types.u.keyed
7072+ =. sub.state.u.args sub.u.keyed
59497073 ?^ t.ref.sh
59507074 ?^ t.t.ref.sh ~
59517075 =/ iface=(unit ifile) (find-jibb-interface i.t.ref.sh jimports.state.u.args)
@@ -5953,9 +7077,10 @@
59537077 =/ template=(unit ischeme) (find-jibb-mold n u.iface)
59547078 ?~ template ~
59557079 ?~ vars.u.template ~
5956− =/ applied=(unit itype) (template-apply u.template types.u.args)
7080+ =/ applied=(unit [typ=itype sub=isub]) (template-apply-sub u.template types.u.args sub.state.u.args)
59577081 ?~ applied ~
5958− `[(itype-in-import u.applied u.iface i.t.ref.sh) state.u.args]
7082+ =. sub.state.u.args sub.u.applied
7083+ `[(itype-in-import typ.u.applied u.iface i.t.ref.sh prelude.state.u.args) state.u.args]
59597084 ?: (lien active.state.u.args |=(x=term =(x n))) ~
59607085 =/ found=(unit shape) (find-simple-mold n molds.state.u.args)
59617086 ?~ found
@@ -5964,21 +7089,25 @@
59647089 =/ prelude-entry=(unit ischeme) (find-jibb-mold n u.prelude.state.u.args)
59657090 ?~ prelude-entry ~
59667091 ?~ vars.u.prelude-entry ~
5967− =/ applied=(unit itype) (template-apply u.prelude-entry types.u.args)
7092+ =/ applied=(unit [typ=itype sub=isub]) (template-apply-sub u.prelude-entry types.u.args sub.state.u.args)
59687093 ?~ applied ~
5969− `[u.applied state.u.args]
7094+ =. sub.state.u.args sub.u.applied
7095+ `[typ.u.applied state.u.args]
59707096 ?. ?=(%generic -.u.found) ~
7097+ =/ grec=(unit itype) (simple-source-generic-recursive n u.found types.u.args state.u.args)
7098+ ?^ grec `[u.grec state.u.args]
59717099 ?. (distinct-params vars.u.found) ~
59727100 =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
59737101 ?~ params ~
59747102 =/ out=(unit [typ=itype state=istate])
59757103 $(sh body.u.found, state state.u.args(active [n active.state.u.args], in-mold &, params u.params))
59767104 ?~ out ~
7105+ ?^ (unresolved-hole holes.state.u.out holes.state.u.args state.u.out) ~
59777106 ?: &(?=(%union -.typ.u.out) !?=(%union -.body.u.found) ?=(~ origin.typ.u.out)) ~
59787107 ?: &(?=(%union -.typ.u.out) ?=(%union -.body.u.found) !(lien top-molds.state.u.args |=(x=term =(x n)))) ~
59797108 =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.u.found))
59807109 (label-direct-union typ.u.out(args types.u.args) u.found n state.u.args)
5981− `[typ.u.out state.u.out(active active.state.u.args, in-mold in-mold.state.u.args, params params.state.u.args)]
7110+ `[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)]
59827111 %tvar
59837112 =/ param=(unit itype) (iparam-lookup name.sh params.state)
59847113 ?^ param `[u.param state]
@@ -6018,12 +7147,12 @@
60187147 ^- isample-result
60197148 ?- -.s
60207149 %bind
6021− ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
7150+ ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
60227151 [%| "sample shadows a name"]
60237152 =/ t=itype [%var next.state]
60247153 [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
60257154 %face
6026− ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
7155+ ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
60277156 [%| "sample shadows a name"]
60287157 =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
60297158 ?~ t [%| "sample mold is not supported by partial inference"]
@@ -6061,8 +7190,8 @@
60617190 [%& [%cell ht typ.p.tail] env.p.tail state.p.tail]
60627191::
60637192:: Local definitions generalize only variables outside their enclosing
6064−:: environment and explicit-capital scope. Single self-recursive gates
6065−:: use a monomorphic placeholder; mutually recursive groups stay unsupported.
7193+:: environment and explicit-capital scope. Recursive gate groups use
7194+:: monomorphic placeholders while their bodies are checked.
60667195::
60677196+$ ilocal-result (each [env=ienv state=istate] idiag)
60687197++ free-env-vars
@@ -6091,6 +7220,7 @@
60917220 |-
60927221 ?~ ds &
60937222 ?: ?=(%mold -.i.ds) $(ds t.ds)
7223+ ?: =(name.i.ds %proj) |
60947224 ?. (unique-value-name name.i.ds names) |
60957225 ?: ?=(^ (ienv-lookup name.i.ds env)) |
60967226 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
@@ -6114,6 +7244,7 @@
61147244 |-
61157245 ?~ locals &
61167246 =/ n=term name.i.locals
7247+ ?: =(n %proj) |
61177248 ?. (unique-value-name n names) |
61187249 ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
61197250 ?: (lien marks.state |=(m=term =(n m))) |
@@ -6278,7 +7409,13 @@
62787409 |-
62797410 ?~ ds
62807411 ?~ remaining [%& env state]
6281− ?. progressed [%| ["local definitions need unsupported inference" ~]]
7412+ ?. progressed
7413+ =/ pending=(list def) (flop remaining)
7414+ =/ groups=icomponents (graph-components pending (global-value-names pending))
7415+ =/ grouped=(unit [rest=(list def) env=ienv state=istate])
7416+ (try-local-group pending groups env state)
7417+ ?~ grouped [%| ["local definitions need unsupported inference" ~]]
7418+ $(ds rest.u.grouped, remaining ~, env env.u.grouped, state state.u.grouped, progressed |)
62827419 $(ds (flop remaining), remaining ~, progressed |)
62837420 =/ d=def i.ds
62847421 ?> ?=(%value -.d)
@@ -6287,6 +7424,11 @@
62877424 =/ retried=? ?=(%| -.inferred)
62887425 =? inferred retried (infer-recursive-gate d env local-state)
62897426 ?: ?=(%| -.inferred) $(ds t.ds, remaining [d remaining])
7427+ ?: !=(obligations.state.p.inferred obligations.state) [%| ["deferred local definition needs unsupported inference" ~]]
7428+ =. state.p.inferred (promote-restricted-numbers state.p.inferred env)
7429+ =. 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)))
7430+ =/ hole=(unit idiag) (unresolved-hole holes.state.p.inferred holes.state state.p.inferred)
7431+ ?^ hole [%| u.hole]
62907432 =/ merged=(unit [first=icap second=icap])
62917433 (merged-capitals caps.state.p.inferred sub.state.p.inferred)
62927434 ?^ merged
@@ -6302,7 +7444,28 @@
63027444 (weld (free-env-vars env sub.state.p.inferred) (free-cap-vars caps.state sub.state.p.inferred))
63037445 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
63047446 =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
6305− $(ds t.ds, env [[name.d [typ vars]] env], state state.p.inferred(caps caps.state), progressed &)
7447+ $(ds t.ds, env [[name.d [typ vars]] env], state state.p.inferred(caps caps.state, holes holes.state), progressed &)
7448+::
7449+:: Try complete cyclic local groups after individual definitions stall.
7450+:: Components with non-gates or unresolved constraints stay unavailable.
7451+::
7452+++ try-local-group
7453+ |= [ds=(list def) groups=icomponents env=ienv state=istate]
7454+ ^- (unit [rest=(list def) env=ienv state=istate])
7455+ ?~ groups ~
7456+ =/ names=(list term) i.groups
7457+ ?. (gth (lent names) 1) $(groups t.groups)
7458+ =/ members=(list def)
7459+ (skim ds |=(d=def &(?=(%value -.d) (lien names |=(n=term =(n name.d))))))
7460+ ?. =((lent members) (lent names)) $(groups t.groups)
7461+ =/ result=ilocal-result (infer-gate-group members env state)
7462+ ?: ?=(%| -.result) $(groups t.groups)
7463+ =/ rest=(list def)
7464+ (skim ds |=(d=def !(lien names |=(n=term =(n name.d)))))
7465+ =/ more=(unit [rest=(list def) env=ienv state=istate])
7466+ $(ds rest, groups t.groups, env env.p.result, state state.p.result)
7467+ ?^ more more
7468+ `[rest env.p.result state.p.result]
63067469::
63077470:: Read only fields of a known record. Unresolved field constraints and
63087471:: ambiguous repeated faces are outside this fragment. Imported record
@@ -6325,17 +7488,29 @@
63257488 ^- iresult
63267489 =/ reverse=(list term) (flop names)
63277490 ?~ reverse [%| ["empty wing" ~]]
6328− =/ scheme=(unit ischeme) (ienv-lookup i.reverse env)
6329− ?~ scheme [%| ["field access is not supported by partial inference" ~]]
6330− =/ inst=[typ=itype state=istate] (instantiate-scheme u.scheme state)
7491+ =/ iface=(unit ifile) (find-jibb-interface i.reverse jimports.state)
63317492 =/ fields=(list term) t.reverse
7493+ ?~ fields [%| ["field access is not supported by partial inference" ~]]
7494+ =/ scheme=(unit ischeme)
7495+ ?~ iface
7496+ (ienv-lookup i.reverse env)
7497+ (ienv-lookup i.fields values.u.iface)
7498+ ?~ scheme
7499+ ?^ iface [%| ["module member is not available to partial inference" ~]]
7500+ [%| ["field access is not supported by partial inference" ~]]
7501+ =/ inst=[typ=itype state=istate]
7502+ ?~ iface (instantiate-scheme u.scheme state)
7503+ =/ imported=ischeme u.scheme
7504+ =. typ.imported (itype-in-import typ.imported u.iface i.reverse prelude.state)
7505+ (instantiate-scheme imported state)
7506+ =/ remaining=(list term) ?~(iface fields t.fields)
63327507 =/ typ=itype typ.inst
63337508 |-
6334− ?~ fields [%& typ state.inst]
6335− =/ found=(list itype) (record-fields-named i.fields typ sub.state.inst)
7509+ ?~ remaining [%& typ state.inst]
7510+ =/ found=(list itype) (record-fields-named i.remaining typ sub.state.inst)
63367511 ?~ found [%| ["field is not available to partial inference" ~]]
63377512 ?^ t.found [%| ["field name is ambiguous in partial inference" ~]]
6338− $(fields t.fields, typ i.found)
7513+ $(remaining t.remaining, typ i.found)
63397514::
63407515:: Propagate a known union or list through supported loobean, unit and list
63417516:: branches. Empty bodies and groups are transparent; bodies with definitions
@@ -6359,6 +7534,8 @@
63597534 ?: &(?=(%collection -.expected) =(%list name.expected) (context-list-expression e))
63607535 (infer-list-context e expected env state context)
63617536 ?: ?=(%branch -.e)
7537+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state `[expected context])
7538+ ?^ empty-list u.empty-list
63627539 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
63637540 ?~ t.arms.e [%| ["branch pattern is not supported by partial inference" ~]]
63647541 ?^ t.t.arms.e [%| ["branch is not supported by partial inference" ~]]
@@ -6374,6 +7551,9 @@
63747551 [%| ["branch does not cover both loobeans" ~]]
63757552 =/ subject=iresult (infer-fragment subject.e env state)
63767553 ?: ?=(%| -.subject) subject
7554+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
7555+ ?: ?=(%union -.subject-type)
7556+ [%| ["contextual union-pattern branch is not supported by partial inference" ~]]
63777557 =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
63787558 ?~ su [%| ["loobean branch subject does not unify with ?" ~]]
63797559 =/ left=iresult $(e val.x, state state.p.subject(sub u.su))
@@ -6387,10 +7567,17 @@
63877567 ?: ?=(%unknown -.fit)
63887568 ?: &(?=(%collection -.expected) =(%list name.expected))
63897569 [%| ["branch list constraint is not supported by partial inference" ~]]
7570+ ?: ?=(%flag -.expected) [%| ["branch loobean constraint is not supported by partial inference" ~]]
63907571 [%| ["branch union constraint is not supported by partial inference" ~]]
63917572 ?: ?=(%bad -.fit)
7573+ =/ missing=(unit idiag) (missing-union-tag e expected sub.state.p.value context)
7574+ ?^ missing [%| u.missing]
7575+ =/ nested=(unit idiag) (nested-missing-tag e typ.p.value expected sub.state.p.value next.state.p.value context)
7576+ ?^ nested [%| u.nested]
63927577 ?: &(?=(%collection -.expected) =(%list name.expected))
63937578 [%| ["branch arm does not fit its expected list" ~[[context "expected list"] [(span-of e) "branch arm"]]]]
7579+ ?: ?=(%flag -.expected)
7580+ [%| ["branch arm does not fit its expected loobean" ~[[context "expected loobean"] [(span-of e) "branch arm"]]]]
63947581 [%| ["branch arm does not fit its expected union" ~[[context "expected union"] [(span-of e) "branch arm"]]]]
63957582 [%& expected state.p.value(sub sub.fit, next next.fit)]
63967583::
@@ -6455,23 +7642,47 @@
64557642 [%| ["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)]]]]
64567643 [%& target state.p.tail(sub sub.fit, next next.fit)]
64577644::
7645+++ infer-open-list-items
7646+ |= [items=(list expr) expected=itype env=ienv state=istate context=span]
7647+ ^- iresult
7648+ ?~ items [%& expected state]
7649+ =/ target=itype (itype-walk expected sub.state)
7650+ =/ value=iresult (infer-call-context-arg i.items target env state context)
7651+ ?: ?=(%| -.value) value
7652+ =/ ordinary-fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7653+ =/ fit=ifit
7654+ ?: ?=(%ok -.ordinary-fit) ordinary-fit
7655+ ?: ?&(?=(%union -.target) ?=(^ prelude.state) =(origin.target `[at.u.prelude.state %element]))
7656+ (program-single-generic-fit typ.p.value target sub.state.p.value next.state.p.value)
7657+ ordinary-fit
7658+ ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
7659+ ?: ?=(%bad -.fit)
7660+ ?: |((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))
7661+ [%| ["list item widening is not supported by partial inference" ~]]
7662+ [%| ["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)]]]]
7663+ ?: (itype-has-tag (itype-normalize expected sub.fit))
7664+ [%| ["list item needs context in partial inference" ~]]
7665+ $(items t.items, state state.p.value(sub sub.fit, next next.fit))
7666+::
64587667++ infer-list-items
64597668 |= [items=(list expr) expected=itype env=ienv state=istate context=span]
64607669 ^- iresult
64617670 ?~ items [%& expected state]
64627671 =/ target=itype (itype-walk expected sub.state)
6463− =/ value=iresult
6464− ?: &(?=(%union -.target) (context-union-branch i.items))
6465− (infer-union-context i.items target env state context)
6466− ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch i.items))
6467− (infer-union-context i.items target env state context)
6468− ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression i.items))
6469− (infer-list-context i.items target env state context)
6470− (infer-fragment i.items env state)
7672+ =/ value=iresult (infer-call-context-arg i.items target env state context)
64717673 ?: ?=(%| -.value) value
6472− =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7674+ =/ ordinary-fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7675+ =/ fit=ifit
7676+ ?: ?=(%ok -.ordinary-fit) ordinary-fit
7677+ ?: ?&(?=(%union -.target) ?=(^ prelude.state) =(origin.target `[at.u.prelude.state %element]))
7678+ (program-single-generic-fit typ.p.value target sub.state.p.value next.state.p.value)
7679+ ordinary-fit
64737680 ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
64747681 ?: ?=(%bad -.fit)
7682+ =/ missing=(unit idiag) (missing-union-tag i.items target sub.state.p.value context)
7683+ ?^ missing [%| u.missing]
7684+ =/ nested=(unit idiag) (nested-missing-tag i.items typ.p.value target sub.state.p.value next.state.p.value context)
7685+ ?^ nested [%| u.nested]
64757686 [%| ["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)]]]]
64767687 $(items t.items, state state.p.value(sub sub.fit, next next.fit))
64777688::
@@ -6552,6 +7763,11 @@
65527763 [%| ["list pattern needs the standard prelude in partial inference" ~]]
65537764 ?~ args.typ [%| ["list pattern is not supported by partial inference" ~]]
65547765 ?^ t.args.typ [%| ["list pattern is not supported by partial inference" ~]]
7766+ =/ item-live=(unit [result=?(%yes %no %unknown) left=@ud])
7767+ (itype-inhabited-proof i.args.typ sub.state caps.state 256)
7768+ ?~ item-live [%| ["list element reachability needs unsupported inference" ~]]
7769+ ?: =(%unknown result.u.item-live) [%| ["list element reachability needs unsupported inference" ~]]
7770+ ?: =(%no result.u.item-live) [%| ["list nonempty pattern is unreachable" ~]]
65557771 ?~ arms.e [%| ["list branch is not supported by partial inference" ~]]
65567772 ?~ t.arms.e [%| ["list branch is not supported by partial inference" ~]]
65577773 ?^ t.t.arms.e [%| ["list branch is not supported by partial inference" ~]]
@@ -6564,7 +7780,7 @@
65647780 [%| ["list branch pattern is not supported by partial inference" ~]]
65657781 =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
65667782 ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
6567− ?: |(=(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)))))
7783+ ?: |(=(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)))))
65687784 [%| ["pattern binder shadows a name" ~]]
65697785 =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
65707786 =/ left=iresult
@@ -6601,10 +7817,15 @@
66017817 [%| ["unit branch pattern is not supported by partial inference" ~]]
66027818 =/ binder=(unit term) ?:(first-empty second-name first-name)
66037819 ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
6604− ?: |(?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
7820+ ?: |(=(u.binder %proj) ?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
66057821 [%| ["pattern binder shadows a name" ~]]
66067822 =/ payload=(unit itype) (unit-union-payload typ)
66077823 ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
7824+ =/ payload-live=(unit [result=?(%yes %no %unknown) left=@ud])
7825+ (itype-inhabited-proof u.payload sub.state.p.subject caps.state.p.subject 256)
7826+ ?~ payload-live [%| ["unit payload reachability needs unsupported inference" ~]]
7827+ ?: =(%unknown result.u.payload-live) [%| ["unit payload reachability needs unsupported inference" ~]]
7828+ ?: =(%no result.u.payload-live) [%| ["unit present pattern is unreachable" ~]]
66087829 =/ extended=ienv [[u.binder [u.payload ~]] env]
66097830 =/ left=iresult
66107831 ?~ expected (infer-fragment val.x ?:(first-empty env extended) state.p.subject)
@@ -6619,27 +7840,752 @@
66197840 ?~ joined [%| ["unit branch results need unsupported inference" ~]]
66207841 [%& typ.p.left state.p.right(sub u.joined)]
66217842::
6622−++ infer-fragment
6623− |= [e=expr env=ienv state=istate]
7843+:: Infer pieces in order, retaining their substitutions and pending tags.
7844+:: A bare decimal literal has no outside type constraint, so it takes its
7845+:: normal @ud default here. Other open numeric and aura variables wait for
7846+:: deferred constraints, which this fragment does not implement yet.
7847+++ infer-string-pieces
7848+ |= [ps=(list piece) env=ienv state=istate]
66247849 ^- iresult
6625− ?- -.e
7850+ ?~ ps [%& [%atom %t] state]
7851+ ?: ?=(%text -.i.ps) $(ps t.ps)
7852+ =/ item=iresult (infer-fragment p.i.ps env state)
7853+ ?: ?=(%| -.item) item
7854+ =/ t=itype (itype-normalize typ.p.item sub.state.p.item)
7855+ ?: |(?=(%atom -.t) ?=(%any-atom -.t))
7856+ $(ps t.ps, state state.p.item)
7857+ ?: &(|(?=(%nvar -.t) ?=(%rnvar -.t)) ?=(%lit -.p.i.ps) =(%number form.lit.p.i.ps))
7858+ $(ps t.ps, state state.p.item)
7859+ ?: &(?=(%collection -.t) =(%list name.t) =(~[[%atom 'tD']] args.t))
7860+ $(ps t.ps, state state.p.item)
7861+ ?: &(?=(%avar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
7862+ [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
7863+ ?: &(?=(%rvar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
7864+ [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
7865+ ?: ?=(%cell -.t)
7866+ [%| ["a cell in interpolation needs a printer" ~[[(span-of p.i.ps) "cell without a printer"]]]]
7867+ [%| ["interpolation type needs unsupported inference" ~]]
7868+::
7869+:: Whole-case coverage for a known union. When a pattern may cover only
7870+:: part of a case, finite loobean refinements are tried below; other
7871+:: partial coverage stays unsupported until the general pattern matrix.
7872++$ imatch ?(%full %none %unknown)
7873+++ union-pattern-items
7874+ |= [ps=(list pattern) t=itype]
7875+ ^- imatch
7876+ ?~ ps %unknown
7877+ ?~ t.ps (union-pattern i.ps t)
7878+ =. t ?:(?=(%face -.t) body.t t)
7879+ ?. ?=(%cell -.t)
7880+ ?: |(?=(%atom -.t) ?=(%any-atom -.t) ?=(%flag -.t) ?=(%const -.t)) %none
7881+ %unknown
7882+ =/ a=imatch (union-pattern i.ps hed.t)
7883+ =/ b=imatch $(ps t.ps, t tal.t)
7884+ ?: |(=(%none a) =(%none b)) %none
7885+ ?:(&(=(%full a) =(%full b)) %full %unknown)
7886+::
7887+++ union-pattern
7888+ |= [p=pattern t=itype]
7889+ ^- imatch
7890+ =. t ?:(?=(%face -.t) body.t t)
7891+ ?- -.p
7892+ %any %full
7893+ %bind %full
66267894 %lit
6627− ?- form.lit.e
6628− %number ?: =(%ud aura.lit.e)
6629− [%& [%nvar next.state] state(next +(next.state))]
6630− [%& [%atom aura.lit.e] state]
6631− %ship [%& [%atom %p] state]
6632− %date [%& [%atom %da] state]
6633− %duration [%& [%atom %dr] state]
6634− %knot [%& [%atom %ta] state]
7895+ ?: ?=(%const -.t) ?:(=(val.literal.t val.lit.p) %full %none)
7896+ ?: ?=(%cell -.t) %none
7897+ ?: ?=(%flag -.t)
7898+ ?:(|(=(0 val.lit.p) =(1 val.lit.p)) %unknown %none)
7899+ %unknown
7900+ %str ?:(?=(%cell -.t) %none %unknown)
7901+ %cell (union-pattern-items items.p t)
7902+ ==
7903+::
7904+++ union-pattern-has-bind
7905+ |= p=pattern
7906+ ^- ?
7907+ ?: ?=(%bind -.p) &
7908+ ?. ?=(%cell -.p) |
7909+ (lien items.p union-pattern-has-bind)
7910+::
7911+++ union-pattern-bind-items
7912+ |= [ps=(list pattern) t=itype env=ienv globals=(list term)]
7913+ ^- (unit ienv)
7914+ ?~ ps ~
7915+ ?~ t.ps (union-pattern-bind i.ps t env globals)
7916+ =. t ?:(?=(%face -.t) body.t t)
7917+ ?. ?=(%cell -.t) ~
7918+ =/ first=(unit ienv) (union-pattern-bind i.ps hed.t env globals)
7919+ ?~ first ~
7920+ $(ps t.ps, t tal.t, env u.first)
7921+::
7922+++ union-pattern-bind
7923+ |= [p=pattern t=itype env=ienv globals=(list term)]
7924+ ^- (unit ienv)
7925+ =. t ?:(?=(%face -.t) body.t t)
7926+ ?: ?=(%bind -.p)
7927+ ?: |(=(name.p %proj) ?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
7928+ `[[name.p [t ~]] env]
7929+ ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
7930+ `env
7931+::
7932+:: Split loobean fields into finite refinements for partial patterns.
7933+:: Keep original cases for binder types and preserve whole-case matching
7934+:: before trying refinements. Cap products at 64; unknown, empty or opaque
7935+:: shapes stay unsupported rather than implying complete pattern checking.
7936++$ ifinite [origin=@ud base=itype part=itype]
7937+++ finite-product
7938+ |= [hs=(list itype) ts=(list itype) out=(list itype)]
7939+ ^- (list itype)
7940+ ?~ hs out
7941+ =/ rows=(list itype) (turn ts |=(t=itype [%cell i.hs t]))
7942+ $(hs t.hs, out (weld rows out))
7943+::
7944+++ finite-type
7945+ |= t=itype
7946+ ^- (unit (list itype))
7947+ ?- -.t
7948+ %flag
7949+ `~[[%const [%loobean %f 0 '%.y']] [%const [%loobean %f 1 '%.n']]]
7950+ %face
7951+ =/ body=(unit (list itype)) $(t body.t)
7952+ ?~ body ~
7953+ `(turn u.body |=(x=itype [%face name.t x]))
7954+ %cell
7955+ =/ hed=(unit (list itype)) $(t hed.t)
7956+ ?~ hed ~
7957+ =/ tal=(unit (list itype)) $(t tal.t)
7958+ ?~ tal ~
7959+ ?: (gth (mul (lent u.hed) (lent u.tal)) 64) ~
7960+ `(finite-product u.hed u.tal ~)
7961+ * `~[t]
7962+ ==
7963+::
7964+++ finite-cases
7965+ |= [xs=(list itype) out=(list ifinite) origin=@ud]
7966+ ^- (unit (list ifinite))
7967+ ?~ xs `out
7968+ =/ parts=(unit (list itype)) (finite-type i.xs)
7969+ ?~ parts ~
7970+ ?: (gth (add (lent out) (lent u.parts)) 64) ~
7971+ =/ rows=(list ifinite) (turn u.parts |=(t=itype [origin i.xs t]))
7972+ $(xs t.xs, out (weld out rows), origin +(origin))
7973+::
7974+++ infer-known-union-whole
7975+ |= [e=expr env=ienv subject=iresult]
7976+ ^- (unit iresult)
7977+ ?> ?=(%branch -.e)
7978+ ?: ?=(%| -.subject) `subject
7979+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7980+ ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
7981+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7982+ ?~ live ~
7983+ =/ cases=(list itype) u.live
7984+ =/ remaining=(list itype) cases
7985+ =/ arms=(list arm) arms.e
7986+ =/ st=istate state.p.subject
7987+ =/ answer=(unit itype) ~
7988+ |-
7989+ ?~ arms
7990+ ?^ remaining
7991+ `[%| ["missing union case {(show-itype i.remaining sub.st)}" ~]]
7992+ ?~ answer `[%| ["empty union branch is not supported by partial inference" ~]]
7993+ `[%& u.answer st]
7994+ =/ a=arm i.arms
7995+ ?: (lien remaining |=(c=itype =(%unknown (union-pattern pat.a c))))
7996+ ~
7997+ =/ matching=(list itype) (skim remaining |=(c=itype =(%full (union-pattern pat.a c))))
7998+ ?~ matching
7999+ ?: (lien cases |=(c=itype =(%full (union-pattern pat.a c))))
8000+ `[%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
8001+ `[%| ["union pattern is not supported by partial inference" ~]]
8002+ ?: &(?=(^ t.matching) (union-pattern-has-bind pat.a))
8003+ `[%| ["a union pattern binding several cases is not supported by partial inference" ~]]
8004+ =/ bound=(unit ienv) (union-pattern-bind pat.a i.matching env globals.st)
8005+ ?~ bound `[%| ["pattern binder shadows a name" ~]]
8006+ =/ body=iresult (infer-fragment val.a u.bound st)
8007+ ?: ?=(%| -.body) `body
8008+ =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
8009+ =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
8010+ ?: mismatch `[%| ["union branch result matching needs unsupported inference" ~]]
8011+ $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body, answer `result)
8012+::
8013+++ infer-known-union-context-whole
8014+ |= [e=expr expected=itype env=ienv subject=iresult context=span]
8015+ ^- (unit iresult)
8016+ ?> ?=(%branch -.e)
8017+ ?: ?=(%| -.subject) `subject
8018+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8019+ ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
8020+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
8021+ ?~ live ~
8022+ =/ cases=(list itype) u.live
8023+ =/ remaining=(list itype) cases
8024+ =/ arms=(list arm) arms.e
8025+ =/ st=istate state.p.subject
8026+ =/ answer=(unit itype) ~
8027+ |-
8028+ ?~ arms
8029+ ?^ remaining
8030+ `[%| ["missing union case {(show-itype i.remaining sub.st)}" ~]]
8031+ ?~ answer `[%| ["empty union branch is not supported by partial inference" ~]]
8032+ `[%& expected st]
8033+ =/ a=arm i.arms
8034+ ?: (lien remaining |=(c=itype =(%unknown (union-pattern pat.a c))))
8035+ ~
8036+ =/ matching=(list itype) (skim remaining |=(c=itype =(%full (union-pattern pat.a c))))
8037+ ?~ matching
8038+ ?: (lien cases |=(c=itype =(%full (union-pattern pat.a c))))
8039+ `[%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
8040+ `[%| ["union pattern is not supported by partial inference" ~]]
8041+ ?: &(?=(^ t.matching) (union-pattern-has-bind pat.a))
8042+ `[%| ["a union pattern binding several cases is not supported by partial inference" ~]]
8043+ =/ bound=(unit ienv) (union-pattern-bind pat.a i.matching env globals.st)
8044+ ?~ bound `[%| ["pattern binder shadows a name" ~]]
8045+ =/ body=iresult (infer-call-context-arg val.a expected u.bound st context)
8046+ ?: ?=(%| -.body) `body
8047+ =/ fit=ifit (itype-fit typ.p.body expected sub.state.p.body next.state.p.body)
8048+ ?: ?=(%unknown -.fit) `[%| ["union branch result constraint is not supported by partial inference" ~]]
8049+ ?: ?=(%bad -.fit)
8050+ =/ missing=(unit idiag) (missing-union-tag val.a expected sub.state.p.body context)
8051+ ?^ missing `[%| u.missing]
8052+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body expected sub.state.p.body next.state.p.body context)
8053+ ?^ nested `[%| u.nested]
8054+ `[%| ["union branch arm does not fit its expected type" ~[[context "expected type"] [(span-of val.a) "branch arm"]]]]
8055+ ?: (itype-has-tag (itype-normalize expected sub.fit))
8056+ `[%| ["union branch result needs context in partial inference" ~]]
8057+ $(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)
8058+::
8059+++ infer-known-union-finite
8060+ |= [e=expr env=ienv subject=iresult expected=(unit [typ=itype context=span])]
8061+ ^- iresult
8062+ ?> ?=(%branch -.e)
8063+ ?: ?=(%| -.subject) subject
8064+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8065+ ?. ?=(%union -.typ) [%| ["branch is not supported by partial inference" ~]]
8066+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
8067+ ?~ live [%| ["union emptiness needs unsupported inference" ~]]
8068+ =/ expanded=(unit (list ifinite)) (finite-cases u.live ~ 0)
8069+ ?~ expanded [%| ["union pattern expansion needs unsupported inference" ~]]
8070+ =/ cases=(list ifinite) u.expanded
8071+ =/ remaining=(list ifinite) cases
8072+ =/ arms=(list arm) arms.e
8073+ =/ st=istate state.p.subject
8074+ =/ answer=(unit itype) ~
8075+ |-
8076+ ?~ arms
8077+ ?^ remaining
8078+ [%| ["missing union case {(show-itype part.i.remaining sub.st)}" ~]]
8079+ ?~ answer [%| ["empty union branch is not supported by partial inference" ~]]
8080+ ?~ expected [%& u.answer st]
8081+ [%& typ.u.expected st]
8082+ =/ a=arm i.arms
8083+ ?: (lien remaining |=(c=ifinite =(%unknown (union-pattern pat.a part.c))))
8084+ [%| ["partial union pattern is not supported by partial inference" ~]]
8085+ =/ matching=(list ifinite) (skim remaining |=(c=ifinite =(%full (union-pattern pat.a part.c))))
8086+ ?~ matching
8087+ ?: (lien cases |=(c=ifinite =(%full (union-pattern pat.a part.c))))
8088+ [%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
8089+ [%| ["union pattern is not supported by partial inference" ~]]
8090+ ?: &((union-pattern-has-bind pat.a) (lien t.matching |=(c=ifinite !=(origin.c origin.i.matching))))
8091+ [%| ["a union pattern binding several cases is not supported by partial inference" ~]]
8092+ =/ bound=(unit ienv) (union-pattern-bind pat.a base.i.matching env globals.st)
8093+ ?~ bound [%| ["pattern binder shadows a name" ~]]
8094+ =/ body=iresult
8095+ ?~ expected (infer-fragment val.a u.bound st)
8096+ (infer-call-context-arg val.a typ.u.expected u.bound st context.u.expected)
8097+ ?: ?=(%| -.body) body
8098+ ?^ expected
8099+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
8100+ ?: ?=(%unknown -.fit) [%| ["union branch result constraint is not supported by partial inference" ~]]
8101+ ?: ?=(%bad -.fit)
8102+ =/ missing=(unit idiag) (missing-union-tag val.a typ.u.expected sub.state.p.body context.u.expected)
8103+ ?^ missing [%| u.missing]
8104+ =/ 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)
8105+ ?^ nested [%| u.nested]
8106+ [%| ["union branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.a) "branch arm"]]]]
8107+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
8108+ [%| ["union branch result needs context in partial inference" ~]]
8109+ $(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)
8110+ =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
8111+ =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
8112+ ?: mismatch [%| ["union branch result matching needs unsupported inference" ~]]
8113+ $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body, answer `result)
8114+::
8115+:: Prove a one-arm record pattern covers a known, non-union subject.
8116+:: Variable or partial matches stay unsupported; binding uses the same
8117+:: scope and original payload types as the existing union matcher.
8118+++ single-structured-pattern
8119+ |= e=expr
8120+ ^- ?
8121+ ?. ?=(%branch -.e) |
8122+ ?~ arms.e |
8123+ ?^ t.arms.e |
8124+ =/ p=pattern pat.i.arms.e
8125+ ?. ?=(%cell -.p) |
8126+ !(levy items.p |=(x=pattern ?=(%bind -.x)))
8127+::
8128+++ infer-single-case-branch
8129+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
8130+ ^- iresult
8131+ ?> (single-structured-pattern e)
8132+ ?> ?=(%branch -.e)
8133+ ?> ?=(^ arms.e)
8134+ =/ a=arm i.arms.e
8135+ =/ subject=iresult (infer-fragment subject.e env state)
8136+ ?: ?=(%| -.subject) subject
8137+ =/ st=istate state.p.subject
8138+ =/ typ=itype (itype-normalize typ.p.subject sub.st)
8139+ ?: ?=(%union -.typ) [%| ["single-case pattern needs unsupported inference" ~]]
8140+ ?. =(%full (union-pattern pat.a typ))
8141+ [%| ["single-case pattern needs unsupported inference" ~]]
8142+ =/ bound=(unit ienv) (union-pattern-bind pat.a typ env globals.st)
8143+ ?~ bound [%| ["pattern binder shadows a name" ~]]
8144+ ?~ expected (infer-fragment val.a u.bound st)
8145+ =/ body=iresult (infer-call-context-arg val.a typ.u.expected u.bound st context.u.expected)
8146+ ?: ?=(%| -.body) body
8147+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
8148+ ?: ?=(%unknown -.fit) [%| ["single-case branch result constraint is not supported by partial inference" ~]]
8149+ ?: ?=(%bad -.fit)
8150+ =/ missing=(unit idiag) (missing-union-tag val.a typ.u.expected sub.state.p.body context.u.expected)
8151+ ?^ missing [%| u.missing]
8152+ =/ 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)
8153+ ?^ nested [%| u.nested]
8154+ [%| ["single-case branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.a) "branch arm"]]]]
8155+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
8156+ [%| ["single-case branch result needs context in partial inference" ~]]
8157+ [%& typ.u.expected state.p.body(sub sub.fit, next next.fit)]
8158+::
8159+:: This view is used only by pattern analysis, never exported or bound as
8160+:: the subject. Only null plus a two-binder/wildcard cell is supported; its
8161+:: tail keeps the original recursive type. Other patterns fail closed.
8162+++ jrec-match-view
8163+ |= [e=expr subject=iresult]
8164+ ^- iresult
8165+ ?: ?=(%| -.subject) subject
8166+ ?. ?=(%branch -.e) subject
8167+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8168+ ?. ?=(%jrec -.typ) subject
8169+ ?~ arms.e subject
8170+ ?~ t.arms.e subject
8171+ ?^ t.t.arms.e subject
8172+ =/ x=pattern pat.i.arms.e
8173+ =/ y=pattern pat.i.t.arms.e
8174+ =/ empty=? &(?=(%lit -.x) =(%null form.lit.x))
8175+ =/ full=pattern ?:(empty y x)
8176+ ?. |(empty &(?=(%lit -.y) =(%null form.lit.y))) subject
8177+ ?. ?=(%cell -.full) subject
8178+ ?~ items.full subject
8179+ ?~ t.items.full subject
8180+ ?^ t.t.items.full subject
8181+ ?. |(?=(%bind -.i.items.full) ?=(%any -.i.items.full)) subject
8182+ ?. |(?=(%bind -.i.t.items.full) ?=(%any -.i.t.items.full)) subject
8183+ ?: =(0 jrec-fuel.state.p.subject)
8184+ [%| ["recursive mold unfolding needs unsupported inference" ~]]
8185+ =/ nil=itype [%const [%null %n 0 '~']]
8186+ =/ cell=itype [%cell [%face head.typ [%atom aura.typ]] [%face tail.typ typ]]
8187+ [%& [%union ~[nil cell] ~ ~ ~] state.p.subject(jrec-fuel (dec jrec-fuel.state.p.subject))]
8188+::
8189+:: A bounded source-proven tree match permits flat tag patterns and
8190+:: nonbinding catch-alls. Whole-case binders cannot consume the temporary
8191+:: structural view. Pattern count and field arity are checked first.
8192+++ grec-simple-pattern
8193+ |= [pat=pattern view=itype]
8194+ ^- ?
8195+ ?. ?=(%cell -.pat) |
8196+ ?~ items.pat |
8197+ =/ first=pattern i.items.pat
8198+ ?. ?=(%lit -.first) |
8199+ ?. =(%term form.lit.first) |
8200+ =/ chosen=(unit itype) (contextual-tagged-case view val.lit.first ~)
8201+ ?~ chosen |
8202+ ?> ?=(%cell -.u.chosen)
8203+ =/ rest=(list pattern) t.items.pat
8204+ =/ arity=? ?:(?=(%cell -.tal.u.chosen) ?=([* [* ~]] rest) ?=([* ~] rest))
8205+ ?. arity |
8206+ (levy rest |=(p=pattern |(?=(%bind -.p) ?=(%any -.p))))
8207+::
8208+:: A catch-all with no binder is safe even when it covers both cases.
8209+:: A bound whole case still declines to avoid exporting the analysis view.
8210+++ grec-patterns-eligible
8211+ |= [arms=(list arm) view=itype left=@ud]
8212+ ^- ?
8213+ ?~ arms &
8214+ ?: =(0 left) |
8215+ =/ pat=pattern pat.i.arms
8216+ ?. |(?=(%any -.pat) (grec-simple-pattern pat view)) |
8217+ $(arms t.arms, left (dec left))
8218+++ grec-match-view
8219+ |= [e=expr subject=iresult]
8220+ ^- iresult
8221+ ?: ?=(%| -.subject) subject
8222+ ?. ?=(%branch -.e) subject
8223+ ?. (grec-direct-context typ.p.subject sub.state.p.subject) subject
8224+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8225+ ?. ?=(%grec -.typ) subject
8226+ ?~ arms.e subject
8227+ =/ view=(unit [view=itype left=@ud]) (grec-unfold-view typ jrec-fuel.state.p.subject)
8228+ ?~ view [%| ["recursive mold unfolding needs unsupported inference" ~]]
8229+ ?. (grec-patterns-eligible arms.e view.u.view 128) subject
8230+ [%& view.u.view state.p.subject(jrec-fuel left.u.view)]
8231+::
8232+:: A single-arm diagnostic only probes a direct, source-typed in-scope wing;
8233+:: other subjects retain the prior single-pattern inference path.
8234+++ grec-single-wing-subject
8235+ |= [e=expr env=ienv state=istate]
8236+ ^- (unit iresult)
8237+ ?. ?=(%wing -.e) ~
8238+ ?. ?=([@ ~] names.e) ~
8239+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8240+ ?~ scheme ~
8241+ ?. (grec-direct-context typ.u.scheme sub.state) ~
8242+ `(infer-fragment e env state)
8243+::
8244+++ infer-known-union-branch-subject
8245+ |= [e=expr env=ienv subject=iresult]
8246+ ^- iresult
8247+ =. subject (grec-match-view e subject)
8248+ =. subject (jrec-match-view e subject)
8249+ =/ whole=(unit iresult) (infer-known-union-whole e env subject)
8250+ ?~ whole (infer-known-union-finite e env subject ~)
8251+ u.whole
8252+::
8253+++ infer-known-union-branch
8254+ |= [e=expr env=ienv state=istate]
8255+ ^- iresult
8256+ ?> ?=(%branch -.e)
8257+ (infer-known-union-branch-subject e env (infer-fragment subject.e env state))
8258+::
8259+++ infer-known-union-context-subject
8260+ |= [e=expr expected=itype env=ienv subject=iresult context=span]
8261+ ^- iresult
8262+ =. subject (grec-match-view e subject)
8263+ =. subject (jrec-match-view e subject)
8264+ =/ whole=(unit iresult) (infer-known-union-context-whole e expected env subject context)
8265+ ?~ whole (infer-known-union-finite e env subject `[expected context])
8266+ u.whole
8267+::
8268+:: Limit speculative subject inference to wings and shallow calls;
8269+:: grouping is peeled linearly and cannot introduce a nested branch.
8270+++ simple-union-subject-arg
8271+ |= e=expr
8272+ ^- ?
8273+ ?- -.e
8274+ %wing &
8275+ %lit &
8276+ %str !(lien pieces.e |=(p=piece ?=(%expr -.p)))
8277+ * |
8278+ ==
8279+::
8280+++ safe-union-subject
8281+ |= e=expr
8282+ ^- ?
8283+ ?: ?=(%group -.e) $(e inner.e)
8284+ ?: ?=(%wing -.e) &
8285+ ?. ?=(%call -.e) |
8286+ ?. ?=(%wing -.head.e) |
8287+ (levy args.e simple-union-subject-arg)
8288+::
8289+++ duplicate-loobean-arms
8290+ |= e=expr
8291+ ^- ?
8292+ ?. ?=(%branch -.e) |
8293+ ?~ arms.e |
8294+ ?~ t.arms.e |
8295+ ?^ t.t.arms.e |
8296+ =/ x=pattern pat.i.arms.e
8297+ =/ y=pattern pat.i.t.arms.e
8298+ ?. &(?=(%lit -.x) ?=(%lit -.y)) |
8299+ ?. &(=(%loobean form.lit.x) =(%loobean form.lit.y)) |
8300+ =(val.lit.x val.lit.y)
8301+::
8302+++ union-subject-call
8303+ |= e=expr
8304+ ^- ?
8305+ ?: ?=(%group -.e) $(e inner.e)
8306+ ?=(%call -.e)
8307+::
8308+++ known-union-subject
8309+ |= [e=expr env=ienv state=istate]
8310+ ^- (unit iresult)
8311+ ?. (safe-union-subject e) ~
8312+ =/ subject=iresult (infer-fragment e env state)
8313+ ?: ?=(%| -.subject) ?:((union-subject-call e) `subject ~)
8314+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8315+ ?. |(?=(%union -.typ) ?=(%jrec -.typ) &(?=(%grec -.typ) (grec-direct-context typ.p.subject sub.state.p.subject))) ~
8316+ `subject
8317+::
8318+:: A direct wing with an already-known union may skip genuinely empty cases
8319+:: when checking a one-arm match. Other subjects keep their existing path.
8320+:: A directly known canonical list of an empty element contains only null.
8321+:: This helper never refines an opaque or variable-bound subject.
8322+++ empty-list-null-branch
8323+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
8324+ ^- (unit iresult)
8325+ ?. ?=(%branch -.e) ~
8326+ ?~ arms.e ~
8327+ ?^ t.arms.e ~
8328+ ?. (unit-empty-pattern pat.i.arms.e) ~
8329+ ?. ?=(%wing -.subject.e) ~
8330+ ?. ?=([@ ~] names.subject.e) ~
8331+ =/ scheme=(unit ischeme) (ienv-lookup i.names.subject.e env)
8332+ ?~ scheme ~
8333+ ?. ?=(%collection -.typ.u.scheme) ~
8334+ ?. =(%list name.typ.u.scheme) ~
8335+ ?~ prelude.state ~
8336+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb) ~
8337+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
8338+ ?~ standard ~
8339+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
8340+ =/ subject=iresult (infer-fragment subject.e env state)
8341+ ?: ?=(%| -.subject) ~
8342+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8343+ ?. ?=(%collection -.typ) ~
8344+ ?. =(%list name.typ) ~
8345+ ?~ args.typ ~
8346+ ?^ t.args.typ ~
8347+ =/ proof=(unit [empty=? left=@ud]) (itype-empty-proof i.args.typ sub.state.p.subject 256)
8348+ ?~ proof ~
8349+ ?. empty.u.proof ~
8350+ ?~ expected `(infer-fragment val.i.arms.e env state.p.subject)
8351+ =/ body=iresult (infer-call-context-arg val.i.arms.e typ.u.expected env state.p.subject context.u.expected)
8352+ ?: ?=(%| -.body) `body
8353+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
8354+ ?: ?=(%unknown -.fit) `[%| ["single-case branch result constraint is not supported by partial inference" ~]]
8355+ ?: ?=(%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"]]]]
8356+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
8357+ `[%| ["single-case branch result needs context in partial inference" ~]]
8358+ `[%& typ.p.body state.p.body(sub sub.fit, next next.fit)]
8359+::
8360+++ known-empty-union-wing
8361+ |= [e=expr env=ienv state=istate]
8362+ ^- (unit iresult)
8363+ ?. ?=(%wing -.e) ~
8364+ ?. ?=([@ ~] names.e) ~
8365+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8366+ ?~ scheme ~
8367+ ?. (contextual-direct-union typ.u.scheme) ~
8368+ =/ subject=iresult (infer-fragment e env state)
8369+ ?: ?=(%| -.subject) ~
8370+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8371+ ?. ?=(%union -.typ) ~
8372+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
8373+ ?~ live ~
8374+ ?: =(u.live cases.typ) ~
8375+ `subject
8376+::
8377+:: Infer changes only against a fully known record spine. Retain the
8378+:: target type; unknown spines and repeated edits remain unsupported.
8379+++ change-spine-known
8380+ |= [t=itype sub=isub]
8381+ ^- ?
8382+ =. t (itype-walk t sub)
8383+ ?: ?=(%face -.t) &
8384+ ?. ?=(%cell -.t) |
8385+ =/ first=itype (itype-walk hed.t sub)
8386+ ?. ?=(%face -.first) |
8387+ $(t tal.t)
8388+::
8389+++ infer-change-edits
8390+ |= [edits=(list edit) target=itype env=ienv state=istate seen=(list term)]
8391+ ^- iresult
8392+ ?~ edits [%& target state]
8393+ =/ entry=edit i.edits
8394+ ?: (lien seen |=(name=term =(name name.entry)))
8395+ [%| ["repeated change fields are not supported by partial inference" ~]]
8396+ ?. (change-spine-known target sub.state)
8397+ [%| ["change target needs a known record in partial inference" ~]]
8398+ =/ found=(list itype) (record-fields-named name.entry target sub.state)
8399+ ?~ found
8400+ [%| ["record has no field `{(trip name.entry)}`" ~[[at.entry "unknown field"]]]]
8401+ ?^ t.found [%| ["change field is ambiguous in partial inference" ~]]
8402+ =/ expected=itype i.found
8403+ =/ value=iresult (infer-call-context-arg val.entry expected env state at.entry)
8404+ ?: ?=(%| -.value) value
8405+ =/ fit=ifit (itype-fit typ.p.value expected sub.state.p.value next.state.p.value)
8406+ ?: ?=(%unknown -.fit) [%| ["change field constraint is not supported by partial inference" ~]]
8407+ ?: ?=(%bad -.fit)
8408+ [%| ["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)]]]]
8409+ $(edits t.edits, state state.p.value(sub sub.fit, next next.fit), seen [name.entry seen])
8410+::
8411+:: Backtick constructs the canonical prelude unit, after checking its
8412+:: prepared template has the standard null and [~ u=A] cases.
8413+++ standard-unit-template
8414+ |= [template=ischeme at=path]
8415+ ^- ?
8416+ ?. =(at /lib/jibb/prelude/jibb) |
8417+ ?~ vars.template |
8418+ ?^ t.vars.template |
8419+ =/ v=@ud i.vars.template
8420+ =/ nil=itype [%const [%null %n 0 '~']]
8421+ =/ expected=itype
8422+ [%union ~[nil [%cell nil [%face %u [%var v]]]] `[at %unit] `%unit ~[[%var v]]]
8423+ =(typ.template expected)
8424+::
8425+:: A named missing-case diagnostic needs more than a failed fit: a case
8426+:: with that tag but the wrong payload is not a missing case. Unknown
8427+:: shapes and atom types that accept terms keep the proof conservative.
8428++$ itag-presence ?(%yes %no %maybe)
8429+++ tag-presence-cases
8430+ |= [cases=(list itype) value=@ sub=isub]
8431+ ^- itag-presence
8432+ ?~ cases %no
8433+ =/ first=itag-presence (tag-presence i.cases value sub)
8434+ ?: =(%yes first) %yes
8435+ =/ rest=itag-presence $(cases t.cases)
8436+ ?: =(%yes rest) %yes
8437+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
8438+ %no
8439+::
8440+++ tag-presence
8441+ |= [t=itype value=@ sub=isub]
8442+ ^- itag-presence
8443+ =. t (itype-walk t sub)
8444+ ?- -.t
8445+ %const ?:(=(value val.literal.t) %yes %no)
8446+ %flag ?:(|(=(value 0) =(value 1)) %yes %no)
8447+ %atom ?:(|(=(%tas aura.t) =(%ta aura.t)) %maybe %no)
8448+ %face $(t body.t)
8449+ %cell
8450+ =/ first=itag-presence $(t hed.t)
8451+ ?: =(%yes first) %yes
8452+ =/ rest=itag-presence $(t tal.t)
8453+ ?: =(%yes rest) %yes
8454+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
8455+ %no
8456+ %union (tag-presence-cases cases.t value sub)
8457+ * %maybe
8458+ ==
8459+::
8460+++ missing-union-tag
8461+ |= [e=expr expected=itype sub=isub context=span]
8462+ ^- (unit idiag)
8463+ ?. ?=(%lit -.e) ~
8464+ ?. =(%term form.lit.e) ~
8465+ =. expected (itype-walk expected sub)
8466+ |-
8467+ ?: ?=(%face -.expected) $(expected (itype-walk body.expected sub))
8468+ ?. ?=(%union -.expected) ~
8469+ ?. =(%no (tag-presence-cases cases.expected val.lit.e sub)) ~
8470+ =/ label=tape
8471+ ?~ label.expected "union {(show-itype expected sub)}"
8472+ (show-itype expected sub)
8473+ `["{label} has no case `{(trip txt.lit.e)}`" ~[[context "expected union"] [(span-of e) "tag"]]]
8474+::
8475+:: Locate a missing tag inside a syntactic tuple only by replaying the
8476+:: directional fit in source order. Uncertain or earlier failures stop
8477+:: the walk, preserving the generic diagnostic rather than guessing.
8478+++ nested-missing-tag
8479+ |= [e=expr actual=itype expected=itype sub=isub next=@ud context=span]
8480+ ^- (unit idiag)
8481+ =/ original=[left=itype right=itype] [actual expected]
8482+ ?: |(?=(%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))) ~
8483+ =/ fit=ifit (itype-fit actual expected sub next)
8484+ ?. ?=(%bad -.fit) ~
8485+ =. actual (itype-walk actual sub)
8486+ =. expected (itype-walk expected sub)
8487+ ?: &(?=(%face -.actual) ?=(%face -.expected))
8488+ ?. =(name.actual name.expected) ~
8489+ $(actual body.actual, expected body.expected)
8490+ ?: ?=(%face -.actual) $(actual body.actual)
8491+ ?: ?=(%face -.expected) $(expected body.expected)
8492+ =/ direct=(unit idiag) (missing-union-tag e expected sub context)
8493+ ?^ direct direct
8494+ ?. ?=(%tuple -.e) ~
8495+ (nested-missing-items items.e actual expected sub next context)
8496+::
8497+++ nested-missing-items
8498+ |= [items=(list item) actual=itype expected=itype sub=isub next=@ud context=span]
8499+ ^- (unit idiag)
8500+ ?~ items ~
8501+ ?~ t.items (nested-missing-tag val.i.items actual expected sub next context)
8502+ =/ original=[left=itype right=itype] [actual expected]
8503+ ?: |(?=(%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))) ~
8504+ =. actual (itype-walk actual sub)
8505+ =. expected (itype-walk expected sub)
8506+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8507+ =/ first=ifit (itype-fit hed.actual hed.expected sub next)
8508+ ?: ?=(%bad -.first)
8509+ (nested-missing-tag val.i.items hed.actual hed.expected sub next context)
8510+ ?. ?=(%ok -.first) ~
8511+ $(items t.items, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
8512+::
8513+:: A term-headed pair is the same noun as a two-item cell. Preserve the
8514+:: whole pair span for the synthetic head and the value's own span for
8515+:: the payload; unresolved term constraints follow ordinary cell inference.
8516+++ pair-as-cell
8517+ |= e=expr
8518+ ^- expr
8519+ ?> ?=(%pair -.e)
8520+ =/ head=expr [%lit at.e [%term %tas tag.e (crip ['%' (trip tag.e)])]]
8521+ [%tuple at.e ~[[at.e ~ head] [(span-of val.e) ~ val.e]]]
8522+::
8523+:: A segment costs one shared step; dynamic segments are not handled yet.
8524+++ qath-static-fuel
8525+ |= [segs=(list qseg) fuel=@ud]
8526+ ^- (unit @ud)
8527+ ?~ segs `fuel
8528+ ?: =(0 fuel) ~
8529+ ?. ?=(%knot -.i.segs) ~
8530+ $(segs t.segs, fuel (dec fuel))
8531+::
8532+++ infer-fragment
8533+ |= [e=expr env=ienv state=istate]
8534+ ^- iresult
8535+ ?- -.e
8536+ %pair $(e (pair-as-cell e))
8537+ %lit
8538+ ?- form.lit.e
8539+ %number ?: =(%ud aura.lit.e)
8540+ [%& [%nvar next.state] state(next +(next.state))]
8541+ [%& [%atom aura.lit.e] state]
8542+ %ship [%& [%atom %p] state]
8543+ %date [%& [%atom %da] state]
8544+ %duration [%& [%atom %dr] state]
8545+ %knot [%& [%atom %ta] state]
66358546 %loobean [%& [%flag ~] state]
6636− %term [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
6637− %null [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
8547+ %term [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e at.e] tags.state])]
8548+ %null [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e at.e] tags.state])]
66388549 ==
6639− %str
6640− =/ interpolated=? (lien pieces.e |=(p=piece ?=(%expr -.p)))
6641− ?: interpolated [%| ["interpolation is not supported by partial inference" ~]]
6642− [%& [%atom %t] state]
8550+ %unit
8551+ ?~ prelude.state [%| ["unit construction needs the standard prelude in partial inference" ~]]
8552+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
8553+ ?~ standard [%| ["unit construction needs the standard prelude in partial inference" ~]]
8554+ ?. (standard-unit-template u.standard at.u.prelude.state)
8555+ [%| ["unit construction needs the standard prelude in partial inference" ~]]
8556+ =/ value=iresult $(e val.e)
8557+ ?: ?=(%| -.value) value
8558+ =/ result=(unit itype) (template-apply u.standard ~[typ.p.value])
8559+ ?~ result [%| ["unit construction is not supported by partial inference" ~]]
8560+ [%& u.result state.p.value]
8561+ %list
8562+ ?~ prelude.state [%| ["list literal needs the standard prelude in partial inference" ~]]
8563+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
8564+ [%| ["list literal needs the standard prelude in partial inference" ~]]
8565+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
8566+ ?~ standard [%| ["list literal needs the standard prelude in partial inference" ~]]
8567+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
8568+ [%| ["list literal needs the standard prelude in partial inference" ~]]
8569+ =/ element=itype [%var next.state]
8570+ =/ result=iresult (infer-open-list-items items.e element env state(next +(next.state)) at.e)
8571+ ?: ?=(%| -.result) result
8572+ [%& [%collection %list ~[element]] state.p.result]
8573+ %str (infer-string-pieces pieces.e env state)
8574+ %qath
8575+ ?~ prelude.state [%| ["application path needs the standard prelude in partial inference" ~]]
8576+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
8577+ [%| ["application path needs the standard prelude in partial inference" ~]]
8578+ =/ standard=(unit ischeme) (find-jibb-mold %qath u.prelude.state)
8579+ ?~ standard [%| ["application path needs the standard prelude in partial inference" ~]]
8580+ ?. ?=(~ vars.u.standard) [%| ["application path mold needs unsupported inference" ~]]
8581+ =/ typ=itype typ.u.standard
8582+ ?. ?=(%jrec -.typ) [%| ["application path mold needs unsupported inference" ~]]
8583+ ?. &(=(at.typ /lib/jibb/internal/jibb) =(%qath name.typ) =(%i head.typ) =(%ta aura.typ) =(%t tail.typ))
8584+ [%| ["application path mold needs unsupported inference" ~]]
8585+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
8586+ =/ remain=(unit @ud) (qath-static-fuel segs.e (dec jrec-fuel.state))
8587+ ?~ remain [%| ["application path segments need unsupported inference" ~]]
8588+ [%& typ state(jrec-fuel u.remain)]
66438589 %wing
66448590 ?~ names.e [%| ["empty wing" ~]]
66458591 ?^ t.names.e
@@ -6648,7 +8594,7 @@
66488594 ?~ iface (infer-field-wing names.e env state)
66498595 =/ member=(unit ischeme) (ienv-lookup i.names.e values.u.iface)
66508596 ?~ member [%| ["module member is not available to partial inference" ~]]
6651− =. typ.u.member (itype-in-import typ.u.member u.iface i.t.names.e)
8597+ =. typ.u.member (itype-in-import typ.u.member u.iface i.t.names.e prelude.state)
66528598 =/ instance=[typ=itype state=istate] (instantiate-scheme u.member state)
66538599 [%& typ.instance state.instance]
66548600 =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
@@ -6661,12 +8607,20 @@
66618607 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
66628608 [%& typ.instance state.instance]
66638609 %group $(e inner.e)
6664− %ctor [%& [%tag next.state tag.e &] state(next +(next.state), tags [[next.state tag.e] tags.state])]
8610+ %change
8611+ ?~ edits.e [%| ["a change takes at least one field" ~[[at.e "empty change"]]]]
8612+ =/ target=iresult $(e [%wing at.e target.e])
8613+ ?: ?=(%| -.target) target
8614+ (infer-change-edits edits.e typ.p.target env state.p.target ~)
8615+ %ctor [%& [%tag next.state tag.e &] state(next +(next.state), tags [[next.state tag.e at.e] tags.state])]
66658616 %trace
66668617 =/ traced=iresult $(e val.e)
66678618 ?: ?=(%| -.traced) traced
66688619 $(e then.e, state state.p.traced)
6669− %tuple (infer-simple-items items.e env state)
8620+ %tuple
8621+ ?: &(?=(^ defer.state) ?=(^ prelude.state))
8622+ (dg-infer-tuple-items items.e env state)
8623+ (infer-simple-items items.e env state)
66708624 %body
66718625 ?~ defs.e $(e final.e)
66728626 =/ local-names=(list term) (global-value-names defs.e)
@@ -6677,6 +8631,9 @@
66778631 [%| ["local molds shadow a name" ~]]
66788632 =/ local-state=istate
66798633 state(globals (weld local-names globals.state), molds (weld local-molds molds.state))
8634+ =/ mold-hole=(unit span) (simple-local-mold-hole defs.e)
8635+ ?^ mold-hole
8636+ [%| ["type hole needs a determined type" ~[[u.mold-hole "unresolved type hole"]]]]
66808637 ?. (local-molds-supported local-molds local-state)
66818638 [%| ["local molds need unsupported inference" ~]]
66828639 =/ values=(list def) (local-value-defs defs.e)
@@ -6686,21 +8643,38 @@
66868643 ?: ?=(%| -.result) result
66878644 [%& typ.p.result state.p.result(globals globals.state, molds molds.state)]
66888645 %branch
8646+ ?^ defer.state (dg-boolean-branch e env state)
66898647 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
6690− ?~ t.arms.e (infer-cell-branch e env state)
6691− ?^ t.t.arms.e [%| ["branch is not supported by partial inference" ~]]
8648+ ?~ t.arms.e
8649+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state ~)
8650+ ?^ empty-list u.empty-list
8651+ =/ empty-union=(unit iresult) (known-empty-union-wing subject.e env state)
8652+ ?^ empty-union (infer-known-union-branch-subject e env u.empty-union)
8653+ =/ single=(unit iresult) (grec-single-wing-subject subject.e env state)
8654+ ?^ single (infer-known-union-branch-subject e env u.single)
8655+ ?: (single-structured-pattern e) (infer-single-case-branch e env state ~)
8656+ (infer-cell-branch e env state ~)
8657+ ?^ t.t.arms.e (infer-known-union-branch e env state)
8658+ =/ known=(unit iresult) (known-union-subject subject.e env state)
8659+ ?: &(?=(^ known) ?=(%| -.u.known) !(duplicate-loobean-arms e)) u.known
8660+ ?: &(?=(^ known) ?=(%& -.u.known) ?=(~ (unit-union-payload (itype-normalize typ.p.u.known sub.state.p.u.known))))
8661+ (infer-known-union-branch-subject e env u.known)
66928662 =/ x=arm i.arms.e
66938663 =/ y=arm i.t.arms.e
66948664 ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
66958665 (infer-unit-branch e env state ~)
6696− ?. ?=(%lit -.pat.x) [%| ["branch pattern is not supported by partial inference" ~]]
6697− ?. ?=(%lit -.pat.y) [%| ["branch pattern is not supported by partial inference" ~]]
8666+ ?. ?=(%lit -.pat.x) (infer-known-union-branch e env state)
8667+ ?. ?=(%lit -.pat.y) (infer-known-union-branch e env state)
66988668 ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
6699− [%| ["branch pattern is not supported by partial inference" ~]]
8669+ (infer-known-union-branch e env state)
8670+ ?: &(?=(^ known) ?=(%& -.u.known)) (infer-known-union-branch-subject e env u.known)
67008671 ?: =(val.lit.pat.x val.lit.pat.y)
67018672 [%| ["branch does not cover both loobeans" ~]]
67028673 =/ subject=iresult $(e subject.e)
67038674 ?: ?=(%| -.subject) subject
8675+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
8676+ ?: ?=(%union -.subject-type)
8677+ [%| ["union-pattern branch subject is not supported by partial inference" ~]]
67048678 =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
67058679 ?~ su [%| ["loobean branch subject does not unify with ?" ~]]
67068680 =/ left=iresult $(e val.x, state state.p.subject(sub u.su))
@@ -6728,29 +8702,32 @@
67288702 %cast
67298703 =/ target=(unit [typ=itype state=istate]) (infer-simple-shape shape.e state)
67308704 ?~ target
6731− =/ diag=(unit idiag) (direct-import-invalid shape.e state)
8705+ =/ diag=(unit idiag) (nested-import-invalid shape.e state)
67328706 ?^ diag [%| u.diag]
67338707 [%| ["cast mold is not supported by partial inference" ~]]
67348708 =/ value=iresult
6735− ?: &(?=(%union -.typ.u.target) (context-union-branch val.e))
6736− (infer-union-context val.e typ.u.target env state.u.target at.shape.e)
6737− ?: &(?=(%collection -.typ.u.target) =(%list name.typ.u.target) (context-union-branch val.e))
6738− (infer-union-context val.e typ.u.target env state.u.target at.shape.e)
6739− ?: &(?=(%collection -.typ.u.target) =(%list name.typ.u.target) (context-list-expression val.e))
6740− (infer-list-context val.e typ.u.target env state.u.target at.shape.e)
6741− $(e val.e, state state.u.target)
8709+ (infer-call-context-arg val.e typ.u.target env state.u.target at.shape.e)
67428710 ?: ?=(%| -.value) value
8711+ =/ shape=(unit [source=iwfields target=iwfields])
8712+ (width-shape typ.p.value typ.u.target sub.state.p.value)
8713+ ?^ shape [%| ["record width constraint needs unsupported inference" ~]]
67438714 =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value next.state.p.value)
67448715 ?: ?=(%unknown -.fit) [%| ["cast constraint is not supported by partial inference" ~]]
67458716 ?: ?=(%bad -.fit)
8717+ =/ missing=(unit idiag) (missing-union-tag val.e typ.u.target sub.state.p.value at.shape.e)
8718+ ?^ missing [%| u.missing]
8719+ =/ 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)
8720+ ?^ nested [%| u.nested]
67468721 [%| ["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)]]]]
8722+ ?: &(?=(^ defer.state.p.value) !(dg-stable-fit typ.p.value typ.u.target sub.fit))
8723+ [%| ["deferred cast fit needs stable inference" ~]]
67478724 =/ merged=itype (itype-merge-faces typ.p.value typ.u.target sub.fit)
67488725 [%& merged state.p.value(sub sub.fit, next next.fit)]
67498726 %crash [%& [%var next.state] state(next +(next.state))]
67508727 %gate
67518728 =/ sam=isample-result (infer-sample sample.e env state)
67528729 ?: ?=(%| -.sam)
6753− =/ diag=(unit idiag) (direct-sample-invalid sample.e state)
8730+ =/ diag=(unit idiag) (sample-import-invalid sample.e env state)
67548731 ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
67558732 [%| [p.sam ~]]
67568733 =/ body=iresult $(e body.e, env env.p.sam, state state.p.sam)
@@ -6759,7 +8736,7 @@
67598736 %gate-wide
67608737 =/ sam=isample-result (infer-sample sample.e env state)
67618738 ?: ?=(%| -.sam)
6762− =/ diag=(unit idiag) (direct-sample-invalid sample.e state)
8739+ =/ diag=(unit idiag) (sample-import-invalid sample.e env state)
67638740 ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
67648741 [%| [p.sam ~]]
67658742 =/ body=iresult $(e body.e, env env.p.sam, state state.p.sam)
@@ -6767,43 +8744,9 @@
67678744 [%& [%fn typ.p.sam typ.p.body] state.p.body]
67688745 %call
67698746 ?~ args.e [%| ["call has no argument" ~]]
6770− =/ head=iresult $(e head.e)
6771− ?: ?=(%| -.head) head
6772− =/ head-type=itype (itype-walk typ.p.head sub.state.p.head)
6773− =/ arg=iresult
6774− ?^ t.args.e
6775− ?: ?=(%fn -.head-type)
6776− (infer-call-context-args args.e sample.head-type env state.p.head (span-of head.e))
6777− (infer-simple-items (turn args.e |=(a=expr [(span-of a) ~ a])) env state.p.head)
6778− ?: &(?=(%fn -.head-type) ?=(%union -.sample.head-type) (context-union-branch i.args.e))
6779− (infer-union-context i.args.e sample.head-type env state.p.head (span-of head.e))
6780− ?: &(?=(%fn -.head-type) ?=(%collection -.sample.head-type) =(%list name.sample.head-type) (context-union-branch i.args.e))
6781− (infer-union-context i.args.e sample.head-type env state.p.head (span-of head.e))
6782− ?: &(?=(%fn -.head-type) ?=(%collection -.sample.head-type) =(%list name.sample.head-type) (context-list-expression i.args.e))
6783− (infer-list-context i.args.e sample.head-type env state.p.head (span-of head.e))
6784− $(e i.args.e, state state.p.head)
6785− ?: ?=(%| -.arg) arg
6786− =/ st=istate state.p.arg
6787− =/ ht=itype (itype-walk typ.p.head sub.st)
6788− ?: ?=(%fn -.ht)
6789− =/ fit=ifit (itype-fit typ.p.arg sample.ht sub.st next.st)
6790− ?: ?=(%unknown -.fit) [%| ["call constraint is not supported by partial inference" ~]]
6791− ?: ?=(%bad -.fit)
6792− =/ bad=(unit [at=span typ=itype])
6793− ?~(t.args.e ~ (call-error-site args.e typ.p.arg sample.ht sub.st next.st))
6794− =/ whole-args=span
6795− ?~(t.args.e (span-of i.args.e) [beg:(span-of i.args.e) end:(span-of (rear args.e))])
6796− =/ arg-at=span ?~(bad whole-args at.u.bad)
6797− =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
6798− [%| ["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)]]]]
6799− ?: &((itype-has-face typ.p.arg sub.fit) (itype-face-asym typ.p.arg sample.ht sub.fit) (itype-output-may-be-cell product.ht sub.fit))
6800− [%| ["call result face propagation is not supported by partial inference" ~]]
6801− [%& product.ht st(sub sub.fit, next next.fit)]
6802− =/ result=itype [%var next.st]
6803− =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
6804− ?~ uni
6805− [%| ["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)]]]]
6806− [%& result st(next +(next.st), sub u.uni)]
8747+ ?: (explicit-proj-call e env state)
8748+ [%| ["proj needs an expected record type" ~]]
8749+ (infer-call-with-head e env state (infer-fragment head.e env state))
68078750 * [%| ["expression is not supported by partial inference" ~]]
68088751 ==
68098752::
@@ -6811,12 +8754,322 @@
68118754:: failed. If an intermediate fit is uncertain, retain the whole argument
68128755:: span rather than assigning blame to a particular argument.
68138756::
8757+:: Check a call using the head already inferred in this state. Keeping
8758+:: this shared avoids evaluating or instantiating a contextual head twice.
8759+++ width-has-projections
8760+ |= ps=(list iwprojection)
8761+ ^- ?
8762+ ?~ ps |
8763+ &
8764+::
8765++$ iwidth-elaboration [original=expr typ=itype sub=isub projections=(list iwprojection)]
8766+++ infer-width-elaboration
8767+ |= [e=expr env=ienv state=istate]
8768+ ^- (each iwidth-elaboration idiag)
8769+ =/ out=iresult (infer-fragment e env state)
8770+ ?: ?=(%| -.out) [%| p.out]
8771+ [%& [e typ.p.out sub.state.p.out (flop projections.state.p.out)]]
8772+::
8773+:: Source-bound gate-layout evidence, confined to checked root gate
8774+:: definitions and direct unshadowed prelude calls. The prepared prelude
8775+:: interface and its retained source are trusted as a matching artifact.
8776+:: Layouts identify sample binder faces; they do not change call arity or
8777+:: authorize stripping nested value faces. Unknown origins use ordinary fit.
8778+++ direct-written-gates
8779+ |= [ds=(list def) out=ivisited]
8780+ ^- ivisited
8781+ ?~ ds out
8782+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8783+ ?. |(?=(%gate -.val.i.ds) ?=(%gate-wide -.val.i.ds)) $(ds t.ds)
8784+ $(ds t.ds, out (~(put by out) name.i.ds &))
8785+++ direct-may-use-prelude
8786+ |= [ds=(list def) root=ivisited heads=ivisited]
8787+ ^- ?
8788+ ?~ ds |
8789+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8790+ =/ refs=(list term) (dependency-expr val.i.ds)
8791+ =/ has-root=? (lien refs |=(n=term ?=(^ (~(get by root) n))))
8792+ =/ has-head=? (lien refs |=(n=term ?=(^ (~(get by heads) n))))
8793+ ?: &(has-root has-head) &
8794+ $(ds t.ds)
8795+++ direct-unique-names
8796+ |= [names=(list term) seen=ivisited]
8797+ ^- ?
8798+ ?~ names &
8799+ ?: ?=(^ (~(get by seen) i.names)) |
8800+ $(names t.names, seen (~(put by seen) i.names &))
8801+++ direct-prelude-evidence
8802+ |= [ds=(list def) prelude=(unit ifile)]
8803+ ^- (unit igate-prelude-evidence)
8804+ ?~ prelude ~
8805+ ?~ source.u.prelude ~
8806+ =/ root=ivisited (direct-written-gates ds ~)
8807+ =/ names=(list term) (turn values.u.prelude |=(e=[name=term scheme=ischeme] name.e))
8808+ =/ heads=ivisited (graph-nameset names ~)
8809+ ?. (direct-may-use-prelude ds root heads) ~
8810+ =/ parsed (parse at.u.prelude u.source.u.prelude)
8811+ ?: ?=(%| -.parsed) ~
8812+ ?^ (duplicate-defs defs.p.parsed) ~
8813+ ?. (direct-unique-names (global-value-names defs.p.parsed) ~) ~
8814+ =/ gates=(map term def) (direct-checked-gates defs.p.parsed values.u.prelude)
8815+ `[u.prelude gates]
8816+++ direct-checked-gates
8817+ |= [ds=(list def) env=ienv]
8818+ ^- (map term def)
8819+ =/ names=(list term) (turn env |=(e=[name=term scheme=ischeme] name.e))
8820+ =/ known=ivisited (graph-nameset names ~)
8821+ =/ out=(map term def) ~
8822+ |-
8823+ ?~ ds out
8824+ =/ d=def i.ds
8825+ ?: ?=(%mold -.d) $(ds t.ds)
8826+ ?. ?=(^ (~(get by known) name.d)) $(ds t.ds)
8827+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) $(ds t.ds)
8828+ $(ds t.ds, out (~(put by out) name.d d))
8829+++ direct-find-gate
8830+ |= [n=term ds=(list def)]
8831+ ^- (unit def)
8832+ ?~ ds ~
8833+ ?: &(?=(%value -.i.ds) =(n name.i.ds)) `i.ds
8834+ $(ds t.ds)
8835+++ direct-gate-sample
8836+ |= d=def
8837+ ^- (unit sample)
8838+ ?. ?=(%value -.d) ~
8839+ ?- -.val.d
8840+ %gate `sample.val.d
8841+ %gate-wide `sample.val.d
8842+ * ~
8843+ ==
8844+++ direct-sample-name
8845+ |= sam=sample
8846+ ^- (unit term)
8847+ ?- -.sam
8848+ %bind `name.sam
8849+ %face `name.sam
8850+ %pun `name.sam
8851+ * ~
8852+ ==
8853+++ direct-field-name
8854+ |= f=field
8855+ ^- (unit term)
8856+ ?- -.f
8857+ %face `name.f
8858+ %pun `name.f
8859+ * ~
8860+ ==
8861+++ direct-slot-body
8862+ |= [typ=itype name=(unit term)]
8863+ ^- (unit itype)
8864+ ?~ name `typ
8865+ ?. ?=(%face -.typ) ~
8866+ ?. =(name.typ u.name) ~
8867+ `body.typ
8868+++ direct-invariant
8869+ |= [a=itype b=itype sub=isub next=@ud]
8870+ ^- ifit
8871+ ?: (itype-face-asym a b sub) [%unknown ~]
8872+ =/ forward=ifit (itype-fit a b sub next)
8873+ ?. ?=(%ok -.forward) [%unknown ~]
8874+ ?: (itype-face-asym a b sub.forward) [%unknown ~]
8875+ =/ reverse=ifit (itype-fit b a sub.forward next.forward)
8876+ ?. ?=(%ok -.reverse) [%unknown ~]
8877+ reverse
8878+++ direct-function-fit
8879+ |= [a=itype b=itype sam=sample sh=shape sub=isub next=@ud]
8880+ ^- ifit
8881+ ?. &(?=(%fn -.a) ?=(%fn -.b) ?=(%cell -.sam) ?=(%fn -.sh)) [%unknown ~]
8882+ ?. ?=(%cell -.sample.sh) [%unknown ~]
8883+ =/ as=(list sample) items.sam
8884+ =/ bs=(list field) fields.sample.sh
8885+ ?~ as [%unknown ~]
8886+ ?~ t.as [%unknown ~]
8887+ ?^ t.t.as [%unknown ~]
8888+ ?~ bs [%unknown ~]
8889+ ?~ t.bs [%unknown ~]
8890+ ?^ t.t.bs [%unknown ~]
8891+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) [%unknown ~]
8892+ =/ an=(unit term) (direct-sample-name i.as)
8893+ =/ bn=(unit term) (direct-field-name i.bs)
8894+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8895+ =/ x=(unit itype) (direct-slot-body hed.sample.a an)
8896+ =/ y=(unit itype) (direct-slot-body hed.sample.b bn)
8897+ ?~ x [%unknown ~]
8898+ ?~ y [%unknown ~]
8899+ =/ first=ifit (direct-invariant u.x u.y sub next)
8900+ ?. ?=(%ok -.first) [%unknown ~]
8901+ =. an (direct-sample-name i.t.as)
8902+ =. bn (direct-field-name i.t.bs)
8903+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8904+ =/ x2=(unit itype) (direct-slot-body tal.sample.a an)
8905+ =/ y2=(unit itype) (direct-slot-body tal.sample.b bn)
8906+ ?~ x2 [%unknown ~]
8907+ ?~ y2 [%unknown ~]
8908+ =/ second=ifit (direct-invariant u.x2 u.y2 sub.first next.first)
8909+ ?. ?=(%ok -.second) [%unknown ~]
8910+ (direct-invariant product.a product.b sub.second next.second)
8911+:: This is a tentative proof: its caller must require closed call samples
8912+:: and repeat every positional check under the stable final substitution.
8913+++ direct-positional-fit
8914+ |= [args=(list expr) slots=(list sample) actual=itype expected=itype env=ienv state=istate sub=isub next=@ud]
8915+ ^- ifit
8916+ ?~ args [%unknown ~]
8917+ ?~ slots [%unknown ~]
8918+ =/ last=? ?=(~ t.args)
8919+ ?: !=(last ?=(~ t.slots)) [%unknown ~]
8920+ =/ split=(unit [left=itype right=itype])
8921+ ?: last `[actual expected]
8922+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8923+ `[hed.actual hed.expected]
8924+ ?~ split [%unknown ~]
8925+ =/ x=itype left.u.split
8926+ =/ y=itype right.u.split
8927+ =/ expected-name=(unit term) (direct-sample-name i.slots)
8928+ =/ expected-body=(unit itype) (direct-slot-body y expected-name)
8929+ ?~ expected-body [%unknown ~]
8930+ =. y u.expected-body
8931+ =/ fit=ifit (itype-fit x y sub next)
8932+ =/ accepted=? &(?=(%ok -.fit) !(itype-positional-slot-face-asym x y sub.fit))
8933+ =/ result=(unit ifit)
8934+ ?: accepted `fit
8935+ ?. &(?=(%face -.i.slots) ?=(%fn -.shape.i.slots)) ~
8936+ ?. ?=(%wing -.i.args) ~
8937+ ?. ?=([@ ~] names.i.args) ~
8938+ ?. (unique-value-name i.names.i.args globals.state) ~
8939+ =/ source=(unit def) (~(get by gate-defs.state) i.names.i.args)
8940+ ?~ source ~
8941+ =/ sample=(unit sample) (direct-gate-sample u.source)
8942+ ?~ sample ~
8943+ =/ trial=ifit (direct-function-fit x y u.sample shape.i.slots sub next)
8944+ ?. ?=(%ok -.trial) ~
8945+ `trial
8946+ ?~ result [%unknown ~]
8947+ =. fit u.result
8948+ ?: last fit
8949+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) [%unknown ~]
8950+ ?. ?=(%ok -.fit) [%unknown ~]
8951+ $(args t.args, slots t.slots, actual tal.actual, expected tal.expected, sub sub.fit, next next.fit)
8952+++ direct-any-gate-arg
8953+ |= [args=(list expr) defs=(map term def)]
8954+ ^- ?
8955+ ?~ args |
8956+ =/ found=?
8957+ ?. ?=(%wing -.i.args) |
8958+ ?. ?=([@ ~] names.i.args) |
8959+ ?=(^ (~(get by defs) i.names.i.args))
8960+ ?: found &
8961+ $(args t.args)
8962+++ direct-gate-call-fit
8963+ |= [e=expr actual=itype expected=itype env=ienv state=istate]
8964+ ^- (unit ifit)
8965+ ?. ?=(%call -.e) ~
8966+ ?~ args.e ~
8967+ ?~ t.args.e ~
8968+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8969+ ?. ?=(%wing -.head.e) ~
8970+ ?. ?=([@ ~] names.head.e) ~
8971+ ?. ?=(~ (ienv-lookup i.names.head.e env)) ~
8972+ ?. (unique-value-name i.names.head.e globals.state) ~
8973+ ?. (direct-any-gate-arg args.e gate-defs.state) ~
8974+ ?~ prelude.state ~
8975+ ?~ source.u.prelude.state ~
8976+ ?~ head-evidence.state ~
8977+ ?. =(u.prelude.state iface.u.head-evidence.state) ~
8978+ ?. ?=(^ (ienv-lookup i.names.head.e values.u.prelude.state)) ~
8979+ =/ head=(unit def) (~(get by gates.u.head-evidence.state) i.names.head.e)
8980+ ?~ head ~
8981+ =/ sam=(unit sample) (direct-gate-sample u.head)
8982+ ?~ sam ~
8983+ ?. ?=(%cell -.u.sam) ~
8984+ =/ fit=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.state next.state)
8985+ ?. ?=(%ok -.fit) ~
8986+ :: Enclosing inference may add constraints after this call. Only a
8987+ :: closed call-sample proof can remain stable under those later bindings.
8988+ =/ actual-final=itype (itype-normalize actual sub.fit)
8989+ =/ expected-final=itype (itype-normalize expected sub.fit)
8990+ ?^ (itype-vars actual-final) ~
8991+ ?^ (itype-vars expected-final) ~
8992+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
8993+ :: A later argument may resolve a variable used by an earlier slot.
8994+ :: Recheck every fit and face against the completed substitution; no
8995+ :: additional binding or fresh variable is permitted in the second pass.
8996+ =/ verified=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.fit next.fit)
8997+ ?. ?=(%ok -.verified) ~
8998+ ?. &(=(sub.fit sub.verified) =(next.fit next.verified)) ~
8999+ `fit
9000+::
9001+++ infer-call-with-head
9002+ |= [e=expr env=ienv state=istate head=iresult]
9003+ ^- iresult
9004+ ?> ?=(%call -.e)
9005+ ?~ args.e [%| ["call has no argument" ~]]
9006+ ?: ?=(%| -.head) head
9007+ =/ head-type=itype (itype-walk typ.p.head sub.state.p.head)
9008+ =/ arg=iresult
9009+ ?^ t.args.e
9010+ ?: ?=(%fn -.head-type)
9011+ (infer-call-context-args args.e sample.head-type env state.p.head (span-of head.e))
9012+ (infer-simple-items (turn args.e |=(a=expr [(span-of a) ~ a])) env state.p.head)
9013+ ?: ?=(%fn -.head-type)
9014+ (infer-call-context-arg i.args.e sample.head-type env state.p.head (span-of head.e))
9015+ (infer-fragment i.args.e env state.p.head)
9016+ ?: ?=(%| -.arg) arg
9017+ =/ st=istate state.p.arg
9018+ =/ ht=itype (itype-walk typ.p.head sub.st)
9019+ ?: ?=(%fn -.ht)
9020+ =/ shape=(unit [source=iwfields target=iwfields])
9021+ ?^ t.args.e ~
9022+ (width-shape typ.p.arg sample.ht sub.st)
9023+ ?^ shape [%| ["record width constraint needs unsupported inference" ~]]
9024+ =/ fit=ifit
9025+ ?^ t.args.e (itype-fit-inner typ.p.arg sample.ht sub.st next.st & |)
9026+ (itype-fit typ.p.arg sample.ht sub.st next.st)
9027+ =/ direct=(unit ifit)
9028+ ?: ?=(%ok -.fit) ~
9029+ (direct-gate-call-fit e typ.p.arg sample.ht env st)
9030+ =. fit ?~(direct fit u.direct)
9031+ ?: ?=(%unknown -.fit)
9032+ ?~ defer.st [%| ["call constraint is not supported by partial inference" ~]]
9033+ =/ edge=(unit dgo) (dg-eligible-ctor e typ.p.head typ.p.arg sample.ht st)
9034+ ?~ edge [%| ["call constraint is not supported by partial inference" ~]]
9035+ ?: (gth (lent obligations.st) 63) [%| ["call constraint is not supported by partial inference" ~]]
9036+ [%& product.ht st(obligations [u.edge obligations.st])]
9037+
9038+ ?: ?=(%bad -.fit)
9039+ ?~ t.args.e
9040+ =/ missing=(unit idiag) (missing-union-tag i.args.e sample.ht sub.st (span-of head.e))
9041+ ?^ missing [%| u.missing]
9042+ =/ nested=(unit idiag) (nested-missing-tag i.args.e typ.p.arg sample.ht sub.st next.st (span-of head.e))
9043+ ?^ nested [%| u.nested]
9044+ [%| ["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)]]]]
9045+ =/ bad=(unit [at=span typ=itype])
9046+ (call-error-site args.e typ.p.arg sample.ht sub.st next.st)
9047+ =/ whole-args=span
9048+ [beg:(span-of i.args.e) end:(span-of (rear args.e))]
9049+ =/ arg-at=span ?~(bad whole-args at.u.bad)
9050+ =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
9051+ [%| ["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)]]]]
9052+ ?: &(?=(^ defer.st) !(dg-stable-call-fit typ.p.arg sample.ht product.ht sub.fit ?=(^ t.args.e)))
9053+ [%| ["deferred call fit needs stable inference" ~]]
9054+ =/ face-asym=?
9055+ ?^ direct |
9056+ ?^ t.args.e (itype-positional-face-asym args.e typ.p.arg sample.ht sub.fit)
9057+ (itype-face-asym typ.p.arg sample.ht sub.fit)
9058+ ?: &((itype-has-face typ.p.arg sub.fit) face-asym (itype-output-may-be-cell product.ht sub.fit))
9059+ [%| ["call result face propagation is not supported by partial inference" ~]]
9060+ [%& product.ht st(sub sub.fit, next next.fit)]
9061+ =/ result=itype [%var next.st]
9062+ =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
9063+ ?~ uni
9064+ [%| ["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)]]]]
9065+ [%& result st(next +(next.st), sub u.uni)]
9066+::
68149067++ call-error-site
68159068 |= [args=(list expr) actual=itype expected=itype sub=isub next=@ud]
68169069 ^- (unit [at=span typ=itype])
68179070 ?~ args ~
68189071 =/ original=[left=itype right=itype] [actual expected]
6819− ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%nvar -.left.original) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%nvar -.right.original)) ~
9072+ ?: |(?=(%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))) ~
68209073 =. actual (itype-walk actual sub)
68219074 =. expected (itype-walk expected sub)
68229075 ?: &(?=(%face -.expected) !?=(%face -.actual))
@@ -6831,36 +9084,519 @@
68319084 ?: ?=(%unknown -.first) ~
68329085 $(args t.args, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
68339086::
6834−:: Context can help each argument while the final fit still checks the
6835−:: complete right-nested sample, including any faces on its positions.
9087+:: Context can help a call argument or cast value while the final fit
9088+:: checks the complete right-nested type, including any written faces.
9089+::
9090+:: Context can resolve the payload of a canonical prelude unit, but an
9091+:: unrelated union with a similar noun shape is not the same mold.
9092+++ infer-unit-context
9093+ |= [e=expr expected=itype env=ienv state=istate context=span]
9094+ ^- iresult
9095+ ?> ?=(%unit -.e)
9096+ ?> ?=(%union -.expected)
9097+ ?~ prelude.state (infer-fragment e env state)
9098+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
9099+ ?~ standard (infer-fragment e env state)
9100+ ?. (standard-unit-template u.standard at.u.prelude.state) (infer-fragment e env state)
9101+ ?. =(origin.expected `[at.u.prelude.state %unit]) (infer-fragment e env state)
9102+ ?~ args.expected (infer-fragment e env state)
9103+ ?^ t.args.expected (infer-fragment e env state)
9104+ =/ payload=itype i.args.expected
9105+ =/ canonical=(unit itype) (template-apply u.standard ~[payload])
9106+ ?~ canonical (infer-fragment e env state)
9107+ ?> ?=(%union -.u.canonical)
9108+ ?. =((itype-normalize expected(label ~) sub.state) (itype-normalize u.canonical(label ~) sub.state))
9109+ (infer-fragment e env state)
9110+ =/ value=iresult (infer-call-context-arg val.e payload env state context)
9111+ ?: ?=(%| -.value) value
9112+ =/ fit=ifit (itype-fit typ.p.value payload sub.state.p.value next.state.p.value)
9113+ ?: ?=(%unknown -.fit) [%| ["unit payload constraint is not supported by partial inference" ~]]
9114+ ?: ?=(%bad -.fit)
9115+ =/ missing=(unit idiag) (missing-union-tag val.e payload sub.state.p.value context)
9116+ ?^ missing [%| u.missing]
9117+ =/ nested=(unit idiag) (nested-missing-tag val.e typ.p.value payload sub.state.p.value next.state.p.value context)
9118+ ?^ nested [%| u.nested]
9119+ [%| ["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)]]]]
9120+ [%& expected state.p.value(sub sub.fit, next next.fit)]
9121+::
9122+:: A known gate may receive an enclosing target before its argument is
9123+:: inferred when its result is open or a direct, matching named generic
9124+:: union. Opaque, recursive, tag-constrained and variable-bound union
9125+:: results keep the existing directional path.
9126+++ infer-contextual-call
9127+ |= [e=expr expected=itype env=ienv state=istate]
9128+ ^- iresult
9129+ ?> ?=(%call -.e)
9130+ ?~ args.e [%| ["call has no argument" ~]]
9131+ =/ head=iresult (infer-fragment head.e env state)
9132+ ?: ?=(%| -.head) head
9133+ =/ ht=itype (itype-walk typ.p.head sub.state.p.head)
9134+ ?. ?=(%fn -.ht) (infer-call-with-head e env state head)
9135+ =/ result=itype (itype-walk product.ht sub.state.p.head)
9136+ =/ eligible=?
9137+ ?: ?=(%var -.result) &
9138+ :: A direct known generic union may receive the same nominal result
9139+ :: context before its arguments are checked. Variable-bound origins,
9140+ :: pending tags, recursive identities and unknown atoms stay open.
9141+ ?. &(?=(%union -.product.ht) ?=(%union -.result) ?=(%union -.expected)) |
9142+ ?~ origin.result |
9143+ ?. =(origin.result origin.expected) |
9144+ ?~ args.result |
9145+ ?. =((lent args.result) (lent args.expected)) |
9146+ ?: |((itype-has-tag (itype-normalize result sub.state.p.head)) (itype-has-tag (itype-normalize expected sub.state.p.head))) |
9147+ =/ result-recursive=? (itype-has-recursive (itype-normalize result sub.state.p.head))
9148+ =/ expected-recursive=? (itype-has-recursive (itype-normalize expected sub.state.p.head))
9149+ =/ result-ok=?
9150+ ?. result-recursive &
9151+ ?~ prelude.state |
9152+ &(=(at.u.prelude.state /lib/jibb/prelude/jibb) =(origin.result `[at.u.prelude.state %element]))
9153+ =/ expected-ok=?
9154+ ?. expected-recursive &
9155+ ?~ prelude.state |
9156+ &(=(at.u.prelude.state /lib/jibb/prelude/jibb) =(origin.expected `[at.u.prelude.state %element]))
9157+ ?. &(result-ok expected-ok) |
9158+ ?: |((itype-has-any-atom result sub.state.p.head) (itype-has-any-atom expected sub.state.p.head)) |
9159+ &
9160+ ?. eligible (infer-call-with-head e env state head)
9161+ ?: |(?=(%var -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected)) (itype-has-tag (itype-normalize expected sub.state.p.head)))
9162+ (infer-call-with-head e env state head)
9163+ =/ sub=(unit isub) (itype-unify result expected sub.state.p.head)
9164+ ?~ sub (infer-call-with-head e env state head)
9165+ (infer-call-with-head e env state [%& typ.p.head state.p.head(sub u.sub)])
9166+::
9167+:: An eligible fully faced literal receives context by name, in source order.
9168+++ width-literal-fields
9169+ |= [items=(list item) axis=@ud fuel=@ud]
9170+ ^- (unit iwfields)
9171+ =/ order=(list iwfield) ~
9172+ =/ index=(map term iwfield) *(map term iwfield)
9173+ |-
9174+ ?~ items ~
9175+ ?: =(0 fuel) ~
9176+ ?~ face.i.items ~
9177+ =/ at-axis=@ud ?~(t.items axis (mul 2 axis))
9178+ =/ entry=iwfield [u.face.i.items at-axis [%noun ~]]
9179+ ?: ?=(^ (~(get by index) name.entry)) ~
9180+ =. index (~(put by index) name.entry entry)
9181+ =. order [entry order]
9182+ ?~ t.items `[(flop order) index]
9183+ $(items t.items, axis +((mul 2 axis)), fuel (dec fuel))
9184+++ width-infer-items
9185+ |= [items=(list item) expected=(map term iwfield) env=ienv state=istate context=span]
9186+ ^- iresult
9187+ ?~ items [%| ["empty record is not supported" ~]]
9188+ ?~ face.i.items [%| ["record face needs unsupported inference" ~]]
9189+ =/ field=(unit iwfield) (~(get by expected) u.face.i.items)
9190+ =/ head=iresult
9191+ ?~ field (infer-fragment val.i.items env state)
9192+ (infer-call-context-arg val.i.items typ.u.field env state context)
9193+ ?: ?=(%| -.head) head
9194+ =/ typ=itype [%face u.face.i.items typ.p.head]
9195+ ?~ t.items [%& typ state.p.head]
9196+ =/ tail=iresult $(items t.items, state state.p.head)
9197+ ?: ?=(%| -.tail) tail
9198+ [%& [%cell typ typ.p.tail] state.p.tail]
9199+++ width-infer-literal
9200+ |= [e=expr expected=itype env=ienv state=istate context=span]
9201+ ^- (unit iresult)
9202+ ?. ?=(%tuple -.e) ~
9203+ ?. |(?=(%cell -.expected) ?=(%face -.expected)) ~
9204+ =/ source=(unit iwfields) (width-literal-fields items.e 1 4.096)
9205+ =/ target=(unit iwfields) (width-scan expected sub.state 1 4.096)
9206+ ?~ source ~
9207+ ?~ target ~
9208+ ?: (lth (lent order.u.source) (lent order.u.target)) ~
9209+ ?. (width-in-order order.u.source order.u.target)
9210+ `(infer-simple-items items.e env state)
9211+ `(width-infer-items items.e index.u.target env state context)
9212+::
9213+:: Experimental intrinsic recognition; real bindings retain normal calls.
9214+++ explicit-proj-call
9215+ |= [e=expr env=ienv state=istate]
9216+ ^- ?
9217+ ?. ?=(%call -.e) |
9218+ ?. ?=([* ~] args.e) |
9219+ ?. ?=(%wing -.head.e) |
9220+ ?. =(names.head.e ~[%proj]) |
9221+ ?: ?=(^ (ienv-lookup %proj env)) |
9222+ ?: (lien globals.state |=(n=term =(n %proj))) |
9223+ ?~ prelude.state &
9224+ ?:(?=(^ (ienv-lookup %proj values.u.prelude.state)) | &)
9225+++ infer-proj-source
9226+ |= [e=expr expected=itype env=ienv state=istate context=span]
9227+ ^- iresult
9228+ ?: ?=(%group -.e) $(e inner.e)
9229+ =/ literal=(unit iresult) (width-infer-literal e expected env state context)
9230+ ?^ literal u.literal
9231+ (infer-fragment e env state)
9232+++ infer-proj-context
9233+ |= [e=expr expected=itype env=ienv state=istate context=span]
9234+ ^- iresult
9235+ ?> ?=(%call -.e)
9236+ ?~ args.e [%| ["proj needs one record" ~]]
9237+ ?. |(?=(%cell -.expected) ?=(%face -.expected)) [%| ["proj needs an expected record type" ~]]
9238+ =/ value=iresult (infer-proj-source i.args.e expected env state context)
9239+ ?: ?=(%| -.value) value
9240+ =/ shape=(unit [source=iwfields target=iwfields])
9241+ (width-proj-shape typ.p.value expected sub.state.p.value)
9242+ ?~ shape [%| ["proj needs a known record containing its expected fields" ~]]
9243+ =/ project=(unit iwidth-result) (width-project u.shape sub.state.p.value next.state.p.value)
9244+ ?~ project [%| ["proj constraint needs unsupported inference" ~]]
9245+ =/ st=istate state.p.value(sub sub.u.project, next next.u.project)
9246+ [%& expected st(projections [[at.e e typ.p.value expected steps.u.project] projections.st])]
9247+::
9248+:: A known literal singleton in a direct union can contextualize a
9249+:: loobean literal of the same noun. Only explicit singleton and cell
9250+:: competitors are considered; opaque or variable cases stay unknown.
9251+++ explicit-singleton-in-union
9252+ |= [t=itype noun=@]
9253+ ^- ?
9254+ ?. ?=(%union -.t) |
9255+ =/ cases=(list itype) cases.t
9256+ =/ found=? |
9257+ |-
9258+ ?~ cases found
9259+ =/ c=itype i.cases
9260+ ?: ?=(%cell -.c) $(cases t.cases)
9261+ ?. ?=(%const -.c) |
9262+ ?: =(noun val.literal.c)
9263+ ?: found |
9264+ $(cases t.cases, found &)
9265+ $(cases t.cases)
9266+::
9267+:: Select a written literal-headed case only when every competing case is
9268+:: also an explicit singleton-headed cell and exactly one matches. Opaque,
9269+:: variable-bound and differently shaped cases keep inference unchanged.
9270+:: This first slice supplies context to a directly called payload. Plain
9271+:: literal data and other expressions retain their existing inference path.
9272+++ contextual-atomic-arguments
9273+ |= args=(list expr)
9274+ ^- ?
9275+ ?~ args &
9276+ ?. ?=(?(%lit %wing %ctor) -.i.args) |
9277+ $(args t.args)
9278+++ contextual-direct-payload-call
9279+ |= e=expr
9280+ ^- ?
9281+ ?: ?=(%group -.e) $(e inner.e)
9282+ ?. ?=(%call -.e) |
9283+ ?. ?=(%wing -.head.e) |
9284+ ?~ args.e |
9285+ (contextual-atomic-arguments args.e)
9286+::
9287+:: A walked variable may have concealed a union inside a substituted
9288+:: structure before this arm was called. Decline in that case rather than
9289+:: deriving provenance from the already-walked type.
9290+++ contextual-simple-sub
9291+ |= sub=isub
9292+ ^- ?
9293+ ?~ sub &
9294+ ?: ?=(?(%cell %face %fn %union %collection) -.val.i.sub) |
9295+ $(sub t.sub)
9296+::
9297+:: Check the syntactic root before scanning; scan substitutions once.
9298+++ grec-direct-context
9299+ |= [expected=itype sub=isub]
9300+ ^- ?
9301+ =/ left=@ud 4.096
9302+ |-
9303+ ?: ?=(%face -.expected)
9304+ ?: =(0 left) |
9305+ $(expected body.expected, left (dec left))
9306+ ?. ?=(%grec -.expected) |
9307+ ?~ sub &
9308+ ?: =(0 left) |
9309+ ?: ?=(?(%cell %face %fn %union %collection %grec) -.val.i.sub) |
9310+ $(sub t.sub, left (dec left))
9311+++ contextual-direct-union
9312+ |= target=itype
9313+ ^- ?
9314+ ?: ?=(%face -.target) $(target body.target)
9315+ ?=(%union -.target)
9316+++ contextual-tagged-case
9317+ |= [target=itype tag=@ sub=isub]
9318+ ^- (unit itype)
9319+ ?. ?=(%union -.target) ~
9320+ =/ remaining=(list itype) cases.target
9321+ =/ found=(unit itype) ~
9322+ =/ seen=(set @) *(set @)
9323+ |-
9324+ ?~ remaining found
9325+ =/ c=itype i.remaining
9326+ ?. ?=(%cell -.c) ~
9327+ =/ head=itype hed.c
9328+ ?. ?=(%const -.head) ~
9329+ ?: (~(has in:..zuse seen) val.literal.head) ~
9330+ =. seen (~(put in:..zuse seen) val.literal.head)
9331+ ?: =(tag val.literal.head)
9332+ $(remaining t.remaining, found `c)
9333+ $(remaining t.remaining)
9334+::
9335+:: A bounded syntactic screen: no nested branch, cast, gate or local body
9336+:: can re-enter cell-branch retry during either inference attempt.
9337+++ closed-cell-retry-safe
9338+ |= [todo=(list expr) fuel=@ud]
9339+ ^- ?
9340+ ?~ todo &
9341+ ?: =(0 fuel) |
9342+ =/ e=expr i.todo
9343+ =. fuel (dec fuel)
9344+ ?+ -.e |
9345+ %lit $(todo t.todo)
9346+ %wing $(todo t.todo)
9347+ %ctor $(todo t.todo)
9348+ %path $(todo t.todo)
9349+ %crash $(todo t.todo)
9350+ %str
9351+ ?. (levy pieces.e |=(p=piece ?=(%text -.p))) |
9352+ $(todo t.todo)
9353+ %group $(todo [inner.e t.todo])
9354+ %pair $(todo [val.e t.todo])
9355+ %unit $(todo [val.e t.todo])
9356+ %list $(todo (weld items.e t.todo))
9357+ %tuple $(todo (weld (turn items.e |=(i=item val.i)) t.todo))
9358+ %change $(todo (weld (turn edits.e |=(ed=edit val.ed)) t.todo))
9359+ %call $(todo [head.e (weld args.e t.todo)])
9360+ %trace $(todo [val.e then.e t.todo])
9361+ ==
9362+::
9363+++ closed-cell-sub-safe
9364+ |= [sub=isub fuel=@ud]
9365+ ^- ?
9366+ ?~ sub &
9367+ ?: =(0 fuel) |
9368+ ?: ?=(?(%cell %face %fn %union %collection %grec %jrec %recursive) -.val.i.sub) |
9369+ $(sub t.sub, fuel (dec fuel))
9370+::
9371+++ closed-cell-branch-eligible
9372+ |= [e=expr expected=itype sub=isub]
9373+ ^- ?
9374+ ?. &(?=(%branch -.e) ?=(%cell -.expected) (closed-cell-sub-safe sub 512)) |
9375+ ?~ arms.e |
9376+ ?~ t.arms.e |
9377+ ?^ t.t.arms.e |
9378+ =/ x=arm i.arms.e
9379+ =/ y=arm i.t.arms.e
9380+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) |
9381+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) |
9382+ ?: =(val.lit.pat.x val.lit.pat.y) |
9383+ (closed-cell-retry-safe ~[subject.e val.x val.y] 512)
9384+::
9385+:: Attempt ordinary inference first; retry from the same state only for
9386+:: the bounded non-reentrant syntax above. Preserve original value faces.
9387+++ infer-closed-cell-branch
9388+ |= [e=expr expected=itype env=ienv state=istate context=span]
9389+ ^- iresult
9390+ ?> (closed-cell-branch-eligible e expected sub.state)
9391+ ?> ?=(%branch -.e)
9392+ ?> ?=(^ arms.e)
9393+ ?> ?=(^ t.arms.e)
9394+ =/ ordinary=iresult (infer-fragment e env state)
9395+ =/ ordinary-good=?
9396+ ?: ?=(%| -.ordinary) |
9397+ =/ fit=ifit (itype-fit typ.p.ordinary expected sub.state.p.ordinary next.state.p.ordinary)
9398+ ?=(%ok -.fit)
9399+ ?: ordinary-good ordinary
9400+ =/ attempt=(unit iresult)
9401+ =/ x=arm i.arms.e
9402+ =/ y=arm i.t.arms.e
9403+ =/ subject=iresult (infer-fragment subject.e env state)
9404+ ?: ?=(%| -.subject) ~
9405+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
9406+ ?: ?=(%union -.subject-type) ~
9407+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
9408+ ?~ su ~
9409+ =/ left=iresult (infer-call-context-arg val.x expected env state.p.subject(sub u.su) context)
9410+ ?: ?=(%| -.left) ~
9411+ =/ lf=ifit (itype-fit typ.p.left expected sub.state.p.left next.state.p.left)
9412+ ?. ?=(%ok -.lf) ~
9413+ =/ right=iresult (infer-call-context-arg val.y expected env state.p.left(sub sub.lf, next next.lf) context)
9414+ ?: ?=(%| -.right) ~
9415+ =/ rf=ifit (itype-fit typ.p.right expected sub.state.p.right next.state.p.right)
9416+ ?. ?=(%ok -.rf) ~
9417+ =/ sub=isub sub.rf
9418+ =/ next=@ud next.rf
9419+ =/ lt=itype (itype-normalize typ.p.left sub)
9420+ =/ rt=itype (itype-normalize typ.p.right sub)
9421+ =/ et=itype (itype-normalize expected sub)
9422+ ?. =(lt rt) ~
9423+ ?: |(?=(^ (itype-vars lt)) ?=(^ (itype-vars rt)) ?=(^ (itype-vars et))) ~
9424+ ?: |((itype-has-tag lt) (itype-has-tag rt) (itype-has-tag et)) ~
9425+ =/ lcheck=ifit (itype-fit typ.p.left expected sub next)
9426+ ?. ?=(%ok -.lcheck) ~
9427+ ?. &(=(sub.lcheck sub) =(next.lcheck next)) ~
9428+ =/ rcheck=ifit (itype-fit typ.p.right expected sub next)
9429+ ?. ?=(%ok -.rcheck) ~
9430+ ?. &(=(sub.rcheck sub) =(next.rcheck next)) ~
9431+ `[%& typ.p.left state.p.right(sub sub, next next)]
9432+ ?~ attempt ordinary
9433+ u.attempt
68369434::
68379435++ infer-call-context-arg
68389436 |= [e=expr expected=itype env=ienv state=istate context=span]
68399437 ^- iresult
9438+ ?: &(?=(^ defer.state) ?=(%branch -.e)) (infer-fragment e env state)
9439+ ?: &(?=(^ defer.state) ?=(^ prelude.state) ?=(%tuple -.e))
9440+ (infer-fragment e env state)
9441+ ?: ?=(%pair -.e) $(e (pair-as-cell e))
9442+ ?: ?=(%group -.e) $(e inner.e)
9443+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
9444+ ?: ?=(%trace -.e)
9445+ =/ traced=iresult (infer-fragment val.e env state)
9446+ ?: ?=(%| -.traced) traced
9447+ $(e then.e, state state.p.traced)
68409448 =/ target=itype (itype-walk expected sub.state)
68419449 |-
68429450 ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9451+ ?: (explicit-proj-call e env state)
9452+ (infer-proj-context e expected env state context)
9453+ :: Experimental construction only for a source-proven direct target.
9454+ :: Decline any walked structural binding to retain raw-variable provenance.
9455+ ?: &(?=(%grec -.target) ?=(%tuple -.e) (grec-direct-context expected sub.state))
9456+ =/ unfolded=(unit [view=itype left=@ud]) (grec-unfold-view target jrec-fuel.state)
9457+ ?~ unfolded [%| ["recursive mold unfolding needs unsupported inference" ~]]
9458+ ?~ items.e [%| ["recursive mold constructor needs unsupported inference" ~]]
9459+ =/ first=item i.items.e
9460+ ?. &(?=(~ face.first) ?=(%lit -.val.first) =(%term form.lit.val.first))
9461+ [%| ["recursive mold constructor needs unsupported inference" ~]]
9462+ =/ chosen=(unit itype) (contextual-tagged-case view.u.unfolded val.lit.val.first sub.state)
9463+ ?~ chosen [%| ["recursive mold constructor has no matching case" ~]]
9464+ =/ value=iresult (infer-call-context-items items.e u.chosen env state(jrec-fuel left.u.unfolded) context)
9465+ ?: ?=(%| -.value) value
9466+ =/ fit=ifit (itype-fit typ.p.value u.chosen sub.state.p.value next.state.p.value)
9467+ ?: ?=(%unknown -.fit) [%| ["recursive mold case needs unsupported inference" ~]]
9468+ ?: ?=(%bad -.fit) [%| ["recursive mold case does not fit its source shape" ~]]
9469+ [%& target state.p.value(sub sub.fit, next next.fit)]
9470+ :: Only the source-proven one-layer cell is exposed. Each recursive
9471+ :: descent consumes one written tuple; named values use ordinary fit.
9472+ ?: &(?=(%jrec -.target) ?=(%lit -.e) =(%null form.lit.e))
9473+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
9474+ [%& target state(jrec-fuel (dec jrec-fuel.state))]
9475+ ?: &(?=(%jrec -.target) ?=(%tuple -.e))
9476+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
9477+ =. state state(jrec-fuel (dec jrec-fuel.state))
9478+ =/ shape=itype
9479+ [%cell [%face head.target [%atom aura.target]] [%face tail.target target]]
9480+ =/ value=iresult (infer-call-context-items items.e shape env state context)
9481+ ?: ?=(%| -.value) value
9482+ =/ fit=ifit (itype-fit typ.p.value shape sub.state.p.value next.state.p.value)
9483+ ?: ?=(%unknown -.fit) [%| ["recursive mold cell constraint needs unsupported inference" ~]]
9484+ ?: ?=(%bad -.fit) [%| ["recursive mold cell does not fit its source shape" ~]]
9485+ [%& target state.p.value(sub sub.fit, next next.fit)]
9486+ ?: ?=(%call -.e) (infer-contextual-call e target env state)
9487+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state `[target context])
9488+ ?^ empty-list u.empty-list
9489+ ?: (single-structured-pattern e)
9490+ ?> ?=(%branch -.e)
9491+ =/ empty-union=(unit iresult) (known-empty-union-wing subject.e env state)
9492+ ?^ empty-union (infer-known-union-context-subject e target env u.empty-union context)
9493+ =/ single=(unit iresult) (grec-single-wing-subject subject.e env state)
9494+ ?^ single (infer-known-union-context-subject e target env u.single context)
9495+ (infer-single-case-branch e env state `[target context])
9496+ ?: (cell-binder-pattern e)
9497+ (infer-cell-branch e env state `[target context])
9498+ :: In an explicit singleton context retain the written loobean noun;
9499+ :: the ordinary singleton fit compares its noun, not its spelling.
9500+ =/ singleton=(unit itype)
9501+ ?. ?=(%lit -.e) ~
9502+ ?. =(%loobean form.lit.e) ~
9503+ ?. |(?=(%const -.target) &(?=(%union -.expected) (explicit-singleton-in-union expected val.lit.e))) ~
9504+ `[%const lit.e]
9505+ ?^ singleton [%& u.singleton state]
9506+ =/ known=(unit iresult)
9507+ ?: ?=(%branch -.e) (known-union-subject subject.e env state)
9508+ ~
9509+ ?: &(?=(^ known) ?=(%| -.u.known) !(duplicate-loobean-arms e)) u.known
9510+ ?: &(?=(^ known) ?=(%& -.u.known) ?=(~ (unit-union-payload (itype-normalize typ.p.u.known sub.state.p.u.known))))
9511+ (infer-known-union-context-subject e target env u.known context)
9512+ ?: &(?=(%union -.target) ?=(%unit -.e))
9513+ (infer-unit-context e target env state context)
9514+ ?: (closed-cell-branch-eligible e expected sub.state)
9515+ (infer-closed-cell-branch e expected env state context)
9516+ ?: &(?=(%flag -.target) (context-union-branch e))
9517+ (infer-union-context e target env state context)
68439518 ?: &(?=(%union -.target) (context-union-branch e))
68449519 (infer-union-context e target env state context)
68459520 ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch e))
68469521 (infer-union-context e target env state context)
68479522 ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression e))
68489523 (infer-list-context e target env state context)
9524+ :: A literal-headed tuple can receive the unique case's payload
9525+ :: context. The ordinary final fit still checks the complete union.
9526+ =/ selected=(unit itype)
9527+ ?. &((contextual-simple-sub sub.state) (contextual-direct-union expected) ?=(%union -.target) ?=(%tuple -.e) ?=(^ items.e)) ~
9528+ ?~ t.items.e ~
9529+ ?^ t.t.items.e ~
9530+ ?. (contextual-direct-payload-call val.i.t.items.e) ~
9531+ =/ first=item i.items.e
9532+ ?. &(?=(~ face.first) ?=(%lit -.val.first) |(=(%term form.lit.val.first) =(%null form.lit.val.first) =(%loobean form.lit.val.first))) ~
9533+ (contextual-tagged-case target val.lit.val.first sub.state)
9534+ ?^ selected
9535+ ?> ?=(%tuple -.e)
9536+ :: On this bounded shallow-call shape, preserve any inference that
9537+ :: already fits before trying the new contextual path. Neither pass
9538+ :: can recursively select a nested tuple from the atomic arguments.
9539+ =/ ordinary=(unit iresult)
9540+ =/ initial=iresult (infer-fragment e env state)
9541+ ?: ?=(%| -.initial) ~
9542+ =/ fit=ifit (itype-fit typ.p.initial target sub.state.p.initial next.state.p.initial)
9543+ ?. ?=(%ok -.fit) ~
9544+ `initial
9545+ ?^ ordinary u.ordinary
9546+ =/ value=iresult (infer-call-context-items items.e u.selected env state context)
9547+ ?: ?=(%| -.value) value
9548+ =/ fit=ifit (itype-fit typ.p.value u.selected sub.state.p.value next.state.p.value)
9549+ ?: ?=(%unknown -.fit) [%| ["tagged case needs unsupported inference" ~]]
9550+ ?: ?=(%bad -.fit) [%| ["tagged case does not fit its expected type" ~[[context "expected union case"] [(span-of e) "value"]]]]
9551+ [%& typ.p.value state.p.value(sub sub.fit, next next.fit)]
9552+ ?: &(?=(%cell -.target) ?=(%tuple -.e))
9553+ (infer-call-context-items items.e target env state context)
68499554 (infer-fragment e env state)
68509555::
6851−++ infer-call-context-args
6852− |= [args=(list expr) expected=itype env=ienv state=istate context=span]
9556+:: Preserve each written face; the final complete sample fit checks faces.
9557+:: A tuple or positional field face belongs to the enclosing sample,
9558+:: not to the expression at that position. A second face, if present,
9559+:: is part of the value's own expected type.
9560+++ projection-field-target
9561+ |= expected=itype
9562+ ^- itype
9563+ ?:(?=(%face -.expected) body.expected expected)
9564+::
9565+++ infer-call-context-items
9566+ |= [items=(list item) expected=itype env=ienv state=istate context=span]
68539567 ^- iresult
6854− ?~ args [%| ["call has no argument" ~]]
6855− ?~ t.args (infer-call-context-arg i.args expected env state context)
9568+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
9569+ ?~ t.items
9570+ =/ last=iresult (infer-call-context-arg val.i.items (projection-field-target expected) env state context)
9571+ ?: ?=(%| -.last) last
9572+ =/ typ=itype typ.p.last
9573+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
9574+ [%& typ state.p.last]
68569575 =/ target=itype (itype-walk expected sub.state)
68579576 |-
68589577 ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
6859− ?. ?=(%cell -.target)
6860− (infer-simple-items (turn args |=(a=expr [(span-of a) ~ a])) env state)
6861− =/ head=iresult (infer-call-context-arg i.args hed.target env state context)
9578+ ?. ?=(%cell -.target) (infer-simple-items items env state)
9579+ =/ head=iresult (infer-call-context-arg val.i.items (projection-field-target hed.target) env state context)
68629580 ?: ?=(%| -.head) head
6863− =/ tail=iresult (infer-call-context-args t.args tal.target env state.p.head context)
9581+ =/ typ=itype typ.p.head
9582+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
9583+ =/ tail=iresult (infer-call-context-items t.items tal.target env state.p.head context)
9584+ ?: ?=(%| -.tail) tail
9585+ [%& [%cell typ typ.p.tail] state.p.tail]
9586+::
9587+++ infer-call-context-args
9588+ |= [args=(list expr) expected=itype env=ienv state=istate context=span]
9589+ ^- iresult
9590+ ?~ args [%| ["call has no argument" ~]]
9591+ ?~ t.args (infer-call-context-arg i.args (projection-field-target expected) env state context)
9592+ =/ target=itype (itype-walk expected sub.state)
9593+ |-
9594+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9595+ ?. ?=(%cell -.target)
9596+ (infer-simple-items (turn args |=(a=expr [(span-of a) ~ a])) env state)
9597+ =/ head=iresult (infer-call-context-arg i.args (projection-field-target hed.target) env state context)
9598+ ?: ?=(%| -.head) head
9599+ =/ tail=iresult (infer-call-context-args t.args tal.target env state.p.head context)
68649600 ?: ?=(%| -.tail) tail
68659601 [%& [%cell typ.p.head typ.p.tail] state.p.tail]
68669602::
@@ -6879,11 +9615,55 @@
68799615 ?: ?=(%| -.tail) tail
68809616 [%& [%cell ht typ.p.tail] state.p.tail]
68819617::
6882−:: A single two-binder cell pattern covers every value of a cell type.
6883−:: No other pattern matrix is implemented here.
9618+:: A single all-binder cell pattern covers a known cell spine; the final
9619+:: binder captures the remaining noun. Other pattern matrices stay partial.
9620+::
9621+:: Validate binders before reading the subject, preserving shadow-error
9622+:: precedence. The last binder receives the entire remaining tail.
9623+++ cell-pattern-names
9624+ |= [pats=(list pattern) env=ienv globals=(list term) seen=(list term)]
9625+ ^- (each (list term) @t)
9626+ ?~ pats [%& ~]
9627+ ?. ?=(%bind -.i.pats) [%| 'branch pattern is not supported by partial inference']
9628+ =/ name=term name.i.pats
9629+ ?: |(=(name %proj) ?=(^ (ienv-lookup name env)) (lien globals |=(n=term =(n name))) (lien seen |=(n=term =(n name))))
9630+ [%| 'pattern shadows a name']
9631+ =/ rest=(each (list term) @t) $(pats t.pats, seen [name seen])
9632+ ?: ?=(%| -.rest) rest
9633+ [%& [name p.rest]]
9634+::
9635+++ cell-pattern-types
9636+ |= [names=(list term) env=ienv next=@ud]
9637+ ^- [typ=itype env=ienv next=@ud]
9638+ ?~ names !!
9639+ =/ head=itype [%var next]
9640+ =/ scope=ienv [[i.names [head ~]] env]
9641+ ?~ t.names [head scope +(next)]
9642+ =/ tail=[typ=itype env=ienv next=@ud] $(names t.names, env scope, next +(next))
9643+ [[%cell head typ.tail] env.tail next.tail]
9644+::
9645+:: At every position that must be a cell, opaque or sum types may still
9646+:: contain cells. Do not report a definite mismatch without unfolding them.
9647+++ cell-pattern-spine-unknown
9648+ |= [typ=itype names=(list term) sub=isub]
9649+ ^- ?
9650+ ?~ names |
9651+ ?~ t.names |
9652+ =. typ (itype-walk typ sub)
9653+ ?: ?=(%cell -.typ) $(typ tal.typ, names t.names)
9654+ |(?=(%union -.typ) ?=(%collection -.typ) ?=(%recursive -.typ) ?=(%jrec -.typ) ?=(%grec -.typ) ?=(%noun -.typ) ?=(%fn -.typ) ?=(%tag -.typ))
9655+::
9656+++ cell-binder-pattern
9657+ |= e=expr
9658+ ^- ?
9659+ ?. ?=(%branch -.e) |
9660+ ?~ arms.e |
9661+ ?^ t.arms.e |
9662+ ?. ?=(%cell -.pat.i.arms.e) |
9663+ !(single-structured-pattern e)
68849664::
68859665++ infer-cell-branch
6886− |= [e=expr env=ienv state=istate]
9666+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
68879667 ^- iresult
68889668 ?> ?=(%branch -.e)
68899669 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
@@ -6892,25 +9672,31 @@
68929672 =/ pats=(list pattern) items.pat.arm
68939673 ?~ pats [%| ["branch pattern is not supported by partial inference" ~]]
68949674 ?~ t.pats [%| ["branch pattern is not supported by partial inference" ~]]
6895− ?^ t.t.pats [%| ["branch pattern is not supported by partial inference" ~]]
6896− ?. ?=(%bind -.i.pats) [%| ["branch pattern is not supported by partial inference" ~]]
6897− ?. ?=(%bind -.i.t.pats) [%| ["branch pattern is not supported by partial inference" ~]]
6898− =/ one=term name.i.pats
6899− =/ two=term name.i.t.pats
6900− ?: |(=(one two) ?=(^ (ienv-lookup one env)) ?=(^ (ienv-lookup two env)) (lien globals.state |=(x=term |(=(x one) =(x two)))))
6901− [%| ["pattern shadows a name" ~]]
9675+ =/ names=(each (list term) @t) (cell-pattern-names pats env globals.state ~)
9676+ ?: ?=(%| -.names) [%| [(trip p.names) ~]]
69029677 =/ subject=iresult (infer-fragment subject.e env state)
69039678 ?: ?=(%| -.subject) subject
69049679 =/ st=istate state.p.subject
6905− ?: (itype-has-recursive (itype-normalize typ.p.subject sub.st))
9680+ =/ subject-type=itype (itype-normalize typ.p.subject sub.st)
9681+ ?: (itype-has-recursive subject-type)
69069682 [%| ["recursive pattern is not supported by partial inference" ~]]
69079683 ?: (itype-has-face typ.p.subject sub.st)
69089684 [%| ["record patterns are not supported by partial inference" ~]]
6909− =/ head=itype [%var next.st]
6910− =/ tail=itype [%var +(next.st)]
6911− =/ sub=(unit isub) (itype-unify typ.p.subject [%cell head tail] sub.st)
9685+ ?: (cell-pattern-spine-unknown subject-type p.names sub.st)
9686+ [%| ["cell pattern subject is not supported by partial inference" ~]]
9687+ =/ binders=[typ=itype env=ienv next=@ud] (cell-pattern-types p.names env next.st)
9688+ =/ sub=(unit isub) (itype-unify typ.p.subject typ.binders sub.st)
69129689 ?~ sub [%| ["cell pattern does not match the subject type" ~]]
6913− (infer-fragment val.arm [[one [head ~]] [two [tail ~]] env] st(next (add 2 next.st), sub u.sub))
9690+ =. st st(next next.binders, sub u.sub)
9691+ ?~ expected (infer-fragment val.arm env.binders st)
9692+ =/ body=iresult (infer-call-context-arg val.arm typ.u.expected env.binders st context.u.expected)
9693+ ?: ?=(%| -.body) body
9694+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
9695+ ?: ?=(%unknown -.fit) [%| ["cell branch result constraint is not supported by partial inference" ~]]
9696+ ?: ?=(%bad -.fit) [%| ["cell branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.arm) "branch arm"]]]]
9697+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
9698+ [%| ["cell branch result needs context in partial inference" ~]]
9699+ [%& typ.u.expected state.p.body(sub sub.fit, next next.fit)]
69149700::
69159701++ show-itype
69169702 |= [t=itype sub=isub]
@@ -6920,15 +9706,26 @@
69209706 %var
69219707 ?: (lth id.t 26) [(add 65 id.t) ~]
69229708 "T{<id.t>}"
9709+ %fvar
9710+ ?: (lth id.t 26) [(add 65 id.t) ~]
9711+ "T{<id.t>}"
69239712 %avar
69249713 ?: (lth id.t 26) [(add 65 id.t) ~]
69259714 "T{<id.t>}"
9715+ %rvar
9716+ ?: (lth id.t 26) [(add 65 id.t) ~]
9717+ "T{<id.t>}"
69269718 %nvar
69279719 ?: (lth id.t 26) [(add 65 id.t) ~]
69289720 "T{<id.t>}"
9721+ %rnvar
9722+ ?: (lth id.t 26) [(add 65 id.t) ~]
9723+ "T{<id.t>}"
69299724 %atom "@{(trip aura.t)}"
69309725 %any-atom "@"
69319726 %flag "?"
9727+ %noun "*"
9728+ %empty "!!"
69329729 %tag (trip txt.literal.t)
69339730 %const (trip txt.literal.t)
69349731 %union
@@ -6936,6 +9733,8 @@
69369733 ?~ args.t (trip u.label.t)
69379734 "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
69389735 %recursive ?~(label.t "recursive mold" (trip u.label.t))
9736+ %jrec ?~(label.t "recursive mold" (trip u.label.t))
9737+ %grec ?~(label.t "recursive mold" "({(trip u.label.t)} {(show-itype-cases args.t sub)})")
69399738 %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
69409739 %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
69419740 %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
@@ -6971,15 +9770,22 @@
69719770 ^- ?
69729771 ?- -.typ
69739772 %nvar &
9773+ %rnvar &
69749774 %var |
9775+ %fvar |
69759776 %avar |
9777+ %rvar |
69769778 %atom |
69779779 %any-atom |
69789780 %flag |
9781+ %noun |
9782+ %empty |
69799783 %tag |
69809784 %const |
69819785 %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
69829786 %recursive |
9787+ %jrec |
9788+ %grec (lien args.typ |=(c=itype (itype-has-nvar c)))
69839789 %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
69849790 %face $(typ body.typ)
69859791 %fn |($(typ sample.typ) $(typ product.typ))
@@ -6990,7 +9796,7 @@
69909796 |= [label=tape typ=itype sub=isub]
69919797 ^- tape
69929798 =/ normalized=itype (itype-normalize typ sub)
6993− ?: |(?=(%var -.normalized) ?=(%avar -.normalized) (itype-has-nvar normalized) (itype-has-tag normalized) (itype-has-union normalized)) label
9799+ ?: |(?=(%var -.normalized) ?=(%fvar -.normalized) ?=(%avar -.normalized) ?=(%rvar -.normalized) (itype-has-nvar normalized) (itype-has-tag normalized) (itype-has-union normalized)) label
69949800 ?: (itype-has-hidden-recursive normalized) label
69959801 =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
69969802 ?: (gth (lent vars) 26) label
@@ -7011,7 +9817,9 @@
70119817 =/ ident=(unit @ud)
70129818 ?+ -.resolved ~
70139819 %var `id.resolved
9820+ %fvar `id.resolved
70149821 %avar `id.resolved
9822+ %rvar `id.resolved
70159823 ==
70169824 ?~ ident $(caps t.caps)
70179825 ?: =(n u.ident) &
@@ -7025,7 +9833,9 @@
70259833 =/ ident=(unit @ud)
70269834 ?+ -.resolved ~
70279835 %var `id.resolved
9836+ %fvar `id.resolved
70289837 %avar `id.resolved
9838+ %rvar `id.resolved
70299839 ==
70309840 ?~ ident $(caps t.caps)
70319841 ?: =(n u.ident) `i.caps
@@ -7039,7 +9849,9 @@
70399849 =/ ident=(unit @ud)
70409850 ?+ -.resolved ~
70419851 %var `id.resolved
9852+ %fvar `id.resolved
70429853 %avar `id.resolved
9854+ %rvar `id.resolved
70439855 ==
70449856 ?~ ident $(caps t.caps)
70459857 =/ found=(unit icap) (cap-with-id u.ident t.caps sub)
@@ -7054,7 +9866,9 @@
70549866 =/ ident=(unit @ud)
70559867 ?+ -.resolved ~
70569868 %var `id.resolved
9869+ %fvar `id.resolved
70579870 %avar `id.resolved
9871+ %rvar `id.resolved
70589872 ==
70599873 ?~ ident &
70609874 ?: (cap-id-in u.ident t.caps sub) &
@@ -7069,8 +9883,8 @@
70699883 ^- ?
70709884 ?~ caps |
70719885 =/ resolved=itype (itype-walk [%var id.i.caps] sub)
7072− ?: ?=(%avar -.resolved)
7073− ?: =(n id.resolved) &
9886+ ?: |(?=(%avar -.resolved) ?=(%rvar -.resolved))
9887+ ?: =(n +.resolved) &
70749888 $(caps t.caps)
70759889 $(caps t.caps)
70769890::
@@ -7079,15 +9893,22 @@
70799893 ^- ?
70809894 ?- -.t
70819895 %var |
9896+ %fvar |
70829897 %avar =(n id.t)
9898+ %rvar =(n id.t)
70839899 %nvar |
9900+ %rnvar |
70849901 %atom |
70859902 %any-atom |
70869903 %flag |
9904+ %noun |
9905+ %empty |
70879906 %tag |
70889907 %const |
70899908 %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
70909909 %recursive |
9910+ %jrec |
9911+ %grec (lien args.t |=(c=itype (has-atom-var n c)))
70919912 %collection (lien args.t |=(c=itype (has-atom-var n c)))
70929913 %face $(t body.t)
70939914 %fn |($(t sample.t) $(t product.t))
@@ -7127,17 +9948,25 @@
71279948 =/ out=tape ""
71289949 |-
71299950 ?~ vars out
9951+ ?: (itype-var-is-restricted i.vars t)
9952+ =/ sep=tape ?:(printed ", " " where ")
9953+ =/ clause=tape "{sep}{(show-itype [%rvar i.vars] ~)} is an atom other than ?"
9954+ $(vars t.vars, printed &, out (weld out clause))
71309955 ?: (itype-var-is-atom i.vars t)
71319956 =/ sep=tape ?:(printed ", " " where ")
71329957 =/ clause=tape "{sep}{(show-itype [%avar i.vars] ~)} is an atom"
71339958 $(vars t.vars, printed &, out (weld out clause))
9959+ ?: (itype-var-is-gate-free i.vars t)
9960+ =/ sep=tape ?:(printed ", " " where ")
9961+ =/ clause=tape "{sep}{(show-itype [%fvar i.vars] ~)} contains no gates"
9962+ $(vars t.vars, printed &, out (weld out clause))
71349963 $(vars t.vars)
71359964::
71369965:: Build the supported part of the value environment in dependency order.
71379966:: Each pass adds successful definitions. Forward references become
7138−:: available on a later pass; mutually recursive groups and unsupported
7139−:: syntax do not enter the environment. Generalized definitions are closed, so a
7140−:: use instantiates its variables afresh.
9967+:: available on a later pass; unsupported syntax does not enter the
9968+:: environment. Generalized definitions are closed, so a use instantiates
9969+:: its variables afresh.
71419970::
71429971++ global-value-names
71439972 |= ds=(list def)
@@ -7227,6 +10056,8 @@
722710056++ infer-recursive-gate
722810057 |= [d=def env=ienv state=istate]
722910058 ^- iresult
10059+ ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
10060+ =. gate-defs.state ~
723010061 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
723110062 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
723210063 [%| ["recursive definition is not a gate" ~]]
@@ -7241,8 +10072,8 @@
724110072 ?: ?=(%| -.sam)
724210073 =/ diag=(unit idiag)
724310074 ?- -.gate
7244− %gate (direct-sample-invalid sample.gate state)
7245− %gate-wide (direct-sample-invalid sample.gate state)
10075+ %gate (sample-import-invalid sample.gate env state)
10076+ %gate-wide (sample-import-invalid sample.gate env state)
724610077 * ~
724710078 ==
724810079 ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
@@ -7264,36 +10095,565 @@
726410095 ?~ uni [%| ["recursive gate constraint is not supported by partial inference" ~]]
726510096 [%& [%fn typ.p.sam typ.p.out] state.p.out(sub u.uni)]
726610097::
7267−++ add-supported-defs
7268− |= [ds=(list def) 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)]
10098+++ dependency-root
10099+ |= names=(list term)
10100+ ^- (list term)
10101+ ?~ names ~
10102+ ~[(rear names)]
10103+::
10104+++ dependency-exprs
10105+ |= xs=(list expr)
10106+ ^- (list term)
10107+ ?~ xs ~
10108+ =/ first=(list term) (dependency-expr i.xs)
10109+ (weld first $(xs t.xs))
10110+::
10111+++ dependency-pieces
10112+ |= xs=(list piece)
10113+ ^- (list term)
10114+ ?~ xs ~
10115+ =/ first=(list term)
10116+ ?- -.i.xs
10117+ %expr (dependency-expr p.i.xs)
10118+ %text ~
10119+ ==
10120+ (weld first $(xs t.xs))
10121+::
10122+++ dependency-qsegs
10123+ |= xs=(list qseg)
10124+ ^- (list term)
10125+ ?~ xs ~
10126+ =/ first=(list term)
10127+ ?- -.i.xs
10128+ %expr (dependency-expr p.i.xs)
10129+ %knot ~
10130+ ==
10131+ (weld first $(xs t.xs))
10132+::
10133+++ dependency-items
10134+ |= xs=(list item)
10135+ ^- (list term)
10136+ ?~ xs ~
10137+ =/ first=(list term) (dependency-expr val.i.xs)
10138+ (weld first $(xs t.xs))
10139+::
10140+++ dependency-edits
10141+ |= xs=(list edit)
10142+ ^- (list term)
10143+ ?~ xs ~
10144+ =/ first=(list term) (dependency-expr val.i.xs)
10145+ (weld first $(xs t.xs))
10146+::
10147+++ dependency-arms
10148+ |= xs=(list arm)
10149+ ^- (list term)
10150+ ?~ xs ~
10151+ =/ first=(list term) (dependency-expr val.i.xs)
10152+ (weld first $(xs t.xs))
10153+::
10154+++ dependency-defs
10155+ |= xs=(list def)
10156+ ^- (list term)
10157+ ?~ xs ~
10158+ =/ first=(list term)
10159+ ?: ?=(%value -.i.xs) (dependency-expr val.i.xs)
10160+ ~
10161+ (weld first $(xs t.xs))
10162+::
10163+++ dependency-expr
10164+ |= e=expr
10165+ ^- (list term)
10166+ ?- -.e
10167+ %str (dependency-pieces pieces.e)
10168+ %qath (dependency-qsegs segs.e)
10169+ %wing (dependency-root names.e)
10170+ %change
10171+ =/ first=(list term) (dependency-root target.e)
10172+ =/ last=(list term) (dependency-edits edits.e)
10173+ (weld first last)
10174+ %pair (dependency-expr val.e)
10175+ %unit (dependency-expr val.e)
10176+ %group (dependency-expr inner.e)
10177+ %list (dependency-exprs items.e)
10178+ %tuple (dependency-items items.e)
10179+ %gate (dependency-expr body.e)
10180+ %gate-wide (dependency-expr body.e)
10181+ %call
10182+ =/ first=(list term) (dependency-expr head.e)
10183+ =/ last=(list term) (dependency-exprs args.e)
10184+ (weld first last)
10185+ %cast (dependency-expr val.e)
10186+ %trace
10187+ =/ first=(list term) (dependency-expr val.e)
10188+ =/ last=(list term) (dependency-expr then.e)
10189+ (weld first last)
10190+ %branch
10191+ =/ first=(list term) (dependency-expr subject.e)
10192+ =/ last=(list term) (dependency-arms arms.e)
10193+ (weld first last)
10194+ %body
10195+ =/ first=(list term) (dependency-defs defs.e)
10196+ =/ last=(list term) (dependency-expr final.e)
10197+ (weld first last)
10198+ * ~
10199+ ==
10200+::
10201+:: Infer a cyclic component with one monomorphic seed per gate. All members
10202+:: must succeed before any scheme is available; pending constraints and
10203+:: unresolved branch joins remain partial.
10204++$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps]
10205++$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
10206+++ seed-gate-group
10207+ |= [ds=(list def) env=ienv state=istate]
10208+ ^- igate-seeds
10209+ ?~ ds [%& [~ state]]
10210+ =/ d=def i.ds
10211+ ?. ?=(%value -.d) [%| ["recursive group contains a non-gate" ~]]
10212+ =/ gate=expr val.d
10213+ ?. |(?=(%gate -.gate) ?=(%gate-wide -.gate))
10214+ [%| ["recursive group contains a non-gate" ~]]
10215+ =/ initial=istate (reserve-def-caps gate state)
10216+ =/ sam=isample-result
10217+ ?- -.gate
10218+ %gate (infer-sample sample.gate env initial)
10219+ %gate-wide (infer-sample sample.gate env initial)
10220+ * !!
10221+ ==
10222+ ?: ?=(%| -.sam) [%| [p.sam ~]]
10223+ =/ body=expr
10224+ ?- -.gate
10225+ %gate body.gate
10226+ %gate-wide body.gate
10227+ * !!
10228+ ==
10229+ =/ seed=itype [%fn typ.p.sam [%var next.state.p.sam]]
10230+ =/ entry=igate-entry [name.d seed body env.p.sam caps.state.p.sam]
10231+ =/ after=istate state.p.sam(next +(next.state.p.sam), caps caps.state)
10232+ =/ rest=igate-seeds $(ds t.ds, state after)
10233+ ?: ?=(%| -.rest) rest
10234+ [%& [[entry entries.p.rest] state.p.rest]]
10235+::
10236+++ group-seed-env
10237+ |= [entries=(list igate-entry) env=ienv]
726910238 ^- ienv
7270− ?~ ds env
10239+ ?~ entries env
10240+ [[name.i.entries [typ.i.entries ~]] $(entries t.entries)]
10241+::
10242+++ infer-gate-group-bodies
10243+ |= [entries=(list igate-entry) seeds=ienv state=istate]
10244+ ^- igate-seeds
10245+ ?~ entries [%& [~ state]]
10246+ =/ entry=igate-entry i.entries
10247+ ?> ?=(%fn -.typ.entry)
10248+ =/ scope=ienv (weld seeds env.entry)
10249+ =/ out=iresult (infer-fragment body.entry scope state(caps caps.entry))
10250+ ?: ?=(%| -.out) out
10251+ =/ uni=(unit isub) (itype-unify product.typ.entry typ.p.out sub.state.p.out)
10252+ ?~ uni [%| ["recursive group constraint is not supported by partial inference" ~]]
10253+ =. caps.entry caps.state.p.out
10254+ =/ after=istate state.p.out(sub u.uni, caps caps.state)
10255+ =/ rest=igate-seeds $(entries t.entries, state after)
10256+ ?: ?=(%| -.rest) rest
10257+ [%& [[entry entries.p.rest] state.p.rest]]
10258+::
10259+++ group-schemes
10260+ |= [entries=(list igate-entry) env=ienv outer=istate state=istate]
10261+ ^- (each ienv idiag)
10262+ ?~ entries [%& ~]
10263+ =/ entry=igate-entry i.entries
10264+ =/ merged=(unit [first=icap second=icap]) (merged-capitals caps.entry sub.state)
10265+ ?^ merged
10266+ [%| ["distinct type variables must not be forced equal" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]]
10267+ ?: (constrained-capitals caps.entry sub.state)
10268+ [%| ["explicit capital constraints are not supported by partial inference" ~]]
10269+ =/ typ=itype (itype-normalize typ.entry sub.state)
10270+ ?: (itype-has-nvar typ) [%| ["recursive group needs unsupported inference" ~]]
10271+ ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
10272+ [%| ["recursive group needs unsupported inference" ~]]
10273+ =/ free=(list @ud) (weld (free-env-vars env sub.state) (free-cap-vars caps.outer sub.state))
10274+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
10275+ =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
10276+ ?: (gth (lent vars) 26) [%| ["recursive group needs too many type variables" ~]]
10277+ =/ rest=(each ienv idiag) $(entries t.entries)
10278+ ?: ?=(%| -.rest) rest
10279+ [%& [[name.entry [typ vars]] p.rest]]
10280+::
10281+++ infer-gate-group
10282+ |= [ds=(list def) env=ienv state=istate]
10283+ ^- ilocal-result
10284+ ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
10285+ =/ names=(list term) (global-value-names ds)
10286+ ?. (levy names |=(n=term (unique-value-name n names)))
10287+ [%| ["recursive group contains duplicate names" ~]]
10288+ ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
10289+ [%| ["recursive group shadows a name" ~]]
10290+ =/ scoped=istate state(globals (weld names globals.state), gate-defs ~)
10291+ =/ seeded=igate-seeds (seed-gate-group ds env scoped)
10292+ ?: ?=(%| -.seeded) seeded
10293+ =/ seeds=ienv (group-seed-env entries.p.seeded ~)
10294+ =/ body=igate-seeds (infer-gate-group-bodies entries.p.seeded seeds state.p.seeded)
10295+ ?: ?=(%| -.body) body
10296+ :: Per-member ownership through mutual recursion is not implemented.
10297+ ?: !=(projections.state.p.body projections.state)
10298+ [%| ["record projection in recursive groups needs unsupported inference" ~]]
10299+ ?: !=(holes.state.p.body holes.state)
10300+ [%| ["holes in recursive groups need unsupported inference" ~]]
10301+ ?: (pending-tags tags.state.p.body sub.state.p.body)
10302+ [%| ["recursive group has unresolved literal constraints" ~]]
10303+ =/ schemes=(each ienv idiag) (group-schemes entries.p.body env state state.p.body)
10304+ ?: ?=(%| -.schemes) schemes
10305+ [%& [(weld p.schemes env) state.p.body(globals globals.state)]]
10306+::
10307+++ width-finalize
10308+ |= [ps=(list iwprojection) sub=isub visible=(list @ud)]
10309+ ^- (unit (list iwprojection))
10310+ ?~ ps `~
10311+ ?: (lien t.ps |=(p=iwprojection =(at.p at.i.ps))) ~
10312+ =/ src=itype (default-decimals (itype-normalize source.i.ps sub))
10313+ =/ dst=itype (default-decimals (itype-normalize target.i.ps sub))
10314+ ?: |((itype-has-nvar src) (itype-has-nvar dst) (itype-has-tag src) (itype-has-tag dst)) ~
10315+ =/ vars=(list @ud) (weld (itype-vars src) (itype-vars dst))
10316+ ?. (levy vars |=(n=@ud (lien visible |=(v=@ud =(n v))))) ~
10317+ =/ rest=(unit (list iwprojection)) $(ps t.ps)
10318+ ?~ rest ~
10319+ =/ entry=iwprojection i.ps
10320+ =. entry entry(source src, target dst)
10321+ `[entry u.rest]
10322+::
10323+++ add-supported-defs
10324+ |= [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)]
10325+ ^- [env=ienv artifacts=(list iwidth-definition)]
10326+ (add-supported-defs-core ds all-defs checked heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts ~)
10327+::
10328+
10329++$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
10330++$ iadj (map term (list term))
10331++$ ivisited (map term ?)
10332++$ iwork (list [name=term done=?])
10333++$ iwresult [seen=ivisited order=(list term)]
10334++$ icresult [seen=ivisited component=(list term)]
10335++$ icomponents (list (list term))
10336+++ graph-nameset
10337+ |= [names=(list term) seen=ivisited]
10338+ ^- ivisited
10339+ ?~ names seen
10340+ $(names t.names, seen (~(put by seen) i.names &))
10341+::
10342+++ graph-edges
10343+ |= [name=term graph=iadj]
10344+ ^- (list term)
10345+ =/ found=(unit (list term)) (~(get by graph) name)
10346+ ?~ found ~
10347+ u.found
10348+::
10349+++ graph-make-forward
10350+ |= [ds=(list def) names=ivisited graph=iadj]
10351+ ^- iadj
10352+ ?~ ds graph
10353+ ?. ?=(%value -.i.ds) $(ds t.ds)
10354+ =/ deps=(list term) (dependency-expr val.i.ds)
10355+ =. deps (skim deps |=(n=term ?=(^ (~(get by names) n))))
10356+ $(ds t.ds, graph (~(put by graph) name.i.ds deps))
10357+::
10358+++ graph-add-reverse
10359+ |= [name=term edges=(list term) reverse=iadj]
10360+ ^- iadj
10361+ ?~ edges reverse
10362+ =/ prior=(list term) (graph-edges i.edges reverse)
10363+ $(edges t.edges, reverse (~(put by reverse) i.edges [name prior]))
10364+::
10365+++ graph-reverse
10366+ |= [names=(list term) graph=iadj reverse=iadj]
10367+ ^- iadj
10368+ ?~ names reverse
10369+ =. reverse (graph-add-reverse i.names (graph-edges i.names graph) reverse)
10370+ $(names t.names)
10371+::
10372+++ graph-order
10373+ |= [todo=iwork seen=ivisited order=(list term) graph=iadj]
10374+ ^- iwresult
10375+ ?~ todo [seen order]
10376+ =/ event=[name=term done=?] i.todo
10377+ ?: done.event $(todo t.todo, order [name.event order])
10378+ ?: ?=(^ (~(get by seen) name.event)) $(todo t.todo)
10379+ =. seen (~(put by seen) name.event &)
10380+ =/ children=iwork (turn (graph-edges name.event graph) |=(n=term [n |]))
10381+ $(todo (weld children [[name.event &] t.todo]))
10382+::
10383+++ graph-collect
10384+ |= [todo=(list term) seen=ivisited component=(list term) graph=iadj]
10385+ ^- icresult
10386+ ?~ todo [seen component]
10387+ ?: ?=(^ (~(get by seen) i.todo)) $(todo t.todo)
10388+ =. seen (~(put by seen) i.todo &)
10389+ $(todo (weld (graph-edges i.todo graph) t.todo), component [i.todo component])
10390+::
10391+++ graph-collect-all
10392+ |= [order=(list term) seen=ivisited graph=iadj comps=icomponents]
10393+ ^- icomponents
10394+ ?~ order comps
10395+ ?: ?=(^ (~(get by seen) i.order)) $(order t.order)
10396+ =/ found=icresult (graph-collect ~[i.order] seen ~ graph)
10397+ $(order t.order, seen seen.found, comps [component.found comps])
10398+::
10399+:: Two depth-first passes find components before group inference. Maps
10400+:: preserve the graph identity; duplicate global names fail closed.
10401+++ graph-components
10402+ |= [ds=(list def) names=(list term)]
10403+ ^- icomponents
10404+ =/ nameset=ivisited ~
10405+ =/ pending=(list term) names
10406+ |-
10407+ ?^ pending
10408+ ?: ?=(^ (~(get by nameset) i.pending)) ~
10409+ $(pending t.pending, nameset (~(put by nameset) i.pending &))
10410+ =/ graph=iadj (graph-make-forward ds nameset ~)
10411+ =/ reverse=iadj (graph-reverse names graph ~)
10412+ =/ order=iwresult (graph-order (turn names |=(n=term [n |])) ~ ~ graph)
10413+ (graph-collect-all order.order ~ reverse ~)
10414+::
10415+++ graph-cycle
10416+ |= [component=(list term) graph=iadj]
10417+ ^- ?
10418+ ?~ component |
10419+ ?^ t.component &
10420+ (lien (graph-edges i.component graph) |=(x=term =(x i.component)))
10421+::
10422+++ add-groups
10423+ |= [ds=(list def) components=icomponents graph=iadj env=ienv grouped=(list term) artifacts=(list iwidth-definition) state=istate]
10424+ ^- iresolved
10425+ ?~ components [env grouped artifacts]
10426+ =/ component=(list term) i.components
10427+ ?. (graph-cycle component graph) $(components t.components)
10428+ ?: (lien component |=(n=term ?=(^ (ienv-lookup n env)))) $(components t.components)
10429+ =/ members=(list def)
10430+ %+ skim ds
10431+ |= d=def
10432+ &(?=(%value -.d) (lien component |=(n=term =(n name.d))))
10433+ ?. =((lent members) (lent component)) $(components t.components)
10434+ ?. (levy component |=(n=term (unique-value-name n globals.state))) $(components t.components)
10435+ =/ result=ilocal-result (infer-gate-group members env state)
10436+ ?: ?=(%| -.result) $(components t.components)
10437+ $(components t.components, env env.p.result, grouped (weld component grouped))
10438+::
10439+++ resolve-groups
10440+ |= [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)]
10441+ ^- iresolved
10442+ (resolve-groups-core ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude ~)
10443+::
10444+
10445++$ iadded-definition
10446+ [env=ienv checked=(map term def) artifacts=(list iwidth-definition)]
10447+++ add-supported-result
10448+ |= [d=def result=iresult initial=istate env=ienv checked=(map term def) artifacts=(list iwidth-definition)]
10449+ ^- (unit iadded-definition)
10450+ ?> ?=(%value -.d)
10451+ ?: ?=(%| -.result) ~
10452+ =. state.p.result (promote-restricted-numbers state.p.result env)
10453+ =. 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)))
10454+ ?^ (unresolved-hole holes.state.p.result holes.initial state.p.result) ~
10455+ ?: (constrained-capitals caps.state.p.result sub.state.p.result) ~
10456+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
10457+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) ~
10458+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) ~
10459+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
10460+ ?: (gth (lent vars) 26) ~
10461+ =/ finalized=(unit (list iwprojection))
10462+ (width-finalize projections.state.p.result sub.state.p.result vars)
10463+ ?~ finalized ~
10464+ =? artifacts ?=(^ u.finalized)
10465+ [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
10466+ =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
10467+ `[[[name.d [typ vars]] env] checked artifacts]
10468+++ add-supported-defs-core
10469+ |= [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)])]
10470+ ^- [env=ienv artifacts=(list iwidth-definition)]
10471+ ?~ ds [env artifacts]
727110472 =/ d=def i.ds
727210473 ?: ?=(%mold -.d) $(ds t.ds)
10474+ ?: (lien (program-recovery-names all-defs) |=(n=term =(n name.d))) $(ds t.ds)
727310475 ?. (unique-value-name name.d globals) $(ds t.ds)
727410476 ?^ (ienv-lookup name.d env) $(ds t.ds)
727510477 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7276− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude]
10478+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10479+ =. grec-index.initial index
10480+ =. gate-defs.initial checked
10481+ =. head-evidence.initial heads
727710482 =. initial (reserve-def-caps val.d initial)
727810483 =/ result=iresult (infer-fragment val.d env initial)
727910484 =? result ?=(%| -.result) (infer-recursive-gate d env initial)
7280− ?: ?=(%| -.result) $(ds t.ds)
7281− ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
7282− =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
7283− ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) $(ds t.ds)
7284− ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
7285− =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
7286− ?: (gth (lent vars) 26) $(ds t.ds)
7287− $(ds t.ds, env [[name.d [typ vars]] env])
10485+ =/ added=(unit iadded-definition)
10486+ (add-supported-result d result initial env checked artifacts)
10487+ ?~ added $(ds t.ds)
10488+ $(ds t.ds, env env.u.added, checked checked.u.added, artifacts artifacts.u.added)
10489+::
10490+:: Full checking discards unsupported definitions. On that failure path only,
10491+:: retry a bounded number of missing definitions to explain a pending tag
10492+:: from the same ordinary inference state instead of hiding it behind the
10493+:: generic completeness error. No successful definition takes this path.
10494+++ module-pending-tag
10495+ |= [ds=(list def) env=ienv base=istate fuel=@ud]
10496+ ^- (unit [at=span msg=tape])
10497+ =/ checked=(map term def) (direct-checked-gates ds env)
10498+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.base)
10499+ |-
10500+ ?~ ds ~
10501+ ?: =(0 fuel) ~
10502+ =/ d=def i.ds
10503+ ?: ?=(%mold -.d) $(ds t.ds, fuel (dec fuel))
10504+ ?^ (ienv-lookup name.d env) $(ds t.ds, fuel (dec fuel))
10505+ =/ initial=istate base(gate-defs checked, head-evidence heads)
10506+ =. initial (reserve-def-caps val.d initial)
10507+ =/ result=iresult (infer-fragment val.d env initial)
10508+ =? result ?=(%| -.result) (infer-recursive-gate d env initial)
10509+ ?: ?=(%| -.result) $(ds t.ds, fuel (dec fuel))
10510+ =/ pending=(unit [at=span msg=tape])
10511+ (pending-tag-diagnostic tags.state.p.result sub.state.p.result)
10512+ ?^ pending pending
10513+ $(ds t.ds, fuel (dec fuel))
10514+::
10515+++ resolve-groups-core
10516+ |= [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)])]
10517+ ^- iresolved
10518+ =/ env=ienv ~
10519+ =/ grouped=(list term) ~
10520+ =/ artifacts=(list iwidth-definition) ~
10521+ =/ names=(list term) (global-value-names ds)
10522+ =/ nameset=ivisited (graph-nameset names ~)
10523+ =/ graph=iadj (graph-make-forward ds nameset ~)
10524+ =/ components=icomponents (graph-components ds names)
10525+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10526+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
10527+ |-
10528+ =/ next=[env=ienv artifacts=(list iwidth-definition)]
10529+ (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)
10530+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10531+ =. grec-index.initial index
10532+ =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
10533+ ?: =(env env.out) out
10534+ $(env env.out, grouped grouped.out, artifacts artifacts.out)
728810535::
728910536++ resolve-supported-defs
729010537 |= [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)]
729110538 ^- ienv
7292− =/ env=ienv ~
10539+ env:(resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
10540+::
10541+:: A diagnostic-only proof for a narrow syntactic value cycle. Every
10542+:: edge is an unqualified wing in a supported expression, and samples
10543+:: may not shadow global bindings. Unknown forms yield no conclusion.
10544++$ icyclesite [name=term at=span]
10545++$ icycle [name=term first=span next=span]
10546+++ cycle-sites-list
10547+ |= [xs=(list expr) globals=(list term) locals=(list term)]
10548+ ^- (unit (list icyclesite))
10549+ ?~ xs `~
10550+ =/ first=(unit (list icyclesite)) (cycle-sites i.xs globals locals)
10551+ ?~ first ~
10552+ =/ tail=(unit (list icyclesite)) $(xs t.xs)
10553+ ?~ tail ~
10554+ `(weld u.first u.tail)
10555+::
10556+++ cycle-sample-name
10557+ |= [sam=sample globals=(list term) locals=(list term)]
10558+ ^- (unit (unit term))
10559+ ?- -.sam
10560+ %bind
10561+ ?: (lien (weld globals locals) |=(n=term =(n name.sam))) ~
10562+ ``name.sam
10563+ %face
10564+ ?: (lien (weld globals locals) |=(n=term =(n name.sam))) ~
10565+ ``name.sam
10566+ %bare `~
10567+ * ~
10568+ ==
10569+::
10570+++ cycle-sites
10571+ |= [e=expr globals=(list term) locals=(list term)]
10572+ ^- (unit (list icyclesite))
10573+ ?- -.e
10574+ %wing
10575+ ?. ?=([@ ~] names.e) ~
10576+ `~[[i.names.e at.e]]
10577+ %lit `~
10578+ %str
10579+ ?: (lien pieces.e |=(p=piece ?=(%expr -.p))) ~
10580+ `~
10581+ %group $(e inner.e)
10582+ %body ?~(defs.e $(e final.e) ~)
10583+ %cast $(e val.e)
10584+ %gate
10585+ =/ binder=(unit (unit term)) (cycle-sample-name sample.e globals locals)
10586+ ?~ binder ~
10587+ =/ nested=(list term) ?~(u.binder locals [u.u.binder locals])
10588+ $(e body.e, locals nested)
10589+ %gate-wide
10590+ =/ binder=(unit (unit term)) (cycle-sample-name sample.e globals locals)
10591+ ?~ binder ~
10592+ =/ nested=(list term) ?~(u.binder locals [u.u.binder locals])
10593+ $(e body.e, locals nested)
10594+ %call
10595+ =/ first=(unit (list icyclesite)) $(e head.e)
10596+ ?~ first ~
10597+ =/ tail=(unit (list icyclesite)) (cycle-sites-list args.e globals locals)
10598+ ?~ tail ~
10599+ `(weld u.first u.tail)
10600+ * ~
10601+ ==
10602+::
10603+++ cycle-definitely-atom
10604+ |= e=expr
10605+ ^- ?
10606+ ?: ?=(%group -.e) $(e inner.e)
10607+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
10608+ ?. ?=(%cast -.e) |
10609+ |(?=(%aura -.shape.e) ?=(%flag -.shape.e))
10610+::
10611+++ cycle-proof-group
10612+ |= [members=(list def) globals=(list term)]
10613+ ^- ?
10614+ ?~ members &
10615+ ?. ?=(%value -.i.members) |
10616+ ?. (unique-value-name name.i.members globals) |
10617+ ?. ?=(^ (cycle-sites val.i.members globals ~)) |
10618+ $(members t.members)
10619+::
10620+++ cycle-find-site
10621+ |= [sites=(list icyclesite) component=(list term)]
10622+ ^- (unit span)
10623+ ?~ sites ~
10624+ ?: (lien component |=(n=term =(n name.i.sites))) `at.i.sites
10625+ $(sites t.sites)
10626+::
10627+++ cycle-group-errors
10628+ |= [members=(list def) component=(list term) globals=(list term)]
10629+ ^- (list icycle)
10630+ ?~ members ~
10631+ =/ d=def i.members
10632+ ?> ?=(%value -.d)
10633+ =/ tail=(list icycle) $(members t.members)
10634+ ?. (cycle-definitely-atom val.d) tail
10635+ =/ sites=(unit (list icyclesite)) (cycle-sites val.d globals ~)
10636+ ?~ sites tail
10637+ =/ found=(unit span) (cycle-find-site u.sites component)
10638+ ?~ found tail
10639+ [[name.d at.d u.found] tail]
10640+::
10641+++ definite-value-cycles
10642+ |= [ds=(list def) globals=(list term)]
10643+ ^- (list icycle)
10644+ =/ names=(list term) (global-value-names ds)
10645+ =/ graph=iadj (graph-make-forward ds (graph-nameset names ~) ~)
10646+ =/ components=icomponents (graph-components ds names)
10647+ =/ out=(list icycle) ~
729310648 |-
7294− =/ next=ienv (add-supported-defs ds env molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
7295− ?: =(next env) env
7296− $(env next)
10649+ ?~ components out
10650+ =/ component=(list term) i.components
10651+ ?. (graph-cycle component graph) $(components t.components)
10652+ =/ members=(list def)
10653+ (skim ds |=(d=def &(?=(%value -.d) (lien component |=(n=term =(n name.d))))))
10654+ ?. =((lent members) (lent component)) $(components t.components)
10655+ ?. (cycle-proof-group members globals) $(components t.components)
10656+ $(components t.components, out (weld (cycle-group-errors members component globals) out))
729710657::
729810658+| %union-analysis
729910659::
@@ -7417,6 +10777,257 @@
741710777 %overlap
741810778 %unknown
741910779::
10780+:: A source-only fallback for literal-tagged cells and one-hop local
10781+:: generic applications. It screens all work before ordinary inference.
10782+++ union-simple-shape-budget
10783+ |= [s=shape fuel=@ud vars=(unit (list @t))]
10784+ ^- (unit @ud)
10785+ ?: =(0 fuel) ~
10786+ =. fuel (dec fuel)
10787+ ?- -.s
10788+ ?(%aura %noun %void %flag) `fuel
10789+ %tvar
10790+ ?~ vars `fuel
10791+ ?:((lien u.vars |=(n=@t =(n name.s))) `fuel ~)
10792+ %const
10793+ ?. |(=(%term form.lit.s) =(%null form.lit.s) =(%loobean form.lit.s)) ~
10794+ ?: &(=(%loobean form.lit.s) !|(=(0 val.lit.s) =(1 val.lit.s))) ~
10795+ `fuel
10796+ %cell (union-simple-fields-budget fields.s fuel vars)
10797+ %fn
10798+ =/ left=(unit @ud) $(s sample.s, fuel fuel)
10799+ ?~ left ~
10800+ $(s product.s, fuel u.left)
10801+ * ~
10802+ ==
10803+++ union-simple-fields-budget
10804+ |= [fields=(list field) fuel=@ud vars=(unit (list @t))]
10805+ ^- (unit @ud)
10806+ ?~ fields `fuel
10807+ ?: =(0 fuel) ~
10808+ =/ field-shape=shape
10809+ ?- -.i.fields
10810+ %bare shape.i.fields
10811+ %face shape.i.fields
10812+ %pun [%ref at.i.fields ~[name.i.fields]]
10813+ ==
10814+ =/ head=(unit @ud) (union-simple-shape-budget field-shape (dec fuel) vars)
10815+ ?~ head ~
10816+ $(fields t.fields, fuel u.head)
10817+++ union-source-find
10818+ |= [n=term molds=imolds fuel=@ud]
10819+ ^- (unit [body=shape left=@ud])
10820+ =/ found=(unit shape) ~
10821+ |-
10822+ ?~ molds
10823+ ?~ found ~
10824+ `[u.found fuel]
10825+ ?: =(0 fuel) ~
10826+ ?: =(n name.i.molds)
10827+ ?^ found ~
10828+ $(molds t.molds, fuel (dec fuel), found `body.i.molds)
10829+ $(molds t.molds, fuel (dec fuel))
10830+++ union-source-args-budget
10831+ |= [vars=(list @t) args=(list shape) fuel=@ud]
10832+ ^- (unit @ud)
10833+ =/ seen=(set @t) *(set @t)
10834+ |-
10835+ ?~ vars ?~(args `fuel ~)
10836+ ?~ args ~
10837+ ?: =(0 fuel) ~
10838+ ?: (~(has in:..zuse seen) i.vars) ~
10839+ =/ arg=(unit @ud) (union-simple-shape-budget i.args (dec fuel) ~)
10840+ ?~ arg ~
10841+ $(vars t.vars, args t.args, fuel u.arg, seen (~(put in:..zuse seen) i.vars))
10842+++ union-source-cell-tag
10843+ |= s=shape
10844+ ^- (unit @)
10845+ ?. ?=(%cell -.s) ~
10846+ ?~ fields.s ~
10847+ ?~ t.fields.s ~
10848+ ?. ?=(%bare -.i.fields.s) ~
10849+ =/ head=shape shape.i.fields.s
10850+ ?. ?=(%const -.head) ~
10851+ ?. |(=(%term form.lit.head) =(%null form.lit.head) =(%loobean form.lit.head)) ~
10852+ ?: &(=(%loobean form.lit.head) !|(=(0 val.lit.head) =(1 val.lit.head))) ~
10853+ `val.lit.head
10854+++ union-source-case-tag
10855+ |= [s=shape molds=imolds fuel=@ud]
10856+ ^- (unit [tag=@ left=@ud])
10857+ ?: ?=(%cell -.s)
10858+ =/ tag=(unit @) (union-source-cell-tag s)
10859+ ?~ tag ~
10860+ =/ left=(unit @ud) (union-simple-shape-budget s fuel ~)
10861+ ?~ left ~
10862+ `[u.tag u.left]
10863+ ?. ?=(%apply -.s) ~
10864+ ?. ?=([@ ~] ref.s) ~
10865+ ?: =(0 fuel) ~
10866+ =/ found=(unit [body=shape left=@ud]) (union-source-find i.ref.s molds (dec fuel))
10867+ ?~ found ~
10868+ ?. ?=(%generic -.body.u.found) ~
10869+ ?~ vars.body.u.found ~
10870+ =/ tag=(unit @) (union-source-cell-tag body.body.u.found)
10871+ ?~ tag ~
10872+ =/ args=(unit @ud) (union-source-args-budget vars.body.u.found args.s left.u.found)
10873+ ?~ args ~
10874+ =/ left=(unit @ud) (union-simple-shape-budget body.body.u.found u.args `vars.body.u.found)
10875+ ?~ left ~
10876+ `[u.tag u.left]
10877+++ union-source-distinct-tags
10878+ |= [cases=(list shape) molds=imolds fuel=@ud]
10879+ ^- ?
10880+ =/ seen=(set @) *(set @)
10881+ =/ has-application=? |
10882+ |-
10883+ ?~ cases has-application
10884+ ?: =(0 fuel) |
10885+ =/ item=(unit [tag=@ left=@ud]) (union-source-case-tag i.cases molds (dec fuel))
10886+ ?~ item |
10887+ ?: (~(has in:..zuse seen) tag.u.item) |
10888+ $(cases t.cases, fuel left.u.item, seen (~(put in:..zuse seen) tag.u.item), has-application |(has-application ?=(%apply -.i.cases)))
10889+::
10890+:: This inference-only screen bounds inherited work that the small source
10891+:: slice may consult. It does not authenticate a caller-created state.
10892+++ union-state-leaf
10893+ |= t=itype
10894+ ^- ?
10895+ ?=(?(%var %fvar %avar %rvar %nvar %rnvar %atom %any-atom %flag %noun %empty %const) -.t)
10896+++ union-state-params-budget
10897+ |= [params=iparams fuel=@ud]
10898+ ^- (unit @ud)
10899+ ?~ params `fuel
10900+ ?: =(0 fuel) ~
10901+ ?. (union-state-leaf typ.i.params) ~
10902+ $(params t.params, fuel (dec fuel))
10903+++ union-state-sub-budget
10904+ |= [sub=isub fuel=@ud]
10905+ ^- (unit @ud)
10906+ ?~ sub `fuel
10907+ ?: =(0 fuel) ~
10908+ ?. (union-state-leaf val.i.sub) ~
10909+ $(sub t.sub, fuel (dec fuel))
10910+++ union-state-caps-budget
10911+ |= [caps=icaps fuel=@ud]
10912+ ^- (unit @ud)
10913+ ?~ caps `fuel
10914+ ?: =(0 fuel) ~
10915+ $(caps t.caps, fuel (dec fuel))
10916+++ union-state-active-budget
10917+ |= [active=(list term) fuel=@ud]
10918+ ^- (unit @ud)
10919+ ?~ active `fuel
10920+ ?: =(0 fuel) ~
10921+ $(active t.active, fuel (dec fuel))
10922+++ union-state-tags-budget
10923+ |= [tags=(list ipending) fuel=@ud]
10924+ ^- (unit @ud)
10925+ ?~ tags `fuel
10926+ ?: =(0 fuel) ~
10927+ $(tags t.tags, fuel (dec fuel))
10928+++ union-source-state-safe
10929+ |= [state=istate fuel=@ud]
10930+ ^- ?
10931+ ?^ grec-index.state |
10932+ ?^ holes.state |
10933+ ?^ defer.state |
10934+ ?^ obligations.state |
10935+ =/ params=(unit @ud) (union-state-params-budget params.state fuel)
10936+ ?~ params |
10937+ =/ sub=(unit @ud) (union-state-sub-budget sub.state u.params)
10938+ ?~ sub |
10939+ =/ caps=(unit @ud) (union-state-caps-budget caps.state u.sub)
10940+ ?~ caps |
10941+ =/ active=(unit @ud) (union-state-active-budget active.state u.caps)
10942+ ?~ active |
10943+ ?=(^ (union-state-tags-budget tags.state u.active))
10944+::
10945+:: Positive overlap witnesses from parsed, one-hop local source only.
10946+:: Unknown or exhausted work returns no witness, never disjointness.
10947++$ uow-case [at=span head=@ payload=upat]
10948+++ union-overlap-primitive
10949+ |= s=shape
10950+ ^- (unit upat)
10951+ ?- -.s
10952+ %aura `[%atom ~]
10953+ %noun `[%all ~]
10954+ %void `[%empty ~]
10955+ %flag `[%flag ~]
10956+ %const
10957+ ?. |(=(%term form.lit.s) =(%null form.lit.s) =(%loobean form.lit.s)) ~
10958+ ?: &(=(%loobean form.lit.s) !|(=(0 val.lit.s) =(1 val.lit.s))) ~
10959+ `[%atom `val.lit.s]
10960+ * ~
10961+ ==
10962+++ union-overlap-case
10963+ |= [s=shape molds=imolds fuel=@ud]
10964+ ^- (unit [item=uow-case left=@ud])
10965+ ?: =(0 fuel) ~
10966+ =. fuel (dec fuel)
10967+ :: Each body has exactly two fields; an application has exactly one
10968+ :: parameter and one concrete primitive argument. The full mold table
10969+ :: is scanned to establish unique ownership.
10970+ =/ expanded=(unit [body=shape param=(unit [name=@t pat=upat]) left=@ud])
10971+ ?: ?=(%cell -.s) `[s ~ fuel]
10972+ ?. ?=(%apply -.s) ~
10973+ ?. ?=([@ ~] ref.s) ~
10974+ ?. ?=([* ~] args.s) ~
10975+ ?: =(0 fuel) ~
10976+ =/ found=(unit [body=shape left=@ud]) (union-source-find i.ref.s molds (dec fuel))
10977+ ?~ found ~
10978+ ?. ?=(%generic -.body.u.found) ~
10979+ ?. ?=([@ ~] vars.body.u.found) ~
10980+ ?: =(0 left.u.found) ~
10981+ =/ argument=(unit upat) (union-overlap-primitive i.args.s)
10982+ ?~ argument ~
10983+ `[body.body.u.found `[i.vars.body.u.found u.argument] (dec left.u.found)]
10984+ ?~ expanded ~
10985+ =/ body=shape body.u.expanded
10986+ ?. ?=(%cell -.body) ~
10987+ ?. ?=([* * ~] fields.body) ~
10988+ :: Charge the cell, two fields, and the head and payload nodes.
10989+ ?: (lth left.u.expanded 5) ~
10990+ =/ head=(unit @) (union-source-cell-tag body)
10991+ ?~ head ~
10992+ =/ field=field i.t.fields.body
10993+ =/ payload=shape
10994+ ?- -.field
10995+ %bare shape.field
10996+ %face shape.field
10997+ %pun [%ref at.field ~[name.field]]
10998+ ==
10999+ =/ pattern=(unit upat)
11000+ ?: ?=(%tvar -.payload)
11001+ ?~ param.u.expanded ~
11002+ ?. =(name.payload name.u.param.u.expanded) ~
11003+ `pat.u.param.u.expanded
11004+ (union-overlap-primitive payload)
11005+ ?~ pattern ~
11006+ `[[at.s u.head u.pattern] (sub left.u.expanded 5)]
11007+++ union-overlap-against
11008+ |= [first=uow-case rest=(list shape) molds=imolds fuel=@ud]
11009+ ^- (unit [witness=(unit upair) left=@ud])
11010+ ?~ rest `[~ fuel]
11011+ ?: =(0 fuel) ~
11012+ =/ other=(unit [item=uow-case left=@ud]) (union-overlap-case i.rest molds (dec fuel))
11013+ ?~ other ~
11014+ ?: &(=(head.first head.item.u.other) =(%overlap (union-relate payload.first payload.item.u.other)))
11015+ `[`[at.first at.item.u.other %overlap] left.u.other]
11016+ $(rest t.rest, fuel left.u.other)
11017+++ union-source-overlap
11018+ |= [cases=(list shape) molds=imolds fuel=@ud]
11019+ ^- (unit upair)
11020+ ?~ cases ~
11021+ ?~ t.cases ~
11022+ ?: =(0 fuel) ~
11023+ =/ first=(unit [item=uow-case left=@ud]) (union-overlap-case i.cases molds (dec fuel))
11024+ ?~ first ~
11025+ =/ found=(unit [witness=(unit upair) left=@ud])
11026+ (union-overlap-against item.u.first t.cases molds left.u.first)
11027+ ?~ found ~
11028+ ?^ witness.u.found witness.u.found
11029+ $(cases t.cases, fuel left.u.found)
11030+::
742011031++ union-pairs
742111032 |= [cases=(list shape) molds=imolds]
742211033 ^- (list upair)
@@ -7430,15 +11041,151 @@
743011041 [at.first at.second (union-relate a (project-union-mold second molds ~))]
743111042 (weld pairs $(cases t.cases))
743211043::
11044+:: A closed structural mold supplies no equation to determine a hole.
11045+:: Applications, references, unbound capitals and unions are unproved.
11046+++ simple-mold-hole
11047+ |= sh=shape
11048+ ^- (unit (unit span))
11049+ ?: ?=(%generic -.sh)
11050+ ?~ vars.sh ~
11051+ ?. (distinct-params vars.sh) ~
11052+ (simple-mold-hole-in body.sh vars.sh)
11053+ (simple-mold-hole-in sh ~)
11054+++ simple-mold-hole-in
11055+ |= [sh=shape vars=(list @t)]
11056+ ^- (unit (unit span))
11057+ ?- -.sh
11058+ %hole ``at.sh
11059+ ?(%aura %noun %void %flag %const) `~
11060+ %tvar ?:((lien vars |=(v=@t =(v name.sh))) `~ ~)
11061+ %cell (simple-mold-field-holes fields.sh vars)
11062+ %fn
11063+ =/ a=(unit (unit span)) $(sh sample.sh)
11064+ ?~ a ~
11065+ =/ b=(unit (unit span)) $(sh product.sh)
11066+ ?~ b ~
11067+ `?~(u.a u.b u.a)
11068+ %generic ~
11069+ * ~
11070+ ==
11071+++ simple-mold-field-holes
11072+ |= [fields=(list field) vars=(list @t)]
11073+ ^- (unit (unit span))
11074+ ?~ fields `~
11075+ =/ f=field i.fields
11076+ =/ first=(unit (unit span))
11077+ ?- -.f
11078+ %face (simple-mold-hole-in shape.f vars)
11079+ %bare (simple-mold-hole-in shape.f vars)
11080+ %pun ~
11081+ ==
11082+ ?~ first ~
11083+ =/ rest=(unit (unit span)) $(fields t.fields)
11084+ ?~ rest ~
11085+ `?~(u.first u.rest u.first)
11086+++ simple-local-mold-hole
11087+ |= defs=(list def)
11088+ ^- (unit span)
11089+ ?~ defs ~
11090+ ?. ?=(%mold -.i.defs) $(defs t.defs)
11091+ =/ found=(unit (unit span)) (simple-mold-hole shape.i.defs)
11092+ ?~ found $(defs t.defs)
11093+ ?^ u.found u.found
11094+ $(defs t.defs)
11095+::
11096+:: A partial prelude may omit unsupported declarations, but may not
11097+:: publish an interface while a named mold's hole remains unchecked.
11098+++ shape-has-hole
11099+ |= sh=shape
11100+ ^- ?
11101+ ?- -.sh
11102+ %hole &
11103+ %path (lien segs.sh |=(s=pseg ?=(%inferred -.s)))
11104+ %apply (lien args.sh shape-has-hole)
11105+ %union (lien cases.sh shape-has-hole)
11106+ %cell (lien fields.sh field-has-hole)
11107+ %fn |($(sh sample.sh) $(sh product.sh))
11108+ %generic $(sh body.sh)
11109+ * |
11110+ ==
11111+++ field-has-hole
11112+ |= f=field
11113+ ^- ?
11114+ ?- -.f
11115+ %face (shape-has-hole shape.f)
11116+ %bare (shape-has-hole shape.f)
11117+ %pun |
11118+ ==
11119+++ named-mold-has-hole
11120+ |= ds=(list def)
11121+ ^- ?
11122+ ?~ ds |
11123+ ?: &(?=(%mold -.i.ds) (shape-has-hole shape.i.ds)) &
11124+ $(ds t.ds)
11125+::
11126+++ sample-has-hole
11127+ |= sam=sample
11128+ ^- ?
11129+ ?- -.sam
11130+ %face (shape-has-hole shape.sam)
11131+ %bare (shape-has-hole shape.sam)
11132+ %cell (lien items.sam sample-has-hole)
11133+ * |
11134+ ==
11135+++ def-has-hole
11136+ |= d=def
11137+ ^- ?
11138+ ?- -.d
11139+ %mold (shape-has-hole shape.d)
11140+ %value (expr-has-hole val.d)
11141+ ==
11142+++ expr-has-hole
11143+ |= e=expr
11144+ ^- ?
11145+ ?- -.e
11146+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (expr-has-hole p.p) |)))
11147+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (expr-has-hole p.p) |)))
11148+ %change (lien edits.e |=(p=edit (expr-has-hole val.p)))
11149+ %pair $(e val.e)
11150+ %unit $(e val.e)
11151+ %group $(e inner.e)
11152+ %list (lien items.e expr-has-hole)
11153+ %tuple (lien items.e |=(i=item (expr-has-hole val.i)))
11154+ ?(%gate %gate-wide) |((sample-has-hole sample.e) $(e body.e))
11155+ %cast |((shape-has-hole shape.e) $(e val.e))
11156+ %call |($(e head.e) (lien args.e expr-has-hole))
11157+ %trace |($(e val.e) $(e then.e))
11158+ %branch |($(e subject.e) (lien arms.e |=(a=arm (expr-has-hole val.a))))
11159+ %body |((lien defs.e def-has-hole) $(e final.e))
11160+ * |
11161+ ==
11162+++ hole-values-present
11163+ |= [ds=(list def) env=ienv]
11164+ ^- ?
11165+ ?~ ds &
11166+ ?. ?=(%value -.i.ds) $(ds t.ds)
11167+ ?: (expr-has-hole val.i.ds)
11168+ ?. ?=(^ (ienv-lookup name.i.ds env)) |
11169+ $(ds t.ds)
11170+ $(ds t.ds)
743311171++ show-partial-mold
743411172 |= [file=path src=@t d=def molds=imolds]
743511173 ^- @t
743611174 ?> ?=(%mold -.d)
743711175 =/ sh=shape shape.d
11176+ =/ hole=(unit (unit span)) (simple-mold-hole sh)
11177+ ?: &(?=(^ hole) ?=(^ u.hole))
11178+ =/ text=@t (show-error src [file line.beg.u.u.hole col.beg.u.u.hole "unresolved type hole"])
11179+ (of-wain:format ~[(crip "+$ {(trip name.d)}: type hole needs a determined type") text])
743811180 =? sh ?=(%generic -.sh) body.sh
743911181 ?. ?=(%union -.sh) (crip "+$ {(trip name.d)}: not checked")
744011182 =/ pairs=(list upair) (union-pairs cases.sh molds)
744111183 =/ overlapping=(list upair) (skim pairs |=(p=upair =(%overlap relation.p)))
11184+ =. overlapping
11185+ ?^ overlapping overlapping
11186+ ?. (lien pairs |=(p=upair =(%unknown relation.p))) ~
11187+ =/ witness=(unit upair) (union-source-overlap cases.sh molds 256)
11188+ ?~(witness ~ ~[u.witness])
744211189 ?^ overlapping
744311190 =/ p=upair i.overlapping
744411191 =/ summary=@t (crip "+$ {(trip name.d)}: overlapping cases; mold not checked")
@@ -7446,7 +11193,9 @@
744611193 =/ second=@t (show-error src [file line.beg.second.p col.beg.second.p "overlapping case"])
744711194 (of-wain:format ~[summary first second])
744811195 ?: (lien pairs |=(p=upair =(%unknown relation.p)))
7449− (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
11196+ ?. (union-source-distinct-tags cases.sh molds 256)
11197+ (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
11198+ (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
745011199 (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
745111200::
745211201:: +show-inference-diagnostic: a partial report with both source sites
@@ -7461,8 +11210,23 @@
746111210 (show-error src [file line.beg.at.site col.beg.at.site note.site])
746211211 (of-wain:format [summary excerpts])
746311212::
7464−:: +golden-types: a partial report; it does not claim the module checks
7465−::
11213+:: Both written field sites are shown in the source that declares them.
11214+++ show-duplicate-fields
11215+ |= [file=path src=@t diagnostic=idiag]
11216+ ^- @t
11217+ =/ excerpts=(list @t)
11218+ %+ turn sites.diagnostic
11219+ |= site=[at=span note=tape]
11220+ (show-error src [file line.beg.at.site col.beg.at.site note.site])
11221+ (of-wain:format [(crip msg.diagnostic) excerpts])
11222+::
11223+++ duplicate-fields-report
11224+ |= [file=path src=@t diagnostic=idiag]
11225+ ^- @t
11226+ (of-wain:format ~['partial inference; module not checked' (show-duplicate-fields file src diagnostic)])
11227+::
11228+:: +golden-types: a partial report; it does not claim the module checks
11229+::
746611230++ golden-types
746711231 |= [file=path src=@t]
746811232 ^- @t
@@ -7488,8 +11252,189 @@
748811252+$ jbundle (list jsource)
748911253+$ jcache (list [at=path iface=ifile])
749011254+$ jfile-result (each [iface=ifile cache=jcache] @t)
11255+:: Overlap evidence retains the exact source that supplied its spans.
11256+:: Ordinary Jibb imports preserve this evidence through the resolver.
11257++$ jfile-overlap [file=path source=@t name=term cases=upair]
11258++$ jfile-failure [message=@t overlap=(unit jfile-overlap)]
11259++$ jfile-detailed-result (each [iface=ifile cache=jcache] jfile-failure)
749111260+$ jimports-result (each [resolved=ijimports cache=jcache] @t)
11261+:: Preserve an imported overlap's original file and source across the graph.
11262++$ jimports-detailed-result (each [resolved=ijimports cache=jcache] jfile-failure)
749211263::
11264+:: Written record fields each have their own lexical record scope.
11265++$ written-fields (map term span)
11266+++ duplicate-written-field
11267+ |= [name=term at=span seen=written-fields]
11268+ ^- (unit idiag)
11269+ =/ prior=(unit span) (~(get by seen) name)
11270+ ?~ prior ~
11271+ `["record field `{(trip name)}` is repeated" ~[[u.prior "first field"] [at "repeated field"]]]
11272+++ duplicate-shapes
11273+ |= xs=(list shape)
11274+ ^- (unit idiag)
11275+ ?~ xs ~
11276+ =/ first (duplicate-shape i.xs)
11277+ ?^ first first
11278+ $(xs t.xs)
11279+++ duplicate-fields
11280+ |= [fields=(list field) seen=written-fields]
11281+ ^- (unit idiag)
11282+ ?~ fields ~
11283+ =/ f=field i.fields
11284+ =/ n=(unit term)
11285+ ?- -.f
11286+ %face `name.f
11287+ %pun `name.f
11288+ %bare ~
11289+ ==
11290+ =/ dup=(unit idiag) ?~(n ~ (duplicate-written-field u.n at.f seen))
11291+ ?^ dup dup
11292+ =/ inner=(unit idiag)
11293+ ?- -.f
11294+ %face (duplicate-shape shape.f)
11295+ %pun ~
11296+ %bare (duplicate-shape shape.f)
11297+ ==
11298+ ?^ inner inner
11299+ $(fields t.fields, seen ?~(n seen (~(put by seen) u.n at.f)))
11300+++ duplicate-shape
11301+ |= s=shape
11302+ ^- (unit idiag)
11303+ ?- -.s
11304+ %cell (duplicate-fields fields.s ~)
11305+ %apply (duplicate-shapes args.s)
11306+ %union (duplicate-shapes cases.s)
11307+ %fn
11308+ =/ left (duplicate-shape sample.s)
11309+ ?^ left left
11310+ (duplicate-shape product.s)
11311+ %generic (duplicate-shape body.s)
11312+ * ~
11313+ ==
11314+++ duplicate-samples
11315+ |= [items=(list sample) seen=written-fields]
11316+ ^- (unit idiag)
11317+ ?~ items ~
11318+ =/ a=sample i.items
11319+ =/ n=(unit term)
11320+ ?- -.a
11321+ %bind `name.a
11322+ %face `name.a
11323+ %pun `name.a
11324+ * ~
11325+ ==
11326+ =/ dup=(unit idiag) ?~(n ~ (duplicate-written-field u.n at.a seen))
11327+ ?^ dup dup
11328+ =/ inner (duplicate-sample a)
11329+ ?^ inner inner
11330+ $(items t.items, seen ?~(n seen (~(put by seen) u.n at.a)))
11331+++ duplicate-sample
11332+ |= s=sample
11333+ ^- (unit idiag)
11334+ ?- -.s
11335+ %cell (duplicate-samples items.s ~)
11336+ %face (duplicate-shape shape.s)
11337+ %bare (duplicate-shape shape.s)
11338+ * ~
11339+ ==
11340+++ duplicate-exprs
11341+ |= xs=(list expr)
11342+ ^- (unit idiag)
11343+ ?~ xs ~
11344+ =/ first (duplicate-expr i.xs)
11345+ ?^ first first
11346+ $(xs t.xs)
11347+++ duplicate-items
11348+ |= [items=(list item) seen=written-fields]
11349+ ^- (unit idiag)
11350+ ?~ items ~
11351+ =/ a=item i.items
11352+ =/ dup=(unit idiag) ?~(face.a ~ (duplicate-written-field u.face.a at.a seen))
11353+ ?^ dup dup
11354+ =/ inner (duplicate-expr val.a)
11355+ ?^ inner inner
11356+ $(items t.items, seen ?~(face.a seen (~(put by seen) u.face.a at.a)))
11357+++ duplicate-pieces
11358+ |= pieces=(list piece)
11359+ ^- (unit idiag)
11360+ ?~ pieces ~
11361+ =/ first=(unit idiag) ?:(?=(%expr -.i.pieces) (duplicate-expr p.i.pieces) ~)
11362+ ?^ first first
11363+ $(pieces t.pieces)
11364+++ duplicate-qsegs
11365+ |= segs=(list qseg)
11366+ ^- (unit idiag)
11367+ ?~ segs ~
11368+ =/ first=(unit idiag) ?:(?=(%expr -.i.segs) (duplicate-expr p.i.segs) ~)
11369+ ?^ first first
11370+ $(segs t.segs)
11371+++ duplicate-edits
11372+ |= edits=(list edit)
11373+ ^- (unit idiag)
11374+ ?~ edits ~
11375+ =/ first (duplicate-expr val.i.edits)
11376+ ?^ first first
11377+ $(edits t.edits)
11378+++ duplicate-arms
11379+ |= arms=(list arm)
11380+ ^- (unit idiag)
11381+ ?~ arms ~
11382+ =/ first (duplicate-expr val.i.arms)
11383+ ?^ first first
11384+ $(arms t.arms)
11385+++ duplicate-defs
11386+ |= defs=(list def)
11387+ ^- (unit idiag)
11388+ ?~ defs ~
11389+ =/ first=(unit idiag)
11390+ ?- -.i.defs
11391+ %mold (duplicate-shape shape.i.defs)
11392+ %value (duplicate-expr val.i.defs)
11393+ ==
11394+ ?^ first first
11395+ $(defs t.defs)
11396+++ duplicate-expr
11397+ |= e=expr
11398+ ^- (unit idiag)
11399+ ?- -.e
11400+ %str (duplicate-pieces pieces.e)
11401+ %qath (duplicate-qsegs segs.e)
11402+ %change (duplicate-edits edits.e)
11403+ %pair (duplicate-expr val.e)
11404+ %unit (duplicate-expr val.e)
11405+ %group (duplicate-expr inner.e)
11406+ %list (duplicate-exprs items.e)
11407+ %tuple (duplicate-items items.e ~)
11408+ %gate-wide
11409+ =/ first (duplicate-sample sample.e)
11410+ ?^ first first
11411+ (duplicate-expr body.e)
11412+ %gate
11413+ =/ first (duplicate-sample sample.e)
11414+ ?^ first first
11415+ (duplicate-expr body.e)
11416+ %cast
11417+ =/ first (duplicate-shape shape.e)
11418+ ?^ first first
11419+ (duplicate-expr val.e)
11420+ %call
11421+ =/ first (duplicate-expr head.e)
11422+ ?^ first first
11423+ (duplicate-exprs args.e)
11424+ %trace
11425+ =/ first (duplicate-expr val.e)
11426+ ?^ first first
11427+ (duplicate-expr then.e)
11428+ %branch
11429+ =/ first (duplicate-expr subject.e)
11430+ ?^ first first
11431+ (duplicate-arms arms.e)
11432+ %body
11433+ =/ first (duplicate-defs defs.e)
11434+ ?^ first first
11435+ (duplicate-expr final.e)
11436+ * ~
11437+ ==
749311438++ import-binding-names
749411439 |= imports=(list import)
749511440 ^- (list term)
@@ -7502,6 +11447,60 @@
750211447 ==
750311448 [n $(imports t.imports)]
750411449::
11450+++ reserved-proj-sample
11451+ |= sam=sample
11452+ ^- ?
11453+ ?- -.sam
11454+ %bind =(name.sam %proj)
11455+ %face =(name.sam %proj)
11456+ %pun =(name.sam %proj)
11457+ %cell (lien items.sam reserved-proj-sample)
11458+ * |
11459+ ==
11460+++ reserved-proj-pattern
11461+ |= p=pattern
11462+ ^- ?
11463+ ?- -.p
11464+ %bind =(name.p %proj)
11465+ %cell (lien items.p reserved-proj-pattern)
11466+ * |
11467+ ==
11468+++ reserved-proj-def
11469+ |= d=def
11470+ ^- ?
11471+ ?: =(name.d %proj) &
11472+ ?: ?=(%value -.d) (reserved-proj-expr val.d)
11473+ |
11474+++ reserved-proj-expr
11475+ |= e=expr
11476+ ^- ?
11477+ ?- -.e
11478+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
11479+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
11480+ %change (lien edits.e |=(p=edit (reserved-proj-expr val.p)))
11481+ %pair $(e val.e)
11482+ %unit $(e val.e)
11483+ %group $(e inner.e)
11484+ %list (lien items.e reserved-proj-expr)
11485+ %tuple (lien items.e |=(i=item (reserved-proj-expr val.i)))
11486+ ?(%gate %gate-wide) |((reserved-proj-sample sample.e) $(e body.e))
11487+ %cast $(e val.e)
11488+ %call |($(e head.e) (lien args.e reserved-proj-expr))
11489+ %trace |($(e val.e) $(e then.e))
11490+ %branch |($(e subject.e) (lien arms.e |=(a=arm |((reserved-proj-pattern pat.a) (reserved-proj-expr val.a)))))
11491+ %body |((lien defs.e reserved-proj-def) $(e final.e))
11492+ * |
11493+ ==
11494+::
11495+++ module-has-reserved-proj
11496+ |= mod=module
11497+ ^- ?
11498+ =/ imported=(list term) (import-binding-names imports.mod)
11499+ =/ vals=(list term) (global-value-names defs.mod)
11500+ =/ molds=imolds (collect-simple-molds defs.mod)
11501+ =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11502+ |((lien (weld imported (weld vals mold-names)) |=(n=term =(n %proj))) (lien defs.mod reserved-proj-def))
11503+::
750511504++ module-scope-valid
750611505 |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
750711506 ^- ?
@@ -7509,6 +11508,7 @@
750911508 =/ vals=(list term) (global-value-names defs.mod)
751011509 =/ molds=imolds (collect-simple-molds defs.mod)
751111510 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11511+ ?: (module-has-reserved-proj mod) |
751211512 ?. %+ levy imported
751311513 |= n=term
751411514 &((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))))
@@ -7516,6 +11516,43 @@
751611516 ?. (levy vals |=(n=term &((unique-value-name n vals) !(lien prelude-values |=(v=term =(n v)))))) |
751711517 (levy mold-names |=(n=term &((unique-value-name n mold-names) !(lien prelude-molds |=(m=term =(n m))))))
751811518::
11519+:: A detailed failure is attached only to the first mold that actually
11520+:: failed in this check, using that module's checked source mold table.
11521++$ imold-failure [message=@t overlap=(unit [name=term cases=upair])]
11522+:: Validate a generic wrapper without an unbounded duplicate-name pass.
11523+++ module-mold-params-valid
11524+ |= [vars=(list @t) seen=(set @t) fuel=@ud]
11525+ ^- ?
11526+ ?~ vars &
11527+ ?: =(0 fuel) |
11528+ ?: (~(has in:..zuse seen) i.vars) |
11529+ $(vars t.vars, seen (~(put in:..zuse seen) i.vars), fuel (dec fuel))
11530+++ module-mold-overlap
11531+ |= [m=[name=term body=shape] molds=imolds]
11532+ ^- (unit upair)
11533+ =/ sh=shape body.m
11534+ =/ valid=?
11535+ ?. ?=(%generic -.sh) &
11536+ ?~ vars.sh |
11537+ (module-mold-params-valid vars.sh *(set @t) 256)
11538+ ?. valid ~
11539+ =? sh ?=(%generic -.sh) body.sh
11540+ ?. ?=(%union -.sh) ~
11541+ (union-source-overlap cases.sh molds 256)
11542+++ module-mold-types-detail
11543+ |= [molds=imolds state=istate]
11544+ ^- (each imold-types imold-failure)
11545+ ?~ molds [%& ~]
11546+ =/ m=[name=term body=shape] i.molds
11547+ =/ t=(unit [template=ischeme state=istate])
11548+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
11549+ ?~ t
11550+ =/ overlap=(unit upair) (module-mold-overlap m molds.state)
11551+ [%| ['module mold needs unsupported inference' ?~(overlap ~ `[name.m u.overlap])]]
11552+ =. typ.template.u.t (label-direct-union typ.template.u.t body.m name.m state)
11553+ =/ rest=(each imold-types imold-failure) $(molds t.molds)
11554+ ?: ?=(%| -.rest) rest
11555+ [%& [[name.m template.u.t] p.rest]]
751911556++ module-mold-types
752011557 |= [molds=imolds state=istate]
752111558 ^- (each imold-types @t)
@@ -7531,9 +11568,9 @@
753111568::
753211569:: Prepare a provisional interface from the trusted vendored source.
753311570:: Every declared name remains reserved, but only molds and values this
7534−:: fragment can infer are usable. Unsupported bodies are not validated,
7535−:: and imports into the prelude are not supported yet. The fixed origin
7536−:: gives its named unions the same identity in every importing module.
11571+:: fragment can infer are usable. Unsupported bodies are not validated.
11572+:: An optional internal source supplies the prelude's one supported import;
11573+:: clients cannot import that path directly. Named unions retain their origin.
753711574::
753811575:: Recognize only the complete standard prelude list shape. Its recursive
753911576:: tail uses the same parameter and the unqualified list name. The reader
@@ -7573,6 +11610,20 @@
757311610 ?. ?=(%tvar -.i.args.tail) |
757411611 =(var name.i.args.tail)
757511612::
11613+++ prelude-label
11614+ |= [typ=itype name=term vars=(list @ud)]
11615+ ^- itype
11616+ ?: ?=(%jrec -.typ) typ(label `name)
11617+ ?: ?=(%grec -.typ)
11618+ ?. (identity-union-parameters vars args.typ) typ(label ~)
11619+ typ(label `name)
11620+ ?. ?=(%union -.typ) typ
11621+ ?. (identity-union-parameters vars args.typ)
11622+ ?~ origin.typ typ
11623+ ?: =(at.u.origin.typ /lib/jibb/internal/jibb) typ(label ~)
11624+ typ
11625+ typ(label `name)
11626+::
757611627++ partial-prelude-molds
757711628 |= [molds=imolds state=istate]
757811629 ^- imold-types
@@ -7585,22 +11636,131 @@
758511636 (infer-mold-template body.m state(active [name.m active.state], in-mold &))
758611637 ?~ out $(molds t.molds)
758711638 =. typ.template.u.out (label-direct-union typ.template.u.out body.m name.m state)
11639+ =. typ.template.u.out (prelude-label typ.template.u.out name.m vars.template.u.out)
758811640 [[name.m template.u.out] $(molds t.molds)]
758911641::
7590−++ partial-prelude-interface
7591− |= src=@t
11642+:: A compiler-owned interface available only to the dedicated
11643+:: internal-prelude preparation path, never the ordinary module resolver.
11644+++ private-primitive-interface
11645+ ^- ifile
11646+ =/ a=itype [%avar 0]
11647+ =/ pair=itype [%cell a a]
11648+ =/ b=itype [%rvar 0]
11649+ =/ plus=ischeme [[%fn [%cell b b] b] ~[0]]
11650+ =/ minus=ischeme [[%fn b b] ~[0]]
11651+ =/ greater=ischeme [[%fn pair [%flag ~]] ~[0]]
11652+ =/ free=itype [%fvar 0]
11653+ =/ equal=ischeme [[%fn [%cell free free] [%flag ~]] ~[0]]
11654+ =/ utf8=itype [%atom 'tD']
11655+ =/ tape=itype [%collection %list ~[utf8]]
11656+ =/ codepoints=itype [%collection %list ~[[%atom %c]]]
11657+ =/ text-trip=ischeme [[%fn [%atom %t] tape] ~]
11658+ =/ text-tuba=ischeme [[%fn tape codepoints] ~]
11659+ [~[[%raw-add plus] [%raw-dec minus] [%raw-gth greater] [%raw-eq equal] [%raw-trip text-trip] [%raw-tuba text-tuba]] ~ /lib/jibb/primitives/jibb ~ ~ ~ ~ ~]
11660+::
11661+++ infer-private-internal
11662+ |= [src=@t public-source=@t]
11663+ ^- (unit ifile)
11664+ =/ at=path /lib/jibb/internal/jibb
11665+ =/ parsed (parse at src)
11666+ ?: ?=(%| -.parsed) ~
11667+ =/ mod=module p.parsed
11668+ ?^ (duplicate-defs defs.mod) ~
11669+ ?~ imports.mod
11670+ =/ built=jfile-result (infer-jibb-file at src ~ ~ ~ ~[at] ~ ~ ~ ~)
11671+ ?: ?=(%| -.built) ~
11672+ `iface.p.built
11673+ ?. ?=([[%jibb *] ~] imports.mod) ~
11674+ ?. =(path.i.imports.mod /lib/jibb/primitives) ~
11675+ ?. (module-scope-valid mod ~ ~) ~
11676+ =/ vals=(list term) (global-value-names defs.mod)
11677+ ?: (lien vals |=(n=term =(n %main))) ~
11678+ =/ molds=imolds (collect-simple-molds defs.mod)
11679+ =/ globals=(list term) (weld (import-binding-names imports.mod) vals)
11680+ :: The private source can use the public list and unit molds before the
11681+ :: prelude is otherwise prepared. Re-read the trusted public source here
11682+ :: and admit only its validated canonical templates; do not accept schemes
11683+ :: supplied independently by the caller.
11684+ =/ public=(each module error) (parse /lib/jibb/prelude/jibb public-source)
11685+ ?: ?=(%| -.public) ~
11686+ ?^ (duplicate-defs defs.p.public) ~
11687+ ?. (module-scope-valid p.public ~ ~) ~
11688+ =/ source-molds=imolds (collect-simple-molds defs.p.public)
11689+ =/ written-list=(unit shape) (find-simple-mold %list source-molds)
11690+ =/ source-list=(unit ischeme)
11691+ ?~ written-list ~
11692+ ?. (standard-prelude-list u.written-list) ~
11693+ `[[%collection %list ~[[%var 0]]] ~[0]]
11694+ :: Derive the public unit template from its actual source, then compare
11695+ :: the complete nominal template before making it available privately.
11696+ =/ unit-decl=(unit shape) (find-simple-mold %unit source-molds)
11697+ =/ source-unit=(unit ischeme)
11698+ ?~ unit-decl ~
11699+ =/ unit-molds=imolds ~[[%unit u.unit-decl]]
11700+ =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~ ~ ~ ~ ~ ~]
11701+ =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
11702+ =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
11703+ =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
11704+ ?~ found ~
11705+ ?. (standard-unit-template u.found /lib/jibb/prelude/jibb) ~
11706+ found
11707+ =/ primitive=ifile private-primitive-interface
11708+ =? primitive ?=(^ source-list)
11709+ primitive(molds [[%list u.source-list] molds.primitive])
11710+ =? primitive ?=(^ source-unit)
11711+ primitive(molds [[%unit u.source-unit] molds.primitive])
11712+ =/ js=ijimports ~[[face.i.imports.mod primitive]]
11713+ =/ reserved=(list term) ~[face.i.imports.mod]
11714+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11715+ =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~ ~ ~ ~ ~ ~]
11716+ =/ mts=(each imold-types @t) (module-mold-types molds state)
11717+ =/ usable=(unit imold-types)
11718+ ?: ?=(%& -.mts) `p.mts
11719+ :: Missing public templates may make an unrelated internal mold
11720+ :: unavailable. Validate all molds once with isolated canonical
11721+ :: templates before admitting only those inferred using the actual
11722+ :: source-backed templates. The proof interface is never exported.
11723+ ?. |(?=(~ source-list) ?=(~ source-unit)) ~
11724+ =/ nil=itype [%const [%null %n 0 '~']]
11725+ =/ canonical-unit=ischeme
11726+ [[%union ~[nil [%cell nil [%face %u [%var 0]]]] `[/lib/jibb/prelude/jibb %unit] `%unit ~[[%var 0]]] ~[0]]
11727+ =/ canonical-list=ischeme [[%collection %list ~[[%var 0]]] ~[0]]
11728+ =/ proof-primitive=ifile private-primitive-interface
11729+ =. molds.proof-primitive ~[[%list canonical-list] [%unit canonical-unit]]
11730+ =/ proof-imports=ijimports ~[[face.i.imports.mod proof-primitive]]
11731+ =/ proof=(each imold-types @t) (module-mold-types molds state(jimports proof-imports))
11732+ ?: ?=(%| -.proof) ~
11733+ `(partial-prelude-molds molds state)
11734+ ?~ usable ~
11735+ =/ resolution=iresolved (resolve-groups defs.mod molds globals ~ ~ ~ ~ js reserved at ~)
11736+ =/ env=ienv env.resolution
11737+ ?. (module-values-complete defs.mod env) ~
11738+ `[env u.usable at ~ artifacts.resolution ~ `src ~]
11739+::
11740+++ partial-prelude-interface-with-internal
11741+ |= [src=@t internal-source=(unit @t)]
759211742 ^- (unit ifile)
759311743 ?: =(0 src) ~
759411744 =/ at=path /lib/jibb/prelude/jibb
759511745 =/ parsed (parse at src)
759611746 ?: ?=(%| -.parsed) ~
7597− ?^ imports.p.parsed ~
11747+ ?: (named-mold-has-hole defs.p.parsed) ~
11748+ ?^ (duplicate-defs defs.p.parsed) ~
11749+ =/ private=(unit ijimports)
11750+ ?~ imports.p.parsed `~
11751+ ?. ?=([[%jibb *] ~] imports.p.parsed) ~
11752+ ?. =(path.i.imports.p.parsed /lib/jibb/internal) ~
11753+ ?~ internal-source ~
11754+ =/ built=(unit ifile) (infer-private-internal u.internal-source src)
11755+ ?~ built ~
11756+ `~[[face.i.imports.p.parsed u.built]]
11757+ ?~ private ~
759811758 ?~ defs.p.parsed ~
759911759 ?. (module-scope-valid p.parsed ~ ~) ~
760011760 =/ ds=(list def) defs.p.parsed
760111761 =/ molds=imolds (collect-simple-molds ds)
760211762 =/ names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7603− =/ globals=(list term) (global-value-names ds)
11763+ =/ globals=(list term) (weld (import-binding-names imports.p.parsed) (global-value-names ds))
760411764 :: Remove raw list before inferring any template, so an altered list
760511765 :: cannot leak through an alias. Its name remains reserved either way.
760611766 =/ declared=? (lien names |=(name=term =(%list name)))
@@ -7608,11 +11768,38 @@
760811768 =? env-molds declared
760911769 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
761011770 =/ reserved=(list term) ?:(declared ~[%list] ~)
7611− =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ ~ reserved ~ ~ ~ | at names ~]
7612− =/ mt=imold-types (partial-prelude-molds molds state)
7613− =/ partial=ifile [~ mt at]
7614− =/ env=ienv (resolve-supported-defs ds env-molds globals ~ ~ ~ ~ ~ reserved at `partial)
7615− `[env mt at]
11771+ =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~ ~ ~ ~ ~ ~]
11772+ :: Other prelude molds may use list only after its source has passed
11773+ :: the standard-list check. The raw declaration remains removed.
11774+ =/ declared-list=(unit shape) (find-simple-mold %list molds)
11775+ =/ mold-prelude=(unit ifile)
11776+ ?~ declared-list ~
11777+ ?. (standard-prelude-list u.declared-list) ~
11778+ `[~ ~[[%list [[%collection %list ~[[%var 0]]] ~[0]]]] at ~ ~ ~ ~ ~]
11779+ =/ mt=imold-types (partial-prelude-molds molds state(prelude mold-prelude))
11780+ =/ partial=ifile [~ mt at ~ ~ ~ ~ ~]
11781+ :: An explicitly qualified re-export must resolve. Other unsupported
11782+ :: prelude declarations remain reserved but absent from the interface.
11783+ =/ required=imolds
11784+ %+ skim molds
11785+ |= m=[name=term body=shape]
11786+ =/ sh=shape body.m
11787+ ?. ?=(%ref -.sh) |
11788+ ?~ names.sh |
11789+ ?=(^ t.names.sh)
11790+ ?. (levy required |=(m=[name=term body=shape] ?=(^ (find-jibb-mold name.m partial)))) ~
11791+ =/ resolution=iresolved (resolve-groups ds env-molds globals ~ ~ ~ ~ u.private reserved at `partial)
11792+ =/ env=ienv env.resolution
11793+ ?. (hole-values-present ds env) ~
11794+ =/ deps=(list iwidth-dependency)
11795+ ?~ u.private ~
11796+ ~[[at.interface.i.u.private source.interface.i.u.private elaborations.interface.i.u.private]]
11797+ `[env mt at ~ artifacts.resolution deps `src ~]
11798+::
11799+++ partial-prelude-interface
11800+ |= src=@t
11801+ ^- (unit ifile)
11802+ (partial-prelude-interface-with-internal src ~)
761611803::
761711804+$ iprelude [iface=ifile values=(list term) molds=(list term)]
761811805::
@@ -7627,6 +11814,17 @@
762711814 =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
762811815 `[u.iface vals ms]
762911816::
11817+++ prepare-prelude-with-internal
11818+ |= [src=@t internal-source=@t]
11819+ ^- (unit iprelude)
11820+ =/ iface=(unit ifile) (partial-prelude-interface-with-internal src `internal-source)
11821+ ?~ iface ~
11822+ =/ parsed (parse /lib/jibb/prelude/jibb src)
11823+ ?: ?=(%| -.parsed) ~
11824+ =/ vals=(list term) (global-value-names defs.p.parsed)
11825+ =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
11826+ `[u.iface vals ms]
11827+::
763011828++ module-values-complete
763111829 |= [ds=(list def) env=ienv]
763211830 ^- ?
@@ -7647,52 +11845,2675 @@
764711845 ?: =(at at.i.cache) `iface.i.cache
764811846 $(cache t.cache)
764911847::
11848+:: These certificates retain the complete checked source closure. The
11849+:: trusted host must supply the identical prepared prelude and reader nouns.
11850+:: Exact bundle equality binds all source paths and versions; the set
11851+:: retains transitive paths for active-cycle checks. Request-bearing graphs
11852+:: alone have a size limit; incompatible diamond evidence fails closed.
11853+++ request-graph-requests-add
11854+ |= [pending=(list irequest-evidence) acc=(list irequest-evidence) fuel=@ud]
11855+ ^- (unit (list irequest-evidence))
11856+ ?~ pending `acc
11857+ ?: =(0 fuel) ~
11858+ =/ hit=(list irequest-evidence)
11859+ (skim acc |=(x=irequest-evidence &(=(api-at.x api-at.i.pending) =(name.x name.i.pending))))
11860+ ?^ hit
11861+ ?. ?=([* ~] hit) ~
11862+ ?. =(i.hit i.pending) ~
11863+ $(pending t.pending, fuel (dec fuel))
11864+ $(pending t.pending, acc [i.pending acc], fuel (dec fuel))
11865+++ request-graph-inputs-match
11866+ |= [g=irequest-graph externals=iexternals marks=imark-externals modules=jbundle values=(list term) molds=(list term) prelude=(unit ifile)]
11867+ ^- ?
11868+ ?& =(bundle-input.g modules)
11869+ =(prelude-input.g prelude)
11870+ =(prelude-values.g values)
11871+ =(prelude-molds.g molds)
11872+ =(externals.g externals)
11873+ =(marks.g marks)
11874+ ==
11875+++ request-graph-bounded
11876+ |= g=irequest-graph
11877+ ^- ?
11878+ =/ total=@ud (add (lent requests.g) (lent stores.g))
11879+ &((lte (lent ~(tap in:..zuse paths.g)) 256) (lte total 256))
11880+::
11881+++ store-graph-requests-add
11882+ |= [pending=(list istore-request-evidence) acc=(list istore-request-evidence) fuel=@ud]
11883+ ^- (unit (list istore-request-evidence))
11884+ ?~ pending `acc
11885+ ?: =(0 fuel) ~
11886+ =/ hit=(list istore-request-evidence)
11887+ (skim acc |=(x=istore-request-evidence =(store-at.x store-at.i.pending)))
11888+ ?^ hit
11889+ ?. ?=([* ~] hit) ~
11890+ ?. =(i.hit i.pending) ~
11891+ $(pending t.pending, fuel (dec fuel))
11892+ $(pending t.pending, acc [i.pending acc], fuel (dec fuel))
11893+::
11894+++ request-graph-merge
11895+ |= [imports=ijimports g=irequest-graph fuel=@ud]
11896+ ^- (unit irequest-graph)
11897+ ?~ imports `g
11898+ ?: =(0 fuel) ~
11899+ =/ child=ifile interface.i.imports
11900+ ?~ graph.child ~
11901+ =/ cg=irequest-graph u.graph.child
11902+ ?. ?& =(bundle-input.g bundle-input.cg)
11903+ =(prelude-input.g prelude-input.cg)
11904+ =(prelude-values.g prelude-values.cg)
11905+ =(prelude-molds.g prelude-molds.cg)
11906+ =(externals.g externals.cg)
11907+ =(marks.g marks.cg)
11908+ ==
11909+ ~
11910+ =/ merged=(set path) (~(uni in:..zuse paths.g) paths.cg)
11911+ =/ rs=(unit (list irequest-evidence))
11912+ (request-graph-requests-add requests.cg requests.g (add 1 (lent requests.cg)))
11913+ ?~ rs ~
11914+ =/ ss=(unit (list istore-request-evidence))
11915+ (store-graph-requests-add stores.cg stores.g (add 1 (lent stores.cg)))
11916+ ?~ ss ~
11917+ =/ total=@ud (add (lent u.rs) (lent u.ss))
11918+ ?: &(?=(^ u.rs) |((gth (lent ~(tap in:..zuse merged)) 256) (gth total 256))) ~
11919+ ?: &(?=(^ u.ss) |((gth (lent ~(tap in:..zuse merged)) 256) (gth total 256))) ~
11920+ $(imports t.imports, g g(paths merged, requests u.rs, stores u.ss), fuel (dec fuel))
11921+++ request-graph-reusable
11922+ |= [f=ifile src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) values=(list term) molds=(list term) prelude=(unit ifile)]
11923+ ^- ?
11924+ ?~ source.f |
11925+ ?. =(u.source.f src) |
11926+ ?~ graph.f |
11927+ =/ g=irequest-graph u.graph.f
11928+ ?. (request-graph-inputs-match g externals marks modules values molds prelude) |
11929+ ?. (~(has in:..zuse paths.g) at.f) |
11930+ !(lien active |=(p=path (~(has in:..zuse paths.g) p)))
11931+::
765011932++ resolve-jibb-imports
765111933 |= [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)]
765211934 ^- jimports-result
11935+ =/ result=jimports-detailed-result
11936+ (resolve-jibb-imports-detailed imports externals mark-externals modules active prelude-values prelude-molds cache prelude)
11937+ ?: ?=(%| -.result) [%| message.p.result]
11938+ [%& p.result]
11939+++ resolve-jibb-imports-detailed
11940+ |= [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)]
11941+ ^- jimports-detailed-result
765311942 ?~ imports [%& [~ cache]]
765411943 ?. ?=(%jibb -.i.imports) $(imports t.imports)
765511944 =/ at=path (weld path.i.imports `path`~[%jibb])
11945+ ?: =(at /lib/jibb/internal/jibb)
11946+ [%| ['the prelude internal module is private' ~]]
11947+ ?: =(at /lib/jibb/primitives/jibb)
11948+ [%| ['the prelude primitive interface is private' ~]]
765611949 ?: (lien active |=(p=path =(p at)))
7657− [%| (crip "import cycle at {(spud at)}")]
11950+ [%| [(crip "import cycle at {(spud at)}") ~]]
765811951 =/ found=jbundle (skim modules |=(m=jsource =(at at.m)))
7659− ?~ found [%| (crip "module source missing: {(spud at)}")]
7660− ?^ t.found [%| (crip "duplicate module sources: {(spud at)}")]
11952+ ?~ found [%| [(crip "module source missing: {(spud at)}") ~]]
11953+ ?^ t.found [%| [(crip "duplicate module sources: {(spud at)}") ~]]
766111954 =/ cached=(unit ifile) (find-jibb-cache at cache)
7662− =/ iface=jfile-result
7663− ?^ cached [%& [u.cached cache]]
7664− (infer-jibb-file at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds cache prelude)
11955+ =/ iface=jfile-detailed-result
11956+ ?^ cached
11957+ ?. =(at.u.cached at) [%| ['cached module identity needs unsupported inference' ~]]
11958+ ?~ graph.u.cached
11959+ :: A detached legacy interface has unknown evidence. Rebuild it
11960+ :: against the current graph, without retaining any stale entry.
11961+ =/ clean=jcache (skim cache |=(x=[at=path iface=ifile] !=(at.x at)))
11962+ (infer-jibb-file-detailed at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds clean prelude)
11963+ ?. (request-graph-reusable u.cached source.i.found externals mark-externals modules active prelude-values prelude-molds prelude)
11964+ [%| ['cached module evidence needs unsupported inference' ~]]
11965+ [%& [u.cached cache]]
11966+ (infer-jibb-file-detailed at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds cache prelude)
766511967 ?: ?=(%| -.iface) [%| p.iface]
7666− =/ rest=jimports-result $(imports t.imports, cache cache.p.iface)
11968+ =/ rest=jimports-detailed-result $(imports t.imports, cache cache.p.iface)
766711969 ?: ?=(%| -.rest) rest
766811970 [%& [[[face.i.imports iface.p.iface] resolved.p.rest] cache.p.rest]]
766911971::
11972+:: Provisional declaration extraction only; this does not derive asks,
11973+:: validate imported types, or claim that an API module has checked.
11974++$ iapi-path [at=span name=term segments=(list pseg) full=term diffs=(list term) scry=(unit (list pseg))]
11975+++ api-path-mark
11976+ |= [sh=shape marks=(list term)]
11977+ ^- (unit term)
11978+ ?. ?=(%ref -.sh) ~
11979+ ?. ?=([@ ~] names.sh) ~
11980+ ?. (unique-value-name i.names.sh marks) ~
11981+ `i.names.sh
11982+::
11983+++ api-path-diffs
11984+ |= [shapes=(list shape) marks=(list term) used=(list term)]
11985+ ^- (unit (list term))
11986+ ?~ shapes `~
11987+ =/ n=(unit term) (api-path-mark i.shapes marks)
11988+ ?~ n ~
11989+ ?: (lien used |=(x=term =(x u.n))) ~
11990+ =/ rest=(unit (list term)) $(shapes t.shapes, used [u.n used])
11991+ ?~ rest ~
11992+ `[u.n u.rest]
11993+::
11994+++ api-path-payload
11995+ |= [sh=shape marks=(list term)]
11996+ ^- (unit [full=term diffs=(list term)])
11997+ =/ direct=(unit term) (api-path-mark sh marks)
11998+ ?^ direct `[u.direct ~]
11999+ ?. ?=(%apply -.sh) ~
12000+ ?. =(~[%facts] ref.sh) ~
12001+ ?~ args.sh ~
12002+ ?~ t.args.sh ~
12003+ =/ full=(unit term) (api-path-mark i.args.sh marks)
12004+ ?~ full ~
12005+ =/ diffs=(unit (list term)) (api-path-diffs t.args.sh marks ~[u.full])
12006+ ?~ diffs ~
12007+ `[u.full u.diffs]
12008+::
12009++$ iapi-parameter [name=term aura=@ta at=span]
12010+++ api-path-parameters
12011+ |= [segments=(list pseg) seen=(list term)]
12012+ ^- (unit (list iapi-parameter))
12013+ ?~ segments `~
12014+ ?: ?=(%knot -.i.segments) $(segments t.segments)
12015+ =/ seg=pseg i.segments
12016+ ?. ?=(%typed -.seg) ~
12017+ ?: =(0 aura.seg) ~
12018+ ?: (lien seen |=(n=term =(n name.seg))) ~
12019+ =/ rest=(unit (list iapi-parameter)) $(segments t.segments, seen [name.seg seen])
12020+ ?~ rest ~
12021+ `[[name.seg aura.seg at.seg] u.rest]
12022+::
12023+++ api-scry-parameters-compatible
12024+ |= [scry=(list iapi-parameter) watch=(list iapi-parameter)]
12025+ ^- ?
12026+ ?~ scry &
12027+ ?. (lien watch |=(p=iapi-parameter &(=(name.p name.i.scry) =(aura.p aura.i.scry)))) |
12028+ $(scry t.scry)
12029+::
12030+++ api-path-one
12031+ |= [sh=shape marks=(list term)]
12032+ ^- (unit iapi-path)
12033+ ?. ?=(%cell -.sh) ~
12034+ =/ fs=(list field) fields.sh
12035+ ?~ fs ~
12036+ ?~ t.fs ~
12037+ ?~ t.t.fs ~
12038+ ?: (gth (lent fs) 4) ~
12039+ ?. ?=(%bare -.i.fs) ~
12040+ =/ tag=shape shape.i.fs
12041+ ?. ?=(%const -.tag) ~
12042+ ?. =(%term form.lit.tag) ~
12043+ =/ name=term val.lit.tag
12044+ ?. (jibb-face-name name) ~
12045+ ?. ?=(%bare -.i.t.fs) ~
12046+ =/ path-shape=shape shape.i.t.fs
12047+ ?. ?=(%path -.path-shape) ~
12048+ ?. ?=(%bare -.i.t.t.fs) ~
12049+ =/ payload=(unit [full=term diffs=(list term)]) (api-path-payload shape.i.t.t.fs marks)
12050+ ?~ payload ~
12051+ =/ scry=(unit (unit (list pseg)))
12052+ ?~ t.t.t.fs `~
12053+ =/ entry=field i.t.t.t.fs
12054+ ?. ?=(%face -.entry) ~
12055+ ?. =(%scry name.entry) ~
12056+ ?. ?=(%path -.shape.entry) ~
12057+ ``segs.shape.entry
12058+ ?~ scry ~
12059+ =/ params=(unit (list iapi-parameter)) (api-path-parameters segs.path-shape ~)
12060+ ?~ params ~
12061+ ?^ u.scry
12062+ =/ scry-params=(unit (list iapi-parameter)) (api-path-parameters u.u.scry ~)
12063+ ?~ scry-params ~
12064+ ?. (api-scry-parameters-compatible u.scry-params u.params) ~
12065+ `[at.sh name segs.path-shape full.u.payload diffs.u.payload u.scry]
12066+ `[at.sh name segs.path-shape full.u.payload diffs.u.payload u.scry]
12067+::
12068+++ api-path-many
12069+ |= [shapes=(list shape) marks=(list term) seen=(list term)]
12070+ ^- (unit (list iapi-path))
12071+ ?~ shapes `~
12072+ =/ one=(unit iapi-path) (api-path-one i.shapes marks)
12073+ ?~ one ~
12074+ ?: (lien seen |=(n=term =(n name.u.one))) ~
12075+ =/ rest=(unit (list iapi-path)) $(shapes t.shapes, seen [name.u.one seen])
12076+ ?~ rest ~
12077+ `[u.one u.rest]
12078+::
12079+++ api-path-declaration
12080+ |= [sh=shape marks=(list term)]
12081+ ^- (unit (list iapi-path))
12082+ ?: ?=(%union -.sh) (api-path-many cases.sh marks ~)
12083+ (api-path-many ~[sh] marks ~)
12084+::
12085+:: Derived gates share the value namespace. /% marks name molds; /- and
12086+:: /= also introduce faces that cannot be shadowed by a derived value.
12087+++ api-import-faces
12088+ |= imports=(list import)
12089+ ^- (list term)
12090+ ?~ imports ~
12091+ ?- -.i.imports
12092+ %mark $(imports t.imports)
12093+ %sur [name.i.imports $(imports t.imports)]
12094+ %jibb [face.i.imports $(imports t.imports)]
12095+ ==
12096+::
12097+++ api-derived-names-valid
12098+ |= [paths=(list iapi-path) poke-names=(list term) mod=module prelude-values=(list term)]
12099+ ^- ?
12100+ =/ path-names=(list term) (turn paths |=(p=iapi-path name.p))
12101+ =/ derived=(list term) (weld path-names poke-names)
12102+ ?: (lien derived |=(n=term =(n %proj))) |
12103+ =/ outer=(list term) (weld prelude-values (weld (global-value-names defs.mod) (api-import-faces imports.mod)))
12104+ (levy derived |=(n=term &((unique-value-name n derived) !(lien outer |=(x=term =(n x))))))
12105+::
12106+:: Analysis only. Successful external entries must be unchanged results
12107+:: produced for the declared marks; no request interface is produced.
12108++$ iapi-mark-type [name=term typ=itype]
12109++$ iapi-path-typed [path=iapi-path full=itype diffs=(list iapi-mark-type)]
12110+++ api-diff-types
12111+ |= [names=(list term) externals=imark-externals declared=(list term)]
12112+ ^- (unit (list iapi-mark-type))
12113+ ?~ names `~
12114+ =/ typ=(unit itype) (find-imported-mark i.names externals declared)
12115+ ?~ typ ~
12116+ =/ tail=(unit (list iapi-mark-type)) $(names t.names)
12117+ ?~ tail ~
12118+ `[[i.names u.typ] u.tail]
12119+::
12120+++ api-path-types
12121+ |= [paths=(list iapi-path) externals=imark-externals declared=(list term)]
12122+ ^- (unit (list iapi-path-typed))
12123+ ?~ paths `~
12124+ =/ full=(unit itype) (find-imported-mark full.i.paths externals declared)
12125+ ?~ full ~
12126+ =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared)
12127+ ?~ diffs ~
12128+ =/ tail=(unit (list iapi-path-typed)) $(paths t.paths)
12129+ ?~ tail ~
12130+ `[[i.paths u.full u.diffs] u.tail]
12131+::
12132+++ api-poke-mark-names
12133+ |= [pokes=(list def) declared=(list term)]
12134+ ^- (unit (list term))
12135+ ?~ pokes `~
12136+ ?^ t.pokes ~
12137+ =/ d=def i.pokes
12138+ ?. ?=(%mold -.d) ~
12139+ =/ sh=shape shape.d
12140+ ?: ?=(%union -.sh) (api-path-diffs cases.sh declared ~)
12141+ =/ name=(unit term) (api-path-mark sh declared)
12142+ ?~ name ~
12143+ `~[u.name]
12144+::
12145+++ api-path-analysis
12146+ |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term)]
12147+ ^- (unit (list iapi-path-typed))
12148+ ?: (lien defs.mod def-has-hole) ~
12149+ ?^ (duplicate-defs defs.mod) ~
12150+ =/ ds=(list def) defs.mod
12151+ =/ declarations=(list def)
12152+ (skim ds |=(d=def &(?=(%mold -.d) =(%paths name.d))))
12153+ ?. ?=([* ~] declarations) ~
12154+ =/ pokes=(list def)
12155+ (skim ds |=(d=def &(?=(%mold -.d) =(%poke name.d))))
12156+ ?: (gth (lent pokes) 1) ~
12157+ =/ ordinary=(list def)
12158+ (skim ds |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12159+ ?. (module-scope-valid mod(defs ordinary) prelude-values prelude-molds) ~
12160+ =/ declared=(list term) (collect-mark-imports imports.mod)
12161+ =/ poke-names=(unit (list term)) (api-poke-mark-names pokes declared)
12162+ ?~ poke-names ~
12163+ =/ decl=def i.declarations
12164+ ?> ?=(%mold -.decl)
12165+ =/ paths=(unit (list iapi-path)) (api-path-declaration shape.decl declared)
12166+ ?~ paths ~
12167+ =/ derived-pokes=(list term) ?~(pokes ~ ~[%poke])
12168+ ?. (api-derived-names-valid u.paths derived-pokes mod prelude-values) ~
12169+ (api-path-types u.paths externals declared)
12170+::
12171+:: Source/graph entry for path analysis only. The returned paths retain
12172+:: reader-derived mark types and import resolution has checked reachable
12173+:: Jibb dependencies. This is not an API interface or a module check.
12174+++ api-path-analysis-source
12175+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12176+ ^- (each (list iapi-path-typed) @t)
12177+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path analysis requires /ui/api/<agent>.jibb']
12178+ =/ parsed (parse file src)
12179+ ?: ?=(%| -.parsed) [%| 'API path source does not parse']
12180+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12181+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
12182+ ?~ prepared [%| 'API path analysis needs the prepared prelude']
12183+ =/ prelude=(unit ifile) `iface.u.prepared
12184+ =/ deps=jimports-result
12185+ (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ prelude)
12186+ ?: ?=(%| -.deps) [%| p.deps]
12187+ =/ paths=(unit (list iapi-path-typed))
12188+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12189+ ?~ paths [%| 'API path declaration needs unsupported analysis']
12190+ [%& u.paths]
12191+::
12192+:: Analysis evidence retains the API source, the prepared interface, the
12193+:: caller's reader results and the resolved Jibb dependency cache alongside
12194+:: the typed path declarations. Reader results and prepared interfaces are
12195+:: trusted inputs: this does not verify their underlying Hoon source/version,
12196+:: create requests or check the provenance of arbitrary values.
12197++$ iapi-path-evidence
12198+ [at=path source=@t prepared=iprelude externals=iexternals marks=imark-externals dependencies=jcache paths=(list iapi-path-typed)]
12199+++ api-path-evidence-source
12200+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12201+ ^- (each iapi-path-evidence @t)
12202+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path evidence requires /ui/api/<agent>.jibb']
12203+ =/ parsed (parse file src)
12204+ ?: ?=(%| -.parsed) [%| 'API path evidence source does not parse']
12205+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12206+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
12207+ ?~ prepared [%| 'API path evidence needs the prepared prelude']
12208+ =/ public=ifile iface.u.prepared
12209+ =/ deps=jimports-result
12210+ (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
12211+ ?: ?=(%| -.deps) [%| p.deps]
12212+ =/ paths=(unit (list iapi-path-typed))
12213+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12214+ ?~ paths [%| 'API path declaration needs unsupported analysis']
12215+ [%& [file src u.prepared externals marks cache.p.deps u.paths]]
12216+:: Graph-aware variant preserves the caller active stack and cache.
12217+++ api-path-evidence-graph
12218+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12219+ ^- (each iapi-path-evidence @t)
12220+ ?~ active [%| 'API analysis needs an active graph']
12221+ ?. =(i.active file) [%| 'API analysis active graph does not start at the source']
12222+ ?: (lien t.active |=(p=path =(p file))) [%| 'API analysis active graph contains a cycle']
12223+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path evidence requires /ui/api/<agent>.jibb']
12224+ =/ parsed (parse file src)
12225+ ?: ?=(%| -.parsed) [%| 'API path evidence source does not parse']
12226+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12227+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
12228+ ?~ prepared [%| 'API path evidence needs the prepared prelude']
12229+ =/ public=ifile iface.u.prepared
12230+ =/ deps=jimports-result
12231+ (resolve-jibb-imports imports.p.parsed externals marks modules active values.u.prepared molds.u.prepared cache `public)
12232+ ?: ?=(%| -.deps) [%| p.deps]
12233+ =/ paths=(unit (list iapi-path-typed))
12234+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12235+ ?~ paths [%| 'API path declaration needs unsupported analysis']
12236+ [%& [file src u.prepared externals marks cache.p.deps u.paths]]
12237+::
12238+:: This query classifies a unique path declaration only. Missing evidence
12239+:: or a nonunique name is unknown; it proves nothing about an ask value.
12240+:: Like prepared interfaces, the supplied evidence is a trusted host input.
12241+++ api-path-watchability
12242+ |= [evidence=(unit iapi-path-evidence) case-name=term]
12243+ ^- ?(%watchable %not-watchable %unknown)
12244+ ?~ evidence %unknown
12245+ =/ found=(list iapi-path-typed)
12246+ (skim paths.u.evidence |=(p=iapi-path-typed =(name.path.p case-name)))
12247+ ?. ?=([* ~] found) %unknown
12248+ ?~ scry.path.i.found %watchable
12249+ %not-watchable
12250+::
12251+:: These are declaration-derived request components, not a callable gate,
12252+:: an ask value, or proof of a value's provenance. Keep the exact trusted
12253+:: source/reader evidence until a later checked interface and lowerer can
12254+:: attach it to a generated request. No argument ordering is claimed here.
12255++$ iapi-request-parameter [name=term typ=itype at=span]
12256++$ iapi-request-parts
12257+ [evidence=iapi-path-evidence path=iapi-path-typed parameters=(list iapi-request-parameter) reply-sample=itype fold=(unit itype) watchability=?(%watchable %not-watchable)]
12258+++ api-request-parameter-types
12259+ |= params=(list iapi-parameter)
12260+ ^- (unit (list iapi-request-parameter))
12261+ ?~ params `~
12262+ =/ aura=@ta aura.i.params
12263+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
12264+ =/ rest=(unit (list iapi-request-parameter)) $(params t.params)
12265+ ?~ rest ~
12266+ `[[name.i.params [%atom aura] at.i.params] u.rest]
12267+::
12268+:: A single diff's fold consumes the tagged diff and the previous full value.
12269+:: Multiple-diff unions need a checked union representation and remain open.
12270+++ api-request-fold-type
12271+ |= p=iapi-path-typed
12272+ ^- (unit (unit itype))
12273+ ?~ diffs.p `~
12274+ ?^ t.diffs.p ~
12275+ =/ d=iapi-mark-type i.diffs.p
12276+ =/ literal=lit [%term %tas name.d (crip ['%' (trip name.d)])]
12277+ =/ sample=itype [%cell [%cell [%const literal] typ.d] full.p]
12278+ ``[%fn sample full.p]
12279+::
12280+++ api-request-parts
12281+ |= [evidence=(unit iapi-path-evidence) case-name=term]
12282+ ^- (unit iapi-request-parts)
12283+ ?~ evidence ~
12284+ =/ found=(list iapi-path-typed)
12285+ (skim paths.u.evidence |=(p=iapi-path-typed =(name.path.p case-name)))
12286+ ?. ?=([* ~] found) ~
12287+ =/ p=iapi-path-typed i.found
12288+ =/ raw=(unit (list iapi-parameter)) (api-path-parameters segments.path.p ~)
12289+ ?~ raw ~
12290+ =/ params=(unit (list iapi-request-parameter)) (api-request-parameter-types u.raw)
12291+ ?~ params ~
12292+ =/ fold=(unit (unit itype)) (api-request-fold-type p)
12293+ ?~ fold ~
12294+ =/ watch=?(%watchable %not-watchable) ?~(scry.path.p %watchable %not-watchable)
12295+ `[u.evidence p u.params full.p u.fold watch]
12296+::
12297+:: Check ordinary API molds and values plus every declared mark type using
12298+:: the same trusted source, prepared prelude and reader inputs as path
12299+:: evidence. Keep elaborations with those inputs for a later interface.
12300+:: This is partial analysis: an unused /- core is not independently checked,
12301+:: definitions needing derived values remain unsupported, and no complete
12302+:: API, request or constructor is exported or given runtime behavior.
12303++$ iapi-support-evidence
12304+ [paths=iapi-path-evidence values=ienv molds=imold-types marks=(list iapi-mark-type) elaborations=(list iwidth-definition)]
12305+++ api-support-analysis-source
12306+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12307+ ^- (each iapi-support-evidence @t)
12308+ =/ path-result (api-path-evidence-source file src externals marks modules prepared)
12309+ ?: ?=(%| -.path-result) [%| p.path-result]
12310+ =/ evidence=iapi-path-evidence p.path-result
12311+ =/ parsed (parse file src)
12312+ ?: ?=(%| -.parsed) [%| 'API source does not parse']
12313+ =/ mod=module p.parsed
12314+ =/ ordinary=(list def)
12315+ (skim defs.mod |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12316+ =/ prep=iprelude prepared.evidence
12317+ ?. (module-scope-valid mod(defs ordinary) values.prep molds.prep) [%| 'API ordinary scope needs unsupported inference']
12318+ =/ vals=(list term) (global-value-names ordinary)
12319+ ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12320+ =/ declared=(list term) (collect-mark-imports imports.mod)
12321+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12322+ ?~ mark-types [%| 'API declared marks need unsupported inference']
12323+ =/ prelude=(unit ifile) `iface.prep
12324+ =/ deps=jimports-result
12325+ (resolve-jibb-imports imports.mod externals marks modules ~[file] values.prep molds.prep dependencies.evidence prelude)
12326+ ?: ?=(%| -.deps) [%| p.deps]
12327+ =/ molds=imolds (collect-simple-molds ordinary)
12328+ =/ globals=(list term) (weld values.prep (weld (import-binding-names imports.mod) vals))
12329+ =/ surs=(list term) (collect-sur-imports imports.mod)
12330+ =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
12331+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12332+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12333+ =/ mts=(each imold-types @t) (module-mold-types molds state)
12334+ ?: ?=(%| -.mts) [%| p.mts]
12335+ =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
12336+ ?. (module-values-complete ordinary env.resolution) [%| 'API ordinary definitions need unsupported inference']
12337+ [%& [evidence env.resolution p.mts u.mark-types artifacts.resolution]]
12338+:: Preserve the same graph context through supporting definitions.
12339+++ api-support-analysis-graph
12340+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12341+ ^- (each iapi-support-evidence @t)
12342+ =/ path-result (api-path-evidence-graph file src externals marks modules active cache prepared)
12343+ ?: ?=(%| -.path-result) [%| p.path-result]
12344+ =/ evidence=iapi-path-evidence p.path-result
12345+ =/ parsed (parse file src)
12346+ ?: ?=(%| -.parsed) [%| 'API source does not parse']
12347+ =/ mod=module p.parsed
12348+ =/ ordinary=(list def)
12349+ (skim defs.mod |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12350+ =/ prep=iprelude prepared.evidence
12351+ ?. (module-scope-valid mod(defs ordinary) values.prep molds.prep) [%| 'API ordinary scope needs unsupported inference']
12352+ =/ vals=(list term) (global-value-names ordinary)
12353+ ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12354+ =/ declared=(list term) (collect-mark-imports imports.mod)
12355+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12356+ ?~ mark-types [%| 'API declared marks need unsupported inference']
12357+ =/ prelude=(unit ifile) `iface.prep
12358+ =/ deps=jimports-result
12359+ (resolve-jibb-imports imports.mod externals marks modules active values.prep molds.prep dependencies.evidence prelude)
12360+ ?: ?=(%| -.deps) [%| p.deps]
12361+ =/ molds=imolds (collect-simple-molds ordinary)
12362+ =/ globals=(list term) (weld values.prep (weld (import-binding-names imports.mod) vals))
12363+ =/ surs=(list term) (collect-sur-imports imports.mod)
12364+ =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
12365+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12366+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12367+ =/ mts=(each imold-types @t) (module-mold-types molds state)
12368+ ?: ?=(%| -.mts) [%| p.mts]
12369+ =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
12370+ ?. (module-values-complete ordinary env.resolution) [%| 'API ordinary definitions need unsupported inference']
12371+ [%& [evidence env.resolution p.mts u.mark-types artifacts.resolution]]
12372+::
12373+:: Type-analysis artifact for one plain request. The resolver may publish
12374+:: its interface only together with trusted source and reader evidence.
12375+:: No lowering or runtime validator exists.
12376+:: Value watchability remains unproved even for a watchable declaration.
12377++$ ione-request-interface
12378+ [support=iapi-support-evidence parts=iapi-request-parts iface=ifile]
12379+++ compatible-raw-poke
12380+ |= prelude=iprelude
12381+ ^- (unit ischeme)
12382+ =/ public=ifile iface.prelude
12383+ ?. =(at.public /lib/jibb/prelude/jibb) ~
12384+ =/ poke=(unit ischeme) (find-jibb-mold %raw-poke public)
12385+ ?~ poke ~
12386+ ?^ vars.u.poke ~
12387+ ?. ?=(%union -.typ.u.poke) ~
12388+ ?^ args.typ.u.poke ~
12389+ ?. =(origin.typ.u.poke `[/lib/jibb/internal/jibb %raw-poke]) ~
12390+ ?: (itype-has-tag typ.u.poke) ~
12391+ =/ private=(list iwidth-dependency)
12392+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12393+ ?. ?=([* ~] private) ~
12394+ ?~ source.i.private ~
12395+ =/ agent-case=itype
12396+ [%cell [%const [%term %tas %agent '%agent']] [%cell [%face %agent [%atom %tas]] [%cell [%face %mark [%atom %tas]] [%face %payload [%noun ~]]]]]
12397+ =/ store-case=itype
12398+ [%cell [%const [%term %tas %store '%store']] [%cell [%face %module [%atom %t]] [%cell [%face %action [%atom %tas]] [%face %payload [%noun ~]]]]]
12399+ ?. =(cases.typ.u.poke ~[agent-case store-case]) ~
12400+ poke
12401+::
12402+++ request-compatible-ask
12403+ |= prelude=iprelude
12404+ ^- (unit ischeme)
12405+ =/ public=ifile iface.prelude
12406+ ?. =(at.public /lib/jibb/prelude/jibb) ~
12407+ =/ ask=(unit ischeme) (find-jibb-mold %ask public)
12408+ ?~ ask ~
12409+ ?. ?=([@ ~] vars.u.ask) ~
12410+ ?. ?=(%union -.typ.u.ask) ~
12411+ ?. =(origin.typ.u.ask `[/lib/jibb/internal/jibb %ask]) ~
12412+ ?. (identity-union-parameters vars.u.ask args.typ.u.ask) ~
12413+ =/ m=@ud i.vars.u.ask
12414+ ?: (itype-var-is-atom m typ.u.ask) ~
12415+ ?. (levy (itype-vars typ.u.ask) |=(n=@ud =(n m))) ~
12416+ ?: (itype-has-tag typ.u.ask) ~
12417+ =/ private=(list iwidth-dependency)
12418+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12419+ ?. ?=([* ~] private) ~
12420+ ?~ source.i.private ~
12421+ =/ path=(unit ischeme) (find-jibb-mold %path public)
12422+ ?~ path ~
12423+ ?^ vars.u.path ~
12424+ =/ path-type=itype [%collection %list ~[[%atom %ta]]]
12425+ ?. =(typ.u.path path-type) ~
12426+ =/ unit-template=(unit ischeme) (find-jibb-mold %unit public)
12427+ ?~ unit-template ~
12428+ ?. (standard-unit-template u.unit-template /lib/jibb/prelude/jibb) ~
12429+ =/ state-unit=(unit itype) (template-apply u.unit-template ~[[%noun ~]])
12430+ ?~ state-unit ~
12431+ =/ path-unit=(unit itype) (template-apply u.unit-template ~[path-type])
12432+ ?~ path-unit ~
12433+ =/ output=itype [%cell [%face %state [%noun ~]] [%face %message [%var m]]]
12434+ =/ agent-input=itype [%cell [%face %mark [%atom %tas]] [%cell [%face %state u.state-unit] [%face %fact [%noun ~]]]]
12435+ =/ store-input=itype [%cell [%face %state u.state-unit] [%face %fact [%noun ~]]]
12436+ =/ pure-case=itype [%cell [%const [%term %tas %pure '%pure']] [%face %value [%var m]]]
12437+ =/ agent-case=itype
12438+ [%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]]]]]]]]
12439+ =/ store-case=itype
12440+ [%cell [%const [%term %tas %store '%store']] [%cell [%face %module [%atom %t]] [%cell [%face %name [%atom %tas]] [%face %receive [%fn store-input output]]]]]
12441+ ?. =(cases.typ.u.ask ~[pure-case agent-case store-case]) ~
12442+ ask
12443+::
12444+:: The first supported standalone API has exactly one mark import and one
12445+:: plain path declaration, with no other definitions or imports. No partial
12446+:: success is published when source, schema, or a required mold is unknown.
12447+++ one-request-interface-source
12448+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12449+ ^- (each ione-request-interface @t)
12450+ =/ out (api-support-analysis-source file src externals marks modules prepared)
12451+ ?: ?=(%| -.out) [%| p.out]
12452+ =/ support=iapi-support-evidence p.out
12453+ =/ ev=iapi-path-evidence paths.support
12454+ =/ parsed (parse file src)
12455+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12456+ =/ mod=module p.parsed
12457+ ?. ?=(?([[%mark *] ~] [[%mark *] [%mark *] ~]) imports.mod) [%| 'request imports need unsupported inference']
12458+ ?. ?=([[%mold *] ~] defs.mod) [%| 'request definitions need unsupported inference']
12459+ ?. =(%paths name.i.defs.mod) [%| 'request declaration needs unsupported inference']
12460+ ?. ?=([* ~] paths.ev) [%| 'request count needs unsupported inference']
12461+ =/ p=iapi-path-typed i.paths.ev
12462+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12463+ ?~ parts [%| 'request components need unsupported inference']
12464+ ?. ?=(?(~ [* ~]) parameters.u.parts) [%| 'request parameters need unsupported inference']
12465+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) [%| 'request parameter and fold need unsupported inference']
12466+ ?^ scry.path.p [%| 'request scry needs unsupported inference']
12467+ =/ valid-marks=?
12468+ ?~ fold.u.parts ?=([* ~] marks.support)
12469+ ?=([* [* ~]] marks.support)
12470+ ?. valid-marks [%| 'request marks need unsupported inference']
12471+ =/ fold-open=?
12472+ ?~ fold.u.parts |
12473+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12474+ ?: fold-open [%| 'request fold needs unsupported inference']
12475+ ?^ (itype-vars reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12476+ ?: (itype-has-tag reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12477+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12478+ ?~ ask [%| 'request ask needs unsupported inference']
12479+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
12480+ ?~ result [%| 'request ask needs unsupported inference']
12481+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12482+ =/ sample=itype
12483+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12484+ ?~ parameters.u.parts callback
12485+ [%cell typ.i.parameters.u.parts callback]
12486+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12487+ =/ exports=imold-types
12488+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12489+ =/ prelude=iprelude prepared.ev
12490+ =/ public=ifile iface.prelude
12491+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12492+ =/ private=(list iwidth-dependency)
12493+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12494+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12495+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12496+ =/ req=irequest-evidence
12497+ [file name.path.p p src u.source.public u.source.i.private values.prelude molds.prelude externals marks]
12498+ =/ interface=ifile [~[[name.path.p scheme]] exports file ~ ~ ~ `src `[(silt `(list path)`~[file]) ~[req] ~ modules `public values.prelude molds.prelude externals marks]]
12499+ [%& [support u.parts interface]]
12500+:: Graph-aware request artifact; resolver use remains type-only.
12501+++ one-request-interface-graph
12502+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12503+ ^- (each ione-request-interface @t)
12504+ =/ out (api-support-analysis-graph file src externals marks modules active cache prepared)
12505+ ?: ?=(%| -.out) [%| p.out]
12506+ =/ support=iapi-support-evidence p.out
12507+ =/ ev=iapi-path-evidence paths.support
12508+ =/ parsed (parse file src)
12509+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12510+ =/ mod=module p.parsed
12511+ ?. ?=(?([[%mark *] ~] [[%mark *] [%mark *] ~]) imports.mod) [%| 'request imports need unsupported inference']
12512+ ?. ?=([[%mold *] ~] defs.mod) [%| 'request definitions need unsupported inference']
12513+ ?. =(%paths name.i.defs.mod) [%| 'request declaration needs unsupported inference']
12514+ ?. ?=([* ~] paths.ev) [%| 'request count needs unsupported inference']
12515+ =/ p=iapi-path-typed i.paths.ev
12516+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12517+ ?~ parts [%| 'request components need unsupported inference']
12518+ ?. ?=(?(~ [* ~]) parameters.u.parts) [%| 'request parameters need unsupported inference']
12519+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) [%| 'request parameter and fold need unsupported inference']
12520+ ?^ scry.path.p [%| 'request scry needs unsupported inference']
12521+ =/ valid-marks=?
12522+ ?~ fold.u.parts ?=([* ~] marks.support)
12523+ ?=([* [* ~]] marks.support)
12524+ ?. valid-marks [%| 'request marks need unsupported inference']
12525+ =/ fold-open=?
12526+ ?~ fold.u.parts |
12527+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12528+ ?: fold-open [%| 'request fold needs unsupported inference']
12529+ ?^ (itype-vars reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12530+ ?: (itype-has-tag reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12531+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12532+ ?~ ask [%| 'request ask needs unsupported inference']
12533+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
12534+ ?~ result [%| 'request ask needs unsupported inference']
12535+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12536+ =/ sample=itype
12537+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12538+ ?~ parameters.u.parts callback
12539+ [%cell typ.i.parameters.u.parts callback]
12540+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12541+ =/ exports=imold-types
12542+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12543+ =/ prelude=iprelude prepared.ev
12544+ =/ public=ifile iface.prelude
12545+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12546+ =/ private=(list iwidth-dependency)
12547+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12548+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12549+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12550+ =/ req=irequest-evidence
12551+ [file name.path.p p src u.source.public u.source.i.private values.prelude molds.prelude externals marks]
12552+ =/ interface=ifile [~[[name.path.p scheme]] exports file ~ ~ ~ `src `[(silt `(list path)`~[file]) ~[req] ~ modules `public values.prelude molds.prelude externals marks]]
12553+ [%& [support u.parts interface]]
12554+::
12555+++ api-mark-exports
12556+ |= [marks=(list term) all=(list term) externals=imark-externals]
12557+ ^- imold-types
12558+ ?~ marks ~
12559+ =/ t=(unit itype) (find-imported-mark i.marks externals all)
12560+ ?~ t $(marks t.marks)
12561+ [[i.marks [u.t ~]] $(marks t.marks)]
12562+::
12563+:: Experimental direct poke-only API. Unsupported API declarations fail
12564+:: as a whole; supplied mark reader results retain their existing boundary.
12565+++ api-poke-interface
12566+ |= [at=path mod=module mark-externals=imark-externals prelude-values=(list term) prelude-molds=(list term) prelude=(unit ifile)]
12567+ ^- (unit ifile)
12568+ ?: (lien defs.mod def-has-hole) ~
12569+ ?. ?=([%ui %api @ %jibb ~] at) ~
12570+ ?^ (duplicate-defs defs.mod) ~
12571+ ?~ prelude ~
12572+ ?. =(at.u.prelude /lib/jibb/prelude/jibb) ~
12573+ =/ poke=(unit ischeme) (find-jibb-mold %raw-poke u.prelude)
12574+ ?~ poke ~
12575+ ?. ?=(%union -.typ.u.poke) ~
12576+ ?^ vars.u.poke ~
12577+ =/ compatible=?
12578+ %+ lien cases.typ.u.poke
12579+ |= c=itype
12580+ ?=([%cell [%const [%term %tas %agent *]] [%cell [%face %agent [%atom %tas]] [%cell [%face %mark [%atom %tas]] [%face %payload [%noun ~]]]]] c)
12581+ ?. compatible ~
12582+ ?. (module-scope-valid mod(defs ~) prelude-values prelude-molds) ~
12583+ ?. (levy imports.mod |=(i=import ?=(%mark -.i))) ~
12584+ =/ marks=(list term) (collect-mark-imports imports.mod)
12585+ ?. ?=([@ ~] marks) ~
12586+ =/ ds=(list def) defs.mod
12587+ ?. ?=([[%mold *] ~] ds) ~
12588+ ?. =(%poke name.i.ds) ~
12589+ =/ sh=shape shape.i.ds
12590+ ?. ?=([%ref *] sh) ~
12591+ ?. ?=([@ ~] names.sh) ~
12592+ =/ n=term i.names.sh
12593+ ?. (unique-value-name n marks) ~
12594+ ?: |((lien prelude-values |=(x=term =(n x))) (lien prelude-molds |=(x=term =(n x)))) ~
12595+ =/ mark=(unit itype) (find-imported-mark n mark-externals marks)
12596+ ?~ mark ~
12597+ =/ sc=(unit ischeme) (derived-poke-command-scheme u.prelude u.mark)
12598+ ?~ sc ~
12599+ `[~[[%poke u.sc]] (api-mark-exports marks marks mark-externals) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
12600+::
12601+:: Source-proven ordinary helpers validate each selected /sur dependency.
12602+:: Unused or less direct cores remain unsupported by this first interface.
12603+++ api-sur-covered
12604+ |= [surs=(list term) defs=(list def) externals=iexternals all=(list term)]
12605+ ^- ?
12606+ ?~ surs &
12607+ =/ found=(list def)
12608+ %+ skim defs
12609+ |= d=def
12610+ ?. ?=(%mold -.d) |
12611+ ?. ?=(%ref -.shape.d) |
12612+ ?. ?=([@ [@ ~]] names.shape.d) |
12613+ =(i.t.names.shape.d i.surs)
12614+ ?~ found |
12615+ =/ selected=def i.found
12616+ ?. ?=(%mold -.selected) |
12617+ =/ sh=shape shape.selected
12618+ ?. ?=(%ref -.sh) |
12619+ ?. ?=([@ [@ ~]] names.sh) |
12620+ =/ checked=(unit itype) (find-imported-mold i.surs i.names.sh externals all)
12621+ ?~ checked |
12622+ $(surs t.surs)
12623+::
12624++$ imulti-request-gates [values=ienv requests=(list irequest-evidence)]
12625+++ api-request-gates
12626+ |= [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]
12627+ ^- (unit imulti-request-gates)
12628+ ?~ paths `[~ ~]
12629+ ?: =(0 fuel) ~
12630+ =/ p=iapi-path-typed i.paths
12631+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12632+ ?~ parts ~
12633+ ?. ?=(?(~ [* ~]) parameters.u.parts) ~
12634+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) ~
12635+ ?^ scry.path.p ~
12636+ ?^ (itype-vars reply-sample.u.parts) ~
12637+ ?: (itype-has-tag reply-sample.u.parts) ~
12638+ =/ open-fold=?
12639+ ?~ fold.u.parts |
12640+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12641+ ?: open-fold ~
12642+ =/ result=(unit itype) (template-apply ask ~[[%var 0]])
12643+ ?~ result ~
12644+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12645+ =/ sample=itype
12646+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12647+ ?~ parameters.u.parts callback
12648+ [%cell typ.i.parameters.u.parts callback]
12649+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12650+ =/ prep=iprelude prepared.ev
12651+ =/ req=irequest-evidence
12652+ [file name.path.p p src public internal values.prep molds.prep externals marks]
12653+ =/ rest=(unit imulti-request-gates)
12654+ $(paths t.paths, fuel (dec fuel))
12655+ ?~ rest ~
12656+ `[[[name.path.p scheme] values.u.rest] [req requests.u.rest]]
12657+::
12658+++ api-poke-from-checked
12659+ |= [file=path mod=module marks=imark-externals values=(list term) molds=(list term) prelude=(unit ifile)]
12660+ ^- (unit [values=ienv derived=(list iderived)])
12661+ =/ pokes=(list def)
12662+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(%poke name.d))))
12663+ ?~ pokes `[~ ~]
12664+ ?. ?=([* ~] pokes) ~
12665+ =/ declared=(list term) (collect-mark-imports imports.mod)
12666+ =/ ns=(unit (list term)) (api-poke-mark-names pokes declared)
12667+ ?~ ns ~
12668+ ?. ?=([@ ~] u.ns) ~
12669+ =/ matching=(list import)
12670+ %+ skim imports.mod
12671+ |= i=import
12672+ ?. ?=(%mark -.i) |
12673+ =(mark.i i.u.ns)
12674+ ?. ?=([* ~] matching) ~
12675+ =/ checked=(unit ifile)
12676+ (api-poke-interface file mod(defs pokes, imports matching) marks values molds prelude)
12677+ ?~ checked ~
12678+ `[values.u.checked derived.u.checked]
12679+::
12680+:: The partial interface is published atomically: all paths, ordinary
12681+:: source definitions, declared marks and the poke must check. Unselected
12682+:: /sur bindings, runtime validation and value watchability remain unproved.
12683+++ multi-request-interface-graph
12684+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12685+ ^- (each [iface=ifile cache=jcache] @t)
12686+ =/ out (api-support-analysis-graph file src externals marks modules active cache prepared)
12687+ ?: ?=(%| -.out) [%| p.out]
12688+ =/ support=iapi-support-evidence p.out
12689+ =/ ev=iapi-path-evidence paths.support
12690+ =/ parsed (parse file src)
12691+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12692+ =/ mod=module p.parsed
12693+ ?. (levy imports.mod |=(i=import ?=(?(%mark %sur) -.i)))
12694+ [%| 'request imports need unsupported inference']
12695+ =/ surs=(list term) (collect-sur-imports imports.mod)
12696+ ?. (api-sur-covered surs defs.mod externals surs)
12697+ [%| 'API source dependency needs unsupported inference']
12698+ ?~ paths.ev [%| 'request count needs unsupported inference']
12699+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12700+ ?~ ask [%| 'request ask needs unsupported inference']
12701+ =/ prep=iprelude prepared.ev
12702+ =/ public=ifile iface.prep
12703+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12704+ =/ private=(list iwidth-dependency)
12705+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12706+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12707+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12708+ =/ gates=(unit imulti-request-gates)
12709+ (api-request-gates paths.ev ev u.ask file src u.source.public u.source.i.private externals marks 256)
12710+ ?~ gates [%| 'request paths need unsupported inference']
12711+ =/ poke=(unit [values=ienv derived=(list iderived)])
12712+ (api-poke-from-checked file mod marks values.prep molds.prep `public)
12713+ ?~ poke [%| 'API poke needs unsupported inference']
12714+ =/ mark-molds=imold-types
12715+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12716+ =/ exports=imold-types (weld mark-molds molds.support)
12717+ =/ names=(list term) (turn exports |=(m=[name=term template=ischeme] name.m))
12718+ ?. (levy names |=(n=term (unique-value-name n names)))
12719+ [%| 'API exported molds need unsupported inference']
12720+ =/ env=ienv (weld values.u.gates (weld values.u.poke values.support))
12721+ =/ graph=irequest-graph
12722+ [(silt `(list path)`~[file]) requests.u.gates ~ modules `public values.prep molds.prep externals marks]
12723+ =/ iface=ifile
12724+ [env exports file derived.u.poke elaborations.support ~ `src `graph]
12725+ [%& [iface dependencies.ev]]
12726+::
12727+:: A checked program main is only the direct four-component source call.
12728+:: Grouping is transparent, but aliases, qualified wings and other module
12729+:: kinds remain outside this slice.
12730+++ program-main-def
12731+ |= ds=(list def)
12732+ ^- (unit def)
12733+ ?~ ds ~
12734+ ?: &(?=(%value -.i.ds) =(%main name.i.ds)) `i.ds
12735+ $(ds t.ds)
12736+::
12737+++ program-main-wing
12738+ |= e=expr
12739+ ^- (unit term)
12740+ ?: ?=(%group -.e) $(e inner.e)
12741+ ?. ?=(%wing -.e) ~
12742+ ?. ?=([@ ~] names.e) ~
12743+ `i.names.e
12744+::
12745+++ program-main-args
12746+ |= d=def
12747+ ^- (unit (list expr))
12748+ ?. ?=(%value -.d) ~
12749+ |-
12750+ ?: ?=(%group -.val.d) $(val.d inner.val.d)
12751+ ?. ?=(%call -.val.d) ~
12752+ =/ head=(unit term) (program-main-wing head.val.d)
12753+ ?~ head ~
12754+ ?. =(%program u.head) ~
12755+ ?. ?=([* * * * ~] args.val.d) ~
12756+ `args.val.d
12757+::
12758+++ program-main-parts
12759+ |= d=def
12760+ ^- (unit [init=term update=term view=term subs=term])
12761+ ?. ?=(%value -.d) ~
12762+ |-
12763+ ?: ?=(%group -.val.d) $(val.d inner.val.d)
12764+ ?. ?=(%call -.val.d) ~
12765+ =/ head=(unit term) (program-main-wing head.val.d)
12766+ ?~ head ~
12767+ ?. =(%program u.head) ~
12768+ ?. ?=([* * * * ~] args.val.d) ~
12769+ =/ args=(list expr) args.val.d
12770+ ?> ?=([* * * * ~] args)
12771+ =/ init=(unit term) (program-main-wing i.args)
12772+ =/ update=(unit term) (program-main-wing i.t.args)
12773+ =/ view=(unit term) (program-main-wing i.t.t.args)
12774+ =/ subs=(unit term) (program-main-wing i.t.t.t.args)
12775+ ?~ init ~
12776+ ?~ update ~
12777+ ?~ view ~
12778+ ?~ subs ~
12779+ `[u.init u.update u.view u.subs]
12780+::
12781+:: A data page is only the direct two-component source call. Grouping is
12782+:: transparent, but page aliases, qualified wings and other kinds are not.
12783+++ page-main-parts
12784+ |= d=def
12785+ ^- (unit [load=term view=term])
12786+ ?. ?=(%value -.d) ~
12787+ |-
12788+ ?: ?=(%group -.val.d) $(val.d inner.val.d)
12789+ ?. ?=(%call -.val.d) ~
12790+ =/ head=(unit term) (program-main-wing head.val.d)
12791+ ?~ head ~
12792+ ?. =(%page u.head) ~
12793+ ?. ?=([* * ~] args.val.d) ~
12794+ =/ args=(list expr) args.val.d
12795+ ?> ?=([* * ~] args)
12796+ =/ load=(unit term) (program-main-wing i.args)
12797+ =/ view=(unit term) (program-main-wing i.t.args)
12798+ ?~ load ~
12799+ ?~ view ~
12800+ `[u.load u.view]
12801+::
12802+:: A store main is only the direct two-wing source call. Its local poke mold
12803+:: is checked here and remains in ordinary mold/value inference.
12804+++ store-main-parts
12805+ |= d=def
12806+ ^- (unit [init=term update=term])
12807+ ?. ?=(%value -.d) ~
12808+ |-
12809+ ?: ?=(%group -.val.d) $(val.d inner.val.d)
12810+ ?. ?=(%call -.val.d) ~
12811+ =/ head=(unit term) (program-main-wing head.val.d)
12812+ ?~ head ~
12813+ ?. =(%store u.head) ~
12814+ ?. ?=([* * ~] args.val.d) ~
12815+ =/ args=(list expr) args.val.d
12816+ ?> ?=([* * ~] args)
12817+ =/ init=(unit term) (program-main-wing i.args)
12818+ =/ update=(unit term) (program-main-wing i.t.args)
12819+ ?~ init ~
12820+ ?~ update ~
12821+ `[u.init u.update]
12822+::
12823++$ istore-declaration [action=term defs=(list def)]
12824+++ store-declaration
12825+ |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
12826+ ^- (unit istore-declaration)
12827+ =/ ds=(list def) defs.mod
12828+ =/ pokes=(list def)
12829+ (skim ds |=(d=def &(?=(%mold -.d) =(%poke name.d))))
12830+ ?. ?=([* ~] pokes) ~
12831+ =/ states=(list def)
12832+ (skim ds |=(d=def &(?=(%mold -.d) =(%state name.d))))
12833+ ?. ?=([* ~] states) ~
12834+ =/ poke=def i.pokes
12835+ =/ state=def i.states
12836+ ?> &(?=(%mold -.poke) ?=(%mold -.state))
12837+ ?: ?=(%generic -.shape.state) ~
12838+ ?: ?=(%generic -.shape.poke) ~
12839+ =/ action=term %poke
12840+ =/ ordinary=(list def) ds
12841+ ?. (module-scope-valid mod prelude-values prelude-molds) ~
12842+ =/ derived=(list term) ~[%state action]
12843+ ?: (lien derived |=(n=term =(n %proj))) ~
12844+ =/ outer=(list term)
12845+ (weld prelude-values (weld (global-value-names ordinary) (api-import-faces imports.mod)))
12846+ ?. (levy derived |=(n=term &((unique-value-name n derived) !(lien outer |=(x=term =(n x)))))) ~
12847+ `[action ordinary]
12848+::
12849+++ program-empty-null
12850+ |= e=expr
12851+ ^- ?
12852+ ?- -.e
12853+ %lit =(%null form.lit.e)
12854+ %cast $(e val.e)
12855+ %group $(e inner.e)
12856+ %body ?~(defs.e $(e final.e) |)
12857+ * |
12858+ ==
12859+::
12860+++ program-subs-empty
12861+ |= d=def
12862+ ^- ?
12863+ ?. ?=(%value -.d) |
12864+ ?- -.val.d
12865+ %gate (program-empty-null body.val.d)
12866+ %gate-wide (program-empty-null body.val.d)
12867+ * |
12868+ ==
12869+::
12870+++ program-transparent
12871+ |= e=expr
12872+ ^- expr
12873+ ?- -.e
12874+ %group $(e inner.e)
12875+ %cast $(e val.e)
12876+ %body ?~(defs.e $(e final.e) e)
12877+ * e
12878+ ==
12879+++ program-init-tuple-null
12880+ |= d=def
12881+ ^- ?
12882+ ?. ?=(%value -.d) |
12883+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) |
12884+ =/ body=expr
12885+ ?- -.val.d
12886+ %gate body.val.d
12887+ %gate-wide body.val.d
12888+ * !!
12889+ ==
12890+ =. body (program-transparent body)
12891+ ?. ?=(%tuple -.body) |
12892+ ?~ items.body |
12893+ (program-empty-null val:(rear items.body))
12894+::
12895+:: Recover only the update of an already recognized direct program main.
12896+:: Its written sample determines the message/model relationship; the canonical
12897+:: cmd, unit and update slot determine the result context. Publication is
12898+:: component-local so later subscription/view/initializer retries can accumulate.
12899+++ program-update-context
12900+ |= [main=def parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
12901+ ^- (unit iresolved)
12902+ =/ env=ienv env.resolution
12903+ ?^ (ienv-lookup %main env) ~
12904+ ?^ (ienv-lookup update.parts env) ~
12905+ =/ updates=(list def)
12906+ (skim ds |=(d=def &(?=(%value -.d) =(update.parts name.d))))
12907+ ?. ?=([* ~] updates) ~
12908+ =/ update-def=def i.updates
12909+ ?> ?=(%value -.update-def)
12910+ =/ written-update=(unit sample) (direct-gate-sample update-def)
12911+ ?~ written-update ~
12912+ ?. ?=(%cell -.u.written-update) ~
12913+ ?. ?=([* * ~] items.u.written-update) ~
12914+ ?~ prelude.initial ~
12915+ =/ program=(unit ischeme) (ienv-lookup %program values.u.prelude.initial)
12916+ ?~ program ~
12917+ =/ command=(unit ischeme) (find-jibb-mold %cmd u.prelude.initial)
12918+ =/ list-template=(unit ischeme) (find-jibb-mold %list u.prelude.initial)
12919+ ?~ command ~
12920+ ?~ list-template ~
12921+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
12922+ ?~ heads ~
12923+ =/ written=(unit def) (~(get by gates.u.heads) %program)
12924+ ?~ written ~
12925+ =/ written-sample=(unit sample) (direct-gate-sample u.written)
12926+ ?~ written-sample ~
12927+ ?. ?=(%cell -.u.written-sample) ~
12928+ ?. ?=([* * * * ~] items.u.written-sample) ~
12929+ =/ checked=(map term def)
12930+ (~(put by (direct-checked-gates ds env)) update.parts update-def)
12931+ =/ templates=ienv
12932+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
12933+ =/ scanned=(unit dgscan)
12934+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
12935+ ?~ scanned ~
12936+ =. next.initial (dg-next-id ids.u.scanned 0)
12937+ =/ update-state=istate (reserve-def-caps val.update-def initial)
12938+ =/ sam=isample-result (infer-sample u.written-update env update-state)
12939+ ?: ?=(%| -.sam) ~
12940+ =/ actual-sample=itype (itype-normalize typ.p.sam sub.state.p.sam)
12941+ ?. ?=(%cell -.actual-sample) ~
12942+ =/ message=(unit itype)
12943+ (direct-slot-body hed.actual-sample (direct-sample-name i.items.u.written-update))
12944+ =/ model=(unit itype)
12945+ (direct-slot-body tal.actual-sample (direct-sample-name i.t.items.u.written-update))
12946+ ?~ message ~
12947+ ?~ model ~
12948+ =/ cmd=(unit itype) (template-apply u.command ~[u.message])
12949+ ?~ cmd ~
12950+ =/ command-result=(unit itype) (template-apply u.list-template ~[u.cmd])
12951+ ?~ command-result ~
12952+ =/ product=itype [%cell u.model u.command-result]
12953+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.program state.p.sam)
12954+ ?. ?=(%fn -.typ.instance) ~
12955+ ?. ?=(%cell -.sample.typ.instance) ~
12956+ ?. ?=(%cell -.tal.sample.typ.instance) ~
12957+ =/ expected-update=(unit itype)
12958+ (direct-slot-body hed.tal.sample.typ.instance (direct-sample-name i.t.items.u.written-sample))
12959+ ?~ expected-update ~
12960+ ?. ?=(%fn -.u.expected-update) ~
12961+ :: Sample binders are not value faces. Strip only those two slot faces
12962+ :: for the invariant canonical-gate proof; the source-faced gate is still
12963+ :: used by the complete positional call and final ordinary result cast.
12964+ =/ canonical-candidate=itype [%fn [%cell u.message u.model] product]
12965+ =/ gate-fit=ifit
12966+ (direct-invariant canonical-candidate u.expected-update sub.state.instance next.state.instance)
12967+ ?. ?=(%ok -.gate-fit) ~
12968+ =/ closed=itype
12969+ (itype-normalize [%fn typ.p.sam product] sub.gate-fit)
12970+ ?. ?=(%fn -.closed) ~
12971+ :: The closed product no longer needs the canonical slot substitutions.
12972+ :: Start the body at its ordinary sample state so existing branch retries
12973+ :: keep their substitution guards, but retain the shared fresh-ID high water.
12974+ =/ st=istate state.p.sam(next next.gate-fit, gate-defs checked, head-evidence heads)
12975+ =/ body=expr
12976+ ?- -.val.update-def
12977+ %gate body.val.update-def
12978+ %gate-wide body.val.update-def
12979+ * !!
12980+ ==
12981+ =/ inferred=iresult
12982+ (infer-call-context-arg body product.closed env.p.sam st (span-of body))
12983+ ?: ?=(%| -.inferred) ~
12984+ =/ product-fit=ifit
12985+ (itype-fit typ.p.inferred product.closed sub.state.p.inferred next.state.p.inferred)
12986+ ?. ?=(%ok -.product-fit) ~
12987+ =/ merged-product=itype
12988+ (itype-merge-faces typ.p.inferred product.closed sub.product-fit)
12989+ =/ actual-cast=itype [%fn typ.p.sam merged-product]
12990+ =/ cast=ifit
12991+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
12992+ ?. ?=(%ok -.cast) ~
12993+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
12994+ =/ adjusted=iresult
12995+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
12996+ =/ added=(unit iadded-definition)
12997+ (add-supported-result update-def adjusted update-state env checked artifacts.resolution)
12998+ ?~ added ~
12999+ =/ recovered=(unit ischeme) (ienv-lookup update.parts env.u.added)
13000+ ?~ recovered ~
13001+ ?. ?=(~ vars.u.recovered) ~
13002+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
13003+ `[env.u.added grouped.resolution artifacts.u.added]
13004+::
13005+++ program-inferred-slot
13006+ |= [typ=itype name=(unit term)]
13007+ ^- itype
13008+ ?~ name typ
13009+ ?: &(?=(%face -.typ) =(name.typ u.name)) body.typ
13010+ typ
13011+::
13012+++ program-inferred-sample
13013+ |= [typ=itype sam=sample]
13014+ ^- itype
13015+ (program-inferred-slot typ (direct-sample-name sam))
13016+::
13017+++ program-two-slot-names
13018+ |= sam=sample
13019+ ^- (unit [first=(unit term) second=(unit term)])
13020+ ?- -.sam
13021+ %cell
13022+ ?. ?=([* * ~] items.sam) ~
13023+ `[(direct-sample-name i.items.sam) (direct-sample-name i.t.items.sam)]
13024+ %face
13025+ ?. ?=(%cell -.shape.sam) ~
13026+ ?. ?=([* * ~] fields.shape.sam) ~
13027+ `[(direct-field-name i.fields.shape.sam) (direct-field-name i.t.fields.shape.sam)]
13028+ * ~
13029+ ==
13030+::
13031+:: Read message/model from the checked update and its written source layout.
13032+:: The source names strip only top-level sample binder faces; nested value
13033+:: faces remain part of the canonical message and model.
13034+++ program-update-relation
13035+ |= [name=term ds=(list def) env=ienv]
13036+ ^- (unit [message=itype model=itype])
13037+ =/ update=(unit ischeme) (ienv-lookup name env)
13038+ ?~ update ~
13039+ ?. ?=(~ vars.u.update) ~
13040+ ?. ?=(~ (itype-vars typ.u.update)) ~
13041+ ?. ?=(%fn -.typ.u.update) ~
13042+ ?. ?=(%cell -.sample.typ.u.update) ~
13043+ =/ defs=(list def)
13044+ (skim ds |=(d=def &(?=(%value -.d) =(name name.d))))
13045+ ?. ?=([* ~] defs) ~
13046+ =/ written=(unit sample) (direct-gate-sample i.defs)
13047+ ?~ written ~
13048+ ?. ?=(%cell -.u.written) ~
13049+ ?. ?=([* * ~] items.u.written) ~
13050+ =/ message=(unit itype)
13051+ (direct-slot-body hed.sample.typ.u.update (direct-sample-name i.items.u.written))
13052+ =/ model=(unit itype)
13053+ (direct-slot-body tal.sample.typ.u.update (direct-sample-name i.t.items.u.written))
13054+ ?~ message ~
13055+ ?~ model ~
13056+ `[u.message u.model]
13057+::
13058+:: Recover an unannotated direct subscription component from the checked
13059+:: update relation and canonical fourth program slot. This establishes only
13060+:: the value type; the final program watch proof remains separate.
13061+++ program-subs-context
13062+ |= [parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
13063+ ^- (unit iresolved)
13064+ =/ env=ienv env.resolution
13065+ ?^ (ienv-lookup %main env) ~
13066+ ?^ (ienv-lookup subs.parts env) ~
13067+ =/ relation=(unit [message=itype model=itype])
13068+ (program-update-relation update.parts ds env)
13069+ ?~ relation ~
13070+ =/ subs=(list def)
13071+ (skim ds |=(d=def &(?=(%value -.d) =(subs.parts name.d))))
13072+ ?. ?=([* ~] subs) ~
13073+ =/ subs-def=def i.subs
13074+ ?> ?=(%value -.subs-def)
13075+ =/ written-subs=(unit sample) (direct-gate-sample subs-def)
13076+ ?~ written-subs ~
13077+ ?~ prelude.initial ~
13078+ =/ program=(unit ischeme) (ienv-lookup %program values.u.prelude.initial)
13079+ =/ sub=(unit ischeme) (find-jibb-mold %sub u.prelude.initial)
13080+ =/ list-template=(unit ischeme) (find-jibb-mold %list u.prelude.initial)
13081+ ?~ program ~
13082+ ?~ sub ~
13083+ ?~ list-template ~
13084+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
13085+ ?~ heads ~
13086+ =/ written=(unit def) (~(get by gates.u.heads) %program)
13087+ ?~ written ~
13088+ =/ written-sample=(unit sample) (direct-gate-sample u.written)
13089+ ?~ written-sample ~
13090+ ?. ?=(%cell -.u.written-sample) ~
13091+ ?. ?=([* * * * ~] items.u.written-sample) ~
13092+ =/ checked=(map term def) (direct-checked-gates ds env)
13093+ =/ templates=ienv
13094+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
13095+ =/ scanned=(unit dgscan)
13096+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
13097+ ?~ scanned ~
13098+ =. next.initial (dg-next-id ids.u.scanned 0)
13099+ =/ subs-state=istate (reserve-def-caps val.subs-def initial)
13100+ =/ sam=isample-result (infer-sample u.written-subs env subs-state)
13101+ ?: ?=(%| -.sam) ~
13102+ =/ actual-model=itype (program-inferred-sample typ.p.sam u.written-subs)
13103+ ?. ?=(~ (itype-vars actual-model)) ~
13104+ ?: (itype-has-tag actual-model) ~
13105+ =/ model-fit=ifit
13106+ (direct-invariant actual-model model.u.relation sub.state.p.sam next.state.p.sam)
13107+ ?. ?=(%ok -.model-fit) ~
13108+ =/ message-sub=(unit itype) (template-apply u.sub ~[message.u.relation])
13109+ ?~ message-sub ~
13110+ =/ product=(unit itype) (template-apply u.list-template ~[u.message-sub])
13111+ ?~ product ~
13112+ =/ instance=[typ=itype state=istate]
13113+ (instantiate-scheme u.program state.p.sam(sub sub.model-fit, next next.model-fit))
13114+ ?. ?=(%fn -.typ.instance) ~
13115+ ?. ?=(%cell -.sample.typ.instance) ~
13116+ ?. ?=(%cell -.tal.sample.typ.instance) ~
13117+ ?. ?=(%cell -.tal.tal.sample.typ.instance) ~
13118+ =/ expected-subs=(unit itype)
13119+ (direct-slot-body tal.tal.tal.sample.typ.instance (direct-sample-name i.t.t.t.items.u.written-sample))
13120+ ?~ expected-subs ~
13121+ ?. ?=(%fn -.u.expected-subs) ~
13122+ =/ canonical=itype [%fn model.u.relation u.product]
13123+ =/ gate-fit=ifit
13124+ (direct-invariant canonical u.expected-subs sub.state.instance next.state.instance)
13125+ ?. ?=(%ok -.gate-fit) ~
13126+ =/ closed=itype
13127+ (itype-normalize [%fn typ.p.sam u.product] sub.gate-fit)
13128+ ?. ?=(%fn -.closed) ~
13129+ =/ body=expr
13130+ ?- -.val.subs-def
13131+ %gate body.val.subs-def
13132+ %gate-wide body.val.subs-def
13133+ * !!
13134+ ==
13135+ =/ st=istate
13136+ state.p.sam(next next.gate-fit, gate-defs checked, head-evidence heads)
13137+ =/ inferred=iresult
13138+ (infer-call-context-arg body product.closed env.p.sam st (span-of body))
13139+ ?: ?=(%| -.inferred) ~
13140+ =/ product-fit=ifit
13141+ (itype-fit typ.p.inferred product.closed sub.state.p.inferred next.state.p.inferred)
13142+ ?. ?=(%ok -.product-fit) ~
13143+ =/ merged-product=itype
13144+ (itype-merge-faces typ.p.inferred product.closed sub.product-fit)
13145+ =/ actual-cast=itype [%fn typ.p.sam merged-product]
13146+ =/ cast=ifit
13147+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
13148+ ?. ?=(%ok -.cast) ~
13149+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
13150+ =/ adjusted=iresult
13151+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
13152+ =/ added=(unit iadded-definition)
13153+ (add-supported-result subs-def adjusted subs-state env checked artifacts.resolution)
13154+ ?~ added ~
13155+ =/ recovered=(unit ischeme) (ienv-lookup subs.parts env.u.added)
13156+ ?~ recovered ~
13157+ ?. ?=(~ vars.u.recovered) ~
13158+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
13159+ `[env.u.added grouped.resolution artifacts.u.added]
13160+::
13161++$ iview-site [xs=expr mapper=term]
13162+++ program-view-site
13163+ |= e=expr
13164+ ^- (unit iview-site)
13165+ =. e (program-transparent e)
13166+ ?. ?=(%call -.e) ~
13167+ ?. ?=([* ~] args.e) ~
13168+ =/ each=expr (program-transparent head.e)
13169+ ?. ?=(%wing -.each) ~
13170+ ?. ?=([%each ~] names.each) ~
13171+ =/ turned=expr (program-transparent i.args.e)
13172+ ?. ?=(%call -.turned) ~
13173+ ?. ?=([* * ~] args.turned) ~
13174+ =/ turn=expr (program-transparent head.turned)
13175+ ?. ?=(%wing -.turn) ~
13176+ ?. ?=([%turn ~] names.turn) ~
13177+ =/ xs=expr (program-transparent i.args.turned)
13178+ ?. ?=(%wing -.xs) ~
13179+ ?~ names.xs ~
13180+ =/ mapper=(unit term) (program-main-wing i.t.args.turned)
13181+ ?~ mapper ~
13182+ `[xs u.mapper]
13183+::
13184+++ program-recovery-names
13185+ |= ds=(list def)
13186+ ^- (list term)
13187+ =/ main=(unit def) (program-main-def ds)
13188+ ?~ main ~
13189+ =/ parts=(unit [init=term update=term view=term subs=term])
13190+ (program-main-parts u.main)
13191+ ?~ parts ~
13192+ =/ views=(list def)
13193+ (skim ds |=(d=def &(?=(%value -.d) =(view.u.parts name.d))))
13194+ ?. ?=([* ~] views) ~
13195+ =/ view-def=def i.views
13196+ ?> ?=(%value -.view-def)
13197+ =/ written=(unit sample) (direct-gate-sample view-def)
13198+ ?~ written ~
13199+ =/ body=expr
13200+ ?- -.val.view-def
13201+ %gate body.val.view-def
13202+ %gate-wide body.val.view-def
13203+ * !!
13204+ ==
13205+ =/ sites=(unit (list iview-site)) (program-view-sites body ~)
13206+ ?~ sites ~
13207+ ?. ?=([* ~] u.sites) ~
13208+ =/ mapper=term mapper.i.u.sites
13209+ =/ components=(list term)
13210+ :~ init.u.parts
13211+ update.u.parts
13212+ view.u.parts
13213+ subs.u.parts
13214+ ==
13215+ ?: (lien components |=(n=term =(n mapper))) ~
13216+ =/ mappers=(list def)
13217+ (skim ds |=(d=def &(?=(%value -.d) =(mapper name.d))))
13218+ ?. ?=([* ~] mappers) ~
13219+ :~ init.u.parts
13220+ update.u.parts
13221+ view.u.parts
13222+ subs.u.parts
13223+ mapper
13224+ ==
13225+::
13226+++ program-sample-binders
13227+ |= sam=sample
13228+ ^- (list term)
13229+ ?- -.sam
13230+ %bind ~[name.sam]
13231+ %face ~[name.sam]
13232+ %pun ~[name.sam]
13233+ %cell (zing (turn items.sam |=(s=sample (program-sample-binders s))))
13234+ * ~
13235+ ==
13236+::
13237+++ program-pattern-binders
13238+ |= pat=pattern
13239+ ^- (list term)
13240+ ?- -.pat
13241+ %bind ~[name.pat]
13242+ %cell (zing (turn items.pat |=(p=pattern (program-pattern-binders p))))
13243+ * ~
13244+ ==
13245+::
13246+++ program-view-sites-merge
13247+ |= [a=(unit (list iview-site)) b=(unit (list iview-site))]
13248+ ^- (unit (list iview-site))
13249+ ?~ a ~
13250+ ?~ b ~
13251+ `(weld u.a u.b)
13252+::
13253+++ program-view-sites-exprs
13254+ |= [xs=(list expr) locals=(list term)]
13255+ ^- (unit (list iview-site))
13256+ ?~ xs `~
13257+ (program-view-sites-merge (program-view-sites i.xs locals) $(xs t.xs))
13258+::
13259+++ program-view-sites-items
13260+ |= [xs=(list item) locals=(list term)]
13261+ ^- (unit (list iview-site))
13262+ ?~ xs `~
13263+ (program-view-sites-merge (program-view-sites val.i.xs locals) $(xs t.xs))
13264+::
13265+++ program-view-sites-pieces
13266+ |= [xs=(list piece) locals=(list term)]
13267+ ^- (unit (list iview-site))
13268+ ?~ xs `~
13269+ =/ here=(unit (list iview-site))
13270+ ?- -.i.xs
13271+ %expr (program-view-sites p.i.xs locals)
13272+ %text `~
13273+ ==
13274+ (program-view-sites-merge here $(xs t.xs))
13275+::
13276+++ program-view-sites-qsegs
13277+ |= [xs=(list qseg) locals=(list term)]
13278+ ^- (unit (list iview-site))
13279+ ?~ xs `~
13280+ =/ here=(unit (list iview-site))
13281+ ?- -.i.xs
13282+ %expr (program-view-sites p.i.xs locals)
13283+ %knot `~
13284+ ==
13285+ (program-view-sites-merge here $(xs t.xs))
13286+::
13287+++ program-view-sites-edits
13288+ |= [xs=(list edit) locals=(list term)]
13289+ ^- (unit (list iview-site))
13290+ ?~ xs `~
13291+ (program-view-sites-merge (program-view-sites val.i.xs locals) $(xs t.xs))
13292+::
13293+++ program-view-sites-defs
13294+ |= [xs=(list def) locals=(list term)]
13295+ ^- (unit (list iview-site))
13296+ ?~ xs `~
13297+ =/ here=(unit (list iview-site))
13298+ ?: ?=(%mold -.i.xs) `~
13299+ (program-view-sites val.i.xs locals)
13300+ (program-view-sites-merge here $(xs t.xs))
13301+::
13302+++ program-view-sites-arms
13303+ |= [xs=(list arm) locals=(list term)]
13304+ ^- (unit (list iview-site))
13305+ ?~ xs `~
13306+ =/ nested=(list term) (weld (program-pattern-binders pat.i.xs) locals)
13307+ (program-view-sites-merge (program-view-sites val.i.xs nested) $(xs t.xs))
13308+::
13309+++ program-view-sites
13310+ |= [e=expr locals=(list term)]
13311+ ^- (unit (list iview-site))
13312+ =/ site=(unit iview-site) (program-view-site e)
13313+ ?^ site
13314+ =/ names=(list term) ~[%each %turn mapper.u.site]
13315+ ?> ?=(%wing -.xs.u.site)
13316+ =/ root=term (rear names.xs.u.site)
13317+ ?: |((lien names |=(n=term (lien locals |=(x=term =(n x))))) (lien locals |=(x=term =(root x))))
13318+ ~
13319+ `~[u.site]
13320+ ?- -.e
13321+ %str (program-view-sites-pieces pieces.e locals)
13322+ %qath (program-view-sites-qsegs segs.e locals)
13323+ %change (program-view-sites-edits edits.e locals)
13324+ %pair (program-view-sites val.e locals)
13325+ %unit (program-view-sites val.e locals)
13326+ %group (program-view-sites inner.e locals)
13327+ %list (program-view-sites-exprs items.e locals)
13328+ %tuple (program-view-sites-items items.e locals)
13329+ %gate
13330+ (program-view-sites body.e (weld (program-sample-binders sample.e) locals))
13331+ %gate-wide
13332+ (program-view-sites body.e (weld (program-sample-binders sample.e) locals))
13333+ %call
13334+ (program-view-sites-merge (program-view-sites head.e locals) (program-view-sites-exprs args.e locals))
13335+ %cast (program-view-sites val.e locals)
13336+ %trace
13337+ (program-view-sites-merge (program-view-sites val.e locals) (program-view-sites then.e locals))
13338+ %branch
13339+ (program-view-sites-merge (program-view-sites subject.e locals) (program-view-sites-arms arms.e locals))
13340+ %body
13341+ =/ nested=(list term) (weld (global-value-names defs.e) locals)
13342+ (program-view-sites-merge (program-view-sites-defs defs.e nested) (program-view-sites final.e nested))
13343+ * `~
13344+ ==
13345+::
13346+++ program-union-tag-case
13347+ |= [expected=itype tag=@]
13348+ ^- (unit itype)
13349+ ?. ?=(%union -.expected) ~
13350+ =/ remaining=(list itype) cases.expected
13351+ =/ found=(unit itype) ~
13352+ =/ seen=(set @) *(set @)
13353+ |-
13354+ ?~ remaining found
13355+ =/ case=itype i.remaining
13356+ =/ head=(unit @)
13357+ ?: ?=(%const -.case) `val.literal.case
13358+ ?. ?=(%cell -.case) ~
13359+ ?. ?=(%const -.hed.case) ~
13360+ `val.literal.hed.case
13361+ ?~ head ~
13362+ ?: (~(has in:..zuse seen) u.head) ~
13363+ =. seen (~(put in:..zuse seen) u.head)
13364+ =? found =(tag u.head)
13365+ ?^(found ~ `case)
13366+ $(remaining t.remaining)
13367+::
13368+++ program-single-case-fit
13369+ |= [actual=itype expected=itype sub=isub next=@ud]
13370+ ^- ifit
13371+ =. actual (itype-normalize actual sub)
13372+ =. expected (itype-normalize expected sub)
13373+ ?. ?=(%union -.expected) [%unknown ~]
13374+ =/ found=(unit itype)
13375+ ?: ?=(%const -.actual) `actual
13376+ ?: ?=(%tag -.actual) `actual
13377+ ?: ?=(%cell -.actual) `actual
13378+ ?. ?=(%union -.actual) ~
13379+ ?. ?=([* ~] cases.actual) ~
13380+ `i.cases.actual
13381+ ?~ found [%unknown ~]
13382+ =/ case=itype u.found
13383+ =/ tag=(unit lit)
13384+ ?: ?=(%const -.case) `literal.case
13385+ ?: ?=(%tag -.case) `literal.case
13386+ ?. ?=(%cell -.case) ~
13387+ =/ head=itype (projection-field-target hed.case)
13388+ ?: ?=(%const -.head) `literal.head
13389+ ?: ?=(%tag -.head) `literal.head
13390+ ~
13391+ ?~ tag [%unknown ~]
13392+ =/ chosen=(unit itype) (program-union-tag-case expected val.u.tag)
13393+ ?~ chosen [%unknown ~]
13394+ ?: |(?=(%const -.case) ?=(%tag -.case))
13395+ ?. ?=(%const -.u.chosen) [%unknown ~]
13396+ (itype-fit case u.chosen sub next)
13397+ ?. ?=(%cell -.case) [%unknown ~]
13398+ ?. ?=(%cell -.u.chosen) [%unknown ~]
13399+ =/ head-fit=ifit (itype-fit hed.case hed.u.chosen sub next)
13400+ ?. ?=(%ok -.head-fit) head-fit
13401+ (itype-fit tal.case tal.u.chosen sub.head-fit next.head-fit)
13402+::
13403+++ program-single-generic-fit
13404+ |= [actual=itype expected=itype sub=isub next=@ud]
13405+ ^- ifit
13406+ =. actual (itype-normalize actual sub)
13407+ =. expected (itype-normalize expected sub)
13408+ ?. &(?=(%union -.actual) ?=(%union -.expected)) [%unknown ~]
13409+ ?~ origin.actual [%unknown ~]
13410+ ?. =(origin.actual origin.expected) [%unknown ~]
13411+ ?. ?=([* ~] args.actual) [%unknown ~]
13412+ ?. ?=([* ~] args.expected) [%unknown ~]
13413+ =/ argument-fit=ifit (direct-invariant i.args.actual i.args.expected sub next)
13414+ ?: ?=(%ok -.argument-fit) argument-fit
13415+ (program-single-case-fit i.args.actual i.args.expected sub next)
13416+::
13417+++ program-keyed-product-fit
13418+ |= [actual=itype expected=itype element=ischeme sub=isub next=@ud]
13419+ ^- ifit
13420+ =. actual (itype-normalize actual sub)
13421+ =. expected (itype-normalize expected sub)
13422+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) [%unknown ~]
13423+ =/ key-fit=ifit
13424+ (itype-fit (projection-field-target hed.actual) (projection-field-target hed.expected) sub next)
13425+ ?. ?=(%ok -.key-fit) key-fit
13426+ =/ actual-el=itype
13427+ (itype-normalize (projection-field-target tal.actual) sub.key-fit)
13428+ =/ expected-el=itype
13429+ (itype-normalize (projection-field-target tal.expected) sub.key-fit)
13430+ ?. &(?=(%union -.actual-el) ?=(%union -.expected-el)) [%unknown ~]
13431+ ?. =(origin.actual-el origin.expected-el) [%unknown ~]
13432+ ?. ?=([* ~] args.actual-el) [%unknown ~]
13433+ ?. ?=([* ~] args.expected-el) [%unknown ~]
13434+ =/ canonical-actual=(unit itype)
13435+ (template-apply element ~[i.args.actual-el])
13436+ =/ canonical-expected=(unit itype)
13437+ (template-apply element ~[i.args.expected-el])
13438+ ?~ canonical-actual [%unknown ~]
13439+ ?~ canonical-expected [%unknown ~]
13440+ =/ actual-check=ifit
13441+ (direct-invariant actual-el u.canonical-actual sub.key-fit next.key-fit)
13442+ ?. ?=(%ok -.actual-check) actual-check
13443+ =/ expected-check=ifit
13444+ (direct-invariant expected-el u.canonical-expected sub.actual-check next.actual-check)
13445+ ?. ?=(%ok -.expected-check) expected-check
13446+ =/ case-fit=ifit
13447+ (program-single-case-fit i.args.actual-el i.args.expected-el sub.expected-check next.expected-check)
13448+ case-fit
13449+::
13450+:: A direct view without a keyed each/turn site still needs the message type
13451+:: from the checked update. Recover only that closed component; final main
13452+:: checking remains the canonical program-kind boundary.
13453+++ program-plain-view-context
13454+ |= [parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
13455+ ^- (unit iresolved)
13456+ =/ env=ienv env.resolution
13457+ ?^ (ienv-lookup %main env) ~
13458+ ?^ (ienv-lookup view.parts env) ~
13459+ =/ relation=(unit [message=itype model=itype])
13460+ (program-update-relation update.parts ds env)
13461+ ?~ relation ~
13462+ =/ views=(list def)
13463+ (skim ds |=(d=def &(?=(%value -.d) =(view.parts name.d))))
13464+ ?. ?=([* ~] views) ~
13465+ =/ view-def=def i.views
13466+ ?> ?=(%value -.view-def)
13467+ =/ written-view=(unit sample) (direct-gate-sample view-def)
13468+ ?~ written-view ~
13469+ =/ body=expr
13470+ ?- -.val.view-def
13471+ %gate body.val.view-def
13472+ %gate-wide body.val.view-def
13473+ * !!
13474+ ==
13475+ =/ sites=(unit (list iview-site)) (program-view-sites body ~)
13476+ ?~ sites ~
13477+ ?^ u.sites ~
13478+ ?~ prelude.initial ~
13479+ ?~ (ienv-lookup %program values.u.prelude.initial) ~
13480+ =/ element=(unit ischeme) (find-jibb-mold %element u.prelude.initial)
13481+ ?~ element ~
13482+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
13483+ ?~ heads ~
13484+ ?~ (~(get by gates.u.heads) %program) ~
13485+ =/ checked=(map term def) (direct-checked-gates ds env)
13486+ =/ templates=ienv
13487+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
13488+ =/ scanned=(unit dgscan)
13489+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
13490+ ?~ scanned ~
13491+ =. next.initial (dg-next-id ids.u.scanned 0)
13492+ =/ view-state=istate (reserve-def-caps val.view-def initial)
13493+ =/ sam=isample-result (infer-sample u.written-view env view-state)
13494+ ?: ?=(%| -.sam) ~
13495+ =/ actual-model=itype (program-inferred-sample typ.p.sam u.written-view)
13496+ ?. ?=(~ (itype-vars actual-model)) ~
13497+ ?: (itype-has-tag actual-model) ~
13498+ =/ model-fit=ifit
13499+ (direct-invariant actual-model model.u.relation sub.state.p.sam next.state.p.sam)
13500+ ?. ?=(%ok -.model-fit) ~
13501+ =/ product=(unit itype) (template-apply u.element ~[message.u.relation])
13502+ ?~ product ~
13503+ =/ st=istate
13504+ state.p.sam(sub sub.model-fit, next next.model-fit, gate-defs checked, head-evidence heads)
13505+ =/ inferred=iresult
13506+ (infer-call-context-arg body u.product env.p.sam st (span-of body))
13507+ ?: ?=(%| -.inferred) ~
13508+ =/ product-fit=ifit
13509+ (itype-fit typ.p.inferred u.product sub.state.p.inferred next.state.p.inferred)
13510+ ?. ?=(%ok -.product-fit) ~
13511+ =/ merged-product=itype
13512+ (itype-merge-faces typ.p.inferred u.product sub.product-fit)
13513+ =/ actual-cast=itype [%fn typ.p.sam merged-product]
13514+ =/ closed=itype [%fn typ.p.sam u.product]
13515+ =/ cast=ifit
13516+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
13517+ ?. ?=(%ok -.cast) ~
13518+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
13519+ =/ adjusted=iresult
13520+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
13521+ =/ added=(unit iadded-definition)
13522+ (add-supported-result view-def adjusted view-state env checked artifacts.resolution)
13523+ ?~ added ~
13524+ =/ recovered=(unit ischeme) (ienv-lookup view.parts env.u.added)
13525+ ?~ recovered ~
13526+ ?. ?=(~ vars.u.recovered) ~
13527+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
13528+ `[env.u.added grouped.resolution artifacts.u.added]
13529+::
13530+:: Recover exactly one direct keyed each/turn row mapper, then its view.
13531+:: The prelude's own each and turn schemes determine the mapper gate: the
13532+:: key is inferred from the mapper body, never selected by this recovery.
13533+++ program-view-context
13534+ |= [parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
13535+ ^- (unit iresolved)
13536+ =/ env=ienv env.resolution
13537+ ?^ (ienv-lookup %main env) ~
13538+ ?^ (ienv-lookup view.parts env) ~
13539+ =/ relation=(unit [message=itype model=itype])
13540+ (program-update-relation update.parts ds env)
13541+ ?~ relation ~
13542+ =/ views=(list def)
13543+ (skim ds |=(d=def &(?=(%value -.d) =(view.parts name.d))))
13544+ ?. ?=([* ~] views) ~
13545+ =/ view-def=def i.views
13546+ ?> ?=(%value -.view-def)
13547+ =/ written-view=(unit sample) (direct-gate-sample view-def)
13548+ ?~ written-view ~
13549+ =/ view-body=expr
13550+ ?- -.val.view-def
13551+ %gate body.val.view-def
13552+ %gate-wide body.val.view-def
13553+ * !!
13554+ ==
13555+ =/ sites=(unit (list iview-site)) (program-view-sites view-body ~)
13556+ ?~ sites ~
13557+ ?. ?=([* ~] u.sites) ~
13558+ =/ site=iview-site i.u.sites
13559+ =/ component-names=(list term) ~[init.parts update.parts view.parts subs.parts]
13560+ ?: (lien component-names |=(n=term =(n mapper.site))) ~
13561+ ?^ (ienv-lookup mapper.site env) ~
13562+ =/ mappers=(list def)
13563+ (skim ds |=(d=def &(?=(%value -.d) =(mapper.site name.d))))
13564+ ?. ?=([* ~] mappers) ~
13565+ =/ mapper-def=def i.mappers
13566+ ?> ?=(%value -.mapper-def)
13567+ =/ written-mapper=(unit sample) (direct-gate-sample mapper-def)
13568+ ?~ written-mapper ~
13569+ ?~ prelude.initial ~
13570+ =/ program=(unit ischeme) (ienv-lookup %program values.u.prelude.initial)
13571+ =/ each-scheme=(unit ischeme) (ienv-lookup %each values.u.prelude.initial)
13572+ =/ turn-scheme=(unit ischeme) (ienv-lookup %turn values.u.prelude.initial)
13573+ =/ element=(unit ischeme) (find-jibb-mold %element u.prelude.initial)
13574+ =/ list-template=(unit ischeme) (find-jibb-mold %list u.prelude.initial)
13575+ ?~ program ~
13576+ ?~ each-scheme ~
13577+ ?~ turn-scheme ~
13578+ ?~ element ~
13579+ ?~ list-template ~
13580+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
13581+ ?~ heads ~
13582+ =/ written-program=(unit def) (~(get by gates.u.heads) %program)
13583+ =/ written-each=(unit def) (~(get by gates.u.heads) %each)
13584+ =/ written-turn=(unit def) (~(get by gates.u.heads) %turn)
13585+ ?~ written-program ~
13586+ ?~ written-each ~
13587+ ?~ written-turn ~
13588+ =/ program-sample=(unit sample) (direct-gate-sample u.written-program)
13589+ =/ each-sample=(unit sample) (direct-gate-sample u.written-each)
13590+ =/ turn-sample=(unit sample) (direct-gate-sample u.written-turn)
13591+ ?~ program-sample ~
13592+ ?~ each-sample ~
13593+ ?~ turn-sample ~
13594+ ?. ?=(%cell -.u.program-sample) ~
13595+ ?. ?=([* * * * ~] items.u.program-sample) ~
13596+ =/ turn-names=(unit [first=(unit term) second=(unit term)])
13597+ (program-two-slot-names u.turn-sample)
13598+ ?~ turn-names ~
13599+ =/ checked=(map term def) (direct-checked-gates ds env)
13600+ =/ templates=ienv
13601+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
13602+ =/ scanned=(unit dgscan)
13603+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
13604+ ?~ scanned ~
13605+ =. next.initial (dg-next-id ids.u.scanned 0)
13606+ =/ view-state=istate (reserve-def-caps val.view-def initial)
13607+ =/ sam=isample-result (infer-sample u.written-view env view-state)
13608+ ?: ?=(%| -.sam) ~
13609+ =/ actual-model=itype (program-inferred-sample typ.p.sam u.written-view)
13610+ =/ model-fit=ifit
13611+ (direct-invariant actual-model model.u.relation sub.state.p.sam next.state.p.sam)
13612+ ?. ?=(%ok -.model-fit) ~
13613+ =/ xs-result=iresult
13614+ (infer-fragment xs.site env.p.sam state.p.sam(sub sub.model-fit, next next.model-fit))
13615+ ?: ?=(%| -.xs-result) ~
13616+ =/ element-var=itype [%var next.state.p.xs-result]
13617+ =/ list-a=(unit itype) (template-apply u.list-template ~[element-var])
13618+ ?~ list-a ~
13619+ =/ xs-fit=ifit
13620+ (itype-fit typ.p.xs-result u.list-a sub.state.p.xs-result +(next.state.p.xs-result))
13621+ ?. ?=(%ok -.xs-fit) ~
13622+ =/ closed-xs=itype (itype-normalize u.list-a sub.xs-fit)
13623+ ?^ (itype-vars closed-xs) ~
13624+ ?: (itype-has-tag closed-xs) ~
13625+ =/ each-instance=[typ=itype state=istate]
13626+ (instantiate-scheme u.each-scheme state.p.xs-result(sub sub.xs-fit, next next.xs-fit))
13627+ ?. ?=(%fn -.typ.each-instance) ~
13628+ =/ turn-instance=[typ=itype state=istate]
13629+ (instantiate-scheme u.turn-scheme state.each-instance)
13630+ ?. ?=(%fn -.typ.turn-instance) ~
13631+ ?. ?=(%cell -.sample.typ.turn-instance) ~
13632+ =/ element-message=(unit itype)
13633+ (template-apply u.element ~[message.u.relation])
13634+ ?~ element-message ~
13635+ =/ each-fit=ifit
13636+ (itype-fit product.typ.each-instance u.element-message sub.state.turn-instance next.state.turn-instance)
13637+ ?. ?=(%ok -.each-fit) ~
13638+ =/ each-input=itype
13639+ (program-inferred-sample sample.typ.each-instance u.each-sample)
13640+ =/ turn-fit=ifit
13641+ (itype-fit product.typ.turn-instance each-input sub.each-fit next.each-fit)
13642+ ?. ?=(%ok -.turn-fit) ~
13643+ =/ turn-list=itype
13644+ (program-inferred-slot hed.sample.typ.turn-instance first.u.turn-names)
13645+ =/ list-fit=ifit
13646+ (itype-fit closed-xs turn-list sub.turn-fit next.turn-fit)
13647+ ?. ?=(%ok -.list-fit) ~
13648+ =/ mapper-type=itype
13649+ (program-inferred-slot tal.sample.typ.turn-instance second.u.turn-names)
13650+ =/ expected-mapper=itype (itype-normalize mapper-type sub.list-fit)
13651+ ?. ?=(%fn -.expected-mapper) ~
13652+ ?^ (itype-vars sample.expected-mapper) ~
13653+ ?: (itype-has-tag sample.expected-mapper) ~
13654+ :: These faces come from the source-backed each sample. Keeping them in
13655+ :: the expected mapper product lets ordinary tuple inference supply key/el.
13656+ ?. ?=(%cell -.product.expected-mapper) ~
13657+ ?. ?=(%face -.hed.product.expected-mapper) ~
13658+ ?. =(%key name.hed.product.expected-mapper) ~
13659+ ?. ?=(%face -.tal.product.expected-mapper) ~
13660+ ?. =(%el name.tal.product.expected-mapper) ~
13661+ =/ mapper-state=istate
13662+ (reserve-def-caps val.mapper-def initial(next next.list-fit))
13663+ =/ mapper-sam=isample-result (infer-sample u.written-mapper env mapper-state)
13664+ ?: ?=(%| -.mapper-sam) ~
13665+ =/ mapper-input=itype (program-inferred-sample typ.p.mapper-sam u.written-mapper)
13666+ =/ mapper-sample-fit=ifit
13667+ (direct-invariant mapper-input sample.expected-mapper sub.state.p.mapper-sam next.state.p.mapper-sam)
13668+ ?. ?=(%ok -.mapper-sample-fit) ~
13669+ =/ mapper-product=itype
13670+ (itype-normalize product.expected-mapper sub.mapper-sample-fit)
13671+ =/ mapper-body=expr
13672+ ?- -.val.mapper-def
13673+ %gate body.val.mapper-def
13674+ %gate-wide body.val.mapper-def
13675+ * !!
13676+ ==
13677+ =/ mapper-inferred=iresult
13678+ (infer-call-context-arg mapper-body mapper-product env.p.mapper-sam state.p.mapper-sam(sub sub.mapper-sample-fit, next next.mapper-sample-fit) (span-of mapper-body))
13679+ ?: ?=(%| -.mapper-inferred) ~
13680+ =/ ordinary-product-fit=ifit
13681+ (itype-fit typ.p.mapper-inferred mapper-product sub.state.p.mapper-inferred next.state.p.mapper-inferred)
13682+ =/ mapper-product-fit=ifit
13683+ ?: ?=(%ok -.ordinary-product-fit) ordinary-product-fit
13684+ (program-keyed-product-fit typ.p.mapper-inferred mapper-product u.element sub.state.p.mapper-inferred next.state.p.mapper-inferred)
13685+ ?. ?=(%ok -.mapper-product-fit) ~
13686+ =/ closed-mapper-product=itype
13687+ (itype-normalize mapper-product sub.mapper-product-fit)
13688+ ?^ (itype-vars closed-mapper-product) ~
13689+ ?: (itype-has-tag closed-mapper-product) ~
13690+ =/ merged-mapper-product=itype
13691+ (itype-merge-faces typ.p.mapper-inferred closed-mapper-product sub.mapper-product-fit)
13692+ =/ mapper-cast=itype [%fn typ.p.mapper-sam merged-mapper-product]
13693+ =/ closed-mapper=itype [%fn typ.p.mapper-sam closed-mapper-product]
13694+ =/ mapper-cast-fit=ifit
13695+ (itype-fit mapper-cast closed-mapper sub.mapper-product-fit next.mapper-product-fit)
13696+ ?. ?=(%ok -.mapper-cast-fit) ~
13697+ =/ merged-mapper=itype
13698+ (itype-merge-faces mapper-cast closed-mapper sub.mapper-cast-fit)
13699+ =/ mapper-adjusted=iresult
13700+ [%& merged-mapper state.p.mapper-inferred(sub sub.mapper-cast-fit, next next.mapper-cast-fit)]
13701+ =/ mapper-added=(unit iadded-definition)
13702+ (add-supported-result mapper-def mapper-adjusted mapper-state env checked artifacts.resolution)
13703+ ?~ mapper-added ~
13704+ =/ mapper-scheme=(unit ischeme) (ienv-lookup mapper.site env.u.mapper-added)
13705+ ?~ mapper-scheme ~
13706+ ?. ?=(~ vars.u.mapper-scheme) ~
13707+ ?. ?=(~ (itype-vars typ.u.mapper-scheme)) ~
13708+ =/ program-instance=[typ=itype state=istate]
13709+ (instantiate-scheme u.program state.p.sam(next next.mapper-cast-fit))
13710+ ?. ?=(%fn -.typ.program-instance) ~
13711+ ?. ?=(%cell -.sample.typ.program-instance) ~
13712+ ?. ?=(%cell -.tal.sample.typ.program-instance) ~
13713+ ?. ?=(%cell -.tal.tal.sample.typ.program-instance) ~
13714+ =/ expected-view=(unit itype)
13715+ (direct-slot-body hed.tal.tal.sample.typ.program-instance (direct-sample-name i.t.t.items.u.program-sample))
13716+ ?~ expected-view ~
13717+ ?. ?=(%fn -.u.expected-view) ~
13718+ =/ canonical-view=itype [%fn model.u.relation u.element-message]
13719+ =/ view-fit=ifit
13720+ (direct-invariant canonical-view u.expected-view sub.state.program-instance next.state.program-instance)
13721+ ?. ?=(%ok -.view-fit) ~
13722+ =/ closed-view=itype
13723+ (itype-normalize [%fn typ.p.sam u.element-message] sub.view-fit)
13724+ ?. ?=(%fn -.closed-view) ~
13725+ =/ view-env=ienv [[mapper.site u.mapper-scheme] env.p.sam]
13726+ =/ final-view-state=istate
13727+ (reserve-def-caps val.view-def state.p.sam(next next.view-fit, gate-defs checked.u.mapper-added, head-evidence heads))
13728+ =/ inferred=iresult
13729+ (infer-call-context-arg view-body product.closed-view view-env final-view-state (span-of view-body))
13730+ ?: ?=(%| -.inferred) ~
13731+ =/ product-fit=ifit
13732+ (itype-fit typ.p.inferred product.closed-view sub.state.p.inferred next.state.p.inferred)
13733+ ?. ?=(%ok -.product-fit) ~
13734+ =/ merged-product=itype
13735+ (itype-merge-faces typ.p.inferred product.closed-view sub.product-fit)
13736+ =/ actual-cast=itype [%fn typ.p.sam merged-product]
13737+ =/ cast=ifit
13738+ (itype-fit actual-cast closed-view sub.product-fit next.product-fit)
13739+ ?. ?=(%ok -.cast) ~
13740+ =/ merged=itype (itype-merge-faces actual-cast closed-view sub.cast)
13741+ =/ adjusted=iresult
13742+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
13743+ =/ added=(unit iadded-definition)
13744+ (add-supported-result view-def adjusted final-view-state env.u.mapper-added checked.u.mapper-added artifacts.u.mapper-added)
13745+ ?~ added ~
13746+ =/ recovered=(unit ischeme) (ienv-lookup view.parts env.u.added)
13747+ ?~ recovered ~
13748+ ?. ?=(~ vars.u.recovered) ~
13749+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
13750+ `[env.u.added grouped.resolution artifacts.u.added]
13751+::
13752+++ program-init-null-sample
13753+ |= d=def
13754+ ^- ?
13755+ =/ written=(unit sample) (direct-gate-sample d)
13756+ ?~ written |
13757+ ?. ?=(%bare -.u.written) |
13758+ =/ sh=shape shape.u.written
13759+ ?. ?=(%const -.sh) |
13760+ =(%null form.lit.sh)
13761+::
13762+:: The tuple-ending-null initializer retry above intentionally keeps its own
13763+:: boundary. A direct null-sample initializer can instead receive the closed
13764+:: model already established by update, view and subscriptions.
13765+++ program-plain-init-context
13766+ |= [parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
13767+ ^- (unit iresolved)
13768+ =/ env=ienv env.resolution
13769+ ?^ (ienv-lookup %main env) ~
13770+ ?^ (ienv-lookup init.parts env) ~
13771+ ?~ (ienv-lookup update.parts env) ~
13772+ ?~ (ienv-lookup view.parts env) ~
13773+ ?~ (ienv-lookup subs.parts env) ~
13774+ =/ relation=(unit [message=itype model=itype])
13775+ (program-update-relation update.parts ds env)
13776+ ?~ relation ~
13777+ =/ inits=(list def)
13778+ (skim ds |=(d=def &(?=(%value -.d) =(init.parts name.d))))
13779+ ?. ?=([* ~] inits) ~
13780+ =/ init-def=def i.inits
13781+ ?> ?=(%value -.init-def)
13782+ ?. (program-init-null-sample init-def) ~
13783+ =/ written=(unit sample) (direct-gate-sample init-def)
13784+ ?~ written ~
13785+ =/ body=expr
13786+ ?- -.val.init-def
13787+ %gate body.val.init-def
13788+ %gate-wide body.val.init-def
13789+ * !!
13790+ ==
13791+ ?~ prelude.initial ~
13792+ ?~ (ienv-lookup %program values.u.prelude.initial) ~
13793+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
13794+ ?~ heads ~
13795+ ?~ (~(get by gates.u.heads) %program) ~
13796+ =/ checked=(map term def) (direct-checked-gates ds env)
13797+ =/ templates=ienv
13798+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
13799+ =/ scanned=(unit dgscan)
13800+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
13801+ ?~ scanned ~
13802+ =. next.initial (dg-next-id ids.u.scanned 0)
13803+ =/ init-state=istate (reserve-def-caps val.init-def initial)
13804+ =/ sam=isample-result (infer-sample u.written env init-state)
13805+ ?: ?=(%| -.sam) ~
13806+ ?. ?=(~ (itype-vars typ.p.sam)) ~
13807+ ?: (itype-has-tag typ.p.sam) ~
13808+ =/ st=istate state.p.sam(gate-defs checked, head-evidence heads)
13809+ =/ inferred=iresult
13810+ (infer-call-context-arg body model.u.relation env.p.sam st (span-of body))
13811+ ?: ?=(%| -.inferred) ~
13812+ =/ product-fit=ifit
13813+ (itype-fit typ.p.inferred model.u.relation sub.state.p.inferred next.state.p.inferred)
13814+ ?. ?=(%ok -.product-fit) ~
13815+ =/ merged-product=itype
13816+ (itype-merge-faces typ.p.inferred model.u.relation sub.product-fit)
13817+ =/ actual-cast=itype [%fn typ.p.sam merged-product]
13818+ =/ closed=itype [%fn typ.p.sam model.u.relation]
13819+ =/ cast=ifit
13820+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
13821+ ?. ?=(%ok -.cast) ~
13822+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
13823+ =/ adjusted=iresult
13824+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
13825+ =/ added=(unit iadded-definition)
13826+ (add-supported-result init-def adjusted init-state env checked artifacts.resolution)
13827+ ?~ added ~
13828+ =/ recovered=(unit ischeme) (ienv-lookup init.parts env.u.added)
13829+ ?~ recovered ~
13830+ ?. ?=(~ vars.u.recovered) ~
13831+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
13832+ `[env.u.added grouped.resolution artifacts.u.added]
13833+::
13834+:: Recover only the initializer of an already recognized direct program main.
13835+:: The derived call is evidence for an ordinary init/main retry, never an
13836+:: interface to publish on its own. Any failure returns the original resolution.
13837+++ program-init-context
13838+ |= [main=def parts=[init=term update=term view=term subs=term] ds=(list def) resolution=iresolved initial=istate]
13839+ ^- (unit iresolved)
13840+ =/ env=ienv env.resolution
13841+ ?^ (ienv-lookup %main env) ~
13842+ ?^ (ienv-lookup init.parts env) ~
13843+ =/ update=(unit ischeme) (ienv-lookup update.parts env)
13844+ =/ view=(unit ischeme) (ienv-lookup view.parts env)
13845+ =/ subs=(unit ischeme) (ienv-lookup subs.parts env)
13846+ ?~ update ~
13847+ ?~ view ~
13848+ ?~ subs ~
13849+ =/ inits=(list def)
13850+ (skim ds |=(d=def &(?=(%value -.d) =(init.parts name.d))))
13851+ ?. ?=([* ~] inits) ~
13852+ =/ init-def=def i.inits
13853+ ?> ?=(%value -.init-def)
13854+ ?. (program-init-tuple-null init-def) ~
13855+ =/ args=(unit (list expr)) (program-main-args main)
13856+ ?~ args ~
13857+ ?~ prelude.initial ~
13858+ =/ program=(unit ischeme) (ienv-lookup %program values.u.prelude.initial)
13859+ ?~ program ~
13860+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude.initial)
13861+ ?~ heads ~
13862+ =/ written=(unit def) (~(get by gates.u.heads) %program)
13863+ ?~ written ~
13864+ =/ written-sample=(unit sample) (direct-gate-sample u.written)
13865+ ?~ written-sample ~
13866+ ?. ?=(%cell -.u.written-sample) ~
13867+ ?~ items.u.written-sample ~
13868+ =/ checked=(map term def) (direct-checked-gates ds env)
13869+ =/ templates=ienv
13870+ (turn molds.u.prelude.initial |=(x=[name=term template=ischeme] [name.x template.x]))
13871+ =/ scanned=(unit dgscan)
13872+ (dg-all-env-ids (weld env (weld values.u.prelude.initial templates)) 32.768 ~)
13873+ ?~ scanned ~
13874+ =. next.initial (dg-next-id ids.u.scanned 0)
13875+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.program initial)
13876+ ?. ?=(%fn -.typ.instance) ~
13877+ ?. ?=(%cell -.sample.typ.instance) ~
13878+ =/ expected-init=(unit itype)
13879+ (direct-slot-body hed.sample.typ.instance (direct-sample-name i.items.u.written-sample))
13880+ ?~ expected-init ~
13881+ ?. ?=(%fn -.u.expected-init) ~
13882+ ?. ?=(%var -.sample.u.expected-init) ~
13883+ =/ data=@ud id.sample.u.expected-init
13884+ =/ init-var=itype [%var next.state.instance]
13885+ =/ st=istate state.instance(next +(next.state.instance))
13886+ =/ up=[typ=itype state=istate] (instantiate-scheme u.update st)
13887+ =/ vw=[typ=itype state=istate] (instantiate-scheme u.view state.up)
13888+ =/ sb=[typ=itype state=istate] (instantiate-scheme u.subs state.vw)
13889+ =. st state.sb(gate-defs checked, head-evidence heads)
13890+ =/ actual=itype [%cell init-var [%cell typ.up [%cell typ.vw typ.sb]]]
13891+ =/ fit=ifit
13892+ (direct-positional-fit u.args items.u.written-sample actual sample.typ.instance env st sub.st next.st)
13893+ ?. ?=(%ok -.fit) ~
13894+ =/ actual-final=itype (itype-normalize actual sub.fit)
13895+ =/ expected-final=itype (itype-normalize sample.typ.instance sub.fit)
13896+ =/ open=(list @ud)
13897+ (unique-type-vars (weld (itype-vars actual-final) (itype-vars expected-final)))
13898+ ?. (levy open |=(n=@ud =(data n))) ~
13899+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
13900+ =/ replay=ifit
13901+ (direct-positional-fit u.args items.u.written-sample actual sample.typ.instance env st sub.fit next.fit)
13902+ ?. ?=(%ok -.replay) ~
13903+ ?. &(=(sub.fit sub.replay) =(next.fit next.replay)) ~
13904+ =/ expected=itype (itype-normalize u.expected-init sub.fit)
13905+ ?. ?=(%fn -.expected) ~
13906+ =. st st(sub sub.fit, next next.fit)
13907+ =/ init-state=istate (reserve-def-caps val.init-def st)
13908+ =/ inferred=iresult (infer-fragment val.init-def env init-state)
13909+ =? inferred ?=(%| -.inferred) (infer-recursive-gate init-def env init-state)
13910+ ?: ?=(%| -.inferred) ~
13911+ ?. ?=(%fn -.typ.p.inferred) ~
13912+ ?^ (itype-vars sample.typ.p.inferred) ~
13913+ =/ data-fit=ifit
13914+ (itype-fit sample.typ.p.inferred sample.expected sub.state.p.inferred next.state.p.inferred)
13915+ ?. ?=(%ok -.data-fit) ~
13916+ =/ closed=itype (itype-normalize expected sub.data-fit)
13917+ ?. ?=(%fn -.closed) ~
13918+ :: Resolve the ordinary tuple cast first, then check the complete gate.
13919+ :: General function fit remains unchanged; only this recovered candidate
13920+ :: receives the derived result context before its whole-type cast fit.
13921+ =/ product-fit=ifit
13922+ (itype-fit product.typ.p.inferred product.closed sub.data-fit next.data-fit)
13923+ ?. ?=(%ok -.product-fit) ~
13924+ =/ product=itype
13925+ (itype-merge-faces product.typ.p.inferred product.closed sub.product-fit)
13926+ =/ actual-cast=itype [%fn sample.typ.p.inferred product]
13927+ =/ cast=ifit
13928+ (itype-fit actual-cast closed sub.product-fit next.product-fit)
13929+ ?. ?=(%ok -.cast) ~
13930+ =/ merged=itype (itype-merge-faces actual-cast closed sub.cast)
13931+ =/ adjusted=iresult
13932+ [%& merged state.p.inferred(sub sub.cast, next next.cast)]
13933+ =/ added=(unit iadded-definition)
13934+ (add-supported-result init-def adjusted init-state env checked artifacts.resolution)
13935+ ?~ added ~
13936+ =/ recovered=(unit ischeme) (ienv-lookup init.parts env.u.added)
13937+ ?~ recovered ~
13938+ ?. ?=(~ vars.u.recovered) ~
13939+ ?. ?=(~ (itype-vars typ.u.recovered)) ~
13940+ `[env.u.added grouped.resolution artifacts.u.added]
13941+::
13942+++ derived-poke-command-scheme
13943+ |= [prelude=ifile action=itype]
13944+ ^- (unit ischeme)
13945+ =/ prep=iprelude [prelude ~ ~]
13946+ =/ raw=(unit ischeme) (compatible-raw-poke prep)
13947+ ?~ raw ~
13948+ =/ command=(unit ischeme) (find-jibb-mold %cmd prelude)
13949+ =/ unit-template=(unit ischeme) (find-jibb-mold %unit prelude)
13950+ ?~ command ~
13951+ ?~ unit-template ~
13952+ ?. (standard-unit-template u.unit-template /lib/jibb/prelude/jibb) ~
13953+ ?. ?=([@ ~] vars.u.command) ~
13954+ ?. ?=(%union -.typ.u.command) ~
13955+ ?. =(origin.typ.u.command `[/lib/jibb/prelude/jibb %cmd]) ~
13956+ ?. (identity-union-parameters vars.u.command args.typ.u.command) ~
13957+ =/ m=@ud i.vars.u.command
13958+ ?: (itype-var-is-atom m typ.u.command) ~
13959+ ?. (levy (itype-vars typ.u.command) |=(n=@ud =(n m))) ~
13960+ ?: (itype-has-tag typ.u.command) ~
13961+ =/ error=(unit itype) (template-apply u.unit-template ~[[%atom %t]])
13962+ ?~ error ~
13963+ ?. ?=(%union -.typ.u.raw) ~
13964+ =/ poke-case=itype
13965+ [%cell [%const [%term %tas %poke '%poke']] [%cell [%face %p typ.u.raw(label `'raw-poke.internal')] [%face %reply [%fn u.error [%var m]]]]]
13966+ =/ go-case=itype
13967+ [%cell [%const [%term %tas %go '%go']] [%face %url [%atom %t]]]
13968+ =/ wait-case=itype
13969+ [%cell [%const [%term %tas %wait '%wait']] [%cell [%face %gap [%atom %dr]] [%face %msg [%var m]]]]
13970+ =/ now-case=itype
13971+ [%cell [%const [%term %tas %now '%now']] [%face %reply [%fn [%atom %da] [%var m]]]]
13972+ =/ who-case=itype
13973+ [%cell [%const [%term %tas %who '%who']] [%face %reply [%fn [%atom %p] [%var m]]]]
13974+ ?. =(cases.typ.u.command ~[poke-case go-case wait-case now-case who-case]) ~
13975+ =/ command-result=(unit itype) (template-apply u.command ~[[%var 0]])
13976+ ?~ command-result ~
13977+ `[[%fn [%cell action [%fn u.error [%var 0]]] u.command-result] ~[0]]
13978+::
13979+++ store-derived-schemes
13980+ |= [prelude=ifile values=(list term) molds=(list term) state=itype action=itype]
13981+ ^- (unit [state=ischeme action=ischeme])
13982+ =/ prep=iprelude [prelude values molds]
13983+ =/ ask=(unit ischeme) (request-compatible-ask prep)
13984+ ?~ ask ~
13985+ ?^ (itype-vars state) ~
13986+ ?^ (itype-vars action) ~
13987+ ?: |((itype-has-tag state) (itype-has-tag action)) ~
13988+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
13989+ ?~ result ~
13990+ =/ request=ischeme [[%fn [%fn state [%var 0]] u.result] ~[0]]
13991+ =/ constructor=(unit ischeme) (derived-poke-command-scheme prelude action)
13992+ ?~ constructor ~
13993+ `[request u.constructor]
13994+::
13995+++ program-subs-watch
13996+ |= [d=def imports=ijimports graph=irequest-graph prelude=ifile]
13997+ ^- ?
13998+ ?. ?=(%value -.d) |
13999+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) |
14000+ =/ body=expr
14001+ ?- -.val.d
14002+ %gate body.val.d
14003+ %gate-wide body.val.d
14004+ * val.d
14005+ ==
14006+ =. body (program-transparent body)
14007+ ?. ?=(%list -.body) |
14008+ ?. ?=([* ~] items.body) |
14009+ =/ watch=expr (program-transparent i.items.body)
14010+ ?. ?=(%tuple -.watch) |
14011+ ?. ?=([* * ~] items.watch) |
14012+ =/ tag=item i.items.watch
14013+ =/ payload=item i.t.items.watch
14014+ ?. &(?=(~ face.tag) ?=(~ face.payload)) |
14015+ =/ tag-expr=expr (program-transparent val.tag)
14016+ ?. ?=(%lit -.tag-expr) |
14017+ ?. &(?=(%term form.lit.tag-expr) =(%watch val.lit.tag-expr)) |
14018+ =/ request=expr (program-transparent val.payload)
14019+ ?. ?=(%call -.request) |
14020+ ?. ?=([* ~] args.request) |
14021+ =/ head=expr (program-transparent head.request)
14022+ ?. ?=(%wing -.head) |
14023+ ?. ?=([@ @ ~] names.head) |
14024+ =/ case=term i.names.head
14025+ =/ face=term i.t.names.head
14026+ =/ callback=expr (program-transparent i.args.request)
14027+ ?. ?=(%ctor -.callback) |
14028+ ?. ?=(%term form.tag.callback) |
14029+ ?| ?=(^ (derived-request-member case face imports graph prelude))
14030+ ?=(^ (derived-store-request-member case face imports graph prelude))
14031+ ==
14032+::
14033+:: Exact derived-member and request-evidence identity, shared by direct
14034+:: program watches and direct data-page loads. Only a plain request in the
14035+:: selected interface's own source-backed graph can establish this shape.
14036+++ derived-request-member
14037+ |= [case=term face=term imports=ijimports graph=irequest-graph prelude=ifile]
14038+ ^- (unit ischeme)
14039+ =/ selected=(list [face=term interface=ifile])
14040+ (skim imports |=(j=[face=term interface=ifile] =(face face.j)))
14041+ ?. ?=([* ~] selected) ~
14042+ =/ iface=ifile interface.i.selected
14043+ =/ member=(unit ischeme) (ienv-lookup case values.iface)
14044+ ?~ member ~
14045+ ?~ source.iface ~
14046+ =/ evidence=(list irequest-evidence)
14047+ (skim requests.graph |=(r=irequest-evidence &(=(api-at.r at.iface) =(name.r case))))
14048+ ?. ?=([* ~] evidence) ~
14049+ =/ request-evidence=irequest-evidence i.evidence
14050+ ?. =(u.source.iface api-source.request-evidence) ~
14051+ ?. =(name.path.path.request-evidence case) ~
14052+ ?~ graph.iface ~
14053+ ?. (lien requests.u.graph.iface |=(r=irequest-evidence =(r request-evidence))) ~
14054+ ?. ?=(~ scry.path.path.request-evidence) ~
14055+ ?. &(?=(~ diffs.path.request-evidence) ?=(~ diffs.path.path.request-evidence)) ~
14056+ ?: (lien segments.path.path.request-evidence |=(p=pseg !?=(%knot -.p))) ~
14057+ ?. ?=([@ ~] vars.u.member) ~
14058+ =/ message=@ud i.vars.u.member
14059+ ?. ?=(%fn -.typ.u.member) ~
14060+ ?. ?=(%fn -.sample.typ.u.member) ~
14061+ ?. =(sample.sample.typ.u.member full.path.request-evidence) ~
14062+ ?. =(product.sample.typ.u.member [%var message]) ~
14063+ =/ prep=iprelude [prelude prelude-values.graph prelude-molds.graph]
14064+ =/ ask=(unit ischeme) (request-compatible-ask prep)
14065+ ?~ ask ~
14066+ =/ result=(unit itype) (template-apply u.ask ~[[%var message]])
14067+ ?~ result ~
14068+ ?. =(product.typ.u.member u.result) ~
14069+ member
14070+::
14071+:: Store state is watchable by definition, but only the actual derived member
14072+:: of the uniquely selected source-bound store interface proves that fact.
14073+++ derived-store-request-member
14074+ |= [case=term face=term imports=ijimports graph=irequest-graph prelude=ifile]
14075+ ^- (unit ischeme)
14076+ ?. =(%state case) ~
14077+ =/ selected=(list [face=term interface=ifile])
14078+ (skim imports |=(j=[face=term interface=ifile] =(face face.j)))
14079+ ?. ?=([* ~] selected) ~
14080+ =/ iface=ifile interface.i.selected
14081+ =/ member=(unit ischeme) (ienv-lookup %state values.iface)
14082+ ?~ member ~
14083+ ?~ source.iface ~
14084+ =/ evidence=(list istore-request-evidence)
14085+ (skim stores.graph |=(r=istore-request-evidence =(store-at.r at.iface)))
14086+ ?. ?=([* ~] evidence) ~
14087+ =/ request=istore-request-evidence i.evidence
14088+ ?. =(u.source.iface source.request) ~
14089+ ?~ graph.iface ~
14090+ ?. (lien stores.u.graph.iface |=(r=istore-request-evidence =(r request))) ~
14091+ =/ derived=(unit [state=ischeme action=ischeme])
14092+ (store-derived-schemes prelude prelude-values.graph prelude-molds.graph state.request action.request)
14093+ ?~ derived ~
14094+ ?. =(u.member state.u.derived) ~
14095+ =/ constructor=(unit ischeme) (ienv-lookup action-name.request values.iface)
14096+ ?~ constructor ~
14097+ ?. =(u.constructor action.u.derived) ~
14098+ member
14099+::
14100+++ program-main-context
14101+ |= [main=def ds=(list def) resolution=iresolved initial=istate]
14102+ ^- iresolved
14103+ ?^ (ienv-lookup %main env.resolution) resolution
14104+ =/ heads=(unit igate-prelude-evidence)
14105+ (direct-prelude-evidence ds prelude.initial)
14106+ ?~ heads resolution
14107+ =/ checked=(map term def) (direct-checked-gates ds env.resolution)
14108+ =/ completed=[env=ienv artifacts=(list iwidth-definition)]
14109+ (add-supported-defs-core ~[main] ds checked heads env.resolution molds.initial globals.initial externals.initial surs.initial mark-externals.initial marks.initial jimports.initial reserved-molds.initial at.initial prelude.initial artifacts.resolution grec-index.initial)
14110+ [env.completed grouped.resolution artifacts.completed]
14111+::
14112+:: A static main may retain a generic element message in its ordinary
14113+:: scheme. Instantiate that scheme, specialize it to canonical element !!,
14114+:: and publish only the resulting closed scheme.
14115+++ static-main-specialized
14116+ |= [env=ienv prelude=(unit ifile)]
14117+ ^- (unit ischeme)
14118+ ?~ prelude ~
14119+ =/ element=(unit ischeme) (find-jibb-mold %element u.prelude)
14120+ ?~ element ~
14121+ =/ main=(unit ischeme) (ienv-lookup %main env)
14122+ ?~ main ~
14123+ =/ canonical=(unit itype) (template-apply u.element ~[[%empty ~]])
14124+ ?~ canonical ~
14125+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.main *istate)
14126+ =/ fit=ifit (itype-fit typ.instance u.canonical ~ next.state.instance)
14127+ ?. ?=(%ok -.fit) ~
14128+ =/ closed=itype (itype-normalize typ.instance sub.fit)
14129+ ?^ (itype-vars closed) ~
14130+ ?: (itype-has-tag closed) ~
14131+ ?. ?=(%union -.closed) ~
14132+ ?. ?=(%union -.u.canonical) ~
14133+ ?. &(=(origin.closed origin.u.canonical) =(args.closed args.u.canonical)) ~
14134+ =/ exact=ifit (direct-invariant closed u.canonical ~ next.fit)
14135+ ?. ?=(%ok -.exact) ~
14136+ `[u.canonical ~]
14137+::
14138+:: The load of a direct data page must itself be a direct gate whose
14139+:: transparent body is one plain derived request with a wing or ctor reply.
14140+++ page-load-derived
14141+ |= [name=term ds=(list def) imports=ijimports graph=irequest-graph prelude=ifile]
14142+ ^- ?
14143+ =/ loads=(list def)
14144+ (skim ds |=(d=def &(?=(%value -.d) =(name name.d))))
14145+ ?. ?=([* ~] loads) |
14146+ =/ load=def i.loads
14147+ ?> ?=(%value -.load)
14148+ ?. |(?=(%gate -.val.load) ?=(%gate-wide -.val.load)) |
14149+ =/ body=expr
14150+ ?- -.val.load
14151+ %gate body.val.load
14152+ %gate-wide body.val.load
14153+ * !!
14154+ ==
14155+ =. body (program-transparent body)
14156+ ?. ?=(%call -.body) |
14157+ ?. ?=([* ~] args.body) |
14158+ =/ head=expr (program-transparent head.body)
14159+ ?. ?=(%wing -.head) |
14160+ ?. ?=([@ @ ~] names.head) |
14161+ =/ reply=expr (program-transparent i.args.body)
14162+ ?. ?| &(?=(%wing -.reply) ?=([@ ~] names.reply))
14163+ &(?=(%ctor -.reply) ?=(%term form.tag.reply))
14164+ ==
14165+ |
14166+ ?=(^ (derived-request-member i.names.head i.t.names.head imports graph prelude))
14167+::
14168+++ page-main-closed
14169+ |= [parts=[load=term view=term] ds=(list def) env=ienv prelude=(unit ifile) imports=ijimports graph=irequest-graph]
14170+ ^- ?
14171+ ?~ prelude |
14172+ =/ page=(unit ischeme) (find-jibb-mold %page u.prelude)
14173+ ?~ page |
14174+ =/ main=(unit ischeme) (ienv-lookup %main env)
14175+ ?~ main |
14176+ ?. ?=(~ vars.u.main) |
14177+ ?. ?=(~ (itype-vars typ.u.main)) |
14178+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.page *istate)
14179+ =/ main-fit=ifit (direct-invariant typ.u.main typ.instance ~ next.state.instance)
14180+ ?. ?=(%ok -.main-fit) |
14181+ (page-load-derived load.parts ds imports graph u.prelude)
14182+::
14183+++ program-main-closed
14184+ |= [parts=[init=term update=term view=term subs=term] ds=(list def) env=ienv prelude=(unit ifile) imports=ijimports graph=irequest-graph]
14185+ ^- ?
14186+ ?~ prelude |
14187+ ?~ (ienv-lookup %program values.u.prelude) |
14188+ =/ program=(unit ischeme) (find-jibb-mold %program u.prelude)
14189+ ?~ program |
14190+ =/ main=(unit ischeme) (ienv-lookup %main env)
14191+ ?~ main |
14192+ ?. ?=(~ vars.u.main) |
14193+ ?. ?=(~ (itype-vars typ.u.main)) |
14194+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.program *istate)
14195+ =/ main-fit=ifit (direct-invariant typ.u.main typ.instance ~ next.state.instance)
14196+ ?. ?=(%ok -.main-fit) |
14197+ =/ init=(unit ischeme) (ienv-lookup init.parts env)
14198+ ?~ init |
14199+ ?. ?=(~ vars.u.init) |
14200+ ?. ?=(%fn -.typ.u.init) |
14201+ ?. ?=(~ (itype-vars sample.typ.u.init)) |
14202+ ?. ?=(~ (itype-vars product.typ.u.init)) |
14203+ =/ data=igate-free (gate-free-type sample.typ.u.init 256 ~)
14204+ ?. =(%yes verdict.data) |
14205+ =/ model=igate-free (gate-free-type product.typ.u.init left.data ~)
14206+ ?. =(%yes verdict.model) |
14207+ =/ subs=(list def)
14208+ (skim ds |=(d=def &(?=(%value -.d) =(subs.parts name.d))))
14209+ ?. ?=([* ~] subs) |
14210+ |((program-subs-empty i.subs) (program-subs-watch i.subs imports graph u.prelude))
14211+::
14212+:: The two outer sample faces are binder names, not part of the action/state
14213+:: relation. Leave every face inside either component untouched.
14214+++ store-update-unfaced
14215+ |= typ=itype
14216+ ^- itype
14217+ ?. ?=(%fn -.typ) typ
14218+ ?. ?=(%cell -.sample.typ) typ
14219+ =/ head=itype hed.sample.typ
14220+ =/ tail=itype tal.sample.typ
14221+ =? head ?=(%face -.head) body.head
14222+ =? tail ?=(%face -.tail) body.tail
14223+ typ(sample [%cell head tail])
14224+::
14225+:: The builder erases the action from main. Recover it only from the local
14226+:: poke mold and check both ordinary components invariantly.
14227+++ store-main-closed
14228+ |= [parts=[init=term update=term] action=term env=ienv molds=imold-types prelude=(unit ifile)]
14229+ ^- (unit ischeme)
14230+ ?~ prelude ~
14231+ =/ builder=(unit ischeme) (ienv-lookup %store values.u.prelude)
14232+ ?~ builder ~
14233+ ?. ?=([@ @ ~] vars.u.builder) ~
14234+ =/ state-var=@ud i.vars.u.builder
14235+ =/ action-var=@ud i.t.vars.u.builder
14236+ ?: =(state-var action-var) ~
14237+ =/ builder-sample=itype
14238+ [%cell [%face %init [%var state-var]] [%face %update [%fn [%cell [%var action-var] [%var state-var]] [%var state-var]]]]
14239+ =/ builder-product=itype [%cell [%face %init [%var state-var]] [%face %update [%noun ~]]]
14240+ ?. =(typ.u.builder [%fn builder-sample builder-product]) ~
14241+ =/ store=(unit ischeme) (find-jibb-mold %store u.prelude)
14242+ ?~ store ~
14243+ ?. ?=([@ ~] vars.u.store) ~
14244+ ?. =(typ.u.store [%cell [%face %init [%var i.vars.u.store]] [%face %update [%noun ~]]]) ~
14245+ =/ state=(unit ischeme) (find-jibb-mold %state [~ molds /tmp ~ ~ ~ ~ ~])
14246+ ?~ state ~
14247+ =/ action-mold=(unit ischeme) (find-jibb-mold action [~ molds /tmp ~ ~ ~ ~ ~])
14248+ ?~ action-mold ~
14249+ ?. &(?=(~ vars.u.state) ?=(~ (itype-vars typ.u.state))) ~
14250+ ?. &(?=(~ vars.u.action-mold) ?=(~ (itype-vars typ.u.action-mold))) ~
14251+ =/ canonical=(unit itype) (template-apply u.store ~[typ.u.state])
14252+ ?~ canonical ~
14253+ =/ main=(unit ischeme) (ienv-lookup %main env)
14254+ =/ main-fit=(unit ifit)
14255+ ?~(main ~ `(direct-invariant typ.u.main u.canonical ~ 0))
14256+ =/ main-ok=?
14257+ ?~ main &
14258+ ?. ?=(~ vars.u.main) |
14259+ ?. ?=(~ (itype-vars typ.u.main)) |
14260+ ?~ main-fit |
14261+ ?=(%ok -.u.main-fit)
14262+ ?. main-ok ~
14263+ =/ init=(unit ischeme) (ienv-lookup init.parts env)
14264+ ?~ init ~
14265+ ?. ?=(~ vars.u.init) ~
14266+ ?. ?=(~ (itype-vars typ.u.init)) ~
14267+ =/ init-fit=ifit (direct-invariant typ.u.init typ.u.state ~ 0)
14268+ ?. ?=(%ok -.init-fit) ~
14269+ =/ update=(unit ischeme) (ienv-lookup update.parts env)
14270+ ?~ update ~
14271+ ?. ?=(~ vars.u.update) ~
14272+ ?. ?=(~ (itype-vars typ.u.update)) ~
14273+ =/ expected=itype [%fn [%cell typ.u.action-mold typ.u.state] typ.u.state]
14274+ =/ update-fit=ifit (direct-invariant (store-update-unfaced typ.u.update) expected ~ 0)
14275+ ?. ?=(%ok -.update-fit) ~
14276+ `[u.canonical ~]
14277+::
767014278++ infer-jibb-file
767114279 |= [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)]
767214280 ^- jfile-result
7673− ?: ?=([%ui %api *] at) [%| (crip "API module needs unsupported inference: {(spud at)}")]
14281+ =/ out=jfile-detailed-result
14282+ (infer-jibb-file-detailed at src externals mark-externals modules active prelude-values prelude-molds cache prelude)
14283+ ?: ?=(%| -.out) [%| message.p.out]
14284+ [%& p.out]
14285+:: Returns structured root-source overlap evidence after the same full check.
14286+++ infer-jibb-file-detailed
14287+ |= [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)]
14288+ ^- jfile-detailed-result
767414289 =/ parsed (parse at src)
7675− ?: ?=(%| -.parsed) [%| (crip "module source does not parse: {(spud at)}")]
14290+ ?: ?=(%| -.parsed) [%| [(crip "module source does not parse: {(spud at)}") ~]]
767614291 =/ mod=module p.parsed
7677− ?. (module-scope-valid mod prelude-values prelude-molds) [%| (crip "module has conflicting names: {(spud at)}")]
7678− =/ vals=(list term) (global-value-names defs.mod)
7679− ?: (lien vals |=(n=term =(n %main)))
7680− [%| (crip "module kind needs unsupported inference: {(spud at)}")]
7681− =/ js=jimports-result (resolve-jibb-imports imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
14292+ =/ duplicate=(unit idiag) (duplicate-defs defs.mod)
14293+ ?^ duplicate [%| [(show-duplicate-fields at src u.duplicate) ~]]
14294+ ?: &(?=([%ui %api *] at) ?=(^ (program-main-def defs.mod)))
14295+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
14296+ ?: ?=([%ui %api *] at)
14297+ =/ iface=(unit ifile) (api-poke-interface at mod mark-externals prelude-values prelude-molds prelude)
14298+ ?^ iface
14299+ =/ checked=ifile u.iface(source `src, graph `[(silt `(list path)`~[at]) ~ ~ modules prelude prelude-values prelude-molds externals mark-externals])
14300+ [%& [checked [[at checked] cache]]]
14301+ ?~ prelude [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
14302+ =/ prepared=iprelude [u.prelude prelude-values prelude-molds]
14303+ =/ narrow=?
14304+ ?. ?=([[%mark *] ~] imports.mod) |
14305+ ?. ?=([[%mold *] ~] defs.mod) |
14306+ ?. =(%paths name.i.defs.mod) |
14307+ !?=(%union -.shape.i.defs.mod)
14308+ ?: narrow
14309+ =/ request=(each ione-request-interface @t)
14310+ (one-request-interface-graph at src externals mark-externals modules active cache `prepared)
14311+ ?: ?=(%| -.request) [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
14312+ =/ checked=ifile iface.p.request
14313+ [%& [checked [[at checked] dependencies.paths.support.p.request]]]
14314+ =/ multi=(each [iface=ifile cache=jcache] @t)
14315+ (multi-request-interface-graph at src externals mark-externals modules active cache `prepared)
14316+ ?: ?=(%| -.multi) [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
14317+ [%& [iface.p.multi [[at iface.p.multi] cache.p.multi]]]
14318+ =/ main=(unit def) (program-main-def defs.mod)
14319+ =/ main-parts=(unit [init=term update=term view=term subs=term])
14320+ ?~(main ~ (program-main-parts u.main))
14321+ =/ page-parts=(unit [load=term view=term])
14322+ ?~(main ~ (page-main-parts u.main))
14323+ =/ store-parts=(unit [init=term update=term])
14324+ ?~(main ~ (store-main-parts u.main))
14325+ =/ declared=(unit istore-declaration)
14326+ ?~(store-parts ~ (store-declaration mod prelude-values prelude-molds))
14327+ ?: &(?=(^ store-parts) ?=(~ declared))
14328+ [%| [(crip "module kind or scope needs unsupported inference: {(spud at)}") ~]]
14329+ ?: &(?=([%ui %stores *] at) ?=(^ main) ?=(~ store-parts))
14330+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
14331+ =/ ds=(list def) ?~(declared defs.mod defs.u.declared)
14332+ =/ checking=module mod(defs ds)
14333+ ?. (module-scope-valid checking prelude-values prelude-molds)
14334+ [%| [(crip "module has conflicting names: {(spud at)}") ~]]
14335+ =/ vals=(list term) (global-value-names ds)
14336+ =/ js=jimports-detailed-result (resolve-jibb-imports-detailed imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
768214337 ?: ?=(%| -.js) [%| p.js]
7683− =/ molds=imolds (collect-simple-molds defs.mod)
14338+ =/ collected=grec-collected
14339+ ?^ imports.mod [(collect-simple-molds ds) *(map term shape)]
14340+ (grec-collect-molds ds)
14341+ =/ molds=imolds molds.collected
768414342 =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
768514343 =/ surs=(list term) (collect-sur-imports imports.mod)
768614344 =/ marks=(list term) (collect-mark-imports imports.mod)
768714345 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
768814346 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7689− =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude]
7690− =/ mts=(each imold-types @t) (module-mold-types molds state)
7691− ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
7692− =/ env=ienv (resolve-supported-defs defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
7693− ?. (module-values-complete defs.mod env)
7694− [%| (crip "module definitions need unsupported inference: {(spud at)}")]
7695− [%& [[env p.mts at] [[at [env p.mts at]] cache.p.js]]]
14347+ =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
14348+ :: Source and scope were checked above; preserve that exact root and prelude.
14349+ :: This first integration only indexes import-free library sources.
14350+ =/ index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])
14351+ ?^ imports.mod ~
14352+ ?~ prelude ~
14353+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude)
14354+ ?~ standard ~
14355+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
14356+ =/ index=(map term shape) proofs.collected
14357+ ?. !=(index *(map term shape)) ~
14358+ ?: (lien molds |=(m=[name=term body=shape] =(%list name.m))) ~
14359+ `[at src u.prelude index]
14360+ =. grec-index.state index
14361+ =/ mts=(each imold-types imold-failure) (module-mold-types-detail molds state)
14362+ ?: ?=(%| -.mts)
14363+ ?~ overlap.p.mts [%| [(crip "{(trip message.p.mts)}: {(spud at)}") ~]]
14364+ =/ witness=[name=term cases=upair] u.overlap.p.mts
14365+ =/ first=@t (show-error src [at line.beg.first.cases.witness col.beg.first.cases.witness "first union case"])
14366+ =/ second=@t (show-error src [at line.beg.second.cases.witness col.beg.second.cases.witness "overlapping case"])
14367+ =/ msg=@t (of-wain:format ~[(crip "module mold {(trip name.witness)} has overlapping cases") first second])
14368+ [%| [msg `[at src name.witness cases.witness]]]
14369+ =/ resolution=iresolved
14370+ ?~ index
14371+ (resolve-groups ds molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
14372+ (resolve-groups-core ds molds globals externals surs mark-externals marks resolved.p.js reserved at prelude index)
14373+ =/ env=ienv env.resolution
14374+ =/ recovered=iresolved
14375+ ?~ main resolution
14376+ ?~ main-parts resolution
14377+ =/ updated=(unit iresolved)
14378+ (program-update-context u.main u.main-parts ds resolution state)
14379+ =/ with-update=iresolved ?~(updated resolution u.updated)
14380+ =/ subscribed=(unit iresolved)
14381+ (program-subs-context u.main-parts ds with-update state)
14382+ =/ with-subs=iresolved ?~(subscribed with-update u.subscribed)
14383+ =/ viewed=(unit iresolved)
14384+ (program-view-context u.main-parts ds with-subs state)
14385+ =/ with-keyed-view=iresolved ?~(viewed with-subs u.viewed)
14386+ =/ plain-view=(unit iresolved)
14387+ ?^(viewed ~ (program-plain-view-context u.main-parts ds with-keyed-view state))
14388+ =/ with-view=iresolved ?~(plain-view with-keyed-view u.plain-view)
14389+ =/ initialized=(unit iresolved)
14390+ (program-init-context u.main u.main-parts ds with-view state)
14391+ =/ with-initialized=iresolved ?~(initialized with-view u.initialized)
14392+ =/ plain-init=(unit iresolved)
14393+ ?^(initialized ~ (program-plain-init-context u.main-parts ds with-initialized state))
14394+ =/ components=iresolved ?~(plain-init with-initialized u.plain-init)
14395+ (program-main-context u.main ds components state)
14396+ =. env env.recovered
14397+ =. artifacts.resolution artifacts.recovered
14398+ =. env
14399+ ?: (module-values-complete ds env) env
14400+ ?: |(?=([%ui %stores *] at) ?=(^ imports.mod) ?=(^ prelude) ?=(^ prelude-values) ?=(^ prelude-molds)) env
14401+ ?: (gth (met 3 src) 65.536) env
14402+ ?: (gth (lent ds) 64) env
14403+ ?. (dg-source-candidate ds 64) env
14404+ =/ transaction=(unit dgcommit) (dg-root-source at src)
14405+ ?~ transaction env
14406+ ?: (dg-interface-safe env.u.transaction) env.u.transaction
14407+ env
14408+ =/ required=(list def)
14409+ ?~ store-parts ds
14410+ (skim ds |=(d=def !&(?=(%value -.d) =(%main name.d))))
14411+ ?. (module-values-complete required env)
14412+ =/ pending=(unit [at=span msg=tape]) (module-pending-tag required env state 64)
14413+ ?^ pending
14414+ [%| [(show-error src [at line.beg.at.u.pending col.beg.at.u.pending msg.u.pending]) ~]]
14415+ [%| [(crip "module definitions need unsupported inference: {(spud at)}") ~]]
14416+ =/ initial=irequest-graph [(silt `(list path)`~[at]) ~ ~ modules prelude prelude-values prelude-molds externals mark-externals]
14417+ =/ graph=(unit irequest-graph) (request-graph-merge resolved.p.js initial (add 1 (lent resolved.p.js)))
14418+ ?~ graph [%| ['module request evidence needs unsupported inference' ~]]
14419+ =/ static-main=(unit ischeme)
14420+ ?~ main ~
14421+ ?^ main-parts ~
14422+ ?^ page-parts ~
14423+ ?^ store-parts ~
14424+ (static-main-specialized env prelude)
14425+ =? env ?=(^ static-main)
14426+ [[%main u.static-main] (skim env |=(entry=[name=term scheme=ischeme] !=(%main name.entry)))]
14427+ =/ store-main=(unit ischeme)
14428+ ?~ store-parts ~
14429+ ?~ declared ~
14430+ (store-main-closed u.store-parts action.u.declared env p.mts prelude)
14431+ =? env ?=(^ store-main)
14432+ [[%main u.store-main] (skim env |=(entry=[name=term scheme=ischeme] !=(%main name.entry)))]
14433+ =/ kind-ok=?
14434+ ?~ main &
14435+ ?^ main-parts (program-main-closed u.main-parts ds env prelude resolved.p.js u.graph)
14436+ ?^ page-parts (page-main-closed u.page-parts ds env prelude resolved.p.js u.graph)
14437+ ?^ store-parts ?=(^ store-main)
14438+ ?=(^ static-main)
14439+ ?. kind-ok
14440+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
14441+ =/ store-derived=(unit [values=ienv evidence=istore-request-evidence])
14442+ ?~ declared ~
14443+ ?~ prelude ~
14444+ =/ state=(unit ischeme) (find-jibb-mold %state [~ p.mts at ~ ~ ~ ~ ~])
14445+ ?~ state ~
14446+ =/ action-mold=(unit ischeme) (find-jibb-mold action.u.declared [~ p.mts at ~ ~ ~ ~ ~])
14447+ ?~ action-mold ~
14448+ =/ schemes=(unit [state=ischeme action=ischeme])
14449+ (store-derived-schemes u.prelude prelude-values prelude-molds typ.u.state typ.u.action-mold)
14450+ ?~ schemes ~
14451+ =/ evidence=istore-request-evidence
14452+ [at src typ.u.state action.u.declared typ.u.action-mold]
14453+ `[~[[%state state.u.schemes] [action.u.declared action.u.schemes]] evidence]
14454+ ?: &(?=(^ declared) ?=(~ store-derived))
14455+ [%| [(crip "store derived gates need unsupported inference: {(spud at)}") ~]]
14456+ =? env ?=(^ store-derived) (weld values.u.store-derived env)
14457+ =? graph ?=(^ store-derived)
14458+ `u.graph(stores [evidence.u.store-derived stores.u.graph])
14459+ ?. (request-graph-bounded u.graph)
14460+ [%| ['module request evidence needs unsupported inference' ~]]
14461+ =/ iface=ifile [env p.mts at ~ artifacts.resolution ~ `src graph]
14462+ [%& [iface [[at iface] cache.p.js]]]
14463+::
14464+:: A source-bound analysis of one named mold, not a module, island,
14465+:: request, watchability or runtime check. The host owns the trusted
14466+:: prepared prelude, canonical paths and reader/source version identities.
14467+:: The 256-node cap covers only classification, not source/graph work.
14468++$ igate-free-mold
14469+ [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]
14470+++ gate-free-mold-source
14471+ |= [file=path src=@t name=term externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude) fuel=@ud]
14472+ ^- (each igate-free-mold @t)
14473+ ?~ file [%| 'mold analysis needs a path ending in jibb']
14474+ ?. =(%jibb (rear file)) [%| 'mold analysis needs a path ending in jibb']
14475+ ?: |(=(file /lib/jibb/internal/jibb) =(file /lib/jibb/primitives/jibb))
14476+ [%| 'the prelude internal modules are private']
14477+ ?: ?=([%ui %api *] file) [%| 'API declarations need unsupported mold analysis']
14478+ ?: ?=([%ui %stores *] file) [%| 'store declarations need unsupported mold analysis']
14479+ =/ entries=jbundle (skim modules |=(m=jsource =(file at.m)))
14480+ ?: (gth (lent entries) 1) [%| 'duplicate root module sources']
14481+ =/ wrong-root=? ?~(entries | !=(source.i.entries src))
14482+ ?: wrong-root [%| 'root module source does not match bundle']
14483+ =/ parsed (parse file src)
14484+ ?: ?=(%| -.parsed) [%| 'mold source does not parse']
14485+ =/ mod=module p.parsed
14486+ =/ duplicate=(unit idiag) (duplicate-defs defs.mod)
14487+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
14488+ ?~ prepared [%| 'mold analysis needs the prepared prelude']
14489+ ?. (module-scope-valid mod values.u.prepared molds.u.prepared)
14490+ [%| 'mold source has conflicting or unsupported scope']
14491+ =/ selected=(list def)
14492+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(name.d name))))
14493+ ?~ selected [%| 'selected mold is not declared']
14494+ ?^ t.selected [%| 'selected mold is not unique']
14495+ ?> ?=(%mold -.i.selected)
14496+ =/ public=ifile iface.u.prepared
14497+ =/ js=jimports-result
14498+ (resolve-jibb-imports imports.mod externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
14499+ ?: ?=(%| -.js) [%| p.js]
14500+ =/ ms=imolds (collect-simple-molds defs.mod)
14501+ =/ vals=(list term) (global-value-names defs.mod)
14502+ =/ globals=(list term) (weld values.u.prepared (weld (import-binding-names imports.mod) vals))
14503+ =/ surs=(list term) (collect-sur-imports imports.mod)
14504+ =/ declared=(list term) (collect-mark-imports imports.mod)
14505+ =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
14506+ =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
14507+ =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~ ~ ~ ~ ~ ~]
14508+ =/ inferred=(unit [template=ischeme state=istate])
14509+ (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
14510+ ?~ inferred [%| 'selected mold needs unsupported inference']
14511+ =/ template=ischeme template.u.inferred
14512+ =. typ.template (label-direct-union typ.template shape.i.selected name state)
14513+ =. typ.template (itype-normalize typ.template sub.state.u.inferred)
14514+ =/ cap=@ud (min fuel 256)
14515+ =/ analysis=igate-free (gate-free-type typ.template cap ~)
14516+ [%& [file src name u.prepared externals marks modules cache.p.js template fuel cap analysis]]
769614517::
769714518:: +golden-types-with-modules fails closed for imports without prelude
769814519:: scope. +golden-types-with-prelude resolves supported library graphs;
@@ -7703,6 +14524,8 @@
770314524 ^- @t
770414525 =/ parsed (parse file src)
770514526 ?: ?=(%| -.parsed) (show-error src p.parsed)
14527+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
14528+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
770614529 ?: (lien imports.p.parsed |=(i=import ?=(%jibb -.i)))
770714530 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
770814531 (golden-types-with-marks file src externals mark-externals)
@@ -7717,6 +14540,8 @@
771714540 ^- @t
771814541 =/ parsed (parse file src)
771914542 ?: ?=(%| -.parsed) (show-error src p.parsed)
14543+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
14544+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
772014545 ?: =(0 prelude-source) 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
772114546 =/ prelude (parse /lib/jibb/prelude/jibb prelude-source)
772214547 ?: ?=(%| -.prelude) 'partial inference; module not checked\0aprelude source does not parse; module import inference unsupported'
@@ -7724,11 +14549,19 @@
772414549 ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
772514550 (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
772614551::
14552+++ golden-types-with-prelude-and-internal
14553+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prelude-source=@t internal-source=@t]
14554+ ^- @t
14555+ =/ prepared=(unit iprelude) (prepare-prelude-with-internal prelude-source internal-source)
14556+ (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
14557+::
772714558++ golden-types-with-prepared-prelude
772814559 |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prepared=(unit iprelude)]
772914560 ^- @t
773014561 =/ parsed (parse file src)
773114562 ?: ?=(%| -.parsed) (show-error src p.parsed)
14563+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
14564+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
773214565 ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
773314566 =/ prelude-values=(list term) values.u.prepared
773414567 =/ prelude-molds=(list term) molds.u.prepared
@@ -7740,7 +14573,7 @@
774014573 ?: ?=(%| -.js) (of-wain:format ~['partial inference; module not checked' p.js])
774114574 =/ scope-values=(list term)
774214575 (weld prelude-values (weld (collect-sur-imports imports.p.parsed) (collect-mark-imports imports.p.parsed)))
7743− (golden-types-in-context file src externals mark-externals resolved.p.js scope-values prelude-molds iface)
14576+ (golden-types-in-context-core file src externals mark-externals resolved.p.js scope-values prelude-molds iface prepared)
774414577::
774514578:: +golden-types-with-marks: supply declared mark types separately from /sur
774614579:: entries, as [mark result] with the result from +read-mark:jibb-import.
@@ -7771,15 +14604,60 @@
777114604++ golden-types-in-context
777214605 |= [file=path src=@t externals=iexternals mark-externals=imark-externals jimports=ijimports prelude-values=(list term) reserved-molds=(list term) prelude=(unit ifile)]
777314606 ^- @t
14607+ (golden-types-in-context-core file src externals mark-externals jimports prelude-values reserved-molds prelude ~)
14608+++ golden-types-in-context-core
14609+ |= [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)]
14610+ ^- @t
777414611 =. reserved-molds (weld reserved-molds (turn jimports |=(j=[face=term interface=ifile] face.j)))
777514612 =/ parsed (parse file src)
777614613 ?: ?=(%| -.parsed) (show-error src p.parsed)
14614+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
14615+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
14616+ ?: (module-has-reserved-proj p.parsed)
14617+ 'module has reserved proj name'
777714618 =/ ds=(list def) defs.p.parsed
777814619 =/ molds=imolds (collect-simple-molds ds)
777914620 =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
778014621 =/ surs=(list term) (collect-sur-imports imports.p.parsed)
778114622 =/ marks=(list term) (collect-mark-imports imports.p.parsed)
7782− =/ env=ienv (resolve-supported-defs ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
14623+ =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
14624+ =/ cycles=(list icycle) (definite-value-cycles ds globals)
14625+ =/ env=ienv env.resolution
14626+ =/ recovered=(list term) ~
14627+ =/ eligible=?
14628+ ?& ?=(~ imports.p.parsed)
14629+ ?=(~ jimports)
14630+ !?=([%ui %api *] file)
14631+ !?=([%ui %stores *] file)
14632+ !(lien (global-value-names ds) |=(n=term =(n %main)))
14633+ !(module-values-complete ds env)
14634+ (lte (met 3 src) 65.536)
14635+ (lte (lent ds) 64)
14636+ ?| &(?=(~ prepared) ?=(~ prelude) ?=(~ prelude-values) ?=(~ reserved-molds) (module-scope-valid p.parsed ~ ~) (dg-source-candidate ds 64))
14637+ ?& ?=(^ prepared)
14638+ ?=(^ prelude)
14639+ =(u.prelude iface.u.prepared)
14640+ =(prelude-values values.u.prepared)
14641+ =(reserved-molds molds.u.prepared)
14642+ (module-scope-valid p.parsed values.u.prepared molds.u.prepared)
14643+ (dg-prepared-candidate ds 64)
14644+ ==
14645+ ==
14646+ ==
14647+ =/ transaction=(unit dgcommit)
14648+ ?. eligible ~
14649+ ?~ prepared (dg-root-source file src)
14650+ (dg-root-prepared file src u.prepared)
14651+ =. recovered
14652+ ?~ transaction ~
14653+ ?. &((module-values-complete ds env.u.transaction) (dg-interface-safe env.u.transaction)) ~
14654+ (turn (skim env.u.transaction |=(entry=[name=term scheme=ischeme] ?=(~ (ienv-lookup name.entry env)))) |=(entry=[name=term scheme=ischeme] name.entry))
14655+ =. env
14656+ ?~ transaction env
14657+ ?: &((module-values-complete ds env.u.transaction) (dg-interface-safe env.u.transaction)) env.u.transaction
14658+ env
14659+ =/ source-defs=(map term def) (direct-checked-gates ds env)
14660+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
778314661 =/ lines=(list @t) ~
778414662 |-
778514663 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
@@ -7788,8 +14666,30 @@
778814666 $(ds t.ds, lines [(show-partial-mold file src d molds) lines])
778914667 ?. (unique-value-name name.d globals)
779014668 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
14669+ =/ cycle=(list icycle) (skim cycles |=(c=icycle =(name.c name.d)))
14670+ ?^ cycle
14671+ =/ diag=idiag ["non-gate value depends on itself through a cycle" ~[[first.i.cycle "value in cycle"] [next.i.cycle "dependency in cycle"]]]
14672+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d diag) lines])
14673+ ?: (lien recovered |=(n=term =(n name.d)))
14674+ =/ found=(unit ischeme) (ienv-lookup name.d env)
14675+ ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: committed definition unavailable") lines])
14676+ ?: (itype-has-hidden-recursive typ.u.found)
14677+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive mold name is not available in this scope") lines])
14678+ ?: (itype-has-hidden-generic typ.u.found)
14679+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: generic union name is not available in this scope") lines])
14680+ =/ typ=itype (canonical-itype typ.u.found vars.u.found)
14681+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
14682+ $(ds t.ds, lines [line lines])
14683+ ?: (lien grouped.resolution |=(n=term =(n name.d)))
14684+ =/ found=(unit ischeme) (ienv-lookup name.d env)
14685+ ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive group unavailable") lines])
14686+ =/ typ=itype (canonical-itype typ.u.found vars.u.found)
14687+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
14688+ $(ds t.ds, lines [line lines])
779114689 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7792− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude]
14690+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
14691+ =. gate-defs.initial source-defs
14692+ =. head-evidence.initial heads
779314693 =. initial (reserve-def-caps val.d initial)
779414694 =/ result=iresult
779514695 ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
@@ -7797,6 +14697,11 @@
779714697 (infer-fragment val.d env initial)
779814698 ?: ?=(%| -.result)
779914699 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
14700+ =. state.p.result (promote-restricted-numbers state.p.result env)
14701+ =. 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)))
14702+ =/ hole=(unit idiag) (unresolved-hole holes.state.p.result holes.initial state.p.result)
14703+ ?^ hole
14704+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d u.hole) lines])
780014705 =/ merged=(unit [first=icap second=icap])
780114706 (merged-capitals caps.state.p.result sub.state.p.result)
780214707 ?^ merged
@@ -7819,7 +14724,672 @@
781914724 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
782014725 ?: (gth (lent vars) 26)
782114726 $(ds t.ds, lines [(crip "++ {(trip name.d)}: too many variables for partial printer") lines])
14727+ ?~ (width-finalize projections.state.p.result sub.state.p.result vars)
14728+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: record projection elaboration needs unsupported inference") lines])
782214729 =/ printable=itype (canonical-itype typ vars)
782314730 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
782414731 $(ds t.ds, lines [line lines])
14732+:: Experimental module-owned pending-constraint generalization only.
14733+:: Inputs, IDs and substitution come from one checker-owned transaction.
14734++$ dgscan [ids=(list @ud) fuel=@ud]
14735+++ dg-scan
14736+ |= [todo=(list itype) sub=isub fuel=@ud ids=(list @ud)]
14737+ ^- (unit dgscan)
14738+ ?~ todo `[ids fuel]
14739+ ?: =(0 fuel) ~
14740+ =. fuel (dec fuel)
14741+ =/ t=itype i.todo
14742+ ?: ?=(?(%var %fvar %avar %rvar %nvar %rnvar %tag) -.t)
14743+ =/ node-id=@ud ?:(?=(%tag -.t) id.t +.t)
14744+ =/ found=(unit itype) (itype-lookup node-id sub)
14745+ ?~ found $(todo t.todo, ids [node-id ids])
14746+ ?: &(?=(?(%rvar %rnvar) -.u.found) =(node-id +.u.found))
14747+ $(todo t.todo, ids [node-id ids])
14748+ $(todo [u.found t.todo])
14749+ ?: ?=(%jrec -.t) $(todo t.todo)
14750+ ?+ -.t ~
14751+ %collection $(todo (weld args.t t.todo))
14752+ %union $(todo (weld args.t (weld cases.t t.todo)))
14753+ %face $(todo [body.t t.todo])
14754+ %fn $(todo [sample.t product.t t.todo])
14755+ %cell $(todo [hed.t tal.t t.todo])
14756+ %atom $(todo t.todo)
14757+ %any-atom $(todo t.todo)
14758+ %flag $(todo t.todo)
14759+ %noun $(todo t.todo)
14760+ %empty $(todo t.todo)
14761+ %const $(todo t.todo)
14762+ ==
14763+::
14764+++ dg-scan-ids
14765+ |= [ids=(list @ud) sub=isub fuel=@ud blocked=(list @ud)]
14766+ ^- (unit dgscan)
14767+ ?~ ids `[blocked fuel]
14768+ =/ one=(unit dgscan) (dg-scan ~[[%var i.ids]] sub fuel blocked)
14769+ ?~ one ~
14770+ $(ids t.ids, fuel fuel.u.one, blocked ids.u.one)
14771+::
14772+++ dg-env
14773+ |= [env=ienv sub=isub fuel=@ud blocked=(list @ud)]
14774+ ^- (unit dgscan)
14775+ ?~ env `[blocked fuel]
14776+ =/ sc=ischeme scheme.i.env
14777+ :: Quantifiers are local to the scheme: first find raw free IDs, then
14778+ :: follow those IDs in the module substitution without capturing them.
14779+ =/ raw=(unit dgscan) (dg-scan ~[typ.sc] ~ fuel ~)
14780+ ?~ raw ~
14781+ =/ free=(list @ud) (skim ids.u.raw |=(n=@ud !(lien vars.sc |=(q=@ud =(q n)))))
14782+ =/ resolved=(unit dgscan) (dg-scan-ids free sub fuel.u.raw blocked)
14783+ ?~ resolved ~
14784+ $(env t.env, fuel fuel.u.resolved, blocked ids.u.resolved)
14785+::
14786+++ dg-obligations
14787+ |= [pending=(list dgo) sub=isub fuel=@ud blocked=(list @ud)]
14788+ ^- (unit dgscan)
14789+ ?~ pending `[blocked fuel]
14790+ =/ found=(unit dgscan) (dg-scan ~[left.i.pending right.i.pending] sub fuel blocked)
14791+ ?~ found ~
14792+ $(pending t.pending, fuel fuel.u.found, blocked ids.u.found)
14793+::
14794+++ dg-tags
14795+ |= [tags=(list ipending) sub=isub fuel=@ud blocked=(list @ud)]
14796+ ^- (unit dgscan)
14797+ ?~ tags `[blocked fuel]
14798+ ?: =(0 fuel) ~
14799+ =/ found=(unit itype) (itype-lookup id.i.tags sub)
14800+ ?~ found $(tags t.tags, fuel (dec fuel), blocked [id.i.tags blocked])
14801+ :: Until this entry is explicitly discharged, retain variables reachable
14802+ :: through its binding; mere existence of a substitution is not proof.
14803+ =/ reached=(unit dgscan) (dg-scan ~[u.found] sub (dec fuel) blocked)
14804+ ?~ reached ~
14805+ $(tags t.tags, fuel fuel.u.reached, blocked ids.u.reached)
14806+::
14807+++ dg-generalize
14808+ |= [typ=itype env=ienv pending=(list dgo) tags=(list ipending) captured=(list @ud) state=istate fuel=@ud]
14809+ ^- (unit ischeme)
14810+ :: Bound the obligation list and all graph/substitution walks. The
14811+ :: substitution is assumed checker-owned and occurs-checked.
14812+ ?: (gth (lent pending) 64) ~
14813+ =/ capt=(unit dgscan) (dg-scan-ids captured sub.state fuel ~)
14814+ ?~ capt ~
14815+ =/ env-free=(unit dgscan) (dg-env env sub.state fuel.u.capt ids.u.capt)
14816+ ?~ env-free ~
14817+ =/ obligations=(unit dgscan) (dg-obligations pending sub.state fuel.u.env-free ids.u.env-free)
14818+ ?~ obligations ~
14819+ =/ tagged=(unit dgscan) (dg-tags tags sub.state fuel.u.obligations ids.u.obligations)
14820+ ?~ tagged ~
14821+ =/ bounded=(unit dgscan) (dg-scan ~[typ] sub.state fuel.u.tagged ~)
14822+ ?~ bounded ~
14823+ =/ normalized=itype (itype-normalize typ sub.state)
14824+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
14825+ =/ quantified=(list @ud) (skim vars |=(n=@ud !(lien ids.u.tagged |=(b=@ud =(b n)))))
14826+ `[[normalized quantified]]
14827+::
14828++$ dgcommit [env=ienv state=istate]
14829+:: A branch literal must not acquire a value face through replay.
14830+++ dg-literal-target-safe
14831+ |= target=itype
14832+ ^- ?
14833+ ?: ?=(%union -.target)
14834+ (levy cases.target |=(c=itype ?=(?(%const %cell) -.c)))
14835+ ?=(?(%const %atom %any-atom %flag %noun) -.target)
14836+::
14837+++ dg-replay-edges
14838+ |= [edges=(list dgo) state=istate fuel=@ud]
14839+ ^- (unit istate)
14840+ ?~ edges `state
14841+ ?: =(0 fuel) ~
14842+ =/ trial=ifit (itype-fit left.i.edges right.i.edges sub.state next.state)
14843+ ?. ?=(%ok -.trial) ~
14844+ =/ valid=?
14845+ ?: ?=(%tag -.left.i.edges)
14846+ ?. constructor.left.i.edges
14847+ =/ closed=(unit dgscan) (dg-scan ~[right.i.edges] sub.trial 512 ~)
14848+ ?~ closed |
14849+ ?^ ids.u.closed |
14850+ (dg-literal-target-safe (itype-normalize right.i.edges sub.trial))
14851+ =((itype-walk left.i.edges sub.trial) (itype-walk right.i.edges sub.trial))
14852+ =((itype-walk left.i.edges sub.trial) (itype-walk right.i.edges sub.trial))
14853+ ?. valid ~
14854+ $(edges t.edges, state state(sub sub.trial, next next.trial), fuel (dec fuel))
14855+::
14856+++ dg-close-env
14857+ |= [env=ienv sub=isub fuel=@ud]
14858+ ^- (unit ienv)
14859+ ?~ env `~
14860+ ?: =(0 fuel) ~
14861+ =/ s=ischeme scheme.i.env
14862+ :: Quantified IDs are scheme-local and cannot be rewritten on publication.
14863+ ?. (levy vars.s |=(n=@ud ?=(~ (itype-lookup n sub)))) ~
14864+ =/ bounded=(unit dgscan) (dg-scan ~[typ.s] sub (dec fuel) ~)
14865+ ?~ bounded ~
14866+ =/ normalized=itype (itype-normalize typ.s sub)
14867+ ?: (itype-has-tag normalized) ~
14868+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
14869+ ?. (levy vars |=(n=@ud (lien vars.s |=(v=@ud =(v n))))) ~
14870+ =/ rest=(unit ienv) (dg-close-env t.env sub fuel.u.bounded)
14871+ ?~ rest ~
14872+ `[[name.i.env [normalized vars.s]] u.rest]
14873+::
14874+:: A deferred boolean branch has exactly the two literal flag patterns.
14875+:: Arms are inferred in order. Equal types are retained; two direct pending
14876+:: literals may instead retain source-owned obligations for later context.
14877+++ dg-boolean-patterns
14878+ |= e=expr
14879+ ^- ?
14880+ ?. ?=(%branch -.e) |
14881+ ?~ arms.e |
14882+ ?~ t.arms.e |
14883+ ?^ t.t.arms.e |
14884+ =/ x=arm i.arms.e
14885+ =/ y=arm i.t.arms.e
14886+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) |
14887+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) |
14888+ !=(val.lit.pat.x val.lit.pat.y)
14889+:: Only a direct source literal which created its own unbound pending tag
14890+:: may create a branch edge. The caller must retain the exact source and state.
14891+++ dg-owned-arm-literal
14892+ |= [e=expr t=itype tags=(list ipending) sub=isub initial=@ud]
14893+ ^- ?
14894+ ?. ?=(%lit -.e) |
14895+ ?. ?=(%tag -.t) |
14896+ ?: constructor.t |
14897+ ?. =(lit.e literal.t) |
14898+ ?: (lth id.t initial) |
14899+ ?^ (itype-lookup id.t sub) |
14900+ (lien tags |=(x=ipending &(=(id.x id.t) =(literal.x literal.t))))
14901+++ dg-boolean-branch
14902+ |= [e=expr env=ienv state=istate]
14903+ ^- iresult
14904+ ?. (dg-boolean-patterns e) [%| ["deferred branch patterns need unsupported inference" ~]]
14905+ ?> ?=(%branch -.e)
14906+ ?> ?=(^ arms.e)
14907+ ?> ?=(^ t.arms.e)
14908+ =/ x=arm i.arms.e
14909+ =/ y=arm i.t.arms.e
14910+ =/ subject=iresult (infer-fragment subject.e env state)
14911+ ?: ?=(%| -.subject) subject
14912+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
14913+ ?~ su [%| ["deferred branch subject does not unify with ?" ~]]
14914+ =/ left=iresult (infer-fragment val.x env state.p.subject(sub u.su))
14915+ ?: ?=(%| -.left) left
14916+ =/ right=iresult (infer-fragment val.y env state.p.left)
14917+ ?: ?=(%| -.right) right
14918+ ?. (dg-stable-fit typ.p.left typ.p.right sub.state.p.right)
14919+ =/ st=istate state.p.right
14920+ ?. (dg-owned-arm-literal val.x typ.p.left tags.st sub.st next.state)
14921+ [%| ["deferred branch arm context needs unsupported inference" ~]]
14922+ ?. (dg-owned-arm-literal val.y typ.p.right tags.st sub.st next.state)
14923+ [%| ["deferred branch arm context needs unsupported inference" ~]]
14924+ ?> ?=(%tag -.typ.p.left)
14925+ ?> ?=(%tag -.typ.p.right)
14926+ ?: =(id.typ.p.left id.typ.p.right)
14927+ [%| ["deferred branch arm context needs unsupported inference" ~]]
14928+ ?: (gth (lent obligations.st) 62)
14929+ [%| ["deferred branch arm context needs unsupported inference" ~]]
14930+ =/ result=itype [%var next.st]
14931+ =/ ex=dgo [typ.p.left result (span-of val.x) (span-of e)]
14932+ =/ ey=dgo [typ.p.right result (span-of val.y) (span-of e)]
14933+ [%& result st(next +(next.st), obligations [ex ey obligations.st])]
14934+ [%& typ.p.left state.p.right]
14935+::
14936+:: A direct tuple literal may wait for a later exact result context.
14937+:: Each pending literal retains its source tag and its own fit obligation.
14938+++ dg-infer-tuple-items
14939+ |= [items=(list item) env=ienv state=istate]
14940+ ^- iresult
14941+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
14942+ =/ head=iresult (infer-fragment val.i.items env state)
14943+ ?: ?=(%| -.head) head
14944+ =/ typ=itype typ.p.head
14945+ =/ st=istate state.p.head
14946+ =/ adjusted=(unit [typ=itype state=istate])
14947+ ?. (dg-owned-arm-literal val.i.items typ tags.st sub.st next.state) `[typ st]
14948+ ?: (gth (lent obligations.st) 63) ~
14949+ =/ pending=itype [%var next.st]
14950+ =/ edge=dgo [typ pending (span-of val.i.items) at.i.items]
14951+ `[pending st(next +(next.st), obligations [edge obligations.st])]
14952+ ?~ adjusted [%| ["deferred tuple context needs unsupported inference" ~]]
14953+ =. typ typ.u.adjusted
14954+ =. st state.u.adjusted
14955+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
14956+ ?~ t.items [%& typ st]
14957+ =/ tail=iresult $(items t.items, state st)
14958+ ?: ?=(%| -.tail) tail
14959+ [%& [%cell typ typ.p.tail] state.p.tail]
14960+::
14961+:: Deferred inference uses only source forms whose successful fit sites are
14962+:: guarded below; a shared source-node budget bounds this screen.
14963+++ dg-safe-expressions
14964+ |= [todo=(list expr) fuel=@ud]
14965+ ^- (unit @ud)
14966+ ?~ todo `fuel
14967+ =/ first=(unit @ud) (dg-safe-expression i.todo fuel)
14968+ ?~ first ~
14969+ $(todo t.todo, fuel u.first)
14970+++ dg-safe-items
14971+ |= [items=(list item) fuel=@ud]
14972+ ^- (unit @ud)
14973+ ?~ items `fuel
14974+ =/ first=(unit @ud) (dg-safe-expression val.i.items fuel)
14975+ ?~ first ~
14976+ $(items t.items, fuel u.first)
14977+++ dg-safe-expression
14978+ |= [e=expr fuel=@ud]
14979+ ^- (unit @ud)
14980+ ?: =(0 fuel) ~
14981+ =. fuel (dec fuel)
14982+ ?+ -.e ~
14983+ ?(%lit %ctor) `fuel
14984+ %wing ?:(?=([@ ~] names.e) `fuel ~)
14985+ %str
14986+ ?. (levy pieces.e |=(p=piece ?=(%text -.p))) ~
14987+ `fuel
14988+ %group $(e inner.e, fuel fuel)
14989+ %body
14990+ ?^ defs.e ~
14991+ $(e final.e, fuel fuel)
14992+ %gate $(e body.e, fuel fuel)
14993+ %gate-wide $(e body.e, fuel fuel)
14994+ %tuple (dg-safe-items items.e fuel)
14995+ %branch
14996+ ?. (dg-boolean-patterns e) ~
14997+ ?> ?=(^ arms.e)
14998+ ?> ?=(^ t.arms.e)
14999+ =/ subject=(unit @ud) $(e subject.e, fuel fuel)
15000+ ?~ subject ~
15001+ (dg-safe-expressions ~[val.i.arms.e val.i.t.arms.e] u.subject)
15002+ %cast $(e val.e, fuel fuel)
15003+ %call
15004+ =/ head=(unit @ud) $(e head.e, fuel fuel)
15005+ ?~ head ~
15006+ (dg-safe-expressions args.e u.head)
15007+ ==
15008+:: Exact normalized equality is preserved by all later substitutions.
15009+:: The bounded scan declines opaque types and oversized inputs.
15010+++ dg-stable-fit
15011+ |= [actual=itype expected=itype sub=isub]
15012+ ^- ?
15013+ ?~ (dg-scan ~[actual expected] sub 512 ~) |
15014+ =((itype-normalize actual sub) (itype-normalize expected sub))
15015+::
15016+:: A positional call peels sample-slot faces during its separate face check.
15017+:: Require its argument, sample and result closed so that check stays valid.
15018+++ dg-stable-call-fit
15019+ |= [actual=itype expected=itype product=itype sub=isub positional=?]
15020+ ^- ?
15021+ =/ checked=(unit dgscan) (dg-scan ~[actual expected product] sub 512 ~)
15022+ ?~ checked |
15023+ ?: &(positional ?=(^ ids.u.checked)) |
15024+ =((itype-normalize actual sub) (itype-normalize expected sub))
15025+::
15026+:: One definition attempt retains state only when inference succeeds.
15027++$ dg-step [env=ienv state=istate pending=(list dgo)]
15028+++ dg-stage-one
15029+ |= [d=def env=ienv state=istate]
15030+ ^- (unit dg-step)
15031+ ?> ?=(%value -.d)
15032+ ?~ (dg-safe-expression val.d 512) ~
15033+ =/ local=istate (reserve-def-caps val.d state)
15034+ :: This first slice declines all written capitals and holes/projections.
15035+ ?^ caps.local ~
15036+ =/ ordinary=iresult (infer-fragment val.d env local)
15037+ ?: ?=(%| -.ordinary) ~
15038+ =/ typ=itype typ.p.ordinary
15039+ =/ after=istate state.p.ordinary
15040+ =/ edges=(list dgo) obligations.after
15041+ ?. =(binders.after binders.state) ~
15042+ ?. =(molds.after molds.state) ~
15043+ ?. =(globals.after globals.state) ~
15044+ ?. =(externals.after externals.state) ~
15045+ ?. =(surs.after surs.state) ~
15046+ ?. =(mark-externals.after mark-externals.state) ~
15047+ ?. =(marks.after marks.state) ~
15048+ ?. =(jimports.after jimports.state) ~
15049+ ?. =(reserved-molds.after reserved-molds.state) ~
15050+ ?. =(params.after params.state) ~
15051+ ?. =(active.after active.state) ~
15052+ ?. =(in-mold.after in-mold.state) ~
15053+ ?. =(at.after at.state) ~
15054+ ?. =(top-molds.after top-molds.state) ~
15055+ ?. =(prelude.after prelude.state) ~
15056+ ?. =(gate-defs.after gate-defs.state) ~
15057+ ?. =(head-evidence.after head-evidence.state) ~
15058+ ?. =(grec-index.after grec-index.state) ~
15059+ ?. =(defer.after defer.state) ~
15060+ ?. =(holes.after holes.state) ~
15061+ ?. =(caps.after caps.state) ~
15062+ ?. =(projections.after projections.state) ~
15063+ ?: (unsupported-atom-vars (itype-normalize typ sub.after) caps.after binders.after sub.after) ~
15064+ ?: (itype-has-nvar (itype-normalize typ sub.after)) ~
15065+ =/ scheme=(unit ischeme) (dg-generalize typ env edges tags.after ~ after 32.768)
15066+ ?~ scheme ~
15067+ `[[[name.d u.scheme] env] after edges]
15068+:: Retry only definitions that did not infer. Successful definitions are
15069+:: committed into the local transaction, never published until all close.
15070+++ dg-stage
15071+ |= [ds=(list def) base=ienv env=ienv state=istate pending=(list dgo) fuel=@ud]
15072+ ^- (unit dgcommit)
15073+ ?: (gth fuel 64) ~
15074+ ?: (gth (lent ds) fuel) ~
15075+ =/ remaining=(list def) ds
15076+ =/ waiting=(list def) ~
15077+ =/ progress=? |
15078+ =/ attempts=@ud (mul fuel fuel)
15079+ |-
15080+ ?~ remaining
15081+ ?^ waiting
15082+ ?. progress ~
15083+ $(remaining (flop waiting), waiting ~, progress |)
15084+ =/ replayed=(unit istate) (dg-replay-edges pending state 64)
15085+ ?~ replayed ~
15086+ ?: (pending-tags tags.u.replayed sub.u.replayed) ~
15087+ =/ closed-edges=(unit dgscan) (dg-obligations pending sub.u.replayed 32.768 ~)
15088+ ?~ closed-edges ~
15089+ ?^ ids.u.closed-edges ~
15090+ =/ rechecked=(unit istate) (dg-replay-edges pending u.replayed 64)
15091+ ?~ rechecked ~
15092+ ?. =(sub.u.rechecked sub.u.replayed) ~
15093+ ?. =(next.u.rechecked next.u.replayed) ~
15094+ =/ closed=(unit ienv) (dg-close-env env sub.u.replayed 32.768)
15095+ ?~ closed ~
15096+ `[[u.closed u.replayed(defer ~, obligations ~)]]
15097+ ?: =(0 attempts) ~
15098+ =. attempts (dec attempts)
15099+ =/ d=def i.remaining
15100+ ?: ?=(%mold -.d) $(remaining t.remaining)
15101+ ?^ (ienv-lookup name.d base) $(remaining t.remaining)
15102+ ?^ (ienv-lookup name.d env) ~
15103+ =/ done=(unit dg-step) (dg-stage-one d env state)
15104+ ?~ done $(remaining t.remaining, waiting [d waiting])
15105+ $(remaining t.remaining, env env.u.done, state state.u.done, pending pending.u.done, progress &)
15106+::
15107+:: Cheap bounded eligibility check on the already parsed source. This
15108+:: deliberately covers only direct constructor calls beneath transparent
15109+:: groups, gates, casts and definition-free bodies. Other shapes decline
15110+:: this fallback without a second parse or resolution pass.
15111+++ dg-direct-source
15112+ |= [e=expr fuel=@ud]
15113+ ^- ?
15114+ ?: =(0 fuel) |
15115+ ?+ -.e |
15116+ %group $(e inner.e, fuel (dec fuel))
15117+ %gate $(e body.e, fuel (dec fuel))
15118+ %gate-wide $(e body.e, fuel (dec fuel))
15119+ %cast $(e val.e, fuel (dec fuel))
15120+ %body ?~(defs.e $(e final.e, fuel (dec fuel)) |)
15121+ %call
15122+ ?. ?=([* ~] args.e) |
15123+ ?=(%ctor -.i.args.e)
15124+ ==
15125+++ dg-source-candidate
15126+ |= [ds=(list def) fuel=@ud]
15127+ ^- ?
15128+ ?~ ds |
15129+ ?: =(0 fuel) |
15130+ ?. ?=(%value -.i.ds) $(ds t.ds, fuel (dec fuel))
15131+ ?: (dg-direct-source val.i.ds 64) &
15132+ $(ds t.ds, fuel (dec fuel))
15133+::
15134+++ dg-prepared-source
15135+ |= [e=expr fuel=@ud]
15136+ ^- ?
15137+ ?: (dg-direct-source e fuel) &
15138+ ?: =(0 fuel) |
15139+ ?+ -.e |
15140+ %group $(e inner.e, fuel (dec fuel))
15141+ %gate $(e body.e, fuel (dec fuel))
15142+ %gate-wide $(e body.e, fuel (dec fuel))
15143+ %cast $(e val.e, fuel (dec fuel))
15144+ %body ?~(defs.e $(e final.e, fuel (dec fuel)) |)
15145+ %tuple &
15146+ ==
15147+++ dg-prepared-candidate
15148+ |= [ds=(list def) fuel=@ud]
15149+ ^- ?
15150+ ?~ ds |
15151+ ?: =(0 fuel) |
15152+ ?. ?=(%value -.i.ds) $(ds t.ds, fuel (dec fuel))
15153+ ?: (dg-prepared-source val.i.ds 64) &
15154+ $(ds t.ds, fuel (dec fuel))
15155+::
15156+++ dg-interface-safe
15157+ |= [env=ienv]
15158+ ^- ?
15159+ ?~ env &
15160+ =/ sc=ischeme scheme.i.env
15161+ ?: |((itype-has-hidden-recursive typ.sc) (itype-has-hidden-generic typ.sc)) |
15162+ ?: (gth (lent vars.sc) 26) |
15163+ $(env t.env)
15164+:: Parse status and the transaction result come from the same source parse.
15165++$ dgparse [parsed=? result=(unit dgcommit)]
15166+++ dg-root-source
15167+ |= [at=path src=@t]
15168+ ^- (unit dgcommit)
15169+ result:(dg-root-detail at src)
15170+++ dg-root-detail
15171+ |= [at=path src=@t]
15172+ ^- dgparse
15173+ =/ parsed (parse at src)
15174+ ?: ?=(%| -.parsed) [| ~]
15175+ =/ transact
15176+ |.
15177+ ?^ imports.p.parsed ~
15178+ ?. (module-scope-valid p.parsed ~ ~) ~
15179+ ?^ (duplicate-defs defs.p.parsed) ~
15180+ =/ defs=(list def) defs.p.parsed
15181+ ?: (gth (lent defs) 64) ~
15182+ =/ molds=imolds (collect-simple-molds defs)
15183+ =/ globals=(list term) (global-value-names defs)
15184+ =/ resolution=iresolved (resolve-groups defs molds globals ~ ~ ~ ~ ~ ~ at ~)
15185+ ?^ grouped.resolution ~
15186+ ?^ artifacts.resolution ~
15187+ =/ base=ienv env.resolution
15188+ =/ free=(unit dgscan) (dg-env base ~ 32.768 ~)
15189+ ?~ free ~
15190+ ?^ ids.u.free ~
15191+ =/ all=(unit dgscan) (dg-all-env-ids base 32.768 ~)
15192+ ?~ all ~
15193+ =/ fresh=@ud (dg-next-id ids.u.all 0)
15194+ =/ st=istate *istate
15195+ =. 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)
15196+ =/ checked-molds=(each imold-types @t) (module-mold-types molds st)
15197+ ?: ?=(%| -.checked-molds) ~
15198+ (dg-stage defs base base st ~ 64)
15199+ ::
15200+ [& (transact)]
15201+:: The caller supplies the trusted prepared prelude. This transaction is
15202+:: only report evidence; the ordinary module resolver does not publish it.
15203+++ dg-root-prepared
15204+ |= [at=path src=@t prepared=iprelude]
15205+ ^- (unit dgcommit)
15206+ ?: ?=([%ui %api *] at) ~
15207+ ?: ?=([%ui %stores *] at) ~
15208+ ?: (gth (met 3 src) 65.536) ~
15209+ =/ parsed (parse at src)
15210+ ?: ?=(%| -.parsed) ~
15211+ ?^ imports.p.parsed ~
15212+ ?. (module-scope-valid p.parsed values.prepared molds.prepared) ~
15213+ ?^ (duplicate-defs defs.p.parsed) ~
15214+ =/ defs=(list def) defs.p.parsed
15215+ ?: (gth (lent defs) 64) ~
15216+ ?: (lien (global-value-names defs) |=(n=term =(n %main))) ~
15217+ ?. (dg-prepared-candidate defs 64) ~
15218+ =/ local-molds=imolds (collect-simple-molds defs)
15219+ =/ globals=(list term) (weld values.prepared (global-value-names defs))
15220+ =/ iface=ifile iface.prepared
15221+ =/ prelude=(unit ifile) `iface
15222+ =/ resolution=iresolved
15223+ (resolve-groups defs local-molds globals ~ ~ ~ ~ ~ molds.prepared at prelude)
15224+ ?^ grouped.resolution ~
15225+ ?^ artifacts.resolution ~
15226+ =/ base=ienv env.resolution
15227+ =/ templates=ienv
15228+ (turn molds.iface |=(x=[name=term template=ischeme] [name.x template.x]))
15229+ =/ all-env=ienv (weld base (weld values.iface templates))
15230+ =/ free=(unit dgscan) (dg-env all-env ~ 32.768 ~)
15231+ ?~ free ~
15232+ ?^ ids.u.free ~
15233+ =/ all=(unit dgscan) (dg-all-env-ids all-env 32.768 ~)
15234+ ?~ all ~
15235+ =/ fresh=@ud (dg-next-id ids.u.all 0)
15236+ =/ st=istate *istate
15237+ =. 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)
15238+ =/ checked-molds=(each imold-types @t) (module-mold-types local-molds st)
15239+ ?: ?=(%| -.checked-molds) ~
15240+ (dg-stage defs base base st ~ 64)
15241+::
15242+++ dg-all-env-ids
15243+ |= [env=ienv fuel=@ud ids=(list @ud)]
15244+ ^- (unit dgscan)
15245+ ?~ env `[ids fuel]
15246+ ?: =(0 fuel) ~
15247+ =/ sc=ischeme scheme.i.env
15248+ ?: (itype-has-tag typ.sc) ~
15249+ =/ raw=(unit dgscan) (dg-scan ~[typ.sc] ~ (dec fuel) ids)
15250+ ?~ raw ~
15251+ =/ quant=(unit dgscan) (dg-scan-ids vars.sc ~ fuel.u.raw ids.u.raw)
15252+ ?~ quant ~
15253+ $(env t.env, fuel fuel.u.quant, ids ids.u.quant)
15254+::
15255+++ dg-next-id
15256+ |= [ids=(list @ud) largest=@ud]
15257+ ^- @ud
15258+ ?~ ids +(largest)
15259+ $(ids t.ids, largest (max largest i.ids))
15260+::
15261+++ dg-eligible-ctor
15262+ |= [e=expr head=itype actual=itype expected=itype state=istate]
15263+ ^- (unit dgo)
15264+ ?. ?=(%call -.e) ~
15265+ ?. ?=([* ~] args.e) ~
15266+ ?. ?=(%ctor -.i.args.e) ~
15267+ ?. ?=(%fn -.head) ~
15268+ ?. ?=(%fn -.expected) ~
15269+ ?. ?=(%tag -.actual) ~
15270+ ?. constructor.actual ~
15271+ ?. ?=(%var -.product.expected) ~
15272+ ?^ (itype-lookup id.product.expected sub.state) ~
15273+ =/ bounded=(unit dgscan) (dg-scan ~[sample.expected] sub.state 256 ~)
15274+ ?~ bounded ~
15275+ ?^ ids.u.bounded ~
15276+ `[[actual expected (span-of i.args.e) (span-of head.e)]]
15277+::
15278+:: Experimental per-module, source-derived recursive tree index.
15279+:: The two tags and the exact children/list/self layout are fixed-shape
15280+:: checks, so ordinary definitions incur no type-tree or source scans.
15281+++ grec-tagged-fields
15282+ |= sh=shape
15283+ ^- (unit [tag=@ fields=(list field)])
15284+ ?. ?=(%cell -.sh) ~
15285+ ?~ fields.sh ~
15286+ =/ head=field i.fields.sh
15287+ ?. ?=(%bare -.head) ~
15288+ ?. ?=(%const -.shape.head) ~
15289+ ?. &(?=(%term form.lit.shape.head) =(%tas aura.lit.shape.head)) ~
15290+ `[val.lit.shape.head t.fields.sh]
15291+++ grec-tree-children
15292+ |= [fs=(list field) param=@t]
15293+ ^- (unit field)
15294+ ?~ fs ~
15295+ ?~ t.fs `i.fs
15296+ ?^ t.t.fs ~
15297+ =/ event=field i.fs
15298+ =/ kids=field i.t.fs
15299+ ?. &(?=(%face -.event) ?=(%face -.kids)) ~
15300+ ?. !=(name.event name.kids) ~
15301+ ?. ?=(%fn -.shape.event) ~
15302+ ?. ?=(%aura -.sample.shape.event) ~
15303+ ?. =(%t aura.sample.shape.event) ~
15304+ ?. ?=(%tvar -.product.shape.event) ~
15305+ ?. =(param name.product.shape.event) ~
15306+ `kids
15307+::
15308+++ grec-tree-proof
15309+ |= [name=term sh=shape]
15310+ ^- ?
15311+ ?. ?=(%generic -.sh) |
15312+ ?. ?=([@ ~] vars.sh) |
15313+ =/ param=@t i.vars.sh
15314+ ?. ?=(%union -.body.sh) |
15315+ ?. ?=([* [* ~]] cases.body.sh) |
15316+ =/ a=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.cases.body.sh)
15317+ =/ b=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.t.cases.body.sh)
15318+ ?~ a |
15319+ ?~ b |
15320+ ?. !=(tag.u.a tag.u.b) |
15321+ ?. ?=([* ~] fields.u.a) |
15322+ =/ value=field i.fields.u.a
15323+ ?. ?=(%face -.value) |
15324+ ?. ?=(%aura -.shape.value) |
15325+ ?. =(%t aura.shape.value) |
15326+ =/ selected=(unit field) (grec-tree-children fields.u.b param)
15327+ ?~ selected |
15328+ =/ kids=field u.selected
15329+ ?. ?=(%face -.kids) |
15330+ ?. ?=(%apply -.shape.kids) |
15331+ ?. =(ref.shape.kids ~[%list]) |
15332+ ?. ?=([* ~] args.shape.kids) |
15333+ =/ self=shape i.args.shape.kids
15334+ ?. ?=(%apply -.self) |
15335+ ?. =(ref.self ~[name]) |
15336+ ?. ?=([* ~] args.self) |
15337+ ?. ?=(%tvar -.i.args.self) |
15338+ =(name.i.args.self param)
15339++$ grec-collected [molds=imolds proofs=(map term shape)]
15340+:: Experimental one-layer analysis view, never an exported mold identity.
15341+++ grec-unfold-view
15342+ |= [typ=itype fuel=@ud]
15343+ ^- (unit [view=itype left=@ud])
15344+ ?. ?=(%grec -.typ) ~
15345+ ?: =(fuel 0) ~
15346+ ?. ?=([* ~] args.typ) ~
15347+ =/ sh=shape proof.typ
15348+ ?. (grec-tree-proof name.typ sh) ~
15349+ ?> ?=(%generic -.sh)
15350+ ?> ?=([@ ~] vars.sh)
15351+ ?> ?=(%union -.body.sh)
15352+ ?> ?=([* [* ~]] cases.body.sh)
15353+ =/ ca=shape i.cases.body.sh
15354+ =/ cb=shape i.t.cases.body.sh
15355+ ?> ?=(%cell -.ca)
15356+ ?> ?=(%cell -.cb)
15357+ ?> ?=([* [* ~]] fields.ca)
15358+ ?> ?=([* *] fields.cb)
15359+ =/ tag-a=field i.fields.ca
15360+ =/ tag-b=field i.fields.cb
15361+ ?> ?=(%bare -.tag-a)
15362+ ?> ?=(%bare -.tag-b)
15363+ ?> ?=(%const -.shape.tag-a)
15364+ ?> ?=(%const -.shape.tag-b)
15365+ =/ text-field=field i.t.fields.ca
15366+ ?> ?=(%face -.text-field)
15367+ =/ branch=(list field) t.fields.cb
15368+ =/ kids=(unit field) (grec-tree-children branch i.vars.sh)
15369+ ?~ kids ~
15370+ ?> ?=(%face -.u.kids)
15371+ =/ children=itype [%face name.u.kids [%collection %list ~[typ]]]
15372+ ?> ?=(^ branch)
15373+ =/ payload=itype
15374+ ?~ t.branch children
15375+ =/ event=field i.branch
15376+ ?> ?=(%face -.event)
15377+ [%cell [%face name.event [%fn [%atom %t] i.args.typ]] children]
15378+ =/ leaf=itype [%cell [%const lit.shape.tag-a] [%face name.text-field [%atom %t]]]
15379+ =/ node=itype [%cell [%const lit.shape.tag-b] payload]
15380+ `[[%union ~[leaf node] ~ ~ ~] (dec fuel)]
15381+::
15382+++ grec-collect-molds
15383+ |= ds=(list def)
15384+ ^- grec-collected
15385+ ?~ ds [~ *(map term shape)]
15386+ =/ rest=grec-collected $(ds t.ds)
15387+ ?. ?=(%mold -.i.ds) rest
15388+ =/ name=term name.i.ds
15389+ =/ body=shape shape.i.ds
15390+ =/ proofs=(map term shape) proofs.rest
15391+ =? proofs (grec-tree-proof name body) (~(put by proofs) name body)
15392+ [[[name body] molds.rest] proofs]
15393+::
15394+
782515395--
jibb-dev/lib/jibb/internal.jibbnew file+34
@@ -0,0 +1,34 @@
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++$ raw-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+++ eq-data |= args=[A A] (raw-eq.core args)
13+
14+:: Application paths are knot sequences.
15++$ qath
16+ ~
17+ [i=@ta t=qath]
18+
19+:: Private compiler primitive wrappers; execution is a later milestone.
20+++ add-atom |= args=[A A] (raw-add.core args)
21+++ dec-atom |= atom=A (raw-dec.core atom)
22+++ trip-text |= value=@t (raw-trip.core value)
23+++ tuba-text |= values (raw-tuba.core values)
24+
25+:: Transparent request data. Identity and path fields are writable and do not
26+:: prove a schema or watchability. A future executor must bind them to checked
27+:: source evidence and validate facts and state; generated receivers must
28+:: decode before calling typed replies or folds. Runtime validation, watch
29+:: provenance and effect execution are not implemented.
30++$ agent-path (list.core @ta)
31++$ ask |$ [M]
32+ [%pure value=M]
33+ [%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])]
34+ [%store module=@t name=@tas receive=$-([state=(unit.core *) fact=*] [state=* message=M])]
jibb-dev/lib/jibb/prelude.jibb+329−64
@@ -1,4 +1,9 @@
1+/= internal /lib/jibb/internal
2++$ raw-poke raw-poke.internal
3++$ qath qath.internal
4+
15:: Initial prelude functions. The rest of the inventory is still to come.
6+
27++ same |= x=A x
38
49++ head |= p=[A B]
@@ -14,6 +19,8 @@
1419 %.y %.n
1520 %.n %.y
1621
22+++ eq |= args=[A A] (eq-data.internal args)
23+
1724+$ list |$ [A]
1825 ~
1926 [i=A t=(list A)]
@@ -45,9 +52,10 @@
4552++ turn |= args=[(list A) $-(A B)]
4653 ?- args
4754 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
55+ ^- (list B)
56+ ?- xs
57+ ~ ~
58+ [item rest] [(f item) (turn rest f)]
5159
5260+$ dime [p=@ta q=@]
5361
@@ -95,6 +103,14 @@
95103
96104+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
97105
106+++ like |= [f=$-(A B) result=(like A)]
107+ ++ mapped
108+ ^- (unit [p=B q=nail])
109+ ?- q.result
110+ ~ ~
111+ [~ value] `[p=(f p.value) q=q.value]
112+ ^- (like B) [p=p.result q=mapped]
113+
98114++ wonk |= veq=(like A)
99115 ?- q.veq
100116 ~ !!
@@ -139,27 +155,34 @@
139155 (reverse-into xs ~)
140156
141157++ drop |= maybe=(unit A)
142− ?- maybe
143− ~ ~
144− [~ value] [value ~]
158+ ^- (list A)
159+ ?- maybe
160+ ~ ~
161+ [~ value] [value ~]
162+
163+++ bond |= fallback=$-(~ A)
164+ |= maybe=(unit A)
165+ ?- maybe
166+ ~ (fallback ~)
167+ [~ value] value
145168
146169++ bind |= args=[(unit A) $-(A B)]
147170 ?- args
148− [maybe f]
171+ [maybe f] ^- (unit B)
149172 ?- maybe
150173 ~ ~
151174 [~ value] `(f value)
152175
153176++ biff |= args=[(unit A) $-(A (unit B))]
154177 ?- args
155− [maybe f]
178+ [maybe f] ^- (unit B)
156179 ?- maybe
157180 ~ ~
158181 [~ value] (f value)
159182
160183++ both |= args=[(unit A) (unit B)]
161184 ?- args
162− [first second]
185+ [first second] ^- (unit [A B])
163186 ?- first
164187 ~ ~
165188 [~ a]
@@ -169,7 +192,7 @@
169192
170193++ clap |= args=[(unit A) (unit A) $-([A A] A)]
171194 ?- args
172− [first second combine]
195+ [first second combine] ^- (unit A)
173196 ?- first
174197 ~ second
175198 [~ a]
@@ -177,9 +200,35 @@
177200 ~ first
178201 [~ b] `(combine a b)
179202
203+++ hunt |= args=[$-([A A] ?) (unit A) (unit A)]
204+ ?- args
205+ [choose first second] ^- (unit A)
206+ ?- first
207+ ~ second
208+ [~ a]
209+ ?- second
210+ ~ first
211+ [~ b]
212+ ?- (choose a b)
213+ %.y first
214+ %.n second
215+
216+++ mate |= args=[(unit A) (unit A)]
217+ ?- args
218+ [first second] ^- (unit A)
219+ ?- second
220+ ~ first
221+ [~ b]
222+ ?- first
223+ ~ second
224+ [~ a]
225+ ?- (eq a b)
226+ %.y first
227+ %.n !!
228+
180229++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
181230 ?- args
182− [first second combine]
231+ [first second combine] ^- (unit C)
183232 ?- first
184233 ~ ~
185234 [~ a]
@@ -189,43 +238,45 @@
189238
190239++ skim |= args=[(list A) $-(A ?)]
191240 ?- args
192− [xs predicate]
193− ?- xs
194− ~ ~
195− [item rest]
196− ?- (predicate item)
197− %.y [item (skim rest predicate)]
198− %.n (skim rest predicate)
241+ [xs predicate] ^- (list A)
242+ ?- xs
243+ ~ ~
244+ [item rest]
245+ ?- (predicate item)
246+ %.y [item (skim rest predicate)]
247+ %.n (skim rest predicate)
199248
200249++ skip |= args=[(list A) $-(A ?)]
201250 ?- args
202− [xs predicate]
203− ?- xs
204− ~ ~
205− [item rest]
206− ?- (predicate item)
207− %.y (skip rest predicate)
208− %.n [item (skip rest predicate)]
251+ [xs predicate] ^- (list A)
252+ ?- xs
253+ ~ ~
254+ [item rest]
255+ ?- (predicate item)
256+ %.y (skip rest predicate)
257+ %.n [item (skip rest predicate)]
209258
210259++ levy |= args=[(list A) $-(A ?)]
211− ?- args
212− [xs predicate]
213− ?- xs
214− ~ %.y
215− [item rest]
216− ?- (predicate item)
217− %.y (levy rest predicate)
218− %.n %.n
260+ ^- ?
261+ ?- args
262+ [xs predicate]
263+ ?- xs
264+ ~ %.y
265+ [item rest]
266+ ?- (predicate item)
267+ %.y (levy rest predicate)
268+ %.n %.n
219269
220270++ lien |= args=[(list A) $-(A ?)]
221− ?- args
222− [xs predicate]
223− ?- xs
224− ~ %.n
225− [item rest]
226− ?- (predicate item)
227− %.y %.y
228− %.n (lien rest predicate)
271+ ^- ?
272+ ?- args
273+ [xs predicate]
274+ ?- xs
275+ ~ %.n
276+ [item rest]
277+ ?- (predicate item)
278+ %.y %.y
279+ %.n (lien rest predicate)
229280
230281++ roll |= args=[(list A) B $-([A B] B)]
231282 ?- args
@@ -243,37 +294,39 @@
243294
244295++ flit |= predicate=$-(A ?)
245296 |= value=A
246− ?- (predicate value)
247− %.y `value
248− %.n ~
297+ ^- (unit A)
298+ ?- (predicate value)
299+ %.y `value
300+ %.n ~
249301
250302++ murn |= args=[(list A) $-(A (unit B))]
251303 ?- args
252− [xs f]
253− ?- xs
254− ~ ~
255− [item rest]
256− ?- (f item)
257− ~ (murn rest f)
258− [~ value] [value (murn rest f)]
304+ [xs f] ^- (list B)
305+ ?- xs
306+ ~ ~
307+ [item rest]
308+ ?- (f item)
309+ ~ (murn rest f)
310+ [~ value] [value (murn rest f)]
259311
260312++ join |= args=[A (list A)]
261313 ?- args
262− [separator xs]
263− ?- xs
264− ~ ~
265− [item rest]
266− ?- rest
267− ~ [item ~]
268− [next more] [item [separator (join separator rest)]]
314+ [separator xs] ^- (list A)
315+ ?- xs
316+ ~ ~
317+ [item rest]
318+ ?- rest
319+ ~ [item ~]
320+ [next more] [item [separator (join separator rest)]]
269321
270322++ snip |= xs=(list A)
271− ?- xs
272− ~ ~
273− [item rest]
274− ?- rest
275− ~ ~
276− [next more] [item (snip rest)]
323+ ^- (list A)
324+ ?- xs
325+ ~ ~
326+ [item rest]
327+ ?- rest
328+ ~ ~
329+ [next more] [item (snip rest)]
277330
278331++ rear |= xs=(list A)
279332 ?- xs
@@ -282,3 +335,215 @@
282335 ?- rest
283336 ~ item
284337 [next more] (rear rest)
338+
339+++ cork |= gates=[$-(A B) $-(B C)]
340+ ?- gates
341+ [f g] |= x=A (g (f x))
342+
343+++ corl |= gates=[$-(B C) $-(A B)]
344+ ?- gates
345+ [f g] |= x=A (f (g x))
346+
347+++ cury |= args=[$-([A B] C) A]
348+ ?- args
349+ [f a] |= b=B (f a b)
350+
351+++ curr |= args=[$-([A B] C) B]
352+ ?- args
353+ [f b] |= a=A (f a b)
354+
355++$ cmd |$ [M]
356+ [%poke p=raw-poke reply=$-((unit @t) M)]
357+ [%go url=@t]
358+ [%wait gap=@dr msg=M]
359+ [%now reply=$-(@da M)]
360+ [%who reply=$-(@p M)]
361+
362+++ gth |= args=[A A] (gth-atom.internal args)
363+++ add |= args=[A A] (add-atom.internal args)
364+++ dec |= atom=A (dec-atom.internal atom)
365+
366++$ ask |$ [M] (ask.internal M)
367+++ pure |= x=M ^- (ask M) [%pure x]
368+
369+:: This mold describes the value; island watchability needs separate proof.
370++$ sub |$ [M]
371+ [%watch a=(ask M)]
372+ [%every gap=@dr reply=$-(@da M)]
373+ [%url reply=$-(path M)]
374+
375+:: Count a finite list with the source-backed addition gate.
376+++ lent |= xs=(list A)
377+ ^- @ud
378+ ?- xs
379+ ~ 0
380+ [item rest] (add 1 (lent rest))
381+
382+++ lth |= args=[A A]
383+ ?- args
384+ [x y] (gth y x)
385+
386+++ gte |= args=[A A]
387+ ?- args
388+ [x y] (not (gth y x))
389+
390+++ lte |= args=[A A]
391+ ?- args
392+ [x y] (not (gth x y))
393+
394+++ zing |= xss=(list (list A))
395+ ^- (list A)
396+ ?- xss
397+ ~ ~
398+ [xs rest] (weld xs (zing rest))
399+
400+++ lead |= first=A |= second=B [first second]
401+++ late |= second=B |= first=A [first second]
402+
403+++ succ |= x=A (add x 1)
404+
405+++ trip |= value=@t (trip-text.internal value)
406+++ tuba |= values=(list @tD) (tuba-text.internal values)
407+
408+:: UI values are source-level descriptions only. Nested element payloads are
409+:: erased in the nonrecursive union; the public constructors below retain the
410+:: typed composition boundaries. Raw-constructor encapsulation, rendering and
411+:: execution are not established by this slice.
412++$ length
413+ [%chars n=@ud]
414+ [%fill n=@ud]
415+ %shrink
416+
417++$ align
418+ %start
419+ %center
420+ %end
421+
422++$ role
423+ %body
424+ %caption
425+ %label
426+
427++$ tone
428+ %normal
429+ %muted
430+ %accent
431+ %danger
432+
433++$ attr
434+ [%pad %s0]
435+ [%pad %s1]
436+ [%pad %s2]
437+ [%pad %s3]
438+ [%gap %s0]
439+ [%gap %s1]
440+ [%gap %s2]
441+ [%gap %s3]
442+ [%width width=length]
443+ [%align align=align]
444+ [%role role=role]
445+ [%tone tone=tone]
446+
447++$ element |$ [M]
448+ [%row attrs=(list attr) kids=*]
449+ [%column attrs=(list attr) kids=*]
450+ [%wrap attrs=(list attr) kids=*]
451+ [%stack attrs=(list attr) kids=*]
452+ [%el attrs=(list attr) kid=*]
453+ [%para kids=*]
454+ [%text words=@t]
455+ [%heading level=@ud words=@t]
456+ [%each items=*]
457+ [%table columns=* rows=*]
458+ [%image source=qath description=@t]
459+ [%image-unsafe source=[url=@t width=@ud height=@ud] description=@t]
460+ [%link target=qath label=@t]
461+ [%link-unsafe target=@t label=@t]
462+ [%button label=@t message=M]
463+ [%toggle on=? label=@t message=M]
464+ [%field label=@t value=@t reply=$-(@t M)]
465+ [%form message=M kids=*]
466+ [%island payload=*]
467+
468+++ row |= [attrs=(list attr) kids=(list (element M))]
469+ ^- (element M) [%row attrs kids]
470+
471+++ column |= [attrs=(list attr) kids=(list (element M))]
472+ ^- (element M) [%column attrs kids]
473+
474+++ wrap |= [attrs=(list attr) kids=(list (element M))]
475+ ^- (element M) [%wrap attrs kids]
476+
477+++ stack |= [attrs=(list attr) kids=(list (element M))]
478+ ^- (element M) [%stack attrs kids]
479+
480+++ el |= [attrs=(list attr) kid=(element M)]
481+ ^- (element M) [%el attrs kid]
482+
483+++ para |= kids=(list (element M))
484+ ^- (element M) [%para kids]
485+
486+++ text |= words=@t
487+ ^- (element M) [%text words]
488+
489+++ heading |= [level=@ud words=@t]
490+ ^- (element M) [%heading level words]
491+
492+++ each |= items=(list [key=K el=(element M)])
493+ ^- (element M) [%each items]
494+
495+++ table |= [columns=(list [header=@t width=length align=align]) rows=(list [key=K cells=(list (element M))])]
496+ ^- (element M) [%table columns rows]
497+
498+++ image |= [source=qath description=@t]
499+ ^- (element M) [%image source description]
500+
501+++ image-unsafe |= [source=[url=@t width=@ud height=@ud] description=@t]
502+ ^- (element M) [%image-unsafe source description]
503+
504+++ link |= [target=qath label=@t]
505+ ^- (element M) [%link target label]
506+
507+++ link-unsafe |= [target=@t label=@t]
508+ ^- (element M) [%link-unsafe target label]
509+
510+++ button |= [label=@t message=M]
511+ ^- (element M) [%button label message]
512+
513+++ toggle |= [on=? label=@t message=M]
514+ ^- (element M) [%toggle on label message]
515+
516+++ field |= [label=@t value=@t reply=$-(@t M)]
517+ ^- (element M) [%field label value reply]
518+
519+++ form |= [message=M kids=(list (element M))]
520+ ^- (element M) [%form message kids]
521+
522++$ theme
523+ [ space=[s1=@t s2=@t s3=@t]
524+ tones=[normal=@t background=@t accent=@t danger=@t muted=@t]
525+ wide=@t
526+ lang=@t
527+ zone=@t
528+ font=(unit qath)
529+ dark=(unit [tones=[normal=@t background=@t accent=@t danger=@t muted=@t]])
530+
531++$ program |$ [D X M]
532+ [init=$-(D X) update=$-([M X] [X (list (cmd M))]) view=$-(X (element M)) subs=$-(X (list (sub M)))]
533+
534+++ program |= [init=$-(D X) update=$-([M X] [X (list (cmd M))]) view=$-(X (element M)) subs=$-(X (list (sub M)))]
535+ ^- (program D X M) [init update view subs]
536+
537+++ island |= [p=(program D X M) data=D]
538+ ^- (element !!) [%island [p data]]
539+
540++$ page |$ [R D]
541+ [load=$-(R (ask D)) view=$-(D (element !!))]
542+
543+++ page |= [load=$-(R (ask D)) view=$-(D (element !!))]
544+ ^- (page R D) [load view]
545+
546++$ store |$ [S] [init=S update=*]
547+
548+++ store |= [init=S update=$-([A S] S)]
549+ ^- (store S) [init update]
my-app/ui/basket.jibb+2−2
@@ -17,8 +17,8 @@
1717++ update |= [=msg m=model]
1818 ?- msg
1919 [%noted t] [m(note=t) ~]
20− %add [m(note="") ~[[%poke (cart-action.cart [%add note.m]) |=%acked]]]
21− %toggle [m ~[[%poke (cart-action.cart %toggle) |=%acked]]]
20+ %add [m(note="") ~[(poke.cart [%add note.m] |=%acked)]]
21+ %toggle [m ~[(poke.cart %toggle |=%acked)]]
2222 [%got c] [m(cart=c) ~]
2323 [%acked err] [m ~]
2424
my-app/ui/stores/cart.jibb+2−3
@@ -1,13 +1,12 @@
11:: /ui/stores/cart.jibb
22+$ state [items=(list @t) open=?]
3−+$ cart-action
3++$ poke
44 [%add item=@t]
55 %toggle
6−+$ poke cart-action
76
87++ main (store init update)
98++ init ^- state [~ %.n]
10−++ update |= [a=cart-action s=state]
9+++ update |= [a=poke s=state]
1110 ?- a
1211 [%add item] s(items=[item items.s])
1312 %toggle s(open=(not open.s))
my-app/ui/theme.jibb+1−1
@@ -5,4 +5,4 @@
55 lang="en"
66 zone="UTC"
77 font=`%/static/fonts/inter.woff2
8− dark=[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
8+ dark=`[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
my-app/ui/todo-list.jibb+2−2
@@ -19,8 +19,8 @@
1919 ?- (gth (lent (tuba (trip t))) 80)
2020 %.y [m(draft=t error=`"Too long") ~]
2121 %.n [m(draft=t error=~) ~]
22− %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
23− [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
22+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
23+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
2424 [%got ts] [m(todos=ts) ~]
2525 [%acked err] [m(error=err) ~]
2626
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/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/source.jibb+2−2
@@ -4,7 +4,7 @@
44 ?- (gth (lent (tuba (trip t))) 80)
55 %.y [m(draft=t error=`"Too long") ~]
66 %.n [m(draft=t error=~) ~]
7− %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
8− [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
7+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
8+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
99 [%got ts] [m(todos=ts) ~]
1010 [%acked err] [m(error=err) ~]
tests/golden/doc-core-02-update/tokens.txt+22−28
@@ -73,20 +73,17 @@
73737:29 tight str ""
74747:31 tight glyph )
75757:33 glyph ~[
76−7:35 tight glyph [
77−7:36 tight lit %poke
78−7:42 glyph (
79−7:43 tight wing todo-action.todo
80−7:60 glyph [
81−7:61 tight lit %add
82−7:66 wing draft.m
83−7:73 tight glyph ]
84−7:74 tight glyph )
85−7:76 glyph |=
86−7:78 tight lit %acked
87−7:84 tight glyph ]
88−7:85 tight glyph ]
89−7:86 tight glyph ]
76+7:35 tight glyph (
77+7:36 tight wing poke.todo
78+7:46 glyph [
79+7:47 tight lit %add
80+7:52 wing draft.m
81+7:59 tight glyph ]
82+7:61 glyph |=
83+7:63 tight lit %acked
84+7:69 tight glyph )
85+7:70 tight glyph ]
86+7:71 tight glyph ]
90878:5 NEWLINE
91888:5 glyph [
92898:6 tight lit %toggled
@@ -95,20 +92,17 @@
95928:20 glyph [
96938:21 tight name m
97948:23 glyph ~[
98−8:25 tight glyph [
99−8:26 tight lit %poke
100−8:32 glyph (
101−8:33 tight wing todo-action.todo
102−8:50 glyph [
103−8:51 tight lit %toggle
104−8:59 name id
105−8:61 tight glyph ]
106−8:62 tight glyph )
107−8:64 glyph |=
108−8:66 tight lit %acked
109−8:72 tight glyph ]
110−8:73 tight glyph ]
111−8:74 tight glyph ]
95+8:25 tight glyph (
96+8:26 tight wing poke.todo
97+8:36 glyph [
98+8:37 tight lit %toggle
99+8:45 name id
100+8:47 tight glyph ]
101+8:49 glyph |=
102+8:51 tight lit %acked
103+8:57 tight glyph )
104+8:58 tight glyph ]
105+8:59 tight glyph ]
1121069:5 NEWLINE
1131079:5 glyph [
1141089:6 tight lit %got
tests/golden/doc-core-02-update/tree.txt+10−14
@@ -44,25 +44,21 @@
4444 (change 7:21 m
4545 (edit 7:23 draft (str 7:29 "")))
4646 (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)))))
47+ (group 7:35
48+ (call 7:36
49+ (wing 7:36 poke.todo)
50+ (tuple 7:46 (lit 7:47 %add) (wing 7:52 draft.m))
51+ (ctor 7:61 %acked))))))
5452 (arm 8:5
5553 (cell 8:5 (lit 8:6 %toggled) (bind 8:15 id))
5654 (tuple 8:20
5755 (wing 8:21 m)
5856 (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)))))
57+ (group 8:25
58+ (call 8:26
59+ (wing 8:26 poke.todo)
60+ (tuple 8:36 (lit 8:37 %toggle) (wing 8:45 id))
61+ (ctor 8:49 %acked))))))
6662 (arm 9:5
6763 (cell 9:5 (lit 9:6 %got) (bind 9:11 ts))
6864 (tuple 9:20
tests/golden/doc-grammar-02-buttons/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Use the prepared prelude; this library has no Jibb module imports.
tests/golden/doc-grammar-02-buttons/types.txtnew file+4
@@ -0,0 +1,4 @@
1+partial inference; module not checked
2+++ add-button: tag needs context in partial inference
3+++ labelled: $-([label=@t msg=A] (element A))
4+++ wide: (list attr)
tests/golden/doc-grammar-04-step/about.txt+1
@@ -1,3 +1,4 @@
11source: Grammar tab, section "Patterns", code block 4 of the tab
22tests: 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+1−1
@@ -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−2
@@ -74,8 +74,8 @@
747413:5 glyph [
757513:6 tight name t
767613:8 lit %sent
77−13:14 name at
78−13:16 tight glyph ]
77+13:14 name sent-at
78+13:21 tight glyph ]
797913:23 name t
808014:5 NEWLINE
818114:5 lit %stop
tests/golden/doc-grammar-04-step/tree.txt+1−1
@@ -33,6 +33,6 @@
3333 (cell 12:5 (bind 12:6 t) (lit 12:8 %draft))
3434 (wing 12:23 t))
3535 (arm 13:5
36− (cell 13:5 (bind 13:6 t) (lit 13:8 %sent) (bind 13:14 at))
36+ (cell 13:5 (bind 13:6 t) (lit 13:8 %sent) (bind 13:14 sent-at))
3737 (wing 13:23 t))
3838 (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+2−3
@@ -1,13 +1,12 @@
11:: /ui/stores/cart.jibb
22+$ state [items=(list @t) open=?]
3−+$ cart-action
3++$ poke
44 [%add item=@t]
55 %toggle
6−+$ poke cart-action
76
87++ main (store init update)
98++ init ^- state [~ %.n]
10−++ update |= [a=cart-action s=state]
9+++ update |= [a=poke s=state]
1110 ?- a
1211 [%add item] s(items=[item items.s])
1312 %toggle s(open=(not open.s))
tests/golden/doc-grammar-06-cart-store/tokens.txt+56−60
@@ -13,7 +13,7 @@
13132:33 tight glyph ]
14143:1 NEWLINE
15153:1 glyph +$
16−3:4 name cart-action
16+3:4 name poke
17174:3 INDENT
18184:3 glyph [
19194:4 tight lit %add
@@ -23,68 +23,64 @@
23234:16 tight glyph ]
24245:3 NEWLINE
25255:3 lit %toggle
26−6:1 DEDENT
27−6:1 NEWLINE
28−6:1 glyph +$
29−6:4 name poke
30−6:9 name cart-action
26+7:1 DEDENT
27+7:1 NEWLINE
28+7:1 glyph ++
29+7:4 name main
30+7:9 glyph (
31+7:10 tight name store
32+7:16 name init
33+7:21 name update
34+7:27 tight glyph )
31358:1 NEWLINE
32368:1 glyph ++
33−8:4 name main
34−8:9 glyph (
35−8:10 tight name store
36−8:16 name init
37−8:21 name update
38−8:27 tight glyph )
37+8:4 name init
38+8:9 glyph ^-
39+8:12 name state
40+8:18 glyph [
41+8:19 tight lit ~
42+8:21 lit %.n
43+8:24 tight glyph ]
39449:1 NEWLINE
40459:1 glyph ++
41−9:4 name init
42−9:9 glyph ^-
43−9:12 name state
44−9:18 glyph [
45−9:19 tight lit ~
46−9:21 lit %.n
47−9:24 tight glyph ]
48−10:1 NEWLINE
49−10:1 glyph ++
50−10:4 name update
51−10:11 glyph |=
52−10:14 glyph [
53−10:15 tight name a
54−10:16 tight glyph =
55−10:17 tight name cart-action
56−10:29 name s
57−10:30 tight glyph =
58−10:31 tight name state
59−10:36 tight glyph ]
60−11:3 INDENT
61−11:3 glyph ?-
62−11:6 name a
63−12:5 INDENT
64−12:5 glyph [
65−12:6 tight lit %add
66−12:11 name item
67−12:15 tight glyph ]
46+9:4 name update
47+9:11 glyph |=
48+9:14 glyph [
49+9:15 tight name a
50+9:16 tight glyph =
51+9:17 tight name poke
52+9:22 name s
53+9:23 tight glyph =
54+9:24 tight name state
55+9:29 tight glyph ]
56+10:3 INDENT
57+10:3 glyph ?-
58+10:6 name a
59+11:5 INDENT
60+11:5 glyph [
61+11:6 tight lit %add
62+11:11 name item
63+11:15 tight glyph ]
64+11:18 name s
65+11:19 tight glyph (
66+11:20 tight name items
67+11:25 tight glyph =
68+11:26 tight glyph [
69+11:27 tight name item
70+11:32 wing items.s
71+11:39 tight glyph ]
72+11:40 tight glyph )
73+12:5 NEWLINE
74+12:5 lit %toggle
687512:18 name s
697612:19 tight glyph (
70−12:20 tight name items
71−12:25 tight glyph =
72−12:26 tight glyph [
73−12:27 tight name item
74−12:32 wing items.s
75−12:39 tight glyph ]
76−12:40 tight glyph )
77−13:5 NEWLINE
78−13:5 lit %toggle
79−13:18 name s
80−13:19 tight glyph (
81−13:20 tight name open
82−13:24 tight glyph =
83−13:25 tight glyph (
84−13:26 tight name not
85−13:30 wing open.s
86−13:36 tight glyph )
87−13:37 tight glyph )
88−13:38 DEDENT
89−13:38 DEDENT
90−13:38 NEWLINE
77+12:20 tight name open
78+12:24 tight glyph =
79+12:25 tight glyph (
80+12:26 tight name not
81+12:30 wing open.s
82+12:36 tight glyph )
83+12:37 tight glyph )
84+12:38 DEDENT
85+12:38 DEDENT
86+12:38 NEWLINE
tests/golden/doc-grammar-06-cart-store/tree.txt+25−26
@@ -4,36 +4,35 @@
44 (face 2:11 items
55 (apply 2:17 list (aura 2:23 @t)))
66 (face 2:27 open (flag 2:32))))
7− (mold 3:1 cart-action
7+ (mold 3:1 poke
88 (union 4:3
99 (cell 4:3
1010 (const 4:4 %add)
1111 (face 4:9 item (aura 4:14 @t)))
1212 (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)
13+ (value 7:1 main
14+ (group 7:9
15+ (call 7:10 (wing 7:10 store) (wing 7:16 init) (wing 7:21 update))))
16+ (value 8:1 init
17+ (cast 8:9
18+ (ref 8:12 state)
19+ (tuple 8:18 (lit 8:19 ~) (lit 8:21 %.n))))
20+ (value 9:1 update
21+ (gate 9:11
22+ (cell 9:14
23+ (face 9:15 a (ref 9:17 poke))
24+ (face 9:22 s (ref 9:24 state)))
25+ (body 10:3
26+ (branch 10:3
27+ (wing 10:6 a)
28+ (arm 11:5
29+ (cell 11:5 (lit 11:6 %add) (bind 11:11 item))
30+ (change 11:18 s
31+ (edit 11:20 items
32+ (tuple 11:26 (wing 11:27 item) (wing 11:32 items.s)))))
2933 (arm 12:5
30− (cell 12:5 (lit 12:6 %add) (bind 12:11 item))
34+ (lit 12:5 %toggle)
3135 (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)))))))))))
36+ (edit 12:20 open
37+ (group 12:25
38+ (call 12:26 (wing 12:26 not) (wing 12:30 open.s)))))))))))
tests/golden/doc-grammar-06-cart-store/types.txtnew file+6
@@ -0,0 +1,6 @@
1+partial inference; module not checked
2++$ state: not checked
3++$ poke: cases proven disjoint; mold not checked
4+++ main: [init=[items=(list @t) open=?] update=*]
5+++ init: [items=(list @t) open=?]
6+++ update: $-([a=poke s=[items=(list @t) open=?]] [items=(list @t) open=?])
tests/golden/doc-grammar-07-basket/source.jibb+2−2
@@ -17,8 +17,8 @@
1717++ update |= [=msg m=model]
1818 ?- msg
1919 [%noted t] [m(note=t) ~]
20− %add [m(note="") ~[[%poke (cart-action.cart [%add note.m]) |=%acked]]]
21− %toggle [m ~[[%poke (cart-action.cart %toggle) |=%acked]]]
20+ %add [m(note="") ~[(poke.cart [%add note.m] |=%acked)]]
21+ %toggle [m ~[(poke.cart %toggle |=%acked)]]
2222 [%got c] [m(cart=c) ~]
2323 [%acked err] [m ~]
2424
tests/golden/doc-grammar-07-basket/tokens.txt+19−25
@@ -111,36 +111,30 @@
11111120:28 tight str ""
11211220:30 tight glyph )
11311320:32 glyph ~[
114−20:34 tight glyph [
115−20:35 tight lit %poke
116−20:41 glyph (
117−20:42 tight wing cart-action.cart
118−20:59 glyph [
119−20:60 tight lit %add
120−20:65 wing note.m
121−20:71 tight glyph ]
122−20:72 tight glyph )
123−20:74 glyph |=
124−20:76 tight lit %acked
125−20:82 tight glyph ]
126−20:83 tight glyph ]
127−20:84 tight glyph ]
114+20:34 tight glyph (
115+20:35 tight wing poke.cart
116+20:45 glyph [
117+20:46 tight lit %add
118+20:51 wing note.m
119+20:57 tight glyph ]
120+20:59 glyph |=
121+20:61 tight lit %acked
122+20:67 tight glyph )
123+20:68 tight glyph ]
124+20:69 tight glyph ]
12812521:5 NEWLINE
12912621:5 lit %toggle
13012721:20 glyph [
13112821:21 tight name m
13212921:23 glyph ~[
133−21:25 tight glyph [
134−21:26 tight lit %poke
135−21:32 glyph (
136−21:33 tight wing cart-action.cart
137−21:50 lit %toggle
138−21:57 tight glyph )
139−21:59 glyph |=
140−21:61 tight lit %acked
141−21:67 tight glyph ]
142−21:68 tight glyph ]
143−21:69 tight glyph ]
130+21:25 tight glyph (
131+21:26 tight wing poke.cart
132+21:36 lit %toggle
133+21:44 glyph |=
134+21:46 tight lit %acked
135+21:52 tight glyph )
136+21:53 tight glyph ]
137+21:54 tight glyph ]
14413822:5 NEWLINE
14513922:5 glyph [
14614022:6 tight lit %got
tests/golden/doc-grammar-07-basket/tree.txt+7−12
@@ -48,23 +48,18 @@
4848 (change 20:21 m
4949 (edit 20:23 note (str 20:28 "")))
5050 (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)))))
51+ (group 20:34
52+ (call 20:35
53+ (wing 20:35 poke.cart)
54+ (tuple 20:45 (lit 20:46 %add) (wing 20:51 note.m))
55+ (ctor 20:59 %acked))))))
5856 (arm 21:5
5957 (lit 21:5 %toggle)
6058 (tuple 21:20
6159 (wing 21:21 m)
6260 (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)))))
61+ (group 21:25
62+ (call 21:26 (wing 21:26 poke.cart) (lit 21:36 %toggle) (ctor 21:44 %acked))))))
6863 (arm 22:5
6964 (cell 22:5 (lit 22:6 %got) (bind 22:11 c))
7065 (tuple 22:20
tests/golden/doc-overview-01-cmd-sub/source.jibb+1−1
@@ -1,5 +1,5 @@
11+$ cmd |$ [M]
2− [%poke p=poke reply=$-((unit @t) M)]
2+ [%poke p=raw-poke reply=$-((unit @t) M)]
33 [%go url=@t]
44 [%wait gap=@dr msg=M]
55 [%now reply=$-(@da M)]
tests/golden/doc-overview-01-cmd-sub/tokens.txt+11−11
@@ -9,17 +9,17 @@
992:4 tight lit %poke
10102:10 name p
11112:11 tight glyph =
12−2:12 tight name poke
13−2:17 name reply
14−2:22 tight glyph =
15−2:23 tight glyph $-(
16−2:26 tight glyph (
17−2:27 tight name unit
18−2:32 aura @t
19−2:34 tight glyph )
20−2:36 tvar M
21−2:37 tight glyph )
22−2:38 tight glyph ]
12+2:12 tight name raw-poke
13+2:21 name reply
14+2:26 tight glyph =
15+2:27 tight glyph $-(
16+2:30 tight glyph (
17+2:31 tight name unit
18+2:36 aura @t
19+2:38 tight glyph )
20+2:40 tvar M
21+2:41 tight glyph )
22+2:42 tight glyph ]
23233:3 NEWLINE
24243:3 glyph [
25253:4 tight lit %go
tests/golden/doc-overview-01-cmd-sub/tree.txt+5−5
@@ -4,11 +4,11 @@
44 (union 2:3
55 (cell 2:3
66 (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))))
7+ (face 2:10 p (ref 2:12 raw-poke))
8+ (face 2:21 reply
9+ (fn 2:27
10+ (apply 2:30 unit (aura 2:36 @t))
11+ (tvar 2:40 M))))
1212 (cell 3:3
1313 (const 3:4 %go)
1414 (face 3:8 url (aura 3:12 @t)))
tests/golden/doc-overview-02-theme/source.jibb+1−1
@@ -5,4 +5,4 @@
55 lang="en"
66 zone="UTC"
77 font=`%/static/fonts/inter.woff2
8− dark=[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
8+ dark=`[tones=[normal="#eee" background="#111" accent="#4c9" danger="#f28b82" muted="#aaa"]]
tests/golden/doc-overview-02-theme/tokens.txt+24−23
@@ -62,27 +62,28 @@
62628:5 NEWLINE
63638:5 name dark
64648:9 tight glyph =
65−8:10 tight glyph [
66−8:11 tight name tones
67−8:16 tight glyph =
68−8:17 tight glyph [
69−8:18 tight name normal
70−8:24 tight glyph =
71−8:25 tight str "#eee"
72−8:32 name background
73−8:42 tight glyph =
74−8:43 tight str "#111"
75−8:50 name accent
76−8:56 tight glyph =
77−8:57 tight str "#4c9"
78−8:64 name danger
79−8:70 tight glyph =
80−8:71 tight str "#f28b82"
81−8:81 name muted
82−8:86 tight glyph =
83−8:87 tight str "#aaa"
84−8:93 tight glyph ]
65+8:10 tight glyph `
66+8:11 tight glyph [
67+8:12 tight name tones
68+8:17 tight glyph =
69+8:18 tight glyph [
70+8:19 tight name normal
71+8:25 tight glyph =
72+8:26 tight str "#eee"
73+8:33 name background
74+8:43 tight glyph =
75+8:44 tight str "#111"
76+8:51 name accent
77+8:57 tight glyph =
78+8:58 tight str "#4c9"
79+8:65 name danger
80+8:71 tight glyph =
81+8:72 tight str "#f28b82"
82+8:82 name muted
83+8:87 tight glyph =
84+8:88 tight str "#aaa"
85858:94 tight glyph ]
86−8:95 DEDENT
87−8:95 DEDENT
88−8:95 NEWLINE
86+8:95 tight glyph ]
87+8:96 DEDENT
88+8:96 DEDENT
89+8:96 NEWLINE
tests/golden/doc-overview-02-theme/tree.txt+9−8
@@ -22,11 +22,12 @@
2222 (face 7:5 font
2323 (unit 7:10 (qath 7:11 static fonts inter.woff2)))
2424 (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")))))))))))
25+ (unit 8:10
26+ (tuple 8:11
27+ (face 8:12 tones
28+ (tuple 8:18
29+ (face 8:19 normal (str 8:26 "#eee"))
30+ (face 8:33 background (str 8:44 "#111"))
31+ (face 8:51 accent (str 8:58 "#4c9"))
32+ (face 8:65 danger (str 8:72 "#f28b82"))
33+ (face 8:82 muted (str 8:88 "#aaa"))))))))))))
tests/golden/doc-overview-10-todo-list/source.jibb+2−2
@@ -19,8 +19,8 @@
1919 ?- (gth (lent (tuba (trip t))) 80)
2020 %.y [m(draft=t error=`"Too long") ~]
2121 %.n [m(draft=t error=~) ~]
22− %submit [m(draft="") ~[[%poke (todo-action.todo [%add draft.m]) |=%acked]]]
23− [%toggled id] [m ~[[%poke (todo-action.todo [%toggle id]) |=%acked]]]
22+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
23+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
2424 [%got ts] [m(todos=ts) ~]
2525 [%acked err] [m(error=err) ~]
2626
tests/golden/doc-overview-10-todo-list/tokens.txt+22−28
@@ -169,20 +169,17 @@
16916922:29 tight str ""
17017022:31 tight glyph )
17117122:33 glyph ~[
172−22:35 tight glyph [
173−22:36 tight lit %poke
174−22:42 glyph (
175−22:43 tight wing todo-action.todo
176−22:60 glyph [
177−22:61 tight lit %add
178−22:66 wing draft.m
179−22:73 tight glyph ]
180−22:74 tight glyph )
181−22:76 glyph |=
182−22:78 tight lit %acked
183−22:84 tight glyph ]
184−22:85 tight glyph ]
185−22:86 tight glyph ]
172+22:35 tight glyph (
173+22:36 tight wing poke.todo
174+22:46 glyph [
175+22:47 tight lit %add
176+22:52 wing draft.m
177+22:59 tight glyph ]
178+22:61 glyph |=
179+22:63 tight lit %acked
180+22:69 tight glyph )
181+22:70 tight glyph ]
182+22:71 tight glyph ]
18618323:5 NEWLINE
18718423:5 glyph [
18818523:6 tight lit %toggled
@@ -191,20 +188,17 @@
19118823:20 glyph [
19218923:21 tight name m
19319023:23 glyph ~[
194−23:25 tight glyph [
195−23:26 tight lit %poke
196−23:32 glyph (
197−23:33 tight wing todo-action.todo
198−23:50 glyph [
199−23:51 tight lit %toggle
200−23:59 name id
201−23:61 tight glyph ]
202−23:62 tight glyph )
203−23:64 glyph |=
204−23:66 tight lit %acked
205−23:72 tight glyph ]
206−23:73 tight glyph ]
207−23:74 tight glyph ]
191+23:25 tight glyph (
192+23:26 tight wing poke.todo
193+23:36 glyph [
194+23:37 tight lit %toggle
195+23:45 name id
196+23:47 tight glyph ]
197+23:49 glyph |=
198+23:51 tight lit %acked
199+23:57 tight glyph )
200+23:58 tight glyph ]
201+23:59 tight glyph ]
20820224:5 NEWLINE
20920324:5 glyph [
21020424:6 tight lit %got
tests/golden/doc-overview-10-todo-list/tree.txt+10−14
@@ -78,25 +78,21 @@
7878 (change 22:21 m
7979 (edit 22:23 draft (str 22:29 "")))
8080 (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)))))
81+ (group 22:35
82+ (call 22:36
83+ (wing 22:36 poke.todo)
84+ (tuple 22:46 (lit 22:47 %add) (wing 22:52 draft.m))
85+ (ctor 22:61 %acked))))))
8886 (arm 23:5
8987 (cell 23:5 (lit 23:6 %toggled) (bind 23:15 id))
9088 (tuple 23:20
9189 (wing 23:21 m)
9290 (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)))))
91+ (group 23:25
92+ (call 23:26
93+ (wing 23:26 poke.todo)
94+ (tuple 23:36 (lit 23:37 %toggle) (wing 23:45 id))
95+ (ctor 23:49 %acked))))))
10096 (arm 24:5
10197 (cell 24:5 (lit 24:6 %got) (bind 24:11 ts))
10298 (tuple 24:20
tests/golden/inline-mold-opaque/about.txt+2−2
@@ -1,3 +1,3 @@
1−source: Grammar tab, Molds: "Opaque: `poke`, `ask` and `qath`, built only by derived gates, `pure` and application-path literals."
2−tests: the opaque molds by name
1+source: Grammar tab, Molds: "`raw-poke`, `ask` and `qath` are transparent types, defined in the internal prelude and re-exported normally; callers can construct and inspect their values."
2+tests: the effect and application-path types by name
33expect: parses
tests/golden/inline-mold-opaque/source.jibb+1−1
@@ -1,3 +1,3 @@
1−+$ a poke
1++$ a raw-poke
22+$ b ask
33+$ c qath
tests/golden/inline-mold-opaque/tokens.txt+1−1
@@ -1,6 +1,6 @@
111:1 glyph +$
221:4 name a
3−1:6 name poke
3+1:6 name raw-poke
442:1 NEWLINE
552:1 glyph +$
662:4 name b
tests/golden/inline-mold-opaque/tree.txt+1−1
@@ -1,4 +1,4 @@
11(module
2− (mold 1:1 a (ref 1:6 poke))
2+ (mold 1:1 a (ref 1:6 raw-poke))
33 (mold 2:1 b (ref 2:6 ask))
44 (mold 3:1 c (ref 3:6 qath)))
tests/golden/inline-namespaces/about.txt+1−1
@@ -1,3 +1,3 @@
1−source: Grammar tab, Modules: "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."
1+source: Grammar tab, Modules: "Molds and values have separate namespaces, told apart by position: `todo-action.todo` is a mold, `poke.todo` its command helper, and `todos.todo` a mold and a request."
22tests: the same wings in mold and in value position
33expect: parses
tests/golden/inline-namespaces/source.jibb+1−1
@@ -1,4 +1,4 @@
11+$ a todo-action.todo
2−++ b todo-action.todo
2+++ b poke.todo
33+$ c todos.todo
44++ d todos.todo
tests/golden/inline-namespaces/tokens.txt+1−1
@@ -4,7 +4,7 @@
442:1 NEWLINE
552:1 glyph ++
662:4 name b
7−2:6 wing todo-action.todo
7+2:6 wing poke.todo
883:1 NEWLINE
993:1 glyph +$
10103:4 name c
tests/golden/inline-namespaces/tree.txt+1−1
@@ -1,5 +1,5 @@
11(module
22 (mold 1:1 a (ref 1:6 todo-action.todo))
3− (value 2:1 b (wing 2:6 todo-action.todo))
3+ (value 2:1 b (wing 2:6 poke.todo))
44 (mold 3:1 c (ref 3:6 todos.todo))
55 (value 4:1 d (wing 4:6 todos.todo)))
tests/golden/inline-requests/about.txt+2−2
@@ -1,3 +1,3 @@
1−source: the first tab ("Jibb — an Elm-architecture UI language for Urbit"), The Elm architecture on Urbit, Effects: "A constructor such as `(todo-action.todo [%add draft.m])` checks its value", "A request such as `(todos.todo |=%got)`", and "A path with diffs also takes a fold, `(changes.todo |=%got apply)`"
2−tests: derived gates called with a cell, a constructor, and a constructor followed by a name
1+source: the first tab ("Jibb — an Elm-architecture UI language for Urbit"), The Elm architecture on Urbit, Effects: "A derived poke helper such as `(poke.todo [%add draft.m] |=%acked)` checks its value and supplies the agent and mark", "A request such as `(todos.todo |=%got)`", and "A path with diffs also takes a fold, `(changes.todo |=%got apply)`"
2+tests: derived gates called with an action and reply, a request, and a request followed by a fold
33expect: parses
tests/golden/inline-requests/source.jibb+1−1
@@ -1,3 +1,3 @@
1−++ a (todo-action.todo [%add draft.m])
1+++ a (poke.todo [%add draft.m] same)
22++ b (todos.todo |=%got)
33++ c (changes.todo |=%got apply)
tests/golden/inline-requests/tokens.txt+7−6
@@ -1,12 +1,13 @@
111:1 glyph ++
221:4 name a
331:6 glyph (
4−1:7 tight wing todo-action.todo
5−1:24 glyph [
6−1:25 tight lit %add
7−1:30 wing draft.m
8−1:37 tight glyph ]
9−1:38 tight glyph )
4+1:7 tight wing poke.todo
5+1:17 glyph [
6+1:18 tight lit %add
7+1:23 wing draft.m
8+1:30 tight glyph ]
9+1:32 name same
10+1:36 tight glyph )
10112:1 NEWLINE
11122:1 glyph ++
12132:4 name b
tests/golden/inline-requests/tree.txt+3−2
@@ -2,8 +2,9 @@
22 (value 1:1 a
33 (group 1:6
44 (call 1:7
5− (wing 1:7 todo-action.todo)
6− (tuple 1:24 (lit 1:25 %add) (wing 1:30 draft.m)))))
5+ (wing 1:7 poke.todo)
6+ (tuple 1:17 (lit 1:18 %add) (wing 1:23 draft.m))
7+ (wing 1:32 same))))
78 (value 2:1 b
89 (group 2:6
910 (call 2:7 (wing 2:7 todos.todo) (ctor 2:18 %got))))
tests/golden/module-import-cycle/source.jibb+1−1
@@ -1,2 +1,2 @@
11/= a /ui/a
2−++ text (identity.a "hi")
2+++ text-value (identity.a "hi")
tests/golden/module-import-cycle/tokens.txt+6−6
@@ -6,9 +6,9 @@
661:11 tight knot a
772:1 NEWLINE
882:1 glyph ++
9−2:4 name text
10−2:9 glyph (
11−2:10 tight wing identity.a
12−2:21 str "hi"
13−2:25 tight glyph )
14−2:26 NEWLINE
9+2:4 name text-value
10+2:15 glyph (
11+2:16 tight wing identity.a
12+2:27 str "hi"
13+2:31 tight glyph )
14+2:32 NEWLINE
tests/golden/module-import-cycle/tree.txt+3−3
@@ -1,5 +1,5 @@
11(module
22 (jibb 1:1 a /ui/a)
3− (value 2:1 text
4− (group 2:9
5− (call 2:10 (wing 2:10 identity.a) (str 2:21 "hi")))))
3+ (value 2:1 text-value
4+ (group 2:15
5+ (call 2:16 (wing 2:16 identity.a) (str 2:27 "hi")))))
tests/golden/module-import-identity/source.jibb+1−1
@@ -1,3 +1,3 @@
11/= lib /ui/lib
2−++ text (identity.lib "hi")
2+++ text-value (identity.lib "hi")
33++ ship (identity.lib ~zod)
tests/golden/module-import-identity/tokens.txt+5−5
@@ -6,11 +6,11 @@
661:13 tight knot lib
772:1 NEWLINE
882:1 glyph ++
9−2:4 name text
10−2:9 glyph (
11−2:10 tight wing identity.lib
12−2:23 str "hi"
13−2:27 tight glyph )
9+2:4 name text-value
10+2:15 glyph (
11+2:16 tight wing identity.lib
12+2:29 str "hi"
13+2:33 tight glyph )
14143:1 NEWLINE
15153:1 glyph ++
16163:4 name ship
tests/golden/module-import-identity/tree.txt+3−3
@@ -1,8 +1,8 @@
11(module
22 (jibb 1:1 lib /ui/lib)
3− (value 2:1 text
4− (group 2:9
5− (call 2:10 (wing 2:10 identity.lib) (str 2:23 "hi"))))
3+ (value 2:1 text-value
4+ (group 2:15
5+ (call 2:16 (wing 2:16 identity.lib) (str 2:29 "hi"))))
66 (value 3:1 ship
77 (group 3:9
88 (call 3:10 (wing 3:10 identity.lib) (lit 3:23 ~zod)))))
tests/golden/module-import-identity/types.txt+1−1
@@ -1,3 +1,3 @@
11partial inference; module not checked
2−++ text: @t
2+++ text-value: @t
33++ ship: @p
tests/golden/module-import-transitive/source.jibb+1−1
@@ -1,2 +1,2 @@
11/= a /ui/a
2−++ text (identity.a "hi")
2+++ text-value (identity.a "hi")
tests/golden/module-import-transitive/tokens.txt+6−6
@@ -6,9 +6,9 @@
661:11 tight knot a
772:1 NEWLINE
882:1 glyph ++
9−2:4 name text
10−2:9 glyph (
11−2:10 tight wing identity.a
12−2:21 str "hi"
13−2:25 tight glyph )
14−2:26 NEWLINE
9+2:4 name text-value
10+2:15 glyph (
11+2:16 tight wing identity.a
12+2:27 str "hi"
13+2:31 tight glyph )
14+2:32 NEWLINE
tests/golden/module-import-transitive/tree.txt+3−3
@@ -1,5 +1,5 @@
11(module
22 (jibb 1:1 a /ui/a)
3− (value 2:1 text
4− (group 2:9
5− (call 2:10 (wing 2:10 identity.a) (str 2:21 "hi")))))
3+ (value 2:1 text-value
4+ (group 2:15
5+ (call 2:16 (wing 2:16 identity.a) (str 2:27 "hi")))))
tests/golden/module-import-transitive/types.txt+1−1
@@ -1,2 +1,2 @@
11partial inference; module not checked
2−++ text: @t
2+++ text-value: @t
tests/golden/module-import-unused-invalid/source.jibb+1−1
@@ -1,2 +1,2 @@
11/= good /ui/good
2−++ text (identity.good "hi")
2+++ text-value (identity.good "hi")
tests/golden/module-import-unused-invalid/tokens.txt+6−6
@@ -6,9 +6,9 @@
661:14 tight knot good
772:1 NEWLINE
882:1 glyph ++
9−2:4 name text
10−2:9 glyph (
11−2:10 tight wing identity.good
12−2:24 str "hi"
13−2:28 tight glyph )
14−2:29 NEWLINE
9+2:4 name text-value
10+2:15 glyph (
11+2:16 tight wing identity.good
12+2:30 str "hi"
13+2:34 tight glyph )
14+2:35 NEWLINE
tests/golden/module-import-unused-invalid/tree.txt+3−3
@@ -1,5 +1,5 @@
11(module
22 (jibb 1:1 good /ui/good)
3− (value 2:1 text
4− (group 2:9
5− (call 2:10 (wing 2:10 identity.good) (str 2:24 "hi")))))
3+ (value 2:1 text-value
4+ (group 2:15
5+ (call 2:16 (wing 2:16 identity.good) (str 2:30 "hi")))))
tests/golden/module-import-unused-invalid/types.txt+1−1
@@ -1,2 +1,2 @@
11partial inference; module not checked
2−++ text: @t
2+++ text-value: @t
tests/golden/parser-hole-parameter-rejected/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: An anonymous hole is not a named generic parameter.
3+expect: error at 1:12
tests/golden/parser-hole-parameter-rejected/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ bad |$ [_] @t
tests/golden/parser-hole-parameter-rejected/tokens.txtnew file+8
@@ -0,0 +1,8 @@
1+1:1 glyph +$
2+1:4 name bad
3+1:8 glyph |$
4+1:11 glyph [
5+1:12 tight glyph _
6+1:13 tight glyph ]
7+1:15 aura @t
8+1:17 NEWLINE
tests/golden/parser-hole-parameter-rejected/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-parameter-rejected/source.jibb:1:12: expected a type variable, found `_`
2++$ bad |$ [_] @t
3+ ^
tests/golden/parser-hole-path-space/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: A path-segment type hole must remain tight after the field's `=`.
3+expect: error at 1:14
tests/golden/parser-hole-path-space/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ path /[id= _]
tests/golden/parser-hole-path-space/tokens.txtnew file+9
@@ -0,0 +1,9 @@
1+1:1 glyph +$
2+1:4 name path
3+1:9 glyph /
4+1:10 tight glyph [
5+1:11 tight name id
6+1:13 tight glyph =
7+1:15 glyph _
8+1:16 tight glyph ]
9+1:17 NEWLINE
tests/golden/parser-hole-path-space/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-path-space/source.jibb:1:14: expected an aura or type hole right after `=`, found a space
2++$ path /[id= _]
3+ ^
tests/golden/parser-hole-path/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: Underscores in `/_` and `%/_` remain literal path knots, while `[id=_]` is a typed-segment hole.
3+expect: parses
tests/golden/parser-hole-path/source.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ root /_
2++$ child /item/_x
3+++ show %/_
4++$ inferred /items/[id=_]
tests/golden/parser-hole-path/tokens.txtnew file+28
@@ -0,0 +1,28 @@
1+1:1 glyph +$
2+1:4 name root
3+1:9 glyph /
4+1:10 tight knot _
5+2:1 NEWLINE
6+2:1 glyph +$
7+2:4 name child
8+2:10 glyph /
9+2:11 tight knot item
10+2:15 tight glyph /
11+2:16 tight knot _x
12+3:1 NEWLINE
13+3:1 glyph ++
14+3:4 name show
15+3:9 glyph %/
16+3:11 tight knot _
17+4:1 NEWLINE
18+4:1 glyph +$
19+4:4 name inferred
20+4:13 glyph /
21+4:14 tight knot items
22+4:19 tight glyph /
23+4:20 tight glyph [
24+4:21 tight name id
25+4:23 tight glyph =
26+4:24 tight glyph _
27+4:25 tight glyph ]
28+4:26 NEWLINE
tests/golden/parser-hole-path/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (mold 1:1 root (path 1:9 /_))
3+ (mold 2:1 child (path 2:10 /item/_x))
4+ (value 3:1 show (qath 3:9 _))
5+ (mold 4:1 inferred (path 4:13 /items/[id=_])))
tests/golden/parser-hole-pattern-rejected/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: A type hole is not a branch-pattern wildcard.
3+expect: error at 3:5
tests/golden/parser-hole-pattern-rejected/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+++ bad |= x=@t
2+ ?- x
3+ _ "no"
tests/golden/parser-hole-pattern-rejected/tokens.txtnew file+15
@@ -0,0 +1,15 @@
1+1:1 glyph ++
2+1:4 name bad
3+1:8 glyph |=
4+1:11 name x
5+1:12 tight glyph =
6+1:13 tight aura @t
7+2:3 INDENT
8+2:3 glyph ?-
9+2:6 name x
10+3:5 INDENT
11+3:5 glyph _
12+3:7 str "no"
13+3:11 DEDENT
14+3:11 DEDENT
15+3:11 NEWLINE
tests/golden/parser-hole-pattern-rejected/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-pattern-rejected/source.jibb:3:5: expected a pattern, found `_`
2+ _ "no"
3+ ^
tests/golden/parser-hole-shapes/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: Holes in samples, casts, nested records, gate molds and generic mold arguments have their own source spans.
3+expect: parses
tests/golden/parser-hole-shapes/source.jibbnew file+11
@@ -0,0 +1,11 @@
1++$ unused _
2++$ nested [a=_ b=$-(_ (list _))]
3++$ alias |$ [A] (pair A _)
4+++ identity |= x=_ x
5+++ inferred ^- _ "hello"
6+++ cast-nested |= x=[$-(_ _) (list _)] ^- [first=_ second=_] [x x]
7+++ bare-sample |= _ "hello"
8+++ cell-sample |= [a=_ b=_] [a b]
9+++ local |= x=@t
10+ ++ inside |= y=_ ^- _ y
11+ (inside x)
tests/golden/parser-hole-shapes/tokens.txtnew file+121
@@ -0,0 +1,121 @@
1+1:1 glyph +$
2+1:4 name unused
3+1:11 glyph _
4+2:1 NEWLINE
5+2:1 glyph +$
6+2:4 name nested
7+2:11 glyph [
8+2:12 tight name a
9+2:13 tight glyph =
10+2:14 tight glyph _
11+2:16 name b
12+2:17 tight glyph =
13+2:18 tight glyph $-(
14+2:21 tight glyph _
15+2:23 glyph (
16+2:24 tight name list
17+2:29 glyph _
18+2:30 tight glyph )
19+2:31 tight glyph )
20+2:32 tight glyph ]
21+3:1 NEWLINE
22+3:1 glyph +$
23+3:4 name alias
24+3:10 glyph |$
25+3:13 glyph [
26+3:14 tight tvar A
27+3:15 tight glyph ]
28+3:17 glyph (
29+3:18 tight name pair
30+3:23 tvar A
31+3:25 glyph _
32+3:26 tight glyph )
33+4:1 NEWLINE
34+4:1 glyph ++
35+4:4 name identity
36+4:13 glyph |=
37+4:16 name x
38+4:17 tight glyph =
39+4:18 tight glyph _
40+4:20 name x
41+5:1 NEWLINE
42+5:1 glyph ++
43+5:4 name inferred
44+5:13 glyph ^-
45+5:16 glyph _
46+5:18 str "hello"
47+6:1 NEWLINE
48+6:1 glyph ++
49+6:4 name cast-nested
50+6:16 glyph |=
51+6:19 name x
52+6:20 tight glyph =
53+6:21 tight glyph [
54+6:22 tight glyph $-(
55+6:25 tight glyph _
56+6:27 glyph _
57+6:28 tight glyph )
58+6:30 glyph (
59+6:31 tight name list
60+6:36 glyph _
61+6:37 tight glyph )
62+6:38 tight glyph ]
63+6:40 glyph ^-
64+6:43 glyph [
65+6:44 tight name first
66+6:49 tight glyph =
67+6:50 tight glyph _
68+6:52 name second
69+6:58 tight glyph =
70+6:59 tight glyph _
71+6:60 tight glyph ]
72+6:62 glyph [
73+6:63 tight name x
74+6:65 name x
75+6:66 tight glyph ]
76+7:1 NEWLINE
77+7:1 glyph ++
78+7:4 name bare-sample
79+7:16 glyph |=
80+7:19 glyph _
81+7:21 str "hello"
82+8:1 NEWLINE
83+8:1 glyph ++
84+8:4 name cell-sample
85+8:16 glyph |=
86+8:19 glyph [
87+8:20 tight name a
88+8:21 tight glyph =
89+8:22 tight glyph _
90+8:24 name b
91+8:25 tight glyph =
92+8:26 tight glyph _
93+8:27 tight glyph ]
94+8:29 glyph [
95+8:30 tight name a
96+8:32 name b
97+8:33 tight glyph ]
98+9:1 NEWLINE
99+9:1 glyph ++
100+9:4 name local
101+9:10 glyph |=
102+9:13 name x
103+9:14 tight glyph =
104+9:15 tight aura @t
105+10:3 INDENT
106+10:3 glyph ++
107+10:6 name inside
108+10:13 glyph |=
109+10:16 name y
110+10:17 tight glyph =
111+10:18 tight glyph _
112+10:20 glyph ^-
113+10:23 glyph _
114+10:25 name y
115+11:3 NEWLINE
116+11:3 glyph (
117+11:4 tight name inside
118+11:11 name x
119+11:12 tight glyph )
120+11:13 DEDENT
121+11:13 NEWLINE
tests/golden/parser-hole-shapes/tree.txtnew file+47
@@ -0,0 +1,47 @@
1+(module
2+ (mold 1:1 unused (hole 1:11))
3+ (mold 2:1 nested
4+ (cell 2:11
5+ (face 2:12 a (hole 2:14))
6+ (face 2:16 b
7+ (fn 2:18
8+ (hole 2:21)
9+ (apply 2:23 list (hole 2:29))))))
10+ (mold 3:1 alias
11+ (generic 3:10 A
12+ (apply 3:17 pair (tvar 3:23 A) (hole 3:25))))
13+ (value 4:1 identity
14+ (gate 4:13
15+ (face 4:16 x (hole 4:18))
16+ (wing 4:20 x)))
17+ (value 5:1 inferred
18+ (cast 5:13 (hole 5:16) (str 5:18 "hello")))
19+ (value 6:1 cast-nested
20+ (gate 6:16
21+ (face 6:19 x
22+ (cell 6:21
23+ (fn 6:22 (hole 6:25) (hole 6:27))
24+ (apply 6:30 list (hole 6:36))))
25+ (cast 6:40
26+ (cell 6:43
27+ (face 6:44 first (hole 6:50))
28+ (face 6:52 second (hole 6:59)))
29+ (tuple 6:62 (wing 6:63 x) (wing 6:65 x)))))
30+ (value 7:1 bare-sample
31+ (gate 7:16 (hole 7:19) (str 7:21 "hello")))
32+ (value 8:1 cell-sample
33+ (gate 8:16
34+ (cell 8:19
35+ (face 8:20 a (hole 8:22))
36+ (face 8:24 b (hole 8:26)))
37+ (tuple 8:29 (wing 8:30 a) (wing 8:32 b))))
38+ (value 9:1 local
39+ (gate 9:10
40+ (face 9:13 x (aura 9:15 @t))
41+ (body 10:3
42+ (value 10:3 inside
43+ (gate 10:13
44+ (face 10:16 y (hole 10:18))
45+ (cast 10:20 (hole 10:23) (wing 10:25 y))))
46+ (group 11:3
47+ (call 11:4 (wing 11:4 inside) (wing 11:11 x)))))))
tests/golden/parser-hole-value-rejected/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: A type hole is not a value expression.
3+expect: error at 1:8
tests/golden/parser-hole-value-rejected/source.jibbnew file+1
@@ -0,0 +1 @@
1+++ bad _
tests/golden/parser-hole-value-rejected/tokens.txtnew file+4
@@ -0,0 +1,4 @@
1+1:1 glyph ++
2+1:4 name bad
3+1:8 glyph _
4+1:9 NEWLINE
tests/golden/parser-hole-value-rejected/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-value-rejected/source.jibb:1:8: expected an expression, found `_`
2+++ bad _
3+ ^
tests/golden/prelude-1c-structural/source.jibb+12−3
@@ -45,9 +45,10 @@
4545++ turn |= args=[(list A) $-(A B)]
4646 ?- args
4747 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
5152
5253+$ dime [p=@ta q=@]
5354
@@ -95,6 +96,14 @@
9596
9697+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
9798
99+++ like |= [f=$-(A B) result=(like A)]
100+ ++ mapped
101+ ^- (unit [p=B q=nail])
102+ ?- q.result
103+ ~ ~
104+ [~ value] `[p=(f p.value) q=q.value]
105+ ^- (like B) [p=p.result q=mapped]
106+
98107++ wonk |= veq=(like A)
99108 ?- q.veq
100109 ~ !!
tests/golden/prelude-1c-structural/tokens.txt+529−447
@@ -244,481 +244,563 @@
24424447:9 name f
24524547:10 tight glyph ]
24624648:7 INDENT
247−48:7 glyph ?-
248−48:10 name xs
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
24925249:9 INDENT
250−49:9 lit ~
251−49:11 lit ~
252−50:9 NEWLINE
253−50:9 glyph [
254−50:10 tight name item
255−50:15 name rest
256−50:19 tight glyph ]
257−50:21 glyph [
258−50:22 tight glyph (
259−50:23 tight name f
260−50:25 name item
261−50:29 tight glyph )
262−50:31 glyph (
263−50:32 tight name turn
264−50:37 name rest
265−50:42 name f
266−50:43 tight glyph )
267−50:44 tight glyph ]
268−52:1 DEDENT
269−52:1 DEDENT
270−52:1 DEDENT
271−52:1 DEDENT
272−52:1 NEWLINE
273−52:1 glyph +$
274−52:4 name dime
275−52:9 glyph [
276−52:10 tight name p
277−52:11 tight glyph =
278−52:12 tight aura @ta
279−52:16 name q
280−52:17 tight glyph =
281−52:18 tight aura @
282−52:19 tight glyph ]
283−54:1 NEWLINE
284−54:1 glyph +$
285−54:4 name hair
286−54:9 glyph [
287−54:10 tight name p
288−54:11 tight glyph =
289−54:12 tight aura @ud
290−54:16 name q
291−54:17 tight glyph =
292−54:18 tight aura @ud
293−54:21 tight glyph ]
294−56:1 NEWLINE
295−56:1 glyph +$
296−56:4 name pint
297−56:9 glyph [
298−56:10 tight name p
299−56:11 tight glyph =
300−56:12 tight glyph [
301−56:13 tight name p
302−56:14 tight glyph =
303−56:15 tight aura @
304−56:17 name q
305−56:18 tight glyph =
306−56:19 tight aura @
307−56:20 tight glyph ]
308−56:22 name q
309−56:23 tight glyph =
310−56:24 tight glyph [
311−56:25 tight name p
312−56:26 tight glyph =
313−56:27 tight aura @
314−56:29 name q
315−56:30 tight glyph =
316−56:31 tight aura @
317−56:32 tight glyph ]
318−56:33 tight glyph ]
319−58:1 NEWLINE
320−58:1 glyph +$
321−58:4 name coin
322−59:3 INDENT
323−59:3 glyph [
324−59:4 tight lit %$
325−59:7 name p
326−59:8 tight glyph =
327−59:9 tight name dime
328−59:13 tight glyph ]
329−60:3 NEWLINE
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
33033060:3 glyph [
331−60:4 tight lit %blob
332−60:10 name p
333−60:11 tight glyph =
334−60:12 tight glyph *
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
33533560:13 tight glyph ]
33633661:3 NEWLINE
33733761:3 glyph [
338−61:4 tight lit %many
338+61:4 tight lit %blob
33933961:10 name p
34034061:11 tight glyph =
341−61:12 tight glyph (
342−61:13 tight name list
343−61:18 name coin
344−61:22 tight glyph )
345−61:23 tight glyph ]
346−63:1 DEDENT
347−63:1 NEWLINE
348−63:1 glyph +$
349−63:4 name pair
350−63:9 glyph |$
351−63:12 glyph [
352−63:13 tight tvar A
353−63:15 tvar B
354−63:16 tight glyph ]
355−63:18 glyph [
356−63:19 tight name p
357−63:20 tight glyph =
358−63:21 tight tvar A
359−63:23 name q
360−63:24 tight glyph =
361−63:25 tight tvar B
362−63:26 tight glyph ]
363−65:1 NEWLINE
364−65:1 glyph +$
365−65:4 name trel
366−65:9 glyph |$
367−65:12 glyph [
368−65:13 tight tvar A
369−65:15 tvar B
370−65:17 tvar C
371−65:18 tight glyph ]
372−65:20 glyph [
373−65:21 tight name p
374−65:22 tight glyph =
375−65:23 tight tvar A
376−65:25 name q
377−65:26 tight glyph =
378−65:27 tight tvar B
379−65:29 name r
380−65:30 tight glyph =
381−65:31 tight tvar C
382−65:32 tight glyph ]
383−67:1 NEWLINE
384−67:1 glyph +$
385−67:4 name qual
386−67:9 glyph |$
387−67:12 glyph [
388−67:13 tight tvar A
389−67:15 tvar B
390−67:17 tvar C
391−67:19 tvar D
392−67:20 tight glyph ]
393−67:22 glyph [
394−67:23 tight name p
395−67:24 tight glyph =
396−67:25 tight tvar A
397−67:27 name q
398−67:28 tight glyph =
399−67:29 tight tvar B
400−67:31 name r
401−67:32 tight glyph =
402−67:33 tight tvar C
403−67:35 name s
404−67:36 tight glyph =
405−67:37 tight tvar D
406−67:38 tight glyph ]
407−69:1 NEWLINE
408−69:1 glyph +$
409−69:4 name cord
410−69:9 aura @t
411−71:1 NEWLINE
412−71:1 glyph +$
413−71:4 name knot
414−71:9 aura @ta
415−73:1 NEWLINE
416−73:1 glyph +$
417−73:4 name tape
418−73:9 glyph (
419−73:10 tight name list
420−73:15 aura @tD
421−73:18 tight glyph )
422−75:1 NEWLINE
423−75:1 glyph +$
424−75:4 name path
425−75:9 glyph (
426−75:10 tight name list
427−75:15 name knot
428−75:19 tight glyph )
429−77:1 NEWLINE
430−77:1 glyph +$
431−77:4 name tank
432−78:3 INDENT
433−78:3 name cord
434−79:3 NEWLINE
435−79:3 glyph [
436−79:4 tight lit %leaf
437−79:10 name p
438−79:11 tight glyph =
439−79:12 tight name tape
440−79:16 tight glyph ]
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
44144180:3 NEWLINE
44244280:3 glyph [
443−80:4 tight lit %palm
443+80:4 tight lit %leaf
44444480:10 name p
44544580:11 tight glyph =
446−80:12 tight glyph (
447−80:13 tight name qual
448−80:18 name tape
449−80:23 name tape
450−80:28 name tape
451−80:33 name tape
452−80:37 tight glyph )
453−80:39 name q
454−80:40 tight glyph =
455−80:41 tight glyph (
456−80:42 tight name list
457−80:47 name tank
458−80:51 tight glyph )
459−80:52 tight glyph ]
446+80:12 tight name tape
447+80:16 tight glyph ]
46044881:3 NEWLINE
46144981:3 glyph [
462−81:4 tight lit %rose
450+81:4 tight lit %palm
46345181:10 name p
46445281:11 tight glyph =
46545381:12 tight glyph (
466−81:13 tight name trel
454+81:13 tight name qual
46745581:18 name tape
46845681:23 name tape
46945781:28 name tape
470−81:32 tight glyph )
471−81:34 name q
472−81:35 tight glyph =
473−81:36 tight glyph (
474−81:37 tight name list
475−81:42 name tank
476−81:46 tight glyph )
477−81:47 tight glyph ]
478−83:1 DEDENT
479−83:1 NEWLINE
480−83:1 glyph +$
481−83:4 name nail
482−83:9 glyph [
483−83:10 tight name p
484−83:11 tight glyph =
485−83:12 tight name hair
486−83:17 name q
487−83:18 tight glyph =
488−83:19 tight name tape
489−83:23 tight glyph ]
490−85:1 NEWLINE
491−85:1 glyph +$
492−85:4 name edge
493−85:9 glyph [
494−85:10 tight name p
495−85:11 tight glyph =
496−85:12 tight name hair
497−85:17 name q
498−85:18 tight glyph =
499−85:19 tight glyph (
500−85:20 tight name unit
501−85:25 glyph [
502−85:26 tight name p
503−85:27 tight glyph =
504−85:28 tight glyph *
505−85:30 name q
506−85:31 tight glyph =
507−85:32 tight name nail
508−85:36 tight glyph ]
509−85:37 tight glyph )
510−85:38 tight glyph ]
511−87:1 NEWLINE
512−87:1 glyph +$
513−87:4 name rule
514−87:9 glyph $-(
515−87:12 tight name nail
516−87:17 name edge
517−87:21 tight glyph )
518−89:1 NEWLINE
519−89:1 glyph +$
520−89:4 name spot
521−89:9 glyph [
522−89:10 tight name p
523−89:11 tight glyph =
524−89:12 tight name path
525−89:17 name q
526−89:18 tight glyph =
527−89:19 tight name pint
528−89:23 tight glyph ]
529−91:1 NEWLINE
530−91:1 glyph +$
531−91:4 name toon
532−92:3 INDENT
533−92:3 glyph [
534−92:4 tight lit %0
535−92:7 name p
536−92:8 tight glyph =
537−92:9 tight glyph *
538−92:10 tight glyph ]
539−93:3 NEWLINE
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
54054093:3 glyph [
541−93:4 tight lit %1
541+93:4 tight lit %0
54254293:7 name p
54354393:8 tight glyph =
54454493:9 tight glyph *
54554593:10 tight glyph ]
54654694:3 NEWLINE
54754794:3 glyph [
548−94:4 tight lit %2
548+94:4 tight lit %1
54954994:7 name p
55055094:8 tight glyph =
551−94:9 tight glyph (
552−94:10 tight name list
553−94:15 name tank
554−94:19 tight glyph )
555−94:20 tight glyph ]
556−96:1 DEDENT
557−96:1 NEWLINE
558−96:1 glyph +$
559−96:4 name like
560−96:9 glyph |$
561−96:12 glyph [
562−96:13 tight tvar A
563−96:14 tight glyph ]
564−96:16 glyph [
565−96:17 tight name p
566−96:18 tight glyph =
567−96:19 tight name hair
568−96:24 name q
569−96:25 tight glyph =
570−96:26 tight glyph (
571−96:27 tight name unit
572−96:32 glyph [
573−96:33 tight name p
574−96:34 tight glyph =
575−96:35 tight tvar A
576−96:37 name q
577−96:38 tight glyph =
578−96:39 tight name nail
579−96:43 tight glyph ]
580−96:44 tight glyph )
581−96:45 tight glyph ]
582−98:1 NEWLINE
583−98:1 glyph ++
584−98:4 name wonk
585−98:9 glyph |=
586−98:12 name veq
587−98:15 tight glyph =
588−98:16 tight glyph (
589−98:17 tight name like
590−98:22 tvar A
591−98:23 tight glyph )
592−99:3 INDENT
593−99:3 glyph ?-
594−99:6 wing q.veq
595−100:5 INDENT
596−100:5 lit ~
597−100:7 glyph !!
598−101:5 NEWLINE
599−101:5 glyph [
600−101:6 tight lit ~
601−101:8 name product
602−101:15 tight glyph ]
603−101:17 wing p.product
604−103:1 DEDENT
605−103:1 DEDENT
606−103:1 NEWLINE
607−103:1 glyph +$
608−103:4 name lone
609−103:9 glyph |$
610−103:12 glyph [
611−103:13 tight tvar A
612−103:14 tight glyph ]
613−103:16 glyph [
614−103:17 tight name p
615−103:18 tight glyph =
616−103:19 tight tvar A
617−103:20 tight glyph ]
618−105:1 NEWLINE
619−105:1 glyph +$
620−105:4 name lest
621−105:9 glyph |$
622−105:12 glyph [
623−105:13 tight tvar A
624−105:14 tight glyph ]
625−105:16 glyph [
626−105:17 tight name i
627−105:18 tight glyph =
628−105:19 tight tvar A
629−105:21 name t
630−105:22 tight glyph =
631−105:23 tight glyph (
632−105:24 tight name list
633−105:29 tvar A
634−105:30 tight glyph )
635−105:31 tight glyph ]
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name like
592+99:9 glyph |=
593+99:12 glyph [
594+99:13 tight name f
595+99:14 tight glyph =
596+99:15 tight glyph $-(
597+99:18 tight tvar A
598+99:20 tvar B
599+99:21 tight glyph )
600+99:23 name result
601+99:29 tight glyph =
602+99:30 tight glyph (
603+99:31 tight name like
604+99:36 tvar A
605+99:37 tight glyph )
606+99:38 tight glyph ]
607+100:3 INDENT
608+100:3 glyph ++
609+100:6 name mapped
610+101:5 INDENT
611+101:5 glyph ^-
612+101:8 glyph (
613+101:9 tight name unit
614+101:14 glyph [
615+101:15 tight name p
616+101:16 tight glyph =
617+101:17 tight tvar B
618+101:19 name q
619+101:20 tight glyph =
620+101:21 tight name nail
621+101:25 tight glyph ]
622+101:26 tight glyph )
623+102:7 INDENT
624+102:7 glyph ?-
625+102:10 wing q.result
626+103:9 INDENT
627+103:9 lit ~
628+103:11 lit ~
629+104:9 NEWLINE
630+104:9 glyph [
631+104:10 tight lit ~
632+104:12 name value
633+104:17 tight glyph ]
634+104:19 glyph `
635+104:20 tight glyph [
636+104:21 tight name p
637+104:22 tight glyph =
638+104:23 tight glyph (
639+104:24 tight name f
640+104:26 wing p.value
641+104:33 tight glyph )
642+104:35 name q
643+104:36 tight glyph =
644+104:37 tight wing q.value
645+104:44 tight glyph ]
646+105:3 DEDENT
647+105:3 DEDENT
648+105:3 DEDENT
649+105:3 NEWLINE
650+105:3 glyph ^-
651+105:6 glyph (
652+105:7 tight name like
653+105:12 tvar B
654+105:13 tight glyph )
655+105:15 glyph [
656+105:16 tight name p
657+105:17 tight glyph =
658+105:18 tight wing p.result
659+105:27 name q
660+105:28 tight glyph =
661+105:29 tight name mapped
662+105:35 tight glyph ]
663+107:1 DEDENT
636664107:1 NEWLINE
637−107:1 glyph +$
638−107:4 name pole
639−107:9 glyph |$
640−107:12 glyph [
641−107:13 tight tvar A
642−107:14 tight glyph ]
665+107:1 glyph ++
666+107:4 name wonk
667+107:9 glyph |=
668+107:12 name veq
669+107:15 tight glyph =
670+107:16 tight glyph (
671+107:17 tight name like
672+107:22 tvar A
673+107:23 tight glyph )
643674108:3 INDENT
644−108:3 lit ~
645−109:3 NEWLINE
646−109:3 glyph [
647−109:4 tight tvar A
648−109:6 glyph (
649−109:7 tight name pole
650−109:12 tvar A
651−109:13 tight glyph )
652−109:14 tight glyph ]
653−111:1 DEDENT
654−111:1 NEWLINE
655−111:1 glyph +$
656−111:4 name quip
657−111:9 glyph |$
658−111:12 glyph [
659−111:13 tight tvar A
660−111:15 tvar B
661−111:16 tight glyph ]
662−111:18 glyph [
663−111:19 tight glyph (
664−111:20 tight name list
665−111:25 tvar A
666−111:26 tight glyph )
667−111:28 tvar B
668−111:29 tight glyph ]
669−113:1 NEWLINE
670−113:1 glyph +$
671−113:4 name tree
672−113:9 glyph |$
673−113:12 glyph [
674−113:13 tight tvar A
675−113:14 tight glyph ]
676−114:3 INDENT
677−114:3 lit ~
678−115:3 NEWLINE
679−115:3 glyph [
680−115:4 tight name n
681−115:5 tight glyph =
682−115:6 tight tvar A
683−115:8 name l
684−115:9 tight glyph =
685−115:10 tight glyph (
686−115:11 tight name tree
687−115:16 tvar A
688−115:17 tight glyph )
689−115:19 name r
690−115:20 tight glyph =
691−115:21 tight glyph (
692−115:22 tight name tree
693−115:27 tvar A
694−115:28 tight glyph )
695−115:29 tight glyph ]
696−117:1 DEDENT
697−117:1 NEWLINE
698−117:1 glyph +$
699−117:4 name each
700−117:9 glyph |$
701−117:12 glyph [
702−117:13 tight tvar A
703−117:15 tvar B
704−117:16 tight glyph ]
705−118:3 INDENT
675+108:3 glyph ?-
676+108:6 wing q.veq
677+109:5 INDENT
678+109:5 lit ~
679+109:7 glyph !!
680+110:5 NEWLINE
681+110:5 glyph [
682+110:6 tight lit ~
683+110:8 name product
684+110:15 tight glyph ]
685+110:17 wing p.product
686+112:1 DEDENT
687+112:1 DEDENT
688+112:1 NEWLINE
689+112:1 glyph +$
690+112:4 name lone
691+112:9 glyph |$
692+112:12 glyph [
693+112:13 tight tvar A
694+112:14 tight glyph ]
695+112:16 glyph [
696+112:17 tight name p
697+112:18 tight glyph =
698+112:19 tight tvar A
699+112:20 tight glyph ]
700+114:1 NEWLINE
701+114:1 glyph +$
702+114:4 name lest
703+114:9 glyph |$
704+114:12 glyph [
705+114:13 tight tvar A
706+114:14 tight glyph ]
707+114:16 glyph [
708+114:17 tight name i
709+114:18 tight glyph =
710+114:19 tight tvar A
711+114:21 name t
712+114:22 tight glyph =
713+114:23 tight glyph (
714+114:24 tight name list
715+114:29 tvar A
716+114:30 tight glyph )
717+114:31 tight glyph ]
718+116:1 NEWLINE
719+116:1 glyph +$
720+116:4 name pole
721+116:9 glyph |$
722+116:12 glyph [
723+116:13 tight tvar A
724+116:14 tight glyph ]
725+117:3 INDENT
726+117:3 lit ~
727+118:3 NEWLINE
706728118:3 glyph [
707−118:4 tight lit %|
708−118:7 name p
709−118:8 tight glyph =
710−118:9 tight tvar B
711−118:10 tight glyph ]
712−119:3 NEWLINE
713−119:3 glyph [
714−119:4 tight lit %&
715−119:7 name p
716−119:8 tight glyph =
717−119:9 tight tvar A
718−119:10 tight glyph ]
719−121:1 DEDENT
720−121:1 NEWLINE
721−121:1 glyph +$
722−121:4 name bloq
723−121:9 aura @
724−121:10 NEWLINE
729+118:4 tight tvar A
730+118:6 glyph (
731+118:7 tight name pole
732+118:12 tvar A
733+118:13 tight glyph )
734+118:14 tight glyph ]
735+120:1 DEDENT
736+120:1 NEWLINE
737+120:1 glyph +$
738+120:4 name quip
739+120:9 glyph |$
740+120:12 glyph [
741+120:13 tight tvar A
742+120:15 tvar B
743+120:16 tight glyph ]
744+120:18 glyph [
745+120:19 tight glyph (
746+120:20 tight name list
747+120:25 tvar A
748+120:26 tight glyph )
749+120:28 tvar B
750+120:29 tight glyph ]
751+122:1 NEWLINE
752+122:1 glyph +$
753+122:4 name tree
754+122:9 glyph |$
755+122:12 glyph [
756+122:13 tight tvar A
757+122:14 tight glyph ]
758+123:3 INDENT
759+123:3 lit ~
760+124:3 NEWLINE
761+124:3 glyph [
762+124:4 tight name n
763+124:5 tight glyph =
764+124:6 tight tvar A
765+124:8 name l
766+124:9 tight glyph =
767+124:10 tight glyph (
768+124:11 tight name tree
769+124:16 tvar A
770+124:17 tight glyph )
771+124:19 name r
772+124:20 tight glyph =
773+124:21 tight glyph (
774+124:22 tight name tree
775+124:27 tvar A
776+124:28 tight glyph )
777+124:29 tight glyph ]
778+126:1 DEDENT
779+126:1 NEWLINE
780+126:1 glyph +$
781+126:4 name each
782+126:9 glyph |$
783+126:12 glyph [
784+126:13 tight tvar A
785+126:15 tvar B
786+126:16 tight glyph ]
787+127:3 INDENT
788+127:3 glyph [
789+127:4 tight lit %|
790+127:7 name p
791+127:8 tight glyph =
792+127:9 tight tvar B
793+127:10 tight glyph ]
794+128:3 NEWLINE
795+128:3 glyph [
796+128:4 tight lit %&
797+128:7 name p
798+128:8 tight glyph =
799+128:9 tight tvar A
800+128:10 tight glyph ]
801+130:1 DEDENT
802+130:1 NEWLINE
803+130:1 glyph +$
804+130:4 name bloq
805+130:9 aura @
806+130:10 NEWLINE
tests/golden/prelude-1c-structural/tree.txt+200−165
@@ -111,177 +111,212 @@
111111 (arm 47:5
112112 (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113113 (body 48:7
114− (branch 48:7
115− (wing 48:10 xs)
116− (arm 49:9 (lit 49:9 ~) (lit 49:11 ~))
117− (arm 50:9
118− (cell 50:9 (bind 50:10 item) (bind 50:15 rest))
119− (tuple 50:21
120− (group 50:22
121− (call 50:23 (wing 50:23 f) (wing 50:25 item)))
122− (group 50:31
123− (call 50:32 (wing 50:32 turn) (wing 50:37 rest) (wing 50:42 f))))))))))))
124− (mold 52:1 dime
125− (cell 52:9
126− (face 52:10 p (aura 52:12 @ta))
127− (face 52:16 q (aura 52:18 @))))
128− (mold 54:1 hair
129− (cell 54:9
130− (face 54:10 p (aura 54:12 @ud))
131− (face 54:16 q (aura 54:18 @ud))))
132− (mold 56:1 pint
133− (cell 56:9
134− (face 56:10 p
135− (cell 56:12
136− (face 56:13 p (aura 56:15 @))
137− (face 56:17 q (aura 56:19 @))))
138− (face 56:22 q
139− (cell 56:24
140− (face 56:25 p (aura 56:27 @))
141− (face 56:29 q (aura 56:31 @))))))
142− (mold 58:1 coin
143− (union 59:3
144− (cell 59:3
145− (const 59:4 %$)
146− (face 59:7 p (ref 59:9 dime)))
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147147 (cell 60:3
148− (const 60:4 %blob)
149− (face 60:10 p (noun 60:12)))
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150150 (cell 61:3
151− (const 61:4 %many)
152− (face 61:10 p
153− (apply 61:12 list (ref 61:18 coin))))))
154− (mold 63:1 pair
155− (generic 63:9 A B
156− (cell 63:18
157− (face 63:19 p (tvar 63:21 A))
158− (face 63:23 q (tvar 63:25 B)))))
159− (mold 65:1 trel
160− (generic 65:9 A B C
161− (cell 65:20
162− (face 65:21 p (tvar 65:23 A))
163− (face 65:25 q (tvar 65:27 B))
164− (face 65:29 r (tvar 65:31 C)))))
165− (mold 67:1 qual
166− (generic 67:9 A B C D
167− (cell 67:22
168− (face 67:23 p (tvar 67:25 A))
169− (face 67:27 q (tvar 67:29 B))
170− (face 67:31 r (tvar 67:33 C))
171− (face 67:35 s (tvar 67:37 D)))))
172− (mold 69:1 cord (aura 69:9 @t))
173− (mold 71:1 knot (aura 71:9 @ta))
174− (mold 73:1 tape
175− (apply 73:9 list (aura 73:15 @tD)))
176− (mold 75:1 path
177− (apply 75:9 list (ref 75:15 knot)))
178− (mold 77:1 tank
179− (union 78:3
180− (ref 78:3 cord)
181− (cell 79:3
182− (const 79:4 %leaf)
183− (face 79:10 p (ref 79:12 tape)))
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184184 (cell 80:3
185− (const 80:4 %palm)
186− (face 80:10 p
187− (apply 80:12 qual (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape) (ref 80:33 tape)))
188− (face 80:39 q
189− (apply 80:41 list (ref 80:47 tank))))
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
190187 (cell 81:3
191− (const 81:4 %rose)
188+ (const 81:4 %palm)
192189 (face 81:10 p
193− (apply 81:12 trel (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape)))
194− (face 81:34 q
195− (apply 81:36 list (ref 81:42 tank))))))
196− (mold 83:1 nail
197− (cell 83:9
198− (face 83:10 p (ref 83:12 hair))
199− (face 83:17 q (ref 83:19 tape))))
200− (mold 85:1 edge
201− (cell 85:9
202− (face 85:10 p (ref 85:12 hair))
203− (face 85:17 q
204− (apply 85:19 unit
205− (cell 85:25
206− (face 85:26 p (noun 85:28))
207− (face 85:30 q (ref 85:32 nail)))))))
208− (mold 87:1 rule
209− (fn 87:9 (ref 87:12 nail) (ref 87:17 edge)))
210− (mold 89:1 spot
211− (cell 89:9
212− (face 89:10 p (ref 89:12 path))
213− (face 89:17 q (ref 89:19 pint))))
214− (mold 91:1 toon
215− (union 92:3
216− (cell 92:3
217− (const 92:4 %0)
218− (face 92:7 p (noun 92:9)))
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219219 (cell 93:3
220− (const 93:4 %1)
220+ (const 93:4 %0)
221221 (face 93:7 p (noun 93:9)))
222222 (cell 94:3
223− (const 94:4 %2)
224− (face 94:7 p
225− (apply 94:9 list (ref 94:15 tank))))))
226− (mold 96:1 like
227− (generic 96:9 A
228− (cell 96:16
229− (face 96:17 p (ref 96:19 hair))
230− (face 96:24 q
231− (apply 96:26 unit
232− (cell 96:32
233− (face 96:33 p (tvar 96:35 A))
234− (face 96:37 q (ref 96:39 nail))))))))
235− (value 98:1 wonk
236− (gate 98:9
237− (face 98:12 veq
238− (apply 98:16 like (tvar 98:22 A)))
239− (body 99:3
240− (branch 99:3
241− (wing 99:6 q.veq)
242− (arm 100:5 (lit 100:5 ~) (crash 100:7))
243− (arm 101:5
244− (cell 101:5 (lit 101:6 ~) (bind 101:8 product))
245− (wing 101:17 p.product))))))
246− (mold 103:1 lone
247− (generic 103:9 A
248− (cell 103:16
249− (face 103:17 p (tvar 103:19 A)))))
250− (mold 105:1 lest
251− (generic 105:9 A
252− (cell 105:16
253− (face 105:17 i (tvar 105:19 A))
254− (face 105:21 t
255− (apply 105:23 list (tvar 105:29 A))))))
256− (mold 107:1 pole
257− (generic 107:9 A
258− (union 108:3
259− (const 108:3 ~)
260− (cell 109:3
261− (tvar 109:4 A)
262− (apply 109:6 pole (tvar 109:12 A))))))
263− (mold 111:1 quip
264− (generic 111:9 A B
265− (cell 111:18
266− (apply 111:19 list (tvar 111:25 A))
267− (tvar 111:28 B))))
268− (mold 113:1 tree
269− (generic 113:9 A
270− (union 114:3
271− (const 114:3 ~)
272− (cell 115:3
273− (face 115:4 n (tvar 115:6 A))
274− (face 115:8 l
275− (apply 115:10 tree (tvar 115:16 A)))
276− (face 115:19 r
277− (apply 115:21 tree (tvar 115:27 A)))))))
278− (mold 117:1 each
279− (generic 117:9 A B
280− (union 118:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 like
239+ (gate 99:9
240+ (cell 99:12
241+ (face 99:13 f
242+ (fn 99:15 (tvar 99:18 A) (tvar 99:20 B)))
243+ (face 99:23 result
244+ (apply 99:30 like (tvar 99:36 A))))
245+ (body 100:3
246+ (value 100:3 mapped
247+ (body 101:5
248+ (cast 101:5
249+ (apply 101:8 unit
250+ (cell 101:14
251+ (face 101:15 p (tvar 101:17 B))
252+ (face 101:19 q (ref 101:21 nail))))
253+ (body 102:7
254+ (branch 102:7
255+ (wing 102:10 q.result)
256+ (arm 103:9 (lit 103:9 ~) (lit 103:11 ~))
257+ (arm 104:9
258+ (cell 104:9 (lit 104:10 ~) (bind 104:12 value))
259+ (unit 104:19
260+ (tuple 104:20
261+ (face 104:21 p
262+ (group 104:23
263+ (call 104:24 (wing 104:24 f) (wing 104:26 p.value))))
264+ (face 104:35 q (wing 104:37 q.value))))))))))
265+ (cast 105:3
266+ (apply 105:6 like (tvar 105:12 B))
267+ (tuple 105:15
268+ (face 105:16 p (wing 105:18 p.result))
269+ (face 105:27 q (wing 105:29 mapped)))))))
270+ (value 107:1 wonk
271+ (gate 107:9
272+ (face 107:12 veq
273+ (apply 107:16 like (tvar 107:22 A)))
274+ (body 108:3
275+ (branch 108:3
276+ (wing 108:6 q.veq)
277+ (arm 109:5 (lit 109:5 ~) (crash 109:7))
278+ (arm 110:5
279+ (cell 110:5 (lit 110:6 ~) (bind 110:8 product))
280+ (wing 110:17 p.product))))))
281+ (mold 112:1 lone
282+ (generic 112:9 A
283+ (cell 112:16
284+ (face 112:17 p (tvar 112:19 A)))))
285+ (mold 114:1 lest
286+ (generic 114:9 A
287+ (cell 114:16
288+ (face 114:17 i (tvar 114:19 A))
289+ (face 114:21 t
290+ (apply 114:23 list (tvar 114:29 A))))))
291+ (mold 116:1 pole
292+ (generic 116:9 A
293+ (union 117:3
294+ (const 117:3 ~)
281295 (cell 118:3
282− (const 118:4 %|)
283− (face 118:7 p (tvar 118:9 B)))
284− (cell 119:3
285− (const 119:4 %&)
286− (face 119:7 p (tvar 119:9 A))))))
287− (mold 121:1 bloq (aura 121:9 @)))
296+ (tvar 118:4 A)
297+ (apply 118:6 pole (tvar 118:12 A))))))
298+ (mold 120:1 quip
299+ (generic 120:9 A B
300+ (cell 120:18
301+ (apply 120:19 list (tvar 120:25 A))
302+ (tvar 120:28 B))))
303+ (mold 122:1 tree
304+ (generic 122:9 A
305+ (union 123:3
306+ (const 123:3 ~)
307+ (cell 124:3
308+ (face 124:4 n (tvar 124:6 A))
309+ (face 124:8 l
310+ (apply 124:10 tree (tvar 124:16 A)))
311+ (face 124:19 r
312+ (apply 124:21 tree (tvar 124:27 A)))))))
313+ (mold 126:1 each
314+ (generic 126:9 A B
315+ (union 127:3
316+ (cell 127:3
317+ (const 127:4 %|)
318+ (face 127:7 p (tvar 127:9 B)))
319+ (cell 128:3
320+ (const 128:4 %&)
321+ (face 128:7 p (tvar 128:9 A))))))
322+ (mold 130:1 bloq (aura 130:9 @)))
tests/golden/prelude-1c-structural/types.txt+1
@@ -27,6 +27,7 @@ partial inference; module not checked
2727+$ spot: not checked
2828+$ toon: cases proven disjoint; mold not checked
2929+$ like: not checked
30+++ like: sample mold is not supported by partial inference
3031++ wonk: sample mold is not supported by partial inference
3132+$ lone: not checked
3233+$ lest: not checked
tests/golden/prelude-3g-basic/source.jibb+4−3
@@ -45,9 +45,10 @@
4545++ turn |= args=[(list A) $-(A B)]
4646 ?- args
4747 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
5152
5253+$ dime [p=@ta q=@]
5354
tests/golden/prelude-3g-basic/tokens.txt+101−94
@@ -244,104 +244,111 @@
24424447:9 name f
24524547:10 tight glyph ]
24624648:7 INDENT
247−48:7 glyph ?-
248−48:10 name xs
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
24925249:9 INDENT
250−49:9 lit ~
251−49:11 lit ~
252−50:9 NEWLINE
253−50:9 glyph [
254−50:10 tight name item
255−50:15 name rest
256−50:19 tight glyph ]
257−50:21 glyph [
258−50:22 tight glyph (
259−50:23 tight name f
260−50:25 name item
261−50:29 tight glyph )
262−50:31 glyph (
263−50:32 tight name turn
264−50:37 name rest
265−50:42 name f
266−50:43 tight glyph )
267−50:44 tight glyph ]
268−52:1 DEDENT
269−52:1 DEDENT
270−52:1 DEDENT
271−52:1 DEDENT
272−52:1 NEWLINE
273−52:1 glyph +$
274−52:4 name dime
275−52:9 glyph [
276−52:10 tight name p
277−52:11 tight glyph =
278−52:12 tight aura @ta
279−52:16 name q
280−52:17 tight glyph =
281−52:18 tight aura @
282−52:19 tight glyph ]
283−54:1 NEWLINE
284−54:1 glyph +$
285−54:4 name hair
286−54:9 glyph [
287−54:10 tight name p
288−54:11 tight glyph =
289−54:12 tight aura @ud
290−54:16 name q
291−54:17 tight glyph =
292−54:18 tight aura @ud
293−54:21 tight glyph ]
294−56:1 NEWLINE
295−56:1 glyph +$
296−56:4 name pint
297−56:9 glyph [
298−56:10 tight name p
299−56:11 tight glyph =
300−56:12 tight glyph [
301−56:13 tight name p
302−56:14 tight glyph =
303−56:15 tight aura @
304−56:17 name q
305−56:18 tight glyph =
306−56:19 tight aura @
307−56:20 tight glyph ]
308−56:22 name q
309−56:23 tight glyph =
310−56:24 tight glyph [
311−56:25 tight name p
312−56:26 tight glyph =
313−56:27 tight aura @
314−56:29 name q
315−56:30 tight glyph =
316−56:31 tight aura @
317−56:32 tight glyph ]
318−56:33 tight glyph ]
319−58:1 NEWLINE
320−58:1 glyph +$
321−58:4 name coin
322−59:3 INDENT
323−59:3 glyph [
324−59:4 tight lit %$
325−59:7 name p
326−59:8 tight glyph =
327−59:9 tight name dime
328−59:13 tight glyph ]
329−60:3 NEWLINE
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
33033060:3 glyph [
331−60:4 tight lit %blob
332−60:10 name p
333−60:11 tight glyph =
334−60:12 tight glyph *
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
33533560:13 tight glyph ]
33633661:3 NEWLINE
33733761:3 glyph [
338−61:4 tight lit %many
338+61:4 tight lit %blob
33933961:10 name p
34034061:11 tight glyph =
341−61:12 tight glyph (
342−61:13 tight name list
343−61:18 name coin
344−61:22 tight glyph )
345−61:23 tight glyph ]
346−61:24 DEDENT
347−61:24 NEWLINE
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+62:24 DEDENT
354+62:24 NEWLINE
tests/golden/prelude-3g-basic/tree.txt+41−38
@@ -111,43 +111,46 @@
111111 (arm 47:5
112112 (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113113 (body 48:7
114− (branch 48:7
115− (wing 48:10 xs)
116− (arm 49:9 (lit 49:9 ~) (lit 49:11 ~))
117− (arm 50:9
118− (cell 50:9 (bind 50:10 item) (bind 50:15 rest))
119− (tuple 50:21
120− (group 50:22
121− (call 50:23 (wing 50:23 f) (wing 50:25 item)))
122− (group 50:31
123− (call 50:32 (wing 50:32 turn) (wing 50:37 rest) (wing 50:42 f))))))))))))
124− (mold 52:1 dime
125− (cell 52:9
126− (face 52:10 p (aura 52:12 @ta))
127− (face 52:16 q (aura 52:18 @))))
128− (mold 54:1 hair
129− (cell 54:9
130− (face 54:10 p (aura 54:12 @ud))
131− (face 54:16 q (aura 54:18 @ud))))
132− (mold 56:1 pint
133− (cell 56:9
134− (face 56:10 p
135− (cell 56:12
136− (face 56:13 p (aura 56:15 @))
137− (face 56:17 q (aura 56:19 @))))
138− (face 56:22 q
139− (cell 56:24
140− (face 56:25 p (aura 56:27 @))
141− (face 56:29 q (aura 56:31 @))))))
142− (mold 58:1 coin
143− (union 59:3
144− (cell 59:3
145− (const 59:4 %$)
146− (face 59:7 p (ref 59:9 dime)))
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147147 (cell 60:3
148− (const 60:4 %blob)
149− (face 60:10 p (noun 60:12)))
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150150 (cell 61:3
151− (const 61:4 %many)
152− (face 61:10 p
153− (apply 61:12 list (ref 61:18 coin)))))))
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin)))))))
tests/golden/prelude-3g-like/about.txt+3−3
@@ -1,4 +1,4 @@
1−source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; Hoon 3g includes `like` and `wonk`.
2−tests: The prelude's `like` generic edge mold and `wonk` extractor; the callable value form of `like` is a separate, unresolved question. The source contains the prelude definitions through `like` and `wonk`.
1+source: Overview, Prelude: Hoon 3g includes `like` and `wonk`; the value `like` maps an existing result.
2+tests: The source includes the generic `like` mold, its mapping gate and `wonk`.
33expect: parses
4−expect-types: a partial inference report, not a checked module; generic molds and the `wonk` body are not fully checked yet
4+expect-types: a partial inference report, not a checked module
tests/golden/prelude-3g-like/source.jibb+12−3
@@ -45,9 +45,10 @@
4545++ turn |= args=[(list A) $-(A B)]
4646 ?- args
4747 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
5152
5253+$ dime [p=@ta q=@]
5354
@@ -95,6 +96,14 @@
9596
9697+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
9798
99+++ like |= [f=$-(A B) result=(like A)]
100+ ++ mapped
101+ ^- (unit [p=B q=nail])
102+ ?- q.result
103+ ~ ~
104+ [~ value] `[p=(f p.value) q=q.value]
105+ ^- (like B) [p=p.result q=mapped]
106+
98107++ wonk |= veq=(like A)
99108 ?- q.veq
100109 ~ !!
tests/golden/prelude-3g-like/tokens.txt+414−332
@@ -244,363 +244,445 @@
24424447:9 name f
24524547:10 tight glyph ]
24624648:7 INDENT
247−48:7 glyph ?-
248−48:10 name xs
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
24925249:9 INDENT
250−49:9 lit ~
251−49:11 lit ~
252−50:9 NEWLINE
253−50:9 glyph [
254−50:10 tight name item
255−50:15 name rest
256−50:19 tight glyph ]
257−50:21 glyph [
258−50:22 tight glyph (
259−50:23 tight name f
260−50:25 name item
261−50:29 tight glyph )
262−50:31 glyph (
263−50:32 tight name turn
264−50:37 name rest
265−50:42 name f
266−50:43 tight glyph )
267−50:44 tight glyph ]
268−52:1 DEDENT
269−52:1 DEDENT
270−52:1 DEDENT
271−52:1 DEDENT
272−52:1 NEWLINE
273−52:1 glyph +$
274−52:4 name dime
275−52:9 glyph [
276−52:10 tight name p
277−52:11 tight glyph =
278−52:12 tight aura @ta
279−52:16 name q
280−52:17 tight glyph =
281−52:18 tight aura @
282−52:19 tight glyph ]
283−54:1 NEWLINE
284−54:1 glyph +$
285−54:4 name hair
286−54:9 glyph [
287−54:10 tight name p
288−54:11 tight glyph =
289−54:12 tight aura @ud
290−54:16 name q
291−54:17 tight glyph =
292−54:18 tight aura @ud
293−54:21 tight glyph ]
294−56:1 NEWLINE
295−56:1 glyph +$
296−56:4 name pint
297−56:9 glyph [
298−56:10 tight name p
299−56:11 tight glyph =
300−56:12 tight glyph [
301−56:13 tight name p
302−56:14 tight glyph =
303−56:15 tight aura @
304−56:17 name q
305−56:18 tight glyph =
306−56:19 tight aura @
307−56:20 tight glyph ]
308−56:22 name q
309−56:23 tight glyph =
310−56:24 tight glyph [
311−56:25 tight name p
312−56:26 tight glyph =
313−56:27 tight aura @
314−56:29 name q
315−56:30 tight glyph =
316−56:31 tight aura @
317−56:32 tight glyph ]
318−56:33 tight glyph ]
319−58:1 NEWLINE
320−58:1 glyph +$
321−58:4 name coin
322−59:3 INDENT
323−59:3 glyph [
324−59:4 tight lit %$
325−59:7 name p
326−59:8 tight glyph =
327−59:9 tight name dime
328−59:13 tight glyph ]
329−60:3 NEWLINE
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
33033060:3 glyph [
331−60:4 tight lit %blob
332−60:10 name p
333−60:11 tight glyph =
334−60:12 tight glyph *
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
33533560:13 tight glyph ]
33633661:3 NEWLINE
33733761:3 glyph [
338−61:4 tight lit %many
338+61:4 tight lit %blob
33933961:10 name p
34034061:11 tight glyph =
341−61:12 tight glyph (
342−61:13 tight name list
343−61:18 name coin
344−61:22 tight glyph )
345−61:23 tight glyph ]
346−63:1 DEDENT
347−63:1 NEWLINE
348−63:1 glyph +$
349−63:4 name pair
350−63:9 glyph |$
351−63:12 glyph [
352−63:13 tight tvar A
353−63:15 tvar B
354−63:16 tight glyph ]
355−63:18 glyph [
356−63:19 tight name p
357−63:20 tight glyph =
358−63:21 tight tvar A
359−63:23 name q
360−63:24 tight glyph =
361−63:25 tight tvar B
362−63:26 tight glyph ]
363−65:1 NEWLINE
364−65:1 glyph +$
365−65:4 name trel
366−65:9 glyph |$
367−65:12 glyph [
368−65:13 tight tvar A
369−65:15 tvar B
370−65:17 tvar C
371−65:18 tight glyph ]
372−65:20 glyph [
373−65:21 tight name p
374−65:22 tight glyph =
375−65:23 tight tvar A
376−65:25 name q
377−65:26 tight glyph =
378−65:27 tight tvar B
379−65:29 name r
380−65:30 tight glyph =
381−65:31 tight tvar C
382−65:32 tight glyph ]
383−67:1 NEWLINE
384−67:1 glyph +$
385−67:4 name qual
386−67:9 glyph |$
387−67:12 glyph [
388−67:13 tight tvar A
389−67:15 tvar B
390−67:17 tvar C
391−67:19 tvar D
392−67:20 tight glyph ]
393−67:22 glyph [
394−67:23 tight name p
395−67:24 tight glyph =
396−67:25 tight tvar A
397−67:27 name q
398−67:28 tight glyph =
399−67:29 tight tvar B
400−67:31 name r
401−67:32 tight glyph =
402−67:33 tight tvar C
403−67:35 name s
404−67:36 tight glyph =
405−67:37 tight tvar D
406−67:38 tight glyph ]
407−69:1 NEWLINE
408−69:1 glyph +$
409−69:4 name cord
410−69:9 aura @t
411−71:1 NEWLINE
412−71:1 glyph +$
413−71:4 name knot
414−71:9 aura @ta
415−73:1 NEWLINE
416−73:1 glyph +$
417−73:4 name tape
418−73:9 glyph (
419−73:10 tight name list
420−73:15 aura @tD
421−73:18 tight glyph )
422−75:1 NEWLINE
423−75:1 glyph +$
424−75:4 name path
425−75:9 glyph (
426−75:10 tight name list
427−75:15 name knot
428−75:19 tight glyph )
429−77:1 NEWLINE
430−77:1 glyph +$
431−77:4 name tank
432−78:3 INDENT
433−78:3 name cord
434−79:3 NEWLINE
435−79:3 glyph [
436−79:4 tight lit %leaf
437−79:10 name p
438−79:11 tight glyph =
439−79:12 tight name tape
440−79:16 tight glyph ]
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
44144180:3 NEWLINE
44244280:3 glyph [
443−80:4 tight lit %palm
443+80:4 tight lit %leaf
44444480:10 name p
44544580:11 tight glyph =
446−80:12 tight glyph (
447−80:13 tight name qual
448−80:18 name tape
449−80:23 name tape
450−80:28 name tape
451−80:33 name tape
452−80:37 tight glyph )
453−80:39 name q
454−80:40 tight glyph =
455−80:41 tight glyph (
456−80:42 tight name list
457−80:47 name tank
458−80:51 tight glyph )
459−80:52 tight glyph ]
446+80:12 tight name tape
447+80:16 tight glyph ]
46044881:3 NEWLINE
46144981:3 glyph [
462−81:4 tight lit %rose
450+81:4 tight lit %palm
46345181:10 name p
46445281:11 tight glyph =
46545381:12 tight glyph (
466−81:13 tight name trel
454+81:13 tight name qual
46745581:18 name tape
46845681:23 name tape
46945781:28 name tape
470−81:32 tight glyph )
471−81:34 name q
472−81:35 tight glyph =
473−81:36 tight glyph (
474−81:37 tight name list
475−81:42 name tank
476−81:46 tight glyph )
477−81:47 tight glyph ]
478−83:1 DEDENT
479−83:1 NEWLINE
480−83:1 glyph +$
481−83:4 name nail
482−83:9 glyph [
483−83:10 tight name p
484−83:11 tight glyph =
485−83:12 tight name hair
486−83:17 name q
487−83:18 tight glyph =
488−83:19 tight name tape
489−83:23 tight glyph ]
490−85:1 NEWLINE
491−85:1 glyph +$
492−85:4 name edge
493−85:9 glyph [
494−85:10 tight name p
495−85:11 tight glyph =
496−85:12 tight name hair
497−85:17 name q
498−85:18 tight glyph =
499−85:19 tight glyph (
500−85:20 tight name unit
501−85:25 glyph [
502−85:26 tight name p
503−85:27 tight glyph =
504−85:28 tight glyph *
505−85:30 name q
506−85:31 tight glyph =
507−85:32 tight name nail
508−85:36 tight glyph ]
509−85:37 tight glyph )
510−85:38 tight glyph ]
511−87:1 NEWLINE
512−87:1 glyph +$
513−87:4 name rule
514−87:9 glyph $-(
515−87:12 tight name nail
516−87:17 name edge
517−87:21 tight glyph )
518−89:1 NEWLINE
519−89:1 glyph +$
520−89:4 name spot
521−89:9 glyph [
522−89:10 tight name p
523−89:11 tight glyph =
524−89:12 tight name path
525−89:17 name q
526−89:18 tight glyph =
527−89:19 tight name pint
528−89:23 tight glyph ]
529−91:1 NEWLINE
530−91:1 glyph +$
531−91:4 name toon
532−92:3 INDENT
533−92:3 glyph [
534−92:4 tight lit %0
535−92:7 name p
536−92:8 tight glyph =
537−92:9 tight glyph *
538−92:10 tight glyph ]
539−93:3 NEWLINE
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
54054093:3 glyph [
541−93:4 tight lit %1
541+93:4 tight lit %0
54254293:7 name p
54354393:8 tight glyph =
54454493:9 tight glyph *
54554593:10 tight glyph ]
54654694:3 NEWLINE
54754794:3 glyph [
548−94:4 tight lit %2
548+94:4 tight lit %1
54954994:7 name p
55055094:8 tight glyph =
551−94:9 tight glyph (
552−94:10 tight name list
553−94:15 name tank
554−94:19 tight glyph )
555−94:20 tight glyph ]
556−96:1 DEDENT
557−96:1 NEWLINE
558−96:1 glyph +$
559−96:4 name like
560−96:9 glyph |$
561−96:12 glyph [
562−96:13 tight tvar A
563−96:14 tight glyph ]
564−96:16 glyph [
565−96:17 tight name p
566−96:18 tight glyph =
567−96:19 tight name hair
568−96:24 name q
569−96:25 tight glyph =
570−96:26 tight glyph (
571−96:27 tight name unit
572−96:32 glyph [
573−96:33 tight name p
574−96:34 tight glyph =
575−96:35 tight tvar A
576−96:37 name q
577−96:38 tight glyph =
578−96:39 tight name nail
579−96:43 tight glyph ]
580−96:44 tight glyph )
581−96:45 tight glyph ]
582−98:1 NEWLINE
583−98:1 glyph ++
584−98:4 name wonk
585−98:9 glyph |=
586−98:12 name veq
587−98:15 tight glyph =
588−98:16 tight glyph (
589−98:17 tight name like
590−98:22 tvar A
591−98:23 tight glyph )
592−99:3 INDENT
593−99:3 glyph ?-
594−99:6 wing q.veq
595−100:5 INDENT
596−100:5 lit ~
597−100:7 glyph !!
598−101:5 NEWLINE
599−101:5 glyph [
600−101:6 tight lit ~
601−101:8 name product
602−101:15 tight glyph ]
603−101:17 wing p.product
604−101:26 DEDENT
605−101:26 DEDENT
606−101:26 NEWLINE
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name like
592+99:9 glyph |=
593+99:12 glyph [
594+99:13 tight name f
595+99:14 tight glyph =
596+99:15 tight glyph $-(
597+99:18 tight tvar A
598+99:20 tvar B
599+99:21 tight glyph )
600+99:23 name result
601+99:29 tight glyph =
602+99:30 tight glyph (
603+99:31 tight name like
604+99:36 tvar A
605+99:37 tight glyph )
606+99:38 tight glyph ]
607+100:3 INDENT
608+100:3 glyph ++
609+100:6 name mapped
610+101:5 INDENT
611+101:5 glyph ^-
612+101:8 glyph (
613+101:9 tight name unit
614+101:14 glyph [
615+101:15 tight name p
616+101:16 tight glyph =
617+101:17 tight tvar B
618+101:19 name q
619+101:20 tight glyph =
620+101:21 tight name nail
621+101:25 tight glyph ]
622+101:26 tight glyph )
623+102:7 INDENT
624+102:7 glyph ?-
625+102:10 wing q.result
626+103:9 INDENT
627+103:9 lit ~
628+103:11 lit ~
629+104:9 NEWLINE
630+104:9 glyph [
631+104:10 tight lit ~
632+104:12 name value
633+104:17 tight glyph ]
634+104:19 glyph `
635+104:20 tight glyph [
636+104:21 tight name p
637+104:22 tight glyph =
638+104:23 tight glyph (
639+104:24 tight name f
640+104:26 wing p.value
641+104:33 tight glyph )
642+104:35 name q
643+104:36 tight glyph =
644+104:37 tight wing q.value
645+104:44 tight glyph ]
646+105:3 DEDENT
647+105:3 DEDENT
648+105:3 DEDENT
649+105:3 NEWLINE
650+105:3 glyph ^-
651+105:6 glyph (
652+105:7 tight name like
653+105:12 tvar B
654+105:13 tight glyph )
655+105:15 glyph [
656+105:16 tight name p
657+105:17 tight glyph =
658+105:18 tight wing p.result
659+105:27 name q
660+105:28 tight glyph =
661+105:29 tight name mapped
662+105:35 tight glyph ]
663+107:1 DEDENT
664+107:1 NEWLINE
665+107:1 glyph ++
666+107:4 name wonk
667+107:9 glyph |=
668+107:12 name veq
669+107:15 tight glyph =
670+107:16 tight glyph (
671+107:17 tight name like
672+107:22 tvar A
673+107:23 tight glyph )
674+108:3 INDENT
675+108:3 glyph ?-
676+108:6 wing q.veq
677+109:5 INDENT
678+109:5 lit ~
679+109:7 glyph !!
680+110:5 NEWLINE
681+110:5 glyph [
682+110:6 tight lit ~
683+110:8 name product
684+110:15 tight glyph ]
685+110:17 wing p.product
686+110:26 DEDENT
687+110:26 DEDENT
688+110:26 NEWLINE
tests/golden/prelude-3g-like/tree.txt+159−124
@@ -111,135 +111,170 @@
111111 (arm 47:5
112112 (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113113 (body 48:7
114− (branch 48:7
115− (wing 48:10 xs)
116− (arm 49:9 (lit 49:9 ~) (lit 49:11 ~))
117− (arm 50:9
118− (cell 50:9 (bind 50:10 item) (bind 50:15 rest))
119− (tuple 50:21
120− (group 50:22
121− (call 50:23 (wing 50:23 f) (wing 50:25 item)))
122− (group 50:31
123− (call 50:32 (wing 50:32 turn) (wing 50:37 rest) (wing 50:42 f))))))))))))
124− (mold 52:1 dime
125− (cell 52:9
126− (face 52:10 p (aura 52:12 @ta))
127− (face 52:16 q (aura 52:18 @))))
128− (mold 54:1 hair
129− (cell 54:9
130− (face 54:10 p (aura 54:12 @ud))
131− (face 54:16 q (aura 54:18 @ud))))
132− (mold 56:1 pint
133− (cell 56:9
134− (face 56:10 p
135− (cell 56:12
136− (face 56:13 p (aura 56:15 @))
137− (face 56:17 q (aura 56:19 @))))
138− (face 56:22 q
139− (cell 56:24
140− (face 56:25 p (aura 56:27 @))
141− (face 56:29 q (aura 56:31 @))))))
142− (mold 58:1 coin
143− (union 59:3
144− (cell 59:3
145− (const 59:4 %$)
146− (face 59:7 p (ref 59:9 dime)))
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147147 (cell 60:3
148− (const 60:4 %blob)
149− (face 60:10 p (noun 60:12)))
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150150 (cell 61:3
151− (const 61:4 %many)
152− (face 61:10 p
153− (apply 61:12 list (ref 61:18 coin))))))
154− (mold 63:1 pair
155− (generic 63:9 A B
156− (cell 63:18
157− (face 63:19 p (tvar 63:21 A))
158− (face 63:23 q (tvar 63:25 B)))))
159− (mold 65:1 trel
160− (generic 65:9 A B C
161− (cell 65:20
162− (face 65:21 p (tvar 65:23 A))
163− (face 65:25 q (tvar 65:27 B))
164− (face 65:29 r (tvar 65:31 C)))))
165− (mold 67:1 qual
166− (generic 67:9 A B C D
167− (cell 67:22
168− (face 67:23 p (tvar 67:25 A))
169− (face 67:27 q (tvar 67:29 B))
170− (face 67:31 r (tvar 67:33 C))
171− (face 67:35 s (tvar 67:37 D)))))
172− (mold 69:1 cord (aura 69:9 @t))
173− (mold 71:1 knot (aura 71:9 @ta))
174− (mold 73:1 tape
175− (apply 73:9 list (aura 73:15 @tD)))
176− (mold 75:1 path
177− (apply 75:9 list (ref 75:15 knot)))
178− (mold 77:1 tank
179− (union 78:3
180− (ref 78:3 cord)
181− (cell 79:3
182− (const 79:4 %leaf)
183− (face 79:10 p (ref 79:12 tape)))
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184184 (cell 80:3
185− (const 80:4 %palm)
186− (face 80:10 p
187− (apply 80:12 qual (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape) (ref 80:33 tape)))
188− (face 80:39 q
189− (apply 80:41 list (ref 80:47 tank))))
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
190187 (cell 81:3
191− (const 81:4 %rose)
188+ (const 81:4 %palm)
192189 (face 81:10 p
193− (apply 81:12 trel (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape)))
194− (face 81:34 q
195− (apply 81:36 list (ref 81:42 tank))))))
196− (mold 83:1 nail
197− (cell 83:9
198− (face 83:10 p (ref 83:12 hair))
199− (face 83:17 q (ref 83:19 tape))))
200− (mold 85:1 edge
201− (cell 85:9
202− (face 85:10 p (ref 85:12 hair))
203− (face 85:17 q
204− (apply 85:19 unit
205− (cell 85:25
206− (face 85:26 p (noun 85:28))
207− (face 85:30 q (ref 85:32 nail)))))))
208− (mold 87:1 rule
209− (fn 87:9 (ref 87:12 nail) (ref 87:17 edge)))
210− (mold 89:1 spot
211− (cell 89:9
212− (face 89:10 p (ref 89:12 path))
213− (face 89:17 q (ref 89:19 pint))))
214− (mold 91:1 toon
215− (union 92:3
216− (cell 92:3
217− (const 92:4 %0)
218− (face 92:7 p (noun 92:9)))
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219219 (cell 93:3
220− (const 93:4 %1)
220+ (const 93:4 %0)
221221 (face 93:7 p (noun 93:9)))
222222 (cell 94:3
223− (const 94:4 %2)
224− (face 94:7 p
225− (apply 94:9 list (ref 94:15 tank))))))
226− (mold 96:1 like
227− (generic 96:9 A
228− (cell 96:16
229− (face 96:17 p (ref 96:19 hair))
230− (face 96:24 q
231− (apply 96:26 unit
232− (cell 96:32
233− (face 96:33 p (tvar 96:35 A))
234− (face 96:37 q (ref 96:39 nail))))))))
235− (value 98:1 wonk
236− (gate 98:9
237− (face 98:12 veq
238− (apply 98:16 like (tvar 98:22 A)))
239− (body 99:3
240− (branch 99:3
241− (wing 99:6 q.veq)
242− (arm 100:5 (lit 100:5 ~) (crash 100:7))
243− (arm 101:5
244− (cell 101:5 (lit 101:6 ~) (bind 101:8 product))
245− (wing 101:17 p.product)))))))
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 like
239+ (gate 99:9
240+ (cell 99:12
241+ (face 99:13 f
242+ (fn 99:15 (tvar 99:18 A) (tvar 99:20 B)))
243+ (face 99:23 result
244+ (apply 99:30 like (tvar 99:36 A))))
245+ (body 100:3
246+ (value 100:3 mapped
247+ (body 101:5
248+ (cast 101:5
249+ (apply 101:8 unit
250+ (cell 101:14
251+ (face 101:15 p (tvar 101:17 B))
252+ (face 101:19 q (ref 101:21 nail))))
253+ (body 102:7
254+ (branch 102:7
255+ (wing 102:10 q.result)
256+ (arm 103:9 (lit 103:9 ~) (lit 103:11 ~))
257+ (arm 104:9
258+ (cell 104:9 (lit 104:10 ~) (bind 104:12 value))
259+ (unit 104:19
260+ (tuple 104:20
261+ (face 104:21 p
262+ (group 104:23
263+ (call 104:24 (wing 104:24 f) (wing 104:26 p.value))))
264+ (face 104:35 q (wing 104:37 q.value))))))))))
265+ (cast 105:3
266+ (apply 105:6 like (tvar 105:12 B))
267+ (tuple 105:15
268+ (face 105:16 p (wing 105:18 p.result))
269+ (face 105:27 q (wing 105:29 mapped)))))))
270+ (value 107:1 wonk
271+ (gate 107:9
272+ (face 107:12 veq
273+ (apply 107:16 like (tvar 107:22 A)))
274+ (body 108:3
275+ (branch 108:3
276+ (wing 108:6 q.veq)
277+ (arm 109:5 (lit 109:5 ~) (crash 109:7))
278+ (arm 110:5
279+ (cell 110:5 (lit 110:6 ~) (bind 110:8 product))
280+ (wing 110:17 p.product)))))))
tests/golden/prelude-3g-like/types.txt+1
@@ -27,4 +27,5 @@ partial inference; module not checked
2727+$ spot: not checked
2828+$ toon: cases proven disjoint; mold not checked
2929+$ like: not checked
30+++ like: sample mold is not supported by partial inference
3031++ wonk: sample mold is not supported by partial inference
tests/golden/prelude-3g-structural/source.jibb+4−3
@@ -45,9 +45,10 @@
4545++ turn |= args=[(list A) $-(A B)]
4646 ?- args
4747 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
5152
5253+$ dime [p=@ta q=@]
5354
tests/golden/prelude-3g-structural/tokens.txt+290−283
@@ -244,314 +244,321 @@
24424447:9 name f
24524547:10 tight glyph ]
24624648:7 INDENT
247−48:7 glyph ?-
248−48:10 name xs
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
24925249:9 INDENT
250−49:9 lit ~
251−49:11 lit ~
252−50:9 NEWLINE
253−50:9 glyph [
254−50:10 tight name item
255−50:15 name rest
256−50:19 tight glyph ]
257−50:21 glyph [
258−50:22 tight glyph (
259−50:23 tight name f
260−50:25 name item
261−50:29 tight glyph )
262−50:31 glyph (
263−50:32 tight name turn
264−50:37 name rest
265−50:42 name f
266−50:43 tight glyph )
267−50:44 tight glyph ]
268−52:1 DEDENT
269−52:1 DEDENT
270−52:1 DEDENT
271−52:1 DEDENT
272−52:1 NEWLINE
273−52:1 glyph +$
274−52:4 name dime
275−52:9 glyph [
276−52:10 tight name p
277−52:11 tight glyph =
278−52:12 tight aura @ta
279−52:16 name q
280−52:17 tight glyph =
281−52:18 tight aura @
282−52:19 tight glyph ]
283−54:1 NEWLINE
284−54:1 glyph +$
285−54:4 name hair
286−54:9 glyph [
287−54:10 tight name p
288−54:11 tight glyph =
289−54:12 tight aura @ud
290−54:16 name q
291−54:17 tight glyph =
292−54:18 tight aura @ud
293−54:21 tight glyph ]
294−56:1 NEWLINE
295−56:1 glyph +$
296−56:4 name pint
297−56:9 glyph [
298−56:10 tight name p
299−56:11 tight glyph =
300−56:12 tight glyph [
301−56:13 tight name p
302−56:14 tight glyph =
303−56:15 tight aura @
304−56:17 name q
305−56:18 tight glyph =
306−56:19 tight aura @
307−56:20 tight glyph ]
308−56:22 name q
309−56:23 tight glyph =
310−56:24 tight glyph [
311−56:25 tight name p
312−56:26 tight glyph =
313−56:27 tight aura @
314−56:29 name q
315−56:30 tight glyph =
316−56:31 tight aura @
317−56:32 tight glyph ]
318−56:33 tight glyph ]
319−58:1 NEWLINE
320−58:1 glyph +$
321−58:4 name coin
322−59:3 INDENT
323−59:3 glyph [
324−59:4 tight lit %$
325−59:7 name p
326−59:8 tight glyph =
327−59:9 tight name dime
328−59:13 tight glyph ]
329−60:3 NEWLINE
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
33033060:3 glyph [
331−60:4 tight lit %blob
332−60:10 name p
333−60:11 tight glyph =
334−60:12 tight glyph *
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
33533560:13 tight glyph ]
33633661:3 NEWLINE
33733761:3 glyph [
338−61:4 tight lit %many
338+61:4 tight lit %blob
33933961:10 name p
34034061:11 tight glyph =
341−61:12 tight glyph (
342−61:13 tight name list
343−61:18 name coin
344−61:22 tight glyph )
345−61:23 tight glyph ]
346−63:1 DEDENT
347−63:1 NEWLINE
348−63:1 glyph +$
349−63:4 name pair
350−63:9 glyph |$
351−63:12 glyph [
352−63:13 tight tvar A
353−63:15 tvar B
354−63:16 tight glyph ]
355−63:18 glyph [
356−63:19 tight name p
357−63:20 tight glyph =
358−63:21 tight tvar A
359−63:23 name q
360−63:24 tight glyph =
361−63:25 tight tvar B
362−63:26 tight glyph ]
363−65:1 NEWLINE
364−65:1 glyph +$
365−65:4 name trel
366−65:9 glyph |$
367−65:12 glyph [
368−65:13 tight tvar A
369−65:15 tvar B
370−65:17 tvar C
371−65:18 tight glyph ]
372−65:20 glyph [
373−65:21 tight name p
374−65:22 tight glyph =
375−65:23 tight tvar A
376−65:25 name q
377−65:26 tight glyph =
378−65:27 tight tvar B
379−65:29 name r
380−65:30 tight glyph =
381−65:31 tight tvar C
382−65:32 tight glyph ]
383−67:1 NEWLINE
384−67:1 glyph +$
385−67:4 name qual
386−67:9 glyph |$
387−67:12 glyph [
388−67:13 tight tvar A
389−67:15 tvar B
390−67:17 tvar C
391−67:19 tvar D
392−67:20 tight glyph ]
393−67:22 glyph [
394−67:23 tight name p
395−67:24 tight glyph =
396−67:25 tight tvar A
397−67:27 name q
398−67:28 tight glyph =
399−67:29 tight tvar B
400−67:31 name r
401−67:32 tight glyph =
402−67:33 tight tvar C
403−67:35 name s
404−67:36 tight glyph =
405−67:37 tight tvar D
406−67:38 tight glyph ]
407−69:1 NEWLINE
408−69:1 glyph +$
409−69:4 name cord
410−69:9 aura @t
411−71:1 NEWLINE
412−71:1 glyph +$
413−71:4 name knot
414−71:9 aura @ta
415−73:1 NEWLINE
416−73:1 glyph +$
417−73:4 name tape
418−73:9 glyph (
419−73:10 tight name list
420−73:15 aura @tD
421−73:18 tight glyph )
422−75:1 NEWLINE
423−75:1 glyph +$
424−75:4 name path
425−75:9 glyph (
426−75:10 tight name list
427−75:15 name knot
428−75:19 tight glyph )
429−77:1 NEWLINE
430−77:1 glyph +$
431−77:4 name tank
432−78:3 INDENT
433−78:3 name cord
434−79:3 NEWLINE
435−79:3 glyph [
436−79:4 tight lit %leaf
437−79:10 name p
438−79:11 tight glyph =
439−79:12 tight name tape
440−79:16 tight glyph ]
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
44144180:3 NEWLINE
44244280:3 glyph [
443−80:4 tight lit %palm
443+80:4 tight lit %leaf
44444480:10 name p
44544580:11 tight glyph =
446−80:12 tight glyph (
447−80:13 tight name qual
448−80:18 name tape
449−80:23 name tape
450−80:28 name tape
451−80:33 name tape
452−80:37 tight glyph )
453−80:39 name q
454−80:40 tight glyph =
455−80:41 tight glyph (
456−80:42 tight name list
457−80:47 name tank
458−80:51 tight glyph )
459−80:52 tight glyph ]
446+80:12 tight name tape
447+80:16 tight glyph ]
46044881:3 NEWLINE
46144981:3 glyph [
462−81:4 tight lit %rose
450+81:4 tight lit %palm
46345181:10 name p
46445281:11 tight glyph =
46545381:12 tight glyph (
466−81:13 tight name trel
454+81:13 tight name qual
46745581:18 name tape
46845681:23 name tape
46945781:28 name tape
470−81:32 tight glyph )
471−81:34 name q
472−81:35 tight glyph =
473−81:36 tight glyph (
474−81:37 tight name list
475−81:42 name tank
476−81:46 tight glyph )
477−81:47 tight glyph ]
478−83:1 DEDENT
479−83:1 NEWLINE
480−83:1 glyph +$
481−83:4 name nail
482−83:9 glyph [
483−83:10 tight name p
484−83:11 tight glyph =
485−83:12 tight name hair
486−83:17 name q
487−83:18 tight glyph =
488−83:19 tight name tape
489−83:23 tight glyph ]
490−85:1 NEWLINE
491−85:1 glyph +$
492−85:4 name edge
493−85:9 glyph [
494−85:10 tight name p
495−85:11 tight glyph =
496−85:12 tight name hair
497−85:17 name q
498−85:18 tight glyph =
499−85:19 tight glyph (
500−85:20 tight name unit
501−85:25 glyph [
502−85:26 tight name p
503−85:27 tight glyph =
504−85:28 tight glyph *
505−85:30 name q
506−85:31 tight glyph =
507−85:32 tight name nail
508−85:36 tight glyph ]
509−85:37 tight glyph )
510−85:38 tight glyph ]
511−87:1 NEWLINE
512−87:1 glyph +$
513−87:4 name rule
514−87:9 glyph $-(
515−87:12 tight name nail
516−87:17 name edge
517−87:21 tight glyph )
518−89:1 NEWLINE
519−89:1 glyph +$
520−89:4 name spot
521−89:9 glyph [
522−89:10 tight name p
523−89:11 tight glyph =
524−89:12 tight name path
525−89:17 name q
526−89:18 tight glyph =
527−89:19 tight name pint
528−89:23 tight glyph ]
529−91:1 NEWLINE
530−91:1 glyph +$
531−91:4 name toon
532−92:3 INDENT
533−92:3 glyph [
534−92:4 tight lit %0
535−92:7 name p
536−92:8 tight glyph =
537−92:9 tight glyph *
538−92:10 tight glyph ]
539−93:3 NEWLINE
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
54054093:3 glyph [
541−93:4 tight lit %1
541+93:4 tight lit %0
54254293:7 name p
54354393:8 tight glyph =
54454493:9 tight glyph *
54554593:10 tight glyph ]
54654694:3 NEWLINE
54754794:3 glyph [
548−94:4 tight lit %2
548+94:4 tight lit %1
54954994:7 name p
55055094:8 tight glyph =
551−94:9 tight glyph (
552−94:10 tight name list
553−94:15 name tank
554−94:19 tight glyph )
555−94:20 tight glyph ]
556−94:21 DEDENT
557−94:21 NEWLINE
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+95:21 DEDENT
564+95:21 NEWLINE
tests/golden/prelude-3g-structural/tree.txt+107−104
@@ -111,115 +111,118 @@
111111 (arm 47:5
112112 (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113113 (body 48:7
114− (branch 48:7
115− (wing 48:10 xs)
116− (arm 49:9 (lit 49:9 ~) (lit 49:11 ~))
117− (arm 50:9
118− (cell 50:9 (bind 50:10 item) (bind 50:15 rest))
119− (tuple 50:21
120− (group 50:22
121− (call 50:23 (wing 50:23 f) (wing 50:25 item)))
122− (group 50:31
123− (call 50:32 (wing 50:32 turn) (wing 50:37 rest) (wing 50:42 f))))))))))))
124− (mold 52:1 dime
125− (cell 52:9
126− (face 52:10 p (aura 52:12 @ta))
127− (face 52:16 q (aura 52:18 @))))
128− (mold 54:1 hair
129− (cell 54:9
130− (face 54:10 p (aura 54:12 @ud))
131− (face 54:16 q (aura 54:18 @ud))))
132− (mold 56:1 pint
133− (cell 56:9
134− (face 56:10 p
135− (cell 56:12
136− (face 56:13 p (aura 56:15 @))
137− (face 56:17 q (aura 56:19 @))))
138− (face 56:22 q
139− (cell 56:24
140− (face 56:25 p (aura 56:27 @))
141− (face 56:29 q (aura 56:31 @))))))
142− (mold 58:1 coin
143− (union 59:3
144− (cell 59:3
145− (const 59:4 %$)
146− (face 59:7 p (ref 59:9 dime)))
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147147 (cell 60:3
148− (const 60:4 %blob)
149− (face 60:10 p (noun 60:12)))
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150150 (cell 61:3
151− (const 61:4 %many)
152− (face 61:10 p
153− (apply 61:12 list (ref 61:18 coin))))))
154− (mold 63:1 pair
155− (generic 63:9 A B
156− (cell 63:18
157− (face 63:19 p (tvar 63:21 A))
158− (face 63:23 q (tvar 63:25 B)))))
159− (mold 65:1 trel
160− (generic 65:9 A B C
161− (cell 65:20
162− (face 65:21 p (tvar 65:23 A))
163− (face 65:25 q (tvar 65:27 B))
164− (face 65:29 r (tvar 65:31 C)))))
165− (mold 67:1 qual
166− (generic 67:9 A B C D
167− (cell 67:22
168− (face 67:23 p (tvar 67:25 A))
169− (face 67:27 q (tvar 67:29 B))
170− (face 67:31 r (tvar 67:33 C))
171− (face 67:35 s (tvar 67:37 D)))))
172− (mold 69:1 cord (aura 69:9 @t))
173− (mold 71:1 knot (aura 71:9 @ta))
174− (mold 73:1 tape
175− (apply 73:9 list (aura 73:15 @tD)))
176− (mold 75:1 path
177− (apply 75:9 list (ref 75:15 knot)))
178− (mold 77:1 tank
179− (union 78:3
180− (ref 78:3 cord)
181− (cell 79:3
182− (const 79:4 %leaf)
183− (face 79:10 p (ref 79:12 tape)))
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184184 (cell 80:3
185− (const 80:4 %palm)
186− (face 80:10 p
187− (apply 80:12 qual (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape) (ref 80:33 tape)))
188− (face 80:39 q
189− (apply 80:41 list (ref 80:47 tank))))
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
190187 (cell 81:3
191− (const 81:4 %rose)
188+ (const 81:4 %palm)
192189 (face 81:10 p
193− (apply 81:12 trel (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape)))
194− (face 81:34 q
195− (apply 81:36 list (ref 81:42 tank))))))
196− (mold 83:1 nail
197− (cell 83:9
198− (face 83:10 p (ref 83:12 hair))
199− (face 83:17 q (ref 83:19 tape))))
200− (mold 85:1 edge
201− (cell 85:9
202− (face 85:10 p (ref 85:12 hair))
203− (face 85:17 q
204− (apply 85:19 unit
205− (cell 85:25
206− (face 85:26 p (noun 85:28))
207− (face 85:30 q (ref 85:32 nail)))))))
208− (mold 87:1 rule
209− (fn 87:9 (ref 87:12 nail) (ref 87:17 edge)))
210− (mold 89:1 spot
211− (cell 89:9
212− (face 89:10 p (ref 89:12 path))
213− (face 89:17 q (ref 89:19 pint))))
214− (mold 91:1 toon
215− (union 92:3
216− (cell 92:3
217− (const 92:4 %0)
218− (face 92:7 p (noun 92:9)))
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219219 (cell 93:3
220− (const 93:4 %1)
220+ (const 93:4 %0)
221221 (face 93:7 p (noun 93:9)))
222222 (cell 94:3
223− (const 94:4 %2)
224− (face 94:7 p
225− (apply 94:9 list (ref 94:15 tank)))))))
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank)))))))
tests/golden/prelude-list-helpers/source.jibb+12−3
@@ -45,9 +45,10 @@
4545++ turn |= args=[(list A) $-(A B)]
4646 ?- args
4747 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
5152
5253+$ dime [p=@ta q=@]
5354
@@ -95,6 +96,14 @@
9596
9697+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
9798
99+++ like |= [f=$-(A B) result=(like A)]
100+ ++ mapped
101+ ^- (unit [p=B q=nail])
102+ ?- q.result
103+ ~ ~
104+ [~ value] `[p=(f p.value) q=q.value]
105+ ^- (like B) [p=p.result q=mapped]
106+
98107++ wonk |= veq=(like A)
99108 ?- q.veq
100109 ~ !!
tests/golden/prelude-list-helpers/tokens.txt+648−566
@@ -244,603 +244,685 @@
24424447:9 name f
24524547:10 tight glyph ]
24624648:7 INDENT
247−48:7 glyph ?-
248−48:10 name xs
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
24925249:9 INDENT
250−49:9 lit ~
251−49:11 lit ~
252−50:9 NEWLINE
253−50:9 glyph [
254−50:10 tight name item
255−50:15 name rest
256−50:19 tight glyph ]
257−50:21 glyph [
258−50:22 tight glyph (
259−50:23 tight name f
260−50:25 name item
261−50:29 tight glyph )
262−50:31 glyph (
263−50:32 tight name turn
264−50:37 name rest
265−50:42 name f
266−50:43 tight glyph )
267−50:44 tight glyph ]
268−52:1 DEDENT
269−52:1 DEDENT
270−52:1 DEDENT
271−52:1 DEDENT
272−52:1 NEWLINE
273−52:1 glyph +$
274−52:4 name dime
275−52:9 glyph [
276−52:10 tight name p
277−52:11 tight glyph =
278−52:12 tight aura @ta
279−52:16 name q
280−52:17 tight glyph =
281−52:18 tight aura @
282−52:19 tight glyph ]
283−54:1 NEWLINE
284−54:1 glyph +$
285−54:4 name hair
286−54:9 glyph [
287−54:10 tight name p
288−54:11 tight glyph =
289−54:12 tight aura @ud
290−54:16 name q
291−54:17 tight glyph =
292−54:18 tight aura @ud
293−54:21 tight glyph ]
294−56:1 NEWLINE
295−56:1 glyph +$
296−56:4 name pint
297−56:9 glyph [
298−56:10 tight name p
299−56:11 tight glyph =
300−56:12 tight glyph [
301−56:13 tight name p
302−56:14 tight glyph =
303−56:15 tight aura @
304−56:17 name q
305−56:18 tight glyph =
306−56:19 tight aura @
307−56:20 tight glyph ]
308−56:22 name q
309−56:23 tight glyph =
310−56:24 tight glyph [
311−56:25 tight name p
312−56:26 tight glyph =
313−56:27 tight aura @
314−56:29 name q
315−56:30 tight glyph =
316−56:31 tight aura @
317−56:32 tight glyph ]
318−56:33 tight glyph ]
319−58:1 NEWLINE
320−58:1 glyph +$
321−58:4 name coin
322−59:3 INDENT
323−59:3 glyph [
324−59:4 tight lit %$
325−59:7 name p
326−59:8 tight glyph =
327−59:9 tight name dime
328−59:13 tight glyph ]
329−60:3 NEWLINE
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
33033060:3 glyph [
331−60:4 tight lit %blob
332−60:10 name p
333−60:11 tight glyph =
334−60:12 tight glyph *
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
33533560:13 tight glyph ]
33633661:3 NEWLINE
33733761:3 glyph [
338−61:4 tight lit %many
338+61:4 tight lit %blob
33933961:10 name p
34034061:11 tight glyph =
341−61:12 tight glyph (
342−61:13 tight name list
343−61:18 name coin
344−61:22 tight glyph )
345−61:23 tight glyph ]
346−63:1 DEDENT
347−63:1 NEWLINE
348−63:1 glyph +$
349−63:4 name pair
350−63:9 glyph |$
351−63:12 glyph [
352−63:13 tight tvar A
353−63:15 tvar B
354−63:16 tight glyph ]
355−63:18 glyph [
356−63:19 tight name p
357−63:20 tight glyph =
358−63:21 tight tvar A
359−63:23 name q
360−63:24 tight glyph =
361−63:25 tight tvar B
362−63:26 tight glyph ]
363−65:1 NEWLINE
364−65:1 glyph +$
365−65:4 name trel
366−65:9 glyph |$
367−65:12 glyph [
368−65:13 tight tvar A
369−65:15 tvar B
370−65:17 tvar C
371−65:18 tight glyph ]
372−65:20 glyph [
373−65:21 tight name p
374−65:22 tight glyph =
375−65:23 tight tvar A
376−65:25 name q
377−65:26 tight glyph =
378−65:27 tight tvar B
379−65:29 name r
380−65:30 tight glyph =
381−65:31 tight tvar C
382−65:32 tight glyph ]
383−67:1 NEWLINE
384−67:1 glyph +$
385−67:4 name qual
386−67:9 glyph |$
387−67:12 glyph [
388−67:13 tight tvar A
389−67:15 tvar B
390−67:17 tvar C
391−67:19 tvar D
392−67:20 tight glyph ]
393−67:22 glyph [
394−67:23 tight name p
395−67:24 tight glyph =
396−67:25 tight tvar A
397−67:27 name q
398−67:28 tight glyph =
399−67:29 tight tvar B
400−67:31 name r
401−67:32 tight glyph =
402−67:33 tight tvar C
403−67:35 name s
404−67:36 tight glyph =
405−67:37 tight tvar D
406−67:38 tight glyph ]
407−69:1 NEWLINE
408−69:1 glyph +$
409−69:4 name cord
410−69:9 aura @t
411−71:1 NEWLINE
412−71:1 glyph +$
413−71:4 name knot
414−71:9 aura @ta
415−73:1 NEWLINE
416−73:1 glyph +$
417−73:4 name tape
418−73:9 glyph (
419−73:10 tight name list
420−73:15 aura @tD
421−73:18 tight glyph )
422−75:1 NEWLINE
423−75:1 glyph +$
424−75:4 name path
425−75:9 glyph (
426−75:10 tight name list
427−75:15 name knot
428−75:19 tight glyph )
429−77:1 NEWLINE
430−77:1 glyph +$
431−77:4 name tank
432−78:3 INDENT
433−78:3 name cord
434−79:3 NEWLINE
435−79:3 glyph [
436−79:4 tight lit %leaf
437−79:10 name p
438−79:11 tight glyph =
439−79:12 tight name tape
440−79:16 tight glyph ]
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
44144180:3 NEWLINE
44244280:3 glyph [
443−80:4 tight lit %palm
443+80:4 tight lit %leaf
44444480:10 name p
44544580:11 tight glyph =
446−80:12 tight glyph (
447−80:13 tight name qual
448−80:18 name tape
449−80:23 name tape
450−80:28 name tape
451−80:33 name tape
452−80:37 tight glyph )
453−80:39 name q
454−80:40 tight glyph =
455−80:41 tight glyph (
456−80:42 tight name list
457−80:47 name tank
458−80:51 tight glyph )
459−80:52 tight glyph ]
446+80:12 tight name tape
447+80:16 tight glyph ]
46044881:3 NEWLINE
46144981:3 glyph [
462−81:4 tight lit %rose
450+81:4 tight lit %palm
46345181:10 name p
46445281:11 tight glyph =
46545381:12 tight glyph (
466−81:13 tight name trel
454+81:13 tight name qual
46745581:18 name tape
46845681:23 name tape
46945781:28 name tape
470−81:32 tight glyph )
471−81:34 name q
472−81:35 tight glyph =
473−81:36 tight glyph (
474−81:37 tight name list
475−81:42 name tank
476−81:46 tight glyph )
477−81:47 tight glyph ]
478−83:1 DEDENT
479−83:1 NEWLINE
480−83:1 glyph +$
481−83:4 name nail
482−83:9 glyph [
483−83:10 tight name p
484−83:11 tight glyph =
485−83:12 tight name hair
486−83:17 name q
487−83:18 tight glyph =
488−83:19 tight name tape
489−83:23 tight glyph ]
490−85:1 NEWLINE
491−85:1 glyph +$
492−85:4 name edge
493−85:9 glyph [
494−85:10 tight name p
495−85:11 tight glyph =
496−85:12 tight name hair
497−85:17 name q
498−85:18 tight glyph =
499−85:19 tight glyph (
500−85:20 tight name unit
501−85:25 glyph [
502−85:26 tight name p
503−85:27 tight glyph =
504−85:28 tight glyph *
505−85:30 name q
506−85:31 tight glyph =
507−85:32 tight name nail
508−85:36 tight glyph ]
509−85:37 tight glyph )
510−85:38 tight glyph ]
511−87:1 NEWLINE
512−87:1 glyph +$
513−87:4 name rule
514−87:9 glyph $-(
515−87:12 tight name nail
516−87:17 name edge
517−87:21 tight glyph )
518−89:1 NEWLINE
519−89:1 glyph +$
520−89:4 name spot
521−89:9 glyph [
522−89:10 tight name p
523−89:11 tight glyph =
524−89:12 tight name path
525−89:17 name q
526−89:18 tight glyph =
527−89:19 tight name pint
528−89:23 tight glyph ]
529−91:1 NEWLINE
530−91:1 glyph +$
531−91:4 name toon
532−92:3 INDENT
533−92:3 glyph [
534−92:4 tight lit %0
535−92:7 name p
536−92:8 tight glyph =
537−92:9 tight glyph *
538−92:10 tight glyph ]
539−93:3 NEWLINE
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
54054093:3 glyph [
541−93:4 tight lit %1
541+93:4 tight lit %0
54254293:7 name p
54354393:8 tight glyph =
54454493:9 tight glyph *
54554593:10 tight glyph ]
54654694:3 NEWLINE
54754794:3 glyph [
548−94:4 tight lit %2
548+94:4 tight lit %1
54954994:7 name p
55055094:8 tight glyph =
551−94:9 tight glyph (
552−94:10 tight name list
553−94:15 name tank
554−94:19 tight glyph )
555−94:20 tight glyph ]
556−96:1 DEDENT
557−96:1 NEWLINE
558−96:1 glyph +$
559−96:4 name like
560−96:9 glyph |$
561−96:12 glyph [
562−96:13 tight tvar A
563−96:14 tight glyph ]
564−96:16 glyph [
565−96:17 tight name p
566−96:18 tight glyph =
567−96:19 tight name hair
568−96:24 name q
569−96:25 tight glyph =
570−96:26 tight glyph (
571−96:27 tight name unit
572−96:32 glyph [
573−96:33 tight name p
574−96:34 tight glyph =
575−96:35 tight tvar A
576−96:37 name q
577−96:38 tight glyph =
578−96:39 tight name nail
579−96:43 tight glyph ]
580−96:44 tight glyph )
581−96:45 tight glyph ]
582−98:1 NEWLINE
583−98:1 glyph ++
584−98:4 name wonk
585−98:9 glyph |=
586−98:12 name veq
587−98:15 tight glyph =
588−98:16 tight glyph (
589−98:17 tight name like
590−98:22 tvar A
591−98:23 tight glyph )
592−99:3 INDENT
593−99:3 glyph ?-
594−99:6 wing q.veq
595−100:5 INDENT
596−100:5 lit ~
597−100:7 glyph !!
598−101:5 NEWLINE
599−101:5 glyph [
600−101:6 tight lit ~
601−101:8 name product
602−101:15 tight glyph ]
603−101:17 wing p.product
604−103:1 DEDENT
605−103:1 DEDENT
606−103:1 NEWLINE
607−103:1 glyph +$
608−103:4 name lone
609−103:9 glyph |$
610−103:12 glyph [
611−103:13 tight tvar A
612−103:14 tight glyph ]
613−103:16 glyph [
614−103:17 tight name p
615−103:18 tight glyph =
616−103:19 tight tvar A
617−103:20 tight glyph ]
618−105:1 NEWLINE
619−105:1 glyph +$
620−105:4 name lest
621−105:9 glyph |$
622−105:12 glyph [
623−105:13 tight tvar A
624−105:14 tight glyph ]
625−105:16 glyph [
626−105:17 tight name i
627−105:18 tight glyph =
628−105:19 tight tvar A
629−105:21 name t
630−105:22 tight glyph =
631−105:23 tight glyph (
632−105:24 tight name list
633−105:29 tvar A
634−105:30 tight glyph )
635−105:31 tight glyph ]
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name like
592+99:9 glyph |=
593+99:12 glyph [
594+99:13 tight name f
595+99:14 tight glyph =
596+99:15 tight glyph $-(
597+99:18 tight tvar A
598+99:20 tvar B
599+99:21 tight glyph )
600+99:23 name result
601+99:29 tight glyph =
602+99:30 tight glyph (
603+99:31 tight name like
604+99:36 tvar A
605+99:37 tight glyph )
606+99:38 tight glyph ]
607+100:3 INDENT
608+100:3 glyph ++
609+100:6 name mapped
610+101:5 INDENT
611+101:5 glyph ^-
612+101:8 glyph (
613+101:9 tight name unit
614+101:14 glyph [
615+101:15 tight name p
616+101:16 tight glyph =
617+101:17 tight tvar B
618+101:19 name q
619+101:20 tight glyph =
620+101:21 tight name nail
621+101:25 tight glyph ]
622+101:26 tight glyph )
623+102:7 INDENT
624+102:7 glyph ?-
625+102:10 wing q.result
626+103:9 INDENT
627+103:9 lit ~
628+103:11 lit ~
629+104:9 NEWLINE
630+104:9 glyph [
631+104:10 tight lit ~
632+104:12 name value
633+104:17 tight glyph ]
634+104:19 glyph `
635+104:20 tight glyph [
636+104:21 tight name p
637+104:22 tight glyph =
638+104:23 tight glyph (
639+104:24 tight name f
640+104:26 wing p.value
641+104:33 tight glyph )
642+104:35 name q
643+104:36 tight glyph =
644+104:37 tight wing q.value
645+104:44 tight glyph ]
646+105:3 DEDENT
647+105:3 DEDENT
648+105:3 DEDENT
649+105:3 NEWLINE
650+105:3 glyph ^-
651+105:6 glyph (
652+105:7 tight name like
653+105:12 tvar B
654+105:13 tight glyph )
655+105:15 glyph [
656+105:16 tight name p
657+105:17 tight glyph =
658+105:18 tight wing p.result
659+105:27 name q
660+105:28 tight glyph =
661+105:29 tight name mapped
662+105:35 tight glyph ]
663+107:1 DEDENT
636664107:1 NEWLINE
637−107:1 glyph +$
638−107:4 name pole
639−107:9 glyph |$
640−107:12 glyph [
641−107:13 tight tvar A
642−107:14 tight glyph ]
665+107:1 glyph ++
666+107:4 name wonk
667+107:9 glyph |=
668+107:12 name veq
669+107:15 tight glyph =
670+107:16 tight glyph (
671+107:17 tight name like
672+107:22 tvar A
673+107:23 tight glyph )
643674108:3 INDENT
644−108:3 lit ~
645−109:3 NEWLINE
646−109:3 glyph [
647−109:4 tight tvar A
648−109:6 glyph (
649−109:7 tight name pole
650−109:12 tvar A
651−109:13 tight glyph )
652−109:14 tight glyph ]
653−111:1 DEDENT
654−111:1 NEWLINE
655−111:1 glyph +$
656−111:4 name quip
657−111:9 glyph |$
658−111:12 glyph [
659−111:13 tight tvar A
660−111:15 tvar B
661−111:16 tight glyph ]
662−111:18 glyph [
663−111:19 tight glyph (
664−111:20 tight name list
665−111:25 tvar A
666−111:26 tight glyph )
667−111:28 tvar B
668−111:29 tight glyph ]
669−113:1 NEWLINE
670−113:1 glyph +$
671−113:4 name tree
672−113:9 glyph |$
673−113:12 glyph [
674−113:13 tight tvar A
675−113:14 tight glyph ]
676−114:3 INDENT
677−114:3 lit ~
678−115:3 NEWLINE
679−115:3 glyph [
680−115:4 tight name n
681−115:5 tight glyph =
682−115:6 tight tvar A
683−115:8 name l
684−115:9 tight glyph =
685−115:10 tight glyph (
686−115:11 tight name tree
687−115:16 tvar A
688−115:17 tight glyph )
689−115:19 name r
690−115:20 tight glyph =
691−115:21 tight glyph (
692−115:22 tight name tree
693−115:27 tvar A
694−115:28 tight glyph )
695−115:29 tight glyph ]
696−117:1 DEDENT
697−117:1 NEWLINE
698−117:1 glyph +$
699−117:4 name each
700−117:9 glyph |$
701−117:12 glyph [
702−117:13 tight tvar A
703−117:15 tvar B
704−117:16 tight glyph ]
705−118:3 INDENT
675+108:3 glyph ?-
676+108:6 wing q.veq
677+109:5 INDENT
678+109:5 lit ~
679+109:7 glyph !!
680+110:5 NEWLINE
681+110:5 glyph [
682+110:6 tight lit ~
683+110:8 name product
684+110:15 tight glyph ]
685+110:17 wing p.product
686+112:1 DEDENT
687+112:1 DEDENT
688+112:1 NEWLINE
689+112:1 glyph +$
690+112:4 name lone
691+112:9 glyph |$
692+112:12 glyph [
693+112:13 tight tvar A
694+112:14 tight glyph ]
695+112:16 glyph [
696+112:17 tight name p
697+112:18 tight glyph =
698+112:19 tight tvar A
699+112:20 tight glyph ]
700+114:1 NEWLINE
701+114:1 glyph +$
702+114:4 name lest
703+114:9 glyph |$
704+114:12 glyph [
705+114:13 tight tvar A
706+114:14 tight glyph ]
707+114:16 glyph [
708+114:17 tight name i
709+114:18 tight glyph =
710+114:19 tight tvar A
711+114:21 name t
712+114:22 tight glyph =
713+114:23 tight glyph (
714+114:24 tight name list
715+114:29 tvar A
716+114:30 tight glyph )
717+114:31 tight glyph ]
718+116:1 NEWLINE
719+116:1 glyph +$
720+116:4 name pole
721+116:9 glyph |$
722+116:12 glyph [
723+116:13 tight tvar A
724+116:14 tight glyph ]
725+117:3 INDENT
726+117:3 lit ~
727+118:3 NEWLINE
706728118:3 glyph [
707−118:4 tight lit %|
708−118:7 name p
709−118:8 tight glyph =
710−118:9 tight tvar B
711−118:10 tight glyph ]
712−119:3 NEWLINE
713−119:3 glyph [
714−119:4 tight lit %&
715−119:7 name p
716−119:8 tight glyph =
717−119:9 tight tvar A
718−119:10 tight glyph ]
719−121:1 DEDENT
720−121:1 NEWLINE
721−121:1 glyph +$
722−121:4 name bloq
723−121:9 aura @
724−123:1 NEWLINE
725−123:1 glyph ++
726−123:4 name some
727−123:9 glyph |=
728−123:12 name item
729−123:16 tight glyph =
730−123:17 tight tvar A
731−123:19 glyph `
732−123:20 tight name item
733−125:1 NEWLINE
734−125:1 glyph ++
735−125:4 name lure
736−125:9 glyph |=
737−125:12 name item
738−125:16 tight glyph =
739−125:17 tight tvar A
740−126:3 INDENT
741−126:3 glyph ^-
742−126:6 glyph (
743−126:7 tight name list
744−126:12 tvar A
745−126:13 tight glyph )
746−126:15 glyph [
747−126:16 tight name item
748−126:21 lit ~
749−126:22 tight glyph ]
750−128:1 DEDENT
751−128:1 NEWLINE
752−128:1 glyph ++
753−128:4 name snoc
754−128:9 glyph |=
755−128:12 name args
756−128:16 tight glyph =
757−128:17 tight glyph [
758−128:18 tight glyph (
759−128:19 tight name list
760−128:24 tvar A
761−128:25 tight glyph )
762−128:27 tvar A
763−128:28 tight glyph ]
764−129:3 INDENT
765−129:3 glyph ?-
766−129:6 name args
767−130:5 INDENT
768−130:5 glyph [
769−130:6 tight name xs
770−130:9 name item
771−130:13 tight glyph ]
772−130:15 glyph (
773−130:16 tight name weld
774−130:21 name xs
775−130:24 glyph [
776−130:25 tight name item
777−130:30 lit ~
778−130:31 tight glyph ]
779−130:32 tight glyph )
780−132:1 DEDENT
781−132:1 DEDENT
729+118:4 tight tvar A
730+118:6 glyph (
731+118:7 tight name pole
732+118:12 tvar A
733+118:13 tight glyph )
734+118:14 tight glyph ]
735+120:1 DEDENT
736+120:1 NEWLINE
737+120:1 glyph +$
738+120:4 name quip
739+120:9 glyph |$
740+120:12 glyph [
741+120:13 tight tvar A
742+120:15 tvar B
743+120:16 tight glyph ]
744+120:18 glyph [
745+120:19 tight glyph (
746+120:20 tight name list
747+120:25 tvar A
748+120:26 tight glyph )
749+120:28 tvar B
750+120:29 tight glyph ]
751+122:1 NEWLINE
752+122:1 glyph +$
753+122:4 name tree
754+122:9 glyph |$
755+122:12 glyph [
756+122:13 tight tvar A
757+122:14 tight glyph ]
758+123:3 INDENT
759+123:3 lit ~
760+124:3 NEWLINE
761+124:3 glyph [
762+124:4 tight name n
763+124:5 tight glyph =
764+124:6 tight tvar A
765+124:8 name l
766+124:9 tight glyph =
767+124:10 tight glyph (
768+124:11 tight name tree
769+124:16 tvar A
770+124:17 tight glyph )
771+124:19 name r
772+124:20 tight glyph =
773+124:21 tight glyph (
774+124:22 tight name tree
775+124:27 tvar A
776+124:28 tight glyph )
777+124:29 tight glyph ]
778+126:1 DEDENT
779+126:1 NEWLINE
780+126:1 glyph +$
781+126:4 name each
782+126:9 glyph |$
783+126:12 glyph [
784+126:13 tight tvar A
785+126:15 tvar B
786+126:16 tight glyph ]
787+127:3 INDENT
788+127:3 glyph [
789+127:4 tight lit %|
790+127:7 name p
791+127:8 tight glyph =
792+127:9 tight tvar B
793+127:10 tight glyph ]
794+128:3 NEWLINE
795+128:3 glyph [
796+128:4 tight lit %&
797+128:7 name p
798+128:8 tight glyph =
799+128:9 tight tvar A
800+128:10 tight glyph ]
801+130:1 DEDENT
802+130:1 NEWLINE
803+130:1 glyph +$
804+130:4 name bloq
805+130:9 aura @
782806132:1 NEWLINE
783807132:1 glyph ++
784−132:4 name flop
808+132:4 name some
785809132:9 glyph |=
786−132:12 name xs
787−132:14 tight glyph =
788−132:15 tight glyph (
789−132:16 tight name list
790−132:21 tvar A
791−132:22 tight glyph )
792−133:3 INDENT
793−133:3 glyph ++
794−133:6 name reverse-into
795−133:19 glyph |=
796−133:22 name args
797−133:26 tight glyph =
798−133:27 tight glyph [
799−133:28 tight glyph (
800−133:29 tight name list
801−133:34 tvar A
802−133:35 tight glyph )
803−133:37 glyph (
804−133:38 tight name list
805−133:43 tvar A
806−133:44 tight glyph )
807−133:45 tight glyph ]
808−134:5 INDENT
809−134:5 glyph ?-
810−134:8 name args
811−135:7 INDENT
812−135:7 glyph [
813−135:8 tight name rest
814−135:13 name acc
815−135:16 tight glyph ]
816−136:9 INDENT
817−136:9 glyph ?-
818−136:12 name rest
819−137:11 INDENT
820−137:11 lit ~
821−137:13 name acc
822−138:11 NEWLINE
823−138:11 glyph [
824−138:12 tight name item
825−138:17 name more
826−138:21 tight glyph ]
827−138:23 glyph (
828−138:24 tight name reverse-into
829−138:37 name more
830−138:42 glyph [
831−138:43 tight name item
832−138:48 name acc
833−138:51 tight glyph ]
834−138:52 tight glyph )
835−139:3 DEDENT
836−139:3 DEDENT
837−139:3 DEDENT
838−139:3 DEDENT
839−139:3 NEWLINE
840−139:3 glyph (
841−139:4 tight name reverse-into
842−139:17 name xs
843−139:20 lit ~
844−139:21 tight glyph )
845−139:22 DEDENT
846−139:22 NEWLINE
810+132:12 name item
811+132:16 tight glyph =
812+132:17 tight tvar A
813+132:19 glyph `
814+132:20 tight name item
815+134:1 NEWLINE
816+134:1 glyph ++
817+134:4 name lure
818+134:9 glyph |=
819+134:12 name item
820+134:16 tight glyph =
821+134:17 tight tvar A
822+135:3 INDENT
823+135:3 glyph ^-
824+135:6 glyph (
825+135:7 tight name list
826+135:12 tvar A
827+135:13 tight glyph )
828+135:15 glyph [
829+135:16 tight name item
830+135:21 lit ~
831+135:22 tight glyph ]
832+137:1 DEDENT
833+137:1 NEWLINE
834+137:1 glyph ++
835+137:4 name snoc
836+137:9 glyph |=
837+137:12 name args
838+137:16 tight glyph =
839+137:17 tight glyph [
840+137:18 tight glyph (
841+137:19 tight name list
842+137:24 tvar A
843+137:25 tight glyph )
844+137:27 tvar A
845+137:28 tight glyph ]
846+138:3 INDENT
847+138:3 glyph ?-
848+138:6 name args
849+139:5 INDENT
850+139:5 glyph [
851+139:6 tight name xs
852+139:9 name item
853+139:13 tight glyph ]
854+139:15 glyph (
855+139:16 tight name weld
856+139:21 name xs
857+139:24 glyph [
858+139:25 tight name item
859+139:30 lit ~
860+139:31 tight glyph ]
861+139:32 tight glyph )
862+141:1 DEDENT
863+141:1 DEDENT
864+141:1 NEWLINE
865+141:1 glyph ++
866+141:4 name flop
867+141:9 glyph |=
868+141:12 name xs
869+141:14 tight glyph =
870+141:15 tight glyph (
871+141:16 tight name list
872+141:21 tvar A
873+141:22 tight glyph )
874+142:3 INDENT
875+142:3 glyph ++
876+142:6 name reverse-into
877+142:19 glyph |=
878+142:22 name args
879+142:26 tight glyph =
880+142:27 tight glyph [
881+142:28 tight glyph (
882+142:29 tight name list
883+142:34 tvar A
884+142:35 tight glyph )
885+142:37 glyph (
886+142:38 tight name list
887+142:43 tvar A
888+142:44 tight glyph )
889+142:45 tight glyph ]
890+143:5 INDENT
891+143:5 glyph ?-
892+143:8 name args
893+144:7 INDENT
894+144:7 glyph [
895+144:8 tight name rest
896+144:13 name acc
897+144:16 tight glyph ]
898+145:9 INDENT
899+145:9 glyph ?-
900+145:12 name rest
901+146:11 INDENT
902+146:11 lit ~
903+146:13 name acc
904+147:11 NEWLINE
905+147:11 glyph [
906+147:12 tight name item
907+147:17 name more
908+147:21 tight glyph ]
909+147:23 glyph (
910+147:24 tight name reverse-into
911+147:37 name more
912+147:42 glyph [
913+147:43 tight name item
914+147:48 name acc
915+147:51 tight glyph ]
916+147:52 tight glyph )
917+148:3 DEDENT
918+148:3 DEDENT
919+148:3 DEDENT
920+148:3 DEDENT
921+148:3 NEWLINE
922+148:3 glyph (
923+148:4 tight name reverse-into
924+148:17 name xs
925+148:20 lit ~
926+148:21 tight glyph )
927+148:22 DEDENT
928+148:22 NEWLINE
tests/golden/prelude-list-helpers/tree.txt+255−220
@@ -111,233 +111,268 @@
111111 (arm 47:5
112112 (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113113 (body 48:7
114− (branch 48:7
115− (wing 48:10 xs)
116− (arm 49:9 (lit 49:9 ~) (lit 49:11 ~))
117− (arm 50:9
118− (cell 50:9 (bind 50:10 item) (bind 50:15 rest))
119− (tuple 50:21
120− (group 50:22
121− (call 50:23 (wing 50:23 f) (wing 50:25 item)))
122− (group 50:31
123− (call 50:32 (wing 50:32 turn) (wing 50:37 rest) (wing 50:42 f))))))))))))
124− (mold 52:1 dime
125− (cell 52:9
126− (face 52:10 p (aura 52:12 @ta))
127− (face 52:16 q (aura 52:18 @))))
128− (mold 54:1 hair
129− (cell 54:9
130− (face 54:10 p (aura 54:12 @ud))
131− (face 54:16 q (aura 54:18 @ud))))
132− (mold 56:1 pint
133− (cell 56:9
134− (face 56:10 p
135− (cell 56:12
136− (face 56:13 p (aura 56:15 @))
137− (face 56:17 q (aura 56:19 @))))
138− (face 56:22 q
139− (cell 56:24
140− (face 56:25 p (aura 56:27 @))
141− (face 56:29 q (aura 56:31 @))))))
142− (mold 58:1 coin
143− (union 59:3
144− (cell 59:3
145− (const 59:4 %$)
146− (face 59:7 p (ref 59:9 dime)))
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147147 (cell 60:3
148− (const 60:4 %blob)
149− (face 60:10 p (noun 60:12)))
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150150 (cell 61:3
151− (const 61:4 %many)
152− (face 61:10 p
153− (apply 61:12 list (ref 61:18 coin))))))
154− (mold 63:1 pair
155− (generic 63:9 A B
156− (cell 63:18
157− (face 63:19 p (tvar 63:21 A))
158− (face 63:23 q (tvar 63:25 B)))))
159− (mold 65:1 trel
160− (generic 65:9 A B C
161− (cell 65:20
162− (face 65:21 p (tvar 65:23 A))
163− (face 65:25 q (tvar 65:27 B))
164− (face 65:29 r (tvar 65:31 C)))))
165− (mold 67:1 qual
166− (generic 67:9 A B C D
167− (cell 67:22
168− (face 67:23 p (tvar 67:25 A))
169− (face 67:27 q (tvar 67:29 B))
170− (face 67:31 r (tvar 67:33 C))
171− (face 67:35 s (tvar 67:37 D)))))
172− (mold 69:1 cord (aura 69:9 @t))
173− (mold 71:1 knot (aura 71:9 @ta))
174− (mold 73:1 tape
175− (apply 73:9 list (aura 73:15 @tD)))
176− (mold 75:1 path
177− (apply 75:9 list (ref 75:15 knot)))
178− (mold 77:1 tank
179− (union 78:3
180− (ref 78:3 cord)
181− (cell 79:3
182− (const 79:4 %leaf)
183− (face 79:10 p (ref 79:12 tape)))
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184184 (cell 80:3
185− (const 80:4 %palm)
186− (face 80:10 p
187− (apply 80:12 qual (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape) (ref 80:33 tape)))
188− (face 80:39 q
189− (apply 80:41 list (ref 80:47 tank))))
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
190187 (cell 81:3
191− (const 81:4 %rose)
188+ (const 81:4 %palm)
192189 (face 81:10 p
193− (apply 81:12 trel (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape)))
194− (face 81:34 q
195− (apply 81:36 list (ref 81:42 tank))))))
196− (mold 83:1 nail
197− (cell 83:9
198− (face 83:10 p (ref 83:12 hair))
199− (face 83:17 q (ref 83:19 tape))))
200− (mold 85:1 edge
201− (cell 85:9
202− (face 85:10 p (ref 85:12 hair))
203− (face 85:17 q
204− (apply 85:19 unit
205− (cell 85:25
206− (face 85:26 p (noun 85:28))
207− (face 85:30 q (ref 85:32 nail)))))))
208− (mold 87:1 rule
209− (fn 87:9 (ref 87:12 nail) (ref 87:17 edge)))
210− (mold 89:1 spot
211− (cell 89:9
212− (face 89:10 p (ref 89:12 path))
213− (face 89:17 q (ref 89:19 pint))))
214− (mold 91:1 toon
215− (union 92:3
216− (cell 92:3
217− (const 92:4 %0)
218− (face 92:7 p (noun 92:9)))
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219219 (cell 93:3
220− (const 93:4 %1)
220+ (const 93:4 %0)
221221 (face 93:7 p (noun 93:9)))
222222 (cell 94:3
223− (const 94:4 %2)
224− (face 94:7 p
225− (apply 94:9 list (ref 94:15 tank))))))
226− (mold 96:1 like
227− (generic 96:9 A
228− (cell 96:16
229− (face 96:17 p (ref 96:19 hair))
230− (face 96:24 q
231− (apply 96:26 unit
232− (cell 96:32
233− (face 96:33 p (tvar 96:35 A))
234− (face 96:37 q (ref 96:39 nail))))))))
235− (value 98:1 wonk
236− (gate 98:9
237− (face 98:12 veq
238− (apply 98:16 like (tvar 98:22 A)))
239− (body 99:3
240− (branch 99:3
241− (wing 99:6 q.veq)
242− (arm 100:5 (lit 100:5 ~) (crash 100:7))
243− (arm 101:5
244− (cell 101:5 (lit 101:6 ~) (bind 101:8 product))
245− (wing 101:17 p.product))))))
246− (mold 103:1 lone
247− (generic 103:9 A
248− (cell 103:16
249− (face 103:17 p (tvar 103:19 A)))))
250− (mold 105:1 lest
251− (generic 105:9 A
252− (cell 105:16
253− (face 105:17 i (tvar 105:19 A))
254− (face 105:21 t
255− (apply 105:23 list (tvar 105:29 A))))))
256− (mold 107:1 pole
257− (generic 107:9 A
258− (union 108:3
259− (const 108:3 ~)
260− (cell 109:3
261− (tvar 109:4 A)
262− (apply 109:6 pole (tvar 109:12 A))))))
263− (mold 111:1 quip
264− (generic 111:9 A B
265− (cell 111:18
266− (apply 111:19 list (tvar 111:25 A))
267− (tvar 111:28 B))))
268− (mold 113:1 tree
269− (generic 113:9 A
270− (union 114:3
271− (const 114:3 ~)
272− (cell 115:3
273− (face 115:4 n (tvar 115:6 A))
274− (face 115:8 l
275− (apply 115:10 tree (tvar 115:16 A)))
276− (face 115:19 r
277− (apply 115:21 tree (tvar 115:27 A)))))))
278− (mold 117:1 each
279− (generic 117:9 A B
280− (union 118:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 like
239+ (gate 99:9
240+ (cell 99:12
241+ (face 99:13 f
242+ (fn 99:15 (tvar 99:18 A) (tvar 99:20 B)))
243+ (face 99:23 result
244+ (apply 99:30 like (tvar 99:36 A))))
245+ (body 100:3
246+ (value 100:3 mapped
247+ (body 101:5
248+ (cast 101:5
249+ (apply 101:8 unit
250+ (cell 101:14
251+ (face 101:15 p (tvar 101:17 B))
252+ (face 101:19 q (ref 101:21 nail))))
253+ (body 102:7
254+ (branch 102:7
255+ (wing 102:10 q.result)
256+ (arm 103:9 (lit 103:9 ~) (lit 103:11 ~))
257+ (arm 104:9
258+ (cell 104:9 (lit 104:10 ~) (bind 104:12 value))
259+ (unit 104:19
260+ (tuple 104:20
261+ (face 104:21 p
262+ (group 104:23
263+ (call 104:24 (wing 104:24 f) (wing 104:26 p.value))))
264+ (face 104:35 q (wing 104:37 q.value))))))))))
265+ (cast 105:3
266+ (apply 105:6 like (tvar 105:12 B))
267+ (tuple 105:15
268+ (face 105:16 p (wing 105:18 p.result))
269+ (face 105:27 q (wing 105:29 mapped)))))))
270+ (value 107:1 wonk
271+ (gate 107:9
272+ (face 107:12 veq
273+ (apply 107:16 like (tvar 107:22 A)))
274+ (body 108:3
275+ (branch 108:3
276+ (wing 108:6 q.veq)
277+ (arm 109:5 (lit 109:5 ~) (crash 109:7))
278+ (arm 110:5
279+ (cell 110:5 (lit 110:6 ~) (bind 110:8 product))
280+ (wing 110:17 p.product))))))
281+ (mold 112:1 lone
282+ (generic 112:9 A
283+ (cell 112:16
284+ (face 112:17 p (tvar 112:19 A)))))
285+ (mold 114:1 lest
286+ (generic 114:9 A
287+ (cell 114:16
288+ (face 114:17 i (tvar 114:19 A))
289+ (face 114:21 t
290+ (apply 114:23 list (tvar 114:29 A))))))
291+ (mold 116:1 pole
292+ (generic 116:9 A
293+ (union 117:3
294+ (const 117:3 ~)
281295 (cell 118:3
282− (const 118:4 %|)
283− (face 118:7 p (tvar 118:9 B)))
284− (cell 119:3
285− (const 119:4 %&)
286− (face 119:7 p (tvar 119:9 A))))))
287− (mold 121:1 bloq (aura 121:9 @))
288− (value 123:1 some
289− (gate 123:9
290− (face 123:12 item (tvar 123:17 A))
291− (unit 123:19 (wing 123:20 item))))
292− (value 125:1 lure
293− (gate 125:9
294− (face 125:12 item (tvar 125:17 A))
295− (body 126:3
296− (cast 126:3
297− (apply 126:6 list (tvar 126:12 A))
298− (tuple 126:15 (wing 126:16 item) (lit 126:21 ~))))))
299− (value 128:1 snoc
300− (gate 128:9
301− (face 128:12 args
302− (cell 128:17
303− (apply 128:18 list (tvar 128:24 A))
304− (tvar 128:27 A)))
305− (body 129:3
306− (branch 129:3
307− (wing 129:6 args)
308− (arm 130:5
309− (cell 130:5 (bind 130:6 xs) (bind 130:9 item))
310− (group 130:15
311− (call 130:16
312− (wing 130:16 weld)
313− (wing 130:21 xs)
314− (tuple 130:24 (wing 130:25 item) (lit 130:30 ~)))))))))
315− (value 132:1 flop
296+ (tvar 118:4 A)
297+ (apply 118:6 pole (tvar 118:12 A))))))
298+ (mold 120:1 quip
299+ (generic 120:9 A B
300+ (cell 120:18
301+ (apply 120:19 list (tvar 120:25 A))
302+ (tvar 120:28 B))))
303+ (mold 122:1 tree
304+ (generic 122:9 A
305+ (union 123:3
306+ (const 123:3 ~)
307+ (cell 124:3
308+ (face 124:4 n (tvar 124:6 A))
309+ (face 124:8 l
310+ (apply 124:10 tree (tvar 124:16 A)))
311+ (face 124:19 r
312+ (apply 124:21 tree (tvar 124:27 A)))))))
313+ (mold 126:1 each
314+ (generic 126:9 A B
315+ (union 127:3
316+ (cell 127:3
317+ (const 127:4 %|)
318+ (face 127:7 p (tvar 127:9 B)))
319+ (cell 128:3
320+ (const 128:4 %&)
321+ (face 128:7 p (tvar 128:9 A))))))
322+ (mold 130:1 bloq (aura 130:9 @))
323+ (value 132:1 some
316324 (gate 132:9
317− (face 132:12 xs
318− (apply 132:15 list (tvar 132:21 A)))
319− (body 133:3
320− (value 133:3 reverse-into
321− (gate 133:19
322− (face 133:22 args
323− (cell 133:27
324− (apply 133:28 list (tvar 133:34 A))
325− (apply 133:37 list (tvar 133:43 A))))
326− (body 134:5
327− (branch 134:5
328− (wing 134:8 args)
329− (arm 135:7
330− (cell 135:7 (bind 135:8 rest) (bind 135:13 acc))
331− (body 136:9
332− (branch 136:9
333− (wing 136:12 rest)
334− (arm 137:11 (lit 137:11 ~) (wing 137:13 acc))
335− (arm 138:11
336− (cell 138:11 (bind 138:12 item) (bind 138:17 more))
337− (group 138:23
338− (call 138:24
339− (wing 138:24 reverse-into)
340− (wing 138:37 more)
341− (tuple 138:42 (wing 138:43 item) (wing 138:48 acc))))))))))))
342− (group 139:3
343− (call 139:4 (wing 139:4 reverse-into) (wing 139:17 xs) (lit 139:20 ~)))))))
325+ (face 132:12 item (tvar 132:17 A))
326+ (unit 132:19 (wing 132:20 item))))
327+ (value 134:1 lure
328+ (gate 134:9
329+ (face 134:12 item (tvar 134:17 A))
330+ (body 135:3
331+ (cast 135:3
332+ (apply 135:6 list (tvar 135:12 A))
333+ (tuple 135:15 (wing 135:16 item) (lit 135:21 ~))))))
334+ (value 137:1 snoc
335+ (gate 137:9
336+ (face 137:12 args
337+ (cell 137:17
338+ (apply 137:18 list (tvar 137:24 A))
339+ (tvar 137:27 A)))
340+ (body 138:3
341+ (branch 138:3
342+ (wing 138:6 args)
343+ (arm 139:5
344+ (cell 139:5 (bind 139:6 xs) (bind 139:9 item))
345+ (group 139:15
346+ (call 139:16
347+ (wing 139:16 weld)
348+ (wing 139:21 xs)
349+ (tuple 139:24 (wing 139:25 item) (lit 139:30 ~)))))))))
350+ (value 141:1 flop
351+ (gate 141:9
352+ (face 141:12 xs
353+ (apply 141:15 list (tvar 141:21 A)))
354+ (body 142:3
355+ (value 142:3 reverse-into
356+ (gate 142:19
357+ (face 142:22 args
358+ (cell 142:27
359+ (apply 142:28 list (tvar 142:34 A))
360+ (apply 142:37 list (tvar 142:43 A))))
361+ (body 143:5
362+ (branch 143:5
363+ (wing 143:8 args)
364+ (arm 144:7
365+ (cell 144:7 (bind 144:8 rest) (bind 144:13 acc))
366+ (body 145:9
367+ (branch 145:9
368+ (wing 145:12 rest)
369+ (arm 146:11 (lit 146:11 ~) (wing 146:13 acc))
370+ (arm 147:11
371+ (cell 147:11 (bind 147:12 item) (bind 147:17 more))
372+ (group 147:23
373+ (call 147:24
374+ (wing 147:24 reverse-into)
375+ (wing 147:37 more)
376+ (tuple 147:42 (wing 147:43 item) (wing 147:48 acc))))))))))))
377+ (group 148:3
378+ (call 148:4 (wing 148:4 reverse-into) (wing 148:17 xs) (lit 148:20 ~)))))))
tests/golden/prelude-list-helpers/types.txt+2−1
@@ -27,6 +27,7 @@ partial inference; module not checked
2727+$ spot: not checked
2828+$ toon: cases proven disjoint; mold not checked
2929+$ like: not checked
30+++ like: sample mold is not supported by partial inference
3031++ wonk: sample mold is not supported by partial inference
3132+$ lone: not checked
3233+$ lest: not checked
@@ -35,7 +36,7 @@ partial inference; module not checked
3536+$ tree: cases proven disjoint; mold not checked
3637+$ each: cases proven disjoint; mold not checked
3738+$ bloq: not checked
38−++ some: expression is not supported by partial inference
39+++ some: unit construction needs the standard prelude in partial inference
3940++ lure: cast mold is not supported by partial inference
4041++ snoc: sample mold is not supported by partial inference
4142++ flop: sample mold is not supported by partial inference
tests/golden/prelude-list-unit/source.jibb+4−3
@@ -45,6 +45,7 @@
4545++ turn |= args=[(list A) $-(A B)]
4646 ?- args
4747 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
tests/golden/prelude-list-unit/tokens.txt+32−25
@@ -244,29 +244,36 @@
24424447:9 name f
24524547:10 tight glyph ]
24624648:7 INDENT
247−48:7 glyph ?-
248−48:10 name xs
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
24925249:9 INDENT
250−49:9 lit ~
251−49:11 lit ~
252−50:9 NEWLINE
253−50:9 glyph [
254−50:10 tight name item
255−50:15 name rest
256−50:19 tight glyph ]
257−50:21 glyph [
258−50:22 tight glyph (
259−50:23 tight name f
260−50:25 name item
261−50:29 tight glyph )
262−50:31 glyph (
263−50:32 tight name turn
264−50:37 name rest
265−50:42 name f
266−50:43 tight glyph )
267−50:44 tight glyph ]
268−50:45 DEDENT
269−50:45 DEDENT
270−50:45 DEDENT
271−50:45 DEDENT
272−50:45 NEWLINE
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+51:47 DEDENT
275+51:47 DEDENT
276+51:47 DEDENT
277+51:47 DEDENT
278+51:47 DEDENT
279+51:47 NEWLINE
tests/golden/prelude-list-unit/tree.txt+13−10
@@ -111,13 +111,16 @@
111111 (arm 47:5
112112 (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113113 (body 48:7
114− (branch 48:7
115− (wing 48:10 xs)
116− (arm 49:9 (lit 49:9 ~) (lit 49:11 ~))
117− (arm 50:9
118− (cell 50:9 (bind 50:10 item) (bind 50:15 rest))
119− (tuple 50:21
120− (group 50:22
121− (call 50:23 (wing 50:23 f) (wing 50:25 item)))
122− (group 50:31
123− (call 50:32 (wing 50:32 turn) (wing 50:37 rest) (wing 50:42 f)))))))))))))
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f)))))))))))))))
tests/golden/prelude-unit-list-transforms/about.txt+2−2
@@ -1,4 +1,4 @@
1−source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; Hoon 2a includes `drop`, `bind`, `biff`, `flit`, `both`, `clap` and `clef`, and 2b includes `join`, `murn`, `rear`, `snip`, `skim`, `skip`, `levy`, `lien`, `roll` and `reel`. Folds take an explicit start.
2−tests: The complete current prelude parses, including unit-to-list conversion, unit mapping and flat mapping, a curried unit-producing filter, three ways to combine units, including `clap` with one shared value type, complementary list filters, present-product mapping, joining, last-item operations, all/any predicates, and left and right folds. The filters retain the order of their selected items.
1+source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; Hoon 2a includes `drop`, `bind`, `biff`, `flit`, `both`, `clap`, `clef`, `hunt` and `mate`, and 2b includes `join`, `murn`, `rear`, `snip`, `skim`, `skip`, `levy`, `lien`, `roll` and `reel`. Folds take an explicit start.
2+tests: The complete current prelude parses, including unit-to-list conversion, unit mapping and flat mapping, a curried unit-producing filter, several ways to combine units, including `clap` with one shared value type, and `hunt` with its ordering gate first, complementary list filters, present-product mapping, joining, last-item operations, all/any predicates, and left and right folds. The filters retain the order of their selected items. It also includes `eq` with its generalized gate-free constraint and the source-backed `ask` re-export and `pure` gate.
33expect: parses
44expect-types: a partial inference report, not a checked module; unit and list gate typing is not complete
tests/golden/prelude-unit-list-transforms/source.jibb+147−64
@@ -1,4 +1,9 @@
1+/= internal /lib/jibb/internal
2++$ raw-poke raw-poke.internal
3++$ qath qath.internal
4+
15:: Initial prelude functions. The rest of the inventory is still to come.
6+
27++ same |= x=A x
38
49++ head |= p=[A B]
@@ -14,6 +19,8 @@
1419 %.y %.n
1520 %.n %.y
1621
22+++ eq |= args=[A A] (eq-data.internal args)
23+
1724+$ list |$ [A]
1825 ~
1926 [i=A t=(list A)]
@@ -45,9 +52,10 @@
4552++ turn |= args=[(list A) $-(A B)]
4653 ?- args
4754 [xs f]
48− ?- xs
49− ~ ~
50− [item rest] [(f item) (turn rest f)]
55+ ^- (list B)
56+ ?- xs
57+ ~ ~
58+ [item rest] [(f item) (turn rest f)]
5159
5260+$ dime [p=@ta q=@]
5361
@@ -95,6 +103,14 @@
95103
96104+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
97105
106+++ like |= [f=$-(A B) result=(like A)]
107+ ++ mapped
108+ ^- (unit [p=B q=nail])
109+ ?- q.result
110+ ~ ~
111+ [~ value] `[p=(f p.value) q=q.value]
112+ ^- (like B) [p=p.result q=mapped]
113+
98114++ wonk |= veq=(like A)
99115 ?- q.veq
100116 ~ !!
@@ -139,27 +155,34 @@
139155 (reverse-into xs ~)
140156
141157++ drop |= maybe=(unit A)
142− ?- maybe
143− ~ ~
144− [~ value] [value ~]
158+ ^- (list A)
159+ ?- maybe
160+ ~ ~
161+ [~ value] [value ~]
162+
163+++ bond |= fallback=$-(~ A)
164+ |= maybe=(unit A)
165+ ?- maybe
166+ ~ (fallback ~)
167+ [~ value] value
145168
146169++ bind |= args=[(unit A) $-(A B)]
147170 ?- args
148− [maybe f]
171+ [maybe f] ^- (unit B)
149172 ?- maybe
150173 ~ ~
151174 [~ value] `(f value)
152175
153176++ biff |= args=[(unit A) $-(A (unit B))]
154177 ?- args
155− [maybe f]
178+ [maybe f] ^- (unit B)
156179 ?- maybe
157180 ~ ~
158181 [~ value] (f value)
159182
160183++ both |= args=[(unit A) (unit B)]
161184 ?- args
162− [first second]
185+ [first second] ^- (unit [A B])
163186 ?- first
164187 ~ ~
165188 [~ a]
@@ -169,7 +192,7 @@
169192
170193++ clap |= args=[(unit A) (unit A) $-([A A] A)]
171194 ?- args
172− [first second combine]
195+ [first second combine] ^- (unit A)
173196 ?- first
174197 ~ second
175198 [~ a]
@@ -177,9 +200,35 @@
177200 ~ first
178201 [~ b] `(combine a b)
179202
203+++ hunt |= args=[$-([A A] ?) (unit A) (unit A)]
204+ ?- args
205+ [choose first second] ^- (unit A)
206+ ?- first
207+ ~ second
208+ [~ a]
209+ ?- second
210+ ~ first
211+ [~ b]
212+ ?- (choose a b)
213+ %.y first
214+ %.n second
215+
216+++ mate |= args=[(unit A) (unit A)]
217+ ?- args
218+ [first second] ^- (unit A)
219+ ?- second
220+ ~ first
221+ [~ b]
222+ ?- first
223+ ~ second
224+ [~ a]
225+ ?- (eq a b)
226+ %.y first
227+ %.n !!
228+
180229++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
181230 ?- args
182− [first second combine]
231+ [first second combine] ^- (unit C)
183232 ?- first
184233 ~ ~
185234 [~ a]
@@ -189,43 +238,45 @@
189238
190239++ skim |= args=[(list A) $-(A ?)]
191240 ?- args
192− [xs predicate]
193− ?- xs
194− ~ ~
195− [item rest]
196− ?- (predicate item)
197− %.y [item (skim rest predicate)]
198− %.n (skim rest predicate)
241+ [xs predicate] ^- (list A)
242+ ?- xs
243+ ~ ~
244+ [item rest]
245+ ?- (predicate item)
246+ %.y [item (skim rest predicate)]
247+ %.n (skim rest predicate)
199248
200249++ skip |= args=[(list A) $-(A ?)]
201250 ?- args
202− [xs predicate]
203− ?- xs
204− ~ ~
205− [item rest]
206− ?- (predicate item)
207− %.y (skip rest predicate)
208− %.n [item (skip rest predicate)]
251+ [xs predicate] ^- (list A)
252+ ?- xs
253+ ~ ~
254+ [item rest]
255+ ?- (predicate item)
256+ %.y (skip rest predicate)
257+ %.n [item (skip rest predicate)]
209258
210259++ levy |= args=[(list A) $-(A ?)]
211− ?- args
212− [xs predicate]
213− ?- xs
214− ~ %.y
215− [item rest]
216− ?- (predicate item)
217− %.y (levy rest predicate)
218− %.n %.n
260+ ^- ?
261+ ?- args
262+ [xs predicate]
263+ ?- xs
264+ ~ %.y
265+ [item rest]
266+ ?- (predicate item)
267+ %.y (levy rest predicate)
268+ %.n %.n
219269
220270++ lien |= args=[(list A) $-(A ?)]
221− ?- args
222− [xs predicate]
223− ?- xs
224− ~ %.n
225− [item rest]
226− ?- (predicate item)
227− %.y %.y
228− %.n (lien rest predicate)
271+ ^- ?
272+ ?- args
273+ [xs predicate]
274+ ?- xs
275+ ~ %.n
276+ [item rest]
277+ ?- (predicate item)
278+ %.y %.y
279+ %.n (lien rest predicate)
229280
230281++ roll |= args=[(list A) B $-([A B] B)]
231282 ?- args
@@ -243,37 +294,39 @@
243294
244295++ flit |= predicate=$-(A ?)
245296 |= value=A
246− ?- (predicate value)
247− %.y `value
248− %.n ~
297+ ^- (unit A)
298+ ?- (predicate value)
299+ %.y `value
300+ %.n ~
249301
250302++ murn |= args=[(list A) $-(A (unit B))]
251303 ?- args
252− [xs f]
253− ?- xs
254− ~ ~
255− [item rest]
256− ?- (f item)
257− ~ (murn rest f)
258− [~ value] [value (murn rest f)]
304+ [xs f] ^- (list B)
305+ ?- xs
306+ ~ ~
307+ [item rest]
308+ ?- (f item)
309+ ~ (murn rest f)
310+ [~ value] [value (murn rest f)]
259311
260312++ join |= args=[A (list A)]
261313 ?- args
262− [separator xs]
263− ?- xs
264− ~ ~
265− [item rest]
266− ?- rest
267− ~ [item ~]
268− [next more] [item [separator (join separator rest)]]
314+ [separator xs] ^- (list A)
315+ ?- xs
316+ ~ ~
317+ [item rest]
318+ ?- rest
319+ ~ [item ~]
320+ [next more] [item [separator (join separator rest)]]
269321
270322++ snip |= xs=(list A)
271− ?- xs
272− ~ ~
273− [item rest]
274− ?- rest
275− ~ ~
276− [next more] [item (snip rest)]
323+ ^- (list A)
324+ ?- xs
325+ ~ ~
326+ [item rest]
327+ ?- rest
328+ ~ ~
329+ [next more] [item (snip rest)]
277330
278331++ rear |= xs=(list A)
279332 ?- xs
@@ -282,3 +335,33 @@
282335 ?- rest
283336 ~ item
284337 [next more] (rear rest)
338+
339+++ cork |= gates=[$-(A B) $-(B C)]
340+ ?- gates
341+ [f g] |= x=A (g (f x))
342+
343+++ corl |= gates=[$-(B C) $-(A B)]
344+ ?- gates
345+ [f g] |= x=A (f (g x))
346+
347+++ cury |= args=[$-([A B] C) A]
348+ ?- args
349+ [f a] |= b=B (f a b)
350+
351+++ curr |= args=[$-([A B] C) B]
352+ ?- args
353+ [f b] |= a=A (f a b)
354+
355++$ cmd |$ [M]
356+ [%poke p=raw-poke reply=$-((unit @t) M)]
357+ [%go url=@t]
358+ [%wait gap=@dr msg=M]
359+ [%now reply=$-(@da M)]
360+ [%who reply=$-(@p M)]
361+
362+++ gth |= args=[A A] (gth-atom.internal args)
363+++ add |= args=[A A] (add-atom.internal args)
364+++ dec |= atom=A (dec-atom.internal atom)
365+
366++$ ask |$ [M] (ask.internal M)
367+++ pure |= x=M ^- (ask M) [%pure x]
tests/golden/prelude-unit-list-transforms/tokens.txt+2343−1694

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/tree.txt+1035−753

This diff is too big to show here.

tests/golden/prelude-unit-list-transforms/types.txt+25−8

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-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-face-inference/types.txt+7−1

This diff is too big to show here.

tests/golden/types-generic-gates/about.txt+1−1

This diff is too big to show here.

tests/golden/types-generic-gates/source.jibb+2

This diff is too big to show here.

tests/golden/types-generic-gates/tokens.txt+43−1

This diff is too big to show here.

tests/golden/types-generic-gates/tree.txt+18−1

This diff is too big to show here.

tests/golden/types-generic-gates/types.txt+2

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-errors/types.txt+3−3

This diff is too big to show here.

tests/golden/types-generic-union-escaping/module-trees.txt+4−4

This diff is too big to show here.

tests/golden/types-generic-union-escaping/modules/ui/mid.jibb+1−1

This diff is too big to show here.

tests/golden/types-generic-union-escaping/source.jibb+1−1

This diff is too big to show here.

tests/golden/types-generic-union-escaping/tokens.txt+1−1

This diff is too big to show here.

tests/golden/types-generic-union-escaping/tree.txt+1−1

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+16

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-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-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-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-patterns/about.txt+1−1

This diff is too big to show here.

tests/golden/types-list-patterns/types.txt+1−1

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-recursive/about.txt+1−1

This diff is too big to show here.

tests/golden/types-local-recursive/types.txt+1−1

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-multi-call/types.txt+1−1

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.txt+1−1

This diff is too big to show here.

tests/golden/types-null-context/source.jibb+1−1

This diff is too big to show here.

tests/golden/types-null-context/tokens.txt+8−8

This diff is too big to show here.

tests/golden/types-null-context/tree.txt+4−4

This diff is too big to show here.

tests/golden/types-null-context/types.txt+1−7

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-aura-family/source.jibb+1−1

This diff is too big to show here.

tests/golden/types-partial-aura-family/tokens.txt+8−8

This diff is too big to show here.

tests/golden/types-partial-aura-family/tree.txt+4−4

This diff is too big to show here.

tests/golden/types-partial-aura-family/types.txt+1−1

This diff is too big to show here.

tests/golden/types-partial-locals/source.jibb+2−2

This diff is too big to show here.

tests/golden/types-partial-locals/tokens.txt+10−10

This diff is too big to show here.

tests/golden/types-partial-locals/tree.txt+5−5

This diff is too big to show here.

tests/golden/types-partial-locals/types.txt+1−1

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-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.txt+1−1

This diff is too big to show here.

tests/golden/types-prelude-direct/source.jibb+1−1

This diff is too big to show here.

tests/golden/types-prelude-direct/tokens.txt+11−11

This diff is too big to show here.

tests/golden/types-prelude-direct/tree.txt+7−7

This diff is too big to show here.

tests/golden/types-prelude-direct/types.txt+1−1

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.txt+1−1

This diff is too big to show here.

tests/golden/types-prelude-interface/source.jibb+1−1

This diff is too big to show here.

tests/golden/types-prelude-interface/tokens.txt+11−11

This diff is too big to show here.

tests/golden/types-prelude-interface/tree.txt+7−7

This diff is too big to show here.

tests/golden/types-prelude-interface/types.txt+1−1

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.txt+1−1

This diff is too big to show here.

tests/golden/types-prelude-list-functions/module-trees.txt+7−1

This diff is too big to show here.

tests/golden/types-prelude-list-functions/modules/ui/lib.jibb+1

This diff is too big to show here.

tests/golden/types-prelude-list-functions/source.jibb+7

This diff is too big to show here.

tests/golden/types-prelude-list-functions/tokens.txt+102−3

This diff is too big to show here.

tests/golden/types-prelude-list-functions/tree.txt+48−1

This diff is too big to show here.

tests/golden/types-prelude-list-functions/types.txt+13

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+78

This diff is too big to show here.

tests/golden/types-prelude-ui/tokens.txtnew file+728

This diff is too big to show here.

tests/golden/types-prelude-ui/tree.txtnew file+300

This diff is too big to show here.

tests/golden/types-prelude-ui/types.txtnew file+85

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+31

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/tokens.txtnew file+427

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/tree.txtnew file+231

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/types.txtnew file+78

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-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-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-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-gate/about.txt+1−1

This diff is too big to show here.

tests/golden/types-recursive-gate/types.txt+2−2

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+3

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-branch-context/types.txt+4−4

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-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-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-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-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-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-tags/types.txt+3−3

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.txt+2−2

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.jibb+44−68

This diff is too big to show here.

tests/golden/types-unit-context/tokens.txt+458−343

This diff is too big to show here.

tests/golden/types-unit-context/tree.txt+218−180

This diff is too big to show here.

tests/golden/types-unit-context/types.txt+90−22

This diff is too big to show here.

tests/golden/types-unit-patterns/types.txt+4−1

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.txt+37−1

This diff is too big to show here.

tests/importer/shadow-static.txt+6

This diff is too big to show here.

tests/importer/shadow.txt+3

This diff is too big to show here.

tests/importer/small.txt+82

This diff is too big to show here.

tests/importer/tree.txt+75−3

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.hoon+97−2

This diff is too big to show here.

tests/lib/jibb-buttons.hoonnew file+81

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-doc-examples.hoonnew file+166

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+143

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.hoon+6−3

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-list-alias-guards.hoonnew file+27

This diff is too big to show here.

tests/lib/jibb-module-scope.hoon+52−3

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-page-main.hoonnew file+168

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+140

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+140

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-store.hoonnew file+285

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-theme.hoonnew file+86

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-full.hoonnew file+157

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-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+1592−662

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+14

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-buttons/error.txtnew file+3

This diff is too big to show here.

tests/type-buttons/expected.txtnew file+2

This diff is too big to show here.

tests/type-buttons/valid.txtnew file+4

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.txt+5−3

This diff is too big to show here.

tests/type-import-diagnostic/expected.txt+38−2

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-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.txt+23−4

This diff is too big to show here.

tests/type-import/expected.txt+67−9

This diff is too big to show here.

tests/type-import/source.txt+26

This diff is too big to show here.

tests/type-import/sur.txt+6

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-module-scope/expected.txt+18

This diff is too big to show here.

tests/type-page-main/about.txtnew file+3

This diff is too big to show here.

tests/type-page-main/arbitrary-main.txtnew file+1

This diff is too big to show here.

tests/type-page-main/blog-api.txtnew file+5

This diff is too big to show here.

tests/type-page-main/blog-index.txtnew file+9

This diff is too big to show here.

tests/type-page-main/blog-sur.txtnew file+6

This diff is too big to show here.

tests/type-page-main/card.txtnew file+5

This diff is too big to show here.

tests/type-page-main/ctor-page.txtnew file+10

This diff is too big to show here.

tests/type-page-main/diff-load.txtnew file+11

This diff is too big to show here.

tests/type-page-main/hand-built-load.txtnew file+14

This diff is too big to show here.

tests/type-page-main/index.txtnew file+10

This diff is too big to show here.

tests/type-page-main/indirect-load.txtnew file+11

This diff is too big to show here.

tests/type-page-main/page-alias.txtnew file+11

This diff is too big to show here.

tests/type-page-main/posts-mark.txtnew file+6

This diff is too big to show here.

tests/type-page-main/pure-load.txtnew file+10

This diff is too big to show here.

tests/type-page-main/static.txtnew file+7

This diff is too big to show here.

tests/type-page-main/todo-api.txtnew file+13

This diff is too big to show here.

tests/type-page-main/todo-island.txtnew file+40

This diff is too big to show here.

tests/type-page-main/typed-load.txtnew file+8

This diff is too big to show here.

tests/type-page-main/wrong-static.txtnew file+1

This diff is too big to show here.

tests/type-poke/about.txtnew file+7

This diff is too big to show here.

tests/type-poke/alias.txtnew file+2

This diff is too big to show here.

tests/type-poke/api.txtnew file+2

This diff is too big to show here.

tests/type-poke/client.txtnew file+23

This diff is too big to show here.

tests/type-poke/direct.txtnew file+2

This diff is too big to show here.

tests/type-poke/expected.txtnew file+66

This diff is too big to show here.

tests/type-poke/exported.txtnew file+9

This diff is too big to show here.

tests/type-poke/fake.txtnew file+4

This diff is too big to show here.

tests/type-poke/impostor-client.txtnew file+2

This diff is too big to show here.

tests/type-poke/impostor.txtnew file+1

This diff is too big to show here.

tests/type-poke/inner.txtnew file+2

This diff is too big to show here.

tests/type-poke/mark.txtnew file+5

This diff is too big to show here.

tests/type-poke/public.txtnew file+2

This diff is too big to show here.

tests/type-poke/transitive.txtnew file+2

This diff is too big to show here.

tests/type-program-main/about.txtnew file+1

This diff is too big to show here.

tests/type-program-main/alias-main.txtnew file+11

This diff is too big to show here.

tests/type-program-main/arbitrary-main.txtnew file+10

This diff is too big to show here.

tests/type-program-main/consumer.txtnew file+2

This diff is too big to show here.

tests/type-program-main/gate-data.txtnew file+10

This diff is too big to show here.

tests/type-program-main/gate-model.txtnew file+11

This diff is too big to show here.

tests/type-program-main/initializer-consumer.txtnew file+2

This diff is too big to show here.

tests/type-program-main/initializer-earlier.txtnew file+10

This diff is too big to show here.

tests/type-program-main/initializer-error.txtnew file+10

This diff is too big to show here.

tests/type-program-main/initializer-generic.txtnew file+10

This diff is too big to show here.

tests/type-program-main/initializer-message.txtnew file+13

This diff is too big to show here.

tests/type-program-main/initializer-missing.txtnew file+9

This diff is too big to show here.

tests/type-program-main/initializer-model.txtnew file+11

This diff is too big to show here.

tests/type-program-main/initializer-no-main.txtnew file+10

This diff is too big to show here.

tests/type-program-main/initializer-subs.txtnew file+10

This diff is too big to show here.

tests/type-program-main/initializer-tag.txtnew file+13

This diff is too big to show here.

tests/type-program-main/initializer-unfaced.txtnew file+10

This diff is too big to show here.

tests/type-program-main/initializer.txtnew file+12

This diff is too big to show here.

tests/type-program-main/mismatched-model.txtnew file+10

This diff is too big to show here.

tests/type-program-main/nonempty-subs.txtnew file+12

This diff is too big to show here.

tests/type-program-main/open-message.txtnew file+7

This diff is too big to show here.

tests/type-program-main/source.txtnew file+12

This diff is too big to show here.

tests/type-program-update/consumer.txtnew file+2

This diff is too big to show here.

tests/type-program-update/malformed-sample.txtnew file+9

This diff is too big to show here.

tests/type-program-update/missing-list.txtnew file+15

This diff is too big to show here.

tests/type-program-update/non-main.txtnew file+14

This diff is too big to show here.

tests/type-program-update/source.txtnew file+15

This diff is too big to show here.

tests/type-program-update/three-slot-sample.txtnew file+9

This diff is too big to show here.

tests/type-program-update/unrelated-tag.txtnew file+16

This diff is too big to show here.

tests/type-program-update/wrong-message.txtnew file+10

This diff is too big to show here.

tests/type-program-update/wrong-model.txtnew file+12

This diff is too big to show here.

tests/type-program-update/wrong-result.txtnew file+12

This diff is too big to show here.

tests/type-program-watch/about.txtnew file+1

This diff is too big to show here.

tests/type-store/basket.txtnew file+32

This diff is too big to show here.

tests/type-store/cart.txtnew file+12

This diff is too big to show here.

tests/type-theme/dark-absent.txtnew file+8

This diff is too big to show here.

tests/type-theme/missing-field.txtnew file+7

This diff is too big to show here.

tests/type-theme/source.txtnew file+8

This diff is too big to show here.

tests/type-theme/wrong-dark.txtnew file+8

This diff is too big to show here.

tests/type-theme/wrong-font.txtnew file+8

This diff is too big to show here.

tests/type-theme/wrong-nested-aura.txtnew file+8

This diff is too big to show here.

tests/type-tlon/about.txtnew file+6

This diff is too big to show here.

tests/type-tlon/expected.txtnew file+6

This diff is too big to show here.

tests/type-tlon/source.txtnew file+6

This diff is too big to show here.

tests/type-todo-api/about.txtnew file+1

This diff is too big to show here.

tests/type-todo-api/expected.txtnew file+17

This diff is too big to show here.

tests/type-todo-api/negative-expected.txtnew file+26

This diff is too big to show here.

tests/type-todo-api/negative.txtnew file+12

This diff is too big to show here.

tests/type-todo-api/source.txtnew file+21

This diff is too big to show here.

tests/type-todo-api/unsupported.txtnew file+13

This diff is too big to show here.

tests/type-todo-full/about.txtnew file+3

This diff is too big to show here.

tests/type-todo-full/alias.txtnew file+42

This diff is too big to show here.

tests/type-todo-full/ambiguous-mapper.txtnew file+41

This diff is too big to show here.

tests/type-todo-full/expected.txtnew file+2

This diff is too big to show here.

tests/type-todo-full/non-gate-view.txtnew file+33

This diff is too big to show here.

tests/type-todo-full/open-key.txtnew file+40

This diff is too big to show here.

tests/type-todo-full/wrong-message.txtnew file+40

This diff is too big to show here.

tests/type-todo-full/wrong-model.txtnew file+40

This diff is too big to show here.

tests/type-todo-full/wrong-result.txtnew file+40

This diff is too big to show here.

tests/type-todo-full/wrong-watch.txtnew file+40

This diff is too big to show here.

tests/type-todo-partial/about.txtnew file+4

This diff is too big to show here.

tests/type-todo-partial/expected.txtnew file+17

This diff is too big to show here.

tests/type-union-alias-overlap/duplicate.txtnew file+5

This diff is too big to show here.

tests/type-union-alias-overlap/expected.txtnew file+25

This diff is too big to show here.

tests/type-union-alias-overlap/flag-source.txtnew file+7

This diff is too big to show here.

tests/type-union-alias-overlap/multi.txtnew file+5

This diff is too big to show here.

tests/type-union-alias-overlap/negative.txtnew file+16

This diff is too big to show here.

tests/type-union-alias-overlap/nonzero.txtnew file+4

This diff is too big to show here.

tests/type-union-alias-overlap/opaque.txtnew file+4

This diff is too big to show here.

tests/type-union-alias-overlap/positive.txtnew file+8

This diff is too big to show here.

tests/type-union-alias-overlap/qualified.txtnew file+5

This diff is too big to show here.

tests/type-union-alias-overlap/wrong.txtnew file+5

This diff is too big to show here.

tests/type-union-source/direct-source.txtnew file+3

This diff is too big to show here.

tests/type-union-source/duplicate-params.txtnew file+4

This diff is too big to show here.

tests/type-union-source/duplicate.txtnew file+5

This diff is too big to show here.

tests/type-union-source/expected.txtnew file+36

This diff is too big to show here.

tests/type-union-source/free-source.txtnew file+4

This diff is too big to show here.

tests/type-union-source/good.txtnew file+9

This diff is too big to show here.

tests/type-union-source/hidden-ref.txtnew file+5

This diff is too big to show here.

tests/type-union-source/late-source.txtnew file+4

This diff is too big to show here.

tests/type-union-source/mixed-source.txtnew file+8

This diff is too big to show here.

tests/type-union-source/nested.txtnew file+4

This diff is too big to show here.

tests/type-union-source/qualified.txtnew file+4

This diff is too big to show here.

tests/type-union-source/same.txtnew file+5

This diff is too big to show here.

tests/type-union-source/shadow-source.txtnew file+7

This diff is too big to show here.

tests/type-union-source/wide-source.txtnew file+4

This diff is too big to show here.

tests/type-union-source/wrong.txtnew file+5

This diff is too big to show here.

tests/type-union-source/zero.txtnew file+5

This diff is too big to show here.

tools/clay-fixtures+56

This diff is too big to show here.

tools/golden+12−2

This diff is too big to show here.

tools/importer-test+1−1

This diff is too big to show here.

tools/ship+46−8

This diff is too big to show here.

tools/testdata/clay-fixtures-selftestnew file+109

This diff is too big to show here.

tools/testdata/lead-late-hoon-reference.hoonnew file+24

This diff is too big to show here.

tools/testdata/selftest+10−10

This diff is too big to show here.

tools/testdata/ship-selftest+221−3

This diff is too big to show here.

tools/testdata/succ-hoon-reference.hoonnew file+9

This diff is too big to show here.

tools/testdata/zing-hoon-reference.hoonnew file+17

This diff is too big to show here.

tools/type-api-evidence-testnew file+40

This diff is too big to show here.

tools/type-api-paths-testnew file+52

This diff is too big to show here.

tools/type-arithmetic-guards-testnew file+28

This diff is too big to show here.

tools/type-ask-guards-testnew file+31

This diff is too big to show here.

tools/type-buttons-testnew file+40

This diff is too big to show here.

tools/type-cell-branch-testnew file+43

This diff is too big to show here.

tools/type-closed-gate-guards-testnew file+29

This diff is too big to show here.

tools/type-constructor-fit-guards-testnew file+29

This diff is too big to show here.

tools/type-deferred-context-testnew file+31

This diff is too big to show here.

tools/type-deferred-prepared-testnew file+49

This diff is too big to show here.

tools/type-deferred-resolver-testnew file+33

This diff is too big to show here.

tools/type-deferred-testnew file+32

This diff is too big to show here.

tools/type-direct-gate-testnew file+64

This diff is too big to show here.

tools/type-doc-examples-testnew file+49

This diff is too big to show here.

tools/type-empty-testnew file+55

This diff is too big to show here.

tools/type-full-overlap-testnew file+49

This diff is too big to show here.

tools/type-gate-free-guards-testnew file+29

This diff is too big to show here.

tools/type-gate-free-source-testnew file+50

This diff is too big to show here.

tools/type-generic-alias-testnew file+28

This diff is too big to show here.

tools/type-generic-construction-testnew file+49

This diff is too big to show here.

tools/type-generic-pattern-testnew file+52

This diff is too big to show here.

tools/type-generic-recursion-testnew file+61

This diff is too big to show here.

tools/type-hole-guards-testnew file+32

This diff is too big to show here.

tools/type-import-default-testnew file+38

This diff is too big to show here.

tools/type-import-diagnostic-test+3−1

This diff is too big to show here.

tools/type-import-overlap-testnew file+33

This diff is too big to show here.

tools/type-import-structural-testnew file+36

This diff is too big to show here.

tools/type-list-alias-testnew file+33

This diff is too big to show here.

tools/type-module-scope-test+2−1

This diff is too big to show here.

tools/type-nested-union-guards-testnew file+29

This diff is too big to show here.

tools/type-page-main-testnew file+86

This diff is too big to show here.

tools/type-poke-testnew file+50

This diff is too big to show here.

tools/type-positional-face-guards-testnew file+29

This diff is too big to show here.

tools/type-program-init-testnew file+49

This diff is too big to show here.

tools/type-program-main-testnew file+46

This diff is too big to show here.

tools/type-program-update-testnew file+46

This diff is too big to show here.

tools/type-program-watch-testnew file+48

This diff is too big to show here.

tools/type-proj-guards-testnew file+32

This diff is too big to show here.

tools/type-qath-guards-testnew file+31

This diff is too big to show here.

tools/type-request-guards-testnew file+31

This diff is too big to show here.

tools/type-store-testnew file+41

This diff is too big to show here.

tools/type-sub-guards-testnew file+31

This diff is too big to show here.

tools/type-theme-testnew file+44

This diff is too big to show here.

tools/type-tlon-testnew file+39

This diff is too big to show here.

tools/type-todo-api-testnew file+62

This diff is too big to show here.

tools/type-todo-full-testnew file+98

This diff is too big to show here.

tools/type-todo-partial-testnew file+55

This diff is too big to show here.

tools/type-union-alias-overlap-testnew file+52

This diff is too big to show here.

tools/type-union-source-testnew file+55

This diff is too big to show here.