Skip to content

Attachments tab: blank uploader for other people's files (uploaded_by arrives as a bare id) and no Rename in the file-row menu (follow-up to #35602) #35724

Closed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Filing gate: ① a visible defect outside #35602's file surface (UI only; the fix is server or data work). Filed by area ux-3 on seat 5's ruling. Suggested grade: p2. ⛔ Not a claim; triage sets lane and grade.

Observed

PR #35708 (#35602) turns the record Attachments tab into 33px file rows with an uploader column. sys_attachment.uploaded_by reaches the client as a bare user id, not expanded, so the panel can name only the viewer's own files (it knows the current user id). For every file someone else uploaded, the uploader cell is blank. The PR leaves it blank rather than showing an id, so it is never wrong, but it is empty.

Also open from #35602 item 3: Rename

The card's file-row ⋮ menu names Rename; #35708 ships Download and Delete only, because the panel has no rename seam (renaming a stored attachment is server work). Add a rename route on the attachment service (same permission as Delete: uploader or parent editor), and a Rename item in the row ⋮ menu that calls it.

Done when

  • The attachments read the panel uses returns the uploader's display name (an expand of uploaded_by, or a name field the server stamps), shaped by the reader's existing user-read rights, and no wider.
  • The Attachments tab shows the uploader for every row the reader may see. A test pins one other-user file showing its uploader's name, and one reader without user-read rights getting no name and no id.

Surface hint: packages/services/service-storage/src/file-attachment-service.ts (and whatever list route feeds ui/packages/app-shell/src/views/RecordAttachmentsPanel.tsx).

  • Rename: the row ⋮ menu offers Rename to a reader who may delete the file, and the new name persists on reload; a reader who may not delete sees no Rename. Pinned on both sides.

Dedupe: issue search uploaded_by attachment uploader → only #35602.

Activity

  1. added
    finding
    on Nov 20, 2026
  2. changed the title [-]Attachments tab shows a blank uploader for other people's files: sys_attachment.uploaded_by reaches the client as a bare id (follow-up to #35602)[/-] [+]Attachments tab: blank uploader for other people's files (uploaded_by arrives as a bare id) and no Rename in the file-row menu (follow-up to #35602)[/+] on Nov 20, 2026
  3. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server · pm:queue; rationale: area:ux · Bug (the Attachments tab shows a blank uploader for other people's files because uploaded_by arrives as a bare id, and the file row offers no Rename) · users of the record page's Attachments tab, not every user every time → p2 under the UX rule.

  4. added
    domain:server
    pm:queue
    priority:p2
    on Nov 20, 2026
  5. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq

    Claim: PM loop · area f7-text · 2026-11-22T10:23Z
    Session: session_01QsR2jTyyBmoPBsURQjeJGq
    Account: zhuangjianguo
    Branch: claude/issue-35724-attachment-uploader-rename
    Worktree: objectstack-issue-35724
    Domain: domain:server
    Seat: repo:objectstack#7
    Area: f7-text
    File surface: packages/services/service-storage/src/** (file-attachment-service.ts, the attachments list read, a rename route), ui/packages/app-shell/src/views/RecordAttachmentsPanel.tsx and its tests, i18n keys for the Rename item, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: opus (default tier; dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: objectstack service-storage serves sys_attachment.uploaded_by as a bare id and has no rename seam | none — PR #35708 left the uploader blank and shipped Download/Delete only | every record-page Attachments tab reader
    Thread-read: 7029758904
    Premise: holds — on origin/main 4e55e4e uploaded_by is server-stamped from the session (attachment-access-hooks) and reaches the panel unexpanded; no rename route exists in service-storage.
    Pre-claim lane: repo:objectstack whole-repo lane, area f7-text (seat 7 partition; the maintainer's 「同意」 2026-11-22T10:11Z on the seat thread); RecordAttachmentsPanel.tsx is not RecordDetailView (f7-record).
    Pre-claim deps: #35602 / PR #35708 merged.
    Prior rulings read: title terms → 67 ADR hits (none on attachments; top ADR-0137, ADR-0150), card thread 0 rulings of 1 comment; the card's own rules bind: uploader name "shaped by the reader's existing user-read rights, and no wider"; Rename has "same permission as Delete: uploader or parent editor".
    Fold-or-serial: not folded.
    Serial constraints cleared: none on this file surface among open PRs (read 2026-11-22T10:23Z).
    Declaration note: yes (widening) — a new rename route and a new served name; L2 TIER_DEFAULT unless the diff edits packages/spec/src.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  7. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq
    os-dev-report

    {
      "issue": 35724,
      "status": "done",
      "branch": "claude/issue-35724-attachment-uploader-rename",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36458",
      "session": "session_01QsR2jTyyBmoPBsURQjeJGq",
      "premise_still_valid": true,
      "summary": "Uploader: both reads the Attachments panel makes now expand uploaded_by through the reader's own sys_user read. These are the record page payload's attachments part (the producer, packages/rest/src/record-page-routes.ts, outside the claimed surface, so the fix lands there) and the panel's own list read ($expand). A reader of the uploader gets the name. A reader refused the user keeps the stored bare id, which the panel never renders. No name column is stamped. Rename: PATCH /api/v1/attachments/:id with exactly {file_name}, mounted beside the uploader removal door and added to the route ledger. It reads the row as the caller (404 if unreadable). The uploader is renamed under a system context attributed to them, as the removal door does. Anyone else's rename runs as the caller through the engine, so the edit grant and the update gate's authorizeRows (the same rule as delete) decide, and a refusal is 403 RECORD_NOT_ACCESSIBLE. Only sys_attachment.file_name changes. The panel's row menu offers Rename exactly where it offers Delete (canDelete), through a name dialog, with four i18n keys in all eleven locales. L2: the diff edits packages/spec/src/** (record-page.zod.ts JSDoc prose only, restating the ruling), which routes L2 to CONTRACT_REVIEW_TIER.",
      "tests": "Tree of 78e903181, all under os-verify-lock (VERDICT command-exit 0). service-storage full pnpm test: 87/87 files, 1708 passed, 1 skipped; typecheck exit 0; attachment-removal-routes.integration.test.ts 16/16 (rename door: uploader with no edit grant 200, editor 200, editor without grant 403 PERMISSION_DENIED, reader-not-editor 403 RECORD_NOT_ACCESSIBLE, outsider and unknown id 404, anonymous 401, malformed 400; uploader read: expanded {id,name} for a reader of the user, bare id and no name for one refused). rest --project local: 427 files, 8776 passed, 351 skipped; typecheck exit 0; record-page-routes.test.ts 37/37. ui: the four attachments-panel files plus i18n tests, 110 files, 2039 passed, 13 skipped. Ablations via scripts/ablation-replace.mjs, each restore proven by blob == HEAD and an empty git diff HEAD. (1) Uploader elevation replaced by false: the first run was green, 15/15, VOID because the fixture had no edit-grant stand-in. After adding the stand-in and the no-grant pin: red, 1 failed, 15 passed of 16. (2) Record page expand removed: red, 1 failed, 36 passed of 37. (3) Panel $expand removed: the first attempt was void (client dist missing, no tests ran); after building the client: red, 1 failed, 45 passed of 46. (4) Rename without the canDelete guard: red, 3 failed, 5 passed of 8. No ablation file kept. NOT MEASURED: app-shell type-check (exit 2, 1986 'Cannot find module @object-ui/*' because the ui dist is not built, a missing prerequisite; CI Type Check covers it); the dogfood record-page-streams test was edited but not run locally (declared to CI).",
      "gates": "dispatch-gates --ran reconciliation on 78e903181: 126 derived, 122 run with exit 0, 3 NOT MEASURED (exit 3, PREREQUISITE NOT MET: check-plugin-teardown-shape --self-test on a shallow clone, check:dual-build-cjs-loads with no full build, check:i18n with the CLI not built), 1 UNRUN declared narrowing (pnpm --dir ui exec vitest run scripts/, left to CI). 103 families were run at 1bc31906e. The 22 families that later commits added, plus every earlier red or fixed one, were rerun at 78e903181, all exit 0: tenant-audit-census and its --self-test, spec check:docs, check:generated, check:test-source-alias, check:nul-bytes, check:route-envelope, check:i18n-stale-fill, check:cross-package-test-inputs, check:system-context-census. check-platform-checklist --changed-from origin/main: OK, 1 anchor judged, 0 lost, exit 0. overlap-check --branch=HEAD: VERDICT clean exit 0. PR check-runs at report time on 78e90318: Check Changeset success, Lint ESLint success, Type Check source gates success, Spec property liveness success, PR-body guards success, Dogfood Regression Gate success, Check PR Size success; Build Core, Test Core 1-10, the Lint lanes, Type Check workspace/consumer/debt and Live E2E UI were in_progress.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — relay pr_create (POST repos/objectstack-ai/objectstack/dispatches, fleet-write run 45022649111, opened #36458, read-back 9859/9859 bytes identical) and this os-dev-report issue comment via post-stamped.mjs. git push to the branch is not a REST write.",
      "open_questions": [
        {
          "question": "A rename by someone who is not the uploader goes through the engine, so it needs the object's edit grant, while the ruling offers Rename to a reader who may delete. Should a holder of the delete grant who lacks the edit grant be able to rename?",
          "options": [
            "A: keep it as is. Server: edit grant plus update gate. UI: Rename shown on the delete grant, and a refusal is shown in words.",
            "B: gate the UI's Rename on the edit grant as well (small UI change, one more pin).",
            "C: let the door write non-uploader renames elevated, after its own delete-rule check (restates the rule, so a second copy to keep in step)."
          ],
          "recommendation": "B, because it keeps the rule in one place (the engine and the update gate) and removes the offered-then-refused case; A is acceptable until such a grant combination exists."
        },
        {
          "question": "The ruling says a reader without user-read rights gets no name and no id. The server returns the stored bare id (the engine's ADR-0104 stored form for a refused expand), and the panel renders neither. Is the panel-level 'no id' enough?",
          "options": [
            "A: yes, as implemented and pinned.",
            "B: also strip the id server-side for refused expands (an engine-wide contract change, needs a decision)."
          ],
          "recommendation": "A, because B changes the expand contract for every consumer."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed: a rename changes only sys_attachment.file_name, so a download still carries the original sys_file name (by design of the ruling's scope; in PR Acceptance notes)",
        "carrier: none · noted, not filed: content/docs/permissions/attachments-access.mdx does not yet describe the rename door; a docs follow-up for the seat to place"
      ],
      "deviations": "(1) Files outside the claimed surface, each because the producer lives there: packages/rest/src/record-page-routes.ts and its test (the producer of the panel's first read); packages/spec/src/api/record-page.zod.ts JSDoc prose; the generated content/docs/references/api/record-page.mdx; docs/audits tenant-audit census counts for service-storage (one new write call site); packages/qa/dogfood/test/record-page-streams.dogfood.test.ts. (2) The refusal code for a non-editor is the update gate's RECORD_NOT_ACCESSIBLE, not the dispatch hypothesis's ATTACHMENT_DELETE_DENIED. (3) A check:type-check-debt --re-measure run in my gate loop started a full-workspace turbo build under the shared lock in my worktree. My attempt to kill it was denied by the auto-mode classifier, so I let it finish (gate exit 0). (4) The changeset is patch level for all four packages, per the order.",
      "files_changed": 26,
      "line_budget": "+1057 / -193 across 26 files (git diff --stat origin/main...HEAD)"
    }

    Generated by Claude Code

  8. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq
    os-dev-report

    {
      "issue": 35724,
      "status": "done",
      "round": "rework 1 (seat rulings Q1=B, Q2=A, docs paragraph, PR body)",
      "branch": "claude/issue-35724-attachment-uploader-rename",
      "head": "927ff8061",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36458",
      "session": "session_01QsR2jTyyBmoPBsURQjeJGq",
      "delta": [
        "Q1=B: the row menu offers Rename only when canDelete AND the reader holds the edit grant on sys_attachment (perms.can update). The server is unchanged.",
        "New pin: a reader with the delete grant but no edit grant sees Download and Delete attachment, and no Rename, on both their own row and another's row. Delete+edit sees Rename. Ablation canRename = canDelete: red, 1 failed, 8 passed of 9; restored, blob == HEAD.",
        "Q2=A: the expand contract is unchanged, and the panel-level no-name/no-id pin stands.",
        "Docs: attachments-access.mdx gains a rename-door section (who may rename, the edit grant, the uploader's self-rename, 400/401/403/404) and an enforcement-summary row.",
        "PR body patched via relay issue_patch with the signed trailer: the deviation (UI edit-grant gate beyond the card's wording, seat ruling) and the docs paragraph.",
        "Changeset sentence on the panel's Rename updated to name the edit grant."
      ],
      "tests": "Under os-verify-lock at 927ff8061 (VERDICT command-exit 0): the four attachments-panel test files passed, 4 files, 62 tests. The first ablation attempt was void (fresh worktree, no spec dist, no tests ran); it was rerun after building the @objectstack/client closure.",
      "gates": "The derived list is unchanged from 78e903181 (126 families). Rerun at 927ff8061: 26 docs and delta families exit 0. spec check:skill-examples exit 3, NOT MEASURED (it read no spec declarations; it was 0 at 78e903181, and the rework touches no spec or skills). overlap-check VERDICT clean exit 0. CI at 78e903181: Test UI showed failure only because shard 2/16 was cancelled at 12:55:05Z, when the push of 927ff8061 superseded that run. No test failed. CI on 927ff8061 was in progress.",
      "open_questions": [
        {
          "question": "Under Q1=B, an uploader who holds the delete grant but not the edit grant is not offered Rename, although the door would rename their own attachment without the edit grant. Should the uploader's own row be exempt?",
          "options": [
            "A: keep it as ruled (both grants on every row).",
            "B: canDelete AND (edit grant OR uploaded_by is the caller), which matches the server on both limbs."
          ],
          "recommendation": "B, because it matches the stated rationale (stop offering only doors the server refuses); A, as ruled, is what is implemented."
        }
      ],
      "security_findings": "none",
      "mcp_calls": "0",
      "api_writes": "this round 2: relay issue_patch on #36458 (run 45024753969, 11611/11611 identical) and this comment"
    }

    Generated by Claude Code

  9. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq
    os-dev-report

    {
      "issue": 35724,
      "status": "done",
      "round": "rework 2 (seat ruling B on the uploader row; two CI reds on 927ff8061)",
      "branch": "claude/issue-35724-attachment-uploader-rename",
      "head": "f4edf7037",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36458",
      "session": "session_01QsR2jTyyBmoPBsURQjeJGq",
      "delta": [
        "Ruling B: canRename(row) = canDelete AND (the attachmentRename edit grant OR the row's uploaded_by, bare id or expanded .id, is the caller). The UI now matches the server's two limbs.",
        "New pins: the uploader holding delete but not edit sees Rename on their own row and no Rename on another's, for a bare-id and for an expanded uploaded_by. Ablation (uploader limb removed): red, 2 failed, 8 passed of 10; restored, blob == HEAD.",
        "Test UI (15/16) red was this PR's: the affordance-map census refused the panel's direct perms.can edit-grant read. Fixed with a new attachmentRename row (crud null, grant update) in @object-ui/core's AFFORDANCE_GRANTS plus its census expectation; the panel reads it through resolveAffordance; @object-ui/core added to the changeset. No OUT_OF_FAMILY entry, no skip.",
        "Build and E2E UI red was not this PR's: check:eager-closure refused a superseded ceiling (main moved PER_CHUNK_GZIP_CEILINGS ui-components 451100 to 445144); the gate printed NOTHING GREW. Fixed as the gate directs by merging origin/main 85a995452; no ceiling touched.",
        "PR body patched via relay issue_patch: the attribution and Requested-by lines on top, the corrected deviation sentence, the two off-surface files, the CI root causes; the signed trailer is last.",
        "Docs page and changeset sentences now say Rename is offered on the caller's own uploads, and on every row with the edit grant."
      ],
      "tests": "At f4edf7037 under os-verify-lock (VERDICT command-exit 0). UI: panel files, census affordanceGrantMap-12082, core affordanceGrant-35684 and i18n: 112 files, 2098 passed, 13 skipped. The census alone: 55/55. service-storage rename door and ledger: 19/19. rest record-page: 37/37.",
      "gates": "After the merge, these all exited 0: tenant-audit-census, test-source-alias, route-envelope, i18n-stale-fill, nul-bytes, doc-anchors, cross-package-test-inputs. The docs families on 6582d7525 also exited 0. The derived list is unchanged (126). overlap-check VERDICT clean exit 0. CI on f4edf7037 was in progress at report time.",
      "security_findings": "none",
      "mcp_calls": "0",
      "api_writes": "this round 2: relay issue_patch on #36458 (run 45028359852, 15107/15107 identical) and this comment"
    }

    Generated by Claude Code

  10. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq

    Delivered · 2026-11-22T14:54Z · PR #36458 merged (Fixes #35724).

    pm:dispatched removed in this stroke.

  11. removed
    pm:dispatched
    on Nov 22, 2026
  12. added a commit that references this issue on Nov 23, 2026
    c9b0a23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:serverfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions