@mindfoldhq/trellis 0.6.8 → 0.6.10

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 (91) hide show
  1. package/dist/cli/index.js +1 -0
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/channel/agent-loader.d.ts +2 -2
  4. package/dist/commands/channel/agent-loader.d.ts.map +1 -1
  5. package/dist/commands/channel/agent-loader.js +9 -5
  6. package/dist/commands/channel/agent-loader.js.map +1 -1
  7. package/dist/commands/channel/context-loader.d.ts +1 -1
  8. package/dist/commands/channel/context-loader.d.ts.map +1 -1
  9. package/dist/commands/channel/context-loader.js +36 -15
  10. package/dist/commands/channel/context-loader.js.map +1 -1
  11. package/dist/commands/channel/context-trust.d.ts +31 -0
  12. package/dist/commands/channel/context-trust.d.ts.map +1 -0
  13. package/dist/commands/channel/context-trust.js +139 -0
  14. package/dist/commands/channel/context-trust.js.map +1 -0
  15. package/dist/commands/channel/spawn.d.ts.map +1 -1
  16. package/dist/commands/channel/spawn.js +4 -2
  17. package/dist/commands/channel/spawn.js.map +1 -1
  18. package/dist/commands/init.d.ts +1 -0
  19. package/dist/commands/init.d.ts.map +1 -1
  20. package/dist/commands/init.js.map +1 -1
  21. package/dist/commands/update.d.ts.map +1 -1
  22. package/dist/commands/update.js +17 -0
  23. package/dist/commands/update.js.map +1 -1
  24. package/dist/configurators/codex.d.ts +36 -0
  25. package/dist/configurators/codex.d.ts.map +1 -1
  26. package/dist/configurators/codex.js +100 -1
  27. package/dist/configurators/codex.js.map +1 -1
  28. package/dist/configurators/index.d.ts.map +1 -1
  29. package/dist/configurators/index.js +5 -0
  30. package/dist/configurators/index.js.map +1 -1
  31. package/dist/configurators/shared.d.ts.map +1 -1
  32. package/dist/configurators/shared.js +1 -0
  33. package/dist/configurators/shared.js.map +1 -1
  34. package/dist/configurators/snow.d.ts +31 -0
  35. package/dist/configurators/snow.d.ts.map +1 -0
  36. package/dist/configurators/snow.js +95 -0
  37. package/dist/configurators/snow.js.map +1 -0
  38. package/dist/configurators/workflow.d.ts +14 -0
  39. package/dist/configurators/workflow.d.ts.map +1 -1
  40. package/dist/configurators/workflow.js +37 -1
  41. package/dist/configurators/workflow.js.map +1 -1
  42. package/dist/migrations/manifests/0.6.10.json +9 -0
  43. package/dist/migrations/manifests/0.6.9.json +9 -0
  44. package/dist/templates/codex/agents/trellis-check.toml +7 -3
  45. package/dist/templates/codex/agents/trellis-implement.toml +7 -3
  46. package/dist/templates/codex/agents/trellis-research.toml +13 -6
  47. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +1 -1
  48. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +1 -1
  49. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +4 -2
  50. package/dist/templates/kimi/agents/trellis-research.md +7 -3
  51. package/dist/templates/omp/extensions/trellis/index.ts.txt +114 -4
  52. package/dist/templates/opencode/lib/trellis-context.js +263 -43
  53. package/dist/templates/opencode/plugins/inject-subagent-context.js +89 -35
  54. package/dist/templates/opencode/plugins/inject-workflow-state.js +90 -5
  55. package/dist/templates/pi/extensions/trellis/index.ts.txt +270 -22
  56. package/dist/templates/shared-hooks/inject-subagent-context.py +311 -83
  57. package/dist/templates/shared-hooks/inject-workflow-state.py +36 -1
  58. package/dist/templates/snow/SNOW.md +86 -0
  59. package/dist/templates/snow/agents/trellis-check.md +135 -0
  60. package/dist/templates/snow/agents/trellis-implement.md +153 -0
  61. package/dist/templates/snow/agents/trellis-research.md +114 -0
  62. package/dist/templates/snow/hooks/beforeSubAgentStart.json +15 -0
  63. package/dist/templates/snow/hooks/onSessionStart.json +15 -0
  64. package/dist/templates/snow/hooks/onUserMessage.json +15 -0
  65. package/dist/templates/snow/hooks/write-trellis-context.py +644 -0
  66. package/dist/templates/snow/index.d.ts +26 -0
  67. package/dist/templates/snow/index.d.ts.map +1 -0
  68. package/dist/templates/snow/index.js +36 -0
  69. package/dist/templates/snow/index.js.map +1 -0
  70. package/dist/templates/template-utils.d.ts.map +1 -1
  71. package/dist/templates/template-utils.js +5 -1
  72. package/dist/templates/template-utils.js.map +1 -1
  73. package/dist/templates/trellis/config.yaml +46 -0
  74. package/dist/templates/trellis/gitattributes.txt +9 -0
  75. package/dist/templates/trellis/index.d.ts +3 -1
  76. package/dist/templates/trellis/index.d.ts.map +1 -1
  77. package/dist/templates/trellis/index.js +3 -1
  78. package/dist/templates/trellis/index.js.map +1 -1
  79. package/dist/templates/trellis/scripts/add_session.py +94 -28
  80. package/dist/templates/trellis/scripts/common/active_task.py +9 -2
  81. package/dist/templates/trellis/scripts/common/config.py +89 -2
  82. package/dist/templates/trellis/scripts/common/task_context.py +84 -6
  83. package/dist/templates/trellis/scripts/common/task_store.py +63 -1
  84. package/dist/templates/trellis/scripts/common/trellis_config.py +2 -1
  85. package/dist/templates/trellis/scripts/task.py +21 -2
  86. package/dist/templates/trellis/workflow.md +14 -14
  87. package/dist/types/ai-tools.d.ts +3 -3
  88. package/dist/types/ai-tools.d.ts.map +1 -1
  89. package/dist/types/ai-tools.js +38 -0
  90. package/dist/types/ai-tools.js.map +1 -1
  91. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,+BAA+B,CAAC;AAEvC,4BAA4B;AAC5B,OAAO,EACL,yBAAyB;AACzB,gCAAgC;AAChC,mBAAmB,EACnB,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B;AAC3B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,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,sDAAsD;QACtD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,kBAAkB,EAAE,GAAG,CAAC,OAAO,CAAC;gBAAE,SAAS;YAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;YAC/D,SAAS,CAAC,WAAW,CAAC,CAAC;YACvB,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;YAChE,MAAM,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;SAAM,CAAC;QACN,mBAAmB;QACnB,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.10",
3
+ "description": "Python 3.9–3.11 task script compatibility, complete Codex hook context recovery, and correct fallback-session cleanup.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Bug Fixes:**\n- fix(scripts): restore Python 3.9–3.11 compatibility in `.trellis/scripts/common/task_context.py` by removing multiline nested f-strings (#476)\n- fix(codex): make `trellis-{implement,check,research}` recover saved `SubagentStart` output before trusting the injected marker (#465)\n- fix(scripts): make `task.py finish` clear the resolved fallback session while preserving ambiguous or unresolved sessions (#469)",
7
+ "migrations": [],
8
+ "notes": "Run `trellis update` to refresh task scripts and Codex sub-agent templates. No `--migrate` required."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.9",
3
+ "description": "Snow CLI platform, sub-agent context injection caps (Python/Pi/OpenCode) with binary-file handling, no-trellis skip keyword, durable Codex sub-agent model config, channel trusted context dirs, and journal merge conflict relief.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(cli): add Snow CLI as class-1 Trellis platform — `trellis init --snow` (#443)\n- feat(hooks): cap sub-agent context injection with configurable limits across the Python hook, Pi extension, and OpenCode plugin — `context_injection` in config.yaml (#441, #456)\n- fix(cli): sub-agent context injection now detects binary referenced files and emits a reference-only notice instead of corrupting output (#471)\n- feat(hooks): `no-trellis` keyword in a prompt mutes per-turn workflow-state injection for that turn — `prompt_injection.skip_keyword` in config.yaml (#427)\n- feat(codex): user-set `model` / `model_reasoning_effort` in `.codex/agents/trellis-*.toml` now survive `trellis update` regeneration; templates ship commented hints (#459)\n- feat(channel): `channel.trusted_context_dirs` config plus narrow auto-trust of symlinked `.trellis/tasks` / `.trellis/workspace` for context loading (#414)\n- feat(scripts): `add_session.py` gains repeatable `--change` / `--test` / `--next-step` flags; empty sections are omitted instead of rendering placeholder text (#394)\n- feat(scripts): `task.py list` renders a dangling parent reference flat instead of hiding the task (#402)\n- feat(scripts): `task.py create --meta key=value` (repeatable) and `task.py set-meta` expose the task.json `meta` field\n\n**Bug Fixes:**\n- fix(kimi): `trellis-research` now persists findings through the writable built-in `coder` sub-agent instead of losing them (#457)\n- feat(workspace): `.gitattributes` ships `journal-*.md merge=union` so parallel-worktree session merges no longer conflict on append-only journal content; `index.md` conflicts are documented as expected and safe to resolve by picking either side (#415)",
7
+ "migrations": [],
8
+ "notes": "Pi Agent users on 0.6.8: skills already moved to .agents/skills/. Codex users: agent model config now persists across update — edit .codex/agents/trellis-*.toml directly."
9
+ }
@@ -1,6 +1,8 @@
1
1
  name = "trellis-check"
2
2
  description = "Workspace-write Trellis reviewer that self-fixes spec drift, lint/type-check failures, and missing tests."
3
3
  sandbox_mode = "workspace-write"
4
+ # model = "gpt-5.6-terra"
5
+ # model_reasoning_effort = "high"
4
6
 
5
7
  developer_instructions = """
6
8
  You are running as the `trellis-check` sub-agent. The main session has dispatched you to review and self-fix.
@@ -15,9 +17,11 @@ CRITICAL — Recursion guard (read first):
15
17
  You are the Trellis reviewer agent.
16
18
 
17
19
  Trellis Context Loading Protocol:
18
- - Look for the `<!-- trellis-hook-injected -->` marker in your input above.
19
- - If the marker is present, the native `SubagentStart` hook has already loaded the role-specific task artifacts and spec context. Proceed directly with the check work.
20
- - If the marker is absent, find `Active task: <path>` in your dispatch prompt. Read `<path>/check.jsonl`, each file listed there, `<path>/prd.md`, `<path>/design.md` if present, and `<path>/implement.md` if present before checking. If the dispatch prompt has no active-task path, ask the main session; do not guess or use another session's task.
20
+ - First look for `Full hook output saved to: <path>` in your input above. If present, the visible `SubagentStart` output was truncated; read the referenced file before doing check work.
21
+ - If the referenced file cannot be read, use the active-task fallback below.
22
+ - If there is no saved-output notice and the `<!-- trellis-hook-injected -->` marker is present, the hook loaded the complete role-specific task artifacts and spec context.
23
+ - If there is no saved-output notice and the marker is absent, use the active-task fallback below.
24
+ - For the fallback, find `Active task: <path>` in your dispatch prompt. Read `<path>/check.jsonl`, each file listed there, `<path>/prd.md`, `<path>/design.md` if present, and `<path>/implement.md` if present before checking. If the dispatch prompt has no active-task path, ask the main session; do not guess or use another session's task.
21
25
 
22
26
  Your job is to review code changes against specs AND fix issues directly — not just report them. You have write access; use it.
23
27
 
@@ -1,6 +1,8 @@
1
1
  name = "trellis-implement"
2
2
  description = "Workspace-write Trellis implementer that follows specs and keeps generated templates in sync."
3
3
  sandbox_mode = "workspace-write"
4
+ # model = "gpt-5.6-terra"
5
+ # model_reasoning_effort = "high"
4
6
 
5
7
  developer_instructions = """
6
8
  You are running as the `trellis-implement` sub-agent. The main session has dispatched you to do the work.
@@ -15,9 +17,11 @@ CRITICAL — Recursion guard (read first):
15
17
  You are the Trellis implementer agent.
16
18
 
17
19
  Trellis Context Loading Protocol:
18
- - Look for the `<!-- trellis-hook-injected -->` marker in your input above.
19
- - If the marker is present, the native `SubagentStart` hook has already loaded the role-specific task artifacts and spec context. Proceed directly with the implementation work.
20
- - If the marker is absent, find `Active task: <path>` in your dispatch prompt. Read `<path>/implement.jsonl`, each file listed there, `<path>/prd.md`, `<path>/design.md` if present, and `<path>/implement.md` if present before doing the work. If the dispatch prompt has no active-task path, ask the main session; do not guess or use another session's task.
20
+ - First look for `Full hook output saved to: <path>` in your input above. If present, the visible `SubagentStart` output was truncated; read the referenced file before doing implementation work.
21
+ - If the referenced file cannot be read, use the active-task fallback below.
22
+ - If there is no saved-output notice and the `<!-- trellis-hook-injected -->` marker is present, the hook loaded the complete role-specific task artifacts and spec context.
23
+ - If there is no saved-output notice and the marker is absent, use the active-task fallback below.
24
+ - For the fallback, find `Active task: <path>` in your dispatch prompt. Read `<path>/implement.jsonl`, each file listed there, `<path>/prd.md`, `<path>/design.md` if present, and `<path>/implement.md` if present before doing the work. If the dispatch prompt has no active-task path, ask the main session; do not guess or use another session's task.
21
25
 
22
26
  Rules:
23
27
  - Read before write. Follow `.trellis/spec/` guidance relevant to the task.
@@ -1,6 +1,8 @@
1
1
  name = "trellis-research"
2
2
  description = "Trellis researcher for specs, code patterns, and affected files. Writes findings into {TASK_DIR}/research/ — read-only elsewhere."
3
3
  sandbox_mode = "workspace-write"
4
+ # model = "gpt-5.6-terra"
5
+ # model_reasoning_effort = "high"
4
6
 
5
7
  developer_instructions = """
6
8
  You are the Trellis researcher agent.
@@ -13,12 +15,17 @@ through the chat reply is a failure.
13
15
 
14
16
  ## Trellis Context Loading Protocol
15
17
 
16
- Look for the `<!-- trellis-hook-injected -->` marker in your input above.
17
-
18
- - If the marker is present, the native `SubagentStart` hook has supplied the
19
- `Active task: <path>` header and research-only context. Use that task path.
20
- - If the marker is absent, find `Active task: <path>` in your dispatch prompt.
21
- If it is absent too, ask the main session for the path; do not run
18
+ - First look for `Full hook output saved to: <path>` in your input above. If
19
+ present, the visible `SubagentStart` output was truncated; read the referenced
20
+ file before doing research work.
21
+ - If the referenced file cannot be read, use the active-task fallback below.
22
+ - If there is no saved-output notice and the
23
+ `<!-- trellis-hook-injected -->` marker is present, the hook supplied the
24
+ complete `Active task: <path>` header and research-only context.
25
+ - If there is no saved-output notice and the marker is absent, use the
26
+ active-task fallback below.
27
+ - For the fallback, find `Active task: <path>` in your dispatch prompt. If it
28
+ is absent too, ask the main session for the path; do not run
22
29
  `task.py current`, guess, or use another session's task.
23
30
  - Do not load `implement.jsonl` or `check.jsonl`; research is role-isolated.
24
31
 
@@ -34,7 +34,7 @@ Agent files should not become generic chat prompts. They should define input sou
34
34
  | Pi Agent | `.pi/agents/trellis-*.md` |
35
35
  | Reasonix | `.reasonix/skills/trellis-*/SKILL.md` (subagent frontmatter) |
36
36
  | ZCode | `.zcode/agents/trellis-*.md` |
37
- | Kimi Code | `.kimi-code/skills/trellis-*/SKILL.md` (agent prompts as skills, dispatched to the built-in coder/explore/plan sub-agents) |
37
+ | Kimi Code | `.kimi-code/skills/trellis-*/SKILL.md` (agent prompts as skills, dispatched to the built-in `coder`; research needs its file-editing tools to persist findings) |
38
38
 
39
39
  GitHub Copilot agent/prompt support is provided by a combination of directories such as `.github/agents/`, `.github/prompts/`, and `.github/skills/`; inspect the files actually generated in the user project.
40
40
 
@@ -5,7 +5,7 @@ Trellis connects the same local architecture to different AI tools. `.trellis/`
5
5
  When a local AI modifies Trellis, it should distinguish two file categories first:
6
6
 
7
7
  - **Shared files**: `.trellis/workflow.md`, `.trellis/tasks/`, `.trellis/spec/`, `.trellis/scripts/`.
8
- - **Platform files**: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.trae/`, `.kilocode/`, `.agent/`, `.devin/`, `.reasonix/`, `.zcode/`, `.kimi-code/`, and similar directories.
8
+ - **Platform files**: `.claude/`, `.snow/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.trae/`, `.kilocode/`, `.agent/`, `.devin/`, `.reasonix/`, `.zcode/`, `.kimi-code/`, and similar directories.
9
9
 
10
10
  Platform files do not store business state. They let the corresponding AI tool read Trellis state, call Trellis scripts, and load Trellis skills/agents/hooks.
11
11
 
@@ -24,7 +24,8 @@ This page lists common Trellis file locations in a user project by platform. Whe
24
24
  | Reasonix | `--reasonix` | `.reasonix/` | `.reasonix/skills/` | None — sub-agents are skills with `runAs: subagent` frontmatter | None |
25
25
  | ZCode | `--zcode` | `.zcode/` | `.zcode/skills/` | `.zcode/agents/` | `.zcode/hooks/` + `.zcode/config.json` (SessionStart + UserPromptSubmit + PreToolUse Agent/Task); sub-agents use hook-injected context |
26
26
  | Grok Build | `--grok` | `.grok/` | `.grok/skills/` | `.grok/agents/` | pull-based prelude (no hooks; flat `.grok/commands/trellis-*.md`) |
27
- | Kimi Code | `--kimi` | `.kimi-code/` | `.agents/skills/` (shared) + `.kimi-code/skills/` | None — agent prompts are skills under `.kimi-code/skills/` (built-in coder/explore/plan sub-agents only) | None (pull-based prelude; no project hooks/settings) |
27
+ | Kimi Code | `--kimi` | `.kimi-code/` | `.agents/skills/` (shared) + `.kimi-code/skills/` | None — agent prompts are skills under `.kimi-code/skills/` and dispatch to the built-in `coder` | None (pull-based prelude; no project hooks/settings) |
28
+ | Snow CLI | `--snow` | `.snow/` | `.snow/skills/` | `.snow/agents/` (auto-discovered; primary path) | class-1: auto inject + project agents + `beforeSubAgentStart` (`.snow/hooks/` `session`/`user`/`subagent` modes -> `additionalContext` JSON); no legacy sub-agent JSON; commands `.snow/commands/trellis-*.json` |
28
29
 
29
30
  ## Capability Groups
30
31
 
@@ -47,7 +48,8 @@ These platforms usually have `trellis-research`, `trellis-implement`, and `trell
47
48
  - Reasonix (delivered as skills with `runAs: subagent` under `.reasonix/skills/`, not as a separate `agents/` directory)
48
49
  - ZCode
49
50
  - Grok Build (`.grok/agents/`; dispatch via `spawn_subagent` with `subagent_type`)
50
- - Kimi Code (delivered as skills under `.kimi-code/skills/`; dispatched to the built-in coder/explore/plan sub-agents)
51
+ - Kimi Code (delivered as skills under `.kimi-code/skills/`; dispatched to the built-in `coder`, including research because it must persist files)
52
+ - Snow CLI (`.snow/agents/`; auto-discovered project agents + class-1 hooks)
51
53
 
52
54
  When changing implementation/check/research behavior, look for the corresponding platform agent files first.
53
55
 
@@ -4,8 +4,8 @@ description: |
4
4
  Code and tech search expert for Trellis. Finds files, patterns, and tech
5
5
  solutions, and PERSISTS every finding to the current task's research/
6
6
  directory. No code modifications outside that directory. On Kimi Code the
7
- main session dispatches the built-in explore sub-agent with these
8
- instructions.
7
+ main session dispatches the built-in coder sub-agent with these instructions
8
+ because it is the only built-in sub-agent with file-editing tools.
9
9
  ---
10
10
  # Research Agent
11
11
 
@@ -19,7 +19,11 @@ Conversations get compacted; files don't. Every research output MUST end up as a
19
19
 
20
20
  ## Dispatch note (main session)
21
21
 
22
- Kimi Code has no project-level custom sub-agent definitions — only the built-in `coder` / `explore` / `plan` sub-agents. The main session dispatches the built-in `explore` sub-agent via the Agent tool with a prompt that starts with `Active task: <path from task.py current>` and includes this skill's instructions (`.kimi-code/skills/trellis-research/SKILL.md`).
22
+ Kimi Code has no project-level custom sub-agent definitions — only the built-in `coder` / `explore` / `plan` sub-agents. The built-in `explore` sub-agent is read-only, so it cannot satisfy this agent's persistence contract. The main session dispatches the built-in `coder` sub-agent via the Agent tool with a prompt that:
23
+
24
+ 1. Starts with `Active task: <path from task.py current>`
25
+ 2. Includes this skill's instructions (`.kimi-code/skills/trellis-research/SKILL.md`)
26
+ 3. States that the spawned agent is already `trellis-research` and may write only under the active task's `research/` directory
23
27
 
24
28
  ---
25
29
 
@@ -1,5 +1,5 @@
1
1
  import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
2
- import { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
2
+ import { existsSync, lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs";
3
3
  import { join, dirname, isAbsolute, relative, resolve } from "node:path";
4
4
  import { spawnSync } from "node:child_process";
5
5
  import { createHash } from "node:crypto";
@@ -58,11 +58,118 @@ function isInsideRoot(root: string, candidate: string): boolean {
58
58
  return rel === "" || (rel !== ".." && !rel.startsWith("../") && !rel.startsWith("..\\") && !isAbsolute(rel));
59
59
  }
60
60
 
61
- function resolveProjectFile(projectRoot: string, file: string): string | null {
61
+ // ---------------------------------------------------------------------------
62
+ // Trusted context roots (mirrors packages/cli/src/commands/channel/context-trust.ts;
63
+ // standalone copy since templates don't import from the CLI package).
64
+ // ---------------------------------------------------------------------------
65
+
66
+ const AUTO_TRUST_ENTRIES = ["tasks", "workspace"];
67
+
68
+ function stripTrustValue(s: string): string {
69
+ return s.trim().replace(/\s*#.*$/, "").trim().replace(/^['"]|['"]$/g, "");
70
+ }
71
+
72
+ function parseChannelTrustSection(content: string): { trustedDirs: string[]; autoTrustSymlinks?: boolean } {
73
+ const lines = content.split("\n");
74
+ const trustedDirs: string[] = [];
75
+ let autoTrustSymlinks: boolean | undefined;
76
+ let inChannel = false;
77
+ let inList = false;
78
+
79
+ for (const raw of lines) {
80
+ const line = raw.replace(/\r$/, "");
81
+ const trimmed = line.trimEnd();
82
+ if (trimmed.trim().startsWith("#")) continue;
83
+
84
+ if (/^channel:\s*$/.test(trimmed)) {
85
+ inChannel = true;
86
+ inList = false;
87
+ continue;
88
+ }
89
+ if (!inChannel) continue;
90
+
91
+ if (trimmed.trim() !== "" && /^\S/.test(line)) {
92
+ inChannel = false;
93
+ inList = false;
94
+ continue;
95
+ }
96
+ if (trimmed.trim() === "") continue;
97
+
98
+ if (inList) {
99
+ const item = trimmed.match(/^ {4}-\s*(.+)$/);
100
+ if (item) {
101
+ const val = stripTrustValue(item[1]!);
102
+ if (val) trustedDirs.push(val);
103
+ continue;
104
+ }
105
+ inList = false;
106
+ }
107
+
108
+ if (/^ {2}trusted_context_dirs:\s*$/.test(trimmed)) {
109
+ inList = true;
110
+ continue;
111
+ }
112
+
113
+ const boolMatch = trimmed.match(/^ {2}auto_trust_trellis_symlinks:\s*(.+)$/);
114
+ if (boolMatch) {
115
+ const val = stripTrustValue(boolMatch[1]!).toLowerCase();
116
+ if (val === "false") autoTrustSymlinks = false;
117
+ else if (val === "true") autoTrustSymlinks = true;
118
+ else process.stderr.write(`[channel] channel.auto_trust_trellis_symlinks: invalid value '${val}', ignoring\n`);
119
+ continue;
120
+ }
121
+ }
122
+
123
+ return { trustedDirs, autoTrustSymlinks };
124
+ }
125
+
126
+ function resolveTrustedRoots(projectRoot: string): string[] {
127
+ const configPath = join(projectRoot, ".trellis", "config.yaml");
128
+ let config: { trustedDirs: string[]; autoTrustSymlinks?: boolean } = { trustedDirs: [] };
129
+ if (existsSync(configPath)) {
130
+ try {
131
+ config = parseChannelTrustSection(readFileSync(configPath, "utf-8"));
132
+ } catch {
133
+ // ignore
134
+ }
135
+ }
136
+
137
+ const roots: string[] = [];
138
+ for (const entry of config.trustedDirs) {
139
+ try {
140
+ roots.push(realpathSync(resolve(projectRoot, entry)));
141
+ } catch {
142
+ // entry not found or invalid — skip
143
+ }
144
+ }
145
+
146
+ if (config.autoTrustSymlinks !== false) {
147
+ for (const entryName of AUTO_TRUST_ENTRIES) {
148
+ const entryPath = join(projectRoot, ".trellis", entryName);
149
+ try {
150
+ if (lstatSync(entryPath).isSymbolicLink()) {
151
+ roots.push(realpathSync(entryPath));
152
+ }
153
+ } catch {
154
+ // missing / broken symlink — nothing to trust
155
+ }
156
+ }
157
+ }
158
+
159
+ return [...new Set(roots)];
160
+ }
161
+
162
+ function resolveProjectFile(
163
+ projectRoot: string,
164
+ file: string,
165
+ trustedRoots: string[],
166
+ ): string | null {
62
167
  try {
63
168
  const rootReal = realpathSync(projectRoot);
64
169
  const targetReal = realpathSync(resolve(projectRoot, file));
65
- return isInsideRoot(rootReal, targetReal) ? targetReal : null;
170
+ if (isInsideRoot(rootReal, targetReal)) return targetReal;
171
+ if (trustedRoots.some((root) => isInsideRoot(root, targetReal))) return targetReal;
172
+ return null;
66
173
  } catch {
67
174
  return null;
68
175
  }
@@ -171,6 +278,9 @@ type AgentType = "trellis-implement" | "trellis-check" | "trellis-research" | nu
171
278
 
172
279
  function buildTaskContext(projectRoot: string, taskDir: string, agentType?: AgentType): string {
173
280
  const parts: string[] = [];
281
+ // Resolved once per call (not per referenced file) — avoids re-parsing
282
+ // config.yaml for every jsonl row.
283
+ const trustedRoots = resolveTrustedRoots(projectRoot);
174
284
 
175
285
  // prd.md and info.md — always included
176
286
  let prd = "";
@@ -212,7 +322,7 @@ function buildTaskContext(projectRoot: string, taskDir: string, agentType?: Agen
212
322
  const row = JSON.parse(trimmed) as Record<string, unknown>;
213
323
  const file = typeof row.file === "string" ? row.file.trim() : "";
214
324
  if (!file) continue;
215
- const targetPath = resolveProjectFile(projectRoot, file);
325
+ const targetPath = resolveProjectFile(projectRoot, file, trustedRoots);
216
326
  if (!targetPath) continue;
217
327
  let content = "";
218
328
  try { content = readFileSync(targetPath, "utf-8"); } catch { }