Skip to content

approvals: GET /api/v1/approvals/requests/UNKNOWN/actions answers 200 [] while GET /requests/UNKNOWN answers 404 #27451

Closed

Description

@objectstack-fleet

domain:devx#1 · sunhaolin · session_017xRBcVkGJizGH7raJHhAvL

Filing gate: ① a product defect found by a QA run (off-clause probe, RUNNER rule 8). It belongs to the "unknown id answers empty instead of 404" class that #25486 fixed for other doors.

Reproduction

  1. Boot the showcase and sign in as admin.
  2. GET /api/v1/approvals/requests/areq_does-not-exist returns 404 REQUEST_NOT_FOUND.
  3. GET /api/v1/approvals/requests/areq_does-not-exist/actions returns 200 {"data":[]}.
  4. Expected: the actions sub-resource answers 404 for a request that does not exist (or is not visible to the caller), the same as its parent. A non-participant reading an existing request's actions should get the same answer as the parent read.
  5. Actual: 200 with an empty list. "No actions yet" cannot be told apart from "no such request". A non-participant also gets 200 [] on a real request's /actions, which leaks no rows but answers differently from the parent's 404.

Mechanism

packages/rest/src/approvals-routes.ts ~L574–590 returns {data: rows} from svc.listActions without first resolving the request under the caller's scope.

QA-source: #27441 · approvals.decision-action-matrix · observed beside the clauses


Generated by Claude Code

Activity

  1. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: 审批与自动化 | none | P⑤

    Triage: p3 · domain:server · area:workflow · 2026-10-29T08:13Z

    ⛔ Not a claim.


    Generated by Claude Code

  2. added
    area:workflowApprovals and automation — the work that runs without a person driving it
    bugSomething isn't working
    domain:serverDomain lane — seat card indexed by label:pm:seat
    on Oct 29, 2026
  3. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL

    Claim: PM loop round 1 · 2026-10-29T22:01Z · fold head (members: #27451, #27493 — triage 6495966619 ruled #27493 a duplicate folded into this fix)
    Session: session_016WV4d1Np3hU7RQnA13YZcL (seat subagent, mode:subagent; the dev's identity is the branch)
    Account: os-elon-musk
    Branch: claude/project-thread-kwainq (the seat session's platform-assigned branch — the recorded platform exception)
    Worktree: objectstack-issue-27451
    Domain: domain:server
    Seat: domain:server#4
    File surface: packages/rest/src/approvals-routes.ts (the GET …/approvals/requests/:id/actions handler only) and its tests, .changeset/*; ⛔ no packages/spec, no governed path — stop on breach and explain in the report
    Container & model: S, mode:subagent, model: default (TIER_DEFAULT; dispatch-gates --tier: no path-derived mandate), effort: medium; a CONTRACT_REVIEW_TIER review is owed before approval (narrowing, the #25486 / PR #25628 precedent)
    Clause-②: no (narrowing — an unknown or invisible request id is answered 404 REQUEST_NOT_FOUND, as its parent door answers, instead of 200 {"data":[]})
    Metadata-protocol: none
    Responsibility: packages/rest's actions sub-resource lists rows without resolving the parent request under the caller's scope; the platform path that covers it is the sibling GET …/requests/:id handler's existing lookup (triage 6495966619); reached by any signed-in caller of the approvals API.
    Thread-read: 6491511316
    Premise: holds (approvals-routes.ts on origin/main 481ade61: the handler calls svc.listActions(req.params.id, …) and answers { data: rows } with no parent lookup)
    Serial constraints cleared: no open PR touches approvals-routes.ts (16 open PRs read); in-flight #27397 (os-sales) works plugin-approvals/src/approval-service.ts, a different package. Fold gates: ① same defect, same fix; ② one file, one changeset; ③ both graded p3; ④ each checked by the same 404 pin; ⑤ excluded: none.

  4. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL
    os-dev-report

    Seat subagent report for the #27451 + #27493 fold (posted by the seat; the dispatch fenced card comments off the dev). PR #27790, head acf67294ccc7bf52a92ac5963d4131bcd180f458, branch claude/project-thread-kwainq.

    • status: done · premise_still_valid: true (the actions handler listed rows with no parent lookup; ApprovalService.listActions answers [] for an unknown or invisible parent).
    • fix: one local helper readableRequestOr404 in registerApprovalsEndpoints, called by GET /requests/:id and GET /requests/:id/actions; both answer the parent's own 404 REQUEST_NOT_FOUND. Unknown and invisible ids answer alike; a visible request is 200 unchanged.
    • pins: packages/rest/src/rest-approvals-actions-unknown-request.test.ts, 3 cases; red before the fix (2 failed, expected 200 to be 404); ablation of the parent lookup → same 2 red; restore verified.
    • tests: @objectstack/rest 343 files / 6695 passed; typecheck exit 0; dogfood battery 2867 passed / 20 skipped, 0 failed.
    • gates: 59 derived, 57 run all exit 0, 2 NOT MEASURED (exit 3: check-plugin-teardown-shape --self-test in a shallow clone, check:dual-build-cjs-loads).
    • line_budget: S, +174 / −5 over 3 files.
    • deviations: the parent handler's lookup and 404 moved into the shared helper (the only way to keep one copy of the rule; the parent's answer is pinned unchanged).
    • out_of_scope_findings: none filed (two parent reads per actions request — efficiency only, Acceptance notes).
    • writes: 1 relay pr_create, 3 git pushes; mcp_calls: 0.
    • contract review: owed (narrowing), arranged by the seat.
  5. objectstack-fleet commented on Oct 29, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL

    ACCEPT → PR #27790 comment 6511069295 · head acf67294 · 2026-10-29T23:37Z · landing sent (contract review PASS 6511002032).

  6. objectstack-fleet commented on Oct 30, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL

    Landed · 2026-10-30T00:13Z

    reading value
    PR #27790 MERGED 2026-10-30T00:13:19Z, merge commit a3014cb3 (merge queue)
    this card closed by Fixes #27451

    State: pm:dispatched removed in this stroke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:workflowApprovals and automation — the work that runs without a person driving itbugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions