@polderlabs/bizar 10.29.1 → 10.30.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/AGENTS.md +17 -15
- package/README.md +55 -93
- package/cli/bin.mjs +14 -1
- package/cli/commands/ao.mjs +212 -0
- package/cli/install/index.mjs +31 -2
- package/config/ao/worker-rules.md +22 -0
- package/config/claude/CLAUDE.md +17 -15
- package/config/claude/agents/office-manager.md +10 -0
- package/package.json +4 -2
- package/packages/sdk/dist/version.d.ts +1 -1
- package/packages/sdk/dist/version.js +1 -1
- package/packages/sdk/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# AGENTS.md — Bizar Harness
|
|
2
2
|
|
|
3
|
-
Bizar Harness is
|
|
3
|
+
Bizar Harness is an Agent Orchestrator (AO)-first, guarded-autonomy worker harness for Codex and Claude Code. AO owns multi-agent coordination, isolated worktrees, sessions, branches, PRs, review feedback, previews, and browser state; Bizar supplies repository policy, skills, hooks, CLI utilities, and verification. OpenKan remains a standalone planning, progression, task, and PRD-goal option through `.ok/` and its supported CLI boundary.
|
|
4
4
|
|
|
5
|
-
If
|
|
5
|
+
If `AO_SESSION_ID` or `AO_PROJECT_ID` is present, this is an AO worker session: inspect AO session context, run `make check` before changing code, and do not start a second team/worktree/task lifecycle. Otherwise, inspect `.ok/` with `ok task list` and `ok prd list`, then run `make check` before changing code.
|
|
6
6
|
|
|
7
7
|
## Commands
|
|
8
8
|
|
|
@@ -24,8 +24,9 @@ make session-end # lifecycle compatibility target
|
|
|
24
24
|
|
|
25
25
|
## Hard constraints
|
|
26
26
|
|
|
27
|
-
- **MUST**
|
|
28
|
-
- **MUST**
|
|
27
|
+
- **MUST** treat AO as the durable task, session, worktree, branch, PR, CI/review, preview, and browser authority when `AO_SESSION_ID` or `AO_PROJECT_ID` is present. Do not update `.ok/` from an AO worker unless the assigned task explicitly requires it and AO has serialized that shared-state operation.
|
|
28
|
+
- **MUST** keep the scoped OpenKan task current in standalone Bizar mode: claim before implementation, update status/evidence at each durable handoff, and complete only with verification evidence.
|
|
29
|
+
- **MUST** use OpenKan PRDs and plans for standalone Bizar durable goals and progression; `PROGRESS.md` and `feature_list.json` are legacy historical records, not live control state.
|
|
29
30
|
- **MUST** keep one logical operation per commit and keep its docs in the same commit.
|
|
30
31
|
- **MUST** run targeted tests, then `make check`; run `make e2e` for cross-component changes.
|
|
31
32
|
- **MUST** verify evidence before claiming completion.
|
|
@@ -50,6 +51,8 @@ force a resolution you do not understand.
|
|
|
50
51
|
|
|
51
52
|
## Autonomy and parallelism
|
|
52
53
|
|
|
54
|
+
When running under AO, the AO orchestrator is the only multi-agent coordinator. A Bizar worker works only in its assigned AO worktree, uses `ao send` for real blockers or cross-session coordination, and asks AO to create further workers when parallel work is necessary. It must not invoke Bizar/Claude/Codex teams, create a separate worktree, manipulate AO internals, or treat `.ok/` as a second source of assignment state.
|
|
55
|
+
|
|
53
56
|
Agents execute clear, local, reversible work autonomously — they inspect,
|
|
54
57
|
edit, test, and iterate without pausing for routine decisions. Routine
|
|
55
58
|
decisions (file layout, naming, scope of a single commit, choosing between
|
|
@@ -169,24 +172,23 @@ isolation.
|
|
|
169
172
|
|
|
170
173
|
## Architecture
|
|
171
174
|
|
|
172
|
-
-
|
|
173
|
-
- `config/
|
|
174
|
-
- `.claude/commands/` — user-invoked workflows.
|
|
175
|
-
- `.claude/hooks/` + `.claude/settings.json` — safety, routing, lifecycle, telemetry, compaction, reviewer-context, simplify, and HITL gates.
|
|
175
|
+
- `config/ao/` — versioned Agent Orchestrator worker-rule template; `bizar ao setup` materializes it at `.ao/bizar-worker-rules.md` in each registered repository.
|
|
176
|
+
- `config/claude/` — standalone Claude Code agents, skills, commands, hooks, and settings.
|
|
176
177
|
- `packages/sdk/` — typed autonomy primitives and the 14-tool stdio MCP surface: plans, loops, graph queries, learning reads, tasks, workflows, control, audits, and model inventory.
|
|
177
|
-
- `cli/` — install/provision, audit, validation, backup,
|
|
178
|
+
- `cli/` — AO bridge, install/provision, audit, validation, backup, OpenKan control, sandbox, and repair utilities.
|
|
178
179
|
- `scripts/` + `.harness/` + `templates/` — verification, feature/eval state, audit output, and reusable contracts.
|
|
179
180
|
|
|
180
181
|
The harness has no embedded browser/server UI layer or local web editor.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
knowledge-base API.
|
|
182
|
+
In AO mode, AO's documented daemon CLI is the machine-readable control boundary
|
|
183
|
+
for session, worktree, PR, review, preview, and browser state. `bizar control`
|
|
184
|
+
and OpenKan remain standalone compatibility surfaces. Session handoff, control
|
|
185
|
+
inbox, and learning logs are bounded operational records for autonomy; they are
|
|
186
|
+
not a general note vault, semantic search service, or knowledge-base API.
|
|
186
187
|
|
|
187
188
|
## State and evidence
|
|
188
189
|
|
|
189
|
-
-
|
|
190
|
+
- AO project/session/PR state — authoritative whenever this is an AO worker session.
|
|
191
|
+
- `.ok/` — authoritative OpenKan tasks, plans, PRDs, progression, evidence, and scoped ownership in standalone Bizar mode.
|
|
190
192
|
- `PROGRESS.md` and `feature_list.json` — legacy historical records; do not use them for new work.
|
|
191
193
|
- `DECISIONS.md` and `docs/decisions/` — current architecture decisions.
|
|
192
194
|
- `.harness/evals/` — feature evaluation records.
|
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="docs/assets/bizar-banner.svg" alt="Bizar: guarded autonomy for
|
|
3
|
+
<img src="docs/assets/bizar-banner.svg" alt="Bizar: guarded autonomy for Agent Orchestrator" width="100%" />
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@polderlabs/bizar)
|
|
6
6
|
[](LICENSE)
|
|
7
|
-
[](https://github.com/Untrivial-ai/agent-orchestrator)
|
|
8
8
|
[](https://github.com/PolderLabsVOF/BizarHarness/releases)
|
|
9
9
|

|
|
10
|
-
[](https://www.npmjs.com/package/@polderlabs/openkan)
|
|
11
11
|
|
|
12
|
-
### Guarded autonomy for
|
|
12
|
+
### Guarded autonomy for Agent Orchestrator workers
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Run focused Codex workers under Agent Orchestrator. Bizar supplies their
|
|
15
|
+
repository policy, guardrails, skills, and verification evidence.
|
|
16
16
|
|
|
17
17
|
`85 agents` · `85 skills` · `37 commands` · `21-tool MCP server`
|
|
18
18
|
|
|
@@ -22,22 +22,20 @@ specialists, guardrails, and evidence to carry it through responsibly.
|
|
|
22
22
|
|
|
23
23
|
## Why Bizar?
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
selects direct primary-session work; workflows and single agents are explicit
|
|
30
|
-
or resumed modes.
|
|
25
|
+
Agent Orchestrator is built to coordinate parallel coding sessions. Bizar makes
|
|
26
|
+
each worker's implementation and verification discipline explicit. AO owns
|
|
27
|
+
multi-agent coordination, worktrees, branches, PR/review/CI feedback, previews,
|
|
28
|
+
and browser state; Bizar does not duplicate those surfaces.
|
|
31
29
|
|
|
32
30
|
It keeps the operator in control of model selection and high-impact actions.
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
AO model choices live in the registered project's AO configuration. Standalone
|
|
32
|
+
Claude aliases live in the global Claude configuration.
|
|
35
33
|
|
|
36
34
|
| You want | Bizar provides |
|
|
37
35
|
| --- | --- |
|
|
38
|
-
| A clean way to begin |
|
|
39
|
-
|
|
|
40
|
-
| Useful parallel work |
|
|
36
|
+
| A clean way to begin | `bizar ao setup` configures the current repository through AO's supported CLI |
|
|
37
|
+
| Codex workers | Versioned AO worker rules plus Bizar's repository guards and checks |
|
|
38
|
+
| Useful parallel work | AO-owned isolated worktrees, sessions, branches, PRs, CI/review feedback, preview, and browser tools |
|
|
41
39
|
| Fewer surprises | Explicit safety checks for releases, publication, deployment, pushes, and destructive operations |
|
|
42
40
|
| Confidence at the end | Tests, architecture checks, E2E checks, and evidence-aware handoff |
|
|
43
41
|
|
|
@@ -45,101 +43,65 @@ the project you happen to be working on.
|
|
|
45
43
|
|
|
46
44
|
<table>
|
|
47
45
|
<tr>
|
|
48
|
-
<td width="50%"><strong>
|
|
49
|
-
<td width="50%"><strong>
|
|
46
|
+
<td width="50%"><strong>Agent Orchestrator</strong><br />Install AO from its official desktop/GitHub distribution and start its local daemon.</td>
|
|
47
|
+
<td width="50%"><strong>Codex</strong><br />AO launches Codex workers and delivers Bizar's project rules through its supported configuration.</td>
|
|
50
48
|
</tr>
|
|
51
49
|
<tr>
|
|
52
|
-
<td width="50%"><strong>
|
|
53
|
-
<td width="50%"><strong>Git</strong><br />
|
|
50
|
+
<td width="50%"><strong>OpenKan (optional)</strong><br />Use it only for standalone Bizar planning; AO is the primary lifecycle authority.</td>
|
|
51
|
+
<td width="50%"><strong>Git</strong><br />AO creates the isolated worktrees and preserves normal project history.</td>
|
|
54
52
|
</tr>
|
|
55
53
|
</table>
|
|
56
54
|
|
|
57
55
|
```mermaid
|
|
58
56
|
flowchart LR
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
B -->
|
|
63
|
-
OK --> S[.ok workspace]
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Configure OmniRoute once before installing Bizar. The command writes provider
|
|
67
|
-
settings to Claude Code and preserves existing hooks, permissions, and MCP
|
|
68
|
-
servers.
|
|
69
|
-
|
|
70
|
-
```sh
|
|
71
|
-
bizar setup-provider --gateway https://your-gateway.example/v1 --key "$YOUR_API_KEY" --model your/model-id
|
|
57
|
+
AO[Agent Orchestrator] --> C[Codex workers]
|
|
58
|
+
AO --> W[Isolated worktrees, sessions, PRs, review, browser]
|
|
59
|
+
C --> B[Bizar worker harness]
|
|
60
|
+
B --> V[Repository checks and evidence]
|
|
61
|
+
OK[OpenKan standalone] --> S[.ok workspace]
|
|
72
62
|
```
|
|
73
63
|
|
|
74
64
|
## Install Bizar
|
|
75
65
|
|
|
76
|
-
Install Bizar
|
|
77
|
-
through four static aliases: `haiku`, `sonnet`, `opus`, and `fable`. OmniRoute
|
|
78
|
-
maps each alias to configured full model IDs and applies ordered failover.
|
|
66
|
+
Install Bizar, then configure the repository with a running AO daemon.
|
|
79
67
|
|
|
80
68
|
```sh
|
|
81
69
|
npm install -g @polderlabs/bizar
|
|
82
|
-
bizar
|
|
70
|
+
bizar ao doctor
|
|
71
|
+
bizar ao setup
|
|
83
72
|
```
|
|
84
73
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
should be enabled, the OpenKan install directory, and whether the current
|
|
92
|
-
project should receive a `.ok/` workspace. OpenKan is installed from npm as
|
|
93
|
-
`@polderlabs/openkan@latest`; its package-owned agent and skill are
|
|
94
|
-
installed into the same Claude configuration. Use `bizar install --yes` for
|
|
95
|
-
CI or a prompt-free refresh.
|
|
96
|
-
|
|
97
|
-
For a completely fresh Bizar-managed Claude setup while retaining endpoint and
|
|
98
|
-
authentication settings:
|
|
99
|
-
|
|
100
|
-
```sh
|
|
101
|
-
bizar install --force
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Then open any repository in Claude Code and describe the outcome you want.
|
|
105
|
-
Mike, the Bizar coordinator, handles the rest.
|
|
106
|
-
|
|
107
|
-
> **Tip:** Run `bizar doctor` whenever you want to verify that the global
|
|
108
|
-
> install, Claude settings, hooks, skills, agents, and provider connection are
|
|
109
|
-
> healthy.
|
|
74
|
+
`bizar ao setup` preserves AO's existing project configuration while selecting
|
|
75
|
+
Codex for both AO roles and materializing Bizar's managed repository-local
|
|
76
|
+
worker rules at `.ao/bizar-worker-rules.md`.
|
|
77
|
+
AO remains responsible for spawning workers, messaging, PR claims, review/CI
|
|
78
|
+
follow-up, previews, and browser verification. See
|
|
79
|
+
[the AO integration guide](docs/agent-orchestrator.md).
|
|
110
80
|
|
|
111
|
-
##
|
|
81
|
+
## AO worker lifecycle
|
|
112
82
|
|
|
113
83
|
```mermaid
|
|
114
84
|
flowchart LR
|
|
115
|
-
U["Describe the outcome"] -->
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
R --> D["Direct edit"]
|
|
121
|
-
R --> A["Isolated specialist"]
|
|
122
|
-
R --> P["Parallel agents / team"]
|
|
123
|
-
R --> W["Visible workflow"]
|
|
124
|
-
D --> V["Verify and report evidence"]
|
|
125
|
-
A --> V
|
|
126
|
-
P --> V
|
|
127
|
-
W --> V
|
|
85
|
+
U["Describe the outcome"] --> AO["AO: inspect state"]
|
|
86
|
+
AO --> W["Spawn focused Codex worker"]
|
|
87
|
+
W --> B["Bizar: implement and verify"]
|
|
88
|
+
B --> V["Report evidence to AO"]
|
|
89
|
+
V --> AO
|
|
128
90
|
```
|
|
129
91
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
foregrounded.
|
|
92
|
+
AO decides whether work needs one focused worker or several. Bizar workers do
|
|
93
|
+
not fan out a second team: they implement, test, and report evidence in their
|
|
94
|
+
assigned AO worktree.
|
|
134
95
|
|
|
135
|
-
##
|
|
96
|
+
## Standalone Claude Code model aliases
|
|
136
97
|
|
|
137
|
-
Bizar
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
gateway IDs for
|
|
141
|
-
gateway ID per agent at
|
|
142
|
-
`model-router.json`, no `userSelected` block, and no
|
|
98
|
+
Bizar's four static native aliases (`haiku`, `sonnet`, `opus`, `fable`) remain
|
|
99
|
+
available for standalone Claude Code operation. AO workers use AO's configured
|
|
100
|
+
Codex model override instead. OmniRoute handles ordered failover between the
|
|
101
|
+
configured full gateway IDs for standalone alias dispatch, so the operator never
|
|
102
|
+
picks a picker-style gateway ID per agent at that layer. There is no `bizar
|
|
103
|
+
models` picker, no `model-router.json`, no `userSelected` block, and no
|
|
104
|
+
Agent-model-guard hook.
|
|
143
105
|
|
|
144
106
|
The four aliases are the entire dispatch surface:
|
|
145
107
|
|
|
@@ -169,12 +131,12 @@ Useful inspection commands:
|
|
|
169
131
|
bizar doctor
|
|
170
132
|
```
|
|
171
133
|
|
|
172
|
-
## OpenKan
|
|
134
|
+
## OpenKan standalone mode
|
|
173
135
|
|
|
174
|
-
OpenKan
|
|
175
|
-
the
|
|
176
|
-
|
|
177
|
-
|
|
136
|
+
OpenKan remains available when Bizar is used without AO. In AO mode, AO owns
|
|
137
|
+
the project/session/PR lifecycle and `.ok/` is opt-in only. In standalone mode,
|
|
138
|
+
OpenKan stores project-local tasks, plans, PRDs, goals, and evidence under
|
|
139
|
+
`.ok/` through its supported `ok` CLI boundary.
|
|
178
140
|
|
|
179
141
|
```mermaid
|
|
180
142
|
flowchart LR
|
package/cli/bin.mjs
CHANGED
|
@@ -81,7 +81,7 @@ if (
|
|
|
81
81
|
// ── Banner ─────────────────────────────────────────────────────────────────────
|
|
82
82
|
|
|
83
83
|
function showBanner() {
|
|
84
|
-
console.log(chalk.bold.cyan(' Bizar — guarded autonomous workflows for Claude Code'));
|
|
84
|
+
console.log(chalk.bold.cyan(' Bizar — guarded autonomous workflows for Agent Orchestrator and Claude Code'));
|
|
85
85
|
console.log();
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -115,6 +115,7 @@ function showHelp() {
|
|
|
115
115
|
setup-provider Configure the global provider used by Bizar and Claude Code
|
|
116
116
|
advisor Configure Claude Code's advisor tool
|
|
117
117
|
orchestrator Manage multi-select modelPicker entries for Claude Code
|
|
118
|
+
ao <subcommand> Configure or forward to Agent Orchestrator (AO-primary)
|
|
118
119
|
statusline Customized Claude Code status bar (render/install/remove/show/preview)
|
|
119
120
|
release-provenance Generate SBOM + provenance + minisig for a release (audit #83)
|
|
120
121
|
verify-release Verify a release artifact set against the pinned allowlist
|
|
@@ -334,6 +335,18 @@ async function main() {
|
|
|
334
335
|
break;
|
|
335
336
|
}
|
|
336
337
|
|
|
338
|
+
case 'ao': {
|
|
339
|
+
const mod = await importCommand('ao');
|
|
340
|
+
if (!mod) {
|
|
341
|
+
console.error(chalk.red(` ✗ Could not load Agent Orchestrator command module`));
|
|
342
|
+
process.exit(EXIT_ERROR);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
dbg('loaded command module:', 'ao');
|
|
346
|
+
await mod.run(cmdArgs);
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
|
|
337
350
|
case 'statusline': {
|
|
338
351
|
const mod = await importCommand('statusline');
|
|
339
352
|
if (!mod) {
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Orchestrator integration.
|
|
3
|
+
*
|
|
4
|
+
* AO owns daemon, worktree, session, PR, review, and browser state. This
|
|
5
|
+
* command configures Bizar as a Codex worker harness through AO's supported
|
|
6
|
+
* CLI rather than accessing AO's local database or runtime internals.
|
|
7
|
+
*/
|
|
8
|
+
import { spawnSync } from 'node:child_process';
|
|
9
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
10
|
+
import { fileURLToPath } from 'node:url';
|
|
11
|
+
import { basename, dirname, resolve } from 'node:path';
|
|
12
|
+
|
|
13
|
+
export const AO_RULES_FILE = '.ao/bizar-worker-rules.md';
|
|
14
|
+
export const AO_ORCHESTRATOR_RULES = 'Use AO for coordination and Bizar as the Codex worker harness. Spawn focused AO workers for implementation; workers own changes, verification, commits, and PR follow-up.';
|
|
15
|
+
const WORKER_RULES_TEMPLATE = resolve(dirname(fileURLToPath(import.meta.url)), '../../config/ao/worker-rules.md');
|
|
16
|
+
|
|
17
|
+
function optionValue(args, flag) {
|
|
18
|
+
const index = args.indexOf(flag);
|
|
19
|
+
return index >= 0 && typeof args[index + 1] === 'string' ? args[index + 1] : undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function parseAoArgs(args = []) {
|
|
23
|
+
const [first, ...rest] = args;
|
|
24
|
+
const subcommand = ['setup', 'doctor', 'status', 'sessions', 'help'].includes(first) ? first : 'forward';
|
|
25
|
+
return {
|
|
26
|
+
subcommand,
|
|
27
|
+
forward: subcommand === 'forward' ? args : rest,
|
|
28
|
+
project: optionValue(args, '--project'),
|
|
29
|
+
model: optionValue(args, '--model'),
|
|
30
|
+
permissions: optionValue(args, '--permissions'),
|
|
31
|
+
help: args.includes('--help') || args.includes('-h') || first === 'help',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function isAoSession(env = process.env) {
|
|
36
|
+
return Boolean(env.AO_SESSION_ID || env.AO_PROJECT_ID);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function defaultProjectId(cwd) {
|
|
40
|
+
const id = basename(resolve(cwd)).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
|
41
|
+
return id || 'bizar-project';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function configuredProjectConfig(current = {}, options = {}) {
|
|
45
|
+
const worker = { ...(current.worker || {}), agent: 'codex' };
|
|
46
|
+
const orchestrator = { ...(current.orchestrator || {}), agent: 'codex' };
|
|
47
|
+
const agentConfig = { ...(current.agentConfig || {}) };
|
|
48
|
+
if (options.model) agentConfig.model = options.model;
|
|
49
|
+
if (options.permissions) agentConfig.permissions = options.permissions;
|
|
50
|
+
return {
|
|
51
|
+
...current,
|
|
52
|
+
agentRulesFile: options.rulesFile || AO_RULES_FILE,
|
|
53
|
+
orchestratorRules: current.orchestratorRules || AO_ORCHESTRATOR_RULES,
|
|
54
|
+
worker,
|
|
55
|
+
orchestrator,
|
|
56
|
+
...(Object.keys(agentConfig).length ? { agentConfig } : {}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* AO resolves agentRulesFile from the registered repository root. Install the
|
|
62
|
+
* packaged Bizar rules there once, without replacing project-owned changes.
|
|
63
|
+
*/
|
|
64
|
+
export function materializeWorkerRules(cwd, options = {}) {
|
|
65
|
+
const filesystem = options.filesystem || { existsSync, mkdirSync, readFileSync, writeFileSync };
|
|
66
|
+
const target = resolve(cwd, AO_RULES_FILE);
|
|
67
|
+
if (filesystem.existsSync(target)) return target;
|
|
68
|
+
|
|
69
|
+
const source = options.rulesTemplate || WORKER_RULES_TEMPLATE;
|
|
70
|
+
const contents = filesystem.readFileSync(source, 'utf8');
|
|
71
|
+
filesystem.mkdirSync(dirname(target), { recursive: true });
|
|
72
|
+
try {
|
|
73
|
+
filesystem.writeFileSync(target, contents, { encoding: 'utf8', mode: 0o644, flag: 'wx' });
|
|
74
|
+
} catch (error) {
|
|
75
|
+
if (error?.code !== 'EEXIST') throw error;
|
|
76
|
+
}
|
|
77
|
+
return target;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function runAo(args, options = {}) {
|
|
81
|
+
const execute = options.execute || ((command, commandArgs, spawnOptions) => spawnSync(command, commandArgs, spawnOptions));
|
|
82
|
+
const result = execute(options.binary || 'ao', args, {
|
|
83
|
+
cwd: options.cwd || process.cwd(),
|
|
84
|
+
encoding: 'utf8',
|
|
85
|
+
shell: false,
|
|
86
|
+
});
|
|
87
|
+
if (result.error) throw result.error;
|
|
88
|
+
return {
|
|
89
|
+
ok: result.status === 0,
|
|
90
|
+
status: result.status ?? 1,
|
|
91
|
+
stdout: result.stdout || '',
|
|
92
|
+
stderr: result.stderr || '',
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function emit(result, output = process) {
|
|
97
|
+
if (result.stdout) output.stdout.write(result.stdout);
|
|
98
|
+
if (result.stderr) output.stderr.write(result.stderr);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function parseJson(text, context) {
|
|
102
|
+
try {
|
|
103
|
+
return JSON.parse(text);
|
|
104
|
+
} catch {
|
|
105
|
+
throw new Error(`Agent Orchestrator returned invalid JSON for ${context}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function findProjectByPath(projects, cwd) {
|
|
110
|
+
const expected = resolve(cwd);
|
|
111
|
+
return projects.find((project) => project?.path && resolve(project.path) === expected) || null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function help(output = process.stdout) {
|
|
115
|
+
output.write(`
|
|
116
|
+
bizar ao — Agent Orchestrator bridge (AO-primary)
|
|
117
|
+
|
|
118
|
+
Usage:
|
|
119
|
+
bizar ao doctor
|
|
120
|
+
bizar ao setup [--project <id>] [--model <id>] [--permissions <mode>]
|
|
121
|
+
bizar ao status
|
|
122
|
+
bizar ao sessions
|
|
123
|
+
bizar ao <any supported ao command> [args...]
|
|
124
|
+
|
|
125
|
+
AO remains the sole owner of sessions, worktrees, PRs, review feedback,
|
|
126
|
+
previews, and browser state. The setup command registers this repository with AO,
|
|
127
|
+
selects Codex for both AO roles, and preserves existing AO project settings.
|
|
128
|
+
It creates and configures the repository-local ${AO_RULES_FILE} as AO worker
|
|
129
|
+
rules, preserving a file that is already present.
|
|
130
|
+
|
|
131
|
+
OpenKan remains available independently through bizar openkan and ok.
|
|
132
|
+
`);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function setupAo(options = {}) {
|
|
136
|
+
const cwd = resolve(options.cwd || process.cwd());
|
|
137
|
+
const list = runAo(['project', 'ls', '--json'], options);
|
|
138
|
+
if (!list.ok) return list;
|
|
139
|
+
const listed = parseJson(list.stdout, 'project list').projects || [];
|
|
140
|
+
let projectDetails = null;
|
|
141
|
+
let projectId = options.project;
|
|
142
|
+
|
|
143
|
+
if (projectId) {
|
|
144
|
+
const details = runAo(['project', 'get', projectId, '--json'], options);
|
|
145
|
+
if (!details.ok) return details;
|
|
146
|
+
projectDetails = parseJson(details.stdout, 'project get').project || {};
|
|
147
|
+
} else {
|
|
148
|
+
for (const project of listed) {
|
|
149
|
+
if (!project?.id) continue;
|
|
150
|
+
const details = runAo(['project', 'get', project.id, '--json'], options);
|
|
151
|
+
if (!details.ok) return details;
|
|
152
|
+
const candidate = parseJson(details.stdout, 'project get').project || {};
|
|
153
|
+
if (findProjectByPath([candidate], cwd)) {
|
|
154
|
+
projectId = candidate.id;
|
|
155
|
+
projectDetails = candidate;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
projectId ||= defaultProjectId(cwd);
|
|
161
|
+
|
|
162
|
+
if (!projectDetails) {
|
|
163
|
+
const added = runAo(['project', 'add', '--path', cwd, '--id', projectId, '--worker-agent', 'codex', '--orchestrator-agent', 'codex'], options);
|
|
164
|
+
if (!added.ok) return added;
|
|
165
|
+
const details = runAo(['project', 'get', projectId, '--json'], options);
|
|
166
|
+
if (!details.ok) return details;
|
|
167
|
+
projectDetails = parseJson(details.stdout, 'project get').project || {};
|
|
168
|
+
}
|
|
169
|
+
materializeWorkerRules(cwd, options);
|
|
170
|
+
const config = configuredProjectConfig(projectDetails.config, options);
|
|
171
|
+
const configured = runAo(['project', 'set-config', projectId, '--config-json', JSON.stringify(config), '--json'], options);
|
|
172
|
+
if (configured.ok) {
|
|
173
|
+
configured.stdout = `${configured.stdout}Bizar is configured as the AO Codex worker harness for ${projectId}.\n`;
|
|
174
|
+
}
|
|
175
|
+
return configured;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function doctorAo(options = {}) {
|
|
179
|
+
const status = runAo(['status', '--json'], options);
|
|
180
|
+
if (!status.ok) return status;
|
|
181
|
+
const agents = runAo(['agent', 'ls', '--json'], options);
|
|
182
|
+
if (!agents.ok) return agents;
|
|
183
|
+
return {
|
|
184
|
+
ok: true,
|
|
185
|
+
status: 0,
|
|
186
|
+
stdout: `${status.stdout}${agents.stdout}Agent Orchestrator is reachable; verify that the Codex row is installed and authenticated before spawning workers.\n`,
|
|
187
|
+
stderr: `${status.stderr}${agents.stderr}`,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function run(args = [], options = {}) {
|
|
192
|
+
const parsed = parseAoArgs(args);
|
|
193
|
+
const output = options.output || process;
|
|
194
|
+
if (parsed.help) {
|
|
195
|
+
help(output.stdout);
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
let result;
|
|
200
|
+
if (parsed.subcommand === 'setup') result = setupAo({ ...options, ...parsed });
|
|
201
|
+
else if (parsed.subcommand === 'doctor') result = doctorAo(options);
|
|
202
|
+
else if (parsed.subcommand === 'status') result = runAo(['status', '--json'], options);
|
|
203
|
+
else if (parsed.subcommand === 'sessions') result = runAo(['session', 'ls', ...parsed.forward], options);
|
|
204
|
+
else result = runAo(parsed.forward, options);
|
|
205
|
+
emit(result, output);
|
|
206
|
+
if (!result.ok) process.exitCode = result.status || 1;
|
|
207
|
+
} catch (error) {
|
|
208
|
+
output.stderr.write(`bizar ao: ${error.message || String(error)}\n`);
|
|
209
|
+
process.exitCode = 1;
|
|
210
|
+
}
|
|
211
|
+
return true;
|
|
212
|
+
}
|
package/cli/install/index.mjs
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* that delegates to the provisioner.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
|
|
8
10
|
import { runProvision, forceCleanInstall, clearSavedEnv } from '../provision.mjs';
|
|
9
11
|
import { runDoctor } from '../doctor.mjs';
|
|
12
|
+
import { runStatuslineInstall } from '../commands/statusline.mjs';
|
|
10
13
|
import { showBanner, sectionHeading } from './banner.mjs';
|
|
11
14
|
import { printInstallLocations } from './paths.mjs';
|
|
12
15
|
import { runInteractiveSetup } from './interactive-setup.mjs';
|
|
@@ -32,9 +35,19 @@ import { runInteractiveSetup } from './interactive-setup.mjs';
|
|
|
32
35
|
* @param {boolean} [opts.quiet] - Only print the location card
|
|
33
36
|
* @param {string} [opts.mode] - 'install' | 'update'
|
|
34
37
|
* @param {boolean} [opts.yes] - assume yes for any non-destructive prompts
|
|
38
|
+
* @param {Function} [opts.statuslineInstall] - injectable statusline installer for tests
|
|
39
|
+
* @param {Function} [opts.provision] - injectable provisioner for tests
|
|
35
40
|
*/
|
|
36
41
|
export async function runInstaller(opts = {}) {
|
|
37
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
dryRun = false,
|
|
44
|
+
force = false,
|
|
45
|
+
quiet = false,
|
|
46
|
+
mode = 'install',
|
|
47
|
+
yes = false,
|
|
48
|
+
statuslineInstall = runStatuslineInstall,
|
|
49
|
+
provision = runProvision,
|
|
50
|
+
} = opts;
|
|
38
51
|
|
|
39
52
|
if (quiet) {
|
|
40
53
|
printInstallLocations({ dryRun, force });
|
|
@@ -78,7 +91,7 @@ export async function runInstaller(opts = {}) {
|
|
|
78
91
|
// Always pass `force: true` downstream so `runProvision` re-emits the
|
|
79
92
|
// template-owned keys (permissions.allow wildcards, mcpServers, hooks)
|
|
80
93
|
// into the freshly-empty settings file.
|
|
81
|
-
const provisionResult = await
|
|
94
|
+
const provisionResult = await provision({
|
|
82
95
|
mode,
|
|
83
96
|
dryRun,
|
|
84
97
|
force: true,
|
|
@@ -87,6 +100,22 @@ export async function runInstaller(opts = {}) {
|
|
|
87
100
|
initializeOpenKanProject: interactive?.initializeOpenKanProject === true,
|
|
88
101
|
});
|
|
89
102
|
|
|
103
|
+
// Auto-install statusline (v10.29.2+). Skipped on dry-run, non-fatal on failure.
|
|
104
|
+
// Idempotent: re-running is safe — updateStatuslineSettings re-writes the same field.
|
|
105
|
+
if (!dryRun) {
|
|
106
|
+
try {
|
|
107
|
+
const statuslineResult = await statuslineInstall([]);
|
|
108
|
+
if (statuslineResult?.ok) {
|
|
109
|
+
provisionResult.statuslineInstalled = true;
|
|
110
|
+
} else {
|
|
111
|
+
console.log(chalk.yellow(` ! statusline auto-install failed: ${statuslineResult?.error || 'unknown'}`));
|
|
112
|
+
}
|
|
113
|
+
} catch (err) {
|
|
114
|
+
// Non-fatal: the user can still run `bizar statusline install` manually.
|
|
115
|
+
console.log(chalk.yellow(` ! statusline auto-install skipped: ${err?.message || err}`));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
90
119
|
// F-183 — post-install health check. Surfaced as a warning rather
|
|
91
120
|
// than a hard failure so a forced install that completes without
|
|
92
121
|
// error still reports its doctor summary; the operator decides
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Bizar worker rules for Agent Orchestrator
|
|
2
|
+
|
|
3
|
+
This repository is running inside an Agent Orchestrator (AO) worker session.
|
|
4
|
+
AO is the sole owner of worker sessions, worktrees, branches, session messages,
|
|
5
|
+
pull-request lifecycle, CI/review feedback, previews, and browser state.
|
|
6
|
+
|
|
7
|
+
- Work only on the assigned AO task in this session and its assigned worktree.
|
|
8
|
+
- Do not create a Bizar, Claude Code, Codex, tmux, or ad-hoc subagent team.
|
|
9
|
+
If parallel work is needed, report it through AO so the AO orchestrator can
|
|
10
|
+
create focused worker sessions.
|
|
11
|
+
- Do not create or manage a second worktree, task database, session ledger, or
|
|
12
|
+
PR coordinator. Use `ao send` only for a real blocker or required
|
|
13
|
+
cross-session coordination.
|
|
14
|
+
- Treat OpenKan as an explicit standalone option. Do not claim, update, or
|
|
15
|
+
complete `.ok/` tasks from an AO worker unless the task explicitly requires
|
|
16
|
+
it and the AO orchestrator has serialized that shared-state operation.
|
|
17
|
+
- Use Bizar's repository guidance, hooks, skills, targeted tests, `make check`,
|
|
18
|
+
and applicable verification gates to implement and prove the assigned work.
|
|
19
|
+
- Keep commits focused. Push, publish, deploy, release, or mutate a PR only
|
|
20
|
+
when the assigned task or an explicit user instruction authorizes it.
|
|
21
|
+
- Report changed files, verification evidence, and remaining risks to AO when
|
|
22
|
+
the task is complete.
|
package/config/claude/CLAUDE.md
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
Bizar Harness is
|
|
14
|
+
Bizar Harness is an Agent Orchestrator (AO)-first, guarded-autonomy worker harness for Codex and Claude Code. AO owns multi-agent coordination, isolated worktrees, sessions, branches, PRs, review feedback, previews, and browser state; Bizar supplies repository policy, skills, hooks, CLI utilities, and verification. OpenKan remains a standalone planning, progression, task, and PRD-goal option through `.ok/` and its supported CLI boundary.
|
|
15
15
|
|
|
16
|
-
If
|
|
16
|
+
If `AO_SESSION_ID` or `AO_PROJECT_ID` is present, this is an AO worker session: inspect AO session context, run `make check` before changing code, and do not start a second team/worktree/task lifecycle. Otherwise, inspect `.ok/` with `ok task list` and `ok prd list`, then run `make check` before changing code.
|
|
17
17
|
|
|
18
18
|
## Commands
|
|
19
19
|
|
|
@@ -35,8 +35,9 @@ make session-end # lifecycle compatibility target
|
|
|
35
35
|
|
|
36
36
|
## Hard constraints
|
|
37
37
|
|
|
38
|
-
- **MUST**
|
|
39
|
-
- **MUST**
|
|
38
|
+
- **MUST** treat AO as the durable task, session, worktree, branch, PR, CI/review, preview, and browser authority when `AO_SESSION_ID` or `AO_PROJECT_ID` is present. Do not update `.ok/` from an AO worker unless the assigned task explicitly requires it and AO has serialized that shared-state operation.
|
|
39
|
+
- **MUST** keep the scoped OpenKan task current in standalone Bizar mode: claim before implementation, update status/evidence at each durable handoff, and complete only with verification evidence.
|
|
40
|
+
- **MUST** use OpenKan PRDs and plans for standalone Bizar durable goals and progression; `PROGRESS.md` and `feature_list.json` are legacy historical records, not live control state.
|
|
40
41
|
- **MUST** keep one logical operation per commit and keep its docs in the same commit.
|
|
41
42
|
- **MUST** run targeted tests, then `make check`; run `make e2e` for cross-component changes.
|
|
42
43
|
- **MUST** verify evidence before claiming completion.
|
|
@@ -61,6 +62,8 @@ force a resolution you do not understand.
|
|
|
61
62
|
|
|
62
63
|
## Autonomy and parallelism
|
|
63
64
|
|
|
65
|
+
When running under AO, the AO orchestrator is the only multi-agent coordinator. A Bizar worker works only in its assigned AO worktree, uses `ao send` for real blockers or cross-session coordination, and asks AO to create further workers when parallel work is necessary. It must not invoke Bizar/Claude/Codex teams, create a separate worktree, manipulate AO internals, or treat `.ok/` as a second source of assignment state.
|
|
66
|
+
|
|
64
67
|
Agents execute clear, local, reversible work autonomously — they inspect,
|
|
65
68
|
edit, test, and iterate without pausing for routine decisions. Routine
|
|
66
69
|
decisions (file layout, naming, scope of a single commit, choosing between
|
|
@@ -180,24 +183,23 @@ isolation.
|
|
|
180
183
|
|
|
181
184
|
## Architecture
|
|
182
185
|
|
|
183
|
-
-
|
|
184
|
-
- `config/
|
|
185
|
-
- `.claude/commands/` — user-invoked workflows.
|
|
186
|
-
- `.claude/hooks/` + `.claude/settings.json` — safety, routing, lifecycle, telemetry, compaction, reviewer-context, simplify, and HITL gates.
|
|
186
|
+
- `config/ao/` — versioned Agent Orchestrator worker-rule template; `bizar ao setup` materializes it at `.ao/bizar-worker-rules.md` in each registered repository.
|
|
187
|
+
- `config/claude/` — standalone Claude Code agents, skills, commands, hooks, and settings.
|
|
187
188
|
- `packages/sdk/` — typed autonomy primitives and the 14-tool stdio MCP surface: plans, loops, graph queries, learning reads, tasks, workflows, control, audits, and model inventory.
|
|
188
|
-
- `cli/` — install/provision, audit, validation, backup,
|
|
189
|
+
- `cli/` — AO bridge, install/provision, audit, validation, backup, OpenKan control, sandbox, and repair utilities.
|
|
189
190
|
- `scripts/` + `.harness/` + `templates/` — verification, feature/eval state, audit output, and reusable contracts.
|
|
190
191
|
|
|
191
192
|
The harness has no embedded browser/server UI layer or local web editor.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
knowledge-base API.
|
|
193
|
+
In AO mode, AO's documented daemon CLI is the machine-readable control boundary
|
|
194
|
+
for session, worktree, PR, review, preview, and browser state. `bizar control`
|
|
195
|
+
and OpenKan remain standalone compatibility surfaces. Session handoff, control
|
|
196
|
+
inbox, and learning logs are bounded operational records for autonomy; they are
|
|
197
|
+
not a general note vault, semantic search service, or knowledge-base API.
|
|
197
198
|
|
|
198
199
|
## State and evidence
|
|
199
200
|
|
|
200
|
-
-
|
|
201
|
+
- AO project/session/PR state — authoritative whenever this is an AO worker session.
|
|
202
|
+
- `.ok/` — authoritative OpenKan tasks, plans, PRDs, progression, evidence, and scoped ownership in standalone Bizar mode.
|
|
201
203
|
- `PROGRESS.md` and `feature_list.json` — legacy historical records; do not use them for new work.
|
|
202
204
|
- `DECISIONS.md` and `docs/decisions/` — current architecture decisions.
|
|
203
205
|
- `.harness/evals/` — feature evaluation records.
|
|
@@ -12,6 +12,16 @@ Follow `_shared/AGENT_BASELINE.md`. You own the user outcome, integration, and
|
|
|
12
12
|
final verification. Direct execution is a narrow exception; native Agent teams
|
|
13
13
|
are the default for meaningful work.
|
|
14
14
|
|
|
15
|
+
## Agent Orchestrator boundary
|
|
16
|
+
|
|
17
|
+
If `AO_SESSION_ID` or `AO_PROJECT_ID` is set, you are an AO worker, not Bizar's
|
|
18
|
+
general orchestrator. AO owns worktrees, session lifecycle, PRs, review/CI
|
|
19
|
+
feedback, and cross-worker coordination. Complete only the assigned task in the
|
|
20
|
+
current AO worktree; do not invoke a Bizar/Claude/Codex team, native workflow,
|
|
21
|
+
or a second worktree. Use `ao send` only for a real blocker or to request that
|
|
22
|
+
the AO orchestrator create another focused worker. OpenKan is opt-in in this
|
|
23
|
+
mode and must not be mutated without an explicit, serialized AO task.
|
|
24
|
+
|
|
15
25
|
## Orient, decide, then coordinate
|
|
16
26
|
|
|
17
27
|
| Shape | Signals | Execution |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polderlabs/bizar",
|
|
3
|
-
"version": "10.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "10.30.0",
|
|
4
|
+
"description": "Agent Orchestrator-first worker harness for Codex and Claude Code with guarded workflows, typed SDK primitives, and MCP tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"bizar": "cli/bin.mjs"
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
48
48
|
"claude-code",
|
|
49
|
+
"codex",
|
|
50
|
+
"agent-orchestrator",
|
|
49
51
|
"claude-agent-sdk",
|
|
50
52
|
"ai-agent",
|
|
51
53
|
"multi-agent",
|