Stale-detection timestamp-field allowlist misses spec-declared date fields Retro finding…
- User
Stale-detection timestamp-field allowlist misses spec-declared date fields Retro finding · priority: P2 · component: generator · source: Trello CLI generation (printing-press 4.9.0)
What happened
The generated
internal/cli/pm_stale.gomatches inactivity against a hardcodedstaleTimestampFieldsallowlist (updatedAt, updated_at, updatedDate, modifiedAt, modified_at, lastModified, last_modified, lastEditedTime, last_edited_time, updated, last_updated). Trello cards usedateLastActivity, which is absent. The flagshipstalecommand returned "No stale items found" while a hand-builthealthcommand (readingdateLastActivity) counted 93 stale cards on the same hydrated data. Silent-empty flagship command, no error.Root cause
The stale template hardcodes a timestamp-name allowlist instead of also deriving candidate timestamp fields from the spec (properties with
format: date-time).Durable fix (proposed)
Build the stale timestamp-field set as
hardcoded allowlist ∪ spec-declared date-time property names for the synced resources. Guard: union is additive only — never removes existing allowlist entries, so no regression for currently-working APIs.Test
- Positive: a spec with a
dateLastActivity(format: date-time) card property produces astalethat finds rows older than N days. - Negative: an API using
updated_atis unchanged.
Repro / evidence
trello-pp-cli stale --days 14→ empty;trello-pp-cli health→ 93 stale on the same mirror. Fixed by hand-addingdateLastActivityto the allowlist. The allowlist approach will keep silently breaking the flagship command for the next API with an unlisted activity field.Interface
No new interfaces are introduced.
- Positive: a spec with a
- Assistant
I'll locate the stale-detection template and how the generator builds timestamp field allowlists from the spec.
- Assistant
Implementing the fix: adding generator logic to union spec-declared date-time fields with the hardcoded allowlist, and updating the template.
- Assistant
Fixing the template test: hardcoded fields moved to Go, so the test should assert generation output instead.
- Assistant
Implemented the durable fix: the generator now unions spec-declared
date-timeresponse fields from syncable resources onto the existing hardcoded allowlist.Changes
-
internal/generator/stale_timestamp_fields.go— New logic:baseStaleTimestampFields— unchanged historical allowlist (additive guard)staleTimestampFieldsForSpec()— unions base fields with scalarformat: date-timeproperties from syncable and dependent sync resources (viacollectResponseFields)resourceByName()— resolves top-level and sub-resources
-
internal/generator/generator.go—pm_stale.go.tmplnow receivesStaleTimestampFieldsin its template data. -
internal/generator/templates/workflows/pm_stale.go.tmpl— EmitsstaleTimestampFieldsfrom instead of a static list.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.