Witness the typed-atom profile's rules and correct the oracle where they differ

Open
#390 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
18/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start with the oracle tests in crates/ambyte-oracle/src/tests/ and the test plan at docs/topics/ambyte-oracle/test-plan.md; compare the owed witnesses and gaps G1–G10 against the specification’s Table 10 records in docs/SPEC_ambyte-core-semantics-v0.md. Work through one witness at a time using the stated RED/GREEN process, and record each result in the test plan and its rule record. Done means every owed witness is cited and each known gap is closed with RED/GREEN commands or recorded as needing a decision.

Written by the indexing model from the issue text.

Description

enhancement type: goalpost

Title: Witness the typed-atom profile's remaining rules, and correct the oracle where it differs from them

.dag: issue-dag/2
.id: ambyte-lang/ambyte#390
.kind: task
.type: test
.blocked_by: []
.size_hours: 8

Task

Outcome

Every rule that Section 1.5 of the Ambyte specification adopts for the typed-atom profile has the executable witness its Table 10 record still owes, and every known gap between the reference oracle and those rules (Section 2) is closed or decided. The owner granted a specification-first exception for #392 on 2026-11-30; this issue holds what that exception deferred.

Scope

Tests in crates/ambyte-oracle/src/tests/, rows in docs/topics/ambyte-oracle/test-plan.md, the oracle corrections listed below, and the Table 10 records of docs/SPEC_ambyte-core-semantics-v0.md, updated as each witness lands. P6's witness belongs to Echo and is listed only to track it.

Out of scope

  • Changing any rule. If a witness shows that a rule is wrong, open a decision issue.
  • The L1 proof text, and any law of Section 5 for the typed-atom profile.
  • Witness W9.

Prerequisites

None. All rules below were adopted on 2026-11-30 (flyingrobots/amblicit#386).

Safe intermediate state

Each witness lands on its own. Follow RED/GREEN: plan the case, observe RED where the oracle differs, then correct it.

Acceptance

  • Each witness below exists, is named in the oracle test plan, and is cited in the rule's Table 10 record.
  • Each gap in Section 2 is closed with its RED and GREEN commands reported, or recorded as needing a decision.
  • No rule text changes.

Already witnessed (flyingrobots/amblicit#392)

Rule Witnessed
TA-Cap ORACLE-TP-020 to ORACLE-TP-023: empty grant, both grants, no typed read, read in an unselected arm
P1 Checks S1 to S4, S7 and S8 (literal and loop) with positive controls; S1 for a write, S3 for an if, and S8 for an address in a list literal (ORACLE-TP-047 to ORACLE-TP-049); their parameter-fed firing results, the loop join (Bytes, address, Bytes then U64), and address and Bytes call arguments (ORACLE-TP-030 to ORACLE-TP-036)
P2 operand_type for < on two Bytes and on two addresses; check S6 (ORACLE-TP-024 to ORACLE-TP-026)
P4 A U64 argument as the operand; check S5; an address constant read (ORACLE-TP-027 to ORACLE-TP-029)
P5 A fully pinned mixed semantic set without a typed read (ORACLE-TP-037); the tariff pin at AdmittedContext::admit, with synthetic tariffs moved to a test-only fixture route (ORACLE-TP-038)
First profile The typed-atom run-time rules do not change first-profile results for a mistagged slot (ORACLE-TP-041 to ORACLE-TP-043)
P7 A successful read under the single root key, with an empty proposal (ORACLE-TP-039)

1. Owed witnesses, by rule

Rule Witness
TA-Values != on two Bytes (= on two unequal Bytes is witnessed by failed_guard_after_a_read_refunds_nothing)
E-ReadAtom A read inside a callee that fails, whose callee result and join are then inactive
TA-Obs F4's count includes a failing typed atom read; slot and atom dependencies ordered in one observation
TA-Viol Basis mismatch ($b_I \ne \mathit{id}_S$) under the typed-atom profile; F5 under ambyte-tariff/2
TA-Cap A typed atom read inside a loop and inside a callee, without the capability
P1 A parameter-fed Bytes value as an if condition, giving the violation at firing (the static S3 case for if is witnessed); an address constant as a fold initializer, read in each round and after the join ($C = 33$, $U = 42$); a callee-local Bytes constant or typed read result used as a key fragment and refused by S2
P2 < on a Bytes call result gives operand_type
P3 See G1
P4 A call or join result that is not an address, as the read operand, gives the violation
P5 See G2 and G3
P6 (Echo, ruling C008) A package with $M = 16$, static bound 24 and carried $U = 13$, refused at installation; F5 is not reached for $C = 13$. Tracked in Echo
P7 See G4

2. Known gaps between the oracle and the specification

Every known place where the reference oracle does not do what the typed-atom rules require. Every file and line in this issue refers to e8a5cb2e, the final head of flyingrobots/amblicit#392, and was checked against it. Paths are under crates/ambyte-oracle/src/. Each landed in #392 under the owner's specification-first exception.

This list records the gaps known at this commit. They were found by two passes over the specification and by seven rounds of independent review. It is not claimed complete. A gap found later is added to the oracle topic shelf's table and to flyingrobots/amblicit#390, and is covered by the owner's specification-first exception in the same way.

# Rule Oracle today Owed
G1 P3, basis domain MemoryBasis keeps attachments in BTreeMap<(WarpId, NodeId), Attachment> (harness/atoms.rs:25), one per node, so the refused basis cannot be presented A basis type that presents several attachments at a node; a witness that such a basis, with one matching atom, is refused before evaluation (ORACLE-TP-011)
G2 P5, version sets admit accepts the first profile's semantic pins with ambyte-tariff/2 (the Profile::First arm, context.rs:127, checks only typed-atom constructs) A refusal of that set, and its witness. This changes the first profile's admission, so it needs the owner's agreement first
G3 P5, version sets The oracle represents no host profile, so the host-profile pin (Table 2, $V_{\text{host}}$) is not checked A representation of the host-profile pin, its refusal and witness
G4 P7, coverage (interim) The in-memory host returns at a language failure (harness/settle.rs:20); Decision has no place for coverage evidence Uncovered atom dependencies recorded beside Failed, and kept beside Aborted when a peer's violation aborts the tick (Echo ruling C007; ORACLE-TP-040). The specification does not fix the form of this host evidence
G5 Section 1.5, "Unchecked entry"; P1, P5 AdmittedContext (context.rs:25) stores no identity of the plan it was admitted for, and evaluate (evaluator/mod.rs:74) does not re-run the static checks. A host can evaluate a plan that S6 refuses through with_bound_unchecked (context.rs:171) or through a context admitted for another plan Bind an admitted context to its plan, so evaluate refuses a substituted or unchecked plan; a witness for each route. The fourth and fifth independent reviews of #392 found both routes
G6 P1, value roles The invocation's arguments are bound without a check of their kind (evaluator/mod.rs:120 to :124), so a plan argument that is a list holding a Bytes value or an address is accepted and can be returned A check of the typed-atom invocation domain at entry, with its disposition specified (Section 2.5 admits scalar arguments, extended by Table 1j to the two new kinds, not lists); a witness. The first profile's path stays unchanged
G7 Section 2.2 and the other admission rules (inherited, now in the typed-atom contract) The table "Admission rules and where the oracle enforces them" in docs/topics/ambyte-oracle/README.md lists the known gaps: 35 expanded rows, including one host evidence row (28 physical rows), 18 known gaps. It is not claimed complete. One entry per gap follows (G7a to G7n, with rule 5's key and call roles as G7h and G7h2); G1 to G3 cover the remaining three Refusal at typed-atom admission for each, with a witness, unless the specification is changed instead
G7a 2.2 rule 1: names in scope Checked as each region is instantiated, so an unbound name in a region never entered is never checked (evaluator/structure.rs:203) A plan returning an unbound name, refused at admission
G7b 2.2 rule 1: call arity Not checked; parameters are zipped with arguments (evaluator/structure.rs:157). f() calling f(x) whose body returns const U64(1) is admitted, value U64(1), charge 5 That plan refused at admission
G7c 2.2 rule 3: unique sites Not checked Two steps at one site, refused
G7d 2.2 rule 4: after names a write Not checked; any bound name is accepted as an input (ir.rs:218, after appended at :231) A write whose after names a constant, refused
G7e 2.2 rule 5: arithmetic operand types At firing, operand_type (harness.rs:149). b = const Bool(true), arith<+, U64>(b, b) is admitted That plan refused at admission
G7f 2.2 rule 5: require and if conditions are Bool At firing, a violation (evaluator/mod.rs:366, :372) c = const U64(1), require c, refused
G7g 2.2 rule 5: a written value's type At firing, a violation (evaluator/slots.rs:49) v = const Str("a"), write<U64>(k, v), refused
G7h 2.2 rule 5 and Table 1j: key names of a permitted kind At firing, a violation for Unit, List, Bytes and typed addresses (evaluator/slots.rs:75; the Bytes case is witnessed by a_bytes_argument_in_a_key_is_a_violation_reported_alone) A key naming a loop's list, refused at admission
G7h2 2.2 rule 5 and Table 1j: call arguments of a permitted kind At firing, a violation for Unit and List only (evaluator/structure.rs:149); Bytes and typed addresses are permitted arguments A call passing a loop's list, refused at admission
G7i 2.2 rule 6: distinct parameters; fold index differs from accumulator When evaluation starts (evaluator/wellformed.rs:21, :45, called at evaluator/mod.rs:109) Parameters x, x, refused at admission
G7j 2.2 rule 7: a literal-only key is canonical When evaluation starts (evaluator/wellformed.rs:72) has("a//b"), refused at admission
G7k 2.5: $U \le B$ at admission Not checked; the oracle takes no delegated budget A budget input and its refusal
G7l 2.8: canonical basis slots Not checked (MemoryBasis in harness.rs) A basis slot a//b refused before evaluation
G7m 2.8: a string read from the basis and used as a key fragment needs a proof or a checked admission restriction, otherwise the invocation is not admitted Not checked: admit sees no basis or selector evidence; the evaluator rejects the rendered key at firing (evaluator/slots.rs:75). A basis slot sel holding Str("a//b"), s = read<Str>("sel"), has(s): admitted, a violation when the key renders The admission restriction, or the proof obligation, of Section 2.8, with that fixture as its witness
G7n 1.2 and P5: every versioned part pinned Profile::of treats an absent first-profile entry as the first profile's version, for legacy contexts (profile.rs:78). An empty semantic-version map, tariff 1 and a constant plan are admitted. Base behaviour, preserved A ruling on whether legacy contexts stay accepted; if not, the refusal and its witness. This changes the first profile's admission, so it needs the owner
G8 P7 and W9 P7 refuses a successful typed read at settlement, so W9's successful read cannot settle and commit The owner's decision on keys over typed addresses, or another rule (flyingrobots/echo#1102); then the oracle follows
G10 P1, role walk Eight reachable branches of roles.rs fail no test when removed: S2 on a read's key and on a write's key (the slot call in the Op::Read and Op::Write arms of step); the evident kind of a name bound by arith, cmp, has or a slot read (evident); the walk into an if's then-arm; the loop index's and the fold accumulator's entries in scope; the fold's exemption from S8; the walk into a callee's body One admission witness per branch, each failing when its branch is removed

The specification decides these rules; the oracle follows them. The oracle's current behaviour is evidence of what it does, not of what the rules are.

7. Related Issues

flyingrobots/amblicit#393 (inherited: a first-profile loop collecting values of different types), flyingrobots/amblicit#386, flyingrobots/amblicit#388, flyingrobots/amblicit#392.

Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flyingrobots/edict

All issues in flyingrobots/edict

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.