biotonomy 0.2.1 → 0.2.2

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.
Files changed (3) hide show
  1. package/README.md +63 -176
  2. package/bt +12 -1
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,211 +1,98 @@
1
1
  # Biotonomy
2
2
 
3
- Biotonomy is a command-line workflow for shipping code changes with Codex.
3
+ Biotonomy (`bt`) is a CLI for running a Codex-driven development workflow in a repo:
4
4
 
5
- - What it is: A CLI that runs a repeatable flow: `spec -> research -> implement -> review -> fix -> pr`.
6
- - Who it is for: Developers who want a structured way to ship small changes fast.
7
- - What problem it solves: Keeps work organized in files, runs quality checks, and reduces "what do I do next?" during AI-assisted coding.
5
+ `spec -> research -> plan-review -> implement -> review -> fix -> pr`
8
6
 
9
- ## 60-Second Quickstart
7
+ It supports both:
8
+ - manual stage-by-stage execution
9
+ - a one-command iterative loop with `bt loop`
10
10
 
11
- Install either way:
11
+ ## Quickstart
12
12
 
13
- ```bash
14
- npm i -g biotonomy
15
- # then use: bt ...
16
- ```
17
-
18
- ```bash
19
- npx biotonomy ...
20
- ```
21
-
22
- Minimal demo in a fresh repo:
23
-
24
- ```bash
25
- mkdir biotonomy-demo && cd biotonomy-demo
26
- git init
27
- npm init -y
28
-
29
- npx biotonomy bootstrap
30
- npx biotonomy spec hello-world
31
- npx biotonomy review hello-world
32
- npx biotonomy status
33
- ```
34
-
35
- Expected files after the demo:
36
-
37
- - `.bt.env`
38
- - `.bt/`
39
- - `specs/hello-world/SPEC.md`
40
- - `specs/hello-world/REVIEW.md`
41
- - `specs/hello-world/progress.txt`
42
- - `specs/hello-world/history/001-spec.md`
43
- - `specs/hello-world/history/002-review.md`
44
- - `specs/hello-world/.artifacts/codex-review.log`
45
-
46
- Notes:
47
-
48
- - `review` still creates `REVIEW.md` even if Codex is not installed.
49
- - `research` requires Codex.
50
-
51
- ## Ship A Small Change
52
-
53
- Use this for a real change from idea to PR.
54
-
55
- 1. `spec` (define the change)
56
-
57
- ```bash
58
- bt spec my-change
59
- # or from GitHub issue:
60
- # bt spec 123
61
- ```
62
-
63
- - Automated today: creates `specs/<feature>/SPEC.md`, history, and progress logs.
64
- - Manual today: fill in/clean up stories and acceptance criteria in `SPEC.md`.
65
-
66
- 2. `research` (gather context)
13
+ Prereqs: Node.js >= 18, `git`, Codex CLI available as `codex` (or set `BT_CODEX_BIN`).
67
14
 
68
15
  ```bash
69
- bt research my-change
70
- ```
71
-
72
- - Automated today: runs Codex in read-only mode and writes `RESEARCH.md`.
73
- - Manual today: confirm research quality and adjust plan if needed.
74
-
75
- 3. `implement` (make the change)
76
-
77
- ```bash
78
- bt implement my-change
79
- ```
80
-
81
- - Automated today: runs Codex in full-auto and then runs quality gates.
82
- - Manual today: if Codex is unavailable, this stage is a stub and you implement changes yourself.
83
-
84
- 4. `review` (check what changed)
85
-
86
- ```bash
87
- bt review my-change
88
- ```
89
-
90
- - Automated today: writes `REVIEW.md` (with a fallback stub if Codex fails).
91
- - Manual today: decide whether findings are acceptable for your team.
92
-
93
- 5. `fix` (address findings)
94
-
95
- ```bash
96
- bt fix my-change
97
- ```
98
-
99
- - Automated today: runs Codex fix pass and re-runs quality gates.
100
- - Manual today: rerun until you are satisfied; no built-in auto-loop to "done" yet.
101
-
102
- 6. `pr` (open pull request)
103
-
104
- ```bash
105
- bt pr my-change --dry-run
106
- bt pr my-change --run
107
- ```
108
-
109
- - Automated today: runs tests/lint, creates branch, optionally commits, pushes, opens PR via `gh`.
110
- - Manual today: choose reviewers/labels, final PR polish, and merge strategy.
111
-
112
- ## Current Limitations
113
-
114
- - No one-command autonomous loop yet (you run each stage yourself).
115
- - `research` needs Codex installed and available.
116
- - `implement`/`fix` can run as stubs without Codex (gates still run, code may not change).
117
- - PR flow depends on `gh` and repository permissions.
118
-
119
- ## Troubleshooting
120
-
121
- `gh` auth fails (`bt spec 123` or `bt pr ...`):
122
-
123
- ```bash
124
- gh auth status
125
- gh auth login
126
- ```
127
-
128
- Codex missing (`codex required` or `codex not found`):
129
-
130
- - Install Codex and make sure `codex` is on your `PATH`.
131
- - Or set a custom binary in `.bt.env`: `BT_CODEX_BIN=/path/to/codex`.
132
-
133
- Quality gate failures on `implement`/`fix`:
134
-
135
- ```bash
136
- bt gates my-change
137
- ```
138
-
139
- - Fix failing lint/typecheck/test commands.
140
- - Override gate commands in `.bt.env` if auto-detection is wrong:
141
- - `BT_GATE_LINT=...`
142
- - `BT_GATE_TYPECHECK=...`
143
- - `BT_GATE_TEST=...`
144
-
145
- ## Release Publish Steps
146
-
147
- Use this when preparing an npm release. This workflow validates readiness but does not publish automatically.
148
-
149
- 1. Confirm clean main branch and pull latest changes.
150
-
151
- ```bash
152
- git checkout main
153
- git pull --ff-only
154
- ```
16
+ # Install
17
+ npm i -g biotonomy
155
18
 
156
- 2. Run release preflight checks (tests, lint, pack verification, and `npm pack --dry-run` summary).
19
+ # In your project repo
20
+ bt bootstrap
157
21
 
158
- ```bash
159
- npm run release:ready
160
- ```
22
+ # Create a feature scaffold
23
+ FEATURE=hello-world
24
+ bt spec "$FEATURE"
161
25
 
162
- 3. Ensure npm authentication is ready for publish.
26
+ # Loop requires an approved plan review verdict first
27
+ cat > "specs/$FEATURE/PLAN_REVIEW.md" <<'MD'
28
+ Verdict: APPROVED_PLAN
29
+ MD
163
30
 
164
- ```bash
165
- npm whoami
166
- # if needed:
167
- npm login
31
+ # Run autonomous implement/review/fix iterations (with gates)
32
+ bt loop "$FEATURE" --max-iterations 3
168
33
  ```
169
34
 
170
- 4. Bump version and create a tag.
35
+ ## `bt loop`
171
36
 
172
- ```bash
173
- npm version patch
174
- # or: npm version minor / npm version major
175
- ```
37
+ `bt loop <feature> [--max-iterations N]` runs:
38
+ 1. preflight quality gates
39
+ 2. `implement`
40
+ 3. `review`
41
+ 4. `fix` only when review verdict is `NEEDS_CHANGES`
42
+ 5. repeat until verdict is `APPROVE`/`APPROVED` and gates pass, or max iterations is reached
176
43
 
177
- 5. Push commit and tag.
44
+ Loop hard-requires an approved `specs/<feature>/PLAN_REVIEW.md` verdict (`APPROVE_PLAN` or `APPROVED_PLAN`).
178
45
 
179
- ```bash
180
- git push --follow-tags
181
- ```
46
+ ## Artifacts And State
182
47
 
183
- 6. Publish manually.
48
+ Biotonomy writes feature state under `specs/<feature>/`:
49
+ - `SPEC.md`
50
+ - `RESEARCH.md`
51
+ - `PLAN_REVIEW.md`
52
+ - `REVIEW.md`
53
+ - `history/` stage snapshots (`###-<stage>.md`) and loop iteration snapshots (`*-loop-iter-###.md`)
54
+ - `loop-progress.json` loop summary and per-iteration status
55
+ - `progress.txt` append-only stage log
56
+ - `.artifacts/` Codex logs and command artifacts (for example `codex-implement.log`, `codex-review.log`, `codex-fix.log`)
57
+ - `gates.json` feature gate results when running `bt gates <feature>`
184
58
 
185
- ```bash
186
- npm publish --access public
187
- ```
188
-
189
- - If your npm account uses 2FA for publish, npm will require a one-time code during `npm publish`.
59
+ Global gate state is written to `.bt/state/gates.json` when running `bt gates` without a feature.
190
60
 
191
- ## Commands
61
+ ## Manual Commands
192
62
 
193
63
  ```bash
194
64
  bt bootstrap
195
65
  bt spec <feature|issue#>
196
66
  bt research <feature>
67
+ bt plan-review <feature>
197
68
  bt implement <feature>
198
69
  bt review <feature>
199
70
  bt fix <feature>
71
+ bt loop <feature> [--max-iterations N]
200
72
  bt gates [feature]
201
73
  bt status
202
- bt pr <feature> [--dry-run|--run]
203
- bt reset
74
+ bt pr <feature> [--run]
75
+ ```
76
+
77
+ ## Configuration
78
+
79
+ Project config lives in `.bt.env` (created by `bt bootstrap`). Common overrides:
80
+
81
+ ```bash
82
+ BT_SPECS_DIR=specs
83
+ BT_STATE_DIR=.bt
84
+ BT_GATE_LINT="npm run lint"
85
+ BT_GATE_TYPECHECK="tsc --noEmit"
86
+ BT_GATE_TEST="npm test"
87
+ BT_CODEX_BIN="/path/to/codex"
204
88
  ```
205
89
 
206
- ## Development
90
+ ## Release
91
+
92
+ Run the release readiness checks:
207
93
 
208
94
  ```bash
209
- npm test
210
- npm run lint
95
+ npm run release:ready
211
96
  ```
97
+
98
+ That script runs tests, lint, pack verification, and `npm pack --dry-run`.
package/bt CHANGED
@@ -1,5 +1,16 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4
+ bt_script_dir() {
5
+ local src="${BASH_SOURCE[0]}"
6
+ while [ -h "$src" ]; do
7
+ local dir
8
+ dir="$(cd -P "$(dirname "$src")" && pwd)"
9
+ src="$(readlink "$src")"
10
+ [[ "$src" != /* ]] && src="$dir/$src"
11
+ done
12
+ cd -P "$(dirname "$src")" && pwd
13
+ }
14
+
15
+ SCRIPT_DIR="$(bt_script_dir)"
5
16
  exec "$SCRIPT_DIR/bt.sh" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biotonomy",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Codex-native autonomous development loop CLI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "homepage": "https://github.com/archive-dot-com/biotonomy#readme",
14
14
  "bin": {
15
- "bt": "bt"
15
+ "bt": "bt",
16
+ "biotonomy": "bt"
16
17
  },
17
18
  "files": [
18
19
  "bt",