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
Let me start by understanding the repository structure and finding the relevant files mentioned in the issue description.
The issue is about:
- A stale-detection timestamp-field allowlist in
internal/cli/pm_stale.go - The allowlist hardcodes timestamp field names (
updatedAt, updated_at, updatedDate, modifiedAt, modified_at, lastModified, last_modified, lastEditedTime, last_edited_time, updated, last_updated) - The fix should: Build the stale timestamp-field set as
hardcoded allowlist ∪ spec-declared date-time property names for the synced resources
Let me explore the repository first.
- A stale-detection timestamp-field allowlist in
Assistant
Let me look for the main source code, not just the testdata.
Assistant
I need to find files related to "stale". Let me search for them
Assistant
Found the template. Let me look at it and explore more of the generator code.
Assistant
Let me look at the template file and generator code:
Assistant
Now let me look at the generator code to understand how it populates this template:
Assistant
Let me look at the generator around the stale template handling and also check how it accesses spec data
Assistant
Let me search for where
pm_staleis used and what data it receivesAssistant
Let me look more broadly at how the generator handles template rendering, especially for stale
Assistant
Let me look at the context around line 1960 to see how stale template is rendered
Assistant
Let me look at how the stale template is rendered. Let me search for where pm_stale is referenced in the rendering flow.
Assistant
Let me search for how workflow templates are rendered
Assistant
Let me look at lines around 2695 and 1897 to see how workflows are rendered.
Assistant
So the template receives
g.Specwhich is aspec.APISpec. Let me look at the spec types to understand the available dataAssistant
Let me look at the Resource and TypeDef definitions to understand how properties and formats are represented
Assistant
Let me look at the Resource struct and TypeDef struct in more detail:
Assistant
Now let me look at TypeDef and its fields:
Assistant
Let me look at how templates are processed to understand the template syntax:
Assistant
Let me look at the template functions available
Assistant
Now I understand the full picture. Let me check if there are existing golden tests for the stale
Assistant
Let me look at the golden test fixtures for stale generation:
Assistant
Let me look at the golden fixtures to understand the test structure
Assistant
Let me check one of the golden fixtures to see the generated stale command:
Assistant
There don't seem to be golden files for stale. Let me check what's in a golden fixture:
Assistant
Let me look at the printing-press-golden directory for stale:
Assistant
Let me look at the vision templates to understand when stale is included
Assistant
Now I have a clear understanding. Let me look at the template file again and make the modification
Assistant
Let me try again with the right syntax.
Assistant
Now I'll modify the template to add spec-declared date-time fields. Let me edit the
staleTimestampFieldsdeclarationAssistant
Let me try using the heredoc syntax for multi-line edit
Assistant
Good, the change looks correct. Now let me verify by looking at the full template and running the tests
Assistant
Let me check the Go environment
Assistant
Let me set up the Go environment and run tests
Assistant
Let me fix the Go environment
Assistant
Good, the build passes. Now let me run the tests related to the generator and stale
Assistant
Let me run all generator tests
Assistant
There's a test failure. Let me see which test failed
Assistant
Let me find the failing
Assistant
Let me look at the TestGenerateWithNoAuth failure details
Assistant
That test failure is unrelated to my change - it's a
govulncheckvulnerability check failing due to Go 1.26.4 having a known vuln. Let me verify this was a pre-existing issue by checking if the stale-related tests pass:Assistant
Let me look at the
TestStaleTemplateCoversCommonTimestampFieldstestAssistant
Let me check the test that exercises PM workflow generation more closely
Assistant
Let me check the
minimalSpecfunction to see what types it includesAssistant
Let me find the minimalSpec function definition more broadly.
Assistant
Let me look at the
minimalSpecfunctionAssistant
Good. The
minimalSpechas noTypes, so the template iteration produces no extra fields. Now let me run the full test suite excluding the known-failing test to confirm nothing else breaksAssistant
The only failure is
TestGenerateWithNoAuthwhich fails due to a pre-existing Go vulnerability check (govulncheck—GO-2026-5856incrypto/tls@go1.26.4), completely unrelated to my change. All stale-related tests pass.Let me verify the final state of my
Assistant
The change is clean and minimal. Let me verify the full file to ensure it's consistent.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.