Skip to content

fix(#34): resolve Hypatia backlog at source; finalize baseline#35

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/resolve-issue-34
May 15, 2026
Merged

fix(#34): resolve Hypatia backlog at source; finalize baseline#35
hyperpolymath merged 2 commits into
mainfrom
claude/resolve-issue-34

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Absolute resolution of #34. Rather than enumerate the scanner's output, I ran the upstream scanner locally to find out what the "standing backlog" actually is — and it is not a security backlog:

  • The upstream bash ruleset emits 1864 line-level findings, dominated by policy rules like rescript_file_present firing on every line of every .res file — a "migrate away from ReScript" policy that directly contradicts this repo's own ReScript-first language standard (CLAUDE.md).
  • The single Critical "proof hole" (coq_admitted, Typing.v:447) is a false positive: it matches the word "Admitted" inside a comment documenting that a lemma was previously admitted and is now fully Qed.-proved. There is no Admitted./admit. token anywhere in the repo.
  • The .ncl "Docker" finding is a false positive on a Nickel policy that itself bans Dockerfile.

So #34's items were resolved at source, not suppressed:

Finding Disposition
concurrency.rs lock/poison unwraps (8+13) Fixed (poison-tolerant, prior PR)
string.rs char::from_digit().unwrap() Fixed.expect() with the proved digit < radix ≤ 36 invariant; .hypatia-ignore entry removed
Coq coq_admitted (Critical) Eliminated — comment reworded; finding ceases to exist
.ncl docker / proptest / playground/ / dialects/ Documented false-positive / non-shipping exemptions in .hypatia-ignore

.hypatia-baseline.json finalized: _partial: false, empty fingerprint set — noise control is structural (diff-scoped comment + .hypatia-ignore with per-entry rationale), not enumeration of unreliable output. Investigation doc updated with the #34 outcome.

Closes #34.

Test plan

  • json.load validates the finalized baseline (_partial=false)
  • Repo-wide scan confirms zero Admitted./admit. tokens in any .v
  • string.rs invariant verified (radix ∈ [2,36], digit = num % radix < radix)
  • Next Hypatia CI run: confirm the diff-scoped comment stays silent / shows no Critical for these files

https://claude.ai/code/session_016X6sPXqrpMxHRMuy46BjeS


Generated by Claude Code

Absolute resolution of #34. Local scanner runs showed the standing
"backlog" is false-positive / non-shipping / policy dominated (the
upstream bash ruleset emits 1864 line-level findings, e.g. flagging every
ReScript line against an anti-ReScript policy that contradicts this
repo's own ReScript-first standard), not a security backlog.

Genuine items fixed/eliminated at source instead of suppressed:
- lib/common/string.rs: char::from_digit().unwrap() -> .expect() with the
  proved digit < radix <= 36 invariant; .hypatia-ignore entry removed.
- proofs/verification/coq/Typing.v: the Critical `coq_admitted` was a
  false positive matching the word "Admitted" inside a comment for a
  fully Qed-proved lemma. Comment reworded; no Admitted./admit. token
  exists anywhere in the repo.
- (concurrency.rs lock/poison unwraps were already fixed.)

.hypatia-baseline.json finalized: _partial=false, empty fingerprint set
-- noise control is structural (diff-scoped comment + .hypatia-ignore
with per-entry rationale), not enumeration of unreliable output.
Investigation doc updated with the #34 outcome.

Closes #34

https://claude.ai/code/session_016X6sPXqrpMxHRMuy46BjeS
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan — findings in this PR's changed files

1 finding(s) in files this PR modifies (of 32 repo-wide; 0 baselined, not shown).

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 1
View findings (this PR's files only)
[
  {
    "reason": "expect() in hot path (1 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/my-lang/my-lang/lib/common/string.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  }
]

Pre-existing repo-wide findings are triaged via the Hypatia backlog issue and suppressed here by .hypatia-baseline.json / .hypatia-ignore.

Powered by Hypatia Neurosymbolic CI/CD Intelligence

The .expect() introduced for the digit<radix invariant tripped
Hypatia's expect_in_hot_path rule (it sits inside the conversion
loop) -- correctly surfaced by the now diff-scoped PR comment.
Replace with an infallible DIGITS table lookup: the validated
radix in 2..=36 and digit = num % radix guarantee the index is in
range, so there is no unwrap()/expect()/panic in the loop at all.
Behaviour is identical (char::from_digit yields lowercase a-z).

https://claude.ai/code/session_016X6sPXqrpMxHRMuy46BjeS
@hyperpolymath
hyperpolymath merged commit aff9d32 into main May 15, 2026
19 checks passed
@hyperpolymath
hyperpolymath deleted the claude/resolve-issue-34 branch May 15, 2026 20:51
hyperpolymath added a commit that referenced this pull request May 18, 2026
…#35 P2) (#60)

src/extension.affine called registerCommand("my-lang.run", 0) with an
Int "wasm-table index" — a Phase-1 assumption. The Phase-2 (#35) stdlib
binding is `registerCommand(name: String, handler: fn(Unit) -> Int)`, so
the Int literal produced `Unify.TypeMismatch ((Unit -> Int), Int)` and
the extension would not compile at all.

Pass the handlers as real callbacks using the canonical pattern from
affinescript's examples/vscode_extension_minimal.affine:
`registerCommand("my-lang.run", fn(u: Unit) => handler_run())` (×3), and
replace the now-obsolete wasm-table-index comment.

Verified: `affinescript compile --vscode-extension src/extension.affine
-o out/extension.cjs` succeeds (against affinescript origin/main stdlib);
regenerated out/extension.cjs passes `node --check`; src/index.cjs wires
it via require("../out/extension.cjs"). The upstream Vscode stdlib
bindings already type-check on affinescript main — no affinescript change
needed; this was purely the my-lang port using the stale contract.

Refs affinescript#35
Refs affinescript#64

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

`vsce` 2.15.0 (the deprecated package) predates `.cjs`-entrypoint
support, so `vsce package` failed looking for `src/index.cjs.js`.
Migrated devDependency to the renamed, maintained `@vscode/vsce` ^3.2.0
(same `vsce` binary, so the `package` script is unchanged).

Also corrected the README "Status" block, which #58 left stale: the
extension DOES compile and the affinescript Vscode stdlib bindings DO
type-check on affinescript main (#35 P2 effectively complete) — the only
real bug was my-lang's own extension.affine (fixed in #60). Documented
that packaging needs a registry-reachable env (WSL npm is unreachable
here, so package/publish must run on CI or a non-WSL host) and that
`.vsix` packaging needs no Azure PAT (only `vsce publish` does).

Refs affinescript#35

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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