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: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) · Issue #3879 · developing-today/code

Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879

New issue
Copy link
New issue
Copy link
Closed
3 / 33 of 3 issues completed
Closed
Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first)#3879
3 / 33 of 3 issues completed
Copy link
Assignees
dezren39
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/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-bearingpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 1, 2026
Issue body actions

Summary

Three lazy initializers in the aggregator memoize their first failure forever, defeating the one layer that was designed to heal:

  • aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732 — getSupabaseClient (pm-stack/aggregator/src/supabase.ts:43) caches its promise once and never clears it; stacked on top, getAlertsStore (src/alerts.ts:481) caches the resulting null in a second, independent latch. One transient bws hiccup at first use makes the whole alert throat (ledger, dedupe, delivery state, ack) report itself unavailable until restart.
  • aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729 — ensurePushConfigured (src/push.ts:26) resolves false when the VAPID key is unreachable and never clears configurePromise on that path; its only reset (a push-service 401/403) is unreachable from the configure failure, because sendPush returns at the configure gate. Web Push is dead for the process lifetime after one transient failure.

Both origins are priority/high with verified laptop probes. The shared dependency already states the intended bound: src/secrets.ts caches a null for only 5 minutes precisely so failures heal — the consumers widen that to forever.

The rule that fixes this already exists in this repo, stated for one app: #2668 recorded for pm-dispatch that "memoized init caches success only (clear-on-reject, in-flight promise still shared)", generalising fetchGithubJwks' success-only cache; its instance #2663 has since closed. The aggregator never adopted the rule. This design generalises it.

Full design doc: files/designs/code-success-only-memoization.md in the keep-the-four-repos-healthy goal workspace. Audit baseline: origin/main 064ce9e5 (all three latch sites read verbatim at HEAD this pass).

The contract

A lazy initializer memoizes success, never failure. Concurrent callers share the one in-flight attempt; once that attempt settles, a failure — a rejection, or a fail-soft failure value (null, false) — leaves no memo behind, so the next caller retries. A success is memoized for the process lifetime unless the module already has an explicit invalidation path, which stays. Per-call fail-soft behaviour is unchanged: the contract removes the permanence, not the posture.

Conforming embodiments already in-tree: secrets.ts (5-minute null cache + forgetBwsSecret), dispatch/src/auth.ts fetchGithubJwks (success-only), aggregator server.ts priming (self-clearing + 60s gate), sources/live.ts TTL caches (assigned only on success), bin/antigravity-direct.mjs token promise (cleared in finally).

Recorded decisions

  1. Clear on settle, not a consumer-side failure TTL. The shared dependency already bounds retry cost (secrets' 5-minute null cache means a retry re-reads a map, not bws); a second per-site TTL delays healing past the designed bound by an arbitrary per-site number.
  2. Every layer clears independently (stacked-latch rule). aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732's evidence: fixing the client alone does not heal the store. "The layer below retries" is never a reason for a layer to keep a failure.
  3. Failure values count as failure. All three sites fail soft (.catch(() => null/false)), so the success test is on the resolved value: non-null client/store, true configure.
  4. In-flight sharing preserved. Clear at settle (a finally/settle handler), never before — concurrent first callers still trigger exactly one resolution.
  5. Existing invalidation stays. Push's 401/403 reset + forgetBwsSecret remain the rotation path; no timers, reset endpoints, or in-call retry loops are added. Retry drivers already exist: the tick, the next request, the next send.

Alternatives that lose (in the doc): per-site failure TTLs; retry-with-backoff inside the initializer; an operator reset surface; repo-wide scope from day one (unexamined sites get dispositions in Phase 3, not presumed fixes).

Phased breakdown

  • Phase 1 — the alerts ledger heals (adopted: aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732). Contract applied at both layers (getSupabaseClient, getAlertsStore), fail-once-then-succeed tests per layer plus the stacked case. Lands first — every alerts surface, and Design: delivered means delivered — one truth contract for the aggregator alert throat #3702's throat contract, sits on this store.
  • Phase 2 — push configuration heals (adopted: aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729). ensurePushConfigured clears on false; the 401/403 reset preserved verbatim; probe-shaped test. Independent of Phase 1 in code.
  • Phase 3 — closing inventory + contract statement (new issue, gated on Phases 1–2). Contract into pm-stack/aggregator/README.md + pointer comments at the three sites; a repo-wide promise-memo inventory with a disposition per site (known candidates: bin/muse-proxy.mjs cliCapsPromise, pkgs/id/web highlighterPromise; expected-conforming sites verified, not re-fixed); a cross-note on design(pm-dispatch): launch pipeline, staged — validate the whole request at the boundary, one commit point, nothing after it can fail the launch #2668 that its rule is now the aggregator's contract too.

Open questions stay in the design doc (supabase client token rotation — no invalidation path, no failure evidence yet; genuinely-absent config cost, bounded by the secrets cache and recorded acceptable; Go/Rust sync.Once latches — no filed instance).

Related: #2668 (the rule's first statement), #3702 (neighbouring throat contract — different mechanism, no phase overlap). Not this design: #3701 (batch scheduling), the settings-kind numeric cluster (pass 32's trigger has not fired).

🤖 Design architect pass 33 (2026-11-01), audit at origin/main 064ce9e5.

Sub-issues

Collapse Sub-issuesSub-issues

3 of 33 of 3 Issues completed
Loading 3 sub-issues

Activity

Next
  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)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    source/design-architectFiled by the repo design architect job
    on Nov 1, 2026
  2. dezren39
    added sub-issues on Nov 1, 2026
    • aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732
    • aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729
    • Phase 3 (audit) of #3879 — closing promise-memo inventory + contract statement #3880
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · design filed

    • Agent: design architect (repo-design-architect-code), pass 33
    • Task: Originated design Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879 — failure is not a result: one success-only memoization contract for lazy initializers, generalising design(pm-dispatch): launch pipeline, staged — validate the whole request at the boundary, one commit point, nothing after it can fail the launch #2668's pm-dispatch rule to the aggregator, whose three promise latches (aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732 ×2 layers, aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729) memoize a transient bws failure for the process lifetime and defeat secrets.ts's designed 5-minute healing bound.
    • Outcome: Design doc at files/designs/code-success-only-memoization.md (keep-the-four-repos-healthy goal workspace); central register entry added (status: proposed). Phases linked as sub-issues: Phase 1 = aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732 (adopted), Phase 2 = aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729 (adopted), Phase 3 = Phase 3 (audit) of #3879 — closing promise-memo inventory + contract statement #3880 (new closing inventory + contract statement, gated on Phases 1–2).
    • Recorded pins: clear on settle, NOT a consumer-side failure TTL (secrets' 5-min null cache already bounds retry cost); every layer clears independently (stacked-latch rule); failure values (null/false) count as failure; in-flight sharing preserved; push's 401/403 reset stays.
    • Links: aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732, aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729, Phase 3 (audit) of #3879 — closing promise-memo inventory + contract statement #3880, design(pm-dispatch): launch pipeline, staged — validate the whole request at the boundary, one commit point, nothing after it can fail the launch #2668, Design: delivered means delivered — one truth contract for the aggregator alert throat #3702
  4. dezren39
    added
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 1, 2026
  5. github-actions
    assigned
    dezren39
    on Nov 1, 2026
  6. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  7. 41 remaining items

  8. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 8, 2026
  9. developing-today commented on Nov 8, 2026

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

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-p
    • Session / ID: task 12125
    • Found via: queue claim
    • Task: triage for issue Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879 handed off to the opencode claimant (assigned_lane=opencode, session unbound at handoff); claimant launches the bound opencode session that drives task 12125 to a terminal state.
    • Expectation: claimant drives task 12125 to a terminal state under this queue's worker id; if the claim lease expires first, task 12125 returns to the queue.
    • Links: task 12125 · issue Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879
  10. developing-today commented on Nov 8, 2026

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

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-z
    • Session / ID: task 12125
    • Found via: queue claim
    • Task: task 12125 (triage for issue Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879) assigned to the opencode execution lane per §1b; handing off to the opencode claimant, which launches the bound session
    • Expectation: claimant launches the bound opencode session; task 12125 parked 1800s pending that launch
    • Links: issue Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879
  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 8, 2026
  12. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code (OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
    • Session / ID: queue task 12125
    • Found via: repo-health-code-pilot atomic claim
    • Task: Triage the remaining scope of design Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879; checkpointed as claimed with origin openchamber-scheduled-lane.
    • Fresh state: Design: failure is not a result — one success-only memoization contract for lazy initializers (aggregator first) #3879 OPEN; PR docs(aggregator): success-only memoization contract + highlight latch fix (#3880) #6796 MERGED; no held, user/owned, do-not-merge, or do-not-auto-edit labels.
    • Next: verify the design acceptance criteria and all phase outcomes against current main; record whether a concrete remainder exists and route only that remainder.
  13. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · triage complete — all phases landed; verified closure

    • Agent: queue worker (repo-worker-code), lane 1a180ae5-384f-4e71-8d77-08f7b1652c75
    • Session / ID: task 12125
    • Found via: OpenChamber scheduled lane claim (partial-verification remainder)

    Fresh verification 2026-11-08:

    • Phase 1 issue aggregator(alerts): getSupabaseClient and getAlertsStore both memoize a transient null forever — the alerts ledger stays unavailable until restart #3732 is CLOSED; PR fix(aggregator): retry alerts initialization after null #4496 is MERGED.
    • Phase 2 issue aggregator(push): ensurePushConfigured memoizes a failed VAPID configure forever — one transient bws failure disables Web Push for the process lifetime #3729 is CLOSED; its merged implementation is PR fix(aggregator): retry a failed VAPID configure instead of latching it (#3729) #6754 (merged 2026-11-07, merge commit ddfba0998ac8e593d987c5fe2f40b364614fb351). PR fix(aggregator): retry failed VAPID setup #4497 remains open but is not the landed implementation; no work on it is needed for this issue's closure.
    • Phase 3 issue Phase 3 (audit) of #3879 — closing promise-memo inventory + contract statement #3880 is CLOSED; PR docs(aggregator): success-only memoization contract + highlight latch fix (#3880) #6796 is MERGED (merge commit ed2534c1dd5c5d40decfeb6b1e5374dbfec99a10). Its inventory, README contract, pointer comments, highlight latch fix, and evidence-gated token-rotation disposition are recorded in the linked phase/design comments.
    • The design's remaining token-rotation question is explicitly evidence-gated with a revisit trigger; no present actionable remainder is left.

    All three adopted phases and the design's closing inventory/dispositions are complete. Closing #3879 with the merged PRs above as evidence; no follow-up packet is needed.

  14. dezren39
    closed this as completedon Nov 8, 2026
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/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-bearingpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/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.