opencode-dev-framework 0.5.0 → 1.0.0

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/dist/types.d.ts CHANGED
@@ -18,6 +18,19 @@ export interface CommandsConfig {
18
18
  lint?: CommandMap;
19
19
  test_changed?: string;
20
20
  }
21
+ /**
22
+ * A named project-specific acceptance check, run by the gate after the
23
+ * built-in steps. Sequential in declaration order; every step runs even
24
+ * when an earlier one fails (same aggregation as the rest of `runGate`).
25
+ */
26
+ export interface AcceptanceCheck {
27
+ /** Unique, non-empty step name. Reported as `acceptance:<name>`. */
28
+ name: string;
29
+ /** Command template. Supports the same `{files}` substitution as tests. */
30
+ command: string;
31
+ /** Per-check timeout in seconds. Falls back to `gate.timeout`, then default. */
32
+ timeout?: number;
33
+ }
21
34
  export interface GateConfig {
22
35
  run_typecheck: boolean;
23
36
  run_tests: boolean;
@@ -34,6 +47,11 @@ export interface GateConfig {
34
47
  * also produce a peer-review artifact before the completion gate passes.
35
48
  */
36
49
  require_review: boolean;
50
+ /**
51
+ * Named project-specific acceptance checks (`acceptance:<name>` steps).
52
+ * Empty by default; run after the built-in gate steps, sequentially.
53
+ */
54
+ acceptance: AcceptanceCheck[];
37
55
  /** Per-command timeout in seconds. */
38
56
  timeout?: number;
39
57
  /** Maximum number of times a failing gate may re-block before standing down. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-dev-framework",
3
- "version": "0.5.0",
3
+ "version": "1.0.0",
4
4
  "description": "OpenCode plugin that enforces project-specific quality gates during AI coding sessions",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,6 +29,12 @@ A task is done only when:
29
29
  - The change matches existing patterns in the surrounding code (see
30
30
  `20-match-existing-patterns`).
31
31
  - A peer-review pass found no blocking issues (see `40-delegation`).
32
+ - If the task came from a written plan, you re-read the plan and verified every
33
+ requirement was implemented — fix gaps rather than declaring success.
34
+ - Any required review artifact describes THIS session's changes. Never reuse a
35
+ review file left over from a previous task; rewrite it fresh every time.
36
+ - You ran the project's full verification yourself (not just the completion
37
+ gate) and read the output — the gate is a backstop, not your test run.
32
38
 
33
39
  If you cannot meet the bar, stop and tell the user what is blocking you rather than
34
40
  declaring success.
@@ -15,7 +15,12 @@ plausible-sounding assertions. Running code is the source of truth.
15
15
  concrete command), then fix it, then show the same check now passes.
16
16
  4. **Run the narrowest useful check often, the full suite before done.** Iterate with
17
17
  targeted tests for speed; the completion gate will run the broader suite.
18
- 5. **Read the actual output.** Don't pattern-match on exit codes — read failures and
18
+ Do not treat the gate as your test run — run the full verification yourself
19
+ before finishing, and read the output.
20
+ 5. **A stale PASS is not evidence.** Any further product edit after a passing run
21
+ invalidates it. Re-run the checks on the final tree; never present an earlier
22
+ PASS as covering later changes.
23
+ 6. **Read the actual output.** Don't pattern-match on exit codes — read failures and
19
24
  address the real cause. Treat a flaky or skipped test as a finding, not a pass.
20
25
 
21
26
  ## Use existing tooling only
@@ -37,7 +37,14 @@ before completion.
37
37
  3. **After a batch of edits** → `style-enforcer` on the changed files.
38
38
  4. **Before declaring done** → `test-grounder` (evidence) and a final
39
39
  `pattern-guardian` / review pass; resolve every blocking item.
40
-
40
+ 5. **Write the review artifact fresh, every task.** When the completion gate
41
+ requires a review file, rewrite it for THIS session's changes — scope,
42
+ findings, and resolutions. A file left over from a previous task never
43
+ counts, even if it exists and is non-empty.
44
+
45
+ This cadence is the default working loop, not an opt-in. For a non-trivial
46
+ change you plan first, implement from the plan without expanding scope, then
47
+ harden (full verification + review + fresh artifact) before declaring done.
41
48
  Keep delegation proportional: a one-line fix doesn't need the full loop; a new module
42
49
  does. Use judgment, but never skip the test-grounding and review steps for behavioral
43
50
  changes. If the specialist agents are not installed in this project, perform the same
package/tui.tsx CHANGED
@@ -4,7 +4,8 @@ import { Plugin } from "@opencode/plugin/tui";
4
4
  import { changeProfile, verifyGate } from "./dist/commands.js";
5
5
  import { loadConfig } from "./dist/config.js";
6
6
  import { runCommand } from "./dist/host.js";
7
- import { renderConfigStatus, renderHelp } from "./dist/format-status.js";
7
+ import { renderConfigStatus, renderHelp, renderRuntimeStatus } from "./dist/format-status.js";
8
+ import { readRuntimeStatus } from "./dist/runtime-status.js";
8
9
  import type { Profile } from "./dist/types.js";
9
10
 
10
11
  const PROFILES: Profile[] = ["off", "advisory", "standard", "strict"];
@@ -39,10 +40,17 @@ export default Plugin.define({
39
40
  run: () => {
40
41
  const dir = getDirectory();
41
42
  const config = loadConfig(dir);
42
- void ctx.ui.dialog.alert({
43
+ // The dialog title already carries the heading; drop the
44
+ // duplicated first line from the shared text renderer.
45
+ const message = renderConfigStatus(config).split("\n").slice(2).join("\n");
46
+ const shown = ctx.ui.dialog.alert({
43
47
  title: "opencode-dev-framework status",
44
- message: renderConfigStatus(config),
48
+ message,
45
49
  });
50
+ // Presentation is core-owned (alert takes no layout opts);
51
+ // large+centered is the available lever for long content.
52
+ ctx.ui.dialog.set({ size: "large", centered: true });
53
+ void shown;
46
54
  },
47
55
  },
48
56
  {
@@ -92,6 +100,24 @@ export default Plugin.define({
92
100
  }
93
101
  },
94
102
  },
103
+ {
104
+ id: "df-runtime",
105
+ title: "dev-framework runtime",
106
+ description: "Show plugin version and live hook/gate runtime state",
107
+ group: "dev-framework",
108
+ palette: true,
109
+ slash: { name: "df-runtime" },
110
+ run: async () => {
111
+ const dir = getDirectory();
112
+ const snapshot = await readRuntimeStatus(dir);
113
+ const shown = ctx.ui.dialog.alert({
114
+ title: "dev-framework runtime",
115
+ message: renderRuntimeStatus(snapshot),
116
+ });
117
+ ctx.ui.dialog.set({ size: "large", centered: true });
118
+ await shown;
119
+ },
120
+ },
95
121
  {
96
122
  id: "df-verify",
97
123
  title: "dev-framework verify",
@@ -103,10 +129,12 @@ export default Plugin.define({
103
129
  const dir = getDirectory();
104
130
  const config = loadConfig(dir);
105
131
  const { summary, report } = await verifyGate(runCommand, dir, config);
106
- await ctx.ui.dialog.alert({
132
+ const shown = ctx.ui.dialog.alert({
107
133
  title: report.ok ? "dev-framework gate passed" : "dev-framework gate failed",
108
134
  message: summary,
109
135
  });
136
+ ctx.ui.dialog.set({ size: "large", centered: true });
137
+ await shown;
110
138
  ctx.ui.toast.show({ message: summary, variant: report.ok ? "success" : "error" });
111
139
  },
112
140
  },