Skip to content

service-automation: notify run-summary warnings: stable texts that dedupe, a per-text bound, and a typed overflow count #33500

Closed

Description

@objectstack-fleet

domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom

Loose-ends card for #33341 (landed as #33438). ⛔ Not a claim.

What happens

review#2's contract review of #33438 (comment 6884750517) left three non-blocking nits on the new FlowRunNodeSummary.warnings member:

  1. N1, dedupe defeated by counts in the text. deliveryFailureWarning (packages/services/service-automation/src/.../notify-node.ts) puts the per-execution delivery count in the text ((N deliveries)). A loop whose fan-out varies produces several distinct texts for one cause, so the summary row's distinct-text dedupe folds nothing and the 5-per-node cap fills with near-duplicates.
  2. N2, no per-text length bound. A single warning text has no length bound. Many nodes × 6 long texts can push a run's summary past the serializeSummaryBounded 16 KB cap into detailOmitted. That is the existing fallback working, not a regression, but it drops the whole node list.
  3. N3, the overflow entry is a meta entry inside a data list. A reader that counts warnings.length counts the "N more were left out" sentence too. It is documented in the jsdoc and the schema describe.

Expected

  1. The notify warning text is stable per cause (the count moves out of the text, or into a fixed suffix the dedupe ignores), so repeated failures fold into one entry.
  2. Each warning text in the summary is bounded (truncated with a marker).
  3. Optional, contract-tier: a typed warningsOmitted: number beside warnings replaces the overflow sentence. That is a second widening (Clause-②: yes), so it needs its own contract review; leave it out if (1) and (2) are enough.

Dedupe words: notify warning deliveries count dedupe summary, FlowRunNodeSummary warnings length bound, warningsOmitted overflow entry.
Related: #33341, #33438.

Activity

  1. added
    pm:queue
    domain:server
    on Nov 14, 2026
  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

    Claim: server area-lease mode (#33751 §2), area S6 lease A5, dispatched by seat domain:server#5 area thread · executed by an os-dev sub-agent (mode:subagent) · posted at 2026-11-15T11:19Z
    Session: session_01QsR2jUZKdq3PK2Sab53cT3
    Account: zhuangjianguo
    Branch: claude/area-A5b-33500
    Worktree: objectstack-issue-33500
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/services/service-automation/src/builtin/notify-node.ts and the run-summary warnings bound in service-automation, packages/services/service-automation/src/builtin/region-index-keys.test.ts, their tests, a changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (no path-derived mandate; dispatch-gates --tier at 1e65a389), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds
    Serial constraints cleared: none in flight on these files; the #33748 claim (same package, engine trigger dispatch) is file-disjoint
    Fold: lead card of #33500 + #33380. Item 3 of #33500 (typed warningsOmitted, a widening) is left out, as the card allows.

    Generated by Claude Code

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  4. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3
    os-dev-report

    {
      "issue": 33500,
      "folded": [33380],
      "status": "needs_area",
      "branch": "claude/area-A5b-33500",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/33871",
      "pr_number": 33871,
      "head_sha": "00c913322efbe42d5c3157bcd024c661dfe8d1d4",
      "session": "session_01QsR2jUZKdq3PK2Sab53cT3",
      "premise_still_valid": true,
      "summary": "Draft PR #33871 is open. It has one commit per card plus a merge of origin/main. #33500 commit 4fcd45e2: deliveryFailureWarning (notify-node.ts) no longer puts a count in the step warning. The text names each failed channel with its reason and says whether anything got through, and the counts stay on the node output (failed/delivered/enqueued). run-summary.ts cuts each warning text at MAX_NODE_SUMMARY_WARNING_LENGTH = 300 UTF-16 units with a marker. The cut happens in the summary builder, before the distinct-text fold, beside the 5-per-node cap, and never splits a surrogate pair. Item 3 (warningsOmitted, Clause-② yes) is declined and named in the PR body. #33380 commit 9236f45a: warnings and droppedFields join the invariant Eq type pin in region-index-keys.test.ts, and the stale comment is corrected (nodeLabel is the only engine-local field left). Both PM hypotheses held: the count lived in deliveryFailureWarning, and the dedupe and cap live in run-summary.ts nodeWarnings/summarizeRun. needs_area is for one item only: #33380's N2 (the stepAdvisoriesOf docblock in dag-traversal.ts) sits outside the claim's file surface. The PR therefore says Part of #33380, and the question is in open_questions.",
      "tests": "service-automation full suite under the lock at 4fcd45e2: Test Files 282 passed (282), Tests 3982 passed (3982), VERDICT command-exit 0. Merge head 00c91332, after rebuilding the closure: run-summary.test.ts, notify-delivery-outcome.integration.test.ts and region-index-keys.test.ts gave Test Files 3 passed (3), Tests 68 passed (68). Package typecheck (tsc + check:test-typecheck OK), VERDICT command-exit 0. New pins: 4 per-text bound cases in run-summary.test.ts, and 1 looped-notify integration case (real MessagingService, loop over recipient lists of 1/2/3 on an unregistered push channel, emit spy shows failed 1,2,3, one identical step text, one entry on the FlowRunSummarySchema-parsed row). Ablations, all through scripts/ablation-replace.mjs, each restored (blob == HEAD, git diff HEAD empty). (1) engine StepLogEntry.droppedFields widened to Array of DroppedFieldsEvent & {at?: string}, a shape still assignable elsewhere: tsc gave exactly one error, region-index-keys.test.ts(76,5) TS2344 'false' does not satisfy 'true'. A first try with unknown[] was also caught by run-history/engine assignability, so it was replaced by the narrower mutation. (2) Count put back in the notify text: loop case red with 'one text for one cause: expected 3 to be 1'. (3) Bound removed (seen.add(warning)): 3 cases red, including 'expected length 300 but got 1217'. (4) Surrogate guard deleted: 'never splits a surrogate pair at the cut' red.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at 4fcd45e2 derived 68 commands. A local sweep ran 64: 63 exit 0, including check:type-check-debt under the lock (VERDICT command-exit 0) and check:nul-bytes. check-plugin-teardown-shape --self-test exited 3 (PREREQUISITE NOT MET, shallow clone); after git fetch --depth=1 origin 621a487607881c66b2899b7e3477115229a156b4 it exited 0 with 48 cases. The PR-body gates ran on the final body with GITHUB_EVENT_PATH: check-changeset-no-major --base origin/main 0, check-adr-0087-registration --base origin/main 0, check-closing-keyword-parity 0, check-partof-closing-keyword 0. pnpm lint (repo-wide eslint) exit 0. dispatch-gates --ran: 68 derived, 67 run, 1 UNRUN (check:dual-build-cjs-loads, left to CI on purpose). CI on 00c91332 when reported: 5 completed, 18 in_progress (in_progress is the honest value). mergeable_state blocked (draft and checks pending, no conflict).",
      "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2: pr_create via fleet-write relay (repository_dispatch, run 43715648691, PR #33871); this os-dev-report comment on #33500 via post-stamped. git push is not a REST write.",
      "files_changed": [
        ".changeset/33500-notify-warning-stable-bounded.md",
        "packages/services/service-automation/src/builtin/notify-node.ts",
        "packages/services/service-automation/src/builtin/notify-delivery-outcome.integration.test.ts",
        "packages/services/service-automation/src/run-summary.ts",
        "packages/services/service-automation/src/run-summary.test.ts",
        "packages/services/service-automation/src/builtin/region-index-keys.test.ts"
      ],
      "line_budget": "207 insertions, 23 deletions across 6 files vs origin/main. No skills/** and no ratcheted ledger touched.",
      "deviations": [
        "dev-common asks for the tests of direct dependents. The 13 direct dependents of @objectstack/service-automation (cli, client, 4 connectors, plugin-approvals, 2 triggers, verify, dogfood, 2 examples) were NOT run locally, following os-dev.md: the public surface is byte-unchanged, because index.ts exports neither new constant. A repo-wide git grep found no reader of the old notify text outside run-summary.test.ts. They are declared to CI Test Core.",
        "The type-pin ablation temporarily mutated packages/services/service-automation/src/engine.ts in this worktree only (never committed, restored to the HEAD blob). That file is in the same package that the parallel #33748 agent works on.",
        "The merge commit 00c91332 carries no session trailer; check:commit-card-trailers passed on push."
      ],
      "open_questions": [
        {
          "question": "#33380 N2: the stepAdvisoriesOf docblock in packages/services/service-automation/src/dag-traversal.ts says the step and the terminal answer 'can never disagree about which events were real'. A host event with fields: [] stays on the step, while foldDropEvents drops it (run-dropped-fields.ts:68). dag-traversal.ts is outside the claim's file surface. May I extend the surface, and which fix?",
          "options": [
            "A. Extend the surface to dag-traversal.ts and narrow the sentence: a comment-only commit of about 3 lines on this PR, and the body moves to closing #33380 through a seat issue_patch. Business need: no in-tree producer emits an empty event (measured: the only writers are crud-nodes/notify via the engine and creditChildRun), so prose that matches reality is all the pull asks. Long-term: an honest docblock, no new behaviour. AI-error axis: neutral, it neither loosens nor tightens. Startup focus: the smallest change, no new behaviour or gate.",
            "B. Extend the surface and add the filter (skip events with fields.length === 0 in stepAdvisoriesOf), with a pin and an ablation, so step and answer really agree. Business need: none measured (zero producers). Long-term: one source of truth for which events are real. AI-error axis: structurally stronger, because a host executor cannot persist a meaningless event. Startup focus: a behaviour change and a test with no pull, about 15 lines.",
            "C. Leave N2 out of this PR. #33380 stays open (Part of), and the seat carries it as a separate small item. No surface breach, but the card remains open for a 3-line comment."
          ],
          "recommendation": "A, because it has zero measured pull (no producer emits an empty event), the card itself offers 'or narrow the sentence', and a prose fix adds no behaviour. B is the right answer only if a host-executor producer of empty events turns up."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted in PR Acceptance notes, not filed. Delivery reasons from service-messaging can name a recipient (email-channel.ts: no email address for recipient X; nothing was sent to X), so per-recipient reasons still give distinct notify texts per recipient. The 5-entry cap and the new per-text bound keep the row bounded. This is the messaging producer's text and outside this card. Dedupe words: notify warning recipient reason distinct, email-channel error recipient text, summary warnings per-recipient dedupe",
        "carrier: none · noted in PR Acceptance notes. The spec describe on FlowRunNodeSummary.warnings does not mention the per-text cut. It is still true ('Bounded per node … the step log holds each execution's own'), and packages/spec was out of bounds."
      ]
    }
  5. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

    Follow-up filed · 2026-11-15T12:58Z

    review-c nit N2 on PR #33871 (verdict 6894657883) → #33874 (spec lane, p3): the FlowRunNodeSummarySchema.warnings describe gains the per-text cut, and the refusedNotify fixture in packages/spec/src/automation/execution.test.ts drops the retired count-bearing text. Lands after #33871.


    Generated by Claude Code

  6. added a commit that references this issue on Nov 16, 2026
    b820e16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:serverpm:dispatchedpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions