fix(abi): remove duplicate allTake in Boj.SafetyLemmas (core proofs green)#237
Merged
Conversation
allTake was defined twice (lines ~122-130 and ~213-221) with the same logical type (only the implicit-argument order differed), causing "Boj.SafetyLemmas.allTake is already defined" and failing the core ABI proof type-check (boj.ipkg: PASS=104 FAIL=1). Pre-existing bug, masked because the Idris2 type-check job is path-gated and skips unless a .idr changes (it surfaced on #234 and #236 when a .idr edit triggered the job). Fix: keep the first definition -- a complete, total proof (no postulates, no believe_me) -- and remove the redundant second copy. Both callers (SafePromptInjection, SafeHTTP) use `allTake prf` with inferred implicits, so the removed copy's implicit order is irrelevant to them. Expected: scripts/typecheck-proofs.sh -> PASS=105 FAIL=0. (Idris2 not available in the authoring env; the Idris2 CI job is the proof check.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XrPAh7eBSUcVKauTVdXH9Y
🏁 path-claims benchCommit NumbersHost-dependent — compare deltas across commits, not absolute values. |
🔍 Hypatia Security ScanFindings: 214 issues detected
View findings[
{
"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"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-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/sanctify-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/hesiod-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]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.
Fixes the pre-existing Idris2 failure surfaced on #234/#236 (not caused by either — they just triggered the path-gated Idris2 job by touching a
.idr).Root cause
allTakewas defined twice insrc/abi/Boj/SafetyLemmas.idr:{p} -> {n} -> {xs} -> allRec p xs = True -> allRec p (take n xs) = True{p} -> {xs} -> {n})→
Error: Boj.SafetyLemmas.allTake is already defined→ the core ABI packageboj.ipkgfailed type-check (PASS=104 FAIL=1). It was masked normally because the Idris2 job is path-gated and skips unless a.idrchanges.Fix
Kept the first definition — a complete, total proof (no
postulate, nobelieve_me) — and removed the redundant second copy. No proof is weakened or stubbed.Both callers use inferred implicits, so the removed copy's argument order didn't matter to them:
Boj/SafePromptInjection.idr:168—MkDelimiterCharsafe (take n cs) {prf = allTake prf}Boj/SafeHTTP.idr:139—MkHeaderCharsafe (take n cs) {prf = allTake prf}Verification
Expected:
scripts/typecheck-proofs.sh→ PASS=105 FAIL=0. Idris2 isn't available in the authoring environment, so the Idris2 type-check CI job is the proof verification here — it should go from failing to green on this PR (and this is the first PR that should pass it cleanly when the job runs).🤖 Generated with Claude Code
Generated by Claude Code