Run artifact

workspace/targets/CsvStat/blueprint/FEATURE-MinMax.md

FEATURE: Min and Max

FieldValue
Version20261025 V1
DescriptionCompute the minimum and maximum of a column according to its inferred type.
Depends OnFEATURE-BooleanTextTypes.md
Providesprofile.MinMax
Consumesprofile.InferType

Purpose

The profile reports min and max for every column. The rule depends on the column type. This story implements the extremes computation in internal/profile; two-decimal formatting of number results belongs to the decimal formatting story.

Interface

// Extremes holds the minimum and maximum of one column.
type Extremes struct {
    Min, Max       string   // text form, see below
    MinRat, MaxRat *big.Rat // exact values for integer and number columns, else nil
}

// MinMax takes the column type and the trimmed non-null values of the column.
func MinMax(typ string, values []string) Extremes

typ is one of integer, number, date, boolean, text, empty.

Behavior

and largest values written as plain integers. MinRat and MaxRat are set.

-0.25). MinRat and MaxRat are set; Min and Max hold the source text of the extreme values, and the decimal formatting story renders them with two places.

if any value is true (ignoring case), else false. Output is lowercase whatever the input case.

case; a space sorts before letters.

Required Tests

The project suite in internal/profile includes these tests by exact name:

lexically (9 is less than 10).

all-false gives false for both; mixed gives false and true.

Programmatic Acceptance

=== AC minmax-integer ===
Intent: Integer extremes are ordered numerically with exact arithmetic.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxInteger") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-integer ===

=== AC minmax-number ===
Intent: Number extremes are ordered exactly as decimals.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxNumber") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-number ===

=== AC minmax-date ===
Intent: Date extremes are the earliest and latest dates.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxDate") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-date ===

=== AC minmax-boolean ===
Intent: Boolean extremes follow the false/true rule and are lowercase regardless of input case.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxBoolean") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-boolean ===

=== AC minmax-text ===
Intent: Text extremes are ordered by byte value.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxText") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-text ===

=== AC minmax-empty ===
Intent: An empty column has blank minimum and maximum.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxEmpty") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-empty ===

=== AC minmax-single-value ===
Intent: A single non-null value is both the minimum and the maximum.
Requires: executable=go; scope=test

from drydock_go import run_test

result = run_test("./internal/profile", "TestMinMaxSingleValue") print(result.stdout) print(result.stderr) assert result.passed, (result.status, result.stdout, result.stderr) === END AC minmax-single-value ===

User Acceptance

Guardrails

EOF_NOT_USED