theory: EchoSearch — Axis 8 witness-search machine (thin slice)#80
Merged
Conversation
Adds `proofs/agda/EchoSearch.agda` (+ `EchoSearchInstance.agda` for smoke pins), the enumerator-bounded witness-search refinement of `Echo` named in `docs/echo-types/taxonomy.md` §Axis 8 / refinement (4) "witness-search abstract machine". Carrier: `EchoS enum f y n = Σ ℕ λ k → (k < n) × (f (enum k) ≡ y)` with stdlib `Data.Nat._<_` (suc m ≤ n) so `<-≤-trans` / `≤-<-trans` apply without conversion glue. Headlines: `echo-search-intro`, `echo-search-relax` (bound monotonicity), `echo-search-forget` (project to `Echo`), `echo-search-bound-zero` (vacuity at budget 0), `echo-search-postcompose` (post-compose with g, same bound). Sequential / product-strategy composition needs a `ℕ × ℕ ↔ ℕ` pairing bijection and is deferred to a separate slice; documented in the module preamble "where next" section alongside a real abstract-machine refinement and the bridge to `EchoDecidable`. `EchoSearchInstance.agda` pins each headline at `A = B = ⊤`, `enum = λ _ → tt`, mirroring the `EchoApproxInstance` pattern so `Smoke.agda` can name the parameterised lemmas in a `using` clause. --safe --without-K throughout; no postulates, no funext, no escape pragmas. Clean-worktree Agda build green: `agda --safe --without-K All.agda` exits 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
Second wave of the same merge regression: the `3227b15` merge of `main` into `examples/absint-sign` also dropped PR #80's additive changes (Axis 8(4) witness-search machine, landed on main as commit `a1e9cbc`). This recovers them on top of the previous parser recovery commit `8950855`: * `proofs/agda/EchoSearch.agda` — restored from `main:proofs/agda/EchoSearch.agda` (156 lines, byte-identical to PR #80). * `proofs/agda/EchoSearchInstance.agda` — restored similarly (86 lines). * `proofs/agda/All.agda` — re-add `open import EchoSearch` + `EchoSearchInstance` (in the post-`EchoDecidable` slot per #80). * `proofs/agda/Smoke.agda` — re-add the 30-line headline-pin block for both modules, slotted between `EchoDecidable` and `EchoAccess`. Build invariant restored: `agda proofs/agda/All.agda` and `agda proofs/agda/Smoke.agda` exit 0 under `--safe --without-K`. All four parallel-session additions (PRs #80 EchoSearch, #83 EchoExampleParser, plus this PR #82's EchoExampleAbsInt) are now wired in together. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
…#86) ## Summary Gate **F1** of the earn-back plan — the MAKE-OR-BREAK retraction from [R-2026-05-18](../blob/main/docs/retractions.adoc) — now passes. The 2026-05-18 spike `EchoGradedComonadF1.agda` had two of three graded-comonad laws closed (`gc-counit-l`, `gc-counit-r`) and named the remaining obstruction precisely: an isolated proof-engineering type-mismatch at the inductive step of `gc-coassoc`, requiring an explicit δ-naturality lemma over the outer `R` layer rather than the ad-hoc `coe-cong-R ∘ sym` push. This PR discharges that obligation: ```agda δ-suc : ∀ m n {A} (x : D (m + n) A) (b : Bool) → δ (suc m) n {A} (x , b) ≡ (δ m n x , b) δ-suc m n {A} x b = coe-cong-R (D-+ m n A) x b ``` This factor + the existing `subst-D-suc` let `gc-coassoc` close as a six-step `≡-Reasoning` chain. Stdlib's `+-assoc (suc m) n p` reduces *definitionally* to `cong suc (+-assoc m n p)`, so the two ℕ-equation proofs at the chain ends are syntactically identical and **ℕ-UIP is not needed for `gc-coassoc` itself** (`gc-counit-l` still uses ℕ-UIP, which is K-free via Hedberg / decidable equality). ## Mechanised content of F1 * Grade monoid `(ℕ, +, 0)`; `D 0 A = A`; `D (suc r) A = R (D r A)` where `R X = X × Bool` — a non-collapsing residue layer. * `mapD r f` functorial (`mapD-id`, `mapD-∘`). * `ε : D 0 A → A` — counit at the unit grade. * `δ : D (m + n) A → D m (D n A)` — **NESTED** comultiplication. * `gc-counit-r` (definitional), `gc-counit-l` (induction on grade), `gc-coassoc` (this PR). * `D2-nontrivial` — separating witness that `D r` is not `⊤` / a prop. * Echo is the grade-unit object: `D 0 (Echo f y) ≡ Echo f y`. `--safe --without-K`, **zero postulates**, zero escape pragmas, no funext. Wired into `All.agda` and pinned in `Smoke.agda`. ## Scope (please re-read with care) F1 earns back the **existence** of a graded comonad with Echo as the grade-unit object — that's the claim R-2026-05-18 retracted at its strongest reading. It does **NOT** retroactively make `EchoGraded` itself a graded comonad: `EchoGraded` remains a thin-poset reindexing modality on a three-element lattice, with no nested family, no monoid multiplication, no `D r r' ⇒ D r ∘ D r'`. The paper's title and central thesis (Echo as a reindexing modality) stand unchanged; F1 enters the codebase as an *additional* mechanised contribution beside `EchoGraded`. ## What this unblocks Gate **F3** — a genuinely independent second model of the comonad at a different grade monoid (e.g. tropical or multiplicative semiring), without a `× ⊤` carrier or a `⊑-prop`-equivalent field — is now in scope. F3 is **not** started by this PR. ## Doc changes (gated, scoped) * `docs/echo-types/earn-back-plan.adoc` — ledger row A1 + Status entry (F1 PASSED 2026-05-20), with the scope qualifier pinned. * `docs/retractions.adoc` — follow-up **F-2026-05-20a** appended (append-only revision policy preserved); no edits to other doc bodies. * `paper.adoc`, `types-abstract.adoc`, `conservativity.adoc` — **intentionally untouched** in this PR. Their bodies are about `EchoGraded`'s thin-poset structure, which F1 does not change. Whether to add a bounded new-contribution paragraph mentioning the F1 side-construction is **owner-gated**. ## Test plan * [x] `agda proofs/agda/All.agda` exit 0 under `--safe --without-K` * [x] `agda proofs/agda/Smoke.agda` exit 0 under `--safe --without-K` * [x] `grep -nE '^\s*postulate\b|BUILTIN REWRITE|NON_TERMINATING|TERMINATING' proofs/agda/EchoGradedComonadF1.agda` returns no matches in code * [x] `--safe --without-K` OPTIONS line preserved on the F1 module * [ ] (owner) confirm the scope language in `retractions.adoc` F-2026-05-20a matches intent * [ ] (owner) decide whether `paper.adoc` / `types-abstract.adoc` / `conservativity.adoc` should gain a bounded contribution paragraph in a separate PR ## Non-overlap with parallel sessions Touches: `EchoGradedComonadF1.agda` (existing 2026-05-18 spike, finishing it), `All.agda` (one-line F1 import), `Smoke.agda` (F1 pin block), `earn-back-plan.adoc`, `retractions.adoc`. Stays clear of: * `proofs/agda/Ordinal/**` — the Brouwer-arithmetic / `_<ᵇ⁻_` / rank-mono session's territory. * Any module the recent estate PRs (#80 EchoSearch, #81 EchoExampleProvenance, #83 EchoExampleParser) added — restored their imports cleanly during the rebase onto fresh `origin/main`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
Third wave of the same merge regression pattern that the prior fix-up commits (8950855 for #83 EchoExampleParser, 549f219 for #80 EchoSearch) already addressed: between the last main-merge and now, PR #81 landed on main, adding EchoExampleProvenance.agda and its imports/pins. Resolution: keep this PR's EchoExampleAbsInt additions and add the EchoExampleProvenance additions from main alongside them (additive on both sides — no semantic conflict, both examples coexist). * proofs/agda/All.agda — both `open import EchoExampleAbsInt` and `open import EchoExampleProvenance` retained; EchoExamples (which the conflict block had duplicated) appears once. * proofs/agda/Smoke.agda — both the Example 10 (AbsInt) pin block and the Example 5 (Provenance) pin block retained, in that order. * proofs/agda/EchoExampleProvenance.agda — restored from main (new file on this branch). Build invariant restored: `agda proofs/agda/All.agda` and `agda proofs/agda/Smoke.agda` exit 0 under `--safe --without-K`. All examples added by parallel sessions (#80 EchoSearch, #81 EchoExampleProvenance, #83 EchoExampleParser, plus this PR #82 EchoExampleAbsInt) are wired in together. No postulates, no escape pragmas. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
…landed (#89) Updates the `Current rung state (2026-05-20)` block to record Wave 3 of today's swarm and refresh the next-Claude plan. ## What this captures * 5 Wave-3 PRs (`#80` EchoSearch, `#81` provenance, `#82` absint, `#83` parser, `#85` EchoCost) and 2 parallel-session merges (`#84` Pillar E Evaluation, `#86` F1 gc-coassoc). * Axis 8 is now 4-of-4 (decidability + graded access + cost + search). * Next-Claude plan refreshed: ordinal-track unbudgeted WF is the named next bottleneck; EchoApprox examples 6/8 still open; EchoSearch sequential/product composition deferred. ## Two minor lessons memorialised * Per-lane Smoke `open import ... using ( ... )` blocks should be separate (with header comments), not shared paren-blocks — cuts swarm merge-conflict noise. * During swarm-merge sequences, re-fetch the branch before any force-push: parallel claude sessions may be concurrently rebasing the same PR (observed on `#82`). ## Invariants * Doc-only change; no Agda touched. * `--safe --without-K` invariant unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
Resolves conflicts in 4 files (CLAUDE.md, docs/echo-types/roadmap.md, proofs/agda/All.agda, proofs/agda/Smoke.agda) by integrating main's Wave-3 axis-8 closure work with this branch's ω-power rank-mono unblock. * `CLAUDE.md` — keep both session-arc sections. Main's "2026-05-20 daytime (theory closure waves 1+2+3)" stays; this branch's "2026-05-20 evening — ω-power rank-mono unblock (read this first)" is the new primary handoff. * `docs/echo-types/roadmap.md` — take main's "Axis 2 + Axis 8 four refinements landed" entries (canonical). * `proofs/agda/All.agda` — drop my stale `EchoExampleSignAnalysis`, `EchoExampleTruncation`, `EchoSearchExample` imports. Those files depended on the early thin-slice `EchoCost`/`EchoSearch` interfaces; main's PRs #80/#85 replaced those with the abstract- algebra `CostAlgebra` shape, breaking the dependents. Stale files left on disk for later triage (delete-or-update is a separate slice). * `proofs/agda/Smoke.agda` — take main's `EchoSearch` / `EchoSearchInstance` / `EchoAccess` headline pins (canonical shape with `SearchStrategy`, `EchoS`, `Access` 5-grade enum, etc.). * `flake.nix`, `proofs/agda/EchoAccess.agda`, `EchoCost.agda`, `EchoSearch.agda` — take main's versions (PRs #80/#85 canonical). Build invariant restored: `agda proofs/agda/All.agda` and `agda proofs/agda/Smoke.agda` exit 0 under `--safe --without-K`. No postulates, no escape pragmas. All Ordinal/Buchholz path-1 work from this session (Slices 1-5 + Items 1-3) intact. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
May 20, 2026
…luster landed (#92) ## Summary Three small accuracy passes through `docs/echo-types/` after the earn-back programme, the §"Theory work — no proof assistant needed" section, and the canonical examples cluster (5/9/10) all closed in this session. Pure prose; no Agda changes. ### 1. `roadmap.md` §"Theory work" — two stale items refreshed * **Axis 8** line said the *decidability-respecting* candidate had shipped but listed the other three as still candidate refinements. All four have now shipped: `EchoDecidable`, `EchoCost` (#85), `EchoAccess` (#68 / #75), `EchoSearch` (#80). Updated to credit all four. * **Negative / co-echoes** line was `[unblocked]`; now `[landed]` — `AntiEcho` (#69), tropical decomposition concrete + generic (#72 + #91), `antiecho-partition-dec` (#90). Names the `coecho.md` §5 obligation-5 / obligation-6 closures explicitly. After these edits, every item in §"Theory work — no proof assistant needed" is either `[landed]` or `[ruled out]`/`[refreshed]` — the section is genuinely closed. ### 2. `roadmap.md` §"Example work" — three items landed * ex. 5 (`EchoExampleProvenance`, #81) → `[landed]` * ex. 9 (`EchoExampleParser`, #83) → `[landed]` * ex. 10 (`EchoExampleAbsInt`, #82) → `[landed]` Only ex. 6 (approximate-echo numeric example) remains `[unblocked]`. ### 3. `earn-back-plan.adoc` — stale `roadmap-gates.adoc` claim corrected * Header note used to say "the gate discipline was historically attributed to a `roadmap-gates.adoc`; that file does not exist in-tree". The file **does** exist (created 2026-05-18; see its preamble). Header rewritten to list `roadmap-gates.adoc` alongside `retractions.adoc` / this plan / `next-questions.adoc` as the four canonical loci. * Ledger row D (the "doesn't exist" entry) marked **CLOSED 2026-05-20** with the cite reflecting current reality. ## Test plan * [x] Pure docs / `.adoc` / `.md` edits — no Agda touched * [x] `agda proofs/agda/All.agda` exit 0 (confirms docs match code) * [x] `agda proofs/agda/Smoke.agda` exit 0 * [x] No retracted-claim language moved; no earned-back claim overclaimed; `paper.adoc` / `types-abstract.adoc` / `conservativity.adoc` untouched ## Scope Disjoint from all currently-open PRs: * #88 (F3) — touches Agda + `retractions.adoc` (different sections) + `earn-back-plan.adoc` Status (different section from header / ledger-D) * #90 (partition-dec) — touches Agda only * #91 (generic-codomain) — touches Agda + preamble comments No retracted claim is moved. No earned-back claim is overclaimed. `paper.adoc` / `types-abstract.adoc` / `conservativity.adoc` are intentionally untouched (owner-gated, per the posture set by #86 / #88). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 10 issues detected
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": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in secret-scanner.yml",
"type": "missing_workflow",
"file": "secret-scanner.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Action actions/cache@v4 needs attention",
"type": "unpinned_action",
"file": "agda.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "No dependabot.yml or renovate.json found in echo-types",
"type": "DependencyUpdate",
"file": "/home/runner/work/echo-types/echo-types",
"action": "auto_fix",
"rule_module": "scorecard",
"severity": "high",
"remediation": "Add .github/dependabot.yml or renovate.json configuration.",
"scorecard_check": "Dependency-Update-Tool"
},
{
"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": "1 workflow(s) with tag-pinned (not SHA-pinned) actions in echo-types",
"type": "DependencyPinning",
"file": "/home/runner/work/echo-types/echo-types",
"action": "auto_fix",
"rule_module": "scorecard",
"severity": "medium",
"remediation": "Pin GitHub Actions and Docker base images by SHA hash.",
"scorecard_check": "Pinned-Dependencies"
},
{
"reason": "Repository has 1 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
proofs/agda/EchoSearch.agda(+EchoSearchInstance.agdaforsmoke pins), the enumerator-bounded witness-search refinement of
Echonamed indocs/echo-types/taxonomy.md§Axis 8 / refinement(4) "witness-search abstract machine".
What lands
SearchStrategy A := ℕ → A(a total enumeration; partiality is a separate axis-8(2) refinement)EchoS enum f y n := Σ ℕ λ k → (k < n) × (f (enum k) ≡ y)— the bound-indexed witness, using stdlibData.Nat._<_so<-≤-trans/≤-<-transapply without conversion glueecho-search-intro,echo-search-relax(bound monotonicity via<-≤-trans),echo-search-forget(project to plainEcho),echo-search-bound-zero(vacuity at budget 0),echo-search-postcompose(post-compose withg, same index, same bound)EchoSearchInstance.agdapins each headline at the trivialA = B = ⊤enumerator (mirrors theEchoApproxInstancepattern soSmoke.agdacan enumerate the parameterised lemmas in ausingclause)All.agda+Smoke.agdaDesign notes
The roadmap term "abstract machine" admits several honest readings; the smallest is enumerator-bounded witness — a search strategy
enum : ℕ → Apaired with a step budgetn : ℕ. Theℕ-bound is the step budget; a heavier machine (Turing-bounded, polynomial-time, configurations + step relation) projects onto this thin slice by forgetting everything except the index queried and the bound queried under. This sits at the bottom of the axis-8(4) lattice in the same senseEchoDecidablesits at the bottom of axis-8(3).On composition. The brief asked for "a sensible compositional rule" and flagged that a full product-strategy compose may be awkward without more machinery. I shipped
echo-search-postcompose— the genuinely-honest compositional content available without further machinery: a bound-nsearch witnessingfatyalso witnessesg ∘ fatg y, at the same step index and the same bound (the enumerator and queried step have not changed; only the answer has). Sequential / product-strategy compositionEchoS enum f b n₁ → EchoS enum' g y n₂ → EchoS (paired) (g ∘ f) y (n₁ * n₂)needs aℕ × ℕ ↔ ℕpairing bijection and is deferred to a separate slice; this and a real abstract-machine refinement + a bridge toEchoDecidableare documented in the module's "where next" section.Invariants
--safe --without-Kon every new modulebelieve_me-equivalentsagda --safe --without-K All.agdaexits 0 (Smoke pins all resolve)Refs Axis 8(4) —
docs/echo-types/taxonomy.md.🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com