Before Day 1 — Make Your Working Copy
You are not supposed to guess where code belongs. Before Day 1, create one private working copy with a known path. Every Brandforge page will name files relative to that directory.
The two copies and their jobs
Section titled “The two copies and their jobs”From the repository root, the relevant directories are:
rust/rust-ai-engineering/├── crates/brandforge/ # finished reference answer — do not edit during the lesson├── starters/brandforge/ # clean starter template — do not edit└── learning/brandforge/ # your working copy — edit this oneThe learning/ directory is ignored by Git. You can make mistakes there without damaging the finished
reference crate or mixing your learning changes into a commit.
Create the working copy
Section titled “Create the working copy”Open a terminal at the repository root, then run exactly:
cd rust/rust-ai-engineeringsh scripts/new-brandforge-lab.shcd learning/brandforgecargo runExpected output:
Brandforge learning project is ready.On the first run, Cargo may download the Rust libraries listed in Cargo.toml. “Offline first” in this
book means the required AI exercises make no paid model or scraping calls after dependencies are
installed.
Keep the terminal in rust/rust-ai-engineering/learning/brandforge for Days 1–5. When a page says
src/main.rs, the complete path is therefore:
rust/rust-ai-engineering/learning/brandforge/src/main.rsHow every edit instruction works
Section titled “How every edit instruction works”Every code step uses one of three labels:
- CREATE means the file does not exist yet. Create it and paste the complete block.
- REPLACE means select everything in that file and replace it with the complete block.
- ADD means keep the existing code and insert the small block at the stated marker.
If a block is only an explanation and should not be pasted, the page labels it READ ONLY.
Never paste Rust code into an .md book page, Cargo.toml, or a different .rs file unless the step
explicitly names that file.
Your starter tree
Section titled “Your starter tree”Before Day 1, your working copy contains:
learning/brandforge/├── Cargo.toml├── fixtures/│ ├── site.md│ ├── business-profile.json│ └── business-profile-unsupported.json└── src/ └── main.rsCargo.toml already contains the dependencies used across the five days. You do not need to understand
all of them now. Each page explains a dependency when the next feature needs it.
The command loop
Section titled “The command loop”After each edit:
cargo fmtcargo checkOnly continue when cargo check finishes successfully. If it fails, read the first error, compare the
filename and line number with the page, and fix that error before the rest.
At the end of a day, run the page’s exact cargo run or cargo test command. The page will show the
important part of the expected output.
If your working copy becomes confusing
Section titled “If your working copy becomes confusing”Do not overwrite it. Create a second clean copy so you can compare:
cd rust/rust-ai-engineeringsh scripts/new-brandforge-lab.sh learning/brandforge-2You now know where to work, which copy is the answer, and how each edit is described.