COMPO · 2.21 · LINE SYSTEM REGRESSION SUITE

Тест-кейсы
линейной
системы.

Формальная проверка Compo 2.00–2.23. Этот модуль не вводит новые художественные правила и не владеет line-метриками: он превращает существующие contracts в воспроизводимые fixtures, assertions, invariance-проверки, deterministic generation tests и regression barriers перед 2.22/2.23.

ModuleCompo 2.21
Scopereference / regression tests for line subsystem
Ownstest vectors + assertions + suite report only
ConsumesCompo 2.00–2.23 public contracts
ProvidesLineRegressionSuite + fixtures + baseline manifest
FinalityTEST ORACLE / NO DESIGN OWNERSHIP

Тест — это executable contract

00 / module api

2.21 фиксирует наблюдаемое поведение публичных интерфейсов. Он не копирует production-логику owner-модулей и не превращает стартовые эвристики в вечные числовые истины.

SCOPE

Unit/reference/regression/integration invariants для line subsystem 2.00–2.23.

BOUNDARY

Ни одной новой line metric, никакого score ownership, никакой геометрической мутации.

DEFERRED

Только будущие global composition owners: balance/hierarchy/negative-space/eye-flow, global pipeline/scoring и generic override system.

CONSUMES / PROVIDES

Consumes
Compo 2.00–2.18 owner contracts
Compo 2.19 LineStructureCandidate[]
Compo 2.19 CandidateLineage / GenerationTrace
Compo 2.20 LineSystemScoreResult
Compo 2.22 MaskCropSeamResult
Compo 2.23 LineContextProjection
MetricResult[] / PenaltyResult[]
StylePreset / semantic target
seed / engineVersion / ownerVersion map
Provides
LineRegressionCase[]
LineRegressionFixture[]
LineRegressionSuite
RegressionBaselineManifest
SuiteRunReport
FailureRecord[]
CompatibilityMatrix
deterministic smoke runner
NO TEST-OWNED METRICS. Если тесту нужен line.grid.localGridFit, его expected owner остаётся Compo 2.13. 2.21 может проверить значение/status/owner, но не становится владельцем формулы.

Типология тестов

01 / assertion classes

Степень жёсткости зависит от природы утверждения. Чистая геометрия допускает exact/tight epsilon; target-fit и эвристические policy проверяются диапазоном или отношением кандидатов.

Source classЧто фиксируетТип assertionПример
DERIVEDЧистая математика / геометрия / стандартная формула.exact ± EPS3–4–5 segment → length=5.
CONSTRAINTHard boundary, ownership, forbidden mutation.status / reject reason / booleanhard violation нельзя компенсировать score.
HEURISTIC RANGEСтартовая policy с provenance.range / set membershipscore drift в документированном допуске.
RELATIONALСравнение вариантов при одном target.A > B / same / excludedconfidence tie-break при score внутри epsilon.
DETERMINISMSeeded generation / tie-break / lineage.structural signature equalitysame input + seed → same candidate signatures.
REGRESSIONСтабильность после corrective pass.baseline diff + documented migrationrank inversion требует причины, а не переписывания expected.
Pixel-perfect layout assertions запрещены. Suite закрепляет архитектурные и вычислимые инварианты, а не единственный визуальный результат генератора.

Допуски и provenance

02 / tolerance policy

Каждый допуск должен быть привязан к типу вычисления. Test suite не имеет права маскировать numerical instability широким «дизайнерским» tolerance.

1e−6normalized geometry EPS · DERIVED
1e−9phase/circular helper EPS · DERIVED
±0.02owner metric V1 drift · INITIAL_HEURISTIC
±0.032.20 local score drift · INITIAL_HEURISTIC
0accepted hard violations · HARD
EXACTowner key / status / lineage / seed signatures
assertDerived(actual, expected, eps) assertRange(actual, [min,max], provenance) assertStatus(actual.status, expectedEnum) assertOwner(metric.key, expectedOwner) assertInvariant(transform(input), referenceOutput) assertDeterministic(run(input,seed), run(input,seed)) assertRegression(current, baseline, allowedDrift, migrationReason?)

Если baseline изменился из-за осознанной migration/corrective pass, expected обновляется только вместе с reason, ownerVersion и новой baseline version.

Coverage matrix 2.00–2.23

03 / subsystem coverage

Каждый owner получает хотя бы один structural или numerical regression barrier. Composite modules 2.19/2.20 получают отдельные integration suites.

ModuleОбластьОбязательные regression assertionsRepresentative IDs
2.00roles / line schemarole/subrole contract; no style kind promoted to top-level roleO09
2.01base geometrylength, angle convention, reversal, degeneracyG01–G07
2.02–2.03axis / diagonalorientation modulo 180; direction-specific semantics explicitG02–G04
2.04–2.05curve / polylinearc/segment invariance; 2.04 owns raw smooth-curve curvature, 2.05 owns polyline turnsG05–G07, A09
2.06visual weightowner remains local; reused contrast evidence not double-votedO06, S09
2.07length ↔ roledescriptor ≠ fit; N/A target handlingO03, O13
2.08local eye-guide cueno global eye-flow ownership/leakageO08
2.09connectorssemantic endpoints / route relation remain owner evidenceG08, S04
2.10–2.11crossing / contacthard/soft distinction; one defect one representationG08, S01, S09
2.12parallel groupsgeometry gaps ≠ rhythm scoreO10
2.13gridN/A ≠ 0; local grid fit onlyO13, S02
2.14boundary/dividerpartition descriptor cannot become global balanceO14
2.15technical/decorative grammargraphicKind/subrole boundaryO09
2.16color/tone/opacitylinear-light compositing; raw contrast ≠ universal qualityA01–A03, O11
2.17rhythm / stroke patterndash canonicalization; phase wrap; model-fit not regularity worshipA04–A08, O10
2.18tension interpretationconsumes 2.04/2.05 raw evidence; owns derived energy/concentration + target-aware tension fitA10, O12, O15
2.19generatorbounded + seeded + dedupe + lineage + immutable parentGEN01–GEN06
2.20scorerN/A, caps, coverage, suppression, deterministic rankingS01–S10
2.21regression oraclesuite owns no design metrics; baselines versionedR01–R02
2.22mask / crop / seamtopology, area conservation, reversal, explicit crop side, host adapter, no score ownershipM01–M06
2.23context adapterimmutable target projection, conflict defer, external selection trace, no local score rewriteC01–C06

Geometry + invariance fixtures

04 / canonical fixtures

Reference geometry проверяет не конкретную реализацию sampling, а наблюдаемые свойства: единицы, нормализацию, reversal, segmentation invariance и degeneracy.

DERIVED

Segment 3–4–5

A=(0,0)
B=(3,4)
expected:
 lengthPx = 5
 finite = true
INVARIANCE

Same path / segmentation

A→D = 100 px
A→B→C→D collinear
expected:
 same pathLength
 same orientation
 no segment-count bias
DEGENERACY

Zero-length

A=(10,10)
B=(10,10)
expected:
 status=degenerate
 angle=N/A
 no NaN metric vote

Transformation invariants

uniform scale k: pathLengthPx' = k × pathLengthPx pathLengthShortN' = pathLengthPx' / shortSide' = SAME reverse(path): unsigned length = SAME orientation modulo 180 = SAME directed start/end semantics MAY flip only when role explicitly uses direction resample / resegment: arc-length descriptors = SAME within geometry EPS owner metric must not depend on raw segment count unless segment count is itself declared evidence

Ownership, N/A и dependency barriers

05 / architecture invariants

Большая часть опасных regressions в COMPO — не числовая, а архитектурная: метрика начинает жить у двух owners, N/A превращается в ноль или descriptor внезапно начинает голосовать.

Owner registry assertions

line.rhythm.localRhythmScore → Compo2.17
line.color.localColorScore   → Compo2.16
line.curvature.localTensionScore → Compo2.18
line.grid.localGridFit       → Compo2.13
line.boundary.localBoundaryScore → Compo2.14
lineSystem.local_score       → Compo2.20

Forbidden substitutions

N/A          != 0
descriptor   != score
dependsOn    != derivedFrom
local cue    != global eye-flow
area ratio   != global balance
raw contrast != universal positive vote
repair hint  != foreign mutation

Double-counting barrier

if componentOf(activeComposite): child → diagnostic-only if crossGroupEvidenceOverlap(A,B): if A.independentVoteAllowed && B.independentVoteAllowed: both MAY vote within group caps else: deterministic primary votes duplicate is logged as suppressed dependsOn alone MUST NOT suppress.
Fallback confidence.

Approximate/fallback measurement остаётся тем же owner-result, но с меньшим confidence. 2.21 проверяет, что fallback не маскируется как exact и не получает одинаковую epistemic weight.

Generator regression 2.19

06 / bounded deterministic search

2.19 тестируется как orchestration layer. Suite проверяет границы поиска и lineage, но не требует единственной формы connector/curve.

IDInputExpected invariant
GEN01same request + seed + versionssame ordered structural signatures
GEN02maxTotalCandidates=5survivors ≤ 5
GEN03one family produces hard-invalid branchinvalid branch absent from survivors, reason logged
GEN04duplicate structural signaturesone deterministic representative retained
GEN05owner correction on candidatenew child lineage; parent snapshot unchanged
GEN06many independent option arraysbounded expansion; no full Cartesian product
Generation cost ≠ aesthetic score. Regression may verify that cost affects search bookkeeping / deterministic dedupe policy, but must not assert «cheaper candidate is more beautiful».

Scorer regression 2.20

07 / local ranking contract

2.21 закрепляет публичные invariants scorer, включая те, которые легко сломать рефакторингом dependency metadata или weight accounting.

IDInvariantExpected
S01hard reject before scorelocalScore=null; not rankEligible
S02N/A excludedsame score as scene without metric
S03group capmetric count cannot inflate family influence
S04missing expected optional groupcoverage/confidence ↓; score not injected with zero
S05missing required + require_allinsufficient_evidence; not rankEligible
S06score within epsilonhigher confidence may win
S07feasible exact tiestable seed/lineage tie-break
S08both rejectedstable audit ordering; no fake «best design»
S09same evidence vote + penaltyone representation unless explicit independence
S10target profile absentdiagnostic-only; no aesthetic localScore
Integration assertion S10. Текстовый contract 2.20 уже требует diagnostic mode без target. 2.21 делает это обязательным regression barrier: production adapter не должен silently score descriptors без semantic/style interpretation.

Correction requests и immutability

08 / no foreign mutation

Suite проверяет не только результат исправления, но и правильный маршрут изменения.

FORBIDDEN

Scorer mutates path

2.20 не двигает points/vertices и не меняет stroke/color.

VALID

Owner request

Диагностика возвращает targetOwner, reason и allowed range.

VALID

New branch

2.19 применяет owner correction как новый child candidate с lineage.

parentCandidate --immutable--> score/diagnostics → CorrectionRequest(targetOwner) → owner-bounded operation → childCandidate(parentId, operation, seedFork) → hard validate → recompute dirty owners → rescore ASSERT: parent structural signature before == after

Mask / crop / seam regression 2.22

09 / operational geometry

2.21 теперь включает финальный 2.22 в consolidated suite. Проверяется topology и contract boundary, а не конкретный rendering.

IDInvariantExpected
M01open splittwo regions + area conservation
M02reversalunordered regions same; anchor selection same
M03crop sidemissing keepSide unresolved; never auto-pick by area
M04ownershipno localBoundaryScore / localScore emitted
M052.14 handoffPartitionDescriptor / BoundaryRelation canonical
M06host contractproduction HostBoundaryAdapter; RectHostRegion fixture-only

Context adapter regression 2.23

10 / line ↔ global bridge

Context integration проверяется как adapter: глобальные facts приходят извне, а local facts сохраняются неизменными.

IDInvariantExpected
C01no contexteffectiveTarget == baseTarget
C02immutable patchbase target / MetricResult unchanged
C03conflictcontext_conflict; no silent last-write-wins
C04external selectionlocal rank/score preserved separately
C05foreign mutationowner-routed correction request only
C06handoff schemaLineStructureCandidate + MaskCropSeamResult canonical types

Визуальная лаборатория инвариантов

11 / reference scenes

SVG здесь не иллюстрация ради декора. Каждая полоса показывает пару inputs, которые должны дать определённое математическое или архитектурное отношение.

A · SEGMENTATION INVARIANCE 1 segment3 collinear segments → same pathLength B · REVERSAL / ORIENTATION MOD 180 θ mod 180 = SAME · directed semantics may flip C · PHASE WRAP IS CIRCULAR phase .98 ↔ .02 → distance .04, not .96 D · HARD REJECT BEFORE SCORE PROTECTED
same derived resultreversal pairvalid routed alternativereference context

Live reference suite

12 / 63 inline smoke tests

Inline runner проверяет test-oracle и основные инварианты автономно. В production те же vectors должны запускаться через adapters реальных owner-модулей; этот JS не заменяет production implementations.

PENDING · 63 TESTS

Regression protocol

13 / future-safe workflow

Красный тест — повод понять изменение контракта, а не автоматически ослабить expected.

После изменения любого 2.xx

1. run owner unit tests
2. run 2.21 full suite
3. compare structural signatures
4. compare hard-reject set
5. compare owner/status changes
6. compare metric deltas
7. inspect rank inversions
8. inspect suppression/penalty log
9. inspect lineage determinism
10. accept migration only with reason

Нельзя

rewrite expected because test is red
convert N/A to 0 for convenience
widen EPS to hide instability
duplicate owner formula in test suite
assert universal beauty preference
allow foreign mutation
drop seed/lineage from baseline
silently change owner key
let global metrics leak into local suite

Baseline manifest

RegressionBaselineManifest { baselineId, suiteVersion, engineVersion, ownerVersions: { "2.01":"...", ... "2.23":"..." }, stylePresetVersion?, canonicalSeeds[], fixtureHashes[], expectedStructuralSignatures[], expectedHardRejectCodes[], expectedMetricRanges[], expectedRankingRelations[], migrationReason? }

DATA FOR LAYOUT ENGINE

14 / machine contract

Machine-readable описание test suite. Оно должно позволять подключить реальные module adapters и прогнать тот же набор vectors без чтения всей статьи.

{
  "module": "Compo 2.21",
  "name": "line_system_reference_regression_suite",
  "version": "1.1-consolidated",
  "scope": "REFERENCE_AND_REGRESSION_TESTS_FOR_COMPO_2_00_TO_2_23",
  "consumes": [
    "Compo2.00-Compo2.18 public owner contracts",
    "Compo2.19.LineStructureCandidate[]",
    "Compo2.19.CandidateLineage[]",
    "Compo2.19.GenerationTrace",
    "Compo2.20.LineSystemScoreResult",
    "Compo2.22.MaskCropSeamResult",
    "Compo2.23.LineContextProjection",
    "MetricResult[]",
    "PenaltyResult[]",
    "semanticTarget",
    "StylePreset",
    "seed",
    "ownerVersionMap"
  ],
  "provides": [
    "LineRegressionCase[]",
    "LineRegressionFixture[]",
    "LineRegressionSuite",
    "RegressionBaselineManifest",
    "SuiteRunReport",
    "FailureRecord[]",
    "CompatibilityMatrix"
  ],
  "owns_metrics": [],
  "descriptors_only": [
    "suite pass/fail report",
    "fixture hashes",
    "baseline signatures",
    "failure diagnostics",
    "coverage matrix"
  ],
  "hard_constraints": [
    "test suite must not become owner of line metrics",
    "N/A must never be coerced to zero",
    "accepted candidate hardViolation count must be zero",
    "global metrics must not affect local line regression results",
    "foreign mutation is forbidden",
    "same input+seed+versions must reproduce structural output",
    "owner key changes require documented migration"
  ],
  "soft_constraints": [
    "heuristic metrics use range or relational assertions",
    "score drift requires explicit tolerance provenance",
    "pixel-perfect generated layout assertions are forbidden"
  ],
  "preferences": [
    "derived math uses tight deterministic epsilon",
    "composite-first scoring assertions",
    "structural signatures over screenshot equality",
    "documented migration over silent expected update"
  ],
  "overrides_allowed_by": [
    "documented owner corrective pass",
    "versioned architecture migration",
    "explicit new StylePreset baseline"
  ],
  "initial_heuristics": {
    "normalizedGeometryEpsilon": {"value": 0.000001, "provenance": "INITIAL_HEURISTIC"},
    "ownerMetricDrift": {"value": 0.02, "provenance": "INITIAL_HEURISTIC"},
    "lineSystemScoreDrift": {"value": 0.03, "provenance": "INITIAL_HEURISTIC"}
  },
  "test_case_schema": {
    "id": "string",
    "owner": "Compo x.yy | CROSS_MODULE",
    "sourceClass": "DERIVED|CONSTRAINT|HEURISTIC_RANGE|RELATIONAL|DETERMINISM|REGRESSION",
    "tags": "string[]",
    "input": "object",
    "expected": "object",
    "tolerance": "number|object|null",
    "seed": "integer|string|null",
    "assertions": "array",
    "baselineVersion": "string|null"
  },
  "suite_policy": {
    "runOnEveryLineModuleChange": true,
    "covers2_22": true,
    "covers2_23": true,
    "runBeforeClosingTopic2": true,
    "updateExpectedRequiresReason": true,
    "pixelPerfectLayoutAssertion": false,
    "productionAdaptersRequiredForRelease": true,
    "inlineRunnerIsReferenceOracleOnly": true
  },
  "coverage_required": [
    "happy_path",
    "N_A",
    "scale_invariance",
    "sampling_or_segmentation_invariance",
    "direction_reversal",
    "angle_or_phase_wrap",
    "missing_data",
    "fallback_confidence",
    "ownership",
    "no_global_leakage",
    "no_double_counting",
    "degeneracy",
    "deterministic_seed",
    "bounded_generation",
    "lineage_immutability",
    "deterministic_ranking",
    "mask_topology",
    "crop_explicit_selection",
    "host_adapter_contract",
    "context_projection_immutability",
    "context_conflict_defer",
    "external_selection_preserves_local_facts"
  ],
  "live_reference_tests": [
    "G01","G02","G03","G04","G05","G06","G07","G08",
    "A01","A02","A03","A04","A05","A06","A07","A08","A09","A10",
    "O01","O02","O03","O04","O05","O06","O07","O08","O09","O10","O11","O12","O13","O14","O15",
    "GEN01","GEN02","GEN03","GEN04","GEN05","GEN06",
    "S01","S02","S03","S04","S05","S06","S07","S08","S09","S10",
    "R01","R02",
    "M01","M02","M03","M04","M05","M06",
    "C01","C02","C03","C04","C05","C06"
  ],
  "deferred_inputs": [
    "global.balance",
    "global.hierarchy",
    "global.negativeSpace",
    "global.eyeFlow",
    "typography.*",
    "imageCrop.*",
    "posterGlobalScore"
  ],
  "recompute_when": [
    "any Compo2.00-Compo2.23 public contract changes",
    "owner version changes",
    "2.19 generator seed/lineage policy changes",
    "2.20 scoring/suppression/ranking policy changes",
    "2.22 mask/crop/seam contract changes",
    "2.23 context projection/selection contract changes",
    "baseline migration is accepted"
  ],
  "finality": "LINE_SUBSYSTEM_REFERENCE_TEST_SUITE_ONLY",
  "invariants": [
    "ONE_METRIC_ONE_OWNER",
    "N_A_NOT_ZERO",
    "LOCAL_NOT_GLOBAL",
    "GEOMETRY_NOT_INTERPRETATION",
    "DESCRIPTOR_NOT_SCORE",
    "COMPOSITE_FIRST",
    "NO_BEAUTYSCORE",
    "NO_FOREIGN_MUTATION",
    "SAME_INPUT_SEED_VERSIONS_SAME_STRUCTURE"
  ]
}
ARCHITECTURE CHECKPOINT · 2.21 НЕ ВЛАДЕЕТ НИ ОДНОЙ LINE-METRIC. Он фиксирует contracts 2.00–2.23 через fixtures, assertions и baseline manifest. Geometry остаётся у 2.01/2.04/2.05, owner-fit у 2.02–2.18, generation у 2.19, local ranking у 2.20. 2.22 добавит mask/crop/seam, 2.23 — context/global overrides. Любое изменение expected требует документированной причины.
VISITS / ...