Skip to content

[Data Integrity] Preserve numeric zero values through work-item normalization #609

Description

@seonghobae

Verified defect

Protected develop@2c328875e00e86537df3e965170be80532571cad still normalizes work-item fields with truthiness fallback such as String(draft?.[field] || ''). A current-head review of PR #608 independently reproduced the consequence on the active branch: legitimate numeric 0 values can be converted to the empty string while an item is normalized for editing/saving. The affected numeric fields include at least budget, actualCost, and storyPoints; the same coercion pattern must be audited at external-record normalization boundaries as well.

This is data-integrity behavior, not an accessibility-only concern. 0 is a meaningful business value and must remain distinguishable from null/undefined/missing.

Required repair contract

  1. Add a realistic RED regression before production mutation proving numeric zero survives the actual normalization path. Cover budget: 0, actualCost: 0, and storyPoints: 0 independently and in combination.
  2. Exercise at least one buyer-visible round trip (edit/save/reopen or import/normalize/render/export, whichever owns the affected path) so the test cannot pass through an assertion-only helper stub.
  3. Audit both sanitizeDraft() and createNormalizedExternalRecord() (and any semantically identical coercion) for || '' fallback on values where zero is valid.
  4. Apply the smallest root-cause fix: distinguish absence (null/undefined) from numeric zero, e.g. a nullish fallback at the owning coercion boundary. Do not broadly normalize unrelated boolean/string semantics.
  5. Run the focused regression, canonical unit/browser path, and exact owned-production coverage; preserve existing validation, CSV safety, and editor accessibility behavior.
  6. Revalidate the exact contributor head and protected base after the change.

Writer/stack boundary

PR #608 currently owns and is actively moving overlapping app.js accessibility work through Jules, so do not race that branch. Refetch its exact head and active-writer evidence first. If it remains actively moving, keep this defect tracked here and repair it on the settled current owning app.js lane rather than creating a competing overlapping source write. This issue is not permission to defer once that collision clears.

Acceptance

A persisted/imported work item containing numeric zero in each supported numeric field must emerge from normalization with a zero-equivalent value rather than '', while missing values continue to follow the existing empty-value contract and all existing tests remain green.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: highHigh-priority or P1 worktype: bugDefect or incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions