supercode-core 0.2.1

A lightweight, fully-customizable AI coding agent SDK in Rust. Talks to any model via OpenRouter or any OpenAI-compatible endpoint.
Documentation
//! # Unified EXCLUDE list (B10) — normative for every series
//!
//! Every reduction must satisfy §3d's pointer discipline. The following
//! cannot (or can only as views), and are classified accordingly. Binding on
//! A-, B-, and C-series alike.
//!
//! | # | Technique | Verdict | One-line reason (§3c) |
//! |---|-----------|---------|------------------------|
//! | #16-20 | Soft-token compressors (Gist, ICAE, AutoCompressors, 500x, xRAG) | **BANNED outright** | Model-specific embedding/KV vectors — non-portable, mostly non-reconstructable; "disqualified as supercode's context representation"; cannot cross an export boundary. |
//! | #12-15 | Hard prompt compression without sidecar (LLMLingua family, Selective Context) | **View-only with sidecar**; banned as stored form | "Irreversibly pruned text with no sidecar" — permitted only as a `project()` output with the original in the sidecar as export source. |
//! | #3, #22-28 (summary path) | Lossy summarization/compaction as the SOLE copy | **View-only with sidecar**; banned as sole copy | "The summary must never become the sole copy"; export always reads the raw. (This is the incumbent-harness pattern the exec summary contrasts against.) |
//! | #38 | Terse-output prompting on load-bearing content | **BANNED in cheap-phase defaults**; allowed only for provably-disposable output | "Dropped preamble is unrecoverable"; empirically oversold (9-21% measured vs 65-75% claimed, §4). Never-generated content is the one loss no sidecar can undo. |
//! | #40 | `max_tokens` truncation as compression | **BANNED as compression**; allowed as a runaway guard above expected need (B9) | "Maximally lossy (severed mid-sentence)"; a truncated answer misrepresents the model's output to export and to any later model. |
//! | #36-37 | Semantic response caches without substitution flags | **BANNED unflagged**; exact-match allowed; semantic hits only with a per-turn substitution flag in sidecar metadata | A fuzzy hit substitutes an answer generated for a *different* prompt — the export would misrepresent what the model produced. |
//! | #55 | Knowledge distillation | **BANNED outright** (out of layer) | Bakes quality loss into the cheap model with no in-step escalation — defeats escalate-when-hard. |
//!
//! Corollary rules (mechanically pinned):
//! - B4's verification probe / scorer traffic is **not conversation** — never in transcript or
//!   sidecar-as-conversation (B4-AC3); B7's cache annotations are wire-only (B7-AC2); B3's
//!   `<<escalate>>` marker **is** honest session content and exports as-is.
//! - The in-repo lossy mechanisms — `cap_tool_output` (`agent.rs:402-420`) and `maybe_compact`
//!   (`agent.rs:265-298`) — are #40-adjacent and #22-28 respectively: in reduced mode they may run
//!   **only** when the sidecar has captured the full original first (A3), and compaction never
//!   crosses the imported prefix (B7 clamp). (D6.)
//!
//! **ACCEPTANCE** (`crates/core/tests/exclude_list.rs`; the table itself is the module doc comment —
//! the normative reviewer reference; unimplemented-tech rows need no test):
//! 1. **No probe leakage** (= B4-AC3, referenced).
//! 2. **No wire annotations in transcripts** (= B7-AC2, referenced).
//! 3. **Compaction-sole-copy guard:** `compact_after_messages` set, **no** sidecar/recorder
//!    attached, reduced machinery configured → `maybe_compact` is inert (returns false) unless the
//!    new explicit `compact_allow_lossy` opt-in is set (default false when reduced machinery is
//!    configured; today's behavior preserved when it is not).
//! 4. **Honest truncation labeling:** with no sidecar, a >cap tool output still truncates (safety
//!    cap never disabled) but the appended notice reads `"full output not retained"` vs the
//!    sidecar-present `"full output in session sidecar"` (string assertions on the
//!    `agent.rs:416-418` notice site).
//!
//! **DEPENDENCIES.** Doctrine: none (write first). Test hooks: B4, B7, A3/D6.

// The four conformance tests above are wave 6 work (they depend on B4, B7,
// and the A3/D6-gated rewiring of `maybe_compact`/`cap_tool_output`, none of
// which exist yet). Until then, this file's job is purely doctrinal — the
// one normative copy of the EXCLUDE table above is what reviewers check new
// reduction work against — and the anchor test below keeps this file
// participating in every `cargo test` run.

/// Compile/test anchor: keeps this doctrine file part of the build so the
/// EXCLUDE table above is exercised (and CI-visible) even before the wave-6
/// conformance tests land.
#[test]
fn sentinel_matches_the_reduction_layer() {
    assert_eq!(supercode::reduce::REDUCTION_SENTINEL, "[sc-reduced");
}