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 — aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever · Issue #2347 · developing-today/code

aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347

New issue
Copy link
New issue
Copy link
Closed
#4151
Closed
aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever#2347
#4151
Copy link
Assignees
dezren39
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

aggregator(comments+actions): one store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes the poisoned record forever

Scope note: this covers BOTH dashboard JSON stores, which share the identical load-filter/sort code shape — CommentsStore (comments.ts) and ActionsStore (actions.ts:434-463, same id-only filter at :438-440, same createdAt.localeCompare sort at :463, same persist re-write). Both probes below were run against both stores with identical results. One fix, one issue.

Evidence (verified this run, main 5a34fa7)

pm-stack/aggregator/src/comments.ts:

  • CommentsStore.doLoad() (comments.ts:114-124) filters the on-disk records with a single check — typeof c.id === "string" (comments.ts:118-120). Every other field a record needs is accepted unchecked.
  • all() (comments.ts:149) then unconditionally calls a.createdAt.localeCompare(b.createdAt) on every loaded record. A record with createdAt missing or non-string throws TypeError on the first comparison.
  • Every read path goes through all(): forObject, byObject, counts, pendingCounts (comments.ts:153-196), and the server's /api/comments.json handler (server.ts:436/440). counts()/byObject() are also awaited while rendering the main views (server.ts:270, 288-289), so the throw is not confined to the comments endpoints.
  • The poisoned record is never quarantined: add() loads, pushes, and persist() re-serializes the whole in-memory array including the bad record (comments.ts:131-145, 170-186), so the breakage survives restarts and new writes until someone hand-edits the JSON file.

Probe (sandbox Bun, real CommentsStore imported from main, temp files):

  • control (one well-formed record): all() OK, counts correct.
  • one well-formed record + one record identical except createdAt deleted: all() THROWS TypeError: undefined is not an object (evaluating 'a.createdAt.localeCompare').
  • createdAt: 123 (number): all() THROWS TypeError: a.createdAt.localeCompare is not a function.
  • a record with only {id, createdAt} also passes the filter and produces a counts() entry keyed null (missing objectRef), and pendingCommentCounts silently treats its missing kind as neither pending class.

Why it matters

The comments file is a hand-inspectable JSON store in the aggregator's data directory, and the load filter exists precisely to tolerate records the current build didn't write (older/newer writers, partial hand edits, a restore from backup — cf. the #1509 load-race history in the same file). Today that tolerance is an illusion: the one field the filter doesn't check is the one field every read dereferences, so a single degraded record takes down the whole comments surface (queue input for the orchestrator, per-card comment boxes, 💬 badges, health pending counts) instead of being dropped or reported like the id-less records the filter already discards. Sibling stores in this codebase validate loaded records field-by-field; this one validates the one field reads don't sort by.

Acceptance criteria

  • Load-time validation checks the fields reads actually use (at minimum id, objectRef, kind, createdAt as an ISO string; author/body per the DashComment shape), and records failing it are excluded from the in-memory set (dropped or quarantined with a logged count — triage pins which), matching the existing id-filter precedent.
  • all() / counts() / byObject() / pendingCounts() never throw on a store file containing such a record; a regression test loads a file mixing one valid record with records missing createdAt, with numeric createdAt, and missing objectRef/kind, and asserts the valid record is served and counted under its real ref.
  • After any subsequent add()/persist(), the poisoned record does not silently return to disk in a form that re-breaks the next process start (or the issue documents why it is retained harmlessly).
  • Well-formed stores are byte-for-byte unaffected: existing comments tests (api-health-comments, store-concurrency) pass unchanged.

Dedup: #950 (githubUrl href validation), #1686 (empty github-result marks failed), #1509 (closed; temp-path/load race), #1210 (triage queue view) are adjacent comments-store issues; none covers load-filter field validation or the createdAt sort crash.

Activity

Next
  1. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-1192

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b cron run 2026-10-29T14:20Z
    • Found via: filed this run
    • Task: Filed aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 — CommentsStore load filter (comments.ts:118-120) checks only id, but all() (comments.ts:149) calls createdAt.localeCompare on every record: one record missing/with a non-string createdAt crashes all()/forObject/byObject/counts/pendingCounts and /api/comments.json, and persist() re-writes the poisoned record forever. Verified with a sandbox Bun probe of the real CommentsStore (main 5a34fa7): missing createdAt -> TypeError, numeric createdAt -> TypeError, control OK.
    • Expectation: effort/xs — triage pins drop-vs-quarantine for invalid records, then routes the fix with the mixed-record regression test.
    • Links: queue packet packet-2347-triage.json (repo-health-code-pilot)
  4. dezren39
    changed the title [-]aggregator(comments): a store record that passes the load filter but lacks a string createdAt crashes every comments read — and persist() re-writes it forever[/-] [+]aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever[/+] on Oct 29, 2026
  5. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · scope extension (same run)

    • Agent: new-issue-creator (new-issue-creator-code-b)
    • Found via: filed this run — follow-up check of the sibling store before this run closed
    • aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347's title/body now also cover ActionsStore (actions.ts:438-440 id-only load filter, :463 identical createdAt.localeCompare sort, same persist re-write): the identical probe against the real ActionsStore throws the identical TypeError on a record missing createdAt, control OK. Same fix shape, so it is folded into this one issue rather than filed separately. Triage packet packet-2347-triage.json names comments; treat actions.ts as in-scope for the same small_fix.
  6. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  7. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  8. 51 remaining items

  9. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: repo-worker-code (Lane A cron shift)
    • Session / ID: Lane A shift 2026-11-02 03:24 CST; queue task 5246 (small_fix, attempt 1)
    • Fresh state: aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 is OPEN and assigned to dezren39; canonical PR fix(aggregator): quarantine malformed comments and actions records #4151 is OPEN, non-draft, head 46c5e6d, authored by dezren39.
    • Disposition: Drew-owned PR hard stop. Preserved branch queue/5246-2347-quarantine-malformed-records; metadata-only, nothing inspected or modified beyond labels/notes.
    • Resume condition: PR fix(aggregator): quarantine malformed comments and actions records #4151 closure, ownership change, or explicit handoff; then revalidate fresh. Queue task 5246 parked 4 hours.
  11. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · correction to the park above

    • Agent: repo-worker-code (Lane A cron shift)
    • Correction: The "Drew-owned" premise of this shift's park for task 5246 is likely a metadata over-fire, the same one Lane C corrected three times today (tasks 5247, 5359, 5443): author/assignee dezren39 alone does not establish Drew-ownership — every fleet PR carries that author. Positive fleet-ownership evidence here: PR fix(aggregator): quarantine malformed comments and actions records #4151 is on this task's own branch queue/5246-2347-quarantine-malformed-records, and the fleet worktree ~/git/fleet/5246 exists on the laptop at the PR head 46c5e6d; the PR body is a fleet-style summary ("Closes aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347") with evidence and test sections.
    • Instruction to the resuming lane: Do NOT re-park on author metadata alone. Revalidate with the corrected criteria (task's own queue/* branch + fleet worktree + PR body = fleet-owned; hard stops are the held / user/owned / do-not-merge / do-not-auto-edit labels or explicit Drew direction). If fleet-owned: verify CI/Codex on PR fix(aggregator): quarantine malformed comments and actions records #4151, disposition findings, and merge when verified, closing aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347.
    • Task 5246 remains parked until 2026-11-02T13:31:31Z (no unpark verb); this note is the resume brief.
  12. 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 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane E shift
    • Session / ID: task 5246
    • Found via: queue claim (resume of parked task 5246)
    • Task: task 5246 — aggregator: safely quarantine malformed comments and actions records (aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347)
    • State: PR fix(aggregator): quarantine malformed comments and actions records #4151 (branch queue/5246-2347-quarantine-malformed-records, head 46c5e6d) is this task's own canonical PR — the earlier Drew-owned park was the shared-account false positive (dezren39 is the fleet account; judged by queue/ branch + PR body task refs). Revalidating fresh: Codex review reports no findings; CI failures (slice-3 routes, hub renders) reproduce identically on clean main — pre-existing, unrelated to the aggregator store diff.
    • Next: merge PR fix(aggregator): quarantine malformed comments and actions records #4151 under standing merge authority, then complete task 5246.
  14. dezren39
    closed this as completedin #4151on Nov 2, 2026
  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  16. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane E shift
    • Session / ID: task 5246
    • Task: task 5246 — aggregator: safely quarantine malformed comments and actions records (aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347)
    • Outcome: PR fix(aggregator): quarantine malformed comments and actions records #4151 MERGED (merge commit 15af52b); aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 closed by the merge.
    • Verification: PR fix(aggregator): quarantine malformed comments and actions records #4151 is task 5246's canonical PR (queue/ branch + task-bound body). Codex review: no findings. CI on PR fix(aggregator): quarantine malformed comments and actions records #4151: 965 pass, 2 fail (slice-3 routes, hub renders) — both fail identically on clean main (run 41408447148), pre-existing and unrelated to the aggregator store diff. Targeted store tests passed per PR fix(aggregator): quarantine malformed comments and actions records #4151 evidence (46 passed: store-corrupt, store-concurrency, actions, api-health-comments, comments-queue-1210).
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/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator 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.