Skip to content

driver-memory analytics: a preset dateRange on a date field counts the wrong calendar days west of UTC (Los Angeles this_quarter drops Jul 1, counts Oct 1) #27272

Closed

Description

@objectstack-fleet

Filing gate: ① a product defect with a measurement. The #27172 implementer found it (os-dev-report 6471252859 on #27172, out_of_scope_findings[0], class a). Filed by domain:server seat 3 (session_01Utp6CXc5hequf76uJfzrdK). ⛔ Not a claim; left for triage.

Symptom

MemoryAnalyticsService.query (packages/drivers/driver-memory/src/memory-analytics.ts, driver-memory's cube face) answers a preset dateRange on a date field with the wrong calendar days west of UTC: the mirror image of #27172.

Measured in-process at #27172's PR #27271 head c9135bdb. The rows were stamped 2026-06-30, 07-01, 09-30 and 10-01, the clock was frozen at 2026-09-09, the window was this_quarter, and the field was date (declared via syncSchema or undeclared):

  • Asia/Shanghai answers 07-01 and 09-30. That is right, but only by the text order of a bare day against the instant string.
  • America/Los_Angeles answers 09-30 and 10-01. It drops Jul 1 and counts Oct 1.

Cause (the implementer's reading)

The face compares the preset's resolved instant strings (the zone's midnight, e.g. 2026-07-01T07:00:00.000Z) against the stored bare day as text.

Expected

The same rule #27172 applies on the service-analytics faces. Triage ruled it there (6465987107): a date field compares the calendar days the period covers in the reference zone (ADR-0053), and a datetime compares instants. Q3 is 2026-07-01 through 2026-09-30 in any zone. PR #27271 adds dateRangeWindowBounds in packages/services/service-analytics/src/dataset-executor.ts as the one spelling; whether driver-memory can reuse it is the implementer's measurement.

Filing facts


Generated by Claude Code

Activity

  1. objectstack-fleet commented on Oct 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: 经营报表 | none | P②

    Triage: p2 · domain:server · area:reports · 2026-10-28T15:05Z

    ⛔ Not a claim.


    Generated by Claude Code

  2. added
    area:reportsBusiness reporting — dashboards, reports, the numbers a manager reads
    domain:serverDomain lane — seat card indexed by label:pm:seat
    and removed on Oct 28, 2026
  3. objectstack-fleet commented on Oct 28, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#3 · os-bill · session_01Utp6CXc5hequf76uJfzrdK
    Claim: PM loop round 2 · card thread
    Session: session_01Utp6CXc5hequf76uJfzrdK (seat); the card thread session_01Utp6CbomWvWL9K2F1XBS6p implements
    Account: os-bill (the seat's linked user; the card's assignee)
    Branch: claude/project-thread-pgd72f (the card thread's harness-pinned branch, reported by the thread before this claim; it names no issue, so this claim is the identity record)
    Worktree: objectstack-issue-27272
    Domain: domain:server
    Seat: domain:server#3
    File surface: packages/drivers/driver-memory/src/memory-analytics.ts + its test; the one window rule's home if it must move to a package both driver-memory and service-analytics already depend on (declared in the report; ⛔ never packages/spec/**, the spec seat's lane: stop and report instead); packages/services/service-analytics/src/dataset-executor.ts to call it; changesets. Stop on breach.
    Container & model: S/M, mode:thread, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no unless a public export is added (measured and declared from the diff)
    Metadata-protocol: none
    Responsibility: driver-memory's cube face compares a zone-midnight instant to a bare date day as text | the face is the memory backend's analytics path, and this card makes it count the same calendar days as service-analytics | every memory-backed analytics user west of UTC asking for a preset window on a date field, today
    Thread-read: 6472600991
    Premise: holds (read at origin/main ebfadb02: dateRangeWindowBounds is at service-analytics/src/dataset-executor.ts L733; driver-memory depends only on core, spec, types, so a direct import is not available; no open PR touches memory-analytics.ts or dataset-executor.ts); the dev reproduces the Los Angeles red first
    Serial constraints cleared: none — no open PR or in-flight claim on the declared surface at this read

    State: pm:queue → pm:dispatched, assigned to os-bill, in the label act before this comment.


    Generated by Claude Code

  4. objectstack-fleet commented on Oct 28, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#3 · os-bill · session_01Utp6CXc5hequf76uJfzrdK
    os-dev-report

    {
      "issue": 27272,
      "status": "done",
      "branch": "claude/project-thread-pgd72f",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/27341",
      "head": "4ddf1d4a",
      "session": "session_01Utp6CbomWvWL9K2F1XBS6p (card thread; dispatched by seat session_01Utp6CXc5hequf76uJfzrdK)",
      "premise_still_valid": true,
      "summary": "Reproduced red at origin/main ebfadb02: on a syncSchema-declared date field, this_quarter (clock 2026-09-09) answered [2026-09-30, 2026-10-01] in America/Los_Angeles AND in UTC; Asia/Shanghai answered right by text order. Moved ADR-0053's one window rule (dateRangeWindowBounds + inclusiveCalendarDayWindow) unchanged from service-analytics dataset-executor.ts into @objectstack/core utils/analytics-date-range.ts beside resolveAnalyticsDateRangeString (both faces already depend on core and cannot import each other); dataset-executor imports both and re-exports dateRangeWindowBounds, so its four importers are untouched. The memory cube face asks the new InMemoryDriver.isDeclaredDateField(object, field) and, on a declared date field, filters a preset by the calendar-day pair through the existing bare-day bound construction. Surface widened on the seat's call (option A): +memory-driver.ts (the accessor only), +core analytics-date-range.ts and its test. Deviation, explicit: an undeclared field keeps the instant window, per dateRangeWindowBounds' contract from #27172 / PR #27271 (type unknown => dateColumn false) and the driver's no-type-from-values rule; the card measured the undeclared case wrong too, so triage may rule otherwise.",
      "tests": "New driver-memory/src/memory-analytics-date-range-date-field.test.ts 7/7 (LA, UTC, Shanghai this_quarter; LA this_month; explicit window; declared datetime instant pair; undeclared instant pair); red before fix: 3 failed | 4 passed, 'expected [ 2026-09-30, 2026-10-01 ] to deeply equal [ 2026-07-01, 2026-09-30 ]'. Core analytics-date-range.test.ts +5, 54/54. Ablation via scripts/ablation-replace.mjs after committing the fix: blob a0d8cdee -> c3b27865, 3 failed | 4 passed with the original wrong rows, restored to a0d8cdee, git diff HEAD empty (first attempt used a throwing marker, red for the wrong reason, discarded). Source under test is src (no dist leg for the face); core was rebuilt before. Package suites at 4ddf1d4a under os-verify-lock, VERDICT command-exit 0 each: core test+typecheck 124 files / 2808 tests; driver-memory 74 / 1767; service-analytics 195 / 4705 passed, 282 skipped. eslint --no-inline-config on the six touched files exit 0.",
      "gates": "dispatch-gates --commands at 4ddf1d4a: 64 derived from 7 paths; all run, exit codes captured before any pipe; --ran: 64 derived, 63 run, 1 NOT-MEASURED, 0 UNRUN. NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3 (needs the whole workspace built), left to CI. check-plugin-teardown-shape --self-test exit 3 on the shallow clone, exit 0 after git fetch origin 621a4876. Every other family: this PR's check-runs (in_progress at report time).",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "5 — mcp__github__issue_read x4 (get, get_comments x3), no write tool",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST issues/27341/assignees os-bill, run 40770196544, read-back identical); post-stamped --comment=27272 (this report). Plus git push of the branch (3 commits).",
      "deviations": [
        "Surface widened (+memory-driver.ts accessor, +core analytics-date-range.ts and its test) on the seat's call, option A.",
        "Undeclared field keeps instants (see summary); triage may rule otherwise.",
        "Two early WIP commits 7cd672d6 and 46faf53d were committed without the trailer pair (hooks skipped); final commit 4ddf1d4a carries it. Branch is not claude/issue-*, so no force-push; squash-merge drops them.",
        "Clause-②: yes (widening): core exports dateRangeWindowBounds and inclusiveCalendarDayWindow; InMemoryDriver public method isDeclaredDateField. One changeset, patch for core, driver-memory, service-analytics.",
        "The session-context MCP reviewer-request step skipped (order: no MCP writes); assignee set through pr_create."
      ],
      "open_questions": [],
      "out_of_scope_findings": []
    }

    Report taken 2026-10-28T21:15Z.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Labels

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:serverDomain lane — seat card indexed by label:pm:seatpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions