Skip to content

feat(app): scaffold cli-first go starter with tasks api - #1

Merged
samzong merged 1 commit into
mainfrom
feat/cli-first-go-starter
Jul 20, 2026
Merged

samzong merged 1 commit into
mainfrom
feat/cli-first-go-starter

Conversation

@samzong

@samzong samzong commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What's changed?

  • Scaffold a CLI-first Go starter: stdlib HTTP tasks CRUD (/health, /tasks, /tasks/{id}).
  • Ship OpenAPI contract, lathe-generated appctl CLI, generated modules under internal/generated/, and skills/appctl/.
  • Add Makefile gates (cli-sync / test / check), CI that verifies generated artifacts stay current, AGENTS.md agent contract, and MIT license.

Why

  • Establish the lathe-cli Go starter as a CLI-first acceptance surface: app + OpenAPI + generated appctl stay in lockstep from day one.

Verification

  • make check (cli-sync, build, go test ./..., go vet ./...) passed locally.
  • Pre-ship gate: 0 MUST-FIX; deferred items listed below.

Considered and deferred

  • openapi/openapi.yaml:3 [BOT-NIT]: info.title still says "CLI-first Node application" for a Go starter — cosmetic metadata, not a runtime or operation contract break.
  • internal/app/app.go:169 [BOT-NIT]: writeJSON ignores Encode errors after WriteHeader — standard pattern once headers are committed.
  • cmd/server/main.go:25 [BOT-SCOPE]: no graceful shutdown/signal handling — out of minimal starter scope.
  • internal/app/app.go:64 [BOT-TASTE]: title has no upper bound beyond MaxBytesReader — matches OpenAPI minLength-only validation.

Initial lathe-generated Go app: tasks CRUD over stdlib HTTP, OpenAPI
contract, generated appctl CLI, and CI that keeps generated artifacts current.

## Considered and deferred

- openapi/openapi.yaml:3 [BOT-NIT]: info.title still says "CLI-first Node application" for a Go starter — cosmetic metadata, not a runtime or operation contract break.
- internal/app/app.go:169 [BOT-NIT]: writeJSON ignores Encode errors after WriteHeader — standard pattern once headers are committed.
- cmd/server/main.go:25 [BOT-SCOPE]: no graceful shutdown/signal handling — out of minimal starter scope.
- internal/app/app.go:64 [BOT-TASTE]: title has no upper bound beyond MaxBytesReader — matches OpenAPI minLength-only validation.

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong
samzong merged commit 1eefd7c into main Jul 20, 2026
1 check passed

@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: d373a24c18

ℹ️ 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/app/app.go
Comment on lines +90 to +93
var body struct {
Title *string `json:"title"`
Completed *bool `json:"completed"`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject explicit null fields in task updates

When a PATCH body combines a valid field with "title": null or "completed": null, encoding/json leaves the corresponding pointer nil, making it indistinguishable from an omitted field. For example, {"completed":true,"title":null} succeeds and returns 200, even though the OpenAPI contract declares both properties as non-nullable string/boolean; preserve field presence or validate nulls so invalid CLI/API input is rejected.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant