Skip to content

Pure helper functions for Review stage #230

Description

@SorraTheOrc

Implement pure, testable helper functions for Stage 3 Review:

  • intensityIndex(label): Map intensity string to ordinal index (subtle=0, soft=1, medium=2, hard=3, aggressive=4)
  • textureIndex(label): Map texture string to ordinal index (alphabetical: bright=0, crunchy=1, dark=2, harsh=3, noisy=4, sharp=5, smooth=6, tonal=7, warm=8)
  • medianIntensity(selections): Compute median intensity index from a list of CandidateSelection
  • medianTextureIndex(selections): For each entry, compute median index of its texture array; then compute median across entries
  • flagCoherenceOutliers(selections): Return a Set of recipe names whose intensity or primary texture deviates >1 step from palette median; skip if <3 entries
  • buildSummaryRows(selections, outliers): Format each selection into a table row [recipe, seed, category, intensity, texture, tags] with warning indicator for outliers
  • summaryColumns: Table column definitions for the palette summary table

Acceptance Criteria:

  • All functions are exported and testable in isolation
  • intensityIndex returns correct ordinal for all 5 values plus -1 for unknown
  • textureIndex returns correct ordinal for all 9 values plus -1 for unknown
  • medianIntensity/medianTextureIndex return correct median for odd and even counts
  • flagCoherenceOutliers correctly identifies entries deviating >1 step from median
  • flagCoherenceOutliers returns empty set when <3 entries
  • buildSummaryRows includes warning indicator for flagged entries

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions