Skip to content
TheChatArchiveThe Chat Archive
x-ai/grok-4.5· unknownHugging 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. Assistant

    I'll start by exploring the repository structure and locating the stale-detection timestamp allowlist logic.

  3. Assistant

    Let me search more specifically for stale-related code in the generator.

  4. Assistant

    Let me look in the generator directory for stale-related templates.

  5. Assistant

    There's a templates directory. Let me look there.

  6. Assistant

    There's an insights directory that might contain the stale template.

  7. Assistant

    Hmm, no stale templates there. Let me search more broadly.

  8. Assistant

    Found it — let me inspect the stale template and related generator code.

  9. Assistant

    Now I'll find how the stale template is rendered and what spec data is available for date-time fields.

  10. Assistant

    Strange, no results? Let me try differently.

  11. Assistant

    Hmm, rg is returning nothing weirdly. Let me try grep.

  12. Assistant

    Let me inspect how templates are executed and what context data they receive.

  13. Assistant

    I'll review schema_builder and the stale-timestamp tests next to see how date-time fields are modeled.

  14. Assistant

    Let me look at how workflows are rendered and what data is passed.

  15. Assistant

    I'll inspect TypeField and how store/sync already extract date-time properties from the spec.

  16. Assistant

    I'll check AGENTS.md and related docs for prior guidance on stale timestamp handling.

  17. Assistant

    I'll inspect SyncableResources and how collectResponseFields is used so we can union date-time fields correctly.

  18. Assistant

    I'll look at framework_collision tests and how they generate pm_stale for patterns to follow.

  19. Assistant

    I'll check when profiling runs relative to workflow rendering and how similar custom template data is passed.

  20. Assistant

    I'll check available template functions and how sort/unique patterns work in generators.

  21. Assistant

    I'll check golden expectations and whether any already embed the hardcoded stale field list.

  22. Assistant

    Implementing collection of date-time fields and updating the template to use the allowlist ∪ spec fields union.

  23. Assistant

    I'll add the collector function and wire it into the template FuncMap.

  24. Assistant

    I'll append the new function at the end of schema_builder.go.

  25. Assistant

    I need to check the SubResources type structure to make sure I'm accessing it correctly.

  26. Assistant

    The SubResources type is wrong in my code — I'll check how schema_builder already handles them.

  27. Assistant

    I need to fix the sub-resource access.

  28. Assistant

    Need to open the file at that line first.

  29. Assistant

    Now I can replace.

  30. Assistant

    Now I'll register the template function and update the template.

  31. Assistant

    I'll add the template function near the other schema/SQL related ones.

  32. Assistant

    Updating the template to use the new function as the single source of truth.

  33. Assistant

    I'll keep the allowlist in the template and only append spec-declared extras so the pin test still holds.

  34. Assistant

    I'll add the extras helper and register it under staleTimestampFieldsExtra.

  35. Assistant

    Need to navigate to the end of the file first.

  36. Assistant

    Now replace.

  37. Assistant

    Now update the FuncMap registration.

  38. Assistant

    Need to goto the right place.

  39. Assistant

    Now replace.

  40. Assistant

    I'll write a temp script to verify generation and runtime behavior end-to-end.

  41. Assistant

    Let me look at minimalSpec full definition.

  42. Assistant

    I'll create a temporary verification program outside the repo.

  43. Assistant

    Need to set GOPATH/GOMODCACHE.

  44. Assistant

    I'll put a temporary test inside the generator package and remove it before submit.

  45. Assistant

    Let me fix the temp test file properly.

  46. Assistant

    Need to find the correct Response type name.

  47. Assistant

    It's ResponseDef not ResponseSpec.

  48. Assistant

    Typo in -count.

  49. Assistant

    Unit tests pass. Next I'll verify runtime: generate a CLI, insert rows with dateLastActivity, and run stale.

  50. Assistant

    Check what sqlite package they use.

  51. Assistant

    I'll look at how the store schema is set up and whether the sqlite3 CLI is available.

  52. Assistant

    I'll rewrite the runtime test to seed the DB via the generated store after building the CLI.

  53. Assistant

    I made a mess of the file. Let me write a clean version and also check Upsert signature.

  54. Assistant

    Good - Upsert(resourceType, id string, data json.RawMessage) exists.

  55. Assistant

    Let me use Python to write a clean file.

  56. Assistant

    The Python string construction got mangled. Let me write the file more carefully.

  57. Assistant

    Runtime verified. Running related existing tests and cleaning up temporary files.

  58. Assistant

    Restoring .gocache and checking that only the intended source files remain changed.

  59. Assistant

    I'll review the final diff once more before submitting.

  60. Assistant

    I'll clean up a slightly inaccurate comment, then submit.

  61. Assistant

    Confirming temp tests are gone, then submitting.

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