Metadata-Version: 2.4
Name: cigito-v3
Version: 0.0.1
Summary: Cigito v3 distill data curator — DeepSeek V4 + Cogito 671B teacher fusion (W2 milestone, $0 CPU)
Author: AI King
License: AGPL-3.0-only
Keywords: distillation,ziq,cbua,fieldread,cigito
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"

# Cigito v3 — Distill Data Curator (W2 milestone)

Standalone parallel-track POC. **Not wired into Concinno main / Sancio.**

## Purpose

W2 milestone of the Cigito v3 plan: curate **5 000 (instruction, response, ZIQ
trajectory, CBUA stage, FieldRead compression %)** pairs from existing
Concinno trajectories — at $0 CPU, pure stdlib heuristic, no GPU/API call.

The curated jsonl is the seed corpus for the W3 distill loop (DeepSeek V4
student + Cogito v2.1 671B teacher, IDA composite loss, USPTO patent
skeleton — see W1 design doc).

## Status

| Phase | Status |
|---|---|
| W1 design doc | shipped 2026-04-28 (`_AI_BRAIN/05_Planning/cigito-v3-...`) |
| W2 data curation (this pkg, 0.0.1 first publish) | shipped 2026-04-28 |
| W3 distill loop POC | gated on W2; runs on RunPod when triggered |
| W4 GO/NO-GO Gate | gates production wire-in to Concinno main / Sancio runtime |

This W2 milestone is **data curation only** — it does not run the distill
loop, does not start RunPod, does not invoke any LLM API. The output
`data/pairs_v0.jsonl` is the input to W3.

## PyPI publication note (0.0.1 first publish)

The 0.0.1 release intentionally has **zero callers in the Concinno
ecosystem**. Wiring is gated on the W4 GO/NO-GO Gate per the Plan v3
parallel-track spec, not on this package's PyPI presence.

If you are a third-party adopter:

- **Treat 0.0.x as Pre-Alpha** — the `Development Status :: 2 -
  Pre-Alpha` classifier in `pyproject.toml` reflects exactly that.
  Public APIs (curator schema, output jsonl shape, classes under
  `cigito_v3.distill`) **may change incompatibly** between 0.0.x
  releases as Phase 1 POC findings come back from RunPod runs.
- The package is **standalone** and pure-stdlib by design — it does
  not import `concinno`, `concinno-skills-*`, or `sancio-runtime`.
  Installing it next to those packages does not affect their behaviour.
- A production wire-in (e.g. a `concinno cigito-distill` subcommand or
  a Concinno main pkg `Distill` skill) will land **only after** the W4
  GO/NO-GO Gate evaluates the Phase 1 POC. Until then this package is
  a staged research artefact, not a turn-key feature.

## Layout

```
cigito-v3/
├── pyproject.toml          (placeholder, version 0.0.1, AGPL)
├── src/cigito_v3/
│   ├── distill/
│   │   ├── curator.py        — 5k pair selector (heuristic, $0 CPU)
│   │   ├── trajectory.py     — ZIQ outcome bus replay → decision sequence
│   │   ├── stage_tagger.py   — CBUA stage transition labeler
│   │   └── compression.py    — FieldRead pre/post compression demo
│   └── data/
│       └── pairs_v0.jsonl    — curated output (or pointer)
└── tests/
    └── test_distill_v2.py    — ≥12 tests
```

## CLI

```bash
python -m cigito_v3.distill.curator \
    --concinno-home ~/.concinno \
    --handoff-root _AI_BRAIN/06_Handoffs \
    --target-pairs 5000 \
    --output data/pairs_v0.jsonl
```

The curator is **read-only** — it never writes outside the explicit
`--output` path. It refuses to call any external service (asserted in
`test_curator_no_external_api_call`).

## Output schema

Each line of `pairs_v0.jsonl` is a JSON object:

```json
{
  "instruction": "<task framing extracted from the source session>",
  "response": "<canonical response derived from the trajectory>",
  "ziq_trajectory": [
    {"step": 0, "tunable": "...", "value": ..., "reward": 0.93,
     "sps_x_ftrl": 0.71, "source": "..."}
  ],
  "cbua_stage": ["C0", "C1", "C2", "B1", "U1", "A1", "A3"],
  "fieldread_compression_pct": 0.42,
  "source_session": "<session id, anonymized>"
}
```

## Hard constraints

1. **$0 CPU** — pure stdlib + heuristic. No embedding model, no LLM call.
2. **No personal paths** — every input root is parameterized via CLI / env.
3. **No GPU API call** — `test_curator_no_external_api_call` asserts the
   relevant env vars are unset *during* curation.
4. **Idempotent** — same inputs deterministically produce the same output.
5. **AGPL** — per W1 design doc, parallel-track Cigito tracks AGPL like
   Concinno mainline.

## Not a GO/NO-GO Gate

W2 ships a curated pairs jsonl. **It is not a Phase 0 PASS milestone.**
Per the post-exec sediment warning, "Phase 0 PASS" framing is misleading —
this milestone is one input to the W3 distill loop, the GO/NO-GO Gate
lives at the W4 evaluation stage with held-out test pairs and capability
deltas vs the DeepSeek V4 base.

The string `Phase 0 PASS` is deliberately absent from outputs (regression
test: `test_no_phase0_pass_string_in_outputs`).

## License

AGPL-3.0-only (per W1 design doc — Cigito follows Concinno mainline AGPL).
