Skip to content

aggregator(activity): summary caps split surrogate pairs — watchdog/kaneo writers and the record-time cap raw-slice at 500, bypassing the #7694/#7711 capUnits guard #7725

Closed

Description

@developing-today

aggregator(activity): summary caps split surrogate pairs — watchdog/kaneo writers and the record-time cap raw-slice at 500, bypassing the #7694/#7711 capUnits guard

Problem

pm-stack/aggregator/src/activity.ts caps activity summaries with raw slice(0, 500) at four sites, none of them pair-safe:

  • line 120 — watchdogDeliveries: summary: item.title.slice(0, 500)
  • line 196 — kaneoChangeDeliveries (appeared): composed summary .slice(0, 500)
  • line 207 — kaneoChangeDeliveries (moved): composed summary .slice(0, 500)
  • line 485 — the ingestion record: summary: (d.link ? ${d.summary} — ${d.link} : d.summary).slice(0, 500) — a second cap applied at persist time, so even a pair fully inside a writer's 500 can be split when the — link suffix pushes the boundary into it.

This is the #3178 defect class that #7694 fixed for actions.ts cleanText and #7711 fixed for markResult (both merged 2026-11-08) via the capUnits helper (actions.ts:292, not exported): an astral character straddling the cap is dropped whole. The activity writers were not audited in either fix. Summaries are persisted through events.record (line 478-486) into the activity stream and rendered on the board, so a split pair is stored, not just displayed: the stored summary ends in a lone high surrogate, and any UTF-8 round-trip (file write, HTTP response) replaces it with U+FFFD.

Evidence (verified this run, laptop primary @ f9dfb4c, real module md5 1512d949c61186d2cdec988887197654)

Probe ~/git/fleet/probe-activity-surrogate/probe.ts (bun, imports the real activity.ts):

watchdog straddle | len: 500 | last unit: 0xd83d | lone high surrogate at end: true  | utf8 roundtrip changes: true | roundtrip last: 0xfffd
watchdog control  | len: 500 | last unit: 0xde00 | lone high surrogate at end: false | utf8 roundtrip changes: false
kaneo straddle    | len: 500 | last unit: 0xd83d | lone high surrogate at end: true  | utf8 roundtrip changes: true | roundtrip last: 0xfffd
  • Straddle case (watchdog): title = 499 × x + 😀 + tail → watchdogDeliveries summary is 500 units ending in lone \ud83d.
  • Straddle case (kaneo): card title padded so the pair straddles the composed summary's 500 cap → same lone \ud83d ending.
  • Control: 498 × x + 😀 (pair fully inside the cap) → summary intact, round-trips cleanly.

Dedup: searches for "activity surrogate", "watchdogDeliveries", and "kaneo summary" (open + closed) return no issue for these caps; #7694/#7711 cover actions.ts only (filed and fixed this morning; this is the residual door in the sibling module).

Why it matters

Acceptance criteria

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Nov 8, 2026
  2. developing-today commented on Nov 8, 2026

    @developing-today
    ContributorAuthor

    🤖 Agent note · state: filed

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-08 08:05 CST
    • Found via: filed this run
    • Task: Filed — aggregator activity summaries are capped by raw slice(0, 500) at four sites in src/activity.ts (:120 watchdog writer, :196/:207 kaneo writers, :485 record-time persist cap), splitting surrogate pairs and bypassing the capUnits guard aggregator(actions): cleanText caps can split a surrogate pair — a stored action field ends in a lone surrogate #7694/aggregator(actions): markResult caps split surrogate pairs — appliedByRun/resultNote stored with a lone surrogate (residual of #7694) #7711 merged today for actions.ts. Verified on laptop @f9dfb4cfa5 with probe ~/git/fleet/probe-activity-surrogate (real module, md5-checked): watchdog + kaneo straddle cases end in lone \ud83d, UTF-8 round-trip -> U+FFFD; exact-fit control intact. Filed via the developing.today App (user-token create silently no-opped; fleet_paperwork verified by readback).
    • Expectation: effort/xs — done looks like all four caps pair-safe (astral char dropped whole at the cap) with straddle regression tests that fail pre-fix, suite green.
    • Links: body file creator-a-2026-11-08-0805/issue-activity-surrogate-body.md; probe ~/git/fleet/probe-activity-surrogate
  3. developing-today commented on Nov 8, 2026

    @developing-today
    ContributorAuthor

    🤖 Agent note · state: picked up

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-08 08:05 CST
    • Found via: self-assigned during new-issue-creator-code-a run (guarded self-solve, lifecycle protocol §4 — filed this run, trivial mirror of the merged aggregator(actions): markResult caps split surrogate pairs — appliedByRun/resultNote stored with a lone surrogate (residual of #7694) #7711 capUnits fix, no safety labels, no queue task exists to cancel)
    • Task: Making all four summary caps in pm-stack/aggregator/src/activity.ts surrogate-pair-safe (local capUnits mirror) and adding straddle regression tests for the watchdog writer, a kaneo writer, and the record-time cap.
    • Expectation: effort/xs — done looks like a merged PR with the new tests failing pre-fix and the aggregator suite green on the branch and on merged main.
    • Links: branch creator-a/7725-activity-surrogate (laptop worktree); probe ~/git/fleet/probe-activity-surrogate
  4. added
    work/self-assignedAn agent grabbed this item directly, outside the queue
    and removed on Nov 8, 2026
  5. added a commit that references this issue on Nov 8, 2026
  6. developing-today commented on Nov 8, 2026

    @developing-today
    ContributorAuthor

    🤖 Agent note · state: done

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-11-08 08:05 CST
    • Found via: filed this run; self-assigned during the same run (guarded self-solve, lifecycle protocol §4)
    • Task: Done — all four summary caps in pm-stack/aggregator/src/activity.ts now route through a local capUnits helper (astral character straddling the 500 cap dropped whole). PR fix(aggregator): activity summary caps never split a surrogate pair (#7725) #7730 merged as 4e4c7ad; this issue auto-closed via the PR's Fixes marker.
    • Expectation: met (effort/xs) — verified on merged main @4e4c7ad969: capUnits present at :133/:209/:220/:498; test/activity-3321.test.ts 20/20 (4 new tests; the 3 straddle tests fail on pre-fix code, exact-fit control passes both sides); original probe ~/git/fleet/probe-activity-surrogate green against merged main (straddle -> 499 units, no lone surrogate, clean UTF-8 round-trip). Full aggregator suite is run-varying in unrelated timing-heavy areas on both sides (branch run 1650 pass / 31 fail; clean-main baseline 1710 pass / 18 fail — digest argv, source-gate boot, events cursor, collector; no activity/actions failures in either).
    • Links: PR fix(aggregator): activity summary caps never split a surrogate pair (#7725) #7730 (merged 4e4c7ad); branch creator-a/7725-activity-surrogate; body file creator-a-2026-11-08-0805/issue-activity-surrogate-body.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/aggregatorPackage/app: aggregator (pm-stack in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions