Skip to content

Revision · Project 1 — Brandforge

Brandforge began with the exciting part—make an advertisement—but did not stop at an impressive image. You built the software boundaries that decide whether the artifact is safe to create.

  • Ownership and borrowing: one buffer owns the frozen website snapshot; validation and hashing borrow it.
  • Typed commands: Clap converts shell text into a command enum and PathBuf values.
  • Structs and Serde: model output crosses into Rust through an exact BusinessProfile contract.
  • Validation layers: JSON syntax, structural decoding, domain validity, evidence support, and product quality are different claims.
  • Traits: the product depends on a profile-producing capability rather than a vendor’s complete SDK.
  • Enums: supported and unsupported claims are explicit states with exhaustive handling.
  • Iterators: claim audits transform a list of proposals into a list of evidence verdicts.
  • Errors and exit codes: failures name their boundary and automation can trust the process status.
  • Artifacts and hashes: a run records the exact source and model profile that produced its outputs.
  • Tests: fast unit cases prove deterministic rules; CLI tests prove the user’s success and failure paths.

Prompt instructions are requests, not enforcement. A model can propose a structured profile and an image prompt, but independent code must decide whether the structure is valid and the factual claims are supported. The first useful harness is often one deterministic gate after one probabilistic step.

Without opening the reference crate, sketch:

  1. the BusinessProfile, Claim, and ClaimStatus types;
  2. the function signature for auditing claims;
  3. the order in which the pipeline writes diagnostic and publishable artifacts;
  4. the assertions in the unsupported-claim integration test.

Then compare your sketch with crates/brandforge and explain every difference.

You are ready to continue when you can:

  • build the campaign pack from the supported fixture;
  • make the unsupported fixture fail without producing a preview;
  • explain why valid JSON is not verified advertising content;
  • locate the source and profile hashes in the run report;
  • add one claim and its evidence without changing Rust code;
  • make all nine tests pass.

Next project: AskDocs — cited answers from your own files →.