feat(context): integrate TypedPage compaction into assembler pipeline#3638
Merged
feat(context): integrate TypedPage compaction into assembler pipeline#3638
Conversation
Wire crates/zeph-context/src/typed_page.rs into the context summarization pipeline. Previously the module was fully tested in isolation but had no integration points and was dead code in production. Changes: - zeph-config: add TypedPagesConfig under [memory.compression.typed_pages] with enabled/enforcement/audit_sink/flush_timeout_ms fields; disabled by default - zeph-context: add BatchViolation, BatchAssertions, TypedPagesState; fix CompactionAuditSink::flush() with oneshot rendezvous + 100ms timeout cap; fix panic on audit_channel_capacity=0 (capacity.max(1)); fix UTF-8 boundary panic in body truncation (char-boundary-safe loop) - zeph-agent-context: add typed_pages field to ContextSummarizationView; wire classify step (2.5), SystemContext pointer-replace in active mode (3.5), BatchAssertions check (5.5), and audit emit (7.5) into compact_context(); skip LLM call when entire batch is pointer-replaced SystemContext stubs - zeph-core: add typed_pages_state to CompressionState and CompactionAdapters; expose with_typed_pages_state() builder method - src/runner.rs: add build_typed_pages_state() async init; wire into builder chain The feature is zero-cost when disabled. Two regression tests added: audit_sink_capacity_zero_does_not_panic and classify_with_role_non_ascii_body_does_not_panic. Closes #3630
68471c6 to
caf893f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
typed_page.rs(previously dead code) into the context summarization pipeline via a config-gated feature ([memory.compression.typed_pages], disabled by default)BatchAssertions(aggregate tool-coverage check) replacing the impractical per-page invariantschannel(0)and UTF-8 byte-index slice on non-ASCII contentCompactionAuditSink::flush()to use a oneshot-rendezvous with a 100ms timeout instead ofyield_now()Test plan
cargo +nightly fmt --check— cleancargo clippy --workspace --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings— 0 warningscargo nextest run --config-file .github/nextest.toml --workspace --lib --bins— 8899 passedaudit_sink_capacity_zero_does_not_panicclassify_with_role_non_ascii_body_does_not_panic[memory.compression.typed_pages] enabled = trueto exercise audit sink and batch assertionsCloses #3630