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 / adr / 0040-identity-layers-normalization.md

92 lines · 5145 bytes Raw Blame History Rendered
1# ADR 0040: Five identities; "same meaning, same identity" holds only under a named normalization
2
3**Status:** Accepted (Main, delegated by Drake, 2026-10-26). Main, the orchestrating agent, adopted
4an outside architecture review that Drake Stapleton forwarded, and accepted this ADR under Drake's
5delegation of technical calls. Recorded by OmegaIntent.
6**Amends (reading only, text unchanged):** at main `fabf7b7`, ADR 0015 line 97 (the invariance
7principle), ADR 0018 line 46 ("the same program, with the same identity") and ADR 0019 line 23
8("the same meaning gets two ids"). This ADR narrows how those lines are read.
9**Related:** ADR 0039 (typed-construction interface); omega-mv #830 (semhash), #826 (bounded
10equivalence, PROPOSED).
11
12---
13
14## Context
15
16Three accepted ADRs say, in different words, that one meaning has one identity:
17
18- ADR 0015 §3: "A semantic object must have the exact same identity regardless of what CPU, GPU,
19 memory address, or operating system instance executes it."
20- ADR 0018: "A program that is correct on a CPU is the same program, with the same identity, when
21 FORGE realizes it on an analog array."
22- ADR 0019 line 23 calls it a failure when "the same meaning gets two ids".
23
24Read as stated, "semantically equivalent implies the same identity" asks for a function from
25programs to ids that is equal exactly when two programs mean the same thing. Program equivalence is
26undecidable in general (Rice's theorem), so no hash can deliver that. A tool that claims to deliver
27it can only be wrong in one of two ways:
28
29- false SAME: it merges different behaviour under one id;
30- false CHANGED: it splits one meaning into two ids.
31
32A false SAME is the dangerous one.
33
34The intent of those ADRs is narrower and achievable: substrate, address, process and device must not
35leak into an identity.
36
37## Decision
38
391. **Five identities.** They are distinct. None is inferred from another without the evidence named
40 here.
41
42 | Identity | What is hashed | Established by |
43 |---|---|---|
44 | Source | the exact source bytes | SHA-256 of the bytes |
45 | Normalized structure | the output of a named normalization system N | the N tool, versioned and pinned |
46 | Declared behaviour | the spec or contract text (requires/ensures, experiment spec) | hash of its canonical encoding |
47 | Proven equivalence | a pair or class of programs | a certificate naming property, domain, checker and assumptions |
48 | Machine realization | the binary or realization artifact | SHA-256 of the artifact, plus compiler pin and target |
49
502. **The narrowing.** "Same meaning, same identity" in ADR 0015, 0018 and 0019 means equality under
51 a defined normalization system N. N is stated by:
52 - the transforms it identifies (the equalities it preserves);
53 - its tool and pin;
54 - the direction in which it fails.
55
56 N must fail toward CHANGED: when it cannot show that a difference is meaning-free, the ids differ.
57 Equivalence beyond N is a proof claim, not an identity. It holds only under its certificate's
58 stated assumptions and domain.
59
603. **The first N** is omega-mv #830 semhash (seeded `.om`, per-function Merkle hash, PR not merged):
61 - Identified: renames of locals and parameters, notes, blank lines and spacing, function order,
62 and function-name-only renames. A call is hashed as the callee's hash.
63 - Not identified: everything else is kept verbatim (fails toward CHANGED).
64 - Algebraic rewrites, loop transforms and different algorithms for the same function are not
65 identified. Treating them as equal needs a proof certificate, for example from #826 bounded
66 equivalence, which is PROPOSED.
67
684. **Substrate independence is unchanged.** The source, normalized-structure and declared-behaviour
69 identities never contain substrate, address, process or device values (ADR 0015 §3 item 2). A
70 machine realization carries them by design. A realization on a new substrate is the same program
71 only in this sense: it has the same normalized-structure identity, and a realization record links
72 it to that identity. It is not the same realization identity.
73
745. **No promotion without evidence.** An agent or tool may report VALID-UNPROVEN (ADR 0039).
75 A claim that two programs are equivalent, or that a realization implements a declared behaviour,
76 is reported with its certificate or as UNKNOWN. A matching normalized hash is reported as
77 "equal under N@pin", never as "equivalent".
78
79## Consequences
80
81- Content-addressed stores key semantic objects by normalized-structure identity under a named N, and
82 record N's pin with the key. Changing N is an identity break and needs its own ADR, as ADR 0019
83 already requires for OMG1.
84- Merge, deduplication and caching decisions that rely on "same meaning" use N equality only, and a
85 wider equivalence only through a certificate.
86
87## Evidence at the time of writing
88
89- **semhash invariances and controls:** as stated in the body of omega-mv #830. At head `b8b969c6`
90 it reports `SEMHASH PASS cases=211 controls=13`. This is that PR's claim, not re-run for this ADR
91 (NOT_RUN here).
92- **#826 bounded equivalence:** PROPOSED, NOT_RUN.