Skip to content

Add --visible-to-clients to docs/uploads create (Fixes #556) - #563

Merged
jeremy merged 1 commit into
mainfrom
feat/docs-uploads-client-visibility
Jul 25, 2026
Merged

Add --visible-to-clients to docs/uploads create (Fixes #556)#563
jeremy merged 1 commit into
mainfrom
feat/docs-uploads-client-visibility

Conversation

@jeremy

@jeremy jeremy commented Jul 25, 2026

Copy link
Copy Markdown
Member

Wires create-time client visibility for docs create and uploads create
(plus the top-level upload shortcut), closing the create-side gap left by
#554. After this, all six SDK create inputs that accept visible_to_clients
are consumed by the CLI.

Why these two were deferred

Documents and uploads target an arbitrary folder via --vault/--folder, and
Basecamp only honors create-time visible_to_clients in the project's
docked/root Docs & Files vault. For a nested folder the server ignores
the param and inherits the folder's visibility — and the client-visibility
endpoint 403s for nested docs/uploads afterward, so there's no post-hoc
remediation (recordings visibility doesn't work for them). Exposing the flag
unconditionally would make it a silent no-op for nested targets.

Approach

A shared resolveVaultClientVisibility helper resolves the *bool before any
mutating request
:

  • Flag not passed → nil (server default preserved; tri-state).
  • Root target (no --vault/--folder) → the value, no fetch needed.
  • Explicit folder → inspected via Vaults().Get; a non-nil Parent (nested) is
    a hard error raised before anything is staged (no attachment POST, no
    inline-image upload, no create). The remediation advises creating in the root
    folder or changing the eligible top-level ancestor that controls the folder's
    visibility.

An explicit --visible-to-clients=false reaches the wire; omitting the flag
keeps the context-dependent server default (client-authenticated callers always
create client-visible records).

Tests

files_test.go gains a method+path mock that counts every POST and tracks the
vault-inspection GET, covering both commands and the shortcut: flag presence,
default omission, root true/false, explicit-root vault, nested rejection
(with zero POSTs, including for =false), and the unchanged nested path (no
flag → vault GET not called, create succeeds).

Docs

  • skills/basecamp/SKILL.md — Files & Documents section, root-only note.
  • API-COVERAGE.md — uploads/documents rows note --visible-to-clients (root vault).
  • .surface regenerated.

bin/ci green.


Summary by cubic

Adds --visible-to-clients to docs create, uploads create, and the top-level upload. The flag works only in the project’s root Docs & Files; using it on a nested folder now errors before anything is uploaded.

  • New Features
    • Tri-state behavior: omit → server default; pass true/false → value sent.
    • Root target needs no vault fetch; explicit --vault is checked and nested targets with the flag are rejected with a clear hint.
    • Tests cover root/explicit/nested cases for docs, uploads, and the shortcut; docs and API coverage updated; .surface regenerated.

Written for commit 5365d71. Summary will update on new commits.

Review in cubic

)

Wire create-time client visibility for docs create and uploads create
(plus the top-level upload shortcut), closing the create-side gap left
by #554. The server only honors visible_to_clients in the project's
docked/root Docs & Files vault; for a nested folder it silently inherits
the folder's visibility, and the visibility endpoint 403s for nested
docs/uploads afterward.

A shared resolveVaultClientVisibility helper runs before any mutating
request: with no --vault/--folder the target is the root vault (no fetch),
and an explicit folder is inspected via Vaults().Get — a non-nil Parent
(nested) is a hard error raised before anything is staged. The tri-state
*bool preserves the server default when the flag is omitted and sends an
explicit false when given.

Docs updated (SKILL.md, API-COVERAGE.md) and .surface regenerated.
Copilot AI review requested due to automatic review settings July 25, 2026 04:47
@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) skills Agent skills docs enhancement New feature or request labels Jul 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds create-time client visibility support for Files uploads and documents by wiring a new --visible-to-clients flag into files uploads create, files doc(s) create, and the top-level upload shortcut, while correctly rejecting nested-folder targets where Basecamp would silently ignore the parameter (and later remediation is not possible).

Changes:

  • Add --visible-to-clients (tri-state via Flags().Changed + *bool request field) to uploads/documents create and the upload shortcut.
  • Introduce resolveVaultClientVisibility to gate the flag to the root Docs & Files vault (errors early for nested folders, before any POSTs).
  • Extend unit tests to cover omission, explicit true/false, explicit root vault, and nested-vault rejection (ensuring zero mutating requests on rejection), and update docs/API coverage + .surface.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
skills/basecamp/SKILL.md Documents root-only behavior and adds examples for --visible-to-clients on uploads/docs create.
internal/commands/files.go Adds the flag to relevant commands and implements the root-vault gating helper + request wiring.
internal/commands/files_test.go Adds a purpose-built transport and test matrix verifying tri-state behavior and “no POSTs on rejection”.
API-COVERAGE.md Notes create support for --visible-to-clients on uploads/documents (root vault only).
.surface Regenerates CLI surface snapshot to include the new flags across aliases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

@jeremy
jeremy merged commit cc7df29 into main Jul 25, 2026
27 checks passed
@jeremy
jeremy deleted the feat/docs-uploads-client-visibility branch July 25, 2026 05:44
@jeremy jeremy added this to the v0.8.0 milestone Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations docs enhancement New feature or request skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants