# ARIZ_KERNEL — inventive thinking OS for GIGACHAD_NATIVE

**Status:** architecture law (kernel-grade). Patches `MASTER_REPORT §1`.
**Date:** 2026-04-27.

> GIGACHAD_NATIVE never does `task → 7B → answer`. It always walks
> the ladder of ARIZ operations: at each step **something concrete is
> computed and written into the DAG**, and only afterwards does the 7B top brain
> receive an already-structured `ARIZ_TRACE` for synthesis.

## Why this exists

Altshuller showed that trial-and-error eats years, while ARIZ breaks the
"problem → solution" path into a sequence of operations. Each operation is narrow,
verifiable, and strips away one layer of psychological inertia. For us that means:
the 7B brain must not "think for everyone" — it must synthesise on top of
already-identified contradictions, IFR (Ideal Final Result), and resources.
Otherwise it slides back into the donor's chat style, which Phase-8C/D demonstrated.
(`NEED_MORE_EVIDENCE | Final: …` loop).

## The 9 ARIZ operations (kernel order)

| # | Stage                         | Output                                   | Native producer                                   |
|---|-------------------------------|------------------------------------------|---------------------------------------------------|
| 1 | Terminology neutralization    | `neutralized_problem` (no jargon)        | new organ `phys05_term_neutralizer` (or 7B fallback) |
| 2 | Technical contradiction (TC)  | `{improves, worsens}`                    | `phys05_triz_contradiction` (already wired)       |
| 3 | Physical contradiction (PC)   | `{must_be_X, must_be_not_X, when}`        | same organ extends schema                         |
| 4 | Ideal Final Result (IFR)      | `"X happens by itself, without …"`       | new organ `phys05_ifr` (or 7B short call)         |
| 5 | Resources                      | `{substance[], field[], time[], space[]}` | new organ `phys05_resources` (or 7B short call)   |
| 6 | TRIZ operators                 | `[op_id, op_name, applicability_score]`  | rule-based selector + memory recall (no LLM call) |
| 7 | Little-people method (smart material) | textual model of micro-elements    | 7B short call, optional                           |
| 8 | Candidate solutions            | `[{idea, applies_op, addresses_pc}]`     | 7B top brain synthesis                            |
| 9 | Verification + docking         | hard verifier + DAG + hologram save      | existing spine                                    |

Stages 1, 2, 3, 4, 5 produce **machine-readable JSON**. Stage 6 is rule-based,
no LLM. Stages 7, 8 are LLM. Stage 9 is the existing verifier/DAG/hologram.

## ARIZ_TRACE schema (the kernel artifact)

Every ARIZ task produces one `ARIZ_TRACE` record, written to DAG and saved
as a hologram:

```json
{
  "trace_version": "ariz_trace_v1",
  "task_id":       "ariz_e2e_<hash>",
  "raw_problem":   "Hot dusty gas at 600C clogs a metal filter…",
  "neutralized":   "A porous barrier captures particles from a hot stream …",
  "TC": {"improves": "particle capture", "worsens": "flow rate"},
  "PC": {"must_be":  "porous to gas", "must_not_be": "porous to dust", "when": "during operation"},
  "IFR": "The barrier separates dust from gas without resistance, without parts, without external energy.",
  "resources": {
    "substance": ["dust", "gas", "filter material", "vibration", "centrifugal force"],
    "field":     ["thermal", "acoustic", "magnetic (if particles ferrous)", "electrostatic"],
    "time":      ["before clog", "during clog", "after clog"],
    "space":     ["upstream of filter", "filter surface", "downstream"]
  },
  "operators":   [
    {"op": 1,  "name": "Segmentation",        "score": 0.7},
    {"op": 17, "name": "Another dimension",   "score": 0.6},
    {"op": 35, "name": "Parameter changes",   "score": 0.55}
  ],
  "little_people": "Tiny workers riding the gas stream; …",
  "candidates": [
    {"idea": "Centrifugal pre-separator before filter",   "applies_op": 17, "addresses_pc": "yes"},
    {"idea": "Self-cleaning electrostatic mesh",          "applies_op": 35, "addresses_pc": "partial"},
    {"idea": "Acoustic standing-wave dust trap",          "applies_op": 18, "addresses_pc": "partial"}
  ],
  "verifier_pass": true,
  "dag_path":      "dag/runs/<…>.json",
  "hologram_id":   "ariz_<hash>_<ts>",
  "memory_sources":["hologram:ariz_<prev>", "vol014:L120-130"]
}
```

This trace is the **memory unit** of ARIZ thinking. Future hits with similar
problems retrieve the trace — not just the final answer — and can short-cut
through stages 1-5.

## Pipeline pseudocode (current target)

```
input
 → memory_recall.find_ariz_traces(input)
 → if hit:        return cached candidate (still verify)
 → else:
    neutralized = phys05_term_neutralizer(input)
    TC, PC      = phys05_triz_contradiction(neutralized)
    IFR         = phys05_ifr(neutralized, TC, PC)
    resources   = phys05_resources(neutralized, TC)
    operators   = trz_select_operators(TC, PC, resources)            # rule-based
    little      = phys05_little_people(neutralized) if needed
    candidates  = physarium_7b.synthesize(
                    task=input,
                    trace={neutralized, TC, PC, IFR, resources, operators, little},
                    memory=memory_sources,
                    verifier_requirements=…)
    verifier    = hard_verifier(candidates)
    DAG.write(ARIZ_TRACE)
    hologram.save(ARIZ_TRACE)
```

## Forbidden shortcuts

- ❌ `input → 7B → answer` without ARIZ trace.
- ❌ Skipping neutralization (terms carry psychological inertia).
- ❌ Skipping IFR (otherwise top brain optimizes the wrong objective).
- ❌ Skipping resources (most operators reference them).
- ❌ Re-prompting 7B on failure without first checking which stage failed.

## Implementation roadmap

| Stage    | Status (2026-04-27) | Phase                                   |
|----------|---------------------|------------------------------------------|
| 1 neutralizer  | ⏳ specced, not wired      | 8F2                                     |
| 2 TC           | ✅ wired (phys05_triz_contradiction) | already in 8F0                  |
| 3 PC           | ⏳ schema extension         | 8F2                                     |
| 4 IFR          | ⏳ specced                  | 8F2                                     |
| 5 resources    | ⏳ specced                  | 8F2                                     |
| 6 operators    | ⏳ rule table TBD            | 8F2 (no LLM, fast)                      |
| 7 little-people| ⏳ optional                  | 8F3                                     |
| 8 synthesis    | ⚠️ partial (7B does it without trace) | 8F2 will pass full trace        |
| 9 verifier+DAG | ✅ wired                    | already in 8F0                          |

## Cost note

Each ARIZ stage on the 0.5B is ~30-90 s on CPU. Full ARIZ chain ≈ 5-7 organ
calls + 1 7B call ≈ 8-15 min wall on the current CPU runner. Phase-8E (CUDA)
is the unlock — but **correctness of the chain is gated on this kernel
existing**, not on speed.

## Master-report patch

`MASTER_REPORT.md`:
- §1 (Architecture lock) — append: "GIGACHAD never does `prompt → 7B → answer`.
  Every ARIZ-class task walks `ARIZ_KERNEL` (this doc)."
- §5 (Organ farm) — add 4 new organs once wired: `phys05_term_neutralizer`,
  `phys05_ifr`, `phys05_resources`, `phys05_little_people`.
- §7 (Latest E2E) — update to include `ARIZ_TRACE` schema in next E2E.
