Repository navigation
feat(spec): a formula field can return percent - #35565
Conversation
Round-1 work saved before its commit was refused, committed on the maintainer's word; the changeset, regenerated artifacts and gates follow in the next commit. Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 955f6da595238a75a34d259523464186f6a99f5a && git checkout 955f6da595238a75a34d259523464186f6a99f5a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 08d920a16e977a1c0842f511ef40158ee3bc7c61 bc810f4ad9458176645f43b29574130fc6d03f44 && git checkout -B drift-repro 08d920a16e977a1c0842f511ef40158ee3bc7c61 && git merge --no-ff bc810f4ad9458176645f43b29574130fc6d03f44
node scripts/docs-audit/affected-docs.mjs --json 08d920a16e977a1c0842f511ef40158ee3bc7c61
|
Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
…returnType inspector pin Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB CI on Generated by Claude Code |
… percentDisplay gate Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
…rmula-percent-return
…r the percent formula return type Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
The formulas and field-types pages enumerate a formula's returnType; both now name percent and state its fraction convention, its scale and its percentDisplay face, as the field schema's describe does. Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB Final head for review · area data-2 · 2026-11-19T17:19Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对L1-a: ACCEPT, with two required items before queueing · head Readings, my own.
Code.
R1 (required before queueing): name the stored-
That is a correct fix, and it is pinned ("a stored
Mirror it in the PR body. This is a changeset and body edit. I re-read only the changeset on the new head, so no full fresh L1 is needed. The arm stays R2 (required before queueing): amend the claim for Pins (names grepped).
Declaration: agreed, apart from R1.
Changeset sentences checked against the diff:
Routing. L2 is owed at |
…lso corrects Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对L1-a delta: ACCEPT, R1 and R2 closed · head Delta. One commit, one file: R1: closed. The new bullet names "an existing
That matches R2: closed. Claim amendment 7016639769 on #35047 names Still owed before queueing: CI green on this head, which was running at this reading. Routing. L2 is owed at |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: PR #35565 for card #35047, schema face. Read: the card body and its six comments (no ruling and no earlier record among them), the PR body, the 28-file list, and the net diff against Check-runs on this head when this record was written: 71 runs: 33 success, 11 skipped, 1 cancelled, 26 in progress, none red. The cancelled run is ① Derived judgmentsAccept-set and public-surface changes the diff implies:
② Semver level
③ Boundary flags
④ Design judgmentHits files:
Implementing files:
Findings: S1 (should-fix) — N2 (nit) — the N3 (nit) — N4 (nit) — the forms open No must-fix. S1 is open on this head and earns a delta review of its fix; the four nits do not. Implemented-by: VERDICT: PASS |
…rmula verdict The field inspector cleared a declared `percent` return type when the edited expression proved no type, which is the verdict of a field-over-field quotient such as `record.spent / record.budget`. A declared `percent` or `currency` now survives every verdict that proves no other type (`number`, or none); a verdict that proves text, a boolean or a date still stamps. The returnType jsdoc and describe say so, and the changeset names the forms, not the inspector, as the place that offers `percent`. Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB Final head for review (S1 round) · area data-2 · 2026-11-19T18:36Z
|
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对L1-a delta: ACCEPT, no required item · head Delta. Two commits, 7 files, +65 / −14: S1: closed.
N1: closed. The changeset now says the field and object forms offer N2: closed, with one new inaccuracy. The describe no longer opens "Inferred". But its new sentence says "
Scope note for seat 5. The CI. 62 success, 11 skipped, 0 failed. One Routing. Seat 5 runs the narrow S1 delta at |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: DELTA review d1 from The delta is two commits in a line, Check-runs on this head when this record was written: 74 runs, 63 success, 11 skipped, none in progress, none red. Every Test Core shard, every Test UI shard, Type Check UI, Type Check · workspace and Lint UI concluded success; those are the families the first record could not speak for. S1: closed.
The ① Derived judgments
② Semver levelUnchanged and still right: N1: closed. The changeset now says the field and object forms offer ③ Boundary flags
④ Design judgment
N5 (nit) — the L1-a delta's point that the describe's " N6 (nit) — a kept No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB Landing · area data-2 · 2026-11-19T18:46Z
State: draft → ready + auto-merge (merge queue). #35047 closes on merge via |
Requested by Bill · project thread
Fixes #35047
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #35607 —
skills/objectstack-data/rules/field-types.md(line 130) lists formula return types withoutpercent; skills prose is outside this card's fence维护者速读
What changes
@objectstack/spec: formulareturnTypeadmitspercent, mirroringcurrency(spec: a formula field cannot declare a currency result —returnTypeisnumber | text | boolean | date, so a formula over money renders as a bare number #22727). The value is read as apercentfield reads its stored value: a fraction (0.25shows25%) unless the formula declaresmaxabove 1, then percentage points (percentScaleOf).scalecounts the decimal places of the displayed percentage (absent: 0).percentDisplayapplies to a percent formula too. Declared, never inferred. Readers that switch onreturnType(display-name eligibility per ADR-0079, filter operator and comparand typing,stack.zod.ts,component.zod.ts) classpercentwithnumber. The field and object forms offerPercent, and the field form'spercentDisplayrow opens for a percent formula.@objectstack/objectql:formulaRoundingScalerounds a percent formula's fraction result toscale + 2places and a whole percentage toscale.percentfield computed from itsexpression. Before, its computed fraction was rounded toscaleitself (0.417 atscale: 1was stored 0.4, reading 40.0%); it now keepsscale + 2places (0.417, 41.7%). This applies from the next computed write; rows written earlier are not rewritten. The changeset says so too.@object-ui/fields:FormulaFieldrenders a percent result with the percent formatter. The field and object forms offerpercentas a return type.@object-ui/app-shell: editing the expression in the field inspector keeps a declaredpercentorcurrencyunless the new expression proves text, a boolean or a date (an unproven field-over-field quotient no longer clears it).content/docs/data-modeling/formulas.mdxandfield-types.mdxlistpercentwith its convention; the reference pages and the en metadata-forms bundle are regenerated.Tests
formula-percent-result.test.ts; objectqlengine-formula-scale.test.ts(percent arm); uiformulaFaces.returnType-11748.test.tsxand the inspector pins (anumberverdict, and a field-over-field quotient that proves no type, forpercentandcurrency; the new arm fails 3 of 11 with the fix taken out).formula-currency-result.test.ts, service-analyticsformula-return-type-measure.test.ts, and the lint shipped-predicate census (63 → 65, the percent formula'spercentDisplaygate holds two literal comparisons).席位核对
bc810f4ad9: the S1 fix round from the contract review (7017037505),fe974fb467(inspector keeps a declaredpercent/currencyunder anumberor unproven verdict, jsdoc and describe, changeset wording) andbc810f4ad9(reference docs regenerated), over03a17ea72f, which follows a base-only merge ofmainviaos-regen-merge.shat986de618a. K = 13. +437/−56 over 28 files, not governed.origin/mainand PRs feat(spec): the Studio hook form offers texts, and HookContext declares ctx.text #35510, fix(audit): a search the server widens never names a column the caller may not query #34817.percent/currencyarms fail.check:generated --fixregenerated the reference docs;check-i18n-bundlesin sync after the build closure.bc810f4ad9: 61 success, 9 skipped, 0 failed.pnpm --filter @objectstack/spec exec vitest run src/data/formula-percent-result.test.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB