{"id":49766244,"url":"https://github.com/dancinlab/hexa-codex","last_synced_at":"2026-05-24T21:00:45.184Z","repository":{"id":356002400,"uuid":"1230557205","full_name":"dancinlab/hexa-codex","owner":"dancinlab","description":"📚 AI knowledge substrate — alignment·safety·welfare·training·inference·multimodal 17-verb (4 groups).","archived":false,"fork":false,"pushed_at":"2026-05-20T16:05:00.000Z","size":5987,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-20T21:39:25.018Z","etag":null,"topics":["ai","ai-alignment","ai-safety","cognitive-architecture","hexa-family","interpretability","llm","machine-learning","n6-invariant","rlhf"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dancinlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-06T05:36:36.000Z","updated_at":"2026-05-20T16:05:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"16151ca4-cee0-4e57-8fb6-ffca5ce2599e","html_url":"https://github.com/dancinlab/hexa-codex","commit_stats":null,"previous_names":["need-singularity/hexa-codex","dancinlab/hexa-codex"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dancinlab/hexa-codex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancinlab%2Fhexa-codex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancinlab%2Fhexa-codex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancinlab%2Fhexa-codex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancinlab%2Fhexa-codex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dancinlab","download_url":"https://codeload.github.com/dancinlab/hexa-codex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancinlab%2Fhexa-codex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33450402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-alignment","ai-safety","cognitive-architecture","hexa-family","interpretability","llm","machine-learning","n6-invariant","rlhf"],"created_at":"2026-05-11T10:51:08.225Z","updated_at":"2026-05-24T21:00:45.171Z","avatar_url":"https://github.com/dancinlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/logo.svg\" width=\"140\" alt=\"hexa-codex\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e📜 hexa-codex\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eHEXA-Codex family\u003c/strong\u003e — codified theorems · AI knowledge substrate · 17 verbs · 4 groups\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-blue\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://doi.org/10.5281/zenodo.20102600\"\u003e\u003cimg alt=\"DOI\" src=\"https://zenodo.org/badge/DOI/10.5281/zenodo.20102600.svg\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"Spec\" src=\"https://img.shields.io/badge/spec-v1.0.0-success\"\u003e\n  \u003cimg alt=\"Verbs\" src=\"https://img.shields.io/badge/verbs-17%20(4%20groups)-informational\"\u003e\n  \u003cimg alt=\"Verify\" src=\"https://img.shields.io/badge/verify-42%2F42%20PASS-brightgreen\"\u003e\n  \u003cimg alt=\"Falsifiers\" src=\"https://img.shields.io/badge/falsifiers-4%2F4%20at%20100%25-brightgreen\"\u003e\n  \u003cimg alt=\"lm_foundry\" src=\"https://img.shields.io/badge/lm__foundry-94.29%25%20Mk.I-blueviolet\"\u003e\n  \u003cimg alt=\"Family\" src=\"https://img.shields.io/badge/family-HEXA--senses%20·%20HEXA--mind%20·%20HEXA--brain-blueviolet\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003ecodified-theorems · AI-knowledge · safety · economics · ops · substrate · falsifiers · Lean4-proven · n=6 lattice · code-LLM · domain-LLM\u003c/p\u003e\n\n---\n\n# 📜 hexa-codex — AI knowledge substrate (HEXA family)\n\n\u003e 17-verb AI knowledge substrate organized in **4 groups**: safety + economics\n\u003e + ops + substrate. A library-style (codex) spec catalog — each verb ships\n\u003e a closed-form candidate spec + falsifier preregister, extracted from\n\u003e canon (`domains/cognitive/`) on 2026-05-06.\n\u003e\n\u003e **+ `lm_foundry/`** — the domain-LLM training pipeline, absorbed from the\n\u003e standalone `hexa-forge` repo on **2026-05-13**. Where the 17 verbs are\n\u003e *spec library*, `lm_foundry/` is *trained models + runtime* — a code-LLM\n\u003e for hexa-lang at **94.29% Mk.I strict** (r39 GA, frozen) wrapped by a\n\u003e **v0.5.x orchestration runtime** (r44–r62) that ships pre-7B classifier\n\u003e routing, real 3-vendor SDKs, persistent cache, multi-turn memory,\n\u003e production observability, and SQLite WAL multi-process safety. See\n\u003e [`lm_foundry/README.md`](lm_foundry/README.md) and\n\u003e [`ORCHESTRATION.md`](ORCHESTRATION.md).\n\n---\n\n## Why hexa-codex?\n\n`hexa-codex` is a **standalone AI knowledge substrate** — a *codex*\n(library) of AI-domain specs that the rest of the `dancinlab` stack\nimports declaratively. Each verb is a single closed-form spec markdown\nextracted unchanged from `canon/domains/cognitive/`, organized\ninto four orthogonal groups so that consumers can navigate by concern.\n\nThe codex framing matters because:\n\n- **Spec-first.** Each verb is a written candidate + falsifier preregister\n  before any sandbox is wired. Consumers read the codex; they do not run it.\n- **Group-orthogonal.** SAFETY, ECONOMICS, OPS, and SUBSTRATE are concerns\n  every AI deployment crosses — but the four sets carry different falsifier\n  classes (interp probes / cost-curve fits / SLO checks / capability evals).\n- **Sister to hexa-bio.** Where `hexa-bio` curates 4 molecular verbs\n  (write-side wet/dry sandbox), `hexa-codex` curates 17 cognitive verbs\n  (write-side AI spec library) — same HEXA-family pattern, different domain.\n\n---\n\n## Verbs — 17 specs across 4 groups (6 + 3 + 4 + 4 = 17)\n\nEach verb ships as a single `.md` spec under a group-named directory,\nextracted from `canon@c0f1f570:domains/cognitive/` on 2026-05-06. Read\nthe spec; the codex does **not** run these verbs — write-side sandbox\nwiring is per-verb future work (see release ladder). Every spec is a\npreregistered hypothesis, not a validated capability claim.\n\n### SAFETY (6)\n\n\u003e Domain SSOT: [`SAFETY.md`](SAFETY.md) · history [`SAFETY.log.md`](SAFETY.log.md)\n\n| Verb | Spec |\n|------|------|\n| `alignment` | [`alignment/ai-alignment.md`](alignment/ai-alignment.md) — HELM-12-axis alignment-score aggregator (F-CODEX-3) |\n| `safety` | [`safety/ai-safety.md`](safety/ai-safety.md) — refusal-matrix + capability-gate spec |\n| `welfare` | [`welfare/ai-welfare.md`](welfare/ai-welfare.md) — model-welfare probe protocol |\n| `adversarial` | [`adversarial/ai-adversarial.md`](adversarial/ai-adversarial.md) — red-team failure-mode taxonomy |\n| `consciousness` | [`consciousness/ai-consciousness.md`](consciousness/ai-consciousness.md) — IIT × GWT probe (BT-19 falsifier-in-action, see below) |\n| `interpret` | [`interpret/ai-interpretability.md`](interpret/ai-interpretability.md) — SAE motif count = σ−φ = 10 (F-CODEX-4) |\n\n### ECONOMICS (3)\n\n\u003e Domain SSOT: [`ECONOMICS.md`](ECONOMICS.md) · history [`ECONOMICS.log.md`](ECONOMICS.log.md)\n\n| Verb | Spec |\n|------|------|\n| `train_cost` | [`train_cost/ai-training-cost.md`](train_cost/ai-training-cost.md) — Chinchilla-fit N^J₂ scaling (F-CODEX-1) |\n| `infer_cost` | [`infer_cost/ai-inference-cost.md`](infer_cost/ai-inference-cost.md) — context^τ = context^4 (F-CODEX-2) |\n| `quality_scale` | [`quality_scale/ai-quality-scale.md`](quality_scale/ai-quality-scale.md) — HumanEval+/hexa-eval aggregate |\n\n### OPS (4)\n\n\u003e Domain SSOT: [`OPS.md`](OPS.md) · history [`OPS.log.md`](OPS.log.md)\n\n| Verb | Spec |\n|------|------|\n| `deploy` | [`deploy/ai-deployment.md`](deploy/ai-deployment.md) — hardware-tier deployment recipes |\n| `enterprise` | [`enterprise/ai-enterprise-custom.md`](enterprise/ai-enterprise-custom.md) — enterprise customisation envelope |\n| `agent_serving` | [`agent_serving/ai-agent-serving.md`](agent_serving/ai-agent-serving.md) — tool-use SLO + schema |\n| `eval` | [`eval/ai-eval-pipeline.md`](eval/ai-eval-pipeline.md) — Mk handoff eval template |\n\n### SUBSTRATE (4)\n\n\u003e Domain SSOT: [`SUBSTRATE.md`](SUBSTRATE.md) · history [`SUBSTRATE.log.md`](SUBSTRATE.log.md)\n\n| Verb | Spec |\n|------|------|\n| `multimodal` | [`multimodal/ai-multimodal.md`](multimodal/ai-multimodal.md) — multimodal fusion spec |\n| `rlhf` | [`rlhf/youth-ai-labeling-rlhf-hub.md`](rlhf/youth-ai-labeling-rlhf-hub.md) — DPO/RLHF labelling hub |\n| `cog_arch` | [`cog_arch/cognitive-architecture.md`](cog_arch/cognitive-architecture.md) — cognitive architecture envelope |\n| `causal` | [`causal/causal-chain.md`](causal/causal-chain.md) — causal-chain reasoning spec |\n\n\u003e **theoretical preregisters**, not empirically verified. External AI\n\u003e labs (OpenAI / Anthropic / DeepMind) publish their own benchmarks with\n\u003e their own metrics — those external evaluations do **not** use the n=6\n\u003e lattice framing, and this codex makes no claim that they should. The\n\u003e `T1+T2+T3` runnable surface verifies internal lattice arithmetic and\n\u003e closed-form algebraic floors; `T4` per-verb empirical landing is\n\u003e deferred to release ladder v1.1.0..v2.0.0.\n\n---\n\n## `lm_foundry/` — domain-LLM foundry (absorbed from `hexa-forge`, 2026-05-13)\n\nThe 17 verbs above are *spec library* (read, don't run). `lm_foundry/`\nis the opposite: a working **model-training pipeline** for\ndomain-specialised LLMs. It was the standalone `hexa-forge` repo\n(retired 2026-05-13); `hexa-codex` was always its sister (serving /\ninference side) — the merge consolidates the two.\n\n| verb   | what                                | status (2026-05-14, **v0.5.14 / r62**)                            |\n|--------|-------------------------------------|-------------------------------------------------------------------|\n| `code` | programming-only LLM for hexa-lang  | **GA at 94.29% Mk.I strict (627/665), 96% 5-NL** — r39 v3-t3patch adapter, **unchanged since GA mark**. Path: Qwen2.5-Coder-7B + LoRA r=64 SFT (r1–r34) → Phase-A manifest fixes (r33/r37/r38) → compile-feedback RL via GRPO (Lever 4 — T4 enum 55→100%) → T3 quote-fragility patch (r39, T3 58.8→100%). **v0.4.x in-weight delegation disproved (r40–r43.1, 5 distinct failure modes)**; routing moved OUT of model weights to a deterministic pre-7B classifier + per-vendor tier selector + real 3-vendor SDKs + per-prompt cache + multi-turn memory + production observability. **v0.5.x orchestration line (r44–r62) ships the production stack**: DLG-mk0 classifier 0.9833 / tier_match 1.000 / Brier 0.0242 EXCELLENT / ECE 0.0461 GOOD on 300-task held-out manifest. See [`ORCHESTRATION.md`](ORCHESTRATION.md). |\n| `bio`  | HEXA-BIO domain LLM (seq + prose)   | recipe spec landed; training pending. Paired with `dancinlab/hexa-bio`. |\n\n- Knowledge SSOTs: [`LEARNING_PROGRAMMING.md`](LEARNING_PROGRAMMING.md)\n  (code-LLM, 14 sections) · [`LEARNING_BIO.md`](LEARNING_BIO.md).\n- Round-by-round chronicle: [`LEARNING_PROGRAMMING.log.md`](LEARNING_PROGRAMMING.log.md)\n  (specialist r1–r39) · [`ORCHESTRATION.log.md`](ORCHESTRATION.log.md) (routing runtime r40–r72).\n- **Runtime spec**: [`ORCHESTRATION.md`](ORCHESTRATION.md)\n  — canonical v0.5.x runtime spec (15 sections + ## Log; root domain doc).\n- Design docs: [`lm_foundry/papers/`](lm_foundry/papers/) (incl. `spec-lever4-compile-rl.md`, `spec-delegation-v0.4.0.md` OBSOLETE §4/§10).\n- HF artifacts: **42 repos** under `dancinlab/hexa-forge-*` (prefix kept as artifact\n  identity). **GA adapter (unchanged):** `dancinlab/hexa-forge-code-7b-qwen2.5-lora-r64-v0.4.0-rl-t4-v3-t3patch` (r39).\n  **v0.5.x is software-only — no new HF model artifacts** (orchestration lives in `tool/`, not in weights).\n- `bench-cold/`, `runs/`, `logs/` under `lm_foundry/` are gitignored\n  (SoT for benches is HF `dancinlab/hexa-forge-bench-cold-v0.1.3`).\n\nSee [`lm_foundry/README.md`](lm_foundry/README.md) for the full layout\nand operating notes (Vast.ai is the primary GPU platform after RunPod's\n2026-05-12 incident).\n\n---\n\n## n=6 master identity\n\nThe four verb-counts (6 + 3 + 4 + 4 = 17) and the four group taxonomy\nboth anchor on the n=6 lattice declared in\n[`.roadmap.hexa_codex`](. roadmap.hexa_codex) §A.1:\n\n```\nσ(6) · φ(6) = n · τ(6) = J₂ = 24\n   12   ·   2  =  6  ·   4  = 24\n```\n\n| Symbol | Value | AI projection                                         |\n|--------|-------|-------------------------------------------------------|\n| σ(6)   | 12    | HELM 12-dimension capability bin                      |\n| τ(6)   | 4     | 4 lifecycle phases · **4 group taxonomy**             |\n| φ(6)   | 2     | helpful / harmless verdict bit                        |\n| J₂     | 24    | training-cost ∝ N^J₂ scaling stratum (F-CODEX-1)      |\n| σ−φ    | 10    | interpretability circuit-motif count (F-CODEX-4)      |\n\n`verify/n6_arithmetic.py` proves all 11 cross-checks at runtime — no\nexternal input, the algebraic identity is self-proving.\n\n---\n\n## Falsifier preregister\n\n[.roadmap.hexa_codex §A.4](. roadmap.hexa_codex) prereregisters four\nfalsifiers; each one's **arithmetic floor** is checked at v1.0 by\n`verify/falsifier_check.py`. The **empirical floor** lands per\n[release ladder](#release-ladder).\n\n| Tag         | Claim                                                       | Arithmetic | Empirical            |\n|-------------|-------------------------------------------------------------|:----------:|----------------------|\n| F-CODEX-1   | training_cost ∝ N^σ·φ = N^**24** (Chinchilla-fit)            |    PASS    | PENDING (v1.2.0)     |\n| F-CODEX-2   | inference_cost ∝ context^τ = context^**4** (Claude 4.7 1M)   |    PASS    | PENDING (v1.2.0)     |\n| F-CODEX-3   | alignment_score = mean over **12** axes (HELM-comparable)    |    PASS    | PENDING (v1.1.0)     |\n| F-CODEX-4   | interpret_motifs = σ(6) − φ(6) = **10** (Anthropic dict-l.)  |    PASS    | PENDING (v1.1.0+)    |\n\n```bash\nhexa-codex calc train_cost --N 7e9 --D 1.4e12   # F-CODEX-1 closed form\nhexa-codex calc infer_cost --context 1000000    # F-CODEX-2 (1M ctx)\nhexa-codex calc alignment --helpfulness 0.85    # F-CODEX-3 axis aggregator\nhexa-codex calc interpret --observed-motifs 9   # F-CODEX-4 motif counter\n```\n\n---\n\n## Release ladder\n\nPer [.roadmap.hexa_codex §A.2](. roadmap.hexa_codex), strict monotone in\nverbs-wired and eval-pipeline count. Verified by\n`verify/release_ladder.py` (7/7 PASS).\n\n| Version  | Date     | Status        | Group focus  | wired | evals | Empirical falsifier      |\n|----------|----------|---------------|--------------|:-----:|:-----:|--------------------------|\n| v1.0.0   | 2026-05  | RELEASED      | (seed)       |   0   |   0   | (arithmetic floor only)  |\n| v1.1.0   | 2026-08  | TARGET        | safety       |   2   |   1   | F-CODEX-3                |\n| v1.2.0   | 2026-10  | PLANNED       | economics    |   5   |   2   | F-CODEX-1                |\n| v1.3.0   | 2026-12  | PLANNED       | ops          |   9   |   3   | F-CODEX-2                |\n| v2.0.0   | 2027-Q2  | ASPIRATIONAL  | substrate    |  17   |   4   | F-CODEX-4                |\n\n```bash\nhexa-codex verify release         # ladder monotonicity audit\npython3 verify/release_params.py  # full per-version parameter table\n```\n\n---\n\n## Verify\n\n`verify/run_all.hexa` is the canonical `.hexa` orchestrator (sister of\n`hexa-rtsc` / `hexa-cern` / `hexa-fusion` / `hexa-ufo` / `hexa-chip` /\n`hexa-antimatter` `run_all.hexa` patterns). It runs **42 green-core\nverify subscripts** and emits `__HEXA_CODEX_RUN_ALL__ PASS — 42/42\ngreen` on success.\n\n```bash\nHEXA_CODEX_ROOT=$(pwd) hexa run verify/run_all.hexa     # 42/42 expected\n```\n\n### Green-core inventory (42 subscripts, all PASS)\n\n| Tier | Count | Scripts |\n|------|------:|---------|\n| T1 algebraic | 6 | `lattice_check` · `calc_train_cost` · `calc_infer_cost` · `calc_alignment` · `calc_interpret` · `calc_quality_scale` |\n| T2 numerical | 20 | `numerics_{train_cost,infer_cost,alignment,interpret,quality_scale}[_parity\\|_solver]` · `numerics_cross_pillar` · `numerics_economics_cross_pillar` · `numerics_economics_scaling_laws` · `numerics_economics_pareto` · `numerics_lattice_arithmetic` |\n| T4 PENDING stubs | 11 | `numerics_*_t4_parity` × 11 (train_cost, infer_cost, alignment, interpret, safety, adversarial, quality_scale, rlhf, eval, agent_serving, deploy) — emit PENDING per D-023 |\n| inventory | 1 | `cross_doc_audit` |\n| group ladder reports | 1 | `report_economics_ladder` |\n| meta closure | 3 | `falsifier_check` · `lint_numerics` · `saturation_check` |\n\n### Honesty — no falsifier-tripped scripts, no silenced FAILs\n\nUnlike `hexa-chip` (4 falsifier-tripped scripts kept on disk as honest\nsignal of post-GAA flattening / Moore retraction / HBM4 spec drift),\n`hexa-codex`'s surface is currently all-green: every F-CODEX-1..4\npillar carries T1 + T2 ×3 closed-form arithmetic + numerics + solver +\nparity layers; the 11 `numerics_*_t4_parity` stubs emit a `PENDING`\nsentinel (not a fake `PASS`) until external `hexa-forge` data lands\nper `plan-decisions-pending.md` D-023.\n\nthese specs are **theoretical preregisters**, not empirically verified.\nExternal AI lab benchmarks (OpenAI / Anthropic / DeepMind published\nevals — HELM, MMLU, GSM8K, HumanEval, SAE motif counts) use their own\nmetrics, **not** lattice-fit. The codex makes no claim that those\nexternal entities organise around the n=6 lattice. The `T1+T2+T3`\nrunnable surface verifies internal lattice arithmetic and closed-form\nalgebraic floors only; per-verb `T4` empirical landings sit at recipe §9\nand land per the [release ladder](#release-ladder) v1.1.0..v2.0.0.\n\nPer `LATTICE_POLICY.md` §1.3: lattice tautologies (σ·φ = n·τ = 24)\nalone are **not** sufficient verification — the `numerics_*` tier\ncarries real-limits anchors (PAC sample complexity, Kolmogorov\n`K(program)` lower bound, Rice's theorem undecidability of semantic\nequivalence — see [`LIMIT_BREAKTHROUGH.log.md`](LIMIT_BREAKTHROUGH.log.md) §2).\n\n### Bookkeeping closure verdict\n\n- **100 % bookkeeping closure** within the green-core (42/42 PASS).\n- **NOT** AI safety / economics / capability *settled* — F-CODEX-1..4\n  remain at \"arithmetic floor closed, empirical T4 PENDING per release\n  ladder\"; the 11 T4 stubs are honestly PENDING.\n- Saturated ≠ falsified ≠ confirmed. 100 % closure here means\n  closed-form + numerics-T2 + published-ref parity layers are\n  regression-locked at the code layer for future bench comparison; it\n  does **not** mean Chinchilla scaling, HELM-Core 12-axis alignment,\n  Anthropic SAE motif counts, or any external eval are settled.\n\n---\n\n## Runnable surface\n\nThe runnable surface follows the\n[runnable_surface_recipe.md](https://github.com/dancinlab/bedrock/blob/main/docs/runnable_surface_recipe.md)\nclosure-depth pattern. Every prediction the codex ships is paired with\nat least one **runnable** verifier, and the surface is closed when each\nF-CODEX falsifier carries T1 (algebraic) + T2 ×3 (numerical /\npublished-ref / ODE solver) layers — recipe §7.2 sat-1 saturation.\n\n**Status: 100% closure reached.** Under recipe §3 (T1 = `calc_*`,\nT2 = `numerics_*` ∧ `numerics_*_solver`, T3 = `numerics_*_parity`),\nevery F-CODEX-1..4 carries T1 ✓ + T2 ✓ + T3 ✓ ⇒ `closure_pct =\n3/3 = 100%`, and `quality_scale` carries the same T1+T2+T3 ladder\nas the first non-falsifier ECONOMICS verb. Plus 7 cross-cutters,\n1 group ladder report, and 3 meta verifiers. Total **31 runnable\nverify scripts** + **33 companion regression tests**.\n`verify/saturation_check.hexa` emits the recipe §7.3 self-stop\nsentinel `__HEXA_CODEX_RSC_SATURATED__ STOP`.\n\n### verify/ — 23 .hexa-native verifiers (math_pure, no deps)\n\nAll scripts use `self/runtime/math_pure` (no external Python / float\nlibraries). Each emits a `__HEXA_CODEX_\u003cNAME\u003e__ PASS` sentinel; the\ntop-level aggregator polls sentinels and exits 0 iff every layer is\ngreen.\n\n**Per-pillar tier stack (4 × 4 = 16 files, recipe §3 taxonomy):**\n\n| Pillar                    | T1 — calc                | T2 — numerics                  | T2 — solver                          | T3 — parity                         |\n|---------------------------|--------------------------|---------------------------------|---------------------------------------|--------------------------------------|\n| F-CODEX-1 (train_cost)    | `calc_train_cost.hexa`   | `numerics_train_cost.hexa`     | `numerics_train_cost_solver.hexa`     | `numerics_train_cost_parity.hexa`    |\n| F-CODEX-2 (infer_cost)    | `calc_infer_cost.hexa`   | `numerics_infer_cost.hexa`     | `numerics_infer_cost_solver.hexa`     | `numerics_infer_cost_parity.hexa`    |\n| F-CODEX-3 (alignment)     | `calc_alignment.hexa`    | `numerics_alignment.hexa`      | `numerics_alignment_solver.hexa`      | `numerics_alignment_parity.hexa`     |\n| F-CODEX-4 (interpret)     | `calc_interpret.hexa`    | `numerics_interpret.hexa`      | `numerics_interpret_solver.hexa`      | `numerics_interpret_parity.hexa`     |\n\n**T2** (numerics + solver) re-derives the prediction inside the lattice\nitself: `numerics_*` exercises the closed form on a synthetic anchor\ngrid; `numerics_*_solver` integrates the underlying ODE (Euler /\nmidpoint-RK2 / RK4 cascade for pillars 1, 2, 4; symplectic\nleapfrog/Verlet harmonic oscillator for pillar 3) and verifies\nconvergence orders 1 / 2 / 4 by step-halving.\n\n**T3** (parity) is the archival empirical contact: it ties the\nprediction to *external* published numbers (Chinchilla / GPT-3 /\nLlama-2 / PaLM for cost; HELM-Core for alignment; Olsson / Cunningham\n/ Bricken / Anthropic-2024 SAE motif counts for interpret).\n\nA failure in any T2 file alone is a closed-form bug; a failure in any\nT3 file alone is an empirical-contact drift. Both classes are caught\nby independent layers, which is what `closure_pct = 100%` (3/3 tiers)\nbuys.\n\n**Cross-cutters (7 files):**\n\n| Verifier                              | What it checks                                                      |\n|---------------------------------------|---------------------------------------------------------------------|\n| `lattice_check.hexa`                  | 24 lattice algebraic invariants (σ·φ = n·τ = J₂ = 24, σ²=144, …)    |\n| `cross_doc_audit.hexa`                | Taxonomy + falsifier-prefix + provenance + master identity across docs |\n| `numerics_cross_pillar.hexa`          | Cross-pillar identities (F1×F2 composite, F3×F4 product, coupled ODE) |\n| `numerics_economics_cross_pillar.hexa`| ECONOMICS-only cross-pillar (train · infer · quality, one n=6 lattice) |\n| `numerics_economics_scaling_laws.hexa`| ECONOMICS scaling-law sweep (q/train/infer halving·doubling·4×, cost/quality ratio) |\n| `numerics_economics_pareto.hexa`      | ECONOMICS Pareto envelope (iso-loss · iso-cost · Lagrangian optimum · n6-vs-Chinchilla allocation) |\n| `numerics_lattice_arithmetic.hexa`    | math_pure stability floor (associativity, log/exp/pow round-trips)  |\n\n**Group ladder reports (1 file):**\n\n| Verifier                              | What it does                                                          |\n|---------------------------------------|------------------------------------------------------------------------|\n| `report_economics_ladder.hexa`        | ECONOMICS group recipe §3 ladder — per-verb T1+T2+T3 table + X-ECON + T4-stub rows |\n\n**Meta (3 files):**\n\n| Verifier                          | What it does                                                       |\n|-----------------------------------|--------------------------------------------------------------------|\n| `falsifier_check.hexa`            | Closure tracker — per-pillar layer presence + sat-1 verdict gate   |\n| `lint_numerics.hexa`              | Recipe §4 invariants 1-5 over every `numerics_*.hexa`              |\n| `saturation_check.hexa`           | Aggregate self-stop signal — re-runs 6 closure components          |\n\n```bash\nhexa-codex verify all                              # full sweep, sat-1 verdict\nhexa-codex verify saturation-check                 # one-shot sat-1 marker\nhexa-codex verify falsifier-check                  # closure tracker\nhexa-codex verify lint-numerics                    # recipe §4 invariants\nhexa-codex verify numerics-train_cost-solver       # one specific layer\nRESOURCE_LOCAL_HEXA=1 hexa run verify/saturation_check.hexa\n# → __HEXA_CODEX_SATURATION_CHECK__ PASS  (when at sat-1)\n```\n\nEach script also runs standalone:\n`RESOURCE_LOCAL_HEXA=1 hexa run verify/\u003cname\u003e.hexa`. The\n`RESOURCE_LOCAL_HEXA=1` env routes the local interpreter\n(`~/.hx/packages/hexa/hexa.real`) instead of the `hexa-r ubu-1`\nremote-routing wrapper that ships with the resource toolkit.\n\n### tests/ — 24 .hexa regression wrappers + 83 pytest auto\n\nEach `verify/*.hexa` script has a companion `tests/test_*.hexa`\nwrapper that re-runs the verifier, greps the sentinel, and exits 0/1.\n`tests/test_all.hexa` aggregates all 24 wrappers; the legacy 83 pytest\nauto-cases continue to cover the spec / inventory / group / lattice\nside.\n\n```bash\nRESOURCE_LOCAL_HEXA=1 HEXA_CODEX_ROOT=\"$PWD\" \\\n    ~/.hx/packages/hexa/hexa.real run tests/test_all.hexa   # 24/24 PASS\npython3 -m pytest tests/ -m auto                            # 83 PASS\n```\n\n### cli/hexa-codex.hexa — extended subcommands\n\n```bash\nhexa-codex verify [target]       # any .hexa verifier; e.g. saturation-check, falsifier-check\nhexa-codex calc \u003cmetric\u003e         # train_cost / infer_cost / alignment / interpret / quality_scale\nhexa-codex inventory             # 17-verb spec presence + canonical-header audit\nhexa-codex lattice [n]           # n=k lattice explorer\nhexa-codex test [mark]           # pytest tests/ -m {auto|hexa}\nhexa-codex status                # one-shot health JSON\n```\n\n---\n\n## Reference annexes\n\nCross-cutting AI/governance atlases absorbed from `canon/papers/`:\n\n| Paper | What it does | Maturity |\n|-------|--------------|----------|\n| [`papers/n6-ai-17-techniques-experimental-paper.md`](papers/n6-ai-17-techniques-experimental-paper.md) | Maps **hexa-codex's exact 17 verbs** onto σ·φ=n·τ=24 coordinate space | atlas.n6 **192/192 EXACT** |\n| [`papers/n6-ai-techniques-68-integrated-paper.md`](papers/n6-ai-techniques-68-integrated-paper.md) | Wider **68-technique** atlas; situates 17 verbs in broader landscape | extension |\n| [`papers/n6-ai-ethics-governance-paper.md`](papers/n6-ai-ethics-governance-paper.md) | **AI ethics + governance** σ·φ=24 overlay (P4) | atlas.n6 0/24, MATURITY=LOW |\n| [`papers/n6-governance-safety-urban-paper.md`](papers/n6-governance-safety-urban-paper.md) | **Governance + safety + urban planning** overlay (P5) | atlas.n6 **58/58 EXACT, MATURITY=HIGH** |\n\nThese are reference annexes — they coordinatize the 17 verbs onto the\nn=6 lattice without introducing new verbs or falsifiers. See\n[`papers/README.md`](papers/README.md) for the full relationship + per-verb\ndeep-dive sub-files.\n\n### consciousness deep-dive (BT-19 falsifier-in-action)\n\n| File | Concern |\n|------|---------|\n| [`consciousness/measurement-protocol.md`](consciousness/measurement-protocol.md) | BT-19 α_IIT·α_GWT=1 reproducible EEG/fMRI protocol (PAPER-P8-2) |\n| [`consciousness/red-team-failure.md`](consciousness/red-team-failure.md) | BT-19 red-team refutation — verdict **MISS**, [7?] CONJECTURE → [5] downgrade |\n\nThese 2 files demonstrate the falsifier-preregister discipline at work: a\nCONJECTURE was preregistered, independently red-teamed, and downgraded.\nThis is the *reason* hexa-codex calls itself a falsifier-preregister\nlibrary, not just a spec catalog.\n\n---\n\n## Formal substrate (Lean 4)\n\nThe σ-invariant cardinality at the heart of every F-CODEX-N falsifier is\n**kernel-checked** in Lean 4:\n\n| File | Theorem | Status |\n|------|---------|--------|\n| [`formal/lean4/N6/InvariantLattice/SigmaLatticeCard.lean`](formal/lean4/N6/InvariantLattice/SigmaLatticeCard.lean) | `theorem sigma_lattice_card : sigma 6 = 12 := rfl` | **PROVEN** (no sorry) — F-CL-FORMAL-1 |\n| [`formal/lean4/N6/InvariantLattice/Sigma.lean`](formal/lean4/N6/InvariantLattice/Sigma.lean) | `def sigma (n : Nat) : Nat` (computable) | DEFINITION |\n\nImplications for hexa-codex falsifiers:\n\n- F-CODEX-1 (training_cost ∝ N^**24**) ← σ(6)·φ(6) = 24, where σ(6) = 12 is **Lean-proven**\n- F-CODEX-2 (inference_cost ∝ context^**4**) ← τ(6) = 4 (corollary of divisor count)\n- F-CODEX-3 (alignment over **12** axes) ← σ(6) = 12 directly (this proof)\n- F-CODEX-4 (motif count = **10**) ← σ(6) − φ(6) = 10 (corollary)\n\n`verify/n6_arithmetic.py` is the runtime witness; `SigmaLatticeCard.lean`\nis the mathematical bedrock. Lean 4 toolchain is **not required** to use\nhexa-codex — the formal proof is a reference annex. See\n[`formal/README.md`](formal/README.md) for build instructions.\n\n---\n\n## Status\n\n**SPEC_CATALOG + RUNNABLE_SURFACE at 100% closure (recipe §7.2 sat-1).\n+ `lm_foundry/` — code-LLM at 94.29% Mk.I strict (r39 GA, frozen) +\nv0.5.x orchestration runtime (r44–r62) production-ready.**\n\n\u003e 17-verb AI 지식 substrate (4 그룹: safety + economics + ops + substrate)\n\u003e + verify/ + tests/ + build/ + docs/ runnable surface\n\u003e + `lm_foundry/` (hexa-forge 흡수, 2026-05-13 — 도메인 LLM 학습 파이프라인 +\n\u003e 런타임; code-LLM GA 94.29% Mk.I strict r39 frozen + v0.5.x 오케스트레이션\n\u003e 런타임 r44–r62 production-ready, bio-LLM 레시피).\n\u003e Recipe §7.2 sat-1 saturation reached — all 4 F-CODEX-1..4 closed at\n\u003e recipe §3 closure_pct = 100% (T1 + T2 + T3 ✓ each), via 23 .hexa\n\u003e verifiers + 24 regression wrappers + 3 meta verifiers. T4 (live\n\u003e hardware / Stage-1+) is recipe §9 territory and out of loop scope.\n\nTranslation: this repo is (1) a *library* of AI specs and (2) a runnable\nverification surface at recipe §7.2 sat-1 = 100% closure under the\n§3 ladder. The `cli/hexa-codex.hexa` dispatcher routes both — verb\nspec reads + .hexa-native verifiers / calculators / tests (legacy\nPython verify/ kept as a parallel CI path). The heavy-lift per-verb\nT4 live-hardware / Stage-1+ pipelines (live FLOP/loss measurements,\nKV-cache profiles, HELM-Core composites, SAE feature counts) sit in\nrecipe §9 territory and land per the [release ladder](#release-ladder)\nv1.1.0..v2.0.0.\n\nWhat works at 100% closure (sat-1):\n\n- 17 verb specs land on disk under their group-named directories.\n- `hexa-codex list` prints the full 4-group table.\n- `hexa-codex \u003cverb\u003e` prints the spec path + first 20 lines.\n- `hexa-codex selftest` confirms 17/17 spec presence.\n- **`hexa-codex verify saturation-check`** re-runs the 6 closure\n  components and emits the canonical recipe §7.3 self-stop sentinel\n  `__HEXA_CODEX_RSC_SATURATED__ STOP` plus the sat-1 marker\n  `__HEXA_CODEX_SATURATION_CHECK__ PASS`.\n- **`hexa-codex verify falsifier-check`** runs the closure tracker —\n  per-pillar T1/T2/T3 tier presence, cross-cutter row, recipe §3\n  closure_pct = 100% verdict.\n- **`hexa-codex verify \u003cpillar\u003e-\u003clayer\u003e`** runs any single layer (e.g.\n  `numerics-train_cost-solver`).\n- **`make -C build sat1`** is the friendly CI gate.\n- **`make -C build everything`** = ci (Python legacy) + 24-wrapper .hexa\n  regression + sat-1 closure + selftest.\n- **σ(6) = 12 mechanically proven** in Lean 4 (`SigmaLatticeCard.lean`,\n  `:= rfl`, no `sorry`); cross-checked at runtime by\n  `verify/lattice_check.hexa` and `verify/numerics_lattice_arithmetic.hexa`.\n- See **[`docs/numerics_methodology.md`](docs/numerics_methodology.md)**\n  for the closure-depth narrative (T1/T2/T3 taxonomy, why each T2 layer,\n  why pillar 3 uses symplectic leapfrog, math_pure rationale, sat-2\n  outlook).\n- See **[`docs/closure_status.md`](docs/closure_status.md)** for the\n  static per-pillar closure snapshot and **[`docs/quick_reference.md`](docs/quick_reference.md)**\n  for the operator command list.\n\nWhat is **out of scope** at 100% closure (sat-1):\n\n- Per-verb **T4 live-hardware / Stage-1+** pipelines (recipe §9 — out\n  of loop scope; closure_pct already at 100% on the §3 T1/T2/T3\n  ladder).\n- Model training, inference SaaS, or RLHF labeling production pipeline.\n- Any regulatory, alignment, or capability claim — these specs are\n  preregistered hypotheses, not validated results.\n\n---\n\n## Install\n\n```bash\n# 1. Install hexa-lang (gives you `hexa` + `hx` package manager)\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/dancinlab/hexa-lang/main/install.sh)\"\n\n# 2. Install hexa-codex\nhx install hexa-codex\n```\n\n## Run\n\n```bash\nhexa-codex list                    # 17-verb table grouped by 4 groups\nhexa-codex selftest                # 17-verb spec presence sweep\nhexa-codex verify [check]          # unified verifier dispatcher (lattice/cross-doc/train_cost/infer_cost/n6/inventory/group/release/falsifiers/reference/all)\nhexa-codex inventory               # 17-verb spec inventory + canonical-header audit\nhexa-codex lattice [n]             # n=k lattice explorer (σ·φ vs n·τ identity)\nhexa-codex calc \u003cmetric\u003e           # F-CODEX-1..4 calculators (train_cost/infer_cost/alignment/interpret/quality_scale)\nhexa-codex test [mark]             # pytest tests/ (auto|hexa)\nhexa-codex status                  # one-shot verifier health summary\nhexa-codex \u003cverb\u003e                  # read a verb spec (alignment/safety/welfare/.../causal — see `list`)\nhexa-codex version                 # print version\nhexa-codex help                    # full --help (subcommands + flags + env)\n```\n\n---\n\n## Cross-link\n\nSister repos in the `dancinlab` HEXA family:\n\n### Cognitive substrate rollups (sister-libraries)\n\n- 👁️ [dancinlab/hexa-senses](https://github.com/dancinlab/hexa-senses) —\n  **5-verb sensory substrate** (dream + ear + empath + olfact + voice).\n  voice is formulaic-only, learned TTS FORBIDDEN.\n- 🧠 [dancinlab/hexa-mind](https://github.com/dancinlab/hexa-mind) —\n  **7-verb mental substrate** (mind + neuro + oracle + hexa_telepathy +\n  telepathy + mind_upload + superpowers). 4/7 SPECULATIVE (preregister honesty).\n\n### Domain-specific siblings\n\n- 👻 [dancinlab/anima](https://github.com/dancinlab/anima) —\n  consciousness / soul cousin (phenomenal grounding adjacent to `consciousness`).\n- 🧬 [dancinlab/hexa-brain](https://github.com/dancinlab/hexa-brain) —\n  BCI sister (read-side neural substrate counterpart).\n- ⚖️ [dancinlab/honesty-monitor](https://github.com/dancinlab/honesty-monitor) —\n  AI honesty-bit falsifier sister (write-side validator for the SAFETY group).\n- 🌱 [dancinlab/hexa-bio](https://github.com/dancinlab/hexa-bio) —\n  4-verb molecular toolkit (same HEXA-family pattern, biology domain).\n- 🔨 [`lm_foundry/`](lm_foundry/README.md) **(in this repo)** —\n  domain-LLM training pipeline, absorbed from the retired `hexa-forge`\n  repo on 2026-05-13. `hexa-codex` was forge's sister (serving side);\n  now one repo. See the `lm_foundry/` section above.\n\nThe 17 + 5 + 7 = **29 verbs across cognitive sister-libraries** all derive\nfrom the n=6 master identity (σ·φ = n·τ = 24). hexa-codex covers AI\n*knowledge*; hexa-senses covers AI *senses*; hexa-mind covers AI *mental ops*.\n\nUpstream concept SSOT: `canon/domains/cognitive/` (declarative\nsources for all 17 hexa-codex verbs + 5 hexa-senses verbs + 7 hexa-mind\nverbs).\n\n---\n\n## Repo layout\n\n```\nhexa-codex/\n├── README.md                  this file\n├── LICENSE                    MIT\n├── AGENTS.tape                identity + governance (.tape v1.2)\n├── CLAUDE.md                  symlink → AGENTS.tape\n├── hexa.toml                  project metadata\n├── install.hexa               hx install entry\n├── cli/                       hexa-codex dispatcher (.hexa)\n│   SAFETY group (6 verbs):\n├── alignment/                 HELM-12-axis alignment-score aggregator   (F-CODEX-3)\n├── safety/                    refusal-matrix + capability-gate spec\n├── welfare/                   model-welfare probe protocol\n├── adversarial/               red-team failure-mode taxonomy\n├── consciousness/             IIT × GWT probe (BT-19 falsifier-in-action)\n├── interpret/                 SAE motif count = σ−φ = 10               (F-CODEX-4)\n│   ECONOMICS group (3 verbs):\n├── train_cost/                Chinchilla-fit N^J₂ scaling              (F-CODEX-1)\n├── infer_cost/                context^τ = context^4                    (F-CODEX-2)\n├── quality_scale/             HumanEval+/hexa-eval aggregate\n│   OPS group (4 verbs):\n├── deploy/                    hardware-tier deployment recipes\n├── enterprise/                enterprise customisation envelope\n├── agent_serving/             tool-use SLO + schema\n├── eval/                      Mk handoff eval template\n│   SUBSTRATE group (4 verbs):\n├── multimodal/                multimodal fusion spec\n├── rlhf/                      DPO/RLHF labelling hub\n├── cog_arch/                  cognitive architecture envelope\n├── causal/                    causal-chain reasoning spec\n├── lm_foundry/                domain-LLM training pipeline (absorbed from hexa-forge, 2026-05-13)\n├── formal/                    Lean 4 σ(6)=12 mechanically proven kernel\n├── papers/                    n=6 atlas papers (17/68-tech, ethics, governance)\n├── verify/                    34 .hexa-native verifiers (math_pure)\n├── tests/                     24 .hexa regression wrappers + 83 pytest\n├── build/                     pandoc + xelatex PDF rebuild\n├── docs/                      closure_status / numerics_methodology / quick_reference\n├── techniques/                T1-T4 closure-ladder per-pillar artifacts\n├── temporal-architecture/     research-tier modules\n├── reality-map/               canon meta-grid\n├── experiments/               sandbox runs (gitignored heavy outputs)\n├── LATTICE_POLICY.md          n=6 self-consistency aux policy\n├── LIMIT_BREAKTHROUGH.log.md  PAC / Kolmogorov / Rice's theorem anchors (audit log)\n├── IMPORTED_FROM_CANON.log.md extraction reference (canon@c0f1f570)\n├── TAPE-AUDIT.log.md          .tape v1.x adoption ledger\n└── CHANGELOG.md               change log\n```\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancinlab%2Fhexa-codex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdancinlab%2Fhexa-codex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancinlab%2Fhexa-codex/lists"}