Skip to content

Commit 65806f4

Browse files
docs(explorations): scaffold the decoration bridge as R5 (exploratory) (#129)
## Summary Bounded exploratory scaffold for a "decoration bridge" — a place to ask whether the *one* `Choreo × Graded` axis pair that `EchoIntegration` integrates resembles the shape adjacent-domain constructions exhibit when they compose two decorations on a shared state evolution (CRDT merges, gossip partial views, local-first causal histories). Strictly scoped to that one axis pair; candidate analogies carry falsifiers, never evidence the recipe generalises. Lands as R5 under the deferred- research track with explicit termination criteria, not as a new Lane. ## What's in this PR **4 new files** (the originally-scoped scaffold): - `proofs/agda/EchoDecorationBridge.agda` — `DecorationFit` record + `decoration-claim` one-line wrapper of `EchoIntegration.knowledge-and-controlled-degradation`. Prose header documents the imports allowlist, the signature-change policy (retire, never patch), the reverse-import prohibition, retraction-watch, and the forbidden-rebrandings discipline. **Not in `proofs/agda/All.agda`.** - `docs/echo-types/explorations/decoration-bridge/README.adoc` — status banner, scope discipline, what-this-is-NOT, Track A/B/C clearance argument, three candidate analogies with falsifiers, open questions QB-1…QB-4, **item-by-item forbidden-rebrandings check against both registers in `.machine_readable/6a2/STATE.a2ml`**, R-2026-05-18 retraction-watch with three drift conditions, six-clause termination criteria including automatic closure on register addition and a cleanup invariant. - `docs/echo-types/explorations/decoration-bridge/01-decoration-instances.adoc` — per-candidate pseudo-Agda sketches sharing the `DecorationFit` shape. - `docs/echo-types/explorations/decoration-bridge/02-non-commuting-residue.adoc` — conceptual core: under `--safe --without-K`, the residue can only live in the witness `x`, not in `y` and not in the equality leg. **2 modified files** (both with explicit justification): - `roadmap.adoc` (+60 lines) — R5 entry with a schema-divergence note flagging the additional `*Termination*` bullet as intentional (R1–R4 do not carry it); one-liner Lane 4 cross-reference for navigability. **Pillar A–E entries and Lane 1–4 status lines untouched.** - `docs/echo-types/echo-kernel-note.adoc` (+11 lines) — **CI-mandatory** single-row addition under a new "Exploratory (not in `All.agda`)" classification, satisfying `scripts/kernel-guard.sh` Check B's requirement that every `proofs/agda/Echo*.agda` be named in the note. Mirrors the existing "Sibling (not kernel-derived)" precedent for non-derived rows; does not reshape the taxonomy. ## What's explicitly NOT in this PR - No changes to `EchoIntegration.agda`, `EchoChoreo.agda`, `EchoGraded.agda`, `EchoCNOBridge.agda`, `EchoJanusBridge.agda`, `DyadicEchoBridge.agda`, or `All.agda` (verified by empty `git diff` against each). - No new external dependencies (`echo-types.agda-lib` and `flake.nix` unchanged). - No postulates / `believe_me` / escape pragmas in the new module (verified by `grep` returning 0). - No edits to either bridge ledger (`docs/bridges/cross-repo-bridge-status.md`, `docs/bridge-status.md`) — the conceptual bridge has no adjacent-side column to fill; reshaping the ledgers to fit was rejected per the original scaffolding directive. - No new identity claim, no Pillar move, no Gate edit, no reopening of EI-2 (forbidden-rebrandings preflight done in README §"Forbidden-rebrandings check"). ## Test plan - [x] `scripts/kernel-guard.sh` PASS locally — funext-free certificate (Check A) and classification-drift lint (Check B) both clean. - [x] `git diff` against `EchoIntegration` / `EchoChoreo` / `EchoGraded` / existing `EchoXBridge` / `All.agda` returns empty. - [x] No postulates introduced (verified by `grep` against the new module). - [x] `echo-types.agda-lib` and `flake.nix` unchanged (no new external deps). - [ ] CI `agda` typecheck (deferred — no `agda` binary in the container that produced this PR). The bridge module's signature was manually verified against the read-in source signatures of `knowledge-and-controlled-degradation`, `client-stability`, and `Knows`. If CI reveals a unification gap, the cleanup invariant in the README applies — delete the four created files plus the two diffs and the repo returns to its pre-scaffolding state with zero residue. - [ ] Reviewer sanity-check on the forbidden-rebrandings check table (README §"Forbidden-rebrandings check"). Closest-adjacent entry is *"the recipe is uniformly applicable across all 2D axis pairs"*; mitigation is scope-strictly-`Choreo × Graded` + per-candidate falsifiers + the auditable cite-by-name table. ## Termination clauses (so the cleanup path is explicit) The exploration terminates and the 6 file additions/edits revert under any of: (i) Track A/B/C failure; (ii) all three candidates fail their falsifiers; (iii) the residue analysis reduces to the retracted-prose graded-comonad framing; (iv) any audit pass adds the bridge framing to `STATE.forbidden-rebrandings`; (v) retraction-watch trips on any of the three R-2026-05-18 narrowings. See `roadmap.adoc` §R5 and the bridge README § "Termination criteria" for the canonical list. https://claude.ai/code/session_013nLEeKZXpvHnrDZMgRm19S --- _Generated by [Claude Code](https://claude.ai/code/session_013nLEeKZXpvHnrDZMgRm19S)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent f2fa7ba commit 65806f4

6 files changed

Lines changed: 1225 additions & 0 deletions

File tree

docs/echo-types/echo-kernel-note.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ kernel** — the boundary is real and lives outside this core.
117117
| `EchoApprox`, `EchoApproxInstance`
118118
| Does **not** `import Echo`; a parallel stdlib-only approximation
119119
module. Listed so the DAG audit is complete.
120+
121+
| *Exploratory (not in `All.agda`)*
122+
| `EchoDecorationBridge`
123+
| Deliberately omitted from `proofs/agda/All.agda` so the verified
124+
suite is unaffected. Re-issues `EchoIntegration`'s integration
125+
claim through a `DecorationFit` record. Listed here only to
126+
satisfy the classification-drift lint
127+
(`scripts/kernel-guard.sh` Check B); the module itself is
128+
exploratory per `roadmap.adoc` § R5 and
129+
`docs/echo-types/explorations/decoration-bridge/README.adoc`.
130+
Not kernel, not load-bearing, subject to abandonment.
120131
|===
121132

122133
`EchoOrdinal` is Tier-1 off `Echo` but additionally pulls the
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
= Decoration bridge — candidate instance sketches
2+
:toc: macro
3+
:toclevels: 2
4+
:sectnums:
5+
:sectnumlevels: 2
6+
:icons: font
7+
:source-highlighter: rouge
8+
9+
[CAUTION]
10+
====
11+
Exploratory pseudocode. Not committed Agda. Each candidate is an
12+
*analogy that may or may not fit* the `Choreo × Graded` shape that
13+
`EchoIntegration` integrates, with an explicit falsifier. Failure to
14+
fit retires the candidate; success commits nothing beyond the
15+
candidate itself. See `README.adoc` § "Scope discipline".
16+
====
17+
18+
toc::[]
19+
20+
== Reading these sketches
21+
22+
Each candidate names: (a) the *external construction* it draws on,
23+
(b) the *fit shape* — what would need to be supplied to discharge the
24+
`DecorationFit` record from `proofs/agda/EchoDecorationBridge.agda`,
25+
(c) one or two pseudo-Agda lines showing the would-be predicate /
26+
stability witness / knowledge witness, and (d) the *falsifier* — the
27+
concrete condition under which the analogy collapses and the
28+
candidate is retired.
29+
30+
The pseudocode is illustrative. It uses the names from
31+
`EchoChoreo` (`Role`, `Client`, `Server`, `Global`,
32+
`scramble-server`, `client-stability`), `EchoEpistemic` (`Knows`),
33+
and `EchoGraded` (`keep`, `residue`, `keep≤residue`, `degrade`).
34+
No file in this directory is intended to typecheck as-is.
35+
36+
== Candidate A — CRDT join semilattices
37+
38+
*External construction.* A replicated value held at two replicas
39+
(`Client` and `Server`); each replica maintains a local update log.
40+
A merge operation combines logs into a joined state.
41+
42+
*Fit shape.*
43+
44+
* `Pred` names the invariant "the client's locally-observed value is
45+
`b : Bool`". Local observation is preserved across the merge step
46+
whenever the merge is observation-preserving from the client's
47+
side — which is precisely the `scramble-client-square` shape
48+
`EchoChoreo` already pins.
49+
* `Pred-stable` is the witness that the merge step does not change
50+
the client-side observation. In CRDT terms, this is *the
51+
client-side projection of the merge is a no-op on the merged
52+
bit*. For a state-based CRDT whose merge is the lattice join,
53+
this is the *join-idempotence* property restricted to the
54+
client-observable component.
55+
* `knowledge` is the proof that every client-side preimage of a
56+
given visible value satisfies `Pred`. For a Boolean-bit CRDT,
57+
this is exhaustion over the two-element preimage.
58+
59+
*Pseudocode.*
60+
61+
[source,agda]
62+
----
63+
-- pseudocode; not committed
64+
PredA : Global → Set
65+
PredA (cBit , _) = cBit ≡ true -- "client observes true"
66+
67+
stableA : ∀ g → PredA g → PredA (scramble-server g)
68+
stableA (true , _) refl = refl -- merge does not touch cBit
69+
70+
knowledgeA : Knows Client PredA true
71+
knowledgeA ((true , _) , refl) = refl
72+
----
73+
74+
*Falsifier.* If the CRDT's merge is genuinely commutative — i.e.
75+
*both* `Pred-stable` and a hypothetical `Pred-stable-reverse` hold
76+
under a symmetric `scramble-client` and `scramble-server` — then no
77+
residue survives composition, and the analogy fits but says nothing
78+
the CRDT's own commutativity proof did not already say. This is the
79+
candidate's *commutative-merge collapse*: the bridge characterises a
80+
property the system already has by design, not a phenomenon worth
81+
naming. Retire if the target CRDT's merge is uniformly commutative
82+
on the observable.
83+
84+
*Why this is not generic Σ.* The fit *requires* the stability
85+
witness to mention `scramble-server` — a specific update on `Global`,
86+
not a generic Σ-projection. A `Σ`-only encoding would have no way to
87+
name the merge step; it would have to project to the visible bit and
88+
discard the structure that makes `Pred-stable` mean anything.
89+
90+
== Candidate B — Local-first causal histories
91+
92+
*External construction.* A document is edited by the client; the
93+
server periodically reconciles. The document state carries
94+
`(cBit, sBit)`: `cBit` is the client's last committed edit, `sBit` is
95+
the server's reconciled view. A reconciliation step is the
96+
`scramble-server` analogue: it may update `sBit` without changing
97+
`cBit`.
98+
99+
*Fit shape.*
100+
101+
* `Pred` names the invariant "the client's edit history reaches a
102+
state where `cBit ≡ true`". Causal-history depth is bounded by
103+
the client's edit count.
104+
* `Pred-stable` is the witness that reconciliation does not rewrite
105+
client history. This is the *no-server-side-rewrite* property
106+
local-first systems offer by design.
107+
* `knowledge` is the proof that any client-observable witness
108+
(a state with `cBit ≡ true`) lies in the predicate.
109+
110+
*Pseudocode.*
111+
112+
[source,agda]
113+
----
114+
-- pseudocode; not committed
115+
PredB : Global → Set
116+
PredB (cBit , _) = cBit ≡ true -- "client history reached true"
117+
118+
stableB : ∀ g → PredB g → PredB (scramble-server g)
119+
stableB (true , _) refl = refl -- reconciliation does not rewrite cBit
120+
121+
knowledgeB : Knows Client PredB true
122+
knowledgeB ((true , _) , refl) = refl
123+
----
124+
125+
*Falsifier.* If the local-first system already maintains a complete
126+
causal-history record on every document state (vector clocks, OT
127+
metadata, full event-log), then the residue the bridge names is
128+
*already captured* in the system's own provenance metadata. The
129+
analogy fits but is redundant: the bridge says nothing the system
130+
did not already say. This is the candidate's *metadata-already-complete*
131+
failure mode. Retire if the target system's provenance metadata
132+
fully reconstructs the residue.
133+
134+
*Why this is not generic Σ.* Same reason as Candidate A — the
135+
stability witness has to mention `scramble-server` specifically. But
136+
there is a second reason: the `Knows Client P y` predicate is
137+
fundamentally about *what every preimage satisfies*, which is a
138+
universal quantification a `Σ`-only encoding would have to write out
139+
explicitly. The bridge inherits the universal quantification from
140+
`EchoEpistemic.Knows`.
141+
142+
== Candidate C — Gossip partial views
143+
144+
*External construction.* A node maintains a partial view of the
145+
cluster membership; gossip messages refresh the view. Local
146+
observation is the *fresh-or-stale bit* of the node's own view;
147+
remote-side updates may change which peer a node is observing
148+
without changing the freshness bit.
149+
150+
*Fit shape.*
151+
152+
* `Pred` names the invariant "the node's view of its own freshness
153+
bit is `true`".
154+
* `Pred-stable` is the witness that a remote-view refresh
155+
(`scramble-server`-analogue) does not change the local freshness
156+
bit. This is the *view-update-locality* property gossip protocols
157+
guarantee.
158+
* `knowledge` is the proof that any local-observable witness lies in
159+
the predicate.
160+
161+
*Pseudocode.*
162+
163+
[source,agda]
164+
----
165+
-- pseudocode; not committed
166+
PredC : Global → Set
167+
PredC (cBit , _) = cBit ≡ true -- "local freshness bit is true"
168+
169+
stableC : ∀ g → PredC g → PredC (scramble-server g)
170+
stableC (true , _) refl = refl -- view refresh does not touch cBit
171+
172+
knowledgeC : Knows Client PredC true
173+
knowledgeC ((true , _) , refl) = refl
174+
----
175+
176+
*Falsifier.* Most gossip protocols are designed to be
177+
*view-oblivious*: the node accepts any refresh that arrives without
178+
caring which peer sent it. If view-obliviousness is the design
179+
intent, the residue the bridge would name is *intentionally
180+
discarded* — the protocol is built precisely to erase that residue.
181+
The bridge characterises a property the protocol does not have and
182+
does not want. Retire if the target protocol's design discards
183+
peer-provenance on refresh.
184+
185+
*Why this is not generic Σ.* Same as Candidates A and B.
186+
187+
== The shared pseudocode shape (and why it matters)
188+
189+
All three candidates instantiate the same record:
190+
191+
[source,agda]
192+
----
193+
-- pseudocode; the actual record is in proofs/agda/EchoDecorationBridge.agda
194+
record DecorationFit (y : Bool) : Set₁ where
195+
field
196+
Pred : Global → Set
197+
Pred-stable : ∀ g → Pred g → Pred (scramble-server g)
198+
knowledge : Knows Client Pred y
199+
----
200+
201+
That every candidate shares the same record is the bridge's *only*
202+
positive content — the claim that "decorations on shared state
203+
evolution" is a structural pattern that admits a uniform fit shape.
204+
If two candidates need genuinely different records to express their
205+
fit, the bridge's positive content collapses and the exploration
206+
loses its motivation.
207+
208+
[NOTE]
209+
====
210+
"Same record" is not "same instance". The three candidates above all
211+
discharge `DecorationFit` with the same `Pred` (`λ (cBit , _) → cBit
212+
≡ true`) and the same trivial proofs. That is because they are
213+
pseudocode sketches over the same toy `Global = Bool × Bool`. Real
214+
candidates would differ in their `Pred` (CRDT lattice element vs
215+
causal-history segment vs view-freshness predicate), their stability
216+
witness (idempotent join vs server-side-rewrite-freedom vs
217+
view-update-locality), and the `Global` carrier they project from.
218+
The toy version is what types under the actual
219+
`EchoChoreo.Global = Bool × Bool`. Promoting any candidate to a real
220+
discharge is a rung-consolidation, with its own forbidden-rebrandings
221+
audit.
222+
====
223+
224+
== Falsifier summary
225+
226+
The three falsifiers above are *distinct*. None subsumes another.
227+
The bridge's exploratory value is in the cases where *exactly one*
228+
candidate fits — that is, the case is non-commutative enough to have
229+
a residue (rules out A's commutative collapse), the system does not
230+
already track that residue (rules out B's metadata-already-complete
231+
collapse), and the system does not want to discard the residue
232+
(rules out C's view-obliviousness collapse). If no domain
233+
construction simultaneously falsifies all three, the bridge has no
234+
useful target and retires.
235+
236+
== What an actual fit would need
237+
238+
Promoting any candidate from sketch to discharged instance would
239+
require:
240+
241+
. A concrete `Global` carrier richer than `Bool × Bool`. The
242+
`Choreo × Graded` shape `EchoIntegration` integrates is fixed to
243+
`Bool × Bool` for the obvious reason of toy-size; a real candidate
244+
needs a domain-appropriate carrier, and the bridge then has to
245+
exhibit role-projections (`obs Client`, `obs Server`) that respect
246+
the domain's natural observation interface.
247+
. A real predicate stability proof — not a one-line `refl` over
248+
exhaustion, but a structural argument that the
249+
`scramble-server`-analogue update preserves the candidate's
250+
`Pred`. This is where the real content lives, and where most
251+
candidates will fail.
252+
. A real `Knows` witness, which means a real `Echo` over the
253+
domain's observation map — not the toy
254+
`obs Client (cBit , _) = cBit`.
255+
. A real-domain falsifier check: the analogy must demonstrably
256+
*fail* in some natural instance of the candidate's domain, not
257+
just in pathological edge cases. A candidate that fits every
258+
instance is suspicious and almost certainly trips
259+
"the recipe is uniformly applicable" in the
260+
forbidden-rebrandings register.
261+
262+
Any session attempting such a promotion should consult
263+
`README.adoc` § "Termination criteria" first; promotion is *not*
264+
pre-authorised.

0 commit comments

Comments
 (0)