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 trace the stale command template and the generator’s spec/resource metadata flow, then implement the additive date-time field union in the generated logic/template. I’ll inspect tests and run the focused test suite, using a temporary reproduction if needed, without modifying repository tests.
- Assistant
The stale workflow is rendered as a bare
*spec.APISpec, so it currently has no access to profiler-selected synced resources. I’ll add a stale-specific render data wrapper and compute a deterministic additive field list from each synced resource’s list endpoint response type (including dependent resources), while retaining the existing hardcoded entries. The template will emit the resulting union as its single shared list, preserving SQL/scan lockstep. - Assistant
The implementation is in place, but the first focused test run is blocked by this environment’s unset Go module cache variables rather than a code failure. I’ll rerun with the repository’s available cache path, then inspect generated output with a temporary or existing generator test path to verify
dateLastActivityis emitted. - Assistant
The focused stale-template test passes, and the generator package’s ordinary tests pass up to unrelated environment gates (Go cache/HOME assumptions and a reported standard-library vulnerability);
git diff --checkis clean. I also restored test-created cache artifacts. The final implementation preserves the original allowlist order and appends sorted spec-derived fields, so existingupdated_atbehavior is unchanged whiledateLastActivityis included when declared on synced response items.Checklist:
- Reproduced the reported failure: confirmed the template’s fixed allowlist omitted spec-only names such as
dateLastActivity; the full live Trello mirror is not present locally, so I did not recreate the exact 93-row dataset. - Confirmed the fix resolves it: generator logic now emits declared
format: date-timeitem fields into the stale list; focused stale-template tests pass. - Considered edge cases: union is additive, deduplicated, deterministic, preserves legacy precedence/order, handles top-level and dependent synced resources, and ignores unrelated unsynced type definitions.
- Reproduced the reported failure: confirmed the template’s fixed allowlist omitted spec-only names such as
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.