Repository navigation
fix(Conformance): render a throwing write fixture's value totally (#271) - #277
Merged
Merged
Conversation
A write fixture's `create` or `update` that threw a value `String` cannot convert (a null-prototype object, a revoked Proxy, an Error whose `message` getter throws or whose `name` is a Symbol) threw again inside the skip reason's `catch`, and the rules it drove came out `Errored` instead of `Skipped`. A `cleanup` that failed with or threw such a value made `Cause.pretty` throw inside the release step, so its ledger entry kept `detail: undefined` and the rules whose targets it disposed of died. core.ts now exports the total renderer `runRule` already used, as `renderThrown`, and write.ts renders the create / update skip reasons and the `cleanup-failed` detail (of `Cause.squash(cause)`) through it: the same `Name: message` / `Formatter.format` rendering, the same 500-unit cap and the same `[unrenderable defect]` marker. The fixture-throw `it.each` crosses five values with create, update, cleanup throwing and cleanup failing. The pending conformance-rule-defect-outcome changeset, the `Outcome` JSDoc, README and docs/conformance.md drop the "until #271" qualification. Claude-Session: https://claude.ai/code/session_0187g2QpzaHqEzX8GJxiJBVc Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #271 (body and the widening comment:
create,updateandcleanup).A write fixture member that threw a value
Stringcannot convert came outErroredinstead ofSkipped, and acleanupthat failed with or threw a valueCause.prettycannot inspect turned the release step into a defect (ledgerdetail: undefined, and the rules whose targets it disposed ofErrored).src/internal/conformance/core.tsexports the total rendererrunRulealready used after fix(Conformance): render a rule defect totally, capped at 500 characters #272, asrenderThrown(@internal).runRulenow calls it. Behaviour is unchanged:Result.try, anErrorasName: message, a string as itself, anything else throughFormatter.format, the 500-unit cap, and[unrenderable defect]when rendering throws. Theno-unknown-parameterswarn-tier rule is suppressed on its one line with a reason: a thrown value has no schema to parse it by.src/internal/conformance/write.ts: thecreateandupdateskip reasons render throughrenderThrowninstead ofString(error).runCleanupsetsdetailtorenderThrown(Cause.squash(cause))instead ofCause.pretty(cause).split("\n")[0].Cause.squashis total: it returns the firstFail's error, otherwise the firstDie's defect, otherwise a fixedError. TherunCleanupanddisposedoc comments now say they never fail or die, whatever the cleanup fails with.Docs: I removed the "until bug: a write fixture that throws an unstringifiable value is reported as Errored, not Skipped #271" qualification fix(Conformance): render a rule defect totally, capped at 500 characters #272 added in four places. The sentence now reads "A write fixture member that throws is not a defect, whatever it throws":
.changeset/conformance-rule-defect-outcome.md. It is still pending (package at 0.16.3, changeset not yet consumed), so I amended it rather than adding one.Conformance.OutcomeJSDoc;docs/conformance.md§ cleanup ("recorded, not propagated"), which now also says howdetailrenders.I wrote "member" on purpose. A
writesrecord whose property getter itself throws (the existing "thrown before the rule's Effect" case) is still a rule defect and stillErrored. That is unchanged and still pinned.Tests (written first)
The fixture-throw
it.eachinsrc/Conformance.test.tsnow crosses five values with four ways a member can misbehave:createthrows,updatethrows,cleanupthrows, andcleanupreturnsEffect.fail. That makes 20 cases.{ __proto__: null }(a null-prototype object), the revokedProxy, an error whosemessagegetter throws, and an error whosenameis a Symbol.Skipped, namingwrites["articles"].create threw: <rendered>, and nothing recorded;spec/status/update-responseSkipped, the othersPassed;Passed, and the 5 entries not removed by the kit's own DELETE arecleanup-failedwithdetailexactly the rendered value;Erroredoutcome and noFailedone.Mutation checks:
Erroredoutcomes.Erroredoutcomes.detail("Error: {}"vs"{}").renderThrown'scatchrethrow fails 16 cases: the 12 unrenderable fixture rows plus the 4 existingrunRule"unrenderable" tests.Verification
Run in the AGENTS.md order on the pushed head:
pnpm install --frozen-lockfile: passvp run build: passvp check: pass (0 errors). No new warn-tier site in the changed lines, apart from the one justifiedoxlint-disable-next-lineabove.vp run check(sources, type-level tests, examples, emitted declarations): pass ("every type gate green")vp run -r test:unit: pass (root 2329 tests in 40 files; examples 41 + 45 + 54)vp run docgen(every JSDoc@examplecompiled and executed): passfallow audit --format json --quiet --explain --gate-marker agent: verdictpass(0 introduced; 7 dead-code and 4 complexity findings inherited)fallow audit --base origin/trunk: "No issues in 7 changed files" (11 inherited findings excluded)Changeset
.changeset/conformance-rule-defect-outcome.md(minor, unreleased) in place, because the behaviour it describes has not shipped. No new changeset.Notes
cleanup-faileddetail format: a cleanup that fails with a string now records the string itself (store offline), notCause.pretty's first line (Error: store offline). AnErrorreadsName: messageeither way. TheReport.writesledger has not been released yet (0.17.0), so no shipped output changes.Erroredmessage. Say if you would rather keep a first-line cut for the ledger.runner'stransportError: String(result.failure)in core.ts. It stringifies a typedHttpClientError, not a fixture value.src/Assemble.ts,src/Middleware.ts,src/Query.tsorsrc/Endpoint.ts.🤖 Generated with Claude Code
Generated by Claude Code