on master help sign in
Fix checker regressions from the repository review
a211c34iko
docs/compiler.md+7−1
@@ -72,12 +72,16 @@ A single-arm cell pattern can bind two or more positions, with its last binder c
72
72
73String 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.
73String 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
74
75+The Hoon bridge translates imported `(unit T)` to the canonical public `unit` union when the prepared template validates as the standard mold. Without that template it retains the older opaque collection behavior. Conversion recurses through imported unions and collection arguments, and API path/diff/poke analysis uses the same prepared reader. The fixtures prove identity, `fall`, `need`, casts, union- and list-nested `need`, canonical unit-typed API full/diff marks, and a canonical direct-poke export while leaving no-prelude output unchanged.
76+
75The 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.
77The 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
78
77A 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.
79A 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
80
79A 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.
81A change can replace uniquely named fields on a fully known, faced record spine, including through a nested wing. Replacements receive the field type as context, substitutions and pending constraints are retained, and the resulting type remains the original record. Missing fields, empty changes and definite replacement mismatches report sites; the expected-type site is the edit, since the original field declaration location is not retained. Unknown or partly unfaced spines, ambiguous fields and repeated edits remain unsupported. A cast to a known record also supplies field context to a tuple or record initializer, including nested list and union fields. The expected-type site is the cast mold; the original field declaration location is not retained. Isolated cart-style `init` and `update` expressions infer in this fragment. The complete cart-store source fails closed because store kind and declaration scope are not yet checked.
80
82
83+Nested labels of the three public re-exports are normalized recursively to `ask`, `qath` and `raw-poke`, so prepared records and instantiated types do not expose their private `.internal` suffixes. Other private names remain private.
84+
81For 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.
85For supported closed unions, the type printer keeps the union’s origin separate from its displayed name. It prints an in-scope name such as `msg` or `msg.lib`, including in records and gates; an accessible imported nongeneric alias may name a transitive union. A nongeneric body-local union that escapes its scope, or an origin without an accessible name, prints its cases separated by spaces, parenthesized when nested. That case-list form is print-only. A supported generic union prints its name and all arguments, including unused arguments; when its name is unavailable, the partial printer reports that limitation instead of dropping its arguments. Two faces for the same imported origin remain compatible; compatibility between distinct union origins, including in gate types, remains unsupported. Some comparisons of generic union arguments also remain unsupported rather than deciding equality or mismatch. The Hoon bridge also translates some imported unnamed unions into this representation; unsupported cases remain errors.
82
86
83Multi-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.
87Multi-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.
@@ -140,7 +144,9 @@ The store interface adds a derived `$-([action $-((unit @t) M)] (cmd M))` poke h
140
144
141When 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.
145When 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
146
147+Ordinary inference runs for every component before recovery, so a keyed view no longer causes an already-valid initializer to be skipped. Recovery is a fallback for unresolved components, not a replacement for definitions that check normally. The regression uses a call-bodied annotated initializer, which is outside the tuple-bodied initializer recovery shape.
148+
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.
149+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. 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
150
145Canonical `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.
151Canonical `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
152
docs/development.md+1−1
@@ -111,7 +111,7 @@ git clone https://github.com/urbit/tools /root/src/tools
111| `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 |
111| `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 |
112| `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 |
112| `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 |
113| `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 |
113| `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 |
114−| `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 |
114+| `tools/type-todo-full-test` | Fully checks the byte-identical todo island and an ordinary call-bodied annotated-initializer variant through real readers, exact main types, structural downstream import and rejection controls under eval and on the ship |
115| `tools/type-closed-gate-guards-test` | Checks closed gate sample labels and face uncertainty under eval and on the ship |
115| `tools/type-closed-gate-guards-test` | Checks closed gate sample labels and face uncertainty under eval and on the ship |
116| `tools/type-constructor-fit-guards-test` | Checks constructor-case uncertainty and known mismatches under eval and on the ship |
116| `tools/type-constructor-fit-guards-test` | Checks constructor-case uncertainty and known mismatches under eval and on the ship |
117| `tools/type-nested-union-guards-test` | Checks nested tagged-union case selection and uncertainty under eval and on the ship |
117| `tools/type-nested-union-guards-test` | Checks nested tagged-union case selection and uncertainty under eval and on the ship |
docs/status.md+5−1
@@ -57,7 +57,11 @@ Static and direct data-page `main` checking now completes the unchanged about pa
57
57
58The 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.
58The 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
59
60+Keyed programs no longer skip ordinary component inference: an annotated initializer that checks normally is accepted, with recovery reserved for definitions that still need it. The todo fixture checks a call-bodied annotated initializer outside the tuple recovery shape through detailed and legacy inference, including on the ship.
61+
62+Imported Hoon `(unit T)` now converts to the validated canonical prelude `unit` when that template is supplied, instead of remaining an incompatible collection. Conversion recurses through imported unions and collections, and API path/diff/poke analysis uses the same prepared reader. The fixtures prove identity, `fall`, `need`, `(unit @t)` casts, union- and list-nested matching, canonical unit-typed API full/diff marks and a canonical direct-poke export while preserving the no-prelude compatibility report and wrong-collection rejection. Nested public re-export labels also remain `ask`, `qath` and `raw-poke` instead of leaking their private `.internal` suffixes into printed types.
63+
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.
64+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; 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
65
62The 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.
66The 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
67
jibb-dev/lib/jibb.hoon+93−84
@@ -6449,6 +6449,11 @@
6449++ import-to-itype
6449++ import-to-itype
6450 |= node=*
6450 |= node=*
6451 ^- (unit itype)
6451 ^- (unit itype)
6452+ (import-to-itype-standard node ~)
6453+::
6454+++ import-to-itype-standard
6455+ |= [node=* standard=(unit ischeme)]
6456+ ^- (unit itype)
6452 ?@ node ~
6457 ?@ node ~
6453 ?+ -.node ~
6458 ?+ -.node ~
6454 %noun ?:(=(node [%noun ~]) `[%noun ~] ~)
6459 %noun ?:(=(node [%noun ~]) `[%noun ~] ~)
@@ -6490,18 +6495,24 @@
6490 ?: |(=(%map name) =(%mop name) =(%jar name) =(%jug name)) 2
6495 ?: |(=(%map name) =(%mop name) =(%jar name) =(%jug name)) 2
6491 0
6496 0
6492 ?: =(arity 0) ~
6497 ?: =(arity 0) ~
6493− =/ args=(unit (list itype)) (import-to-itypes +>.node)
6498+ =/ args=(unit (list itype)) (import-to-itypes-standard +>.node standard)
6494 ?~ args ~
6499 ?~ args ~
6495 ?. =(arity (lent u.args)) ~
6500 ?. =(arity (lent u.args)) ~
6496 =/ keyed=(unit [types=(list itype) sub=isub]) (itype-collection-keys name u.args ~)
6501 =/ keyed=(unit [types=(list itype) sub=isub]) (itype-collection-keys name u.args ~)
6497 ?~ keyed ~
6502 ?~ keyed ~
6503+ ?: =(%unit name)
6504+ ?. ?=([* ~] types.u.keyed) ~
6505+ ?~ standard `[%collection name types.u.keyed]
6506+ ?. (standard-unit-template u.standard /lib/jibb/prelude/jibb) ~
6507+ =/ nil=itype [%const [%null %n 0 '~']]
6508+ `[%union ~[nil [%cell nil [%face %u i.types.u.keyed]]] `[/lib/jibb/prelude/jibb %unit] `%unit types.u.keyed]
6498 `[%collection name types.u.keyed]
6509 `[%collection name types.u.keyed]
6499 %fork
6510 %fork
6500 :: Hoon's ordinary ? mold is the fork of its two %f singletons.
6511 :: Hoon's ordinary ? mold is the fork of its two %f singletons.
6501 =/ raw=* +.node
6512 =/ raw=* +.node
6502 ?: |(=(raw ~[[%atom %f `0] [%atom %f `1]]) =(raw ~[[%atom %f `1] [%atom %f `0]]))
6513 ?: |(=(raw ~[[%atom %f `0] [%atom %f `1]]) =(raw ~[[%atom %f `1] [%atom %f `0]]))
6503 `[%flag ~]
6514 `[%flag ~]
6504− =/ cases=(unit (list itype)) (import-to-itypes raw)
6515+ =/ cases=(unit (list itype)) (import-to-itypes-standard raw standard)
6505 ?~ cases ~
6516 ?~ cases ~
6506 ?~ u.cases ~
6517 ?~ u.cases ~
6507 ?~ t.u.cases ~
6518 ?~ t.u.cases ~
@@ -6541,10 +6552,15 @@
6541++ import-to-itypes
6552++ import-to-itypes
6542 |= nodes=*
6553 |= nodes=*
6543 ^- (unit (list itype))
6554 ^- (unit (list itype))
6555+ (import-to-itypes-standard nodes ~)
6556+::
6557+++ import-to-itypes-standard
6558+ |= [nodes=* standard=(unit ischeme)]
6559+ ^- (unit (list itype))
6544 ?@ nodes ?:(=(nodes 0) `~ ~)
6560 ?@ nodes ?:(=(nodes 0) `~ ~)
6545− =/ first (import-to-itype -.nodes)
6561+ =/ first (import-to-itype-standard -.nodes standard)
6546 ?~ first ~
6562 ?~ first ~
6547− =/ rest $(nodes +.nodes)
6563+ =/ rest $(nodes +.nodes, standard standard)
6548 ?~ rest ~
6564 ?~ rest ~
6549 `[u.first u.rest]
6565 `[u.first u.rest]
6550::
6566::
@@ -6571,9 +6587,10 @@
6571 ?. (levy t.cases |=(t=itype =(%disjoint (union-relate first (import-type-pattern t))))) |
6587 ?. (levy t.cases |=(t=itype =(%disjoint (union-relate first (import-type-pattern t))))) |
6572 $(cases t.cases)
6588 $(cases t.cases)
6573::
6589::
6574−++ find-imported-mold
6590+++ find-imported-mold-prelude
6575− |= [module=term name=term externals=iexternals surs=(list term)]
6591+ |= [module=term name=term externals=iexternals surs=(list term) prelude=ifile]
6576 ^- (unit itype)
6592 ^- (unit itype)
6593+ =/ standard=(unit ischeme) (find-jibb-mold %unit prelude)
6577 ?. (lien surs |=(n=term =(n module))) ~
6594 ?. (lien surs |=(n=term =(n module))) ~
6578 =/ found=iexternals
6595 =/ found=iexternals
6579 (skim externals |=(e=[module=term name=term result=*] &(=(module module.e) =(name name.e))))
6596 (skim externals |=(e=[module=term name=term result=*] &(=(module module.e) =(name name.e))))
@@ -6584,13 +6601,17 @@
6584 ?. ?=(%& -.result) ~
6601 ?. ?=(%& -.result) ~
6585 =/ node=* +.result
6602 =/ node=* +.result
6586 ?. (imported-faces-valid node) ~
6603 ?. (imported-faces-valid node) ~
6587− ?@ node (import-to-itype node)
6604+ ?@ node (import-to-itype-standard node standard)
6588− ?: ?=(%ref -.node) (import-to-itype node)
6605+ ?: ?=(%ref -.node) (import-to-itype-standard node standard)
6589 =/ pattern=(unit irec-pattern) (rec-pattern node module name)
6606 =/ pattern=(unit irec-pattern) (rec-pattern node module name)
6590− ?~ pattern (import-to-itype node)
6607+ ?~ pattern (import-to-itype-standard node standard)
6591− ?. has.u.pattern (import-to-itype node)
6608+ ?. has.u.pattern (import-to-itype-standard node standard)
6592 `[%recursive module name `(crip "{(trip name)}.{(trip module)}")]
6609 `[%recursive module name `(crip "{(trip name)}.{(trip module)}")]
6593−
6610+::
6611+++ find-imported-mold
6612+ |= [module=term name=term externals=iexternals surs=(list term)]
6613+ ^- (unit itype)
6614+ (find-imported-mold-prelude module name externals surs *ifile)
6594::
6615::
6595++ collect-sur-imports
6616++ collect-sur-imports
6596 |= imports=(list import)
6617 |= imports=(list import)
@@ -6608,9 +6629,10 @@
6608 [mark.i.imports $(imports t.imports)]
6629 [mark.i.imports $(imports t.imports)]
6609 $(imports t.imports)
6630 $(imports t.imports)
6610::
6631::
6611−++ find-imported-mark
6632+++ find-imported-mark-prelude
6612− |= [name=term externals=imark-externals marks=(list term)]
6633+ |= [name=term externals=imark-externals marks=(list term) prelude=ifile]
6613 ^- (unit itype)
6634 ^- (unit itype)
6635+ =/ standard=(unit ischeme) (find-jibb-mold %unit prelude)
6614 ?. (unique-value-name name marks) ~
6636 ?. (unique-value-name name marks) ~
6615 =/ found=imark-externals
6637 =/ found=imark-externals
6616 (skim externals |=(e=[mark=term result=*] =(name mark.e)))
6638 (skim externals |=(e=[mark=term result=*] =(name mark.e)))
@@ -6620,7 +6642,12 @@
6620 ?@ result ~
6642 ?@ result ~
6621 ?. ?=(%& -.result) ~
6643 ?. ?=(%& -.result) ~
6622 ?. (imported-faces-valid +.result) ~
6644 ?. (imported-faces-valid +.result) ~
6623− (import-to-itype +.result)
6645+ (import-to-itype-standard +.result standard)
6646+::
6647+++ find-imported-mark
6648+ |= [name=term externals=imark-externals marks=(list term)]
6649+ ^- (unit itype)
6650+ (find-imported-mark-prelude name externals marks *ifile)
6624::
6651::
6625++ find-jibb-interface
6652++ find-jibb-interface
6626 |= [face=term imports=ijimports]
6653 |= [face=term imports=ijimports]
@@ -7035,12 +7062,12 @@
7035 ?^ vars.u.found ~
7062 ?^ vars.u.found ~
7036 `[(itype-in-import typ.u.found u.iface i.t.names.sh prelude.state) state]
7063 `[(itype-in-import typ.u.found u.iface i.t.names.sh prelude.state) state]
7037 =/ found=(unit itype)
7064 =/ found=(unit itype)
7038− (find-imported-mold i.t.names.sh n externals.state surs.state)
7065+ (find-imported-mold-prelude i.t.names.sh n externals.state surs.state ?~(prelude.state *ifile u.prelude.state))
7039 ?~ found ~
7066 ?~ found ~
7040 `[u.found state]
7067 `[u.found state]
7041 ?: (lien marks.state |=(x=term =(x n)))
7068 ?: (lien marks.state |=(x=term =(x n)))
7042 ?^ (find-simple-mold n molds.state) ~
7069 ?^ (find-simple-mold n molds.state) ~
7043− =/ imported=(unit itype) (find-imported-mark n mark-externals.state marks.state)
7070+ =/ imported=(unit itype) (find-imported-mark-prelude n mark-externals.state marks.state ?~(prelude.state *ifile u.prelude.state))
7044 ?~ imported ~
7071 ?~ imported ~
7045 `[u.imported state]
7072 `[u.imported state]
7046 ?: (lien active.state |=(x=term =(x n))) ~
7073 ?: (lien active.state |=(x=term =(x n))) ~
@@ -10325,11 +10352,6 @@
10325 =. entry entry(source src, target dst)
10352 =. entry entry(source src, target dst)
10326 `[entry u.rest]
10353 `[entry u.rest]
10327::
10354::
10328−++ add-supported-defs
10329− |= [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)]
10330− ^- [env=ienv artifacts=(list iwidth-definition)]
10331− (add-supported-defs-core ds all-defs checked heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts ~)
10332−::
10333
10355
10334+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
10356+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
10335+$ iadj (map term (list term))
10357+$ iadj (map term (list term))
@@ -10471,12 +10493,11 @@
10471 =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
10493 =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
10472 `[[[name.d [typ vars]] env] checked artifacts]
10494 `[[[name.d [typ vars]] env] checked artifacts]
10473++ add-supported-defs-core
10495++ add-supported-defs-core
10474− |= [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)])]
10496+ |= [ds=(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)])]
10475 ^- [env=ienv artifacts=(list iwidth-definition)]
10497 ^- [env=ienv artifacts=(list iwidth-definition)]
10476 ?~ ds [env artifacts]
10498 ?~ ds [env artifacts]
10477 =/ d=def i.ds
10499 =/ d=def i.ds
10478 ?: ?=(%mold -.d) $(ds t.ds)
10500 ?: ?=(%mold -.d) $(ds t.ds)
10479− ?: (lien (program-recovery-names all-defs) |=(n=term =(n name.d))) $(ds t.ds)
10480 ?. (unique-value-name name.d globals) $(ds t.ds)
10501 ?. (unique-value-name name.d globals) $(ds t.ds)
10481 ?^ (ienv-lookup name.d env) $(ds t.ds)
10502 ?^ (ienv-lookup name.d env) $(ds t.ds)
10482 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10503 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
@@ -10531,7 +10552,7 @@
10531 =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
10552 =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
10532 |-
10553 |-
10533 =/ next=[env=ienv artifacts=(list iwidth-definition)]
10554 =/ next=[env=ienv artifacts=(list iwidth-definition)]
10534− (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)
10555+ (add-supported-defs-core ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts index)
10535 =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10556 =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10536 =. grec-index.initial index
10557 =. grec-index.initial index
10537 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
10558 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
@@ -11615,9 +11636,38 @@
11615 ?. ?=(%tvar -.i.args.tail) |
11636 ?. ?=(%tvar -.i.args.tail) |
11616 =(var name.i.args.tail)
11637 =(var name.i.args.tail)
11617::
11638::
11639+++ prelude-public-label
11640+ |= label=@t
11641+ ^- (unit @t)
11642+ ?: =(label 'ask.internal') `'ask'
11643+ ?: =(label 'qath.internal') `'qath'
11644+ ?: =(label 'raw-poke.internal') `'raw-poke'
11645+ `label
11646+::
11647+++ prelude-label-nested
11648+ |= typ=itype
11649+ ^- itype
11650+ ?- -.typ
11651+ %union
11652+ =/ label=(unit @t) ?~(label.typ ~ (prelude-public-label u.label.typ))
11653+ [%union (turn cases.typ |=(c=itype (prelude-label-nested c))) origin.typ label (turn args.typ |=(c=itype (prelude-label-nested c)))]
11654+ %grec
11655+ =/ label=(unit @t) ?~(label.typ ~ (prelude-public-label u.label.typ))
11656+ typ(label label, args (turn args.typ |=(c=itype (prelude-label-nested c))))
11657+ %jrec
11658+ =/ label=(unit @t) ?~(label.typ ~ (prelude-public-label u.label.typ))
11659+ typ(label label)
11660+ %collection [%collection name.typ (turn args.typ |=(c=itype (prelude-label-nested c)))]
11661+ %face [%face name.typ $(typ body.typ)]
11662+ %fn [%fn $(typ sample.typ) $(typ product.typ)]
11663+ %cell [%cell $(typ hed.typ) $(typ tal.typ)]
11664+ * typ
11665+ ==
11666+::
11618++ prelude-label
11667++ prelude-label
11619 |= [typ=itype name=term vars=(list @ud)]
11668 |= [typ=itype name=term vars=(list @ud)]
11620 ^- itype
11669 ^- itype
11670+ =. typ (prelude-label-nested typ)
11621 ?: ?=(%jrec -.typ) typ(label `name)
11671 ?: ?=(%jrec -.typ) typ(label `name)
11622 ?: ?=(%grec -.typ)
11672 ?: ?=(%grec -.typ)
11623 ?. (identity-union-parameters vars args.typ) typ(label ~)
11673 ?. (identity-union-parameters vars args.typ) typ(label ~)
@@ -12113,22 +12163,22 @@
12113+$ iapi-mark-type [name=term typ=itype]
12163+$ iapi-mark-type [name=term typ=itype]
12114+$ iapi-path-typed [path=iapi-path full=itype diffs=(list iapi-mark-type)]
12164+$ iapi-path-typed [path=iapi-path full=itype diffs=(list iapi-mark-type)]
12115++ api-diff-types
12165++ api-diff-types
12116− |= [names=(list term) externals=imark-externals declared=(list term)]
12166+ |= [names=(list term) externals=imark-externals declared=(list term) prelude=ifile]
12117 ^- (unit (list iapi-mark-type))
12167 ^- (unit (list iapi-mark-type))
12118 ?~ names `~
12168 ?~ names `~
12119− =/ typ=(unit itype) (find-imported-mark i.names externals declared)
12169+ =/ typ=(unit itype) (find-imported-mark-prelude i.names externals declared prelude)
12120 ?~ typ ~
12170 ?~ typ ~
12121 =/ tail=(unit (list iapi-mark-type)) $(names t.names)
12171 =/ tail=(unit (list iapi-mark-type)) $(names t.names)
12122 ?~ tail ~
12172 ?~ tail ~
12123 `[[i.names u.typ] u.tail]
12173 `[[i.names u.typ] u.tail]
12124::
12174::
12125++ api-path-types
12175++ api-path-types
12126− |= [paths=(list iapi-path) externals=imark-externals declared=(list term)]
12176+ |= [paths=(list iapi-path) externals=imark-externals declared=(list term) prelude=ifile]
12127 ^- (unit (list iapi-path-typed))
12177 ^- (unit (list iapi-path-typed))
12128 ?~ paths `~
12178 ?~ paths `~
12129− =/ full=(unit itype) (find-imported-mark full.i.paths externals declared)
12179+ =/ full=(unit itype) (find-imported-mark-prelude full.i.paths externals declared prelude)
12130 ?~ full ~
12180 ?~ full ~
12131− =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared)
12181+ =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared prelude)
12132 ?~ diffs ~
12182 ?~ diffs ~
12133 =/ tail=(unit (list iapi-path-typed)) $(paths t.paths)
12183 =/ tail=(unit (list iapi-path-typed)) $(paths t.paths)
12134 ?~ tail ~
12184 ?~ tail ~
@@ -12148,7 +12198,7 @@
12148 `~[u.name]
12198 `~[u.name]
12149::
12199::
12150++ api-path-analysis
12200++ api-path-analysis
12151− |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term)]
12201+ |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term) prelude=ifile]
12152 ^- (unit (list iapi-path-typed))
12202 ^- (unit (list iapi-path-typed))
12153 ?: (lien defs.mod def-has-hole) ~
12203 ?: (lien defs.mod def-has-hole) ~
12154 ?^ (duplicate-defs defs.mod) ~
12204 ?^ (duplicate-defs defs.mod) ~
@@ -12171,7 +12221,7 @@
12171 ?~ paths ~
12221 ?~ paths ~
12172 =/ derived-pokes=(list term) ?~(pokes ~ ~[%poke])
12222 =/ derived-pokes=(list term) ?~(pokes ~ ~[%poke])
12173 ?. (api-derived-names-valid u.paths derived-pokes mod prelude-values) ~
12223 ?. (api-derived-names-valid u.paths derived-pokes mod prelude-values) ~
12174− (api-path-types u.paths externals declared)
12224+ (api-path-types u.paths externals declared prelude)
12175::
12225::
12176:: Source/graph entry for path analysis only. The returned paths retain
12226:: Source/graph entry for path analysis only. The returned paths retain
12177:: reader-derived mark types and import resolution has checked reachable
12227:: reader-derived mark types and import resolution has checked reachable
@@ -12185,12 +12235,13 @@
12185 =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12235 =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12186 ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
12236 ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
12187 ?~ prepared [%| 'API path analysis needs the prepared prelude']
12237 ?~ prepared [%| 'API path analysis needs the prepared prelude']
12238+ =/ public=ifile iface.u.prepared
12188 =/ prelude=(unit ifile) `iface.u.prepared
12239 =/ prelude=(unit ifile) `iface.u.prepared
12189 =/ deps=jimports-result
12240 =/ deps=jimports-result
12190 (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ prelude)
12241 (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ prelude)
12191 ?: ?=(%| -.deps) [%| p.deps]
12242 ?: ?=(%| -.deps) [%| p.deps]
12192 =/ paths=(unit (list iapi-path-typed))
12243 =/ paths=(unit (list iapi-path-typed))
12193− (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12244+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared public)
12194 ?~ paths [%| 'API path declaration needs unsupported analysis']
12245 ?~ paths [%| 'API path declaration needs unsupported analysis']
12195 [%& u.paths]
12246 [%& u.paths]
12196::
12247::
@@ -12215,7 +12266,7 @@
12215 (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
12266 (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
12216 ?: ?=(%| -.deps) [%| p.deps]
12267 ?: ?=(%| -.deps) [%| p.deps]
12217 =/ paths=(unit (list iapi-path-typed))
12268 =/ paths=(unit (list iapi-path-typed))
12218− (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12269+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared public)
12219 ?~ paths [%| 'API path declaration needs unsupported analysis']
12270 ?~ paths [%| 'API path declaration needs unsupported analysis']
12220 [%& [file src u.prepared externals marks cache.p.deps u.paths]]
12271 [%& [file src u.prepared externals marks cache.p.deps u.paths]]
12221:: Graph-aware variant preserves the caller active stack and cache.
12272:: Graph-aware variant preserves the caller active stack and cache.
@@ -12236,7 +12287,7 @@
12236 (resolve-jibb-imports imports.p.parsed externals marks modules active values.u.prepared molds.u.prepared cache `public)
12287 (resolve-jibb-imports imports.p.parsed externals marks modules active values.u.prepared molds.u.prepared cache `public)
12237 ?: ?=(%| -.deps) [%| p.deps]
12288 ?: ?=(%| -.deps) [%| p.deps]
12238 =/ paths=(unit (list iapi-path-typed))
12289 =/ paths=(unit (list iapi-path-typed))
12239− (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12290+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared public)
12240 ?~ paths [%| 'API path declaration needs unsupported analysis']
12291 ?~ paths [%| 'API path declaration needs unsupported analysis']
12241 [%& [file src u.prepared externals marks cache.p.deps u.paths]]
12292 [%& [file src u.prepared externals marks cache.p.deps u.paths]]
12242::
12293::
@@ -12323,7 +12374,7 @@
12323 =/ vals=(list term) (global-value-names ordinary)
12374 =/ vals=(list term) (global-value-names ordinary)
12324 ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12375 ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12325 =/ declared=(list term) (collect-mark-imports imports.mod)
12376 =/ declared=(list term) (collect-mark-imports imports.mod)
12326− =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12377+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared iface.prep)
12327 ?~ mark-types [%| 'API declared marks need unsupported inference']
12378 ?~ mark-types [%| 'API declared marks need unsupported inference']
12328 =/ prelude=(unit ifile) `iface.prep
12379 =/ prelude=(unit ifile) `iface.prep
12329 =/ deps=jimports-result
12380 =/ deps=jimports-result
@@ -12357,7 +12408,7 @@
12357 =/ vals=(list term) (global-value-names ordinary)
12408 =/ vals=(list term) (global-value-names ordinary)
12358 ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12409 ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12359 =/ declared=(list term) (collect-mark-imports imports.mod)
12410 =/ declared=(list term) (collect-mark-imports imports.mod)
12360− =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12411+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared iface.prep)
12361 ?~ mark-types [%| 'API declared marks need unsupported inference']
12412 ?~ mark-types [%| 'API declared marks need unsupported inference']
12362 =/ prelude=(unit ifile) `iface.prep
12413 =/ prelude=(unit ifile) `iface.prep
12363 =/ deps=jimports-result
12414 =/ deps=jimports-result
@@ -12558,10 +12609,10 @@
12558 [%& [support u.parts interface]]
12609 [%& [support u.parts interface]]
12559::
12610::
12560++ api-mark-exports
12611++ api-mark-exports
12561− |= [marks=(list term) all=(list term) externals=imark-externals]
12612+ |= [marks=(list term) all=(list term) externals=imark-externals prelude=ifile]
12562 ^- imold-types
12613 ^- imold-types
12563 ?~ marks ~
12614 ?~ marks ~
12564− =/ t=(unit itype) (find-imported-mark i.marks externals all)
12615+ =/ t=(unit itype) (find-imported-mark-prelude i.marks externals all prelude)
12565 ?~ t $(marks t.marks)
12616 ?~ t $(marks t.marks)
12566 [[i.marks [u.t ~]] $(marks t.marks)]
12617 [[i.marks [u.t ~]] $(marks t.marks)]
12567::
12618::
@@ -12597,11 +12648,11 @@
12597 =/ n=term i.names.sh
12648 =/ n=term i.names.sh
12598 ?. (unique-value-name n marks) ~
12649 ?. (unique-value-name n marks) ~
12599 ?: |((lien prelude-values |=(x=term =(n x))) (lien prelude-molds |=(x=term =(n x)))) ~
12650 ?: |((lien prelude-values |=(x=term =(n x))) (lien prelude-molds |=(x=term =(n x)))) ~
12600− =/ mark=(unit itype) (find-imported-mark n mark-externals marks)
12651+ =/ mark=(unit itype) (find-imported-mark-prelude n mark-externals marks u.prelude)
12601 ?~ mark ~
12652 ?~ mark ~
12602 =/ sc=(unit ischeme) (derived-poke-command-scheme u.prelude u.mark)
12653 =/ sc=(unit ischeme) (derived-poke-command-scheme u.prelude u.mark)
12603 ?~ sc ~
12654 ?~ sc ~
12604− `[~[[%poke u.sc]] (api-mark-exports marks marks mark-externals) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
12655+ `[~[[%poke u.sc]] (api-mark-exports marks marks mark-externals u.prelude) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
12605::
12656::
12606:: Source-proven ordinary helpers validate each selected /sur dependency.
12657:: Source-proven ordinary helpers validate each selected /sur dependency.
12607:: Unused or less direct cores remain unsupported by this first interface.
12658:: Unused or less direct cores remain unsupported by this first interface.
@@ -13186,48 +13237,6 @@
13186 ?~ mapper ~
13237 ?~ mapper ~
13187 `[xs u.mapper]
13238 `[xs u.mapper]
13188::
13239::
13189−++ program-recovery-names
13190− |= ds=(list def)
13191− ^- (list term)
13192− =/ main=(unit def) (program-main-def ds)
13193− ?~ main ~
13194− =/ parts=(unit [init=term update=term view=term subs=term])
13195− (program-main-parts u.main)
13196− ?~ parts ~
13197− =/ views=(list def)
13198− (skim ds |=(d=def &(?=(%value -.d) =(view.u.parts name.d))))
13199− ?. ?=([* ~] views) ~
13200− =/ view-def=def i.views
13201− ?> ?=(%value -.view-def)
13202− =/ written=(unit sample) (direct-gate-sample view-def)
13203− ?~ written ~
13204− =/ body=expr
13205− ?- -.val.view-def
13206− %gate body.val.view-def
13207− %gate-wide body.val.view-def
13208− * !!
13209− ==
13210− =/ sites=(unit (list iview-site)) (program-view-sites body ~)
13211− ?~ sites ~
13212− ?. ?=([* ~] u.sites) ~
13213− =/ mapper=term mapper.i.u.sites
13214− =/ components=(list term)
13215− :~ init.u.parts
13216− update.u.parts
13217− view.u.parts
13218− subs.u.parts
13219− ==
13220− ?: (lien components |=(n=term =(n mapper))) ~
13221− =/ mappers=(list def)
13222− (skim ds |=(d=def &(?=(%value -.d) =(mapper name.d))))
13223− ?. ?=([* ~] mappers) ~
13224− :~ init.u.parts
13225− update.u.parts
13226− view.u.parts
13227− subs.u.parts
13228− mapper
13229− ==
13230−::
13231++ program-sample-binders
13240++ program-sample-binders
13232 |= sam=sample
13241 |= sam=sample
13233 ^- (list term)
13242 ^- (list term)
@@ -13967,7 +13976,7 @@
13967 ?~ error ~
13976 ?~ error ~
13968 ?. ?=(%union -.typ.u.raw) ~
13977 ?. ?=(%union -.typ.u.raw) ~
13969 =/ poke-case=itype
13978 =/ poke-case=itype
13970− [%cell [%const [%term %tas %poke '%poke']] [%cell [%face %p typ.u.raw(label `'raw-poke.internal')] [%face %reply [%fn u.error [%var m]]]]]
13979+ [%cell [%const [%term %tas %poke '%poke']] [%cell [%face %p typ.u.raw(label `'raw-poke')] [%face %reply [%fn u.error [%var m]]]]]
13971 =/ go-case=itype
13980 =/ go-case=itype
13972 [%cell [%const [%term %tas %go '%go']] [%face %url [%atom %t]]]
13981 [%cell [%const [%term %tas %go '%go']] [%face %url [%atom %t]]]
13973 =/ wait-case=itype
13982 =/ wait-case=itype
@@ -14111,7 +14120,7 @@
14111 ?~ heads resolution
14120 ?~ heads resolution
14112 =/ checked=(map term def) (direct-checked-gates ds env.resolution)
14121 =/ checked=(map term def) (direct-checked-gates ds env.resolution)
14113 =/ completed=[env=ienv artifacts=(list iwidth-definition)]
14122 =/ completed=[env=ienv artifacts=(list iwidth-definition)]
14114− (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)
14123+ (add-supported-defs-core ~[main] 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)
14115 [env.completed grouped.resolution artifacts.completed]
14124 [env.completed grouped.resolution artifacts.completed]
14116::
14125::
14117:: A static main may retain a generic element message in its ordinary
14126:: A static main may retain a generic element message in its ordinary
tests/golden/types-prelude-ui/types.txt+1−1
@@ -82,4 +82,4 @@ partial inference; module not checked
82 ^
82 ^
83++ load: $-(@t (ask [count=@ud]))
83++ load: $-(@t (ask [count=@ud]))
84++ page-view: $-([count=@ud] (element !!))
84++ page-view: $-([count=@ud] (element !!))
85−++ static-page: [load=$-(@t (ask.internal [count=@ud])) view=$-([count=@ud] (element !!))]
85+++ static-page: [load=$-(@t (ask [count=@ud])) view=$-([count=@ud] (element !!))]
tests/lib/jibb-api-paths.hoon+37−1
@@ -51,6 +51,32 @@
51 =/ params=tape
51 =/ params=tape
52 (zing (turn segments.info |=(s=pseg:jibb ?:(?=(%typed -.s) " {(trip name.s)}=@{(trip aura.s)}" ""))))
52 (zing (turn segments.info |=(s=pseg:jibb ?:(?=(%typed -.s) " {(trip name.s)}=@{(trip aura.s)}" ""))))
53 (crip "{(trip name.info)}: full={(show-itype:jibb full.item ~)} diffs:{diff-text} parameters:{params}")
53 (crip "{(trip name.info)}: full={(show-itype:jibb full.item ~)} diffs:{diff-text} parameters:{params}")
54+++ standard-unit
55+ |= typ=itype:jibb
56+ ^- ?
57+ ?. ?=(%union -.typ) |
58+ ?. =(origin.typ `[/lib/jibb/prelude/jibb %unit]) |
59+ ?. =(label.typ `%unit) |
60+ =(args.typ ~[[%atom %t]])
61+++ unit-detail
62+ |= result=(each (list iapi-path-typed:jibb) @t)
63+ ^- @t
64+ ?: ?=(%| -.result) 'unit marks: rejected'
65+ ?. ?=([* ~] p.result) 'unit marks: wrong path count'
66+ =/ item=iapi-path-typed:jibb i.p.result
67+ ?. ?=([* ~] diffs.item) 'unit marks: wrong diff count'
68+ ?: &((standard-unit full.item) (standard-unit typ.i.diffs.item))
69+ 'unit marks: canonical'
70+ 'unit marks: opaque'
71+++ unit-poke-detail
72+ |= interface=(unit ifile:jibb)
73+ ^- @t
74+ ?~ interface 'unit poke: rejected'
75+ =/ mark=(unit ischeme:jibb) (find-jibb-mold:jibb %unit-full u.interface)
76+ ?~ mark 'unit poke: missing export'
77+ ?. ?=(~ vars.u.mark) 'unit poke: generic export'
78+ ?: (standard-unit typ.u.mark) 'unit poke: canonical'
79+ 'unit poke: opaque'
54++ scry-detail
80++ scry-detail
55 |= result=(each (list iapi-path-typed:jibb) @t)
81 |= result=(each (list iapi-path-typed:jibb) @t)
56 ^- @t
82 ^- @t
@@ -78,6 +104,15 @@
78 =/ duplicate=(list [mark=term result=*]) [[%todos mt] marks]
104 =/ duplicate=(list [mark=term result=*]) [[%todos mt] marks]
79 =/ file=path /ui/api/todo/jibb
105 =/ file=path /ui/api/todo/jibb
80 =/ ok (api-path-analysis-source:jibb file api ~ marks ~ prepared)
106 =/ ok (api-path-analysis-source:jibb file api ~ marks ~ prepared)
107+ =/ unit-node=* [%apply %unit ~[[%atom %t ~]]]
108+ =/ unit-marks=imark-externals:jibb ~[[%unit-full [%& unit-node]] [%unit-diff [%& unit-node]]]
109+ =/ unit-api=@t '/% %unit-full\0a/% %unit-diff\0a+$ paths [%items /items (facts unit-full unit-diff)]\0a'
110+ =/ unit-ok (api-path-analysis-source:jibb /ui/api/unit/jibb unit-api ~ unit-marks ~ prepared)
111+ =/ unit-poke-source=@t '/% %unit-full\0a+$ poke unit-full\0a'
112+ =/ unit-poke-parsed=(each module:jibb error:jibb) (parse:jibb /ui/api/unit/jibb unit-poke-source)
113+ =/ unit-poke=(unit ifile:jibb)
114+ ?: ?=(%| -.unit-poke-parsed) ~
115+ (api-poke-interface:jibb /ui/api/unit/jibb p.unit-poke-parsed unit-marks values.u.prepared molds.u.prepared `iface.u.prepared)
81 =/ miss (api-path-analysis-source:jibb file api ~ missing ~ prepared)
116 =/ miss (api-path-analysis-source:jibb file api ~ missing ~ prepared)
82 =/ dup (api-path-analysis-source:jibb file api ~ duplicate ~ prepared)
117 =/ dup (api-path-analysis-source:jibb file api ~ duplicate ~ prepared)
83 =/ undeclared (api-path-analysis-source:jibb file missing-decl ~ marks ~ prepared)
118 =/ undeclared (api-path-analysis-source:jibb file missing-decl ~ marks ~ prepared)
@@ -100,5 +135,6 @@
100 (show-result 'todo' ok)
135 (show-result 'todo' ok)
101 ==
136 ==
102 =. lines ?:(?=(%& -.ok) (weld lines (turn p.ok show-path)) lines)
137 =. lines ?:(?=(%& -.ok) (weld lines (turn p.ok show-path)) lines)
138+ =. lines ?:(?=(%& -.unit-ok) (weld lines (turn p.unit-ok show-path)) lines)
103− (weld lines ~[(show-result 'missing mark' miss) (show-result 'duplicate mark' dup) (show-result 'undeclared mark' undeclared) (show-result 'value collision' clash) (show-result 'poke collision' poke) (show-result 'scry matching parameters' scry-ok) (scry-detail scry-ok) (show-result 'scry unknown parameter' scry-bad) (show-result 'wrong path' wrong) (show-result 'missing prelude' unprepared) (show-result 'private import' private) (show-result 'indirect private import' indirect) (show-result 'cycle' cycle)])
139+ (weld lines ~[(unit-detail unit-ok) (unit-poke-detail unit-poke) (show-result 'missing mark' miss) (show-result 'duplicate mark' dup) (show-result 'undeclared mark' undeclared) (show-result 'value collision' clash) (show-result 'poke collision' poke) (show-result 'scry matching parameters' scry-ok) (scry-detail scry-ok) (show-result 'scry unknown parameter' scry-bad) (show-result 'wrong path' wrong) (show-result 'missing prelude' unprepared) (show-result 'private import' private) (show-result 'indirect private import' indirect) (show-result 'cycle' cycle)])
104--
140--
tests/lib/jibb-bridge.hoon+5−2
@@ -129,6 +129,8 @@
129 [%fixture %texts (read %texts)]
129 [%fixture %texts (read %texts)]
130 [%fixture %numbers (read %numbers)]
130 [%fixture %numbers (read %numbers)]
131 [%fixture %maybe (read %maybe)]
131 [%fixture %maybe (read %maybe)]
132+ [%fixture %unit-choice [%& [%fork ~[[%atom %n [~ 0]] [%cell [%atom %tas [~ %some]] [%apply %unit ~[[%atom %t ~]]]]]]]]
133+ [%fixture %unit-list [%& [%apply %list ~[[%apply %unit ~[[%atom %t ~]]]]]]]
132 [%fixture %tagged-list (read %tagged-list)]
134 [%fixture %tagged-list (read %tagged-list)]
133 [%fixture %buckets (read %buckets)]
135 [%fixture %buckets (read %buckets)]
134 [%fixture %collection-rec (read %collection-rec)]
136 [%fixture %collection-rec (read %collection-rec)]
@@ -159,9 +161,10 @@
159 =/ prelude=@t (crip "++ prelude-id |= x x\0a")
161 =/ prelude=@t (crip "++ prelude-id |= x x\0a")
160 =/ modules=(list [at=path source=@t]) ~[[~[%ui %helper %jibb] dep]]
162 =/ modules=(list [at=path source=@t]) ~[[~[%ui %helper %jibb] dep]]
161 =/ hidden=@t (golden-types-with-prelude:jibb /ui/main/jibb root external ~ modules prelude)
163 =/ hidden=@t (golden-types-with-prelude:jibb /ui/main/jibb root external ~ modules prelude)
162− =/ unit-prelude=@t (crip "+$ unit |$ [A]\0a ~\0a [~ u=A]\0a")
164+ =/ unit-prelude=@t
165+ (crip "+$ list |$ [A]\0a ~\0a [i=A t=(list A)]\0a+$ unit |$ [A]\0a ~\0a [~ u=A]\0a++ fall |= args=[(unit A) A]\0a ?- args\0a [maybe fallback]\0a ?- maybe\0a ~ fallback\0a [~ value] value\0a++ need |= maybe=(unit A)\0a ?- maybe\0a ~ !!\0a [~ value] value\0a")
163 =/ unit-client=@t
166 =/ unit-client=@t
164− (crip "/- fixture\0a++ canonical ^- (unit @t) `\"hi\"\0a++ lookalike ^- zero-lookalike.fixture `\"hi\"\0a")
167+ (crip "/- fixture\0a++ canonical ^- (unit @t) `\"hi\"\0a++ canonical-fall |= x=(unit @t) (fall x \"fallback\")\0a++ canonical-need |= x=(unit @t) (need x)\0a++ canonical-cast |= x=(unit @t) ^- (unit @t) x\0a++ maybe-id |= x=maybe.fixture x\0a++ maybe-fall |= x=maybe.fixture (fall x \"fallback\")\0a++ maybe-need |= x=maybe.fixture (need x)\0a++ maybe-cast |= x=maybe.fixture ^- (unit @t) x\0a++ unit-choice-need |= x=unit-choice.fixture\0a ?- x\0a ~ \"empty\"\0a [%some maybe] (need maybe)\0a++ unit-list-need |= xs=unit-list.fixture\0a ?- xs\0a ~ \"empty\"\0a [maybe rest] (need maybe)\0a++ lookalike ^- zero-lookalike.fixture `\"hi\"\0a")
165 =/ unit-report=@t
168 =/ unit-report=@t
166 (golden-types-with-prelude:jibb /ui/unit-client/jibb unit-client external ~ ~ unit-prelude)
169 (golden-types-with-prelude:jibb /ui/unit-client/jibb unit-client external ~ ~ unit-prelude)
167 (cat 3 report (cat 3 (crip "\0areader-collapsed: {(show-result:jibb-import (read %collapsed))}\0areader-mixed-zero: {(show-result:jibb-import (read %mixed-zero))}\0areader-separate-tags: {(show-result:jibb-import (read %separate-tags))}\0areader-separate-terms: {(show-result:jibb-import (read %separate-terms))}\0a") (cat 3 hidden (cat 3 '\0a' (cat 3 unit-report (cat 3 '\0a' (cat 3 noun-synthetic (cat 3 '\0a' (cat 3 recursive-list-synthetic (cat 3 '\0a' named-recursive-synthetic))))))))))
170 (cat 3 report (cat 3 (crip "\0areader-collapsed: {(show-result:jibb-import (read %collapsed))}\0areader-mixed-zero: {(show-result:jibb-import (read %mixed-zero))}\0areader-separate-tags: {(show-result:jibb-import (read %separate-tags))}\0areader-separate-terms: {(show-result:jibb-import (read %separate-terms))}\0a") (cat 3 hidden (cat 3 '\0a' (cat 3 unit-report (cat 3 '\0a' (cat 3 noun-synthetic (cat 3 '\0a' (cat 3 recursive-list-synthetic (cat 3 '\0a' named-recursive-synthetic))))))))))
tests/lib/jibb-hole-guards.hoon+3−3
@@ -48,11 +48,11 @@
48 ?. &(?=(%& -.g) ?=(%& -.b) ?=(%& -.v))
48 ?. &(?=(%& -.g) ?=(%& -.b) ?=(%& -.v))
49 ["API path control sources did not parse" failures]
49 ["API path control sources did not parse" failures]
50 =/ ext=imark-externals:jibb ~[[%todo [%& [%atom %t ~]]]]
50 =/ ext=imark-externals:jibb ~[[%todo [%& [%atom %t ~]]]]
51− =? failures ?=(~ (api-path-analysis:jibb p.g ext ~ ~))
51+ =? failures ?=(~ (api-path-analysis:jibb p.g ext ~ ~ *ifile:jibb))
52 ["a valid API path was rejected" failures]
52 ["a valid API path was rejected" failures]
53− =? failures ?=(^ (api-path-analysis:jibb p.b ext ~ ~))
53+ =? failures ?=(^ (api-path-analysis:jibb p.b ext ~ ~ *ifile:jibb))
54 ["an API path ignored an unused mold hole" failures]
54 ["an API path ignored an unused mold hole" failures]
55− =? failures ?=(^ (api-path-analysis:jibb p.v ext ~ ~))
55+ =? failures ?=(^ (api-path-analysis:jibb p.v ext ~ ~ *ifile:jibb))
56 ["an API path ignored an unused value hole" failures]
56 ["an API path ignored an unused value hole" failures]
57 =/ prepared=(unit iprelude:jibb) (prepare-prelude-with-internal:jibb real-prelude real-internal)
57 =/ prepared=(unit iprelude:jibb) (prepare-prelude-with-internal:jibb real-prelude real-internal)
58 ?~ prepared ["actual prelude was not prepared" failures]
58 ?~ prepared ["actual prelude was not prepared" failures]
tests/lib/jibb-proj-guards.hoon+2−2
@@ -46,8 +46,8 @@
46 ?: |(?=(%| -.valid) ?=(%| -.clash) ?=(%| -.poke)) ~["API reservation controls did not parse"]
46 ?: |(?=(%| -.valid) ?=(%| -.clash) ?=(%| -.poke)) ~["API reservation controls did not parse"]
47 =/ todo=imark-externals:jibb ~[[%todo [%& [%atom %t ~]]]]
47 =/ todo=imark-externals:jibb ~[[%todo [%& [%atom %t ~]]]]
48 =/ proj-mark=imark-externals:jibb ~[[%proj [%& [%atom %t ~]]]]
48 =/ proj-mark=imark-externals:jibb ~[[%proj [%& [%atom %t ~]]]]
49− =/ good=(unit (list iapi-path-typed:jibb)) (api-path-analysis:jibb p.valid todo ~ ~)
49+ =/ good=(unit (list iapi-path-typed:jibb)) (api-path-analysis:jibb p.valid todo ~ ~ *ifile:jibb)
50− =/ bad=(unit (list iapi-path-typed:jibb)) (api-path-analysis:jibb p.clash todo ~ ~)
50+ =/ bad=(unit (list iapi-path-typed:jibb)) (api-path-analysis:jibb p.clash todo ~ ~ *ifile:jibb)
51 ?~ good ~["a literal /proj path was rejected"]
51 ?~ good ~["a literal /proj path was rejected"]
52 ?^ bad ~["an API-derived proj path name was accepted"]
52 ?^ bad ~["an API-derived proj path name was accepted"]
53 =/ prepared=(unit iprelude:jibb) (prepare-prelude-with-internal:jibb real-prelude real-internal)
53 =/ prepared=(unit iprelude:jibb) (prepare-prelude-with-internal:jibb real-prelude real-internal)
tests/lib/jibb-theme.hoon+1−1
@@ -63,7 +63,7 @@
63 =/ prepared=(unit iprelude:jibb)
63 =/ prepared=(unit iprelude:jibb)
64 (prepare-prelude-with-internal:jibb public private)
64 (prepare-prelude-with-internal:jibb public private)
65 ?~ prepared ~["theme prelude did not prepare"]
65 ?~ prepared ~["theme prelude did not prepare"]
66− =/ expected=tape "[space=[s1=@t [s2=@t s3=@t]] [tones=[normal=@t [background=@t [accent=@t [danger=@t muted=@t]]]] [wide=@t [lang=@t [zone=@t [font=(unit qath.internal) dark=(unit [tones=[normal=@t [background=@t [accent=@t [danger=@t muted=@t]]]]])]]]]]]"
66+ =/ expected=tape "[space=[s1=@t [s2=@t s3=@t]] [tones=[normal=@t [background=@t [accent=@t [danger=@t muted=@t]]]] [wide=@t [lang=@t [zone=@t [font=(unit qath) dark=(unit [tones=[normal=@t [background=@t [accent=@t [danger=@t muted=@t]]]]])]]]]]]"
67 =/ negatives=(list [label=tape src=@t])
67 =/ negatives=(list [label=tape src=@t])
68 :~ ["wrong nested aura" wrong-nested-aura]
68 :~ ["wrong nested aura" wrong-nested-aura]
69 ["missing required field" missing-field]
69 ["missing required field" missing-field]
tests/lib/jibb-todo-full.hoon+9
@@ -17,6 +17,7 @@
17/* alias %txt /tests/type-todo-full/alias/txt
17/* alias %txt /tests/type-todo-full/alias/txt
18/* wrong-watch %txt /tests/type-todo-full/wrong-watch/txt
18/* wrong-watch %txt /tests/type-todo-full/wrong-watch/txt
19/* non-gate-view %txt /tests/type-todo-full/non-gate-view/txt
19/* non-gate-view %txt /tests/type-todo-full/non-gate-view/txt
20+/* cast-init %txt /tests/type-todo-full/cast-init/txt
20/* expected %txt /tests/type-todo-full/expected/txt
21/* expected %txt /tests/type-todo-full/expected/txt
21|%
22|%
22++ text
23++ text
@@ -130,6 +131,14 @@
130 (todo-full-legacy-report prelude internal (text sur) (text action) (text todos) (text update) (text item) (text api) (text source))
131 (todo-full-legacy-report prelude internal (text sur) (text action) (text todos) (text update) (text item) (text api) (text source))
131 ?. =((to-wain:format (cat 3 legacy '\0a')) expected)
132 ?. =((to-wain:format (cat 3 legacy '\0a')) expected)
132 ~[leaf+"legacy full todo report differs"]
133 ~[leaf+"legacy full todo report differs"]
134+ =/ cast-report=@t
135+ (todo-full-report prelude internal (text sur) (text action) (text todos) (text update) (text item) (text api) (text cast-init))
136+ ?. =((to-wain:format (cat 3 cast-report '\0a')) expected)
137+ ~[leaf+"ordinary annotated initializer was rejected"]
138+ =/ cast-legacy=@t
139+ (todo-full-legacy-report prelude internal (text sur) (text action) (text todos) (text update) (text item) (text api) (text cast-init))
140+ ?. =((to-wain:format (cat 3 cast-legacy '\0a')) expected)
141+ ~[leaf+"legacy ordinary annotated initializer was rejected"]
133 =/ imported=@t
142 =/ imported=@t
134 (todo-full-import-report prelude internal (text sur) (text action) (text todos) (text update) (text item) (text api) (text source))
143 (todo-full-import-report prelude internal (text sur) (text action) (text todos) (text update) (text item) (text api) (text source))
135 ?. =(imported 'downstream import accepted')
144 ?. =(imported 'downstream import accepted')
tests/type-api-paths/about.txt+1−1
@@ -1,3 +1,3 @@
1source: Overview, Agent APIs: a path names a request, a route and a mark for full state; `facts` supplies diff marks and an optional scry path. Imports: Hoon marks are read at their declared names.
1source: Overview, Agent APIs: a path names a request, a route and a mark for full state; `facts` supplies diff marks and an optional scry path. Imports: Hoon marks are read at their declared names.
2−tests: Partial path analysis uses the actual todo `/sur` and Ford-style mark samples, preserving the full and diff types and typed path parameter. Matching scry parameters are accepted; unknown scry parameters, missing, duplicate and undeclared marks, value and derived-name collisions, an invalid module path, a missing prelude, private imports and an import cycle fail closed. This does not check the module or derive request gates.
2+tests: Partial path analysis uses the actual todo `/sur` and Ford-style mark samples, preserving the full and diff types and typed path parameter. Synthetic full and diff marks containing Hoon units must retain the canonical prelude union in path analysis and a direct poke export, not merely print like it. Matching scry parameters are accepted; unknown scry parameters, missing, duplicate and undeclared marks, value and derived-name collisions, an invalid module path, a missing prelude, private imports and an import cycle fail closed. This does not check the module or derive request gates.
3expect: partial path metadata or an unsupported/error report
3expect: partial path metadata or an unsupported/error report
tests/type-api-paths/expected.txt+3
@@ -3,6 +3,9 @@ todo: accepted 3 path cases
3todos: full=(list [id=@ud [done=? text=@t]]) diffs: parameters:
3todos: full=(list [id=@ud [done=? text=@t]]) diffs: parameters:
4changes: full=(list [id=@ud [done=? text=@t]]) diffs: todo-update=[%added item=[id=@ud [done=? text=@t]]] [%toggled id=@ud] parameters:
4changes: full=(list [id=@ud [done=? text=@t]]) diffs: todo-update=[%added item=[id=@ud [done=? text=@t]]] [%toggled id=@ud] parameters:
5todo-by-id: full=[id=@ud [done=? text=@t]] diffs: parameters: id=@ud
5todo-by-id: full=[id=@ud [done=? text=@t]] diffs: parameters: id=@ud
6+items: full=(unit @t) diffs: unit-diff=(unit @t) parameters:
7+unit marks: canonical
8+unit poke: canonical
6missing mark: API path declaration needs unsupported analysis
9missing mark: API path declaration needs unsupported analysis
7duplicate mark: API path declaration needs unsupported analysis
10duplicate mark: API path declaration needs unsupported analysis
8undeclared mark: API path declaration needs unsupported analysis
11undeclared mark: API path declaration needs unsupported analysis
tests/type-import/about.txt+4−2
@@ -12,8 +12,10 @@ as `?`, including in either supplied order. Open `%f`, out-of-range values,
12duplicates, overlapping zero constants, extra or faced cases and malformed
12duplicates, overlapping zero constants, extra or faced cases and malformed
13forks stay unsupported. A structurally unit-like import does not gain unit
13forks stay unsupported. A structurally unit-like import does not gain unit
14construction even when a canonical prelude unit is supplied; constructing
14construction even when a canonical prelude unit is supplied; constructing
15−that canonical unit succeeds. It covers matching and
15+that canonical unit succeeds. With the validated canonical template, the
16+same imported unit fits identity, `fall`, `need` and `(unit @t)` casts, including
17+when nested in an imported union. It covers matching and mismatched collections,
16−mismatched collections, nested union arguments, and malformed collection names
18+nested union arguments, and malformed collection names
17and arities. An imported `*` can widen a value, while malformed nouns,
19and arities. An imported `*` can widen a value, while malformed nouns,
18overlapping direct or nested union cases, and unknown gate or empty cases
20overlapping direct or nested union cases, and unknown gate or empty cases
19stay unsupported. Distinct tagged cases with a noun payload remain disjoint.
21stay unsupported. Distinct tagged cases with a noun payload remain disjoint.
tests/type-import/expected.txt+15−5
@@ -53,6 +53,7 @@ partial inference; module not checked
53/test.jibb:32:45: argument has type (unit @t)
53/test.jibb:32:45: argument has type (unit @t)
54++ wrong-kind |= x=maybe.fixture (text-list x)
54++ wrong-kind |= x=maybe.fixture (text-list x)
55 ^
55 ^
56+++ maybe-id: $-((unit @t) (unit @t))
56++ bad-kind: sample mold is not supported by partial inference
57++ bad-kind: sample mold is not supported by partial inference
57++ bad-arity: sample mold is not supported by partial inference
58++ bad-arity: sample mold is not supported by partial inference
58++ bad-argument: sample mold is not supported by partial inference
59++ bad-argument: sample mold is not supported by partial inference
@@ -63,10 +64,10 @@ partial inference; module not checked
63++ chain-again: $-(chain.fixture chain.fixture)
64++ chain-again: $-(chain.fixture chain.fixture)
64++ other-id: $-(other.fixture other.fixture)
65++ other-id: $-(other.fixture other.fixture)
65++ chain-mismatch: call's sample and argument types do not unify
66++ chain-mismatch: call's sample and argument types do not unify
66−/test.jibb:42:39: called gate has type $-(chain.fixture chain.fixture)
67+/test.jibb:43:39: called gate has type $-(chain.fixture chain.fixture)
67++ chain-mismatch |= x=other.fixture (chain-id x)
68++ chain-mismatch |= x=other.fixture (chain-id x)
68 ^
69 ^
69−/test.jibb:42:48: argument has type other.fixture
70+/test.jibb:43:48: argument has type other.fixture
70++ chain-mismatch |= x=other.fixture (chain-id x)
71++ chain-mismatch |= x=other.fixture (chain-id x)
71 ^
72 ^
72++ recursive-field: field is not available to partial inference
73++ recursive-field: field is not available to partial inference
@@ -77,10 +78,10 @@ partial inference; module not checked
77++ raw-ref: sample mold is not supported by partial inference
78++ raw-ref: sample mold is not supported by partial inference
78++ raw-null: $-(~ ~)
79++ raw-null: $-(~ ~)
79++ cross-module: call's sample and argument types do not unify
80++ cross-module: call's sample and argument types do not unify
80−/test.jibb:50:36: called gate has type $-(chain.fixture chain.fixture)
81+/test.jibb:51:36: called gate has type $-(chain.fixture chain.fixture)
81++ cross-module |= x=chain.second (chain-id x)
82++ cross-module |= x=chain.second (chain-id x)
82 ^
83 ^
83−/test.jibb:50:45: argument has type chain.second
84+/test.jibb:51:45: argument has type chain.second
84++ cross-module |= x=chain.second (chain-id x)
85++ cross-module |= x=chain.second (chain-id x)
85 ^
86 ^
86++ chain-pattern: recursive pattern is not supported by partial inference
87++ chain-pattern: recursive pattern is not supported by partial inference
@@ -105,7 +106,7 @@ partial inference; module not checked
105++ flag-faced: sample mold is not supported by partial inference
106++ flag-faced: sample mold is not supported by partial inference
106++ flag-malformed: sample mold is not supported by partial inference
107++ flag-malformed: sample mold is not supported by partial inference
107++ mixed-zero: Hoon union cases overlap
108++ mixed-zero: Hoon union cases overlap
108−/test.jibb:81:20: invalid imported mold
109+/test.jibb:82:20: invalid imported mold
109++ mixed-zero |= x=mixed-zero.fixture x
110++ mixed-zero |= x=mixed-zero.fixture x
110 ^
111 ^
111++ separate-tags: $-(([%left [%$ @t]] [%right [? @t]]) ([%left [%$ @t]] [%right [? @t]]))
112++ separate-tags: $-(([%left [%$ @t]] [%right [? @t]]) ([%left [%$ @t]] [%right [? @t]]))
@@ -118,6 +119,15 @@ partial inference; module not checked
118++ use: recursive mold name is not available in this scope
119++ use: recursive mold name is not available in this scope
119partial inference; module not checked
120partial inference; module not checked
120++ canonical: (unit @t)
121++ canonical: (unit @t)
122+++ canonical-fall: $-((unit @t) @t)
123+++ canonical-need: $-((unit @t) @t)
124+++ canonical-cast: $-((unit @t) (unit @t))
125+++ maybe-id: $-((unit @t) (unit @t))
126+++ maybe-fall: $-((unit @t) @t)
127+++ maybe-need: $-((unit @t) @t)
128+++ maybe-cast: $-((unit @t) (unit @t))
129+++ unit-choice-need: $-((~ [%some (unit @t)]) @t)
130+++ unit-list-need: $-((list (unit @t)) @t)
121++ lookalike: cast constraint is not supported by partial inference
131++ lookalike: cast constraint is not supported by partial inference
122noun: *
132noun: *
123malformed: unsupported
133malformed: unsupported
tests/type-import/source.txt+1
@@ -30,6 +30,7 @@
30++ same-list |= x=texts.fixture (text-list x)
30++ same-list |= x=texts.fixture (text-list x)
31++ wrong-item |= x=numbers.fixture (text-list x)
31++ wrong-item |= x=numbers.fixture (text-list x)
32++ wrong-kind |= x=maybe.fixture (text-list x)
32++ wrong-kind |= x=maybe.fixture (text-list x)
33+++ maybe-id |= x=maybe.fixture x
33++ bad-kind |= x=bad-kind.fixture x
34++ bad-kind |= x=bad-kind.fixture x
34++ bad-arity |= x=bad-arity.fixture x
35++ bad-arity |= x=bad-arity.fixture x
35++ bad-argument |= x=bad-argument.fixture x
36++ bad-argument |= x=bad-argument.fixture x
tests/type-todo-full/cast-init.txtnew file+43
@@ -0,0 +1,43 @@
1+/= todo /ui/api/todo
2+
3+++ main (program init update view subs)
4+
5++$ model [todos=(list item.todo) draft=@t error=(unit @t)]
6++$ msg
7+ [%typed text=@t]
8+ %submit
9+ [%toggled id=@ud]
10+ [%got todos=(list item.todo)]
11+ [%acked err=(unit @t)]
12+
13+++ make-model |= ts=(list item.todo)
14+ ^- model [ts "" ~]
15+
16+++ init |= ts=(list item.todo)
17+ ^- model (make-model ts)
18+
19+++ update |= [=msg m=model]
20+ ?- msg
21+ [%typed t]
22+ ?- (gth (lent (tuba (trip t))) 80)
23+ %.y [m(draft=t error=`"Too long") ~]
24+ %.n [m(draft=t error=~) ~]
25+ %submit [m(draft="") ~[(poke.todo [%add draft.m] |=%acked)]]
26+ [%toggled id] [m ~[(poke.todo [%toggle id] |=%acked)]]
27+ [%got ts] [m(todos=ts) ~]
28+ [%acked err] [m(error=err) ~]
29+
30+++ subs |= m=model
31+ ~[[%watch (todos.todo |=%got)]]
32+
33+++ view |= m=model
34+ column ~[gap+%s2] ~[
35+ heading 2 "Todos"
36+ each (turn todos.m row-of)
37+ row ~[gap+%s1] ~[
38+ el ~[width+[%fill 1]] (field "New todo" draft.m |=%typed)
39+ button "Add" %submit
40+ el ~[tone+%danger] (text (fall error.m ""))
41+
42+++ row-of |= t=item.todo
43+ [id.t (toggle done.t text.t [%toggled id.t])]
tools/type-todo-full-test+8−1
@@ -32,7 +32,7 @@ suites = {'detailed': shared + tests[report_at:legacy_at] + '\n--\n',
32 'negative': shared + tests[negative_at:test_at] + '\n--\n'}
32 'negative': shared + tests[negative_at:test_at] + '\n--\n'}
33names = ('sur', 'action', 'todos', 'update', 'item', 'api', 'source',
33names = ('sur', 'action', 'todos', 'update', 'item', 'api', 'source',
34 'wrong-model', 'wrong-message', 'wrong-result', 'ambiguous-mapper',
34 'wrong-model', 'wrong-message', 'wrong-result', 'ambiguous-mapper',
35− 'open-key', 'alias', 'wrong-watch', 'non-gate-view', 'expected')
35+ 'open-key', 'alias', 'wrong-watch', 'non-gate-view', 'cast-init', 'expected')
36prefix = ('=/ jibb .\n=/ jibb-import\n' + reader + '\n' +
36prefix = ('=/ jibb .\n=/ jibb-import\n' + reader + '\n' +
37 ''.join('=/ ' + name + '=wain (to-wain:format ' + name + '-text)\n'
37 ''.join('=/ ' + name + '=wain (to-wain:format ' + name + '-text)\n'
38 for name in names) + '=/ suite\n')
38 for name in names) + '=/ suite\n')
@@ -46,6 +46,7 @@ fixtures = {'sur': 'tests/type-api-paths/todo-sur.txt',
46 **{name: f'tests/type-todo-full/{name}.txt'
46 **{name: f'tests/type-todo-full/{name}.txt'
47 for name in ('wrong-model', 'wrong-message', 'wrong-result',
47 for name in ('wrong-model', 'wrong-message', 'wrong-result',
48 'ambiguous-mapper', 'open-key', 'alias', 'wrong-watch', 'non-gate-view')},
48 'ambiguous-mapper', 'open-key', 'alias', 'wrong-watch', 'non-gate-view')},
49+ 'cast-init': 'tests/type-todo-full/cast-init.txt',
49 'expected': 'tests/type-todo-full/expected.txt'}
50 'expected': 'tests/type-todo-full/expected.txt'}
50
51
51def evaluate(expression, kind):
52def evaluate(expression, kind):
@@ -79,6 +80,12 @@ if legacy != expected:
79 legacy.decode().splitlines(keepends=True),
80 legacy.decode().splitlines(keepends=True),
80 fromfile='expected.txt', tofile='legacy'))
81 fromfile='expected.txt', tofile='legacy'))
81 sys.exit('legacy full todo report differs')
82 sys.exit('legacy full todo report differs')
83+for expression, label in (('todo-full-report', 'detailed cast initializer'),
84+ ('todo-full-legacy-report', 'legacy cast initializer')):
85+ cast = evaluate(f'({expression}:suite prelude internal sur-text action-text todos-text update-text item-text api-text cast-init-text)', 'detailed' if expression == 'todo-full-report' else 'legacy')
86+ if cast != expected:
87+ sys.stderr.buffer.write(cast)
88+ sys.exit(label + ' was rejected')
82imported = evaluate('(todo-full-import-report:suite prelude internal sur-text action-text todos-text update-text item-text api-text source-text)', 'import')
89imported = evaluate('(todo-full-import-report:suite prelude internal sur-text action-text todos-text update-text item-text api-text source-text)', 'import')
83if imported != b'downstream import accepted\n':
90if imported != b'downstream import accepted\n':
84 sys.stderr.buffer.write(imported)
91 sys.stderr.buffer.write(imported)