DOCS / DATA-CATALOGUE
Data catalogue
Every table and view in the warehouse, as DuckDB describes them, with the comments
crates/warehouse/schema.sql gives them. Generated by
cargo run -p tentzhen-warehouse -- catalogue; the test the_catalogue_is_current fails
when this file differs from what that would write. Change the schema, not this file.
Lineage
crates/warehouse loads bronze and silver from the records. An arrow runs from what is
read to what reads it: a view's SQL, or a crate's source.
flowchart LR
subgraph bronze
bronze_record["bronze.record"]
bronze_record_hash["bronze.record_hash"]
end
subgraph silver
silver_part["silver.part"]
silver_build_version["silver.build_version"]
silver_line["silver.line"]
silver_uses["silver.uses"]
silver_firmware["silver.firmware"]
silver_pin["silver.pin"]
silver_step["silver.step"]
silver_trusted_entry["silver.trusted_entry"]
silver_claim["silver.claim"]
silver_claim_value["silver.claim_value"]
silver_lab_limit["silver.lab_limit"]
silver_lab_limit_input["silver.lab_limit_input"]
silver_lab_limit_rests_on["silver.lab_limit_rests_on"]
silver_lab_limit_at_most["silver.lab_limit_at_most"]
silver_lab_target["silver.lab_target"]
silver_lab_log_entry["silver.lab_log_entry"]
silver_lab_log_value["silver.lab_log_value"]
silver_measurement["silver.measurement"]
silver_measurement_device["silver.measurement_device"]
silver_measurement_tool["silver.measurement_tool"]
silver_measurement_value["silver.measurement_value"]
silver_sourcing["silver.sourcing"]
silver_fab_row["silver.fab_row"]
silver_fab_side["silver.fab_side"]
silver_fab_route_with["silver.fab_route_with"]
silver_referent["silver.referent"]
end
subgraph gold
gold_latest["gold.latest"]
gold_claim_grades["gold.claim_grades"]
gold_claim_values["gold.claim_values"]
gold_grade_coverage["gold.grade_coverage"]
gold_build_tree["gold.build_tree"]
gold_bom_exploded["gold.bom_exploded"]
gold_where_used["gold.where_used"]
gold_bench["gold.bench"]
gold_bench_line["gold.bench_line"]
gold_sourcing_status["gold.sourcing_status"]
gold_limit_grades["gold.limit_grades"]
gold_page["gold.page"]
gold_page_line["gold.page_line"]
gold_page_uses["gold.page_uses"]
gold_page_used_in["gold.page_used_in"]
gold_page_firmware["gold.page_firmware"]
gold_page_pin["gold.page_pin"]
gold_page_step["gold.page_step"]
gold_page_parts["gold.page_parts"]
gold_page_parts_used_in["gold.page_parts_used_in"]
gold_page_fab["gold.page_fab"]
gold_legal["gold.legal"]
gold_doc["gold.doc"]
gold_doc_image["gold.doc_image"]
end
bronze -. crates/warehouse .-> silver
bronze_record --> bronze_record_hash
silver_build_version --> gold_latest
silver_claim --> gold_claim_grades
silver_referent --> gold_claim_grades
silver_claim_value --> gold_claim_values
gold_claim_grades --> gold_grade_coverage
silver_build_version --> gold_build_tree
silver_uses --> gold_build_tree
gold_build_tree --> gold_bom_exploded
silver_line --> gold_bom_exploded
gold_bom_exploded --> gold_where_used
gold_latest --> gold_bench
silver_uses --> gold_bench
gold_bench --> gold_bench_line
gold_build_tree --> gold_bench_line
silver_line --> gold_bench_line
silver_lab_log_entry --> gold_sourcing_status
silver_measurement --> gold_sourcing_status
silver_sourcing --> gold_sourcing_status
gold_claim_grades --> gold_limit_grades
silver_lab_limit --> gold_limit_grades
silver_lab_limit_input --> gold_limit_grades
silver_lab_limit_rests_on --> gold_limit_grades
bronze_record --> gold_page
bronze_record_hash --> gold_page
gold_latest --> gold_page
silver_build_version --> gold_page
silver_line --> gold_page_line
silver_part --> gold_page_line
silver_uses --> gold_page_uses
silver_uses --> gold_page_used_in
silver_firmware --> gold_page_firmware
silver_pin --> gold_page_pin
silver_step --> gold_page_step
gold_bench_line --> gold_page_parts
gold_sourcing_status --> gold_page_parts
silver_part --> gold_page_parts
gold_bench_line --> gold_page_parts_used_in
silver_fab_route_with --> gold_page_fab
silver_fab_row --> gold_page_fab
silver_fab_side --> gold_page_fab
bronze_record --> gold_legal
bronze_record --> gold_doc
bronze_record --> gold_doc_image
crates_records(["crates/records"])
gold_page_fab --> crates_records
crates_site(["crates/site"])
gold_claim_grades --> crates_site
gold_claim_values --> crates_site
gold_page --> crates_site
gold_page_line --> crates_site
gold_page_uses --> crates_site
gold_page_used_in --> crates_site
gold_page_firmware --> crates_site
gold_page_pin --> crates_site
gold_page_step --> crates_site
gold_page_parts --> crates_site
gold_page_parts_used_in --> crates_site
gold_page_fab --> crates_site
gold_legal --> crates_site
gold_doc --> crates_site
gold_doc_image --> crates_site
bronze
bronze.record (table)
Every file the loader read, exactly as read: records, drawings, site documents, the lab's limits, the lab-target list, the lab log and measurement records.
| column | type | null | about |
|---|---|---|---|
path | VARCHAR | no | The file's path, relative to the repo root. |
body | VARCHAR | no |
Constraints:
PRIMARY KEY(path)
Read by: bronze.record_hash, gold.page, gold.legal, gold.doc, gold.doc_image.
bronze.record_hash (view)
Lineage: the sha256 of each file's text.
| column | type |
|---|---|
path | VARCHAR |
sha256 | VARCHAR |
Reads: bronze.record.
Read by: gold.page.
silver
silver.part (table)
Each part record in parts/.
| column | type | null | about |
|---|---|---|---|
part | VARCHAR | no | |
kind | VARCHAR | no | |
what | VARCHAR | no | The record's is: what the part is. |
authorized_only | BOOLEAN | no | |
datasheet | VARCHAR | yes | |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(part)CHECK((kind IN ('chip', 'module', 'product')))
Read by: gold.page_line, gold.page_parts.
silver.build_version (table)
Each version of each build, from builds/
| column | type | null | about |
|---|---|---|---|
build | VARCHAR | no | |
version | INTEGER | no | |
status | VARCHAR | no | |
does | VARCHAR | no | |
changes | VARCHAR | yes | |
drawing | VARCHAR | yes | |
never_a_lab_target | VARCHAR | yes | Why no board of this build, or of a build that uses it, may be a lab target; NULL if it may. crates/records refuses such a target; the database does not. |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
CHECK(("version" >= 1))CHECK((status IN ('draft', 'published')))CHECK((main."trim"(never_a_lab_target) != ''))PRIMARY KEY(build, "version")CHECK((("version" = 1) OR (changes IS NOT NULL)))
Read by: gold.latest, gold.build_tree, gold.page.
silver.line (table)
A build version's bill of materials: a part or a commodity on each line, and how many.
| column | type | null | about |
|---|---|---|---|
build | VARCHAR | no | |
version | INTEGER | no | |
line_no | INTEGER | no | |
part | VARCHAR | yes | |
commodity | VARCHAR | yes | |
form | VARCHAR | yes | |
class | VARCHAR | no | The letter a schematic labels the thing with (R resistor, U integrated circuit, A a board or module), as crates/records lists them. crates/records holds that one thing has one class in every build version that writes it; the database does not. |
qty | INTEGER | no |
Constraints:
FOREIGN KEY (part) REFERENCES silver.part(part)CHECK(("class" IN ('A', 'C', 'F', 'J', 'MP', 'PS', 'Q', 'R', 'S', 'U', 'W', 'XF')))CHECK((qty > 0))PRIMARY KEY(build, "version", line_no)FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")CHECK(((part IS NULL) != (commodity IS NULL)))
Read by: gold.bom_exploded, gold.bench_line, gold.page_line.
silver.uses (table)
Another build version a build version is made from, and how many.
| column | type | null | about |
|---|---|---|---|
build | VARCHAR | no | |
version | INTEGER | no | |
uses_no | INTEGER | no | |
uses_build | VARCHAR | no | |
uses_version | INTEGER | no | |
qty | INTEGER | no |
Constraints:
CHECK((qty > 0))PRIMARY KEY(build, "version", uses_build, uses_version)FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")FOREIGN KEY (uses_build, uses_version) REFERENCES silver.build_version(build, "version")
Read by: gold.build_tree, gold.bench, gold.page_uses, gold.page_used_in.
silver.firmware (table)
The firmware a build version runs, pinned by its sha256.
| column | type | null | about |
|---|---|---|---|
build | VARCHAR | no | |
version | INTEGER | no | |
name | VARCHAR | no | |
license | VARCHAR | no | |
source | VARCHAR | no | |
release | VARCHAR | no | |
file | VARCHAR | no | |
sha256 | VARCHAR | no | |
pin_map | VARCHAR | yes |
Constraints:
CHECK(regexp_full_match(sha256, '[0-9a-f]{64}'))PRIMARY KEY(build, "version")FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")
Read by: gold.page_firmware.
silver.pin (table)
A build version's pin assignments.
| column | type | null | about |
|---|---|---|---|
build | VARCHAR | no | |
version | INTEGER | no | |
pin_no | INTEGER | no | |
name | VARCHAR | no | |
board_pin | INTEGER | no | |
net | VARCHAR | no | |
required | BOOLEAN | no |
Constraints:
PRIMARY KEY(build, "version", pin_no)FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")
Read by: gold.page_pin.
silver.step (table)
A build version's steps, in order.
| column | type | null | about |
|---|---|---|---|
build | VARCHAR | no | |
version | INTEGER | no | |
step_no | INTEGER | no | |
instruction | VARCHAR | no | The record's do. |
run | VARCHAR | yes | |
expect | VARCHAR | yes | |
agent | VARCHAR | yes |
Constraints:
PRIMARY KEY(build, "version", step_no)FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")
Read by: gold.page_step.
silver.trusted_entry (table)
The trusted base, from trusted-base.toml: what is assumed, not shown. A trusted referent names an entry by its id.
| column | type | null | about |
|---|---|---|---|
entry | VARCHAR | no | Its id. |
entry_no | INTEGER | no | Its place in the file, from 1. |
assumes | VARCHAR | no | |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(entry)
silver.claim (table)
What a part or a build version claims. Its grades come from its referents, never typed.
| column | type | null | about |
|---|---|---|---|
claim | VARCHAR | no | How it is cited: |
part | VARCHAR | yes | |
build | VARCHAR | yes | |
version | INTEGER | yes | |
claim_no | INTEGER | no | Its place in its record, from 1. |
id | VARCHAR | no | |
says | VARCHAR | no |
Constraints:
PRIMARY KEY(claim)FOREIGN KEY (part) REFERENCES silver.part(part)FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")CHECK(((part IS NULL) != (build IS NULL)))CHECK(((build IS NULL) = ("version" IS NULL)))UNIQUE(claim, part)UNIQUE(claim, build, "version")
Read by: gold.claim_grades.
silver.claim_value (table)
The numbers a claim states.
| column | type | null | about |
|---|---|---|---|
claim | VARCHAR | no | |
name | VARCHAR | no | Ends in its unit: min_volts, input_ratio. |
amount | DOUBLE | no |
Constraints:
FOREIGN KEY (claim) REFERENCES silver.claim(claim)PRIMARY KEY(claim, "name")
Read by: gold.claim_values.
silver.lab_limit (table)
Each limit and its basis: a person's decision (policy), a copy of another value (same_as), or a rule in crates/lab (rule).
| column | type | null | about |
|---|---|---|---|
path | VARCHAR | no | Where the value sits in the file, as table.key. |
amount | DOUBLE | yes | |
unit | VARCHAR | yes | |
choice | VARCHAR | yes | |
basis | VARCHAR | no | |
policy | VARCHAR | yes | |
rule | VARCHAR | yes | |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(path)CHECK((unit IN ('V', 'A')))CHECK((basis IN ('policy', 'same_as', 'rule')))CHECK(((amount IS NULL) = (unit IS NULL)))CHECK(((amount IS NULL) != (choice IS NULL)))CHECK(((basis = 'policy') = ("policy" IS NOT NULL)))CHECK(((basis = 'rule') = ("rule" IS NOT NULL)))
Read by: gold.limit_grades.
silver.lab_limit_input (table)
The values each limit comes from: the original it copies, or its rule's inputs.
| column | type | null | about |
|---|---|---|---|
path | VARCHAR | no | |
input | VARCHAR | no |
Constraints:
FOREIGN KEY (path) REFERENCES silver.lab_limit(path)FOREIGN KEY ("input") REFERENCES silver.lab_limit(path)PRIMARY KEY(path, "input")
Read by: gold.limit_grades.
silver.lab_limit_rests_on (table)
The claims a limit relies on to do its job.
| column | type | null | about |
|---|---|---|---|
path | VARCHAR | no | |
claim | VARCHAR | no |
Constraints:
FOREIGN KEY (path) REFERENCES silver.lab_limit(path)FOREIGN KEY (claim) REFERENCES silver.claim(claim)PRIMARY KEY(path, claim)
Read by: gold.limit_grades.
silver.lab_limit_at_most (table)
A number a limit may not exceed: a value of a claim it rests on. crates/lab holds the limit to it.
| column | type | null | about |
|---|---|---|---|
path | VARCHAR | no | |
claim | VARCHAR | no | |
name | VARCHAR | no | The claim's value, in silver.claim_value. |
Constraints:
PRIMARY KEY(path)FOREIGN KEY (path) REFERENCES silver.lab_limit(path)FOREIGN KEY (path, claim) REFERENCES silver.lab_limit_rests_on(path, claim)FOREIGN KEY (claim, "name") REFERENCES silver.claim_value(claim, "name")
silver.lab_target (table)
Each board an agent may flash without asking first: one physical board, a part or a build version. crates/records holds each flash in the lab log to it.
| column | type | null | about |
|---|---|---|---|
target | VARCHAR | no | Its id, written on a label on the board. |
part | VARCHAR | yes | |
build | VARCHAR | yes | |
version | INTEGER | yes | |
serial | VARCHAR | no | The serial the board reports, which no other target's is. |
listed | DATE | no | The first UTC day it may be flashed. |
approved_by | VARCHAR | no | On whose decision it was listed: a person's, as person: |
retired | DATE | yes | The UTC day it stops being a target, once it has. |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY("target")FOREIGN KEY (part) REFERENCES silver.part(part)UNIQUE(serial)CHECK(regexp_full_match(approved_by, 'person:[a-z0-9-]+'))FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")CHECK(((part IS NULL) != (build IS NULL)))CHECK(((build IS NULL) = ("version" IS NULL)))CHECK((retired > listed))
silver.lab_log_entry (table)
Each hardware action in the lab log, numbered in the log's order. Each entry names the sha256 of the line before it.
| column | type | null | about |
|---|---|---|---|
seq | INTEGER | no | Its place in the log, from 1. |
logged_at | TIMESTAMP | no | The entry's at, in UTC. |
by_kind | VARCHAR | no | Who acted, from the entry's by: a person or an agent. |
by_name | VARCHAR | no | |
what | VARCHAR | no | The action, such as supply.set. |
limits_sha256 | VARCHAR | no | The sha256 of lab/limits.toml as the host read it when the entry was written. Nothing checks that it names a version of that file. |
sha256 | VARCHAR | no | The sha256 of the entry's line, which the next entry names as its prev. |
prev | VARCHAR | yes | The sha256 of the line before it; NULL only for the first entry. Unique, so the log cannot fork. |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(seq)CHECK((seq >= 1))CHECK((by_kind IN ('person', 'agent')))CHECK(regexp_full_match(limits_sha256, '[0-9a-f]{64}'))UNIQUE(sha256)CHECK(regexp_full_match(sha256, '[0-9a-f]{64}'))UNIQUE(prev)FOREIGN KEY (prev) REFERENCES silver.lab_log_entry(sha256)CHECK(((seq = 1) = (prev IS NULL)))
Read by: gold.sourcing_status.
silver.lab_log_value (table)
What each action was asked to do (params) and what happened (result): each a number, a word or a yes/no.
| column | type | null | about |
|---|---|---|---|
seq | INTEGER | no | |
side | VARCHAR | no | |
name | VARCHAR | no | A number's name ends in its unit: set_volts. |
amount | DOUBLE | yes | |
text | VARCHAR | yes | |
flag | BOOLEAN | yes |
Constraints:
FOREIGN KEY (seq) REFERENCES silver.lab_log_entry(seq)CHECK((side IN ('params', 'result')))PRIMARY KEY(seq, side, "name")CHECK((((CAST((amount IS NOT NULL) AS INTEGER) + CAST(("text" IS NOT NULL) AS INTEGER)) + CAST((flag IS NOT NULL) AS INTEGER)) = 1))
silver.measurement (table)
Each measurement record: one experiment on the bench, and the lab-log entries it came from. A claim's record referent names one.
| column | type | null | about |
|---|---|---|---|
measurement | VARCHAR | no | Its id, the file's name: |
measures | VARCHAR | no | What was measured. |
setup | VARCHAR | no | How it was wired and set. |
log_first | VARCHAR | no | Its first lab-log entry, by the sha256 of its line. |
log_last | VARCHAR | no | Its last lab-log entry, by the sha256 of its line. crates/records holds it at or after the first. |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(measurement)FOREIGN KEY (log_first) REFERENCES silver.lab_log_entry(sha256)FOREIGN KEY (log_last) REFERENCES silver.lab_log_entry(sha256)
Read by: gold.sourcing_status.
silver.measurement_device (table)
What each experiment measured (device) and what read it (meter): a part or a build version, with the hashes of the code it ran.
| column | type | null | about |
|---|---|---|---|
measurement | VARCHAR | no | |
role | VARCHAR | no | |
device_no | INTEGER | no | Its place among the record's devices, or its meters, from 1. |
part | VARCHAR | yes | |
build | VARCHAR | yes | |
version | INTEGER | yes | |
revision | VARCHAR | yes | A part's hardware revision, as marked on it. A build's is its version. |
firmware_sha256 | VARCHAR | yes | |
gateware_sha256 | VARCHAR | yes | |
accuracy | VARCHAR | yes | A meter's: the claim on its own record that gives its accuracy. |
Constraints:
FOREIGN KEY (measurement) REFERENCES silver.measurement(measurement)CHECK(("role" IN ('device', 'meter')))FOREIGN KEY (part) REFERENCES silver.part(part)CHECK(regexp_full_match(firmware_sha256, '[0-9a-f]{64}'))CHECK(regexp_full_match(gateware_sha256, '[0-9a-f]{64}'))PRIMARY KEY(measurement, "role", device_no)FOREIGN KEY (build, "version") REFERENCES silver.build_version(build, "version")FOREIGN KEY (accuracy, part) REFERENCES silver.claim(claim, part)FOREIGN KEY (accuracy, build, "version") REFERENCES silver.claim(claim, build, "version")CHECK(((part IS NULL) != (build IS NULL)))CHECK(((build IS NULL) = ("version" IS NULL)))CHECK(((revision IS NULL) OR (part IS NOT NULL)))CHECK((("role" = 'meter') = (accuracy IS NOT NULL)))
silver.measurement_tool (table)
The tools each experiment used, and their versions.
| column | type | null | about |
|---|---|---|---|
measurement | VARCHAR | no | |
tool | VARCHAR | no | |
version | VARCHAR | no |
Constraints:
FOREIGN KEY (measurement) REFERENCES silver.measurement(measurement)PRIMARY KEY(measurement, tool)
silver.measurement_value (table)
What each experiment found: each a number, a word or a yes/no.
| column | type | null | about |
|---|---|---|---|
measurement | VARCHAR | no | |
name | VARCHAR | no | A number's name ends in its unit: input_volts. A raw ADC code, input_codes, sits beside the value converted from it; crates/records holds that. |
amount | DOUBLE | yes | |
text | VARCHAR | yes | |
flag | BOOLEAN | yes |
Constraints:
FOREIGN KEY (measurement) REFERENCES silver.measurement(measurement)PRIMARY KEY(measurement, "name")CHECK((((CAST((amount IS NOT NULL) AS INTEGER) + CAST(("text" IS NOT NULL) AS INTEGER)) + CAST((flag IS NOT NULL) AS INTEGER)) = 1))
silver.sourcing (table)
Where the lab buys each thing its builds need, and which stages it has reached, each on the UTC day in its _on column when the file gives one. A thing with no row, or a row that has reached no stage, is specced.
| column | type | null | about |
|---|---|---|---|
line_no | INTEGER | no | Its place in the file, from 1. |
part | VARCHAR | yes | |
form | VARCHAR | yes | |
commodity | VARCHAR | yes | |
shop | VARCHAR | yes | |
store | VARCHAR | yes | The seller, as the listing names it, or, with no shop, its own name: a store in town, a thrift store, a person. |
item | VARCHAR | yes | The shop's item number: on Amazon the ASIN, on LCSC the C number. crates/records holds its shape. |
used | BOOLEAN | no | Bought secondhand. |
salvaged_from | VARCHAR | yes | The device a part was taken out of; used, and with no shop. |
authorized | VARCHAR | yes | Where the maker lists the seller as an authorized distributor, or that the maker sold it itself, and when: a seller's, for a part sold new. crates/records holds that a part sold by authorized sellers only, or whose claims rest on maker-datasheets, gives it once a source or a stage is written. |
listing_checked | BOOLEAN | no | A person checked the listing against the build. |
in_cart | BOOLEAN | no | |
ordered | BOOLEAN | no | |
arrived | BOOLEAN | no | |
listing_checked_on | DATE | yes | |
in_cart_on | DATE | yes | |
ordered_on | DATE | yes | |
arrived_on | DATE | yes | |
passed_qa | VARCHAR | yes | The measurement record of the incoming QA it passed. crates/records holds that it lists the part and is from on or after each day the stages give; the database holds that it exists. |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(line_no)FOREIGN KEY (part) REFERENCES silver.part(part)CHECK((shop IN ('aliexpress', 'amazon', 'lcsc', 'taobao')))CHECK(((listing_checked_on IS NULL) OR listing_checked))CHECK(((in_cart_on IS NULL) OR in_cart))CHECK(((ordered_on IS NULL) OR ordered))CHECK(((arrived_on IS NULL) OR arrived))FOREIGN KEY (passed_qa) REFERENCES silver.measurement(measurement)CHECK(((part IS NULL) != (commodity IS NULL)))CHECK(((shop IS NULL) = (item IS NULL)))CHECK(((salvaged_from IS NULL) OR (shop IS NULL)))CHECK((NOT (used AND (salvaged_from IS NOT NULL))))CHECK(((authorized IS NULL) OR (shop IS NOT NULL) OR (store IS NOT NULL)))CHECK(((authorized IS NULL) OR (NOT (used OR (salvaged_from IS NOT NULL)))))CHECK(((shop IS NOT NULL) OR (NOT (listing_checked OR in_cart OR ordered))))CHECK(((listing_checked_on <= in_cart_on) AND (listing_checked_on <= ordered_on) AND (listing_checked_on <= arrived_on) AND (in_cart_on <= ordered_on) AND (in_cart_on <= arrived_on) AND (ordered_on <= arrived_on)))
Read by: gold.sourcing_status.
silver.fab_row (table)
One thing Hacker Fab's stack and the industry's are compared on, and Tentzhen's route across the gap between them: a proposal.
| column | type | null | about |
|---|---|---|---|
row_no | INTEGER | no | Its place in the file, from 1. A layer's rows are consecutive. |
layer | VARCHAR | no | |
measure | VARCHAR | no | |
unit | VARCHAR | yes | The SI unit of both sides' values: 1 for a count or ratio. NULL when neither side has a value. |
better | VARCHAR | yes | Which way the measure improves, given when both sides have a value, so that gold.page_fab can work out the gap. |
gap | VARCHAR | yes | The gap in words, given when a side has no value. |
route | VARCHAR | no | |
why_not | VARCHAR | yes | Why the route is built with neither Rust nor CortenForge, when it is not. |
record | VARCHAR | no | The file in bronze.record this row came from. |
Constraints:
PRIMARY KEY(row_no)CHECK((better IN ('lower', 'higher')))UNIQUE(layer, measure)CHECK(((better IS NULL) != (gap IS NULL)))
Read by: gold.page_fab.
silver.fab_side (table)
Hacker Fab's side of a row, or the industry's: a value in the row's unit or the side in words, what has it, and the source's own words for it.
| column | type | null | about |
|---|---|---|---|
row_no | INTEGER | no | |
side | VARCHAR | no | |
value | DOUBLE | yes | |
is_words | VARCHAR | yes | |
tool | VARCHAR | no | |
note | VARCHAR | yes | The conditions the source attaches to the figure. |
quote | VARCHAR | no | The source's own words, which hold the value. Nothing checks them against the source. |
source | VARCHAR | no | A URL, or owner/repo@sha:path for a file in a repository at a commit. |
read_on | DATE | no | The UTC day the source was read. |
Constraints:
FOREIGN KEY (row_no) REFERENCES silver.fab_row(row_no)CHECK((side IN ('hacker_fab', 'industry')))CHECK(("value" > 0))PRIMARY KEY(row_no, side)CHECK((("value" IS NULL) != (is_words IS NULL)))
Read by: gold.page_fab.
silver.fab_route_with (table)
What a row's route is built with, in the file's order: Rust, CortenForge, Amaranth, KiCad, or bought.
| column | type | null | about |
|---|---|---|---|
row_no | INTEGER | no | |
with_no | INTEGER | no | |
tool | VARCHAR | no |
Constraints:
FOREIGN KEY (row_no) REFERENCES silver.fab_row(row_no)PRIMARY KEY(row_no, with_no)UNIQUE(row_no, tool)
Read by: gold.page_fab.
silver.referent (table)
What shows a claim: a proof, a bounded check or a test in simulation; a bench measurement record; or an entry in the trusted base.
| column | type | null | about |
|---|---|---|---|
claim | VARCHAR | no | |
kind | VARCHAR | no | |
evidence | VARCHAR | yes | The proof, check or test, as the claim names it. Nothing checks that it exists. |
trusted | VARCHAR | yes | For a trusted referent, the entry in the trusted base that assumes the claim. |
measurement | VARCHAR | yes | For a record referent, the measurement record that shows the claim. crates/records holds that the record measured the claim's subject. |
Constraints:
FOREIGN KEY (claim) REFERENCES silver.claim(claim)CHECK((kind IN ('proof', 'check', 'test', 'record', 'trusted')))FOREIGN KEY ("trusted") REFERENCES silver.trusted_entry(entry)FOREIGN KEY (measurement) REFERENCES silver.measurement(measurement)PRIMARY KEY(claim, kind)CHECK(((kind = 'trusted') = ("trusted" IS NOT NULL)))CHECK(((kind = 'record') = (measurement IS NOT NULL)))CHECK(((evidence IS NULL) = (kind IN ('trusted', 'record'))))
Read by: gold.claim_grades.
gold
gold.latest (view)
The newest version of each build.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
Reads: silver.build_version.
Read by: gold.bench, gold.page.
gold.claim_grades (view)
Every claim on a part or a build version, with its grade on each axis: in simulation (proven, checked, tested) and on the bench (measured, trusted), each the strongest its referents give. No referent reads 'unknown'.
| column | type |
|---|---|
claim | VARCHAR |
part | VARCHAR |
build | VARCHAR |
version | INTEGER |
claim_no | INTEGER |
id | VARCHAR |
says | VARCHAR |
sim_grade | VARCHAR |
sim_evidence | VARCHAR |
bench_grade | VARCHAR |
bench_evidence | VARCHAR |
Reads: silver.claim, silver.referent.
Read by: gold.grade_coverage, gold.limit_grades, crates/site.
gold.claim_values (view)
The numbers each claim states, for readers that write them into the claim's words.
| column | type |
|---|---|
claim | VARCHAR |
name | VARCHAR |
amount | DOUBLE |
Reads: silver.claim_value.
Read by: crates/site.
gold.grade_coverage (view)
How much of each part and build version is shown, and how.
| column | type |
|---|---|
subject | VARCHAR |
claims | BIGINT |
shown_in_sim | BIGINT |
measured | BIGINT |
trusted | BIGINT |
unknown | BIGINT |
Reads: gold.claim_grades.
Read by: no crate yet.
gold.build_tree (view)
Every build version each build version is made of, itself included, and how many of it, through every build it uses. The records forbid uses loops, so the recursion ends.
| column | type |
|---|---|
root_build | VARCHAR |
root_version | INTEGER |
build | VARCHAR |
version | INTEGER |
qty | HUGEINT |
Reads: silver.build_version, silver.uses.
Read by: gold.bom_exploded, gold.bench_line.
gold.bom_exploded (view)
Every part and commodity a build version needs, through every build it uses, with quantities multiplied down the tree.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
part | VARCHAR |
commodity | VARCHAR |
form | VARCHAR |
qty | HUGEINT |
Reads: gold.build_tree, silver.line.
Read by: gold.where_used.
gold.where_used (view)
Where each part ends up, directly or inside another build.
| column | type |
|---|---|
part | VARCHAR |
build | VARCHAR |
version | INTEGER |
qty | HUGEINT |
Reads: gold.bom_exploded.
Read by: no crate yet.
gold.bench (view)
The build versions the lab builds, each once: the newest version of every build, less one that the newest version of another build uses, which is built inside that one.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
Reads: gold.latest, silver.uses.
Read by: gold.bench_line.
gold.bench_line (view)
Every line the bench needs, in the build version that writes it, with how many: its qty times how many of that version the builds in gold.bench take. parts_no is its row on the parts list, shared by every line that buys the same thing (part and form, or commodity and form): the place of the first such line, by build, version and line.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
line_no | INTEGER |
part | VARCHAR |
form | VARCHAR |
commodity | VARCHAR |
class | VARCHAR |
qty | HUGEINT |
parts_no | BIGINT |
Reads: gold.bench, gold.build_tree, silver.line.
Read by: gold.page_parts, gold.page_parts_used_in.
gold.sourcing_status (view)
Each line of the lab's sourcing with its status, the last stage it has reached, never typed, and since, the UTC day it reached that stage: for incoming QA, the day of its record's first lab-log entry; NULL while specced, or when the file gives no day for that stage.
| column | type |
|---|---|
line_no | INTEGER |
part | VARCHAR |
form | VARCHAR |
commodity | VARCHAR |
shop | VARCHAR |
store | VARCHAR |
item | VARCHAR |
used | BOOLEAN |
salvaged_from | VARCHAR |
authorized | VARCHAR |
status | VARCHAR |
since | DATE |
passed_qa | VARCHAR |
Reads: silver.lab_log_entry, silver.measurement, silver.sourcing.
Read by: gold.page_parts.
gold.limit_grades (view)
Each limit with the weakest bench grade (measured, trusted) among the claims it rests on, directly or through any value it comes from. NULL when it rests on no claim: nothing here claims it does its job.
| column | type |
|---|---|
path | VARCHAR |
amount | DOUBLE |
unit | VARCHAR |
choice | VARCHAR |
basis | VARCHAR |
weakest_grade | VARCHAR |
rests_on | VARCHAR |
Reads: gold.claim_grades, silver.lab_limit, silver.lab_limit_input, silver.lab_limit_rests_on.
Read by: no crate yet.
gold.page (view)
One row per build version, with its newest sibling, its drawing and the hash of its record.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
status | VARCHAR |
does | VARCHAR |
changes | VARCHAR |
latest | INTEGER |
latest_changes | VARCHAR |
drawing_svg | VARCHAR |
record | VARCHAR |
record_sha256 | VARCHAR |
Reads: bronze.record, bronze.record_hash, gold.latest, silver.build_version.
Read by: crates/site.
gold.page_line (view)
A build page's bill of materials, with each part's datasheet and whether it must come from an authorized distributor.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
line_no | INTEGER |
qty | INTEGER |
part | VARCHAR |
commodity | VARCHAR |
form | VARCHAR |
datasheet | VARCHAR |
authorized_only | BOOLEAN |
Reads: silver.line, silver.part.
Read by: crates/site.
gold.page_uses (view)
The build versions a build version is made from, for its page.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
uses_no | INTEGER |
uses_build | VARCHAR |
uses_version | INTEGER |
qty | INTEGER |
Reads: silver.uses.
Read by: crates/site.
gold.page_used_in (view)
silver.uses read the other way: where each build version is used.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
in_build | VARCHAR |
in_version | INTEGER |
qty | INTEGER |
Reads: silver.uses.
Read by: crates/site.
gold.page_firmware (view)
silver.firmware, for build pages.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
name | VARCHAR |
license | VARCHAR |
source | VARCHAR |
release | VARCHAR |
file | VARCHAR |
sha256 | VARCHAR |
pin_map | VARCHAR |
Reads: silver.firmware.
Read by: crates/site.
gold.page_pin (view)
silver.pin, for build pages.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
pin_no | INTEGER |
name | VARCHAR |
board_pin | INTEGER |
net | VARCHAR |
required | BOOLEAN |
Reads: silver.pin.
Read by: crates/site.
gold.page_step (view)
silver.step, for build pages.
| column | type |
|---|---|
build | VARCHAR |
version | INTEGER |
step_no | INTEGER |
instruction | VARCHAR |
run | VARCHAR |
expect | VARCHAR |
agent | VARCHAR |
Reads: silver.step.
Read by: crates/site.
gold.page_parts (view)
The parts page: each thing the bench needs once, with its class, how many, where the lab buys it and how far it has got. No prices: CLAUDE.md keeps them out.
| column | type |
|---|---|
parts_no | BIGINT |
class | VARCHAR |
qty | HUGEINT |
part | VARCHAR |
form | VARCHAR |
commodity | VARCHAR |
datasheet | VARCHAR |
authorized_only | BOOLEAN |
shop | VARCHAR |
store | VARCHAR |
item | VARCHAR |
used | BOOLEAN |
salvaged_from | VARCHAR |
authorized | VARCHAR |
status | VARCHAR |
since | DATE |
passed_qa | VARCHAR |
Reads: gold.bench_line, gold.sourcing_status, silver.part.
Read by: crates/site.
gold.page_parts_used_in (view)
The build versions that write each row of the parts page, and how many each needs.
| column | type |
|---|---|
parts_no | BIGINT |
build | VARCHAR |
version | INTEGER |
qty | HUGEINT |
Reads: gold.bench_line.
Read by: crates/site.
gold.page_fab (view)
The fab page: each row with both sides, and, when both have a value, the gap as a factor: how many times better the industry's figure is than Hacker Fab's, below 1 where Hacker Fab's is better.
| column | type |
|---|---|
row_no | INTEGER |
layer | VARCHAR |
measure | VARCHAR |
unit | VARCHAR |
better | VARCHAR |
gap | VARCHAR |
route | VARCHAR |
why_not | VARCHAR |
built_with | VARCHAR |
hf_value | DOUBLE |
hf_is | VARCHAR |
hf_tool | VARCHAR |
hf_note | VARCHAR |
hf_quote | VARCHAR |
hf_source | VARCHAR |
hf_read | DATE |
ind_value | DOUBLE |
ind_is | VARCHAR |
ind_tool | VARCHAR |
ind_note | VARCHAR |
ind_quote | VARCHAR |
ind_source | VARCHAR |
ind_read | DATE |
factor | DOUBLE |
Reads: silver.fab_route_with, silver.fab_row, silver.fab_side.
Read by: crates/records, crates/site.
gold.legal (view)
The disclaimer, as the site's legal page shows it.
| column | type |
|---|---|
body | VARCHAR |
Reads: bronze.record.
Read by: crates/site.
gold.doc (view)
Each doc in docs/, in Markdown, by its name: the site makes a page of each.
| column | type |
|---|---|
name | VARCHAR |
path | VARCHAR |
body | VARCHAR |
Reads: bronze.record.
Read by: crates/site.
gold.doc_image (view)
Each drawing in docs/img/, which the doc pages show.
| column | type |
|---|---|
file | VARCHAR |
body | VARCHAR |
Reads: bronze.record.
Read by: crates/site.
Written in docs/data-catalogue.md, on main; this page is made from it.