Skip to content

Commit 2cd3189

Browse files
committed
Expand bundle workflows and validation
1 parent f7fb366 commit 2cd3189

38 files changed

Lines changed: 1523 additions & 201 deletions

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: npm
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Test
29+
run: npm test

README.md

Lines changed: 119 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
[English](./README.md) | [简体中文](./README.zh-CN.md)
44

5-
Task Bundle is a small TypeScript + Node.js CLI for packaging one AI coding task into a portable directory.
5+
Task Bundle is a TypeScript + Node.js CLI for packaging one AI coding task into a portable bundle directory.
66

7-
It is built for workflows where you want to:
7+
It is designed for workflows where you want to:
88
- inspect what happened
99
- share a task with someone else
10-
- rerun the task later
11-
- compare how different models or tools perform on the same starting point
12-
13-
This MVP focuses on a directory-based bundle format and three commands: `init`, `pack`, and `inspect`.
10+
- rerun a task later
11+
- compare outputs across tools and models
12+
- grow toward replay and benchmark workflows
1413

1514
It is intentionally not:
1615
- an agent framework
@@ -39,7 +38,11 @@ task-bundle/
3938
files/...
4039
```
4140

42-
See [docs/bundle-format.md](./docs/bundle-format.md) for the format details.
41+
See:
42+
- [docs/bundle-format.md](./docs/bundle-format.md)
43+
- [docs/bundle-format.zh-CN.md](./docs/bundle-format.zh-CN.md)
44+
- [docs/design-decisions.md](./docs/design-decisions.md)
45+
- [docs/replay-contract.md](./docs/replay-contract.md)
4346

4447
## Five-Minute Demo
4548

@@ -56,35 +59,46 @@ npm run build
5659
npm run dev -- inspect ./examples/hello-world-bundle
5760
```
5861

59-
3. Generate starter inputs for your own task:
62+
3. Compare two example bundles produced by different tools:
63+
64+
```bash
65+
npm run dev -- compare ./examples/hello-world-bundle ./examples/hello-world-bundle-claude
66+
```
67+
68+
4. Validate the example bundle:
69+
70+
```bash
71+
npm run dev -- validate ./examples/hello-world-bundle
72+
```
73+
74+
5. Scan the whole examples directory:
75+
76+
```bash
77+
npm run dev -- scan ./examples
78+
```
79+
80+
6. Generate starter inputs:
6081

6182
```bash
6283
npm run dev -- init --out ./starter
6384
```
6485

65-
4. Pack those inputs into a new bundle:
86+
7. Pack from the generated config:
6687

6788
```bash
68-
npm run dev -- pack \
69-
--title "My first bundle" \
70-
--task ./starter/task.md \
71-
--summary ./starter/summary.md \
72-
--diff ./starter/result.diff \
73-
--events ./starter/events.jsonl \
74-
--workspace ./starter/workspace-files \
75-
--out ./dist/my-first-bundle
89+
npm run dev -- pack --config ./starter/taskbundle.config.json
7690
```
7791

78-
5. Inspect the bundle you just created:
92+
8. Archive the result:
7993

8094
```bash
81-
npm run dev -- inspect ./dist/my-first-bundle
95+
npm run dev -- archive ./starter/bundle-output --out ./starter/bundle-output.tar.gz
8296
```
8397

8498
## Commands
8599

86100
### `taskbundle init`
87-
Create starter inputs for a new bundle:
101+
Create starter files for a new bundle:
88102

89103
```bash
90104
npm run dev -- init --out ./starter
@@ -96,10 +110,13 @@ This writes:
96110
- `events.jsonl`
97111
- `result.diff`
98112
- `workspace-files/`
113+
- `taskbundle.config.json`
99114
- `README.md`
100115

101116
### `taskbundle pack`
102-
Build a bundle directory from task artifacts:
117+
Build a bundle directory from task artifacts.
118+
119+
Explicit flags:
103120

104121
```bash
105122
npm run dev -- pack \
@@ -118,66 +135,91 @@ npm run dev -- pack \
118135
--out ./dist/fix-auth-bundle
119136
```
120137

138+
Config-driven:
139+
140+
```bash
141+
npm run dev -- pack --config ./starter/taskbundle.config.json
142+
```
143+
144+
`pack` also supports:
145+
- automatic git metadata detection
146+
- artifact hashes and sizes in `bundle.json`
147+
- optional `.tar.gz` archive creation with `--archive`
148+
121149
### `taskbundle inspect`
122150
Read a bundle directory and print a human-friendly summary:
123151

124152
```bash
125153
npm run dev -- inspect ./examples/hello-world-bundle
126154
```
127155

128-
Or print machine-readable JSON:
156+
Machine-readable JSON:
129157

130158
```bash
131159
npm run dev -- inspect --json ./examples/hello-world-bundle
132160
```
133161

134-
Expected output shape:
162+
### `taskbundle compare`
163+
Compare two bundles:
135164

136-
```txt
137-
Task Bundle
138-
-----------
139-
Title: Fix greeting punctuation
140-
Schema: 0.1.0
141-
Created: 2026-03-18T00:00:00.000Z
142-
Tool: codex
143-
Model: gpt-5
144-
Runtime: node
145-
Repo: example/hello-world
146-
Commit: abc123
147-
Tags: demo, mvp
148-
149-
Artifacts:
150-
- bundle.json
151-
- events.jsonl
152-
- result.diff
153-
- summary.md
154-
- task.md
155-
- workspace
156-
157-
Workspace files: 1
158-
Events: 3
159-
```
160-
161-
## Example Bundle
162-
163-
The repository includes a real example at [examples/hello-world-bundle](./examples/hello-world-bundle).
164-
165-
You can use it to:
166-
- inspect a complete bundle immediately
167-
- understand the directory structure
168-
- see how task, summary, events, diff, and workspace snapshot fit together
165+
```bash
166+
npm run dev -- compare ./examples/hello-world-bundle ./examples/hello-world-bundle-claude
167+
```
168+
169+
JSON output:
170+
171+
```bash
172+
npm run dev -- compare --json ./examples/hello-world-bundle ./examples/hello-world-bundle-claude
173+
```
174+
175+
### `taskbundle archive`
176+
Create a `.tar.gz` archive from a bundle directory:
177+
178+
```bash
179+
npm run dev -- archive ./examples/hello-world-bundle --out ./dist/hello-world-bundle.tar.gz
180+
```
181+
182+
### `taskbundle extract`
183+
Extract a bundle archive into a directory:
184+
185+
```bash
186+
npm run dev -- extract ./dist/hello-world-bundle.tar.gz --out ./dist/extracted
187+
```
188+
189+
### `taskbundle validate`
190+
Validate a bundle and check replay readiness:
191+
192+
```bash
193+
npm run dev -- validate ./examples/hello-world-bundle
194+
```
195+
196+
### `taskbundle scan`
197+
Scan a directory for bundle folders:
198+
199+
```bash
200+
npm run dev -- scan ./examples
201+
```
202+
203+
## Example Bundles
204+
205+
The repository includes two real examples:
206+
- [examples/hello-world-bundle](./examples/hello-world-bundle)
207+
- [examples/hello-world-bundle-claude](./examples/hello-world-bundle-claude)
208+
209+
They represent the same task captured from different tool/model combinations so `compare` has something meaningful to show.
169210

170211
## Bundle Format At A Glance
171212

172-
- `bundle.json`: top-level metadata and pointers to artifacts
213+
- `bundle.json`: top-level metadata and artifact pointers
214+
- `artifactInfo`: optional size/hash information for copied artifacts
173215
- `task.md`: original task, constraints, and acceptance criteria
174216
- `summary.md`: short human-readable execution outcome
175217
- `result.diff`: final patch or diff
176218
- `events.jsonl`: notable actions and turning points, not every token
177219
- `workspace/manifest.json`: file list with paths, sizes, and hashes
178220
- `workspace/files/`: captured task-related files
179-
180-
Full format details live in [docs/bundle-format.md](/Users/haoc/Developer/task-bundle/docs/bundle-format.md).
221+
- `git`: optional git root / branch / remote / commit metadata
222+
- `runner`: optional pack-time runtime metadata
181223

182224
## Local Development
183225

@@ -199,6 +241,12 @@ npm run build
199241
npm test
200242
```
201243

244+
### Full Check
245+
246+
```bash
247+
npm run check
248+
```
249+
202250
### Run the CLI
203251

204252
```bash
@@ -221,28 +269,23 @@ src/
221269
utils/
222270
examples/
223271
hello-world-bundle/
272+
hello-world-bundle-claude/
224273
docs/
225274
bundle-format.md
275+
bundle-format.zh-CN.md
276+
design-decisions.md
277+
replay-contract.md
226278
```
227279

228280
## Known Limitations
229281

230-
- The MVP stores bundles as plain directories only.
231-
- Event logs are intentionally lightweight and not token-level recordings.
232-
- Workspace capture copies a provided file set directly; it does not detect repo state automatically.
233-
- There is no remote execution, provider integration, or viewer UI yet.
234-
235-
## Why This Can Grow
236-
237-
This structure is intentionally simple, but it leaves clear room for:
238-
- a session viewer
239-
- benchmark runners
240-
- alternate bundle transports like tar or zip
241-
- richer metadata and event schemas
282+
- Archives currently use `.tar.gz`, not `.zip`.
283+
- The project compares bundle-level metadata and counts, not semantic code quality.
284+
- Workspace capture still uses explicit copied file sets instead of repository-wide snapshot strategies.
285+
- There is no viewer UI yet.
242286

243-
## Next Worthwhile Steps
287+
## Roadmap
244288

245-
1. Add schema validation for bundle contents.
246-
2. Support packing directly from a git diff and commit metadata.
247-
3. Add CLI smoke tests once dependency installation is available.
248-
4. Add zip export and import.
289+
See:
290+
- [ROADMAP.md](./ROADMAP.md)
291+
- [ROADMAP.zh-CN.md](./ROADMAP.zh-CN.md)

0 commit comments

Comments
 (0)