M3b plan: task 11 starts from a compiling skeleton of container.rs
Two sessions ended with nothing written, each out of room while planning the whole file in one turn. The skeleton has the signatures, the constants and the steps as comments; the task says to fill one function at a time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,10 @@ proxy is task 12; in this task every call runs its container with no egress dire
|
||||
|
||||
## Files
|
||||
|
||||
- Copy: `crates/brokerd/tests/support/fake_podman.rs`, `crates/brokerd/tests/container.rs`
|
||||
- Create: `crates/brokerd/src/container.rs`
|
||||
- Copy: `crates/brokerd/tests/support/fake_podman.rs`, `crates/brokerd/tests/container.rs`, and
|
||||
the **skeleton** `crates/brokerd/src/container.rs` (every signature, the constants, and `todo!()`
|
||||
bodies with the steps as comments)
|
||||
- Fill in: `crates/brokerd/src/container.rs`
|
||||
- Modify: `crates/brokerd/src/lib.rs` (`pub mod container;`), `docs/implementer-log.md`
|
||||
|
||||
## Interfaces
|
||||
@@ -88,13 +90,30 @@ the `serial()` lock first, because writing a script and running it at once races
|
||||
forks ("Text file busy"). The time-limit test's fake ends with `exec sleep 30`, so killing the
|
||||
process kills the sleep and nothing keeps the pipes open.
|
||||
|
||||
## How to work (read this first)
|
||||
|
||||
Two earlier sessions on this task ended with nothing written: each tried to plan the whole file
|
||||
in one turn and ran out of room while still deciding. So:
|
||||
|
||||
- **Start from the skeleton.** It compiles. Replace the `todo!()`s **one function at a time**, in
|
||||
this order: `read_capped`, `new`, `egress_dir`, `podman`, `wait`, `run`. After each, run
|
||||
`cargo check -p brokerd` and fix what it says before going on.
|
||||
- **Let the compiler answer API questions.** If you are unsure whether something compiles (how to
|
||||
call the log, which trait a type has), write it and run `cargo check`. The log is called as
|
||||
`(self.log)(&line)`.
|
||||
- Keep each turn short: write, check, next. Do not restate the task to yourself.
|
||||
|
||||
## Steps
|
||||
|
||||
- [ ] **1. Copy.** `git switch m3b`, then
|
||||
`cp docs/plans/M3b/files/crates/brokerd/tests/support/fake_podman.rs crates/brokerd/tests/support/`
|
||||
and `cp docs/plans/M3b/files/crates/brokerd/tests/container.rs crates/brokerd/tests/`
|
||||
- [ ] **2. See it fail.** `cargo test -p brokerd --test container`. Expected: it does not compile.
|
||||
- [ ] **3. Write `container.rs`.** Run `cargo fmt --all`.
|
||||
and `cp docs/plans/M3b/files/crates/brokerd/src/container.rs crates/brokerd/src/`, then add
|
||||
`pub mod container;` to `crates/brokerd/src/lib.rs` after `pub mod config;`.
|
||||
- [ ] **2. See it fail.** `cargo test -p brokerd --test container`. Expected: it compiles (with
|
||||
warnings about unused variables) and all 11 fail on `todo!()`.
|
||||
- [ ] **3. Fill in `container.rs`** as in "How to work". Delete the skeleton paragraph from the
|
||||
module doc. Run `cargo fmt --all`.
|
||||
- [ ] **4. See it pass.** `cargo test -p brokerd --test container`. Expected: 11 passed. Run it ten
|
||||
times; it must pass every time.
|
||||
- [ ] **5. Walk the table.** Point at the line of your code for each row, and check that no row
|
||||
|
||||
Reference in New Issue
Block a user