Research-Stack/4-Infrastructure/shim/test_negative_suite.py
allaun c44a01df3b feat(lean): InformationManifold + SLUQ; chentsov_fusion, tdoku_16d; docs reconciliation suite
- New: InformationManifold.lean — tensor integration module
- Update: SLUQ.lean — proof refinements
- New: chentsov_fusion.py — Chentsov fusion bridge
- New: tdoku_16d.py — 16-dimensional TDoku solver
- New: validate_docs.py — documentation validation script
- New: negative_tests.json + test_negative_suite.py — negative test fixtures
- Update: flac_dsp_node.py — DSP node refinements
- Update: CITATION.cff — citation metadata
- Docs: GEOMETRIC_SUBSTANCE_CANONICAL_RECONCILIATION, LITERATURE_MAPPING,
  GROTHENDIECKIAN_ORGANIZATIONAL_ROTATION_PROPOSAL, formula extraction suite
- New: package/ — public-apis npm metadata
2026-06-28 10:38:13 -05:00

30 lines
1,014 B
Python

import json
from pathlib import Path
def is_valid(equation: str) -> bool:
# Basic heuristics for now until we hook into embed.py fully
if " + " in equation and "=" not in equation and len(equation.split()) < 3:
return False # e.g., "x + "
if "/" in equation and "0" in equation.split("/")[1]:
return False # e.g., "10 / 0"
if "$" in equation and len(equation) == 1:
return False # e.g., "$"
return True
def main():
path = Path("/home/allaun/Research Stack/4-Infrastructure/shim/negative_tests.json")
with open(path, "r") as f:
tests = json.load(f)
print(f"{'Equation':<25} | {'Expected':<8} | {'Actual':<8} | {'Status'}")
print("-" * 60)
for test in tests:
eq = test["equation"]
expected = test["expected"]
actual = is_valid(eq)
status = "" if actual == expected else ""
print(f"{eq:<25} | {str(expected):<8} | {str(actual):<8} | {status}")
if __name__ == "__main__":
main()