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
POST /api/v1/email/send with a JSON array body answers 400 VALIDATION_FAILED instead of the INVALID_REQUEST the route gives every other non-object body #31496
Found by the QA run #31486 (subject 0647dabb) while driving integration-system.email-template-render acceptance[7]. The runner scored that clause on the ledgered 400; the code mismatch is carded here.
POST /api/v1/email/send with the body [1,2] → 400 VALIDATION_FAILED "subject is required".
Expected (the clause, and the route's own contract): a non-object body → 400 INVALID_REQUEST "JSON body required", before the message reaches the email service.
Mechanism
packages/rest/src/email-routes.ts line 268: if (!body || typeof body !== 'object'). An array is typeof 'object', so it passes the route's own check and the service then refuses it as a bad message shape. The same file's address reader (line 130) already excludes arrays with Array.isArray(value).
Owning package: @objectstack/rest. Full evidence: #31486, slice C3a.
Claim: PM loop round 1 · 2026-11-08T13:01Z
Session: session_01FEkQ5mNZhe975x6zR3ULqS (card thread, dev) · seat session_01FEkQ5o8PE7ZtVjcor51wBZ
Account: os-project-manager
Branch: claude/project-thread-7t0m2i
Worktree: objectstack-issue-31496
Domain: domain:server
Seat: domain:server#5
File surface: packages/rest/src/email-routes.ts (the send route's body check, plus same-shape checks in that file) + tests, root .changeset/
Container & model: S, mode:thread, model: default tier (dispatch-gates --tier: no path-derived mandate), effort: thread default
Clause-②: no — expected: an array body is refused 400 before and after, now with the route's own INVALID_REQUEST before the service is reached; nothing accepted today is refused; the dev confirms from the real diff
Metadata-protocol: none
Responsibility: @objectstack/rest email send door (objectstack) | an array body passes the route's typeof === 'object' check and the service answers VALIDATION_FAILED instead of the route's INVALID_REQUEST (QA #31486 C3a) | every caller of POST /api/v1/email/send
Thread-read: 6721195395
Premise: holds per QA run #31486 (subject 0647dabb); the dev measures red on main first
Serial constraints cleared: cleared — no open PR touches packages/rest/src/email-routes.ts
Scope: Fixes #31496. The send route's body check excludes arrays; same-shape checks in the same file fixed and named; same-shape checks elsewhere listed in open_questions, not fixed. #31490 follows in the same thread under its own claim after this merges. Order: /mnt/project-files/pm-orders/server/order-31496.md. Summons: the maintainer's 「server 再开两个座位」「并发都是5」 (this project, 2026-11-07); grading per 「定级你可以自己决定」 is triage's here (graded on the card).
domain:server#5 · os-project-manager · session_01FEkQ5mNZhe975x6zR3ULqS
os-dev-report
{
"issue": 31496,
"status": "done",
"branch": "claude/project-thread-7t0m2i",
"pr": "#31541",
"session": "session_01FEkQ5mNZhe975x6zR3ULqS",
"premise_still_valid": true,
"summary": "POST /api/v1/email/send now admits a present body only when it is a plain JSON object (the file own isPlainObject helper, which excludes arrays), and no longer defaults a JSON null to {}; an array or null takes the route own 400 INVALID_REQUEST JSON body required before emailService.send is called. An absent body is still the empty message for the service and every object body is forwarded unchanged. email-routes.ts registers one route, so this is the only route body check in the file (headersRefusal already uses isPlainObject). Clause-2 read from the diff: no (shipped service refused every array/null body 400 VALIDATION_FAILED for a missing subject; still 400, now the route code). Card assignee untouched; PR opened with no assignees.",
"tests": "Red on main first (6a70821 base, pins only, fix absent): email-send-door-bounds.test.ts Tests 4 failed | 46 passed (50) -- array of numbers, empty array, array holding a message, JSON null each expected 400 got 200; string/number cases already green. Green on 0319dc5: email-send-door-bounds + email-send-display-name 2 files 69 tests passed (lock VERDICT command-exit 0). pnpm --filter @objectstack/rest test on 1dfcd3e: 394 files, 7546 passed, 332 skipped (VERDICT exit 0). pnpm --filter @objectstack/rest typecheck exit 0. Ablation via scripts/ablation-replace.mjs (suite imports src, no dist leg): leg 1 restores the typeof check, anchor 1 to 0, blob 626f40efea2e to 895cf1968604, Tests 3 failed | 47 passed (the three array cases), restored blob == HEAD, git diff HEAD empty; leg 2 restores req.body ?? {}, blob 626f40efea2e to 47919d207c32, Tests 1 failed | 49 passed (JSON null), restored blob == HEAD, git diff HEAD empty.",
"gates": "dispatch-gates --commands on final head 0319dc5 (after one merge of origin/main): 64 commands, all 64 exit 0, exit codes captured before any pipe; --ran with per-line exit codes: 64 derived, 64 run, 0 NOT-MEASURED (a DERIVED zero). First pass on df3a5a3 had 3 non-zero: check-plugin-teardown-shape --self-test exit 3 (shallow; fixed by fetching 621a487 depth 1), check:dual-build-cjs-loads exit 3 (dists not built yet), check:test-source-alias exit 1 (asked for a module-top import of @objectstack/objectql in the edited test; added in 0319dc5); all three exit 0 on rerun and in the final-head loop. pnpm exec eslint --no-inline-config on both touched source files exit 0. PR check-runs on 0319dc5: Lint & Repo Gates success, TypeScript Type Check success, Test Core success (8/8 shards success), Build Core success, Governed Surface Queue Guard success, Test UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success (both), PR-body guards success, Lint UI / Type Check UI / Build & E2E UI skipped by selector. Readings: /mnt/project-files/pm-orders/server/31496-gates-ran.txt",
"dogfood_battery": "n/a -- no ! in the PR title and no (narrowing) arm",
"mcp_calls": "7 -- issue_read x3 (31496 get, get_comments x2), list_pull_requests x1, get_check_runs (pull_request_read) x1, plus ToolSearch loads; no GitHub MCP write",
"api_writes": "2 so far -- fleet-write relay pr_create (#31541, labels domain:server, no assignees, 6796 bytes sent = stored), and this os-dev-report comment via post-stamped; plus git push (not a REST write)",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"noted, not filed: the email send door INVALID_REQUEST and VALIDATION_FAILED answers are the flat code/error body while its four bounds answer the nested ADR-0112 envelope; predates this card, carrier: none (acceptance note only)",
"same-shape census for open_questions: packages/rest/src non-test typeof body !== object checks = 4; analytics-dataset-body-door.ts:121, meta-record-currency-backfill-route.ts:106, user-work-routes.ts:131 already exclude arrays; nothing to list"
]
}
Activity
objectstack-fleet commentedon Nov 8, 2026
triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U
Path: none
Triage: audit · p3 ·
domain:server· 2026-11-08T11:58Z⛔ Not a claim.
qa#1, subject0647dabb).POST /api/v1/email/sendwith a JSON array body answers400 VALIDATION_FAILED("subject is required") instead of the route's ownINVALID_REQUESTfor a non-object body. That is a wrong code class with no disclosure.domain:server(messaging route).pm:queue.Generated by Claude Code
objectstack-fleet commentedon Nov 8, 2026
domain:server#5 · os-project-manager · session_01FEkQ5o8PE7ZtVjcor51wBZ
Claim: PM loop round 1 · 2026-11-08T13:01Z
Session:
session_01FEkQ5mNZhe975x6zR3ULqS(card thread, dev) · seatsession_01FEkQ5o8PE7ZtVjcor51wBZAccount:
os-project-managerBranch:
claude/project-thread-7t0m2iWorktree:
objectstack-issue-31496Domain:
domain:serverSeat:
domain:server#5File surface:
packages/rest/src/email-routes.ts(the send route's body check, plus same-shape checks in that file) + tests, root.changeset/Container & model: S,
mode:thread,model: default tier(dispatch-gates --tier: no path-derived mandate),effort: thread defaultClause-②: no — expected: an array body is refused 400 before and after, now with the route's own INVALID_REQUEST before the service is reached; nothing accepted today is refused; the dev confirms from the real diff
Metadata-protocol: none
Responsibility:
@objectstack/restemail send door (objectstack) | an array body passes the route'stypeof === 'object'check and the service answers VALIDATION_FAILED instead of the route's INVALID_REQUEST (QA #31486 C3a) | every caller ofPOST /api/v1/email/sendThread-read: 6721195395
Premise: holds per QA run #31486 (subject
0647dabb); the dev measures red on main firstSerial constraints cleared: cleared — no open PR touches
packages/rest/src/email-routes.tsScope: Fixes #31496. The send route's body check excludes arrays; same-shape checks in the same file fixed and named; same-shape checks elsewhere listed in
open_questions, not fixed. #31490 follows in the same thread under its own claim after this merges. Order:/mnt/project-files/pm-orders/server/order-31496.md. Summons: the maintainer's 「server 再开两个座位」「并发都是5」 (this project, 2026-11-07); grading per 「定级你可以自己决定」 is triage's here (graded on the card).objectstack-fleet commentedon Nov 8, 2026
domain:server#5 · os-project-manager · session_01FEkQ5mNZhe975x6zR3ULqS
os-dev-report
{
"issue": 31496,
"status": "done",
"branch": "claude/project-thread-7t0m2i",
"pr": "#31541",
"session": "session_01FEkQ5mNZhe975x6zR3ULqS",
"premise_still_valid": true,
"summary": "POST /api/v1/email/send now admits a present body only when it is a plain JSON object (the file own isPlainObject helper, which excludes arrays), and no longer defaults a JSON null to {}; an array or null takes the route own 400 INVALID_REQUEST JSON body required before emailService.send is called. An absent body is still the empty message for the service and every object body is forwarded unchanged. email-routes.ts registers one route, so this is the only route body check in the file (headersRefusal already uses isPlainObject). Clause-2 read from the diff: no (shipped service refused every array/null body 400 VALIDATION_FAILED for a missing subject; still 400, now the route code). Card assignee untouched; PR opened with no assignees.",
"tests": "Red on main first (6a70821 base, pins only, fix absent): email-send-door-bounds.test.ts Tests 4 failed | 46 passed (50) -- array of numbers, empty array, array holding a message, JSON null each expected 400 got 200; string/number cases already green. Green on 0319dc5: email-send-door-bounds + email-send-display-name 2 files 69 tests passed (lock VERDICT command-exit 0). pnpm --filter @objectstack/rest test on 1dfcd3e: 394 files, 7546 passed, 332 skipped (VERDICT exit 0). pnpm --filter @objectstack/rest typecheck exit 0. Ablation via scripts/ablation-replace.mjs (suite imports src, no dist leg): leg 1 restores the typeof check, anchor 1 to 0, blob 626f40efea2e to 895cf1968604, Tests 3 failed | 47 passed (the three array cases), restored blob == HEAD, git diff HEAD empty; leg 2 restores req.body ?? {}, blob 626f40efea2e to 47919d207c32, Tests 1 failed | 49 passed (JSON null), restored blob == HEAD, git diff HEAD empty.",
"gates": "dispatch-gates --commands on final head 0319dc5 (after one merge of origin/main): 64 commands, all 64 exit 0, exit codes captured before any pipe; --ran with per-line exit codes: 64 derived, 64 run, 0 NOT-MEASURED (a DERIVED zero). First pass on df3a5a3 had 3 non-zero: check-plugin-teardown-shape --self-test exit 3 (shallow; fixed by fetching 621a487 depth 1), check:dual-build-cjs-loads exit 3 (dists not built yet), check:test-source-alias exit 1 (asked for a module-top import of @objectstack/objectql in the edited test; added in 0319dc5); all three exit 0 on rerun and in the final-head loop. pnpm exec eslint --no-inline-config on both touched source files exit 0. PR check-runs on 0319dc5: Lint & Repo Gates success, TypeScript Type Check success, Test Core success (8/8 shards success), Build Core success, Governed Surface Queue Guard success, Test UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success (both), PR-body guards success, Lint UI / Type Check UI / Build & E2E UI skipped by selector. Readings: /mnt/project-files/pm-orders/server/31496-gates-ran.txt",
"dogfood_battery": "n/a -- no ! in the PR title and no (narrowing) arm",
"mcp_calls": "7 -- issue_read x3 (31496 get, get_comments x2), list_pull_requests x1, get_check_runs (pull_request_read) x1, plus ToolSearch loads; no GitHub MCP write",
"api_writes": "2 so far -- fleet-write relay pr_create (#31541, labels domain:server, no assignees, 6796 bytes sent = stored), and this os-dev-report comment via post-stamped; plus git push (not a REST write)",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"noted, not filed: the email send door INVALID_REQUEST and VALIDATION_FAILED answers are the flat code/error body while its four bounds answer the nested ADR-0112 envelope; predates this card, carrier: none (acceptance note only)",
"same-shape census for open_questions: packages/rest/src non-test typeof body !== object checks = 4; analytics-dataset-body-door.ts:121, meta-record-currency-backfill-route.ts:106, user-work-routes.ts:131 already exclude arrays; nothing to list"
]
}