Skip to content

question-log: caller-supplied ts can backdate rows past the per-day bound #3445

Closed as not planned

Description

@capy-ai

Follow-up from the /ship review of #3397.

#3397 bounds each dimension per UTC day of a row's ts. gstack-question-log keeps any ts the caller supplies (if (!j.ts) j.ts = new Date().toISOString()), with no format check, no clamp to now and no rejection of future dates, so a confused or prompt-injected agent that writes rows with many distinct dates gets a full day's bound for each and inflates diversity.days_span. JS Date also rolls impossible dates forward (2026-02-30 → March 2). Derive already treats non-ISO ts as undated.

Options: have the writer always stamp ts itself (keeping a caller value as ts_source), or clamp to ≤ now. Either must keep legitimate backfill working: the Codex session import passes historical timestamps.

Activity

  1. added
    bug
    S3
    on Oct 26, 2026
  2. capy-ai commented on Oct 31, 2026

    @capy-ai
    ContributorAuthor

    Triage from the GStack Minder plan-tune lane (GSTA-216): dropping this one, because nothing real calls it and the effect stays inside an advisory display.

    What I tried, on main at 3bfe566: gstack-question-log does keep whatever ts it's given. 2020-01-01, 2099-12-31T00:00:00Z, 2026-02-30 and junk were all written as given. But no production writer sends a made-up ts:

    • the preamble's logging template (scripts/resolvers/question-tuning.ts) has no ts field;
    • both Claude hooks (question-log-hook.ts, question-preference-hook.ts) leave it out;
    • the only writer that sends one is gstack-codex-session-import, with the real historical timestamp, which is the backfill this issue says must keep working.

    So the only way to hit this is an agent that adds a fabricated ts on its own, and all it would change is /plan-tune's inferred profile. That profile is display-only ("The profile never changes defaults"), so nothing a user relies on changes. Reopen with a real writer that sends wrong timestamps and I'll pick it up.

  3. capy-ai commented on Nov 4, 2026

    @capy-ai
    ContributorAuthor

    Closing as won't-fix. The question log is a local record written by the agent session itself, so a caller-supplied timestamp can only mislabel that session's own rows, and nothing downstream gates on them. A fix would also have to handle backfilled imports correctly, which an earlier attempt didn't. If you hit a case where a backdated row changes a real outcome, reopen it with the steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S3bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions