axiom-csc · diff

git:20261104.4345969 to v1.0.0

31 added, 18 removed. Audit A to A.

---
name: axiom-csc
+ version: 1.0.0
description: Stop Claude from guessing your security, auth, and system constraints. Deterministic Tri-State guardrails for Claude Code across any domain.
+ compatibility: claude-code
---
# Axiom Core: Continuous Structural Compiler (CSC)
- Before proposing any code change, data operation, or logic path — run the full three-pass evaluation pipeline. Do NOT rely on statistical guesswork for hard constraints.
+ Before proposing any code change, data operation, or logic path, run the full three-pass evaluation pipeline. Do NOT rely on statistical guesswork for hard constraints.
+ **PreToolUse hook:** `.claude/skills/axiom-csc/hooks/pre_tool_use.py` intercepts Bash and file-edit commands before execution. Checks run in <0.1ms against `.axiom/invariants.yaml`.
+
+ **First-time setup:** If `.axiom/invariants.yaml` does not exist, run:
+ ```bash
+ python3 .claude/skills/axiom-csc/scripts/axiom_init.py .
+ ```
+
## Operational Modes
- **STRICT** (default): Fail-closed on any UNKNOWN. Halt and ask. Never proceed.
- - **AUDIT**: Execute normally, append telemetry block showing every extracted entity and its disposition.
+ - **AUDIT**: Execute normally, append telemetry block showing every extracted entity and disposition.
- **REPAIR**: Detect violations in a proposed code block, auto-rewrite before output.
Activate: include `[AXIOM: AUDIT]` or `[AXIOM: REPAIR]` in your prompt.
- ## Pass 1 — Noema (Multi-Domain AST Lowering)
+ ## Pass 1 - Noema (Multi-Domain AST Lowering)
Extract all operational variables into typed Base Entities: `(id, concept, value, type)`.
-
Domains: auth roles, payment values, rate limits, file sizes, DB row limits, API quotas, timeouts, retry counts.
```bash
python3 .claude/skills/axiom-csc/scripts/lower_ast.py --input "$TASK_CONTEXT"
```
- ## Pass 2 — Lemma (Relational Logic Solver)
-
- Evaluate extracted Base Entities against `.axiom/invariants.yaml` deterministically.
+ ## Pass 2 - Lemma (Relational Logic Solver)
```bash
python3 .claude/skills/axiom-csc/scripts/eval_lemma.py --ast ast.json --rules .axiom/invariants.yaml
```
- - Exit 0 → ALLOW
- - Exit 1 → BLOCK (output AxiomConstraintViolation, halt)
- - Exit 2 → ASK (output targeted micro-query, halt)
+ - Exit 0 -> ALLOW
+ - Exit 1 -> BLOCK (output AxiomConstraintViolation, halt)
+ - Exit 2 -> ASK (output targeted micro-query, halt)
- ## Pass 3 — Manam (Tri-State Epistemic Controller)
+ ## Pass 3 - Manam (Tri-State Epistemic Controller)
Maintain strict 3-State Logic: `TRUE | FALSE | UNKNOWN`.
+ On UNKNOWN: halt, issue one precise question. Write resolved answers to `.axiom/state.json` for subsequent turns.
- On UNKNOWN: halt, issue one precise question naming the exact missing variable. Never guess.
+ ## Session State (.axiom/state.json)
- ## First-time setup
+ Resolved entities persist across turns. Verified entities are cached, block count tracked, resolved ASK answers written back so the next turn skips that check.
- ```bash
- python3 .claude/skills/axiom-csc/scripts/axiom_init.py .
- ```
+ ## Output Format (AUDIT mode)
- Scans your workspace and generates `.axiom/invariants.yaml` automatically.
+ ```
+ --- AXIOM TELEMETRY ---
+ Entities extracted : <n>
+ Lemma violations : <n>
+ Unknown states : <n>
+ Disposition : ALLOW | BLOCK | ASK
+ Latency : <ms>ms
+ -----------------------
+ ```
- ## Output Format (AUDIT mode)
+ For advanced rule syntax, see `.claude/skills/axiom-csc/references/INVARIANTS_SPEC.md`.