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, add the date-time fields without weakening the existing fallback list, and cover both the new field and
updated_at. I’ll also check the repository’s local issue/solution context; external issue operations are unavailable because this task explicitly forbids internet access. - Assistant
rgisn’t installed in this workspace, so I’m switching to targetedfind/grepsearches and keeping the scope to generator and related tests. - Assistant
The clean generator boundary is the workflow render data: the template will retain its established fallback names and receive only additional
date-timefields resolved from resources the profiler actually syncs. I’m adding the derivation there, so request-only dates and unrelated resource schemas don’t leak into stale detection. - Assistant
The regression test now exercises the printed CLI end to end against its generated SQLite store: one stale row uses
dateLastActivity, another uses the legacyupdated_at, and both must be returned. This directly covers the additive-union guard instead of only checking generated text. - Assistant
The focused test passes, including a real generated
staleinvocation. I’m moving through the required repository gates now: golden verification first, then the full Go suite and build with dependency fetching disabled. - Assistant
Golden verification is locally blocked before generation because
jqis not installed. I’ll still run the full Go tests and build offline; the focused generation test already validates the changed artifact path. - Assistant
The first full-suite run hit the container’s process limit (
fork/exec … resource temporarily unavailable), not code failures. I’m rerunning serially (-p 1) to fit the environment. - Assistant
The serialized suite is progressing cleanly through the packages; no implementation failures have surfaced. The slower pace is expected from limiting Go to one package build at a time.
- Assistant
The full suite cannot complete cleanly in this constrained container: generated-project tests require module versions absent from the local cache while offline mode is enforced, and other integration tests spawn enough subprocesses to exceed the process limit. The changed package’s end-to-end regression remains green; I’m doing an offline focused rerun plus the required binary build.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.