sqz synthesis
Type: agentic-system-analyses/types/agentic-system-synthesis.md
Bounded synthesis
Reduce context before an external agent consumes it
sqz is a context-compression and retention system, not the runtime that chooses an agent's next action. It transforms file, command, tool and session text before an external host supplies it to a model. Its distinctive combination is deterministic reduction, persistent original-content recovery and short references or deltas for repeated material. The caller still decides what work to request, when to recover missing information and whether the final answer is adequate.
This account covers the repository at commit 495c078d8f4c94d060ecfbb4d919286670b87898, with applicability cutoff 2026-11-09. SRC-1 supplies inspected implementation, declared design and attributed benchmark results. The whole-system boundary includes native CLI/engine/storage, MCP server and proxy, session maintenance, generated guidance, browser/WASM, IDE callers and evaluation code. It is not a claim that every module was exhaustively audited. No supplied execution or causal experiment establishes installed operation, actual model use or improved task performance. External hosts, providers and downloaded release builds are outside the frozen implementation evidence (boundary, Source register). Independent checks accepted the bounded reports and memory classifications without outstanding blockers or declared additional limits (report verification, profile verification).
The ordinary native file-tool route illustrates the boundary of preservation. An MCP call selects a path, optional lines and output cap. sqz reads with process filesystem authority, decodes bytes with UTF-8 replacement, then compresses the selected body through its lossless file-tool path. The header is separate. A fresh body, reference or eligible delta can be returned. Consequently, the retained “original” is the selected decoded body, not necessarily the whole file or its original bytes. Host approval remains an external responsibility; compression is not a filesystem sandbox (RT-RTE-file-read).
Other native inputs follow different paths. Automatic stdin CLI calls probe caches and command-specific formatters before the generic engine; positional text or explicit modes take the engine directly. The engine risk-routes content, applies configured stages, checks selected preservation features and can recompute with safer settings. That is a consequential fallback policy, not semantic equivalence: checks sample strings/features, and safe recomputation need not pass every check before return. Command-formatter output and final CLI abbreviation are outside that engine candidate check. Explicit Aggressive mode still reaches ordinary compression; its name does not establish a risk-router bypass (RT-RTE-cli-compress, RT-RTE-engine-compress, EPI-RTE-preservation-check, EPI-RTE-fallback-select).
Retain representations without proving context residence
The native cache separates raw original BLOBs, serialized compressed representations and symbolic access metadata in SQLite. Later calls can use hash identity, line containment or similarity to select a reference or delta. Explicit expansion retrieves an original when present, with a compressed-only alternative for entries lacking it. Recall is a different operation: lexical FTS/BM25 search returns snippets and locators, after which a caller can request expansion. Index exclusions and caps mean that recoverable material need not be searchable (MEM-OBJ-cache-original, MEM-OBJ-cache-compressed, RT-RTE-cache-recovery, MEM-RTE-recall-search).
Reference eligibility estimates residence through timestamps, compaction markers and pins; it does not inspect the model window. Pins bypass ordinary freshness checks rather than injecting a body. Persistent known-file rows can cause an “[in context]” annotation without checking host residence. Dependency pre-caching makes the distinction especially concrete: the CLI can retain imported files before any established delivery of those files to a model. The delta baseline path compares against compressed data without the exact-reference freshness check. Neither cache membership nor a uniform freshness guarantee can therefore stand in for actual consumer knowledge (MEM-OBJ-known-files, MEM-BAP-reference-policy, MEM-RTE-dependency-precache, MEM-OBJ-cache-compressed).
Retention controls are similarly route-specific. CLI --no-cache disables probes, not all later stores or dependency tracking. The wrapper's never-store policy has a length gate, and lower-level cache/pin-add admission does not inherit its veto. PreCompact marks references stale; compact reports hypothetical evictions and can mark compaction, but neither removes host messages. Ordinary reset does not erase sessions, known files or regret logs; lower-level reset and LRU also have stated scope limits. These are mechanisms for selective maintenance, not complete privacy withdrawal or a hard storage ceiling (RT-RTE-cli-compress, RT-RTE-cache-recovery, MEM-RTE-cache-maintenance).
Mediate tool work, then return control
The representative multi-step workflow is the stdio MCP proxy. The caller supplies an upstream command; sqz spawns it, appends protocol guidance and can shorten tool descriptions while retaining full documentation in process memory for explicit help requests. Request IDs associate calls with replies. Ordinary tool work goes upstream; successful eligible text items pass size, risk and savings gates before replacement. Errors and non-text items are not compressed. This is subprocess mediation, not delegation to an isolated model worker or a reduction of upstream OS authority (RT-RTE-mcp-proxy, workflow account).
sqz delivers by writing and flushing the response to host stdout. A caught rewrite panic returns the original upstream line, but does not undo cache/statistics effects already incurred. Storage can also precede rejection of a proposed replacement. A later help or expand request is answered locally; missing retained content yields an error rather than automatic upstream re-execution. Proxy expansion decodes original bytes into text with replacement, so storage-level byte recovery does not imply arbitrary-byte fidelity over this text channel. The host/model must notice missing information, request it and decide what to do next. Successful task completion and durable delivery acknowledgment are not established by that return boundary (workflow delivery and recovery, RT-RTE-cache-recovery).
Restore selected session material, not an established complete trace
Session continuity is a separate path. CTX import admits typed caller-supplied sessions and can replace an existing same-ID entry; structural parsing does not authenticate assertions. Resume selects an explicit or latest session, projects its summary, five recent clipped turns, facts and correction pairs, then prints a category/budget-limited guide. The installed compact SessionStart hook invokes resume, providing an automatic guide route to host stdout. External injection and model compliance remain unobserved. Latest selection is not project-scoped, and synthetic dashboard rows may fail typed session loading (MEM-OBJ-session, MEM-RTE-session-continuity, EPI-RTE-ctx-import).
The alternative library snapshot builder selects events under a byte budget and exposes checkpoint persistence/load operations. CLI resume instead projects session data directly: it does not restore that checkpoint, and PreCompact is not a demonstrated checkpoint writer. Ordinary compression's initial full-session acquisition remains unresolved. Retained source-turn pointers and edit context can also disappear from the guide. The supported result is conditional continuity from valid retained sessions, not an automatic complete capture-to-checkpoint-to-restoration loop or preserved rationale for every assertion (MEM-OBJ-snapshot, EPI-RTE-resume-guide).
Keep alternate context controls and evaluation separate
Browser compression uses a separate WASM engine followed, when needed, by JavaScript fallback. Pending text can be adopted on submission without a separate acceptance click. Memoized compressed strings and extension-local statistics do not supply native original expansion. IDE bridges have separate line-based fallbacks; source comparison identifies an incompatible JetBrains CLI argument shape, not an observed installed failure. HTTP “proxy” transformation returns a body to its caller rather than forwarding to a model provider; older eligible text retains first/last lines, with no established reload route for the omitted middle. Native checks cannot be transferred across these implementations (RT-CMP-wasm-engine, RT-RTE-browser-compress, runtime alternatives, RT-RTE-request-transform).
In a repeated-read or large-tool-output scenario, the source supports reduced representations plus explicit recovery when originals survive. After compaction, on never-delivered dependencies, or when task-critical conditions lie in omitted text, the unresolved consumer context becomes decisive. References are text locators, not pointers automatically followed inside attention. Lazy tool help retains a reloadable full description, whereas HTTP shortening and browser/IDE fallbacks need not retain equivalent originals. Auxiliary library stores and context filters establish additional capabilities, not unspecified live agent consumers (MEM-CMP-library-stores, MEM-CMP-context-controls, RT-RTE-mcp-proxy).
The strongest supported trace-fed contribution is automatic tool-result compression into durable derived context used by later baseline/recovery consumers. The accepted memory assessment treats that as wired trace learning, separately from improved capacity or weight training. Full-session extraction and automatic production-policy adaptation remain unresolved; raw regret logging and separate in-memory recommendations do not close those chains (profile verification, MEM-OBJ-cache-compressed, MEM-OBJ-operation-metadata). The accepted runtime does not establish theory-builder conditions 1–4 as a completed pathway. Localized installed guidance and configuration are present, but their presence does not establish content-dependent theory consumption, content-directed criticism or criticism retained into another round. Improved future capacity from criticism of a consumed theory is not established. Reflection, autonomous theory building and self-improvement are independently unestablished, not inferred absent from missing runs or opaque processing. Retained guidance, parser admission and heuristic fallback alone establish none of those properties (RT-BAP-host-guidance, RT-RTE-preset-reload, epistemic conclusion).
The shipped quality evaluator checks authored fact strings, bounded verbatim comparisons, byte recovery and aggregate reduction, with assertions able to fail the suite. Its expected references are fixture oracles, not production task-answer oracles. Reported complete fact recall remains attributed, and neither substring retention nor recoverability proves correct interpretation or task success. The selected routes acquire and reshape content without establishing its source truth or accepting a new explanatory claim (EPI-RTE-fixture-check, EPI-RTE-regression-gate, EPI-CLM-fact-recall, RT-CLM-recoverable-results).
The assessment would change with host-linked traces showing precisely what was retained, delivered, expanded and used; model-task comparisons separating compression routes and recovery effects; a traced ordinary session producer and checkpoint consumer; or enforcement changes covering final outputs and all admission alternatives. Those would answer different questions: operation, benefit, continuity completeness and guarantee coverage respectively. No new frozen-source reads were used for this synthesis.
Limitations
| Limitation | Affected SRC IDs and record citations | Inspected boundary | Conclusion prevented | Evidence that would resolve it |
|---|---|---|---|---|
| No supplied execution or causal comparison | SRC-1; RT-RTE-mcp-proxy, EPI-CLM-fact-recall | Frozen source and attributed results; external host/model operation unobserved | Installed reliability, actual billing savings, model activation or causal task benefit | Host/model-linked execution artifacts and controlled task comparisons at named routes |
| Preservation checks and recovery have narrower scope than product-wide guarantees | SRC-1; RT-RTE-file-read, RT-RTE-cli-compress, EPI-RTE-preservation-check, RT-RTE-cache-recovery | Prepared file bodies, native candidates, formatter/postprocessing alternatives and captured originals | Universal semantic preservation, whole-file byte identity or byte-exact delivery through every channel | Route-complete final-output checks, explicit capture/encoding contracts and recovery evidence for each channel |
| Residency is heuristic; delta selection has distinct gates | SRC-1; MEM-OBJ-known-files, MEM-RTE-dependency-precache, MEM-OBJ-cache-compressed | Timestamp/pin/marker/path policy, predictive admission and compressed delta baselines | Cached-means-seen, live window membership or uniformly fresh delta bases | Host-window/delivery tracking and traced baseline availability/reconstruction after compaction |
| Session production and checkpoint restoration remain partly disconnected | SRC-1; MEM-OBJ-session, MEM-OBJ-snapshot, MEM-RTE-session-continuity | Import, dashboard, typed resume, installed hook and library checkpoints | Complete automatic trace capture/restoration, project-correct latest resume or guaranteed rationale delivery | Traced ordinary full-session acquisition, valid selection and checkpoint-to-consumer wiring with delivered guide contents |
| Admission and withdrawal controls differ by route/store | SRC-1; RT-RTE-cli-compress, MEM-RTE-cache-maintenance | CLI probes/stores, wrapper risk guards, pin add, reset and LRU | Blanket no-write/no-secret-storage, full deletion or hard disk-size ceiling | Complete write/deletion inventory and enforced controls covering originals, metadata and alternative stores |
| Alternate implementations and auxiliary callers are not fully resolved | SRC-1; RT-RTE-browser-compress, MEM-CMP-library-stores, MEM-CMP-context-controls | Separate browser/IDE/HTTP paths and exposed APIs; not every adapter, transform body or bundled binary inspected | Native-guarantee parity, exhaustive selection semantics, deployed consumer or source-to-binary equivalence | Relevant caller traces, remaining material implementation inspection and reproducible binary correspondence |
| Trace-fed context retention does not settle broader learning properties | SRC-1; MEM-OBJ-cache-compressed, MEM-OBJ-operation-metadata, RT-BAP-host-guidance | Wired tool-result retention; unresolved session origins, adaptive consumers and criticism pathways | Complete learning inventory, improved capacity from criticism, reflection, autonomous theory building or exercised self-improvement | Property-specific records tracing theory decisions/criticism, retained updates, later authority and exercised dependence; independent outcome evidence for benefit |