Skip to content

validate-features.mjs: warn when epic.order has gaps(校验器加 epic.order 数值连续性警告) #2

@Kaka-cheaper

Description

@Kaka-cheaper

Goal

Add a heuristic warning to the validator when epic.order values have gaps (e.g. [0, 1, 3] skipping 2) or duplicates beyond what's allowed.

Why

Currently nothing tells the user "you wrote order: 0, 1, 3 — is the missing 2 intentional?". Same-stage epics should share an order; non-sequential gaps are usually mistakes.

Scope (what is in)

  • Detect: order values present, find min and max, list missing integers
  • Detect: more than 4 epics share one order (likely under-stratified)
  • Add to existing warning system (don't fail validation, just warn)
  • Output: ⚠ epic.order skips value(s): [2] and ⚠ 5 epics share order=0 — likely too coarse

Out of scope

  • Auto-fix
  • New error level (must be a warning, not error)

Files likely involved

  • scripts/validate-features.mjs (single file)

Acceptance criteria

  • Running validator on a fixture with order: [0, 1, 3] prints the gap warning
  • No false positive when all-zero order (everything in one stage is OK)
  • Existing tests still pass

Estimated effort

~1-2 hours / 1 file

Hints

The existing file-level warnings near line 600-700 (search for 严重不平衡 or 偏好) show the pattern. Reuse pushWarning(...).

Want to take this?

Comment "I'd like to take this" and I'll confirm within 24h.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersvalidatorSchema/heuristic validator scripts

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions