This guide explains how to continue improving zBitCompressor.rs with a simpler local AI agent ("OpenClaw" style workflow) while keeping changes safe, reviewable, and test-backed.
Use the smaller agent for:
- small refactors in one module
- adding focused tests
- updating docs/examples
- debugging one failing test at a time
Avoid delegating to a smaller agent:
- cross-module architecture changes without a test harness
- format or parser redesigns touching serialization compatibility
- large objective-function changes without benchmark validation
From repo root:
cargo test --manifest-path zbit-rs/Cargo.tomlFast loop during edits:
cargo test --manifest-path zbit-rs/Cargo.toml --lib
cargo test --manifest-path zbit-rs/Cargo.toml --test advanced_validationFull validation before merging:
cargo test --manifest-path zbit-rs/Cargo.toml
cargo run --manifest-path zbit-rs/Cargo.toml --bin zbit-benchmark -- \
papers/zbit-algorithmsResearch.md \
zbit-rs/benchmark_algorithmsResearch.zbpk \
zbit-rs/benchmark_latest.txtUse this exact shape to reduce drift:
Task:
<one concrete change>
Constraints:
- Keep compatibility with existing zbit-rs APIs unless explicitly asked.
- Add/update tests for the changed behavior.
- Do not remove license headers in Rust files.
- Update AGENTS.md with a dated bullet in "Recent Updates".
Validation:
- Run: cargo test --manifest-path zbit-rs/Cargo.toml
- Summarize failures or pass results.
Output:
- Files changed
- Why the change is correct
- Residual risks
- Rust crate root is
zbit-rs/. - Public API lives in
zbit-rs/src/lib.rsexports. - Core logic paths:
- exact minimization:
zbit-rs/src/minimizer.rs - advanced flow (heuristics/rewrite/SAT/objectives):
zbit-rs/src/advanced.rs - SAT engine:
zbit-rs/src/sat.rs - model integration:
zbit-rs/src/model.rs
- exact minimization:
- Add the short license/copyright header to every new
.rsfile. - After edits, append a dated entry to
AGENTS.md.
- Behavior check: truth-table validation still passes for care minterms.
- Serialization check:
.zbitroundtrip tests still pass. - Compression check:
.zbpkadaptive roundtrip still passes. - Objective check: if touching scoring, run advanced tests and confirm expected metric direction.
- Changelog hygiene:
AGENTS.mdupdated.
- Add micro-benchmarks for objective scoring variants in
advanced.rs. - Add deterministic tie-break tests for equal weighted-cost candidates.
- Add optional timeout/step cap in SAT solver for pathological CNFs.
- Add CLI switch in
zbit-rs/src/main.rsfor choosingMappingObjective. - Add property-style randomized test for advanced cover validity vs care set.
Escalate to a stronger agent/human review when:
- tests pass but objective metrics regress unexpectedly
- changes touch both format parsing and optimization logic in one PR
- SAT logic changes alter pruning behavior without clear proof/tests
- benchmark report shows regressions without an intentional tradeoff