opencode-dev-framework 1.9.4 → 1.10.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.
Files changed (71) hide show
  1. package/README.md +137 -33
  2. package/bin/df +94 -4
  3. package/cordis.patch.yml +17 -0
  4. package/dist/adapters/dsh/extract.d.ts +47 -0
  5. package/dist/adapters/dsh/extract.js +62 -0
  6. package/dist/adapters/dsh/index.d.ts +332 -0
  7. package/dist/adapters/dsh/index.js +1643 -0
  8. package/dist/adapters/opencode/index.d.ts +30 -0
  9. package/dist/{index.js → adapters/opencode/index.js} +138 -251
  10. package/dist/{block-store.d.ts → core/block-store.d.ts} +10 -3
  11. package/dist/{commands.js → core/commands.js} +4 -2
  12. package/dist/{config.d.ts → core/config.d.ts} +16 -4
  13. package/dist/{config.js → core/config.js} +102 -10
  14. package/dist/{format-status.d.ts → core/format-status.d.ts} +13 -2
  15. package/dist/{format-status.js → core/format-status.js} +30 -7
  16. package/dist/{gate.d.ts → core/gate.d.ts} +9 -1
  17. package/dist/{gate.js → core/gate.js} +14 -2
  18. package/dist/{goal.d.ts → core/goal.d.ts} +4 -3
  19. package/dist/{goal.js → core/goal.js} +4 -3
  20. package/dist/{harness.d.ts → core/harness.d.ts} +10 -5
  21. package/dist/{harness.js → core/harness.js} +119 -32
  22. package/dist/{init.d.ts → core/init.d.ts} +18 -1
  23. package/dist/{init.js → core/init.js} +33 -8
  24. package/dist/core/install-dsh.d.ts +67 -0
  25. package/dist/core/install-dsh.js +235 -0
  26. package/dist/{installer.d.ts → core/installer.d.ts} +32 -2
  27. package/dist/{installer.js → core/installer.js} +129 -12
  28. package/dist/{lint.d.ts → core/lint.d.ts} +43 -2
  29. package/dist/{lint.js → core/lint.js} +89 -2
  30. package/dist/{logger.js → core/logger.js} +30 -1
  31. package/dist/core/paths.d.ts +35 -0
  32. package/dist/core/paths.js +41 -0
  33. package/dist/{protect.d.ts → core/protect.d.ts} +18 -4
  34. package/dist/{protect.js → core/protect.js} +85 -34
  35. package/dist/{registry.d.ts → core/registry.d.ts} +36 -15
  36. package/dist/{registry.js → core/registry.js} +66 -52
  37. package/dist/{review.js → core/review.js} +18 -6
  38. package/dist/{rules.d.ts → core/rules.d.ts} +3 -2
  39. package/dist/{rules.js → core/rules.js} +21 -5
  40. package/dist/core/run-hooks.d.ts +138 -0
  41. package/dist/core/run-hooks.js +196 -0
  42. package/dist/{runtime-status.d.ts → core/runtime-status.d.ts} +5 -4
  43. package/dist/{runtime-status.js → core/runtime-status.js} +29 -17
  44. package/dist/{types.d.ts → core/types.d.ts} +17 -0
  45. package/dist/{update.d.ts → core/update.d.ts} +12 -4
  46. package/dist/{update.js → core/update.js} +28 -12
  47. package/dist/{weakening.js → core/weakening.js} +2 -1
  48. package/package.json +16 -6
  49. package/rules/40-delegation.md +13 -2
  50. package/templates/.opencode/agents/style-enforcer.md +1 -1
  51. package/templates/.opencode/agents/test-grounder.md +1 -1
  52. package/templates/.opencode/skills/ground-in-tests/SKILL.md +1 -1
  53. package/templates/.opencode/skills/peer-review/SKILL.md +6 -1
  54. package/templates/.opencode/skills/project-config/SKILL.md +2 -2
  55. package/tui.tsx +6 -6
  56. package/dist/index.d.ts +0 -101
  57. /package/dist/{block-store.js → core/block-store.js} +0 -0
  58. /package/dist/{command-utils.d.ts → core/command-utils.d.ts} +0 -0
  59. /package/dist/{command-utils.js → core/command-utils.js} +0 -0
  60. /package/dist/{commands.d.ts → core/commands.d.ts} +0 -0
  61. /package/dist/{detect.d.ts → core/detect.d.ts} +0 -0
  62. /package/dist/{detect.js → core/detect.js} +0 -0
  63. /package/dist/{host.d.ts → core/host.d.ts} +0 -0
  64. /package/dist/{host.js → core/host.js} +0 -0
  65. /package/dist/{logger.d.ts → core/logger.d.ts} +0 -0
  66. /package/dist/{review.d.ts → core/review.d.ts} +0 -0
  67. /package/dist/{roster.d.ts → core/roster.d.ts} +0 -0
  68. /package/dist/{roster.js → core/roster.js} +0 -0
  69. /package/dist/{types.js → core/types.js} +0 -0
  70. /package/dist/{weakening.d.ts → core/weakening.d.ts} +0 -0
  71. /package/templates/{.opencode/opencode-dev-framework → .dev-framework}/rules/.gitkeep +0 -0
@@ -18,7 +18,7 @@ you're about to make a claim about behavior you have not actually executed.
18
18
 
19
19
  ## Steps
20
20
 
21
- 1. **Discover the commands.** Prefer `.opencode-dev-framework.yml`
21
+ 1. **Discover the commands.** Prefer `.dev-framework.yml`
22
22
  (`commands.test`, `commands.typecheck`). Else detect from the project
23
23
  (`package.json` scripts, `pytest`, `go test ./...`, `cargo test`,
24
24
  `Makefile`). If the project genuinely has no tests, say so explicitly and
@@ -37,7 +37,12 @@ to write the review file.
37
37
 
38
38
  If there is nothing to review, say so and stop.
39
39
 
40
- 2. **Run the specialists in parallel.** Delegate each as a subagent, giving
40
+ Docs-only changes (no product code) skip the battery: run
41
+ `npm run lint:md` on the changed files and record scope plus result
42
+ in the review artifact. That is the entire docs cadence.
43
+
44
+ 2. **Run the specialists in parallel (product code only).** For docs-only
45
+ changes, see the carve-out above — no battery. Delegate each as a subagent, giving
41
46
  each the diff scope and the relevant file paths:
42
47
  - **pattern-guardian** — duplication, re-invented helpers, divergent
43
48
  conventions, a second way to do a thing, unjustified new dependencies.
@@ -15,7 +15,7 @@ build system, not guessed. You propose; the user disposes.
15
15
  ## When to use
16
16
 
17
17
  Setting up the plugin on a project for the first time, instead of
18
- hand-writing `.opencode-dev-framework.yml` or trusting `df init`
18
+ hand-writing `.dev-framework.yml` or trusting `df init`
19
19
  detection alone. Also when the existing config smells wrong — gate
20
20
  passing vacuously, commands that don't match CI, a red tree nobody can
21
21
  explain.
@@ -87,7 +87,7 @@ list assumptions.
87
87
 
88
88
  ## Output
89
89
 
90
- + The proposed `.opencode-dev-framework.yml` and `hardening.md` content
90
+ + The proposed `.dev-framework.yml` and `.dev-framework/hardening.md` content
91
91
  as a reviewable diff, each command annotated verified-by-running,
92
92
  inferred-from-files, or needs-confirmation.
93
93
  + The enforceability self-check result (blocking profile + at least one
package/tui.tsx CHANGED
@@ -1,12 +1,12 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
2
 
3
3
  import { Plugin } from "@opencode/plugin/tui";
4
- import { changeProfile, verifyGate } from "./dist/commands.js";
5
- import { loadConfig } from "./dist/config.js";
6
- import { runCommand } from "./dist/host.js";
7
- import { renderConfigStatus, renderHelp, renderRuntimeStatus } from "./dist/format-status.js";
8
- import { readRuntimeStatus } from "./dist/runtime-status.js";
9
- import type { Profile } from "./dist/types.js";
4
+ import { changeProfile, verifyGate } from "./dist/core/commands.js";
5
+ import { loadConfig } from "./dist/core/config.js";
6
+ import { runCommand } from "./dist/core/host.js";
7
+ import { renderConfigStatus, renderHelp, renderRuntimeStatus } from "./dist/core/format-status.js";
8
+ import { readRuntimeStatus } from "./dist/core/runtime-status.js";
9
+ import type { Profile } from "./dist/core/types.js";
10
10
 
11
11
  const PROFILES: Profile[] = ["off", "advisory", "standard", "strict"];
12
12
 
package/dist/index.d.ts DELETED
@@ -1,101 +0,0 @@
1
- /**
2
- * opencode-dev-framework V2 plugin entry point.
3
- *
4
- * V2 framework (opencode v2): Plugin.define({ id, setup(ctx) })
5
- * - ctx.session.hook("context"/"generate"/"compaction"/"title", ...) -> constitution injection
6
- * - ctx.permission.hook("evaluate", ...) -> native permission layer (Phase 25;
7
- * observe-only spike in 25.1, enforcing mapper from 25.2)
8
- * - ctx.tool.hook("execute.before", ...) -> guardrails (backstop from Phase 25)
9
- * - ctx.tool.hook("execute.after", ...) -> per-edit lint + change tracking
10
- * (`filesystem.changed` stays as a fallback this release; see Phase 24)
11
- * - ctx.event.subscribe() -> file tracking + gate enforcement via re-prompt
12
- * - ctx.tool.transform(...) -> custom tools
13
- * - ctx.command.transform(...) -> server-side `/df-goal` verified-goal
14
- * wrapper (thin adapter delegating to native `/goal`; see src/goal.ts)
15
- * - ctx.command.transform(...) -> server-side `/df-init` project setup
16
- * (deterministic scaffold in code, handoff back via session.prompt;
17
- * see src/init.ts)
18
- * - ctx.command.transform(...) -> server-side `/df-update` template drift
19
- * check (detection only, handoff back via session.prompt; see src/update.ts)
20
- *
21
- * Gate enforcement: no synchronous pre-stop veto. On `experimental.idle`
22
- * (same execution) we run the gate and if it fails inside budget we admit
23
- * `ctx.session.synthetic({ sessionID, text: stoppingMessage })` — the
24
- * continuation runs before the session goes idle (see
25
- * docs/plans/12-idle-hook-cutover.md). The `event.subscribe` idle net
26
- * stays as a deduped fallback for the boundaries the hook skips.
27
- */
28
- import { Plugin } from "@opencode/plugin";
29
- import { type BlockStore, type StuckSnapshotStore } from "./block-store.js";
30
- import { type ChangedFileTracker } from "./gate.js";
31
- import { type PassCache } from "./harness.js";
32
- import { type RunCommand } from "./host.js";
33
- import { type LintLimiter } from "./lint.js";
34
- import { type LogFn } from "./logger.js";
35
- import type { ResolvedConfig } from "./types.js";
36
- import { type EnforceableSnapshot } from "./weakening.js";
37
- export interface HookState {
38
- directory: string;
39
- config: ResolvedConfig;
40
- /**
41
- * Session-start enforceable snapshot (plan 17 §2). Compared against the
42
- * live config at every gate evaluation so mid-session duty reductions
43
- * surface in the verdict. Never re-baselined — including across
44
- * `set_profile` — so a profile downgrade reads as the weakening it is.
45
- */
46
- initialEnforceable: EnforceableSnapshot;
47
- log: LogFn;
48
- run: RunCommand;
49
- tracker: ChangedFileTracker;
50
- constitution: string | null;
51
- blockCounts: Map<string, number>;
52
- /**
53
- * Persistent block-count store over `ctx.storage`, write-through into
54
- * `blockCounts` (which stays the live L1 cache for status rendering).
55
- * Survives plugin reload / session_move / server restart.
56
- * Note: this `HookState` is intentionally forked from `registry.ts`
57
- * `HookState` (module state is per-location here, not registry-keyed);
58
- * `format-status.ts` reads the `blockCounts` Map projection, which the
59
- * store keeps live on every get/increment/clear.
60
- */
61
- blocks: BlockStore;
62
- /**
63
- * Last-blocked-evaluation snapshots for no-progress early stand-down
64
- * (docs/plans/14-stuck-detection.md). Same storage-backed, best-effort pattern as `blocks`;
65
- * memory-only here (no status projection needed).
66
- */
67
- stuckSnapshots: StuckSnapshotStore;
68
- precommitAvailable?: boolean;
69
- configMtime?: number;
70
- /**
71
- * Shared FIFO limiter bounding concurrent linter subprocesses across
72
- * per-edit lints and gate lint steps.
73
- */
74
- lintLimiter: LintLimiter;
75
- /** Fingerprint of the last clean gate pass; skips redundant suites. */
76
- passCache: PassCache;
77
- /**
78
- * `Date.now()` of the last config-mtime check. Hook fires are far more
79
- * frequent than config edits, so mtime stats are throttled to a 1s window.
80
- */
81
- lastConfigCheck: number;
82
- /**
83
- * Which lever completed a gate evaluation most recently in this process:
84
- * `"idle"` once the `experimental.idle` hook has (same-execution
85
- * continuation active), `"fallback"` when only the `event.subscribe`
86
- * idle re-prompt net has. Absent until either fires. Memory-only: a
87
- * reload re-derives it on the next idle boundary. `/df-status` renders
88
- * the active level.
89
- */
90
- continuationLevel?: "idle" | "fallback";
91
- /**
92
- * Dedup map for the idle-first cutover: sessionID → `Date.now()` at the
93
- * last COMPLETED hook evaluation (pass, blocked-admitted, and standdown
94
- * all stamp; throw/early-return do not). The `event.subscribe` idle net
95
- * skips when the stamp is fresh so one boundary never runs the gate
96
- * twice. Memory-only; worst case on reload is one extra suite run.
97
- */
98
- lastIdleHandled: Map<string, number>;
99
- }
100
- declare const plugin: Plugin.Plugin;
101
- export default plugin;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes