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 trace how synced resource schemas reach the stale template, add the date-time field union at the generator level, and cover both the spec-derived and existing allowlist paths. I’ll stay local as requested; no GitHub issue/claim operations.
- Assistant
rgisn’t installed in this workspace, so I’m switching to localfind/grepinspection. The worktree is clean. - Assistant
The stale workflow currently receives only the raw API spec, even though generation already knows the exact syncable resources. I’m going to pass that profile into workflow rendering and compute a deterministic, additive field list from each sync endpoint’s declared response type; the historical names remain first and unchanged.
- Assistant
The focused regression test is running now. It includes an end-to-end generated-CLI check that seeds the local SQLite mirror and executes
stale --days 14; I’ll use its result to catch both template emission and runtime SQL behavior. - Assistant
The focused tests pass. The package-wide generator suite hit an environment/resource failure while launching its many parallel generated-project checks (the output shows a process crash alongside an unrelated
govulncheckgate), so I’m rerunning deterministically with constrained test parallelism after checking the required golden output. - Assistant
The constrained generator suite is still progressing without new failures. Golden verification itself is blocked by a missing local
jqbinary; there are no stale workflow files in the existing golden fixture set, so this change does not require a golden update. - Assistant
The regression suite is green. A repository-wide compile-only pass also exceeded the container’s process limit under Go’s default parallelism, so I’ve cleared the spawned processes and am rerunning it with package parallelism capped at one and network resolution disabled.
- Assistant
Implementation and targeted runtime verification are complete. The final checks confirm formatting, repository-wide compilation, and the binary build; the full test suite still has unrelated baseline/environment failures (publish-validation fixtures and generated subprocess resource limits), while all stale-field regressions pass.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.