Add TraceDecay registry, LCM, and transcript audit improvements#142
Conversation
|
Follow-up design: lazy indexing for ignored dependency symbolsUser goal: keep expensive roots such as Current relevant code/docs:
Approaches considered:
Recommended first implementation slice:
Likely target areas:
Open design question:
|
f7390f1 to
476377c
Compare
476377c to
1d61cdb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c5a0ade6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| &self, | ||
| request: SearchFactsRequest, | ||
| ) -> Result<Vec<FactSearchResult>> { | ||
| let db = self.open_project_store_db().await?; |
There was a problem hiding this comment.
Keep context memory lookup read-only
Because tracedecay_context includes memory by default and the tool is advertised as read-only, this lookup should not call open_project_store_db(): that helper rejects TraceDecay::open_read_only instances and otherwise uses Database::open, which applies write PRAGMAs/migrations to the shared graph DB. In read-only MCP/serve contexts this either makes the new memory lane unavailable or mutates a store during a read-only context request; open the project store with a read-only connection for this untracked search.
Useful? React with 👍 / 👎.
| )); | ||
| }; | ||
| let _ = crate::sessions::ingest_global_sources(&db, &target_root).await; | ||
| if catch_up { |
There was a problem hiding this comment.
Open sessions DB read-only when catch_up is false
catch_up=false is documented for read-only audits, but by this point the handler has already called open_session_db_with_cached_ensure, which creates/ensures/migrates the sessions DB before the catch_up guard. In a missing or older session store, a supposedly read-only message search can create or mutate sessions.db even though ingestion is skipped; choose a read-only existing open path when catch_up is false.
Useful? React with 👍 / 👎.
Summary
tracedecay projectsCLI for global registry inspection:tracedecay projects listtracedecay projects search <query>tracedecay projects context <selector>--jsonoutputtracedecay_lcm_statusforprovider: "all"so it aggregates provider data instead of treatingallas a literal provider.catch_up: falsesupport totracedecay_message_searchfor strictly read-only audits of already-ingested transcript messages.tracedecay_lcm_grephash separator queries such asissue#123so Cursor transcript searches do not hit SQLite FTS syntax errors.tracedecay_contextwith bounded untracked project memory matches, includinginclude_memory,memory_limit, andmemory_min_trustcontrols, so fact-store context is visible in the normal code-context path without inflating explicit retrieval/recall counters.Audit basis
This branch came out of a 30-agent read-only audit of local Codex/Cursor/Hermes transcripts, TraceDecay project stores, LCM state, hook analytics, daemon logs, response handles, and global registry state.
Key observed problems:
provider="all"LCM status returned zero even when Codex/Cursor provider-specific counts were populated.tracedecay tool ...or manual store inspection.proj_b4a8bbe4953823c4to/home/zack/projects/tracedecay, while store metadata still references stale TokenSave roots./tmpaliases/project configs and orphan profile-sharded stores remain.analytics_events,savings_ledger, andturnsare empty in the active store, so adherence must be inferred from transcripts.${workspaceFolder}startup failures and an FTS#query failure.node_modulesshould stay ignored by default, but imported dependency symbols/types should be discoverable through lazy/on-demand dependency indexing instead of unignoring whole dependency trees.Tests
cargo fmt --checkcargo check --workspacecargo test --test cli_help_test -- --nocapturecargo test --test cli_non_interactive_test projects_ -- --nocapturecargo test --test mcp_handler_test lcm_status_all_provider_aggregates_provider_counts -- --nocapturecargo test --test mcp_handler_test lcm_status_all_provider_counts_payload_health_once -- --nocapturecargo test --test mcp_handler_test lcm_status_ -- --nocapture --test-threads=1cargo test --test mcp_handler_test message_search_catches_up_provider_transcripts_before_querying -- --nocapturecargo test --test mcp_handler_test message_search_can_skip_catch_up_for_read_only_audits -- --nocapturecargo test --test automation_skill_writer_runner_test -- --nocapturecargo test --test session_lcm_query_test grep_like_fallback_handles_hash_separator_queries -- --nocapturecargo test --test session_lcm_query_test grep_like_fallback_recalls_infix -- --nocapturecargo test --test mcp_handler_test context_ -- --nocapturecargo test --test mcp_handler_test context_memory -- --nocapturecargo test --test memory_test search_facts_bump_access_count_only_for_returned_results -- --nocapturecargo test --workspace --no-runtracedecay syncNote:
cargo test --test mcp_handler_test lcm_status_ -- --nocaptureshowed an existing parallel fixture collision inlcm_status_reports_lifecycle_fields_and_resolved_storage_scope; the same filtered LCM status suite passes with--test-threads=1.Follow-up work
config.jsonvsstore_manifest.jsonidentity drift./tmpprojects, orphan store dirs, branch DB retention, and response handles.analytics_events.skill_nameandanalytics_events.hint_categoryare populated instead of requiring transcript inference.${workspaceFolder}failures, add Cursor summary health checks, and sanitize/fallback LCM FTS queries containing#.node_modules/gitignored roots out of the primary graph while resolving imported symbols on demand.