Skip to content

Latest commit

 

History

History
71 lines (42 loc) · 9.13 KB

File metadata and controls

71 lines (42 loc) · 9.13 KB

Sticky context selection

Current implementation: sticky-context-v12. The default judges new arrivals once, above a 50,000-token estimate. It preserves human instructions, assistant notes, complete execution envelopes and signed/opaque content. It never opts a caller into reasoning loss. See configuration and lifecycle limits and real session validation.

The first-forwarded prefix is a contract: cached keep/omit decisions are replayed, including after a human follow-up. Failed, skipped and below-gate spans stay retained. The judge sees the effective retained history, paired completion results for inputs, and a chronological action skeleton. Every request remains within the existing 24 KB guard; oversized evidence retains the candidate. Results retain the calibrated Atomic thresholds, while input/report spans keep their separate experimental loss thresholds.

This protects append-only sessions within the persisted store's lifetime. It is not semantic compaction, a proof that the model uses retained reasoning, or a guarantee of savings. Automatic historical rewriting is disabled. Native client/server compaction remains responsible for context that is already too large. New configuration, store loss/eviction/expiry and client edits require a fresh continuity boundary; see the documented limitations.

Official contracts checked for this change:

  • Preserved thinking: prefix identity, cache-marker exclusions, strict mismatch errors and observable transformations.
  • Context editing: native tool clearing, configurable thresholds and cache invalidation.

Historical snapshot implementation

The following describes the earlier experimental lifecycle, available explicitly with YOSHI_CONTEXT_LIFECYCLE=snapshot. Its measured v11 outcomes do not describe the sticky default. The current snapshot classifier also receives the added chronology and paired-result context, so rerunning it is a new experiment rather than byte-identical v11 reproduction.

Historical implementation: focused-context-v11, 2026-09-17. The main change is many small Jev calls, not larger batches: one historical input/result/report span per request, with up to eight independent calls in flight. Measured operations results and interactive report.

Eligible content and protocol

Content Current behavior
Completed Bash.command, Write.content, Edit.old_string/new_string Complete-line spans targeting at most 1,200 characters, each evaluated separately
Claude teammate reports Recognize both bare XML and the actual Another Claude session sent a message: wrapper; evaluate report spans and preserve surrounding transport text
Tool results One focused call per complete passage, eligible on arrival; signed sibling blocks no longer exclude the whole message
Completed exchanges with short plain results Can be removed atomically, with unique chronological pairing; caller is supported
Historical user/assistant text Existing whole-user-block/prose candidates; one candidate per evaluation
Current human instruction, recent assistant/tool cycle, errors, unsupported metadata Retained
Opaque thinking/signature/media blocks, system and tool schemas Not rewritten by the client-side selector

Input omissions preserve the call ID, tool name, file path, caller, completion result and every unselected field. The changed field is a historical record containing an explicit omission marker, not an executable replacement action. Nothing in the benchmark or proxy executes transformed history. Source-block hashes and exact offsets are rechecked before applying a verdict. Unknown result metadata and mixed-media results remain protected.

A signed block remains byte-identical, but this alone does not preserve Fable 5.1's prefix binding. With adaptive/enabled thinking, conversation mode sends thinking.block_binding.prefix_mismatch_behavior=drop_block and thinking-binding-controls-2026-08-01. The provider can discard invalidated reasoning; input_transformations is recorded separately. An explicit caller error policy, or an unsupported thinking configuration with signed history, disables rewriting. Dry-run forwards originals. This is provider-controlled reasoning loss, not Jev reading or compressing encrypted reasoning. Provider contract.

What Jev sees

For each input/result/report span, one request contains:

  • The current human task and earlier human constraints, deduplicating identical constraint text.
  • The complete candidate span, tool/field identity and compact argument metadata (large sibling values are explicitly identified as omitted from the judge).
  • Up to 1,800 characters of whole concise immutable receipts/notes, ranked against the task. Long code blocks and system/tool catalogs are not piled into this evidence set.
  • Two Boolean questions: whether a required fact/code quote is missing from retained evidence, and whether a binding user constraint would be lost.

Both loss probabilities must be at most 0.2. This is a separate experimental payload operating point, not a 95% confidence claim or inherited calibration from tool-only mode. All other payloads are excluded as coverage, including those in concurrent requests. Missing, invalid, timed-out or failed answers retain their span.

General user/assistant/exchange units keep the two-stage proposal/retained-state check, now with one candidate per call. Proposal threshold remains 0.8 and both preservation thresholds remain 0.95. Kept units can become immutable witnesses only after their decision completes. Fixed evidence is selected under a byte budget; omitted evidence cannot justify coverage. Human task/constraints and candidates are never silently truncated.

Result-only conversations

When there are no eligible historical human blocks, large completed argument fields or teammate reports, the proxy automatically uses focused arrival selection. It retains the earlier calibrated Atomic rule (irrelevant <= 0.2 or covered >= 0.7, with conflict <= 0.2), evaluates one passage per request, allows eight independent calls in flight, and reuses arrival decisions as history grows. It does not repeatedly reconsider already-forwarded uncertain outputs merely because a later call succeeds. Receipts identify this strategy as focused-arrival; mixed conversations use focused-conversation.

This distinction came from a real regression: repeatedly reclassifying old outputs in the first v10 run caused recovery reads and increased accumulated context and cost. That run was stopped after its completed outcomes were saved. It is excluded from the final v11 comparison, with its failure and interruption explicitly recorded. The input/report classifier itself did not change between v9 and v11.

Work budgets and observability

The default remains 128 candidate units, a 24,000-byte final guard and a 45-second conversation evaluation deadline (ten seconds for tools scope). Long histories reserve a few general-text slots and share the remainder across arguments, results, reports and exchanges, preventing an early log from hiding all arguments. An indivisible long line may exceed the 1,200-character target; it is retained if it cannot fit the byte guard. Large prior human constraints can still exceed the guard. Reclassifying skill bodies and compaction summaries as data requires further authority handling; they are not silently dropped.

Measured deadlines, latency and failure outcomes are listed in the consolidated report. No retries are hidden.

Receipts expose context_coverage by kind, jev_request_bytes, completed judgments, applied spans, error codes, actual Gateway cost, provider usage and provider thinking transformations. Candidate eligibility is not a claim of removal. Ordinary logs store metadata, not raw source. Explicit benchmark traces remain private under .yoshi/.

Exact request snapshots reuse the existing cache. Any changed conversation can trigger reclassification and different removals; provider cache writes, latency, Jev input and total cost must be measured separately. No deterministic compaction or deduplication runs in conversation mode.

Current validation

The canonical src/rewrite.test.ts suite covers completed-vs-pending arguments, caller/signature preservation, exact surviving source, necessary-span retention, one-payload-per-call state, real peer wrappers, stale verdicts, circular coverage, dry-run, cache lifecycle and prefix-binding metadata transport. Unit doubles exist only at external model I/O boundaries. Real-model evidence includes the operations comparison, live tool-loop regression and Fable 5.1 signed-thinking smoke run described in results.

Configuration and reproduction remain in README. Historical experiments remain separate from registered reference results.

Older policy outcomes are preserved in the archive.