Diagram, Chart and Infrastructure Explainers
Four local explainer projects. Run them, feed them, read their outputs and fix their errors.
- Concepts and terms
- Tasks and commands
- Annotated code
- Diagrams
- Comparisons
- Defaults and numbers
- Troubleshooting
- Questions and tips
Four projects side by side#
| Factor | Chart Storyboard Builder | Diagram Reading Companion | Infrastructure Plan Explainer | Service Ownership Navigator |
|---|---|---|---|---|
| Language | Python 3.10+ | Node 22.18 or newer | Python 3.10+ | Node 22.18 or newer |
| Input | csv, roles, periods, charts | svg, graph | Terraform plan JSON | catalog, path |
| Outputs | chart-N.svg, chart-specs.json, storyboard.html | graph.json, analysis.json, report.html | change-brief.md, resource-impact.json, review.html | handoff.json, catalog.json, report.html |
| Review file | none | third argument, reviewed order | none | none |
| Never does | Infer dates or causation | Read meaning from SVG geometry | Apply a plan | Send notifications |
From chart-storyboard-builder/README.md, solution/cli.py, diagram-reading-companion/README.md, solution/cli.ts, infrastructure-plan-explainer/README.md, solution/cli.py, service-ownership-navigator/README.md, solution/cli.ts
Run the reference#
| Command | What it does |
|---|---|
python3 cli.py samples/ | Chart or infrastructure sample |
node cli.ts sample.json output | Diagram or ownership sample |
node cli.ts <input.json> <dir> <review.json> | Diagram with your reviewed order |
node cli.ts --help | Prints the argument line |
python3 scripts/ | Grades the reference |
python3 scripts/ | Makes a starter |
From chart-storyboard-builder/README.md, infrastructure-plan-explainer/README.md, diagram-reading-companion/README.md, service-ownership-navigator/README.md, solution/cli.ts
Explain a real Terraform plan#
terraform show -json saved.plan > input.jsonsaved plan as JSONpython3 cli.py input.json --output reviewnever applies the planFrom infrastructure-plan-explainer/README.md, solution/cli.py
Plan explainer pipeline#
Action sequences#
| Command | What it does |
|---|---|
["create"] | create |
["update"] | update, in place |
["delete", | replace |
["create", | replace |
["delete"] | delete |
["read"], ["no-op"], ["forget"] | read, no-op, forget |
| any other list | unsupported action sequence |
Diagram companion#
Chart rules#
- roles
group,valueandunitname CSV columns and a display unit.- Reducers
sum,meanandcount. Count uses nonblank values, unitrecords.- Grammar
barfor categories,linefor ordered periods.- Blank value
- it is missing, not zero. A line breaks there.
- periods
- set the order. An absent period plots as null.
- Axis
- always includes zero.
- Annotation
- needs a plotted point. The text gets the exact value and unit.
From chart-storyboard-builder/API.md, solution/main.py, chart-storyboard-builder/README.md
Ownership rules#
- Last match wins
- the last matching rule sets the effective owners.
- Anchored
- a pattern that starts with
/or holds a/matches from the root. - Wildcards
*stays in one segment,**/spans folders,?is one character.- Directory
- a trailing
/matches the folder and all below it. - Service
- the longest service
rootthat holds the path. - Owners
@useror@org/teamnames only.- Runbook links
- local links must point to a supplied runbook file.
From solution/main.ts, service-ownership-navigator/README.md
Defaults and limits#
| Setting | Default | Note |
|---|---|---|
reducer | sum | Per chart in charts |
grammar | bar | Or line |
schema_version | 1 | Chart specs and plan brief |
| SVG size | 500000 | Characters at most |
| Rule source | CODEOWNERS | Name in the evidence rows |
| Output folder | output | Second argument of the Node CLIs |
| Chart width | 640 | Minimum SVG width in pixels |
From solution/main.py, solution/cli.py, solution/main.ts, solution/main.ts, solution/cli.ts, solution/main.py
Error messages and fixes#
| Symptom | Cause | Fix |
|---|---|---|
unsupported Terraform JSON format major | Not a terraform show -json file | Export the saved plan as JSON |
periods omit data or duplicate a group | A data group is not in periods | List every group once |
annotation needs a unique plotted point | Note on a blank or unknown group | Annotate a point with a value |
Node missing from SVG or duplicated | Manifest id has no SVG id | Add the id to the SVG element |
Unsupported SVG element | Tag outside the safe subset | Use shapes, text, g, title, desc |
Review order must contain every node exactly once | Old or partial order | List each node id one time |
Earlier matching rules name different owners; last matching rule wins | Rules overlap | Check the last rule is right |
Missing local runbook link | Runbook links a file not supplied | Add the file to runbooks |
From solution/main.py, solution/main.py, solution/main.ts, solution/main.ts
Worked examples#
- What does W1 plot with sum?
- 18. Its rows hold 8 and 10.
- What happens to W2 and W3?
- W2 is blank and W3 is absent. Both plot as missing.
- Why is the database a replace?
- Its actions are
deletethencreate. - What does the brief show for the password?
[sensitive], also inside arrays.- Who owns
services/images/cache/store.ts? @fictional/cache, from the last rule.- Where does the diagram branch?
- At
check, toshareandclarify.
From samples/input.json, chart-storyboard-builder/README.md, samples/input.json, infrastructure-plan-explainer/README.md, solution/sample.json, solution/sample.json
Tips#
- Graph edges are declared dependencies, not the provider execution order.
- The plan tool does not predict outage time, cost or full execution order.
- A reading order is a candidate for review, not a proof of pedagogy.
- Chart SVGs carry
titleanddescand no JavaScript. - The ownership format is a local subset, not the full CODEOWNERS format.
From infrastructure-plan-explainer/README.md, infrastructure-plan-explainer/API.md, diagram-reading-companion/README.md, chart-storyboard-builder/API.md, service-ownership-navigator/README.md