Domain 3 capstone: a build sheet that refuses an incompatible combination

capstone · 130 min · Objective 3.4

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

  1. Write lab/build/parts.csv with header slot,part,key_spec,constraint specifying a complete machine -- board, processor, memory, storage, graphics, supply, cooler, case.
  2. Write lab/build/rules.csv with header rule,checks,failure_message with 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.
  3. Write lab/build-check.sh that reads both files and prints PASS or the failure messages of every violated rule. It must exit non-zero on any violation.
  4. Run it against the good specification and record the output in lab/build/pass.txt.
  5. Plant four incompatible combinations, one at a time, run the checker on each, and record in lab/build/canary.csv with header planted,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.