@blxzer/cursor-trellis 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +45 -21
  3. package/dist/configurators/workflow.d.ts +1 -1
  4. package/dist/configurators/workflow.d.ts.map +1 -1
  5. package/dist/configurators/workflow.js +20 -9
  6. package/dist/configurators/workflow.js.map +1 -1
  7. package/dist/migrations/manifests/0.1.3.json +9 -0
  8. package/dist/migrations/manifests/0.1.4.json +9 -0
  9. package/dist/templates/cursor/rules/retrieval-routing.mdc +9 -7
  10. package/dist/templates/markdown/agents.md +1 -1
  11. package/dist/templates/markdown/index.d.ts +1 -0
  12. package/dist/templates/markdown/index.d.ts.map +1 -1
  13. package/dist/templates/markdown/index.js +1 -0
  14. package/dist/templates/markdown/index.js.map +1 -1
  15. package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +13 -29
  16. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +0 -49
  17. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +0 -85
  18. package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +7 -21
  19. package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +6 -10
  20. package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +17 -18
  21. package/dist/templates/shared-hooks/inject-retrieval-plan.py +42 -23
  22. package/dist/templates/shared-hooks/inject-subagent-context.py +6 -2
  23. package/dist/templates/shared-hooks/session-start.py +17 -9
  24. package/dist/templates/trellis/index.d.ts +8 -4
  25. package/dist/templates/trellis/index.d.ts.map +1 -1
  26. package/dist/templates/trellis/index.js +13 -7
  27. package/dist/templates/trellis/index.js.map +1 -1
  28. package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +80 -31
  29. package/dist/templates/trellis/scripts/common/config.py +1 -1
  30. package/dist/templates/trellis/scripts/common/cursor_retrieval_env.py +92 -0
  31. package/dist/templates/trellis/scripts/common/parent_orchestration.py +27 -15
  32. package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +100 -9
  33. package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +76 -31
  34. package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +18 -3
  35. package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +19 -0
  36. package/dist/templates/trellis/scripts/common/smart_search_evidence.py +5 -2
  37. package/dist/templates/trellis/scripts/common/smart_search_resolve.py +28 -3
  38. package/dist/templates/trellis/scripts/common/task_gates.py +372 -73
  39. package/dist/templates/trellis/scripts/common/task_map.py +29 -1
  40. package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +396 -0
  41. package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +300 -0
  42. package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +126 -0
  43. package/dist/templates/trellis/workflow.md +9 -53
  44. package/dist/utils/codebase-retrieval-router.d.ts +5 -0
  45. package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
  46. package/dist/utils/codebase-retrieval-router.js +48 -28
  47. package/dist/utils/codebase-retrieval-router.js.map +1 -1
  48. package/dist/utils/cursor-retrieval-env.d.ts +28 -0
  49. package/dist/utils/cursor-retrieval-env.d.ts.map +1 -0
  50. package/dist/utils/cursor-retrieval-env.js +89 -0
  51. package/dist/utils/cursor-retrieval-env.js.map +1 -0
  52. package/dist/utils/project-capabilities.d.ts.map +1 -1
  53. package/dist/utils/project-capabilities.js +22 -15
  54. package/dist/utils/project-capabilities.js.map +1 -1
  55. package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -1
  56. package/dist/utils/retrieval-agent-instructions.js +37 -21
  57. package/dist/utils/retrieval-agent-instructions.js.map +1 -1
  58. package/dist/utils/retrieval-tool-classification.d.ts +2 -0
  59. package/dist/utils/retrieval-tool-classification.d.ts.map +1 -1
  60. package/dist/utils/retrieval-tool-classification.js +10 -2
  61. package/dist/utils/retrieval-tool-classification.js.map +1 -1
  62. package/dist/utils/semantic-plan-gate.d.ts +8 -0
  63. package/dist/utils/semantic-plan-gate.d.ts.map +1 -0
  64. package/dist/utils/semantic-plan-gate.js +42 -0
  65. package/dist/utils/semantic-plan-gate.js.map +1 -0
  66. package/package.json +5 -43
  67. package/bin/smart-search.js +0 -79
  68. package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +0 -342
  69. package/dist/templates/trellis/scripts/batch_plan_envelope.py +0 -105
  70. package/vendor/smart-search/LICENSE +0 -21
  71. package/vendor/smart-search/README.md +0 -412
  72. package/vendor/smart-search/README.zh-CN.md +0 -430
  73. package/vendor/smart-search/npm/bin/smart-search.js +0 -63
  74. package/vendor/smart-search/npm/scripts/postinstall.js +0 -87
  75. package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +0 -108
  76. package/vendor/smart-search/npm/scripts/set-package-version.js +0 -35
  77. package/vendor/smart-search/npm/scripts/sync-python-version.js +0 -22
  78. package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +0 -99
  79. package/vendor/smart-search/npm/scripts/test.js +0 -85
  80. package/vendor/smart-search/package.json +0 -42
  81. package/vendor/smart-search/pyproject.toml +0 -37
  82. package/vendor/smart-search/skills/smart-search-cli/SKILL.md +0 -387
  83. package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +0 -3
  84. package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +0 -98
  85. package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
  86. package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +0 -337
  87. package/vendor/smart-search/src/smart_search/__init__.py +0 -1
  88. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +0 -387
  89. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +0 -3
  90. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +0 -98
  91. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
  92. package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +0 -337
  93. package/vendor/smart-search/src/smart_search/cli.py +0 -2003
  94. package/vendor/smart-search/src/smart_search/config.py +0 -580
  95. package/vendor/smart-search/src/smart_search/logger.py +0 -43
  96. package/vendor/smart-search/src/smart_search/providers/__init__.py +0 -16
  97. package/vendor/smart-search/src/smart_search/providers/base.py +0 -41
  98. package/vendor/smart-search/src/smart_search/providers/context7.py +0 -141
  99. package/vendor/smart-search/src/smart_search/providers/exa.py +0 -206
  100. package/vendor/smart-search/src/smart_search/providers/jina.py +0 -136
  101. package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +0 -370
  102. package/vendor/smart-search/src/smart_search/providers/zhipu.py +0 -143
  103. package/vendor/smart-search/src/smart_search/service.py +0 -2865
  104. package/vendor/smart-search/src/smart_search/sources.py +0 -429
  105. package/vendor/smart-search/src/smart_search/utils.py +0 -220
@@ -20,30 +20,16 @@ python -c "from common.retrieval_tool_classification import classify_tool_calls;
20
20
 
21
21
  On **cursor**, `semantic_executed` = `platform_semantic_executed`. Track `fast_context_count` and `cursor_fast_context_misuse` separately.
22
22
 
23
- ## Plan-only metrics (eval)
23
+ ## Per-query checklist
24
24
 
25
- ```powershell
26
- python .trellis/scripts/batch_plan_envelope.py --queries queries-semantic-slice.jsonl --pretty
27
- ```
28
-
29
- Do **not** use legacy `scripts/batch-plan-envelope.py` (looks for `semantic-fast-context` on all platforms).
30
-
31
- ## 12-query slice experiment
32
-
33
- Prompt: `prompts/run-semantic-slice-12.md` in openclaw-retrieval-eval (or Trellis template copy).
25
+ When `platform-semantic` is in the route list, verify in the session tool log:
34
26
 
35
- Record per query:
27
+ - `plan_block_in_prompt` — visible `## 代码库检索计划` (or equivalent) before code search
28
+ - `tools_called` — verbatim tool names from Cursor
29
+ - `platform_semantic_executed` / `fast_context_count` — from `classify_tool_calls(..., platform=cursor, cursor_env=...)`
36
30
 
37
- - `plan_block_in_prompt` (visible `## 代码库检索计划` + 语义合规 block)
38
- - `tools_called` verbatim from Cursor
39
- - `platform_semantic_executed` / `fast_context_count` from classifier
40
-
41
- Aggregate:
42
-
43
- ```powershell
44
- python .trellis/scripts/aggregate_retrieval_telemetry.py runs/<run>/telemetry.jsonl --markdown
45
- ```
31
+ Plan-level presence does not imply execution-level use.
46
32
 
47
33
  ## Agent instructions
48
34
 
49
- When `platform-semantic` is in the route list, `render_agent_instructions` appends **语义合规(Cursor)** requiring one built-in semantic search before Top-1 and logging the host tool name.
35
+ When `platform-semantic` is in the route list, `render_agent_instructions` appends **语义合规(Cursor)** requiring one built-in semantic search before Top-1 and logging the host tool name.
@@ -47,7 +47,7 @@ If unsure: Task dispatch is the path Trellis workflow routes through; Agent sess
47
47
 
48
48
  ## Model dispatch strategy (BYOK-aware)
49
49
 
50
- > **Full technical analysis:** .trellis/spec/guides/cursor-subagent-reverse-engineering-report.md
50
+ > **Model routing details:** See Method 2.5 / 2.6 below and Cursor++ provider settings (`~/.ccursor/providers.json`).
51
51
 
52
52
  ### Environment detection
53
53
 
@@ -56,7 +56,7 @@ If unsure: Task dispatch is the path Trellis workflow routes through; Agent sess
56
56
  | **Native Cursor API** | Frontmatter `model:` works (server-side routing) | Native model picker |
57
57
  | **Cursor++ BYOK** | ❌ Frontmatter / Cursor Settings per-agent: not wired for `trellis-*`; **✅ Method 2.5** if applied | ✅ Independent model via Cursor++ panel (v0.0.11+) |
58
58
 
59
- Under Cursor++ BYOK, **committed** agent frontmatter `model:` and **Cursor Settings** UI for `trellis-research` / `trellis-implement` / `trellis-check` do **not** populate `subagentModelOverrides` for those types (verified). Without **Method 2.5**, custom Task subagents **inherit** the parent session BYOK model. See `.trellis/spec/guides/cursor-subagent-reverse-engineering-report.md`.
59
+ Under Cursor++ BYOK, **committed** agent frontmatter `model:` and **Cursor Settings** UI for `trellis-research` / `trellis-implement` / `trellis-check` do **not** populate `subagentModelOverrides` for those types (verified). Without **Method 2.5**, custom Task subagents **inherit** the parent session BYOK model.
60
60
 
61
61
  ### Dispatch strategy matrix
62
62
 
@@ -332,15 +332,12 @@ When `preToolUse` cannot resolve a selected task, the subagent should read **`Se
332
332
 
333
333
  ### Confirmed compatibility (v0.0.11+, Cursor 3.7.27)
334
334
 
335
- Verified by local testing on `D:\MyHarness` workspace:
336
-
337
- | Trellis component | Status under Cursor++ | Evidence |
335
+ | Trellis component | Status under Cursor++ | Notes |
338
336
  | --------------------- | --------------------- | ----------------------------------------------------------------------------------- |
339
337
  | `.cursor/agents/` | Normal | Agent files not intercepted; `model:` frontmatter read by Cursor at spawn |
340
- | `.cursor/hooks/` | Normal | Agent log `requestContextKeys` contains `hooksConfig` |
341
- | `.cursor/skills/` | Normal | Agent log `requestContextKeys` contains `agentSkills` |
342
- | `.cursor/mcp.json` | Normal | 4+ MCP servers, 300+ tools load normally |
343
- | SubAgent write access | **Fixed in v0.0.11** | Prior versions defaulted SubAgent to readonly; `ttrellis-implement` now writes files |
338
+ | `.cursor/hooks/` | Normal | Hook config loads; verify `hooksConfig` in agent logs when debugging |
339
+ | `.cursor/mcp.json` | Normal | MCP servers and tools load normally |
340
+ | SubAgent write access | **Fixed in v0.0.11** | Prior versions defaulted SubAgent to readonly; `trellis-implement` now writes files |
344
341
 
345
342
  **Minimum version: v0.0.11.** Earlier versions break `ttrellis-implement` due to SubAgent readonly bug.
346
343
 
@@ -351,7 +348,6 @@ Verified by local testing on `D:\MyHarness` workspace:
351
348
  - The `model:` ID **must match** a model configured in Cursor++ provider settings (`~/.ccursor/providers.json`). If it doesn't match, the request will fail with a provider error.
352
349
  - Cursor++ intercepts `AvailableModels`/`GetDefaultModel` - the model picker and model list are determined by BYOK provider config, not Cursor's official model catalog.
353
350
  - Under Cursor++, "inherit" means the parent session's BYOK-routed model, which may differ from what the Cursor UI label suggests.
354
- - **Full technical analysis:** `.trellis/spec/guides/cursor-subagent-reverse-engineering-report.md`
355
351
 
356
352
  ### Safety boundary
357
353
 
@@ -12,7 +12,7 @@ For **external / current / web facts**, **smart-search** (`run_smart_search.py`)
12
12
  | --- | --- | --- |
13
13
  | Exact string / path / log line | **rg** (Grep) | Fast literal match in repo |
14
14
  | Symbol, callers, edit blast radius | **codegraph** MCP | Structure-first for caller/trap/extension intents |
15
- | Unknown keywords, semantic discovery | **@codebase** (Cursor) | Cursor's platform-native semantic search |
15
+ | Unknown keywords, semantic discovery | **@codebase** (Cursor Native) / **fast-context** (Cursor++ BYOK) | Native: built-in semantic; BYOK: `fast_context_search` MCP (see `cursorEnv` in plans) |
16
16
  | External / current facts | **smart-search-cli** | **Mandatory first** — built-in web tools are downgrade-only (see rule above) |
17
17
  | Trellis durable docs | **artifact-search** | `search_artifacts.py` |
18
18
  | Past sessions | **session-memory** | Historical; verify against tasks/spec |
@@ -22,7 +22,12 @@ For **external / current / web facts**, **smart-search** (`run_smart_search.py`)
22
22
 
23
23
  ## Semantic routing (Cursor)
24
24
 
25
- The retrieval planner routes semantic intents to **built-in `@codebase` and agent semantic search**. Do **not** use the third-party `fast-context` MCP on Cursor.
25
+ The planner emits **`platform-semantic`** with backend chosen by **`cursorEnv`** (`native` | `byok` from `~/.ccursor/routes.json` or `TRELLIS_CURSOR_BYOK`):
26
+
27
+ - **native:** built-in `@codebase` / agent semantic search — **do not** use fast-context as Primary.
28
+ - **byok:** **fast-context MCP** (`fast_context_search`) — built-in semantic is not in the agent tool list.
29
+
30
+ Definition / reference jumps: **codegraph** (not GO_TO_DEFINITION; Agent LSP unavailable).
26
31
 
27
32
  ## Token economy signals
28
33
 
@@ -36,7 +41,7 @@ Each route in the router output includes a `tokenEconomy` label:
36
41
 
37
42
  When `projectFileCount > 2000`, the router promotes structural (codegraph) routes ahead of rg routes for better token efficiency on large codebases.
38
43
 
39
- **Dogfood default (REC-10):** `route_codebase_retrieval.py` and `get_context.py --mode retrieval-pack` default `--project-file-count` to **`auto`** — they count files under the Trellis repo root (`git ls-files` when `.git` exists, else a bounded walk). Override with an integer (e.g. `5000`) for eval fixtures or non-git trees. **Harness note:** `D:\MyHarness` is not a git repo; dogfood from `Trellis/` or pass `--project-file-count` explicitly when routing from the workspace root.
44
+ **Project file count default:** `route_codebase_retrieval.py` and `get_context.py --mode retrieval-pack` default `--project-file-count` to **`auto`** — they count files under the repo root (`git ls-files` when `.git` exists, else a bounded walk). Override with an integer (e.g. `5000`) for large non-git trees or eval fixtures.
40
45
 
41
46
  ## Commands
42
47
 
@@ -71,7 +76,7 @@ Paste into the **run report header** (markdown):
71
76
 
72
77
  When `smart-search doctor` is not ok or `run_smart_search.py` status is `not_configured` / `failed` (including **search timeout**), use **Cursor WebSearch/WebFetch**, then persist to `{TASK}/research/` with `source: cursor-web-fallback` in frontmatter. See `smart-search-cli` skill §4b.
73
78
 
74
- **CLI discovery (Cursor):** optional env/config override → PATH → `node_modules/.bin` / package script optional harness wrappers (`Trellis/packages/cli/bin/smart-search.js`). No `.trellis/.runtime/` cache.
79
+ **CLI discovery (Cursor):** `TRELLIS_SMART_SEARCH_COMMAND` / `smart_search.command` → PATH `smart-search` project `node_modules/.bin/smart-search` (when installed as a dependency). Agent entrypoint is always `./.trellis/scripts/run_smart_search.py`.
75
80
 
76
81
  ## Router vs execution
77
82
 
@@ -90,8 +95,8 @@ After Grep/codegraph/semantic produce **path candidates**, reorder before choosi
90
95
  | `env-config-literal` | Prefer `scripts/`, `e2e/`, `bench/`, `test/` over generic `src/auth` / `src/paths`. |
91
96
 
92
97
  - **Agent plans**: `render_agent_instructions` / `inject-retrieval-plan.py` append a **结果层排序** block when these intents appear.
93
- - **Eval / offline**: `python ./.trellis/scripts/rank_retrieval_candidates.py --candidates fixtures.json --intents caller-chain --top-k 5 --pretty`
94
- - **Library**: TS `packages/cli/src/utils/retrieval-result-ranking.ts` (Vitest fixtures B03/B05/D03); Python mirror `common/retrieval_result_ranking.py`.
98
+ - **Offline reorder**: `python ./.trellis/scripts/rank_retrieval_candidates.py --candidates fixtures.json --intents caller-chain --top-k 5 --pretty`
99
+ - **Library**: `common/retrieval_result_ranking.py` (Python mirror used by router and rank script).
95
100
 
96
101
  Do **not** claim aggregate openclaw score gains from ranking alone without fresh telemetry (`candidate_pool_recall` vs final Top-K).
97
102
 
@@ -99,9 +104,9 @@ Do **not** claim aggregate openclaw score gains from ranking alone without fresh
99
104
 
100
105
  For structural intents (caller-chain, trap-package-disambiguation, extension-shared-symbol), the router now suggests **codegraph before rg**. This reflects codegraph's superior token economy for structural queries (~80-150 tokens/answer vs rg's ~3557 for naive grep). The agent should still use rg to fill gaps codegraph misses (dynamic dispatch, string-based callsites).
101
106
 
102
- ### Semantic routing on Cursor
107
+ ### Semantic routing on Cursor (plans)
103
108
 
104
- On Cursor, the router outputs `platform-semantic` routes (with `platformNative: true`). The agent should use `@codebase` or Cursor's built-in agent search `fast_context_search` calls are tracked as **misuse** in eval telemetry.
109
+ Envelopes include **`cursorEnv`**. `platform-semantic` uses **`platformNative: true`** on native and **`semanticBackend: fast-context-mcp`** on BYOK. Native: `@codebase` / built-in search; BYOK: `fast_context_search`.
105
110
 
106
111
  ### Semantic dual metrics (openclaw / eval)
107
112
 
@@ -110,26 +115,20 @@ On Cursor, the router outputs `platform-semantic` routes (with `platformNative:
110
115
  | `semantic_plan_rate` | Share of queries whose routing envelope lists a semantic route |
111
116
  | `semantic_exec_rate` | Share of queries with ≥1 semantic search tool call |
112
117
 
113
- On **Cursor**, `semantic_exec_rate` uses **platform-native** tool names only (`classify_tool_calls(..., platform=cursor)`); `fast_context_search` is tracked as **misuse**, not semantic exec. See `cursor-semantic-compliance.md`.
118
+ On **Cursor**, `semantic_exec_rate` uses `classify_tool_calls(..., platform=cursor, cursor_env=...)`: **native** counts built-in semantic only; **byok** counts `fast_context_search` as semantic exec. `cursor_fast_context_misuse` applies only when **native** (or non-byok) uses fast-context while the plan has `platform-semantic`. See `cursor-semantic-compliance.md`.
114
119
 
115
120
  Plan-level presence does not imply execution-level use (see parent research `06-19` OQ-1 双轨).
116
121
 
117
- ### Execution telemetry (schema v2, eval / openclaw)
122
+ ### Execution telemetry (schema v2)
118
123
 
119
- Store **one JSON object per query** in JSONL (`schema_version: 2`). Split scores:
124
+ When recording eval or audit runs, store **one JSON object per query** in JSONL (`schema_version: 2`). Split scores:
120
125
 
121
126
  | Field | Owner | Meaning |
122
127
  | --- | --- | --- |
123
128
  | `answer_score` | Human rubric | Top-1 / Recall@5 / answer quality (0–6 per query in main-50) |
124
129
  | `compliance_score` | Derived | Plan vs exec layer compliance (0–1); structural/codegraph, semantic, read verify |
125
130
 
126
- Report **summary rates must not be hand-copied** from batch router envelopes. Aggregate from JSONL:
127
-
128
- ```powershell
129
- python .trellis/scripts/aggregate_retrieval_telemetry.py runs/<run>/telemetry.jsonl --markdown
130
- ```
131
-
132
- Key exec fields (fill from session tool log): `tools_called`, `grep_count`, `read_count`, `codegraph_executed`, `semantic_executed`, `router_cli_invoked`, `plan_block_in_prompt`, `read_verification_done`. TypeScript contract: `packages/cli/src/utils/retrieval-execution-telemetry.ts` (`RETRIEVAL_TELEMETRY_FIELD_OWNERSHIP`).
131
+ Key exec fields (fill from session tool log): `tools_called`, `grep_count`, `read_count`, `codegraph_executed`, `semantic_executed`, `router_cli_invoked`, `plan_block_in_prompt`, `read_verification_done`. Classify tool names with `common/retrieval_tool_classification.py` (see `cursor-semantic-compliance.md`).
133
132
 
134
133
  ## retrieval-pack
135
134
 
@@ -1,9 +1,14 @@
1
1
  #!/usr/bin/env python3
2
- """Cursor beforeSubmitPrompt: inject router-derived ## 代码库检索计划 per user turn.
2
+ """Cursor beforeSubmitPrompt: telemetry-only for retrieval plan routing.
3
3
 
4
- Runs route_codebase_retrieval + render_agent_instructions for the submitted
5
- prompt. Complements retrieval-routing.mdc (Rules) with an explicit plan block
6
- so REC-03 telemetry can set plan_block_in_prompt=true.
4
+ DEGRADED MODE (2026-06-24): beforeSubmitPrompt hook's additional_context does
5
+ not reach the model in current Cursor versions (L1: event often not fired;
6
+ L2: additional_context not delivered). This hook now runs in telemetry-only
7
+ mode: logs routing decisions to .trellis/.runtime/retrieval-plan-events.log
8
+ for post-session analysis but does NOT inject plan blocks.
9
+
10
+ See .trellis/tasks/06-24-handle-beforesubmitprompt-unreliability/prd.md for
11
+ probe results and mitigation strategy.
7
12
 
8
13
  Silent exit 0 (no stdout) when:
9
14
  - TRELLIS_HOOKS=0 / not a Trellis repo
@@ -15,6 +20,7 @@ from __future__ import annotations
15
20
  import json
16
21
  import os
17
22
  import sys
23
+ from datetime import datetime, timezone
18
24
  from pathlib import Path
19
25
  from typing import Any
20
26
 
@@ -45,6 +51,7 @@ if sys.platform.startswith("win"):
45
51
  DIR_WORKFLOW = ".trellis"
46
52
  PLAN_MARKER_ZH = "## 代码库检索计划"
47
53
  PLAN_MARKER_EN = "## Codebase retrieval plan"
54
+ TELEMETRY_LOG = ".runtime/retrieval-plan-events.log"
48
55
 
49
56
 
50
57
  def _find_trellis_root(start: Path) -> Path | None:
@@ -80,15 +87,31 @@ def _load_capabilities(root: Path) -> dict[str, object] | None:
80
87
  return None
81
88
 
82
89
 
83
- def _emit_plan_block(plan_text: str) -> None:
84
- payload = {
85
- "additional_context": plan_text,
86
- "hookSpecificOutput": {
87
- "hookEventName": "beforeSubmitPrompt",
88
- "additionalContext": plan_text,
89
- },
90
+ def _write_telemetry_log(
91
+ root: Path,
92
+ query_preview: str,
93
+ cursor_env: str,
94
+ intents: list[str],
95
+ ) -> None:
96
+ """Write telemetry event to side-channel log (no injection to model)."""
97
+ log_path = root / DIR_WORKFLOW / TELEMETRY_LOG
98
+ log_path.parent.mkdir(parents=True, exist_ok=True)
99
+
100
+ event = {
101
+ "ts": datetime.now(timezone.utc).isoformat(),
102
+ "event": "beforeSubmitPrompt",
103
+ "query_preview": query_preview[:120],
104
+ "cursorEnv": cursor_env,
105
+ "intents": intents,
106
+ "action": "telemetry-only",
107
+ "note": "additional_context channel unreliable, no injection",
90
108
  }
91
- print(json.dumps(payload, ensure_ascii=False), flush=True)
109
+
110
+ try:
111
+ with log_path.open("a", encoding="utf-8") as handle:
112
+ handle.write(json.dumps(event, ensure_ascii=False) + "\n")
113
+ except Exception:
114
+ pass
92
115
 
93
116
 
94
117
  def main() -> int:
@@ -122,9 +145,6 @@ def main() -> int:
122
145
  from common.project_file_stats import ( # type: ignore[import-not-found]
123
146
  resolve_project_file_count_arg,
124
147
  )
125
- from common.retrieval_agent_instructions import ( # type: ignore[import-not-found]
126
- render_agent_instructions,
127
- )
128
148
  from common.retrieval_plan_gate import ( # type: ignore[import-not-found]
129
149
  extract_user_prompt,
130
150
  should_inject_retrieval_plan,
@@ -148,14 +168,13 @@ def main() -> int:
148
168
  codebase_retrieval_selected=selected,
149
169
  project_file_count=project_file_count,
150
170
  )
151
- instructions = render_agent_instructions(
152
- plan,
153
- locale="zh",
154
- )
155
- if PLAN_MARKER_ZH not in instructions and PLAN_MARKER_EN not in instructions:
156
- return 0
157
-
158
- _emit_plan_block(instructions)
171
+
172
+ # TELEMETRY-ONLY: log routing decision but do not inject
173
+ cursor_env = plan.get("cursorEnv", "unknown")
174
+ intent_ids = [i.get("id", "unknown") for i in plan.get("intents", [])]
175
+ _write_telemetry_log(root, query, cursor_env, intent_ids)
176
+
177
+ # Exit 0 with no stdout (no injection to model context)
159
178
  return 0
160
179
 
161
180
 
@@ -166,8 +166,12 @@ def main() -> None:
166
166
  sys.exit(0)
167
167
 
168
168
  try:
169
- input_data = json.load(sys.stdin)
170
- except json.JSONDecodeError:
169
+ input_text = sys.stdin.read()
170
+ # Remove UTF-8 BOM if present
171
+ if input_text.startswith('\ufeff'):
172
+ input_text = input_text[1:]
173
+ input_data = json.loads(input_text)
174
+ except (json.JSONDecodeError, ValueError):
171
175
  sys.exit(0)
172
176
 
173
177
  subagent_type, original_prompt, tool_input = _parse_hook_input(input_data)
@@ -18,6 +18,9 @@ import sys
18
18
  from io import StringIO
19
19
  from pathlib import Path
20
20
 
21
+ # Cross-platform Python command resolver: Windows standard install has 'python', not 'python3'
22
+ _PYTHON_CMD = "python" if sys.platform == "win32" else "python3"
23
+
21
24
 
22
25
  def _normalize_windows_shell_path(path_str: str) -> str:
23
26
  """Normalize Unix-style shell paths to real Windows paths.
@@ -338,7 +341,7 @@ def _get_task_status(trellis_dir: Path, input_data: dict) -> str:
338
341
  return (
339
342
  f"Trellis framework: active\nSelected task: {task_ref}\n"
340
343
  "Status: STALE SELECTION\n"
341
- f"Next-Action: Run `python3 ./.trellis/scripts/task.py exit` to clear the stale selection, "
344
+ f"Next-Action: Run `{_PYTHON_CMD} ./.trellis/scripts/task.py exit` to clear the stale selection, "
342
345
  "then ask the user what to work on next."
343
346
  )
344
347
 
@@ -638,7 +641,7 @@ def _build_compact_current_state(
638
641
  try:
639
642
  task_count = sum(1 for _ in iter_active_tasks(get_tasks_dir(repo_root)))
640
643
  lines.append(
641
- f"Active tasks: {task_count} total. Use the Task Dashboard for routing; use `python3 ./.trellis/scripts/task.py list --mine` only for raw inspection."
644
+ f"Active tasks: {task_count} total. Use the Task Dashboard for routing; use `{_PYTHON_CMD} ./.trellis/scripts/task.py list --mine` only for raw inspection."
642
645
  )
643
646
  except Exception:
644
647
  pass
@@ -669,7 +672,7 @@ def _build_task_dashboard(trellis_dir: Path, input_data: dict) -> str:
669
672
  _detect_platform(input_data),
670
673
  )
671
674
  except Exception:
672
- return "Task Dashboard unavailable. Run: python3 ./.trellis/scripts/task.py dashboard"
675
+ return f"Task Dashboard unavailable. Run: {_PYTHON_CMD} ./.trellis/scripts/task.py dashboard"
673
676
 
674
677
 
675
678
  def _extract_range(content: str, start_header: str, end_header: str) -> str:
@@ -736,7 +739,7 @@ def _build_workflow_overview(workflow_path: Path) -> str:
736
739
 
737
740
  out_lines = [
738
741
  "# Development Workflow - Session Summary",
739
- "Full guide: .trellis/workflow.md. Step detail: `python3 ./.trellis/scripts/get_context.py --mode phase --step <X.Y>`.",
742
+ f"Full guide: .trellis/workflow.md. Step detail: `{_PYTHON_CMD} ./.trellis/scripts/get_context.py --mode phase --step <X.Y>`.",
740
743
  "",
741
744
  ]
742
745
 
@@ -833,14 +836,19 @@ Trellis compact SessionStart context. Use it to orient the session; load details
833
836
 
834
837
  output.write(
835
838
  "Discover more via: "
836
- "`python3 ./.trellis/scripts/get_context.py --mode packages`\n"
839
+ f"`{_PYTHON_CMD} ./.trellis/scripts/get_context.py --mode packages`\n"
837
840
  )
838
841
  if _detect_platform(hook_input) == "cursor":
839
842
  output.write(
840
- "\n**External web research (Cursor):** `smart-search-cli` + Bash first "
841
- "(resolves PATH, optional `smart_search.command`, or "
842
- "`Trellis/packages/cli/bin/smart-search.js`). "
843
- "If `run_smart_search.py` returns `not_configured` or `failed` (incl. timeout), "
843
+ "\n**External web research (Cursor):** run "
844
+ f"`{_PYTHON_CMD} ./.trellis/scripts/run_smart_search.py \"<question>\" "
845
+ "--intent deep-research --json` first (Trellis evidence wrapper → "
846
+ "`smart-search` CLI). CLI discovery: `TRELLIS_SMART_SEARCH_COMMAND` / "
847
+ "`smart_search.command`, then PATH `smart-search`, then project "
848
+ "`node_modules/.bin/smart-search`, then optional repo-local layouts "
849
+ "(see `.trellis/spec/guides/retrieval-daily-guide.md`). "
850
+ "`smart-search-cli` is an internal workflow skill name — not a file under `.cursor/skills/` on Cursor. "
851
+ "If `run_smart_search.py` status is `not_configured` or `failed` (incl. timeout), "
844
852
  "use **WebSearch/WebFetch**, persist `{TASK}/research/*.md` with "
845
853
  "`source: cursor-web-fallback`.\n"
846
854
  )
@@ -44,21 +44,19 @@ export declare const commonSmartSearchEvidence: string;
44
44
  export declare const commonSmartSearchResolve: string;
45
45
  export declare const commonRetrievalEvidence: string;
46
46
  export declare const commonCodebaseRetrievalRouter: string;
47
+ export declare const commonCursorRetrievalEnv: string;
47
48
  export declare const commonProjectFileStats: string;
48
49
  export declare const commonRetrievalToolClassification: string;
49
- export declare const aggregateRetrievalTelemetryScript: string;
50
50
  export declare const commonRetrievalAgentInstructions: string;
51
51
  export declare const commonRetrievalPlanGate: string;
52
52
  export declare const commonSemanticPlanGate: string;
53
53
  export declare const commonRetrievalResultRanking: string;
54
54
  export declare const rankRetrievalCandidatesScript: string;
55
- export declare const batchPlanEnvelopeScript: string;
56
55
  export declare const scoreEvidenceScript: string;
57
56
  export declare const commonRetrievalAdapterMetadata: string;
58
57
  export declare const commonContextPack: string;
59
58
  export declare const commonRetrievalPack: string;
60
59
  export declare const commonRetrievalPackContext: string;
61
- export declare const commonTestRetrievalArbitration: string;
62
60
  export declare const commonSessionContext: string;
63
61
  export declare const commonPackagesContext: string;
64
62
  export declare const commonWorkflowPhase: string;
@@ -86,7 +84,13 @@ export declare const gitignoreTemplate: string;
86
84
  */
87
85
  export declare function getAllTaskTemplates(): Map<string, string>;
88
86
  /**
89
- * Get all script templates as a map of relative path to content
87
+ * Python scripts kept in the template tree for Trellis maintainers only.
88
+ * Present under `templates/trellis/scripts/` but not shipped via init/update.
89
+ */
90
+ export declare const MAINTAINER_ONLY_SCRIPT_PATHS: Set<string>;
91
+ /**
92
+ * Get all user-shipped script templates as a map of relative path to content.
93
+ * Init and update both use this as the single source of truth (no full-dir copy).
90
94
  */
91
95
  export declare function getAllScripts(): Map<string, string>;
92
96
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAcH,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,oBAAoB,QAEhC,CAAC;AAC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;;GAGG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA2EnD"}
@@ -54,21 +54,19 @@ export const commonSmartSearchEvidence = readTemplate("scripts/common/smart_sear
54
54
  export const commonSmartSearchResolve = readTemplate("scripts/common/smart_search_resolve.py");
55
55
  export const commonRetrievalEvidence = readTemplate("scripts/common/retrieval_evidence.py");
56
56
  export const commonCodebaseRetrievalRouter = readTemplate("scripts/common/codebase_retrieval_router.py");
57
+ export const commonCursorRetrievalEnv = readTemplate("scripts/common/cursor_retrieval_env.py");
57
58
  export const commonProjectFileStats = readTemplate("scripts/common/project_file_stats.py");
58
59
  export const commonRetrievalToolClassification = readTemplate("scripts/common/retrieval_tool_classification.py");
59
- export const aggregateRetrievalTelemetryScript = readTemplate("scripts/aggregate_retrieval_telemetry.py");
60
60
  export const commonRetrievalAgentInstructions = readTemplate("scripts/common/retrieval_agent_instructions.py");
61
61
  export const commonRetrievalPlanGate = readTemplate("scripts/common/retrieval_plan_gate.py");
62
62
  export const commonSemanticPlanGate = readTemplate("scripts/common/semantic_plan_gate.py");
63
63
  export const commonRetrievalResultRanking = readTemplate("scripts/common/retrieval_result_ranking.py");
64
64
  export const rankRetrievalCandidatesScript = readTemplate("scripts/rank_retrieval_candidates.py");
65
- export const batchPlanEnvelopeScript = readTemplate("scripts/batch_plan_envelope.py");
66
65
  export const scoreEvidenceScript = readTemplate("scripts/score_evidence.py");
67
66
  export const commonRetrievalAdapterMetadata = readTemplate("scripts/common/retrieval_adapter_metadata.py");
68
67
  export const commonContextPack = readTemplate("scripts/common/context_pack.py");
69
68
  export const commonRetrievalPack = readTemplate("scripts/common/retrieval_pack.py");
70
69
  export const commonRetrievalPackContext = readTemplate("scripts/common/retrieval_pack_context.py");
71
- export const commonTestRetrievalArbitration = readTemplate("scripts/common/test_retrieval_arbitration.py");
72
70
  export const commonSessionContext = readTemplate("scripts/common/session_context.py");
73
71
  export const commonPackagesContext = readTemplate("scripts/common/packages_context.py");
74
72
  export const commonWorkflowPhase = readTemplate("scripts/common/workflow_phase.py");
@@ -122,7 +120,17 @@ export function getAllTaskTemplates() {
122
120
  return templates;
123
121
  }
124
122
  /**
125
- * Get all script templates as a map of relative path to content
123
+ * Python scripts kept in the template tree for Trellis maintainers only.
124
+ * Present under `templates/trellis/scripts/` but not shipped via init/update.
125
+ */
126
+ export const MAINTAINER_ONLY_SCRIPT_PATHS = new Set([
127
+ "cursor_retrieval_probe.py",
128
+ "common/test_retrieval_arbitration.py",
129
+ "hooks/linear_sync.py",
130
+ ]);
131
+ /**
132
+ * Get all user-shipped script templates as a map of relative path to content.
133
+ * Init and update both use this as the single source of truth (no full-dir copy).
126
134
  */
127
135
  export function getAllScripts() {
128
136
  const scripts = new Map();
@@ -157,6 +165,7 @@ export function getAllScripts() {
157
165
  scripts.set("common/smart_search_resolve.py", commonSmartSearchResolve);
158
166
  scripts.set("common/retrieval_evidence.py", commonRetrievalEvidence);
159
167
  scripts.set("common/codebase_retrieval_router.py", commonCodebaseRetrievalRouter);
168
+ scripts.set("common/cursor_retrieval_env.py", commonCursorRetrievalEnv);
160
169
  scripts.set("common/project_file_stats.py", commonProjectFileStats);
161
170
  scripts.set("common/retrieval_tool_classification.py", commonRetrievalToolClassification);
162
171
  scripts.set("common/retrieval_agent_instructions.py", commonRetrievalAgentInstructions);
@@ -167,7 +176,6 @@ export function getAllScripts() {
167
176
  scripts.set("common/context_pack.py", commonContextPack);
168
177
  scripts.set("common/retrieval_pack.py", commonRetrievalPack);
169
178
  scripts.set("common/retrieval_pack_context.py", commonRetrievalPackContext);
170
- scripts.set("common/test_retrieval_arbitration.py", commonTestRetrievalArbitration);
171
179
  scripts.set("common/session_context.py", commonSessionContext);
172
180
  scripts.set("common/packages_context.py", commonPackagesContext);
173
181
  scripts.set("common/workflow_phase.py", commonWorkflowPhase);
@@ -186,9 +194,7 @@ export function getAllScripts() {
186
194
  scripts.set("build_retrieval_pack.py", buildRetrievalPackScript);
187
195
  scripts.set("route_codebase_retrieval.py", routeCodebaseRetrievalScript);
188
196
  scripts.set("codegraph_session_smoke.py", codegraphSessionSmokeScript);
189
- scripts.set("aggregate_retrieval_telemetry.py", aggregateRetrievalTelemetryScript);
190
197
  scripts.set("rank_retrieval_candidates.py", rankRetrievalCandidatesScript);
191
- scripts.set("batch_plan_envelope.py", batchPlanEnvelopeScript);
192
198
  scripts.set("score_evidence.py", scoreEvidenceScript);
193
199
  return scripts;
194
200
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,gCAAgC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,qBAAqB,CAAC,CAAC;AAE/D,0BAA0B;AAC1B,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC,4BAA4B,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,yBAAyB,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC,+BAA+B,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,eAAe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