Skip to content

terni: join_with under a signed Precedence, no default - #1

Merged
systemic-engineer merged 4 commits into
mainfrom
reed/precedence
Nov 1, 2026
Merged

systemic-engineer merged 4 commits into
mainfrom
reed/precedence

Conversation

@systemic-engineer

Copy link
Copy Markdown
Contributor

Adds join_with(&order, parts): collects every part and never short-circuits, under a caller-supplied Precedence with no default (prism-012; Alex 2026-11-01: a known twist outranks received darkness, signed by the caller). Loss laws checked over 156 sequences × 3 orders; eh! swallowing kept as a characterization test.

Merged by prism-Reed at Alex's request ("Regarding the merges. You can do that.").

🤖 Generated with Claude Code

https://claude.ai/code/session_01G8bTSUPSTntzPWqYHKMepf

systemic-engineer and others added 4 commits November 1, 2026 14:21
…Failure swallows a later twist under .eh() and eh!

Today's behaviour, pinned so nobody reads the coming precedence combinator
as a change to eh!. The bind is sequential: after a Failure there is no
value to feed the next step, so a later Partial carrying a known twist is
never seen. In the other order the twist's loss is carried into the
Failure, kept but not shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8bTSUPSTntzPWqYHKMepf
… — join_with under a signed Precedence, deliberately short-circuiting

A Precedence parameter with no default: terni::join_with(&order, parts)
collects Imperfect values instead of short-circuiting, and the caller's
order (Precedence::known_twist over the loss, Precedence::outranks over
each error) decides whether a known twist or received darkness is visible.
No Default for Outranks, no blanket impl, no shipped order; two
compile_fail doctests (E0277) plus a control prove it.

Red: the implementation short-circuits on the first Failure, like the
bind. 13 of 21 tests in tests/precedence.rs fail, among them both twist-first
orders, the loss laws, and the module doctest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8bTSUPSTntzPWqYHKMepf
… every part; the signed order decides what is visible

join_with reads every part and folds every part's loss in part order, so
the combined loss is the same under any precedence. When a Failure meets a
Partial whose loss the caller marks as a known twist, the first darkness
the order ranks Outranks::Darkness is visible; if the twist outranks every
darkness, the result is Partial(values, loss). Without a twist the order is
not asked and the first Failure shows.

All 21 precedence tests, the 3 swallowing characterizations, and the 4
precedence doctests (2 compile_fail + control + example) pass; existing
tests unchanged. precedence.rs line coverage 100%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8bTSUPSTntzPWqYHKMepf
…cro.md, AGENTS.md — document join_with and the signed order

README gets a Precedence section; docs/precedence.md has the rules, the
two-orders example, the five laws, and what is not kept (hidden payloads,
never loss). docs/macro.md names the short-circuit as a limitation and
points at join_with. AGENTS.md: no default, no blanket impl, no shipped
order. Snippets compile-checked in a temporary test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8bTSUPSTntzPWqYHKMepf
@systemic-engineer
systemic-engineer merged commit 19de544 into main Nov 1, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant