Skip to content

fix(browser): bound memory namespace bookkeeping - #68

Merged
Jason-Doyle merged 3 commits into
mainfrom
experiment/bounded-memory-namespace-bookkeeping
Dec 3, 2026
Merged

Jason-Doyle merged 3 commits into
mainfrom
experiment/bounded-memory-namespace-bookkeeping

Conversation

@Jason-Doyle

Copy link
Copy Markdown
Owner

Change

Bound the recognised built-in memory namespace path by resident keys instead
of access/write history. Private weak capabilities compose namespace prefixes
and snapshot the root's resident keys once per clear.

Clearing now includes objects created by same-namespace peer or previous
wrappers. Other namespaces, unrelated raw keys and nested siblings remain
isolated. Unknown subclasses and other module instances keep delegated
tracked-key cleanup, including failed-delete retry behaviour.

Only src/browser/cache.ts changes in production: 54 insertions and nine
deletions. Public options, default limits, accounting, policies, persistence
operations and stored formats are unchanged.

Evidence

The prospective protocol was published before production edits. Source and
collector were published at f755744322f0cdf979a01bd93f08dd163808bd11 before
the first and only comparative capture, which ran from that detached commit.

Observation Baseline Candidate
Combined resource/cleanup contracts 168/384 384/384
Data-state/return checks 336/384 384/384
Historical keys before clear, summed across 336 built-in trials 70,464 0
Built-in-path clear key visits 53,808 1,344
Built-in-path forwarded clear deletes 53,808 1,008

The baseline's 168 history-resource failures are not corrupted reads.
Another 48 trials fail the intentionally strengthened namespace-cleanup
contract. All 48 custom-subclass controls preserve legacy forwarding/retry
behaviour. Work-phase root operation digests and copy work match in every pair.

The qualification report
contains exact tables, a graph, limits and reproduction commands. The
raw capture
retains all 768 rows, 384 pairs and 78 verified source inputs.

Local qualification passed 33 focused cases plus 242 existing controls,
54 Chromium/Firefox/WebKit cases, types, package build/exports, canonical
documentation and website repository-link checks. The expanded exact
historical suite reproduces 15 expected failures of 33; its initial 32-case
pre-edit reproduction is retained separately.

Costs and merge assessment

Score: 91/100 against the published 85/100 threshold. All local mandatory
gates pass; normal repository CI and human review remain required.

Clear scans the whole shared root and allocates a temporary key array, so
small or empty scopes can do more work. Weak registration and conditional
tracking checks add local bookkeeping. Custom fallback history remains
potentially unbounded. Other instances' pending fills are not fenced.
No heap, garbage-collection timing, latency or production-frequency benefit
is claimed.

@Jason-Doyle
Jason-Doyle merged commit 44e0442 into main Dec 3, 2026
4 checks passed
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.

1 participant