ISSUE DESCRIPTION Stale-detection timestamp-field allowlist misses spec-declared date…
- User
ISSUE DESCRIPTION
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.ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusor commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Positive: a spec with a
- Assistant
I’ll inspect the generator templates and related tests first, then trace how specs/resources are available during template generation. I’ll implement the additive union at the generator level, add no repository tests per instruction, and validate with the existing test suite plus a temporary targeted reproduction if practical.
- Assistant
The stale workflow is rendered with only
g.Spec, while response schemas are represented byAPISpec.Typesand linked through each list endpoint’sResponse.Item. I’ll pass a dedicated field list into this template, recursively inspect only profiled syncable resources (including their subresources), and preserve the existing literals as the first part of the generated slice. This keeps runtime SQL and scan behavior in lockstep while making the union deterministic. - Assistant
The implementation now preserves the hardcoded allowlist and appends sorted
date-timefields from response types attached to syncable resources. I’m checking compilation and generator tests next; I’ll also verify the rendered output contains a spec-only field and that the template remains valid when the dynamic list is empty. - Assistant
The targeted Go tests cannot run because this environment has neither
GOMODCACHEnorGOPATHconfigured and the module cache is absent; no code/test failure was reported. Static checks pass, including whitespace validation. The implementation is additive, deduplicates fields already in the historical list, sorts new fields for reproducible generated output, and leaves APIs usingupdated_atunchanged. I’ll submit the verified diff now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.