Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
29 changes: 25 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,33 @@ TRACEDECAY_DISABLE_GLOBAL_DB = { value = "1", force = false }
# in-process. Installed binaries run outside cargo and are unaffected, but the
# profile does apply to `cargo run` — use the installed binary (or set
# TRACEDECAY_DATA_DIR yourself) for real `daemon install-service` runs.
# Enforced by tests/test_profile_isolation_test.rs.
# Enforced by crates/tracedecay-cli/tests/core_cli_suite/test_profile_isolation_test.rs.
TRACEDECAY_DATA_DIR = { value = "target/test-profile/.tracedecay", force = false, relative = true }

# Cheaper Linux debuginfo handling, scoped to the gnu triples so Windows
# (MSVC supports only packed split-debuginfo) and macOS (already defaults to
# unpacked) keep their platform defaults. `split-debuginfo=unpacked` leaves
# debuginfo in the object files instead of linking it into every binary; it
# is linker-agnostic and a no-op for profiles that build without debuginfo.
# Deliberately no linker flags here: rustc already links
# x86_64-unknown-linux-gnu with its bundled rust-lld, CI symlinks ld -> mold
# (see .github/actions/setup-linux-mold; `-fuse-ld=mold` needs GCC >= 12),
# and driver-only flags such as `-B` would land on the raw linker command
# line — and fail — for anyone who sets `target.<triple>.linker` or
# CARGO_TARGET_<TRIPLE>_LINKER to a linker executable directly. Developers
# who want mold locally opt in through their own linker config or RUSTFLAGS
# (a user-set RUSTFLAGS env var replaces these flags entirely).
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "split-debuginfo=unpacked"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "split-debuginfo=unpacked"]

[alias]
# Local default for the full Rust test suite. Requires cargo-nextest:
# https://nexte.st/docs/installation/pre-built-binaries/
test-all = "nextest run --workspace --no-fail-fast"
test-ci = "nextest run --workspace --no-fail-fast"
dogfood = "run --quiet --release --bin tracedecay -- dogfood"
# The perf cargo profile keeps the critical-path kernels (code index, graph,
# sha2, …) optimized for the generation-scale suites in the full run; see
# [profile.perf] in the root Cargo.toml.
test-all = "nextest run --workspace --all-features --no-fail-fast --cargo-profile perf"
test-ci = "nextest run --workspace --all-features --no-fail-fast --cargo-profile perf"
5 changes: 0 additions & 5 deletions .changeset/derived-branch-corruption-recovery.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/hermes-projectless-routing.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/personal-codex-plugin.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/runtime-routing-ci-hardening.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/session-catchup-hook-trust.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/session-worktree-discovery.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/user-message-search-scope.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/v2-foundation-crates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tracedecay": patch
---

Land the stacked V2 foundation: ten workspace crates (api, application, host-integration, hooks, policy, private-fs, rusqlite-runtime, store, temporal-query, tool-catalog) and the V2 domain contracts, with protobuf node kinds now unconditional graph vocabulary. Hook spool roots are refused unless private to the current owner (and gain a private ACL on Windows), and Windows lock contention in the hook admission ledger and storage sidecar locks is typed as busy/contended instead of surfacing as I/O errors.
5 changes: 0 additions & 5 deletions .changeset/windows-lifecycle-handoff.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/worktree-store-resolution.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"files": {
"SKILL.md": "sha256:ce428b37c4067c28a8bfa803e31e5647f023aa6996be5997e065b6e9d75c1ebb"
"SKILL.md": "sha256:72250a902f26620d2bb6c5aea1a1ae198aba382f061ae365d58cea71416d3d78"
},
"managed_by": "tracedecay-automation",
"package_hash": "sha256:070f5045d0af6f415c30166b75ecc0b3f4b2c9aaf61a23eaf8bb42a6900a390e",
"package_hash": "sha256:62c256a24e756b8b9270ed092477e24daa7d80aa721328de3d7749b8c232aa9d",
"skill_id": "automation-run-review"
}
21 changes: 18 additions & 3 deletions .claude/skills/automation-run-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
---
name: automation-run-review
description: "Use when Review self-improvement automation runs and activation policy."
description: "Use when reviewing self-improvement automation run status, validation evidence, automatic skill activation, or memory-curation outcomes."
managed-by: tracedecay-automation
skill-id: "automation-run-review"
content-hash: sha256:070f5045d0af6f415c30166b75ecc0b3f4b2c9aaf61a23eaf8bb42a6900a390e
content-hash: sha256:62c256a24e756b8b9270ed092477e24daa7d80aa721328de3d7749b8c232aa9d
skill-version: 1783629450
---

Check the run ledger, activation policy, and approval state before applying changes.
# Automation run review

Review automation without mutating it:

1. Use `tracedecay_automation_run_list` to find the exact run id.
2. Use `tracedecay_automation_run_view` to inspect terminal status, counts,
validation report, effects, and advertised artifact kinds.
3. Use `tracedecay_automation_run_artifact_view` only for an artifact kind
advertised by that run; verify the returned hash-backed payload against the
terminal record.
4. For skill-writer runs, verify automatic validation, activation, and
materialization against `tracedecay_skill_list` and
`tracedecay_skill_view`. For memory-curator runs, verify committed effects
with read-only fact queries.
5. Report failures after committed effects as reconciliation work. Never rerun
blindly or manufacture a manual settlement step.
52 changes: 0 additions & 52 deletions .claude/skills/dogfooding-tracedecay/SKILL.md

This file was deleted.

4 changes: 2 additions & 2 deletions .claude/skills/evaluating-hook-hints/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Use this skill for TraceDecay repo development only. These are repo-local dev in

## Workflow

1. Start with TraceDecay context for `src/hooks/tool_hints.rs`, `src/hooks/tool_hints/classifiers.rs`, `src/hooks/tool_hints/evals.rs`, host adapters in `src/hooks/{codex,claude,cursor}.rs`, and recent transcript evidence.
1. Start with TraceDecay context for `src/hooks/tool_hints.rs`, `src/hooks/tool_hints/classifiers.rs`, the `src/hooks/tool_hints/evals/` module (`mod.rs` plus `host_cases.rs`), host adapters in `src/hooks/{codex,claude,cursor}.rs`, and recent transcript evidence.
2. Render model-visible hook input when judging verbosity:
`scripts/render-codex-hook-inputs.py --glob '/home/zack/.codex/sessions/**/*.jsonl' --all --limit 5 --max-chars 800`.
3. Run deterministic evals before behavior edits:
Expand All @@ -22,7 +22,7 @@ Use this skill for TraceDecay repo development only. These are repo-local dev in
## Acceptance Rules

- Hints should be contextual and short; avoid generic TraceDecay availability boilerplate.
- Real-world transcript cases and synthetic cases should both be represented in `src/hooks/tool_hints/evals.rs`.
- Real-world transcript cases and synthetic cases should both be represented in `src/hooks/tool_hints/evals/` (`host_cases.rs` holds the per-host scenarios). The module is `#[cfg(test)]`, so it only compiles under a test profile.
- A normal user prompt should not be wrapped into a noisy `UserPromptSubmit hook (completed)` model-visible user message.
- No hint is a valid outcome when the request does not need TraceDecay guidance.
- Repeated native behavior should get at most one initial hint plus one later escalation per category, bounded by the session budget.
Expand Down
49 changes: 31 additions & 18 deletions .claude/skills/inspecting-automation-cycles/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: inspecting-automation-cycles
description: 'TraceDecay Dev: Use when auditing TraceDecay automation loops, skipped runs, memory-curator/session-reflector/skill-writer output, apply policy, or run artifacts.'
description: 'TraceDecay Dev: Use when auditing TraceDecay automation loops, skipped runs, memory-curator/session-reflector/skill-writer output, terminal receipts, or run artifacts.'
---

# TraceDecay Dev: Inspecting Automation Cycles
Expand All @@ -12,16 +12,28 @@ analytics prove whether generated output was adopted.
## Workflow

1. Start with `tracedecay automation config get` to identify enabled tasks,
schedules, locks, profile paths, and apply policy.
2. List recent runs with `tracedecay automation runs list --limit 100`; group
schedules, locks, and profile paths.
2. When the operator requests an immediate memory-curation cycle, use the sole
public semantic launcher, `fact_store_curate`, through its MCP adapter
`tracedecay_fact_store_curate`, generic CLI adapter `tracedecay tool
fact_store_curate`, or HTTP adapter `POST
/api/application/retained/fact_store_curate`. Its request accepts only the
optional `fact_review_limit` and `min_confidence_millionths` bounds. Each
adapter invokes the same daemon-owned operation; the daemon derives run
identity, task selection, operations, validation, policy, and effect
settlement.
3. List recent runs with `tracedecay automation runs list --limit 100`; group
by task and status before opening individual artifacts.
3. For failures or suspicious skips, open the relevant artifact with
`tracedecay_automation_run_artifact_view` or
`tracedecay tool automation_run_artifact_view --args ...`.
4. Inspect model-managed memory outcomes plus configured managed-skill review
queues: `tracedecay automation facts list`, dashboard telemetry, and
`tracedecay_skill_list --state pending`.
5. Check adoption evidence: `tracedecay analytics diagnostics --all --no-sync`,
4. Inspect one exact run with `tracedecay automation runs view <run_id>`.
Read its verified artifacts with
`tracedecay automation runs artifact <run_id> <kind> --json`,
`GET /api/automation/runs/<run_id>/artifacts/<kind>`, or the read-only MCP
tool `tracedecay_automation_run_artifact_view`. MCP automation analytics
summarizes run history; exact MCP run list/view is not currently exposed.
5. Inspect terminal memory outcomes plus active managed-skill adoption:
`tracedecay automation facts list`, dashboard telemetry, and
`tracedecay_skill_list --state active`.
6. Check adoption evidence: `tracedecay analytics diagnostics --all --no-sync`,
`tracedecay sessions search "mcp__tracedecay" --provider all`, and managed
skill usage counts.

Expand All @@ -32,15 +44,16 @@ analytics prove whether generated output was adopted.
| `scheduler_interval_not_elapsed` | Healthy throttling | Count only, do not fix. |
| `scheduler_lock_active` | Another run owns the loop | Check age before calling stale. |
| `no_new_session_activity` | Nothing new to process | Verify transcript ingest if surprising. |
| `validation_gate` artifact | Mutation passed validation | Inspect apply-policy state or dashboard artifact. |
| Many fact proposal records | Inspect validation/apply telemetry | Use `tracedecay:project-memory`. |
| `validation_gate` artifact | Mutation passed validation | Inspect terminal automatic application/deployment receipts. |
| Many automatic fact receipts | Inspect applied/quarantined outcomes and telemetry | Use `tracedecay automation facts list`. |
| Active managed skills with zero use | Adoption telemetry gap | Use `tracedecay:diagnosing-analytics`. |

## Guardrails

- Prefer read-only inspection. Do not mutate fact records.
- Do not approve, reject, delete, or apply managed-skill drafts unless the user
explicitly asked for mutation.
- After any requested run, keep inspection read-only. Do not submit curator
operations or approve, reject, or apply its output.
- Validated memory-curator and skill-writer output settles automatically;
inspect receipts rather than waiting for a manual gate.
- Do not treat skipped runs as failures until grouped by skip reason and age.
- Avoid parallel `tracedecay_skill_view` calls against one profile while
automation may write usage ledgers. If a usage read reports a truncated JSON
Expand All @@ -50,6 +63,6 @@ analytics prove whether generated output was adopted.

## Deliverable

Report task/status counts, the exact run or artifact ids inspected, apply-policy
state, adoption gaps, and the next concrete command for any mutation the user
should choose.
Report the launcher adapter used, task/status counts, exact run or artifact ids,
terminal automatic application/deployment receipts, read-only verification,
and adoption gaps.
14 changes: 8 additions & 6 deletions .claude/skills/introspecting-tracedecay-usage/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ failure mode, then code, tests, or bundled skills encode the fix.
`tracedecay:inspecting-managed-skills`. Start with
`tracedecay_skill_list`; view skills or run artifacts only when the list
points to a specific stale, patched, failed, or unused item.
4. **Durable memory:** Use `tracedecay:project-memory`. Search with
`tracedecay_fact_store` before re-deriving project decisions. For curation,
run read-only inventory and dry-runs first; never remove facts without
explicit approval.
4. **Durable memory:** Use `tracedecay:project-memory`. Recall prior decisions
with `tracedecay_fact_store_search`; record durable decisions and corrections
with `tracedecay_fact_store_add`. Delegate broad curation to
`tracedecay:project-memory` and inspect its automatic validation and
application receipts.
5. **Code-health and implementation target:** Use `tracedecay:code-health`.
Let weak dimensions and hotspots decide whether the fix is code, tests,
docs, evals, or skill guidance.
Expand All @@ -38,8 +39,9 @@ failure mode, then code, tests, or bundled skills encode the fix.
or add a bundled operator skill that prevents the repeated mistake.
- LCM depth and compression ratios are health signals, not direct quality
scores. Use raw/session recall to confirm what agents actually missed.
- Memory curation candidates are proposals, not permission. Prefer merge or
update when provenance matters; deletion needs fresh user approval.
- Memory curation is automation-owned after validation. Inspect validation and
applied operation receipts; use `tracedecay:project-memory` for any direct
operator override.
- Analytics fields can be global. `project_id: null` means the run was global,
not broken.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,39 @@ PY=python3; have "$PY" || PY=python
# --- Resolve store paths from TraceDecay, not from hardcoded locations. -------
SS="$(tracedecay tool storage_status --args '{"format":"json"}' 2>/dev/null || true)"
if [ -z "$SS" ]; then echo "error: could not read 'tracedecay tool storage_status'" >&2; exit 4; fi
read -r SERVING_DB DATA_ROOT PROJECT_ROOT <<EOF
$(printf '%s' "$SS" | "$PY" -c 'import sys,json
d=json.load(sys.stdin); s=d["active_project"]["storage"]
print(s["graph_db_path"], s["data_root"], d["active_project"]["project_root"])')
if ! STORAGE_FIELDS="$(printf '%s' "$SS" | "$PY" -c 'import sys,json
d=json.load(sys.stdin)
store_path=d.get("store_path")
project_id=d.get("project_id")
if not isinstance(store_path, str) or not store_path or not isinstance(project_id, str) or not project_id:
raise SystemExit(1)
print(f"{store_path}\t{project_id}")')"; then
echo "error: storage_status is missing required store_path or project_id" >&2
exit 5
fi
IFS=$'\t' read -r SERVING_DB PROJECT_ID <<EOF
$STORAGE_FIELDS
EOF
if [ ! -f "$SERVING_DB" ]; then
echo "error: serving store does not exist: $SERVING_DB" >&2
exit 6
fi
DATA_ROOT="$(dirname "$SERVING_DB")"
TD_HOME="$(dirname "$(dirname "$DATA_ROOT")")" # .../.tracedecay/projects/<proj> -> .../.tracedecay
GLOBAL_DB="$TD_HOME/global.db"

q() { sqlite3 -noheader -separator ' ' "$1" "$2" 2>/dev/null; }

echo "================================================================"
echo " TraceDecay usage & fact-store adoption — $PROJECT_ROOT"
echo " TraceDecay usage & fact-store adoption — $PROJECT_ID"
echo "================================================================"

# --- 1. MCP tool adoption (per-tool breakdown; the CLI only groups by kind). --
echo
echo "## MCP tool calls (analytics_events)"
if [ -f "$GLOBAL_DB" ]; then
FILTER="event_kind='mcp_tool_call'"
[ "$ALL" -eq 0 ] && FILTER="$FILTER AND project_id='$PROJECT_ROOT'"
[ "$ALL" -eq 0 ] && FILTER="$FILTER AND project_id='$PROJECT_ID'"
SCOPE=$([ "$ALL" -eq 1 ] && echo "ALL PROJECTS" || echo "this project")
echo "scope: $SCOPE"
printf ' %-42s %8s %8s\n' "tool" "calls" "errors"
Expand Down
Loading
Loading