Sync ctx 8e56add (part 2)
Browse filesGitHub commit: 8e56add2dad3382f9427395b1433f8845134d7ae
- qa/bug_smoke_status.csv +13 -8
- qa/feature_status.csv +3 -3
- scripts/ci_no_test_policy.py +13 -6
- scripts/ci_preflight.py +53 -8
- src/ctx/core/wiki/wiki_packs.py +20 -5
- src/ctx/monitor/compat.py +1 -1
- src/ctx/monitor/pages/wiki_entity.py +35 -3
- src/ctx/monitor/services/wiki.py +68 -42
qa/bug_smoke_status.csv
CHANGED
|
@@ -1,9 +1,14 @@
|
|
| 1 |
finding_id,category,scope,surface,file_or_pattern,source_evidence,severity,expected_behavior,discovery_method,status,first_observed,bug_summary,repro_or_detection,fix_strategy,fix_status,validation_command,retest_evidence,last_verified_at,owner,review_status,review_notes,next_action
|
| 2 |
-
AUDIT-001,Garbage Files,Repo hygiene,generated artifacts,
|
| 3 |
-
AUDIT-002,Review Tooling,Repo audit,open-code-review,
|
| 4 |
-
AUDIT-003,Bug Risk,Dashboard graph artifacts,monitor graph index extraction,src/ctx/monitor/services/graph_artifacts.py:426,ruff B023 reported lambda closing over loop-local source in tar extraction loop,Medium,Dashboard graph index extraction should copy archive members without closure-capture ambiguity.,ruff B023 static audit,Retested Pass,ruff B023 found Function definition does not bind loop variable source,Chunk reader used iter(lambda: source.read(...)) inside archive loop; future refactor or delayed evaluation could read from the wrong source.,.venv/bin/python -m ruff check src/ctx/monitor/services/graph_artifacts.py --select B023,Replace lambda iterator with explicit walrus read loop scoped to current source.,Fixed,.venv/bin/python -m ruff check src/ctx/monitor/services/graph_artifacts.py --select B023,PASS: B023 check reports no findings for graph_artifacts.py.,2026-07-04,Codex,Reviewed by local static audit,Ponytail: minimal source-loop rewrite; behavior-preserving copy semantics.,
|
| 5 |
-
AUDIT-004,Bug,MCP ingest,ctx-mcp-ingest dry-run checkpointing,src/mcp_ingest.py:322,dry-run marked slugs processed and saved resume checkpoint,High,MCP ingest dry-run must not persist resume state that makes a later live run skip records.,subagent repro + focused pytest,Retested Pass,dry-run checkpoint poisoning made live ingest skip dry-run-only records,Run dry_run=True then reload checkpoint then live run; before fix live call count stayed one and processed contained dry-run slug,pytest src/tests/test_mcp_ingest.py::TestFreshRun::test_dry_run_does_not_checkpoint_processed_slugs,Skip processed/failures mutations and checkpoint saves while dry_run is true.,Fixed,pytest src/tests/test_mcp_ingest.py::TestFreshRun::test_dry_run_does_not_checkpoint_processed_slugs,PASS: dry-run leaves processed empty and live run processes the slug again.,2026-07-04,Codex,Reviewed by explorer + local tests,Ponytail: guard checkpoint writes only; live checkpoint behavior unchanged.,
|
| 6 |
-
AUDIT-005,Bug,MCP enrich,ctx-mcp-enrich dry-run checkpointing,src/mcp_enrich.py:607,dry-run marked slugs processed and saved resume checkpoint,High,MCP enrich dry-run must not persist resume state that makes a later live run skip entity enrichment.,subagent repro + focused pytest,Retested Pass,dry-run checkpoint poisoning made live enrich skip dry-run-only entities,Run dry_run=True then reload checkpoint then live run; before fix source fetch was not called again and github_url stayed absent,pytest src/tests/test_mcp_enrich_render_scalar.py::TestRenderScalar::test_enrich_entities_dry_run_does_not_checkpoint_processed_slugs,Skip processed/failures mutations and checkpoint saves while dry_run is true.,Fixed,pytest src/tests/test_mcp_enrich_render_scalar.py::TestRenderScalar::test_enrich_entities_dry_run_does_not_checkpoint_processed_slugs,PASS: dry-run leaves processed empty and live enrich fetches the slug again.,2026-07-04,Codex,Reviewed by explorer + local tests,Ponytail: guard checkpoint writes only; live checkpoint behavior unchanged.,
|
| 7 |
-
AUDIT-006,Privacy,Telemetry,enterprise telemetry redaction,src/ctx/telemetry/__init__.py:73,subagent repro showed repo_name and repository stayed raw,High,Telemetry local_redacted mode should hash repo/context/workspace/project identifiers and never spool raw values.,subagent repro + focused pytest,Retested Pass,telemetry key coverage repro found raw repo/context fields before fix,repo/context keys leaked raw private names before this phase,Sanitize payload with repo_name repository workspace project context and inspect returned JSON,Expand raw key allowlist and suffix coverage for repo/context/workspace/project identifiers.,Fixed,.venv/bin/pytest src/tests/test_enterprise_telemetry.py,PASS: enterprise telemetry test file passed after adding repo/context key assertions.,2026-07-04,Codex,Reviewed by Worker A + local verification,Ponytail: extend sanitizer key matching only; exporter/event schema unchanged.,
|
| 8 |
-
AUDIT-007,Privacy,Runtime lifecycle,security_scan telemetry return,src/ctx/adapters/generic/runtime_lifecycle.py:355,subagent repro showed raw token and absolute path in ctx-core lifecycle output,High,Runtime lifecycle security_scan data should redact secrets and local paths before persistence return and session state.,subagent repro + focused pytest,Retested Pass,security_scan command output and summary returned raw token/path before fix,Lifecycle security_scan returned raw secret and local path data through ctx-core responses,Load skill with security_scan containing ghp token sk token and /Users path then inspect event file and session state,Sanitize nested security_scan strings with secret and absolute path redaction inside lifecycle boundary.,Fixed,.venv/bin/pytest src/tests/test_harness_ctx_core.py::TestRuntimeLifecycle,PASS: 10 runtime lifecycle tests pass including redacted security_scan command output summary and persisted event.,2026-07-04,Codex,Reviewed by Worker B + local verification,Ponytail: sanitize lifecycle security_scan field only; status and proof metadata preserved.,
|
| 9 |
-
AUDIT-008,Privacy,LoopFlow adapter,public context payload and recommendation pass count,src/ctx/adapters/loopflow.py:104,subagent repro showed raw look_at paths in public payload and one graph scan per granted type,Medium,LoopFlow adapter should expose safe context refs and use one permission-filtered recommendation pass.,subagent repro + focused pytest,Retested Pass,raw look_at path appeared in context.query and recommend_by_tags ran once per type before fix,LoopFlow leaked local context paths and scanned recommendation graph repeatedly for multi-grant requests,Recommend for loop with private look_at paths and skills agents mcps permissions then inspect payload and call count,Return basename plus path_hash context refs publicly and call recommend_by_tags once with combined entity types.,Fixed,.venv/bin/pytest src/tests/test_loopflow_adapter.py,PASS: 23 LoopFlow adapter tests passed including sanitized public payload and single combined graph call.,2026-07-04,Codex,Reviewed by Worker C + local verification,Ponytail: keep raw paths only in private local ranking query; public adapter payload is safe.,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
finding_id,category,scope,surface,file_or_pattern,source_evidence,severity,expected_behavior,discovery_method,status,first_observed,bug_summary,repro_or_detection,fix_strategy,fix_status,validation_command,retest_evidence,last_verified_at,owner,review_status,review_notes,next_action
|
| 2 |
+
AUDIT-001,Garbage Files,Repo hygiene,generated artifacts,**/__pycache__/**; **/*.pyc; **/.DS_Store,find command found 380 generated files outside .git/.venv/site/htmlcov/graph on 2026-07-04,Medium,Repo source should not track generated OS or Python cache artifacts; local ignored caches may be deleted after validation runs.,manual static scan + git ls-files,Retested Pass,380 ignored generated artifacts present before cleanup,Generated OS/Python cache artifacts polluted local repo-wide scans and working-tree hygiene.,find generated-artifact scan listed .DS_Store and pyc files; git ls-files checks tracked hygiene,Delete generated artifacts while keeping existing .gitignore guards; add a tracked-file regression test.,Fixed,git ls-files generated-artifact scan,PASS: git tracks 0 generated artifact files; local ignored caches were cleaned before validation.,2026-07-04,Codex,Reviewed by local static audit,Ponytail: delete only generated artifacts and guard the source boundary; no product behavior change.,Closed; continue repo-wide discovery.
|
| 3 |
+
AUDIT-002,Review Tooling,Repo audit,open-code-review,/Users/steves/.local/bin/ocr; ~/.opencodereview/config.json,ocr v1.7.1 installed; ocr llm test reports no endpoint configured,High,Whole-repo OCR scan should run with a configured enterprise LLM endpoint before final goal completion.,open-code-review install + ocr llm test,Blocked/Human Decision,ocr was missing from PATH before this phase; installed user-local v1.7.1,Open Code Review AI scan cannot produce findings without OCR_LLM_URL/OCR_LLM_TOKEN/OCR_LLM_MODEL or provider config.,ocr llm test,Install OCR and keep the blocker only on provider secret/endpoint configuration; continue evidence-backed manual review meanwhile.,Blocked,ocr llm test,BLOCKED: no valid LLM endpoint configured; OCR preview can enumerate files only.,2026-07-04,Human Owner,Open,Needs enterprise/provider configuration; do not fake OCR findings.,Configure provider or supply enterprise-compatible env for OCR.
|
| 4 |
+
AUDIT-003,Bug Risk,Dashboard graph artifacts,monitor graph index extraction,src/ctx/monitor/services/graph_artifacts.py:426,ruff B023 reported lambda closing over loop-local source in tar extraction loop,Medium,Dashboard graph index extraction should copy archive members without closure-capture ambiguity.,ruff B023 static audit,Retested Pass,ruff B023 found Function definition does not bind loop variable source,Chunk reader used iter(lambda: source.read(...)) inside archive loop; future refactor or delayed evaluation could read from the wrong source.,.venv/bin/python -m ruff check src/ctx/monitor/services/graph_artifacts.py --select B023,Replace lambda iterator with explicit walrus read loop scoped to current source.,Fixed,.venv/bin/python -m ruff check src/ctx/monitor/services/graph_artifacts.py --select B023,PASS: B023 check reports no findings for graph_artifacts.py.,2026-07-04,Codex,Reviewed by local static audit,Ponytail: minimal source-loop rewrite; behavior-preserving copy semantics.,Closed; continue repo-wide discovery.
|
| 5 |
+
AUDIT-004,Bug,MCP ingest,ctx-mcp-ingest dry-run checkpointing,src/mcp_ingest.py:322,dry-run marked slugs processed and saved resume checkpoint,High,MCP ingest dry-run must not persist resume state that makes a later live run skip records.,subagent repro + focused pytest,Retested Pass,dry-run checkpoint poisoning made live ingest skip dry-run-only records,Run dry_run=True then reload checkpoint then live run; before fix live call count stayed one and processed contained dry-run slug,pytest src/tests/test_mcp_ingest.py::TestFreshRun::test_dry_run_does_not_checkpoint_processed_slugs,Skip processed/failures mutations and checkpoint saves while dry_run is true.,Fixed,pytest src/tests/test_mcp_ingest.py::TestFreshRun::test_dry_run_does_not_checkpoint_processed_slugs,PASS: dry-run leaves processed empty and live run processes the slug again.,2026-07-04,Codex,Reviewed by explorer + local tests,Ponytail: guard checkpoint writes only; live checkpoint behavior unchanged.,Closed; continue repo-wide discovery.
|
| 6 |
+
AUDIT-005,Bug,MCP enrich,ctx-mcp-enrich dry-run checkpointing,src/mcp_enrich.py:607,dry-run marked slugs processed and saved resume checkpoint,High,MCP enrich dry-run must not persist resume state that makes a later live run skip entity enrichment.,subagent repro + focused pytest,Retested Pass,dry-run checkpoint poisoning made live enrich skip dry-run-only entities,Run dry_run=True then reload checkpoint then live run; before fix source fetch was not called again and github_url stayed absent,pytest src/tests/test_mcp_enrich_render_scalar.py::TestRenderScalar::test_enrich_entities_dry_run_does_not_checkpoint_processed_slugs,Skip processed/failures mutations and checkpoint saves while dry_run is true.,Fixed,pytest src/tests/test_mcp_enrich_render_scalar.py::TestRenderScalar::test_enrich_entities_dry_run_does_not_checkpoint_processed_slugs,PASS: dry-run leaves processed empty and live enrich fetches the slug again.,2026-07-04,Codex,Reviewed by explorer + local tests,Ponytail: guard checkpoint writes only; live checkpoint behavior unchanged.,Closed; continue repo-wide discovery.
|
| 7 |
+
AUDIT-006,Privacy,Telemetry,enterprise telemetry redaction,src/ctx/telemetry/__init__.py:73,subagent repro showed repo_name and repository stayed raw,High,Telemetry local_redacted mode should hash repo/context/workspace/project identifiers and never spool raw values.,subagent repro + focused pytest,Retested Pass,telemetry key coverage repro found raw repo/context fields before fix,repo/context keys leaked raw private names before this phase,Sanitize payload with repo_name repository workspace project context and inspect returned JSON,Expand raw key allowlist and suffix coverage for repo/context/workspace/project identifiers.,Fixed,.venv/bin/pytest src/tests/test_enterprise_telemetry.py,PASS: enterprise telemetry test file passed after adding repo/context key assertions.,2026-07-04,Codex,Reviewed by Worker A + local verification,Ponytail: extend sanitizer key matching only; exporter/event schema unchanged.,Closed; continue repo-wide discovery.
|
| 8 |
+
AUDIT-007,Privacy,Runtime lifecycle,security_scan telemetry return,src/ctx/adapters/generic/runtime_lifecycle.py:355,subagent repro showed raw token and absolute path in ctx-core lifecycle output,High,Runtime lifecycle security_scan data should redact secrets and local paths before persistence return and session state.,subagent repro + focused pytest,Retested Pass,security_scan command output and summary returned raw token/path before fix,Lifecycle security_scan returned raw secret and local path data through ctx-core responses,Load skill with security_scan containing ghp token sk token and /Users path then inspect event file and session state,Sanitize nested security_scan strings with secret and absolute path redaction inside lifecycle boundary.,Fixed,.venv/bin/pytest src/tests/test_harness_ctx_core.py::TestRuntimeLifecycle,PASS: 10 runtime lifecycle tests pass including redacted security_scan command output summary and persisted event.,2026-07-04,Codex,Reviewed by Worker B + local verification,Ponytail: sanitize lifecycle security_scan field only; status and proof metadata preserved.,Closed; continue repo-wide discovery.
|
| 9 |
+
AUDIT-008,Privacy,LoopFlow adapter,public context payload and recommendation pass count,src/ctx/adapters/loopflow.py:104,subagent repro showed raw look_at paths in public payload and one graph scan per granted type,Medium,LoopFlow adapter should expose safe context refs and use one permission-filtered recommendation pass.,subagent repro + focused pytest,Retested Pass,raw look_at path appeared in context.query and recommend_by_tags ran once per type before fix,LoopFlow leaked local context paths and scanned recommendation graph repeatedly for multi-grant requests,Recommend for loop with private look_at paths and skills agents mcps permissions then inspect payload and call count,Return basename plus path_hash context refs publicly and call recommend_by_tags once with combined entity types.,Fixed,.venv/bin/pytest src/tests/test_loopflow_adapter.py,PASS: 23 LoopFlow adapter tests passed including sanitized public payload and single combined graph call.,2026-07-04,Codex,Reviewed by Worker C + local verification,Ponytail: keep raw paths only in private local ranking query; public adapter payload is safe.,Closed; continue repo-wide discovery.
|
| 10 |
+
AUDIT-009,CI Gate,CI preflight,no-test policy release metadata exemption,scripts/ci_no_test_policy.py; scripts/ci_preflight.py,local audit found internal preflight passed pyproject metadata paths without diff content,High,No-test policy should only allow release metadata changes when actual diff hunks prove only allowed version or stats lines changed.,manual code review + regression test,Retested Pass,ci preflight passed metadata-only files with empty diff context,Internal no-test policy could exempt pyproject or stats files when called without diffs which risks false green PR gates.,Call _run_no_test_policy_for_files with pyproject.toml and empty diffs_by_file then expect nonzero,Require content diff lines for every non-CHANGELOG release metadata file and pass real per-file diffs from preflight.,Fixed,.venv/bin/pytest src/tests/test_ci_preflight.py src/tests/test_ci_classifier.py -q --tb=short,PASS: regression rejects pyproject.toml when diff context is missing.,2026-07-05,Codex,Reviewed by local static audit,Ponytail: tighten exemption proof only; release metadata behavior still allowed when diff lines match.,Closed; continue repo-wide discovery.
|
| 11 |
+
AUDIT-010,Quality Gate,Session hook,quality recompute checkpointing,hooks/quality_on_session_end.py:146,local audit found hook advanced state after missing or failed recompute,Medium,Quality hook should not advance the last-seen state unless recompute completed successfully.,manual code review + regression test,Retested Pass,quality hook swallowed recompute failure and wrote state,If skill_quality.py was missing or subprocess failed then a later run could skip events that were never scored.,Patch _invoke_recompute to return failure on missing script or subprocess error and assert state file is not written.,Advance state only after successful recompute while keeping hook exit zero for developer ergonomics.,Fixed,.venv/bin/pytest src/tests/test_quality_hook.py -q --tb=short,PASS: recompute OSError path exits zero but does not create state.json.,2026-07-05,Codex,Reviewed by local static audit,Ponytail: make checkpoint durable without changing hook failure policy.,Closed; continue repo-wide discovery.
|
| 12 |
+
AUDIT-011,CI Gate,PR docs workflow,docs-check dashboard tracker mismatch,.github/workflows/test.yml,No-mistakes review found PR docs-check omitted src/tests/test_dashboard_user_story_tracker.py while preflight included it,Medium,PR CI docs-check and local preflight should run the same public docs tracker tests.,no-mistakes review gate,Retested Pass,docs-check workflow split from preflight tracker list,Dashboard tracker regressions could pass PR docs-check even when local preflight would catch them.,Compare .github/workflows/test.yml docs-check command to scripts.ci_preflight.PUBLIC_DOCS_TRACKER_TESTS,Add dashboard tracker test to docs-check and add regression comparing workflow command to preflight constant.,Fixed,gh pr checks 232 plus no-mistakes run 01KWRJYRGY8AEWBCVNM408MV20,PASS: PR #232 checks passed and no-mistakes completed checks-passed.,2026-07-05,Codex,Reviewed by no-mistakes review,Ponytail: align duplicated gate list and add small drift regression.,Closed; continue repo-wide discovery.
|
| 13 |
+
AUDIT-012,UX Bug,Dashboard wiki,pack mode local overlays and entity typing,src/ctx/monitor/services/wiki.py; src/ctx/monitor/pages/wiki_entity.py,parallel dashboard worker found pack mode hid local-only Manage-created pages and untyped non-skill pages loaded skill metadata,Medium,Wiki pack mode should merge pack pages with safe local-only pages and infer entity type from path when page frontmatter omits type.,parallel worker repro + focused pytest,Retested Pass,Pack mode returned only pack pages and untyped agent pages were rendered without agent sidecar context,Create physical manage-created skill beside wiki pack and render untyped agent path; before fix local page was absent and sidecar type was None,Merge pack rows with non-packed local file rows; read local files when pack lacks the relpath; resolve wiki entity type from frontmatter or path; fix subgraph drag guard selector.,Overlay pack pages with safe local rows and resolve wiki type before sidecar/subgraph rendering.,Fixed,.venv/bin/pytest targeted monitor tests,PASS: 3 focused monitor tests pass for pack merge local page untyped agent type and subgraph selector.,2026-07-05,Codex,Reviewed by local tests + static gates,Ponytail: merge only local rows not shadowed by pack relpaths and keep pack override semantics.,Closed; continue repo-wide discovery.
|
| 14 |
+
AUDIT-013,Tracker Hygiene,Canonical bug tracker,fixed-row next_action evidence,qa/bug_smoke_status.csv,local tracker audit found fixed rows still pointing at already completed PR or backlog actions,Low,Fixed and retested tracker rows should not tell future agents to rerun already completed PR or backlog actions.,manual tracker audit + csv parser validation,Retested Pass,Fixed rows included stale next_action values such as Run PR CI after commit and Continue dashboard/wiki backlog after PRs were merged,"Canonical tracker next_action text was stale for closed rows, making status summaries look unfinished.",Parse qa/bug_smoke_status.csv and inspect fixed rows whose next_action is not a closed-state instruction.,Normalize fixed-row next_action values to a closed discovery handoff and document this tracker cleanup row.,Fixed,.venv/bin/pytest src/tests/test_bug_smoke_tracker.py -q --tb=short,PASS: tracker parser enforces PASS retest evidence and closed next_action values.,2026-07-05,Codex,Reviewed by local static audit,Ponytail: tracker text only; no product behavior change.,Closed; continue repo-wide discovery.
|
qa/feature_status.csv
CHANGED
|
@@ -49,7 +49,7 @@ CLI-047,,docs/qa/feature-user-story-status.csv,CLI,Resume MCP restoration safety
|
|
| 49 |
CLI-048,,docs/qa/feature-user-story-status.csv,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,Medium,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,Automated Test,Tested Pass,test_harness_install.py covers update dry-run uninstall safety and missing-record behavior.,,,,,,2026-06-29,CLI Lane,Split from CLI-026 so install recommend update and uninstall semantics are separately tracked.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 50 |
CLI-049,,docs/qa/feature-user-story-status.csv,CLI,LoopFlow and agent-loop adapter,python -m ctx.adapters.loopflow,src/ctx/adapters/loopflow.py and src/tests/test_loopflow_adapter.py,High,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,Automated Test,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,CLI Lane,Tracks the module entry point documented in docs/harness/attaching-to-hosts.md.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 51 |
HOOK-001,,docs/qa/feature-user-story-status.csv,Hooks,Backup PostToolUse runtime hook,hooks/backup_on_change.py,hooks/backup_on_change.py and src/tests/test_quality_hook.py,Medium,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,Automated Test,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,Core/Docs Lane,Validated in Phase 2 runtime hook behavior slice without increasing the test inventory count.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 52 |
-
HOOK-002,,docs/qa/feature-user-story-status.csv,Hooks,Quality Stop runtime hook,hooks/quality_on_session_end.py,hooks/quality_on_session_end.py and src/tests/test_quality_hook.py,Medium,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 writes audit
|
| 53 |
PYAPI-001,,docs/qa/feature-user-story-status.csv,Python API,Public Python API,ctx.api and ctx top-level re-exports,src/ctx/api.py and src/ctx/__init__.py,High,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,Automated Test,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,API/MCP Lane,Added during canonical feature inventory gap pass and updated when related recommendations became public API.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 54 |
MCP-001,,docs/qa/feature-user-story-status.csv,MCP/Core Tools,Read/query tool catalog,"ctx__recommend_bundle, ctx__recommend_related, ctx__graph_query, ctx__wiki_search, ctx__wiki_get",src/ctx/adapters/generic/ctx_core_tools.py and src/ctx/mcp_server/server.py,High,As an MCP or generic harness client I can call ctx read tools consistently,Read tools return recommendations related suggestions graph neighborhoods wiki search and wiki entity payloads through both generic toolbox and MCP stdio surfaces,Synthetic graph/wiki fixture available,pytest src/tests/test_harness_ctx_core.py src/tests/test_mcp_server.py -q,Automated Test,Tested Pass,test_harness_ctx_core.py and test_mcp_server.py pin the read tool names schemas dispatch success paths and JSON-RPC tools/list exposure.,,,,,,2026-07-02,API/MCP Lane,Canonical tracker row for the first-class ctx-core read tools including related recommendations.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 55 |
MCP-002,,docs/qa/feature-user-story-status.csv,MCP/Core Tools,Lifecycle and session tool catalog,"ctx__observe_dev_event, ctx__load_entity, ctx__mark_entity_used, ctx__record_validation, ctx__record_escalation, ctx__unload_entity, ctx__session_end, ctx__session_state",src/ctx/adapters/generic/ctx_core_tools.py and ctx.runtime_lifecycle.record,High,As an MCP or generic harness client I can record runtime lifecycle evidence,Lifecycle tools append privacy-safe runtime events enforce bound session IDs hash telemetry identifiers and expose local session state with caller-facing slugs for usability,Temp runtime lifecycle directory available,pytest src/tests/test_harness_ctx_core.py src/tests/test_mcp_server.py -q,Automated Test,Tested Pass,test_harness_ctx_core.py covers lifecycle append order bound session enforcement telemetry hashing and test_mcp_server.py covers lifecycle tools/call round-trip.,,,,,,2026-07-02,API/MCP Lane,Canonical tracker row for lifecycle/session tools exposed in the MCP/core toolbox catalog.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
|
@@ -140,9 +140,9 @@ SEC-002,,docs/qa/feature-user-story-status.csv,Distribution,No-mistakes developm
|
|
| 140 |
MAINT-001,,docs/qa/feature-user-story-status.csv,Maintainer,Backup snapshot audit,scripts/audit_backup.py,scripts/audit_backup.py,Medium,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,Manual/Documented,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,python scripts/audit_backup.py --help; run script against representative backup fixture,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,Core/Docs Lane,Read-only reporting; --help is snapshot-free and does not repair backup gaps.,Reviewed by no-mistakes,Run 01KWFXQTHJ83VNZ9ZJGMTAJPWC reported no findings; PR #210 merged as c61de902e8fdd2a4b2cfa061c5337a2fef078d0a.,Ponytail: minimal fix only; no behavior expansion beyond help handling.,Validated by completed goal-loop and no-mistakes gate
|
| 141 |
MAINT-002,,docs/qa/feature-user-story-status.csv,Maintainer,Dashboard graph index builder,scripts/build_dashboard_graph_index.py,scripts/build_dashboard_graph_index.py,Medium,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,Manual/Documented,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,Run script against small graph fixture and query resulting index,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,Core/Docs Lane,,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 142 |
MAINT-003,,docs/qa/feature-user-story-status.csv,Maintainer,CI change classifier,scripts/ci_classifier.py,scripts/ci_classifier.py and .github/workflows/test.yml,Medium,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,Automated Test,Tested Pass,CI classifier suite covers path classes and workflow contract behavior.,,,,,,2026-06-23,Core/Docs Lane,Validated by focused pytest in this tracker slice.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 143 |
-
MAINT-004,,docs/qa/feature-user-story-status.csv,Maintainer,No-test policy gate,scripts/ci_no_test_policy.py,scripts/ci_no_test_policy.py and .github/workflows/test.yml,Medium,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,Automated Test,Tested Pass,CI
|
| 144 |
MAINT-005,,docs/qa/feature-user-story-status.csv,Maintainer,Required CI aggregate,scripts/ci_required.py,scripts/ci_required.py and .github/workflows/test.yml,Medium,As a branch maintainer I can trust the required CI summary,Aggregate rejects failed missing or wrongly skipped required jobs and allows documented conditional skips,CI required tests available,python -m pytest src/tests/test_ci_classifier.py -q,Automated Test,Tested Pass,CI classifier suite covers required job dependency success failure and conditional skip cases.,,,,,,2026-06-23,Core/Docs Lane,Validated by focused pytest in this tracker slice.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 145 |
-
MAINT-006,,docs/qa/feature-user-story-status.csv,Maintainer,CI preflight gate,scripts/ci_preflight.py,scripts/ci_preflight.py and scripts/ci_classifier.py,Medium,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 feature
|
| 146 |
MAINT-007,,docs/qa/feature-user-story-status.csv,Maintainer,Clean host contract script,scripts/clean_host_contract.py,scripts/clean_host_contract.py and .github/workflows/clean-host-contract.yml,Medium,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,Automated Test,Tested Pass,Clean host contract job passed inside PR #195 required checks.,,,,,,2026-06-23,Core/Docs Lane,Workflow evidence covers the script path.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 147 |
MAINT-008,,docs/qa/feature-user-story-status.csv,Maintainer,Dashboard smoke script,scripts/dashboard_smoke.py,scripts/dashboard_smoke.py,Medium,As a maintainer I can smoke a running monitor before release,Script probes an already running ctx-monitor base URL and checks key pages/APIs with optional warmup,Monitor running or fake HTTP fixture available,python -m pytest src/tests/test_dashboard_smoke.py -q,Automated Test,Tested Pass,Dashboard smoke test suite covers route probing warmup and failure reporting for a supplied base URL.,,,,,,2026-06-29,Core/Docs Lane,Corrected wording from starts-or-probes to probes-running-monitor; ctx-monitor startup is tracked separately by CLI-042.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 148 |
MAINT-009,,docs/qa/feature-user-story-status.csv,Maintainer,Graph artifact guard,scripts/graph_artifact_guard.py,scripts/graph_artifact_guard.py,Medium,As a maintainer I can prevent huge graph artifacts from bloating local Git state,Guard parks unparks and prunes graph artifacts safely without deleting unrelated files,Graph artifact fixture available,python -m pytest src/tests/test_graph_artifact_guard.py -q,Automated Test,Tested Pass,Graph artifact guard suite covers park unpark prune and explicit git prune safety.,,,,,,2026-06-23,Core/Docs Lane,Validated by focused pytest in this tracker slice.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
|
|
|
| 49 |
CLI-048,,docs/qa/feature-user-story-status.csv,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,Medium,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,Automated Test,Tested Pass,test_harness_install.py covers update dry-run uninstall safety and missing-record behavior.,,,,,,2026-06-29,CLI Lane,Split from CLI-026 so install recommend update and uninstall semantics are separately tracked.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 50 |
CLI-049,,docs/qa/feature-user-story-status.csv,CLI,LoopFlow and agent-loop adapter,python -m ctx.adapters.loopflow,src/ctx/adapters/loopflow.py and src/tests/test_loopflow_adapter.py,High,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,Automated Test,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,CLI Lane,Tracks the module entry point documented in docs/harness/attaching-to-hosts.md.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 51 |
HOOK-001,,docs/qa/feature-user-story-status.csv,Hooks,Backup PostToolUse runtime hook,hooks/backup_on_change.py,hooks/backup_on_change.py and src/tests/test_quality_hook.py,Medium,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,Automated Test,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,Core/Docs Lane,Validated in Phase 2 runtime hook behavior slice without increasing the test inventory count.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 52 |
+
HOOK-002,,docs/qa/feature-user-story-status.csv,Hooks,Quality Stop runtime hook,hooks/quality_on_session_end.py,hooks/quality_on_session_end.py and src/tests/test_quality_hook.py,Medium,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,Automated Test,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,Core/Docs Lane,Validated after checkpoint hardening for recompute failures.,Reviewed by no-mistakes,Documentation sync verified against current hook behavior.,Ponytail: checkpoint only advances after successful recompute; hook remains nonblocking.,Validated by focused hook regression
|
| 53 |
PYAPI-001,,docs/qa/feature-user-story-status.csv,Python API,Public Python API,ctx.api and ctx top-level re-exports,src/ctx/api.py and src/ctx/__init__.py,High,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,Automated Test,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,API/MCP Lane,Added during canonical feature inventory gap pass and updated when related recommendations became public API.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 54 |
MCP-001,,docs/qa/feature-user-story-status.csv,MCP/Core Tools,Read/query tool catalog,"ctx__recommend_bundle, ctx__recommend_related, ctx__graph_query, ctx__wiki_search, ctx__wiki_get",src/ctx/adapters/generic/ctx_core_tools.py and src/ctx/mcp_server/server.py,High,As an MCP or generic harness client I can call ctx read tools consistently,Read tools return recommendations related suggestions graph neighborhoods wiki search and wiki entity payloads through both generic toolbox and MCP stdio surfaces,Synthetic graph/wiki fixture available,pytest src/tests/test_harness_ctx_core.py src/tests/test_mcp_server.py -q,Automated Test,Tested Pass,test_harness_ctx_core.py and test_mcp_server.py pin the read tool names schemas dispatch success paths and JSON-RPC tools/list exposure.,,,,,,2026-07-02,API/MCP Lane,Canonical tracker row for the first-class ctx-core read tools including related recommendations.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 55 |
MCP-002,,docs/qa/feature-user-story-status.csv,MCP/Core Tools,Lifecycle and session tool catalog,"ctx__observe_dev_event, ctx__load_entity, ctx__mark_entity_used, ctx__record_validation, ctx__record_escalation, ctx__unload_entity, ctx__session_end, ctx__session_state",src/ctx/adapters/generic/ctx_core_tools.py and ctx.runtime_lifecycle.record,High,As an MCP or generic harness client I can record runtime lifecycle evidence,Lifecycle tools append privacy-safe runtime events enforce bound session IDs hash telemetry identifiers and expose local session state with caller-facing slugs for usability,Temp runtime lifecycle directory available,pytest src/tests/test_harness_ctx_core.py src/tests/test_mcp_server.py -q,Automated Test,Tested Pass,test_harness_ctx_core.py covers lifecycle append order bound session enforcement telemetry hashing and test_mcp_server.py covers lifecycle tools/call round-trip.,,,,,,2026-07-02,API/MCP Lane,Canonical tracker row for lifecycle/session tools exposed in the MCP/core toolbox catalog.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
|
|
|
| 140 |
MAINT-001,,docs/qa/feature-user-story-status.csv,Maintainer,Backup snapshot audit,scripts/audit_backup.py,scripts/audit_backup.py,Medium,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,Manual/Documented,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,python scripts/audit_backup.py --help; run script against representative backup fixture,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,Core/Docs Lane,Read-only reporting; --help is snapshot-free and does not repair backup gaps.,Reviewed by no-mistakes,Run 01KWFXQTHJ83VNZ9ZJGMTAJPWC reported no findings; PR #210 merged as c61de902e8fdd2a4b2cfa061c5337a2fef078d0a.,Ponytail: minimal fix only; no behavior expansion beyond help handling.,Validated by completed goal-loop and no-mistakes gate
|
| 141 |
MAINT-002,,docs/qa/feature-user-story-status.csv,Maintainer,Dashboard graph index builder,scripts/build_dashboard_graph_index.py,scripts/build_dashboard_graph_index.py,Medium,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,Manual/Documented,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,Run script against small graph fixture and query resulting index,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,Core/Docs Lane,,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 142 |
MAINT-003,,docs/qa/feature-user-story-status.csv,Maintainer,CI change classifier,scripts/ci_classifier.py,scripts/ci_classifier.py and .github/workflows/test.yml,Medium,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,Automated Test,Tested Pass,CI classifier suite covers path classes and workflow contract behavior.,,,,,,2026-06-23,Core/Docs Lane,Validated by focused pytest in this tracker slice.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 143 |
+
MAINT-004,,docs/qa/feature-user-story-status.csv,Maintainer,No-test policy gate,scripts/ci_no_test_policy.py,scripts/ci_no_test_policy.py and .github/workflows/test.yml,Medium,As a reviewer I can reject risky code or workflow changes without test updates,Policy fails contract changes 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,Automated Test,Tested Pass,CI policy and preflight suites cover contract files release metadata exceptions and rejection when diff context is missing.,,,,,,2026-07-05,Core/Docs Lane,Validated after preflight started passing real per-file diffs to the policy helper.,Reviewed by no-mistakes,Documentation sync verified against current policy behavior.,Ponytail: release metadata exemptions require actual diff evidence.,Validated by focused policy and preflight regressions
|
| 144 |
MAINT-005,,docs/qa/feature-user-story-status.csv,Maintainer,Required CI aggregate,scripts/ci_required.py,scripts/ci_required.py and .github/workflows/test.yml,Medium,As a branch maintainer I can trust the required CI summary,Aggregate rejects failed missing or wrongly skipped required jobs and allows documented conditional skips,CI required tests available,python -m pytest src/tests/test_ci_classifier.py -q,Automated Test,Tested Pass,CI classifier suite covers required job dependency success failure and conditional skip cases.,,,,,,2026-06-23,Core/Docs Lane,Validated by focused pytest in this tracker slice.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 145 |
+
MAINT-006,,docs/qa/feature-user-story-status.csv,Maintainer,CI preflight gate,scripts/ci_preflight.py,scripts/ci_preflight.py and scripts/ci_classifier.py,Medium,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 feature dashboard bug-smoke and toolbox coverage, strict build, graph, browser, package, and similarity gates required",Repo checkout with git available,Run scripts/ci_preflight.py against representative changed files,CI/CD Gate,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.",,,,,,2026-07-05,Core/Docs Lane,Validated through the preflight selection seam and workflow parity test without launching expensive full preflight.,Reviewed by no-mistakes,Documentation sync verified against current preflight and docs-check coverage.,Ponytail: dashboard tracker coverage now matches PR docs workflow.,Validated by focused preflight regression
|
| 146 |
MAINT-007,,docs/qa/feature-user-story-status.csv,Maintainer,Clean host contract script,scripts/clean_host_contract.py,scripts/clean_host_contract.py and .github/workflows/clean-host-contract.yml,Medium,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,Automated Test,Tested Pass,Clean host contract job passed inside PR #195 required checks.,,,,,,2026-06-23,Core/Docs Lane,Workflow evidence covers the script path.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 147 |
MAINT-008,,docs/qa/feature-user-story-status.csv,Maintainer,Dashboard smoke script,scripts/dashboard_smoke.py,scripts/dashboard_smoke.py,Medium,As a maintainer I can smoke a running monitor before release,Script probes an already running ctx-monitor base URL and checks key pages/APIs with optional warmup,Monitor running or fake HTTP fixture available,python -m pytest src/tests/test_dashboard_smoke.py -q,Automated Test,Tested Pass,Dashboard smoke test suite covers route probing warmup and failure reporting for a supplied base URL.,,,,,,2026-06-29,Core/Docs Lane,Corrected wording from starts-or-probes to probes-running-monitor; ctx-monitor startup is tracked separately by CLI-042.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 148 |
MAINT-009,,docs/qa/feature-user-story-status.csv,Maintainer,Graph artifact guard,scripts/graph_artifact_guard.py,scripts/graph_artifact_guard.py,Medium,As a maintainer I can prevent huge graph artifacts from bloating local Git state,Guard parks unparks and prunes graph artifacts safely without deleting unrelated files,Graph artifact fixture available,python -m pytest src/tests/test_graph_artifact_guard.py -q,Automated Test,Tested Pass,Graph artifact guard suite covers park unpark prune and explicit git prune safety.,,,,,,2026-06-23,Core/Docs Lane,Validated by focused pytest in this tracker slice.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
scripts/ci_no_test_policy.py
CHANGED
|
@@ -65,6 +65,14 @@ def is_test_file(path: str) -> bool:
|
|
| 65 |
return path.startswith("src/tests/") and path.endswith((".py", ".json"))
|
| 66 |
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
def is_release_metadata_only(
|
| 69 |
changed_files: Iterable[str],
|
| 70 |
diffs_by_file: dict[str, str],
|
|
@@ -79,10 +87,11 @@ def is_release_metadata_only(
|
|
| 79 |
for path in files:
|
| 80 |
if path == "CHANGELOG.md":
|
| 81 |
continue
|
|
|
|
|
|
|
|
|
|
| 82 |
if path in RELEASE_GENERATED_STATS_FILES:
|
| 83 |
-
for line in
|
| 84 |
-
if not line.startswith(("+", "-")) or line.startswith(("+++", "---")):
|
| 85 |
-
continue
|
| 86 |
text = line[1:].strip()
|
| 87 |
if (
|
| 88 |
not TEST_COUNT_STATS_RE.fullmatch(text)
|
|
@@ -95,9 +104,7 @@ def is_release_metadata_only(
|
|
| 95 |
return False
|
| 96 |
continue
|
| 97 |
expected = VERSION_LINE_RE if path == "pyproject.toml" else INIT_VERSION_LINE_RE
|
| 98 |
-
for line in
|
| 99 |
-
if not line.startswith(("+", "-")) or line.startswith(("+++", "---")):
|
| 100 |
-
continue
|
| 101 |
if not expected.fullmatch(line[1:].strip()):
|
| 102 |
return False
|
| 103 |
return True
|
|
|
|
| 65 |
return path.startswith("src/tests/") and path.endswith((".py", ".json"))
|
| 66 |
|
| 67 |
|
| 68 |
+
def _content_diff_lines(diff_text: str) -> tuple[str, ...]:
|
| 69 |
+
return tuple(
|
| 70 |
+
line
|
| 71 |
+
for line in diff_text.splitlines()
|
| 72 |
+
if line.startswith(("+", "-")) and not line.startswith(("+++", "---"))
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
|
| 76 |
def is_release_metadata_only(
|
| 77 |
changed_files: Iterable[str],
|
| 78 |
diffs_by_file: dict[str, str],
|
|
|
|
| 87 |
for path in files:
|
| 88 |
if path == "CHANGELOG.md":
|
| 89 |
continue
|
| 90 |
+
change_lines = _content_diff_lines(diffs_by_file.get(path, ""))
|
| 91 |
+
if not change_lines:
|
| 92 |
+
return False
|
| 93 |
if path in RELEASE_GENERATED_STATS_FILES:
|
| 94 |
+
for line in change_lines:
|
|
|
|
|
|
|
| 95 |
text = line[1:].strip()
|
| 96 |
if (
|
| 97 |
not TEST_COUNT_STATS_RE.fullmatch(text)
|
|
|
|
| 104 |
return False
|
| 105 |
continue
|
| 106 |
expected = VERSION_LINE_RE if path == "pyproject.toml" else INIT_VERSION_LINE_RE
|
| 107 |
+
for line in change_lines:
|
|
|
|
|
|
|
| 108 |
if not expected.fullmatch(line[1:].strip()):
|
| 109 |
return False
|
| 110 |
return True
|
scripts/ci_preflight.py
CHANGED
|
@@ -23,6 +23,13 @@ if str(REPO_ROOT) not in sys.path:
|
|
| 23 |
from scripts.ci_classifier import classify_paths # noqa: E402
|
| 24 |
from scripts.ci_no_test_policy import evaluate_policy # noqa: E402
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
GRAPH_VALIDATE_ARGS = (
|
| 28 |
"src/validate_graph_artifacts.py",
|
|
@@ -87,9 +94,27 @@ def _run_git(args: list[str], *, allow_failure: bool = False) -> list[str]:
|
|
| 87 |
return [line.strip() for line in proc.stdout.splitlines() if line.strip()]
|
| 88 |
|
| 89 |
|
| 90 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
merge_base = _run_git(["merge-base", base_ref, "HEAD"], allow_failure=True)
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
paths = set(_run_git(["diff", "--name-only", base, "HEAD"], allow_failure=True))
|
| 94 |
paths.update(_run_git(["diff", "--name-only"], allow_failure=True))
|
| 95 |
paths.update(_run_git(["diff", "--cached", "--name-only"], allow_failure=True))
|
|
@@ -97,6 +122,21 @@ def changed_files(base_ref: str) -> list[str]:
|
|
| 97 |
return sorted(path.replace("\\", "/") for path in paths)
|
| 98 |
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
def select_checks(
|
| 101 |
*,
|
| 102 |
base_ref: str,
|
|
@@ -190,9 +230,7 @@ def select_checks(
|
|
| 190 |
"pytest",
|
| 191 |
"-q",
|
| 192 |
"--no-cov",
|
| 193 |
-
|
| 194 |
-
"src/tests/test_feature_user_story_tracker.py",
|
| 195 |
-
"src/tests/test_toolbox_cli.py",
|
| 196 |
),
|
| 197 |
),
|
| 198 |
Check("docs strict build", (python, "-m", "mkdocs", "build", "--strict")),
|
|
@@ -286,8 +324,15 @@ def select_checks(
|
|
| 286 |
return checks, notes
|
| 287 |
|
| 288 |
|
| 289 |
-
def _run_no_test_policy_for_files(
|
| 290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
print(result.message)
|
| 292 |
if result.contract_files:
|
| 293 |
print("Contract files:")
|
|
@@ -358,7 +403,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
| 358 |
|
| 359 |
files = changed_files(args.base)
|
| 360 |
if args.internal_no_test_policy:
|
| 361 |
-
return _run_no_test_policy_for_files(files)
|
| 362 |
|
| 363 |
checks, notes = select_checks(
|
| 364 |
base_ref=args.base,
|
|
|
|
| 23 |
from scripts.ci_classifier import classify_paths # noqa: E402
|
| 24 |
from scripts.ci_no_test_policy import evaluate_policy # noqa: E402
|
| 25 |
|
| 26 |
+
PUBLIC_DOCS_TRACKER_TESTS = (
|
| 27 |
+
"src/tests/test_bug_smoke_tracker.py",
|
| 28 |
+
"src/tests/test_feature_user_story_tracker.py",
|
| 29 |
+
"src/tests/test_dashboard_user_story_tracker.py",
|
| 30 |
+
"src/tests/test_toolbox_cli.py",
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
|
| 34 |
GRAPH_VALIDATE_ARGS = (
|
| 35 |
"src/validate_graph_artifacts.py",
|
|
|
|
| 94 |
return [line.strip() for line in proc.stdout.splitlines() if line.strip()]
|
| 95 |
|
| 96 |
|
| 97 |
+
def _run_git_text(args: list[str], *, allow_failure: bool = False) -> str:
|
| 98 |
+
proc = subprocess.run(
|
| 99 |
+
["git", *args],
|
| 100 |
+
check=False,
|
| 101 |
+
capture_output=True,
|
| 102 |
+
text=True,
|
| 103 |
+
)
|
| 104 |
+
if proc.returncode != 0:
|
| 105 |
+
if allow_failure:
|
| 106 |
+
return ""
|
| 107 |
+
raise RuntimeError(proc.stderr.strip() or proc.stdout.strip())
|
| 108 |
+
return proc.stdout
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def _diff_base(base_ref: str) -> str:
|
| 112 |
merge_base = _run_git(["merge-base", base_ref, "HEAD"], allow_failure=True)
|
| 113 |
+
return merge_base[0] if merge_base else base_ref
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def changed_files(base_ref: str) -> list[str]:
|
| 117 |
+
base = _diff_base(base_ref)
|
| 118 |
paths = set(_run_git(["diff", "--name-only", base, "HEAD"], allow_failure=True))
|
| 119 |
paths.update(_run_git(["diff", "--name-only"], allow_failure=True))
|
| 120 |
paths.update(_run_git(["diff", "--cached", "--name-only"], allow_failure=True))
|
|
|
|
| 122 |
return sorted(path.replace("\\", "/") for path in paths)
|
| 123 |
|
| 124 |
|
| 125 |
+
def _diffs_for_files(base_ref: str, files: list[str]) -> dict[str, str]:
|
| 126 |
+
base = _diff_base(base_ref)
|
| 127 |
+
diffs: dict[str, str] = {}
|
| 128 |
+
for path in files:
|
| 129 |
+
parts = (
|
| 130 |
+
_run_git_text(["diff", "--unified=0", base, "HEAD", "--", path], allow_failure=True),
|
| 131 |
+
_run_git_text(["diff", "--cached", "--unified=0", "--", path], allow_failure=True),
|
| 132 |
+
_run_git_text(["diff", "--unified=0", "--", path], allow_failure=True),
|
| 133 |
+
)
|
| 134 |
+
diff_text = "\n".join(part for part in parts if part)
|
| 135 |
+
if diff_text:
|
| 136 |
+
diffs[path] = diff_text
|
| 137 |
+
return diffs
|
| 138 |
+
|
| 139 |
+
|
| 140 |
def select_checks(
|
| 141 |
*,
|
| 142 |
base_ref: str,
|
|
|
|
| 230 |
"pytest",
|
| 231 |
"-q",
|
| 232 |
"--no-cov",
|
| 233 |
+
*PUBLIC_DOCS_TRACKER_TESTS,
|
|
|
|
|
|
|
| 234 |
),
|
| 235 |
),
|
| 236 |
Check("docs strict build", (python, "-m", "mkdocs", "build", "--strict")),
|
|
|
|
| 324 |
return checks, notes
|
| 325 |
|
| 326 |
|
| 327 |
+
def _run_no_test_policy_for_files(
|
| 328 |
+
files: list[str],
|
| 329 |
+
*,
|
| 330 |
+
base_ref: str = "origin/main",
|
| 331 |
+
diffs_by_file: dict[str, str] | None = None,
|
| 332 |
+
) -> int:
|
| 333 |
+
if diffs_by_file is None:
|
| 334 |
+
diffs_by_file = _diffs_for_files(base_ref, files)
|
| 335 |
+
result = evaluate_policy(files, (), diffs_by_file)
|
| 336 |
print(result.message)
|
| 337 |
if result.contract_files:
|
| 338 |
print("Contract files:")
|
|
|
|
| 403 |
|
| 404 |
files = changed_files(args.base)
|
| 405 |
if args.internal_no_test_policy:
|
| 406 |
+
return _run_no_test_policy_for_files(files, base_ref=args.base)
|
| 407 |
|
| 408 |
checks, notes = select_checks(
|
| 409 |
base_ref=args.base,
|
src/ctx/core/wiki/wiki_packs.py
CHANGED
|
@@ -120,6 +120,12 @@ class WikiPackPromotion:
|
|
| 120 |
}
|
| 121 |
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
def write_wiki_base_pack(
|
| 124 |
*,
|
| 125 |
pack_dir: Path,
|
|
@@ -253,12 +259,13 @@ def _overlay_sort_key(entry: WikiPackEntry) -> tuple[str, str]:
|
|
| 253 |
return entry.manifest.created_at or "", entry.manifest.pack_id
|
| 254 |
|
| 255 |
|
| 256 |
-
def
|
| 257 |
-
"""Return wiki-relative markdown pages after applying
|
| 258 |
entries = discover_wiki_pack_manifests(packs_dir)
|
| 259 |
if not entries:
|
| 260 |
-
return {}
|
| 261 |
pages: dict[str, str] = {}
|
|
|
|
| 262 |
for entry in entries:
|
| 263 |
page_rows = _read_jsonl_objects(entry.path / "pages.jsonl")
|
| 264 |
tombstone_rows = _read_jsonl_objects(entry.path / "tombstones.jsonl")
|
|
@@ -281,9 +288,17 @@ def load_merged_wiki_pages(packs_dir: Path) -> dict[str, str]:
|
|
| 281 |
if isinstance(expected_sha, str) and expected_sha != _sha256_text(text):
|
| 282 |
raise WikiPackManifestError(f"wiki page checksum mismatch: {relpath}")
|
| 283 |
pages[relpath] = text
|
|
|
|
| 284 |
for row in tombstone_rows:
|
| 285 |
-
|
| 286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
|
| 288 |
|
| 289 |
def compact_wiki_packs(
|
|
|
|
| 120 |
}
|
| 121 |
|
| 122 |
|
| 123 |
+
@dataclass(frozen=True)
|
| 124 |
+
class WikiPackState:
|
| 125 |
+
pages: dict[str, str]
|
| 126 |
+
tombstones: frozenset[str]
|
| 127 |
+
|
| 128 |
+
|
| 129 |
def write_wiki_base_pack(
|
| 130 |
*,
|
| 131 |
pack_dir: Path,
|
|
|
|
| 259 |
return entry.manifest.created_at or "", entry.manifest.pack_id
|
| 260 |
|
| 261 |
|
| 262 |
+
def load_merged_wiki_pack_state(packs_dir: Path) -> WikiPackState:
|
| 263 |
+
"""Return wiki-relative markdown pages and active tombstones after applying overlays."""
|
| 264 |
entries = discover_wiki_pack_manifests(packs_dir)
|
| 265 |
if not entries:
|
| 266 |
+
return WikiPackState(pages={}, tombstones=frozenset())
|
| 267 |
pages: dict[str, str] = {}
|
| 268 |
+
tombstones: set[str] = set()
|
| 269 |
for entry in entries:
|
| 270 |
page_rows = _read_jsonl_objects(entry.path / "pages.jsonl")
|
| 271 |
tombstone_rows = _read_jsonl_objects(entry.path / "tombstones.jsonl")
|
|
|
|
| 288 |
if isinstance(expected_sha, str) and expected_sha != _sha256_text(text):
|
| 289 |
raise WikiPackManifestError(f"wiki page checksum mismatch: {relpath}")
|
| 290 |
pages[relpath] = text
|
| 291 |
+
tombstones.discard(relpath)
|
| 292 |
for row in tombstone_rows:
|
| 293 |
+
relpath = _normalise_page_path(_required_str(row, "path"))
|
| 294 |
+
pages.pop(relpath, None)
|
| 295 |
+
tombstones.add(relpath)
|
| 296 |
+
return WikiPackState(pages=pages, tombstones=frozenset(tombstones))
|
| 297 |
+
|
| 298 |
+
|
| 299 |
+
def load_merged_wiki_pages(packs_dir: Path) -> dict[str, str]:
|
| 300 |
+
"""Return wiki-relative markdown pages after applying overlay packs."""
|
| 301 |
+
return load_merged_wiki_pack_state(packs_dir).pages
|
| 302 |
|
| 303 |
|
| 304 |
def compact_wiki_packs(
|
src/ctx/monitor/compat.py
CHANGED
|
@@ -1253,7 +1253,7 @@ def _render_wiki_entity(
|
|
| 1253 |
def _wiki_index_entries(
|
| 1254 |
limit_per_type: int | None = _WIKI_INDEX_LIMIT_PER_TYPE,
|
| 1255 |
) -> list[dict]:
|
| 1256 |
-
"""List
|
| 1257 |
|
| 1258 |
Returns ``{slug, type, tags, description}`` rows. The full skill inventory
|
| 1259 |
is too large to render as one HTML page, so the dashboard samples
|
|
|
|
| 1253 |
def _wiki_index_entries(
|
| 1254 |
limit_per_type: int | None = _WIKI_INDEX_LIMIT_PER_TYPE,
|
| 1255 |
) -> list[dict]:
|
| 1256 |
+
"""List dashboard-supported wiki entities from packs plus local files.
|
| 1257 |
|
| 1258 |
Returns ``{slug, type, tags, description}`` rows. The full skill inventory
|
| 1259 |
is too large to render as one HTML page, so the dashboard samples
|
src/ctx/monitor/pages/wiki_entity.py
CHANGED
|
@@ -12,6 +12,13 @@ from ctx.monitor.pages.wiki_markdown import TruncateFn, WikiLinkFn, render_wiki_
|
|
| 12 |
|
| 13 |
MetricRowFn = Callable[[str, Any], str]
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
def entity_tab_script() -> str:
|
| 17 |
return """
|
|
@@ -166,6 +173,25 @@ def subgraph_quality_cell(sidecar: dict[str, Any] | None) -> str:
|
|
| 166 |
return f"<span class='pill grade-{grade}'>{grade}</span> <code>{score:.3f}</code>{floor_html}"
|
| 167 |
|
| 168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
def _subgraph_node_title(
|
| 170 |
label: str,
|
| 171 |
entity_type: str,
|
|
@@ -357,7 +383,7 @@ def render_entity_subgraph_svg(
|
|
| 357 |
" document.getElementById('entity-subgraph-zoom-in')?.addEventListener('click', () => { zoom = Math.min(2.5, zoom * 1.18); draw(); });\n"
|
| 358 |
" document.getElementById('entity-subgraph-zoom-out')?.addEventListener('click', () => { zoom = Math.max(0.35, zoom / 1.18); draw(); });\n"
|
| 359 |
" let dragging = false, lastX = 0, lastY = 0;\n"
|
| 360 |
-
" svg.addEventListener('pointerdown', ev => { if (ev.target.closest('[data-
|
| 361 |
" svg.addEventListener('pointerup', ev => { dragging = false; try { svg.releasePointerCapture(ev.pointerId); } catch (_) {} });\n"
|
| 362 |
" svg.addEventListener('pointermove', ev => { if (!dragging) return; yaw += (ev.clientX - lastX) * 0.01; pitch += (ev.clientY - lastY) * 0.01; pitch = Math.max(-1.35, Math.min(1.35, pitch)); lastX = ev.clientX; lastY = ev.clientY; draw(); });\n"
|
| 363 |
" svg.addEventListener('wheel', ev => { ev.preventDefault(); zoom = Math.max(0.35, Math.min(2.5, zoom * (ev.deltaY < 0 ? 1.08 : 0.92))); draw(); }, {passive:false});\n"
|
|
@@ -693,10 +719,16 @@ def render_wiki_entity(
|
|
| 693 |
f"<h1>{html.escape(slug)}</h1><p class='muted'>read error: page unavailable</p>",
|
| 694 |
)
|
| 695 |
meta, md_body = parse_frontmatter(raw)
|
| 696 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 697 |
return render_wiki_entity_page(
|
| 698 |
slug=slug,
|
| 699 |
-
entity_type=
|
| 700 |
meta=meta,
|
| 701 |
md_body=md_body,
|
| 702 |
sidecar=sidecar if isinstance(sidecar, dict) else None,
|
|
|
|
| 12 |
|
| 13 |
MetricRowFn = Callable[[str, Any], str]
|
| 14 |
|
| 15 |
+
_ENTITY_TYPE_FOR_PATH_SUBJECT = {
|
| 16 |
+
"skills": "skill",
|
| 17 |
+
"agents": "agent",
|
| 18 |
+
"mcp-servers": "mcp-server",
|
| 19 |
+
"harnesses": "harness",
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
|
| 23 |
def entity_tab_script() -> str:
|
| 24 |
return """
|
|
|
|
| 173 |
return f"<span class='pill grade-{grade}'>{grade}</span> <code>{score:.3f}</code>{floor_html}"
|
| 174 |
|
| 175 |
|
| 176 |
+
def resolved_wiki_entity_type(
|
| 177 |
+
requested_type: str | None,
|
| 178 |
+
meta: dict[str, Any],
|
| 179 |
+
path: Any,
|
| 180 |
+
*,
|
| 181 |
+
dashboard_entity_types: tuple[str, ...],
|
| 182 |
+
) -> str | None:
|
| 183 |
+
if requested_type in dashboard_entity_types:
|
| 184 |
+
return requested_type
|
| 185 |
+
frontmatter_type = str(meta.get("type") or "").strip()
|
| 186 |
+
if frontmatter_type in dashboard_entity_types:
|
| 187 |
+
return frontmatter_type
|
| 188 |
+
for part in getattr(path, "parts", ()):
|
| 189 |
+
path_type = _ENTITY_TYPE_FOR_PATH_SUBJECT.get(str(part))
|
| 190 |
+
if path_type in dashboard_entity_types:
|
| 191 |
+
return path_type
|
| 192 |
+
return requested_type
|
| 193 |
+
|
| 194 |
+
|
| 195 |
def _subgraph_node_title(
|
| 196 |
label: str,
|
| 197 |
entity_type: str,
|
|
|
|
| 383 |
" document.getElementById('entity-subgraph-zoom-in')?.addEventListener('click', () => { zoom = Math.min(2.5, zoom * 1.18); draw(); });\n"
|
| 384 |
" document.getElementById('entity-subgraph-zoom-out')?.addEventListener('click', () => { zoom = Math.max(0.35, zoom / 1.18); draw(); });\n"
|
| 385 |
" let dragging = false, lastX = 0, lastY = 0;\n"
|
| 386 |
+
" svg.addEventListener('pointerdown', ev => { if (ev.target.closest('[data-testid=\"entity-subgraph-node\"]') || ev.target.closest('[data-edge-detail]')) return; dragging = true; lastX = ev.clientX; lastY = ev.clientY; svg.setPointerCapture(ev.pointerId); });\n"
|
| 387 |
" svg.addEventListener('pointerup', ev => { dragging = false; try { svg.releasePointerCapture(ev.pointerId); } catch (_) {} });\n"
|
| 388 |
" svg.addEventListener('pointermove', ev => { if (!dragging) return; yaw += (ev.clientX - lastX) * 0.01; pitch += (ev.clientY - lastY) * 0.01; pitch = Math.max(-1.35, Math.min(1.35, pitch)); lastX = ev.clientX; lastY = ev.clientY; draw(); });\n"
|
| 389 |
" svg.addEventListener('wheel', ev => { ev.preventDefault(); zoom = Math.max(0.35, Math.min(2.5, zoom * (ev.deltaY < 0 ? 1.08 : 0.92))); draw(); }, {passive:false});\n"
|
|
|
|
| 719 |
f"<h1>{html.escape(slug)}</h1><p class='muted'>read error: page unavailable</p>",
|
| 720 |
)
|
| 721 |
meta, md_body = parse_frontmatter(raw)
|
| 722 |
+
resolved_type = resolved_wiki_entity_type(
|
| 723 |
+
entity_type,
|
| 724 |
+
meta,
|
| 725 |
+
path,
|
| 726 |
+
dashboard_entity_types=dashboard_entity_types,
|
| 727 |
+
)
|
| 728 |
+
sidecar = load_sidecar(slug, entity_type=resolved_type)
|
| 729 |
return render_wiki_entity_page(
|
| 730 |
slug=slug,
|
| 731 |
+
entity_type=resolved_type,
|
| 732 |
meta=meta,
|
| 733 |
md_body=md_body,
|
| 734 |
sidecar=sidecar if isinstance(sidecar, dict) else None,
|
src/ctx/monitor/services/wiki.py
CHANGED
|
@@ -12,14 +12,14 @@ from urllib.parse import quote
|
|
| 12 |
|
| 13 |
from ctx.core import entity_types as core_entity_types
|
| 14 |
from ctx.core.wiki import wiki_queue
|
| 15 |
-
from ctx.core.wiki.wiki_packs import
|
| 16 |
from ctx.core.wiki.wiki_utils import parse_frontmatter_and_body
|
| 17 |
from ctx.monitor.services import graph as graph_service
|
| 18 |
from ctx.utils._safe_name import is_safe_source_name
|
| 19 |
|
| 20 |
|
| 21 |
_WIKI_PACK_CACHE_KEY: tuple[Any, ...] | None = None
|
| 22 |
-
_WIKI_PACK_CACHE_VALUE:
|
| 23 |
_DASHBOARD_ENTITY_SOURCES: tuple[tuple[str, str, bool], ...] = (
|
| 24 |
core_entity_types.entity_source_specs()
|
| 25 |
)
|
|
@@ -71,8 +71,8 @@ def queue_entity_refresh(
|
|
| 71 |
)
|
| 72 |
|
| 73 |
|
| 74 |
-
def
|
| 75 |
-
"""Return merged wiki-pack
|
| 76 |
global _WIKI_PACK_CACHE_KEY, _WIKI_PACK_CACHE_VALUE
|
| 77 |
|
| 78 |
packs_dir = wiki_dir / "wiki-packs"
|
|
@@ -93,10 +93,16 @@ def wiki_pack_pages(wiki_dir: Path) -> dict[str, str] | None:
|
|
| 93 |
if _WIKI_PACK_CACHE_KEY == cache_key and _WIKI_PACK_CACHE_VALUE is not None:
|
| 94 |
return _WIKI_PACK_CACHE_VALUE
|
| 95 |
|
| 96 |
-
|
| 97 |
_WIKI_PACK_CACHE_KEY = cache_key
|
| 98 |
-
_WIKI_PACK_CACHE_VALUE =
|
| 99 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
|
| 102 |
def entity_path(
|
|
@@ -110,18 +116,21 @@ def entity_path(
|
|
| 110 |
normalized = normalize_entity_type(entity_type) if entity_type else None
|
| 111 |
if entity_type is not None and normalized is None:
|
| 112 |
return None
|
| 113 |
-
|
| 114 |
for _sub, current_type, _recursive in _DASHBOARD_ENTITY_SOURCES:
|
| 115 |
if normalized is not None and normalized != current_type:
|
| 116 |
continue
|
| 117 |
path = core_entity_types.entity_page_path(wiki_dir, current_type, slug)
|
| 118 |
if path is None:
|
| 119 |
continue
|
| 120 |
-
if
|
| 121 |
relpath = core_entity_types.entity_relpath(current_type, slug)
|
| 122 |
-
if relpath is not None
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
| 125 |
if path.exists():
|
| 126 |
return path
|
| 127 |
return None
|
|
@@ -144,12 +153,30 @@ def iter_entity_paths(
|
|
| 144 |
wiki_dir: Path,
|
| 145 |
entity_type: str | None = None,
|
| 146 |
) -> list[tuple[str, str, Path]]:
|
|
|
|
| 147 |
normalized = normalize_entity_type(entity_type) if entity_type else None
|
| 148 |
if entity_type is not None and normalized is None:
|
| 149 |
raise ValueError(f"unsupported entity_type: {entity_type!r}")
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
for relpath in sorted(pack_pages):
|
| 154 |
parsed = pack_entity_from_relpath(relpath)
|
| 155 |
if parsed is None:
|
|
@@ -157,25 +184,14 @@ def iter_entity_paths(
|
|
| 157 |
slug, current_type = parsed
|
| 158 |
if normalized is not None and normalized != current_type:
|
| 159 |
continue
|
| 160 |
-
|
| 161 |
-
if
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
for sub, current_type, recursive in _DASHBOARD_ENTITY_SOURCES:
|
| 169 |
-
if normalized is not None and normalized != current_type:
|
| 170 |
-
continue
|
| 171 |
-
root = base / sub
|
| 172 |
-
if not root.is_dir():
|
| 173 |
-
continue
|
| 174 |
-
paths = root.rglob("*.md") if recursive else root.glob("*.md")
|
| 175 |
-
for path in paths:
|
| 176 |
-
slug = path.stem
|
| 177 |
-
if is_safe_slug(slug):
|
| 178 |
-
file_rows.append((slug, current_type, path))
|
| 179 |
return sorted(file_rows, key=lambda row: (row[1], row[0].lower(), row[2].as_posix()))
|
| 180 |
|
| 181 |
|
|
@@ -229,20 +245,30 @@ def read_entity_text(
|
|
| 229 |
entity_type: str | None,
|
| 230 |
path: Path,
|
| 231 |
) -> str | None:
|
| 232 |
-
|
| 233 |
-
if
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
relpath
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
try:
|
| 241 |
return path.read_text(encoding="utf-8", errors="replace")
|
| 242 |
except OSError:
|
| 243 |
return None
|
| 244 |
|
| 245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
def wiki_stats_from_dashboard_index(
|
| 247 |
index_path: Path,
|
| 248 |
*,
|
|
|
|
| 12 |
|
| 13 |
from ctx.core import entity_types as core_entity_types
|
| 14 |
from ctx.core.wiki import wiki_queue
|
| 15 |
+
from ctx.core.wiki.wiki_packs import WikiPackState, load_merged_wiki_pack_state
|
| 16 |
from ctx.core.wiki.wiki_utils import parse_frontmatter_and_body
|
| 17 |
from ctx.monitor.services import graph as graph_service
|
| 18 |
from ctx.utils._safe_name import is_safe_source_name
|
| 19 |
|
| 20 |
|
| 21 |
_WIKI_PACK_CACHE_KEY: tuple[Any, ...] | None = None
|
| 22 |
+
_WIKI_PACK_CACHE_VALUE: WikiPackState | None = None
|
| 23 |
_DASHBOARD_ENTITY_SOURCES: tuple[tuple[str, str, bool], ...] = (
|
| 24 |
core_entity_types.entity_source_specs()
|
| 25 |
)
|
|
|
|
| 71 |
)
|
| 72 |
|
| 73 |
|
| 74 |
+
def wiki_pack_state(wiki_dir: Path) -> WikiPackState | None:
|
| 75 |
+
"""Return cached merged wiki-pack state, preserving active tombstones."""
|
| 76 |
global _WIKI_PACK_CACHE_KEY, _WIKI_PACK_CACHE_VALUE
|
| 77 |
|
| 78 |
packs_dir = wiki_dir / "wiki-packs"
|
|
|
|
| 93 |
if _WIKI_PACK_CACHE_KEY == cache_key and _WIKI_PACK_CACHE_VALUE is not None:
|
| 94 |
return _WIKI_PACK_CACHE_VALUE
|
| 95 |
|
| 96 |
+
state = load_merged_wiki_pack_state(packs_dir)
|
| 97 |
_WIKI_PACK_CACHE_KEY = cache_key
|
| 98 |
+
_WIKI_PACK_CACHE_VALUE = state
|
| 99 |
+
return state
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def wiki_pack_pages(wiki_dir: Path) -> dict[str, str] | None:
|
| 103 |
+
"""Return merged wiki-pack pages, or None when packs are not installed."""
|
| 104 |
+
state = wiki_pack_state(wiki_dir)
|
| 105 |
+
return state.pages if state is not None else None
|
| 106 |
|
| 107 |
|
| 108 |
def entity_path(
|
|
|
|
| 116 |
normalized = normalize_entity_type(entity_type) if entity_type else None
|
| 117 |
if entity_type is not None and normalized is None:
|
| 118 |
return None
|
| 119 |
+
pack_state = wiki_pack_state(wiki_dir)
|
| 120 |
for _sub, current_type, _recursive in _DASHBOARD_ENTITY_SOURCES:
|
| 121 |
if normalized is not None and normalized != current_type:
|
| 122 |
continue
|
| 123 |
path = core_entity_types.entity_page_path(wiki_dir, current_type, slug)
|
| 124 |
if path is None:
|
| 125 |
continue
|
| 126 |
+
if pack_state is not None:
|
| 127 |
relpath = core_entity_types.entity_relpath(current_type, slug)
|
| 128 |
+
if relpath is not None:
|
| 129 |
+
relpath_text = relpath.as_posix()
|
| 130 |
+
if relpath_text in pack_state.pages:
|
| 131 |
+
return path
|
| 132 |
+
if relpath_text in pack_state.tombstones:
|
| 133 |
+
continue
|
| 134 |
if path.exists():
|
| 135 |
return path
|
| 136 |
return None
|
|
|
|
| 153 |
wiki_dir: Path,
|
| 154 |
entity_type: str | None = None,
|
| 155 |
) -> list[tuple[str, str, Path]]:
|
| 156 |
+
"""List pack-backed entities plus local files not shadowed by packs."""
|
| 157 |
normalized = normalize_entity_type(entity_type) if entity_type else None
|
| 158 |
if entity_type is not None and normalized is None:
|
| 159 |
raise ValueError(f"unsupported entity_type: {entity_type!r}")
|
| 160 |
+
base = wiki_dir / "entities"
|
| 161 |
+
file_rows: list[tuple[str, str, Path]] = []
|
| 162 |
+
if base.is_dir():
|
| 163 |
+
for sub, current_type, recursive in _DASHBOARD_ENTITY_SOURCES:
|
| 164 |
+
if normalized is not None and normalized != current_type:
|
| 165 |
+
continue
|
| 166 |
+
root = base / sub
|
| 167 |
+
if not root.is_dir():
|
| 168 |
+
continue
|
| 169 |
+
paths = root.rglob("*.md") if recursive else root.glob("*.md")
|
| 170 |
+
for file_path in paths:
|
| 171 |
+
slug = file_path.stem
|
| 172 |
+
if is_safe_slug(slug):
|
| 173 |
+
file_rows.append((slug, current_type, file_path))
|
| 174 |
+
|
| 175 |
+
pack_state = wiki_pack_state(wiki_dir)
|
| 176 |
+
if pack_state is not None:
|
| 177 |
+
pack_pages = pack_state.pages
|
| 178 |
+
rows: list[tuple[str, str, Path]] = []
|
| 179 |
+
pack_relpaths = set(pack_pages) | set(pack_state.tombstones)
|
| 180 |
for relpath in sorted(pack_pages):
|
| 181 |
parsed = pack_entity_from_relpath(relpath)
|
| 182 |
if parsed is None:
|
|
|
|
| 184 |
slug, current_type = parsed
|
| 185 |
if normalized is not None and normalized != current_type:
|
| 186 |
continue
|
| 187 |
+
pack_path = core_entity_types.entity_page_path(wiki_dir, current_type, slug)
|
| 188 |
+
if pack_path is not None:
|
| 189 |
+
rows.append((slug, current_type, pack_path))
|
| 190 |
+
for slug, current_type, file_path in file_rows:
|
| 191 |
+
file_relpath = core_entity_types.entity_relpath(current_type, slug)
|
| 192 |
+
if file_relpath is None or file_relpath.as_posix() not in pack_relpaths:
|
| 193 |
+
rows.append((slug, current_type, file_path))
|
| 194 |
+
return sorted(rows, key=lambda row: (row[1], row[0].lower(), row[2].as_posix()))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
return sorted(file_rows, key=lambda row: (row[1], row[0].lower(), row[2].as_posix()))
|
| 196 |
|
| 197 |
|
|
|
|
| 245 |
entity_type: str | None,
|
| 246 |
path: Path,
|
| 247 |
) -> str | None:
|
| 248 |
+
pack_state = wiki_pack_state(wiki_dir)
|
| 249 |
+
if pack_state is not None:
|
| 250 |
+
relpath = wiki_relative_path(wiki_dir, path)
|
| 251 |
+
if relpath is not None:
|
| 252 |
+
if relpath in pack_state.pages:
|
| 253 |
+
return pack_state.pages[relpath]
|
| 254 |
+
if relpath in pack_state.tombstones:
|
| 255 |
+
return None
|
| 256 |
try:
|
| 257 |
return path.read_text(encoding="utf-8", errors="replace")
|
| 258 |
except OSError:
|
| 259 |
return None
|
| 260 |
|
| 261 |
|
| 262 |
+
def wiki_relative_path(wiki_dir: Path, path: Path) -> str | None:
|
| 263 |
+
try:
|
| 264 |
+
return path.resolve().relative_to(wiki_dir.resolve()).as_posix()
|
| 265 |
+
except (OSError, ValueError):
|
| 266 |
+
try:
|
| 267 |
+
return path.relative_to(wiki_dir).as_posix()
|
| 268 |
+
except ValueError:
|
| 269 |
+
return None
|
| 270 |
+
|
| 271 |
+
|
| 272 |
def wiki_stats_from_dashboard_index(
|
| 273 |
index_path: Path,
|
| 274 |
*,
|