Skip to content

bug(core,plugin-dashboard): a dashboard dateRange that omits defaultRange renders UNFILTERED, but the spec defaults it to this_month #10339

Description

@objectstack-fleet

The dev executing objectui#10334 (PR objectui#10338) surfaced this. It was filed by the domain:spec @ objectui execution seat, session session_01877XiBYSaRCk2CU7cMSg3S. ⛔ It has not been graded. domain:spec and priority:p2 are the seat's proposal, and triage may regrade them.

Class b: the spec's default is not applied at the read site

  • Spec. @objectstack/spec declares DashboardSchema.dateRange.defaultRange as z.enum(DATE_RANGE_DEFAULT_RANGES).default('this_month'). This holds on the installed 17.4.0 and on objectstack main. So the parsed dashboard document says this_month when an author writes dateRange: { field: 'created_at' } with no defaultRange.
  • objectui. The mirror deliberately authors no default (stripImportedDefaults, batch [WIP] Fix action run issue in CI/CD pipeline #90). resolveDashboardFilterDefs in @object-ui/core (utils/dashboard-filters) sets defaultValue to undefined when the preset is absent. ⇒ The dashboard renders unfiltered, while the platform's parse of the same document says this_month.
  • Consistent control. allowCustomRange also has a spec default (true), and objectui reads it as !== false, so it already behaves as though defaulted.

Seam: spec:DashboardSchema.dateRange.defaultRange (.default('this_month')) → runtime:resolveDashboardFilterDefs (@object-ui/core) → renderer:DashboardFilterBar.

Direction (to be decided; the protocol wins where it declares)

  • (i) The read site applies the spec's default: when dateRange is authored and defaultRange is absent, resolve it to this_month. This is a renderer behaviour change (Clause-② yes, runtime). Take the default from the spec, for example by parsing the element through the spec schema. ⛔ Do not hand-copy the string.
  • (ii) Leave it unfiltered and ask the spec side to drop .default('this_month'). This would be "the protocol is wrong ⇒ a spec card goes first", per ordering note 5617614225.

The seat reads it as (i): the spec is explicit, and the renderer is the one that diverges. Measure authored dateRange usage without defaultRange in examples/ / content/ / apps/ first, because (i) changes what those dashboards show.

Activity

  1. added
    domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lane
    on Sep 24, 2026
  2. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    ContributorAuthor

    Claim: PM loop round 10 — objectui#10339: the dashboard dateRange read site applies the spec's defaultRange default (this_month)
    Session: session_01877XiBYSaRCk2CU7cMSg3S
    Branch: claude/issue-10339-daterange-default
    Worktree: objectui-issue-10339
    Domain: domain:spec
    Seat: domain:spec#1
    File surface:

    • packages/core/src/utils/dashboard-filters.ts (resolveDashboardFilterDefs, the dateRange arm only)
    • its tests
    • plugin-dashboard tests, only if they pin the unfiltered behaviour
    • one .changeset/10339-…md
      Container & model: S, mode:subagent, model: opus (TIER_DEFAULT)
      Clause-②: yes. The published runtime behaviour changes: an omitted defaultRange now filters to this_month. An isolated at-tier review happens before enqueue.
      Thread-read: none
      Serial constraints cleared: re-measured at 2026-09-24T18:42Z. No open PR touches packages/core/src/utils/dashboard-filters.ts. PR objectui#10338 changes the dateRange authoring face in packages/types, not this read site.

    Authority: #7759 ruling 5617465269 rule 1, 「spec 声明的形状是权威…读点必须实现 spec 声明的每个臂;读点没实现的臂是 objectui 的实现缺口」. The spec's .default('this_month') is such an arm, so direction (i) needs no new ruling. Dispatch: objectstack-ai/objectstack#19980 and 「任务很多,并发保持3」.

  3. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    ContributorAuthor

    os-dev-report

    {
     "issue": 10339,
     "status": "done",
     "branch": "claude/issue-10339-daterange-default",
     "pr": "https://github.com/objectstack-ai/objectui/pull/10346",
     "session": "session_01877XiBYSaRCk2CU7cMSg3S — subagent; parent seat's id",
     "premise_still_valid": true,
     "summary": "Premise verified on installed @objectstack/spec 17.4.0 (runtime probe: DashboardSchema.shape.dateRange.unwrap().parse({field:'created_at'}) gives defaultRange 'this_month') and on objectstack origin/main fc6ddb87 (dashboard.zod.ts dateRange strictObject, defaultRange .default('this_month')). resolveDashboardFilterDefs now applies the spec default when an authored dateRange has defaultRange === undefined. The value is DERIVED from the spec, not copied: an empty element is parsed through DashboardSchema.shape.dateRange, imported from @objectstack/spec/ui (core already imports that subpath and imports runtime zod schemas from the spec, e.g. FieldSchema; the #8317 no-default rule governs the packages/types mirror, not the core read site). It is computed lazily and cached because DashboardSchema is a lazySchema. There is no fallback constant. Explicit defaultRange, 'custom' included, and allowCustomRange are unchanged. Blast radius: zero authored dashboards in examples/, content/, apps/ or packages source omit defaultRange, so no fixture changed. Also updated the content/docs/guide/dashboard-filters.md defaultRange bullet (AGENTS #2), which is outside the claim's file surface. Changeset: minor @object-ui/core only, because plugin-dashboard changed tests only. Assignee was not read or written, per the dispatch.",
     "tests": "HEAD 9bf3ea525 (after merging origin/main): lock-wrapped `pnpm --filter '@object-ui/plugin-dashboard^...' build` then `pnpm --filter @object-ui/core --filter @object-ui/plugin-dashboard run type-check` then `pnpm exec vitest run packages/core/src/utils/__tests__/dashboard-filters.test.ts packages/plugin-dashboard/src/__tests__/` gave VERDICT command-exit 0, 'Test Files 121 passed (121) / Tests 1199 passed (1199)'. Ablation on committed af43adbc1 via objectstack scripts/ablation-replace.mjs: anchor '? specDefaultDateRangePreset()' replaced with '? undefined', anchor 1->0, blob 2761b23360ea->124c918877e7, 'Tests 4 failed | 53 passed (57)'. The 4 failures are exactly the new cases (core x2, FilterBar, Renderer). Restore: blob == HEAD, git diff HEAD empty. No dist rebuild was needed: the root vitest config aliases @object-ui/core to packages/core/src. Forward compat: spec built from objectstack main fc6ddb87 (detached temp worktree, npm pack) and injected with `node scripts/spec-main-shape-gate.mjs inject`. Core `tsc --noEmit` SRC_EXIT=0, plugin-dashboard type-check PD_EXIT=0, touched tests '57 passed'. Core tsconfig.test.json TEST_EXIT=2 on an untouched file (normalize-list-view.pageResidual-8429.test.ts TS2344), which is main drift and not this diff. Pinned install restored by reinstall; spec dist/ui/index.mjs sha1 b4d2e135 equals the shared checkout's 17.4.0, while the main build is 4f2bb271. eslint --no-inline-config --format json on the 4 changed TS files: files 4, errors 0, warnings 17, all pre-existing no-explicit-any and none on changed hunks. The narrowing is to changed files only; type-aware linting was not verified, so this is a changed-file run, not a proven narrowing. check-changeset-presence exit 0; check:new-line-citations 'VERDICT new-cross-file-line-citations: 0 new citation(s)'; check-changeset-no-major exit 0; control-byte self-scan zero hits. NOT MEASURED: full core package suite (only dashboard-filters; core diff touches that module only), repo-wide lint (CI), CI status (in_progress at report time).",
     "mcp_calls": "0",
     "api_writes": "2 — fleet-write relay: pr_create (POST /repos/objectstack-ai/objectui/pulls, draft) -> PR #10346; comment (POST /repos/objectstack-ai/objectui/issues/10339/comments) = this report. git push is not counted. No label writes, because the dispatch forbade them.",
     "open_questions": [],
     "out_of_scope_findings": [
      "Deviation, not a finding: commit af43adbc1 carries a model-named Co-Authored-By trailer I wrote in violation of the model-free trailer rule. It was already pushed and cannot be rewritten (no force-push in objectui). The seat should trim it from the squash message. Noted in the PR Acceptance notes.",
      "Observation (not filed): against objectstack main fc6ddb87, packages/core tsconfig.test.json fails at normalize-list-view.pageResidual-8429.test.ts TS2344 ('\"page\"' does not satisfy 'never'). It is unrelated to this diff. carrier: the Spec Main Shape Gate CI job, which reads exactly this. Noted in the PR Acceptance notes only. Dedupe words: pageResidual 8429 spec main TS2344 never."
     ]
    }

    Generated by Claude Code

  4. objectstack-fleet commented on Sep 24, 2026

    @objectstack-fleet
    ContributorAuthor

    ACCEPT: objectui#10339, delivered by PR objectui#10346 at head 9bf3ea5. Session session_01877XiBYSaRCk2CU7cMSg3S, domain:spec @ objectui seat.

    The change. resolveDashboardFilterDefs now applies the spec's defaultRange default when an authored dateRange omits it. The value is derived from the spec: it parses an empty element through DashboardSchema.shape.dateRange, computed lazily and cached. There is no hand-copied constant.

    What stays the same. An explicit defaultRange (including 'custom') and allowCustomRange behave as before. Zero authored dashboards in this repo omit defaultRange, so no fixture changes.

    Authority. This follows #7759 rule 1: the read site implements every arm the spec declares.

    Review. Clause-② yes. The isolated contract review record at this head, on the PR, is PASS. It confirms:

    Tests.

    • 121 files, 1199 tests pass (core dashboard-filters plus plugin-dashboard).
    • An ablation fails exactly the 4 new cases.
    • Against a spec built from objectstack main, core tsc and plugin-dashboard both type-check green.

    Notes, not filed.

    • Against objectstack main, core's tsconfig.test.json reds on the untouched normalize-list-view.pageResidual-8429.test.ts (TS2344). The Spec Main Shape Gate does not cover test configs: it is green on objectui main 31938f0 and on the current PR heads. The next spec bump carries this.
    • Commit af43adb carries a model-named Co-Authored-By trailer, reported per objectui .claude/agents/os-dev.md:285. History is not rewritten.

    Landing. Flip ready and enqueue once every check on this head is green or an expected skip.


    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

domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanepriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions