Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-opus-5· anthropicHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Stale-detection timestamp-field allowlist misses spec-declared date…

  1. 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.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.

    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 using git reset --hard command. Additionally, you can use git stash and git stash pop to 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 submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /cli-printing-press, current file: none) bash-$

  2. Claude Assistant

    Now wire it into the generator's workflow rendering.

  3. Claude Assistant

    Now add the domainWorkflowRenderData method in the new file.

  4. Claude Assistant

    Now update the template.

  5. Claude Assistant

    Now run the full generator test suite (and repo tests) to check nothing broke.

  6. Claude Assistant

    Now update staleScanResourceNames to return a set (or nil for "all").

  7. Claude Assistant

    Now re-run my temp verification tests plus a real-catalog spec check (e.g. asana, github) to see what fields get unioned.

  8. Claude Assistant

    All work is complete. Final summary and checklist:

    Change

    Root cause: templates/workflows/pm_stale.go.tmpl hardcoded a timestamp-name allowlist; APIs whose activity field isn't listed (Trello's dateLastActivity) made the flagship stale command silently return "No stale items found".

    Fix (3 pieces):

    1. internal/generator/stale_timestamps.go (new): mirrors the hardcoded allowlist (baseStaleTimestampFields, additive-only — never shrinks) and derives extra candidates from the spec: format: date-time/date scalar response properties of the resources sync mirrors locally (profiler syncable + dependent sets, plus their sub-resources; all resources when the profiler produced no sets). Names already in the allowlist are deduped, results sorted for deterministic output, unsafe JSON-path names (./[) rejected, and creation/future-dated names (created*, due*, start*, expires*, scheduled*, next*, …) excluded — the generated WHERE ORs every candidate field, so including a past due date would falsely flag freshly-touched rows.
    2. internal/generator/generator.go: domain workflow templates now render with domainWorkflowRenderData (embeds *spec.APISpec, so {{.Name}}/{{.Owner}} keep working) carrying SpecTimestampFields.
    3. The stale template appends {{range .SpecTimestampFields}} entries after the hardcoded list, so the first-key-wins order for existing APIs is untouched.

    Checklist

    • Reproduced the reported error: Yes. I replicated the generated SQL predicate against SQLite (python sqlite3) with the pre-fix allowlist: a card 93 days stale by dateLastActivity was invisible (No stale items found.) while an updated_at row was found — exactly the issue's symptom.
    • Confirmed the fix resolves it: Yes. After the fix, generation of both a hand-built spec and a real OpenAPI spec (dateLastActivity: format: date-time) emits "dateLastActivity" in staleTimestampFields, and the same SQLite simulation now returns the stale card (fresh card still excluded, updated_at rows unchanged).
    • Edge cases: additive-only union (no allowlist entry removed, verified byte-identical field block for an updated_at+created_at API); dedup against the allowlist; deterministic sorting; nil spec / nil profiler profile; sub-resources (their rows share the generic resources table); non-scalar and non-date fields skipped; JSON-path-unsafe names skipped so generated SQL and the Go-side scan can't disagree; creation/deadline fields excluded to avoid new false positives from the OR'd WHERE.
    • Ran existing tests: Yes — go build ./..., go vet, and go test ./.... The only failure is TestGenerateWithNoAuth, which fails identically on a clean checkout (govulncheck reporting a stdlib TLS vuln / needing network), so it's pre-existing and unrelated. All template/workflow tests (TestStaleTemplateCoversCommonTimestampFields, TestProjectManagementWorkflows*, golden-output tests) pass; existing testdata specs produce byte-identical pm_stale.go. No test files were modified or added (temporary verification tests/scripts were deleted).

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