Getting started¶
From an empty folder to a pipeline whose spec is written and checked, in about 15 minutes. The
example reads an input dataset, cleans it and writes the result. The commands run as written
(they are tested): copy them, then replace the names and the <...> with your own.
First, in a minute: archvow try copies a finished example into a scratch folder, makes the change an
AI assistant often makes and shows check stop it. Nothing outside that folder is written.
You need archvow installed (Installation) and Git. Building a web
service instead? The same flow with -t fastapi-service: its project's README walks through it
(The fastapi-service template).
1. Create the project¶
NAME=my_pipeline # the project: a snake_case Python package name
mkdir "$NAME" && cd "$NAME"
archvow init "$NAME" -t pyspark-pipeline -d "PySpark pipeline for $NAME" -a architects=@my-team -a ai_tools=claude-code
python3 -m pip install -r requirements.txt
git add -A && git commit -m "archvow init" # the only commit on main
git switch -c develop && git switch -c feature/US-001-orders # gitflow: the Git hook refuses commits on main and develop
init writes the spec folder .archvow/ and the guards (rules for AI assistants, ruff and
pytest settings, CI, code owners, the Git hook, entrypoint.sh...). It writes no source code.
archvow init --help lists every answer you can give with -a; the defaults suit most
projects. Only architects (who approves changes to the spec) is required.
The project's documents (README, AGENTS.md, guide, specs) are in English; -a language=fr
writes them in French. Commands and their answers are the same in both languages.
archvow doctor checks that your machine has what the project needs (Java, PySpark, the Git
hook...).
2. Say what must exist¶
archvow component add schema sales -d "Sales records: id string, amount double" -s US-001
archvow component add reader sales -d "Read one CSV file with a header and enforce SALES_SCHEMA" -s US-001 -u sales_schema
archvow component add transformation clean_sales -d "Keep the rows with an id and an amount >= 0" -s US-001 -u sales_schema
archvow component add writer revenue -d "Write the result as parquet" -s US-001
archvow component add job "$NAME" -d "Read, clean, write" -s US-001 -u sales_reader,clean_sales,revenue_writer
archvow component add entrypoint "$NAME" -d "Command line: --input-path CSV, --output-path folder" -s US-001 -u "${NAME}_job"
Each component add declares one component: its file, its public function and signature, its
layer, its test file. The description -d is the instruction the developer or the AI will
implement. -s links a ticket, -u lists the components it uses.
3. Decide what each component does¶
archvow show clean_sales # everything about it: its numbered questions, rules, safety questions
archvow show # one line per component: what is still open
Answer every question: what it computes, then the edge cases. Nothing is decided silently.
In a terminal, archvow specify asks them one at a time; or answer with decision make.
The same answer to several questions: archvow decision make clean_sales 3,4 "No".
archvow decision make spark 1 "spark.sql.session.timeZone=UTC, nothing else"
archvow decision make logging_setup 1 "stderr, one line per event: time, level, component, message"
archvow decision make config 1 "input_path: str, output_path: str"
archvow decision make config 2 "ValueError raised in __post_init__ for an empty path"
archvow decision make sales_schema 1 "id is never null; amount may be null"
archvow decision make sales_schema 2 "None: no personal data"
archvow column set sales_schema id,amount none # GDPR: every column classified
archvow decision make sales_reader 1 "Fail with a clear error"
archvow decision make sales_reader 2 "Fail the job (FAILFAST)"
archvow decision make sales_reader 3 "One CSV file given by path, no partitions"
archvow decision make sales_reader 4 "No: Spark reads it itself"
archvow decision make clean_sales 1 "Rows with an id and amount >= 0"
archvow decision make clean_sales 2 "The schema columns, unchanged"
archvow decision make clean_sales 3 "No grouping"
archvow decision make clean_sales 4 "No join"
archvow decision make clean_sales 5 "Return an empty DataFrame with the output schema"
archvow decision make clean_sales 6 "Drop rows with a null id"
archvow decision make clean_sales 7 "Keep duplicates"
archvow decision make clean_sales 8 "Drop rows with amount < 0"
archvow decision make clean_sales 9 "Drop them: output only the schema columns"
archvow rule add clean_sales "Given a row with a null id, when it is cleaned, then it is dropped"
archvow decision make revenue_writer 1 "Overwrite"
archvow decision make revenue_writer 2 "Write to a temporary folder next to the output, then rename it"
archvow decision make revenue_writer 3 "Yes: the same input gives the same output"
archvow decision make revenue_writer 4 "Parquet, not partitioned"
archvow decision make revenue_writer 5 "No: Spark writes them itself"
archvow decision make "${NAME}_job" 1 "Fail"
archvow decision make "${NAME}_job" 2 "No automatic retry; a re-run is safe"
archvow decision make "${NAME}_job" 3 "No run date: the job processes the file it is given"
archvow decision make "${NAME}_main" 1 "Exit code 2 with a usage message"
archvow decision make "${NAME}_main" 2 "0 success, 1 job failure, 2 invalid arguments"
4. Say what must never happen¶
archvow hazard add clean_sales S3 high "A valid row is dropped"
archvow invariant add clean_sales "every row with an id and amount >= 0 is kept"
archvow hazard add revenue_writer S1 critical "Downstream reads a half-written output"
archvow invariant add revenue_writer "the output folder is complete or absent" --verify runtime
archvow show <component> numbers the safety questions S1, S2... (red ✖ open, green ✔
answered); hazard add and hazard dismiss take that number (S3, or 3), and archvow
specify asks them one at a time. A hazard is what must never happen; an
invariant is the property that prevents it. By default an invariant guards the component's
hazard that has none yet and is proven by a test (a Hypothesis property test for a critical
hazard); --verify runtime asks for a guard in the code instead. Severities: critical = data
lost or wrong results that cannot be undone, high = wrong results reach users, medium = a delay
or a re-run, low = noticed and fixed without harm.
5. Commit the spec¶
git add .archvow && git commit -m "US-001: specify $NAME"
6. Write the code¶
archvow next # the build order, and what each component waits for
- With an AI assistant: in its chat, one line -
implement everything archvow next lists as ready.AGENTS.mdtells it what "implement" means: read the spec, write the file with its header and its tests, run the checks, report what it assumed. - Yourself: open
archvow show <component>; it is your task.
Commit as you go: the Git hook runs ruff and archvow check, and refuses code that does
not follow the spec, with the reason.
7. Check and run¶
archvow check # the code follows the spec
archvow check --complete # release gate: every planned component is written
SPARK_MASTER="local[*]" ./entrypoint.sh "$NAME" --input-path in.csv --output-path out/result # once the code exists
The project's own README.md repeats this flow with its names, and shows how the project
looks when it is finished. Next: Daily workflow.