on master help sign in
Check spans and the Hoon references with test arms
32f4b78Claude
docs/compiler.md+1−1
@@ -156,7 +156,7 @@ Each case's canonical API identity and source-derived schema travel across impor
156
156
157`+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.
157`+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.
158
158
159−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.
159+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. The `test-zing-reference` arm of `tests/lib/jibb-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 the same suite's `test-lead-late-reference` arm. 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.
160
160
161`+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.
161`+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.
162
162
docs/development.md+3−1
@@ -100,6 +100,7 @@ The `jibb-dev` desk has no `my-app`, so the suites that check `my-app` files rea
100| `jibb-bridge` | The importer/checker bridge: the Hoon importer composed with the partial checker | `tests/type-import/expected.txt` |
100| `jibb-bridge` | The importer/checker bridge: the Hoon importer composed with the partial checker | `tests/type-import/expected.txt` |
101| `jibb-buttons` | The documented valid button helpers and the unchanged unresolved-`%add` module, through detailed and legacy inference | `tests/type-buttons/expected.txt` |
101| `jibb-buttons` | The documented valid button helpers and the unchanged unresolved-`%add` module, through detailed and legacy inference | `tests/type-buttons/expected.txt` |
102| `jibb-cell-branch` | Closed-cell branch context, rollback and bounded retry screens | |
102| `jibb-cell-branch` | Closed-cell branch context, rollback and bounded retry screens | |
103+| `jibb-check-spans` | `+check-spans`, which `+golden` runs on every tree: its own test, `+check-spans-test`, moves the spans of parsed nodes as a parser bug would and checks that it says so | |
103| `jibb-closed-gate-guards` | Closed gate sample labels and face uncertainty | |
104| `jibb-closed-gate-guards` | Closed gate sample labels and face uncertainty | |
104| `jibb-constructor-fit-guards` | Constructor-case uncertainty and known mismatches | |
105| `jibb-constructor-fit-guards` | Constructor-case uncertainty and known mismatches | |
105| `jibb-deferred` | The bounded source-owned deferred inference transaction | `tests/type-deferred/expected.txt` |
106| `jibb-deferred` | The bounded source-owned deferred inference transaction | `tests/type-deferred/expected.txt` |
@@ -119,6 +120,7 @@ The `jibb-dev` desk has no `my-app`, so the suites that check `my-app` files rea
119| `jibb-generic-pattern` | Source-backed recursive patterns, catch-all coverage, state and per-attempt fuel/arm limits | `tests/type-generic-pattern/expected.txt` |
120| `jibb-generic-pattern` | Source-backed recursive patterns, catch-all coverage, state and per-attempt fuel/arm limits | `tests/type-generic-pattern/expected.txt` |
120| `jibb-generic-recursion` | Source-backed generic recursive identity and provenance | `tests/type-generic-recursion/expected.txt` |
121| `jibb-generic-recursion` | Source-backed generic recursive identity and provenance | `tests/type-generic-recursion/expected.txt` |
121| `jibb-hole-guards` | Hole-defaulting and API interface guards | |
122| `jibb-hole-guards` | Hole-defaulting and API interface guards | |
123+| `jibb-hoon-reference` | Hoon translations of the Jibb-written `zing`, `lead`, `late` and `succ` against Hoon's own arms, on selected inputs; this does not execute Jibb, test lowering or prove jet recognition | |
122| `jibb-import` | The partial Hoon importer's diagnostic trees and errors over the importer fixtures; the projection is an internal tree, not the Jibb type printer | `tests/importer/tree.txt` |
124| `jibb-import` | The partial Hoon importer's diagnostic trees and errors over the importer fixtures; the projection is an internal tree, not the Jibb type printer | `tests/importer/tree.txt` |
123| `jibb-import-default` | Default-wrapped union source proofs over a real Tlon mold, and adversarial cases | `tests/type-import-default/expected.txt` |
125| `jibb-import-default` | Default-wrapped union source proofs over a real Tlon mold, and adversarial cases | `tests/type-import-default/expected.txt` |
124| `jibb-import-diagnostic` | The structured reader diagnostic bridge report: definite and unsupported reader diagnostics through the checker | `tests/type-import-diagnostic/expected.txt` |
126| `jibb-import-diagnostic` | The structured reader diagnostic bridge report: definite and unsupported reader diagnostics through the checker | `tests/type-import-diagnostic/expected.txt` |
@@ -160,7 +162,7 @@ tools/check --group eval # only the checks that need no ship, as CI runs the
160nix flake check # the same checks in the Nix sandbox, on a fresh fake ~zod
162nix flake check # the same checks in the Nix sandbox, on a fresh fake ~zod
161```
163```
162
164
163−`tools/check` runs every check the repo has. Their one list is `CHECKS` in the script, so a new check goes there, as well as in the table above; `tools/check --list` prints it with each check's command. A new suite in `tests/lib` needs no new check: `arms-1` to `arms-4` run every suite's arms, in shards of about equal time, and a slow suite's cost belongs in `COSTS` in `tools/test-arms`, which balances them. The eval group, the 13 checks that need only `urbit` and Python, runs several at a time (`-j`, by default one per CPU), the slowest first. The ship group, `ship-selftest`, `ship-test`, `check-commit` and `clay-fixtures`, then runs one check at a time on the ship `tools/ship` talks to; `tools/check` starts it if it isn't running and stops it again afterwards. Name checks, or globs, to run only those: `tools/check golden 'arms-*'`. To run one suite under eval, use `tools/test-arms <suite>`, as `tools/test-arms jibb-todo-full`. A failing check's output follows its FAIL line; `-v` prints every check's output, and `--logs DIR` keeps it all.
165+`tools/check` runs every check the repo has. Their one list is `CHECKS` in the script, so a new check goes there, as well as in the table above; `tools/check --list` prints it with each check's command. A new suite in `tests/lib` needs no new check: `arms-1` to `arms-4` run every suite's arms, in shards of about equal time, and a slow suite's cost belongs in `COSTS` in `tools/test-arms`, which balances them. The eval group, the 9 checks that need only `urbit` and Python, runs several at a time (`-j`, by default one per CPU), the slowest first. The ship group, `ship-selftest`, `ship-test`, `check-commit` and `clay-fixtures`, then runs one check at a time on the ship `tools/ship` talks to; `tools/check` starts it if it isn't running and stops it again afterwards. Name checks, or globs, to run only those: `tools/check golden 'arms-*'`. To run one suite under eval, use `tools/test-arms <suite>`, as `tools/test-arms jibb-todo-full`. A failing check's output follows its FAIL line; `-v` prints every check's output, and `--logs DIR` keeps it all.
164
166
165CI, [.github/workflows/check.yml](../.github/workflows/check.yml), builds the desks and runs the eval group through the flake on every push to `master` and every pull request. It doesn't run the ship group, so run that before pushing.
167CI, [.github/workflows/check.yml](../.github/workflows/check.yml), builds the desks and runs the eval group through the flake on every push to `master` and every pull request. It doesn't run the ship group, so run that before pushing.
166
168
docs/status.md+2−1
@@ -293,7 +293,8 @@ tools/test-arms jibb-program-init # transactional direct-program initializer con
293tools/test-arms jibb-program-update # transactional direct-program update context guards
293tools/test-arms jibb-program-update # transactional direct-program update context guards
294tools/test-arms jibb-program-watch # direct request-value watchability guards
294tools/test-arms jibb-program-watch # direct request-value watchability guards
295tools/test-arms jibb-todo-full # byte-identical full todo and rejection guards
295tools/test-arms jibb-todo-full # byte-identical full todo and rejection guards
296−tools/hoon check-spans-test # prints <<>> when the span checker works
296+tools/test-arms jibb-check-spans # the span checker catches planted wrong spans
297+tools/test-arms jibb-hoon-reference # Hoon translations of zing, lead, late and succ agree with Hoon's
297tools/testdata/selftest # the tools themselves
298tools/testdata/selftest # the tools themselves
298tools/doc-blocks docs/spec # the doc's examples are golden cases
299tools/doc-blocks docs/spec # the doc's examples are golden cases
299tools/ship start
300tools/ship start
jibb-dev/lib/jibb.hoon+5−5
@@ -63,8 +63,8 @@
63:: finds each node's end from the tokens alone, matching each opener
63:: finds each node's end from the tokens alone, matching each opener
64:: with its closer on the line, so a node that stops at a child where
64:: with its closer on the line, so a node that stops at a child where
65:: its closer follows fails it, and +check-spans-test plants such
65:: its closer follows fails it, and +check-spans-test plants such
66−:: wrong ends to show that it does (tools/hoon check-spans-test prints
66+:: wrong ends to show that it does (the jibb-check-spans test suite
67−:: the empty list, <<>>, when it passes).
67+:: runs it).
68::
68::
69:: ===================================================================
69:: ===================================================================
70:: 2. The layout pass (+layout)
70:: 2. The layout pass (+layout)
@@ -4510,9 +4510,9 @@
4510::
4510::
4511:: Each case parses a source, checks that its spans pass, then moves
4511:: Each case parses a source, checks that its spans pass, then moves
4512:: the span of every node of a kind that starts at a place, as a
4512:: the span of every node of a kind that starts at a place, as a
4513−:: parser bug would, and checks that +check-spans says so. Run it as
4513+:: parser bug would, and checks that +check-spans says so.
4514−:: tools/hoon check-spans-test, which prints <<>> when every case
4514+:: tests/lib/jibb-check-spans.hoon runs it, under eval with
4515−:: passes.
4515+:: tools/test-arms and on the ship.
4516::
4516::
4517++ check-spans-test
4517++ check-spans-test
4518 ^- (list tape)
4518 ^- (list tape)
tests/lib/jibb-check-spans.hoonnew file+8
@@ -0,0 +1,8 @@
1+:: +check-spans catches the spans a parser bug could give: its own test,
2+:: +check-spans-test, plants wrong ends and starts in parsed sources.
3+/+ jibb
4+|%
5+++ test-check-spans
6+ ^- tang
7+ (turn check-spans-test:jibb |=(reason=tape leaf+reason))
8+--
tests/lib/jibb-hoon-reference.hoonnew file+60
@@ -0,0 +1,60 @@
1+:: Hoon translations of Jibb prelude gates against the Hoon arms they
2+:: stand for: zing, lead and late, and succ. They don't execute Jibb,
3+:: test lowering or prove jet recognition.
4+|%
5+:: +zing: Jibb's recursion, translated, against Hoon's zing
6+++ test-zing-reference
7+ ^- tang
8+ =/ flatten
9+ |= xss=(list (list @ud))
10+ ^- (list @ud)
11+ ?~ xss ~
12+ (weld i.xss $(xss t.xss))
13+ =/ cases=(list (list (list @ud)))
14+ :~ ~
15+ ~[~]
16+ ~[~[1 2] ~ ~[3]]
17+ ~[~[0] ~[3 2 1] ~]
18+ ==
19+ %+ murn cases
20+ |= xss=(list (list @ud))
21+ ?: =((flatten xss) (zing xss)) ~
22+ `leaf+"flattening differs from zing on {<xss>}"
23+:: +lead and +late: curried pair constructors, translated, against Hoon's
24+:: on every pair of five nouns, a gate among them
25+++ test-lead-late-reference
26+ ^- tang
27+ =/ make-lead |=(a=* |=(b=* [a b]))
28+ =/ make-late |=(b=* |=(a=* [a b]))
29+ :: Each noun has a name for the failure message: printing a gate
30+ :: would print its whole subject.
31+ =/ items=(list [name=tape noun=*])
32+ :~ ["0" 0]
33+ ["1" 1]
34+ ["'hello'" 'hello']
35+ ["[1 2]" [1 2]]
36+ ["a gate" |=(x=@ud x)]
37+ ==
38+ %- zing
39+ %+ turn items
40+ |= [xn=tape x=*]
41+ %+ murn items
42+ |= [yn=tape y=*]
43+ ?. =(((make-lead x) y) ((lead x) y))
44+ `leaf+"lead differs on {xn} and {yn}"
45+ ?. =(((make-late x) y) ((late x) y))
46+ `leaf+"late differs on {xn} and {yn}"
47+ ~
48+:: +succ: the successor, translated, against Hoon's succ
49+++ test-succ-reference
50+ ^- tang
51+ =/ next |=(x=@ (add x 1))
52+ =/ values=(list @)
53+ :~ 0 1 2 31 255 256 65.535 65.536 4.294.967.295
54+ 18.446.744.073.709.551.615
55+ ==
56+ %+ murn values
57+ |= x=@
58+ ?: =((next x) (succ x)) ~
59+ `leaf+"successor differs from succ on {<x>}"
60+--
tools/check+7−33
@@ -19,11 +19,9 @@ order, on the ship tools/ship talks to: $JIBB_PIER, or /root/urbit/zod
19(tools/ship also reads $JIBB_CLICK and $JIBB_SHIP_LOG). When that ship
19(tools/ship also reads $JIBB_CLICK and $JIBB_SHIP_LOG). When that ship
20isn't running, tools/check starts it first and stops it again at the end.
20isn't running, tools/check starts it first and stops it again at the end.
21
21
22−Each check is one command, run from the repo root. It passes when it
22+Each check is one command, run from the repo root, and passes when it
23−exits 0 and, for the few that print their verdict rather than exit with
24−it, when its output matches what the list expects. Output is kept and
25−printed only for a check that fails (all of it with -v); --logs DIR
23+exits 0. Output is kept and printed only for a check that fails (all of
26−keeps every check's output in DIR/<name>.log.
24+it with -v); --logs DIR keeps every check's output in DIR/<name>.log.
27
25
28Exit status: 0 when every check ran and passed, 1 when a check failed,
26Exit status: 0 when every check ran and passed, 1 when a check failed,
292 when the checks couldn't run (an unknown name, a ship that won't start).
272 when the checks couldn't run (an unknown name, a ship that won't start).
@@ -47,11 +45,10 @@ SHIP = os.path.join('tools', 'ship')
47
45
48
46
49class Check:
47class Check:
50− def __init__(self, name, group, command, expect=None):
48+ def __init__(self, name, group, command):
51 self.name = name
49 self.name = name
52 self.group = group # 'eval' or 'ship'
50 self.group = group # 'eval' or 'ship'
53 self.command = command # argv, run from ROOT
51 self.command = command # argv, run from ROOT
54− self.expect = expect # a regex stdout must match in full
55
52
56 def shown(self):
53 def shown(self):
57 return ' '.join(c if re.match(r'^[\w./=-]+$', c) else "'%s'" % c
54 return ' '.join(c if re.match(r'^[\w./=-]+$', c) else "'%s'" % c
@@ -64,11 +61,6 @@ def tool(name, group='eval', *args):
64 return Check(base, group, [os.path.join('tools', name)] + list(args))
61 return Check(base, group, [os.path.join('tools', name)] + list(args))
65
62
66
63
67−def hoon(name, *args, expect):
68− """A check that runs tools/hoon and compares what it prints."""
69− return Check(name, 'eval', ['tools/hoon'] + list(args), expect=expect)
70−
71−
72# Every check, in the order they start: the eval group, slowest first,
64# Every check, in the order they start: the eval group, slowest first,
73# then the ship group, in the order they must run. Times are from one
65# then the ship group, in the order they must run. Times are from one
74# run on four CPUs (2026-11-03).
66# run on four CPUs (2026-11-03).
@@ -88,17 +80,6 @@ CHECKS = [
88 for i in range(1, ARM_SHARDS + 1)
80 for i in range(1, ARM_SHARDS + 1)
89] + [
81] + [
90 Check('my-app-copies', 'eval', ['tools/test-arms', '--copies']),
82 Check('my-app-copies', 'eval', ['tools/test-arms', '--copies']),
91− # These print their verdict and exit 0 either way.
92− hoon('check-spans-test', 'check-spans-test', expect=r'<<>>\n'),
93− hoon('zing-hoon-reference', '-f',
94− 'tools/testdata/zing-hoon-reference.hoon',
95− expect=r"'Hoon flattening reference: \d+ cases passed'\n"),
96− hoon('lead-late-hoon-reference', '-f',
97− 'tools/testdata/lead-late-hoon-reference.hoon',
98− expect=r"'Hoon lead/late reference: \d+ comparisons passed'\n"),
99− hoon('succ-hoon-reference', '-f',
100− 'tools/testdata/succ-hoon-reference.hoon',
101− expect=r"'Hoon successor reference: \d+ comparisons passed'\n"),
102 Check('doc-blocks', 'eval', ['tools/doc-blocks', 'docs/spec']),
83 Check('doc-blocks', 'eval', ['tools/doc-blocks', 'docs/spec']),
103 tool('testdata/clay-fixtures-selftest'),
84 tool('testdata/clay-fixtures-selftest'),
104 # The ship group. ship-selftest leaves its fixture files on the
85 # The ship group. ship-selftest leaves its fixture files on the
@@ -139,12 +120,11 @@ def run(check, timeout, env):
139 """Run one check; a Result."""
120 """Run one check; a Result."""
140 res = Result(check)
121 res = Result(check)
141 start = time.time()
122 start = time.time()
142− with tempfile.TemporaryFile() as out, tempfile.TemporaryFile() as err:
123+ with tempfile.TemporaryFile() as out:
143 try:
124 try:
144 proc = subprocess.Popen(
125 proc = subprocess.Popen(
145 check.command, cwd=ROOT, env=env, stdin=subprocess.DEVNULL,
126 check.command, cwd=ROOT, env=env, stdin=subprocess.DEVNULL,
146− stdout=out,
147− stderr=err if check.expect is not None else subprocess.STDOUT,
127+ stdout=out, stderr=subprocess.STDOUT,
148 start_new_session=True)
128 start_new_session=True)
149 except OSError as e:
129 except OSError as e:
150 res.why = 'could not run %s: %s' % (check.command[0], e)
130 res.why = 'could not run %s: %s' % (check.command[0], e)
@@ -162,18 +142,12 @@ def run(check, timeout, env):
162 _running.discard(proc.pid)
142 _running.discard(proc.pid)
163 kill(proc.pid) # anything it left running, such as urbit eval
143 kill(proc.pid) # anything it left running, such as urbit eval
164 out.seek(0)
144 out.seek(0)
165− err.seek(0)
166− stdout = out.read().decode('utf-8', 'replace')
145+ res.output = out.read().decode('utf-8', 'replace')
167− stderr = err.read().decode('utf-8', 'replace')
168 res.seconds = time.time() - start
146 res.seconds = time.time() - start
169− res.output = stdout + stderr
170 if res.why:
147 if res.why:
171 return res
148 return res
172 if res.status != 0:
149 if res.status != 0:
173 res.why = 'exit status %d' % res.status
150 res.why = 'exit status %d' % res.status
174− elif check.expect is not None and \
175− not re.fullmatch(check.expect, stdout):
176− res.why = "it didn't print the verdict that means a pass"
177 else:
151 else:
178 res.ok = True
152 res.ok = True
179 return res
153 return res
tools/testdata/lead-late-hoon-reference.hoondeleted−24
@@ -1,24 +0,0 @@
1−:: Hoon translations of curried Jibb pair constructors vs Hoon 2n arms.
2−:: This does not execute Jibb, lower code or verify jet recognition.
3−^- @t
4−=/ make-lead |= a=* |= b=* [a b]
5−=/ make-late |= b=* |= a=* [a b]
6−=/ items=(list *)
7− :~ 0
8− 1
9− 'hello'
10− [1 2]
11− |=(x=@ud x)
12− ==
13−=/ xs=(list *) items
14−|-
15−?~ xs 'Hoon lead/late reference: 50 comparisons passed'
16−=/ ys=(list *) items
17−=/ good=?
18− |-
19− ?~ ys &
20− ?. =(((make-lead i.xs) i.ys) ((lead i.xs) i.ys)) |
21− ?. =(((make-late i.xs) i.ys) ((late i.xs) i.ys)) |
22− $(ys t.ys)
23−?. good 'BAD pair mismatch'
24−$(xs t.xs)
tools/testdata/succ-hoon-reference.hoondeleted−9
@@ -1,9 +0,0 @@
1−:: Compare a Hoon translation of the Jibb successor with Hoon's 2n arm.
2−:: This does not execute Jibb, lower code or verify jet recognition.
3−^- @t
4−=/ next |= x=@ (add x 1)
5−=/ values=(list @) ~[0 1 2 31 255 256 65.535 65.536 4.294.967.295 18.446.744.073.709.551.615]
6−|- ^- @t
7−?~ values 'Hoon successor reference: 10 comparisons passed'
8−?. =((next i.values) (succ i.values)) 'BAD successor mismatch'
9−$(values t.values)
tools/testdata/zing-hoon-reference.hoondeleted−17
@@ -1,17 +0,0 @@
1−:: Compare a Hoon translation of Jibb zing's recursion with Hoon's zing.
2−:: This does not run Jibb, test lowering, or prove jet recognition.
3−^- @t
4−=/ flatten |= xss=(list (list @ud))
5− ^- (list @ud)
6− ?~ xss ~
7− (weld i.xss $(xss t.xss))
8−=/ cases=(list (list (list @ud)))
9− :~ ~
10− ~[~]
11− ~[~[1 2] ~ ~[3]]
12− ~[~[0] ~[3 2 1] ~]
13− ==
14−|-
15−?~ cases 'Hoon flattening reference: 4 cases passed'
16−?. =((flatten i.cases) (zing i.cases)) 'BAD Hoon flattening mismatch'
17−$(cases t.cases)