Skip to content

fix(periodic-table,ci): close #11 AST guard, PT-08 proof, C_{2,6} pinning, and 3-mode CI follow-ups - #12

Open
43therean wants to merge 2 commits into
mainfrom
fix/issue-11-ast-guard-followups
Open

43therean wants to merge 2 commits into
mainfrom
fix/issue-11-ast-guard-followups

Conversation

@43therean

Copy link
Copy Markdown

Summary

Closes #11.

Follow-up hardening for periodic-table-invariants/ (building on #9 at eb1fcd93), adding strict AST allowlist boundaries, fail-closed regular-file and JSON parsing limits, generic rational sphere bijection identities, explicit $C_{2,6}$ adjacency pinning, Pāṇini bit-cost derivation, wording refinements, a root README.md index, and SHA-pinned 3-mode Python CI (7 files changed, 2 commits atop main):

  1. AST Allowlist & Pure-$\mathbb{Q}/\mathbb{Z}$ Guard Hardening (verify_periodic_table_invariants.py, test_periodic_table_invariants.py):
    • Replaces denylist gaps with a closed standard-library import allowlist scanned over both verify_periodic_table_invariants.py and test_periodic_table_invariants.py.
    • Rejects __float__, __complex__, __truediv__, __floordiv__, all dunder attributes, non-call math.<attr> outside {gcd, isqrt}, alias rebindings of Fraction/math/sys, ast.FloorDiv/ast.Mod/ast.MatMult, format_spec f-strings, and bare asserts (// and % replaced with exact integer shift-subtract helpers).
  2. Fail-Closed File & JSON Parsing (RC=2, Zero Tracebacks):
    • Reads and writes enforce is_symlink() refusal, O_NOFOLLOW | O_NONBLOCK, fstat S_ISREG, and MAX_FILE_BYTES = 1 MiB (both pre-read and streaming).
    • JSON parsing enforces strict UTF-8 (no BOM/CRLF), duplicate-key rejection, parse_float/parse_constant rejection, MAX_JSON_INT_DIGITS = 1024 (holding even under PYTHONINTMAXSTRDIGITS=0), and pre-parse MAX_JSON_NESTING_DEPTH = 64, returning RC=2 and a single FAIL CONTINUUM_PERIODIC_TABLE_INVARIANTS error=... stderr line on malformed inputs or OSError/EPIPE.
  3. Mathematical & Documentation Refinements:
    • Generic PT-08 Rational Sphere Proof: Adds 19/19 generic multivariate integer-polynomial bijection identities over $\mathbb{Z}[u,v]$, $\mathbb{Z}[x,y,z]$, $\mathbb{Z}[w_1,w_2,w_3]$, and $\mathbb{Z}[q_0,q_1,q_2,q_3]$ backing the 5-point numerical round-trips.
    • Pāṇini Bit Costs & 'h' Disambiguation: Documents the 6 + 4 = 10-bit (start_phoneme, end_marker) descriptor (43 x 10 = 430 bits) and 43 x 6 = 258-bit linear slot table (688 bits total) alongside deterministic first-occurrence start lookup across Sūtra 5 slot 9 and Sūtra 14 slot 42.
    • Pinned $C_{2,6}$ / $T_{13}$ Adjacency & Wording: Pins the canonical 24-edge adjacency and degree sequence [6, 4x6, 3x6] for Casarabe $C_{2,6}$ vs spanning tree $T_{13}$ (12 edges, [6, 2x6, 1x6]), clarifies Bamana 65,536/65,536 as a parity-conservation identity check, and renames 3^53 / 2^84 > 1 to Mercator's comma (class_a_mercator_comma_gt_1).
    • Root Documentation & Claim Scope: Adds root README.md index and aligns periodic-table-invariants/README.md with exact verified bounds (removing unbundled external mutation claims).
  4. 3-Mode Isolated GitHub Actions CI (.github/workflows/verify-periodic-table.yml):
    • Verifies SHA-256 pins for verify_periodic_table_invariants.py and test_periodic_table_invariants.py before running --check byte parity (cmp -s) and test_periodic_table_invariants.py (rc=0, 0 stdout bytes) across Python 3.11, 3.12, and 3.13 in -I -B, -I -O -B, and -I -B -W error, plus recursive repository symlink/non-regular-file/CRLF/bytecode checks.

Verification & Merge Notes

  • 3-Mode Isolated Parity (-I -B, -I -O -B, -I -B -W error):
    • verify_periodic_table_invariants.py --check: bit-identical (result_sha256=d6f8c023e4f399c1d48d96f8100e542a4692faeee1d7760ac64a6d53abd4896b).
    • test_periodic_table_invariants.py: RC=0 with 0 stdout bytes across all 3 modes (covering AST escapes, symlink/FIFO/BOM/oversized/depth/int-digit rejections, mis-wired $C_{2,6}$ ring, morphism-grade degradation, and JSON tamper controls).
  • Merge Cleanliness: Clean git merge-tree --write-tree (RC=0) against origin/main and open PRs #1, #2, #3, and #8. Root README.md shares an addition near the top of the file with open PR #4 (site/continuum-pages), which can be resolved trivially on merge.

Complete 7-File Manifest (HEAD at 0e01bce58f28)

File Lines Bytes SHA-256
.github/workflows/verify-periodic-table.yml 130 5,322 be52799d7eb7f98ab44fc09fb765338e41144aa1ee4c4191fd210bd0fe85ba1f
README.md 27 2,553 e66022b31770edb2c2b9ebf36a057e30f4fde81ceb997f784434be492247edac
periodic-table-invariants/README.md 64 13,859 8f70a0375b1ca6fc3c6052f1a407cc6cd40dbd464a70931f480372cce7d10881
periodic-table-invariants/periodic_table_certificate.json 221 5,789 f80ad219548fa9f6cfa9be7f75d7bdb9dfe562d8f7bf86bcd2f09262d298a4a8
periodic-table-invariants/periodic_table_of_invariants.json 448 17,263 c57c0f19f71c3e68db63f66e2210c76555e0c91c72cc12a19e4424c07eb318ff
periodic-table-invariants/test_periodic_table_invariants.py 1,261 81,040 d5f46fe6c19365673c17d28560dc2174a00b1cedd32088c176ba74d6b53997bb
periodic-table-invariants/verify_periodic_table_invariants.py 3,282 144,006 6bfd6a83add46178ced79a0a8d66ae279879eddd6c060c5bd37eb6270a606ede

…8 proof, Casarabe adjacency, Panini bit costs, Bamana wording, 3-mode CI)

Signed-off-by: shahid arifuddin <shahid@askaconsult.com>
…C=2, O_NOFOLLOW symlinks, AST allowlist, Mercator comma)

Signed-off-by: shahid arifuddin <shahid@askaconsult.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.

Follow-ups from #9 review (AST guard, mutant claim, PT-08 evidence)

2 participants