Infrastructure

jackin❯ Context Engine

Embed a native token-optimization context engine in jackin — write-time observation compression, bounded retrieval, output/prompt policy, fleet routing economics, and honest measurement — synthesizing the validated mechanisms from caveman, headroom, RTK, lean-ctx, sem, fff, codedb, and mq without their delivery tax.

Status: Partially implemented — design spec and evidence base drafted; crates/jackin-context implementation remains open.

Objective

Make every jackin capsule token-optimized out of the box by embedding one Rust engine (crates/jackin-context) that owns six layers: measurement (ledger, cache-bust detection, thinking estimation, validation harness), observation compression at the tool boundary (shims + deterministic filters + reversible archive), bounded retrieval (embedded fff/sem/mq + codedb-shaped query verbs), output/prompt policy (register pack, guard lines, subagent report contracts), routing and fleet economics (effort tiers, model pins, advisor, spawn choreography, batch lane, quota metering), and a single reversible memory/state layer.

Why jackin, not a stack of third-party tools

The research corpus concluded every external tool pays most of its complexity for not owning the runtime (installers, self-healing hooks, permission mediation, proxy plumbing) and none can prove its savings honestly (GPT tokenizers, per-payload marketing numbers, no net-of-injection accounting). jackin composes capsule config at launch, supervises every tool boundary, and already parses per-session usage — so it can ship the mechanisms without the delivery tax and measure them properly.

Canonical documents

Remaining work

Phases P0–P6 per the spec's rollout page: measurement-only foundation first (ledger, attribution, CI token-budget gate), then the negative-cost config set, then shims/filters, retrieval, output pack, routing, memory — each gated by the harness acceptance bar (≥20% tokens-per-solved-task at quality parity, net of the engine's own overhead). Requires one versioned jackin.role.toml schema bump for the [context] table.

On this page