fix: lock private jsonl appends#323
Merged
Merged
Conversation
|
cfee448 to
8e9e3fd
Compare
8e9e3fd to
a0f96c0
Compare
This was referenced Jul 8, 2026
Merged
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
rows_malformed, first line/error)Root cause
Live TraceDecay logs showed malformed JSONL in multiple
hook_analytics.jsonlfiles and onedashboard/automation_runs.jsonl. Both append paths relied on append mode/write_all without an advisory lock, so split writes from concurrent processes/tasks could interleave and corrupt rows. Separately,tracedecay_contextmemory enrichment called a project-store opener that requires write access, causing read-only MCP serving to renderMemory Matchesunavailable.Live log scan
/home/zack/.tracedecay/hook_analytics.jsonl: 1 malformed row, first line 256/home/zack/.tracedecay/projects/proj_b4a8bbe4953823c4/hook_analytics.jsonl: 0 malformed rows/home/zack/.tracedecay/**/*.jsonl: 5 files with malformed rows, all hook analytics or automation run ledger filesValidation
cargo fmt --all -- --checktracedecay_diagnosticsworkspace: 0 diagnosticsgit diff --checkcargo test storage::tests::append_line_keeps_concurrent_jsonl_writes_intactcargo test context_memory_matches_use_project_store_when_serving_branch_dbcargo test hook_analytics_sources_report_malformed_jsonl_rowscargo test run_ledgercargo test --lib