feat(core,a2a): Focus strategy auto-consolidation and MMA2A AgentCard capabilities#3388
Merged
feat(core,a2a): Focus strategy auto-consolidation and MMA2A AgentCard capabilities#3388
Conversation
1f6a95d to
4a167f7
Compare
… capabilities Closes #3313 Closes #3326 Wire the previously-declared CompressionStrategy::Focus variant into the proactive compaction pipeline. When this strategy is active, a background pass identifies the oldest contiguous low-relevance message window (via TF-Jaccard scoring) and extracts key facts into an AutoConsolidated KnowledgeBlock, using the existing focus_scorer_provider. Raw history prior to the window is preserved per memory-pipeline invariant §6. Changes: - FocusConfig.auto_consolidate_min_window (default 6) controls the minimum window size before consolidation fires - run_focus_auto_consolidation in compaction_strategy.rs performs scoring and LLM extraction with a 20s timeout - Focus branch wired in maybe_proactive_compress via run_focus_auto_consolidation_pass helper - CompressionGuard RAII struct ensures AtomicBool release on cancellation, panic, and normal exit - Guard skips consolidation when task_goal is empty (no User message) or when focus_scorer_provider is configured but unresolvable - migrate-config step 31 injects auto_consolidate_min_window via toml_edit into existing [agent.focus] sections - 6 new tests; 1911 unit tests pass Add capability-aware modality advertisement to AgentCard per the MMA2A paper (arXiv:2604.12213). MVP: types and builder only; A2A bootstrap wiring deferred to #3378. Changes: - AgentCapabilities gains images/audio/files bool fields with #[serde(default)] for full backward compatibility - AgentCardBuilder gains .images()/.audio()/.files() fluent helpers - 8 new tests covering serialization, deserialization, and builder
…s in zeph-context
8620f84 to
279d36f
Compare
5 tasks
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
CompressionStrategy::Focusinto the proactive compaction pipeline. When active, the agent identifies the oldest low-relevance message window via TF-Jaccard scoring and extracts key facts into anAutoConsolidatedKnowledgeBlockusingfocus_scorer_provider. AtomicBool guard is now RAII (CompressionGuard) — safe under future cancellation and panic.images/audio/filescapability fields toAgentCardwith full backward-compatible#[serde(default)]and fluent builder helpers. Bootstrap wiring deferred to feat(a2a): wire AgentCard modality capabilities at A2A bootstrap #3378.Changes
zeph-core:
run_focus_auto_consolidation— TF-Jaccard scoring + LLM extraction with 20s timeoutrun_focus_auto_consolidation_pass— Focus branch inmaybe_proactive_compressCompressionGuardRAII struct — releasescompressingAtomicBool on dropfocus_scorer_provideris misconfiguredzeph-config:
FocusConfig.auto_consolidate_min_window(default 6)migrate-configstep 31 viatoml_editzeph-context:
should_proactively_compresshandlesCompressionStrategy::Focuszeph-a2a:
AgentCapabilities.{images,audio,files}fieldsAgentCardBuilder.{images,audio,files}()helpersTest Plan
cargo nextest run -p zeph-config -p zeph-a2a --lib --bins— 409 tests passcargo nextest run -p zeph-core --lib --bins— 1488 tests passcargo nextest run -p zeph-context -E 'test(focus)' --lib— 3 tests passcargo +nightly fmt --check— cleancargo clippy -p zeph-core -p zeph-config -p zeph-context -p zeph-a2a -- -D warnings— clean[memory.compression] strategy = "focus"config — playbook:.local/testing/playbooks/focus-auto-consolidation.md.local/testing/playbooks/mma2a-capabilities.mdFollow-up Issues Filed
score_blocks_migO(K²) tospawn_blockingauto_consolidate_min_windowrejects zeroCloses #3313
Closes #3326