Engineering principles
Every fact has one owner, criteria must prove they can turn red, the enumeration domain is derived from the output side, and a delegation in a comment is not an implementation — each with a real bad example attached.
This page is not a values pitch; it is a set of rules for recurring mistakes that we learned the hard way, each with the bad shape it corresponds to. Read these and you can predict whether this product will have the same kind of accident in its next change.
Every fact has exactly one owner
The same fact written in two places will always drift. This is not a metaphor; it is a repeatedly occurring event: one permission code written simultaneously into the server-side menu declaration, the frontend registry, the opener mapping and the page state table loses the selected state silently with a single differing letter; one "the order visitors see now" exists at the same time in a JSON field and a database column, and one edit eats one reorder. So the current rule is: anything that can live in one place never goes into two; each kind of configuration item holds only one data shape, and a snapshot pins that version of the content, not the current pointer.
A criterion must be able to turn red, and must prove it can
A guard that is "always green" is worse than no guard — it makes people stop checking. We have run into this: a syntax-check command parsed only one file at a time, so the second script onward in the list was never looked at once, while it printed "script syntax passed" every time; an assertion written as "this call appears in the source" stayed green even after the actual line was deleted, because the same call still existed in the shutdown branch. So the current practice is: break the thing being guarded and confirm the corresponding test turns red, then restore it byte by byte; the criterion must be pinned to "the path where it holds", not to "this symbol once existed".
The enumeration domain is derived from the output side, not copied from a list
The rule "do not hard-code lists" has been violated many times, and the bad shape is the same every time: the list hard-codes 12 panels, the registry grows to 19, and 7 silently lose coverage while all green. The current rule is that the enumeration domain comes from the data source itself — when a panel is added as the 13th, no test needs changing; at the same time the assertion must state "how many entries were compared", otherwise "violations: 0" and "the scanner is blind" produce identical output.
A delegation in a comment is not an implementation
There was a code comment saying "this item separately rejects example values", while the implementation only checked length — so an instance installed from the example file used a key public in the repository for credential encryption and audit-chain signing. Worse, the acceptance ledger recorded it as "done", all four gates were green, and the rule that should have protected credentials lay there for three weeks. The current criterion is: behavior tests, not comments, and not the ledger.
"The interface is sending, the UI shows nothing" is a class of accidents
A backend panel declares a field while the server neither sends nor receives it, and that column is forever a dash; an entire statistics summary is added to an interface while the generic renderer only draws rows — the interface returns 200, the declaration is valid, the menu authorization passes, and the screen shows nothing. So before a new number lands, first ask "who reads it"; after a new field lands, there must be an assertion that its rendering point exists, and the rendering point must recognize expressions that print to the screen (one used only to decide "whether a cell appears" does not count).
A guard that turns green along with the change is not proof the change is done
Removing one backend panel means touching six places at once; the consistency criteria changed on both sides together will turn green along with it (they compare "the two sides agree", not "this screen still exists"). So every time work is closed out, run the full set of gates and ask one extra question: is that interface still there.
Failures must turn red cleanly
In tests, one panic swallows every assertion after it — when we counted the impact by "number of failures", we counted 5 as 3, and the conclusion reported was exactly backwards. So before taking elements from a collection, first ask for its length, and error messages must be able to say which cell and why; a vague rejection message sends people to fix the cell that was not broken, which is why the five kinds of failure now each have their own wording.
Green lights do not mean the shipped surface is fixed
The backend UI is compiled into the binary. Running only the frontend build and not the embedding leaves the old console in the resulting binary, while build, static checks, unit tests and frontend tests are all green at four layers. This kind of "the source was changed, the artifact was tested" misalignment is now closed by one build step, not by people remembering.
Sentences with "current" in documentation expire
Historical documents are for tracing only; but the half that says "current" must be readable as no longer being true today.