/ Stream
build 2026.12.03 · --:--:-- UTC · RSS

BabbTools for the frontier.

mascot mascot
All materials

Direction-bit test — report (Stage D prep)

DIRECTION-BIT-REPORT.md View the source file

Run: Sun 2026-11-29, Python stdlib only, local. Files: direction_bit_test.py (the test) and this report, in ~/workspace/stream-unfolding-work/direction-bit/. Reproduce: python3 direction_bit_test.py in that directory. It imports the Stage C harness (model.py) from ~/workspace/stream-stage-c/ unchanged. No GitHub writes, no Lab tool work, no repo writes of any kind.

Material tested: the note 16b transcript (L:1–L:16), the 75-entry kernel-model corpus, the mark-boundary entry-exit fixture, and the three v0.1 compact-header presets.

Sources:

  • Candidates and observables: ~/workspace/stream-unfolding-lab-prep/02-direction-bit-test.md.
  • Corpus + harness: ~/workspace/stream-stage-c/ (copies of babbworks/stream docs/kernel-model/test/ at main 7761b9a).
  • Transcript: docs/creation/review/16-seed-dependencies-and-bootstrap-transcript.md (note 16b) at main 5d18970.
  • Fixture: experiments/mark-boundary/ (entry-exit.json, checker.py, README.md, premises.json) at main 5d18970.
  • Presets: docs/compact-header/bitpack-header-draft-v0.1.md and bitpack-header-test-vectors-v0.1.md at main 5d18970.
  • Family direction contracts: note 19 §5 and §7 (docs/creation/review/19-generative-world-model-and-matrix.md).
  • The dispute's earliest record: docs/creation/analysis/01-origin.md: "The specifications disagree with each other on some verb numbers and on the meaning of the direction bit."

The table

CandidateO1 to legs conserveO2 entry/exit fixtureO3 grant/revocationO4 75/75 verbsO5 v0.1 presets
D1 crossingFAILPASSFAILFAIL (4/75)FAIL (2/3)
D2 claim polarityFAILFAILPASSFAIL (71/75)FAIL (2/3)
D3 flowPASSFAILFAILFAIL (6/75)FAIL (1/3)
D4 operand directionPASSFAILFAILFAIL (38/75)PASS (3/3)
D1b (supplementary: note 19 §5 per-relation composite)PASSPASSPASSFAIL (71/75)PASS (3/3)

No candidate passes all five observables. Each uniform candidate passes exactly the observable(s) of its home family — D1 the fixture, D2 the grant pair, D3 the to fold, D4 the presets — and fails the rest. The supplementary composite D1b passes four of five and fails O4 on 4 named entries (see below).

The honest outcome: the direction bit is not one bit

No single uniform meaning of D survives all five observables. What does survive, observable by observable, is note 19 §5's per-relation reading: IN open/close, IS assert/withdraw, MAY grant/revoke, TO incoming/outgoing. That is not one bit with one meaning — it is one bit whose interpretation is selected by the relation. The test therefore returns the outcome the test design named: the direction bit is not one bit.

What that implies, in order of increasing change:

  1. Keep one bit, make its meaning explicitly per-relation. The bit stays in the header and in the 7-bit position, but its contract is written as four relation-specific rules (note 19 §5), not as one sentence about "direction". This is the smallest change that fits the evidence — and it is already what the sources do in practice. It requires the two O4 refinements below to be decided, not assumed.
  2. Split the bit. If a per-relation reading is judged too implicit to carry in one bit, the polarity axes split: a membership axis for IN/MAY facts, a flow axis for TO facts, a claim axis for IS facts. That costs bits and a layout change, and needs a decision, not a silent drift.
  3. Move polarity into the verb/role. Drop D as an independent bit and let the verb (GRANT vs REVOKE, OPEN vs COMMIT) or the role carry the polarity. The GRANT/REVOKE pair already works this way in effect — the two verbs differ in nothing but D — so this would be naming what is already true for MAY, at the cost of the same treatment everywhere.

The test does not choose between these. Morgen decides. The table is the evidence for that decision.

Method note (read before disputing a count)

Every prediction rule in the script reads the entry's verb, phase and payload only. No rule reads the stored code or the stored D — that would be circular, since the test is whether the candidate's rule, applied to the entry's content, reproduces the stored D. A prediction of None means the candidate's rule assigns no D to that entry at all; that counts against verb recovery, because the v0.1 header carries a direction field on every line — a bit that is undefined for most lines is not a working bit. The full rules, with their justifications, are in the script's docstrings; the per-verb rules for O4 are stated in the O4 section below.

O1 — Do to legs conserve?

The published fold (test_books.py rule B) posts every to fact subject → object and ignores D entirely — it is D-agnostic. The test therefore builds a D-driven fold: the same fact selection as rule B (12 to facts over the corpus once superseded entries are excluded: 2 leg-pair facts, 10 use facts; the demo PAY [10] is superseded by the AMEND [23] and excluded), but the signs come from each candidate's reading of the fact's stored D. The check is whether the D-driven fold reproduces rule B's Books over the same corpus.

Reference (rule B) Books over the corpus: host:build-01 −419 J, −21,450 ti, −1,179 to, −51.6 xs; human:ops-lead −188 USD; task-83 the mirror image (+419 J, +21,450 ti, +1,179 to, +51.6 xs); vendor:model-api +188 USD. (These differ from the published demo-only table because the corpus also folds the your-log PAY and QUERY use facts.)

  • D3 PASS, D4 PASS. Both read D=1 as subject → object, so their folds are identical to rule B. Note the equivalence: on TO facts, D4's rule ("the transition leaves the subject") folds exactly like D3's ("outflow from the subject"). D4's pass here is D3's pass in different words — and D4's rule is silent on a D=0 TO fact (a transition entering is not covered), of which the corpus happens to contain none.
  • D1 FAIL — all 12 pair sums break. D1 reads the fact's D as the crossing direction of the operand, applied at both ends: D=1 means the quantity leaves each end's boundary. Every to fact in the corpus carries D=1, so every pair folds as two outflows. Concrete: the AMEND [23] legs fold as −89 and −89 USD (pair sum −178, not 0); the PAY [71] legs as −99 and −99; the QUERY) [14] use facts as −7,150 and −7,150 ti, −393 and −393 to; the ACT) [17] use facts as −343 and −343 J, −24.5 and −24.5 xs; the ACT) [19] use facts likewise for J, ti, to, xs. The folded Books get every source side right and every destination side wrong: task-83 −419 J (reference +419 J), vendor:model-api −188 USD (reference +188 USD). A transfer cannot be one crossing of one boundary — it is an exit from one boundary and an entry into another, and one bit cannot say both.
  • D2 FAIL — the fold posts nothing. D is claim polarity; it assigns no flow sign to either end of a transfer. The D2-driven fold is empty ({}) against the reference's ten nonzero balances. A D2 reader would have to fold from the payload signs and ignore D — which concedes the bit is silent on to facts. Supporting evidence: every to fact in the corpus carries D=1, which under D2 reads as withdrawing the claim that the transfer happened — so under D2 the corpus asserts no transfer at all.

O2 — Are entry/exit signs consistent with the mark-boundary fixture?

The script re-runs the fixture locally (a condensed re-implementation of checker.py): mark → enclose [] → relocate 1 null→2 → relocate 1 2→null. Verified: spellings * → *() → (*) → *(); entry delta +1, exit delta −1; a query about the enclosure before its birth (inside(1,2) at the state after step 1) returns undefined, never "outside" and never zero.

  • D1 PASS. Entry reads D=0 (into), exit reads D=1 (out of), and the pre-birth query is undefined — D1 is the only candidate whose semantics even includes a boundary's birth.
  • D2 FAIL, D3 FAIL. The relocation steps are not claims (D2) and carry no conserved quantity (D3); both candidates assign no D to either step, and neither has any rule for a pre-birth state.
  • D4 FAIL. Entry reads D=0 (the mark is a referent entering the boundary) but the exit step is undefined: a referent leaving is not covered by D4's rule (only referent-entering is D=0 and transition-leaving is D=1). Under the alternative transition-operand reading the exit is D=1 but the entry is then undefined — either uniform reading fails one step.

Transcript cross-check (note 16b L:15, supplementary to O2). The move of A from B into C has three membership deltas at once: direct membership in C +1, immediate parenthood under B −1, transitive membership in B 0. No single D value matches all three; D1 needs a named boundary as an argument, which the bit does not carry. One act, three signs — the bit cannot encode the move without saying which query it answers.

O3 — Does grant/revocation invert cleanly?

GRANT is 0x0C, REVOKE is 0x0D: the pair differs in nothing but D, so this observable is a direct test of whether D carries the permission polarity. The script replays the transcript (L:14 issue creates grant G; L:15 move consumes G and retires parent q9 and emits parent(A,C); L:16 retry with the spent grant and stale parent is refused — all reproduced), then runs a synthetic GRANT-then-REVOKE of corpus GRANT [9] (GRANT host:build-01 {for: agent:*, may: record, to: host:build-01}) and checks whether authority returns to exactly its pre-GRANT state.

  • D2 PASS. GRANT reads D=0, REVOKE reads D=1 — distinct, so the REVOKE removes exactly the grant named and the state returns.
  • D1 FAIL, D3 FAIL. A grant is not a boundary crossing (D1) and carries no conserved quantity (D3); both assign no D to GRANT or REVOKE, so the reader cannot tell the two verbs apart by the bit at all — the pair collapses onto one coordinate.
  • D4 FAIL. Under the uniform subject-operand rule GRANT reads D=0 (the grantee, a referent, enters the allowed set) but REVOKE is undefined (a referent leaving is not covered). Under the uniform transition-operand rule GRANT would predict D=1 (a transition leaving the granter), contradicting its stored 0. Either uniform rule fails; D4 can match both stored values only by switching the operand reading between the two verbs.

The second half of O3 — a grant created by an action must not satisfy that action's own check — holds under all four candidates, so it does not discriminate: it is a property of prefix evaluation (note 16b §2: admission is evaluated under prefix-effective knowledge; at the pre-L:14 prefix G does not yet exist), not of D. It is recorded here as passing everywhere, not as evidence for any candidate.

O4 — Do the 75 corpus entries keep their verb names?

Each candidate's content-based rule predicts the main fact's D for all 75 entries; a mismatch changes the code (the verb is lost or collides), and an undefined prediction leaves the coordinate incomplete. Baseline under the stored convention: 75/75.

Verb distribution in the corpus: CREATE 26, OPEN 11, MEASURE 10, ACT 6 (4 begin, 2 end), COMMIT 5, QUERY 4 (2 begin, 2 end), AMEND 3, BIND 2, GRANT 2, PAY 2, NOTE 2, ACK 1, ESTIMATE 1.

  • D1: 4/75 (4 correct, 2 wrong, 69 undefined). The narrow crossing rule speaks only to the ACT's run membership: begin predicts 0 (correct, [12], [16], [67], [70]) and end predicts 1 (wrong, [17], [19] — stored 0). Everything else is undefined: no other main fact records a referent crossing a named boundary.
  • D2: 71/75 (71 correct, 4 wrong, 0 undefined). Failing entries: PAY [10] and [71] (a payment asserts a transfer occurred, so D2 predicts 0; stored 1 — the code reads the payment as outgoing flow, not as a claim) and R:ACT) [17] and [19] (end-phase withdraws the act's run membership, so D2 predicts 1; stored 0).
  • D3: 6/75 (6 correct, 0 wrong, 69 undefined). Correct only where a flow is actually carried: PAY [10], [71] (outflow from the payer) and QUERY)/ACT) with use — [14], [68], [17], [19] (inflow to the task). A sample value (MEASURE ×10) and a claimed quantity (ESTIMATE) are not flows, and no IN/IS/MAY main fact carries one.
  • D4: 38/75 (38 correct, 7 wrong, 30 undefined). Wrong: QUERY ×4 ([13], [14], [68], [69] — a query is a transition leaving the asker, so D4 predicts 1; stored 0) and AMEND ×3 ([22], [23], [24] — the new value is a referent entering the register, so D4 predicts 0; stored 1). Undefined: OPEN ×11, MEASURE ×10, COMMIT ×5, BIND ×2, ACT end ×2 (a segment being created or sealed, a sample, a binding, and a referent leaving are all outside D4's two clauses).

The ACT-end entries [17] and [19] fail under D1, D2 and D1b alike. Every content-based rule that reads "end = closing / withdrawing" conflicts with ACT's stored D=0. The model's phase mechanism already carries the close (begin/end marks); D re-encoding it double-counts the same distinction. That is the single most robust O4 finding: it is not an artifact of one candidate's rule.

D1b (supplementary): 71/75 (71 correct, 4 wrong, 0 undefined). Failing entries: R:QUERY( [13] and [69] (the question goes out, so the TO rule predicts 1; stored 0) and R:ACT) [17] and [19] (the IN rule predicts closing → 1; stored 0). D1b is the per-relation composite, so its O4 failures name exactly where the composite itself breaks: the phase/D double-encoding (ACT end) and the act/flow ambiguity (QUERY begin, where the question goes out but the code says incoming because the tokens come in). Two refinements would be needed for the composite to pass O4: (a) state that phase, not D, carries open/close for IN verbs; (b) state the TO rule's anchor for a query-begin, which carries no observable flow in its payload. Both are decisions for Morgen, not conclusions of this test.

O5 — Does the corpus's direction bit agree with the v0.1 header's?

The script decodes the three presets independently from the published vectors (alphabet, MSB-first, short-header layout) and verifies them: QToB4 → position 32, end, direction out (1), delta 60; UpgALACAHT → position 41, begin, direction into (0), delta 5; I5wlhYAADe → position 17, sample, direction into (0), delta 1200. All three vectors verify, including the XOR-fold check bits on the two extended headers. The preset acts are then read under each candidate:

  • D1: 2/3. ACT end steel transfer → out (1) ✓; ATTEND begin → into (0) ✓; FAIL sample → no boundary crossing described, undefined ✗.
  • D2: 2/3. ACT end steel → asserts a transfer (0) ✗ against preset 1; ATTEND begin → asserts attendance (0) ✓; FAIL sample → asserts a failure (0) ✓.
  • D3: 1/3. ACT end steel → steel flows out (1) ✓; ATTEND begin and FAIL sample move no conserved quantity, undefined ✗✗.
  • D4: 3/3 PASS. Steel transfer → the transfer is a transition leaving the source (1) ✓; ATTEND begin → the attendee is a referent entering the event (0) ✓; FAIL sample → the sample is a referent entering the record (0) ✓. The FAIL reading is the softest call in O5 (see sensitivities): it infers the operand kind from the preset's grid position (17 = IN), which the preset text does not state.

Sensitivities (where a different reading would change a count)

These were checked; none changes the verdict (no candidate passes all five under any of them):

  • D2 on PAY (O4): the report's rule reads a payment as asserting a transfer (D=0 → wrong). Reading it as withdrawing the funds' membership in the payer's holding gives D=1 (correct) and D2 becomes 73/75 — still failing on the two ACT-end entries.
  • D1b on QUERY begin (O4): reading the query act as bringing information in (D=0) instead of sending a question out (D=1) gives D1b 73/75 — still failing on the two ACT-end entries.
  • D4 on the FAIL preset (O5): reading the failure sample's operand as a transition rather than a referent makes V07 undefined and D4 2/3 — which would leave no candidate passing O5.
  • D1 strict (O4): refusing the ACT begin/end = entry/exit reading (the run is a scope, not a boundary) drops D1 from 4/75 to 0/75.
  • D3 on QUERY)/ACT) main facts (O4): ruling that the flow lives in the attached use facts, not the main fact, drops D3 from 6/75 to 2/75 (PAY only).

Caveats

  • Preset positions ≠ kernel-model positions. The presets' position numbers (32, 41, 17) do not match the kernel-model POS table (ACT 0x60, ATTEND 0x68, FAIL unlisted), and each preset's grid D (from its position number) disagrees with its header direction bit. The lab presets use their own position map. O5 therefore tests the presets' direction bits against the candidate readings of the acts, not the position numbers — and the mismatch itself is worth a look before the header is frozen.
  • The D-driven fold is the test's construction. The published Books fold ignores D; O1 asks what happens when the fold is driven by D instead. A candidate that "passes" O1 by having its D-reading coincide with the D-agnostic fold (D3, D4) has shown its D is consistent with the Books, not that the Books need its D.
  • The transcript replay is a harness check, not a discriminator. It reproduces note 16b's stated outcomes (L:15 succeeds, L:16 refused); the candidate-dependent part of O3 is only the GRANT/REVOKE distinguishability.
  • Coverage. The corpus exercises 13 verbs and 13 of the 128 positions (Stage C). These results are evidence about those positions, not a proof about all 128 — in particular, no REVOKE entry exists in the corpus, so O3's REVOKE half is synthetic.