interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / plans / atemporal / AT0_RESULT_V2.md

155 lines · 15138 bytes Raw Blame History Rendered
1# AT0_RESULT_V2: AT-0 result interchange contract
2
3**Contract:** `AT0_RESULT_V2`. **Domain tags:** `omega.at0.verdict.v2` (verdict identity), `omega.at0.evidence.v2` (evidence digest).
4**Status:** FROZEN on merge of the pull request that adds this file. After that, any change to this file is a contract change and requires `AT0_RESULT_V2` (charter section 8).
5**Owner:** Agent 0 (charter section 7). **Program status:** NOT_RUN.
6
7## 0. Changes from AT0_RESULT_V1
8
9AT0_RESULT_V1 stays frozen and readable (`AT0_FREEZE.md`); no evidence was ever written under it. V2 differs from V1 only in:
10
11- the five version strings: header `OMEGA-AT0-RESULT v2`, `domain omega.at0.result.v2`, `contract AT0_RESULT_V2`, verdict tag `omega.at0.verdict.v2`, evidence tag `omega.at0.evidence.v2`;
12- the trivial-kernel rule (sections 1, 3, 4): V1 did not say how the `label` and `clock_probability` lines are written when the kernel of `H_total` is empty, so two V1-conforming implementations could disagree. Reported by Agent 1 on 2026-10-09; ruling on aien-dev/omega#358.
13
14`case_contract` stays `AT0_CASE_V1`. AT0_CASE_V1 is unchanged.
15
16A result records one execution of one AT0_CASE_V1 case: the computed numbers, how precise they are, the verdict, and where everything came from. It keeps two things apart:
17
18- **Semantic content** (exact text, may carry an identity): the case, the acceptance rules, and the discrete verdict.
19- **Physical execution evidence** (no identity): computed floating-point values, bounds, toolchain, host, wall-clock times and artifact digests.
20
21## 1. File shape
22
23The byte rules and encodings of AT0_CASE_V1 sections 1 and 2 apply unchanged, with one addition: the `f64:` value token of section 2 below. Lines appear in exactly this order:
24
25```
26OMEGA-AT0-RESULT v2
27domain omega.at0.result.v2
28contract AT0_RESULT_V2
29case_contract AT0_CASE_V1
30case_name <name>
31<the case's semantic block, byte-identical, begin semantic .. end semantic>
32<the case's acceptance block, byte-identical, begin acceptance .. end acceptance>
33case_id <digest>
34acceptance_id <digest>
35case_file_sha256 <digest>
36begin numerics
37arithmetic <BINARY64|BINARY64_INTERVAL|BINARY64_COMPENSATED|NONE>
38bound_kind <RIGOROUS|ESTIMATED|NONE>
39threads 1
40end numerics
41begin values
42physical_state_kernel_dim <integer>
43constraint_residual <value> <bound>
44povm_residual <value> <bound>
45label <k> <label> <DEFINED|UNDEFINED|INDETERMINATE> (repeated, k = 0 .. M-1)
46clock_probability <k> <value> <bound> (repeated)
47pauli <k> <AXIS> <SIGN> <value> <bound> (repeated)
48reference <k> <AXIS> <SIGN> <value> <bound> (repeated)
49end values
50begin verdict
51check <check_name> <PASS|FAIL|INDETERMINATE|NOT_EVALUATED> (repeated, fixed order of section 4)
52outcome <PASS|FAIL|ERROR|NOT_RUN>
53failure_codes <code>,<code>,... | none
54error_code <code> | none
55expectation_met <YES|NO|NOT_APPLICABLE>
56end verdict
57verdict_id <digest>
58begin provenance
59source_repo <owner/name>
60source_commit <40 lowercase hex>
61source_tree_clean <YES|NO>
62contract_commit <40 lowercase hex>
63engine_sha256 <digest>
64oracle_repo <owner/name>
65oracle_commit <40 lowercase hex>
66oracle_sha256 <digest>
67build_cc <text>
68build_flags <text>
69host <text>
70run_started_utc <YYYY-MM-DDTHH:MM:SSZ>
71run_finished_utc <YYYY-MM-DDTHH:MM:SSZ>
72artifact <path> <digest> (repeated, sorted by path bytewise; may be absent)
73end provenance
74evidence_digest <digest>
75end
76```
77
78`AXIS` is `X`, `Y` or `Z`; `SIGN` is `PLUS` or `MINUS`. The `pauli` and `reference` lines are ordered by `k`, then axis `X, Y, Z`, then `PLUS, MINUS`. For a label whose status is not `DEFINED`, its six `pauli` lines carry the value token `undefined` and bound `0@0`, and its six `reference` lines are still written (the reference does not depend on the label being reachable). **Trivial kernel:** when `physical_state_kernel_dim` is `0`, or `Psi` is exactly zero, every `label` status is `UNDEFINED`, every `clock_probability` line carries `undefined` and bound `0@0`, every `pauli` line carries `undefined` and bound `0@0`, `constraint_residual` carries `undefined` and bound `0@0`, and the `povm_residual` and `reference` lines are still written with real values. The line count and order never change. `<text>` is 1 to 200 bytes of 0x20..0x7E with no leading or trailing space.
79
80`case_name`, the two blocks, `case_id` and `acceptance_id` are copied from the case. A writer must refuse to emit a result whose blocks do not reproduce the copied identities.
81
82## 2. Numbers in a result
83
84- **Value token:** `f64:` followed by 16 lowercase hex digits of the IEEE-754 binary64 bit pattern, written most-significant digit first (the integer value of the 64-bit pattern, not the byte order in memory). `-0.0` is written as `+0.0` (`f64:0000000000000000`), the same rule omega uses in `src/estimation/est_types.c`, `src/dual/rx_dual.c` and `src/ans/`. NaN and infinity are never written as `f64:`. A non-finite computed value is written as the token `nonfinite` and forces failure code `NONFINITE_VALUE`. `undefined` is used only where sections 1 and 3 say (non-`DEFINED` labels, trivial kernel); a parser refuses it anywhere else.
85- **Bound token:** a scaled decimal (AT0_CASE_V1 section 2): a claimed absolute error bound on the value, in the same units. `bound_kind` says what kind of claim every bound in the file is:
86 - `RIGOROUS`: a proven enclosure (for example directed-rounding interval arithmetic, with transcendental functions also enclosed).
87 - `ESTIMATED`: a stated numerical estimate, not a proof.
88 - `NONE`: no claim; every bound is `0@0`.
89 The bound covers the full error from the exact mathematical quantity defined in AT0_CASE_V1 section 3, including rounding of inputs.
90- **Arithmetic:** names the arithmetic the engine used. `threads 1` is fixed in V2: no parallel reductions, so results are reproducible bit for bit on the same build.
91
92## 3. Quantities
93
94All quantities refer to the exact definitions in AT0_CASE_V1 section 3. Let `Psi` be the physical state and `Psi_hat = Psi / ||Psi||`.
95
96- `physical_state_kernel_dim`: dimension of the kernel of `H_total`, computed exactly from the rational energies (count of pairs with `E_j + e_s = 0`). Exact integer, not a measurement.
97- `constraint_residual`: `|| H_total Psi_hat ||_2`, Euclidean norm, energy units. Written as a value only when the kernel is nontrivial and `Psi` is nonzero; otherwise `undefined` with bound `0@0` (section 1, trivial kernel).
98- `povm_residual`: `|| sum_k F_k - I_C ||_F`, Frobenius norm over the N x N clock matrix.
99- `clock_probability k`: `p(k) = w || phi_k ||^2 / || Psi ||^2` with `phi_k = (<t_k| (x) I_S) Psi`.
100- Label status: `UNDEFINED` if `p(k) + bound <= tol_zero_probability`; `DEFINED` if `p(k) - bound > tol_zero_probability`; otherwise `INDETERMINATE`.
101- Trivial kernel (`physical_state_kernel_dim` is `0`, or `Psi` is exactly zero): `p(k)` has no value because `|| Psi || = 0`. Every label is `UNDEFINED` and every `clock_probability` is `undefined` with bound `0@0`; the writer never divides. `povm_residual` does not depend on `Psi` and is still computed.
102- `pauli k AXIS SIGN`: for a `DEFINED` label, the probability of outcome `+1` (`PLUS`) or `-1` (`MINUS`) when that Pauli is measured on the conditional system state `rho_k = phi_k phi_k^dagger / || phi_k ||^2`. Each is computed directly from `rho_k`, not as one minus the other.
103- `reference k AXIS SIGN`: the same probabilities for the Schrodinger-evolved state `exp(-i H_S (t_k - t_r)) |psi_0> / || psi_0 ||`, where `t_r` is the reading of `reference_clock_label`. Produced by the independent oracle (charter section 7, Agent 3) through a separate code path, never by the engine.
104
105No result field is a deviation or a sum. Those are derived by the checker from the values above (section 4), so they cannot disagree with them.
106
107## 4. Checks, in this fixed order
108
109Each comparison is decided in exact real arithmetic on the written values: a binary64 value is an exact rational and a scaled decimal is an exact rational, so a checker never compares floats. Two comparison forms are used, for a quantity `v` with bound `b` and tolerance `tol`. **Absolute form** (residuals, sums, deviations): `PASS` if `|v| + b <= tol`; `FAIL` if `|v| - b > tol`; otherwise `INDETERMINATE`. **Signed form** (range limits only): `PASS` if `v + b <= tol`; `FAIL` if `v - b > tol`; otherwise `INDETERMINATE`. Derived quantities carry the summed bounds of their parts. A check whose input contains `nonfinite` or `undefined` is `NOT_EVALUATED` for that input (check 2 and check 9 already report those cases).
110
111| # | check_name | quantity compared with its tolerance | failure code on FAIL |
112|---|---|---|---|
113| 1 | `bound_kind_sufficient` | `bound_kind` at least `min_bound_kind` (order `NONE < ESTIMATED < RIGOROUS`) | `BOUND_KIND_INSUFFICIENT` |
114| 2 | `values_finite` | no `nonfinite` token anywhere | `NONFINITE_VALUE` |
115| 3 | `physical_state_nontrivial` | `physical_state_kernel_dim >= 1` and `Psi` nonzero (exact, no tolerance) | `TRIVIAL_PHYSICAL_STATE` |
116| 4 | `constraint_residual` | `constraint_residual` vs `tol_constraint_residual` | `CONSTRAINT_RESIDUAL_EXCEEDED` |
117| 5 | `povm_normalization` | `povm_residual` vs `tol_povm_residual` | `POVM_NORMALIZATION_EXCEEDED` |
118| 6 | `clock_probability_sum` | `sum_k p(k) - 1` vs `tol_probability` | `PROBABILITY_SUM_EXCEEDED` |
119| 7 | `probability_range` | every written probability `p`, signed form: `-p` vs `tol_probability` and `p - 1` vs `tol_probability` | `PROBABILITY_OUT_OF_RANGE` |
120| 8 | `pauli_pair_sum` | for each defined label and axis, `PLUS + MINUS - 1` vs `tol_probability` | `PROBABILITY_SUM_EXCEEDED` |
121| 9 | `conditional_defined` | no label `UNDEFINED` | `CONDITIONAL_UNDEFINED` |
122| 10 | `schrodinger_agreement` | for each defined label, axis and sign, `pauli - reference` vs `tol_schrodinger` | `SCHRODINGER_DEVIATION_EXCEEDED` |
123
124A check that cannot be evaluated because an earlier check removed its input is `NOT_EVALUATED` and contributes no failure code. In the trivial-kernel case this is fixed: check 3 is `FAIL` (`TRIVIAL_PHYSICAL_STATE`), checks 4, 6, 7, 8, 9 and 10 are `NOT_EVALUATED`, checks 1, 2 and 5 are evaluated as usual. The `UNDEFINED` labels of a trivial kernel do not raise `CONDITIONAL_UNDEFINED` (check 9 is not evaluated) and do not raise `PRECISION_INSUFFICIENT`. Any `INDETERMINATE` check or label adds failure code `PRECISION_INSUFFICIENT`. A check that is `FAIL` for several items adds its code once.
125
126## 5. Outcome, codes and expectation
127
128- `outcome PASS`: every check is `PASS` or `NOT_EVALUATED`, and no label is `INDETERMINATE`.
129- `outcome FAIL`: the case was valid and the run completed, but at least one failure code was raised. `failure_codes` lists them, sorted bytewise ascending, no duplicates.
130- `outcome ERROR`: the case was refused or the run could not complete. `error_code` names why; `failure_codes none`; every check `NOT_EVALUATED`; the values block is written with `physical_state_kernel_dim 0`, all values `undefined` and bounds `0@0`.
131- `outcome NOT_RUN`: a placeholder result for a case that has not been executed. Same shape as `ERROR` with `error_code none`. In `ERROR` and `NOT_RUN` results, provenance fields whose value does not exist (`engine_sha256`, `oracle_repo`, `oracle_commit`, `oracle_sha256`, `build_cc`, `build_flags`, `host`, `run_started_utc`, `run_finished_utc`) carry the token `none`. `NOT_RUN` is the status of every AT-0 case today.
132
133**Failure codes (closed set for V2):** `BOUND_KIND_INSUFFICIENT`, `CONDITIONAL_UNDEFINED`, `CONSTRAINT_RESIDUAL_EXCEEDED`, `NONFINITE_VALUE`, `POVM_NORMALIZATION_EXCEEDED`, `PRECISION_INSUFFICIENT`, `PROBABILITY_OUT_OF_RANGE`, `PROBABILITY_SUM_EXCEEDED`, `SCHRODINGER_DEVIATION_EXCEEDED`, `TRIVIAL_PHYSICAL_STATE`.
134
135**Refusal codes (closed set for V2):** `CASE_PARSE_ERROR`, `CASE_NONCANONICAL`, `CASE_UNSUPPORTED_VERSION`, `CASE_INVALID_PARAMETER`, `CASE_IRRATIONAL_SPECTRUM`, `CASE_ID_MISMATCH`. A case that fails AT0_CASE_V1 section 4 cannot be copied into a result, so no result file is written: the tool prints exactly one line `AT0_CASE_REFUSED <code>` to standard error and exits with status 2.
136
137**Run error codes (closed set for V2, written as `error_code`):** `ORACLE_UNAVAILABLE`, `RESOURCE_LIMIT`, `INTERNAL_ERROR`.
138
139**`expectation_met`:** `NOT_APPLICABLE` when the outcome is `ERROR` or `NOT_RUN`. Otherwise `YES` exactly when the outcome equals `expected_outcome` and `failure_codes` equals `expected_failure_codes` as a set; else `NO`. A negative control therefore succeeds only when it fails for the stated reasons and no others: a verifier may not normalize a discrepancy away (Postulate v1.1, "Negative controls").
140
141## 6. Identity and evidence
142
143- **`verdict_id`** `= SHA-256( "omega.at0.verdict.v2" || 0x00 || "case_id " || case_id || LF || "acceptance_id " || acceptance_id || LF || B_ver )`, where `B_ver` is every line from `begin verdict` through `end verdict` inclusive, each followed by LF. It covers only exact, discrete content: which case, which rules, which checks passed, which codes. It is the claim identity of the run (the `CLAIM_ID` role in the Postulate). Two runs on different hosts, at different times, with bit-different floating-point values, have the same `verdict_id` when they reach the same verdict on the same case and rules.
144- **No semantic identity over computed values in V2.** The values are binary64 measurements produced by an unspecified sequence of floating-point operations. Their bit patterns are physical evidence, so no V1 identity is defined over them, and no digest that includes them may be called a semantic identity, case identity, result identity or claim identity. An exact-arithmetic engine could define a result identity in a later contract version.
145- **`evidence_digest`** `= SHA-256( "omega.at0.evidence.v2" || 0x00 || every line of the file above the evidence_digest line, each followed by LF )`. It fingerprints this physical record (values, bounds, provenance, wall-clock times) so it can be cited and checked for tampering. It is evidence, not identity: two honest runs of the same case normally have different evidence digests.
146- `case_file_sha256`, `engine_sha256`, `oracle_sha256` and `artifact` digests are artifact digests: plain SHA-256 of the file bytes, no domain tag.
147
148## 7. Provenance rules
149
150- `source_repo`, `source_commit`: the omega commit the engine was built from; `source_tree_clean NO` means the build had uncommitted changes, and such a result may not be cited as evidence for a gate.
151- `contract_commit`: the aien-architecture commit holding the frozen AT0 contract files the writer was built against.
152- `engine_sha256`, `oracle_sha256`: digests of the executables that produced the values and the reference values.
153- `build_cc`, `build_flags`, `host`: free text for humans; never parsed for decisions.
154- `run_started_utc`, `run_finished_utc`: wall-clock times of the physical execution, UTC, second resolution. They exist only here, outside every identity.
155- `artifact` lines name other files produced by the run (logs, case file copy), relative to the evidence folder.