Stevesolun commited on
Commit
34ebeb1
·
verified ·
1 Parent(s): 6b497c6

Sync ctx c61de90

Browse files

GitHub commit: c61de902e8fdd2a4b2cfa061c5337a2fef078d0a

.github/pull_request_template.md CHANGED
@@ -10,7 +10,7 @@
10
 
11
  - [ ] Existing tests pass (`pytest -q`)
12
  - [ ] New tests added for changed behaviour
13
- - [ ] MkDocs nav or public docs asset changes update `docs/qa/feature-user-story-status.csv`
14
  - [ ] `ruff check src/` passes
15
  - [ ] `mypy src/` passes
16
  - [ ] Integration tests checked if embedding code was touched (`pytest -q -m integration`)
 
10
 
11
  - [ ] Existing tests pass (`pytest -q`)
12
  - [ ] New tests added for changed behaviour
13
+ - [ ] MkDocs nav or public docs asset changes update `docs/qa/feature-user-story-status.csv` and `qa/feature_status.csv`
14
  - [ ] `ruff check src/` passes
15
  - [ ] `mypy src/` passes
16
  - [ ] Integration tests checked if embedding code was touched (`pytest -q -m integration`)
CONTRIBUTING.md CHANGED
@@ -28,12 +28,12 @@ pytest --cov=src -q # with coverage report
28
 
29
  ## Documentation changes
30
 
31
- Public docs surfaces are release-tracked in
 
32
  `docs/qa/feature-user-story-status.csv`. If you add, remove, or move a `.md`
33
  entry under `mkdocs.yml` `nav`, or change linked public assets under
34
  `docs/assets/javascripts/`, `docs/services/`, or `docs/toolbox/templates/`,
35
- update the canonical feature tracker with the exact path in
36
- `entrypoint_or_route` and run:
37
 
38
  ```bash
39
  python -m pytest -q --no-cov \
@@ -59,6 +59,15 @@ ruff format src/
59
  ruff check --fix src/
60
  ```
61
 
 
 
 
 
 
 
 
 
 
62
  ## Commit conventions
63
 
64
  This repo uses [Conventional Commits](https://www.conventionalcommits.org/):
 
28
 
29
  ## Documentation changes
30
 
31
+ Public docs surfaces are release-tracked in the canonical
32
+ `qa/feature_status.csv` tracker, with supporting feature rows in
33
  `docs/qa/feature-user-story-status.csv`. If you add, remove, or move a `.md`
34
  entry under `mkdocs.yml` `nav`, or change linked public assets under
35
  `docs/assets/javascripts/`, `docs/services/`, or `docs/toolbox/templates/`,
36
+ update both tracker rows with the exact path in `entrypoint_or_route` and run:
 
37
 
38
  ```bash
39
  python -m pytest -q --no-cov \
 
59
  ruff check --fix src/
60
  ```
61
 
62
+ ## No-mistakes runner
63
+
64
+ Maintainer no-mistakes agents can use `scripts/no_mistakes_codex_env.sh` as
65
+ the Codex wrapper for this repo. It prepends the verified project Python venv
66
+ when present and owner-only, plus Codex-bundled resources, without installing
67
+ or upgrading system packages. Set `CTX_NO_MISTAKES_PYTHON_BIN` to override the
68
+ Python venv explicitly; `CTX_NO_MISTAKES_CODEX_RESOURCES` and
69
+ `CTX_NO_MISTAKES_REAL_CODEX` override the Codex resource directory or binary.
70
+
71
  ## Commit conventions
72
 
73
  This repo uses [Conventional Commits](https://www.conventionalcommits.org/):
README.md CHANGED
@@ -18,7 +18,7 @@ tags:
18
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
19
  [![Python 3.11+](https://img.shields.io/badge/Python-3.11+-green.svg)](https://python.org)
20
  [![PyPI](https://img.shields.io/pypi/v/claude-ctx.svg)](https://pypi.org/project/claude-ctx/)
21
- [![Tests](https://img.shields.io/badge/Tests-4421_inventory-brightgreen.svg)](https://github.com/stevesolun/ctx/actions/workflows/test.yml)
22
  [![Graph](https://img.shields.io/badge/Graph-79%2C958_nodes_/_1%2C778%2C069_edges-red.svg)](https://stevesolun.github.io/ctx/knowledge-graph/)
23
  [![Skills](https://img.shields.io/badge/Skills-68%2C494-blue.svg)](https://stevesolun.github.io/ctx/catalog/?type=skill)
24
  [![Agents](https://img.shields.io/badge/Agents-467-purple.svg)](https://stevesolun.github.io/ctx/catalog/?type=agent)
@@ -58,16 +58,17 @@ Current shipped snapshot:
58
  ## Example user stories
59
 
60
  The canonical QA tracker is
61
- [`docs/qa/feature-user-story-status.csv`](docs/qa/feature-user-story-status.csv).
62
- The dashboard-specific tracker
 
63
  [`docs/qa/dashboard-user-story-status.csv`](docs/qa/dashboard-user-story-status.csv)
64
- is a supporting detail ledger; canonical status and release readiness stay in the
65
- feature tracker.
66
  Rows for public MkDocs pages use the exact `docs/...md` path from `mkdocs.yml`
67
  as `entrypoint_or_route`. Public linked docs assets under
68
  `docs/assets/javascripts/`, `docs/services/`, and `docs/toolbox/templates/`
69
  are tracker-covered too, so adding, moving, or removing one means adding or
70
- updating the matching feature-tracker row.
71
  Examples from that tracker:
72
 
73
  | Tracker row | User story | Expected ctx behavior |
@@ -135,6 +136,7 @@ ctx-harness-install text-to-cad --dry-run # inspect before cloning/running any
135
  ctx-harness-install text-to-cad # install after reviewing the plan
136
  ctx-harness-install text-to-cad --update --dry-run
137
  ctx-harness-install text-to-cad --uninstall --dry-run
 
138
  python -m ctx.adapters.loopflow --goal "fix checkout e2e" --permissions skills,agents,mcps
139
  ctx-skill-quality list # four-signal quality score for every skill
140
  ctx-skill-quality explain python-patterns # drill into a single skill
 
18
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
19
  [![Python 3.11+](https://img.shields.io/badge/Python-3.11+-green.svg)](https://python.org)
20
  [![PyPI](https://img.shields.io/pypi/v/claude-ctx.svg)](https://pypi.org/project/claude-ctx/)
21
+ [![Tests](https://img.shields.io/badge/Tests-4429_inventory-brightgreen.svg)](https://github.com/stevesolun/ctx/actions/workflows/test.yml)
22
  [![Graph](https://img.shields.io/badge/Graph-79%2C958_nodes_/_1%2C778%2C069_edges-red.svg)](https://stevesolun.github.io/ctx/knowledge-graph/)
23
  [![Skills](https://img.shields.io/badge/Skills-68%2C494-blue.svg)](https://stevesolun.github.io/ctx/catalog/?type=skill)
24
  [![Agents](https://img.shields.io/badge/Agents-467-purple.svg)](https://stevesolun.github.io/ctx/catalog/?type=agent)
 
58
  ## Example user stories
59
 
60
  The canonical QA tracker is
61
+ [`qa/feature_status.csv`](qa/feature_status.csv). The supporting feature ledger
62
+ [`docs/qa/feature-user-story-status.csv`](docs/qa/feature-user-story-status.csv)
63
+ and dashboard-specific ledger
64
  [`docs/qa/dashboard-user-story-status.csv`](docs/qa/dashboard-user-story-status.csv)
65
+ are supporting detail ledgers that feed that root tracker; canonical status and
66
+ release readiness stay in `qa/feature_status.csv`.
67
  Rows for public MkDocs pages use the exact `docs/...md` path from `mkdocs.yml`
68
  as `entrypoint_or_route`. Public linked docs assets under
69
  `docs/assets/javascripts/`, `docs/services/`, and `docs/toolbox/templates/`
70
  are tracker-covered too, so adding, moving, or removing one means adding or
71
+ updating matching rows in the supporting feature ledger and canonical tracker.
72
  Examples from that tracker:
73
 
74
  | Tracker row | User story | Expected ctx behavior |
 
136
  ctx-harness-install text-to-cad # install after reviewing the plan
137
  ctx-harness-install text-to-cad --update --dry-run
138
  ctx-harness-install text-to-cad --uninstall --dry-run
139
+ python -m ctx --help # same run/resume/sessions CLI as the ctx script
140
  python -m ctx.adapters.loopflow --goal "fix checkout e2e" --permissions skills,agents,mcps
141
  ctx-skill-quality list # four-signal quality score for every skill
142
  ctx-skill-quality explain python-patterns # drill into a single skill
docs/harness/attaching-to-hosts.md CHANGED
@@ -214,6 +214,8 @@ ctx run \
214
 
215
  See `ctx run --help` for the full flag set (budgets, compaction,
216
  system prompt overrides, session resume, JSON output, ...).
 
 
217
 
218
  Planning and review modes are opt-in flags on `ctx run`. Use `--planner` to
219
  produce a structured spec before generation, `--evaluator` to grade and revise
 
214
 
215
  See `ctx run --help` for the full flag set (budgets, compaction,
216
  system prompt overrides, session resume, JSON output, ...).
217
+ If the console script is unavailable, use the package entrypoint instead:
218
+ `python -m ctx run ...`.
219
 
220
  Planning and review modes are opt-in flags on `ctx run`. Use `--planner` to
221
  produce a structured spec before generation, `--evaluator` to grade and revise
docs/index.md CHANGED
@@ -31,12 +31,13 @@ with persistent memory that gets smarter every session.
31
  Optional extras: `pip install "claude-ctx[embeddings]"` for the
32
  semantic backend, `pip install "claude-ctx[harness]"` for local/API
33
  model harness runs, `pip install "claude-ctx[dev]"` for the
34
- pytest/mypy/ruff toolchain. After install the `ctx-scan-repo`,
35
  `ctx-skill-quality`, `ctx-skill-health`, and `ctx-toolbox` console
36
- scripts are on PATH. `ctx-init --graph` installs the fast pre-built
37
- runtime graph that powers recommendations and harness dry-runs; source checkouts use
38
- `graph/wiki-graph-runtime.tar.gz`, while pip installs download the
39
- matching GitHub release asset. Use
 
40
  `ctx-init --graph --graph-install-mode full` when you want the full
41
  markdown LLM-wiki expanded locally.
42
 
@@ -59,9 +60,9 @@ with persistent memory that gets smarter every session.
59
  strict MkDocs build. Public docs surfaces are release-tracked: when
60
  `mkdocs.yml` adds, removes, or moves a nav `.md` page, or public linked
61
  assets under `docs/assets/javascripts/`, `docs/services/`, or
62
- `docs/toolbox/templates/` change, update
63
- `docs/qa/feature-user-story-status.csv` with the exact path in
64
- `entrypoint_or_route`.
65
 
66
  ## Why this exists
67
 
@@ -216,7 +217,7 @@ ones are flagged. New ones self-ingest.
216
  ---
217
 
218
  Current main is **v1.0.20** — MIT, CI-matrixed (Ubuntu 3.12 plus Windows/macOS 3.11/3.12),
219
- 4,421 test inventory. Adds enterprise OpenTelemetry-ready telemetry and
220
  ships console scripts including `ctx-init`,
221
  `ctx-monitor` (local dashboard with graph + wiki + load/unload for
222
  skills, agents, and MCP servers, plus Harness Setup for user-owned LLMs),
 
31
  Optional extras: `pip install "claude-ctx[embeddings]"` for the
32
  semantic backend, `pip install "claude-ctx[harness]"` for local/API
33
  model harness runs, `pip install "claude-ctx[dev]"` for the
34
+ pytest/mypy/ruff toolchain. After install the `ctx`, `ctx-scan-repo`,
35
  `ctx-skill-quality`, `ctx-skill-health`, and `ctx-toolbox` console
36
+ scripts are on PATH; `python -m ctx --help` reaches the same
37
+ run/resume/sessions CLI as `ctx`. `ctx-init --graph` installs the fast
38
+ pre-built runtime graph that powers recommendations and harness dry-runs;
39
+ source checkouts use `graph/wiki-graph-runtime.tar.gz`, while pip installs
40
+ download the matching GitHub release asset. Use
41
  `ctx-init --graph --graph-install-mode full` when you want the full
42
  markdown LLM-wiki expanded locally.
43
 
 
60
  strict MkDocs build. Public docs surfaces are release-tracked: when
61
  `mkdocs.yml` adds, removes, or moves a nav `.md` page, or public linked
62
  assets under `docs/assets/javascripts/`, `docs/services/`, or
63
+ `docs/toolbox/templates/` change, update both
64
+ `docs/qa/feature-user-story-status.csv` and the canonical
65
+ `qa/feature_status.csv` with the exact path in `entrypoint_or_route`.
66
 
67
  ## Why this exists
68
 
 
217
  ---
218
 
219
  Current main is **v1.0.20** — MIT, CI-matrixed (Ubuntu 3.12 plus Windows/macOS 3.11/3.12),
220
+ 4,429 test inventory. Adds enterprise OpenTelemetry-ready telemetry and
221
  ships console scripts including `ctx-init`,
222
  `ctx-monitor` (local dashboard with graph + wiki + load/unload for
223
  skills, agents, and MCP servers, plus Harness Setup for user-owned LLMs),
docs/knowledge-graph.md CHANGED
@@ -89,6 +89,12 @@ signal:
89
  1. **Semantic cosine** — when the embedding backend is available, entity
90
  text is embedded and semantic neighbors above the configured build floor
91
  contribute weighted edges.
 
 
 
 
 
 
92
  2. **Explicit frontmatter tags** — each entity page's YAML `tags:`
93
  list contributes edges between every pair of entities that share
94
  a tag. Popular tags capped at 500 nodes to avoid noise-floor
 
89
  1. **Semantic cosine** — when the embedding backend is available, entity
90
  text is embedded and semantic neighbors above the configured build floor
91
  contribute weighted edges.
92
+ The default backend is `sentence-transformers`. Setting
93
+ `intake.embedding.backend` to `ollama` uses
94
+ `intake.embedding.base_url`, then `OLLAMA_URL` when set, then
95
+ `http://localhost:11434`; non-local hosts require
96
+ `intake.embedding.allow_remote: true`, and empty or malformed values fail
97
+ closed.
98
  2. **Explicit frontmatter tags** — each entity page's YAML `tags:`
99
  list contributes edges between every pair of entities that share
100
  a tag. Popular tags capped at 500 nodes to avoid noise-floor
docs/qa/feature-user-story-status.csv CHANGED
@@ -1,5 +1,5 @@
1
  feature_id,surface,feature,entrypoint_or_route,source_evidence,user_story,expected_behavior,setup_preconditions,test_command_or_steps,status,first_test_result,error_id,error_summary,fix_status,retest_result,last_verified_at,notes
2
- CLI-001,CLI,Generic model run harness,ctx,pyproject.toml project.scripts,As a user I can run or resume a model-agnostic ctx session,ctx creates or resumes a session with configured provider tools budgets and transcript ordering intact,Provider credentials or dry-run/local test provider available,ctx --help then focused run/resume smoke,Tested Pass,test_harness_cli_run.py: 67 passed for ctx run/resume/sessions.,,,,,2026-06-23,Validated in focused pytest or isolated temp CLI smoke during A-Z pass.
3
  CLI-002,CLI,Repository recommendation,ctx-recommend,pyproject.toml project.scripts,As a user I can ask ctx for current repo recommendations,ctx returns capped relevant skill agent MCP recommendations from the shared graph engine,Graph installed and target repo available,ctx-recommend --help then sample repo recommendation,Tested Pass,recommend CLI/golden subset: 24 passed for ctx-recommend and shared recommendation surfaces.,,,,,2026-06-23,Validated in focused pytest or isolated temp CLI smoke during A-Z pass.
4
  CLI-003,CLI,Initial setup,ctx-init,pyproject.toml project.scripts,As a new user I can install hooks graph and model mode from one command,ctx-init installs requested pieces idempotently and reports failures with non-zero exit,Writable user config directory,ctx-init --model-mode skip --graph,Retested Pass,"PASS: temp USERPROFILE ctx-init --model-mode skip --knowledge-mode skip created .claude config/toolboxes and exited 0. PASS: temp USERPROFILE ctx-init --graph --graph-install-mode runtime --model-mode skip installed graph.json and harness page in 129.2s.",CTX-AZ-006,Full graph install exceeded the 10-minute Windows smoke budget before packed wiki artifacts: native-tar full install completed in 759.0s and cleanup took 171.7s.,Packed full artifact now ships wiki-packs and omits expanded non-root markdown fanout; ctx-init checksum updated.,PASS: temp USERPROFILE ctx-init --graph --graph-install-mode full --model-mode skip --knowledge-mode skip exited 0 in 409.7s with graph-store.sqlite3 wiki-packs harness pages and no expanded skills/agents/MCP/converted/concepts markdown.,2026-06-23,Runtime path remains usable; full path now installs packed markdown wiki under the smoke budget while keeping harness pages direct.
5
  CLI-004,CLI,Claude hook install,ctx-install-hooks,pyproject.toml project.scripts,As a Claude Code user I can install ctx hooks,Hooks are installed idempotently and point to existing modules,Claude config path writable,ctx-install-hooks --help then temp-home smoke,Tested Pass,inject hooks/ctx-init hook subset: 24 passed for hook install and failure handling.,,,,,2026-06-23,Validated in focused pytest or isolated temp CLI smoke during A-Z pass.
@@ -136,7 +136,7 @@ DIST-007,Distribution,Parallel pytest experiment workflow,.github/workflows/xdis
136
  CICD-001,Distribution,Tracker gates in docs and release workflows,".github/workflows/docs.yml, .github/workflows/publish.yml",src/tests/test_feature_user_story_tracker.py and src/tests/test_dashboard_user_story_tracker.py,As a release reviewer I can trust docs deploys and release tags cannot bypass tracker integrity,Docs deploy and publish release canaries run canonical feature and dashboard tracker tests before deployment or publishing,GitHub Actions available,python -m pytest src/tests/test_feature_user_story_tracker.py src/tests/test_dashboard_user_story_tracker.py -q,Tested Pass,Tracker enforcement test checks docs and publish workflows include both tracker suites.,,,,,2026-06-29,Added after expert audit found docs deploy and publish could rely on strict build without tracker checks.
137
  SEC-001,Distribution,Hugging Face token fail-closed workflow policy,.github/workflows/huggingface-sync.yml,.github/workflows/huggingface-sync.yml,As a repository owner I want canonical Hugging Face sync to fail when its publishing secret is absent,The canonical stevesolun/ctx workflow exits non-zero without HF_TOKEN while forks may skip safely without publishing,GitHub Actions workflow metadata available,python -m pytest src/tests/test_feature_user_story_tracker.py -q,Tested Pass,Tracker enforcement test checks canonical repository guard and Missing HF_TOKEN error marker in the workflow.,,,,,2026-06-29,Separate from DIST-004 credential rotation which still requires external token revocation.
138
  SEC-002,Distribution,No-mistakes development gate,no-mistakes axi run,imported-skills/no-mistakes and no-mistakes binary,As a maintainer I can gate feature branches through no-mistakes before merge,The no-mistakes pipeline runs intent rebase review test docs lint push PR and CI before changes reach main,Feature branch with committed changes,no-mistakes axi run --intent tracker-governance-change,Tested Pass,no-mistakes run 01KW9N9RP1F7N9T593164EPZY6 reached checks-passed and PR #206 merged after CI success.,,,,,2026-06-29,Tracks the required development-process gate requested for enterprise readiness.
139
- MAINT-001,Maintainer,Backup snapshot audit,scripts/audit_backup.py,scripts/audit_backup.py,As a maintainer I can inspect backup snapshots for missing expected files,Script summarizes backup contents and flags missing graph/wiki/report artifacts without mutating the repo,Backup fixture available,Run script against representative backup fixture,Retested Pass,FAIL: BOM-prefixed manifest.json from PowerShell Set-Content -Encoding UTF8 raised JSONDecodeError.,CTX-AZ-008,Backup audit read manifest JSON with utf-8 and rejected common Windows BOM input,Fixed by reading manifest.json with utf-8-sig,PASS: temp backup fixture with BOM manifest printed entries and OK coverage; regression pytest passed.,2026-06-23,
140
  MAINT-002,Maintainer,Dashboard graph index builder,scripts/build_dashboard_graph_index.py,scripts/build_dashboard_graph_index.py,As a dashboard user I get fast graph search and neighborhoods,Script builds the dashboard SQLite/index artifacts from graph exports for fast monitor reads,Graph fixture available,Run script against small graph fixture and query resulting index,Retested Pass,FAIL: BOM-prefixed graph.json from PowerShell Set-Content -Encoding UTF8 raised JSONDecodeError.,CTX-AZ-008,Dashboard graph index builder read graph JSON with utf-8 and rejected common Windows BOM input,Fixed by reading graph JSON with utf-8-sig,PASS: temp graph fixture built SQLite index with 2 nodes and neighbor mcp-server:github; regression pytest passed.,2026-06-23,
141
  MAINT-003,Maintainer,CI change classifier,scripts/ci_classifier.py,scripts/ci_classifier.py and .github/workflows/test.yml,As a contributor I get the right CI gates for the files I changed,Classifier marks docs graph source package browser and similarity changes conservatively,CI classifier tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers path classes and workflow contract behavior.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
142
  MAINT-004,Maintainer,No-test policy gate,scripts/ci_no_test_policy.py,scripts/ci_no_test_policy.py and .github/workflows/test.yml,As a reviewer I can reject risky code or workflow changes without test updates,Policy fails contract changes that omit matching tests while allowing metadata-only releases,CI policy tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers no-test policy contract files and release metadata exceptions.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
@@ -149,7 +149,7 @@ MAINT-010,Maintainer,Overlay wiki entities,scripts/overlay_wiki_entities.py,scri
149
  MAINT-011,Maintainer,Full wiki tar repacker,scripts/pack_full_wiki_tar.py,scripts/pack_full_wiki_tar.py,As a maintainer I can ship a packed full LLM-wiki artifact without huge expanded fanout,Repacker moves high-fanout pages into wiki packs omits raw originals and is idempotent,Wiki tar fixture available,python -m pytest src/tests/test_pack_full_wiki_tar.py -q,Tested Pass,Pack full wiki tar tests cover packed wiki output original omission and idempotent repack.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
150
  MAINT-012,Maintainer,SkillSpector wiki pruner,scripts/prune_skillspector_wiki.py,scripts/prune_skillspector_wiki.py,As a maintainer I can prune low-value SkillSpector wiki noise before shipping,Script builds pruned artifacts in dry-run/apply modes while preserving required catalog metadata,Prune fixture available,python -m pytest src/tests/test_prune_skillspector_wiki.py -q,Tested Pass,Prune SkillSpector wiki tests cover dry-run apply and artifact rewrite behavior.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
151
  MAINT-013,Maintainer,Hugging Face sync script,scripts/sync_huggingface.py,scripts/sync_huggingface.py and .github/workflows/huggingface-sync.yml,As a Hugging Face visitor I get a clean repo-card snapshot without ignored local artifacts,Script exports tracked files adds repo-card metadata validates graph artifacts and removes stale remote files,HF token or fake API available,python -m pytest src/tests/test_huggingface_sync.py -q,Tested Pass,Hugging Face sync tests cover metadata wrapping stale remote cleanup and hardened workflow contract.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
152
- MAINT-014,Maintainer,Similarity threshold tuner,scripts/tune_similarity_thresholds.py,scripts/tune_similarity_thresholds.py,As a graph maintainer I can calibrate similarity thresholds against fixtures,Tuner sweeps threshold settings and reports quality metrics without mutating graph artifacts,Similarity fixture corpus available,Run tuner against fixture corpus,Tested Pass,python scripts/tune_similarity_thresholds.py completed and printed near/distinct/adversarial score distributions plus threshold sweep.,,,,,2026-06-23,Validated with current fixture corpus; unauthenticated HF warning did not block local cached model load.
153
  PUBLIC-001,Docs,Public catalog search JavaScript,docs/assets/javascripts/catalog.js,docs/assets/javascripts/catalog.js and docs/catalog.md,As a GitHub Pages visitor I can filter catalog tiles without a local dashboard,JavaScript wires input and checkbox filters and updates visible catalog cards/counts client-side,Docs assets available,python -m pytest src/tests/test_docs_catalog_page.py -q,Tested Pass,Docs catalog page tests verify script inclusion input listener and public non-local links.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
154
  PUBLIC-002,Docs,Public repo stats refresh JavaScript,docs/assets/javascripts/repo-stats-refresh.js,docs/assets/javascripts/repo-stats-refresh.js and mkdocs.yml,As a docs visitor I see current repo stats when GitHub allows client refresh,JavaScript is included by MkDocs and degrades safely when live repo stats cannot be fetched,Docs assets available,python -m pytest src/tests/test_docs_repo_stats.py -q,Tested Pass,Docs repo stats tests verify MkDocs includes the script and the script has the expected refresh behavior.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
155
  PUBLIC-003,Docs,Backup watchdog service manifests,"docs/services/systemd/claude-backup-watchdog.service, docs/services/macos/com.claude.backup.watchdog.plist, docs/services/windows/install-backup-watchdog.ps1","docs/services and docs/backup-hook-install.md",As an operator I can install the backup watchdog as a least-privilege background service on Linux macOS or Windows,Public service assets point at backup_mirror watchdog use user-scope execution and expose install/remove/status guidance without requiring admin rights,Docs services assets available,"python -m pytest src/tests/test_feature_user_story_tracker.py src/tests/test_backup_watchdog.py -q",Tested Pass,Tracker enforcement covers every docs/services asset and watchdog CLI tests cover --once JSON and real snapshot behavior.,,,,,2026-06-29,Added for public linked service assets referenced from backup hook install docs.
 
1
  feature_id,surface,feature,entrypoint_or_route,source_evidence,user_story,expected_behavior,setup_preconditions,test_command_or_steps,status,first_test_result,error_id,error_summary,fix_status,retest_result,last_verified_at,notes
2
+ CLI-001,CLI,Generic model run harness,ctx; python -m ctx,pyproject.toml project.scripts and src/ctx/__main__.py,As a user I can run or resume a model-agnostic ctx session,ctx and python -m ctx expose the same run/resume/sessions harness with configured provider tools budgets and transcript ordering intact,Provider credentials or dry-run/local test provider available,ctx --help; python -m ctx --help; focused run/resume smoke,Tested Pass,test_harness_cli_run.py: 67 passed for ctx run/resume/sessions; test_package_scaffold.py covers python -m ctx --help.,,,,,2026-07-01,Validated in focused pytest or isolated temp CLI smoke during A-Z pass.
3
  CLI-002,CLI,Repository recommendation,ctx-recommend,pyproject.toml project.scripts,As a user I can ask ctx for current repo recommendations,ctx returns capped relevant skill agent MCP recommendations from the shared graph engine,Graph installed and target repo available,ctx-recommend --help then sample repo recommendation,Tested Pass,recommend CLI/golden subset: 24 passed for ctx-recommend and shared recommendation surfaces.,,,,,2026-06-23,Validated in focused pytest or isolated temp CLI smoke during A-Z pass.
4
  CLI-003,CLI,Initial setup,ctx-init,pyproject.toml project.scripts,As a new user I can install hooks graph and model mode from one command,ctx-init installs requested pieces idempotently and reports failures with non-zero exit,Writable user config directory,ctx-init --model-mode skip --graph,Retested Pass,"PASS: temp USERPROFILE ctx-init --model-mode skip --knowledge-mode skip created .claude config/toolboxes and exited 0. PASS: temp USERPROFILE ctx-init --graph --graph-install-mode runtime --model-mode skip installed graph.json and harness page in 129.2s.",CTX-AZ-006,Full graph install exceeded the 10-minute Windows smoke budget before packed wiki artifacts: native-tar full install completed in 759.0s and cleanup took 171.7s.,Packed full artifact now ships wiki-packs and omits expanded non-root markdown fanout; ctx-init checksum updated.,PASS: temp USERPROFILE ctx-init --graph --graph-install-mode full --model-mode skip --knowledge-mode skip exited 0 in 409.7s with graph-store.sqlite3 wiki-packs harness pages and no expanded skills/agents/MCP/converted/concepts markdown.,2026-06-23,Runtime path remains usable; full path now installs packed markdown wiki under the smoke budget while keeping harness pages direct.
5
  CLI-004,CLI,Claude hook install,ctx-install-hooks,pyproject.toml project.scripts,As a Claude Code user I can install ctx hooks,Hooks are installed idempotently and point to existing modules,Claude config path writable,ctx-install-hooks --help then temp-home smoke,Tested Pass,inject hooks/ctx-init hook subset: 24 passed for hook install and failure handling.,,,,,2026-06-23,Validated in focused pytest or isolated temp CLI smoke during A-Z pass.
 
136
  CICD-001,Distribution,Tracker gates in docs and release workflows,".github/workflows/docs.yml, .github/workflows/publish.yml",src/tests/test_feature_user_story_tracker.py and src/tests/test_dashboard_user_story_tracker.py,As a release reviewer I can trust docs deploys and release tags cannot bypass tracker integrity,Docs deploy and publish release canaries run canonical feature and dashboard tracker tests before deployment or publishing,GitHub Actions available,python -m pytest src/tests/test_feature_user_story_tracker.py src/tests/test_dashboard_user_story_tracker.py -q,Tested Pass,Tracker enforcement test checks docs and publish workflows include both tracker suites.,,,,,2026-06-29,Added after expert audit found docs deploy and publish could rely on strict build without tracker checks.
137
  SEC-001,Distribution,Hugging Face token fail-closed workflow policy,.github/workflows/huggingface-sync.yml,.github/workflows/huggingface-sync.yml,As a repository owner I want canonical Hugging Face sync to fail when its publishing secret is absent,The canonical stevesolun/ctx workflow exits non-zero without HF_TOKEN while forks may skip safely without publishing,GitHub Actions workflow metadata available,python -m pytest src/tests/test_feature_user_story_tracker.py -q,Tested Pass,Tracker enforcement test checks canonical repository guard and Missing HF_TOKEN error marker in the workflow.,,,,,2026-06-29,Separate from DIST-004 credential rotation which still requires external token revocation.
138
  SEC-002,Distribution,No-mistakes development gate,no-mistakes axi run,imported-skills/no-mistakes and no-mistakes binary,As a maintainer I can gate feature branches through no-mistakes before merge,The no-mistakes pipeline runs intent rebase review test docs lint push PR and CI before changes reach main,Feature branch with committed changes,no-mistakes axi run --intent tracker-governance-change,Tested Pass,no-mistakes run 01KW9N9RP1F7N9T593164EPZY6 reached checks-passed and PR #206 merged after CI success.,,,,,2026-06-29,Tracks the required development-process gate requested for enterprise readiness.
139
+ MAINT-001,Maintainer,Backup snapshot audit,scripts/audit_backup.py,scripts/audit_backup.py,As a maintainer I can inspect backup snapshots for missing expected files,Script summarizes backup contents while accepting --help without snapshot access and flags missing graph/wiki/report artifacts without mutating the repo,Backup fixture available,python scripts/audit_backup.py --help; run script against representative backup fixture,Retested Pass,PASS: --help printed usage without touching manifest.json; temp backup fixture with BOM manifest printed entries and OK coverage; regression pytest passed.,CTX-AZ-008,Backup audit read manifest JSON with utf-8 and rejected common Windows BOM input,Fixed by reading manifest.json with utf-8-sig,PASS: temp backup fixture with BOM manifest printed entries and OK coverage; regression pytest passed.,2026-06-23,
140
  MAINT-002,Maintainer,Dashboard graph index builder,scripts/build_dashboard_graph_index.py,scripts/build_dashboard_graph_index.py,As a dashboard user I get fast graph search and neighborhoods,Script builds the dashboard SQLite/index artifacts from graph exports for fast monitor reads,Graph fixture available,Run script against small graph fixture and query resulting index,Retested Pass,FAIL: BOM-prefixed graph.json from PowerShell Set-Content -Encoding UTF8 raised JSONDecodeError.,CTX-AZ-008,Dashboard graph index builder read graph JSON with utf-8 and rejected common Windows BOM input,Fixed by reading graph JSON with utf-8-sig,PASS: temp graph fixture built SQLite index with 2 nodes and neighbor mcp-server:github; regression pytest passed.,2026-06-23,
141
  MAINT-003,Maintainer,CI change classifier,scripts/ci_classifier.py,scripts/ci_classifier.py and .github/workflows/test.yml,As a contributor I get the right CI gates for the files I changed,Classifier marks docs graph source package browser and similarity changes conservatively,CI classifier tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers path classes and workflow contract behavior.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
142
  MAINT-004,Maintainer,No-test policy gate,scripts/ci_no_test_policy.py,scripts/ci_no_test_policy.py and .github/workflows/test.yml,As a reviewer I can reject risky code or workflow changes without test updates,Policy fails contract changes that omit matching tests while allowing metadata-only releases,CI policy tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers no-test policy contract files and release metadata exceptions.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
 
149
  MAINT-011,Maintainer,Full wiki tar repacker,scripts/pack_full_wiki_tar.py,scripts/pack_full_wiki_tar.py,As a maintainer I can ship a packed full LLM-wiki artifact without huge expanded fanout,Repacker moves high-fanout pages into wiki packs omits raw originals and is idempotent,Wiki tar fixture available,python -m pytest src/tests/test_pack_full_wiki_tar.py -q,Tested Pass,Pack full wiki tar tests cover packed wiki output original omission and idempotent repack.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
150
  MAINT-012,Maintainer,SkillSpector wiki pruner,scripts/prune_skillspector_wiki.py,scripts/prune_skillspector_wiki.py,As a maintainer I can prune low-value SkillSpector wiki noise before shipping,Script builds pruned artifacts in dry-run/apply modes while preserving required catalog metadata,Prune fixture available,python -m pytest src/tests/test_prune_skillspector_wiki.py -q,Tested Pass,Prune SkillSpector wiki tests cover dry-run apply and artifact rewrite behavior.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
151
  MAINT-013,Maintainer,Hugging Face sync script,scripts/sync_huggingface.py,scripts/sync_huggingface.py and .github/workflows/huggingface-sync.yml,As a Hugging Face visitor I get a clean repo-card snapshot without ignored local artifacts,Script exports tracked files adds repo-card metadata validates graph artifacts and removes stale remote files,HF token or fake API available,python -m pytest src/tests/test_huggingface_sync.py -q,Tested Pass,Hugging Face sync tests cover metadata wrapping stale remote cleanup and hardened workflow contract.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
152
+ MAINT-014,Maintainer,Similarity threshold tuner,scripts/tune_similarity_thresholds.py,scripts/tune_similarity_thresholds.py,As a graph maintainer I can calibrate similarity thresholds against fixtures,Tuner prints help without loading the embedding model and sweeps threshold settings with precision/recall/F1 output without mutating graph artifacts,Similarity fixture corpus available,python scripts/tune_similarity_thresholds.py --help; run tuner against fixture corpus,Tested Pass,python scripts/tune_similarity_thresholds.py --help printed usage without loading the embedder; tuner completed and printed near/distinct/adversarial score distributions plus threshold sweep with F1.,,,,,2026-06-23,Validated with current fixture corpus; --help covered by focused maintainer script pytest.
153
  PUBLIC-001,Docs,Public catalog search JavaScript,docs/assets/javascripts/catalog.js,docs/assets/javascripts/catalog.js and docs/catalog.md,As a GitHub Pages visitor I can filter catalog tiles without a local dashboard,JavaScript wires input and checkbox filters and updates visible catalog cards/counts client-side,Docs assets available,python -m pytest src/tests/test_docs_catalog_page.py -q,Tested Pass,Docs catalog page tests verify script inclusion input listener and public non-local links.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
154
  PUBLIC-002,Docs,Public repo stats refresh JavaScript,docs/assets/javascripts/repo-stats-refresh.js,docs/assets/javascripts/repo-stats-refresh.js and mkdocs.yml,As a docs visitor I see current repo stats when GitHub allows client refresh,JavaScript is included by MkDocs and degrades safely when live repo stats cannot be fetched,Docs assets available,python -m pytest src/tests/test_docs_repo_stats.py -q,Tested Pass,Docs repo stats tests verify MkDocs includes the script and the script has the expected refresh behavior.,,,,,2026-06-23,Validated by focused pytest in this tracker slice.
155
  PUBLIC-003,Docs,Backup watchdog service manifests,"docs/services/systemd/claude-backup-watchdog.service, docs/services/macos/com.claude.backup.watchdog.plist, docs/services/windows/install-backup-watchdog.ps1","docs/services and docs/backup-hook-install.md",As an operator I can install the backup watchdog as a least-privilege background service on Linux macOS or Windows,Public service assets point at backup_mirror watchdog use user-scope execution and expose install/remove/status guidance without requiring admin rights,Docs services assets available,"python -m pytest src/tests/test_feature_user_story_tracker.py src/tests/test_backup_watchdog.py -q",Tested Pass,Tracker enforcement covers every docs/services asset and watchdog CLI tests cover --once JSON and real snapshot behavior.,,,,,2026-06-29,Added for public linked service assets referenced from backup hook install docs.
docs/telemetry.md CHANGED
@@ -25,7 +25,8 @@ Outcome and dimensions live in attributes such as `otel.status_code`,
25
  Every recorded event gets a generated OpenTelemetry-compatible `trace_id` and
26
  `span_id` when the caller does not provide one. OTLP export maps those to the
27
  log record `traceId` and `spanId` fields and also includes ctx release
28
- provenance as `ctx.version`.
 
29
 
30
  ## Metric Shape
31
 
@@ -100,9 +101,11 @@ The shipped config keeps telemetry local:
100
  ```
101
 
102
  `local_redacted` removes or hashes raw input fields such as `query`, `prompt`,
103
- `tool_input`, `stdout`, `stderr`, paths, repo names, and secrets. The only
104
- accepted modes are `local_redacted`, `disabled`, `off`, and `none`; unknown modes
105
- fail closed instead of emitting raw fields.
 
 
106
 
107
  Local JSONL records retain the top-level `session_id` field for compatibility
108
  with existing local-only workflows, but they also include a salted
 
25
  Every recorded event gets a generated OpenTelemetry-compatible `trace_id` and
26
  `span_id` when the caller does not provide one. OTLP export maps those to the
27
  log record `traceId` and `spanId` fields and also includes ctx release
28
+ provenance as `ctx.version`. In installed wheels this comes from package
29
+ metadata; in source checkouts it falls back to `ctx.__version__`.
30
 
31
  ## Metric Shape
32
 
 
101
  ```
102
 
103
  `local_redacted` removes or hashes raw input fields such as `query`, `prompt`,
104
+ `tool_input`, `stdout`, `stderr`, repo names, secrets, `paths`, dotted or
105
+ hyphenated path keys such as `ctx.repo.path` and `repo-path`, and keys that
106
+ normalize to `_path` or `_paths` suffixes. The only accepted modes are
107
+ `local_redacted`, `disabled`, `off`, and `none`; unknown modes fail closed
108
+ instead of emitting raw fields.
109
 
110
  Local JSONL records retain the top-level `session_id` field for compatibility
111
  with existing local-only workflows, but they also include a salted
docs/toolbox/behavior-miner.md CHANGED
@@ -18,30 +18,25 @@ can surface:
18
 
19
  ## User profile
20
 
21
- Signals aggregate into `~/.claude/user-profile.json`:
22
 
23
  ```jsonc
24
  {
25
- "version": 1,
26
- "updated_at": 1713456789,
27
- "signals": {
28
- "co_invocation": {
29
- "code-reviewer|security-reviewer": 4,
30
- "architect-review|test-automator": 3
31
- },
32
- "skill_cadence": {
33
- "python-patterns": {"loads": 12, "sessions": 12}
34
- },
35
- "file_types": {"py": 87, "md": 31, "tf": 0},
36
- "commit_types": {"fix": 8, "feat": 2}
37
- },
38
  "suggestions": [
39
  {
40
- "id": "bundle:reviewers-pair",
41
- "rationale": "4 co-invocations of code-reviewer + security-reviewer",
42
- "evidence_count": 4
 
43
  }
44
- ]
 
45
  }
46
  ```
47
 
@@ -51,31 +46,26 @@ On `session-end`, the hook calls `format_digest(profile)` and prints
51
  anything new. Example output:
52
 
53
  ```
54
- [behavior-miner] 2 suggestions:
55
- - bundle:reviewers-pair (4 co-invocations)
56
- → add to 'review' toolbox:
57
- ctx-toolbox add review --post code-reviewer,security-reviewer
58
- - promote:python-patterns (loaded in 12/12 sessions)
59
- → promote to 'pre' in your default toolbox
60
  ```
61
 
62
- Suggestions are never applied automatically. The user runs the command,
63
- or accepts the suggestion via `toolbox init --accept <id>`.
64
 
65
  ## CLI
66
 
67
  ```bash
68
- # Rebuild the profile from scratch (scans ~/.claude/history/)
69
- python -m behavior_miner build
70
 
71
- # Show current suggestions
72
- python -m behavior_miner show
73
 
74
- # Print digest (same output as session-end hook)
75
- python -m behavior_miner digest
76
-
77
- # Drop a suggestion (noise reduction)
78
- python -m behavior_miner dismiss bundle:reviewers-pair
79
  ```
80
 
81
  ## Privacy
 
18
 
19
  ## User profile
20
 
21
+ Signals aggregate into `~/.claude/user-profile.json` as a `BehaviorProfile`:
22
 
23
  ```jsonc
24
  {
25
+ "total_intent_events": 87,
26
+ "total_commits": 10,
27
+ "co_invocation_pairs": [{"a": "python", "b": "pytest", "count": 4}],
28
+ "skill_cadence": [["python-patterns", 12]],
29
+ "file_types": [["py", 87], ["md", 31]],
30
+ "commit_types": [["fix", 8], ["feat", 2]],
 
 
 
 
 
 
 
31
  "suggestions": [
32
  {
33
+ "kind": "co-invocation",
34
+ "rationale": "Signals 'python' and 'pytest' co-occurred 4x.",
35
+ "evidence": 4,
36
+ "proposed": {"name": "python-pytest-bundle"}
37
  }
38
+ ],
39
+ "generated_at": 1713456789
40
  }
41
  ```
42
 
 
46
  anything new. Example output:
47
 
48
  ```
49
+ [toolbox] 2 suggestion(s):
50
+ - python-pytest-bundle (co-invocation, 4x): Signals 'python' and 'pytest' co-occurred 4x.
51
+ - python-patterns-default (skill-cadence, 12x): Skill 'python-patterns' was loaded/unloaded 12x.
 
 
 
52
  ```
53
 
54
+ Suggestions are never applied automatically. The digest is advisory; apply
55
+ changes through the normal `ctx-toolbox` commands after review.
56
 
57
  ## CLI
58
 
59
  ```bash
60
+ # Build the full JSON profile without saving it
61
+ python -m behavior_miner profile
62
 
63
+ # Build and persist ~/.claude/user-profile.json
64
+ python -m behavior_miner profile --save
65
 
66
+ # Print a short digest, optionally persisting the underlying profile
67
+ python -m behavior_miner suggest --limit 5
68
+ python -m behavior_miner suggest --save
 
 
69
  ```
70
 
71
  ## Privacy
docs/toolbox/configuration.md CHANGED
@@ -30,12 +30,12 @@ from the per-repo file fall back to the global value.
30
  ],
31
 
32
  "scope": {
33
- // "diff" | "dynamic" | "full"
34
  "analysis": "dynamic",
35
  // Optional: restrict to these glob projects
36
  "projects": ["*"],
37
- // Optional: restrict to these file globs
38
- "files": ["src/**/*.py"]
39
  },
40
 
41
  "budget": {
@@ -44,16 +44,16 @@ from the per-repo file fall back to the global value.
44
  },
45
 
46
  "dedup": {
47
- // "fresh" = always re-run, "user-configurable" = skip
48
- // if same files already reviewed this session
49
- "policy": "user-configurable",
50
  "window_seconds": 3600
51
  },
52
 
53
  "trigger": {
54
  "slash": true,
55
- "session_start": false,
56
- "file_save": false,
57
  "pre_commit": true,
58
  "session_end": false
59
  },
@@ -84,26 +84,28 @@ Controls what files the council sees:
84
  | Value | Behavior |
85
  |---|---|
86
  | `diff` | Only files with uncommitted changes. Cheapest, fastest. |
87
- | `dynamic` | Diff + import graph blast radius. Catches downstream regressions. |
 
88
  | `full` | Every tracked file. Most thorough; expensive — reserve for security sweeps. |
89
 
90
  ### `budget`
91
 
92
- Enforced by `council_runner`. When the plan would exceed `max_tokens`, the
93
- runner truncates the file list; when time exceeds `max_seconds`, the
94
- trigger exits 0 without running remaining agents.
95
 
96
  ### `dedup`
97
 
98
- `fresh` always re-runs. `user-configurable` skips a council run when the
99
- same file set was reviewed within `window_seconds`. Dedup state lives at
100
- `~/.claude/toolbox-runs/<plan_hash>.json`.
101
 
102
  ### `trigger`
103
 
104
- At least one trigger must be true. Multiple triggers are allowed — a
105
- `ship-it` toolbox typically enables `slash`, `pre_commit`, and
106
- `session_end`.
 
 
107
 
108
  ### `guardrail`
109
 
@@ -133,11 +135,11 @@ ctx-toolbox import my-toolboxes.yaml
133
 
134
  ## Validation
135
 
136
- `toolbox_config.load()` validates on read:
137
 
138
  - `version` must equal `1`.
139
- - Every toolbox needs at least one trigger.
140
- - `scope.analysis` must be one of `diff`, `dynamic`, `full`.
141
  - `budget.max_tokens` and `budget.max_seconds` must be positive ints.
142
 
143
  Invalid entries raise `ValueError` with the offending key.
 
30
  ],
31
 
32
  "scope": {
33
+ // "diff" | "dynamic" | "graph-blast" | "full"
34
  "analysis": "dynamic",
35
  // Optional: restrict to these glob projects
36
  "projects": ["*"],
37
+ // Optional: match intent signals
38
+ "signals": ["python"]
39
  },
40
 
41
  "budget": {
 
44
  },
45
 
46
  "dedup": {
47
+ // "fresh" = always re-run, "cached" = reuse a matching
48
+ // plan within window_seconds
49
+ "policy": "cached",
50
  "window_seconds": 3600
51
  },
52
 
53
  "trigger": {
54
  "slash": true,
55
+ // Optional file-save glob; null disables file-save
56
+ "file_save": null,
57
  "pre_commit": true,
58
  "session_end": false
59
  },
 
84
  | Value | Behavior |
85
  |---|---|
86
  | `diff` | Only files with uncommitted changes. Cheapest, fastest. |
87
+ | `dynamic` | Diff by default; expands one graph hop for tiny diffs when graph edges are available; falls back to full when no diff exists. |
88
+ | `graph-blast` | Current diff plus one-hop graph expansion when a graph edge map is supplied; otherwise the changed set. |
89
  | `full` | Every tracked file. Most thorough; expensive — reserve for security sweeps. |
90
 
91
  ### `budget`
92
 
93
+ Copied into the `RunPlan` as `budget_tokens` and `budget_seconds`.
94
+ Downstream council execution enforces those caps.
 
95
 
96
  ### `dedup`
97
 
98
+ `fresh` always builds a new plan. `cached` reuses a matching plan when its
99
+ deterministic `plan_hash` is still within `window_seconds`. Dedup state lives
100
+ at `~/.claude/toolbox-runs/<plan_hash>.json`.
101
 
102
  ### `trigger`
103
 
104
+ Multiple triggers are allowed — a `ship-it` toolbox typically enables
105
+ `slash`, `pre_commit`, and `session_end`. `file_save` is a glob string
106
+ such as `"**/*.md"`; use `null` to disable file-save matching.
107
+ `session-start` is not configured in the trigger map: any active toolbox
108
+ with a non-empty `pre` list can preload those skills at session start.
109
 
110
  ### `guardrail`
111
 
 
135
 
136
  ## Validation
137
 
138
+ `toolbox_config` validates on read:
139
 
140
  - `version` must equal `1`.
141
+ - `scope.analysis` must be one of `diff`, `dynamic`, `graph-blast`, `full`.
142
+ - `dedup.policy` must be one of `fresh`, `cached`.
143
  - `budget.max_tokens` and `budget.max_seconds` must be positive ints.
144
 
145
  Invalid entries raise `ValueError` with the offending key.
docs/toolbox/council-runner.md CHANGED
@@ -7,15 +7,13 @@ the hook system can execute.
7
  ## Responsibilities
8
 
9
  1. **Resolve the toolbox** — merge global + per-repo config.
10
- 2. **Compute scope** — walk the current diff or full repo, honoring
11
- `scope.analysis` and optional `scope.files` globs.
12
- 3. **Graph-blast expansion** — for `dynamic` scope, add every file that
13
- imports a changed module (via the knowledge graph edge map).
14
- 4. **Enforce budget** — drop files until the plan fits within
15
- `budget.max_tokens` (estimated by line count × heuristic).
16
- 5. **Honor dedup** — skip if the same file set was run within
17
- `dedup.window_seconds` and policy is `user-configurable`.
18
- 6. **Persist** — write the plan to
19
  `~/.claude/toolbox-runs/<plan_hash>.json` for downstream reads.
20
 
21
  ## RunPlan
@@ -23,57 +21,53 @@ the hook system can execute.
23
  ```python
24
  @dataclass(frozen=True)
25
  class RunPlan:
26
- plan_hash: str
27
  toolbox: str
28
  agents: tuple[str, ...]
29
  files: tuple[str, ...]
30
- source: str # "slash" | "pre-commit" | ...
 
 
31
  guardrail: bool
32
- budget: Budget
33
  created_at: float
 
 
34
  ```
35
 
36
- The `plan_hash` is deterministic (sha256 of `toolbox|sorted(files)|agents`),
37
- which lets dedup work across triggers without any additional state.
38
 
39
  ## CLI
40
 
41
  ```bash
42
  # Build and persist a plan for the named toolbox
43
- python -m council_runner build ship-it
44
 
45
  # Build without persisting (useful for inspection)
46
- python -m council_runner build ship-it --dry-run
47
-
48
- # Show a previously persisted plan
49
- python -m council_runner show <plan_hash>
50
 
51
  # List recent plans
52
- python -m council_runner list --limit 10
 
 
 
53
  ```
54
 
55
  ## Budget estimation
56
 
57
- Token estimates are intentionally rough. The runner assumes ~4 tokens per
58
- line of source, then sorts files by recency (newest first) and greedily
59
- takes until `max_tokens` is reached. If a single file exceeds the budget,
60
- the plan is truncated rather than dropped — the council still runs on a
61
- partial view.
62
-
63
- This cheap estimate is fine because the council itself enforces its own
64
- budgets; `council_runner`'s job is just to stay in the right ballpark.
65
 
66
  ## Dedup window
67
 
68
- Dedup compares the sorted file list, not the plan hash — that way a
69
- toolbox and its re-run with a newer budget still dedup correctly.
 
70
 
71
  ## Graph-blast expansion
72
 
73
- For `dynamic` scope, `council_runner` reads the graph edge map produced
74
- by `scan_repo.py` and walks imports one hop out from each changed file.
75
- It stops at one hop to keep scope bounded; deep graph walks are reserved
76
- for explicit `full` mode.
77
 
78
  ## Related
79
 
 
7
  ## Responsibilities
8
 
9
  1. **Resolve the toolbox** — merge global + per-repo config.
10
+ 2. **Compute scope** — use explicit files, the current diff, the full repo,
11
+ or one-hop graph expansion when a graph edge map is supplied.
12
+ 3. **Carry budget caps** — copy the toolbox token and second caps into the
13
+ plan so downstream execution can enforce them.
14
+ 4. **Honor dedup** — reuse a cached plan when the toolbox policy is `cached`
15
+ and the matching hash is still inside `dedup.window_seconds`.
16
+ 5. **Persist** — write the plan to
 
 
17
  `~/.claude/toolbox-runs/<plan_hash>.json` for downstream reads.
18
 
19
  ## RunPlan
 
21
  ```python
22
  @dataclass(frozen=True)
23
  class RunPlan:
 
24
  toolbox: str
25
  agents: tuple[str, ...]
26
  files: tuple[str, ...]
27
+ scope_mode: str
28
+ budget_tokens: int
29
+ budget_seconds: int
30
  guardrail: bool
 
31
  created_at: float
32
+ plan_hash: str
33
+ source: str # "fresh" | "cached"
34
  ```
35
 
36
+ The `plan_hash` is deterministic from the toolbox, agents, file set, and
37
+ effective scope mode, which lets dedup work without any additional state.
38
 
39
  ## CLI
40
 
41
  ```bash
42
  # Build and persist a plan for the named toolbox
43
+ python -m council_runner plan --toolbox ship-it
44
 
45
  # Build without persisting (useful for inspection)
46
+ python -m council_runner plan --toolbox ship-it --dry-run
 
 
 
47
 
48
  # List recent plans
49
+ python -m council_runner history --limit 10
50
+
51
+ # Delete stale plans
52
+ python -m council_runner purge --older-than-days 30
53
  ```
54
 
55
  ## Budget estimation
56
 
57
+ The runner records `budget.max_tokens` and `budget.max_seconds` in the plan.
58
+ The downstream council execution is responsible for enforcing those caps.
 
 
 
 
 
 
59
 
60
  ## Dedup window
61
 
62
+ Dedup looks up the deterministic `plan_hash`. If the toolbox policy is
63
+ `cached` and the existing plan is still inside `dedup.window_seconds`, the
64
+ runner returns that cached plan instead of writing a fresh one.
65
 
66
  ## Graph-blast expansion
67
 
68
+ When callers provide a graph edge map, `graph-blast` expands changed files by
69
+ one hop. Without a graph map, graph-blast falls back to the changed set so the
70
+ CLI remains deterministic and cheap.
 
71
 
72
  ## Related
73
 
docs/toolbox/hooks.md CHANGED
@@ -2,7 +2,8 @@
2
 
3
  [`src/toolbox_hooks.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_hooks.py)
4
  is the bridge between Claude Code's hook system and the toolbox runner.
5
- It listens for four events plus one explicit slash command.
 
6
 
7
  ## Event model
8
 
@@ -10,12 +11,14 @@ It listens for four events plus one explicit slash command.
10
  |---|---|---|
11
  | `session-start` | New Claude Code session | Skill preloaders, intent suggestions |
12
  | `file-save` | File written to disk | Linters, quick reviewers |
13
- | `pre-commit` | `git commit` before write | Guardrail councils (`ship-it`, `security-sweep`) |
14
  | `session-end` | Session closes | Digest, behavior miner, retro |
15
- | `slash:/toolbox run <name>` | User-initiated | Anything |
16
 
17
- Each trigger in a toolbox's `trigger` map enables that toolbox on that
18
- event. Events with no matching toolbox emit nothing.
 
 
 
19
 
20
  ## Emission format
21
 
@@ -24,11 +27,11 @@ One JSON line per matching toolbox, on stdout:
24
  ```jsonc
25
  {
26
  "trigger": "pre-commit",
27
- "toolbox": "ship-it",
28
  "plan_file": "/Users/steve/.claude/toolbox-runs/abc123.json",
29
- "agents": ["code-reviewer", "security-reviewer", "architect-review"],
30
  "files": ["src/toolbox_verdict.py", "src/tests/test_toolbox_verdict.py"],
31
- "source": "pre-commit",
32
  "guardrail": true
33
  }
34
  ```
@@ -57,15 +60,13 @@ The `2` exit from `pre-commit` is what actually blocks `git commit`.
57
  ctx-toolbox run --event pre-commit
58
  ```
59
 
60
- Then point git at the directory once: `git config core.hooksPath .githooks`.
61
-
62
  Then `git config core.hooksPath .githooks`.
63
 
64
  ## file-save path matching
65
 
66
- `file-save` triggers honor `scope.files` globs. Without a `--path` arg
67
- the event matches nothing (there's no file to test). This is intentional:
68
- file-save toolboxes must be path-scoped.
69
 
70
  ## session-end digest
71
 
 
2
 
3
  [`src/toolbox_hooks.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_hooks.py)
4
  is the bridge between Claude Code's hook system and the toolbox runner.
5
+ It listens for four hook events. User-initiated slash wrappers use the same
6
+ toolbox config but are not emitted by this hook runner.
7
 
8
  ## Event model
9
 
 
11
  |---|---|---|
12
  | `session-start` | New Claude Code session | Skill preloaders, intent suggestions |
13
  | `file-save` | File written to disk | Linters, quick reviewers |
14
+ | `pre-commit` | `git commit` before write | `security-sweep` guardrail |
15
  | `session-end` | Session closes | Digest, behavior miner, retro |
 
16
 
17
+ `session-start` matches active toolboxes with a non-empty `pre` list.
18
+ `file-save`, `pre-commit`, and `session-end` use the toolbox's `trigger`
19
+ map. Events with no matching toolbox emit nothing. User-initiated slash
20
+ wrappers are dispatched outside `toolbox_hooks.py` and select toolboxes from
21
+ the same config with `trigger.slash`.
22
 
23
  ## Emission format
24
 
 
27
  ```jsonc
28
  {
29
  "trigger": "pre-commit",
30
+ "toolbox": "security-sweep",
31
  "plan_file": "/Users/steve/.claude/toolbox-runs/abc123.json",
32
+ "agents": ["security-reviewer", "security-auditor", "penetration-tester"],
33
  "files": ["src/toolbox_verdict.py", "src/tests/test_toolbox_verdict.py"],
34
+ "source": "fresh",
35
  "guardrail": true
36
  }
37
  ```
 
60
  ctx-toolbox run --event pre-commit
61
  ```
62
 
 
 
63
  Then `git config core.hooksPath .githooks`.
64
 
65
  ## file-save path matching
66
 
67
+ `file-save` triggers honor the `trigger.file_save` glob. Without a
68
+ `--path` arg the event matches nothing (there's no file to test). This is
69
+ intentional: file-save toolboxes must be path-scoped.
70
 
71
  ## session-end digest
72
 
docs/toolbox/index.md CHANGED
@@ -24,10 +24,11 @@ Each arrow is a concrete module:
24
  - **Declare**: [`toolbox_config.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_config.py)
25
  loads `~/.claude/toolboxes.json` and merges per-repo `.toolbox.yaml` on top.
26
  - **Trigger**: [`toolbox_hooks.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_hooks.py)
27
- listens for `session-start`, `file-save`, `pre-commit`, `session-end`, and
28
- the `/toolbox run` slash command.
 
29
  - **Plan**: [`council_runner.py`](https://github.com/stevesolun/ctx/blob/main/src/council_runner.py)
30
- assembles a `RunPlan` honoring scope, dedup, and graph-blast expansion.
31
  - **Verdict**: [`toolbox_verdict.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_verdict.py)
32
  merges findings by id and escalates level to max(findings).
33
 
@@ -64,7 +65,8 @@ Or let the `pre-commit` hook fire it automatically — see
64
  | Mode | What gets reviewed | Best for |
65
  |---|---|---|
66
  | `diff` | Files in the current uncommitted diff | Pre-commit, real-time review |
67
- | `dynamic` | Diff + graph blast radius (imports of modified files) | Refactor safety |
 
68
  | `full` | Entire repo | Security sweeps, docs audits |
69
 
70
  ## Related
 
24
  - **Declare**: [`toolbox_config.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_config.py)
25
  loads `~/.claude/toolboxes.json` and merges per-repo `.toolbox.yaml` on top.
26
  - **Trigger**: [`toolbox_hooks.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_hooks.py)
27
+ listens for `session-start`, `file-save`, `pre-commit`, and `session-end`.
28
+ User-initiated `/toolbox run` wrappers use the same toolbox config but do
29
+ not enter through `toolbox_hooks.py`.
30
  - **Plan**: [`council_runner.py`](https://github.com/stevesolun/ctx/blob/main/src/council_runner.py)
31
+ assembles a `RunPlan` honoring scope, budget caps, dedup, and graph-blast expansion.
32
  - **Verdict**: [`toolbox_verdict.py`](https://github.com/stevesolun/ctx/blob/main/src/toolbox_verdict.py)
33
  merges findings by id and escalates level to max(findings).
34
 
 
65
  | Mode | What gets reviewed | Best for |
66
  |---|---|---|
67
  | `diff` | Files in the current uncommitted diff | Pre-commit, real-time review |
68
+ | `dynamic` | Diff by default; graph-blast for tiny diffs when graph edges are available; full repo when no diff exists | General-purpose review |
69
+ | `graph-blast` | Diff plus one graph hop when graph edges are supplied | Refactor safety |
70
  | `full` | Entire repo | Security sweeps, docs audits |
71
 
72
  ## Related
docs/toolbox/starters.md CHANGED
@@ -10,12 +10,13 @@ in `.toolbox.yaml`.
10
 
11
  Runs `code-reviewer`, `security-reviewer`, `architect-review`,
12
  `test-automator`, `performance-engineer`, `accessibility-tester`, and
13
- `docs-lookup` against the diff + graph blast radius.
14
 
15
  - **Triggers**: slash, pre-commit, session-end.
16
- - **Scope**: `dynamic` — diff plus imports of changed modules.
 
17
  - **Budget**: 200 k tokens / 420 seconds.
18
- - **Guardrail**: on (HIGH/CRITICAL blocks pre-commit).
19
 
20
  Best for: shipping a feature branch. The council covers correctness,
21
  security, architecture, testing, performance, accessibility, and docs in
@@ -25,10 +26,10 @@ one pass.
25
 
26
  > **Full-repo security audit with blocking guardrail on HIGH findings.**
27
 
28
- Runs `security-reviewer`, `backend-security-coder`, `frontend-security-coder`,
29
- and `compliance-auditor` against the entire repo.
30
 
31
- - **Triggers**: slash, pre-commit.
32
  - **Scope**: `full` — every tracked file.
33
  - **Budget**: 300 k tokens / 600 seconds.
34
  - **Guardrail**: on.
@@ -40,12 +41,12 @@ Expensive; not a per-commit hook.
40
 
41
  > **Graph-informed refactor review with regression and dead-code checks.**
42
 
43
- Runs `architect-review`, `refactor-cleaner`, `test-automator`, and
44
- `code-reviewer` against diff + graph blast.
45
 
46
- - **Triggers**: slash, pre-commit.
47
- - **Scope**: `dynamic`.
48
- - **Budget**: 120 k tokens / 300 seconds.
49
  - **Guardrail**: off — flags issues without blocking.
50
 
51
  Best for: mid-refactor checkpoints. Catches orphaned code, downstream
@@ -55,12 +56,12 @@ breakage, missing test updates.
55
 
56
  > **Documentation pass: accuracy, completeness, clarity, and API parity.**
57
 
58
- Runs `docs-lookup`, `technical-writer`, and `code-reviewer` against docs
59
- diffs.
60
 
61
- - **Triggers**: slash, pre-commit.
62
  - **Scope**: `diff`.
63
- - **Budget**: 60 k tokens / 180 seconds.
64
  - **Guardrail**: off.
65
 
66
  Best for: docs-heavy branches and README updates.
@@ -73,8 +74,8 @@ Invokes `intent_interview` in interactive mode, then activates whichever
73
  starters the user selects.
74
 
75
  - **Triggers**: slash only.
76
- - **Scope**: `full` (fresh scan of a new repo).
77
- - **Budget**: small — this bundle is just an orchestrator.
78
 
79
  Best for: `git init` followed by `toolbox init`.
80
 
 
10
 
11
  Runs `code-reviewer`, `security-reviewer`, `architect-review`,
12
  `test-automator`, `performance-engineer`, `accessibility-tester`, and
13
+ `docs-lookup` against the dynamic review scope.
14
 
15
  - **Triggers**: slash, pre-commit, session-end.
16
+ - **Scope**: `dynamic` — diff by default, graph-blast for tiny diffs with
17
+ graph edges, full repo when no diff exists.
18
  - **Budget**: 200 k tokens / 420 seconds.
19
+ - **Guardrail**: off.
20
 
21
  Best for: shipping a feature branch. The council covers correctness,
22
  security, architecture, testing, performance, accessibility, and docs in
 
26
 
27
  > **Full-repo security audit with blocking guardrail on HIGH findings.**
28
 
29
+ Runs `security-reviewer`, `security-auditor`, `penetration-tester`,
30
+ `compliance-auditor`, and `threat-detection-engineer` against the entire repo.
31
 
32
+ - **Triggers**: slash, pre-commit, file-save on `**/auth/**`.
33
  - **Scope**: `full` — every tracked file.
34
  - **Budget**: 300 k tokens / 600 seconds.
35
  - **Guardrail**: on.
 
41
 
42
  > **Graph-informed refactor review with regression and dead-code checks.**
43
 
44
+ Runs `architect-review`, `refactor-cleaner`, `code-reviewer`,
45
+ `test-automator`, and `dependency-manager` against graph-blast scope.
46
 
47
+ - **Triggers**: slash, session-end.
48
+ - **Scope**: `graph-blast`.
49
+ - **Budget**: 180 k tokens / 360 seconds.
50
  - **Guardrail**: off — flags issues without blocking.
51
 
52
  Best for: mid-refactor checkpoints. Catches orphaned code, downstream
 
56
 
57
  > **Documentation pass: accuracy, completeness, clarity, and API parity.**
58
 
59
+ Runs `technical-writer`, `docs-architect`, `api-documenter`, and
60
+ `tutorial-engineer` against docs diffs.
61
 
62
+ - **Triggers**: slash, file-save on `**/*.md`.
63
  - **Scope**: `diff`.
64
+ - **Budget**: 120 k tokens / 240 seconds.
65
  - **Guardrail**: off.
66
 
67
  Best for: docs-heavy branches and README updates.
 
74
  starters the user selects.
75
 
76
  - **Triggers**: slash only.
77
+ - **Scope**: `diff`.
78
+ - **Budget**: 100 k tokens / 300 seconds.
79
 
80
  Best for: `git init` followed by `toolbox init`.
81