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.Interface
No new interfaces are introduced.
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 call ) using or 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 start by exploring the repository structure and locating the stale-detection timestamp allowlist logic.
- Assistant
Found the stale template — I'll inspect it and the generator code that feeds the timestamp allowlist.
- Assistant
Let me search for how stale is generated and any references to staleTimestampFields in the generator.
- Assistant
I'll inspect how the stale template is rendered and how template data is prepared.
- Assistant
I'll look at how workflows are rendered and what data is passed to the stale template.
- Assistant
Let me look at renderWorkflowFiles and also schema_builder related to date fields, and how Fields are represented in the APISpec.
- Assistant
I'll inspect the spec types and look for similar patterns that derive fields from the OpenAPI date-time format.
- Assistant
I'll check schema_builder for DATETIME handling and look for related issue docs or recent commits.
- Assistant
There was a previous allowlist expansion — I'll review that change and generator function map helpers for a pattern.
- Assistant
I'll check how the health/insight templates detect timestamps, and whether creation dates are filtered out.
- Assistant
Looking at the test guidance again:The issue is that the stale-detection logic hardcodes an allowlist of timestamp fields, but the Trello spec declares
dateLastActivity(format: date-time) which is missing from that list. This causes the generatedstalecommand to miss stale cards.The root cause is that the template hardcodes the allowlist instead of also deriving candidate timestamp fields from the spec (properties with
format: date-time).The durable fix is to build the stale timestamp-field set as
hardcoded allowlist ∪ spec-declared date-time property names for the synced resources. - Assistant
I'll look for existing patterns that merge hardcoded lists withspec-derived fields, and re-read the issue expectations once more.
- Assistant
Checking how LED dates appear in specs and how minimalSpec is defined:
- Assistant
Looking at existing test fixtures that have created_at with date-time - if we add all date-time fields to the allowlist, created_at would be added. For the PM workflow tests with minimalSpec,there may...
- Assistant
Hmm minimalSpec wasn't found with that grep, maybe different naming.
- Assistant
Let me look at minimalSpec and also check if there's any solution doc pattern. I'll implement the fix now. I understand the issue with the stale-detection timestamp-field allowlist missing spec-declared date fields like
dateLastActivityin Trello. The hardcoded list in the template isn't sufficient, and we need to make it dynamic by unioning with spec-declared date-time properties. - Assistant
I'll implement the durable fix: keep the hardcoded allowlist in the template and append spec-declared
date-timefields so the union is additive only. - Assistant
I'll write the Go file with a Python helper to avoid heredoc issues.
- Assistant
I'll fix the module import path and a comment typo, then wire the template function.
- Assistant
I'll fix the module import path for v4.
- Assistant
Also I need to fix the import line - let me check the file
- Assistant
Next I'll register the template function and update the stale template.
- Assistant
Updating the pm_stale template to append dürzichtspec-declared date-time fields.
- Assistant
I'll narrow the field-name exclusions so short prefixes like
enddon't over-match. - Assistant
I'll set the Go module cache and rebuild.
- Assistant
Build succeeded. Next I'll verify the fix with a temporary reproduction script.
- Assistant
I'll put the repro in a proper module directory outside
/tmpsystem root. - Assistant
Version issue with v4 module.
- Assistant
I'll run a temporary test inside the generator package, then remove it.
- Assistant
Remove unused import
- Assistant
The plain-API false positive was from the template comment mentioning
dateLastActivity. I'll tighten the assertion and re-run. - Assistant
I'll restrict matching to
format: date-timeas the issue specifies, then clean up temp files. - Assistant
I need to isolate our intentional changes —
.gocachegot dirty and shouldn't be submitted. - Assistant
I'll review the generator.go diff to make sure only the intended change landed.
- Assistant
submitusesgit diff, so untracked files won't be included — I'll fold the new helpers into an existing tracked file. - Assistant
All three tracked files look good. Running a quick schema_builder sanity check, then submitting.
- Assistant
Need to restore .gocache/trim.txt so it doesn't get submitted.
- Assistant
Checklist complete — submitting the fix.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.