@polderlabs/bizar 10.15.0 → 10.16.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 CHANGED
@@ -31,6 +31,21 @@ make session-end # lifecycle compatibility target
31
31
  - **MUST NOT** use a persistent Claude daemon. Claude Code and the Agent SDK run in-process; background work uses Claude Code's Agent tool.
32
32
  - **MUST NOT** rebase or force-push under the default project policy.
33
33
 
34
+ ### Worktree discipline
35
+
36
+ Every code-writing Agent call dispatched by an orchestrator MUST pass
37
+ `isolation: "worktree"`. Read-only agents stay foreground. Dispatched
38
+ worktrees branch from HEAD as `wt/<agent_type>-<short-task-id>`. The
39
+ SubagentStart hook (`config/claude/hooks/worktree-bootstrap.mjs`) bootstraps
40
+ the worktree; the SubagentStop hook (`config/claude/hooks/worktree-archive.mjs`)
41
+ records the branch into `~/.config/bizar/worktree-queue.json`. The
42
+ orchestrator merges the queue with `bizar worktree-merge --all` (or one
43
+ branch at a time with `bizar worktree-merge <branch>`); the sequencer
44
+ tags each source tip as `merge-archive/<branch>-<sha>` before
45
+ `git merge --no-ff` and surfaces conflicts instead of silently dropping
46
+ work. Conflicts MUST be reported to the user for resolution; never silently
47
+ force a resolution you do not understand.
48
+
34
49
  ## Autonomy and parallelism
35
50
 
36
51
  Agents execute clear, local, reversible work autonomously — they inspect,
@@ -43,14 +58,18 @@ still deny prohibited actions and escalate externally visible or irreversible
43
58
  actions with `permissionDecision: "ask"`; that escalation list is the
44
59
  authoritative floor, not a starting point.
45
60
 
46
- Subagent dispatch through the Agent tool is the default for focused disjoint
47
- work. Native dynamic workflows under `~/.claude/workflows/` are used when a
48
- large or repeatable task benefits from deterministic scripted fan-out. Native
49
- agent teams are used only when independent workers need direct communication or
50
- shared task state. When two or more subtasks have non-overlapping file scopes
51
- and no data dependency on each other's intermediate output, the orchestrator
52
- MUST dispatch them concurrently. Sequential dispatch is reserved for dependent
53
- phases and integration.
61
+ Native dynamic workflows under `config/workflows/` and `~/.claude/workflows/`
62
+ are the primary dispatch mechanism for non-trivial tasks. Mike dispatches a
63
+ named workflow when the request maps to a research / implement / debug /
64
+ review shape. For work that needs 3+ long-lived workers with bounded cross-
65
+ talk, Mike invokes a workflow that fans out as a native agent team; the team
66
+ is host-side state under `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`, and per
67
+ Anthropic's docs `team_name` is deprecated and ignored. Plain `Agent` calls
68
+ are reserved for trivial, single-shot, or fully isolated work. When two or
69
+ more subtasks within a workflow have non-overlapping file scopes and no data
70
+ dependency on each other's intermediate output, the orchestrator MUST dispatch
71
+ them concurrently through `parallel([...])`. Sequential dispatch is reserved
72
+ for dependent phases and integration.
54
73
 
55
74
  Agent roles are model-agnostic. Mike selects the cheapest sufficient tier for
56
75
  each dispatch. It passes a concrete model only when live discovery proves a
@@ -58,11 +77,51 @@ configured tier candidate; otherwise it omits `model` and inherits the active
58
77
  session. Bizar never retries a failed dispatch by cycling aliases, providers, or
59
78
  tiers.
60
79
 
61
- The authoritative hard approval list (cannot be auto-approved) is: commits, pushes, pull-request
80
+ The authoritative hard approval list (cannot be auto-approved) is: pushes, pull-request
62
81
  mutations, releases, package publication, deployments, production/shared-
63
82
  infrastructure writes, credential changes, public exposure, irreversible
64
83
  destruction. Everything else proceeds.
65
84
 
85
+ Under F-176 the seven-category floor above is enforced by `permission-request.mjs`
86
+ (the destructive subset: force-push, rebase, root deletion, system-destructive
87
+ commands) and surfaced for the rest via `git-workflow-guard.mjs` as advisory
88
+ reminders in `hookSpecificOutput.additionalContext`. `permissions.deny` and
89
+ `permissions.ask` are emptied by design — the floor is enforced by hook output,
90
+ not by Claude Code prompts.
91
+
92
+ > Note: `config/claude/settings.json` ships `permissions.ask` moved into
93
+ > `permissions.allow` so subagents do not prompt for commits, pushes, PRs,
94
+ > or deploys. Operators who want HITL back can move the following exact
95
+ > patterns from `permissions.allow` into `permissions.ask` in their local
96
+ > `~/.claude/settings.json` override:
97
+ >
98
+ > - `Bash(git push *)`
99
+ > - `Bash(git -C * push *)`
100
+ > - `Bash(git --git-dir=* push *)`
101
+ > - `Bash(git push --force *)`
102
+ > - `Bash(git push -f *)`
103
+ > - `Bash(git rebase *)`
104
+ > - `Bash(gh pr create *)`
105
+ > - `Bash(gh pr merge *)`
106
+ > - `Bash(gh release create *)`
107
+ > - `Bash(npm publish *)`
108
+ > - `Bash(bun publish *)`
109
+ > - `Bash(pnpm publish *)`
110
+ > - `Bash(vercel deploy *)`
111
+ > - `Bash(wrangler deploy *)`
112
+ > - `Bash(flyctl deploy *)`
113
+
114
+ > Note: `disableAutoCompact: true` is shipped by default. Sessions rely on
115
+ > manual `/compact` instead. Hook `precompact-priorities.sh` preserves
116
+ > evidence and decisions on compaction.
117
+ Local `git commit` is always allowed silently via `permissions.allow`; the seven
118
+ HITL categories above are gated by `permission-request.mjs` plus the advisory
119
+ hook chain.
120
+
121
+ Agents always fetch current official documentation via WebSearch + WebFetch at
122
+ task start and whenever uncertainty appears during work. Guess-and-try is
123
+ prohibited.
124
+
66
125
  ## Execution model
67
126
 
68
127
  The autonomy and approval policy above governs this execution model. The project defaults to `acceptEdits`; eligible operators may opt into Claude Code Auto mode.
package/cli/bin.mjs CHANGED
@@ -416,14 +416,37 @@ async function main() {
416
416
  break;
417
417
  }
418
418
 
419
+ case 'models': {
420
+ const mod = await importCommand('models');
421
+ if (!mod) {
422
+ console.error(chalk.red(` ✗ Could not load models command module`));
423
+ process.exit(EXIT_ERROR);
424
+ return;
425
+ }
426
+ dbg('loaded command module:', 'models');
427
+ const found = await mod.run(cmd, cmdArgs, isHelpRequest);
428
+ if (found === false) {
429
+ console.error(chalk.red(` ✗ Usage: bizar models [--list|--set|--clear|--json] — run 'bizar models --help'`));
430
+ process.exit(EXIT_USAGE);
431
+ }
432
+ break;
433
+ }
434
+
419
435
  case 'model': {
436
+ // Deprecated alias. Routes to the original `model.mjs` so the
437
+ // legacy JSON shape (`{ providers: { ... }, total: N }`) and table
438
+ // output keep working for existing scripts and tests. New code
439
+ // should use `bizar models` (see `case 'models'`).
420
440
  const mod = await importCommand('model');
421
441
  if (!mod) {
422
442
  console.error(chalk.red(` ✗ Could not load model command module`));
423
443
  process.exit(EXIT_ERROR);
424
444
  return;
425
445
  }
426
- dbg('loaded command module:', 'model');
446
+ dbg('loaded command module (deprecated alias):', 'model');
447
+ if (!isHelpRequest) {
448
+ console.error(chalk.yellow(' ! `bizar model` is deprecated; use `bizar models` for the new picker surface.'));
449
+ }
427
450
  const found = await mod.run(cmd, cmdArgs, isHelpRequest);
428
451
  if (found === false) {
429
452
  console.error(chalk.red(` ✗ Usage: bizar model <subcommand> — run 'bizar model --help'`));
@@ -47,6 +47,7 @@ export const HOOK_PROGRAMS = Object.freeze({
47
47
  'team-lifecycle': 'team-lifecycle.mjs',
48
48
  'verify-deliverables': 'verify-deliverables.mjs',
49
49
  'worker-suggest': 'worker-suggest.mjs',
50
+ 'worktree-archive': 'worktree-archive.mjs',
50
51
  'worktree-bootstrap': 'worktree-bootstrap.mjs',
51
52
  });
52
53
 
@@ -81,7 +82,7 @@ export const EVENT_CHAINS = Object.freeze({
81
82
  'advisor-context',
82
83
  'worktree-bootstrap',
83
84
  ]),
84
- 'subagent-stop': Object.freeze(['verify-deliverables']),
85
+ 'subagent-stop': Object.freeze(['verify-deliverables', 'worktree-archive']),
85
86
  'task-created': Object.freeze(['team-lifecycle']),
86
87
  'task-completed': Object.freeze(['team-lifecycle']),
87
88
  'teammate-idle': Object.freeze(['team-lifecycle']),