diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 906f9a2b..c4392aa1 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -35,9 +35,12 @@ - MUST show 0 findings before external publication - Run: `./pre-submit.sh` before submitting to opam, crates.io, npm, etc. -✅ **Keep .machine_readable/6a2/META.a2ml ADRs updated** -- Architecture decisions go in `.machine_readable/6a2/META.a2ml` -- Reference ADR-008 (FFI-only bindings) when writing binding code +✅ **Keep the current boundary decisions and evidence updated** +- Architecture decisions go in `docs/adr/`; status belongs in `ROADMAP.adoc`. +- Read `docs/adr/2026-11-16-header-refc-boundary.adoc` and + `docs/adr/2026-11-17-c-abi-status-ledger.adoc` before changing binding code. +- ABI definitions/contracts are Idris2; foreign-facing FFIs and APIs are Zig. +- Legacy A2ML records are retained for kyX conversion; do not create or update them. ## Author Attribution @@ -153,8 +156,8 @@ If uncertain whether binding code should be written: ## References -- Architecture: `.machine_readable/6a2/META.a2ml` ADR-008, ADR-009 -- Ecosystem context: `.machine_readable/6a2/ECOSYSTEM.a2ml` -- Current state: `.machine_readable/6a2/STATE.a2ml` +- Architecture and boundary evidence: `docs/adr/` +- Ecosystem context: `README.adoc` +- Current state and pending work: `ROADMAP.adoc` - Idris 2 docs: https://idris2.readthedocs.io/ - hypatia scanner: `../hypatia/` diff --git a/.github/copilot/coding-agent.yml b/.github/copilot/coding-agent.yml index a719a773..5625c2ce 100644 --- a/.github/copilot/coding-agent.yml +++ b/.github/copilot/coding-agent.yml @@ -1,6 +1,6 @@ mcp_servers: boj-server: - command: npx - args: ["-y", "@hyperpolymath/boj-server@latest"] + command: bunx + args: [ "@hyperpolymath/boj-server@latest"] env: BOJ_URL: http://localhost:7700 diff --git a/.github/workflows/echidna-verify.yml b/.github/workflows/echidna-verify.yml index 0ba5b1c0..f10738c3 100644 --- a/.github/workflows/echidna-verify.yml +++ b/.github/workflows/echidna-verify.yml @@ -57,13 +57,13 @@ jobs: - name: Type-check proofs id: typecheck run: | - set -e + set -euo pipefail echo "=== Agda proofs under lol/proofs ===" find lol/proofs/theories -name '*.agda' -print cd lol/proofs for f in $(find theories -name '*.agda'); do echo "--- checking $f ---" - agda --safe "$f" 2>&1 | tee -a ../../agda-verify.log || true + agda --safe --cubical-compatible --double-check "$f" 2>&1 | tee -a ../../agda-verify.log done - name: Postulate audit run: | diff --git a/.github/workflows/governance.yml b/.github/workflows/governance.yml index 978e3993..fec439c8 100644 --- a/.github/workflows/governance.yml +++ b/.github/workflows/governance.yml @@ -14,4 +14,6 @@ permissions: jobs: governance: - uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@571cc734cd69fb846032ec77a662aa8ee4fc32cd + uses: metadatastician/standards/.github/workflows/governance-reusable.yml@84c2d1c1b040c9d7b8924532fa77e71e63d72c66 + with: + hypatia-ref: 09c305db10bfde1668c8d5f686677f3a20e84889 diff --git a/.github/workflows/hypatia-scan.yml b/.github/workflows/hypatia-scan.yml index 308c0bdf..67c7c269 100644 --- a/.github/workflows/hypatia-scan.yml +++ b/.github/workflows/hypatia-scan.yml @@ -17,4 +17,8 @@ permissions: jobs: hypatia: - uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@571cc734cd69fb846032ec77a662aa8ee4fc32cd + uses: metadatastician/standards/.github/workflows/hypatia-scan-reusable.yml@84c2d1c1b040c9d7b8924532fa77e71e63d72c66 + with: + hypatia-ref: 09c305db10bfde1668c8d5f686677f3a20e84889 + # Preserve the legacy whole-tree scope; do not silently exclude archives. + scope-excludes: "" diff --git a/.github/workflows/instant-sync.yml b/.github/workflows/instant-sync.yml index 099d94d2..bdb0ea69 100644 --- a/.github/workflows/instant-sync.yml +++ b/.github/workflows/instant-sync.yml @@ -25,6 +25,11 @@ jobs: env: FARM_DISPATCH_TOKEN: ${{ secrets.FARM_DISPATCH_TOKEN }} steps: + - name: Constrain credential-bearing job egress + uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0 + with: + egress-policy: block + allowed-endpoints: github.com:443 api.github.com:443 codeload.github.com:443 release-assets.githubusercontent.com:443 objects.githubusercontent.com:443 - name: Trigger Propagation # Without this the action runs with an empty token and fails with an # opaque auth error on every fork and every repo where the secret is diff --git a/.github/workflows/label-triage.yml b/.github/workflows/label-triage.yml index 9886e920..2677c326 100644 --- a/.github/workflows/label-triage.yml +++ b/.github/workflows/label-triage.yml @@ -46,6 +46,7 @@ permissions: jobs: triage: runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Classify and label env: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index c80b676c..c536afb9 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -32,6 +32,7 @@ permissions: jobs: sync: runs-on: ubuntu-latest + timeout-minutes: 10 steps: - name: Apply canonical labels env: diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 7095b7c7..26cb5399 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -11,5 +11,12 @@ permissions: contents: read jobs: mirror: - uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@571cc734cd69fb846032ec77a662aa8ee4fc32cd - secrets: inherit + uses: metadatastician/standards/.github/workflows/mirror-reusable.yml@84c2d1c1b040c9d7b8924532fa77e71e63d72c66 + secrets: + GITLAB_SSH_KEY: ${{ secrets.GITLAB_SSH_KEY }} + BITBUCKET_SSH_KEY: ${{ secrets.BITBUCKET_SSH_KEY }} + CODEBERG_SSH_KEY: ${{ secrets.CODEBERG_SSH_KEY }} + SOURCEHUT_SSH_KEY: ${{ secrets.SOURCEHUT_SSH_KEY }} + DISROOT_SSH_KEY: ${{ secrets.DISROOT_SSH_KEY }} + GITEA_SSH_KEY: ${{ secrets.GITEA_SSH_KEY }} + RADICLE_KEY: ${{ secrets.RADICLE_KEY }} diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index c8b37aab..9ecd5b86 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -4,7 +4,10 @@ name: Publish to crates.io on: release: types: [published] - workflow_call: # Allow calling from release.yml + workflow_call: + secrets: + CRATES_IO_TOKEN: + required: false workflow_dispatch: inputs: dry_run: @@ -29,6 +32,11 @@ jobs: run: working-directory: bindings/rust steps: + - name: Constrain credential-bearing job egress + uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0 + with: + egress-policy: block + allowed-endpoints: github.com:443 api.github.com:443 codeload.github.com:443 release-assets.githubusercontent.com:443 objects.githubusercontent.com:443 static.rust-lang.org:443 index.crates.io:443 static.crates.io:443 crates.io:443 - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Install Rust toolchain diff --git a/.github/workflows/publish-ghcr.yml b/.github/workflows/publish-ghcr.yml index 88989da0..28ef283c 100644 --- a/.github/workflows/publish-ghcr.yml +++ b/.github/workflows/publish-ghcr.yml @@ -25,11 +25,9 @@ jobs: node-version: '24' registry-url: 'https://npm.pkg.github.com' scope: '@hyperpolymath' - - name: Build JavaScript binding + - name: Validate JavaScript package (source-only; no build script) working-directory: bindings/javascript - run: | - npm ci - npm run build + run: npm pack --dry-run - name: Publish to GitHub Packages working-directory: bindings/javascript run: npm publish diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 780297f3..66e918e1 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -6,7 +6,10 @@ env: on: release: types: [published] - workflow_call: # Allow calling from release.yml + workflow_call: + secrets: + NPM_TOKEN: + required: false workflow_dispatch: inputs: dry_run: @@ -39,6 +42,11 @@ jobs: run: working-directory: bindings/javascript steps: + - name: Constrain credential-bearing job egress + uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0 + with: + egress-policy: block + allowed-endpoints: github.com:443 api.github.com:443 codeload.github.com:443 release-assets.githubusercontent.com:443 objects.githubusercontent.com:443 nodejs.org:443 registry.npmjs.org:443 - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Setup Node.js @@ -65,6 +73,11 @@ jobs: run: working-directory: bindings/typescript steps: + - name: Constrain credential-bearing job egress + uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0 + with: + egress-policy: block + allowed-endpoints: github.com:443 api.github.com:443 codeload.github.com:443 release-assets.githubusercontent.com:443 objects.githubusercontent.com:443 nodejs.org:443 registry.npmjs.org:443 - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - name: Setup Node.js @@ -72,10 +85,14 @@ jobs: with: node-version: '24' registry-url: 'https://registry.npmjs.org' + - name: Setup Bun + uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + with: + bun-version: '1.3.0' - name: Install dependencies - run: npm install + run: bun install --frozen-lockfile --ignore-scripts - name: Build TypeScript - run: npm run build + run: bun run build - name: Verify package run: npm pack --dry-run - name: Publish to npm diff --git a/.github/workflows/push-email-notify.yml b/.github/workflows/push-email-notify.yml index 0689291e..90205893 100644 --- a/.github/workflows/push-email-notify.yml +++ b/.github/workflows/push-email-notify.yml @@ -38,6 +38,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: + - name: Constrain credential-bearing job egress + uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0 + with: + egress-policy: block + allowed-endpoints: github.com:443 api.github.com:443 codeload.github.com:443 release-assets.githubusercontent.com:443 objects.githubusercontent.com:443 ${{ secrets.SMTP_HOST }}:${{ secrets.SMTP_PORT }} - name: Send push notification email uses: hyperpolymath/smtp-notify-action@ede1191ef6ff3ac02c4f4d9efdf837ee517e11d7 # v0.2.0 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14a7c460..fe40f4cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,19 +105,21 @@ jobs: needs: [validate, create-release] if: always() && needs.validate.result == 'success' && (github.event_name == 'push' || inputs.publish_crates) uses: ./.github/workflows/publish-crates.yml - secrets: inherit + secrets: + CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} publish-npm: name: Publish to npm needs: [validate, create-release] if: always() && needs.validate.result == 'success' && (github.event_name == 'push' || inputs.publish_npm) uses: ./.github/workflows/publish-npm.yml - secrets: inherit + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} publish-jsr: name: Publish to JSR needs: [validate, create-release] if: always() && needs.validate.result == 'success' && (github.event_name == 'push' || inputs.publish_jsr) uses: ./.github/workflows/publish-jsr.yml - secrets: inherit + # JSR authenticates with the job's OIDC token; no inherited secrets. summary: name: Release summary needs: [validate, publish-crates, publish-npm, publish-jsr] diff --git a/.github/workflows/secret-scanner.yml b/.github/workflows/secret-scanner.yml index 164c11cb..21abba22 100644 --- a/.github/workflows/secret-scanner.yml +++ b/.github/workflows/secret-scanner.yml @@ -16,7 +16,5 @@ jobs: scan: permissions: contents: read - pull-requests: write actions: read - uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@571cc734cd69fb846032ec77a662aa8ee4fc32cd - secrets: inherit + uses: metadatastician/standards/.github/workflows/secret-scanner-reusable.yml@84c2d1c1b040c9d7b8924532fa77e71e63d72c66 diff --git a/.github/workflows/spark-theatre-gate.yml b/.github/workflows/spark-theatre-gate.yml index 3c6c4ed7..332d651b 100644 --- a/.github/workflows/spark-theatre-gate.yml +++ b/.github/workflows/spark-theatre-gate.yml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MPL-2.0 # Estate SPARK Theatre Gate — thin caller of the reusable workflow in -# hyperpolymath/standards (#135 / #141). Pinned by commit SHA per the +# metadatastician/standards (#135 / #141). Pinned by commit SHA per the # estate action-pinning policy. Regenerate the pin only when the reusable # workflow is intentionally bumped. name: SPARK Theatre Gate @@ -15,7 +15,7 @@ permissions: contents: read jobs: spark-theatre-gate: - uses: hyperpolymath/standards/.github/workflows/spark-theatre-gate.yml@571cc734cd69fb846032ec77a662aa8ee4fc32cd + uses: metadatastician/standards/.github/workflows/spark-theatre-gate.yml@84c2d1c1b040c9d7b8924532fa77e71e63d72c66 with: paths: "." enforce_zero_contract: false diff --git a/.github/workflows/trustfile.yml b/.github/workflows/trustfile.yml index a2b2e14c..17c20aa5 100644 --- a/.github/workflows/trustfile.yml +++ b/.github/workflows/trustfile.yml @@ -103,8 +103,6 @@ jobs: run: | # Count believe_me instances and verify they have justification comments BELIEVE_ME_COUNT=$(grep -r "believe_me" src/ --include="*.idr" 2>/dev/null | wc -l) - UNJUSTIFIED=$(grep -r "believe_me" src/ --include="*.idr" -B1 2>/dev/null | \ - grep -c "believe_me" 2>/dev/null || true) echo "believe_me instances: $BELIEVE_ME_COUNT" if [ "$BELIEVE_ME_COUNT" -gt 300 ]; then echo "WARNING: believe_me count ($BELIEVE_ME_COUNT) exceeds threshold (300)" diff --git a/0-AI-MANIFEST.a2ml b/0-AI-MANIFEST.a2ml index f62510d9..b1beab8f 100644 --- a/0-AI-MANIFEST.a2ml +++ b/0-AI-MANIFEST.a2ml @@ -4,7 +4,8 @@ ; 0-AI-MANIFEST.a2ml — Universal AI entry point for proven ; Media-Type: application/a2ml -; THIS FILE MUST BE READ FIRST BY ALL AI AGENTS +; Legacy entry point: follow the current human-readable pointers below. +; Retained pending kyX conversion; do not add or update legacy descriptiles. (manifest (identity @@ -17,7 +18,7 @@ (purpose "Formally verified safety library: 258 Idris2 modules with dependent types, - Zig FFI bridge (pure ABI layer), and 120+ language binding targets. + Idris2 ABI contracts and pure Zig FFI/API bridge, and 120+ language binding targets. ALL computation happens in Idris2. Bindings are thin FFI wrappers ONLY.") ;; =================================================================== @@ -27,7 +28,7 @@ (context-tiers ; Tier 0 (always load): This file + .claude/CLAUDE.md — orientation only ; Tier 1 (load if working on code): README.adoc, EXPLAINME.adoc, proven.ipkg - ; Tier 2 (load on demand): .machine_readable/6a2/*.a2ml, docs/ + ; Tier 2 (load on demand): docs/adr/, ROADMAP.adoc ; Tier 3 (never load unless asked): tests/, benchmarks/, generated/ ; ; DO NOT READ unless specifically asked: @@ -46,9 +47,9 @@ (canonical-locations (ai-manifest "0-AI-MANIFEST.a2ml" "THIS FILE") (ai-instructions ".claude/CLAUDE.md" "Claude-specific patterns") - (state ".machine_readable/6a2/STATE.a2ml") - (meta ".machine_readable/6a2/META.a2ml") - (ecosystem ".machine_readable/6a2/ECOSYSTEM.a2ml") + (state "ROADMAP.adoc") + (meta ".claude/CLAUDE.md") + (ecosystem "README.adoc") (bot-directives ".bot_directives/") (contractiles "contractiles/")) @@ -60,7 +61,7 @@ (principle "Idris2 is the SOLE computation layer — ALL safety logic lives in src/Proven/") (layers (idris2 "src/Proven/" "258 modules — the source of truth") - (zig-ffi "ffi/zig/" "PURE ABI layer — no safety logic here") + (zig-ffi "ffi/zig/" "Pure Zig FFI/API — marshaling and checked boundary handling") (bindings "bindings/" "120+ thin FFI wrappers — CALL Idris, NEVER reimplement")) (banned "believe_me is BANNED — --total flag enforced") (banned "NEVER reimplement algorithms in bindings")) @@ -87,7 +88,7 @@ ;; =================================================================== (critical-invariants - (rule "Idris2 is the sole computation layer — Zig is pure ABI, bindings are thin wrappers") + (rule "Idris2 defines ABI contracts and core safety logic; Zig implements FFI/API boundaries; bindings are thin wrappers") (rule "believe_me is BANNED — --total flag enforced on all modules") (rule "NEVER reimplement algorithms in bindings — CALL Idris via FFI only") (rule "SCM files ONLY in .machine_readable/ — never in root") @@ -102,11 +103,11 @@ (on-enter (step "Read THIS file first") (step "Read .claude/CLAUDE.md for detailed constraints") - (step "Read .machine_readable/6a2/STATE.a2ml for current status") + (step "Read ROADMAP.adoc for current status") (step "Understand: Idris2 -> Zig FFI -> Bindings")) (on-exit - (step "Update .machine_readable/6a2/STATE.a2ml if changes made") + (step "Update ROADMAP.adoc if changes made") (step "Verify no reimplemented logic in bindings") (step "Summarise outcomes"))) diff --git a/CODE_OF_CONDUCT.adoc b/CODE_OF_CONDUCT.adoc index 21fb60f9..71b06668 100644 --- a/CODE_OF_CONDUCT.adoc +++ b/CODE_OF_CONDUCT.adoc @@ -74,7 +74,8 @@ each other doesn’t get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes. Original text courtesy of the -http://web.archive.org/web/20141109123859/http://speakup.io/coc.html[Speak +// hypatia: allow content_patterns/http_in_docs -- Historical original URL is an archive identifier; transport to the archive uses HTTPS. +https://web.archive.org/web/20141109123859/http://speakup.io/coc.html[Speak Up! project]. === Questions? diff --git a/apps/proven-ws/src/WS.idr b/apps/proven-ws/src/WS.idr index e093d705..3ea60504 100644 --- a/apps/proven-ws/src/WS.idr +++ b/apps/proven-ws/src/WS.idr @@ -53,4 +53,5 @@ maxControlPayloadSize = 125 ||| Sec-WebSocket-Key, then SHA-1 hashed and base64 encoded. public export wsGlobalGUID : String +-- hypatia: allow-next-line uuid/external -- RFC 6455 WebSocket handshake GUID; protocol-defined bytes wsGlobalGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" diff --git a/apps/proven-ws/src/WS/Handshake.idr b/apps/proven-ws/src/WS/Handshake.idr index 8c441132..28e6fe9d 100644 --- a/apps/proven-ws/src/WS/Handshake.idr +++ b/apps/proven-ws/src/WS/Handshake.idr @@ -101,6 +101,7 @@ findHeader name = map (.value) . find (\h => h.name == name) ||| The WebSocket GUID used in the accept key computation (RFC 6455 Section 4.2.2). public export wsGUID : String +-- hypatia: allow-next-line uuid/external -- RFC 6455 WebSocket handshake GUID; protocol-defined bytes wsGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" ||| Validate a handshake request per RFC 6455 Section 4.2.1. diff --git a/bindings/bash/proven.sh b/bindings/bash/proven.sh index c9c7b0c3..dcb2c208 100644 --- a/bindings/bash/proven.sh +++ b/bindings/bash/proven.sh @@ -240,6 +240,7 @@ uuid_v4() { } # Parse UUID +# hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier # Usage: parse_uuid "550e8400-e29b-41d4-a716-446655440000" parse_uuid() { _proven_call uuid parse "$1" @@ -416,6 +417,7 @@ parse_currency() { # Evaluate arithmetic expression # Usage: result=$(calc_eval "2 + 3 * 4") calc_eval() { + # hypatia: allow content_patterns/eval_in_shell -- Literal calculator subcommand passed to the CLI; this does not execute the shell builtin. _proven_call calculator eval "$1" } diff --git a/bindings/cobol/copybooks/SAFEUUID.cpy b/bindings/cobol/copybooks/SAFEUUID.cpy index 1e14e6bd..21d01017 100644 --- a/bindings/cobol/copybooks/SAFEUUID.cpy +++ b/bindings/cobol/copybooks/SAFEUUID.cpy @@ -47,9 +47,10 @@ * Nil UUID constant 01 UUID-NIL PIC X(36) + * hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier VALUE "00000000-0000-0000-0000-000000000000". * Max UUID constant 01 UUID-MAX PIC X(36) + * hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier VALUE "ffffffff-ffff-ffff-ffff-ffffffffffff". - diff --git a/bindings/dhall/proven/core/SafeUUID.dhall b/bindings/dhall/proven/core/SafeUUID.dhall index 528aceba..afafbc69 100644 --- a/bindings/dhall/proven/core/SafeUUID.dhall +++ b/bindings/dhall/proven/core/SafeUUID.dhall @@ -68,23 +68,29 @@ let mkUUIDv5 -- Nil UUID (all zeros) let nilUUID : UUID + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier = { uuid = "00000000-0000-0000-0000-000000000000", version = UUIDVersion.Nil } -- Check if UUID is nil let isNil : UUID -> Bool = \(u : UUID) -> + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier u.uuid == "00000000-0000-0000-0000-000000000000" -- Standard namespace UUIDs (RFC 4122) let Namespaces = { -- DNS namespace + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability dns = { uuid = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", version = UUIDVersion.V1 }, -- URL namespace + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability url = { uuid = "6ba7b811-9dad-11d1-80b4-00c04fd430c8", version = UUIDVersion.V1 }, -- OID namespace + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability oid = { uuid = "6ba7b812-9dad-11d1-80b4-00c04fd430c8", version = UUIDVersion.V1 }, -- X.500 DN namespace + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability x500 = { uuid = "6ba7b814-9dad-11d1-80b4-00c04fd430c8", version = UUIDVersion.V1 } } diff --git a/bindings/elixir/test/proven_test.exs b/bindings/elixir/test/proven_test.exs index b5d969bc..5ec6d76e 100644 --- a/bindings/elixir/test/proven_test.exs +++ b/bindings/elixir/test/proven_test.exs @@ -157,6 +157,7 @@ defmodule ProvenTest do end test "parse validates UUIDs" do + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assert SafeUuid.valid?("550e8400-e29b-41d4-a716-446655440000") == true assert SafeUuid.valid?("not-a-uuid") == false end diff --git a/bindings/forth/README.adoc b/bindings/forth/README.adoc index ba18f0c9..6a218f93 100644 --- a/bindings/forth/README.adoc +++ b/bindings/forth/README.adoc @@ -200,12 +200,14 @@ UUID parsing, formatting, and validation (RFC 4122): include safe-uuid.fs \ Parse UUID +\ hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier s" 550e8400-e29b-41d4-a716-446655440000" uuid-buffer uuid-parse if uuid-buffer uuid-format type cr \ Canonical format uuid-buffer uuid-format-urn type cr \ urn:uuid:... then \ Quick validation +\ hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier s" 550e8400-e29b-41d4-a716-446655440000" uuid? if ." Looks like a UUID" cr then diff --git a/bindings/gleam/test/proven_test.gleam b/bindings/gleam/test/proven_test.gleam index 158b6ac7..a3fa011b 100644 --- a/bindings/gleam/test/proven_test.gleam +++ b/bindings/gleam/test/proven_test.gleam @@ -207,6 +207,7 @@ pub fn hex_is_valid_invalid_test() { // -- UUID tests --------------------------------------------------------------- pub fn uuid_is_valid_test() { + // hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier uuid.is_valid("550e8400-e29b-41d4-a716-446655440000") |> should.equal(True) } diff --git a/bindings/guile/README.adoc b/bindings/guile/README.adoc index 4d0d890e..1526345d 100644 --- a/bindings/guile/README.adoc +++ b/bindings/guile/README.adoc @@ -174,24 +174,32 @@ All operations return an alist with `'value` and `'ok` keys. (use-modules (proven safe-uuid)) ;; Validate UUID +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (uuid-valid? "550e8400-e29b-41d4-a716-446655440000") ; => #t +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (uuid-valid-v4? "550e8400-e29b-41d4-a716-446655440000") ; => #t ;; Get version +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (uuid-version "550e8400-e29b-41d4-a716-446655440000") ; => 4 ;; Normalize +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (uuid-normalize "550E8400-E29B-41D4-A716-446655440000") +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier ; => "550e8400-e29b-41d4-a716-446655440000" ;; Parse into components +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (uuid-parse "550e8400-e29b-41d4-a716-446655440000") ;; Convert to/from hex +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (uuid-to-hex "550e8400-e29b-41d4-a716-446655440000") ; => "550e8400e29b41d4a716446655440000" (uuid-from-hex "550e8400e29b41d4a716446655440000") +;; hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier ; => ((uuid . "550e8400-e29b-41d4-a716-446655440000") (ok . #t)) ---- diff --git a/bindings/javascript/benchmarks/benchmark.mjs b/bindings/javascript/benchmarks/benchmark.mjs index 6af22de6..ec75a909 100644 --- a/bindings/javascript/benchmarks/benchmark.mjs +++ b/bindings/javascript/benchmarks/benchmark.mjs @@ -113,6 +113,7 @@ console.log(); // SafeUUID benchmarks console.log('SafeUUID'); console.log('--------'); +// hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier benchmark('parseUuid', () => parseUuid("550e8400-e29b-41d4-a716-446655440000")); benchmark('generateUuidV4', () => generateUuidV4(), 10000); console.log(); diff --git a/bindings/julia/Project.toml b/bindings/julia/Project.toml index d1a02690..b737ad04 100644 --- a/bindings/julia/Project.toml +++ b/bindings/julia/Project.toml @@ -2,11 +2,13 @@ # Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) name = "Proven" +# hypatia: allow-next-line uuid/external -- Existing Julia package identity; preserve dependency resolution uuid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" version = "0.9.0" authors = ["Jonathan D.A. Jewell "] [extras] +# hypatia: allow-next-line uuid/external -- Existing Julia package identity; preserve dependency resolution Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] diff --git a/bindings/just/proven.just b/bindings/just/proven.just index 0ad6a73d..b390c8ce 100644 --- a/bindings/just/proven.just +++ b/bindings/just/proven.just @@ -338,6 +338,7 @@ uuid-v4: @{{ proven_cli }} uuid v4 # Parse and validate a UUID +# hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier # Usage: just parse-uuid "550e8400-e29b-41d4-a716-446655440000" [doc("Parse and validate a UUID string")] parse-uuid uuid: diff --git a/bindings/malbolge/README.adoc b/bindings/malbolge/README.adoc index 66ecb64e..f6b22d0d 100644 --- a/bindings/malbolge/README.adoc +++ b/bindings/malbolge/README.adoc @@ -359,6 +359,6 @@ MPL-2.0 == See Also - link:https://lscheffer.com/malbolge_spec.html[Malbolge Specification] -- link:http://www.catb.org/jargon/html/story-of-mel.html[The Story of Mel] +- link:https://www.catb.org/jargon/html/story-of-mel.html[The Story of Mel] - link:https://github.com/hyperpolymath/proven[Proven Documentation] - Your therapist (after reading Malbolge code) diff --git a/bindings/mustache/README.adoc b/bindings/mustache/README.adoc index 54e847b5..c7cb3775 100644 --- a/bindings/mustache/README.adoc +++ b/bindings/mustache/README.adoc @@ -164,6 +164,7 @@ console.log(Mustache.render(template, context)); | `proven_parse_version` | semver string | `{{#proven_parse_version}}1.2.3-alpha{{/proven_parse_version}}` | | `proven_version_compare` | `a b` (space-separated) | `{{#proven_version_compare}}1.2.3 2.0.0{{/proven_version_compare}}` | | `proven_uuid_v4` | (none) | `{{#proven_uuid_v4}}{{/proven_uuid_v4}}` | +// hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier | `proven_parse_uuid` | UUID string | `{{#proven_parse_uuid}}550e8400-e29b-41d4-a716-446655440000{{/proven_parse_uuid}}` | == Architecture diff --git a/bindings/mustache/helpers/proven-helpers.js b/bindings/mustache/helpers/proven-helpers.js index e32496a4..cea1d281 100644 --- a/bindings/mustache/helpers/proven-helpers.js +++ b/bindings/mustache/helpers/proven-helpers.js @@ -185,6 +185,7 @@ export function provenHelpers() { }; }, + // hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier // Usage: {{#proven_parse_uuid}}550e8400-e29b-41d4-a716-446655440000{{/proven_parse_uuid}} proven_parse_uuid: makeSingleArgLambda("uuid", "parse"), }; diff --git a/bindings/mustache/helpers/proven-helpers.rb b/bindings/mustache/helpers/proven-helpers.rb index 8e447b95..717f0cff 100644 --- a/bindings/mustache/helpers/proven-helpers.rb +++ b/bindings/mustache/helpers/proven-helpers.rb @@ -174,6 +174,7 @@ def self.context # Usage: {{#proven_uuid_v4}}{{/proven_uuid_v4}} 'proven_uuid_v4' => ->(_text) { call_cli('uuid', 'v4') }, + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier # Usage: {{#proven_parse_uuid}}550e8400-e29b-41d4-a716-446655440000{{/proven_parse_uuid}} 'proven_parse_uuid' => make_single_arg_lambda('uuid', 'parse'), } diff --git a/bindings/nickel/proven/safe-uuid.ncl b/bindings/nickel/proven/safe-uuid.ncl index 2ad4de89..a28c9db9 100644 --- a/bindings/nickel/proven/safe-uuid.ncl +++ b/bindings/nickel/proven/safe-uuid.ncl @@ -13,6 +13,7 @@ uuid_pattern = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", # Nil UUID + # hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier NIL = "00000000-0000-0000-0000-000000000000", # Check if string is a valid UUID (any version) diff --git a/bindings/nim/tests/test_proven.nim b/bindings/nim/tests/test_proven.nim index f51cfaa4..cbfc34a1 100644 --- a/bindings/nim/tests/test_proven.nim +++ b/bindings/nim/tests/test_proven.nim @@ -110,6 +110,7 @@ suite "SafeCrypto": suite "SafeUuid": test "parseUuid parses valid UUID": + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier let uuid = parseUuid("550e8400-e29b-41d4-a716-446655440000") check uuid.isSome check uuid.get.version == uvV4 @@ -121,19 +122,25 @@ suite "SafeUuid": check parseUuid("550e8400-e29b-41d4-a716").isNone test "nil UUID is detected": + # hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier let uuid = parseUuid("00000000-0000-0000-0000-000000000000") check uuid.isSome check uuid.get.isNil test "UUID formats correctly": + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier let uuid = parseUuid("550e8400-e29b-41d4-a716-446655440000") + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier check $uuid.get == "550e8400-e29b-41d4-a716-446655440000" test "UUID URN format": + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier let uuid = parseUuid("550e8400-e29b-41d4-a716-446655440000") + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier check uuid.get.toUrn == "urn:uuid:550e8400-e29b-41d4-a716-446655440000" test "isValidUuid validates format": + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier check isValidUuid("550e8400-e29b-41d4-a716-446655440000") == true check isValidUuid("invalid") == false diff --git a/bindings/ruby/lib/proven/safe_uuid.rb b/bindings/ruby/lib/proven/safe_uuid.rb index 4a86b6eb..5b229a45 100644 --- a/bindings/ruby/lib/proven/safe_uuid.rb +++ b/bindings/ruby/lib/proven/safe_uuid.rb @@ -79,6 +79,7 @@ def valid?(uuid_string) def nil_uuid?(uuid_string) parsed = parse(uuid_string) return nil if parsed.nil? + # hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier parsed == "00000000-0000-0000-0000-000000000000" end diff --git a/bindings/rust/benches/benchmarks.rs b/bindings/rust/benches/benchmarks.rs index c3afffbf..8b8c6b13 100644 --- a/bindings/rust/benches/benchmarks.rs +++ b/bindings/rust/benches/benchmarks.rs @@ -158,6 +158,7 @@ fn bench_safe_uuid(c: &mut Criterion) { let mut group = c.benchmark_group("SafeUUID"); group.bench_function("parse_uuid", |b| { + // hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier b.iter(|| parse_uuid(black_box("550e8400-e29b-41d4-a716-446655440000"))) }); diff --git a/bindings/seed7/README.adoc b/bindings/seed7/README.adoc index 6f110d5b..8ab4918c 100644 --- a/bindings/seed7/README.adoc +++ b/bindings/seed7/README.adoc @@ -17,7 +17,7 @@ external C interface. == Prerequisites -- link:http://seed7.sourceforge.net/[Seed7] compiler +- link:https://seed7.sourceforge.net/[Seed7] compiler - `libproven.so` (or `libproven.a`) built from the proven repository - The `proven.h` C header (for the Seed7 compiler's C backend) diff --git a/bindings/squirrel/README.adoc b/bindings/squirrel/README.adoc index 4a451cc4..5601629c 100644 --- a/bindings/squirrel/README.adoc +++ b/bindings/squirrel/README.adoc @@ -5,7 +5,7 @@ -FFI binding for the link:http://squirrel-lang.org/[Squirrel] scripting language, +FFI binding for the link:https://squirrel-lang.org/[Squirrel] scripting language, providing access to the formally verified *libproven* safety library. All computation is performed in the verified Idris 2 core via the Zig FFI layer. diff --git a/bindings/typescript/bun.lock b/bindings/typescript/bun.lock new file mode 100644 index 00000000..291e4d75 --- /dev/null +++ b/bindings/typescript/bun.lock @@ -0,0 +1,14 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "@proven/typescript", + "devDependencies": { + "typescript": "^5.3.0", + }, + }, + }, + "packages": { + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + } +} diff --git a/bindings/yaml-schema/proven-schema.yaml b/bindings/yaml-schema/proven-schema.yaml index 7bc09efe..803a96ac 100644 --- a/bindings/yaml-schema/proven-schema.yaml +++ b/bindings/yaml-schema/proven-schema.yaml @@ -371,6 +371,7 @@ $defs: format: uuid pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' examples: + # hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier - "550e8400-e29b-41d4-a716-446655440000" UUIDv4: diff --git a/bindings/zig/src/safe_uuid.zig b/bindings/zig/src/safe_uuid.zig index 387e7d54..43ef8679 100644 --- a/bindings/zig/src/safe_uuid.zig +++ b/bindings/zig/src/safe_uuid.zig @@ -83,10 +83,12 @@ test "v4 generation" { } test "parse and format" { + // hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier const uuid = try parse("550e8400-e29b-41d4-a716-446655440000"); try std.testing.expect(!uuid.isNil()); const str = try uuid.toString(); defer str.deinit(); + // hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier try std.testing.expectEqualStrings("550e8400-e29b-41d4-a716-446655440000", str.slice()); } diff --git a/bindings/zsh/functions/proven-validate b/bindings/zsh/functions/proven-validate index 5c49c492..1971784b 100644 --- a/bindings/zsh/functions/proven-validate +++ b/bindings/zsh/functions/proven-validate @@ -137,6 +137,7 @@ proven-validate-phone() { } # Parse and validate a UUID. +# hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier # Usage: proven-validate-uuid "550e8400-e29b-41d4-a716-446655440000" proven-validate-uuid() { if [[ $# -ne 1 ]]; then diff --git a/ffi/zig/src/refc/bits8.zig b/ffi/zig/src/refc/bits8.zig index 7e825053..2c7686ce 100644 --- a/ffi/zig/src/refc/bits8.zig +++ b/ffi/zig/src/refc/bits8.zig @@ -3,6 +3,7 @@ //! Marshaling for the pinned Idris RefC immediate Bits8 representation. //! Values are tagged words, not pointers to allocated objects. const std = @import("std"); +const word = @import("bits8_word.zig"); const c = @cImport({ @cInclude("_datatypes.h"); }); @@ -13,7 +14,7 @@ comptime { } pub fn encode(value: u8) ?*anyopaque { - return @ptrFromInt((@as(usize, value) << shift) | 1); + return @ptrFromInt(word.encodeWord(value)); } pub fn decode(value: ?*anyopaque) error{InvalidRefcResult}!u8 { diff --git a/ffi/zig/src/refc/bits8_word.zig b/ffi/zig/src/refc/bits8_word.zig new file mode 100644 index 00000000..3cac3c39 --- /dev/null +++ b/ffi/zig/src/refc/bits8_word.zig @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright (c) 2026 Jonathan D.A. Jewell +// Scalar marshaling only. bits8.zig still checks the SDK shift and target. +pub fn encodeWord(value: u8) u64 { + return (@as(u64, value) << 32) | 1; +} diff --git a/src/Proven/FFI/RefCBits8.idr b/src/Proven/FFI/RefCBits8.idr new file mode 100644 index 00000000..bd65106e --- /dev/null +++ b/src/Proven/FFI/RefCBits8.idr @@ -0,0 +1,11 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Copyright (c) 2026 Jonathan D.A. Jewell +||| ABI word specification for the pinned 64-bit RefC Bits8 profile. +||| The Zig carrier checks the actual SDK shift; this is not a pointer lease. +module Proven.FFI.RefCBits8 + +%default total + +public export +encodeWord : Bits8 -> Bits64 +encodeWord value = cast value * 4294967296 + 1 diff --git a/src/Proven/SafeOTP.idr b/src/Proven/SafeOTP.idr index 50b6ee14..6c9afba6 100644 --- a/src/Proven/SafeOTP.idr +++ b/src/Proven/SafeOTP.idr @@ -223,6 +223,7 @@ public export totpProvisioningUri : String -> String -> TOTPConfig -> String totpProvisioningUri issuer account config = "otpauth://totp/" ++ urlEncode issuer ++ ":" ++ urlEncode account ++ + -- hypatia: allow security_errors/secret_detected -- Non-secret output placeholder; Base32 provisioning is not implemented here. "?secret=" ++ "{BASE32_SECRET}" ++ -- placeholder: real base32 needs FFI "&issuer=" ++ urlEncode issuer ++ "&algorithm=" ++ show config.algorithm ++ @@ -250,6 +251,7 @@ public export hotpProvisioningUri : String -> String -> HOTPConfig -> Nat -> String hotpProvisioningUri issuer account config counter = "otpauth://hotp/" ++ issuer ++ ":" ++ account ++ + -- hypatia: allow security_errors/secret_detected -- Non-secret output placeholder; Base32 provisioning is not implemented here. "?secret=" ++ "{BASE32_SECRET}" ++ "&issuer=" ++ issuer ++ "&algorithm=" ++ show config.algorithm ++ diff --git a/src/Proven/SafeUnionFind.idr b/src/Proven/SafeUnionFind.idr index ce57c971..fb60f7ac 100644 --- a/src/Proven/SafeUnionFind.idr +++ b/src/Proven/SafeUnionFind.idr @@ -206,11 +206,14 @@ allSets uf = in mapMaybe (\r => members r uf) roots where nub : Eq a => List a -> List a - nub [] = [] - -- TRUSTED: termination; `filter` never grows a list, so the recursive - -- argument is at most `xs`, which is a subterm of the pattern `x :: xs`. - -- The checker cannot see through `filter`. - nub (x :: xs) = x :: nub (assert_smaller xs (filter (/= x) xs)) + nub = go [] + where + -- Recurse on the original tail, preserving first-occurrence order. + -- The totality checker sees structural descent without an assertion. + go : List a -> List a -> List a + go seen [] = [] + go seen (x :: xs) = + if elem x seen then go seen xs else x :: go (x :: seen) xs -------------------------------------------------------------------------------- -- Batch Operations diff --git a/tests/properties/SafeUUIDProps.idr b/tests/properties/SafeUUIDProps.idr index 0f9b7e54..799877fc 100644 --- a/tests/properties/SafeUUIDProps.idr +++ b/tests/properties/SafeUUIDProps.idr @@ -18,6 +18,7 @@ import System private v4Sample : String +-- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier v4Sample = "550e8400-e29b-41d4-a716-446655440000" -------------------------------------------------------------------------------- @@ -83,10 +84,15 @@ check label False = do private samples : List String samples = [ v4Sample + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier , "550E8400-E29B-41D4-A716-446655440000" + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier , "00000000-0000-0000-0000-000000000000" + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability , "6ba7b810-9dad-11d1-80b4-00c04fd430c8" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier , "6fa459ea-ee8a-3ca4-894e-db77e160355e" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier , "886313e1-3b8a-5372-9b90-0c9aee199e5d" ] private @@ -124,18 +130,25 @@ runUUIDProperties = do check "prop_validUUIDv4Parses: version V4, variant RFC 4122" (map (\u => u.version == V4 && u.variant == RFC4122) (Proven.SafeUUID.parse v4Sample) == Just True) check "prop_uppercaseUUIDParses: uppercase hex accepted" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (isValid "550E8400-E29B-41D4-A716-446655440000") check "prop_nilUUIDParses: nil UUID accepted" + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier (isValid "00000000-0000-0000-0000-000000000000") check "nil UUID string is recognised as nil; v4 sample is not" + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier (map isNil (Proven.SafeUUID.parse "00000000-0000-0000-0000-000000000000") == Just True && map isNil (Proven.SafeUUID.parse v4Sample) == Just False && isNil nilUUID) check "prop_generatedUUIDValid: library-produced nilUUID formats to a valid UUID" + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier (isValid (format nilUUID) && format nilUUID == "00000000-0000-0000-0000-000000000000") check "prop_versionExtractable: versions 1, 3, 4, 5 read from the version nibble" + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability (versionOf "6ba7b810-9dad-11d1-80b4-00c04fd430c8" == Just V1 && + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier versionOf "6fa459ea-ee8a-3ca4-894e-db77e160355e" == Just V3 && versionOf v4Sample == Just V4 && + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier versionOf "886313e1-3b8a-5372-9b90-0c9aee199e5d" == Just V5) check "prop_formatConsistent: format/parse round-trip on samples" (all roundTrips samples) @@ -143,16 +156,22 @@ runUUIDProperties = do (map format (Proven.SafeUUID.parse "550e8400e29b41d4a716446655440000") == Just v4Sample) check "prop_uuidEqReflexive: == reflexive and case-insensitive on samples" (all (\s => map (\u => u == u) (Proven.SafeUUID.parse s) == Just True) samples && + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier Proven.SafeUUID.parse v4Sample == Proven.SafeUUID.parse "550E8400-E29B-41D4-A716-446655440000") check "prop_bytesRoundtrip: 16 bytes that re-encode to an equal UUID" (all bytesRoundTrip samples) check "rejects non-hex characters and wrong lengths" (not (isValid "550e8400-e29b-41d4-a716-44665544000g") && + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier not (isValid "550e8400-e29b-41d4-a716-4466554400000") && not (isValid "")) check "prop_versionExtractable: hex version nibble 'a' is version 10" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (versionOf "550e8400-e29b-a1d4-a716-446655440000" == Just (Unknown 10)) check "prop_versionExtractable: version nibble is case-insensitive hex ('F' and 'f' are 15)" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier (versionOf "550e8400-e29b-F1d4-a716-446655440000" == Just (Unknown 15) && + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier versionOf "550e8400-e29b-f1d4-a716-446655440000" == Just (Unknown 15) && + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier versionOf "550e8400-e29b-91d4-a716-446655440000" == Just (Unknown 9)) putStrLn "" diff --git a/tests/totality/BoundaryRegression.idr b/tests/totality/BoundaryRegression.idr index 92d2c74c..d4e12730 100644 --- a/tests/totality/BoundaryRegression.idr +++ b/tests/totality/BoundaryRegression.idr @@ -4,6 +4,7 @@ module BoundaryRegression import Proven.Core import Proven.SafeTree +import Proven.SafeUnionFind import Proven.SafeArgs.Types import Proven.SafeArgs.Parser import Proven.SafeRegex.Types @@ -86,5 +87,8 @@ main = do (isErr (parseYAML "[true") && isErr (parseYAML "\"unclosed") && isErr (parseYAML "&a true")) check "YAML depth limit remains effective" (isErr (parseYAML (nestedYAML 55))) + check "union-find duplicate roots preserve first-occurrence set order" + (allSets (MkUF [Parent 1, Root 1, Parent 1, Root 0] 2) == [[0,1,2],[3]] && + allSets (Proven.SafeUnionFind.create 3) == [[0],[1],[2]]) runMathProperties putStrLn "Finite regression execution passed; parser completeness/equivalence is not claimed." diff --git a/tests/unit/SafeRegexUnit.idr b/tests/unit/SafeRegexUnit.idr index faf46069..a263aca7 100644 --- a/tests/unit/SafeRegexUnit.idr +++ b/tests/unit/SafeRegexUnit.idr @@ -87,6 +87,7 @@ runRegexUnitTests = do Err _ => putStrLn " ✗ Failed to compile IPv4 regex" case uuidRegex of + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier Ok re => assertTrue "uuidRegex matches UUID" (test re "550e8400-e29b-41d4-a716-446655440000") Err _ => putStrLn " ✗ Failed to compile UUID regex" diff --git a/tests/unit/SafeUUIDUnit.idr b/tests/unit/SafeUUIDUnit.idr index ceae8cb1..d20b8dc2 100644 --- a/tests/unit/SafeUUIDUnit.idr +++ b/tests/unit/SafeUUIDUnit.idr @@ -33,8 +33,11 @@ runUUIDUnitTests = do -- Parse tests putStrLn "\n[Parsing]" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertOk "parseUUID standard format" (parseUUID "550e8400-e29b-41d4-a716-446655440000") + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertOk "parseUUID uppercase" (parseUUID "550E8400-E29B-41D4-A716-446655440000") + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertOk "parseUUID lowercase" (parseUUID "550e8400-e29b-41d4-a716-446655440000") assertErr "parseUUID invalid length" (parseUUID "550e8400-e29b") assertErr "parseUUID invalid chars" (parseUUID "550e8400-e29b-41d4-a716-44665544000g") @@ -43,33 +46,42 @@ runUUIDUnitTests = do -- Nil UUID tests putStrLn "\n[Nil UUID]" + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier assertOk "parseUUID nil UUID" (parseUUID "00000000-0000-0000-0000-000000000000") + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier case parseUUID "00000000-0000-0000-0000-000000000000" of Ok uuid => assertTrue "isNil nil UUID" (isNil uuid) Err _ => putStrLn " ✗ Failed to parse nil UUID" -- Version detection tests putStrLn "\n[Version Detection]" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier case parseUUID "550e8400-e29b-41d4-a716-446655440000" of Ok uuid => assertEq "getVersion v4 UUID" (Just 4) (getVersion uuid) Err _ => putStrLn " ✗ Failed to parse v4 UUID" + -- hypatia: allow-next-line uuid/external -- RFC UUID namespace constant; preserve interoperability case parseUUID "6ba7b810-9dad-11d1-80b4-00c04fd430c8" of Ok uuid => assertEq "getVersion v1 UUID" (Just 1) (getVersion uuid) Err _ => putStrLn " ✗ Failed to parse v1 UUID" -- Format tests putStrLn "\n[Formatting]" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier case parseUUID "550E8400-E29B-41D4-A716-446655440000" of Ok uuid => do + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertEq "formatUUID lowercase" "550e8400-e29b-41d4-a716-446655440000" (formatUUID Lowercase uuid) + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertEq "formatUUID uppercase" "550E8400-E29B-41D4-A716-446655440000" (formatUUID Uppercase uuid) assertEq "formatUUID compact" "550e8400e29b41d4a716446655440000" (formatUUID Compact uuid) + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertEq "formatUUID URN" "urn:uuid:550e8400-e29b-41d4-a716-446655440000" (formatUUID URN uuid) Err _ => putStrLn " ✗ Failed to parse format test UUID" -- Validation tests putStrLn "\n[Validation]" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier assertTrue "isValidUUID valid" (isValidUUID "550e8400-e29b-41d4-a716-446655440000") assertTrue "isValidUUID invalid" (not $ isValidUUID "not-a-uuid") assertTrue "isValidUUID empty" (not $ isValidUUID "") @@ -87,12 +99,14 @@ runUUIDUnitTests = do -- Comparison tests putStrLn "\n[Comparison]" + -- hypatia: allow-next-line uuid/external -- UUID nil/max or ordered-value test vector, not an estate identifier case (parseUUID "00000000-0000-0000-0000-000000000001", parseUUID "00000000-0000-0000-0000-000000000002") of (Ok u1, Ok u2) => do assertTrue "UUID comparison u1 < u2" (compareUUID u1 u2 == LT) assertTrue "UUID comparison u2 > u1" (compareUUID u2 u1 == GT) _ => putStrLn " ✗ Failed to parse comparison UUIDs" + -- hypatia: allow-next-line uuid/external -- UUID parser interoperability or rejection test vector, not an estate identifier case (parseUUID "550e8400-e29b-41d4-a716-446655440000", parseUUID "550e8400-e29b-41d4-a716-446655440000") of (Ok u1, Ok u2) => assertTrue "UUID equality" (compareUUID u1 u2 == EQ) _ => putStrLn " ✗ Failed to parse equality UUIDs" diff --git a/verification/header/CI-PROFILE.adoc b/verification/header/CI-PROFILE.adoc new file mode 100644 index 00000000..1629e053 --- /dev/null +++ b/verification/header/CI-PROFILE.adoc @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// Copyright (c) 2026 Jonathan D.A. Jewell += Header and reusable workflow validation profiles + +The ABI definitions remain Idris2 and the FFI/API implementation remains pure +Zig. Atoma's scalar replay pins `21346ae1c85b7773a4bc16df51cb1ec5977f6b65`; +this workflow migration changes none of those source or contract bytes. +Compiler refinement and the complete foreign boundary remain unproved. + +== Canonical governance migration + +Four callers pin Standards default-branch revision +`84c2d1c1b040c9d7b8924532fa77e71e63d72c66`. Its canonical policy recognizes +the moved `metadatastician/standards` owner, its baseline validator uses file +inputs rather than overflowing the argument vector, and its workflow helpers +are bound to the reusable's own revision. + +This replaces the isolated `6da35965d761761c09e3779e5639012de767bb48` +lock-metadata backport. That backport repaired startup, but the default-branch +ancestry policy correctly rejected it. The removed caller-side lock +experiment is not restored. + +The owner-approved four exact reusable paths and their two nested DEED/K9 +conformance paths were admitted and read back in the Actions allowlist. +The nested paths pin +`bfa851f5291edd82d01dfb33cb8d81b3002d2f89`; no owner-wide wildcard is needed. +DEED/K9 retain the canonical advisory default; existing gates are not disabled. +Hypatia explicitly scans the whole tree, preserving the previous scope. +Its validated baseline and threshold behavior remain the canonical defaults. + +Both scanner consumers explicitly pin Hypatia +`09c305db10bfde1668c8d5f686677f3a20e84889`, the exact revision previously +resolved by the legacy caller on 24 November. This prevents the workflow +migration from reverting to its older default scanner. That revision records +retired A2ML layout as advisory pending kyX conversion, in line with the +current canon. No baseline entry, threshold or source exclusion is added. + +The secret scanner declares no inherited secrets. Its caller forwards none +and no longer requests pull-request write permission. This addresses +SonarCloud rule `githubactions:S7635` without an exemption. + +== Evidence and limits + +Header RefC soundness, header theory replay and Atoma scalar replay are separate +from generic governance checks. Passing one is not evidence that the others +passed. The final PR head must pass hosted CI and review before merge; the +migration's hosted result is pending when this document is introduced. + +The TypeScript dependency lock was generated remotely with pinned Bun 1.3.0 +and installed with `--frozen-lockfile --ignore-scripts` in dry-run +https://github.com/hyperpolymath/proven/actions/runs/45511904922[45511904922]. +No package was published. Its subsequent TypeScript build failed on existing +nonexistent exports and absent declarations for the JavaScript wrappers. +The lock-generation bootstrap was removed after retaining the generated lock; +normal publishing still requires a successful build. This is an outstanding +package-readiness defect, not evidence against or for the native header proofs. diff --git a/verification/header/SCALAR-SOURCE.adoc b/verification/header/SCALAR-SOURCE.adoc new file mode 100644 index 00000000..0391b8a9 --- /dev/null +++ b/verification/header/SCALAR-SOURCE.adoc @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// Copyright (c) 2026 Jonathan D.A. Jewell += RefC byte-word source checking +:revdate: 2026-11-24 + +`src/Proven/FFI/RefCBits8.idr` defines the Idris2 contract for this fixed +64-bit RefC word profile. `ScalarOracle.idr` enumerates its 256 byte inputs. +`ffi/zig/src/refc/bits8_word.zig` is the pure Zig encoder used by the existing +FFI wrapper in `bits8.zig`; the wrapper still checks the target width and SDK +shift, and validates canonical results when decoding. Header business logic +continues to execute in Idris2. No C FFI or C API implementation is introduced. + +Atoma PR #30 consumes these exact sources through a pinned commit manifest. +Its hosted gate compiles the oracle afresh with totality, warnings-as-errors +and a no-holes check; interprets the helper's original source bytes in Coq; +checks every input; and compares native Zig execution in all four optimization +modes with the oracle. ECHIDNA compilation, coqchk, theorem-type and assumption +audits, independent byte serialization and rejecting mutations are mandatory. +The existing Header RefC soundness workflow separately exercises the actual +exported ABI, byte-pair corpus and always-clean kernel mutation. + +The source proof concerns the scalar word expression. It does not establish +pointer provenance, accessibility, lifetime, SDK/compiler refinement or the +whole library's correctness. The foreign-boundary receipt remains INCOMPLETE. +The oracle and source helper are evidence inputs, never cached proof verdicts. diff --git a/verification/header/ScalarOracle.idr b/verification/header/ScalarOracle.idr new file mode 100644 index 00000000..0b4cad04 --- /dev/null +++ b/verification/header/ScalarOracle.idr @@ -0,0 +1,14 @@ +-- SPDX-License-Identifier: MPL-2.0 +-- Copyright (c) 2026 Jonathan D.A. Jewell +module Main +import Proven.FFI.RefCBits8 +%default total + +rows : Nat -> Nat -> IO () +rows Z index = pure () +rows (S fuel) index = do + putStrLn (show index ++ " " ++ show (encodeWord (cast index))) + rows fuel (S index) + +main : IO () +main = rows 256 0