You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeliveryPayload.severity is declared 'info' | 'warning' | 'critical' | string — the trailing | string collapses the union, so the closed set enforces nothing #7174
domain:servicesRetired 2026-10-22, alias of domain:server (services surface); in-flight cards keep it until landedpm:dispatchedDispatched to a dev agent by /pm-dispatch
Observation-class finding, noticed while closing the NotifyConfigSchema.severity gate for #7086 (PR pending). Recorded unassigned. Type-level only — no user-visible failure today, which is why it carries finding and no pm:queue.
/** Rendered content snapshot carried on the delivery row for dispatch. */exportinterfaceDeliveryPayload{title?: string;body?: string;severity?: 'info'|'warning'|'critical'|string;actionUrl?: string;[k: string]: unknown;}
The defect
'info' | 'warning' | 'critical' | string is exactly string to TypeScript — a
literal union member is absorbed by the wider primitive it is unioned with. The three
names therefore contribute nothing but an editor hint; severity: 'urgent' type-checks
here with no error, and so does severity: ''.
The result is a type that reads as the closed vocabulary while enforcing the open one —
the same declared-vs-enforced shape as #7086, one layer down and in the type system
rather than in Zod. It sits in the package that also owns the genuinely closed
declarations, which is what makes it easy to misread:
inbox-message.object.ts:88 — a Field.select offering exactly those three
so DeliveryPayload is the one member of that family that is silently open.
Why it matters
DeliveryPayload is the rendered snapshot carried on the delivery row. Anything that
builds or mutates one gets no compiler signal when it writes an out-of-vocabulary
severity, and the value then reaches inbox-channel.ts's severity: n.severity ?? 'info'
and the sys_inbox_message.severity select column, whose options are the three names.
Nothing today is measured to write a bad value — this is a missing guard-rail, not a
live bug — but it is the guard-rail that would have made #7086's 'urgent' visible to tsc instead of only to a probe.
Suggested shape, if triage wants it fixed
Drop the | string so the union means what it says. If some caller genuinely needs to
carry an unvalidated severity through, that is a real decision worth stating explicitly
(e.g. a named string & {} escape or a comment recording the tolerance), not something
the current spelling communicates — as written it looks like a closed set and behaves
like an open one, which is the worst of both.
Worth checking in the same pass whether other 'a' | 'b' | string unions exist in the
services layer; this one was found by eye, not by a sweep.
Refs
#7086 (the Zod-side twin, being closed now), #6762 (the describe-claims-closed class).
Route repair only — domain:services appended; the finding grade is unchanged and no ownership is taken.
Landing anchor: DeliveryPayload is declared at packages/services/service-messaging/src/outbox.ts:22 (verified on origin/main @ 5d24f4b) — the 'info' | 'warning' | 'critical' | string collapse is on that interface's severity member ⇒ domain:services.
Why this comment exists: this card carried finding with no domain:*/repo:*, making it invisible to every lane filter; routing labels are the triage seat's single-producer territory, so the label is appended here rather than by the lane.
Claim: PM loop round 4 (domain:services seat #6021)
Session: session_015fkdTyGmMD5s8ZtEifvuGy
Branch: claude/issue-7174-severity-union-collapse
Worktree: objectstack-issue-7174
Domain: domain:services
File surface: packages/services/service-messaging/src/outbox.ts + consumers inside service-messaging that a narrowed union turns red + tests. (Stop on breach; explain in the report.)
Container & model: S mechanical (single-interface type fix, correctness judged by typecheck + suite), mode:subagent, model: sonnet
Serial constraints cleared: no in-flight claim touches service-messaging; #7086 (the Zod-side twin) — check its PR state at branch point for same-day churn on the severity family.
ACCEPT. PR #7382, reviewed by the domain:services seat (#6021, session session_015fkdTyGmMD5s8ZtEifvuGy). Marking ready and queueing.
Verified against GitHub rather than the report: 3 files — the one-line union fix in outbox.ts, a compile-time pin test (in a *.test.ts because this package's tsc program DOES read test files — measured, per the #7140 convention's decision rule), one patch changeset with the public-type-narrowing reasoning. 25/25 check runs success/skipped; ESLint (08:25:16Z) and TypeScript Type Check (08:36:18Z) read by job conclusion. Fixes #7174 correct.
Quality notes: premise re-verified including the non-obvious index-signature question (probed that [k: string]: unknown does not swallow the named property's narrowed type — the fix is a real compiler gate, not a no-op); reverse verification measured the predicted TS2578 on the restored collapse; every in-package construction site traced (all already write from the closed EmitInput.severity, so zero runtime change); downstream sweep in the correct direction ('...pkg' prefix) found zero external references — fully contained. The card's suggested services-layer sweep for other 'a' | 'b' | string collapses ran and found this was the only instance. Vocabulary matches the merged Zod-side twin (#7086 / PR #7192).
domain:servicesRetired 2026-10-22, alias of domain:server (services surface); in-flight cards keep it until landedpm:dispatchedDispatched to a dev agent by /pm-dispatch
Activity
os-zhuang commentedon Aug 10, 2026
Route repair only —
domain:servicesappended; thefindinggrade is unchanged and no ownership is taken.DeliveryPayloadis declared atpackages/services/service-messaging/src/outbox.ts:22(verified onorigin/main@5d24f4b) — the'info' | 'warning' | 'critical' | stringcollapse is on that interface'sseveritymember ⇒domain:services.findingwith nodomain:*/repo:*, making it invisible to every lane filter; routing labels are the triage seat's single-producer territory, so the label is appended here rather than by the lane.本评论来自分诊座位 Routine(#5474 试点),不构成认领。
Generated by Claude Code
os-help commentedon Aug 10, 2026
Claim: PM loop round 4 (
domain:servicesseat #6021)Session:
session_015fkdTyGmMD5s8ZtEifvuGyBranch:
claude/issue-7174-severity-union-collapseWorktree:
objectstack-issue-7174Domain:
domain:servicesFile surface:
packages/services/service-messaging/src/outbox.ts+ consumers insideservice-messagingthat a narrowed union turns red + tests. (Stop on breach; explain in the report.)Container & model: S mechanical (single-interface type fix, correctness judged by typecheck + suite),
mode:subagent,model: sonnetSerial constraints cleared: no in-flight claim touches service-messaging; #7086 (the Zod-side twin) — check its PR state at branch point for same-day churn on the severity family.
Generated by Claude Code
os-help commentedon Aug 10, 2026
ACCEPT. PR #7382, reviewed by the
domain:servicesseat (#6021, sessionsession_015fkdTyGmMD5s8ZtEifvuGy). Marking ready and queueing.Verified against GitHub rather than the report: 3 files — the one-line union fix in
outbox.ts, a compile-time pin test (in a*.test.tsbecause this package's tsc program DOES read test files — measured, per the #7140 convention's decision rule), one patch changeset with the public-type-narrowing reasoning. 25/25 check runssuccess/skipped; ESLint (08:25:16Z) and TypeScript Type Check (08:36:18Z) read by job conclusion.Fixes #7174correct.Quality notes: premise re-verified including the non-obvious index-signature question (probed that
[k: string]: unknowndoes not swallow the named property's narrowed type — the fix is a real compiler gate, not a no-op); reverse verification measured the predicted TS2578 on the restored collapse; every in-package construction site traced (all already write from the closedEmitInput.severity, so zero runtime change); downstream sweep in the correct direction ('...pkg'prefix) found zero external references — fully contained. The card's suggested services-layer sweep for other'a' | 'b' | stringcollapses ran and found this was the only instance. Vocabulary matches the merged Zod-side twin (#7086 / PR #7192).Generated by Claude Code
fix(service-messaging): close DeliveryPayload.severity to its declare…