@mindfoldhq/trellis 0.6.9 → 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.
@@ -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
+ }
@@ -17,9 +17,11 @@ CRITICAL — Recursion guard (read first):
17
17
  You are the Trellis reviewer agent.
18
18
 
19
19
  Trellis Context Loading Protocol:
20
- - Look for the `<!-- trellis-hook-injected -->` marker in your input above.
21
- - 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.
22
- - 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.
23
25
 
24
26
  Your job is to review code changes against specs AND fix issues directly — not just report them. You have write access; use it.
25
27
 
@@ -17,9 +17,11 @@ CRITICAL — Recursion guard (read first):
17
17
  You are the Trellis implementer agent.
18
18
 
19
19
  Trellis Context Loading Protocol:
20
- - Look for the `<!-- trellis-hook-injected -->` marker in your input above.
21
- - 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.
22
- - 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.
23
25
 
24
26
  Rules:
25
27
  - Read before write. Follow `.trellis/spec/` guidance relevant to the task.
@@ -15,12 +15,17 @@ through the chat reply is a failure.
15
15
 
16
16
  ## Trellis Context Loading Protocol
17
17
 
18
- Look for the `<!-- trellis-hook-injected -->` marker in your input above.
19
-
20
- - If the marker is present, the native `SubagentStart` hook has supplied the
21
- `Active task: <path>` header and research-only context. Use that task path.
22
- - If the marker is absent, find `Active task: <path>` in your dispatch prompt.
23
- 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
24
29
  `task.py current`, guess, or use another session's task.
25
30
  - Do not load `implement.jsonl` or `check.jsonl`; research is role-isolated.
26
31
 
@@ -612,13 +612,16 @@ def clear_active_task(
612
612
  platform_input: dict[str, Any] | None = None,
613
613
  platform: str | None = None,
614
614
  ) -> ActiveTask:
615
- """Clear the active task by deleting the current session context file."""
615
+ """Clear the active task by deleting its resolved session context file."""
616
616
  context_key = resolve_context_key(platform_input, platform)
617
617
  if not context_key:
618
618
  return ActiveTask(None, "none")
619
619
 
620
620
  previous = resolve_active_task(repo_root, platform_input, platform)
621
- context_path = _context_path(repo_root, context_key)
621
+ if not previous.task_path or not previous.context_key:
622
+ return previous
623
+
624
+ context_path = _context_path(repo_root, previous.context_key)
622
625
  if context_path.is_file():
623
626
  _remove_file(context_path)
624
627
  return previous
@@ -236,20 +236,22 @@ def _validate_jsonl(jsonl_file: Path, repo_root: Path, task_dir: Path | None = N
236
236
  if extension in _CODE_FILE_EXTENSIONS and not _is_exempt_from_code_file_warning(
237
237
  file_path, task_rel
238
238
  ):
239
- print(
240
- f" {colored(f'{file_name}:{line_num}: Warning: {file_path} looks like a code file — '
241
- 'implement/check.jsonl should reference spec/research docs; '
242
- 'agents read code themselves', Colors.YELLOW)}"
239
+ warning_message = (
240
+ f"{file_name}:{line_num}: Warning: {file_path} looks like a code file — "
241
+ "implement/check.jsonl should reference spec/research docs; "
242
+ "agents read code themselves"
243
243
  )
244
+ print(f" {colored(warning_message, Colors.YELLOW)}")
244
245
 
245
246
  if max_file_bytes:
246
247
  size = full_path.stat().st_size
247
248
  if size > max_file_bytes:
248
- print(
249
- f" {colored(f'{file_name}:{line_num}: Warning: {file_path} is {size} bytes, '
250
- f'exceeds context_injection.max_file_bytes ({max_file_bytes}); '
251
- 'injection will truncate it', Colors.YELLOW)}"
249
+ warning_message = (
250
+ f"{file_name}:{line_num}: Warning: {file_path} is {size} bytes, "
251
+ f"exceeds context_injection.max_file_bytes ({max_file_bytes}); "
252
+ "injection will truncate it"
252
253
  )
254
+ print(f" {colored(warning_message, Colors.YELLOW)}")
253
255
 
254
256
  if errors == 0:
255
257
  print(f" {colored(f'{file_name}: ✓ ({real_entries} entries)', Colors.GREEN)}")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfoldhq/trellis",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,7 @@
34
34
  "inquirer": "^9.3.7",
35
35
  "undici": "^6.21.0",
36
36
  "zod": "^4.4.2",
37
- "@mindfoldhq/trellis-core": "0.6.9"
37
+ "@mindfoldhq/trellis-core": "0.6.10"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@eslint/js": "^9.18.0",