feat(core,tools): goal lifecycle and TACO output compression#3591
Merged
feat(core,tools): goal lifecycle and TACO output compression#3591
Conversation
6882164 to
bf83705
Compare
015b761 to
5fa297b
Compare
…3306) Adds two long-horizon agent features: **Goal lifecycle** (`/goal` command): - `GoalStore` (SQLite + Postgres) with transactional `create()` that atomically pauses any active goal; partial unique index enforces at-most-one-active invariant - `GoalStatus` FSM: active → paused/completed/cleared, paused → active/cleared - `GoalAccounting` caches active goal in-memory; dispatches `record_turn` as a fire-and-forget background task tracked in the supervisor JoinSet - Active goal text injected into system prompt after `<!-- cache:volatile -->` (G3) with XML escaping and `</active_goal>` injection guard (H1) - `/goal create|pause|resume|complete|clear|status|list` registered in all channels - TUI status badge (▶/⏸/✓/✗) in status panel - Config section `[goals]` with `enabled`, `max_text_chars`, `default_token_budget` - SQLite migration `081_goal_lifecycle.sql`, Postgres `076_goal_lifecycle.sql` - Config migrations `migrate_goals_config` (step 41) **TACO output compression** (`OutputCompressor` + `CompressedExecutor`): - `OutputCompressor` async trait with `IdentityCompressor` (zero-cost no-op) - `RuleBasedCompressor`: regex rules from `compression_rules` table, hit counts in `DashMap<String, AtomicU64>`, rules in `parking_lot::RwLock<Vec<CompiledRule>>` - `safe_compile`: `spawn_blocking` + `tokio::time::timeout` + `RegexBuilder` size limits + `AtomicUsize` concurrency cap (max 4 concurrent compiles, H2) - `CompressedExecutor<E>` decorator: audit log sees raw output, LLM gets compressed - Self-evolution hook in `maybe_autodream` generates candidate rules via LLM - Config section `[tools.compression]` with `enabled`, `min_lines_to_compress`, `evolution_provider`, `regex_compile_timeout_ms` - SQLite migration `082_compression_rules.sql`, Postgres `077_compression_rules.sql` - Config migrations `migrate_tools_compression_config` (step 42) Closes #3567, #3306
5fa297b to
8c6cc2c
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
/goalcommand, closes research(core): Codex /goal — persisted long-horizon goal lifecycle with pause/resume/clear controls #3567): persistent long-horizon objective tracking across agent turns.GoalStore(SQLite + Postgres) with transactionalcreate(),GoalStatusFSM (active/paused/completed/cleared),GoalAccountingbackground bookkeeping, active goal injected into system prompt after the volatile cache marker with XML escaping,/goal create|pause|resume|complete|clear|status|listregistered in all channels (CLI, TUI, Telegram), TUI status badge.OutputCompressortrait +RuleBasedCompressor(regex rules from DB) +CompressedExecutor<E>decorator (audit sees raw, LLM sees compressed).safe_compilewith spawn_blocking + timeout + size limits + concurrent-task cap. Self-evolution hook inmaybe_autodream.Key invariants enforced
create()<active_goal>injected after<!-- cache:volatile -->(snapshot-tested)</active_goal>literal rejected at store levelAtomicUsizeTest plan
cargo nextest run --workspace --lib --bins— 8785 passed, 21 skippedcargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleanGoalStatusFSM (5),GoalStoretransitions (4),GoalAccounting(6),CompressedExecutor(3),RuleBasedCompressor(3),safe_compile(2), G3 snapshot test, T4 audit invariant, H1 injection guard.local/testing/playbooks/goal-taco.md.local/testing/coverage-status.md(both features markedUntested)Migrations
081_goal_lifecycle.sql,082_compression_rules.sql076_goal_lifecycle.sql,077_compression_rules.sqlmigrate_goals_config) + 42 (migrate_tools_compression_config)