gcf-board 0.2.17 → 0.2.18
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
|
@@ -52,6 +52,7 @@ It puts **GCF Board** on the desktop (Windows: a shortcut whose server console s
|
|
|
52
52
|
- **Lessons** (core 0.7.10, harness 0.9.2): what got in an agent's way, asked at the end of each session, lands in the inbox with its kind (`tool`, `rules`, `framework`, `template`, `other`) and its item. The inbox filters them; a card shows `N lessons`, and the drawer lists the item's lessons with the inbox's buttons. A run's report line ends with `, N lessons`, and with `— code written outside aif-implement` when a session skipped that skill.
|
|
53
53
|
- **Playtest**: `gcf playtest session` with the checklist grouped by subsystem; keep, tune or kill each item from the list. **Build** runs `dod.build`. A note goes to the inbox as `--source playtest`.
|
|
54
54
|
- **Ended**: history (accepted) and graveyard (killed, dropped, won't-fix).
|
|
55
|
+
- **Metrics**: `gcf-harness metrics --json` of the project — how many runs reached submit or close, what they cost, handoffs, plan checks, DoD attempts, guard firings, block reasons — and, with harness 0.9.5, the cost per item over all its runs and per week and day.
|
|
55
56
|
|
|
56
57
|
The page updates by itself: the server watches each project's `gcf/` and `.gcf-session/runs/`.
|
|
57
58
|
|
package/dist/server/app.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// The board's HTTP server: the page, and an API that is a thin layer over `ai-factory gcf`.
|
|
2
|
-
// Reads: projects, the board, a shown file, a run log, the playtest session
|
|
2
|
+
// Reads: projects, the board, a shown file, a run log, the playtest session, the run metrics
|
|
3
|
+
// (`ai-factory gcf-harness metrics`). Writes: a project
|
|
3
4
|
// on the board, a move, a run. Every write is a command of the framework.
|
|
4
5
|
import { randomBytes } from 'node:crypto';
|
|
5
6
|
import { createServer } from 'node:http';
|
|
@@ -185,6 +186,14 @@ export function createApp(o) {
|
|
|
185
186
|
send(res, 200, jsonOf(r, 'gcf playtest session'));
|
|
186
187
|
},
|
|
187
188
|
],
|
|
189
|
+
[
|
|
190
|
+
'GET',
|
|
191
|
+
/^\/api\/p\/([^/]+)\/metrics$/,
|
|
192
|
+
async (_req, res, m) => {
|
|
193
|
+
const r = await cli(await projectOf(m[1]), ['gcf-harness', 'metrics', '--json']);
|
|
194
|
+
send(res, 200, jsonOf(r, 'gcf-harness metrics'));
|
|
195
|
+
},
|
|
196
|
+
],
|
|
188
197
|
[
|
|
189
198
|
// A build runs the project's own command: a write, so a POST with its Origin checked.
|
|
190
199
|
'POST',
|
package/dist/server/cli.js
CHANGED
|
@@ -43,11 +43,13 @@ function globalRoots() {
|
|
|
43
43
|
return roots;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* The
|
|
47
|
-
*
|
|
46
|
+
* The refusal an operator reads: the core throws, and node prints the stack under an
|
|
47
|
+
* `Error: <message>` header, every line of the message (a git failure's cause comes after its
|
|
48
|
+
* first line). Anything else is shown as it came.
|
|
48
49
|
*/
|
|
49
50
|
export function briefError(err) {
|
|
50
|
-
|
|
51
|
+
const m = err.match(/^\w*Error: ([\s\S]*?)\r?\n {4}at /m) ?? err.match(/^\w*Error: (.+)$/m);
|
|
52
|
+
return (m?.[1] ?? err).replace(/\r/g, '').trim();
|
|
51
53
|
}
|
|
52
54
|
/** Run `ai-factory <args>` in a project; a move can wait up to a minute on gcf's main lock. */
|
|
53
55
|
export function runCli(entry, cwd, args, timeoutMs = 120_000) {
|