fix(#34): resolve Hypatia backlog at source; finalize baseline#35
Merged
Conversation
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
🔍 Hypatia Security Scan — findings in this PR's changed files1 finding(s) in files this PR modifies (of 32 repo-wide; 0 baselined, not shown).
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 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
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>
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.
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:
rescript_file_presentfiring on every line of every.resfile — a "migrate away from ReScript" policy that directly contradicts this repo's own ReScript-first language standard (CLAUDE.md).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 fullyQed.-proved. There is noAdmitted./admit.token anywhere in the repo..ncl"Docker" finding is a false positive on a Nickel policy that itself bansDockerfile.So #34's items were resolved at source, not suppressed:
concurrency.rslock/poison unwraps (8+13)string.rschar::from_digit().unwrap().expect()with the proveddigit < radix ≤ 36invariant;.hypatia-ignoreentry removedcoq_admitted(Critical).ncldocker / proptest /playground//dialects/.hypatia-ignore.hypatia-baseline.jsonfinalized:_partial: false, empty fingerprint set — noise control is structural (diff-scoped comment +.hypatia-ignorewith per-entry rationale), not enumeration of unreliable output. Investigation doc updated with the #34 outcome.Closes #34.Test plan
json.loadvalidates the finalized baseline (_partial=false)Admitted./admit.tokens in any.vstring.rsinvariant verified (radix ∈ [2,36],digit = num % radix < radix)https://claude.ai/code/session_016X6sPXqrpMxHRMuy46BjeS
Generated by Claude Code