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 — next I'll inspect it and the generator code that feeds the timestamp field list.
- Assistant
Let me search for how the stale template is used and how template data is built.
- Assistant
Let me look at how generator.go handles pm_stale.go.tmpl and the related tests.
- Assistant
I'll inspect how vision/workflow templates are rendered and how resource properties are modeled in the generator.
- Assistant
Let me look at the visionRenderData struct and how fields/properties are available from the spec. Also look at schema builder which seems to deal with date-time fields.
- Assistant
I'll check how the schema builder collects date-time fields and how Types map onto resources.
- Assistant
I'll check existing golden fixtures and any tests around stale generation or dateLastActivity.
- Assistant
I'll look at the existing generation tests for workflows and any patterns for injecting dynamic field lists into templates.
- Assistant
I'll inspect the profile SyncableResource model and how AGENTS.md discusses stale handling.
- Assistant
I'll inspect generator template functions and how special template data is wired for workflows.
- Assistant
I'll inspect minimalSpec and how profiles are built during Generate, then implement the collection helper.
- Assistant
I'll implement collecting date-time fields from synced resources and union them into the stale template allowlist.
- Assistant
I'll check how SyncableResource.Name relates to Spec.Resources keys, then implement the collection.
- Assistant
The allowlist is modification timestamps only — I'll check how similar regressions were handled and whether created_at-style fields need filtering.
- Assistant
I'llпроверяю how OpenAPI maps formats and whether Trello or similar fixtures exist.
- Assistant
Implementing the collection helper and wiring it into template rendering.
- Assistant
I'll add the helper and update the template and render path.
- Assistant
Creating a dedicated helper file and updating the template and renderer.
- Assistant
Checking whether the file was written correctly.
- Assistant
The create command left an empty file — writing the contents via the shell instead.
- Assistant
I'll fix the comment join, then update the template and renderer.
- Assistant
Updating the stale template to append spec-declared timestamp fields.
- Assistant
I'll update the comment and the slice definition to include SpecStaleTimestampFields.
- Assistant
Updating
renderWorkflowFilesso that workflow templates receive the enriched data. - Assistant
I need to check if workflow templates are rendered anywhere else besides renderWorkflowFiles - e.g. tests that call renderTemplate directly.
- Assistant
There's also generator.go:1897 that iterates Workflows - let me check what that does.
- Assistant
Updating
renderWorkflowFilesto pass the enriched template data. - Assistant
Checking whether any code executes all templates with Spec-only data.
- Assistant
I'll check for other code paths that render workflow templates.
- Assistant
Writing a temporary verification script to generate a Trello-like CLI and exercise the stale command.
- Assistant
I'll run the verification from inside the module tree so the internal package import is allowed.
- Assistant
Generation looks correct. Next I'll exercise runtime stale detection on a synthetic store and run the related existing tests.
- Assistant
Generation is verified. Cleaning up temp files and running the existing stale-related tests.
- Assistant
Formatting the new file and checking that the package still builds.
- Assistant
We're still in the generator directory.
- Assistant
Submit uses
git diffand may miss untracked files — I'll fold the new helper into an existing package file so the change is captured. - Assistant
Verifying the build and re-running the related generator tests.
- Assistant
Re-verifying generation with a quick inline check:
- Assistant
Reviewing the final code quality before submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.