A Copilot coding agent picks up a well-specified ticket and runs Preflight without human interaction.
Issue #247: Add updatedAt timestamp to User model
Acceptance criteria:
- Add
updated_atcolumn touserstable (timestamp, not null, default now) - Update
Userstruct inmodels/user.gowithUpdatedAt time.Timefield - Set
UpdatedAttotime.Now()inUpdateUser()function - Add migration file
- Add test verifying
UpdatedAtchanges after update
Read models/user.go (User struct, lines 12-24), models/user.go:UpdateUser (lines 45-62), migrations/ directory (latest: 003_add_email_verified.sql), and models/user_test.go.
Current User struct has fields: ID, Email, Name, CreatedAt. No UpdatedAt field exists. Migrations use sequential numbering. Tests use a test database with setupTestDB() helper.
Ticket spec is complete:
- Column type specified (timestamp, not null, default now)
- Struct field specified (
UpdatedAt time.Time) - Function to modify specified (
UpdateUser()) - Test requirement specified
- No ambiguity detected. Proceeding.
I'll add migration 004_add_updated_at.sql, add the struct field, set it in UpdateUser(), and add a test. Single approach — the ticket fully specifies the implementation.
Plan logged. Files:
- Create:
migrations/004_add_updated_at.sql - Modify:
models/user.go(struct + UpdateUser function) - Modify:
models/user_test.go(add TestUpdateUser_SetsUpdatedAt)
All acceptance criteria will be met. Proceeding.
Agent writes the migration, struct update, function update, and test.
The autonomous agent didn't ask questions — but it still verified the spec was complete (Phase 2) and logged its plan (Phase 4) before writing code. If the ticket had been missing acceptance criteria, the agent would have labeled it needs-spec and stopped.