Skip to content

refactor(reasons): declare the durable capture outcomes in ReasonTable rows - #4978

Merged
thymikee merged 2 commits into
mainfrom
refactor/r7-durable-outcomes
Nov 22, 2026
Merged

thymikee merged 2 commits into
mainfrom
refactor/r7-durable-outcomes

Conversation

@thymikee

@thymikee thymikee commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Second R7 PR for #4937 (the first is #4976). It declares the durable cleanup and reattach outcome family as DURABLE_RESOURCE_REASONS rows: ownership-fence-lost, owner-unavailable, transport-failed, cleanup-unconfirmed, manual-recovery-required, descriptor-invalid, descriptor-version-unsupported and transport-not-reattachable.

  • CleanupPendingReason, ResourceUnreattachableReason and the new DescriptorDecodeFailureReason in contracts derive from the rows.
  • Every runtime, recovery, admission-ledger and perf-host site reads the table, and so does the gateway's owner-unavailable. The summaries cover every producer.
  • Home: kernel/errors. The gateway and the capture admission ledger load no contracts module in common. The contracts/durable-resource entry checks its one value site with satisfies against the row instead of loading kernel errors.

This PR touches the same region of kernel/errors.ts as #4976, so whichever lands second needs a rebase.

Value

Measure base head
R89 untyped reason sites 58 53
R89 untyped values 21 18
Reason table rows 464 472

Before / after

No observable change. Wire spellings stay byte-identical.

Validation

Head d1848c5: typecheck, oxlint, format, generate:reasons, the reason-table guard, the eager-closure gate and wire-compat pass. fallow audit reports 0 dead code and 0 complexity; its 4 warn-level clone groups already existed in the touched files. 3,305 affected tests pass.

🤖 Generated with Claude Code

…e rows

Declares the eight durable cleanup and reattach outcomes, including
owner-unavailable, as DURABLE_RESOURCE_REASONS rows in kernel errors, the
one module every producer already loads. The contracts outcome unions
derive from the rows, and every runtime, recovery and admission site reads
the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.52 MB 6.52 MB +1.2 kB
Package (unpacked) 6.52 MB 6.52 MB +1.2 kB
Package (download) 1.99 MB 1.99 MB +386 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 19.1 ms 19.5 ms +0.4 ms
CLI --help 39.8 ms 40.7 ms +0.9 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of d1848c5

No open findings.

Reviewed with this repository's own Sentinel configuration (e10ad0cc2fb8).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

The code in d1848c5 is ready, and no conflicts were reported. Not blocking, and fine to take or leave: the descriptorVersionUnsupported row in packages/kernel/src/errors.ts (and its generated row in website/docs/docs/error-reasons.md) says the descriptor "was written by a newer version", but both producers emit it for any version other than the current one, so "was written by a different descriptor version" would be accurate. The only failing check is Body rules, which failed on an earlier body revision that had no ## Value section. The current body has one, so re-running that job should turn it green, and nothing else blocks merge. Not verified here: typecheck, generate:reasons, wire-compat and the tests were not re-run locally. CI covers them, and every other check is green. The token comparison strips comments and imports, so comment edits were checked by reading the diff.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 22, 2026
…version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Applied in dc4423d. The descriptorVersionUnsupported row and its generated page row now say the descriptor was written in a different descriptor version than this build reads. Pushing also re-ran Body rules against the current body, which has the ## Value section.

@thymikee
thymikee merged commit 648fcd5 into main Nov 22, 2026
18 of 19 checks passed
@thymikee
thymikee deleted the refactor/r7-durable-outcomes branch November 22, 2026 19:21
thymikee added a commit that referenced this pull request Nov 22, 2026
…asons

* origin/main:
  refactor(types): drop branches and assertions the types already exclude (#4975)
  refactor(reasons): declare the durable capture outcomes in ReasonTable rows (#4978)
  feat(harmonyos): verify foreground after open instead of trusting the launch line (#4293)
  fix(remote): give each session its own saved-connection file (#4925)

# Conflicts:
#	packages/kernel/src/errors.ts
#	src/platform-runtime-gateway.ts
thymikee added a commit that referenced this pull request Nov 22, 2026
…ures

* origin/main:
  refactor(types): drop branches and assertions the types already exclude (#4975)
  refactor(reasons): declare the durable capture outcomes in ReasonTable rows (#4978)
  feat(harmonyos): verify foreground after open instead of trusting the launch line (#4293)
  fix(remote): give each session its own saved-connection file (#4925)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant