Skip to content

proof: discharge charEqSym axiom (5→4) + TLA+ model of the Elixir JsWorker#251

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/awesome-davinci-8afqgy
Jun 24, 2026
Merged

proof: discharge charEqSym axiom (5→4) + TLA+ model of the Elixir JsWorker#251
hyperpolymath merged 2 commits into
mainfrom
claude/awesome-davinci-8afqgy

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Proof-completion work across two layers. Both pieces share this branch because the session is pinned to it; they are logically independent and reviewable as separate commits.


1 — ABI: discharge charEqSym axiom → constructive theorem (666c3e0)

charEqSym : (x, y : Char) -> (x == y) = (y == x) was a class-(J) believe_me axiom classified "genuinely unavoidable." It isn't — it is derivable from charEqSound (which the repo already has):

  • x == y = TruecharEqSound gives x = y, collapsing both sides → both True;
  • a mixed True/False split is impossible (soundness forces the contradiction);
  • both False → trivially equal.

No new axiom is introduced. This is the first (a) DISCHARGED entry under the trusted-base reduction policy (standards#203), dropping the sanctioned count 5 → 4. Survivors (charEqSound, unpackLength, appendLengthSum, substrLengthBound) remain genuinely irreducible over opaque Char/String primitives.

Verified: cd src/abi && idris2 --typecheck boj.ipkg → 17/17 modules clean (Idris2 0.8.0, Chez 9.5.8); bash scripts/check-trusted-base.sh → OK, 4 axioms. (Same run confirms Boj.CartridgeDispatch/BJ1 still type-checks.)

Count reconciled across check-trusted-base.sh (EXPECTED_AXIOMS 5→4), PROOF-NEEDS.md, docs/proof-debt.md (charEqSym → §(a)), STATE.a2ml, and docs/backend-assurance/prim__eqChar.md. Also fixed pre-existing drift in src/abi/README.adoc: it wrongly listed logSafeBounded as a believe_me (constructive since #116), said "graded D" (READINESS says C), and called CartridgeDispatch "WIP / not in boj.ipkg" (it's in-package and type-checks).

2 — Elixir: TLA+ model of BojRest.JsWorker (836c977)

specs/elixir-harness/ — a TLA+ model of elixir/lib/boj_rest/js_worker.ex (GenServer pipelining concurrent requests to one persistent Deno Port, per-request 30 s timeout, crash-replies-all + :one_for_one restart). Closes the "Elixir harness has no formal coverage" gap on the proof axis (the Idris2 proofs stop at the Zig FFI boundary).

Verified with TLC (Requests = {r1,r2,r3}, 341 states, no error):

  • ReplyOnce — no caller replied twice under any response/timeout/crash interleaving (the Map.pop guard). Headline.
  • Consistent, NoPendingWhileDown — crash clears pending atomically.
  • EventuallyReplied (liveness) — the 30 s timer guarantees termination even if Deno hangs.
  • Non-vacuity: ReachOk/ReachTimeout/ReachCrashed sanity controls all refuted (all terminal outcomes reachable).

Deferred (noted in the README): the JsWorkerPool routing/supervision layer, and the Invoker pool once it exists (it's fork-per-request today — ADR-0005/0006).


Scope

Items 1 + 2 (Idris ABI) and item 4 (Elixir model). Zig FFI/invariants (item 3) is out of scope (separate workstream). Also carries ef959f0 (prior allTake dedup, not yet on main). Neither piece moves the CRG grade — both are on the formal-proof axis, not the empirical/dogfooding axis.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XrPAh7eBSUcVKauTVdXH9Y


Generated by Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
boj-server c5956d7 Jun 24 2026, 05:52 PM

@hyperpolymath hyperpolymath marked this pull request as ready for review June 24, 2026 17:52
@hyperpolymath hyperpolymath enabled auto-merge (squash) June 24, 2026 17:52
claude added 2 commits June 24, 2026 18:52
…d base 5->4)

charEqSym (symmetry of prim__eqChar) was classified a class-(J) NECESSARY
axiom, but it is derivable from charEqSound: a True result forces
propositional equality (collapsing both sides to the same expression), and a
mixed True/False split is impossible under soundness. Replace the believe_me
with a constructive proof. Verified by `idris2 --typecheck boj.ipkg`
(Idris2 0.8.0, 17/17 modules clean) and `scripts/check-trusted-base.sh`.

First (a) DISCHARGED entry under the trusted-base reduction policy
(standards#203), reducing the sanctioned axiom count 5 -> 4. The survivors
(charEqSound, unpackLength, appendLengthSum, substrLengthBound) remain
genuinely irreducible over opaque Char/String primitives.

Reconcile the count across the gate + docs and fix pre-existing drift:
- scripts/check-trusted-base.sh: EXPECTED_AXIOMS 5 -> 4
- PROOF-NEEDS.md, docs/proof-debt.md: move charEqSym to (a); count 5 -> 4
- src/abi/README.adoc: correct believe_me enumeration (logSafeBounded is
  constructive, not a believe_me, but was wrongly listed); grade D -> C;
  CartridgeDispatch is in boj.ipkg (no longer WIP)
- .machine_readable/6a2/STATE.a2ml: believe-me-count 5 -> 4
- docs/backend-assurance/prim__eqChar.md: charEqSym now a derived theorem

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XrPAh7eBSUcVKauTVdXH9Y
…d (item 4)

Models BojRest.JsWorker (elixir/lib/boj_rest/js_worker.ex): a GenServer
pipelining concurrent requests to one persistent Deno Port, matched by id,
with a per-request 30s timeout and crash-replies-all + :one_for_one restart.

Closes the "Elixir harness has no formal coverage" gap on the proof axis
(the Idris2 ABI proofs end at the Zig FFI boundary; the BEAM-side protocol
was test-only). Formal-proof axis only — does not move the CRG grade.

TLC (Requests = {r1,r2,r3}) verifies, no error across 341 states / depth 8:
- ReplyOnce: no caller replied twice under any response/timeout/crash
  interleaving (the Map.pop guard) -- headline result.
- Consistent + NoPendingWhileDown: crash clears pending atomically.
- EventuallyReplied (liveness): the 30s timer guarantees every request
  terminates even if Deno hangs.
Sanity controls (ReachOk/ReachTimeout/ReachCrashed) are refuted, proving
non-vacuity -- all terminal reply kinds are reachable.

Future work (README): JsWorkerPool routing/supervision; the Invoker pool once
ADR-0005/0006 land (Invoker is fork-per-request today).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XrPAh7eBSUcVKauTVdXH9Y
@hyperpolymath hyperpolymath force-pushed the claude/awesome-davinci-8afqgy branch from 836c977 to c5956d7 Compare June 24, 2026 17:52
@hyperpolymath hyperpolymath disabled auto-merge June 24, 2026 17:53
@hyperpolymath hyperpolymath merged commit a677019 into main Jun 24, 2026
14 of 15 checks passed
@hyperpolymath hyperpolymath deleted the claude/awesome-davinci-8afqgy branch June 24, 2026 17:53
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 219 issues detected

Severity Count
🔴 Critical 15
🟠 High 131
🟡 Medium 73

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action actions/checkout@v4 needs attention",
    "type": "unpinned_action",
    "file": "pages-deploy.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in pages-deploy.yml",
    "type": "missing_timeout_minutes",
    "file": "pages-deploy.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in push-email-notify.yml",
    "type": "missing_timeout_minutes",
    "file": "push-email-notify.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "missing_timeout_minutes",
    "file": "scorecard-enforcer.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "codeql_missing_actions_language",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@github-actions

Copy link
Copy Markdown

🏁 path-claims bench

Commit f7025ae

Numbers
path-claims bench  (node v22.23.0)

  scenario                                              iters       ms        ns/op          ops/s
  --------------------------------------------------------------------------------------------------------------
  register: 10 active claims, 3 new paths               50000 iters    185 ms      3.71 µs/op    269.5k ops/s
  register: 100 active claims, 3 new paths              20000 iters    323 ms     16.16 µs/op     61.9k ops/s
  register: 1000 active claims, 3 new paths              5000 iters    964 ms    192.92 µs/op      5.2k ops/s
  register: 100 active claims, 20 new paths              5000 iters    366 ms     73.31 µs/op     13.6k ops/s

  pathsOverlap: deep diverge at segment 4             1000000 iters    155 ms     155.7 ns/op     6.42M ops/s
  pathsOverlap: short prefix match                    1000000 iters    137 ms     137.5 ns/op     7.27M ops/s

  refresh (existing claim)                             100000 iters     11 ms     112.9 ns/op     8.85M ops/s
  list (100 active claims)                              50000 iters    285 ms      5.71 µs/op    175.0k ops/s

  (Bench numbers depend on host; use deltas across commits, not absolute values.)

Host-dependent — compare deltas across commits, not absolute values.

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