Skip to content

Resolve the monad/comonad/adjunction variance of loss in --safe Agda#243

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/eager-heisenberg-r3gz3c
Jun 19, 2026
Merged

Resolve the monad/comonad/adjunction variance of loss in --safe Agda#243
hyperpolymath merged 1 commit into
mainfrom
claude/eager-heisenberg-r3gz3c

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

The sharpened understanding of an echo-type — a tropically-graded modality of structured information loss over the min-plus semiring (ℕ∪{∞}, min, +), recoverable exact on a homotopy fibre rather than complement-storing — left a precise live question:

the combining direction of loss is monadic (accumulation is μ : D_r (D_s A) → D_{r+s} A), so whether the right word is "graded comonad", "graded monad", or "graded adjunction (with the section as unit/counit)" is unsettled and is being resolved in --safe Agda rather than asserted.

R-2026-05-18 already retracted the unqualified "graded comonad" claim (a reindexing modality, no nested D_r D_s); this PR builds the nested maps the question is actually about and lets the type-checker decide.

The verdict (each clause a pinned theorem in EchoVariance.agda)

Clause Theorem Reuses
(1) Accumulation is monadicμ total + canonical (definable from layered data alone) accumulate Echo-comp-iso-from
(2) Exact on the fibre — fixed-factoring round-trips are refl accumulate-split-id, split-accumulate-id Echo-comp-iso-{to,from}
(2′) Grade-0 section/retraction adjunction recoverable-fibre A↔ΣEcho
(3) Comonad direction fails for genuine loss — no recovery from a bare residue no-bare-recovery, fibre-retains-lost-bit no-section-of-collapsing-map
(4) "Graded comonad" = lossless complement-storing writer — F1's δ is coe along a type equality, inverted by μ-writer μ-writer, writer-μ-section, writer-δ-section EchoGradedComonadF1.{δ,D-+,coe}

One-line resolution. Echo (fibre-based loss) is a graded monad of accumulation (the + axis) with a fibre-exact section/retraction adjunction; it is not a graded comonad. The min axis (order / degrade) carries the reindexing modality; the + axis (accumulation) carries the monad. The graded-comonad reading is available only on the complement-storing writer, which is lossless — the resource neighbour echo-types is not. This sharpens R-2026-05-18 from "graded comonad withdrawn" to "decided against".

Informs the redesign

docs/echo-types/variance-resolution.adoc records the verdict and four consequences: keep the modality(min)/measure(+) split (it is the variance answer); name the accumulation monad on the measure axis; read EchoGradedComonad/F1/F3 as the complement-storing neighbour on the record; state recoverability as the grade-0 adjunction, never an all-grade comonadic extract/duplicate.

Files

  • proofs/agda/EchoVariance.agda (new) — --safe --without-K, zero postulates, reuses only existing kernel theorems.
  • All.agda import; Smoke.agda pin block (10 headlines).
  • docs/echo-types/variance-resolution.adoc (new) — the verdict + redesign consequences + honest-scope NotProved-*.
  • echo-kernel-note.adoc + MAP.adocEchoVariance classified [REAL].
  • paper.adoc Reframing note — follow-up F-2026-06-19.

Verification

  • agda proofs/agda/All.agda → exit 0
  • agda proofs/agda/Smoke.agda → exit 0
  • scripts/kernel-guard.shPASS (Check A funext-free cone; Check B classification in sync)
  • zero postulates; --safe --without-K throughout

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rw1RpYXU5Q7rzy2bVofVeB


Generated by Claude Code

…--safe Agda

The sharpened understanding of an echo-type (a tropically-graded modality
of structured loss over the min-plus semiring, recoverable "exact on a
homotopy fibre rather than complement-storing") left a precise live
question: the combining direction of loss is monadic
(μ : D_r (D_s A) → D_{r+s} A), so is the right word graded comonad,
graded monad, or graded adjunction? Resolve it in --safe Agda rather than
asserting it.

New module proofs/agda/EchoVariance.agda (--safe --without-K, zero
postulates; reuses only existing kernel theorems):

  * accumulate (= Echo-comp-iso-from): the combining map
    μ : D_r (D_s A) → D_{r+s} A — total and canonical (definable from
    the layered data alone). Accumulation is the graded-MONAD shape.
  * accumulate-split-id / split-accumulate-id: for a fixed factoring,
    accumulate and split are mutually inverse (refl) — exact on the fibre.
  * recoverable-fibre (= A↔ΣEcho): the grade-0 section/retraction
    ADJUNCTION (unit = encode, counit = decode).
  * no-bare-recovery (via no-section-of-collapsing-map): the graded
    COMONAD direction fails for genuine loss — no recovery from a bare
    residue. fibre-retains-lost-bit pins that the lost bit lives on the
    fibre, not as a recoverable complement.
  * μ-writer + writer-{μ,δ}-section: EchoGradedComonadF1's δ is coe along
    a TYPE EQUALITY, hence invertible — the writer is LOSSLESS
    (complement-storing), the resource neighbour echo-types is NOT.
  * matched NotProved-* honest-scope block.

Verdict: echo (fibre-based loss) is a graded MONAD of accumulation (the +
axis) with a fibre-exact section/retraction ADJUNCTION; it is NOT a graded
comonad. The min axis (order / degrade) carries the reindexing modality;
the + axis (accumulation) carries the monad. Sharpens R-2026-05-18 from
"graded comonad withdrawn" to "decided against".

Wiring + docs:
  * All.agda import; Smoke.agda pin block (10 headlines).
  * docs/echo-types/variance-resolution.adoc: the verdict + consequences
    for the modality/measure redesign.
  * echo-kernel-note.adoc + MAP.adoc: EchoVariance classified ([REAL]);
    kernel-guard Check B back in sync.
  * paper.adoc Reframing note: follow-up F-2026-06-19 recording the
    positive resolution.

agda proofs/agda/All.agda and proofs/agda/Smoke.agda exit 0 under
--safe --without-K; kernel-guard.sh PASS; zero postulates.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rw1RpYXU5Q7rzy2bVofVeB
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 6 issues detected

Severity Count
🔴 Critical 0
🟠 High 3
🟡 Medium 3
View findings
[
  {
    "reason": "No test directory or test files found",
    "type": "no_tests",
    "file": "/home/runner/work/echo-types/echo-types",
    "action": "flag",
    "rule_module": "honest_completion",
    "severity": "high",
    "deduction": 20
  },
  {
    "reason": "Nominal-only SAST in echo-types: codeql.yml language matrix contains no language present in the repo and lacks `actions`, so CodeQL records zero results on every commit. Remediation: set the CodeQL matrix to `language: actions`.",
    "type": "StaticAnalysis",
    "file": "/home/runner/work/echo-types/echo-types",
    "action": "auto_fix",
    "rule_module": "scorecard",
    "severity": "medium",
    "remediation": "Add CodeQL or equivalent SAST workflow.",
    "scorecard_check": "SAST"
  },
  {
    "reason": "Repository has 6 non-main remote branch(es). Policy: single main branch only.",
    "type": "GS007",
    "file": ".",
    "action": "delete_remote_branches",
    "rule_module": "git_state",
    "severity": "medium"
  },
  {
    "reason": "Code scanning (Scorecard): TokenPermissionsID -- Token-Permissions -- 17 day(s) old [STALE]",
    "type": "CSA001",
    "file": ".github/workflows/scorecard.yml",
    "action": "escalate",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  },
  {
    "reason": "Code-scanning alert TokenPermissionsID (high) at .github/workflows/scorecard.yml is 17 days old (threshold: 7 days) -- overdue for remediation",
    "type": "CSA003",
    "file": ".github/workflows/scorecard.yml",
    "action": "escalate",
    "rule_module": "code_scanning_alerts",
    "severity": "high"
  },
  {
    "reason": "Code-scanning alert hypatia/code_safety/agda_postulate dismissed as 'false positive' -- ensure dismissal is documented and justified",
    "type": "CSA004",
    "file": "proofs/agda/EchoImageFactorizationPropPostulated.agda",
    "action": "review",
    "rule_module": "code_scanning_alerts",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath marked this pull request as ready for review June 19, 2026 23:41
@hyperpolymath hyperpolymath merged commit de02dd9 into main Jun 19, 2026
19 checks passed
@hyperpolymath hyperpolymath deleted the claude/eager-heisenberg-r3gz3c branch June 19, 2026 23:42
hyperpolymath added a commit that referenced this pull request Jun 20, 2026
)

## What & why

Owner decision (`D-2026-06-20`): **PARK** the transfinite
ordinal-fidelity ladder. This is a **park — not a kill, not a
retraction**. Order-type fidelity was always flagged OPEN;
**`D-2026-06-14` stands; no postulate is closed**.

**Reason — the consumer was removed.** The only consumer of ψ₀(Ω_ω)
order-type fidelity was the Groove cleave. Groove **RC-11** forbids ε₀+
in cleave ranks (the ladder is already past ε₀ at rung 2), and the
cleave has resolved to a **finite exact-round-trip zipper needing
well-foundedness only**. The fidelity result is therefore
**consumer-less**. The ladder is correct, well-built, `--safe
--without-K`, zero-postulate — and now unconsumed; the clean ending is
to freeze it.

## Changes (docs only — no `.agda` touched)

- **New decision record**
`docs/echo-types/decisions/ordinal-fidelity-ladder-parked.adoc` (sibling
to `D-2026-06-14`, same idiom), recording: status (parked, resumable);
reason; the frozen artifact inventory (Veblen rungs 1–6); the **frontier
captured for cold resumption** (Γ₀-least open → reverse `φ_Γ₀(0) ≤′ Γ₀`
→ general first-arg monotonicity → gated on the Veblen **mutual
fixed-point descent**; downstream the ψ collapsing function, then the
two `Fidelity.agda` postulates); and the **disposition** (extraction to
its own ordinal-notation repo, cut **FLAGGED and left to the owner** —
firewall `{OmegaMarkers, Buchholz.Syntax, EchoOrdinal}` verified clean
and stays; everything else under `Ordinal/` moves).
- **Pointers** so a cold-resume session finds the park:
`docs/proof-debt.md` (Fidelity debt entry), `roadmap.adoc` §Lane 3
banner, `CLAUDE.md` (new 2026-06-20 arc covering variance #243 + Veblen
rungs #244#247 + the park).

The Veblen layer stays **frozen exactly as landed**; the mutual-descent
rung is deliberately **not** opened.

## Verification
- Docs only; no `.agda` changes → Agda invariants untouched (`--safe
--without-K`, zero postulates, no `TERMINATING`).
- `scripts/kernel-guard.sh` → **PASS**.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Rw1RpYXU5Q7rzy2bVofVeB

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Rw1RpYXU5Q7rzy2bVofVeB)_

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Jun 21, 2026
…choVariance (#243) (#258)

## What

A one-line-spirit refresh of `docs/proof-debt.md`: the 2026-06-16
ground-truth-audit bullet still flagged the monad/comonad/adjunction
**variance** question as *"genuinely open"* — but it was **settled four
days later** by the **wired** `EchoVariance.agda` (#243, 2026-06-20).

## The fix

The bullet now:
- **preserves the dated audit observation** (true *as of 2026-06-16*:
the only variance material was the orphaned
`experimental/echo-additive/` track + `VarianceGate.agda`, which
self-declares "NO proven theorems");
- **records the resolution**: `EchoVariance.agda` (in `All.agda`,
`--safe --without-K`, zero postulates) — echo is a graded **monad of
accumulation** + a section/retraction **adjunction exact on the grade-0
fibre**, and is **NOT a graded comonad** (`no-bare-recovery` the
obstruction; sharpens `R-2026-05-18` from "withdrawn" to "decided
against");
- points at the **wired** `EchoVariance` +
`docs/echo-types/variance-resolution.adoc` as the citation, and notes
the orphaned experimental track is the *retired earlier attempt*.

This keeps the audit's honesty (it was accurate when written) while
removing the stale "open" status that contradicted the later wired
result.

Docs-only; `kernel-guard` PASS. Verified `EchoVariance` is wired
(`All.agda:107`) and `variance-resolution.adoc` exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_018CaSgNjNURC7ocsyjYh9We

---
_Generated by [Claude
Code](https://claude.ai/code/session_018CaSgNjNURC7ocsyjYh9We)_

Co-authored-by: Claude <noreply@anthropic.com>
hyperpolymath pushed a commit that referenced this pull request Jun 21, 2026
…nd-user split

- Home.adoc: add a "Who is this for?" tri-split with reading orders for
  developers (proof discipline + build), maintainers (gates + CI cone + 6a2),
  and end users (FOUNDATION_CONTRACT + Overview + EchoTypes.jl). Refresh the
  one-line status to 2026-06-21: ordinal track RETIRED (D-2026-06-21); variance
  resolved (#243); aggregation generalised (#175); establishment Pillar E
  in-repo half complete with order-type fidelity the one named OPEN external
  problem (D-2026-06-14).
- Roadmap.adoc: reframe the ordinal track from "active bottleneck" to RETIRED,
  with the extraction disposition, verified firewall, and frozen open items
  (tracking #263); fix the carried-debt line that still pointed at the moved
  ordinal WF items.

Refs #263.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWMMxryCcPrAjJ8tuGvygG
hyperpolymath pushed a commit that referenced this pull request Jun 21, 2026
…ETIRED)

The machine-readable state still framed the Buchholz/Ordinal track as the
"PRIMARY landed workstream" / "active centre of gravity" (last-updated
2026-06-12, detail as-of 2026-06-05) — predating the 2026-06-20 PARK and the
2026-06-21 RETIREMENT.

- Add a CURRENCY NOTE recording the ordinal-track retirement (D-2026-06-21),
  the extraction disposition (tracking #263), and the hand-off doc; mark the
  detailed [recent-work] / [current-workstream] blocks as preserved HISTORY of
  the 2026-06-05 -> 2026-06-12 arc, not live work.
- Refresh [metadata] last-updated -> 2026-06-21 and phase to the live tracks
  (composition landed; establishment Pillars A-D+F closed + Pillar E in-repo
  complete with order-type fidelity the one OPEN external problem; variance
  resolved #243; aggregation generalised #175).

Refs #263.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWMMxryCcPrAjJ8tuGvygG
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.

2 participants