Domain 3 capstone: a build sheet that refuses an incompatible combination
Task
Assemble the domain into a machine-checkable build specification: a parts list with every compatibility constraint expressed as a rule, and a script that refuses a combination that violates one. Then prove it refuses, by planting four incompatible combinations.
Steps
- Write
lab/build/parts.csvwith headerslot,part,key_spec,constraintspecifying a complete machine -- board, processor, memory, storage, graphics, supply, cooler, case. - Write
lab/build/rules.csvwith headerrule,checks,failure_messagewith at least six rules: socket against board, memory generation against board, memory capacity against board maximum, M.2 protocol against slot, supply wattage against computed draw, and form factor against case. - Write
lab/build-check.shthat reads both files and prints PASS or the failure messages of every violated rule. It must exit non-zero on any violation. - Run it against the good specification and record the output in
lab/build/pass.txt. - Plant four incompatible combinations, one at a time, run the checker on each, and record in
lab/build/canary.csvwith headerplanted,rule_that_caught_it,exit_code-- a rule that catches nothing is a rule that does not exist.
Verify
awk -F, 'NR>1 && NF>=4 {n++} END {print n" part(s) specified"}' lab/build/parts.csv
awk -F, 'NR>1 && NF>=3 {n++} END {print n" rule(s)"}' lab/build/rules.csv
test -s lab/build-check.sh && echo "checker present"
grep -c . lab/build/pass.txt
awk -F, 'NR>1 && NF>=3 {n++} END {print n" planted fault(s)"}' lab/build/canary.csv
awk -F, 'NR>1 && $3!="0" {n++} END {print n+0" correctly refused"}' lab/build/canary.csv
Eight or more parts, six or more rules, a clean pass recorded, and four planted faults all refused with a non-zero exit. A checker that has only ever been run against a good specification has not been shown to fail, and a check that cannot go red is not a check.
Notes
The canary table is the point of the capstone and it is the discipline this whole library runs on. Prove the instrument can report a failure before believing its successes.
This is an independent study companion for CompTIA A+ Core 1 220-1201 and is not produced by or endorsed by CompTIA.