Skip to content

feat: Adds platform domain with Extension runtime architecture and failure modes - #166

Merged
MajorLift merged 15 commits into
mainfrom
jongsun/add/platform-skills
Sep 18, 2026
Merged

MajorLift merged 15 commits into
mainfrom
jongsun/add/platform-skills

Conversation

@MajorLift

@MajorLift MajorLift commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds a platform domain: the extension's runtime architecture and its failure modes.

  • extension-errors-debugging — triage a runtime error to root cause. Ships a metamask-extension overlay.
  • extension-lifecycle-decoupling — decouple work from the Manifest V3 service-worker lifecycle, so a suspended worker doesn't strand it.
  • Knowledge: extension-architecture, mv3-service-worker.

Needs a decision: /domains/platform/ has no CODEOWNERS entry, falling to the * catch-all — which team should own it?

Motivation

Nothing in mobile or core corresponds, making these a domain rather than a corner of coding.

extension-lifecycle-decoupling is argued as always-loaded, spending shared description budget. It preempts confidently wrong MV3 claims that disrupted the platform team — recurring reports attributing unrelated bugs to the service worker dying mid-session, which it does not do due to a keepalive. Nobody holding a wrong model searches for the skill that corrects it: from the inside, the model is not in question.

Showcase

Neither skill has a trial run reported here, so nothing here speaks to their hit rate.

Adjacent, not a trial run: #44003 (error-handling capture) in the mms-evidence showcase — write gap 631 ms against a 192 ms control, recovery beacons 1 against 0, error toast absent and asserted twice. Handled, not skipped.

MajorLift added 11 commits June 5, 2026 14:54
CHANGELOG.md tracks consumer-facing changes to the `@metamask/skills` package,
per CONTRIBUTING's "CLI / tooling changes" section. No merged skill-only PR adds
an entry (#80, #78, #70, #62, #61 all touch zero changelog lines).

It was also the sole source of this branch's conflict with `main`, since every
skill PR edits the same `[Unreleased]` block.
`benchmark-design` and `browser-extension-profiling` both cover E2E benchmarking
with statistical rigor, and they sat in different domains here while the rest of
the measurement work — `data-analysis`, `react-render-proof` — lives in the
performance PR. Splitting one subject across two PRs made both harder to review.

Moves `benchmark-design`, its `benchmark-statistical-hygiene` knowledge, and
`browser-extension-profiling`. Neither skill referenced the other by path, so
nothing needed rewriting.

What remains is the extension-runtime work this PR is named for.
Generic scripting guidance — paginate an API, handle rate limits, retry
transient errors — with no MetaMask specificity and no relationship to this PR's
extension-runtime subject. `coding/` otherwise holds MetaMask internals.

Nothing referenced it and it referenced nothing, so removal is self-contained.
The content stays in this branch's history if it is wanted later.
The keepalive row was the one entry here resting on a live implementation detail
rather than on an absent handler or persistent storage, and it was cited as
`background.js:750-758` — a line range that drifts. If the interval grows past
the idle timeout or the keepalive is removed, the conclusion inverts from
"eviction is prevented" to "eviction happens routinely", and a skill still
asserting the first is worse than no skill.

Replaces the line range with a symbol grep (`saveTimestamp`,
`SAVE_TIMESTAMP_INTERVAL_MS`), names the two conditions the conclusion depends
on — sub-idle-timeout interval, and an extension API call rather than a bare
timer — and records what was verified, against which commit.
Both platform teams co-own the domain, as they do `coding`, `general`,
`performance` and `pr-workflow`. A client's overlay is owned by that client's
platform team, placed directly under the domain line so it wins on
last-match and so each domain PR inserts at its own anchor.
…termination

metamask-extension#44348 (move keep-alive polling to service worker startup)
moved the keepalive out of `background.js`, #44373 (remove the
enableMV3TimestampSave debug preference) removed its gate, and #44433
(remove browserify) took `app-init.js` with it. The re-check grep searched
the file the keepalive left, so it told readers to treat eviction as live.
Cold starts are measured and frequent, and whether idle termination is
among their causes is not established.
…start does to cronjobs

Wallet state persists in `chrome.storage.local` with an IndexedDB backup.
On a restart, `CronjobController` runs a recurring job that came due while
the worker was down and drops a one-off background event that did. Chrome
also ends a worker whose single event runs past five minutes or whose
`fetch()` response takes over 30 seconds, the update debounce has a 1s
`maxWait`, and an error's tag split counts errors rather than users.
@MajorLift
MajorLift marked this pull request as ready for review September 18, 2026 14:25
@MajorLift
MajorLift requested a review from rvelaz September 18, 2026 14:48
@MajorLift MajorLift changed the title feat: Adds platform domain - Extension runtime architecture and failure modes feat: Adds platform domain with Extension runtime architecture and failure modes Sep 18, 2026
…/` overlay

A skill with no `repos/` directory is repo-agnostic to `tools/install`, so this MV3
and `chrome.storage` skill was installing into `metamask-mobile` and `core` as well.
Moving the platform detail into `repos/metamask-extension.md` scopes it, and matches
the shape the merged `platform` skills use: a thin shared body, specifics in the overlay.
@MajorLift
MajorLift enabled auto-merge (squash) September 18, 2026 17:58
@MajorLift
MajorLift merged commit ba3d49c into main Sep 18, 2026
28 checks passed
@MajorLift
MajorLift deleted the jongsun/add/platform-skills branch September 18, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants