Stale-detection timestamp-field allowlist misses spec-declared date fields Retro finding…
- User
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.
- Positive: a spec with a
- Assistant
I’ll trace how synced resource schemas reach the stale template, then add the date-time union at generation time with focused regression tests. I’ll keep this as a Printing Press generator change and run the golden suite if generated output changes.
- Assistant
rgisn’t installed in this workspace, so I’m switching tofind/grepfor repository inspection. - Assistant
The generator already retains each response property’s OpenAPI
formatand knows the exact endpoints selected for sync. I’ll use those two sources so only date-time fields from actually hydrated endpoint shapes are appended; the legacy list remains first and byte-stable for APIs without extra fields. - Assistant
The implementation and focused tests are in place. The generator test run is still compiling dependencies; once it completes I’ll address any failures, then run the full suite and golden verification because
pm_stale.gooutput is affected. - Assistant
The broad generator package run exhausted the container while many existing parallel generation tests launched subprocesses; it did not produce a targeted assertion failure. I’m narrowing to the stale tests first, and I’ll update the older template-shape assertion now that the canonical defaults live in generator data rather than literal template text.
- Assistant
The focused regression now passes, including a generated-CLI execution test that seeds one old and one future
dateLastActivityrow and confirms only the old row is returned. I’m checking output stability next; existing APIs should remain unchanged because their generated field list is identical. - Assistant
Golden verification is blocked by a missing local prerequisite (
jq), before any fixtures were generated or compared. I’ll continue with the required build and full Go suite using constrained parallelism to avoid the earlier container resource exhaustion. - Assistant
The constrained full suite is progressing cleanly through repository packages. The generator package is the long pole because many tests create and compile printed CLIs; no new failure has surfaced so far.
- Assistant
The full suite has passed the CLI and crowd-sniff packages; the sequential generator tests are still running. Constrained execution is slower but stable, and the repository build already succeeded.
- Assistant
The generator suite is taking substantially longer under single-test parallelism, but remains active without error output. I’m letting it finish rather than reverting to the resource-heavy mode that previously crashed the test process.
- Assistant
The full suite found one failure in
internal/generator, but the package’s very large warning stream displaced the actual assertion from captured output. All other packages passed. I’m rerunning that package at bounded parallelism with failure-only filtering to isolate and fix it. - Assistant
The isolated full-suite failure is environmental and unrelated to this patch: a quality-gate test flags the workspace’s Go 1.26.4 standard library for a vulnerability fixed in Go 1.26.5. I’m rerunning the generator suite excluding only that known toolchain-dependent test, so the remaining generator coverage still gets a clean verdict.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.