Explorar el Código

docs: the step before 'what else would produce this' - an inference with no observation in it

Two instances within an hour, in opposite directions. I nearly refused to
raise run-log retention because 'store size is what took prod down' -
every clause true, no measurement anywhere; a row is ~711 bytes, so a day
costs 2-3 MB against a 607 MB store, wrong by 100x. A consumer nearly had
me divide by a negative delta because facts_versions is not monotonic.

The tell is grammatical: the sentence goes from a true general fact
straight to a magnitude with no step where anything was counted. More
scepticism cannot help when every premise survives scrutiny.

Also records that their 50-run report was a correct observation whose
cause sits one layer over - limit IS honoured and clamped to retention,
so the handler has nothing to fix and the remedies are disjoint.
fszontagh hace 1 mes
padre
commit
abb031b466
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      CLAUDE.md

+ 5 - 0
CLAUDE.md

@@ -65,6 +65,11 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
 - **STATE THE RULE, NOT THE LIST - a list of names makes the blast radius something each consumer has to ask about.** I told consumers that the index-values route "now refuses `offset`, `page`, `cursor`, `sort`, `fields`, `after`, `skip`", and a consumer had to gate their deploy approval on asking whether it was a SHARED query-string validator, because they send `offset` and `sort` to the DOCUMENTS listing where both are load-bearing. The rule is **"refuse what you cannot honour"**: the documents route IMPLEMENTS both, so accepting them is correct, while the values route's underlying client call takes `(collection, field, limit, ascending)` and has no offset at all, so accepting them was the defect. Stated that way the scope is DERIVABLE; stated as seven names it reads like a generic set and invites exactly the question it got.
   Worth pairing with the verification lesson, because answering it needed both: reading `opts.offset = parseUInt(...)` proves the parameter is CONSUMED, and disjoint page1/page2 proves it is HONOURED. Different claims, and this whole week turned on the gap between them.
 - **THE WHOLE FAMILY IN ONE SENTENCE, FROM A CONSUMER AFTER A DAY OF FINDING THEM: WHEN THE OBSERVABLE IS IDENTICAL IN THE WORKING AND BROKEN CASES, THE ONLY ESCAPE IS TO VARY THE INPUT AND DEMAND THE OUTPUT VARY WITH IT.** Four separate findings on 2026-10-15 had exactly that structure, two of them ours and two theirs: a report returning `ok` with nobody mailed; a comment-only edit "proving" a deploy skip, when the bundler had stripped the comment so there was genuinely nothing to push; a row count that cannot see a truncated document; and a **200 for an input the handler discarded**. In every one the passing observation was real and the inference from it was unsupported, and no amount of care in reading the result would have helped, because the result is the same either way. **A control with a DIFFERING input is the one test such a failure cannot survive** - which is also why the falsifiability pairing exists in the query-param tests, and why the prune was verified by reading a document body back rather than by watching a count fall.
+- **THE STEP BEFORE THAT QUESTION: AN INFERENCE THAT NEVER TOUCHES A NUMBER AT ALL. "WHAT ELSE WOULD PRODUCE THIS RESULT" ASSUMES THERE WAS A RESULT - AND THE MOST EXPENSIVE CALLS OF 2026-10-19 HAD NO OBSERVATION IN THEM WHATSOEVER.** Named by a consumer after we each did it once in opposite directions within an hour, which is what makes it a shape rather than an anecdote.
+  - **Mine, nearly refusing something cheap:** a consumer asked to raise the function run log's retention from 50, and I almost declined on the grounds that "store size is exactly what took prod down this morning, so today is the wrong day to grow a collection." Every clause of that is TRUE and the sentence contains no measurement. Measured instead: a run row is **~711 bytes** (601 docs / 427,481 bytes on `justice-pa:vectorapi_function_runs`, small because capping it turned versioning off), only 2 of their 18 functions are minute-crons, so a full day of retention costs **2-3 MB against a 607 MB store**. Wrong by about **100x**, in the direction of refusing a consumer a cheap thing they had a real need for.
+  - **Theirs, nearly having me divide by zero:** they asked for a history size to divide by their own fact-count delta, and the delta was NEGATIVE because `facts_versions` is not monotonic - a retirement removes that fact's row from the sum - so writes in a period are `delta + the versions of everything retired in it`. Clean arithmetic over an unchecked quantity, which would have produced a confident wrong number rather than an error.
+  **The tell is grammatical and worth learning: the sentence reasons from a true general fact straight to a magnitude, with no step in between where anything was counted.** "Store size caused the outage" to "therefore this collection is too expensive" skips the only question that mattered, which was how big a row is. More scepticism does not help, because every premise survives scrutiny; the missing thing is an act of measurement, not a doubt. Pair it with the existing rule - ask what else would produce a result you HAVE, and ask whether you have one at all before reasoning from it.
+  **The same pair also produced the day's cleanest instance of a correct observation with the cause one layer over.** They reported `GET /functions/<id>/logs` capping at 50 however high `limit` is set, which is exactly true. `limit` is HONOURED and clamped to the retained count (`function_run_log.cpp:110`), because rows beyond it were trimmed on write and do not exist to return - so this is NOT the accepted-and-ignored family (#72/#74) and there is nothing to fix in the handler, which already names `runs_kept` in its refusal text. The remedies are entirely disjoint: "honour my limit" has no fix, "raise retention" is one config line plus a restart (`runs_kept` is a BOOT config, `src/config.hpp:25`, default 50). A report of a symptom is not a report of a cause, and filing it as the latter sends the next reader to the wrong file.
 - **THE ONE QUESTION THAT CATCHES THIS WHOLE FAMILY: "WHAT ELSE WOULD PRODUCE THIS EXACT RESULT?"** It is one line, it costs nothing, and on 2026-10-12 three separate instances of the same defect appeared in a single afternoon - two of them mine - every one of which it would have stopped:
   - **A vector-encryption test** read rows written BEFORE the flag was flipped and concluded about writes after it. What else would produce three rows still searching at 1.0? Pre-flip vectors living in the vector sub-db rather than the body. Which is exactly what was happening, and the new-insert path was broken.
   - **A consumer's page probe** returned 200 at 5.4 MiB and they concluded the size limit was per DOCUMENT. What else would produce that? A per-RESPONSE limit anywhere above 5.4 MiB - which is what it is, 100 MB. A test that passes under both hypotheses cannot choose between them.