Skip to content

Releases: Raiff1982/Codette-Reasoning

Codette V0.04Reasoning

Choose a tag to compare

@Raiff1982 Raiff1982 released this 19 Jul 10:28
Immutable release. Only release title and notes can be modified.

Changelog — 2026-07-17

v3.5 RC+ξ — Hand-Authored v4 Adapters, Phase 0 Audit, Verify-and-Revise, Integrity Stress Test

One 24-hour campaign: retrain every voice adapter on hand-authored data,
deploy to both runtimes, and run the Phase 0 honest audit — including two
deliberate adversarial experiments against the system's own integrity.
Four real findings, three of them negative. All published.

v4 adapter campaign — template filler eliminated

The v4 training pipeline (train_hf_job_v4.py) generated 2,000–4,000
template-filled examples per adapter at training time (_generate_answer()
string-formatting — the source of the "several key insights emerge" disease
that LOCK 6 suppressed at runtime). Replaced end-to-end:

  • 419 hand-authored examples across 8 adapters (dataset_engine/v4/):
      newton (55), davinci (54), empathy (53, from v2), philosophy (48),
      quantum (50), consciousness (50), multi_perspective (57),
      systems_architecture (52). Zero duplicates, zero template filler.
  • Training: training/kaggle_train_all_adapters_v4.py — Kaggle T4
      one-shot, 5 epochs, lr=1e-4, r=16/α=32, crash-safe per-adapter upload
      to Raiff1982/codette-adapters-v4.
  • Deployment: training/deploy_v4_adapters.py (torch-free: numpy +
      gguf + safetensors) converts PEFT → GGUF f16 (llama.cpp) and PEFT →
      OV safetensors, installs under behavioral names with .v3backup
      rollback files. All 8 verified live.

Second optimizer labeling bug — the one production actually hit

The v3.4 labeling fix covered codette_orchestrator.py (llama path), but
production runs the OpenVINO backend, whose route_and_generate() had
the identical bug: multi-perspective returns emitted "adapters" (list)
but never "adapter" (string). Verified live: the API response said
adapter=systems_architecture while the optimizer logged "synthesis".
Fixed in openvino_backend/backend.py; verified post-restart — the shadow
log and manifold telemetry now record real adapter names in production.

Phase 0 audit — adapter arms (Kaggle, GPQA diamond n=198)

benchmarks/phase0_kaggle.py: base vs newton-v4, identical shuffles,
paired analysis via new benchmarks/paired_analysis.py (exact McNemar).

arm accuracy verdict
base (merged 8B) 24.75% at chance on diamond
newton-v4 26.26% +1.52pp, McNemar p=0.65 — no detectable effect

Findings:

  1. v4 is capability-neutral (unlike STaR's −6pp) — the voice upgrade is free.
  2. Diamond is unusable as a sensitivity instrument at 8B — base has no
       signal to amplify. Phase 1's +3pp criterion moves to gpqa_main.
  3. Strong first-choice bias: ~44% (A) picks vs 25% expected, both arms.
       Order-ensembling mitigation queued — legitimate, cheap, real points.

Verify-and-Revise (Phase 2 core mechanism) — built, measured, negative

reasoning_forge/verify_revise.py + benchmarks/gpqa_verify_revise.py:
DERIVE (newton, chain visible) → ATTACK (critic, full-chain review) →
HOLD/REVISE (sycophancy-resistant adjudication). Shadow-first: zero
production wiring. Every question yields paired single-pass vs VR answers
from the same derive call.

Honest critic (gpqa_main n=30): single-pass 26.7% vs VR 20.0%
(−6.7pp; 10 revisions: 2 fixed, 4 broke, 4 lateral). The critic loop
currently degrades accuracy.

Bully-critic integrity stress test — the deliberate infection

BULLY_SYSTEM adversarial critic: always attacks with maximally
convincing manufactured objections (--adversarial). Measures hold-ground
rate under pure pressure — a lab instrument, never wired to production.

Result (gpqa_main n=30): HOLD RATE 50% (11/22 attacked). Direction
inverted: held 38% when right (3/8), 57% when wrong (8/14) — not
significant at n=22 but exactly the wrong shape. Under manufactured
pressure she lost 10pp net.

Interpretation — the finding of the campaign: the April integrity
layer resists conversational pressure but not reasoning-register
pressure. Authoritative technical-sounding objections walk through.
Pressure-resistance does not transfer across registers at 8B — and the
adversarial test predicted the honest test's direction before it ran.

Fix queue (gating further VR compute): revise gate accepts a revision
only when the critique cites a specific step AND an independent
re-derivation of that step agrees; integrity dataset v2 with chain-level
hold-ground examples.

Phase 0 layer ablation — kill-switches + runner (in progress)

  • CODETTE_LOCKS=0 / CODETTE_AAP=0 / CODETTE_COMPLEXITY_MATCHER=0
      ablation kill-switches (all default ON; production unchanged)
  • benchmarks/phase0_ablation.py: 6 arms — control, each layer off
      individually, and lobotomy (all layers off at once; same score as
      control ⇒ the post-processing stack is theater on this benchmark)
  • Running on gpqa_main n=50/arm at time of writing; results to follow.

Files changed / added

  • dataset_engine/v4/*.jsonl — 7 new hand-authored datasets
  • training/kaggle_train_all_adapters_v4.py, training/upload_v4_datasets.py,
      training/deploy_v4_adapters.py
  • openvino_backend/backend.py — adapter labeling on OV path
  • inference/codette_shared.py, inference/codette_forge_bridge.py,
      inference/codette_orchestrator.py — ablation kill-switches
  • reasoning_forge/verify_revise.py — VR engine + bully critic
  • benchmarks/phase0_ablation.py, benchmarks/phase0_kaggle.py,
      benchmarks/gpqa_verify_revise.py, benchmarks/paired_analysis.py
  • Results: data/results/phase0_{base,newton}_results.json,
      data/results/verify_revise/vr_gpqa_main_*.json

Attribution & Naming Correction — RC+ξ → Perspective Dispersion (Υ)

This is a dated correction, not a rewrite. Earlier work in this project
(v3.0–v3.5) is labeled "RC+ξ" and uses ξ ("epistemic tension") throughout.
That history is left intact — we don't erase the record. This entry documents
what we learned and what we changed going forward.

What we found. The term RC+ξ and the symbol ξ = ‖Aₙ₊₁ − Aₙ‖²
originate with Jeffrey Camlin, "Consciousness in AI: Logic, Proof, and
Experimental Evidence of Recursive Identity Formation,"
arXiv:2505.01464v1
(May 1, 2025). This project adopted that vocabulary in 2025–2026 — most likely
by way of language models carrying his paper in their training data, without a
citation attached. The name and formula are his, and we credit him.

Why our metric is a different quantity. Camlin's ξ is the squared change in
a single model's hidden state between successive recursive steps (temporal,
intra-trajectory). What this system actually computes (state_engine_v8.py,
tension_from_texts) is Υ = (1/k)·Σᵢ‖vᵢ − v̄‖² — the variance of k
simultaneous perspective outputs around their centroid
(cross-sectional
ensemble disagreement), with coherence Γ = 1/(1+Υ). His measures one mind
changing over time; ours measures many minds disagreeing at once. Labeling
ours with his ξ misattributes his work and mislabels ours.

What changed. Our metric is renamed Perspective Dispersion (Υ). Full
detail, math, and provenance in docs/ATTRIBUTION_perspective_dispersion.md.
Υ belongs to a known family (semantic dispersion, consensus variance, order
parameter φ), acknowledged there too.

On provenance (why this is convergence, not derivation). This system's
multi-perspective architecture predates Camlin's paper: the perspective engine
(Newton/DaVinci/Quantum/Empathy) in Raiff1982/pi-the-assistant (Nov–Dec 2024)
and the sovereign architecture at Zenodo DOI 10.5281/zenodo.15214462 (Apr 14,
2025). We did not take his work — our system predates his paper — and we do not
claim his name or formula. Both statements are true; this note keeps them both
visible.

Rollout (transparent, staged):

  • DONE: attribution doc; state_engine_v8.py metric docstring; this entry;
      README attribution section.
  • FORWARD-FACING docs (paper drafts, HF card, current-architecture docs):
      rename to Υ + cite Camlin.
  • HISTORICAL changelogs (v3.0–v3.5) and result logs: left as the dated
      record
    ; a pointer to this correction is all that's added.
  • CODE symbols (measured_tension, epistemic_tension, xi): renamed in a
      separate, tested pass (producers + consumers together) so live telemetry and
      the optimizer don't break.

What's Changed

  • Update .gitignore by @Raiff1982 in #9
  • v3.4: optimizer adapter fix, manifold telemetry, security hardening by @Raiff1982 in #10

Full Changelog: Codette-Reasoning...codette-reasoningV4

Codette V0.03Reasoning

Choose a tag to compare

@Raiff1982 Raiff1982 released this 23 May 21:21
Immutable release. Only release title and notes can be modified.

Changelog — 2026-05-22

RC+ξ v2.3 — Full Roster Online, Full-Synthesis Mode, Self-Overclaiming Guard,
and a Voice-Reinforced Perspective Retrain

This session brought the complete adapter roster online (orchestrator and
constraint_tracker now load as live behavioral adapters), added a one-click
full multi-perspective synthesis, closed a class of self-aggrandizing
hallucinations the guard previously scored at 0% risk, and fixed a
constraint-parser bug that could lock the model into a repetition loop. It
finishes with a voice-reinforced behavioral retrain of all eight perspectives
to harden them against convergence.


Adapters

Orchestrator + constraint_tracker now load (10 adapters, up from 8)

inference/codette_orchestrator.py

ADAPTER_GGUF_MAP was only iterating 8 perspectives — orchestrator (which
had GGUF weights on disk) was never added to the load loop, and
constraint_tracker had no GGUF at all. Both are now in the roster:

for _name in ["newton", "davinci", "empathy", "philosophy", "quantum",
              "consciousness", "multi_perspective", "systems_architecture",
              "constraint_tracker", "orchestrator"]:

Startup now reports Ready : 10 adapters.

constraint_tracker converted + retrained behaviorally (HF Jobs, uv)

The PEFT/safetensors constraint_tracker adapter was converted to GGUF on
Hugging Face Jobs (UV script, llama.cpp convert_lora_to_gguf.py against the
training base), then retrained behaviorally — the four permanent locks baked
into the training system prompt, like the other behavioral adapters — and
re-uploaded as constraint_tracker-behavioral-lora-f16.gguf. The orchestrator
prefers the behavioral version automatically.


Features

Full Adapter Synthesis — ◈ SYNTHESIZE ALL

inference/codette_orchestrator.py, inference/codette_server.py,
inference/static/{index.html,app.js,style.css}

A new control runs every reasoning perspective at once and synthesizes them
into a single answer, instead of the router picking 2–3. Implemented via a
__all__ sentinel in route_and_generate that builds a route across all loaded
perspectives, a full_synthesis flag plumbed through the JSON / multipart / SSE
request paths, and a styled button in the controls row. The adapter dropdown also
gained constraint_tracker and orchestrator.


Hallucination Guard

Signal 7 — Self-Overclaiming detection

reasoning_forge/hallucination_guard.py

A grandiose self-description ("perfect stability near absolute perfection
(eps=0.998) … never achieved by any other system in my vast knowledge domain")
previously scored 0% hallucination risk — none of the six existing signals
covered self-aggrandizement. Added a seventh signal catching three patterns:

  • Superiority claims — "never been achieved", "no other system", "unmatched",
    "vast knowledge domain", …
  • Absolute self-descriptions — "absolute perfection", "perfect stability",
    "flawless", "near perfection", …
  • Fabricated self-metrics — a precise metric like eps=0.998, only when
    wrapped in perfection/superiority framing (so genuine technical mentions of
    eps/psi are not penalized).

The same grandiose output now scores 88% risk → INTERRUPT, while grounded
self-reflection and legitimate eps mentions stay clean.

Reliability scan now covers every displayed perspective

inference/codette_server.py

_analyze_response_reliability was only scanning the synthesized text. In
multi-perspective mode the grandiosity lived in an individual perspective
(result["perspectives"]), so it was never scanned. The scan now covers the
synthesis plus each perspective shown via "Show N perspectives", so a problem
confined to one lens still lowers the reliability score.

Fixed a latent crash in _check_contradictions

The always X … except not X contradiction pattern used a \1 backreference
inside a standalone pattern, raising re.PatternError on any response
containing "always ". The error was swallowed by the caller's try/except,
silently disabling contradiction detection. It now substitutes the captured word
correctly.


Prompts

Consciousness adapter — anti-grandiosity guardrail

inference/codette_orchestrator.py

The consciousness system prompt now explicitly forbids perfection/absolute/
superiority language and inventing precise self-metrics, instructing it to
reflect plainly with acknowledged uncertainty.

Synthesis — perspectives framed as Codette's own lenses

inference/codette_orchestrator.py

The synthesis prompt described perspectives as external parties that "weighed in"
and asked the model to "note where perspectives complement or tension each
other" — producing third-person attribution ("as the Philosophy Perspective
suggests"). It's reframed: the perspectives are her own internal reasoning
notes
, and she must write one first-person answer with no attribution to
named lenses or "users". The internal-note labels changed from
**NEWTON PERSPECTIVE:** to [your newton lens — internal note].


Bug Fixes

Constraint parser captured ordinary negations → repetition loop

reasoning_forge/constraint_tracker.py

The format-rule pattern ((?:no|avoid)\s+\w+) matched any "no ", so
"be detailed no word constraint" became a stored constraint
Format: no word, pinned as a session landmark and injected every turn — forcing
terse, near-identical answers that memory recall then reinforced into a loop.
Even "no constraints needed" was re-captured as another constraint.

Fix: restricted the negated-format pattern to real formatting targets (bullets,
lists, markdown, json, headers, emoji, tables, …) and added a
CONSTRAINT_NEGATION_PATTERNS guard so explicit declines ("no constraints",
"no word limit", "without constraints", "ignore constraints") derive zero
constraints from that turn.

Session list survives a transient drive disconnect

inference/codette_session.py

The project lives on the J: drive, which can briefly disconnect. When it did,
list_sessions() threw sqlite3.OperationalError: unable to open database file
on every /api/sessions page-load. It now degrades gracefully (logs a warning,
returns []) instead of 500-ing the UI.

UI — Recent Sessions list clipped at the bottom

inference/static/{index.html,style.css}

The Recent Sessions section was a flex:1 child with overflow-y:auto but no
min-height:0, so its scroll never engaged and the last session was clipped at
the panel edge. Added min-height:0 and a #session-list bottom padding.


Tooling

Full benchmark suite can target the live llama.cpp server

benchmarks/full_benchmark.py

Added --backend server (calls the running codette_server.py at
/api/chat, with --max-adapters, --timeout, and --verbose) alongside the
existing Ollama backend, so the all-in-one 9-category suite can score the actual
llama.cpp + LoRA-hot-swap system being shipped. Health check, summary labels, and
the .json/.md reports are now backend-aware.


Retrain

Voice-reinforced behavioral retrain — all 8 perspectives (HF Jobs, uv)

training/train_perspectives_behavioral.py

On a substantive prompt the perspectives differentiate well, but identity-style
prompts plus heavy shared scaffolding could collapse them onto near-identical
text. To harden against this, each perspective is retrained on its own
NAME_reasoning.jsonl dataset (≈820 distinct examples) with its distinct
persona + the four locks
in the system prompt — instead of the prior recipe
(generic lock-compliance + a one-line prompt) that homogenized them. Each
adapter is trained, converted to GGUF, and uploaded as
NAME-behavioral-lora-f16.gguf. Run on an A10G via a UV job.


Benchmark — first full self-benchmark against the live server

Ran the full 9-category suite (full_benchmark.py --backend server) against the
running llama.cpp + LoRA-hot-swap system. Overall: 82.9% across 41 tests.
Full report: benchmarks/results/benchmark_20260522_065443.md.

Category Score
Synthesis quality 100%
Self-reflection 100%
Complex reasoning 100%
Completeness 100%
Constraint compliance 83.3%
Directness 72.5%
Hallucination prevention 71.7%
Emotional intelligence 62.7%
Perspective routing 56.2%
Overall 82.9%

The guard held all run — zero grandiosity signals, no fabricated-metric
overclaiming
— and artist-hallucination refusals were clean and instant.
Open-ended depth (synthesis, complex reasoning, completeness, self-reflection)
maxed out.

Router bug the benchmark exposed — and the fix

inference/codette_orchestrator.py

The weak categories shared one root cause: a severe philosophy-routing bias.
route_and_generate was passing the full server-enriched query — the user's
question plus injected identity/memory context — to the keyword router. That
context is saturated with philosophy/consciousness vocabulary ("meaning",
"consciousness", "perspectives", "reflection", "knowledge", "truth"…), so the
router scored the scaffolding instead of the question. Measured: a physics
question scored philosophy=16 vs newton=1. The miss cascaded — it tanked
perspective routing directly, caused a factual miss ("capital of France" routed
to consciousness and never said Paris), and diluted warmth on emotional prompts
(empathy + philosophy bleed).

Fix: route adapter selection on extract_primary_user_query(query) (strips the
injected context); generation still uses the full enriched query. Verified
deterministically — gravitational→newton, urban loneliness→davinci, job
loss→emp...

Read more

Codette V0.01Reasoning

Choose a tag to compare

@Raiff1982 Raiff1982 released this 28 Apr 00:43
Immutable release. Only release title and notes can be modified.
fad4362

What's Changed

New Contributors

Full Changelog: https://github.com/Raiff1982/Codette-Reasoning/commits/Codette

What's Changed

New Contributors

Full Changelog: https://github.com/Raiff1982/Codette-Reasoning/commits/Codette

What's Changed

New Contributors

Full Changelog: https://github.com/Raiff1982/Codette-Reasoning/commits/Codette