fix(events): core.lease keeps a module's retry: false on read/apply refusals #236

Merged
whitlocktech merged 2 commits from fix/lease-retry-206 into main 2026-11-02 05:21:54 -06:00
Member

Closes #206.

What

core.lease's perform rebuilt its read and apply failure returns as { ok: false, error }. The module's retry was dropped, so the dispatcher's default (retry !== false, events/dispatch.js:184) retried permanent refusals three times. Examples are module-rust's events-disabled and an unresolved target. That made MODULE_API §1.1's retry: false opt-out unreachable for leases.

Both returns now pass retry: false through when the module said so, and leave retry undefined otherwise, so the default is unchanged. Error text and the release of the reservation after a failed apply are unchanged.

Tests

server/test/eventModuleContract.test.js, three new cases:

  • A read refusal with retry: false → terminal; no reservation is made.
  • An apply refusal with retry: false → terminal; the reservation is still released (markReverted).
  • Refusals without retry: false → still retried.

Results:

  • node --test test/eventModuleContract.test.js → 32/32 pass.
  • With the fix stashed, the first two cases fail and the third passes.
  • Full npm test locally: 2283 pass, 2 fail.
    • Both failures are routeManifest.test.js sync checks, caused by the locally installed modules/uo and modules/rust adding routes. With MODULES_DIR pointed at an empty directory they pass 4/4.
    • This diff touches no routes. CI is the check of record.

No API, route or schema change, so no Swagger or BACKEND_DESIGN edit. The docs follow-up (the PLAN §27.6 note) goes in a separate docs PR.

  • AI-assisted: Claude Code (Claude Opus 5.5; the code and tests were written by its Sonnet 5.5 implementer agent and reviewed by the main session)

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

Closes #206. ## What `core.lease`'s `perform` rebuilt its `read` and `apply` failure returns as `{ ok: false, error }`. The module's `retry` was dropped, so the dispatcher's default (`retry !== false`, `events/dispatch.js:184`) retried permanent refusals three times. Examples are module-rust's `events-disabled` and an unresolved target. That made MODULE_API §1.1's `retry: false` opt-out unreachable for leases. Both returns now pass `retry: false` through when the module said so, and leave `retry` undefined otherwise, so the default is unchanged. Error text and the release of the reservation after a failed apply are unchanged. ## Tests `server/test/eventModuleContract.test.js`, three new cases: - A read refusal with `retry: false` → terminal; no reservation is made. - An apply refusal with `retry: false` → terminal; the reservation is still released (`markReverted`). - Refusals without `retry: false` → still retried. Results: - `node --test test/eventModuleContract.test.js` → 32/32 pass. - With the fix stashed, the first two cases fail and the third passes. - Full `npm test` locally: 2283 pass, 2 fail. - Both failures are `routeManifest.test.js` sync checks, caused by the locally installed `modules/uo` and `modules/rust` adding routes. With `MODULES_DIR` pointed at an empty directory they pass 4/4. - This diff touches no routes. CI is the check of record. No API, route or schema change, so no Swagger or BACKEND_DESIGN edit. The docs follow-up (the PLAN §27.6 note) goes in a separate docs PR. - [x] AI-assisted: Claude Code (Claude Opus 5.5; the code and tests were written by its Sonnet 5.5 implementer agent and reviewed by the main session) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-11-01 02:53:25 -06:00
fix(events): core.lease keeps a module's retry: false on read/apply refusals
All checks were successful
PR Checks / client-build (pull_request) Successful in 59s
PR Checks / bot-tests (pull_request) Successful in 1m16s
PR Checks / server-tests (pull_request) Successful in 6m3s
28d0b76f13
core.lease rebuilt both failure envelopes as { ok: false, error }, so a
module's retry: false was dropped and the dispatcher retried a permanent
refusal (e.g. module-rust's events-disabled) three times. Both returns now
pass retry: false through and leave retry undefined otherwise, so the
dispatcher's default still applies. Three tests in eventModuleContract cover
read, apply (reservation still released) and the default.

Closes #206

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech approved these changes 2026-11-02 05:14:28 -06:00
whitlocktech added 1 commit 2026-11-02 05:15:28 -06:00
Merge branch 'main' into fix/lease-retry-206
All checks were successful
PR Checks / bot-tests (pull_request) Successful in 52s
PR Checks / client-build (pull_request) Successful in 1m10s
PR Checks / server-tests (pull_request) Successful in 6m14s
10efafbae5
whitlocktech scheduled this pull request to auto merge when all checks succeed 2026-11-02 05:15:46 -06:00
whitlocktech merged commit 27f7fe5d85 into main 2026-11-02 05:21:54 -06:00
whitlocktech deleted branch fix/lease-retry-206 2026-11-02 05:21:56 -06:00
Sign in to join this conversation.
No description provided.