@mindfoldhq/trellis 0.5.0-beta.5 → 0.5.0-beta.7

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.5.0-beta.6",
3
+ "description": "Fix codex trellis-check agent: change from read-only to workspace-write, rewrite developer_instructions to match other platforms' self-fix behavior per workflow.md contract.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Bug Fixes:**\n- fix(codex): `trellis-check.toml` was shipped with `sandbox_mode = \"read-only\"` and 'Read-only Trellis reviewer' framing, which directly contradicted `workflow.md` (the check agent is supposed to auto-fix issues it finds — all other platforms' check agents have Write+Edit tools). Codex users running `trellis-check` could report findings but not fix them, forcing a manual roundtrip through the main agent. Changed to `sandbox_mode = \"workspace-write\"` and rewrote developer_instructions to instruct self-fix + re-run lint/type-check until green, matching the behavior contract of every other platform.",
7
+ "migrations": [],
8
+ "notes": "Pure template-content fix for codex users. No path migrations — `trellis update` will flag `.codex/agents/trellis-check.toml` as a template update and either auto-update (if unmodified) or prompt for confirm (if you customized it)."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.5.0-beta.7",
3
+ "description": "Fix opencode plugin loader incompatibility with OpenCode 1.2.x. Plugins shipped `export default { id, server: async (...) => hooks }` object shape; OpenCode iterates `Object.entries(mod)` and calls each export as a function (`packages/opencode/src/plugin/index.ts:90 — for ([_, fn] of Object.entries(mod)) await fn(input)`), which crashes with `TypeError: fn is not a function`. Fixed by changing all 3 plugins to the current factory-function shape: `export default async (input) => hooks`.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Bug Fixes:**\n- fix(opencode): plugins now use the factory-function export shape (`export default async ({ directory, client }) => hooks`) that OpenCode 1.2.x requires. The previous `{ id, server }` object shape crashed OpenCode on startup with `TypeError: fn3 is not a function. (In 'fn3(input)', 'fn3' is an instance of Object)` at `src/plugin/index.ts:90:28`, because OpenCode 1.2.x iterates every module export with `Object.entries(mod)` and calls each one as a function (`for ([_, fn] of Object.entries(mod)) await fn(input)`). The `server:` field was never unwrapped by the runtime. Affects all 3 plugins: `inject-subagent-context.js`, `inject-workflow-state.js`, `session-start.js`.\n Users on any trellis version that configured opencode — including 0.4.x stable — were affected as soon as they updated opencode to 1.2.x. Upgrade to this version to restore opencode startup.",
7
+ "migrations": [],
8
+ "notes": "Pure template-content fix for opencode users. No path migrations. `trellis update` auto-updates the 3 plugin files (unmodified copies) or prompts for confirm with diff (if you customized them)."
9
+ }
@@ -1,23 +1,38 @@
1
1
  name = "trellis-check"
2
- description = "Read-only Trellis reviewer focused on correctness, missing tests, and spec drift."
3
- sandbox_mode = "read-only"
2
+ description = "Workspace-write Trellis reviewer that self-fixes spec drift, lint/type-check failures, and missing tests."
3
+ sandbox_mode = "workspace-write"
4
4
 
5
5
  developer_instructions = """
6
6
  You are the Trellis reviewer agent.
7
7
 
8
+ Your job is to review code changes against specs AND fix issues directly — not just report them. You have write access; use it.
9
+
8
10
  Review checklist:
9
11
  - Verify behavior against the actual code paths, not assumptions.
10
12
  - Look for missing template/update/detection touch points when platform config changes.
11
13
  - Check whether tests should be added or updated.
12
14
  - Check whether `.trellis/spec/` docs need sync after implementation.
15
+ - Run lint and type-check; fix any failures.
13
16
  - Prefer concrete findings over speculative warnings.
14
17
 
18
+ When you find an issue:
19
+ 1. Fix it directly using edit/write tools.
20
+ 2. Re-run lint and type-check until green.
21
+ 3. Record what you changed and why.
22
+
15
23
  Output format:
16
- ## Findings
17
- - Severity: <high|medium|low>
24
+ ## Findings (fixed)
18
25
  - File: <path>
19
- - Issue: <what is wrong>
20
- - Recommendation: <specific fix>
26
+ - Issue: <what was wrong>
27
+ - Fix: <what you changed>
28
+
29
+ ## Findings (not fixed)
30
+ Only list issues you could not self-fix (e.g. missing product decision, out-of-scope). Explain why.
31
+
32
+ ## Verification
33
+ - Lint: pass/fail
34
+ - TypeCheck: pass/fail
35
+ - Tests: pass/fail (if applicable)
21
36
 
22
- If no issues are found, say so explicitly.
37
+ If no issues are found, say so explicitly after verifying lint/type-check pass.
23
38
  """
@@ -255,13 +255,16 @@ ${originalPrompt}
255
255
  return templates[agentType] || originalPrompt
256
256
  }
257
257
 
258
- export default {
259
- id: "trellis.inject-subagent-context",
260
- server: async ({ directory }) => {
261
- const ctx = new TrellisContext(directory)
262
- debugLog("inject", "Plugin loaded, directory:", directory)
263
-
264
- return {
258
+ // OpenCode plugin factory: `export default async (input) => hooks`.
259
+ // OpenCode 1.2.x iterates every module export and invokes it as a function
260
+ // (packages/opencode/src/plugin/index.ts — `for ([_, fn] of Object.entries(mod)) await fn(input)`);
261
+ // the previous `{ id, server }` object shape failed with
262
+ // `TypeError: fn is not a function` in 1.2.x.
263
+ export default async ({ directory }) => {
264
+ const ctx = new TrellisContext(directory)
265
+ debugLog("inject", "Plugin loaded, directory:", directory)
266
+
267
+ return {
265
268
  "tool.execute.before": async (input, output) => {
266
269
  try {
267
270
  debugLog("inject", "tool.execute.before called, tool:", input?.tool)
@@ -337,5 +340,4 @@ export default {
337
340
  }
338
341
  }
339
342
  }
340
- }
341
343
  }
@@ -107,13 +107,12 @@ function buildBreadcrumb(id, status, templates) {
107
107
  return `<workflow-state>\n${header}\n${body}\n</workflow-state>`
108
108
  }
109
109
 
110
- export default {
111
- id: "trellis.inject-workflow-state",
112
- server: async ({ directory }) => {
113
- const ctx = new TrellisContext(directory)
114
- debugLog("workflow-state", "Plugin loaded, directory:", directory)
110
+ // OpenCode 1.2.x expects plugins to be factory functions (see inject-subagent-context.js comment).
111
+ export default async ({ directory }) => {
112
+ const ctx = new TrellisContext(directory)
113
+ debugLog("workflow-state", "Plugin loaded, directory:", directory)
115
114
 
116
- return {
115
+ return {
117
116
  // chat.message fires on every user message. Inject breadcrumb in-place
118
117
  // so it persists in conversation history.
119
118
  "chat.message": async (input, output) => {
@@ -155,6 +154,5 @@ export default {
155
154
  )
156
155
  }
157
156
  },
158
- }
159
- },
157
+ }
160
158
  }
@@ -432,13 +432,12 @@ async function hasPersistedInjectedContext(client, directory, sessionID) {
432
432
  }
433
433
  }
434
434
 
435
- export default {
436
- id: "trellis.session-start",
437
- server: async ({ directory, client }) => {
438
- const ctx = new TrellisContext(directory)
439
- debugLog("session", "Plugin loaded, directory:", directory)
435
+ // OpenCode 1.2.x expects plugins to be factory functions (see inject-subagent-context.js comment).
436
+ export default async ({ directory, client }) => {
437
+ const ctx = new TrellisContext(directory)
438
+ debugLog("session", "Plugin loaded, directory:", directory)
440
439
 
441
- return {
440
+ return {
442
441
  // Clear in-memory dedupe after compaction so context can be re-injected.
443
442
  event: ({ event }) => {
444
443
  try {
@@ -511,6 +510,5 @@ export default {
511
510
  debugLog("session", "Error in chat.message:", error.message, error.stack)
512
511
  }
513
512
  }
514
- }
515
513
  }
516
514
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfoldhq/trellis",
3
- "version": "0.5.0-beta.5",
3
+ "version": "0.5.0-beta.7",
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",