$ cat test-plan.md
# Jcode Swarm comparison plan — 8 October 2026

Task 19: saved before the comparison starts.

## Task and immutable starting point
Synthetic, standard-library Python study-log repository; commit `9b7fad2a153b1d0e24d873e00876697eb2eb2d3a`. Implement two unfinished modules: record normalization and case-insensitive aggregation. Two fresh clones begin at exactly this commit. Nine unittest methods cover trimming, zero, invalid minutes and records, empty input, aggregation and input immutability. The starting tests must fail; neither agent may change them.

## Success criteria
1. All nine unchanged tests pass when independently run after Jcode exits.
2. Only normalize.py and summary.py change; original tests/README/AGENTS hashes match.
3. Baseline has no worker spawns. Swarm must demonstrate two native spawned workers, distinct session IDs, role ownership and completion. A passing implementation without verified workers is not a successful Swarm run.
4. No paid model, dependency download or unrelated repo modification.

## Controlled variables
Jcode v0.91.0 official release; same machine, model `cohere/north-mini-code:free`, task, inputs and acceptance tests. Fresh per-condition home/runtime and isolated server; memory disabled. Worker model pinned to the same free route; headless spawn mode; maximum two live workers. Same coding tools, with swarm/bg only added to the Swarm condition. Execute baseline first, then Swarm, one paired trial. This order, provider variability and one sample prohibit general speed/cost conclusions.

## Roles
Single-agent baseline implements both files and runs tests. Swarm root coordinates two workers: Normalizer writes only normalize.py, Aggregator writes only summary.py. The aggregator can implement against the fixed normalization interface while its peer works. Root waits, verifies status and runs integration tests; may correct integration defects but must report them. Shared repo/file ownership avoids overlapping writes; no nested workers.

## Measurement and stopping
Record full CLI stdout/stderr (NDJSON and trace), exit status, wall seconds from process start to exit, final test output, git diff and unchanged-file hashes. Sample server plus client RSS every second; report peak sum as an approximate process-RSS measurement, not whole-system memory or all child-tool usage. Record client token reports separately; do not label them total Swarm tokens/cost. Each condition gets a 600-second maximum. If blocked by credentials, quota or worker transport, retain the error; one infrastructure retry from a fresh clone may be reported separately, never overwrite the initial result.

## Reproduction artifacts
fixture/, baseline-prompt.txt, swarm-prompt.txt, setup.py, runner.py, per-run logs and results.json. Login uses a privately supplied key; never put the secret in command text, logs or screenshots. Screenshots show actual recorded output with arrow overlays only, no rewritten UI or added image headers. Guide must label transcript screenshots and disclose failures.

## Sequence
- [x] Define repository, prompts, fixed tests, roles and limits; save this plan.
- [ ] Verify failing fixture; run single-agent baseline and independent validation.
- [ ] Run native Swarm on a fresh clone and independently validate.
- [ ] Save results, screenshots and resource caveats.
- [ ] Publish /jcode-swarm/ with only observed claims, internal links and at most two official external links; verify live page.
