Skip to content

Add and change cloud files and Google documents in Docs & Files - #1012

Open
jeremy wants to merge 12 commits into
mainfrom
sdk-absorb/card-10476950575
Open

jeremy wants to merge 12 commits into
mainfrom
sdk-absorb/card-10476950575

Conversation

@jeremy

@jeremy jeremy commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Why

The gap card 10476950575 names four SDK operations the CLI doesn't reach: adding and changing cloud files and Google documents in Docs & Files. files show already reads both kinds; nothing could create or edit them.

What changed

Operation Command
CreateCloudFile basecamp files cloud-files create [title] --url … [--service] [--description] [--subscribe|--no-subscribe] [--visible-to-clients]
UpdateCloudFile basecamp files cloud-files update <id|url> [--url] [--title] [--service] [--description]
CreateGoogleDocument basecamp files google-docs create [title] --url … [--type] [--description] [--draft] [--subscribe|--no-subscribe] [--visible-to-clients]
UpdateGoogleDocument basecamp files google-docs update <id|url> [--url] [--title] [--type] [--description] [--publish] [--subscribe|--no-subscribe]

The groups hang off files, so they appear under its aliases too (docs, vaults, …), like files documents and files folders.

  • Update is a full replace in Basecamp. Both controllers build a new recordable from the permitted params alone, so an omitted title or description is erased. The update commands read the record first and send back every field no flag changes. The description goes back verbatim, as files update already does for documents. The known rich-text write-back problem with @mentions is card 10439714339.
  • --service is inferred from the URL's host with the same table doors uses, falling back to other. --type is inferred from a docs.google.com path (document, spreadsheets, presentation), falling back to other. An explicit flag wins. On update, a new URL changes the service or type only when its host or path names one.
  • Google documents publish on create unless --draft is given, matching files documents create; Basecamp's own default is a draft. On update, status is left out unless --publish is given, so Basecamp keeps the document's current status. --publish=false is refused, because a published document can't go back to a draft.
  • files show breadcrumbs for a cloud file or Google document now point at these update commands, not at files update, which can't change them.

Builds on

main at 29150b2, which already pins SDK v0.35.0, with main merged in through da36c00. No bump is needed.

Left out

  • --subscribe on cloud-files update. bc3 applies subscriptions on update only to a drafted recording (Recording::DraftSubscribers), and CloudFilesController always creates and updates a cloud file as active. The flag would be a no-op. On google-docs update it is offered and documented as affecting drafts only.
  • Subscriptions on files upload. The card also asks for upload notifications. CreateUpload is already reached, but files upload still sends no subscriber list. That part of the card is untouched, so the card stays open for it.

Tests

  • Unit tests in internal/commands/files_links_test.go cover:
    • inference of the service and type;
    • subscribers sent, [] for --no-subscribe, and none by default;
    • refusals before any request;
    • update sending back unchanged fields;
    • an empty --description clearing it;
    • draft and publish;
    • an explicit --type winning over the URL.
  • e2e validation in e2e/files.bats: create without --url, update with no fields, an unknown --type.
  • Smoke: e2e/smoke/smoke_file_links.bats creates and renames one of each against the QA project. The docs and vaults variants are marked out of scope in smoke_lifecycle.bats, as for the other files subgroups. check-smoke-coverage accounts for every leaf.
  • API-COVERAGE.md gains cloud_files and google_documents rows (232 of 232 tracked), and .surface is regenerated.
  • bin/ci passes locally on c742d62, which merges main through 2032be2. One earlier run failed three timing tests in internal/connector/runner (untouched here); they pass alone and on a full rerun.

Gap card

https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10476950575


Summary by cubic

Adds files cloud-files create/update and files google-docs create/update, so the CLI can now add and change cloud files and Google documents in Docs & Files; previously files show could only read them.

  • Updates replace the whole record in Basecamp, so the update commands read the record first and send back every field no flag changes; an explicitly empty --description clears it. An unchanged description's mentions and files are reduced to bare tags, since Basecamp returns them expanded and stores an expanded copy.
  • Update accepts a URL only from a trusted Basecamp host naming one record of its own type in the configured account, and refuses a comment's permalink; descriptions upload the local images they name.
  • --service is inferred from the URL host and --type from a docs.google.com path, with an explicit flag winning.
  • Google documents publish on create unless --draft is given; on update, status is untouched unless --publish.
  • files show breadcrumbs for these records now point at the new update commands, naming the ID create prints since files list doesn't list them; follow-up commands carry the profile and account.
  • --subscribe is omitted from cloud-files update because Basecamp only applies subscriptions to drafted records, and cloud files are always active; on google-docs update it affects drafts only.
  • Subscriptions on files upload are still unsupported, so the gap card stays open for that.

Written for commit 84af125. Summary will update on new commits.

View guided diff Turn on auto-fix

files cloud-files create/update and files google-docs create/update reach
the SDK's CreateCloudFile, UpdateCloudFile, CreateGoogleDocument and
UpdateGoogleDocument. Basecamp replaces the whole record on update, so the
update commands read it first and send back every field no flag changes.
Copilot AI balanced review requested due to automatic review settings November 7, 2026 17:29
@jeremy

jeremy commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) docs labels Nov 7, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:35:06.251594Z 84af125 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac407b1deb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/commands/files_links.go Resolved

Copilot AI 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.

🟡 Changes recommended

Update commands fail to validate URL hosts, accounts, and resource types, allowing look-alike or cross-account URLs to trigger unintended reads or updates in the configured account.

3 open issues
What changed in this PR

Adds create and update commands for cloud files and Google documents under files and its aliases, extending Docs & Files support beyond reading these records.

Changes:

  • Adds service/type inference, subscription controls, and Google document draft/publish options.
  • Preserves fields not explicitly changed during full-replacement updates and adds type-specific update breadcrumbs.
  • Adds unit, validation, and smoke tests; updates API coverage and the CLI surface snapshot.

[!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.

File Description
internal/​commands/​files.go Registers new command groups and updates breadcrumbs.
internal/​commands/​files_links.go Implements cloud file and Google document creation and updates.
internal/​commands/​files_links_test.go Tests inference, validation, subscriptions, and field preservation.
e2e/​smoke/​smoke_lifecycle.bats Marks shared alias commands as covered by canonical commands.
e2e/​smoke/​smoke_file_links.bats Adds live create/update smoke scenarios.
e2e/​files.bats Adds command-line validation tests.
API-COVERAGE.md Documents cloud file and Google document endpoint coverage.
.surface Records new commands and flags across aliases.

Review effort: Balanced

Comment thread internal/commands/files_links.go Resolved
Comment thread e2e/smoke/smoke_file_links.bats Resolved
Comment thread internal/commands/files_links.go Resolved

@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.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread internal/commands/files_links.go Resolved
Comment thread internal/commands/files_links.go Resolved
Comment thread e2e/smoke/smoke_file_links.bats Resolved
Comment thread e2e/smoke/smoke_file_links.bats Resolved
Comment thread internal/commands/files.go Resolved
…ocument writes

Update takes a URL only from a trusted Basecamp host, naming one record of
its own type in the configured account, as doors does. Descriptions upload
the local images they name, as the other Docs & Files writes do. The smoke
runner runs smoke_file_links.bats, and the files catalog lists the two
new groups.
Copilot AI balanced review requested due to automatic review settings November 7, 2026 17:48
@jeremy

jeremy commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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.

All reported issues were addressed across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread internal/commands/files_links_test.go Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 9cae368f5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeremy

jeremy commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI 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.

🟡 Changes recommended

Recovery hints recommend listings that cannot expose the needed IDs, and follow-up commands omit account/profile scope, so copied commands can fail to find the intended records.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Include effective account and profile in breadcrumbs

internal/​commands/​files_links.go:270

The new show/update breadcrumbs omit the effective account and active profile, so copying them after using a one-off --account, --profile, or URL-supplied account can fail to find the record. Capture newFollowUpScope(app) before account resolution or URL adoption, then append scope.args(app.Config.AccountID) as doors.go does. Apply this to all four new handlers and the new update breadcrumbs in internal/commands/files.go:1555–1561.

2 resolved since last review

Review effort: Balanced

Comment thread internal/commands/files_links.go Resolved
Copilot AI balanced review requested due to automatic review settings November 7, 2026 17:53
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: e862ef6223

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI 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.

🔵 Needs a closer look

Follow-up commands lose profile/account scope and may use the wrong credentials or account, while listing guidance incorrectly suggests that files list includes cloud files and Google documents.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve account scope in follow-up commands

internal/​commands/​files_links.go:270

With --profile, a one-off --account, or an account adopted from an update URL, these numeric-ID breadcrumbs lose the invocation's scope; copying them can use different credentials/account or fail noninteractively. Capture newFollowUpScope(app) before account resolution or linkIDArg, then append scope.args(app.Config.AccountID) to each new show/update breadcrumb, as doors does. Apply this to both create/update command pairs here and the update hints in internal/commands/files.go:1555,1561.

Review effort: Balanced

…p the account in follow-ups

files list doesn't list cloud files or Google documents, so the hints name
the ID create prints instead. Follow-up commands carry the profile and an
account that came from a URL or a flag, as doors does.
Copilot AI balanced review requested due to automatic review settings November 7, 2026 18:08
@jeremy

jeremy commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI previously approved these changes Nov 7, 2026

Copilot AI 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.

🟢 Approved

No active review issues block the new cloud-file and Google-document create/update commands.

1 open issue
1 resolved since last review

Review effort: Balanced

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb8d8fa84a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/commands/files.go Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: a745c988d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI 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.

🟡 Changes recommended

Both update commands accept comment permalinks and silently edit the parent file or document instead of rejecting the comment URL.

1 open issue

Review effort: Balanced

Comment thread internal/commands/files_links.go Resolved
A #__recording_ URL names a comment on the file or document. Updating
its parent instead would write a record the URL did not name.
Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:14
@jeremy

jeremy commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: c742d62204

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI previously approved these changes Nov 19, 2026

Copilot AI 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.

🟢 Approved

No active review issues are reported for the cloud-file and Google-document create/update additions.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@jeremy

jeremy commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

🤖 Converged again on c742d62. It merges main through 2032be2 (#1045: the MCP toolkit bump and tool titles; no conflicts) and refuses a comment's permalink in cloud-files update and google-docs update, answering Copilot's thread. bin/ci is green on the head. One run before that failed three timing tests in internal/connector/runner, a package this PR doesn't touch; they passed when that package ran alone, and on a second full run. CI is green on the head (cubic stopped at its line limit and reported neutral). Copilot approved and Codex found no issues on this head. No open threads. Ready for a person to merge.

* origin/main:
  Open pin-comment repair PRs as the org PR bot (#1052)
  Stop approving Dependabot PRs with GITHUB_TOKEN (#1048)
  Send mentions and files back bare when rich text is edited (#1046)
@jeremy
jeremy requested a balanced review from Copilot November 22, 2026 17:05
@jeremy

jeremy commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

Copilot AI dismissed their stale review, a newer Copilot review was requested November 22, 2026 17:05
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 76861375ea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI 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.

🔵 Needs a closer look

Human review is needed to assess the data-integrity tradeoff of resending expanded rich-text descriptions verbatim and validate live attachment/mention round trips, since stub tests cover only plain descriptions.

No open issues 🎉

Review effort: Balanced

cloud-files update and google-docs update send back the description
they read when no flag changes it. Basecamp returns mentions and files
expanded, and stores an expanded one as content of its own, so each
update added another copy of the figure. Reduce them to bare tags with
richtext.CollapseAttachments, as rich-text input already is (#1046).
@jeremy
jeremy requested a balanced review from Copilot November 22, 2026 18:53
@jeremy

jeremy commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c87dba55ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI 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.

🔵 Needs a closer look

Human review is needed to assess the impact of delayed stdin description validation, which can mask input errors behind account/API failures or trigger unnecessary network requests.

No open issues 🎉

Review effort: Balanced

@jeremy

jeremy commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

🤖 Converged again on c87dba5.

bin/ci is green on the head. One earlier run failed TestARequestStartsFreshWhenTheEarlierSessionIsGone/claude in internal/connector/runner, which this PR doesn't touch. It timed out at 10.6s under host load, passed alone in 1.8s, and the full gate passed on the rerun. CI is green on the head, Codex found no issues on it, and there are no open threads.

Review bodies: 1 finding answered (declined).
Declined: Copilot's review of c87dba5 says --description - is validated only after the record is read. That order is deliberate. Reading the description also uploads any local images it names (resolveLocalImages), and reading it first would upload them before we know the record exists. The only request made before validation is a GET, and nothing is written until the description is valid.

…950575

* origin/main:
  Keep a person's client flag when it is false (#1055)
  Filter gauge listings by chosen projects (#1049)
  Say how to recover a broken connect.json, and keep reporting around it (#1053)
  Support schedule entry drafts, highlights, and join links (#1019)
  Let auth login reach a beta preview on a private network (#1054)
  Resubscribe the feed when its socket stays connected and stops delivering (#1056)
@jeremy
jeremy requested a balanced review from Copilot November 23, 2026 17:31
@jeremy

jeremy commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 84af12515f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI 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.

🟢 Approved

No active review issues remain for the new cloud-file and Google-document creation and editing commands.

No open issues 🎉

Review effort: Balanced

@jeremy

jeremy commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

🤖 Converged again on 84af125. It merges main through e18cb59 (#1019, #1049, #1053, #1054, #1055, #1056). The only files both sides touched are .surface and API-COVERAGE.md, and both merged without conflicts.

bin/ci is green on the head, and so is CI. Copilot approved this head and Codex found no issues on it. There are no open threads, and no review body has a finding left unanswered.

This branch has not been deployed

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

Labels

commands CLI command implementations docs tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants