GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Design: define, don't assign — untrusted keys are stored with define semantics, never through the __proto__ setter · Issue #2953 · developing-today/code

Design: define, don't assign — untrusted keys are stored with define semantics, never through the __proto__ setter #2953

New issue
Copy link
New issue
Copy link
Closed
4 / 44 of 4 issues completed
Closed
Design: define, don't assign — untrusted keys are stored with define semantics, never through the __proto__ setter#2953
4 / 44 of 4 issues completed
Copy link
Assignees
dezren39
Labels
effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/queuedHas a queued queue tasksource/design-architectFiled by the repo design architect jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 31, 2026
Issue body actions

Summary

One rule for the write side of the prototype family: a value keyed by an externally-spellable name is stored with define semantics, never assignment semantics. Assignment (obj[key] = v, obj[key] ??= …, dst[k] = src[k] copy loops, Object.assign(dst, src)) goes through [[Set]], and for exactly one spelling — __proto__ — [[Set]] invokes the Object.prototype setter instead of creating an own property: a non-object value is silently ignored, an object value replaces the container's prototype. Three filed instances in three surfaces prove the class; this design adopts them as its phases and closes with an inventory audit.

This is the write-side counterpart of #2792 (read-side own-key lookups), whose design doc explicitly scoped this class out ("a different bug class with a different fix… a future design decides") and whose pass-23 assessment recorded the trigger: originate when a second write-side instance files after #2851. There are now three.

Design doc: files/designs/code-proto-write-side.md in the keep-the-four-repos-healthy goal workspace (problem, evidence, alternatives, risks, open questions).

The instances (audited at origin/main 106b0571)

  • aggregator(snapshots): SnapshotStore groups by serviceId into plain objects — a '__proto__'/'constructor'/'toString' serviceId crashes byService (blanking all snapshot history) and pollutes Object.prototype during compact #2941 — aggregator snapshots (Phase 1, the polluting instance). SnapshotStore.byService() (pm-stack/aggregator/src/snapshots.ts:562-565) groups with (grouped[r.serviceId] ??= []).push(r) and compactInner() (:703-711) accumulates its report the same way; serviceId is validated only as a non-empty string (:303) and arrives from external feed jobs. A __proto__/constructor/toString id makes byService() throw (its only caller swallows the throw into {} — all snapshot history blanks, persistently, since the record passes validation and is stored), and compact() with a __proto__ id writes its counts onto Object.prototype itself (({}).before === NaN afterwards). The same file already groups with Map at appendLocked (~:620) and in compactRecordsToRollups — these two sites are outliers in their own file.
  • aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851 — aggregator cost-explorer (Phase 2). Saved setups live in a plain object from localStorage (pm-stack/aggregator/src/render.ts:4338 save all[name] = …, :4359 import all[k] = parsed[k]). A setup named __proto__ is silently never saved; an imported one mutates the store object's prototype. Silent data loss both directions.
  • record(loose): a '__proto__' field in loose text is silently dropped — parseLoose assigns into a plain object, so the field never reaches the JSONL line (the JSON path preserves it) #2828 — bin/record (Phase 2). parseLoose (bin/record.mjs:110) builds fields by assignment; a loose __proto__ field counts toward the keyed-segment threshold but never reaches the appended JSONL line — breaking record's never-lose-a-field contract for exactly the key an agent records while reporting this bug class. The JSON path preserves it (parse + spread = define semantics); the two paths disagree.

Decisions recorded

  1. Preserve, don't reject. The key is data: a __proto__ field / setup name / serviceId is stored, listed, exported and re-read like any other key. (aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851's acceptance permits visible rejection for setup names; this design records preserve so all surfaces behave identically and aggregator(snapshots): SnapshotStore groups by serviceId into plain objects — a '__proto__'/'constructor'/'toString' serviceId crashes byService (blanking all snapshot history) and pollutes Object.prototype during compact #2941's already-stored records become readable instead of stranded. Validation-side rejection is also not the fix — aggregator(snapshots): SnapshotStore groups by serviceId into plain objects — a '__proto__'/'constructor'/'toString' serviceId crashes byService (blanking all snapshot history) and pollutes Object.prototype during compact #2941's acceptance already states the grouping fix must not depend on it.)
  2. The prototype must not move — asserted as a test property: after any covered write, the container's prototype is unchanged (or null by design) and Object.prototype gains no own properties.
  3. Accumulators are construction, not lookup. Grouping/counting sites are fixed by changing the container (Map, converted at the boundary via Object.fromEntries/spread), not by hasOwn guards — that is the boundary with design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792. (byService()'s crash is a ??= read, but its fix is container construction, so it lives here; design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792's Phase 3 audit should disposition it as covered by this design.)
  4. One probe matrix everywhere: __proto__ with a string value and an object value (the setter treats them differently), constructor, toString, an ordinary key — asserting own-property presence, JSON round-trip preservation, and decision 2.

Phased breakdown

  • Phase 1 = aggregator(snapshots): SnapshotStore groups by serviceId into plain objects — a '__proto__'/'constructor'/'toString' serviceId crashes byService (blanking all snapshot history) and pollutes Object.prototype during compact #2941 (aggregator snapshots): Map grouping in byService() + compactInner(), converted at the boundary. Lands first — the only instance that corrupts global state and blanks a whole surface, and its store may already hold a poisoned line.
  • Phase 2 = record(loose): a '__proto__' field in loose text is silently dropped — parseLoose assigns into a plain object, so the field never reaches the JSONL line (the JSON path preserves it) #2828 + aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851 (silent loss at the edges): define-semantics construction in record.mjs's loose parser and in the cost-explorer save/import paths. Independent of Phase 1.
  • Phase 3 = new issue (filed with this design): closing inventory audit — grep TS/JS/mjs (vendored assets and tests excluded) for the four non-conforming forms with dynamic keys, disposition each (covered / external-key → fixed here or filed as a named follow-up / internal-only → named in the closing evidence), state the contract in the app docs that already state contracts, and close this design with the evidence. Candidates already visible, to be dispositioned not pre-judged: antigravity-direct's schema walkers (merged[k], sub[name], props[name] — external tool-schema keys); provider-catalog-sync's report.providers[providerId] and (added[pid] ??= []); pkgs/id/web Object.assign(records, frame.records) (world.ts:181, a peer-supplied frame); sync-models' prov.models[baseId] family. Gated on Phases 1–2.

Phases 1–2 adopt the origin issues (no parallels — they carry explicit acceptance with verified probes and queued triage packets). Related, deliberately NOT adopted: today's read-side filings #2920 / #2919 (id/web) belong to #2792's Phase 3 audit — their fix is a read guard.

Open questions (stay in the design doc, not filed)

  • Lint enforcement of define-semantics (false-positive rate known only after Phase 3's inventory — same deferred question as design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792's for reads).
  • Recursive/deep-merge helpers, if Phase 3's audit finds one in-tree (none known).
  • Cost-explorer storage-format change (per-name keys) — unnecessary once names are safe; revisit only if that format is revised for another reason.

Filed by the repo design architect (pass 24, 2026-10-31) for developing-today/code. Implementation phases are the linked sub-issues; phases with open questions stayed in the design doc.

Acceptance criteria

  • The design doc (files/designs/code-proto-write-side.md, goal workspace) is adopted or amended with the decision recorded on this issue.
  • Each filed write-side instance (the three surfaces named in the design, incl. aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851) is linked as a phase of this epic, with its fix approach stated in define-semantics terms.
  • The closing inventory audit is posted: every externally-keyed write site in the prototype family is listed and dispositioned (define semantics, guarded, or filed as a follow-up).
  • Read-side counterpart design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 is cross-linked and the boundary between the two classes stays explicit.

Sub-issues

Collapse Sub-issuesSub-issues

4 of 44 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. dezren39
    added
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    source/design-architectFiled by the repo design architect job
    on Oct 31, 2026
  2. dezren39
    added sub-issues on Oct 31, 2026
    • aggregator(snapshots): SnapshotStore groups by serviceId into plain objects — a '__proto__'/'constructor'/'toString' serviceId crashes byService (blanking all snapshot history) and pollutes Object.prototype during compact #2941
    • aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851
    • record(loose): a '__proto__' field in loose text is silently dropped — parseLoose assigns into a plain object, so the field never reaches the JSONL line (the JSON path preserves it) #2828
    • Phase 3 of #2953 — closing inventory audit for the define-semantics (write-side prototype) contract + contract statement #2954
  3. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1 — design-architect pass 24 (2026-10-31): filed this design this pass. It is the write-side counterpart of #2792, whose doc scoped this class out to a future design; pass 23's recorded trigger (a second write-side instance after #2851) is met by #2828 + #2941. Phases adopted as sub-issues (verified in this issue's sub_issues list: 2941, 2851, 2828, 2954): Phase 1 = #2941, Phase 2 = #2828 + #2851, Phase 3 = #2954 (new, gated on Phases 1–2). Decisions recorded in the body: preserve-don't-reject; prototype-must-not-move as an asserted test property; accumulators fixed by container construction (Map), not hasOwn. Design doc: files/designs/code-proto-write-side.md in the keep-the-four-repos-healthy goal workspace; register entry added (status: proposed). No user/review — the origins carry explicit acceptance and the rule generalises in-tree idioms (the aggregator's own Map groupings; record's JSON path).

  4. dezren39
    added
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 31, 2026
  5. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    Intake review

    • Related: read-side counterpart design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 (OPEN, explicitly scoped this class out); phase instance aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851; this is the epic/design parent for the write-side class.
    • Notes: Well-formed design issue: one rule (define semantics for externally-keyed writes), three filed instances as phases, design doc lives in the goal workspace (files/designs/code-proto-write-side.md). Still live — no merged PR closes the class; the instances remain the evidence.
    • Risks: Prototype-pollution fixes are easy to under-audit: fixing the three known surfaces without the closing inventory audit leaves the class open. The audit is in the acceptance criteria for that reason.
    • Suggested approach: Adopt/amend the design doc first, land the three phase fixes under it, finish with the inventory audit across the prototype family.
  6. github-actions
    assigned
    dezren39
    on Oct 31, 2026
  7. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    Agent note (program tending, 2026-11-01): child progress — sub-issue #2851 CLOSED 2026-11-01T10:28:28Z (parent link REST-verified this run). This epic's last comment (2026-10-31T06:25Z) predates the closure, so the landing is recorded here. Progress note only — not a completion proposal.

  8. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    Program tending — sub-issue progress (2026-11-02)

    Closed since this thread's last activity: #2828 (closed 2026-11-02T07:02Z).

    Recorded for the parent rollup; this is a progress note, not a completion proposal — the parent stays open on its remaining children.

  9. dezren39
    added a commit that references this issue on Nov 3, 2026

    Merge pull request #4956 from developing-today/queue/7683-2954-define…

    05fd4bb
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: done — design #2953 closed by its Phase 3 audit
    task 7683 (lane code-j), Phase 3 = #2954. All three phases have landed:

    • Phase 1 — aggregator(snapshots): SnapshotStore groups by serviceId into plain objects — a '__proto__'/'constructor'/'toString' serviceId crashes byService (blanking all snapshot history) and pollutes Object.prototype during compact #2941 (aggregator snapshots): CLOSED 2026-11-02.
    • Phase 2 — record(loose): a '__proto__' field in loose text is silently dropped — parseLoose assigns into a plain object, so the field never reaches the JSONL line (the JSON path preserves it) #2828 (bin/record) + aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851 (cost-explorer): CLOSED 2026-11-02 / 2026-11-01.
    • Phase 3 — Phase 3 of #2953 — closing inventory audit for the define-semantics (write-side prototype) contract + contract statement #2954 (closing inventory audit + contract statement): fixes merged in PR fix(define-semantics): Phase 3 closing audit fixes (#2954, design #2953) #4956 (05fd4bb); the full disposition table (four grep forms, 579 + 5 + 21 hits, every hit dispositioned (a) covered / (b) fixed / (b) follow-up / (c) internal-only, read-side sites listed as design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 scope) is posted on Phase 3 of #2953 — closing inventory audit for the define-semantics (write-side prototype) contract + contract statement #2954 as comment 6606519181.

    Contract statement (rule + probe matrix) is now in pm-stack/aggregator/README.md and the bin/record.mjs header.

    Remaining follow-up, named per this design's own open question (deep-merge helpers: report, don't pre-decide): #4957 — deepMergeProviders in bin/provider-catalog-sync.mjs, a recursive assignment-semantics merge over runtime-overlay config keys, with the #2953 probe matrix as its acceptance. It is the only (b) site not fixed inside Phase 3, and it is filed and linked from #2954 — nothing else from the sweep is outstanding.

    Closing this design issue as complete with #4957 named as its remainder.

  11. dezren39
    closed this as completedon Nov 3, 2026
  12. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  13. developing-today commented on Nov 3, 2026

    @developing-today
    developing-todayBot
    on Nov 3, 2026 – with developing.today
    Contributor
    More actions

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/queuedHas a queued queue tasksource/design-architectFiled by the repo design architect jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.