Parcourir la source

docs: an unrecorded error channel leaves only the status code

Second diagnosis decided by that gap: we build a structured slug on every
refusal and log none of it for a 4xx, so a single failed insert narrowed
to five eliminations and then stopped at a cause nobody can now close.
Records the worked example, including eliminating dimension_mismatch by
the response's byte count and using rt=0.755 to prove the embedding ran -
which placed the refusal after a successful embed rather than before it.

And the sharper lesson, which came back from the consumer: a deliberately
tolerated failure needs a re-check trigger just as a headroom measurement
does, because its justification can expire silently while the tolerance
outlives it. Their tolerated 404 was correct until a backfill finished,
then meant a hole for six days across three call sites. Names our own
best-effort paths as audit candidates.

Also keeps their verification as the model: counts reconciled and a
paraphrase query still missed the row, which reads like the junk-row
failure; only the exact-text query at 1.000000 settled it.
fszontagh il y a 1 mois
Parent
commit
fed9e76620
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      CLAUDE.md

+ 5 - 0
CLAUDE.md

@@ -92,6 +92,11 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
   **And a correction can invite the very error it fixes, so write the warning beside it.** They had measured index-values refusing `offset` and returning `truncated`, whose obvious reading is "vectorapi refuses unhonoured params now". That generalisation is FALSE on 0.13.0: it is one bespoke check on one route, and the export still ignoring `?filter=` is the disproof sitting right beside it. Correcting the first entry without that caveat would have replaced one wrong note with another.
   **A STRONGER CONTROL FOR `distinct_values`, FROM THE SAME CONSUMER, AND IT BEATS THE ONE I USED.** `GET .../collections/{c}/indexes` reports `distinct_values` per indexed field from the index's own metadata with NO 1000 cap (the values route caps and sets `truncated`). I verified exactness with `departmentKey` at 10 against exactly 10 enumerated - agreement BELOW the cap, which is the weak form. Theirs: `kb_fact_answers.intent` reports **13092 against a document count of 13092**, where `intent` is a unique business key, so one-per-row is what it MUST report and the agreement is at 13k rather than under the cap. Neither proves exactness for an arbitrary field, and that limit is worth stating when quoting the number. **Note the route needs an index to exist** - a collection with none answers `{"composite_unique":[],"indexes":[]}`, which is why a caller can reasonably conclude no route can total a high-cardinality field.
   **That exact count then found a real data defect one layer out, which is the argument for exposing counts at all:** comparing their two fact collections gave 13093 against 13092, and the one-row gap is a fact with a question vector and no answer vector - live and retrievable by its question, invisible to any search over answers. Invisible until there was an exact count to compare.
+- **AN ERROR CHANNEL THAT IS NOT RECORDED IS ONE YOU CAN ONLY EVER READ THE STATUS CODE OF. WE BUILD A STRUCTURED SLUG ON EVERY REFUSAL AND LOG NONE OF IT FOR A 4xx.** A consumer's formulation, 2026-10-22, after a diagnosis that ended in an unknown nobody can now close. It is the second time the same gap has decided a question: once a three-day 403 where only the access log knew, and once a single failed insert where five eliminations narrowed the cause and the cause itself was unrecoverable.
+  **The worked example, because it shows exactly how far the access log alone can get you and where it stops.** A consumer's write to a vector collection was refused once, and they could establish from their side that it was attempted and was not a 409. From ours: exactly one 422 in a two-hour window on that route (457 × 201, 134 × 409, 58 × 200, 1 × 422), `rt=0.756 urt=0.755`, 95-byte body. Four candidates then fell to measurement rather than argument - **`dimension_mismatch` by BYTE COUNT**, since that envelope is 82-85 bytes for any plausible vector length against the 95 observed; `schema_violation` because the collection reports `has_schema: false`; `relation_violation` because the only active relation has a different child; and the 2.17.x encrypted-collection vector freeze because that collection is `encrypted: no`. **And the timing was the half the consumer could not see:** the route's order is authorize, then embed, then insert, so the only pre-provider 422 fires in microseconds and 755 ms excludes it - which places the refusal AFTER a successful embedding, a different defect from the one anybody would have assumed. What remained was a database-side refusal carrying a 51-character message, and nothing retained it: no journal entry for a 4xx on our side, nothing at warning level from the database across twenty minutes.
+  **So the cost of not logging the slug is not the eliminations - it is an unknown that cannot be closed later.** Logging the code for every 4xx and 5xx would have made that one line. The structured error already exists and already passes through one place. Raised with the owner rather than shipped unilaterally.
+  **AND THE SHARPER LESSON CAME BACK FROM THEIR SIDE: A DELIBERATELY TOLERATED FAILURE NEEDS A RE-CHECK TRIGGER, EXACTLY AS A HEADROOM MEASUREMENT DOES - BECAUSE ITS JUSTIFICATION CAN EXPIRE SILENTLY AND THE TOLERANCE WILL OUTLIVE IT.** Our own access log showed their mirror path hitting the missing row three times over two days, taking a 404 each time and never repairing it. That 404 was tolerated ON PURPOSE and for a good reason: facts predating the answer collection had no answer row until a backfill reached them, and failing a withdrawal over that would have made the feature unusable on 1635 facts. **The premise expired the day the backfill finished, and nothing noticed** - from that moment a 404 there meant a hole rather than a legacy state. Three chances to catch a real defect, silence every time. They kept the tolerance, because failing the withdrawal is still the worse trade, and made it REPORT at all three call sites with a test. The shape to carry: when tolerating a failure, write down what makes it safe and what would end that - this file already demands a re-measurement trigger for a dated number, and a tolerated error is the same claim wearing different clothes. **Audit candidates here are every best-effort path: the error-handler dispatch that never throws, the registry's retry-then-health-check, the secret store's deliberately kept guard.** Each is currently right for a stated reason; the question is whether anything would tell us when a reason stops holding.
+  **Their verification is also the model, and it nearly fooled them in our direction:** counts reconciled at 13093/13093 and the id answered 200 in both collections, and a PARAPHRASE query still did not surface the row in the top five - which reads exactly like the unsearchable-junk-row failure. Querying with the exact text put it at **1.000000**, its own nearest neighbour, so the ranking was ordinary all along. Their words: they would have reported success off the count. A count cannot see a vector stored in the wrong field or the wrong form; only retrieval by similarity can.
 - **MAINTAINING THIS FILE: REWRITE when a claim was WRONG; KEEP AND LABEL when a claim was RIGHT and the world moved.** The two look similar and the failure modes are opposite. An appended correction under a wrong claim leaves both sentences reading as true and invites the reader to pick - the stale-comment failure with a timestamp attached, and this file is read under pressure by someone who will take the first assertion that fits. So a measured refutation REPLACES the claim, says it was wrong, and says what the measurement was: the note that history bytes dominate the at-rest migration was mine, it was false, and it reads as false now rather than as a dated opinion beside a newer one. Conversely the superseded filtered-scan cap stays, LABELLED superseded, because the claim was accurate and only the mechanism retired - and the failure shape it describes is still worth recognising. The rule came from a consumer drawing the distinction after watching me do both in one afternoon without naming it.
 - **ESTABLISH WHO OWNS A LAYER BEFORE REPORTING A FINDING TO IT.** `encryption-verify`, the CLI, the migration, encryption at rest and storage are the DATABASE's; this repo owns the HTTP surface, the function runtime, the export and its digest. A consumer sent us a sound suggestion about the verify tool's verdict wording and told us it was our call - it was not, and had we received it politely they would have waited on a change we cannot make. **A finding filed one layer too high is sympathetically received by someone who cannot act on it**, which is worse than a rejection because it looks like progress. Route it, and say plainly that you are routing it.