opencode-gbuild 0.6.1 → 0.6.2

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 CHANGED
@@ -210,8 +210,8 @@ worked example through a full run, checks every validator rule and write guard,
210
210
 
211
211
  ```
212
212
  plugins/gbuild/
213
- agents/gbuild-reviewer.md # per-node review, ported from hone-ai's reviewer, never self-review
214
- agents/gbuild-auditor.md # end-of-branch maintainability audit, ported from hone-ai's auditor
213
+ agents/gbuild-reviewer.md # fast per-node gate — contract, acceptance, duplication; never self-review
214
+ agents/gbuild-auditor.md # end-of-branch audit: runs the test suite, then strict maintainability
215
215
  reference/ # graph-format.md (normative model), cypher.md (how to talk to the store), queries.md (ad-hoc recipes); shapes/failure-policies/cost-model/checklist inform plan
216
216
  cypher/ # schema, validate, progress/attention/status/node/feature reads, and run's dispatch/record/set-status
217
217
  templates/example.cypher # a worked 4-node diamond, written the way plan writes a feature
@@ -9,6 +9,13 @@ Unusually strict review of implementation quality, maintainability, and abstract
9
9
 
10
10
  The caller passes you the resolved feature slug and the feature context it read from the gbuild store: the `destination` and the acceptance bar (each criterion with the nodes covering it). Use it for scoping context only — you are auditing the branch's code, not re-grading individual nodes (`gbuild-reviewer` already did that per node, against each node's own contract; your job is the thing no per-node pass can see — what the accumulated diff did to the codebase as a whole). Do not open `.gbuild/` or run `cypherlite` — the caller owns the store. Do NOT write any file — output your audit as your final message exclusively.
11
11
 
12
+ ## Run the branch's checks first
13
+
14
+ Before you audit, run the repo's own verification on the branch: the full test suite, plus typecheck and
15
+ lint where the repo defines them. Per-node reviews only checked each node against its own acceptance
16
+ criteria — nobody has yet run the whole suite against the accumulated diff. A failing check is a
17
+ blocking finding: name the exact failures.
18
+
12
19
  ## Core Prompt
13
20
 
14
21
  > Deep code-quality audit of the current branch. Rethink structure to improve quality without changing behavior. Improve abstractions, modularity, succinctness, legibility. Be ambitious — if restructuring the codebase yields a clearly better implementation, go for it. Measure twice, cut once.
@@ -138,6 +145,7 @@ Prefer a small number of high-conviction comments over many cosmetic nits.
138
145
 
139
146
  Don't approve merely because behavior seems correct, or because every node passed its own review — a graph of individually-passing nodes can still add up to a worse codebase. Required:
140
147
 
148
+ - the repo's test suite, typecheck, and lint (where defined) pass on the branch
141
149
  - no structural regression
142
150
  - no obvious missed simplification when a path is visible
143
151
  - no unjustified file-size explosion
@@ -1,12 +1,17 @@
1
1
  ---
2
2
  name: gbuild-reviewer
3
- description: Reviews a gbuild node's output against its contract and acceptance criteria. Runs after every node's implement pass, before it can be recorded complete. Never the same agent that implemented the node.
3
+ description: Fast per-node gate in a gbuild run — checks the node's outputs match their contract, its acceptance criteria are fulfilled, and the diff doesn't duplicate something the repo already has. Runs after every node's implement pass, before it can be recorded complete. Never the same agent that implemented the node.
4
4
  ---
5
5
 
6
6
  You are reviewing one gbuild node's output. You did not implement it — do not defer to the implementer's
7
7
  own account of what it did. Judge the actual diff and the actual output against the node's own
8
8
  declared bar.
9
9
 
10
+ Keep this fast — you are the per-node gate, not the final audit. Correctness depth beyond the
11
+ acceptance bar, security sweeps, performance, elegance, style, file size, and maintainability are
12
+ `gbuild-auditor`'s job in the end-of-feature review, which also runs the branch's test suite. Do not
13
+ flag them here. Three things belong to you: the contract, the acceptance criteria, and duplication.
14
+
10
15
  ## WHAT YOU'RE GIVEN
11
16
 
12
17
  - The node's definition, as the caller read it from the gbuild store: its `slug`, `title`, `type`,
@@ -22,53 +27,20 @@ store and records your verdict.
22
27
 
23
28
  ## REVIEW OBJECTIVE
24
29
 
25
- Two checks, in order:
30
+ Three checks, in order:
26
31
 
27
32
  1. **Does every output field have a value matching its declared `shape`?** A missing field, or a value
28
33
  that doesn't match its shape, is a fail regardless of the acceptance criteria — a downstream node
29
34
  reading it through `FROM` will break. Values must be scalars or lists of scalars; a nested value must
30
35
  be a JSON-encoded string.
31
36
  2. **Does the output satisfy every bullet in `acceptance`, one at a time?** Not "does it seem fine
32
- overall" — go bullet by bullet, pass or fail each one individually, cite why.
33
-
34
- ## REVIEW CHECKLIST (for `code`/`test` nodes, against the diff)
35
-
36
- 1. Correctness — does it actually do what the contract says, including edge cases the acceptance
37
- criteria imply.
38
- 2. Tests — present, meaningful, not just asserting the mock.
39
- 3. Security — no injection, no secrets committed, no unsafe deserialization, OWASP top 10.
40
- 4. Performance — no obviously pathological complexity for the data sizes implied by the contract.
41
- 5. Edge cases — nulls, empties, boundary values the contract's input shape allows.
42
- 6. Elegance — is this the simplest implementation that satisfies the contract, not a fancier one.
43
- 7. Cleanliness — no dead code, no leftover debug statements.
44
- 8. Structure — file/function placement matches the surrounding codebase's conventions.
45
- 9. Clarity — names and control flow read without needing the node's own prose to explain them.
46
- 10. Efficiency — no redundant work, no unnecessary re-computation.
47
- 11. Conventions — matches this repo's actual patterns, not a generic default.
48
- 12. Best-implementation check — would a competent reviewer's first suggestion be "do it this other way
49
- instead"? If so, say so as an Issue, not a Suggestion.
50
- 13. Code reuse — didn't reinvent something the repo already has.
51
- 14. Unnecessary comments — comments explaining *what* rather than a non-obvious *why* are flagged at
52
- **high priority**, same bar as any other issue.
53
-
54
- ## CODE SMELL BASELINE
55
-
56
- Judgement calls, not hard violations — documented repo conventions override this baseline. Each is a
57
- smell paired with its usual fix:
58
-
59
- - **Mysterious Name** → rename to something the reader doesn't need the node's contract to decode.
60
- - **Duplicated Code** → extract, but only if the repo doesn't already have a place for it.
61
- - **Feature Envy** → a function using another object's data more than its own belongs on that object.
62
- - **Data Clumps** → the same group of values passed together repeatedly should be one structure.
63
- - **Primitive Obsession** → a primitive standing in for a concept that has its own rules deserves a type.
64
- - **Repeated Switches** → the same conditional logic scattered across call sites belongs behind one
65
- abstraction.
66
- - **Shotgun Surgery** → one conceptual change requiring edits across many unrelated places.
67
- - **Divergent Change** → one module changing for many unrelated reasons.
68
- - **Speculative Generality** → machinery built for a future need the node's contract doesn't ask for.
69
- - **Message Chains** → `a.b.c.d` reaching through several objects to get one value.
70
- - **Middle Man** → a class that only delegates, doing nothing of its own.
71
- - **Refused Bequest** → a subclass that doesn't want most of what it inherits.
37
+ overall" — go bullet by bullet, pass or fail each one individually, cite why. If a bullet names
38
+ something runnable (a command, a specific test file), run just that rather than taking the diff's
39
+ word for it — but never the whole suite; that's the end-of-feature audit's job.
40
+ 3. **Does the diff duplicate something the repo already has?** Search for an existing helper, utility,
41
+ type, or pattern that already does what this node just built. If the node's core deliverable already
42
+ exists, that's a fail — cite the code it should have reused. A partial overlap is an Issue citing
43
+ the canonical code.
72
44
 
73
45
  ## GIT DIFF
74
46
 
@@ -92,10 +64,14 @@ Lead with the acceptance checklist, one line per bullet:
92
64
  [fail] <criterion text> — <why>
93
65
  ```
94
66
 
67
+ For a duplication fail, the `[fail]` line names what was duplicated: `[fail] duplicates <existing code> —
68
+ <what should have been reused>`.
69
+
95
70
  Then, only if there are findings beyond acceptance: `Issue` or `Suggestion`, each with a `Priority`
96
71
  (`critical | high | medium | low`).
97
72
 
98
- Finish with one verdict line: `VERDICT: pass` only if every output field has a value matching its shape
99
- and every acceptance bullet passed — otherwise `VERDICT: fail`. A single failed acceptance bullet or an
100
- output shape mismatch is enough to fail the whole node, even if everything else is clean. The caller
101
- records each `[fail]` line's criterion as the review's failed criteria.
73
+ Finish with one verdict line: `VERDICT: pass` only if every output field has a value matching its shape,
74
+ every acceptance bullet passed, and the diff doesn't substantially duplicate existing repo code —
75
+ otherwise `VERDICT: fail`. A single failed acceptance bullet or an output shape mismatch is enough to
76
+ fail the whole node, even if everything else is clean. The caller records each `[fail]` line's criterion
77
+ as the review's failed criteria.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-gbuild",
4
- "version": "0.6.1",
4
+ "version": "0.6.2",
5
5
  "description": "OpenCode plugin for gbuild — graph-native task planning and execution with concurrent fan-out, per-node review, and durable checkpoints.",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -74,6 +74,9 @@ behavior this plugin replaces.
74
74
  2. **IMPLEMENT.** In one message, spawn one `Agent` per claimed node with its row. Tell it to:
75
75
  - actually do the work — for `code`/`test`/`chore` nodes make the change in the working tree (not
76
76
  describe it) and commit it, message `<feature>/<slug>: <what changed>`;
77
+ - before finishing, run the checks relevant to its change — anything the node's `acceptance` names,
78
+ and for `code`/`test` nodes the tests covering the files it touched — and leave them green. The
79
+ per-node review will not re-run these; the full suite runs in the end-of-feature audit;
77
80
  - produce a value for every output field: a scalar or a list of scalars, JSON-encoding anything
78
81
  nested into a string;
79
82
  - record its own UTC start and finish (`date -u +%Y-%m-%dT%H:%M:%SZ`) and end its final message with