@blxzer/cursor-trellis 0.1.0 → 0.1.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.
- package/README.md +124 -5
- package/README.zh-CN.md +170 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +0 -13
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -14
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +3 -32
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +7 -84
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/index.d.ts +7 -8
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +11 -236
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +5 -1
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +3 -3
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +4 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +8 -15
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +7 -7
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +18 -21
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +10 -7
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +4 -4
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +20 -31
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +20 -31
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +24 -40
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +28 -59
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +12 -28
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +2 -2
- package/dist/templates/cursor/hooks.json +6 -0
- package/dist/templates/cursor/rules/retrieval-routing.mdc +57 -0
- package/dist/templates/extract.d.ts +0 -14
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +0 -34
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/markdown/agents.md +2 -6
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +1 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +41 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +14 -14
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +8 -20
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +15 -14
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +2 -1
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +49 -0
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +2 -2
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +68 -20
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +1 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-retrieval-plan.py +163 -0
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +2 -11
- package/dist/templates/trellis/index.d.ts +11 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +22 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +342 -0
- package/dist/templates/trellis/scripts/batch_plan_envelope.py +105 -0
- package/dist/templates/trellis/scripts/codegraph_session_smoke.py +76 -0
- package/dist/templates/trellis/scripts/common/active_task.py +116 -147
- package/dist/templates/trellis/scripts/common/cli_adapter.py +34 -710
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +49 -106
- package/dist/templates/trellis/scripts/common/git_context.py +17 -2
- package/dist/templates/trellis/scripts/common/project_file_stats.py +91 -0
- package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +9 -11
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +313 -0
- package/dist/templates/trellis/scripts/common/retrieval_pack.py +0 -6
- package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +0 -4
- package/dist/templates/trellis/scripts/common/retrieval_plan_gate.py +76 -0
- package/dist/templates/trellis/scripts/common/retrieval_result_ranking.py +253 -0
- package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +157 -0
- package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +52 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -24
- package/dist/templates/trellis/scripts/rank_retrieval_candidates.py +80 -0
- package/dist/templates/trellis/scripts/route_codebase_retrieval.py +38 -11
- package/dist/templates/trellis/scripts/score_evidence.py +112 -0
- package/dist/templates/trellis/workflow.md +861 -960
- package/dist/types/ai-tools.d.ts +13 -16
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +5 -238
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/codebase-retrieval-router.d.ts +1 -8
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
- package/dist/utils/codebase-retrieval-router.js +39 -180
- package/dist/utils/codebase-retrieval-router.js.map +1 -1
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +10 -24
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.d.ts +14 -0
- package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -0
- package/dist/utils/retrieval-agent-instructions.js +221 -0
- package/dist/utils/retrieval-agent-instructions.js.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts +43 -85
- package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -1
- package/dist/utils/retrieval-execution-telemetry.js +289 -22
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -1
- package/dist/utils/retrieval-result-ranking.js +1 -1
- package/dist/utils/retrieval-result-ranking.js.map +1 -1
- package/dist/utils/retrieval-tool-classification.d.ts +32 -0
- package/dist/utils/retrieval-tool-classification.d.ts.map +1 -0
- package/dist/utils/retrieval-tool-classification.js +113 -0
- package/dist/utils/retrieval-tool-classification.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +0 -36
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +0 -184
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +4 -2
- package/dist/commands/mem.d.ts +0 -30
- package/dist/commands/mem.d.ts.map +0 -1
- package/dist/commands/mem.js +0 -424
- package/dist/commands/mem.js.map +0 -1
- package/dist/configurators/antigravity.d.ts +0 -7
- package/dist/configurators/antigravity.d.ts.map +0 -1
- package/dist/configurators/antigravity.js +0 -19
- package/dist/configurators/antigravity.js.map +0 -1
- package/dist/configurators/claude.d.ts +0 -9
- package/dist/configurators/claude.d.ts.map +0 -1
- package/dist/configurators/claude.js +0 -72
- package/dist/configurators/claude.js.map +0 -1
- package/dist/configurators/codebuddy.d.ts +0 -10
- package/dist/configurators/codebuddy.d.ts.map +0 -1
- package/dist/configurators/codebuddy.js +0 -30
- package/dist/configurators/codebuddy.js.map +0 -1
- package/dist/configurators/codex.d.ts +0 -8
- package/dist/configurators/codex.d.ts.map +0 -1
- package/dist/configurators/codex.js +0 -87
- package/dist/configurators/codex.js.map +0 -1
- package/dist/configurators/copilot.d.ts +0 -10
- package/dist/configurators/copilot.d.ts.map +0 -1
- package/dist/configurators/copilot.js +0 -51
- package/dist/configurators/copilot.js.map +0 -1
- package/dist/configurators/droid.d.ts +0 -10
- package/dist/configurators/droid.d.ts.map +0 -1
- package/dist/configurators/droid.js +0 -30
- package/dist/configurators/droid.js.map +0 -1
- package/dist/configurators/gemini.d.ts +0 -16
- package/dist/configurators/gemini.d.ts.map +0 -1
- package/dist/configurators/gemini.js +0 -38
- package/dist/configurators/gemini.js.map +0 -1
- package/dist/configurators/kilo.d.ts +0 -7
- package/dist/configurators/kilo.d.ts.map +0 -1
- package/dist/configurators/kilo.js +0 -19
- package/dist/configurators/kilo.js.map +0 -1
- package/dist/configurators/kiro.d.ts +0 -8
- package/dist/configurators/kiro.d.ts.map +0 -1
- package/dist/configurators/kiro.js +0 -24
- package/dist/configurators/kiro.js.map +0 -1
- package/dist/configurators/opencode.d.ts +0 -14
- package/dist/configurators/opencode.d.ts.map +0 -1
- package/dist/configurators/opencode.js +0 -96
- package/dist/configurators/opencode.js.map +0 -1
- package/dist/configurators/pi.d.ts +0 -3
- package/dist/configurators/pi.d.ts.map +0 -1
- package/dist/configurators/pi.js +0 -45
- package/dist/configurators/pi.js.map +0 -1
- package/dist/configurators/qoder.d.ts +0 -11
- package/dist/configurators/qoder.d.ts.map +0 -1
- package/dist/configurators/qoder.js +0 -31
- package/dist/configurators/qoder.js.map +0 -1
- package/dist/configurators/windsurf.d.ts +0 -7
- package/dist/configurators/windsurf.d.ts.map +0 -1
- package/dist/configurators/windsurf.js +0 -19
- package/dist/configurators/windsurf.js.map +0 -1
- package/dist/templates/claude/agents/trellis-check.md +0 -124
- package/dist/templates/claude/agents/trellis-implement.md +0 -110
- package/dist/templates/claude/agents/trellis-research.md +0 -137
- package/dist/templates/claude/index.d.ts +0 -22
- package/dist/templates/claude/index.d.ts.map +0 -1
- package/dist/templates/claude/index.js +0 -46
- package/dist/templates/claude/index.js.map +0 -1
- package/dist/templates/claude/settings.json +0 -84
- package/dist/templates/codebuddy/agents/trellis-check.md +0 -115
- package/dist/templates/codebuddy/agents/trellis-implement.md +0 -110
- package/dist/templates/codebuddy/agents/trellis-research.md +0 -137
- package/dist/templates/codebuddy/index.d.ts +0 -15
- package/dist/templates/codebuddy/index.d.ts.map +0 -1
- package/dist/templates/codebuddy/index.js +0 -15
- package/dist/templates/codebuddy/index.js.map +0 -1
- package/dist/templates/codebuddy/settings.json +0 -70
- package/dist/templates/codex/agents/trellis-check.toml +0 -67
- package/dist/templates/codex/agents/trellis-implement.toml +0 -40
- package/dist/templates/codex/agents/trellis-research.toml +0 -73
- package/dist/templates/codex/config.toml +0 -28
- package/dist/templates/codex/hooks/session-start.py +0 -575
- package/dist/templates/codex/hooks.json +0 -15
- package/dist/templates/codex/index.d.ts +0 -39
- package/dist/templates/codex/index.d.ts.map +0 -1
- package/dist/templates/codex/index.js +0 -85
- package/dist/templates/codex/index.js.map +0 -1
- package/dist/templates/codex/skills/before-dev/SKILL.md +0 -40
- package/dist/templates/codex/skills/brainstorm/SKILL.md +0 -112
- package/dist/templates/codex/skills/break-loop/SKILL.md +0 -130
- package/dist/templates/codex/skills/check/SKILL.md +0 -98
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +0 -158
- package/dist/templates/codex/skills/create-command/SKILL.md +0 -101
- package/dist/templates/codex/skills/finish-work/SKILL.md +0 -90
- package/dist/templates/codex/skills/improve-ut/SKILL.md +0 -69
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +0 -221
- package/dist/templates/codex/skills/onboard/SKILL.md +0 -363
- package/dist/templates/codex/skills/record-session/SKILL.md +0 -67
- package/dist/templates/codex/skills/start/SKILL.md +0 -66
- package/dist/templates/codex/skills/update-spec/SKILL.md +0 -335
- package/dist/templates/copilot/hooks/session-start.py +0 -557
- package/dist/templates/copilot/hooks.json +0 -19
- package/dist/templates/copilot/index.d.ts +0 -23
- package/dist/templates/copilot/index.d.ts.map +0 -1
- package/dist/templates/copilot/index.js +0 -54
- package/dist/templates/copilot/index.js.map +0 -1
- package/dist/templates/copilot/prompts/before-dev.prompt.md +0 -39
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +0 -111
- package/dist/templates/copilot/prompts/break-loop.prompt.md +0 -129
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +0 -157
- package/dist/templates/copilot/prompts/check.prompt.md +0 -97
- package/dist/templates/copilot/prompts/create-command.prompt.md +0 -116
- package/dist/templates/copilot/prompts/finish-work.prompt.md +0 -99
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +0 -223
- package/dist/templates/copilot/prompts/onboard.prompt.md +0 -362
- package/dist/templates/copilot/prompts/parallel.prompt.md +0 -204
- package/dist/templates/copilot/prompts/record-session.prompt.md +0 -66
- package/dist/templates/copilot/prompts/start.prompt.md +0 -63
- package/dist/templates/copilot/prompts/update-spec.prompt.md +0 -358
- package/dist/templates/droid/droids/trellis-check.md +0 -107
- package/dist/templates/droid/droids/trellis-implement.md +0 -102
- package/dist/templates/droid/droids/trellis-research.md +0 -137
- package/dist/templates/droid/index.d.ts +0 -15
- package/dist/templates/droid/index.d.ts.map +0 -1
- package/dist/templates/droid/index.js +0 -15
- package/dist/templates/droid/index.js.map +0 -1
- package/dist/templates/droid/settings.json +0 -70
- package/dist/templates/gemini/agents/trellis-check.md +0 -107
- package/dist/templates/gemini/agents/trellis-implement.md +0 -102
- package/dist/templates/gemini/agents/trellis-research.md +0 -136
- package/dist/templates/gemini/index.d.ts +0 -13
- package/dist/templates/gemini/index.d.ts.map +0 -1
- package/dist/templates/gemini/index.js +0 -13
- package/dist/templates/gemini/index.js.map +0 -1
- package/dist/templates/gemini/settings.json +0 -28
- package/dist/templates/kiro/agents/trellis-check.json +0 -26
- package/dist/templates/kiro/agents/trellis-implement.json +0 -26
- package/dist/templates/kiro/agents/trellis-research.json +0 -30
- package/dist/templates/kiro/index.d.ts +0 -18
- package/dist/templates/kiro/index.d.ts.map +0 -1
- package/dist/templates/kiro/index.js +0 -18
- package/dist/templates/kiro/index.js.map +0 -1
- package/dist/templates/opencode/agents/trellis-check.md +0 -122
- package/dist/templates/opencode/agents/trellis-implement.md +0 -118
- package/dist/templates/opencode/agents/trellis-research.md +0 -145
- package/dist/templates/opencode/lib/session-utils.js +0 -667
- package/dist/templates/opencode/lib/trellis-context.js +0 -336
- package/dist/templates/opencode/package.json +0 -5
- package/dist/templates/opencode/plugins/inject-subagent-context.js +0 -495
- package/dist/templates/opencode/plugins/inject-workflow-state.js +0 -159
- package/dist/templates/opencode/plugins/session-start.js +0 -101
- package/dist/templates/pi/agents/trellis-check.md +0 -37
- package/dist/templates/pi/agents/trellis-implement.md +0 -42
- package/dist/templates/pi/agents/trellis-research.md +0 -25
- package/dist/templates/pi/extensions/trellis/index.ts.txt +0 -1600
- package/dist/templates/pi/index.d.ts +0 -5
- package/dist/templates/pi/index.d.ts.map +0 -1
- package/dist/templates/pi/index.js +0 -12
- package/dist/templates/pi/index.js.map +0 -1
- package/dist/templates/pi/settings.json +0 -12
- package/dist/templates/qoder/agents/trellis-check.md +0 -108
- package/dist/templates/qoder/agents/trellis-implement.md +0 -103
- package/dist/templates/qoder/agents/trellis-research.md +0 -137
- package/dist/templates/qoder/index.d.ts +0 -15
- package/dist/templates/qoder/index.d.ts.map +0 -1
- package/dist/templates/qoder/index.js +0 -15
- package/dist/templates/qoder/index.js.map +0 -1
- package/dist/templates/qoder/settings.json +0 -47
|
@@ -6,23 +6,13 @@
|
|
|
6
6
|
* (router-owned fields only; adapterState/freshness are pass-through stubs).
|
|
7
7
|
*/
|
|
8
8
|
export const CODEBASE_RETRIEVAL_ROUTER_VERSION = 2;
|
|
9
|
-
export const PLATFORM_CURSOR = "cursor";
|
|
10
|
-
export const PLATFORM_CLAUDE_CODE = "claude-code";
|
|
11
|
-
export const PLATFORM_CODEX = "codex";
|
|
12
|
-
export const PLATFORM_GENERIC = "generic";
|
|
13
|
-
export const KNOWN_PLATFORMS = new Set([
|
|
14
|
-
PLATFORM_CURSOR,
|
|
15
|
-
PLATFORM_CLAUDE_CODE,
|
|
16
|
-
PLATFORM_CODEX,
|
|
17
|
-
PLATFORM_GENERIC,
|
|
18
|
-
]);
|
|
19
9
|
export const MODALITY_LEXICAL = "lexical";
|
|
20
10
|
export const MODALITY_STRUCTURAL = "structural";
|
|
21
11
|
export const MODALITY_SEMANTIC = "semantic";
|
|
22
12
|
export const TOKEN_ECONOMY_HIGH = "high";
|
|
23
13
|
export const TOKEN_ECONOMY_MEDIUM = "medium";
|
|
24
14
|
export const TOKEN_ECONOMY_LOW = "low";
|
|
25
|
-
export function emptyCodebaseRetrievalPlan(query = "",
|
|
15
|
+
export function emptyCodebaseRetrievalPlan(query = "", projectFileCount = null) {
|
|
26
16
|
return {
|
|
27
17
|
version: CODEBASE_RETRIEVAL_ROUTER_VERSION,
|
|
28
18
|
query,
|
|
@@ -33,7 +23,6 @@ export function emptyCodebaseRetrievalPlan(query = "", platform = PLATFORM_GENER
|
|
|
33
23
|
fallback: [],
|
|
34
24
|
warnings: [],
|
|
35
25
|
verification: [],
|
|
36
|
-
platform,
|
|
37
26
|
projectFileCount,
|
|
38
27
|
};
|
|
39
28
|
}
|
|
@@ -243,84 +232,7 @@ function extensionVerification() {
|
|
|
243
232
|
...baseVerification(),
|
|
244
233
|
];
|
|
245
234
|
}
|
|
246
|
-
function
|
|
247
|
-
return {
|
|
248
|
-
order: 1,
|
|
249
|
-
id: "exact-rg-primary",
|
|
250
|
-
role: "exact",
|
|
251
|
-
sourceFamily: "rg",
|
|
252
|
-
commands: ["rg <pattern> <path>"],
|
|
253
|
-
rationale: "Exact identifiers, literals, paths, and protocol constants stay primary; corroborate with direct reads.",
|
|
254
|
-
intentIds,
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
function routePolicyDocs(intentIds) {
|
|
258
|
-
return {
|
|
259
|
-
order: 2,
|
|
260
|
-
id: "policy-docs-rg",
|
|
261
|
-
role: "exact",
|
|
262
|
-
sourceFamily: "policy-docs",
|
|
263
|
-
commands: [
|
|
264
|
-
'rg -i "storage default|sidecar|sqlite only" AGENTS.md "**/AGENTS.md" README.md CONTRIBUTING.md .trellis/spec',
|
|
265
|
-
],
|
|
266
|
-
rationale: "Policy/document intent: search instruction and spec docs before implementation modules.",
|
|
267
|
-
intentIds,
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
function routeAst(intentIds, order) {
|
|
271
|
-
return {
|
|
272
|
-
order,
|
|
273
|
-
id: "ast-codegraph",
|
|
274
|
-
role: "ast",
|
|
275
|
-
sourceFamily: "codegraph",
|
|
276
|
-
commands: [
|
|
277
|
-
"codegraph query <symbol-or-search> --path <path> --json",
|
|
278
|
-
"codegraph callers <symbol> --path <path> --json",
|
|
279
|
-
"codegraph callees <symbol> --path <path> --json",
|
|
280
|
-
],
|
|
281
|
-
rationale: "Structural expansion after exact candidates exist; graph output remains candidate until freshness and source checks.",
|
|
282
|
-
intentIds,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
function routeSemantic(intentIds, order) {
|
|
286
|
-
return {
|
|
287
|
-
order,
|
|
288
|
-
id: "semantic-fast-context",
|
|
289
|
-
role: "semantic",
|
|
290
|
-
sourceFamily: "fast-context",
|
|
291
|
-
commands: ["fast_context_search query=<question> project_path=<root>"],
|
|
292
|
-
rationale: "Semantic recall last on policy/env/extension-heavy queries; convert hits to exact rg follow-ups.",
|
|
293
|
-
intentIds,
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
function routeVerification(intentIds, order) {
|
|
297
|
-
return {
|
|
298
|
-
order,
|
|
299
|
-
id: "verification-source-git-tests",
|
|
300
|
-
role: "verification",
|
|
301
|
-
sourceFamily: "source-git-tests",
|
|
302
|
-
commands: ["git diff -- <path>", "Get-Content <file>"],
|
|
303
|
-
rationale: "Required proof layer for verified claims.",
|
|
304
|
-
intentIds,
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
function modalityForIntent(intentIds, structuralIntents) {
|
|
308
|
-
const structural = structuralIntents ??
|
|
309
|
-
new Set([
|
|
310
|
-
"caller-chain",
|
|
311
|
-
"trap-package-disambiguation",
|
|
312
|
-
"extension-shared-symbol",
|
|
313
|
-
]);
|
|
314
|
-
const hasStructural = [...intentIds].some((id) => structural.has(id));
|
|
315
|
-
if (hasStructural) {
|
|
316
|
-
return [MODALITY_STRUCTURAL, MODALITY_LEXICAL, MODALITY_SEMANTIC];
|
|
317
|
-
}
|
|
318
|
-
if (intentIds.has("cross-cutting-discovery") && !intentIds.has("exact-symbol-path")) {
|
|
319
|
-
return [MODALITY_SEMANTIC, MODALITY_LEXICAL, MODALITY_STRUCTURAL];
|
|
320
|
-
}
|
|
321
|
-
return [MODALITY_LEXICAL, MODALITY_STRUCTURAL, MODALITY_SEMANTIC];
|
|
322
|
-
}
|
|
323
|
-
function tokenEconomyForRoute(routeId, platform) {
|
|
235
|
+
function tokenEconomyForRoute(routeId) {
|
|
324
236
|
const highEconomyRoutes = new Set([
|
|
325
237
|
"caller-chain-ast",
|
|
326
238
|
"trap-demote-codegraph",
|
|
@@ -331,10 +243,6 @@ function tokenEconomyForRoute(routeId, platform) {
|
|
|
331
243
|
if (highEconomyRoutes.has(routeId)) {
|
|
332
244
|
return TOKEN_ECONOMY_HIGH;
|
|
333
245
|
}
|
|
334
|
-
const lowEconomyRoutes = new Set(["exact-rg-primary"]);
|
|
335
|
-
if (lowEconomyRoutes.has(routeId) && platform !== PLATFORM_CURSOR) {
|
|
336
|
-
return TOKEN_ECONOMY_LOW;
|
|
337
|
-
}
|
|
338
246
|
return TOKEN_ECONOMY_MEDIUM;
|
|
339
247
|
}
|
|
340
248
|
function largeProject(projectFileCount) {
|
|
@@ -342,7 +250,7 @@ function largeProject(projectFileCount) {
|
|
|
342
250
|
return false;
|
|
343
251
|
return projectFileCount > 2000;
|
|
344
252
|
}
|
|
345
|
-
function orderedRoutesForIntents(intents, includeOptionalAdapters,
|
|
253
|
+
function orderedRoutesForIntents(intents, includeOptionalAdapters, projectFileCount = null) {
|
|
346
254
|
const ids = new Set(intents.map((item) => item.id));
|
|
347
255
|
const preserve = ids.has("protocol-platform-preserve");
|
|
348
256
|
const policy = ids.has("policy-document");
|
|
@@ -353,7 +261,6 @@ function orderedRoutesForIntents(intents, includeOptionalAdapters, platform = PL
|
|
|
353
261
|
const exact = ids.has("exact-symbol-path");
|
|
354
262
|
const conceptual = ids.has("cross-cutting-discovery");
|
|
355
263
|
const activeIntentIds = [...ids];
|
|
356
|
-
const isCursor = platform === PLATFORM_CURSOR;
|
|
357
264
|
const isLarge = largeProject(projectFileCount);
|
|
358
265
|
let semanticPromoted = false;
|
|
359
266
|
const routes = [];
|
|
@@ -362,7 +269,7 @@ function orderedRoutesForIntents(intents, includeOptionalAdapters, platform = PL
|
|
|
362
269
|
...route,
|
|
363
270
|
order: routes.length + 1,
|
|
364
271
|
intentIds: activeIntentIds,
|
|
365
|
-
tokenEconomy: tokenEconomyForRoute(route.id
|
|
272
|
+
tokenEconomy: tokenEconomyForRoute(route.id),
|
|
366
273
|
platformNative: route.platformNative ?? false,
|
|
367
274
|
});
|
|
368
275
|
}
|
|
@@ -433,25 +340,14 @@ function orderedRoutesForIntents(intents, includeOptionalAdapters, platform = PL
|
|
|
433
340
|
const semanticRationale = policy
|
|
434
341
|
? "Policy plus conceptual intent: semantic recall after policy docs, before exact rg follow-up."
|
|
435
342
|
: "Conceptual query without exact signals; semantic recall before exact rg narrowing.";
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
append({
|
|
448
|
-
id: "semantic-fast-context",
|
|
449
|
-
role: "semantic",
|
|
450
|
-
sourceFamily: "fast-context",
|
|
451
|
-
commands: ["fast_context_search query=<question> project_path=<root>"],
|
|
452
|
-
rationale: semanticRationale,
|
|
453
|
-
});
|
|
454
|
-
}
|
|
343
|
+
append({
|
|
344
|
+
id: "platform-semantic",
|
|
345
|
+
role: "semantic",
|
|
346
|
+
sourceFamily: "platform-semantic",
|
|
347
|
+
commands: ["cursor @codebase or built-in semantic search"],
|
|
348
|
+
rationale: semanticRationale + " (Cursor built-in semantic search)",
|
|
349
|
+
platformNative: true,
|
|
350
|
+
});
|
|
455
351
|
semanticPromoted = true;
|
|
456
352
|
append({
|
|
457
353
|
id: "exact-rg-primary",
|
|
@@ -534,46 +430,24 @@ function orderedRoutesForIntents(intents, includeOptionalAdapters, platform = PL
|
|
|
534
430
|
rationale: cgRationale,
|
|
535
431
|
});
|
|
536
432
|
}
|
|
537
|
-
|
|
433
|
+
append({
|
|
434
|
+
id: "lsp-navigation",
|
|
435
|
+
role: "lsp",
|
|
436
|
+
sourceFamily: "language-server",
|
|
437
|
+
commands: ["definition", "references", "hover"],
|
|
438
|
+
rationale: "Optional editor/LSP navigation when exposed; not guaranteed in Agent tool telemetry — prefer Read/Grep/codegraph after candidates exist.",
|
|
439
|
+
platformNative: true,
|
|
440
|
+
});
|
|
441
|
+
if (!semanticPromoted) {
|
|
538
442
|
append({
|
|
539
|
-
id: "
|
|
540
|
-
role: "
|
|
541
|
-
sourceFamily: "
|
|
542
|
-
commands: ["
|
|
543
|
-
rationale: "
|
|
443
|
+
id: "platform-semantic",
|
|
444
|
+
role: "semantic",
|
|
445
|
+
sourceFamily: "platform-semantic",
|
|
446
|
+
commands: ["cursor @codebase or built-in semantic search"],
|
|
447
|
+
rationale: "Semantic recall via Cursor built-in codebase search.",
|
|
544
448
|
platformNative: true,
|
|
545
449
|
});
|
|
546
450
|
}
|
|
547
|
-
else {
|
|
548
|
-
append({
|
|
549
|
-
id: "lsp-navigation",
|
|
550
|
-
role: "lsp",
|
|
551
|
-
sourceFamily: "language-server",
|
|
552
|
-
commands: ["definition", "references", "hover"],
|
|
553
|
-
rationale: "LSP after candidate symbols exist.",
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
if (!semanticPromoted) {
|
|
557
|
-
if (isCursor) {
|
|
558
|
-
append({
|
|
559
|
-
id: "platform-semantic",
|
|
560
|
-
role: "semantic",
|
|
561
|
-
sourceFamily: "platform-semantic",
|
|
562
|
-
commands: ["cursor @codebase or built-in semantic search"],
|
|
563
|
-
rationale: "Semantic recall via platform-native Cursor search.",
|
|
564
|
-
platformNative: true,
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
else {
|
|
568
|
-
append({
|
|
569
|
-
id: "semantic-fast-context",
|
|
570
|
-
role: "semantic",
|
|
571
|
-
sourceFamily: "fast-context",
|
|
572
|
-
commands: ["fast_context_search query=<question> project_path=<root>"],
|
|
573
|
-
rationale: "Semantic recall last; convert to exact rg follow-ups.",
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
451
|
}
|
|
578
452
|
append({
|
|
579
453
|
id: "verification-source-git-tests",
|
|
@@ -640,14 +514,13 @@ function classifyIntents(query) {
|
|
|
640
514
|
return true;
|
|
641
515
|
});
|
|
642
516
|
}
|
|
643
|
-
function buildFallbackHints(intents, includeOptionalAdapters, routes
|
|
517
|
+
function buildFallbackHints(intents, includeOptionalAdapters, routes) {
|
|
644
518
|
const hints = [
|
|
645
519
|
{
|
|
646
520
|
when: "rg missing on PATH",
|
|
647
521
|
action: "Codebase retrieval readiness fails; install or expose rg before claiming readiness.",
|
|
648
522
|
},
|
|
649
523
|
];
|
|
650
|
-
const isCursor = platform === PLATFORM_CURSOR;
|
|
651
524
|
if (!includeOptionalAdapters) {
|
|
652
525
|
hints.push({
|
|
653
526
|
when: "codebase-retrieval not selected",
|
|
@@ -668,24 +541,15 @@ function buildFallbackHints(intents, includeOptionalAdapters, routes, platform =
|
|
|
668
541
|
if (includeOptionalAdapters &&
|
|
669
542
|
semanticRoute &&
|
|
670
543
|
(hasConceptual || semanticRoute.order >= 3 || exactPrimary)) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
else {
|
|
679
|
-
hints.push({
|
|
680
|
-
when: "exact rg returns no corroborated file/range candidates (or only trap hits) before final Top-1",
|
|
681
|
-
action: "Invoke fast_context_search per semantic-fast-context route, then narrow with rg on returned keywords and paths; semantic output remains recall-only until source reads confirm.",
|
|
682
|
-
replacesRole: "semantic",
|
|
683
|
-
});
|
|
684
|
-
}
|
|
544
|
+
hints.push({
|
|
545
|
+
when: "exact rg returns no corroborated file/range candidates (or only trap hits) before final Top-1",
|
|
546
|
+
action: "Use Cursor @codebase or built-in semantic search per platform-semantic route, then narrow with rg on returned keywords and paths.",
|
|
547
|
+
replacesRole: "semantic",
|
|
548
|
+
});
|
|
685
549
|
}
|
|
686
550
|
return hints;
|
|
687
551
|
}
|
|
688
|
-
function buildWarnings(intents
|
|
552
|
+
function buildWarnings(intents) {
|
|
689
553
|
const warnings = [];
|
|
690
554
|
const low = intents.filter((i) => i.confidence === "low");
|
|
691
555
|
if (low.length > 0) {
|
|
@@ -701,7 +565,7 @@ function buildWarnings(intents, platform = PLATFORM_GENERIC) {
|
|
|
701
565
|
if (hasConceptual &&
|
|
702
566
|
!hasExactIntent &&
|
|
703
567
|
!intents.some((i) => i.id === "protocol-platform-preserve")) {
|
|
704
|
-
const semanticHint =
|
|
568
|
+
const semanticHint = "platform-semantic";
|
|
705
569
|
warnings.push(`Conceptual intent without exact signals; ${semanticHint} route promoted in plan. Convert semantic hits to exact rg follow-ups before final claims.`);
|
|
706
570
|
}
|
|
707
571
|
return warnings;
|
|
@@ -727,13 +591,10 @@ function verificationForIntents(intents) {
|
|
|
727
591
|
export function routeCodebaseRetrieval(input) {
|
|
728
592
|
const query = normalizeQuery(input.query);
|
|
729
593
|
const includeOptionalAdapters = input.codebaseRetrievalSelected !== false;
|
|
730
|
-
const platform = input.platform && KNOWN_PLATFORMS.has(input.platform)
|
|
731
|
-
? input.platform
|
|
732
|
-
: PLATFORM_GENERIC;
|
|
733
594
|
const projectFileCount = input.projectFileCount ?? null;
|
|
734
595
|
if (!query) {
|
|
735
596
|
const emptyIntent = buildIntent("exact-symbol-path", "General codebase (exact baseline)", ["empty-query"], "low", true);
|
|
736
|
-
const emptyRoutes = orderedRoutesForIntents([emptyIntent], includeOptionalAdapters,
|
|
597
|
+
const emptyRoutes = orderedRoutesForIntents([emptyIntent], includeOptionalAdapters, projectFileCount);
|
|
737
598
|
return {
|
|
738
599
|
version: CODEBASE_RETRIEVAL_ROUTER_VERSION,
|
|
739
600
|
query,
|
|
@@ -741,15 +602,14 @@ export function routeCodebaseRetrieval(input) {
|
|
|
741
602
|
routes: emptyRoutes,
|
|
742
603
|
adapterState: [],
|
|
743
604
|
freshness: [],
|
|
744
|
-
fallback: buildFallbackHints([emptyIntent], includeOptionalAdapters, emptyRoutes
|
|
605
|
+
fallback: buildFallbackHints([emptyIntent], includeOptionalAdapters, emptyRoutes),
|
|
745
606
|
warnings: ["Empty query; only baseline exact route is emitted."],
|
|
746
607
|
verification: baseVerification(),
|
|
747
|
-
platform,
|
|
748
608
|
projectFileCount,
|
|
749
609
|
};
|
|
750
610
|
}
|
|
751
611
|
const intents = classifyIntents(query);
|
|
752
|
-
const routes = orderedRoutesForIntents(intents, includeOptionalAdapters,
|
|
612
|
+
const routes = orderedRoutesForIntents(intents, includeOptionalAdapters, projectFileCount);
|
|
753
613
|
return {
|
|
754
614
|
version: CODEBASE_RETRIEVAL_ROUTER_VERSION,
|
|
755
615
|
query,
|
|
@@ -757,10 +617,9 @@ export function routeCodebaseRetrieval(input) {
|
|
|
757
617
|
routes,
|
|
758
618
|
adapterState: [],
|
|
759
619
|
freshness: [],
|
|
760
|
-
fallback: buildFallbackHints(intents, includeOptionalAdapters, routes
|
|
761
|
-
warnings: buildWarnings(intents
|
|
620
|
+
fallback: buildFallbackHints(intents, includeOptionalAdapters, routes),
|
|
621
|
+
warnings: buildWarnings(intents),
|
|
762
622
|
verification: verificationForIntents(intents),
|
|
763
|
-
platform,
|
|
764
623
|
projectFileCount,
|
|
765
624
|
};
|
|
766
625
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codebase-retrieval-router.js","sourceRoot":"","sources":["../../src/utils/codebase-retrieval-router.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAU,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,QAAiB,CAAC;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,OAAgB,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IAC1D,eAAe;IACf,oBAAoB;IACpB,cAAc;IACd,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAqB,CAAC;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAe,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAc,CAAC;AA2EhD,MAAM,UAAU,0BAA0B,CACxC,KAAK,GAAG,EAAE,EACV,WAAmB,gBAAgB,EACnC,mBAAkC,IAAI;IAEtC,OAAO;QACL,OAAO,EAAE,iCAAiC;QAC1C,KAAK;QACL,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,QAAQ;QACR,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAsB;IACxC,uBAAuB;IACvB,cAAc;IAC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AAE,uBAAuB,EAAE,MAAM,EAAE,QAAQ,CAAC;QAChF,QAAQ,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC1C,YAAY,EAAE,sBAAsB,CAAC,OAAO,CAAC;QAC7C,QAAQ;QACR,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"codebase-retrieval-router.js","sourceRoot":"","sources":["../../src/utils/codebase-retrieval-router.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAU,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAqB,CAAC;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAe,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAc,CAAC;AAyEhD,MAAM,UAAU,0BAA0B,CACxC,KAAK,GAAG,EAAE,EACV,mBAAkC,IAAI;IAEtC,OAAO;QACL,OAAO,EAAE,iCAAiC;QAC1C,KAAK;QACL,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAsB;IACxC,uBAAuB;IACvB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;IAClB,qBAAqB;IACrB,wBAAwB;IACxB,mBAAmB;IACnB,qBAAqB;IACrB,gBAAgB;IAChB,cAAc;IACd,iCAAiC;IACjC,iBAAiB;IACjB,mCAAmC;IACnC,+BAA+B;IAC/B,yCA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;QAChC,YAAY,EAAE,sBAAsB,CAAC,OAAO,CAAC;QAC7C,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-capabilities.d.ts","sourceRoot":"","sources":["../../src/utils/project-capabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"project-capabilities.d.ts","sourceRoot":"","sources":["../../src/utils/project-capabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,eAAO,MAAM,sBAAsB,iEAIzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,mBAAmB,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EA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,SAAS,mBAAmB,EAAE,EACxC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC1B,OAAO,CAAC,IAAI,CAAC,CAWf;AAMD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAqB1E;AAED,wBAAgB,iCAAiC,CAC/C,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC1B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAKrB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { getConfigTemplate as getCodexConfigTemplate } from "../templates/codex/index.js";
|
|
4
3
|
import { ensureDir, writeFile } from "./file-writer.js";
|
|
5
4
|
export const PROJECT_CAPABILITY_IDS = [
|
|
6
5
|
"codebase-retrieval",
|
|
@@ -23,9 +22,9 @@ export const PROJECT_CAPABILITIES = [
|
|
|
23
22
|
"colbymchenry-codegraph",
|
|
24
23
|
],
|
|
25
24
|
title: "Codebase retrieval",
|
|
26
|
-
description: "Role-based local code retrieval through exact search, AST/structure, LSP
|
|
27
|
-
routing: "Use for codebase questions by retrieval role: extract exact identifiers, path hints, and policy phrases, run rg first, apply intent-gated policy/document-first routing for architecture, boundary, and storage-policy questions, apply other intent-gated branches (caller-chain, trap demotion, extension disambiguation, env/config literals) only when the question matches that class, expand structural candidates with CodeGraph when available and fresh enough, use LSP
|
|
28
|
-
readiness: "Required exact search (`rg`) is available. Optional CodeGraph, LSP, and fast-context adapters are reported as available, unavailable, or unverified without startup side effects.",
|
|
25
|
+
description: "Role-based local code retrieval through exact search, AST/structure, optional editor/LSP navigation, semantic recall, and verification.",
|
|
26
|
+
routing: "Use for codebase questions by retrieval role: extract exact identifiers, path hints, and policy phrases, run rg first, apply intent-gated policy/document-first routing for architecture, boundary, and storage-policy questions, apply other intent-gated branches (caller-chain, trap demotion, extension disambiguation, env/config literals) only when the question matches that class, expand structural candidates with CodeGraph when available and fresh enough, optionally use editor/LSP navigation (GO_TO_DEFINITION / find references) only after candidate symbols/files exist and when the host exposes it — not as a guaranteed Agent default tool, use fast-context for semantic recall last on policy/env-heavy queries, then promote only source/Git/test-backed findings to final claims.",
|
|
27
|
+
readiness: "Required exact search (`rg`) is available. Optional CodeGraph, editor/LSP navigation, and fast-context adapters are reported as available, unavailable, or unverified without startup side effects. On Cursor Agent sessions, LSP is optional and often uncounted in benchmarks; prefer Grep, Read, and codegraph.",
|
|
29
28
|
fallback: [
|
|
30
29
|
"Install or expose `rg` on PATH before claiming codebase retrieval readiness.",
|
|
31
30
|
"Ensure `npx -y fast-context-mcp` and `npx -y @colbymchenry/codegraph serve --mcp` can launch before generated MCP adapter entries are claimed as usable.",
|
|
@@ -52,9 +51,9 @@ export const PROJECT_CAPABILITIES = [
|
|
|
52
51
|
lsp: {
|
|
53
52
|
provider: "language-server",
|
|
54
53
|
required: false,
|
|
55
|
-
purpose: "
|
|
56
|
-
readiness: "
|
|
57
|
-
evidenceStatus: "Navigation candidate until exact file/range evidence is verified by source reads.",
|
|
54
|
+
purpose: "Optional editor/LSP navigation (definitions, references, hover) after candidates exist — not a guaranteed Cursor Agent tool; use Read and Grep when LSP is absent or uninvoked.",
|
|
55
|
+
readiness: "Host-dependent: IDE language services or GO_TO_DEFINITION when exposed. Trellis does not start language servers during init/update; Agent cold runs may show zero LSP tool calls.",
|
|
56
|
+
evidenceStatus: "Navigation candidate until exact file/range evidence is verified by source reads; label uninvoked LSP as unverified.",
|
|
58
57
|
},
|
|
59
58
|
semantic: {
|
|
60
59
|
provider: "fast-context-mcp",
|
|
@@ -324,14 +323,15 @@ function appendPolicyDocumentRetrievalRouting(lines) {
|
|
|
324
323
|
lines.push("## Policy and Document-First Routing (intent-gated)", "", "Apply this branch when the question is about architecture, responsibility, ownership, boundaries, project or package policy, storage or persistence policy, conventions, or where behavior is allowed, forbidden, or defined in instructions—not when the question names an exact symbol, protocol constant, schema path, platform file, or version literal (those stay symbol/path-first for strong A/G/F/J routes).", "", "Trigger signals include: 规定 / 边界 / 为什么不能 / storage policy / persistence / sidecar / import boundaries / transport-only / project instructions / AGENTS conventions.", "", "Evidence order for policy/document queries:", "", "1. Root and nested `AGENTS.md`, then `.trellis/spec/**`, `README.md`, `CONTRIBUTING.md`, architecture or design docs, and package-level policy or contract instruction files.", "2. Exact `rg` on policy phrases and boundary terms scoped to those paths (for example `Storage default: SQLite only`, `sidecar`, `SQLite only`, transport-only, import boundary).", "3. Read matched policy sections with direct source reads before ranking implementation files as Top-1.", "4. Use AST/CodeGraph or semantic recall only to corroborate policy claims or locate related implementation; do not let SQLite/state/cache modules outrank root policy docs when the question asks what is allowed or forbidden.", "5. Verify with source reads before final claims; optional adapters remain optional.", "", "### Storage and persistence policy (benchmark C03 pattern)", "", "When the question asks how storage is chosen, why sidecar files for cache or queue are forbidden, or SQLite vs JSON/JSONL policy: inspect root `AGENTS.md` (and nested `**/AGENTS.md`) before `src/state/*`, Kysely, or other storage implementation modules. Target Top-1 policy evidence such as `Storage default: SQLite only`, `state/openclaw.sqlite`, and `Kysely` cited from instruction docs, not from implementation adjacency alone. OpenClaw audit acceptance target for this query class: `>= 4/6` when agents follow this route.", "");
|
|
325
324
|
}
|
|
326
325
|
function appendCodebaseRetrievalIntentBranches(lines) {
|
|
327
|
-
lines.push("## Query Intent Branches (intent-gated)", "", "Apply these branches only when the question matches the intent class. Do not reorder the global workflow for F/G protocol queries, platform file paths, or questions with a single named symbol or constant—keep exact `rg` and symbol-scoped CodeGraph first.", "", "### Caller and assembly chain (B-class)", "", "- Use when the question asks who calls, which modules invoke, where behavior is wired, or which facade modules delegate work.", "- Do not treat facade-runtime, loader, barrel, plugin-registry-snapshot, or a single deliver/helper file as sufficient Top-1 evidence when the rubric expects many concrete call sites.", "- After exact hits on the helper or symbol, run `codegraph callers` with a raised limit (or repeat with `rg` references/imports) until concrete callee modules appear; follow assembly nodes (`*-runtime`, `server-runtime-services`, registry entry vs snapshot) with `codegraph callees` or targeted `rg`.", "- Rank concrete call-site files above the file that only defines or loads the helper.", "", "### Trap demotion and package boundary (E-class)", "", "- Use when similarly named files exist in a different package or layer (for example `src/agents/*` vs `packages/*-core`).", "- Parse path and package hints in the query; demote trap candidates until an export, protocol type, or corroborating call site matches the asked layer.", "- Prefer `packages/<name>/` evidence when the question names a core library; demote spawn/runtime overlay traps that share a prefix but live in agent glue code.", "- Do not promote a trap file to Top-1 without reading exports and at least one confirming reference.", "", "### Extension and shared-symbol disambiguation (A-class)", "", "- Use when one symbol (for example `legacyConfigRules`) appears across many `extensions/` trees.", "- Run exact `rg` across `extensions/` first; filter by extension id or directory named in the question.", "- Prefer the first non-empty export with a real implementation over stub or empty `doctor-contract-api` paths; demote traps listed in eval/query context when present.", "- Run CodeGraph explore only after the extension candidate set is narrowed—not as an unscoped global symbol search.", "", "### Environment and config literals (D-class)", "", "- Use when the question names env vars, `OPENCLAW_*` prefixes, benchmark startup, or e2e script configuration.", "- Run exact `rg` on `scripts/`, `test/`, `e2e/`, and `bench/` (or project equivalents) before `src/` auth, token, or runtime conflict modules.", "- Prefer files that assign or read the literal in scripts over implementation files that only mention the prefix in error handling.", "- Use CodeGraph after literal hits exist; do not let auth/runtime implementation outrank script evidence for env-inventory questions.", "", "### Preserve strong routes (F / G / exact symbol)", "", "- Platform paths (`apps/ios`, `apps/android`, Swift/Kotlin trees), `packages/gateway-protocol`, contract/schema globs, and named constants: exact `rg` plus symbol-scoped `codegraph_search` stay primary.", "- Do not run policy-first, trap demotion, or env-before-`src/` passes ahead of exact symbol discovery for those queries.", "");
|
|
326
|
+
lines.push("## Query Intent Branches (intent-gated)", "", "Apply these branches only when the question matches the intent class. Do not reorder the global workflow for F/G protocol queries, platform file paths, or questions with a single named symbol or constant—keep exact `rg` and symbol-scoped CodeGraph first.", "", "### Caller and assembly chain (B-class)", "", "- Use when the question asks who calls, which modules invoke, where behavior is wired, or which facade modules delegate work.", "- Do not treat facade-runtime, loader, barrel, plugin-registry-snapshot, or a single deliver/helper file as sufficient Top-1 evidence when the rubric expects many concrete call sites.", "- After exact hits on the helper or symbol, run `codegraph callers` with a raised limit (or repeat with `rg` references/imports) until concrete callee modules appear; follow assembly nodes (`*-runtime`, `server-runtime-services`, registry entry vs snapshot) with `codegraph callees` or targeted `rg`.", "- Rank concrete call-site files above the file that only defines or loads the helper.", "", "### Cross-cutting / conceptual discovery", "", "- Use when the question has no named symbol, path, or protocol constant but asks how behavior works, spans modules/packages, or uses conceptual phrasing (for example English *how does* / *across packages*, or Chinese 如何 / 机制 / 跨).", "- The deterministic router emits intent `cross-cutting-discovery` and promotes semantic recall to plan order 1–2 (after `policy-docs-rg` when policy intent also matches); follow with exact `rg` on returned keywords and paths.", "- **On Cursor**: router route id `platform-semantic` (`platformNative: true`) — use Cursor built-in codebase / semantic search (see `.cursor/rules/retrieval-routing.mdc`). **Do not** use `fast_context_search` or fast-context MCP for semantic recall on Cursor.", "- **On Codex, Claude Code, and other non-Cursor hosts**: router route id `semantic-fast-context` — invoke `fast_context_search` when the envelope fallback calls for semantic recall after uncorroborated exact `rg`.", "- When exact-symbol or F/G preserve intents match, keep exact `rg` primary; do not apply this branch.", "", "### Trap demotion and package boundary (E-class)", "", "- Use when similarly named files exist in a different package or layer (for example `src/agents/*` vs `packages/*-core`).", "- Parse path and package hints in the query; demote trap candidates until an export, protocol type, or corroborating call site matches the asked layer.", "- Prefer `packages/<name>/` evidence when the question names a core library; demote spawn/runtime overlay traps that share a prefix but live in agent glue code.", "- Do not promote a trap file to Top-1 without reading exports and at least one confirming reference.", "", "### Extension and shared-symbol disambiguation (A-class)", "", "- Use when one symbol (for example `legacyConfigRules`) appears across many `extensions/` trees.", "- Run exact `rg` across `extensions/` first; filter by extension id or directory named in the question.", "- Prefer the first non-empty export with a real implementation over stub or empty `doctor-contract-api` paths; demote traps listed in eval/query context when present.", "- Run CodeGraph explore only after the extension candidate set is narrowed—not as an unscoped global symbol search.", "", "### Environment and config literals (D-class)", "", "- Use when the question names env vars, `OPENCLAW_*` prefixes, benchmark startup, or e2e script configuration.", "- Run exact `rg` on `scripts/`, `test/`, `e2e/`, and `bench/` (or project equivalents) before `src/` auth, token, or runtime conflict modules.", "- Prefer files that assign or read the literal in scripts over implementation files that only mention the prefix in error handling.", "- Use CodeGraph after literal hits exist; do not let auth/runtime implementation outrank script evidence for env-inventory questions.", "", "### Preserve strong routes (F / G / exact symbol)", "", "- Platform paths (`apps/ios`, `apps/android`, Swift/Kotlin trees), `packages/gateway-protocol`, contract/schema globs, and named constants: exact `rg` plus symbol-scoped `codegraph_search` stay primary.", "- Do not run policy-first, trap demotion, or env-before-`src/` passes ahead of exact symbol discovery for those queries.", "");
|
|
328
327
|
}
|
|
329
328
|
function appendCodebaseRetrievalWorkflow(lines) {
|
|
330
|
-
lines.push("## Codebase Retrieval Workflow", "", "1. Extract exact identifiers, literals, path hints, policy phrases, command names, error text, config keys, env prefixes, extension ids, routes, event names, task names, and test names from the question.", "2. Run exact `rg` search first when exact signals exist and keep file/range candidates tied to source evidence.", "3. Classify intent (policy/document, caller-chain, trap/package, extension spread, env literal, protocol/platform) and apply **Policy and Document-First Routing** or the matching branch from **Query Intent Branches** when it fits; skip branches that do not match.", "4. Use AST/CodeGraph when available and fresh enough to resolve symbols, imports, callers, callees, impact, and affected files.", "5.
|
|
329
|
+
lines.push("## Codebase Retrieval Workflow", "", "1. Extract exact identifiers, literals, path hints, policy phrases, command names, error text, config keys, env prefixes, extension ids, routes, event names, task names, and test names from the question.", "2. Run exact `rg` search first when exact signals exist and keep file/range candidates tied to source evidence.", "3. Classify intent (policy/document, caller-chain, trap/package, extension spread, env literal, protocol/platform) and apply **Policy and Document-First Routing** or the matching branch from **Query Intent Branches** when it fits; skip branches that do not match.", "4. Use AST/CodeGraph when available and fresh enough to resolve symbols, imports, callers, callees, impact, and affected files.", "5. Optionally use editor/LSP navigation (GO_TO_DEFINITION / references) only after candidate files or symbols exist; not a guaranteed Agent default — continue with Read and Grep when LSP is unavailable or uninvoked.", "6. Use semantic recall for conceptual, poorly named, or cross-cutting areas, then turn returned files/ranges/keywords into exact follow-up checks; deprioritize semantic Top-1 for policy/storage-policy, env-literal, and extension-disambiguation questions until policy docs or `rg` narrow candidates.", "7. Fuse candidates by source proximity, tests, current Git state, and adapter freshness.", "8. Read files, inspect relevant Git evidence, and run task-appropriate validation before making final behavior, impact, or test-coverage claims.", "", "## Codebase Evidence Levels", "", "- Candidate: filenames, semantic recall, initial graph/LSP output, or incomplete exact search. Candidate evidence cannot support final claims.", "- Corroborated candidate: current source reads or exact `rg` hits confirm the candidate exists in this checkout. Use it to plan deeper reads or tests.", "- Verified claim: current source lines plus Git evidence or focused validation support the statement. Use this level for final answers and `verify.md`.", "- Unverified / unavailable: adapter output is stale, skipped, unavailable, hidden from the host, or not invoked. Report it explicitly instead of claiming it.", "", "## Evidence Persistence", "", "- Record exploratory retrieval chains, adapter availability, freshness checks, and competing hypotheses in task `research/*.md`.", "- Record final source/Git/test proof, validation commands, and unresolved adapter gaps in `verify.md`.", "- Prefer reusable research frontmatter when the artifact should be rediscovered later: `doc_type`, `status`, `confidence`, `scope`, and `related_files`.", "", "## Fallback Sequence", "", "- If `rg` is missing, codebase retrieval readiness fails; install or expose `rg` before claiming readiness.", "- If CodeGraph, LSP, or fast-context are unavailable or unverified, continue with exact search, direct source reads, Git evidence, and focused tests.", "- Do not start MCP servers, initialize indexes, start language servers, or install tools without explicit user approval.", "", "## Adapter Roles", "");
|
|
331
330
|
const adapters = capabilityById("codebase-retrieval").adapters ?? {};
|
|
332
331
|
for (const [role, adapter] of Object.entries(adapters)) {
|
|
333
332
|
lines.push(`### ${role}`, "", `- Provider: ${adapter.provider}`, `- Required: ${adapter.required ? "yes" : "no"}`, `- Purpose: ${adapter.purpose}`, `- Readiness: ${adapter.readiness}`, `- Evidence status: ${adapter.evidenceStatus}`, "");
|
|
334
333
|
}
|
|
334
|
+
lines.push("## Semantic recall (Cursor)", "", "The `semantic` adapter role above lists **fast-context-mcp** as the default MCP provider for generated templates. **On Cursor**, the retrieval planner routes semantic intents to **platform-native search** (`platform-semantic`, `platformNative: true`) — use built-in codebase / semantic search; **not** fast-context MCP.", "", "Prefer `.cursor/rules/retrieval-routing.mdc` and `retrieval-daily-guide.md` for tool names.", "");
|
|
335
335
|
appendCodebaseRetrievalIntentBranches(lines);
|
|
336
336
|
}
|
|
337
337
|
export function renderCapabilitiesMarkdown(selected) {
|
|
@@ -353,7 +353,7 @@ export function renderCapabilitiesMarkdown(selected) {
|
|
|
353
353
|
lines.push(`- ${capability.id}: ${capability.description}`);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
lines.push("", "## Routing Rules", "", "- Unselected, unavailable, skipped, or uninvoked capabilities must not be reported as used.", "- Capability output that affects task decisions must be recorded in task research or verify evidence.", "- `codebase-retrieval` routes by retrieval role, not by tool brand: exact search, intent-gated policy/document-first routing for C-class questions, other intent-gated branches when the question class matches, AST/structure, LSP navigation, semantic recall, then verification.", "- Policy, architecture, boundary, and storage-policy questions must inspect `AGENTS.md`, `.trellis/spec/**`, and README/contributing/architecture docs before semantic implementation search.", "- Intent-gated branches (policy/document, caller-chain, trap demotion, extension disambiguation, env/config literals) must not override exact-symbol or F/G protocol routes.", "- Exact `rg` search and direct source reads are the baseline for current-code claims.", "- CodeGraph output is structural guidance until index freshness and current source/Git evidence are confirmed.", "- fast-context output is semantic recall only and must be converted into exact source checks before final claims.", "- GitHub MCP uses the GitHub API server package; remote writes require explicit user intent and the host's credential/tool posture must be clear.", "- Playwright MCP should be used for rendered UI evidence only when browser verification is part of the task.", "");
|
|
356
|
+
lines.push("", "## Routing Rules", "", "- Unselected, unavailable, skipped, or uninvoked capabilities must not be reported as used.", "- Capability output that affects task decisions must be recorded in task research or verify evidence.", "- `codebase-retrieval` routes by retrieval role, not by tool brand: exact search, intent-gated policy/document-first routing for C-class questions, other intent-gated branches when the question class matches, AST/structure, LSP navigation, semantic recall, then verification.", "- Policy, architecture, boundary, and storage-policy questions must inspect `AGENTS.md`, `.trellis/spec/**`, and README/contributing/architecture docs before semantic implementation search.", "- Intent-gated branches (policy/document, caller-chain, trap demotion, extension disambiguation, env/config literals) must not override exact-symbol or F/G protocol routes.", "- Exact `rg` search and direct source reads are the baseline for current-code claims.", "- CodeGraph output is structural guidance until index freshness and current source/Git evidence are confirmed.", "- fast-context output is semantic recall only and must be converted into exact source checks before final claims.", "- On **Cursor**, semantic recall uses built-in search (`platform-semantic`); do not substitute fast-context MCP. See **Semantic recall (Cursor)** under codebase-retrieval.", "- On Cursor, per-query tool order also lives in `.cursor/rules/retrieval-routing.mdc` (`alwaysApply`).", "- GitHub MCP uses the GitHub API server package; remote writes require explicit user intent and the host's credential/tool posture must be clear.", "- Playwright MCP should be used for rendered UI evidence only when browser verification is part of the task.", "");
|
|
357
357
|
if (selectedIds.includes("codebase-retrieval")) {
|
|
358
358
|
appendPolicyDocumentRetrievalRouting(lines);
|
|
359
359
|
appendCodebaseRetrievalWorkflow(lines);
|
|
@@ -460,13 +460,6 @@ export function buildProjectCapabilityTemplates(selected, platforms) {
|
|
|
460
460
|
files.set(CAPABILITIES_JSON_PATH, renderCapabilitiesJson(selectedIds));
|
|
461
461
|
files.set(CAPABILITIES_MD_PATH, renderCapabilitiesMarkdown(selectedIds));
|
|
462
462
|
const platformSet = new Set(platforms);
|
|
463
|
-
if (platformSet.has("codex")) {
|
|
464
|
-
const config = getCodexConfigTemplate();
|
|
465
|
-
files.set(`.codex/${config.targetPath}`, applyCodexCapabilityConfig(config.content, selectedIds));
|
|
466
|
-
}
|
|
467
|
-
if (platformSet.has("claude-code")) {
|
|
468
|
-
files.set(".mcp.json", renderMcpJson(selectedIds));
|
|
469
|
-
}
|
|
470
463
|
if (platformSet.has("cursor")) {
|
|
471
464
|
files.set(".cursor/mcp.json", renderMcpJson(selectedIds));
|
|
472
465
|
}
|
|
@@ -480,13 +473,6 @@ export async function writeProjectCapabilityFiles(cwd, selected, platforms) {
|
|
|
480
473
|
for (const [relativePath, content] of files) {
|
|
481
474
|
const targetPath = path.join(cwd, ...relativePath.split("/"));
|
|
482
475
|
ensureDir(path.dirname(targetPath));
|
|
483
|
-
if (relativePath === ".codex/config.toml" &&
|
|
484
|
-
fs.existsSync(targetPath) &&
|
|
485
|
-
normalizeLineEndings(fs.readFileSync(targetPath, "utf-8")) ===
|
|
486
|
-
normalizeLineEndings(getCodexConfigTemplate().content)) {
|
|
487
|
-
fs.writeFileSync(targetPath, content);
|
|
488
|
-
continue;
|
|
489
|
-
}
|
|
490
476
|
await writeFile(targetPath, content);
|
|
491
477
|
}
|
|
492
478
|
}
|