deepstrike 0.2.78__tar.gz → 0.2.80__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {deepstrike-0.2.78 → deepstrike-0.2.80}/Cargo.lock +14 -6
- {deepstrike-0.2.78 → deepstrike-0.2.80}/Cargo.toml +3 -3
- {deepstrike-0.2.78 → deepstrike-0.2.80}/PKG-INFO +1 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/compression.rs +94 -112
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/item.rs +168 -11
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/manager.rs +720 -39
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/partitions.rs +302 -50
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/renderer.rs +37 -10
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/renewal.rs +10 -5
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/mm/handle.rs +23 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/observation.rs +6 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/checkpoint.rs +36 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/crash_point.rs +8 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/continuation.rs +31 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/effects.rs +6 -2
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/events.rs +14 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/projection.rs +36 -10
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/provider.rs +21 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/tests.rs +216 -24
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver.rs +53 -9
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/effect.rs +42 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/session.rs +5 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/mod.rs +27 -10
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/tests.rs +23 -22
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-py/src/lib.rs +8 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/__init__.py +16 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/base.py +6 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/_session_event_registry.py +1 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/canonical_kernel_step.py +33 -0
- deepstrike-0.2.80/deepstrike/runtime/dynamic_workflow.py +279 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/kernel_event_log.py +3 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/kernel_step.py +6 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/runner.py +166 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/session_log.py +12 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/sub_agent_orchestrator.py +4 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/types/content.py +1 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/pyproject.toml +1 -1
- {deepstrike-0.2.78 → deepstrike-0.2.80}/LICENSE +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/README.md +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/Cargo.toml +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/LICENSE +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/benches/kernel_baseline.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/benches/wait_index_baseline.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/benchmark/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/config.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/fault.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/measurement.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/policy.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/pressure.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/skill_catalog.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/summarizer.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/task_state.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/text.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/token_engine.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/units.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/context/utility.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/constraint.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/permission.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/pipeline.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/quota.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/rate_limit.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/repeat_fuse.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/governance/veto.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/harness/eval.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/harness/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/lexical.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/lib.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/memory/curator.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/memory/durable.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/memory/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/mm/memory.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/mm/memory_candidate.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/mm/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/mm/value.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/orchestration/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/orchestration/task_graph.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/orchestration/workflow/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/orchestration/workflow/run.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/proc/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/projection_pairs.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/event_log.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/binding.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/command.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/config.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/planning.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/driver/syscall.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/envelope.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/event.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/fault.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/memory_authority.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/projection.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/record.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/restore.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/root.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/scalar.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/syscall.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/terminal.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/tests.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire/transaction.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel/wire.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/kernel.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/repair.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/replay.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/session_registry_tests.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/runtime/session_wire.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/budget_grant.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/cross_operation.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/entropy.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/mailbox.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/milestone.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/policy.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/rollback.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/runnable.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/cancellation.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/capability.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/eviction.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/gate.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/milestone_exec.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/process.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/signal.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/state_machine/workflow.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/tcb.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/scheduler/wait_index.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/signals/attention.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/signals/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/signals/queue.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/signals/router.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/syscall/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/agent.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/capability.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/contract.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/durable_content.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/error.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/message.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/milestone.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/mod.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/policy.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/result.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/signal.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/skill.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-core/src/types/task.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-py/Cargo.toml +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-py/LICENSE +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-tokenizer/Cargo.toml +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-tokenizer/LICENSE +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/crates/deepstrike-tokenizer/src/lib.rs +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/agent.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/collaboration/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/collaboration/contract.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/collaboration/handoff.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/collaboration/harness.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/collaboration/modes.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/collaboration/pool.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/governance.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/harness/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/harness/harness.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/harness/judge.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/kernel/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/kernel/canonical.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/knowledge/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/knowledge/source.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/agent.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/attestation.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/authority.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/candidate_sink.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/durable.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/durable_candidate_sink.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/durable_lifecycle_store.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/in_memory_store.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/lifecycle.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/protocols.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/ranking.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/recall_projection.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/retention.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/runtime_policy.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/working.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/memory/writer.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/anthropic.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/anthropic_adapter.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/anthropic_compaction.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/anthropic_compatible.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/capability_router.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/credentials.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/embedding.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/factories.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/fallback.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/gemini.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/gemini_adapter.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/model_catalog.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/model_registry.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/ollama.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/ollama_adapter.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/openai.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/openai_chat_adapter.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/openai_responses.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/prepared_request.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/protocol_adapter.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/protocols.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/provider_error.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/qwen.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/replay.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/replay_validator.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/request_plan.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/runtime_registry.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/stop_reason.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/stream.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/usage.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/providers/vendor_profiles.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/agent_declaration.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/archive.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/context_policy.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/credential_vault.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/durable_content.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/eval.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/eval_dataset.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/event_stream.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/execution_evidence.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/execution_plane.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/facade.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/filtered_plane.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/kernel_journal.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/loop_driver.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/mcp_proxy_plane.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/os_profile.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/os_snapshot.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/output_schema.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/payload_store.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/process_sandbox_plane.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/provider_replay.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/reaction_checkpoint.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/reactive_session.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/reliability.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/remote_vpc_plane.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/replay_fixture.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/replay_provider.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/replay_sanitize.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/run_group.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/session_repair.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/tool_arguments.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/turn_policy.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/workflow_replay.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/workflow_store.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/runtime/worktree_plane.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/safety/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/safety/permissions.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/signals/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/signals/gateway.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/signals/scheduled.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/signals/types.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/skills/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/skills/loader.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/skills/registry.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/skills/watcher.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/tools/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/tools/builtin/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/tools/builtin/read_file.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/tools/errors.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/tools/execution.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/tools/registry.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/types/__init__.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/types/agent.py +0 -0
- {deepstrike-0.2.78 → deepstrike-0.2.80}/deepstrike/types/content_policy.py +0 -0
|
@@ -293,7 +293,7 @@ dependencies = [
|
|
|
293
293
|
|
|
294
294
|
[[package]]
|
|
295
295
|
name = "deepstrike-core"
|
|
296
|
-
version = "0.2.
|
|
296
|
+
version = "0.2.80"
|
|
297
297
|
dependencies = [
|
|
298
298
|
"compact_str",
|
|
299
299
|
"deepstrike-tokenizer",
|
|
@@ -305,9 +305,17 @@ dependencies = [
|
|
|
305
305
|
"uuid",
|
|
306
306
|
]
|
|
307
307
|
|
|
308
|
+
[[package]]
|
|
309
|
+
name = "deepstrike-lab"
|
|
310
|
+
version = "0.2.80"
|
|
311
|
+
dependencies = [
|
|
312
|
+
"serde",
|
|
313
|
+
"serde_json",
|
|
314
|
+
]
|
|
315
|
+
|
|
308
316
|
[[package]]
|
|
309
317
|
name = "deepstrike-node"
|
|
310
|
-
version = "0.2.
|
|
318
|
+
version = "0.2.80"
|
|
311
319
|
dependencies = [
|
|
312
320
|
"compact_str",
|
|
313
321
|
"deepstrike-core",
|
|
@@ -319,7 +327,7 @@ dependencies = [
|
|
|
319
327
|
|
|
320
328
|
[[package]]
|
|
321
329
|
name = "deepstrike-py"
|
|
322
|
-
version = "0.2.
|
|
330
|
+
version = "0.2.80"
|
|
323
331
|
dependencies = [
|
|
324
332
|
"compact_str",
|
|
325
333
|
"deepstrike-core",
|
|
@@ -330,7 +338,7 @@ dependencies = [
|
|
|
330
338
|
|
|
331
339
|
[[package]]
|
|
332
340
|
name = "deepstrike-sdk"
|
|
333
|
-
version = "0.2.
|
|
341
|
+
version = "0.2.80"
|
|
334
342
|
dependencies = [
|
|
335
343
|
"async-stream",
|
|
336
344
|
"async-trait",
|
|
@@ -368,7 +376,7 @@ dependencies = [
|
|
|
368
376
|
|
|
369
377
|
[[package]]
|
|
370
378
|
name = "deepstrike-tokenizer"
|
|
371
|
-
version = "0.2.
|
|
379
|
+
version = "0.2.80"
|
|
372
380
|
dependencies = [
|
|
373
381
|
"pretty_assertions",
|
|
374
382
|
"tiktoken-rs",
|
|
@@ -376,7 +384,7 @@ dependencies = [
|
|
|
376
384
|
|
|
377
385
|
[[package]]
|
|
378
386
|
name = "deepstrike-wasm"
|
|
379
|
-
version = "0.2.
|
|
387
|
+
version = "0.2.80"
|
|
380
388
|
dependencies = [
|
|
381
389
|
"compact_str",
|
|
382
390
|
"deepstrike-core",
|
|
@@ -3,13 +3,13 @@ resolver = "2"
|
|
|
3
3
|
members = ["crates/deepstrike-core", "crates/deepstrike-tokenizer", "crates/deepstrike-py"]
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
|
-
version = "0.2.
|
|
6
|
+
version = "0.2.80"
|
|
7
7
|
edition = "2024"
|
|
8
8
|
repository = "https://github.com/kongusen/deepstrike"
|
|
9
9
|
|
|
10
10
|
[workspace.dependencies]
|
|
11
|
-
deepstrike-core = { path = "crates/deepstrike-core", version = "0.2.
|
|
12
|
-
deepstrike-tokenizer = { path = "crates/deepstrike-tokenizer", version = "0.2.
|
|
11
|
+
deepstrike-core = { path = "crates/deepstrike-core", version = "0.2.80" }
|
|
12
|
+
deepstrike-tokenizer = { path = "crates/deepstrike-tokenizer", version = "0.2.80" }
|
|
13
13
|
notify = "6"
|
|
14
14
|
serde = { version = "1", features = ["derive"] }
|
|
15
15
|
serde_json = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use super::config::ContextConfig;
|
|
2
2
|
use super::measurement::TokenMeasurement;
|
|
3
|
-
use super::partitions::ContextPartitions;
|
|
3
|
+
use super::partitions::{ContextPartitions, PartitionRow};
|
|
4
4
|
use super::pressure::PressureAction;
|
|
5
5
|
use super::token_engine::ContextTokenEngine;
|
|
6
6
|
use super::units::{strict_tool_pairing_is_valid, unit_boundaries};
|
|
@@ -14,10 +14,8 @@ pub struct CompressResult {
|
|
|
14
14
|
pub tokens_saved: u32,
|
|
15
15
|
/// Generated summary text if any.
|
|
16
16
|
pub summary: Option<String>,
|
|
17
|
-
///
|
|
18
|
-
pub archived: Vec<
|
|
19
|
-
/// Host measurements aligned with `archived`; kept separate from canonical messages.
|
|
20
|
-
pub archived_measurements: Vec<TokenMeasurement>,
|
|
17
|
+
/// Items drained/archived from history, with their identities.
|
|
18
|
+
pub archived: Vec<PartitionRow>,
|
|
21
19
|
/// Cache-aware (W1-1 step 2 / DoD #4): the earliest history-message index this op rewrote or
|
|
22
20
|
/// removed — i.e. where it invalidates the prompt-cache prefix. `None` = prefix-safe (touched
|
|
23
21
|
/// nothing). The pipeline folds the minimum across stages and surfaces it on the observation.
|
|
@@ -58,19 +56,18 @@ impl Compressor for SnipCompactor {
|
|
|
58
56
|
// — exists only when `len < preserve_k*3`. Below that threshold, disable protection so a
|
|
59
57
|
// forced/413 compaction can always cap the oldest messages and free space; above it, the
|
|
60
58
|
// prefix is droppable as a fallback, so we protect it (cache-aware).
|
|
61
|
-
let prefix_keep = prefix_keep_for(partition.
|
|
59
|
+
let prefix_keep = prefix_keep_for(partition.len(), preserve_k);
|
|
62
60
|
let indices = oversized_text_message_indices(
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
partition.messages(),
|
|
62
|
+
partition.measurements(),
|
|
65
63
|
per_msg_limit,
|
|
66
64
|
prefix_keep,
|
|
67
65
|
engine,
|
|
68
66
|
);
|
|
69
67
|
|
|
70
68
|
for &i in &indices {
|
|
71
|
-
let
|
|
72
|
-
let msg = &
|
|
73
|
-
let original_tokens = measured;
|
|
69
|
+
let original_tokens = partition.measured_tokens(i, engine);
|
|
70
|
+
let msg = &partition.messages()[i];
|
|
74
71
|
let head_limit = per_msg_limit / 2;
|
|
75
72
|
let tail_limit = per_msg_limit.saturating_sub(head_limit);
|
|
76
73
|
// Same head/tail elision as excerpt_text; the omitted count comes from the recorded
|
|
@@ -87,14 +84,12 @@ impl Compressor for SnipCompactor {
|
|
|
87
84
|
None
|
|
88
85
|
};
|
|
89
86
|
if let Some(text) = snipped {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
saved +=
|
|
87
|
+
let mut excerpt = msg.clone();
|
|
88
|
+
excerpt.content = Content::Text(text);
|
|
89
|
+
saved += partition.excerpt(i, excerpt, per_msg_limit, engine);
|
|
93
90
|
}
|
|
94
91
|
}
|
|
95
92
|
|
|
96
|
-
partition.token_count = partition.token_count.saturating_sub(saved);
|
|
97
|
-
|
|
98
93
|
// Pure executor: snip caps oversized messages in place; it never archives or summarizes.
|
|
99
94
|
// Summary + compression-log attribution is the pipeline's job (under the *requested* action).
|
|
100
95
|
CompressResult {
|
|
@@ -318,23 +313,21 @@ impl Compressor for MicroCompactor {
|
|
|
318
313
|
|
|
319
314
|
// Selection lifted to a pure helper (excludes `preserved_refs` + the cache-prefix when it has
|
|
320
315
|
// a drop-fallback); the executor only applies the excerpt to the chosen tool-result messages.
|
|
321
|
-
let prefix_keep = prefix_keep_for(partitions.history.
|
|
316
|
+
let prefix_keep = prefix_keep_for(partitions.history.len(), preserve_k);
|
|
322
317
|
let indices = excerptable_tool_result_indices(
|
|
323
|
-
|
|
324
|
-
|
|
318
|
+
partitions.history.messages(),
|
|
319
|
+
partitions.history.measurements(),
|
|
325
320
|
&partitions.task_state.preserved_refs,
|
|
326
321
|
prefix_keep,
|
|
327
322
|
engine,
|
|
328
323
|
);
|
|
329
|
-
let messages_clone = partitions.history.messages.
|
|
324
|
+
let messages_clone = partitions.history.messages().to_vec();
|
|
330
325
|
let preserved_refs = partitions.task_state.preserved_refs.clone();
|
|
331
326
|
let partition = &mut partitions.history;
|
|
332
327
|
let mut saved = 0u32;
|
|
333
328
|
|
|
334
329
|
for &i in &indices {
|
|
335
|
-
let
|
|
336
|
-
let msg = &mut partition.messages[i];
|
|
337
|
-
let original_tokens = measured;
|
|
330
|
+
let mut msg = partition.messages()[i].clone();
|
|
338
331
|
if let Content::Parts(ref mut parts) = msg.content {
|
|
339
332
|
for part in parts.iter_mut() {
|
|
340
333
|
if let ContentPart::ToolResult {
|
|
@@ -383,14 +376,11 @@ impl Compressor for MicroCompactor {
|
|
|
383
376
|
*durable_content = None;
|
|
384
377
|
}
|
|
385
378
|
}
|
|
386
|
-
let new_tokens = engine.count_message(msg);
|
|
387
|
-
partition.
|
|
388
|
-
saved += original_tokens.saturating_sub(new_tokens);
|
|
379
|
+
let new_tokens = engine.count_message(&msg);
|
|
380
|
+
saved += partition.excerpt(i, msg, new_tokens, engine);
|
|
389
381
|
}
|
|
390
382
|
}
|
|
391
383
|
|
|
392
|
-
partition.token_count = partition.token_count.saturating_sub(saved);
|
|
393
|
-
|
|
394
384
|
// Pure executor: excerpts tool results in place; no archive, summary, or self-log.
|
|
395
385
|
CompressResult {
|
|
396
386
|
tokens_saved: saved,
|
|
@@ -445,12 +435,12 @@ impl Compressor for CollapseCompactor {
|
|
|
445
435
|
) -> CompressResult {
|
|
446
436
|
let non_history_tokens = partitions
|
|
447
437
|
.total_tokens(engine)
|
|
448
|
-
.saturating_sub(partitions.history.token_count);
|
|
438
|
+
.saturating_sub(partitions.history.token_count());
|
|
449
439
|
let history_target = target_tokens.saturating_sub(non_history_tokens);
|
|
450
440
|
let plan = super::utility::plan_utility_archive_with_measurements(
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
partitions.history.token_count,
|
|
441
|
+
partitions.history.messages(),
|
|
442
|
+
partitions.history.measurements(),
|
|
443
|
+
partitions.history.token_count(),
|
|
454
444
|
history_target,
|
|
455
445
|
preserve_k,
|
|
456
446
|
engine,
|
|
@@ -465,15 +455,13 @@ impl Compressor for CollapseCompactor {
|
|
|
465
455
|
return CompressResult::default();
|
|
466
456
|
}
|
|
467
457
|
let prefix_invalidated_at = plan.archived_ranges.iter().map(|range| range.start).min();
|
|
468
|
-
let (archived,
|
|
469
|
-
apply_utility_plan(&mut partitions.history, &plan, engine);
|
|
458
|
+
let (archived, saved) = apply_utility_plan(&mut partitions.history, &plan);
|
|
470
459
|
|
|
471
460
|
// Pure executor: return the drained messages; the pipeline summarizes + logs once under the
|
|
472
461
|
// requested action. Removing an interior unit invalidates from its original start index.
|
|
473
462
|
CompressResult {
|
|
474
463
|
tokens_saved: saved,
|
|
475
464
|
archived,
|
|
476
|
-
archived_measurements,
|
|
477
465
|
prefix_invalidated_at,
|
|
478
466
|
..Default::default()
|
|
479
467
|
}
|
|
@@ -492,17 +480,17 @@ impl Compressor for AutoCompactor {
|
|
|
492
480
|
preserve_k: usize,
|
|
493
481
|
engine: &ContextTokenEngine,
|
|
494
482
|
) -> CompressResult {
|
|
495
|
-
if partitions.history.
|
|
483
|
+
if partitions.history.is_empty() {
|
|
496
484
|
return CompressResult::default();
|
|
497
485
|
}
|
|
498
486
|
let non_history_tokens = partitions
|
|
499
487
|
.total_tokens(engine)
|
|
500
|
-
.saturating_sub(partitions.history.token_count);
|
|
488
|
+
.saturating_sub(partitions.history.token_count());
|
|
501
489
|
let history_target = target_tokens.saturating_sub(non_history_tokens);
|
|
502
490
|
let plan = super::utility::plan_utility_archive_with_measurements(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
partitions.history.token_count,
|
|
491
|
+
partitions.history.messages(),
|
|
492
|
+
partitions.history.measurements(),
|
|
493
|
+
partitions.history.token_count(),
|
|
506
494
|
history_target,
|
|
507
495
|
preserve_k,
|
|
508
496
|
engine,
|
|
@@ -517,15 +505,13 @@ impl Compressor for AutoCompactor {
|
|
|
517
505
|
return CompressResult::default();
|
|
518
506
|
}
|
|
519
507
|
let prefix_invalidated_at = plan.archived_ranges.iter().map(|range| range.start).min();
|
|
520
|
-
let (archived,
|
|
521
|
-
apply_utility_plan(&mut partitions.history, &plan, engine);
|
|
508
|
+
let (archived, saved) = apply_utility_plan(&mut partitions.history, &plan);
|
|
522
509
|
|
|
523
510
|
// Pure executor: return the drained messages; the pipeline summarizes + logs once under the
|
|
524
511
|
// requested action.
|
|
525
512
|
CompressResult {
|
|
526
513
|
tokens_saved: saved,
|
|
527
514
|
archived,
|
|
528
|
-
archived_measurements,
|
|
529
515
|
prefix_invalidated_at,
|
|
530
516
|
..Default::default()
|
|
531
517
|
}
|
|
@@ -535,57 +521,19 @@ impl Compressor for AutoCompactor {
|
|
|
535
521
|
fn apply_utility_plan(
|
|
536
522
|
partition: &mut super::partitions::Partition,
|
|
537
523
|
plan: &super::utility::UtilityArchivePlan,
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
while partition.measurements.len() < partition.messages.len() {
|
|
541
|
-
let index = partition.measurements.len();
|
|
542
|
-
let message = &partition.messages[index];
|
|
543
|
-
let tokens = engine.count_message(message);
|
|
544
|
-
partition
|
|
545
|
-
.measurements
|
|
546
|
-
.push(super::measurement::TokenMeasurement::for_message(
|
|
547
|
-
message, tokens,
|
|
548
|
-
));
|
|
549
|
-
}
|
|
550
|
-
partition.align_items();
|
|
551
|
-
let pairing_was_valid = strict_tool_pairing_is_valid(&partition.messages);
|
|
524
|
+
) -> (Vec<PartitionRow>, u32) {
|
|
525
|
+
let pairing_was_valid = strict_tool_pairing_is_valid(partition.messages());
|
|
552
526
|
let archived_indices = plan
|
|
553
527
|
.archived_ranges
|
|
554
528
|
.iter()
|
|
555
529
|
.flat_map(|range| range.clone())
|
|
556
530
|
.collect::<std::collections::BTreeSet<_>>();
|
|
557
|
-
let
|
|
558
|
-
let mut archived_measurements = Vec::new();
|
|
559
|
-
let mut retained = Vec::new();
|
|
560
|
-
let old_messages = std::mem::take(&mut partition.messages);
|
|
561
|
-
let old_measurements = std::mem::take(&mut partition.measurements);
|
|
562
|
-
let old_items = std::mem::take(&mut partition.items);
|
|
563
|
-
let mut retained_measurements = Vec::new();
|
|
564
|
-
let mut retained_items = Vec::new();
|
|
565
|
-
for (index, ((message, measurement), tag)) in old_messages
|
|
566
|
-
.into_iter()
|
|
567
|
-
.zip(old_measurements.into_iter())
|
|
568
|
-
.zip(old_items.into_iter())
|
|
569
|
-
.enumerate()
|
|
570
|
-
{
|
|
571
|
-
if archived_indices.contains(&index) {
|
|
572
|
-
archived.push(message);
|
|
573
|
-
archived_measurements.push(measurement);
|
|
574
|
-
} else {
|
|
575
|
-
retained.push(message);
|
|
576
|
-
retained_measurements.push(measurement);
|
|
577
|
-
retained_items.push(tag);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
partition.messages = retained;
|
|
581
|
-
partition.measurements = retained_measurements;
|
|
582
|
-
partition.items = retained_items;
|
|
583
|
-
partition.token_count = plan.retained_tokens;
|
|
531
|
+
let archived = partition.take_rows(&archived_indices, plan.retained_tokens);
|
|
584
532
|
debug_assert!(
|
|
585
|
-
!pairing_was_valid || strict_tool_pairing_is_valid(
|
|
533
|
+
!pairing_was_valid || strict_tool_pairing_is_valid(partition.messages()),
|
|
586
534
|
"utility selection split a valid tool transaction"
|
|
587
535
|
);
|
|
588
|
-
(archived,
|
|
536
|
+
(archived, plan.archived_tokens)
|
|
589
537
|
}
|
|
590
538
|
|
|
591
539
|
/// Compression pipeline — operates on history partition but can reference full partitions.
|
|
@@ -619,14 +567,13 @@ impl CompressionPipeline {
|
|
|
619
567
|
max_tokens: u32,
|
|
620
568
|
target_tokens: u32,
|
|
621
569
|
engine: &ContextTokenEngine,
|
|
622
|
-
) -> (u32, Option<String>, Vec<
|
|
570
|
+
) -> (u32, Option<String>, Vec<PartitionRow>, Option<usize>) {
|
|
623
571
|
if action == PressureAction::None {
|
|
624
572
|
return (0, None, vec![], None);
|
|
625
573
|
}
|
|
626
574
|
|
|
627
575
|
let mut total_saved = 0;
|
|
628
|
-
let mut all_archived = vec![];
|
|
629
|
-
let mut all_archived_measurements = vec![];
|
|
576
|
+
let mut all_archived: Vec<PartitionRow> = vec![];
|
|
630
577
|
// Cache cost of the whole compaction = the earliest prefix-break across the stages that ran
|
|
631
578
|
// (an earlier break dominates). `None` = entirely prefix-safe.
|
|
632
579
|
let mut cache_at: Option<usize> = None;
|
|
@@ -650,7 +597,6 @@ impl CompressionPipeline {
|
|
|
650
597
|
.flatten()
|
|
651
598
|
.min();
|
|
652
599
|
all_archived.extend(res.archived);
|
|
653
|
-
all_archived_measurements.extend(res.archived_measurements);
|
|
654
600
|
}
|
|
655
601
|
}
|
|
656
602
|
|
|
@@ -673,9 +619,13 @@ impl CompressionPipeline {
|
|
|
673
619
|
let summary = if all_archived.is_empty() {
|
|
674
620
|
None
|
|
675
621
|
} else {
|
|
622
|
+
let (messages, measurements): (Vec<_>, Vec<_>) = all_archived
|
|
623
|
+
.iter()
|
|
624
|
+
.map(|row| (row.message.clone(), row.measurement.clone()))
|
|
625
|
+
.unzip();
|
|
676
626
|
let s = summarizer.summarize(
|
|
677
|
-
&
|
|
678
|
-
&
|
|
627
|
+
&messages,
|
|
628
|
+
&measurements,
|
|
679
629
|
action,
|
|
680
630
|
summary_budget,
|
|
681
631
|
);
|
|
@@ -719,7 +669,7 @@ mod tests {
|
|
|
719
669
|
// preserve_k=0: exercise the truncation transform directly (no cache-prefix protection).
|
|
720
670
|
let result = compactor.compress(&mut ctx, 0, MAX, 0, &engine());
|
|
721
671
|
assert!(result.tokens_saved > 0);
|
|
722
|
-
if let Content::Text(ref t) = ctx.history.messages[0].content {
|
|
672
|
+
if let Content::Text(ref t) = ctx.history.messages()[0].content {
|
|
723
673
|
assert!(t.contains("… [… 100 tokens omitted …] …"), "got: {t}");
|
|
724
674
|
}
|
|
725
675
|
}
|
|
@@ -757,13 +707,12 @@ mod tests {
|
|
|
757
707
|
content: Content::Parts(parts),
|
|
758
708
|
tool_calls: vec![],
|
|
759
709
|
};
|
|
760
|
-
ctx.history.
|
|
761
|
-
ctx.history.token_count = 300;
|
|
710
|
+
ctx.history.push(msg, 300);
|
|
762
711
|
|
|
763
712
|
// preserve_k=0: exercise the excerpt transform directly (no cache-prefix protection).
|
|
764
713
|
let result = compactor.compress(&mut ctx, 0, MAX, 0, &engine());
|
|
765
714
|
assert!(result.tokens_saved > 0);
|
|
766
|
-
let Content::Parts(parts) = &ctx.history.messages[0].content else {
|
|
715
|
+
let Content::Parts(parts) = &ctx.history.messages()[0].content else {
|
|
767
716
|
panic!("tool-result envelope must survive compaction");
|
|
768
717
|
};
|
|
769
718
|
let text = parts
|
|
@@ -813,9 +762,9 @@ mod tests {
|
|
|
813
762
|
|
|
814
763
|
compactor.compress(&mut ctx, 0, MAX, 0, &engine());
|
|
815
764
|
|
|
816
|
-
let message = &ctx.history.messages[0];
|
|
765
|
+
let message = &ctx.history.messages()[0];
|
|
817
766
|
let recounted = engine().count_message(message);
|
|
818
|
-
assert_eq!(ctx.history.token_count, recounted);
|
|
767
|
+
assert_eq!(ctx.history.token_count(), recounted);
|
|
819
768
|
let Content::Parts(parts) = &message.content else {
|
|
820
769
|
panic!("parts preserved")
|
|
821
770
|
};
|
|
@@ -838,7 +787,7 @@ mod tests {
|
|
|
838
787
|
}
|
|
839
788
|
let result = compactor.compress(&mut ctx, 250, MAX, 2, &engine());
|
|
840
789
|
assert!(result.tokens_saved > 0);
|
|
841
|
-
assert!(ctx.history.
|
|
790
|
+
assert!(ctx.history.len() < 8);
|
|
842
791
|
// Pure executor: returns the drained messages; summary + log attribution is the pipeline's
|
|
843
792
|
// job (under the requested action), so the compactor itself no longer summarizes or logs.
|
|
844
793
|
assert!(
|
|
@@ -855,6 +804,40 @@ mod tests {
|
|
|
855
804
|
);
|
|
856
805
|
}
|
|
857
806
|
|
|
807
|
+
#[test]
|
|
808
|
+
fn compaction_acts_on_items_and_keeps_their_identity() {
|
|
809
|
+
use crate::context::item::{Fidelity, ItemOrigin, ItemTag};
|
|
810
|
+
|
|
811
|
+
let mut ctx = ContextPartitions::new(&config());
|
|
812
|
+
for id in 1..=8u64 {
|
|
813
|
+
let text = if id == 8 { "long ".repeat(400) } else { "msg".into() };
|
|
814
|
+
let tag = ItemTag::new(id, ItemOrigin::User, 0);
|
|
815
|
+
ctx.history.push_tagged(CoreMessage::user(text), 50, tag);
|
|
816
|
+
}
|
|
817
|
+
ctx.history.push_tagged(
|
|
818
|
+
CoreMessage::user("long ".repeat(400)),
|
|
819
|
+
500,
|
|
820
|
+
ItemTag::new(9, ItemOrigin::User, 0),
|
|
821
|
+
);
|
|
822
|
+
|
|
823
|
+
// An in-place excerpt keeps the item and records what it now renders.
|
|
824
|
+
SnipCompactor { per_msg_ratio: 0.001 }.compress(&mut ctx, 0, 100_000, 0, &engine());
|
|
825
|
+
let snipped = ctx.history.tags().iter().find(|tag| tag.id == 9).unwrap();
|
|
826
|
+
assert_eq!(snipped.fidelity, Fidelity::Excerpt);
|
|
827
|
+
assert!(ctx.history.tags().iter().filter(|tag| tag.id < 8).all(|tag| tag.fidelity == Fidelity::Full));
|
|
828
|
+
|
|
829
|
+
// Archiving takes whole rows out: the archived ids and the retained ids partition the table.
|
|
830
|
+
let result = CollapseCompactor.compress(&mut ctx, 250, MAX, 2, &engine());
|
|
831
|
+
let archived: Vec<_> = result.archived.iter().map(|row| row.tag.id).collect();
|
|
832
|
+
let retained: Vec<_> = ctx.history.tags().iter().map(|tag| tag.id).collect();
|
|
833
|
+
assert!(!archived.is_empty());
|
|
834
|
+
let mut all = [archived.clone(), retained.clone()].concat();
|
|
835
|
+
all.sort();
|
|
836
|
+
assert_eq!(all, (1..=9).collect::<Vec<_>>());
|
|
837
|
+
assert_eq!(ctx.history.tags().len(), ctx.history.len());
|
|
838
|
+
assert_eq!(ctx.history.measurements().len(), ctx.history.len());
|
|
839
|
+
}
|
|
840
|
+
|
|
858
841
|
#[test]
|
|
859
842
|
fn collapse_utility_selection_changes_the_archived_units_not_only_the_score() {
|
|
860
843
|
let compactor = CollapseCompactor;
|
|
@@ -876,7 +859,7 @@ mod tests {
|
|
|
876
859
|
let result = compactor.compress(&mut ctx, 160, MAX, 1, &engine());
|
|
877
860
|
let retained = ctx
|
|
878
861
|
.history
|
|
879
|
-
.messages
|
|
862
|
+
.messages()
|
|
880
863
|
.iter()
|
|
881
864
|
.filter_map(|message| message.content.as_text())
|
|
882
865
|
.collect::<Vec<_>>()
|
|
@@ -884,7 +867,7 @@ mod tests {
|
|
|
884
867
|
let archived = result
|
|
885
868
|
.archived
|
|
886
869
|
.iter()
|
|
887
|
-
.filter_map(|
|
|
870
|
+
.filter_map(|row| row.message.content.as_text())
|
|
888
871
|
.collect::<Vec<_>>()
|
|
889
872
|
.join("\n");
|
|
890
873
|
assert!(retained.contains("ORCHID"));
|
|
@@ -892,7 +875,7 @@ mod tests {
|
|
|
892
875
|
assert!(!retained.contains("routine chatter"));
|
|
893
876
|
assert!(archived.contains("routine chatter one"));
|
|
894
877
|
assert!(archived.contains("routine chatter two"));
|
|
895
|
-
assert_eq!(ctx.history.token_count, 160);
|
|
878
|
+
assert_eq!(ctx.history.token_count(), 160);
|
|
896
879
|
}
|
|
897
880
|
|
|
898
881
|
#[test]
|
|
@@ -907,7 +890,7 @@ mod tests {
|
|
|
907
890
|
|
|
908
891
|
let result = compactor.compress(&mut ctx, 700, MAX, 1, &engine());
|
|
909
892
|
assert_eq!(result.tokens_saved, 300);
|
|
910
|
-
assert_eq!(ctx.history.token_count, 100);
|
|
893
|
+
assert_eq!(ctx.history.token_count(), 100);
|
|
911
894
|
assert!(ctx.total_tokens(&engine()) <= 700);
|
|
912
895
|
}
|
|
913
896
|
|
|
@@ -958,13 +941,12 @@ mod tests {
|
|
|
958
941
|
content: Content::Parts(parts),
|
|
959
942
|
tool_calls: vec![],
|
|
960
943
|
};
|
|
961
|
-
ctx.history.
|
|
962
|
-
ctx.history.token_count = 300;
|
|
944
|
+
ctx.history.push(msg, 300);
|
|
963
945
|
|
|
964
946
|
let result = compactor.compress(&mut ctx, 0, MAX, 2, &engine());
|
|
965
947
|
// Since call_id "keep_me" is in preserved_refs, it should not be replaced!
|
|
966
948
|
assert_eq!(result.tokens_saved, 0);
|
|
967
|
-
let text_opt = ctx.history.messages[0].content.as_text();
|
|
949
|
+
let text_opt = ctx.history.messages()[0].content.as_text();
|
|
968
950
|
assert!(
|
|
969
951
|
text_opt.is_none(),
|
|
970
952
|
"should not be replaced to text placeholder"
|
|
@@ -980,7 +962,7 @@ mod tests {
|
|
|
980
962
|
}
|
|
981
963
|
let result = compactor.compress(&mut ctx, 0, MAX, 2, &engine());
|
|
982
964
|
assert!(result.tokens_saved > 0);
|
|
983
|
-
assert_eq!(ctx.history.
|
|
965
|
+
assert_eq!(ctx.history.len(), 2); // kept last 2 semantic units
|
|
984
966
|
// Pure executor: returns the drained messages; the pipeline summarizes + logs under the
|
|
985
967
|
// requested action (see `baseline_auto_*` / `pipeline_attributes_summary_to_requested_action`).
|
|
986
968
|
assert!(
|
|
@@ -1066,8 +1048,8 @@ mod tests {
|
|
|
1066
1048
|
|
|
1067
1049
|
compactor.compress(&mut ctx, 0, MAX, 1, &engine());
|
|
1068
1050
|
|
|
1069
|
-
assert_eq!(ctx.history.
|
|
1070
|
-
assert_eq!(ctx.history.messages[0].content.as_text(), Some("question"));
|
|
1051
|
+
assert_eq!(ctx.history.len(), 4);
|
|
1052
|
+
assert_eq!(ctx.history.messages()[0].content.as_text(), Some("question"));
|
|
1071
1053
|
}
|
|
1072
1054
|
|
|
1073
1055
|
#[test]
|
|
@@ -1185,7 +1167,7 @@ mod tests {
|
|
|
1185
1167
|
let (saved, summary, archived, _cache_at) =
|
|
1186
1168
|
CompressionPipeline::new(&cfg).compress(&mut ctx, action, MAX, 500, &engine());
|
|
1187
1169
|
let archived_len = archived.len();
|
|
1188
|
-
let msgs_after = ctx.history.
|
|
1170
|
+
let msgs_after = ctx.history.len();
|
|
1189
1171
|
let total_after = ctx.total_tokens(&engine());
|
|
1190
1172
|
(
|
|
1191
1173
|
before,
|
|
@@ -1301,7 +1283,7 @@ mod tests {
|
|
|
1301
1283
|
archived.is_empty(),
|
|
1302
1284
|
"heavier archival stages should not run"
|
|
1303
1285
|
);
|
|
1304
|
-
assert_eq!(ctx.history.
|
|
1286
|
+
assert_eq!(ctx.history.len(), 1);
|
|
1305
1287
|
assert!(ctx.total_tokens(&engine()) <= 500);
|
|
1306
1288
|
}
|
|
1307
1289
|
|
|
@@ -1429,7 +1411,7 @@ mod tests {
|
|
|
1429
1411
|
}
|
|
1430
1412
|
pipeline.compress(&mut ctx, action, MAX, target, &eng);
|
|
1431
1413
|
assert!(
|
|
1432
|
-
strict_tool_pairing_is_valid(
|
|
1414
|
+
strict_tool_pairing_is_valid(ctx.history.messages()),
|
|
1433
1415
|
"compression {action:?} target {target} broke pairing (seed {seed})"
|
|
1434
1416
|
);
|
|
1435
1417
|
|