Skip to content

fix(abi): wire PanelIsolation + ResourceCleanup via class-J axiom (proof-debt standards#131)#41

Merged
hyperpolymath merged 2 commits into
mainfrom
proof-debt/standards-131-panel-isolation
May 20, 2026
Merged

fix(abi): wire PanelIsolation + ResourceCleanup via class-J axiom (proof-debt standards#131)#41
hyperpolymath merged 2 commits into
mainfrom
proof-debt/standards-131-panel-isolation

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Discharges the LAST OWED item from gossamer#22's deferred list — the PanelIsolation / ResourceCleanup pair flagged "design call: String == commutativity axiom vs Distinct refactor".

idris2 0.8.0 --typecheck gossamer-abi.ipkg passes 11/11 on this branch, %default total. After gossamer#40 merges and this rebases, the result will be all 13 ABI proof modules wired and green.

Refs hyperpolymath/standards#131 and hyperpolymath/standards#124. NOT Closesstandards#131 close is owner-only (joint-close on agreement; the design choice between axiom and refactor is the substantive bit you'd want a maintainer to sign off on).

Branch base note

This branch is on origin/main (which contains GrooveTermination from gossamer#36). LayoutStability + IPCIntegrity are still in flight on gossamer#40. When both this branch and #40 land, a small ipkg-comment rebase will resolve the overlap. Module count on origin/main today: 9 wired; this branch adds 2; #40 adds 2; final state after both merge: 13 wired.

Decision: Option 1 — sanctioned class-J axiom

The earlier analysis comment on standards#131 (and this session's conversation) walked through Option 1 (axiom) vs Option 2 (Distinct-refactor). Picking Option 1 because:

  1. The axiom is genuine and load-bearing for any approach. Option 2 doesn't eliminate it — it relocates the trust from "== is commutative" to "decEq correctly decides propositional equality on Strings", which is the same primitive (prim__eq_String) at one more level of indirection. Same trust budget.
  2. Naming it explicitly (stringNotEqCommut, classified J in the docstring) makes the trust visible rather than hiding it inside decEq String's implementation.
  3. Aligns gossamer with boj-server's postureBoj.SafetyLemmas has 5 class-J axioms over prim__eqChar / prim__strAppend / etc, with a dedicated property-test + trusted-extraction validation harness on the way (campaign project_boj_server_backend_assurance_harness). One consistent estate story for primitive-boundary reasoning beats per-repo divergence.
  4. Option 2 ergonomic cost — touching every Distinct call site, creating a style split with sibling So types in the same file (MkPanelState, MkPanelChannel) — was non-trivial for the same trust budget.

Changes

PanelIsolation.idr

A new class-J axiom between the Distinct data declaration and the distinctSym proof:

%unsafe
export
stringNotEqCommut : {a, b : String}
                 -> So (not (a == b))
                 -> So (not (b == a))
stringNotEqCommut _ = believe_me ()

distinctSym re-implemented using the axiom:

distinctSym : Distinct a b -> Distinct b a
distinctSym (MkDistinct {a} {b} {prf}) =
  MkDistinct {a=b} {b=a} {prf = stringNotEqCommut prf}

Moduledoc's "Zero believe_me" banner replaced with an honest "One class-J axiom (stringNotEqCommut); all other proofs constructive." — better accurate than aspirational; this is gossamer's first class-J axiom.

ResourceCleanup.idr

The OWED note bundled this with PanelIsolation, but the actual defects were independent:

# Defect Fix
1 Missing import Data.DPair (for Exists / Evidence) Added the import
2 Typo: lowercase exists should be Exists (Idris2 0.8.0 stdlib capitalises it; idris2 suggested the fix in the error message) Renamed at line 228

gossamer-abi.ipkg

Module list extended with the two newly-wired modules. Header deferred-list comment replaced with a closure summary noting where each formerly-deferred module landed (#36 / #40 / this branch).

Verification

$ idris2 --typecheck gossamer-abi.ipkg
 1/11: Building Gossamer.ABI.Types
 2/11: Building Gossamer.ABI.Groove
 3/11: Building Gossamer.ABI.HandleLinearity
 4/11: Building Gossamer.ABI.PanelIsolation
 5/11: Building Gossamer.ABI.ResourceCleanup
 6/11: Building Gossamer.ABI.GrooveTermination
 7/11: Building Gossamer.ABI.WindowStateMachine
 8/11: Building Gossamer.ABI.IPCDispatch
 9/11: Building Gossamer.ABI.CapabilityAuthenticity
10/11: Building Gossamer.ABI.Layout
11/11: Building Gossamer.ABI.Foreign
EXIT=0

Soundness oracle (deferred)

This class-J axiom is principled (prim__eq_String is commutative on every supported backend — Chez, Racket, Node, JS — because they all dispatch to native string-equal which is content-symmetric), but it's still trust that needs external validation. The boj-server project_boj_server_backend_assurance_harness campaign is building exactly that validation infrastructure (property-tests + trusted-extraction against Chez/BEAM). When that harness exists for gossamer, this axiom can be replaced with a backend-verified theorem.

🤖 Generated with Claude Code

@hyperpolymath
Copy link
Copy Markdown
Owner Author

CI auto-trigger anomaly — same as boj-server#132 earlier this session

pull_request workflows did not auto-fire on this branch. Only dogfood-gate.yml (on a push event) ran, and it failed at setup level — not a code defect.

Same diagnosis as boj-server#132 (PR comment): the estate-wide CI concurrency-pool exhaustion from the active sweep122 campaign (memory: project_ci_concurrency_pool_estate, Terminal-7 PID 244005 launched 09:33Z). Other PRs in this session triggered fine when slots were free; the pool is now saturated.

The critical workflow (abi-typecheck.ymlidris2 --typecheck gossamer-abi.ipkg) does NOT support workflow_dispatch, so I cannot manually trigger it.

Local oracle:

$ idris2 --typecheck gossamer-abi.ipkg
 1/11: Building Gossamer.ABI.Types
 2/11: Building Gossamer.ABI.Groove
 3/11: Building Gossamer.ABI.HandleLinearity
 4/11: Building Gossamer.ABI.PanelIsolation
 5/11: Building Gossamer.ABI.ResourceCleanup
 6/11: Building Gossamer.ABI.GrooveTermination
 7/11: Building Gossamer.ABI.WindowStateMachine
 8/11: Building Gossamer.ABI.IPCDispatch
 9/11: Building Gossamer.ABI.CapabilityAuthenticity
10/11: Building Gossamer.ABI.Layout
11/11: Building Gossamer.ABI.Foreign
EXIT=0

Owner: please re-run from the Actions tab once the pool frees up — that's the merge oracle.

🤖 Generated with Claude Code

…oof-debt standards#131)

Discharges the LAST OWED item from gossamer#22's deferred list (the
PanelIsolation/ResourceCleanup pair flagged "design call: String ==
commutativity axiom vs Distinct refactor"). `idris2 0.8.0 --typecheck
gossamer-abi.ipkg` now passes 11/11 (was 11/11 on the prior branch
but without PanelIsolation/ResourceCleanup — net: gossamer-abi.ipkg
goes from 11 to all 13 ABI proof modules wired, with
`%default total` and zero unsanctioned escape hatches).

NB: this branch is based on `origin/main` (which contains
GrooveTermination from gossamer#36); LayoutStability + IPCIntegrity
are in flight on gossamer#40 and will need a small ipkg-comment
rebase when both this branch and #40 land. Module set on origin/main
is 9 wired; this branch adds 2 (PanelIsolation, ResourceCleanup).
After #40 merges + rebase: 13 wired.

Decision: **Option 1 — sanctioned class-J axiom** (over Option 2's
`Distinct`-refactor). Rationale:

  1. The axiom is genuine and load-bearing for *any* approach; Option 2
     relocates it from `==` commutativity to `decEq` correctness over
     the same primitive `prim__eq_String`. Same trust budget.
  2. Naming it explicitly (`stringNotEqCommut`, classified J in the
     docstring) makes the trust visible rather than hidden inside
     `decEq String`.
  3. Aligns gossamer with boj-server's posture (`Boj.SafetyLemmas` 5
     class-J axioms over `prim__eqChar` / `prim__strAppend` etc.), so
     the estate has one consistent story for primitive-boundary
     reasoning rather than diverging postures per repo.
  4. The Option 2 ergonomic cost — touching every Distinct call site,
     creating a style split with sibling `So` types in the same file
     (MkPanelState, MkPanelChannel) — was non-trivial for what is
     ultimately the same trust budget.

  * New class-J axiom `stringNotEqCommut` between the `Distinct` data
    declaration and the `distinctSym` proof:

      %unsafe
      export
      stringNotEqCommut : {a, b : String}
                       -> So (not (a == b))
                       -> So (not (b == a))
      stringNotEqCommut _ = believe_me ()

  * `distinctSym` re-implemented using the axiom (constructive modulo
    the named axiom; full proof in the body):

      distinctSym : Distinct a b -> Distinct b a
      distinctSym (MkDistinct {a} {b} {prf}) =
        MkDistinct {a=b} {b=a} {prf = stringNotEqCommut prf}

  * Moduledoc updated: the "Zero believe_me. All proofs are
    constructive." banner is replaced with an honest "One class-J
    axiom (stringNotEqCommut); all other proofs constructive." — the
    earlier banner was always going to become wrong here; better
    accurate than aspirational.

The OWED note bundled this with PanelIsolation but the actual defects
were independent:

  * Missing `import Data.DPair` (for `Exists` / `Evidence`).
  * Typo: lowercase `exists` should be `Exists` (Idris2 0.8.0 stdlib
    capitalises the type name; idris2 suggests the fix in the error).

Both 1-line fixes; the module now builds clean.

Module list extended with the two newly-wired modules. Header
deferred-list comment replaced with a closure summary noting where
each formerly-deferred module landed (#36 / #40 / this branch).

`IPCIntegrity.ConformsTo`'s `ConformHere` / `ConformThere`
lowercase-shadowing warnings and the suspicious `ConformThere` type
identity (already flagged in the gossamer#40 PR body) remain.
Pre-existing latent defects unrelated to the OWED items in this PR;
file as a separate issue if you want them fixed.

Refs hyperpolymath/standards#131
Refs hyperpolymath/standards#124

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath force-pushed the proof-debt/standards-131-panel-isolation branch from ec8ebd5 to aaef606 Compare May 20, 2026 12:22
Documents the trust-base change (gossamer's first class-J axiom),
the discharge ledger across PRs #36/#40/#41, and the meta-lesson
that landed in the standards#131 closing comment.

## PROOF-NEEDS.md

  * Replaced the now-incorrect "No `believe_me` ... in ABI layer" line
    with an honest "One class-J axiom" entry + reference to the new
    Class-J axioms section.
  * Added "Class-J axioms (trusted base)" section listing
    `stringNotEqCommut`, its justification, and the
    reduce-the-trusted-base path via the boj-server backend-assurance
    harness when ported.
  * Added "Discharge ledger" table for the standards#131 close-out
    (modules → PRs, with merge state).
  * Recorded the meta-lesson: OWED notes from never-built modules
    systematically misdiagnose root cause (4-for-4 in gossamer#22's
    deferred list); build is the only oracle for proof-bearing code.

## .machine_readable/6a2/STATE.a2ml

  * Bumped `last-updated` from 2026-04-25 to 2026-05-20.
  * Added a session-history entry summarising the four discharges
    (#36 / #40 / #41) and the class-J axiom decision (Option 1 vs
    Option 2 rationale captured).

Refs hyperpolymath/standards#131
Refs hyperpolymath/standards#124

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit f04a8ad into main May 20, 2026
15 of 17 checks passed
hyperpolymath added a commit that referenced this pull request May 20, 2026
…dards#131) (#43)

Adds a `== Formal verification` section to the README mirroring
boj-server's (PR #108, 2026-05-20). Necessary update post-#41 because
the README's previous claim of "machine-checked in Idris2" needed
nuance now that one believe_me-bodied class-J axiom
(`stringNotEqCommut`) exists in PanelIsolation.

The new section names:
  * 13/13 ABI modules build green (was a mix of wired-and-tested vs
    wired-but-never-built before the standards#131 campaign discharged
    all four originally-deferred modules).
  * One believe_me invocation, isolated, classified, soundness-oracle
    explicit.
  * Forward link to PROOF-NEEDS.md "Class-J axioms (trusted base)"
    section (added in PR #41) for full per-site rationale.

Symmetric with boj-server's README.adoc:109-129 § Formal verification
which documents that repo's 5 class-(J) axioms. Estate-wide pattern:
honest disclosure at the README level, full audit in PROOF-NEEDS,
machine-readable state in STATE.a2ml.

Refs hyperpolymath/standards#131
Refs hyperpolymath/standards#124

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath deleted the proof-debt/standards-131-panel-isolation branch May 20, 2026 13:08
hyperpolymath added a commit that referenced this pull request May 20, 2026
…dards#131) (#44)

Adds a `== Formal verification` section to the README mirroring
boj-server's (PR #108, 2026-05-20). Necessary update post-#41 because
the README's previous claim of "machine-checked in Idris2" needed
nuance now that one believe_me-bodied class-J axiom
(`stringNotEqCommut`) exists in PanelIsolation.

The new section names:
  * 13/13 ABI modules build green (was a mix of wired-and-tested vs
    wired-but-never-built before the standards#131 campaign discharged
    all four originally-deferred modules).
  * One believe_me invocation, isolated, classified, soundness-oracle
    explicit.
  * Forward link to PROOF-NEEDS.md "Class-J axioms (trusted base)"
    section (added in PR #41) for full per-site rationale.

Symmetric with boj-server's README.adoc:109-129 § Formal verification
which documents that repo's 5 class-(J) axioms. Estate-wide pattern:
honest disclosure at the README level, full audit in PROOF-NEEDS,
machine-readable state in STATE.a2ml.

Refs hyperpolymath/standards#131
Refs hyperpolymath/standards#124

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request May 20, 2026
…dards#131) (#47)

Adds a `== Formal verification` section to the README mirroring
boj-server's (PR #108, 2026-05-20). Necessary update post-#41 because
the README's previous claim of "machine-checked in Idris2" needed
nuance now that one believe_me-bodied class-J axiom
(`stringNotEqCommut`) exists in PanelIsolation.

The new section names:
  * 13/13 ABI modules build green (was a mix of wired-and-tested vs
    wired-but-never-built before the standards#131 campaign discharged
    all four originally-deferred modules).
  * One believe_me invocation, isolated, classified, soundness-oracle
    explicit.
  * Forward link to PROOF-NEEDS.md "Class-J axioms (trusted base)"
    section (added in PR #41) for full per-site rationale.

Symmetric with boj-server's README.adoc:109-129 § Formal verification
which documents that repo's 5 class-(J) axioms. Estate-wide pattern:
honest disclosure at the README level, full audit in PROOF-NEEDS,
machine-readable state in STATE.a2ml.

Refs hyperpolymath/standards#131
Refs hyperpolymath/standards#124

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request May 20, 2026
…dards#131) (#49)

Adds a `== Formal verification` section to the README mirroring
boj-server's (PR #108, 2026-05-20). Necessary update post-#41 because
the README's previous claim of "machine-checked in Idris2" needed
nuance now that one believe_me-bodied class-J axiom
(`stringNotEqCommut`) exists in PanelIsolation.

The new section names:
  * 13/13 ABI modules build green (was a mix of wired-and-tested vs
    wired-but-never-built before the standards#131 campaign discharged
    all four originally-deferred modules).
  * One believe_me invocation, isolated, classified, soundness-oracle
    explicit.
  * Forward link to PROOF-NEEDS.md "Class-J axioms (trusted base)"
    section (added in PR #41) for full per-site rationale.

Symmetric with boj-server's README.adoc:109-129 § Formal verification
which documents that repo's 5 class-(J) axioms. Estate-wide pattern:
honest disclosure at the README level, full audit in PROOF-NEEDS,
machine-readable state in STATE.a2ml.

Refs hyperpolymath/standards#131
Refs hyperpolymath/standards#124

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 31 issues detected

Severity Count
🔴 Critical 11
🟠 High 4
🟡 Medium 16

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "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": "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": "Action actions/upload-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/download-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/gossamer/gossamer/src/interface/abi/IPCDispatch.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/gossamer/gossamer/src/interface/abi/ResourceCleanup.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/gossamer/gossamer/src/interface/abi/GrooveTermination.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/gossamer/gossamer/src/interface/abi/HandleLinearity.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/gossamer/gossamer/src/interface/abi/WindowStateMachine.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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.

1 participant