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. Let me look at it and related generator code.
- Assistant
I'll locate where the stale template is rendered and how timestamp fields are determined.
- Assistant
Let me look at the generator.go code around pm_stale and vision_templates, and also the test for stale timestamp fields.
- Assistant
I need to understand how template data is built and how workflows are generated.
- Assistant
Workflows receive
g.Specas template data. I'll inspect how specs expose properties and how other templates pull date-time fields. - Assistant
Let me look at TypeField and how Resources map to Types, and also look at schema_builder which seems to deal with date-time fields. Also check if there's any existing partial or function around stale ...
- Assistant
I'll inspect the template FuncMap and how store schemas gather date-time fields next.
- Assistant
I'll look for related solutions/docs and inspect how store templates use response field collections.
- Assistant
I'll check how similar dynamic field lists are injected into templates and review generation flow for workflows.
- Assistant
I'll check AGENTS.md and inspect how render path for workflows should pass extra data.
- Assistant
I'll search plans and docs for prior art on this stale-timestamp fix before implementing.
- Assistant
I'll check existing workflow-generation tests and how to structure a wrapper for stale template data.
- Assistant
I'll check when the profile is ready relative to workflow rendering.
- Assistant
I'll check how templates are executed in tests so the FuncMap change stays safe.
- Assistant
I'll inspect how the Generator and FuncMap are constructed.
- Assistant
I'll check how dependent sync resources are named and resolved.
- Assistant
I'll implement collecting date-time fields from all resources and update the stale template.
- Assistant
I'll add the stale timestamp field collector and wire it into the template FuncMap.
- Assistant
Let me verify the file contents were written correctly.
- Assistant
The special create command failed to write content—I'll use a shell heredoc instead.
- Assistant
Adding the template function next to other similar helpers in FuncMap.
- Assistant
I'll add the function after sqlString or near hasTypedTable.
- Assistant
Updating the stale template to append spec-declared date-time fields.
- Assistant
Update the comment and the list.
- Assistant
I'll verify with a temporary generation script that reproduces the Trello case and the updated_at unchanged case.
- Assistant
Need to set up the Go module cache and GOPATH.
- Assistant
GOPATH should be /root/go and there's a .gocache in the repo.
- Assistant
I'll put a temporary test inside the generator package since external imports can't use
internal/. - Assistant
Need to find the correct type name for Response.
- Assistant
It's ResponseDef. Let me fix the test.
- Assistant
Positive/negative generation works. Next I'll runtime-verify stale detection and run related existing tests.
- Assistant
Need to remove unused import.
- Assistant
I'll seed after migrations run by opening the CLI first on an empty DB.
- Assistant
I'll rewrite the runtime test: open the CLI first so migrations create the DB. then seed with the proper schema.
- Assistant
Need to check the sync_state schema.
- Assistant
I'll fix the seed to use
last_synced_atand skipsync_stateif it isn't needed. - Assistant
Runtime confirmed. Removing temporary test files and running existing related tests.
- Assistant
Restoring
.gocacheso only the real source changes are left staged. - Assistant
Intent-to-add the new file so
git diffincludes it for submit. - Assistant
I'll run gofmt on the new Go files, then submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.