[docs] KeepSafe: Analysis, review, lessons, and G0.11 closed
This commit is contained in:
@@ -12,9 +12,9 @@ and **how to apply it**.
|
||||
| [`art.md`](art.md) | 2 | The image pipeline. |
|
||||
| [`code.md`](code.md) | 3 | TypeScript, Svelte, async ordering, Rust. |
|
||||
| [`technical.md`](technical.md) | 5 | The browser and the build as platforms. |
|
||||
| [`testing.md`](testing.md) | 8 | What makes a test worth having, and how a passing test lies. |
|
||||
| [`testing.md`](testing.md) | 9 | What makes a test worth having, and how a passing test lies. |
|
||||
| `privacy.md` | none yet | What could leave the device or make a person findable. (The geocell finding is in the review, not here: it was caught before it cost anything.) |
|
||||
| [`process.md`](process.md) | 2 | Workflow, commits, credentials, honesty about what shipped. |
|
||||
| [`process.md`](process.md) | 3 | Workflow, commits, credentials, honesty about what shipped. |
|
||||
|
||||
A file is created with its first real entry. An empty lessons file only looks like
|
||||
knowledge.
|
||||
|
||||
@@ -31,3 +31,17 @@ better source of versions than the registry.
|
||||
|
||||
**How to apply it.** Start a new repository from a sibling's resolved versions, and
|
||||
pin them exactly. Unpin deliberately, in its own commit, after upgrading Node (G0.20).
|
||||
|
||||
## A rule checked by reading a number is broken by the next command
|
||||
|
||||
**What happened.** CLAUDE.md §5.7 says not to start a full run above ~80 % CPU. Three
|
||||
times on 2026-11-02 a run started above it. Once the load was not checked at all; twice it
|
||||
was read (85 %, then 100 %, another project's tests) and the run started anyway, once
|
||||
because the check and the run were chained in one command that did not depend on it.
|
||||
|
||||
**Why it bit.** A rule that relies on a person reading a number before acting holds only
|
||||
while nothing else is competing for attention.
|
||||
|
||||
**How to apply it.** Make the run refuse to start: a gate script that samples the load
|
||||
and exits above 80 %, waiting or saying so. Until it exists, read the number in its own
|
||||
step and decide before starting the run.
|
||||
|
||||
@@ -118,3 +118,16 @@ the one case that matters.
|
||||
**How to apply it.** For each condition, write the case where only it decides (from
|
||||
0.39 a full can overshoots: needed, too full). For an order property, add one fixed
|
||||
log where order changes the answer. Then put the bug back and watch the test fail.
|
||||
|
||||
## `toEqual` cannot see a field that is `undefined`
|
||||
|
||||
**What happened.** On 2026-11-02 a drill made the rose's export file carry an extra field
|
||||
taken from the identity. The test passed: it kept no identity, so the field was
|
||||
`undefined`; `toEqual` treats a missing property and an undefined one as equal, and
|
||||
`JSON.stringify` drops it, so the text check saw nothing either.
|
||||
|
||||
**Why it bit.** "Nothing else in it" is a claim about absent fields, and the default
|
||||
equality is blind to exactly the field that is absent by accident.
|
||||
|
||||
**How to apply it.** For "holds this and nothing else", use `toStrictEqual`, and give the
|
||||
test something real to leak (here, a kept identity).
|
||||
|
||||
Reference in New Issue
Block a user