@brainbase-labs/cli 0.19.0 → 0.20.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/README.md +62 -0
- package/dist/index.js +2067 -108
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,68 @@ brainbase task create --message "Review this project and propose next steps"
|
|
|
26
26
|
|
|
27
27
|
Run `brainbase help` to see every command.
|
|
28
28
|
|
|
29
|
+
## Benchmark runtime commands
|
|
30
|
+
|
|
31
|
+
Managed benchmark workers invoke two machine-only commands inside the same
|
|
32
|
+
sandbox as the agent task:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
brainbase benchmark hydrate --spec /path/to/hydrate.json --result /path/to/result.json --json
|
|
36
|
+
brainbase benchmark evaluate --spec /path/to/evaluate.json --result /path/to/result.json --json
|
|
37
|
+
brainbase benchmark capabilities --json
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The CLI executes local, versioned phase specifications. It does not claim work,
|
|
41
|
+
authorize users, or persist benchmark database state. The capabilities response
|
|
42
|
+
advertises both the CLI version and supported phase schema versions.
|
|
43
|
+
|
|
44
|
+
Both specs use `schema_version: "1"`, an `attempt_id`, a stable `phase_id`,
|
|
45
|
+
absolute workspace/staging/log paths, and a phase budget. Staging must be:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
<workspace>/.brainbase/benchmark/<attempt_id>/incoming
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Phase log/test roots must be absent, empty, or carry the CLI's matching
|
|
52
|
+
attempt/phase ownership marker; the CLI never recursively clears an unowned
|
|
53
|
+
non-empty directory.
|
|
54
|
+
|
|
55
|
+
Hydration verifies every staged size and SHA-256 before copying a file or
|
|
56
|
+
safely extracting a gzip tar into the candidate workspace. `.brainbase`, `.git`,
|
|
57
|
+
and `brainbase.agent.yaml` are reserved. Setup commands use argv arrays, bounded
|
|
58
|
+
time/output, an allowlisted base environment, literal values explicitly marked
|
|
59
|
+
`sensitive: false`, and only command-selected secret environment variables from
|
|
60
|
+
the spec's declared bindings. Expected answers and evaluator definitions are
|
|
61
|
+
not valid hydrate fields.
|
|
62
|
+
|
|
63
|
+
Evaluation starts only after MAS has ended the agent turn and staged a separate
|
|
64
|
+
evaluation spec. It verifies final-output, trajectory, reference, and evaluator
|
|
65
|
+
bundle digests; writes a pre-evaluation workspace manifest; preserves declared
|
|
66
|
+
candidate artifacts; optionally creates a candidate archive; then materializes
|
|
67
|
+
hidden references outside the candidate workspace and runs evaluators
|
|
68
|
+
synchronously. Schema v1 supports:
|
|
69
|
+
|
|
70
|
+
- `output_assertion`: exact, contains, or regex checks over final output.
|
|
71
|
+
- `trajectory_assertion`: bounded counts of canonical event types.
|
|
72
|
+
- `workspace_assertion`: file existence, absence, SHA-256, or content checks.
|
|
73
|
+
- `sandbox_command`: a bounded argv command rooted in the workspace or hidden
|
|
74
|
+
tests directory. Exit zero passes; any other exit code is a valid failed
|
|
75
|
+
verdict. Schema v1 allows one command evaluator and runs it after all
|
|
76
|
+
read-only assertions so evaluator mutations cannot change candidate verdicts.
|
|
77
|
+
|
|
78
|
+
Valid failed verdicts still produce a successful evaluation phase. Invalid
|
|
79
|
+
specs, digest/path violations, missing environment, launch failures, timeouts,
|
|
80
|
+
and output-budget violations fail the phase. Results are written atomically
|
|
81
|
+
with mode `0600`, include the raw spec digest and checksummed evidence/log
|
|
82
|
+
input/output references with explicit `staging`, `workspace`, `tests`, or
|
|
83
|
+
`logs` roots, redact declared secret values from command logs, require the
|
|
84
|
+
result path to be `<logs_root>/result.json`, and treat a matching successful
|
|
85
|
+
phase result as authoritative on replay.
|
|
86
|
+
|
|
87
|
+
On any phase-level execution failure, MAS must tear down the task sandbox. The
|
|
88
|
+
CLI kills the command process group and descendants it can observe, but the
|
|
89
|
+
runtime lifecycle remains the final cleanup boundary for daemonized processes.
|
|
90
|
+
|
|
29
91
|
## Development
|
|
30
92
|
|
|
31
93
|
Use Bun 1.3.10 when building this repository. The generated
|