Stevesolun commited on
Commit
e932c44
·
verified ·
1 Parent(s): 7ca8c24

Sync ctx 0f61777

Browse files

GitHub commit: 0f617779a5a1f11f8714c8f61087eb80c1c492b4

.github/workflows/test.yml CHANGED
@@ -816,13 +816,11 @@ jobs:
816
  lfs: false
817
 
818
  - name: Enforce test-coverage-per-PR policy
819
- # Policy: any product or CI/package contract change
820
- # must be accompanied by at least one test file change in the
821
- # same PR. Exemptions:
822
- # - Pure docs / comment changes (matched by a trivial heuristic)
823
- # - Config JSON (src/config.json) schema changes get tests
824
- # for the accessor, not the JSON itself.
825
- # - Changes ONLY inside __pycache__, .pyc files, etc.
826
  run: |
827
  set -euo pipefail
828
  BASE="${{ github.event.pull_request.base.sha }}"
 
816
  lfs: false
817
 
818
  - name: Enforce test-coverage-per-PR policy
819
+ # Policy: product or CI/package contract changes must include
820
+ # at least one src/tests/ change in the same PR. Exemptions are
821
+ # intentionally narrow and implemented in scripts/ci_no_test_policy.py:
822
+ # release metadata-only changes, or a maintainer-applied
823
+ # no-tests-needed label for changes where tests are genuinely not useful.
 
 
824
  run: |
825
  set -euo pipefail
826
  BASE="${{ github.event.pull_request.base.sha }}"
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-4584_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)
 
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-4606_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)
docs/dashboard.md CHANGED
@@ -225,6 +225,7 @@ per-process monitor token injected into the rendered page.
225
  | `/` | Home: seven stat cards (loaded, sidecars, wiki entities, graph nodes, runtime checks, audit events, sessions), grade distribution pills, recent sessions table, recent audit events |
226
  | `/loaded` | **Currently-loaded skills, agents, MCP servers, and installed harness records** from `~/.claude/skill-manifest.json` plus `~/.claude/harness-installs/*.json`; skill/agent/MCP rows expose supported live actions |
227
  | `/skills` | Every sidecar as a filterable **card grid**: left sidebar (search by slug, grade checkboxes, skill/agent/MCP toggle, hide-floored), card shows grade pill + raw score + links to sidecar/wiki/graph |
 
228
  | `/skill/<slug>` | Full sidecar breakdown: four-signal score (telemetry · intake · graph · routing), hard-floor reason, computed_at timestamp, per-skill audit timeline |
229
  | `/wiki` | **Wiki entity index** - bounded card-grid sample of up to 500 pages per dashboard-supported entity type, merging installed wiki-pack pages with local-only entity files not shadowed by a pack page or tombstone. Includes sharded MCP server pages and flat harness pages. Left sidebar: text search over the visible sample (slug, description, tag), skill/agent/MCP/harness checkboxes. |
230
  | `/wiki/<slug>?type=<entity>` | Dashboard-supported wiki entity page rendered from the merged pack/local source: markdown body + full frontmatter table + grade banner + deep links to sidecar and graph-neighborhood views. The optional `type` query disambiguates duplicate slugs such as `langgraph`; omitted types are inferred from frontmatter or path when possible. |
@@ -250,10 +251,13 @@ per-process monitor token injected into the rendered page.
250
  | `GET /api/sessions.json` | All sessions with aggregated counts |
251
  | `GET /api/manifest.json` | Raw `skill-manifest.json` passthrough |
252
  | `GET /api/status.json` | `{queue, artifacts, telemetry}` payload: durable queue counts/recent jobs, graph/wiki artifact file status and promotion metadata, plus telemetry spool/export health including malformed records and exporter errors |
 
 
253
  | `GET /api/skill/<slug>.json` | Raw sidecar for one slug; missing or unsafe slugs return JSON `{detail: ...}` with HTTP 404 |
254
  | `GET /api/graph/<slug>.json?type=<entity>&hops=1&limit=40` | Dashboard-shaped skill/agent/MCP/harness `{nodes, edges, center}`; `type` is optional but recommended for duplicate slugs, `hops` is [1, 3], `limit` is [5, 150]. |
255
  | `GET /api/kpi.json` | `DashboardSummary` passthrough — `{total, by_subject, grade_counts, lifecycle_counts, category_breakdown, hard_floor_counts, low_quality_candidates, archived, generated_at}`. Returns `{total: 0, detail: "no sidecars yet"}` when the quality directory is empty |
256
  | `GET /api/runtime.json` | Runtime lifecycle summary: source path, validation count, failed/error count, open-escalation count, latest validation, recent validations, open escalations, session IDs, `tool_selection`, `token_usage`, `token_usage_history`, and `recent_tool_usage`. |
 
257
  | `GET /api/config.json` | Effective/default/user config payload used by the Config tab. |
258
  | `GET /api/entities/search.json?q=<text>&type=<entity>&limit=80` | Wiki entity search results for Manage, Config, and entity picker flows, with wiki-relative `path` values. |
259
  | `GET /api/entity/<slug>.json?type=<entity>` | Frontmatter, wiki-relative `path`, and Markdown body for one wiki entity from the same merged pack/local source as `/wiki/<slug>`. |
 
225
  | `/` | Home: seven stat cards (loaded, sidecars, wiki entities, graph nodes, runtime checks, audit events, sessions), grade distribution pills, recent sessions table, recent audit events |
226
  | `/loaded` | **Currently-loaded skills, agents, MCP servers, and installed harness records** from `~/.claude/skill-manifest.json` plus `~/.claude/harness-installs/*.json`; skill/agent/MCP rows expose supported live actions |
227
  | `/skills` | Every sidecar as a filterable **card grid**: left sidebar (search by slug, grade checkboxes, skill/agent/MCP toggle, hide-floored), card shows grade pill + raw score + links to sidecar/wiki/graph |
228
+ | `/skillspector` | SkillSpector audit tab for ctx-run static scan results over skill bodies, with status, severity, tag, graph-family, query, and limit filters plus a link to `/api/skillspector.json` |
229
  | `/skill/<slug>` | Full sidecar breakdown: four-signal score (telemetry · intake · graph · routing), hard-floor reason, computed_at timestamp, per-skill audit timeline |
230
  | `/wiki` | **Wiki entity index** - bounded card-grid sample of up to 500 pages per dashboard-supported entity type, merging installed wiki-pack pages with local-only entity files not shadowed by a pack page or tombstone. Includes sharded MCP server pages and flat harness pages. Left sidebar: text search over the visible sample (slug, description, tag), skill/agent/MCP/harness checkboxes. |
231
  | `/wiki/<slug>?type=<entity>` | Dashboard-supported wiki entity page rendered from the merged pack/local source: markdown body + full frontmatter table + grade banner + deep links to sidecar and graph-neighborhood views. The optional `type` query disambiguates duplicate slugs such as `langgraph`; omitted types are inferred from frontmatter or path when possible. |
 
251
  | `GET /api/sessions.json` | All sessions with aggregated counts |
252
  | `GET /api/manifest.json` | Raw `skill-manifest.json` passthrough |
253
  | `GET /api/status.json` | `{queue, artifacts, telemetry}` payload: durable queue counts/recent jobs, graph/wiki artifact file status and promotion metadata, plus telemetry spool/export health including malformed records and exporter errors |
254
+ | `GET /api/grades.json` | Grade distribution used by the home page: `{grades: {A, B, C, D, F}, total}`, reusing the KPI summary when available and falling back to sidecar counts |
255
+ | `GET /api/sidecars.json?q=<text>&type=<entity>&grade=A&hide_floor=1&limit=50` | Filtered sidecar page payload for `/skills`: matching items, totals, pagination bounds, active type/grade filters, and hide-floor state |
256
  | `GET /api/skill/<slug>.json` | Raw sidecar for one slug; missing or unsafe slugs return JSON `{detail: ...}` with HTTP 404 |
257
  | `GET /api/graph/<slug>.json?type=<entity>&hops=1&limit=40` | Dashboard-shaped skill/agent/MCP/harness `{nodes, edges, center}`; `type` is optional but recommended for duplicate slugs, `hops` is [1, 3], `limit` is [5, 150]. |
258
  | `GET /api/kpi.json` | `DashboardSummary` passthrough — `{total, by_subject, grade_counts, lifecycle_counts, category_breakdown, hard_floor_counts, low_quality_candidates, archived, generated_at}`. Returns `{total: 0, detail: "no sidecars yet"}` when the quality directory is empty |
259
  | `GET /api/runtime.json` | Runtime lifecycle summary: source path, validation count, failed/error count, open-escalation count, latest validation, recent validations, open escalations, session IDs, `tool_selection`, `token_usage`, `token_usage_history`, and `recent_tool_usage`. |
260
+ | `GET /api/skillspector.json?q=<text>&status=<status>&severity=<severity>&tag=<tag>&family=<family>&limit=100` | SkillSpector audit payload for `/skillspector`: summary counts, available filters, filtered records, audit path, and audit availability |
261
  | `GET /api/config.json` | Effective/default/user config payload used by the Config tab. |
262
  | `GET /api/entities/search.json?q=<text>&type=<entity>&limit=80` | Wiki entity search results for Manage, Config, and entity picker flows, with wiki-relative `path` values. |
263
  | `GET /api/entity/<slug>.json?type=<entity>` | Frontmatter, wiki-relative `path`, and Markdown body for one wiki entity from the same merged pack/local source as `/wiki/<slug>`. |
docs/harness/attaching-to-hosts.md CHANGED
@@ -38,6 +38,11 @@ Claude on the next turn, alongside runtime lifecycle tools such as
38
  `ctx__load_entity`, `ctx__mark_entity_used`, and `ctx__session_state`.
39
  Ask "What skills help with FastAPI auth?" and it will call them.
40
 
 
 
 
 
 
41
  ### Claude Agent SDK (Python)
42
 
43
  ```python
@@ -288,8 +293,8 @@ The adapter emits a JSON contract with:
288
  engine;
289
  - `related_recommendations` after the loop passes selected and rejected
290
  recommendation IDs;
291
- - optional harness recommendations only when the loop declares a user-owned,
292
- API, or local model.
293
 
294
  For LoopFlow, keep the `.loop` file in charge and call ctx before the plan:
295
 
@@ -299,6 +304,10 @@ python -m ctx.adapters.loopflow \
299
  --permissions skills,agents,mcps
300
  ```
301
 
 
 
 
 
302
  Add `--last-failure-file .loopflow/last-failure.txt` only after the loop has
303
  written that file; omit it on the first run. The adapter uses that failure text
304
  for recommendation ranking and returns only `context.last_failure_present`, not
@@ -367,11 +376,14 @@ plan_context = recommend_for_loop(
367
  )
368
  ```
369
 
370
- Load only the groups that are explicitly granted in `permissions`. If
371
- `harnesses` is granted without `--own-llm`, `--model-provider`, or `--model`,
372
- the adapter returns a warning and no harness recommendations. The ctx MCP
373
- command and tool list are also permission-filtered; ctx tools that can operate
374
- across all capability groups only appear when all of those groups are granted.
 
 
 
375
 
376
  ---
377
 
 
38
  `ctx__load_entity`, `ctx__mark_entity_used`, and `ctx__session_state`.
39
  Ask "What skills help with FastAPI auth?" and it will call them.
40
 
41
+ For permissioned adapters that should expose only read/query tools, start the
42
+ same server with `--allow-tools` and `--entity-types`. For example,
43
+ `ctx-mcp-server --allow-tools ctx__recommend_bundle,ctx__wiki_search,ctx__wiki_get --entity-types skill,mcp-server`
44
+ limits tool discovery and read results to the named tools and entity types.
45
+
46
  ### Claude Agent SDK (Python)
47
 
48
  ```python
 
293
  engine;
294
  - `related_recommendations` after the loop passes selected and rejected
295
  recommendation IDs;
296
+ - optional harness recommendations only when the loop gives explicit
297
+ user-owned/API/local model consent with `--own-llm` or `own_llm=True`.
298
 
299
  For LoopFlow, keep the `.loop` file in charge and call ctx before the plan:
300
 
 
304
  --permissions skills,agents,mcps
305
  ```
306
 
307
+ `.loop` files can also grant ctx capabilities with
308
+ `ctx grants: skills, mcps, harnesses`. CLI `--permissions` override those file
309
+ grants; when neither is present, the adapter returns no capabilities.
310
+
311
  Add `--last-failure-file .loopflow/last-failure.txt` only after the loop has
312
  written that file; omit it on the first run. The adapter uses that failure text
313
  for recommendation ranking and returns only `context.last_failure_present`, not
 
376
  )
377
  ```
378
 
379
+ Load only the groups that are explicitly granted in `permissions`.
380
+ `--model-provider` and `--model` are ranking metadata, not ownership consent:
381
+ if `harnesses` is granted without `--own-llm`, the adapter returns a warning
382
+ and no harness recommendations. The ctx MCP command and tool list are also
383
+ permission-filtered. A partial `mcps` grant exposes only read-only ctx tools and
384
+ adds `mcp_server.args` with `--allow-tools` / `--entity-types`; lifecycle write
385
+ tools appear only when `skills`, `agents`, `mcps`, and `harnesses` are all
386
+ granted.
387
 
388
  ---
389
 
docs/harness/loopflow-adapter-demo.md CHANGED
@@ -27,6 +27,7 @@ loop "select ctx capabilities":
27
  goal: mcp agent loop local ollama filesystem
28
  look at: the repo plan, AGENTS.md, and the last failure
29
  done when "pytest src/tests/test_loopflow_adapter.py -q" passes
 
30
  each cycle: plan, then act, then observe
31
  when it fails: reflect, then plan again
32
  ```
@@ -87,6 +88,7 @@ stable.
87
  "mcp_server": {
88
  "name": "ctx",
89
  "command": "ctx-mcp-server",
 
90
  "tools": [
91
  "ctx__recommend_bundle",
92
  "ctx__graph_query",
@@ -175,6 +177,7 @@ if ctx_payload["mcp_server"]["command"]:
175
  runner.register_mcp_server(
176
  name=ctx_payload["mcp_server"]["name"],
177
  command=ctx_payload["mcp_server"]["command"],
 
178
  )
179
 
180
  if ctx_payload["loopflow"]["use_skills"]:
@@ -193,14 +196,28 @@ logic, and ctx refreshes recommendations based on what just failed.
193
  The adapter fails closed:
194
 
195
  - `--permissions skills` only returns skill recommendations.
196
- - `--permissions mcps` only returns MCP server recommendations unless all
197
- capability groups are granted, which lets ctx MCP tools operate safely across
198
- skills, agents, MCPs, and harnesses.
199
- - `--permissions harnesses` returns no harnesses unless `--own-llm`,
200
- `--model-provider`, or `--model` is present.
 
 
 
201
  - `agent_loop.harness_install` is always a `--dry-run` command. It shows what
202
  would be installed; it does not mutate the host.
203
 
 
 
 
 
 
 
 
 
 
 
 
204
  This lets a LoopFlow user decide whether a loop may use skills, agents, MCPs,
205
  or harnesses without giving ctx authority to bypass the loop's own gates.
206
 
 
27
  goal: mcp agent loop local ollama filesystem
28
  look at: the repo plan, AGENTS.md, and the last failure
29
  done when "pytest src/tests/test_loopflow_adapter.py -q" passes
30
+ ctx grants: skills, mcps, harnesses
31
  each cycle: plan, then act, then observe
32
  when it fails: reflect, then plan again
33
  ```
 
88
  "mcp_server": {
89
  "name": "ctx",
90
  "command": "ctx-mcp-server",
91
+ "args": [],
92
  "tools": [
93
  "ctx__recommend_bundle",
94
  "ctx__graph_query",
 
177
  runner.register_mcp_server(
178
  name=ctx_payload["mcp_server"]["name"],
179
  command=ctx_payload["mcp_server"]["command"],
180
+ args=ctx_payload["mcp_server"]["args"],
181
  )
182
 
183
  if ctx_payload["loopflow"]["use_skills"]:
 
196
  The adapter fails closed:
197
 
198
  - `--permissions skills` only returns skill recommendations.
199
+ - `--permissions mcps` returns MCP server recommendations and exposes only
200
+ read-only ctx MCP tools: recommendation, graph query, and wiki lookup.
201
+ - Lifecycle MCP tools such as load, mark-used, validation, escalation, unload,
202
+ and session tools are exposed only when all capability groups are granted:
203
+ `skills`, `agents`, `mcps`, and `harnesses`.
204
+ - `--permissions harnesses` returns no harnesses unless `--own-llm` is present.
205
+ `--model-provider` and `--model` improve ranking and dry-run command metadata;
206
+ they are not user-owned model consent.
207
  - `agent_loop.harness_install` is always a `--dry-run` command. It shows what
208
  would be installed; it does not mutate the host.
209
 
210
+ `.loop` files can request ctx grants with one small line:
211
+
212
+ ```loop
213
+ ctx grants: skills, mcps, harnesses
214
+ ```
215
+
216
+ CLI/API grants take precedence. If the command passes `--permissions`, those
217
+ grants replace the `.loop` line. If the API caller passes `permissions=...`,
218
+ that explicit set is authoritative. If neither is present, the `.loop` grants
219
+ are used; if none are present anywhere, the adapter returns no capabilities.
220
+
221
  This lets a LoopFlow user decide whether a loop may use skills, agents, MCPs,
222
  or harnesses without giving ctx authority to bypass the loop's own gates.
223
 
docs/index.md CHANGED
@@ -17,9 +17,10 @@ burn fewer tokens and local models waste less CPU/GPU work.
17
  Watches what you develop, walks a knowledge graph of **68,494 skill pages, 467 agents, 10,790 MCP servers, and 207 cataloged harnesses**, and recommends the
18
  right execution bundle on the fly. The live execution bundle is skills,
19
  agents, and MCP servers only; custom/API/local model users and external loop
20
- adapters get separate harness recommendations based on model choice and task
21
- goal. You decide what to load, install, or adopt. Powered by a Karpathy LLM wiki
22
- with persistent memory that gets smarter every session.
 
23
 
24
  !!! tip "Install"
25
 
@@ -145,9 +146,9 @@ graph-based discovery:
145
  agents, and MCP servers in real time — **nothing loads or
146
  installs without your approval**.
147
  - During custom/API/local model onboarding and LoopFlow/agent-loop adapter
148
- calls, `ctx-init`, `ctx-harness-install`, and
149
- `python -m ctx.adapters.loopflow` use the same graph to recommend harnesses
150
- above the configured harness match floor.
151
 
152
  The result: you always know what skills, agents, and MCP servers are available
153
  for your current task, and which harness fits when you choose your own model.
@@ -235,7 +236,7 @@ ones are flagged. New ones self-ingest.
235
  ---
236
 
237
  Current main is **v1.0.21** — MIT, CI-matrixed (Ubuntu 3.12 plus Windows/macOS 3.11/3.12),
238
- 4,584 test inventory. Adds enterprise OpenTelemetry-ready telemetry and
239
  ships console scripts including `ctx-init`,
240
  `ctx-monitor` (local dashboard with graph + wiki + load/unload for
241
  skills, agents, and MCP servers, plus Harness Setup for user-owned LLMs),
 
17
  Watches what you develop, walks a knowledge graph of **68,494 skill pages, 467 agents, 10,790 MCP servers, and 207 cataloged harnesses**, and recommends the
18
  right execution bundle on the fly. The live execution bundle is skills,
19
  agents, and MCP servers only; custom/API/local model users and external loop
20
+ adapters get separate harness recommendations after explicit user-owned model
21
+ consent, ranked by model choice and task goal. You decide what to load,
22
+ install, or adopt. Powered by a Karpathy LLM wiki with persistent memory that
23
+ gets smarter every session.
24
 
25
  !!! tip "Install"
26
 
 
146
  agents, and MCP servers in real time — **nothing loads or
147
  installs without your approval**.
148
  - During custom/API/local model onboarding and LoopFlow/agent-loop adapter
149
+ calls with explicit user-owned model consent, `ctx-init`,
150
+ `ctx-harness-install`, and `python -m ctx.adapters.loopflow` use the same
151
+ graph to recommend harnesses above the configured harness match floor.
152
 
153
  The result: you always know what skills, agents, and MCP servers are available
154
  for your current task, and which harness fits when you choose your own model.
 
236
  ---
237
 
238
  Current main is **v1.0.21** — MIT, CI-matrixed (Ubuntu 3.12 plus Windows/macOS 3.11/3.12),
239
+ 4,606 test inventory. Adds enterprise OpenTelemetry-ready telemetry and
240
  ships console scripts including `ctx-init`,
241
  `ctx-monitor` (local dashboard with graph + wiki + load/unload for
242
  skills, agents, and MCP servers, plus Harness Setup for user-owned LLMs),
docs/knowledge-graph.md CHANGED
@@ -215,9 +215,11 @@ The graph backs these recommendation paths:
215
  those records, the same recommender falls back to the index file.
216
  - Harness recommendations are a separate path for custom/API/local
217
  model onboarding (`ctx-init --model-mode custom ...`),
218
- `ctx-harness-install`, and LoopFlow/agent-loop adapter calls that declare a
219
- user-owned/API/local model. They use the same graph filtered to `harness`
220
- nodes and the higher harness match floor from `config.json`.
 
 
221
  - Repository scans still start from stack detections, then turn that profile
222
  into the same tag/query bundle used by the execution recommender. If a
223
  shipped graph is unavailable, scan output falls back to the legacy installed
@@ -273,6 +275,10 @@ Pack directories live inside the installed wiki:
273
  wiki-packs/overlay-<id>/
274
  ```
275
 
 
 
 
 
276
  Overlay packs are the normal local-update path. Full rebuilds are still needed
277
  when you intentionally refresh the release artifact, change global scoring
278
  configuration, rebuild communities, or compact a long chain of overlays into a
@@ -434,6 +440,9 @@ JSON, graph-pack node/edge metadata, markdown members, and merged wiki-pack
434
  markdown must not contain host-user paths; markdown members are capped at
435
  10 MiB; local generated markdown such as `catalog.md`, `converted-index.md`,
436
  `log.md`, and `versions-catalog.md` must stay out of the full archive.
 
 
 
437
 
438
  ## Current artifact record
439
 
@@ -448,7 +457,7 @@ the wiki content and the checked-in graph build configuration.
448
 
449
  ## Pre-ship gates
450
 
451
- Two advisory gates run before the tarball is repackaged. Both produce
452
  review reports and never auto-modify the inventory.
453
 
454
  - **`ctx-dedup-check`** — flags entity pairs (skill ↔ skill, skill ↔
 
215
  those records, the same recommender falls back to the index file.
216
  - Harness recommendations are a separate path for custom/API/local
217
  model onboarding (`ctx-init --model-mode custom ...`),
218
+ `ctx-harness-install`, and LoopFlow/agent-loop adapter calls that pass
219
+ explicit user-owned/API/local model consent. Model/provider fields can
220
+ improve ranking, but the LoopFlow adapter does not treat them as consent by
221
+ themselves. Harness paths use the same graph filtered to `harness` nodes and
222
+ the higher harness match floor from `config.json`.
223
  - Repository scans still start from stack detections, then turn that profile
224
  into the same tag/query bundle used by the execution recommender. If a
225
  shipped graph is unavailable, scan output falls back to the legacy installed
 
275
  wiki-packs/overlay-<id>/
276
  ```
277
 
278
+ Pack manifests require every checksum value to be a lowercase 64-character
279
+ SHA-256 hex digest. Non-hex placeholders are rejected before merged graph/wiki
280
+ readers can trust the pack contents.
281
+
282
  Overlay packs are the normal local-update path. Full rebuilds are still needed
283
  when you intentionally refresh the release artifact, change global scoring
284
  configuration, rebuild communities, or compact a long chain of overlays into a
 
440
  markdown must not contain host-user paths; markdown members are capped at
441
  10 MiB; local generated markdown such as `catalog.md`, `converted-index.md`,
442
  `log.md`, and `versions-catalog.md` must stay out of the full archive.
443
+ When a shipped root artifact has sibling promotion metadata, validation also
444
+ checks the `current` snapshot against the actual artifact size and SHA-256 so
445
+ stale promotion records cannot describe a different file.
446
 
447
  ## Current artifact record
448
 
 
457
 
458
  ## Pre-ship gates
459
 
460
+ Three advisory gates run before the tarball is repackaged. All three produce
461
  review reports and never auto-modify the inventory.
462
 
463
  - **`ctx-dedup-check`** — flags entity pairs (skill ↔ skill, skill ↔
docs/plans/ctx-agent-reviewer-workbench.md ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ctx Agent-Reviewer Workbench
2
+
3
+ This plan adapts the Claude Science actor-critic pattern to ctx review work.
4
+ The source pattern is a coordinator agent that delegates to specialists, while
5
+ separate reviewer agents check evidence, traceability, calculations, and
6
+ artifact correctness:
7
+ <https://www.anthropic.com/news/claude-science-ai-workbench>.
8
+
9
+ This is an internal execution plan. It is intentionally kept under
10
+ `docs/plans/`, which `mkdocs.yml` excludes from public docs.
11
+
12
+ ## Goal
13
+
14
+ Review ctx with paired agents that behave like production review teams:
15
+
16
+ 1. An actor agent discovers, tests, or proposes the review artifact.
17
+ 2. A critic agent independently checks the artifact against code, tests, docs,
18
+ and user-visible behavior.
19
+ 3. The CTO orchestrator merges only evidence-backed findings into the canonical
20
+ trackers.
21
+ 4. Fixes land as small commits. No rushed PRs. No long no-mistakes runs until
22
+ the fix batch is ready.
23
+
24
+ ## Non-Goals
25
+
26
+ - Do not create a PR during this review setup phase.
27
+ - Do not run no-mistakes as the default review loop.
28
+ - Do not replace `qa/bug_smoke_status.csv` or `qa/feature_status.csv`.
29
+ - Do not let specialist notes become new canonical trackers.
30
+ - Do not accept "tests passed" as evidence unless the behavior under review is
31
+ directly demonstrated.
32
+
33
+ ## CTX Review Workbench Team
34
+
35
+ ### CTO Orchestrator
36
+
37
+ Owns scope, task graph, conflicts, and merge criteria.
38
+
39
+ Inputs:
40
+
41
+ - `qa/feature_status.csv`.
42
+ - `qa/bug_smoke_status.csv`.
43
+ - CI/no-mistakes evidence.
44
+ - Repo tree.
45
+
46
+ Output:
47
+
48
+ - One canonical review board with owner, status, evidence path, and blocker
49
+ state, derived from the canonical CSVs. Do not create a third tracker file.
50
+
51
+ ### Feature Mapper + Feature Reviewer
52
+
53
+ Mapper discovers every product capability: CLI, MCP server, dashboard,
54
+ telemetry, graph/wiki, skills, agents, harnesses, and Loopflow adapter.
55
+
56
+ Reviewer checks every discovered feature has a user story, expected behavior,
57
+ test evidence, and tracker row.
58
+
59
+ ### Runtime/API/MCP Agent + Contract Reviewer
60
+
61
+ Agent reviews `src/ctx/api.py`, `src/ctx/mcp_server`, generic adapters, tool
62
+ router, and lifecycle flows.
63
+
64
+ Reviewer checks API schemas, backwards compatibility, permissions, error
65
+ behavior, and trace propagation.
66
+
67
+ ### Telemetry/Enterprise Agent + Privacy Reviewer
68
+
69
+ Agent reviews OTel-style traces/metrics/logs, token usage KPIs, exporters,
70
+ retention, and local defaults.
71
+
72
+ Reviewer checks redaction, hashed error handling, salt boundaries, exporter
73
+ config safety, and enterprise runbook gaps.
74
+
75
+ ### Dashboard/UX Agent + UX Critic
76
+
77
+ Agent walks dashboard pages and user flows.
78
+
79
+ Critic checks broken links, misleading states, graph/LLM-wiki/dashboard health,
80
+ visual regressions, and empty/error states.
81
+
82
+ ### Graph/Wiki/Recommendation Agent + Evidence Reviewer
83
+
84
+ Agent reviews graph artifacts, wiki packs, skill/agent/MCP recommendations, and
85
+ subgroup selection behavior.
86
+
87
+ Reviewer checks recommendations are explainable, reproducible,
88
+ permission-aware, and backed by tests.
89
+
90
+ ### QA/Test Gate Agent + Gate Critic
91
+
92
+ Agent runs local-fast, focused pytest, CI classifier, no-test policy,
93
+ no-mistakes, and PR checks.
94
+
95
+ Critic checks bottlenecks, flaky tests, overbroad gates, missing fixtures, and
96
+ whether evidence is real or just "tests passed."
97
+
98
+ ### Security/Supply Chain Agent + Red-Team Reviewer
99
+
100
+ Agent scans install scripts, sync/HF paths, tokens/secrets, LFS/artifacts, and
101
+ external tool ingestion.
102
+
103
+ Reviewer tries adversarial cases: malicious skill/MCP metadata, path traversal,
104
+ unsafe exporters, and poisoned DSL/tool manifests.
105
+
106
+ ### Docs/Runbook Agent + Docs Reviewer
107
+
108
+ Agent validates docs against code behavior.
109
+
110
+ Reviewer checks every doc claim has command/test/source evidence and flags stale
111
+ prose or unsupported marketing language.
112
+
113
+ ### Loopflow/DSL Integration Agent + DSL Author Reviewer
114
+
115
+ Agent designs the Loopflow adapter surface: permissions, harnesses, skills,
116
+ MCPs, agents, recommendations, and agent loops.
117
+
118
+ Reviewer evaluates from the Loopflow owner's view: "Would I trust ctx as a
119
+ recommendation/runtime layer without losing control of my DSL?"
120
+
121
+ ## Operating Loop
122
+
123
+ Each pair produces:
124
+
125
+ - finding
126
+ - evidence
127
+ - repro
128
+ - risk
129
+ - fix recommendation
130
+ - reviewer verdict
131
+
132
+ Then CTO merges them into:
133
+
134
+ - canonical tracker updates
135
+ - prioritized fix batches
136
+ - local-fast/no-mistakes validation plan
137
+ - PR-ready changelog
138
+
139
+ ## Operating Principles
140
+
141
+ - Keep one coordinator. The CTO owns scope, conflicts, ordering, and commit
142
+ boundaries.
143
+ - Keep agents paired. Every actor output gets an independent critic pass before
144
+ it becomes a finding.
145
+ - Keep evidence portable. Findings must include file paths, commands, observed
146
+ output, screenshots when visual, or generated artifacts when behavior is not
147
+ visible in logs.
148
+ - Keep trackers canonical. Feature coverage updates go to
149
+ `qa/feature_status.csv`; bug, smoke, UX, and garbage-code findings go to
150
+ `qa/bug_smoke_status.csv`.
151
+ - Keep fixes separate. Review findings first, fix batches second.
152
+ - Keep validation cheap until ready. Use focused tests and `local-fast`; reserve
153
+ no-mistakes and PR CI for the final integrated batch.
154
+
155
+ ## Canonical Tracker Hygiene
156
+
157
+ Before any agent or CTO step writes tracker rows, validate the canonical CSVs:
158
+
159
+ - Parse `qa/feature_status.csv` as CSV and require unique non-empty
160
+ `feature_id` values.
161
+ - Parse `qa/bug_smoke_status.csv` as CSV and require unique non-empty
162
+ `finding_id` values.
163
+ - Check proposed new row keys against both files before writing; collisions
164
+ must become `needs-cto-review`, not silent overwrites.
165
+ - Check stale status/evidence markers before writing: historical phrases such
166
+ as `pending no-mistakes`, bare `TODO`, obsolete blocker text, or retest claims
167
+ without matching `last_verified_at` and evidence.
168
+ - If a stale row is found, preserve the old text in review notes, add current
169
+ evidence, and update status only after the critic verifies the behavior.
170
+ - Treat the "canonical review board" as a derived view over these CSVs with
171
+ owner, status, evidence path, and blocker state. Do not create a separate
172
+ board file unless the user explicitly approves it.
173
+
174
+ ## CTO Orchestrator
175
+
176
+ The CTO orchestrator owns the shared review board and makes final calls.
177
+
178
+ Inputs:
179
+
180
+ - Current branch and diff.
181
+ - `qa/feature_status.csv`.
182
+ - `qa/bug_smoke_status.csv`.
183
+ - `docs/qa/feature-user-story-status.csv`.
184
+ - `docs/qa/dashboard-user-story-status.csv`.
185
+ - Local-fast timing evidence in `.gate/local-fast.json` when available.
186
+ - CI/no-mistakes evidence only when intentionally run.
187
+
188
+ Outputs:
189
+
190
+ - Updated canonical trackers.
191
+ - A prioritized fix queue.
192
+ - Small commit boundaries.
193
+ - A final "ready for big PR" report.
194
+
195
+ Decision rules:
196
+
197
+ - If actor and critic disagree, the finding stays `needs-cto-review`.
198
+ - If the critic cannot reproduce, the finding stays `needs-evidence`.
199
+ - If a behavior needs product judgment, the finding is `human-decision`.
200
+ - If a fix would touch more than 5 files, split it into phases before coding.
201
+
202
+ ## Evidence Contract
203
+
204
+ Every pair returns this shape:
205
+
206
+ ```yaml
207
+ pair: string
208
+ surface: string
209
+ status: pass | finding | blocked | human-decision
210
+ finding:
211
+ summary: string
212
+ category: feature-gap | bug | ux | security | docs | gate | architecture | none
213
+ evidence:
214
+ files: []
215
+ commands: []
216
+ artifacts: []
217
+ observed_output: []
218
+ risk:
219
+ severity: critical | high | medium | low | info
220
+ blast_radius: string
221
+ repro:
222
+ steps: []
223
+ fix_recommendation:
224
+ scope: string
225
+ suggested_files: []
226
+ validation: []
227
+ reviewer_verdict:
228
+ status: accepted | needs-evidence | duplicate | human-decision | invalid
229
+ notes: string
230
+ tracker_update:
231
+ file: qa/feature_status.csv | qa/bug_smoke_status.csv | none
232
+ row_key: string
233
+ ```
234
+
235
+ The CTO may reject any result without concrete evidence.
236
+
237
+ ## Detailed Pair Contracts
238
+
239
+ The canonical team roster is `CTX Review Workbench Team` above. This section
240
+ adds execution contracts only, so agents do not maintain a second divergent
241
+ team list.
242
+
243
+ | Canonical pair | First local review focus | Primary tracker target |
244
+ | --- | --- | --- |
245
+ | QA/Test Gate Agent + Gate Critic | Run `scripts/no_mistakes_run.sh fast`, focused pytest, CI classifier checks, no-test policy checks, and local gate timing summaries. Identify slow, flaky, redundant, or missing local gates. Separate local CPU bottlenecks from GitHub-hosted runner delays and no-mistakes agent overhead. | `qa/bug_smoke_status.csv` for gate findings |
246
+ | Feature Mapper + Feature Reviewer | Discover user-visible features, map each to current tests/docs, and reject vague or duplicate rows. | `qa/feature_status.csv`; missing-story findings in `qa/bug_smoke_status.csv` |
247
+ | Runtime/API/MCP Agent + Contract Reviewer | Exercise API and MCP boundaries from a user perspective; check schema stability, error payloads, backwards compatibility, permissions, and trace propagation. | `qa/bug_smoke_status.csv` for contract gaps |
248
+ | Telemetry/Enterprise Agent + Privacy Reviewer | Verify traces, metrics, logs, events, token usage KPIs, exporters, retention, local defaults, redaction, hashed errors, salt boundaries, and exporter opt-in safety. | `qa/bug_smoke_status.csv` for telemetry/privacy gaps |
249
+ | Dashboard/UX Agent + UX Critic | Walk dashboard pages and capture browser evidence for visual or interaction findings. Reject visual UX findings without screenshot or rendered artifact evidence. | `qa/bug_smoke_status.csv` for UX findings |
250
+ | Graph/Wiki/Recommendation Agent + Evidence Reviewer | Verify graph artifacts, wiki packs, recommendations, subgroup selection, explainability, permission awareness, and LFS hydration expectations. | `qa/bug_smoke_status.csv` for graph/recommendation findings |
251
+ | Security/Supply Chain Agent + Red-Team Reviewer | Review install scripts, Hugging Face sync, Git LFS artifacts, external imports, MCP ingestion, exporters, generated artifacts, and adversarial skill/MCP/DSL inputs. | `qa/bug_smoke_status.csv` for security findings |
252
+ | Docs/Runbook Agent + Docs Reviewer | Compare docs to code behavior and reject unsupported claims, stale prose, or instructions without command/test/source evidence. | `qa/bug_smoke_status.csv` for docs drift |
253
+ | Loopflow/DSL Integration Agent + DSL Author Reviewer | Check permissions, harnesses, skills, MCPs, agents, recommendations, and agent loops from the DSL author's perspective. | `qa/bug_smoke_status.csv` for adapter UX/permission findings |
254
+
255
+ ## First Wave
256
+
257
+ Run these pairs first because local-fast is the review bottleneck reducer and
258
+ tracker hygiene must be clean before broader feature mapping:
259
+
260
+ 1. QA/Test Gate Agent + Gate Critic.
261
+ 2. Feature Mapper + Feature Reviewer.
262
+ 3. Runtime/API/MCP Agent + Contract Reviewer.
263
+ 4. Telemetry/Enterprise Agent + Privacy Reviewer.
264
+ 5. Loopflow/DSL Integration Agent + DSL Author Reviewer.
265
+
266
+ First-wave success criteria:
267
+
268
+ - Local-fast lanes are run first and `.gate/local-fast.json` is inspected.
269
+ - Canonical tracker IDs are checked for collisions before any row update.
270
+ - Stale tracker status/evidence text is identified before any row update.
271
+ - Every reviewed surface has a row or explicit deferral in canonical trackers.
272
+ - Every finding has repro evidence.
273
+ - Every fix candidate has a scoped validation command.
274
+ - No PR is opened.
275
+ - No no-mistakes run is started.
276
+ - At least one commit records the review plan and tracker updates.
277
+
278
+ ## Subagent Prompt Template
279
+
280
+ Use this template for each actor:
281
+
282
+ ```text
283
+ You are the ACTOR for <pair name>. Work only in ctx. Inspect the named surface.
284
+ Return findings using docs/plans/ctx-agent-reviewer-workbench.md Evidence
285
+ Contract. Do not fix code. Do not create trackers. Use existing canonical
286
+ trackers only. Include exact files, commands, and observed behavior.
287
+ ```
288
+
289
+ Use this template for each critic:
290
+
291
+ ```text
292
+ You are the CRITIC for <pair name>. Review the actor output. Verify against
293
+ code, docs, tests, and artifacts. Reject weak evidence. Mark each item as
294
+ accepted, needs-evidence, duplicate, human-decision, or invalid. Do not fix
295
+ code. Do not create trackers.
296
+ ```
297
+
298
+ Use this template for the CTO:
299
+
300
+ ```text
301
+ Merge actor and critic outputs. Update only canonical trackers. Split accepted
302
+ fixes into small commits. Keep no-mistakes and PRs out of scope until the user
303
+ approves the final integrated validation phase.
304
+ ```
305
+
306
+ ## Commit Policy
307
+
308
+ - Commit review infrastructure separately from bug fixes.
309
+ - Commit tracker updates separately from code fixes.
310
+ - Commit each fix batch by surface.
311
+ - Do not open PRs until the user asks.
312
+ - Do not run no-mistakes until the user asks or the final integrated batch is
313
+ ready.
314
+
315
+ ## Fast Validation
316
+
317
+ Use these checks for review-plan-only commits:
318
+
319
+ ```bash
320
+ python -m mkdocs build --strict
321
+ scripts/no_mistakes_run.sh fast --lane cheap --lane docs
322
+ ```
323
+
324
+ Use broader local validation only when tracker updates or code fixes justify it.
docs/qa/feature-user-story-status.csv CHANGED
@@ -47,7 +47,7 @@ CLI-045,CLI,Backup mirror CLI,"python -m backup_mirror create, snapshot-if-chang
47
  CLI-046,CLI,Generic harness planner evaluator and contract modes,"ctx run --planner, ctx run --evaluator, ctx run --contract","src/ctx/cli/run.py, src/tests/test_harness_planner.py, src/tests/test_harness_evaluator.py, src/tests/test_harness_contract.py",As a model-agnostic harness user I can run planning evaluation and contract review modes,ctx.cli.run exposes --planner --evaluator and --contract modes while preserving session and runtime semantics,Provider fixture or local test provider available,"python -m pytest src/tests/test_harness_planner.py src/tests/test_harness_evaluator.py src/tests/test_harness_contract.py -q",Tested Pass,harness planner evaluator and contract tests cover CLI parser runtime dispatch and persisted outputs.,,,,,2026-06-29,Split from broad CLI-001 so deep ctx.cli.run modes are explicit.
48
  CLI-047,CLI,Resume MCP restoration safety,ctx resume --restore-session-mcp and credential_env,src/ctx/cli/run.py and src/tests/test_harness_cli_run.py,As a returning harness user I can resume without restoring executable MCP metadata unless I opt in,ctx resume skips recorded MCP command and env metadata by default restores credential_env only with explicit --restore-session-mcp and emits previous trace correlation when available,Recorded session fixture,python -m pytest src/tests/test_harness_cli_run.py -q,Retested Pass,PASS: test_harness_cli_run.py covers default skip restore opt-in credential_env behavior failed resume telemetry and previous_trace_id correlation.,AUDIT-018,Early ctx resume failures and resumed sessions lacked reliable previous trace correlation telemetry.,Fixed,PASS: .venv/bin/pytest src/tests/test_harness_cli_run.py -q --tb=short -> 73 passed.,2026-07-05,Tracks resume security and trace correlation semantics inside broad CLI-001.
49
  CLI-048,CLI,Harness update and uninstall controls,ctx-harness-install --update and ctx-harness-install --uninstall,src/harness_install.py and src/tests/test_harness_install.py,As a harness user I can dry-run update or uninstall an installed harness safely,Update and uninstall flows detect installed harness state show planned changes and avoid destructive surprises,Installed harness fixture,python -m pytest src/tests/test_harness_install.py -q,Tested Pass,test_harness_install.py covers update dry-run uninstall safety and missing-record behavior.,,,,,2026-06-29,Split from CLI-026 so install recommend update and uninstall semantics are separately tracked.
50
- CLI-049,CLI,LoopFlow and agent-loop adapter,python -m ctx.adapters.loopflow,src/ctx/adapters/loopflow.py and src/tests/test_loopflow_adapter.py,As a DSL runner or custom agent-loop author I can ask ctx for scoped planning capabilities before each loop plan,Adapter emits a JSON contract with permission-gated skills agents MCPs ctx MCP server metadata and gated harness recommendations only when a user-owned/API/local model is declared,Graph/wiki available or recommendation functions mocked,python -m pytest src/tests/test_loopflow_adapter.py -q,Tested Pass,test_loopflow_adapter.py covers loop-file parsing permission filtering MCP tool metadata harness gating shell-quoted harness install commands CLI JSON output and empty permission fail-closed behavior.,,,,,2026-06-30,Tracks the module entry point documented in docs/harness/attaching-to-hosts.md.
51
  HOOK-001,Hooks,Backup PostToolUse runtime hook,hooks/backup_on_change.py,hooks/backup_on_change.py and src/tests/test_quality_hook.py,As a Claude Code user I can snapshot tracked config changes from a PostToolUse hook,The hook reads stdin JSON detects tracked files runs snapshot-if-changed and always exits 0 so edits are not blocked,Temp Claude home and tracked config fixture needed,python -m pytest src/tests/test_quality_hook.py -q,Tested Pass,test_quality_hook.py covers root backup hook stdin parsing tracked-file dispatch snapshot reason shaping and nonblocking exit even when snapshot returns nonzero.,,,,,2026-06-30,Validated in Phase 2 runtime hook behavior slice without increasing the test inventory count.
52
  HOOK-002,Hooks,Quality Stop runtime hook,hooks/quality_on_session_end.py,hooks/quality_on_session_end.py and src/tests/test_quality_hook.py,As a Claude Code user I can refresh touched skill quality on session stop without blocking shutdown,The hook reads event state recomputes bounded touched slugs advances state only after successful recompute writes audit session rows and always exits 0,Temp Claude home and skill event fixture needed,python -m pytest src/tests/test_quality_hook.py -q,Tested Pass,test_quality_hook.py covers touched slug selection state cutoff max slug cap missing file behavior and failed recompute exit zero without state advancement.,,,,,2026-07-05,Validated after checkpoint hardening for recompute failures.
53
  PYAPI-001,Python API,Public Python API,ctx.api and ctx top-level re-exports,src/ctx/api.py and src/ctx/__init__.py,As a harness author I can import ctx from Python without depending on internal modules,recommend_bundle recommend_related graph_query wiki_search wiki_get list_all_entities default_wiki_dir and CtxCoreToolbox keep stable signatures safe defaults and top-level re-exports,Runtime wiki or synthetic fixture available,pytest src/tests/test_public_api.py -q,Tested Pass,test_public_api.py covers __all__ exports top-level re-exports signatures happy paths empty paths and telemetry privacy payloads.,,,,,2026-07-02,Added during canonical feature inventory gap pass and updated when related recommendations became public API.
@@ -139,7 +139,7 @@ SEC-002,Distribution,No-mistakes development gate,no-mistakes axi run,imported-s
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 snapshot files; temp backup fixture with BOM manifest printed entries and OK coverage; focused pytest passed.,CTX-AZ-008; CTX-QA-034,Backup audit previously rejected UTF-8 BOM manifests and treated --help as a snapshot path,Fixed by utf-8-sig manifest reads and snapshot-free help parsing in PR #210,PASS: /tmp/ctx-verify-venv/bin/python scripts/audit_backup.py --help; focused pytest 62 passed 1 skipped; no-mistakes run 01KWFXQTHJ83VNZ9ZJGMTAJPWC checks-passed.,2026-07-02,Read-only reporting; --help is snapshot-free and does not repair backup gaps.
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 similarity telemetry and CI workflow changes conservatively,CI classifier tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers path classes workflow contract behavior and ci_changed output use.,,,,,2026-07-06,Validated by focused pytest in this tracker slice including CI workflow classification.
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 including release sync and graph artifact maintainer scripts that omit matching tests while only allowing metadata-only releases when diff hunks prove version or stats-only edits,CI policy tests available,python -m pytest src/tests/test_ci_classifier.py src/tests/test_ci_preflight.py -q,Tested Pass,CI policy and preflight suites cover contract files release metadata exceptions and rejection when diff context is missing.,,,,,2026-07-05,Validated after preflight started passing real per-file diffs to the policy helper and after maintainer script contract coverage expanded.
143
  MAINT-005,Maintainer,Required CI aggregate,scripts/ci_required.py,scripts/ci_required.py and .github/workflows/test.yml,As a branch maintainer I can trust the required CI summary,Aggregate rejects failed missing or wrongly skipped required jobs including skipped full pytest matrix on CI workflow PRs while allowing documented conditional skips,CI required tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers required job dependency success failure conditional skip cases and ci-changed PR full-matrix skip rejection.,,,,,2026-07-06,Validated by focused pytest in this tracker slice including CI workflow PR matrix skip rejection.
144
  MAINT-006,Maintainer,CI preflight gate,scripts/ci_preflight.py,scripts/ci_preflight.py scripts/ci_classifier.py and scripts/local_fast_gate.py,As a contributor I can run the same preflight logic locally that CI uses,"Preflight classifies changes then emits source static gates (ruff format/check, ruff lint, mypy, pip check), public docs tracker including bug-smoke, feature, dashboard, and toolbox coverage, strict build, graph, browser, package, and similarity gates required; local-fast groups those same checks into isolated parallel worktree lanes before the serial gate",Repo checkout with git available,Run scripts/ci_preflight.py against representative changed files; run scripts/no_mistakes_run.sh fast before PR validation,Tested Pass,"select_checks and workflow parity coverage confirm the public docs tracker includes bug-smoke, feature, dashboard, and toolbox checks before strict MkDocs build; local_fast_gate grouping coverage confirms graph hydration stays with graph validation and source changes split across independent lanes.",,,,,2026-07-06,Validated through focused preflight tests and the first real local-fast run which exposed missing tracker coverage before the final serial gate.
145
  MAINT-007,Maintainer,Clean host contract script,scripts/clean_host_contract.py,scripts/clean_host_contract.py and .github/workflows/clean-host-contract.yml,As a new installer I can smoke ctx on a clean host,Script builds a clean venv installs ctx and runs init scan harness and monitor checks,Network and clean temp venv available,GitHub clean-host contract or local script smoke,Tested Pass,Clean host contract job passed inside PR #195 required checks.,,,,,2026-06-23,Workflow evidence covers the script path.
 
47
  CLI-046,CLI,Generic harness planner evaluator and contract modes,"ctx run --planner, ctx run --evaluator, ctx run --contract","src/ctx/cli/run.py, src/tests/test_harness_planner.py, src/tests/test_harness_evaluator.py, src/tests/test_harness_contract.py",As a model-agnostic harness user I can run planning evaluation and contract review modes,ctx.cli.run exposes --planner --evaluator and --contract modes while preserving session and runtime semantics,Provider fixture or local test provider available,"python -m pytest src/tests/test_harness_planner.py src/tests/test_harness_evaluator.py src/tests/test_harness_contract.py -q",Tested Pass,harness planner evaluator and contract tests cover CLI parser runtime dispatch and persisted outputs.,,,,,2026-06-29,Split from broad CLI-001 so deep ctx.cli.run modes are explicit.
48
  CLI-047,CLI,Resume MCP restoration safety,ctx resume --restore-session-mcp and credential_env,src/ctx/cli/run.py and src/tests/test_harness_cli_run.py,As a returning harness user I can resume without restoring executable MCP metadata unless I opt in,ctx resume skips recorded MCP command and env metadata by default restores credential_env only with explicit --restore-session-mcp and emits previous trace correlation when available,Recorded session fixture,python -m pytest src/tests/test_harness_cli_run.py -q,Retested Pass,PASS: test_harness_cli_run.py covers default skip restore opt-in credential_env behavior failed resume telemetry and previous_trace_id correlation.,AUDIT-018,Early ctx resume failures and resumed sessions lacked reliable previous trace correlation telemetry.,Fixed,PASS: .venv/bin/pytest src/tests/test_harness_cli_run.py -q --tb=short -> 73 passed.,2026-07-05,Tracks resume security and trace correlation semantics inside broad CLI-001.
49
  CLI-048,CLI,Harness update and uninstall controls,ctx-harness-install --update and ctx-harness-install --uninstall,src/harness_install.py and src/tests/test_harness_install.py,As a harness user I can dry-run update or uninstall an installed harness safely,Update and uninstall flows detect installed harness state show planned changes and avoid destructive surprises,Installed harness fixture,python -m pytest src/tests/test_harness_install.py -q,Tested Pass,test_harness_install.py covers update dry-run uninstall safety and missing-record behavior.,,,,,2026-06-29,Split from CLI-026 so install recommend update and uninstall semantics are separately tracked.
50
+ CLI-049,CLI,LoopFlow and agent-loop adapter,python -m ctx.adapters.loopflow,src/ctx/adapters/loopflow.py and src/tests/test_loopflow_adapter.py,As a DSL runner or custom agent-loop author I can ask ctx for scoped planning capabilities before each loop plan,Adapter emits a JSON contract with permission-gated skills agents MCPs scoped ctx MCP server metadata and gated harness recommendations only with explicit user-owned model consent,Graph/wiki available or recommendation functions mocked,python -m pytest src/tests/test_loopflow_adapter.py -q,Tested Pass,test_loopflow_adapter.py covers loop-file parsing permission filtering scoped MCP tool metadata harness gating shell-quoted harness install commands CLI JSON output and empty permission fail-closed behavior.,,,,,2026-06-30,Tracks the module entry point documented in docs/harness/attaching-to-hosts.md.
51
  HOOK-001,Hooks,Backup PostToolUse runtime hook,hooks/backup_on_change.py,hooks/backup_on_change.py and src/tests/test_quality_hook.py,As a Claude Code user I can snapshot tracked config changes from a PostToolUse hook,The hook reads stdin JSON detects tracked files runs snapshot-if-changed and always exits 0 so edits are not blocked,Temp Claude home and tracked config fixture needed,python -m pytest src/tests/test_quality_hook.py -q,Tested Pass,test_quality_hook.py covers root backup hook stdin parsing tracked-file dispatch snapshot reason shaping and nonblocking exit even when snapshot returns nonzero.,,,,,2026-06-30,Validated in Phase 2 runtime hook behavior slice without increasing the test inventory count.
52
  HOOK-002,Hooks,Quality Stop runtime hook,hooks/quality_on_session_end.py,hooks/quality_on_session_end.py and src/tests/test_quality_hook.py,As a Claude Code user I can refresh touched skill quality on session stop without blocking shutdown,The hook reads event state recomputes bounded touched slugs advances state only after successful recompute writes audit session rows and always exits 0,Temp Claude home and skill event fixture needed,python -m pytest src/tests/test_quality_hook.py -q,Tested Pass,test_quality_hook.py covers touched slug selection state cutoff max slug cap missing file behavior and failed recompute exit zero without state advancement.,,,,,2026-07-05,Validated after checkpoint hardening for recompute failures.
53
  PYAPI-001,Python API,Public Python API,ctx.api and ctx top-level re-exports,src/ctx/api.py and src/ctx/__init__.py,As a harness author I can import ctx from Python without depending on internal modules,recommend_bundle recommend_related graph_query wiki_search wiki_get list_all_entities default_wiki_dir and CtxCoreToolbox keep stable signatures safe defaults and top-level re-exports,Runtime wiki or synthetic fixture available,pytest src/tests/test_public_api.py -q,Tested Pass,test_public_api.py covers __all__ exports top-level re-exports signatures happy paths empty paths and telemetry privacy payloads.,,,,,2026-07-02,Added during canonical feature inventory gap pass and updated when related recommendations became public API.
 
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 snapshot files; temp backup fixture with BOM manifest printed entries and OK coverage; focused pytest passed.,CTX-AZ-008; CTX-QA-034,Backup audit previously rejected UTF-8 BOM manifests and treated --help as a snapshot path,Fixed by utf-8-sig manifest reads and snapshot-free help parsing in PR #210,PASS: /tmp/ctx-verify-venv/bin/python scripts/audit_backup.py --help; focused pytest 62 passed 1 skipped; no-mistakes run 01KWFXQTHJ83VNZ9ZJGMTAJPWC checks-passed.,2026-07-02,Read-only reporting; --help is snapshot-free and does not repair backup gaps.
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 similarity telemetry and CI workflow changes conservatively,CI classifier tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers path classes workflow contract behavior and ci_changed output use.,,,,,2026-07-06,Validated by focused pytest in this tracker slice including CI workflow classification.
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 including release sync and graph artifact maintainer scripts that omit matching tests while allowing proven metadata-only releases or maintainer-applied no-tests-needed labels for genuinely untestable changes,CI policy tests available,python -m pytest src/tests/test_ci_classifier.py src/tests/test_ci_preflight.py -q,Tested Pass,CI policy and preflight suites cover contract files release metadata exceptions no-tests-needed label exemptions and rejection when diff context is missing.,,,,,2026-07-05,Validated after preflight started passing real per-file diffs to the policy helper and after maintainer script contract coverage expanded.
143
  MAINT-005,Maintainer,Required CI aggregate,scripts/ci_required.py,scripts/ci_required.py and .github/workflows/test.yml,As a branch maintainer I can trust the required CI summary,Aggregate rejects failed missing or wrongly skipped required jobs including skipped full pytest matrix on CI workflow PRs while allowing documented conditional skips,CI required tests available,python -m pytest src/tests/test_ci_classifier.py -q,Tested Pass,CI classifier suite covers required job dependency success failure conditional skip cases and ci-changed PR full-matrix skip rejection.,,,,,2026-07-06,Validated by focused pytest in this tracker slice including CI workflow PR matrix skip rejection.
144
  MAINT-006,Maintainer,CI preflight gate,scripts/ci_preflight.py,scripts/ci_preflight.py scripts/ci_classifier.py and scripts/local_fast_gate.py,As a contributor I can run the same preflight logic locally that CI uses,"Preflight classifies changes then emits source static gates (ruff format/check, ruff lint, mypy, pip check), public docs tracker including bug-smoke, feature, dashboard, and toolbox coverage, strict build, graph, browser, package, and similarity gates required; local-fast groups those same checks into isolated parallel worktree lanes before the serial gate",Repo checkout with git available,Run scripts/ci_preflight.py against representative changed files; run scripts/no_mistakes_run.sh fast before PR validation,Tested Pass,"select_checks and workflow parity coverage confirm the public docs tracker includes bug-smoke, feature, dashboard, and toolbox checks before strict MkDocs build; local_fast_gate grouping coverage confirms graph hydration stays with graph validation and source changes split across independent lanes.",,,,,2026-07-06,Validated through focused preflight tests and the first real local-fast run which exposed missing tracker coverage before the final serial gate.
145
  MAINT-007,Maintainer,Clean host contract script,scripts/clean_host_contract.py,scripts/clean_host_contract.py and .github/workflows/clean-host-contract.yml,As a new installer I can smoke ctx on a clean host,Script builds a clean venv installs ctx and runs init scan harness and monitor checks,Network and clean temp venv available,GitHub clean-host contract or local script smoke,Tested Pass,Clean host contract job passed inside PR #195 required checks.,,,,,2026-06-23,Workflow evidence covers the script path.
docs/telemetry.md CHANGED
@@ -137,9 +137,12 @@ The shipped config keeps telemetry local:
137
  `local_redacted` removes or hashes raw input fields such as `query`, `prompt`,
138
  `tool_input`, `stdout`, `stderr`, repo names, secrets, `paths`, dotted or
139
  hyphenated path keys such as `ctx.repo.path` and `repo-path`, and keys that
140
- normalize to `_path` or `_paths` suffixes. The only accepted modes are
141
- `local_redacted`, `disabled`, `off`, and `none`; unknown modes fail closed
142
- instead of emitting raw fields.
 
 
 
143
 
144
  Runtime lifecycle records apply the same local-redacted posture to their
145
  evidence-bearing strings. Top-level `reason`, `evidence`, `command`, `summary`,
@@ -261,6 +264,11 @@ advance the checkpoint past malformed pending records; retrying after repair may
261
  re-export already delivered events, so downstream collectors should deduplicate
262
  by `event_id`.
263
 
 
 
 
 
 
264
  ## Retention
265
 
266
  Retention is explicit operator action, never a background deletion. Plan first:
@@ -307,6 +315,13 @@ overrides live at `~/.claude/skill-system-config.json`.
307
  `OTEL_EXPORTER_OTLP_ENDPOINT` is also supported and automatically appends
308
  `/v1/logs`.
309
 
 
 
 
 
 
 
 
310
  ## Collector Examples
311
 
312
  Use an OpenTelemetry Collector between ctx and the observability backend. That
 
137
  `local_redacted` removes or hashes raw input fields such as `query`, `prompt`,
138
  `tool_input`, `stdout`, `stderr`, repo names, secrets, `paths`, dotted or
139
  hyphenated path keys such as `ctx.repo.path` and `repo-path`, and keys that
140
+ normalize to `_path` or `_paths` suffixes. It also scans arbitrary string
141
+ payload values for local host paths such as `/Users/...`, `/home/...`, `~/...`,
142
+ and Windows drive paths, replacing each match with
143
+ `[path_hash:sha256:...]`. The only accepted modes are `local_redacted`,
144
+ `disabled`, `off`, and `none`; unknown modes fail closed instead of emitting
145
+ raw fields.
146
 
147
  Runtime lifecycle records apply the same local-redacted posture to their
148
  evidence-bearing strings. Top-level `reason`, `evidence`, `command`, `summary`,
 
264
  re-export already delivered events, so downstream collectors should deduplicate
265
  by `event_id`.
266
 
267
+ Manual and continuous exporters re-sanitize legacy local records at the export
268
+ boundary before writing `local_jsonl` or sending OTLP, so older spool entries
269
+ that predate current redaction rules do not leak raw query, path, repo, stdout,
270
+ stderr, token, or secret payload values.
271
+
272
  ## Retention
273
 
274
  Retention is explicit operator action, never a background deletion. Plan first:
 
315
  `OTEL_EXPORTER_OTLP_ENDPOINT` is also supported and automatically appends
316
  `/v1/logs`.
317
 
318
+ Continuous export drains the pending spool before advancing the checkpoint, not
319
+ just the event or metric that triggered the write. If all pending well-formed
320
+ records export successfully and no malformed pending records remain, the
321
+ checkpoint advances to the last exported id. If malformed pending records or a
322
+ checkpoint anomaly are present, ctx records `status: degraded` and leaves the
323
+ checkpoint in place so an operator can repair or intentionally replay.
324
+
325
  ## Collector Examples
326
 
327
  Use an OpenTelemetry Collector between ctx and the observability backend. That