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
Not it. Let's check schema_builder.go around those lines.
Assistant
Good, confirms SyncableResource.Name corresponds to keys of s.Resources. Now let's check existing tests for pm_stale in generator_test.go to understand expectations and naming conventions.
Assistant
Good, all packages already imported. Now let's implement helper function near
commandConstructorForTemplateor nearrenderWorkflowFiles.Assistant
Now let's implement the change:
Assistant
Now let's gofmt the map literal alignment and check build.
Assistant
Build succeeds. Now let's update the template to use the extra fields, and update comments.
Assistant
Only rendered through renderWorkflowFiles/Generate path. Good. Now let's build and run tests.
Assistant
Now let's write a quick reproduction test with a Trello-like spec containing
dateLastActivitydate-time field to confirm generation works end to end.Assistant
Now let's write a temp Go test script (not part of test suite) to actually invoke generator with a spec containing dateLastActivity and check output.
Assistant
The fix works end-to-end. Let's inspect actual generated file content for correctness.
Assistant
Looks correct and gofmt formatted properly. Now let's remove the temp test files and check the negative case (a spec using only
updated_at, no date-time, should be unchanged).Assistant
Confirmed pre-existing failure unrelated to our change (Go toolchain vulnerability environment issue). Restore our changes.
Assistant
Now let's run the full generator test suite skipping that known unrelated failing test, to make sure everything else passes.
Assistant
All relevant tests pass. Now run the broader generator test suite excluding known network-dependent/vuln test.
Assistant
All tests pass (except the unrelated pre-existing govulncheck network test). Let's also run the full test suite for related packages (spec, profiler) to be safe.
Assistant
Let's view the final diff.
Assistant
The diff is clean. Let's clean up any leftover test/env artifacts before finalizing.
Assistant
No stray files left. Let's go through the checklist explicitly.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.