Skip to content
TheChatArchiveThe Chat Archive
fable-5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Stale-detection timestamp-field allowlist misses spec-declared date fields Retro finding…

  1. 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.go matches inactivity against a hardcoded staleTimestampFields allowlist (updatedAt, updated_at, updatedDate, modifiedAt, modified_at, lastModified, last_modified, lastEditedTime, last_edited_time, updated, last_updated). Trello cards use dateLastActivity, which is absent. The flagship stale command returned "No stale items found" while a hand-built health command (reading dateLastActivity) 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 a stale that finds rows older than N days.
    • Negative: an API using updated_at is unchanged.

    Repro / evidence

    trello-pp-cli stale --days 14 → empty; trello-pp-cli health → 93 stale on the same mirror. Fixed by hand-adding dateLastActivity to 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.

  2. Assistant

    Now wire the derived fields into the workflow-template render data in generator.go:

  3. Assistant

    Now the template — union block plus updated doc comment:

  4. Assistant

    Now the tests:

  5. Assistant

    All new tests pass. Now the full suite, formatting, and golden verification:

  6. Assistant

    The environment is hitting process limits with parallel compilation. Retrying with limited parallelism:

  7. Assistant

    Pre-existing failure confirmed (fails on clean tree — the sandbox's Go stdlib version trips govulncheck). Now golden verification, required since a template changed:

  8. Assistant

    16 cases failing is suspicious — my change shouldn't touch any golden case. Let me inspect a diff and check the clean-tree baseline:

  9. Assistant

    All golden diff lines are exclusively the mvanhorn<REPO> normalization artifact — zero real changes. The built binary isn't ignored though; let me check:

  10. Assistant

    No dependent skills/docs. Final full run of the affected package:

  11. Assistant

    Everything passes except TestGenerateWithNoAuth, which I confirmed fails identically on the clean tree (a govulncheck stdlib finding from this sandbox's Go toolchain — unrelated to this change). The work is complete.

    Summary

    Fixed the P2 retro finding: stale silently returned empty when an API's activity timestamp (e.g. Trello's dateLastActivity) wasn't in the hardcoded allowlist. The stale field set is now hardcoded allowlist ∪ spec-declared date/date-time modification fields, built at generation time — a machine change, so every future printed CLI gets it.

    Changes:

    • internal/generator/stale_fields.go (new) — specStaleTimestampFields() walks each resource's (and sub-resource's) spec-declared response types via the existing collectResponseFields, and keeps fields that are:
      • format: date-time or date;
      • named like a modification/activity timestamp (stems: update, modif, activity, edited, changed, touched) — this filter is essential because the stale WHERE ORs across fields, so unioning createdAt/dueDate/startDate would flag actively-updated rows as stale and regress currently-working APIs (suffixed stems chosen to exclude activatedAt, exchangeRateDate);
      • safe to embed in both a Go string literal and a json_extract('$.<name>') path (^[A-Za-z_][A-Za-z0-9_]*$);
      • not already in the hardcoded allowlist (Go-side mirror staleTemplateHardcodedFields, pinned to the template by a drift test).
    • templates/workflows/pm_stale.go.tmpl — appends {{range .SpecStaleTimestampFields}} after the hardcoded literals. Additive-only per the retro guard: existing entries are never removed, ordering keeps first-present-wins stable, and an updated_at-shaped API emits byte-identical output.
    • generator.go renderWorkflowFiles — workflow templates now receive {*spec.APISpec, SpecStaleTimestampFields}; embedding keeps pm_orphans/pm_load/comm_health untouched.
    • stale_fields_test.go (new) — covers the retro's test spec: positive (dateLastActivity derived and emitted in generated pm_stale.go), negative (updated_at API emits exactly the hardcoded list), plus creation-field exclusion, no-format exclusion, unsafe-name exclusion, sub-resource walking, and the template↔Go allowlist drift pin.

    Verification: new + existing stale tests pass (including TestStaleTemplateCoversCommonTimestampFields, unmodified); go vet/gofmt clean; full go test ./... green except pre-existing failures I confirmed on the clean tree (govulncheck stdlib finding; some parallel-run flakes from this sandbox's process limits that pass in isolation). scripts/golden.sh verify shows only a pre-existing environmental artifact — this checkout lives at /cli-printing-press, so the harness's <REPO> path normalizer mangles the literal github.com/mvanhorn/cli-printing-press URL; identical 16-case result on the clean tree, zero diffs attributable to this change. No new golden fixture: no golden case exercises the vision-plan-selected PM workflow templates (verified — no fixture contains staleTimestampFields), and the behavior contract is pinned by the package's unit tests, matching existing precedent. golangci-lint isn't installed in this environment, so that gate will run in CI/pre-push.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.