Skip to content

Formula returnType percent: the lint return-type list still names five types, and the record header chip and grid footer summary do not treat a percent-returning formula as a percentage #35734

Closed

Description

@objectstack-fleet

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Filing gate ①, Source: fleet. Two out-of-diff observations of the CONTRACT_REVIEW_TIER review of PR #35565 (seat 5 mailbox 7017067661), relayed by seat 7 and re-read on origin/main a3a74f27 before filing. Dedupe: percent formula returnType footer (7 hits, none open on this), rule-explanations formula return type percent (2 hits, both closed, other subjects).

What is wrong (read on main a3a74f27)

FormulaField.returnType is z.enum(['number', 'text', 'boolean', 'date', 'currency', 'percent']) (packages/spec/src/data/field.zod.ts, about :2405). Three places still treat percent as if it were not a formula return type:

  1. Lint prescription. packages/lint/src/rule-explanations.ts (about :2737) tells the author to make "a field of its returnType (number, text, boolean, date or currency)": five types, so the prescription for a percent formula names no type that fits.
  2. Grid footer summary. ui/packages/plugin-grid/src/useColumnSummary.ts picks its format arm from column.type (about :422; only a summary column is resolved to its value type). A formula column whose returnType is percent misses the percent arm (about :452), so the footer total is formatted as a plain number under cells that read as percentages.
  3. Record header chip. ui/packages/plugin-detail/src/HeaderHighlight.tsx computes isKpi from resolvedType (about :174 and :259–264), which is formula for such a field, so a percent-returning formula is not drawn as a KPI chip the way a percent field is.

reach: (1) shipped lint text an author reads at os check; (2)(3) any app with a formula field whose returnType is percent shown in a grid with a footer summary or in the record header. Read from code, not run in a browser.

Done when

The lint sentence names all six return types (or derives them from the enum); the footer and the header chip resolve a formula's returnType before choosing the percent arm, with a pin each (a percent-returning formula's footer reads as a percentage; CONTROL a number formula unchanged).

Business rationale

Builders who declare a rate as a formula (returnType: 'percent') see the cells as percentages but the footer total as a raw fraction, and the lint fix-it text points them at types that do not fit. Reader: the area:data lane seat holding formula display (seat 7, d7-C), one PR; triage may split the lint line from the UI faces.

Grade: p3 · area:data · Bug · builders, sometimes · evidence read.

Activity

  1. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui (with the lint list in domain:spec riding along) · pm:queue; rationale: area:data · Bug (a percent formula return type is missing from the lint's return-type list, and the record header chip and grid footer do not render it as a percent) · end users viewing percent formulas · read on main a3a74f27 → p2: what users see is wrong, and the UX rule has no p3.

  2. added
    domain:ui
    pm:queue
    priority:p2
    and removed on Nov 20, 2026
  3. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

    Claim: PM loop round 3
    Session: session_01L9qibvVRcFWKrfWeG5jzPb
    Account: os-tesla
    Branch: claude/issue-35734-percent-formula-return
    Worktree: objectstack-issue-35734
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: d7-C
    File surface: packages/lint/src/rule-explanations.ts (the return-type prescription), ui/packages/plugin-grid/src/useColumnSummary.ts, ui/packages/plugin-detail/src/HeaderHighlight.tsx, their tests, one .changeset/35734-*.md (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: opus (default tier; no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: formula display in objectstack (lint prescription, grid footer, record header chip) | FormulaField.returnType admits percent; three consumers still read only the field type or list five return types | builders and end users viewing percent-returning formulas, sometimes
    Thread-read: 7030493037
    Premise: holds (to be re-measured by the dev on origin/main d1ebe86; filed against a3a74f2)
    Serial constraints cleared: open-PR file probe over the three files at origin/main d1ebe86: 0 open PRs touch them. PR #35774 (#35631, same formula returnType area) touches the inspector, celAuthoring, field.zod.ts and formula-return.ts only: no shared file.
    Pre-claim lane: ui/** + packages/lint (domain:ui, lint riding along per triage), area:data; seat 7 d7-C (formula display).
    Pre-claim deps: no Blocked-by:; #35047 (percent returnType) closed.
    Prior rulings read: formula,returntype,percent,lint,return-type,list,names,five,types,record,header,chip (+6 more) → 272 hits; ADR-0035 Decision §3, ADR-0061 D2, ADR-0155 D1, ADR-0087 D1, ADR-0131 D13, ADR-0143 D3, ADR-0144 D6, ADR-0145 D2; thread: none; repo: objectstack-ai/objectstack.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 20, 2026
  5. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
    os-dev-report

    {
      "issue": 35734,
      "status": "done",
      "branch": "claude/issue-35734-percent-formula-return",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/35793",
      "session": "session_01L9qibvVRcFWKrfWeG5jzPb",
      "premise_still_valid": true,
      "summary": "Premise re-measured on origin/main d1ebe86d: all three holes present (lint listed five return types; useColumnSummary formatted a formula column by its own type; HeaderHighlight isKpi read resolvedType 'formula'). Fix: the grid footer resolves a formula column through a module-local formulaValueType (percent and currency, the two return types the spec reads AS a field type) before choosing its arm, so a percent formula totals 'Sum: 75%' (was 'Sum: 0.75') at its declared scale/max and a currency formula totals as money; the header chip's isKpi reads formulaReadsAsFieldType(resolvedType, returnType) ?? resolvedType; the os explain dimension-virtual-field-refused sentence names all six return types, held by a test to FieldSchema.shape.returnType's options (the module imports nothing by design, so the list is written out and pinned, the file's existing pattern). currency falls out of the same resolution line in both faces and is covered and pinned; number/text/boolean/date formulas are unchanged (number CONTROL pinned in both). No shared exported helper existed to reuse (FormulaCellRenderer, plugin-form columnValueType and plugin-grid alignsAsNumber each spell their own); both helpers are module-local. Changed lines: 223 (+212 / -11) over 7 files. L2: dispatch-gates --tier names no contract face for these paths (no path-derived CONTRACT_REVIEW_TIER owed); the lint text is published rules text (os explain), not a spec schema.",
      "tests": "HEAD e62abfdb. `pnpm --dir ui exec vitest run packages/plugin-grid/src/useColumnSummary.test.tsx packages/plugin-detail/src/__tests__/HeaderHighlight.formulaReturnType-35734.test.tsx`: Test Files 2 passed, Tests 17 passed. Narrowed package run (28 footer-summary + highlights files of plugin-grid/plugin-detail + scripts/__tests__/percent-storage-callers-11475.test.ts): Test Files 29 passed, Tests 300 passed. `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2`: Test Files 222 passed, Tests 9337 passed. Typecheck: `pnpm --filter @objectstack/lint typecheck` exit 0 (check:test-typecheck OK); `turbo run type-check --filter=@object-ui/plugin-grid --filter=@object-ui/plugin-detail` 55/55 tasks successful, both type-check tasks executed (cache miss). Ablations (fix committed first, scripts/ablation-replace.mjs, each restored to the HEAD blob with git diff HEAD empty; no dist in the path: all three suites import the subject by relative path): A1 footer colType resolution removed -> 3 failed (percent x2, currency), number control green; first A1 attempt refused by the tool before running (replacement text already occurred in the file), re-run with a unique marker. A2 percent width face removed -> 17 passed, no test moved: expected, the platform's absent percent width and formatPercent's default are both 0 today; the percent-field equality pin is what reds if that width moves. A3 chip resolution removed -> 2 failed (percent, currency chips), number control green. A4 lint list back to five -> 1 failed (enum pin).",
      "gates": "Local derived set: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (no paths, branch change set) -> 73 commands, run on HEAD e62abfdb, each exit captured before any pipe: 72 exit 0; `node scripts/check-plugin-teardown-shape.mjs --self-test` exit 3 = NOT MEASURED, reason: shallow clone cannot read its pinned positive-control commit (checker-health self-test, not a diff verdict). `--ran` reconciliation: '73 derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)'. A round-1 run on an earlier head found `pnpm --dir ui exec vitest run scripts/` red (percent-storage-callers-11475 ledger names percentCellScale(column); my first spelling passed percentCellScale(percentFace)); fixed in e62abfdb by keeping the storage call on the column, green in round 2. `check:dual-build-cjs-loads` was PREREQUISITE NOT MET in round 1, exit 0 in round 2. overlap-check before each push: VERDICT clean exit 0. CI on PR head e62abfdb at report time: all gate-carrying runs in_progress (Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint · *, Type Check · *, PR-body guards); none concluded yet.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 relay actions — (1) pr_create: POST /repos/objectstack-ai/objectstack/pulls (draft) + POST /repos/objectstack-ai/objectstack/issues/35793/assignees (os-tesla), read back 8199 bytes sent = stored; (2) this os-dev-report comment: POST /repos/objectstack-ai/objectstack/issues/35734/comments via post-stamped.mjs. git push x4 (not REST).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — date-returning formula, grid footer: the date-family test (temporalCellFaceOf) reads the field's own type, so a min/max summary over a date formula takes the numeric path and parseFloat reads its ISO text as a year. Read from code on d1ebe86d, not reproduced at a public door, no named producer declares a date formula with a summary. Dedupe words: date formula footer min max, temporalCellFaceOf formula returnType, footer ISO year formula",
        "carrier: none · noted, not filed — date-returning formula, header chip: the wide-basis rule reads drawnType ('formula'), so a date formula's chip keeps the 9rem basis that the date wide floor exists to avoid. Read from code only. Dedupe words: highlight date formula wide basis, HeaderHighlight isWide formula date",
        "carrier: none · noted, not filed — DetailView summary chip picks its currency/percent arms from the field's own type (ftype), so a percent/currency formula there misses them; same family as this card, outside its file surface, read from code only. Dedupe words: DetailView summary chip formula percent, summary chip returnType",
        "carrier: none · noted, not filed — polish: no shared exported helper resolves a formula's value type; FormulaCellRenderer, plugin-form columnValueType, plugin-grid alignsAsNumber and now the two module-local helpers each spell it."
      ]
    }
  6. removed
    pm:dispatched
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:datadomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions