Skip to content

39173 数字字段 precision: 0 能发布,之后每条非零数据都被拒:发布判定应先拦下 #39173

Description

@objectstack-fleet

repo:cloud@os-warren · os-warren · session_01JQwxbaECoSjckwkB1YXMTu

① product defect (class c) · Source: cloud#5306 acceptance run 2 (epic cloud#5304) · Grading: area:data (spec/field) · Bug · p2 (one build in nine hit it; data silently refused after a clean publish). Dedupe: searched objectstack open issues for precision "digits in total", precision 0 number field, max_precision: 0 hits.

维护者速读

  • 是什么:应用内助手建了一个数字字段,写了 precision: 0。发布判定说「可发布」,但发布后这个字段除了 0 之外什么值都存不进,演示数据 8 条丢了 7 条。
  • 为什么要紧:管理员看到「发布成功」,之后录数据才报「最多 0 位数字」,难以理解。
  • 怎么修(建议):要么 spec 把 number 的 precision 最小值定为 1,要么发布判定把 precision: 0 当作拒绝并说明「precision 是总位数,小数位用 scale」。

Reach (measured once)

cloud#5306 run 2, door rep2 crm (cloud 9f608e7, pin b706ec6e): the in-app admin build agent saved a number field { type: 'number', min: 0, precision: 0 }; save_metadata_draft answered publishable, refusals []; publish answered published; the install door's seed load then refused records #0..#2 with ValidationError 'Employees must have at most 0 digits in total (got 3)'; seed 1/8.

Evidence: packages/spec/src/data/field.zod.ts (~1964) precision: z.number().int().min(0), and its describe defines precision as total digits (decimal places are scale), so precision: 0 can only hold 0. Run record /mnt/project-files/cloud-5304/acceptance/run-2/RUN-2-RECORD.md (N1).

Acceptance

  • A number field with precision: 0 is refused at save/publish with a sentence naming scale, or the spec forbids it; an authored precision ≥ 1 behaves as today.

Clause-②: no
Suggested-grade: p2

Activity

  1. added
    bug
    priority:p2
    pm:queue
    on Dec 2, 2026
  2. changed the title [-]数字字段 precision: 0 能发布,之后每条非零数据都被拒:发布判定应先拦下[/-] [+]39173 数字字段 precision: 0 能发布,之后每条非零数据都被拒:发布判定应先拦下[/+] on Dec 2, 2026
  3. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ

    First touch · 2026-12-02T21:04Z

    定级:area:data · Bug · p2 · 数字字段 precision: 0 发布判定放行,发布后非零数据全被拒 · 实测一次(cloud#5306 验收 2 第 2 轮)

    • 作者定级保留,补 area:data、domain:spec;已在 pm:queue。
  4. added
    domain:spec
    on Dec 2, 2026
  5. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

    Self-audit (execution-duties 自分诊 ③): triage first touch 7358774266 (triage@os-warren, area:data · Bug · p2) is on this card; card-pick.mjs reads it as "no triage audit" because its recogniser does not read the **First touch** shape. Route and grade unchanged.

    Claim: PM loop round 1
    Session: session_01Utp6CYUove7YBXgHy4iEsr
    Thread session: session_01Utp6CZrpGx11Siz7rMLiFi
    Account: os-bill
    Branch: claude/project-thread-wxsz4m
    Worktree: objectstack-issue-39173
    Domain: domain:spec
    Seat: repo:objectstack@os-bill
    Area: data-p2 (zone of seat repo:objectstack@os-bill, intake area:data p1/p2)
    File surface: packages/spec/src/data/field.zod.ts (the precision bound and its author-facing message), the generated baselines and schemas the spec build regenerates from it, test files named for this card, one changeset; the publish/draft verdict path only if measurement shows the schema bound does not reach it (the thread names that file before editing it) (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default — dispatch-gates --tier: "The tier stays below the ceiling: with no mandate the PM picks floor or default per card", effort: high
    Clause-②: no
    Metadata-protocol: narrowed
    Responsibility: packages/spec in this repo: number precision accepts 0, which can hold only 0, so a clean publish is followed by every non-zero write refused | no path refuses it at save or publish today | every metadata author, the in-app build agent included (cloud#5306 run 2: 7 of 8 seed rows refused)
    Thread-read: 7358774266
    Premise: holds — at origin/main 9a13387 packages/spec/src/data/field.zod.ts:1964 reads precision: z.number().int().min(0).optional() and its describe defines precision as total digits (decimal places are scale)
    Pre-claim lane: domain:spec (the bound lives in packages/spec/src/data/field.zod.ts)
    Pre-claim deps: no Blocked-by: on the card
    Prior rulings read: the card names none; the thread greps docs/adr/** (ADR-0049, ADR-0087) and the field.zod.ts precision docblocks before editing; L2 at contract-review tier owed before the queue (narrowing)
    Serial constraints cleared: check-handover.mjs --inflight --paths=packages/spec/src/data/field.zod.ts: no readable in-flight surface meets it; none else
    Intake: area:data p2, on the maintainer's word 「再开 专区 处理 area:ux area:data p1 p2」 (2026-12-02T22:22Z).

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 2, 2026
  7. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

    Claim amendment (claim 7361454513): File surface adds packages/spec/src/migrations/entries/semantic/19.field-precision-zero-refused.ts (new; reason: check:adr-0087-registration refuses a Metadata-protocol: narrowed changeset without a disposition and refuses no-migration-prescription on narrowed, so registered plus one semantic entry is the only fit; precedent 18.field-max-length-malformed-or-misplaced-refused.ts) and packages/spec/src/data/field.test.ts (an existing pin lists { precision: 0 } as legal and moves to the refused list). The publish/draft verdict path needs no file: the save door's schema parse and the publish re-parse both reach FieldSchema (thread reading). Declaration arm corrected: Clause-②: no (narrowing) in the PR body and changeset, as the level gate requires beside narrowed. check-handover.mjs --inflight on the two paths: no in-flight surface meets them.

  8. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

    Overlap reading for amendment above: check-handover.mjs --inflight reports #38876 (claim 7343063306, repo:objectstack@os-justin, draft PR #39144) meeting the directory packages/spec/src/migrations/entries/semantic/. Its claim names "one new file" there; this card adds a different new file (19.field-precision-zero-refused.ts). The directory has no index the entries register in (entries are discovered by file; the only cross-reference is semantic-relevance-coverage-38929.test.ts, read on origin/main), so the two new files do not meet. Notify: none needed; whichever lands second merges main and re-runs the semantic-entry gates.

  9. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

    Claim amendment (claim 7361454513): File surface adds packages/metadata-protocol/src/protocol.publish-draft-schema-reparse.test.ts (test only; reason: the door pin the dispatch asks for — a draft save of { type: 'number', min: 0, precision: 0 } answers 422 INVALID_METADATA at fields.F.precision naming scale, and a draft stored before the change is refused at per-item publish — goes into this file's shared save-door + publish re-parse harness, as AGENTS.md's shared-harness rule asks, not a new file).

  10. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CZrpGx11Siz7rMLiFi
    os-dev-report

    Card thread of seat repo:objectstack@os-bill, under claim 7361454513 and its amendments. Draft PR #39211, head 9eb9de932ce79279d293acbb58de6a6725f42f7e.

    {
      "issue": 39173,
      "status": "done",
      "branch": "claude/project-thread-wxsz4m",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/39211",
      "session": "session_01Utp6CZrpGx11Siz7rMLiFi",
      "premise_still_valid": true,
      "summary": "FieldSchema.precision tightened from int().min(0) to int().min(1) with a module-private refusal sentence naming `scale` (`scale: 0` for a whole number; omit precision for no limit). Measured that the save door (resolveOverlaySchema -> ObjectSchema) and the publish re-parse of a stored object draft both reach FieldSchema, so no verdict-path code changed. ADR-0087 registered as semantic entry 19.field-precision-zero-refused (no D2 conversion, per zone). Stored rows: an active object row still loads (registry parse is a diagnostic, metadata_spec_invalid) and keeps today's write behaviour until next saved, which is then refused; a stored draft is refused at publish (pinned).",
      "tests": "Red first: new spec describe 7 failed on cf44d851 (test commit, pre-fix). Green: spec field.test.ts + src/migrations 581 passed (582, 1 todo) at 9eb9de93 post-merge; metadata-protocol protocol.publish-draft-schema-reparse.test.ts 12 passed (3 new: save 422 INVALID_METADATA at fields.headcount.precision naming `scale: 0`, pre-change draft refused at publish, CONTROL precision 1 publishes). Ablation once via ablation-replace.mjs (.min(1,{message}) -> .min(0,'ABLATED_39173')), spec rebuilt, dist preflight marker present in 2 built files: spec 8 red (7 new + precision:-1 message), door 2 red, CONTROL green; restored blob == HEAD 9a71c8742a2f, rebuilt, preflight --absent over 614 files, green again. cli migrate-meta-engine-guidance.test.ts 3 passed. spec typecheck (tsc + scripts + test layer) passed. Full spec suite NOT MEASURED (exceeds 10-minute foreground cap; Test Core runs it).",
      "gates": "dispatch-gates --commands: 120 families, run at 3d7870f3; merge 9eb9de93 touched no spec/metadata-protocol path; spec build + check:generated (14/14) + targeted tests re-run at 9eb9de93. --ran: 120 accounted, 114 run, 6 NOT-MEASURED (exit 3: check-plugin-teardown-shape --self-test [shallow clone], check:skill-examples, check:dual-build-cjs-loads, check:lean-entry-closure [need full workspace build]; claimed: check:query-options-erasure exit 124 at local 300 s cap, check:type-check-debt killed by container restart exit 137). Recorded red: check:dts-closure exit 1, missing .d.ts in core/formula/lint/driver-sql/driver-sqlite-wasm built locally with OS_SKIP_DTS=1, none in the diff. metadata-protocol typecheck NOT MEASURED locally. CI check-runs: pending at report time (PR just opened). Record: /mnt/project-files/card-39173/gates-ran-3d7870f3.txt",
      "mcp_calls": "0 MCP GitHub calls",
      "api_writes": "3 — git push (5 pushes to claude/project-thread-wxsz4m, not REST); relay pr_create (repository_dispatch -> run 47000038008 -> POST pulls, #39211); post-stamped os-dev-report comment on #39173",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: c · reach: named producer — FormFieldSchema.precision (packages/spec/src/ui/view.zod.ts, form row override) keeps int().min(0), pinned legal by view.test.ts ~1773; plugin-form sectionFields copies it onto the runtime field, no write path enforces it · dedupe words: form field precision zero, FormFieldSchema precision min, form row precision · zone files it (zone 23:06Z)",
        "carrier: zone — Skills-docs follow-up owed: skills/objectstack-data/rules/field-types.md lists `precision` beside `scale` without saying precision = total digits, scale = decimal places (the trap the in-app agent fell into)"
      ]
    }
  11. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

    Claim amendment (claim 7361454513): File surface adds packages/spec/src/data/currency-precision-iso4217.test.ts (test only; reason: a fixture authoring precision: 0 in its ['JPY', 0] tuple parses through FieldSchema and is refused by the narrowed bound — Test Core 4/12 red on 9eb9de9; the thread changed it to ['JPY', 1] on head 545b751). L1 checks that the fixture's intent (JPY's zero fraction digits) is still what the test pins.

  12. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

    Close-out · 2026-12-03T02:36Z · PR #39211 merged (merge 2b06762911, enqueued by the approver os-zhuang after the narrowing hand-off 7365059389): a field declaring precision below 1 is refused at os validate, defineStack, the metadata save door and the publish of an object draft, and the refusal names the fix (scale: 0 on number / percent / rating / slider; delete precision on currency). ADR-0087 semantic entry field-precision-zero-refused registered. Reviewed by CONTRACT_REVIEW_TIER PASS 7363940829 and delta PASS 7364635898, seat ACCEPT 7364661931. Follow-ups: #39213 (skills field-types wording, now unblocked), #39214 (FormFieldSchema.precision). pm:dispatched removed.

  13. removed
    pm:dispatched
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugdomain:specpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions