chore(elidex-review): axes.md Axis 3 docstring-contract↔body entry#277
Merged
Conversation
Add a calibration entry so /elidex-review Axis 3 (Pragmatic shortcut) catches docstring-contract ↔ body inconsistency: `Result`-returning host natives (esp. promise-returning `*_outcome` family) whose body swallows a backend/IO `Result` via `unwrap_or`/`unwrap_or_default`/`.ok().flatten()` while the file/fn docstring or a sibling op (`open`/`put`) states a "failure → reject/propagate" contract → silent-wrong-on-error + self- inconsistency. Origin: PR #275 (Cache API) Copilot R1 — 8 IMP error-swallow findings the pre-push /elidex-review did not catch. MECE home is Axis 3 (the docstring contract was correct; the body violated it = pragmatic error-swallow), not Axis 4 (citation-accuracy only). Adds the Detect rule + a MECE ownership line. Skill-only diff; no Rust paths touched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the /elidex-review skill’s Axis 3 (Pragmatic shortcut) guidance to explicitly flag docstring/contract violations where Result-returning (especially promise-returning *_outcome) host natives swallow backend/IO failures instead of rejecting/propagating as documented.
Changes:
- Adds a MECE ownership rule assigning “docstring-stated contract ↔ body violation” findings exclusively to Axis 3.
- Adds an Axis 3
[diff]Detect entry describing the “Resultswallow despite reject/propagate contract” pattern and the required remediation (?+map_err).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
send
added a commit
that referenced
this pull request
Jun 3, 2026
…spatch flag
Copilot flagged (2 IMPORTANT, one shared root): `FetchEvent.respondWith` and
`ExtendableEvent.waitUntil` did not gate on the event's dispatch flag, so a late
call from a timer/network callback during the pump (after the SW loop snapshotted
the side-store) silently mutated state instead of throwing the spec-mandated
`InvalidStateError`.
One structural fix — read the shared `dispatched_events` §2.9 dispatch-window
bracket (set/cleared by `dispatch_event_at_sw_scope`) in both natives:
- `respondWith` → SW §4.6.7 step 2 (dispatch-flag), ordered before the existing
step-3 respond-with-entered (`responded`) guard. This also makes the impl
finally honor its own docstring ("any call after dispatch settled ... throws
InvalidStateError" — the #277 docstring-contract<->body axis).
- `waitUntil` → the dispatch-flag half of the spec's "active" predicate (§4.4.1);
the pending-promises (lifetime-extension chaining) half stays in the deferred
`#11-sw-fetchevent-waituntil` slot, so a late call throws rather than silently
dropping.
Regression test `wait_until_after_dispatch_throws_invalid_state` drives the gate
via a `setTimeout` callback — the genuine post-dispatch window (a microtask
`.then` instead runs inside `dispatch_script_event`'s trailing checkpoint, flag
still set, and is correctly accepted).
Gate: clippy + doc + nextest (10744/10744) green; fix-delta /elidex-review
(5-axis) 0C/0I/0M/6FP — both new spec citations webref-verified.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Calibrates
/elidex-reviewAxis 3 (Pragmatic shortcut) to catch a self-inconsistency class the pre-push gate missed on PR #275:Result-returning host natives (esp. promise-returning*_outcomefamily) whose body swallows a backend/IOResultviaunwrap_or/unwrap_or_default/.ok().flatten()…open/put) states a "failure → reject/propagate" contract.→ silent-wrong-on-error + docstring↔body self-inconsistency. Required action: honor the contract with
?-propagate +map_err.Origin
PR #275 (Cache API) Copilot R1 surfaced 8 IMP error-swallow findings in cache read-side natives where the body violated the file docstring's own "every sync failure → rejected Promise" contract — sibling
open/puthonored it with?+map_err(TypeError). The pre-push/elidex-reviewdid not flag the self-inconsistency.Placement (MECE)
Axis 3, not Axis 4. Axis 4 is citation-accuracy only (§-number↔title); here the docstring contract was correct and the body violated it (a pragmatic error-swallow). So the MECE home is Axis 3. Adds one
### Detectrule + one## MECE 整理ルールownership line.Scope
Skill-only diff (
.claude/skills/elidex-review/axes.md, +2 lines). No Rust paths touched — CI paths-filter skips the Rust jobs.🤖 Generated with Claude Code