@grainulation/wheat 1.0.3 → 1.0.4
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/LICENSE +1 -1
- package/README.md +32 -31
- package/bin/wheat.js +47 -36
- package/compiler/detect-sprints.js +108 -66
- package/compiler/generate-manifest.js +116 -69
- package/compiler/wheat-compiler.js +763 -471
- package/lib/compiler.js +11 -6
- package/lib/connect.js +273 -134
- package/lib/disconnect.js +61 -40
- package/lib/guard.js +20 -17
- package/lib/index.js +8 -8
- package/lib/init.js +217 -142
- package/lib/install-prompt.js +26 -26
- package/lib/load-claims.js +88 -0
- package/lib/quickstart.js +225 -111
- package/lib/serve-mcp.js +495 -180
- package/lib/server.js +198 -111
- package/lib/stats.js +65 -39
- package/lib/status.js +65 -34
- package/lib/update.js +13 -11
- package/package.json +8 -4
- package/templates/claude.md +31 -17
- package/templates/commands/blind-spot.md +9 -2
- package/templates/commands/brief.md +11 -1
- package/templates/commands/calibrate.md +3 -1
- package/templates/commands/challenge.md +4 -1
- package/templates/commands/connect.md +12 -1
- package/templates/commands/evaluate.md +4 -0
- package/templates/commands/feedback.md +3 -1
- package/templates/commands/handoff.md +11 -7
- package/templates/commands/init.md +4 -1
- package/templates/commands/merge.md +4 -1
- package/templates/commands/next.md +1 -0
- package/templates/commands/present.md +3 -0
- package/templates/commands/prototype.md +2 -0
- package/templates/commands/pull.md +103 -0
- package/templates/commands/replay.md +8 -0
- package/templates/commands/research.md +1 -0
- package/templates/commands/resolve.md +4 -1
- package/templates/commands/status.md +4 -0
- package/templates/commands/sync.md +94 -0
- package/templates/commands/witness.md +6 -2
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://www.npmjs.com/package/@grainulation/wheat"><img src="https://img.shields.io/npm/v/@grainulation/wheat" alt="npm version"></a> <a href="https://www.npmjs.com/package/@grainulation/wheat"><img src="https://img.shields.io/npm/dm/@grainulation/wheat" alt="npm downloads"></a> <a href="https://github.com/grainulation/wheat/blob/main/LICENSE"><img src="https://img.shields.io/
|
|
6
|
+
<a href="https://www.npmjs.com/package/@grainulation/wheat"><img src="https://img.shields.io/npm/v/@grainulation/wheat" alt="npm version"></a> <a href="https://www.npmjs.com/package/@grainulation/wheat"><img src="https://img.shields.io/npm/dm/@grainulation/wheat" alt="npm downloads"></a> <a href="https://github.com/grainulation/wheat/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license"></a> <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/@grainulation/wheat" alt="node"></a> <a href="https://github.com/grainulation/wheat/actions"><img src="https://github.com/grainulation/wheat/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
7
|
+
<a href="https://deepwiki.com/grainulation/wheat"><img src="https://deepwiki.com/badge.svg" alt="Explore on DeepWiki"></a>
|
|
7
8
|
</p>
|
|
8
9
|
|
|
9
10
|
<p align="center"><strong>CI/CD for technical decisions.</strong></p>
|
|
@@ -76,26 +77,26 @@ The compiler catches conflicts, warns about weak evidence, and blocks the build
|
|
|
76
77
|
|
|
77
78
|
## Commands
|
|
78
79
|
|
|
79
|
-
| Command
|
|
80
|
-
|
|
81
|
-
| `/init`
|
|
82
|
-
| `/research <topic>`
|
|
83
|
-
| `/prototype`
|
|
84
|
-
| `/challenge <id>`
|
|
85
|
-
| `/witness <id> <url>` | External corroboration
|
|
86
|
-
| `/blind-spot`
|
|
87
|
-
| `/status`
|
|
88
|
-
| `/brief`
|
|
89
|
-
| `/present`
|
|
90
|
-
| `/feedback`
|
|
91
|
-
| `/resolve`
|
|
92
|
-
| `/replay`
|
|
93
|
-
| `/calibrate`
|
|
94
|
-
| `/handoff`
|
|
95
|
-
| `/merge <path>`
|
|
96
|
-
| `/connect <type>`
|
|
97
|
-
| `/evaluate`
|
|
98
|
-
| `/next`
|
|
80
|
+
| Command | What it does |
|
|
81
|
+
| --------------------- | ------------------------------------------------- |
|
|
82
|
+
| `/init` | Bootstrap a new research sprint |
|
|
83
|
+
| `/research <topic>` | Deep dive on a topic, creates claims |
|
|
84
|
+
| `/prototype` | Build something testable |
|
|
85
|
+
| `/challenge <id>` | Adversarial stress-test of a claim |
|
|
86
|
+
| `/witness <id> <url>` | External corroboration |
|
|
87
|
+
| `/blind-spot` | Find gaps in your investigation |
|
|
88
|
+
| `/status` | Sprint dashboard |
|
|
89
|
+
| `/brief` | Compile the decision document |
|
|
90
|
+
| `/present` | Generate a stakeholder presentation |
|
|
91
|
+
| `/feedback` | Incorporate stakeholder input |
|
|
92
|
+
| `/resolve` | Adjudicate conflicts between claims |
|
|
93
|
+
| `/replay` | Time-travel through sprint history |
|
|
94
|
+
| `/calibrate` | Score predictions against actual outcomes |
|
|
95
|
+
| `/handoff` | Package sprint for knowledge transfer |
|
|
96
|
+
| `/merge <path>` | Combine findings across sprints |
|
|
97
|
+
| `/connect <type>` | Link external tools (Jira, docs, etc.) |
|
|
98
|
+
| `/evaluate` | Test claims against reality, resolve conflicts |
|
|
99
|
+
| `/next` | Route next steps through Farmer (mobile feedback) |
|
|
99
100
|
|
|
100
101
|
## Guard rails
|
|
101
102
|
|
|
@@ -116,16 +117,16 @@ Node built-in modules only. No npm install waterfall. No supply chain anxiety.
|
|
|
116
117
|
|
|
117
118
|
## Part of the grainulation ecosystem
|
|
118
119
|
|
|
119
|
-
| Tool
|
|
120
|
-
|
|
121
|
-
| **wheat**
|
|
122
|
-
| [farmer](https://github.com/grainulation/farmer)
|
|
123
|
-
| [barn](https://github.com/grainulation/barn)
|
|
124
|
-
| [mill](https://github.com/grainulation/mill)
|
|
125
|
-
| [silo](https://github.com/grainulation/silo)
|
|
126
|
-
| [harvest](https://github.com/grainulation/harvest)
|
|
127
|
-
| [orchard](https://github.com/grainulation/orchard)
|
|
128
|
-
| [grainulation](https://github.com/grainulation/grainulation) | Unified CLI -- single entry point to the ecosystem
|
|
120
|
+
| Tool | Role |
|
|
121
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
122
|
+
| **wheat** | Research engine -- grow structured evidence |
|
|
123
|
+
| [farmer](https://github.com/grainulation/farmer) | Permission dashboard -- approve AI actions in real time (admin + viewer roles) |
|
|
124
|
+
| [barn](https://github.com/grainulation/barn) | Shared tools -- templates, validators, sprint detection |
|
|
125
|
+
| [mill](https://github.com/grainulation/mill) | Format conversion -- export to PDF, CSV, slides, 24 formats |
|
|
126
|
+
| [silo](https://github.com/grainulation/silo) | Knowledge storage -- reusable claim libraries and packs |
|
|
127
|
+
| [harvest](https://github.com/grainulation/harvest) | Analytics -- cross-sprint patterns and prediction scoring |
|
|
128
|
+
| [orchard](https://github.com/grainulation/orchard) | Orchestration -- multi-sprint coordination and dependencies |
|
|
129
|
+
| [grainulation](https://github.com/grainulation/grainulation) | Unified CLI -- single entry point to the ecosystem |
|
|
129
130
|
|
|
130
131
|
## License
|
|
131
132
|
|
package/bin/wheat.js
CHANGED
|
@@ -19,34 +19,40 @@
|
|
|
19
19
|
* Zero npm dependencies.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import path from
|
|
23
|
-
import { readFileSync } from
|
|
24
|
-
import { fileURLToPath } from
|
|
25
|
-
import {
|
|
22
|
+
import path from "path";
|
|
23
|
+
import { readFileSync } from "fs";
|
|
24
|
+
import { fileURLToPath } from "url";
|
|
25
|
+
import {
|
|
26
|
+
track as trackInstall,
|
|
27
|
+
maybePrompt as installPrompt,
|
|
28
|
+
} from "../lib/install-prompt.js";
|
|
26
29
|
|
|
27
30
|
const __filename = fileURLToPath(import.meta.url);
|
|
28
31
|
const __dirname = path.dirname(__filename);
|
|
29
32
|
|
|
30
|
-
const VERSION = JSON.parse(
|
|
33
|
+
const VERSION = JSON.parse(
|
|
34
|
+
readFileSync(path.join(__dirname, "..", "package.json"), "utf8")
|
|
35
|
+
).version;
|
|
31
36
|
|
|
32
37
|
// ─── Parse arguments ─────────────────────────────────────────────────────────
|
|
33
38
|
|
|
34
|
-
const verbose = process.argv.includes(
|
|
39
|
+
const verbose = process.argv.includes("--verbose");
|
|
35
40
|
function vlog(...a) {
|
|
36
41
|
if (!verbose) return;
|
|
37
42
|
const ts = new Date().toISOString();
|
|
38
|
-
process.stderr.write(`[${ts}] wheat: ${a.join(
|
|
43
|
+
process.stderr.write(`[${ts}] wheat: ${a.join(" ")}\n`);
|
|
39
44
|
}
|
|
40
45
|
export { vlog, verbose };
|
|
41
46
|
|
|
42
47
|
const args = process.argv.slice(2);
|
|
43
48
|
const subcommand = args[0];
|
|
44
49
|
|
|
45
|
-
vlog(
|
|
50
|
+
vlog("startup", `subcommand=${subcommand || "(none)"}`, `cwd=${process.cwd()}`);
|
|
46
51
|
|
|
47
52
|
// Extract --dir or --root flag (applies to all subcommands)
|
|
48
53
|
let targetDir = process.cwd();
|
|
49
|
-
const dirIdx =
|
|
54
|
+
const dirIdx =
|
|
55
|
+
args.indexOf("--dir") !== -1 ? args.indexOf("--dir") : args.indexOf("--root");
|
|
50
56
|
if (dirIdx !== -1 && args[dirIdx + 1]) {
|
|
51
57
|
targetDir = path.resolve(args[dirIdx + 1]);
|
|
52
58
|
args.splice(dirIdx, 2);
|
|
@@ -57,7 +63,7 @@ const subArgs = args.slice(1);
|
|
|
57
63
|
|
|
58
64
|
// ─── Help / Version ──────────────────────────────────────────────────────────
|
|
59
65
|
|
|
60
|
-
if (!subcommand || subcommand ===
|
|
66
|
+
if (!subcommand || subcommand === "--help" || subcommand === "-h") {
|
|
61
67
|
console.log(`wheat v${VERSION} — Research-driven development framework
|
|
62
68
|
|
|
63
69
|
Usage:
|
|
@@ -94,7 +100,7 @@ Documentation: https://github.com/grainulation/wheat`);
|
|
|
94
100
|
process.exit(0);
|
|
95
101
|
}
|
|
96
102
|
|
|
97
|
-
if (subcommand ===
|
|
103
|
+
if (subcommand === "--version" || subcommand === "-v") {
|
|
98
104
|
console.log(`wheat v${VERSION}`);
|
|
99
105
|
process.exit(0);
|
|
100
106
|
}
|
|
@@ -109,28 +115,27 @@ installPrompt(subcommand);
|
|
|
109
115
|
// ─── Dispatch ────────────────────────────────────────────────────────────────
|
|
110
116
|
|
|
111
117
|
const commands = {
|
|
112
|
-
init:
|
|
113
|
-
quickstart:
|
|
114
|
-
compile:
|
|
115
|
-
guard:
|
|
116
|
-
status:
|
|
117
|
-
stats:
|
|
118
|
-
update:
|
|
119
|
-
serve:
|
|
120
|
-
mcp:
|
|
118
|
+
init: "../lib/init.js",
|
|
119
|
+
quickstart: "../lib/quickstart.js",
|
|
120
|
+
compile: "../lib/compiler.js",
|
|
121
|
+
guard: "../lib/guard.js",
|
|
122
|
+
status: "../lib/status.js",
|
|
123
|
+
stats: "../lib/stats.js",
|
|
124
|
+
update: "../lib/update.js",
|
|
125
|
+
serve: "../lib/server.js",
|
|
126
|
+
mcp: "../lib/serve-mcp.js",
|
|
121
127
|
};
|
|
122
128
|
|
|
123
129
|
// ─── wheat migrate (not yet implemented) ────────────────────────────────────
|
|
124
|
-
if (subcommand ===
|
|
125
|
-
console.error(
|
|
130
|
+
if (subcommand === "migrate") {
|
|
131
|
+
console.error("wheat migrate is not yet available");
|
|
126
132
|
process.exit(1);
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
|
|
130
135
|
// Handle "wheat connect <target>" as a compound subcommand
|
|
131
|
-
if (subcommand ===
|
|
136
|
+
if (subcommand === "connect") {
|
|
132
137
|
const target = subArgs[0];
|
|
133
|
-
if (!target || target ===
|
|
138
|
+
if (!target || target === "--help" || target === "-h") {
|
|
134
139
|
console.log(`wheat connect — Link external tools
|
|
135
140
|
|
|
136
141
|
Usage:
|
|
@@ -139,9 +144,11 @@ Usage:
|
|
|
139
144
|
Run "wheat connect farmer --help" for options.`);
|
|
140
145
|
process.exit(0);
|
|
141
146
|
}
|
|
142
|
-
if (target ===
|
|
143
|
-
const connectModule = await import(
|
|
144
|
-
|
|
147
|
+
if (target === "farmer") {
|
|
148
|
+
const connectModule = await import(
|
|
149
|
+
new URL("../lib/connect.js", import.meta.url).href
|
|
150
|
+
);
|
|
151
|
+
await connectModule.run(targetDir, subArgs.slice(1)).catch((err) => {
|
|
145
152
|
console.error(`\nwheat connect farmer failed:`, err.message);
|
|
146
153
|
if (process.env.WHEAT_DEBUG) console.error(err.stack);
|
|
147
154
|
process.exit(1);
|
|
@@ -153,9 +160,9 @@ Run "wheat connect farmer --help" for options.`);
|
|
|
153
160
|
}
|
|
154
161
|
|
|
155
162
|
// Handle "wheat disconnect <target>" as a compound subcommand
|
|
156
|
-
if (subcommand ===
|
|
163
|
+
if (subcommand === "disconnect") {
|
|
157
164
|
const target = subArgs[0];
|
|
158
|
-
if (!target || target ===
|
|
165
|
+
if (!target || target === "--help" || target === "-h") {
|
|
159
166
|
console.log(`wheat disconnect — Remove external tool hooks
|
|
160
167
|
|
|
161
168
|
Usage:
|
|
@@ -164,16 +171,20 @@ Usage:
|
|
|
164
171
|
Run "wheat disconnect farmer --help" for options.`);
|
|
165
172
|
process.exit(0);
|
|
166
173
|
}
|
|
167
|
-
if (target ===
|
|
168
|
-
const disconnectModule = await import(
|
|
169
|
-
|
|
174
|
+
if (target === "farmer") {
|
|
175
|
+
const disconnectModule = await import(
|
|
176
|
+
new URL("../lib/disconnect.js", import.meta.url).href
|
|
177
|
+
);
|
|
178
|
+
await disconnectModule.run(targetDir, subArgs.slice(1)).catch((err) => {
|
|
170
179
|
console.error(`\nwheat disconnect farmer failed:`, err.message);
|
|
171
180
|
if (process.env.WHEAT_DEBUG) console.error(err.stack);
|
|
172
181
|
process.exit(1);
|
|
173
182
|
});
|
|
174
183
|
process.exit(0);
|
|
175
184
|
}
|
|
176
|
-
console.error(
|
|
185
|
+
console.error(
|
|
186
|
+
`wheat: unknown disconnect target: ${target}\nAvailable: farmer`
|
|
187
|
+
);
|
|
177
188
|
process.exit(1);
|
|
178
189
|
}
|
|
179
190
|
|
|
@@ -184,10 +195,10 @@ if (!commands[subcommand]) {
|
|
|
184
195
|
}
|
|
185
196
|
|
|
186
197
|
// Load and run the subcommand module
|
|
187
|
-
vlog(
|
|
198
|
+
vlog("dispatch", `loading module for "${subcommand}"`);
|
|
188
199
|
const modulePath = new URL(commands[subcommand], import.meta.url).href;
|
|
189
200
|
const handler = await import(modulePath);
|
|
190
|
-
handler.run(targetDir, subArgs).catch(err => {
|
|
201
|
+
handler.run(targetDir, subArgs).catch((err) => {
|
|
191
202
|
console.error(`\nwheat ${subcommand} failed:`, err.message);
|
|
192
203
|
if (process.env.WHEAT_DEBUG) console.error(err.stack);
|
|
193
204
|
process.exit(1);
|