From 39bf8c86c49a375e02c21dceb38d070932b859d2 Mon Sep 17 00:00:00 2001 From: Teakowa <27560638+Teakowa@users.noreply.github.com> Date: Wed, 28 Oct 2026 04:07:44 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20update=20merged-work=20lessons=20(2026-?= =?UTF-8?q?10-21=20=E2=86=92=202026-10-28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/LESSONS.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/LESSONS.md b/docs/LESSONS.md index 2c5c1647..51244be1 100644 --- a/docs/LESSONS.md +++ b/docs/LESSONS.md @@ -36,7 +36,13 @@ Short review queue of reusable failure classes from merged Wright work. Each ent - **Rule:** When input falls outside the declared contract or a computation cannot produce its result, reject or report `unavailable` — never clamp, coerce, or print a zero. A plausible-looking result is worse than an honest failure. - **Why:** `lookup` silently clamped `limit: 11` to 10 so the caller could not tell its request was changed, and `inspect cost` printed `0 element(s) of the 0-element budget` when the count had failed. The same class as the wire-boundary escalation in #728, now on request and result surfaces. - **Prevention home:** the `malformed-request` rejection and `unavailable` reporting landed in #811 and #816; org escalation [wright#728](https://github.com/wrightkit/wright/issues/728). -- **Incidents:** [wright#811](https://github.com/wrightkit/wright/pull/811) (fixes [wright#783](https://github.com/wrightkit/wright/issues/783)), [wright#816](https://github.com/wrightkit/wright/pull/816) (fixes [wright#790](https://github.com/wrightkit/wright/issues/790)) — observed 2026-10-19 +- **Incidents:** [wright#811](https://github.com/wrightkit/wright/pull/811) (fixes [wright#783](https://github.com/wrightkit/wright/issues/783)), [wright#816](https://github.com/wrightkit/wright/pull/816) (fixes [wright#790](https://github.com/wrightkit/wright/issues/790)) — observed 2026-10-19; [wright#943](https://github.com/wrightkit/wright/pull/943) (a failed findings read showed rules as unmarked) — observed 2026-10-22 + +### A failure keeps its code and class when it crosses a boundary +- **Rule:** A wrapper that forwards a provider, session, or loader failure carries its typed code and exit class through unchanged. Do not reclassify it as a capability gap, a refusal, or a default class. +- **Why:** A refusal became an `unavailable` capability gap, a session diagnostic became a fabricated provider refusal, and a reload failure lost its class, so callers and exit codes reported the wrong failure. +- **Prevention home:** test — escalated in [wright#1022](https://github.com/wrightkit/wright/issues/1022). +- **Incidents:** [wright#1014](https://github.com/wrightkit/wright/pull/1014), [wright#1017](https://github.com/wrightkit/wright/pull/1017) — observed 2026-10-27 ### A multi-resource mutation stages every change before committing - **Rule:** A transaction over several files or resources stages every replacement before touching the first target; a mid-sequence failure leaves the set unchanged or names exactly what was written.