feat(templates): add --start-date to templates construct - #695
Conversation
The API has accepted project[start_date] on template construction since 2022, so a scripted construction could anchor the template's relative dates to a chosen week only by re-dating every to-do and schedule entry afterwards. --start-date takes YYYY-MM-DD or the natural forms the other date flags accept, is validated before any request, and rides under the project envelope through the SDK's CreateProjectOptions. Template weeks start on Sunday, so the server anchors to the Sunday on or before the date; the help, agent notes and skill say so. Pins the SDK to the head of basecamp/basecamp-sdk#856 through make bump-sdk, with the vendored MCP model re-synced from that checkout and the Nix vendorHash recomputed and build-verified.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The SDK remains pinned to an open PR head that must be replaced with a tagged release before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds --start-date to template construction, enabling natural or ISO dates while documenting Sunday-based anchoring.
Changes:
- Validates and sends
start_datethrough the SDK. - Adds unit/e2e coverage and CLI documentation.
- Updates SDK-generated metadata and dependency hashes.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
File summaries
| File | Description |
|---|---|
internal/commands/templates.go |
Implements the new flag and validation. |
internal/commands/templates_test.go |
Tests parsing and request serialization. |
e2e/templates.bats |
Tests malformed-date handling. |
skills/basecamp/SKILL.md |
Documents date anchoring. |
.surface |
Records the new CLI flag. |
go.mod |
Pins the supporting SDK revision. |
go.sum |
Updates SDK checksums. |
nix/package.nix |
Refreshes the vendor hash. |
internal/version/sdk-provenance.json |
Records SDK provenance. |
internal/mcpserver/model/PROVENANCE.json |
Updates model provenance. |
internal/mcpserver/model/openapi.json |
Adds start_date to the schema. |
Review details
- Files reviewed: 10/11 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9fd04df4d
ℹ️ 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".
… to its own clock
There was a problem hiding this comment.
🟡 Changes recommended
The implementation is sound, but SDK PR #856 remains open and the temporary pseudo-version must be replaced with its tagged release before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/11 changed files
- Comments generated: 0 new
- Review effort level: Balanced
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is consistent with existing date validation patterns and thoroughly tests wire format, omission, parsing, and pre-request failures.
Review details
- Files reviewed: 10/11 changed files
- Comments generated: 0 new
- Review effort level: Balanced
What
basecamp templates construct <id> --name NAME [--start-date DATE]The API has accepted
project[start_date]on template construction since 2022 (bc3project_operations.rb#project_from_template_params), but the command exposed only--name/--description, so every constructed project anchored the template's relative dates to the day of construction and a script had to re-date each to-do and schedule entry afterwards (#659).--start-datetakesYYYY-MM-DDor the natural forms the other date flags accept (tomorrow,next monday,+7), is validated before any request (Invalid start date: "…", usage exit, no network), and rides under theprojectenvelope through the SDK'sCreateProjectOptions. Unset, it stays off the wire.templatesgroup'sagent_notes, andskills/basecamp/SKILL.mdsay so;.surfacecarries the new flag.Dependency — pinned to the tagged SDK release
Depends on basecamp/basecamp-sdk#856 (
ProjectConstructionAttributes.start_date, GoCreateProjectOptions), which shipped in basecamp-sdk v0.18.0.go.modpinsgithub.com/basecamp/basecamp-sdk/go v0.18.0viamake bump-sdk REF=v0.18.0; the vendored MCP model is re-synced from thego/v0.18.0checkout (scripts/sync-mcp-model.sh,PROVENANCE.jsonrefgo/v0.18.0) and the NixvendorHashrecomputed and build-verified (make update-nix-hash). Noreplacedirective. The earlier pseudo-version pin to the #856 branch head is gone; this is the same flip #689 made tov0.17.0.Fixes #659. Tracked on this card; the bc3 doc side is basecamp/bc3#13259.
Tests
templates_test.go: the literal wire body{"project":{"name","description","start_date":"2026-09-01"}}from the recording transport;start_dateabsent when the flag is unset; natural-language parsing; a malformed date rejected as a usage error before any request.e2e/templates.bats: offline usage error for a malformed--start-date.Every
bin/citarget run locally: fmt, vet, lint, lint-actions, e2e, naming, surface, skill drift, bare groups, lint lockstep, smoke coverage, SDK provenance, and go mod tidy green; MCP catalog provenance test green against thev0.18.0pin. The Go unit run is green exceptTestBareBasecampNeverReportsASetupError,TestExplicitSetupStillRefuses,TestDeleteConfirmableFollowsTheAudienceNotTheDeviceand theTestIsInteractive*/TestInteractive*/TestIsTerminalcases inappctx/cli, which fail identically on pristinemainin this non-TTY shell (as #689 and #677 noted).I'm babysitting the review loop on this PR through to convergence.
Release note: Features (
enhancement).Summary by cubic
Adds
--start-datetotemplates constructso template relative dates anchor to a chosen week instead of the week of construction (fixes #659).YYYY-MM-DDor natural forms (tomorrow,next monday,+7); malformed or explicitly blank values fail with a usage error before any request.Dependencies
github.com/basecamp/basecamp-sdk/goto v0.18.0, which providesCreateProjectOptions.StartDate.Written for commit 902b2c4. Summary will update on new commits.