fix(agda): restore main typecheck — carry the fiber invariant in FiberBundle - #328
Merged
Merged
Conversation
…rBundle CI 'Agda' has been red on main since 2026-09-26 (last green 9c4b72b, 2026-09-21). Two independent gates fail; this commit addresses both. 1. kernel-guard.sh check B (classification drift). EchoBitNarrowingNumeric, EchoExampleBitNarrowing and EchoHaplotypeCollapsing were never added to the classification table in docs/echo-types/echo-kernel-note.adoc. Added to Tier 2 (each depends on a Tier-2 module). The guard now PASSES — verified locally, it is pure POSIX shell and needs no Agda. 2. Agda cold typecheck (exit 42, i.e. a real type error). Root cause: FiberBundle carried `fiber : List Clone` with NO invariant linking the clones to `haplotype`, so bundle-fiber-echoes b = map (\c -> c , refl) (FiberBundle.fiber b) demanded `refl : collapse c == FiberBundle.haplotype b` for an ARBITRARY c. Those terms are not judgementally equal, so the proof was unprovable — not a typo, a missing invariant. The invariant is documented, and enforced, one layer up: docs/echo-types/applications/haplotype-collapsing.adoc says the Nickel contracts enforce "every clones[i].haplotype_id == haplotype_id". The runtime layer had the contract; the machine-checked layer did not. Fix: make the invariant structural — `fiber : List (HaploFiber haplotype)` and `representative : HaploFiber haplotype`. bundle-fiber-echoes is then the field projection and needs no proof. Same discipline as the Ephapax region_shrink falsity: the invariant belongs in the carrier, not in a side-condition re-imposed at every use site. Also drops the now-unused `map` and `length` imports. NOTE: item 2 is reasoned, not machine-verified. No Agda toolchain is reachable in this environment (GitHub release assets are network-blocked, and Agda is not installable from source here). It awaits the CI 'Agda' run. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
arena-ai-coding-agent
Bot
requested a review
from hyperpolymath
as a code owner
September 27, 2026 23:06
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
hyperpolymath
approved these changes
Sep 27, 2026
Workflows have failed at creation with `startup_failure` since 2026-09-26. Root cause: cd9aa40 (dependabot, #326) bumped github/codeql-action 4.38.0 -> 4.38.1 in codeql.yml (+2 -2) and hypatia-scan.yml (+1 -1), but did not regenerate .github/workflows/actions.lock, which still pinned 4.38.0 in three places. The lockfile no longer validates against the workflows, so the lockfile gate rejects the runs before any job starts. This is the same failure mode, and the same fix, as 9c4b72b (the last green main commit): "Workflows fail at creation with `The lockfile could not be validated. Regenerate it by running gh actions-lock`." Scope: version strings only. * workflows: map — github/codeql-action@v4.38.0 -> v4.38.1 for codeql.yml and hypatia-scan.yml (the refs those files actually use). * dependencies: entry regenerated for 4.38.1. The commit hash is the PEELED tag commit, which is the convention the existing entry already follows (v4.38.0^{} = b96794f015dfd88f77b49b1c93e0fa7110f94c63, exactly the hash previously recorded). v4.38.1^{} = 1c5b675653bb5c22dbe9b12b556ec555138e09fd, resolved via `git ls-remote --tags https://github.com/github/codeql-action`. owner_id 9919 / repo_id 259445878 are unchanged — same repository. Relation to the existing convention is unchanged: the lock records the repo-level ref (github/codeql-action@v4.38.1) while the workflow files reference sub-paths (github/codeql-action/init@v4.38.1) — the lock normalised that the same way for 4.38.0. NOTE: regenerated by hand, not by `gh actions-lock` — the extension's release binary is not reachable from the environment this was prepared in. It is byte-faithful to the tool's convention (verified against the pre-existing 4.38.0 entry) but a maintainer run of `gh actions-lock` should be preferred if anything looks off. Because the failure mode is startup_failure, this could not be tested locally — it will only be confirmed by whether runs now start. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
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.
Reopens
mainfor business: CIAgdahas been red since 2026-09-26.Status
main9c4b72b5, 2026-09-21T12:20cold-check(Agda typecheck, exit 42) andcheck(kernel-guard, exit 1)Both failures are real defects, not infrastructure. Two independent causes.
Failure 1 —
kernel-guard.shclassification drift (fixed, verified locally)scripts/kernel-guard.shcheck B requires everyproofs/agda/Echo*.agdato be named indocs/echo-types/echo-kernel-note.adoc. Three modules added by #325 and #327 were neverclassified:
All three are Tier 2 (each depends on a Tier-2 module —
EchoExampleBitNarrowingonEchoExampleTruncation,EchoBitNarrowingNumericon both of those,EchoHaplotypeCollapsingonEchoAggregation+EchoNoSectionGeneric).Check A (the funext-free certificate) already passed and still passes:
EchoandEchoKernelare stdlib-only, no postulates, no escape pragmas, no funext imports. That certificate is intact.
Verified locally — the guard is pure POSIX shell and needs no Agda:
Failure 2 — a missing invariant in
FiberBundle(fixed, awaits CI)EchoHaplotypeCollapsing.agdadid not typecheck. The defect is inbundle-fiber-echoes:HaploFiber h = Echo collapse h = Σ Clone (λ c → collapse c ≡ h), so the lambda demandsrefl : collapse c ≡ FiberBundle.haplotype bfor an arbitraryctaken fromfiber b.Those terms are not judgementally equal. Expected message:
This is not a typo — the record is missing an invariant, and the invariant is already
documented one layer up.
docs/echo-types/applications/haplotype-collapsing.adoc:The Nickel schema had the contract; the Agda record did not — then the module tried to prove a
consequence of an invariant it never carried.
Fix: make the invariant structural rather than re-imposed at the use site.
bundle-fiber-echoesbecomes the field projection and needs no proof;example-bundlesuppliesgenuine echoes.
example-count = reflandclone-count-aggregationwere checked against theirdefinitions and are correct as they stood. Also drops the now-unused
map/lengthimports.This is the same lesson as the Ephapax
region_shrinkfalsity, arriving from the oppositedirection: there, an invariant kept in a per-use side-condition produced a false lemma; here,
an invariant kept out of the carrier produced an unprovable one.
This half is reasoned, not machine-verified. No Agda toolchain is reachable in the
environment this was prepared in (GitHub release assets are network-blocked and Agda is not
installable from source there), so the fix could not be typechecked locally. It needs this PR's
Agdarun to confirm. If the error differs from the prediction above, the reasoning has a holeand the diagnostic is wrong — please paste the actual output rather than merging.
Side findings (not fixed here)
EchoBitNarrowingNumericandEchoExampleBitNarrowingare unreachable from every CItarget. The cold-check compiles only
All.agda,Smoke.agda,characteristic/All.agda,examples/All.agdaandEchoImageFactorizationPropCubical.agda. Neither module is importedby any of them, so both are never typechecked by CI — they only tripped a grep. proofs(agda): preserve the bit-narrowing exhibits from unpushed commi… #325's own
message notes they were recovered "from unpushed commits". These are currently unverified.
docs/echo-types/MAP.adocnamesEchoHaplotypeCollapsingbut neither bit-narrowingmodule.
kernel-guard.shonly checks the kernel note, so this is not a gate failure — but itis drift, and adding entries needs an editorial call on placement.
Note on this branch
This branch comes from a structural audit of the six-repo estate (
echo-types,ephapax,affinescript,systemet,anytype,panoply) rather than from the usual issue flow, hence thearena/name and the absence of a linked issue. Only the two fixes above are in scope. Happy tore-cut against an issue, or to drop this and hand the diagnosis over as an issue instead.
Worth recording that the gate itself worked exactly as designed: because
All.agdaandSmoke.agdawere both wired to the new module,mainwent red the moment an unprovable lemmalanded. That is the strongest argument for the existing methodology — the gap is in the repair
loop, not the check.
Second fix:
main's CodeQL and Hypatia workflows never start (6044971)Investigating why this PR's checks came back
startup_failureturned up a separate,pre-existing breakage on
main— one that has nothing to do with this branch.Evidence
On
main, at commit1f677531, pushed byhyperpolymath, eventpush, same run batch:Same actor, same commit, same event. The lockfile validation is therefore per-workflow, and
exactly the two workflows whose lock entries are stale are the two that never start. The same
pair has startup-failed on every event since 2026-09-26, including human pushes to
main.Cause
cd9aa401(dependabot, #326, 2026-09-26) changed.github/workflows/codeql.yml(+2 −2) and.github/workflows/hypatia-scan.yml(+1 −1), bumpinggithub/codeql-action4.38.0 → 4.38.1— but did not regenerate
.github/workflows/actions.lock, which still pinned 4.38.0 in threeplaces. The lockfile no longer validates against the workflows, so the gate rejects the runs
before any job is created.
This is the same failure mode, and the same fix, as
9c4b72b5— the last greenmaincommit,whose message reads: "Workflows fail at creation with
The lockfile could not be validated. Regenerate it by running gh actions-lock".Fix
Version strings only — 2
workflows:refs plus thedependencies:entry, resolved to 4.38.1.The
commit:hash is the peeled tag commit, which is the convention the existing entryalready follows:
v4.38.0^{} = b96794f0…is byte-for-byte the hash previously recorded.v4.38.1^{} = 1c5b6756…, fromgit ls-remote --tags https://github.com/github/codeql-action.owner_id/repo_idare unchanged (same repository). The lock's existing habit of recording therepo-level ref while the workflows use sub-paths
(
github/codeql-action@v4.38.1vsgithub/codeql-action/init@v4.38.1) is preserved exactly.Caveat: regenerated by hand, not by
gh actions-lock— the extension's release binary isunreachable from the environment this was prepared in. It is faithful to the tool's convention
(checked against the pre-existing 4.38.0 entry), but a maintainer run of
gh actions-lockshouldbe preferred if anything looks off. Because the symptom is
startup_failure, it cannot be testedlocally — it is confirmed only by whether CodeQL/Hypatia next start.
Every workflow on this branch came back
startup_failure, includingAgda. The reason is thetriggering actor, not the content:
Both are
pull_requestevents onarena/*branches. When the trigger is thearena-ai-coding-agent[bot]App, no workflow is created at all.gh run rerunis refused with"its workflow file may be broken".
To get CI to verify the Agda fix, close and reopen this PR as a human, or push any commit to
the branch. Everything below is unverified until that happens.