# NEXT temporary contract 3.3 — Consumer configuration: features first, choices as constraints {#root}

@status:impl/plan

[p01] @fact:NEXT-A03-SCOPE Temporary normative staging unit. Its body is the accepted architecture from refined plan revision 4, section 3.3. Before production code cites this law, promote the relevant clauses into permanent specifications. This file is consumed only after semantic coverage, implemented behavior and retained evidence are accepted. The task/retirement checker cannot perform semantic acceptance. @status:spec/done

[p02] @fact:NEXT-A03-U001 Выбор архитектуры: **thin choice groups над одним feature/request/effect algebra**. Plain old features недостаточны, независимые choices.requires дублируют dependency semantics. Option ссылается на feature IDs собственного package; feature activation ссылается на typed declared dependency IDs/subskill exports/config values. Version/source/link/visibility metadata живут один раз на declaration, а не копируются под каждым option. @status:spec/done

[p03] @fact:NEXT-A03-U002 D-003/D-017 приняты. Точный TOML spelling и code-generated contracts фиксируются engineering atom M-05-B в рамках выбранной модели, без повторного ontology vote. Target semantic model: @status:spec/done

[p04] @fact:NEXT-A03-U003 Requirement: - Dependency declaration: qualified coordinate/source constraint, stable local declaration ID, optional flag, requested target features, default policy. - Feature: local feature references; activate dependency by declaration ID; strong/weak target-feature request; exported subskill activation. Aliases локальны package и не заменяют qualified identities в graph/lock. - Group: stable ID, option feature IDs, cardinality, labels/help, optional explicit default, optional positive same-package parent-option guard. - ConsumerRequest: owning node/edge, target source constraint, explicit additive features, exact group selections, default policy, provenance. - ResolvedConfiguration: exact owner capture/definition hash, requested intent, active feature closure, active/dormant selections, induced dependency/provider edges и activated contribution exports. @status:spec/done

[p05]
```text
- Dependency declaration: qualified coordinate/source constraint, stable local declaration ID, optional flag, requested target features, default policy.
- Feature: local feature references; activate dependency by declaration ID; strong/weak target-feature request; exported subskill activation. Aliases локальны package и не заменяют qualified identities в graph/lock.
- Group: stable ID, option feature IDs, cardinality, labels/help, optional explicit default, optional positive same-package parent-option guard.
- ConsumerRequest: owning node/edge, target source constraint, explicit additive features, exact group selections, default policy, provenance.
- ResolvedConfiguration: exact owner capture/definition hash, requested intent, active feature closure, active/dormant selections, induced dependency/provider edges и activated contribution exports.
```

[p06] @fact:NEXT-A03-U004 Cardinalities distinct: at-most-one = 0..1; exactly-one = 1; at-least-one = 1..n; many = 0..n. Legacy exclusive остаётся at-most-one; requires_any остаётся technical OR. E1 реализует эти четыре закрытые формы, не arbitrary expressions/min/max. --all-features не выбирает constrained group member; conflicting complete expansion даёт clear error, а structural validator не вызывает «включить всё» как proof валидности definition. @status:spec/done

[p07] @fact:NEXT-A03-U005 **Solver integration:** @status:spec/done

[p08] @fact:NEXT-A03-U006 Requirement: 1. Сохранять все consumer edges и version constraints до unification; current first-wins root dedup исправляется. Additive requests объединяются; incompatible exact selections одного shared instance → conflict с обоими consumers. 2. Candidate metadata связано с immutable source/content identity, а не только version. Доступный каталог фиксируется на одну resolution transaction. 3. Activation implications условны на выбранный package candidate. Rejected candidate не меняет global requests. Существующие DepSolver/DepProvider расширяются typed request/result carriers или эквивалентным complete solver encoding. 4. Одна normalized view используется initial solve, metadata/capability scan, manifest_of, solve_masked, visibility, conditional resolution, graph output и lock serialization. Final graph содержит реальные selected capability/OR-provider edges. 5. Никакого blind five-iteration fixed point для нового semantics. Existing conditional layer проверяется на name-present/wrong-version и negated predicates; если совместное решение не доказано complete, комбинация с новой activation отказывает явно. 6. Candidate lacking requested option — candidate incompatibility, не global NeedsSelection из discarded version. Source corruption — отдельная ошибка. Mandatory unresolved group обсуждается только для реально requested/reachable owner. 7. Semantic default не выбирается backtracking. Default-based selection сначала bind к показанному exact owner definition и policy, затем становится hard request. Если solve требует другой semantic default, вернуть rediscovery/reconfiguration, не выбирать его. 8. Explicit stable selection может участвовать в backtracking по совместимым candidate definitions; final exact payload/definition и induced graph входят в reviewable apply plan. Persisted definition drift не применяется unattended без explicit reconfiguration authority. 9. Backend без capability для новой algebra возвращает unsupported-solver-mode до mutation. Не обещать parity naive/sat/resolvo без реализованных и проверенных adapters; нельзя silent fallback. @status:spec/done

[p09]
```text
1. Сохранять все consumer edges и version constraints до unification; current first-wins root dedup исправляется. Additive requests объединяются; incompatible exact selections одного shared instance → conflict с обоими consumers.
2. Candidate metadata связано с immutable source/content identity, а не только version. Доступный каталог фиксируется на одну resolution transaction.
3. Activation implications условны на выбранный package candidate. Rejected candidate не меняет global requests. Существующие DepSolver/DepProvider расширяются typed request/result carriers или эквивалентным complete solver encoding.
4. Одна normalized view используется initial solve, metadata/capability scan, manifest_of, solve_masked, visibility, conditional resolution, graph output и lock serialization. Final graph содержит реальные selected capability/OR-provider edges.
5. Никакого blind five-iteration fixed point для нового semantics. Existing conditional layer проверяется на name-present/wrong-version и negated predicates; если совместное решение не доказано complete, комбинация с новой activation отказывает явно.
6. Candidate lacking requested option — candidate incompatibility, не global NeedsSelection из discarded version. Source corruption — отдельная ошибка. Mandatory unresolved group обсуждается только для реально requested/reachable owner.
7. Semantic default не выбирается backtracking. Default-based selection сначала bind к показанному exact owner definition и policy, затем становится hard request. Если solve требует другой semantic default, вернуть rediscovery/reconfiguration, не выбирать его.
8. Explicit stable selection может участвовать в backtracking по совместимым candidate definitions; final exact payload/definition и induced graph входят в reviewable apply plan. Persisted definition drift не применяется unattended без explicit reconfiguration authority.
9. Backend без capability для новой algebra возвращает unsupported-solver-mode до mutation. Не обещать parity naive/sat/resolvo без реализованных и проверенных adapters; нельзя silent fallback.
```

[p10] @fact:NEXT-A03-U007 **Fresh/offline/update:** requested и resolved selections хранятся раздельно; request digest проверяется до Fresh path. Reinstall воспроизводит exact lock capture/selection, не re-solves. Fresh clone восстанавливает authored intent; offline missing exact capture → unavailable. Update сохраняет selection, показывает changed payload/definition; removed option/new required group → stale/needs-selection. --force не меняет intent, --assume-yes не отвечает на вопросы. @status:spec/done

[p11] @fact:NEXT-A03-U008 **Discovery/UI:** show choices --json — pure cached catalog query. Explicit fetch/prepare может наполнить cache, но не менять project. TTY wizard показывает default и effects; non-TTY/JSON/unattended никогда не prompt. Для первого unattended install default допустим лишь при явной consumer/CLI allow-defaults policy (D-004), иначе NeedsSelection. Explicit empty list — clear many; group omission — unspecified, не clear. Dormant branch selections сохраняются как intent, effects выключены; удаление dormant option всё равно диагностируется. @status:spec/done

[p12] @fact:NEXT-A03-U009 Guard DAG только positive same-package references, никаких OS/env/Git branch/network predicates. Новые transitive unresolved groups возвращаются структурным запросом input с exact definition; не строят бесконечный wizard/resolve loop. Повтор identical discovery state без нового input завершается needs-selection, не retries. @status:spec/done

[p13] @fact:NEXT-A03-U010 **Transaction:** complete request validation/solve/trust/collision/effect plan до project writes. Authored manifest, lock, owned materialized/boot outputs публикуются через recovery protocol с exact before-images и request/catalog preconditions. Multi-file filesystem operation не называется физически атомарной. Third-party hooks не rollbackable автоматически: их admission и intent предшествуют execution, partial failure reported. Старые dependencies, нужные другому root, сохраняются. @status:spec/done

[p14] @fact:NEXT-A03-U011 @status:spec/done

[p15] @fact:NEXT-A03-U012 **Redbook policy (accepted D-004/D-005/D-019):** continuity exactly-one, default multi-user-planning, WAL alternative; addons many и positive branch-local additions. Explicit unattended selection/allow-defaults обязателен, applied choices persist. Не добавлять symmetric global WAL/MUP conflicts: независимые package dependencies допускаются, группа отвечает только за выбор Redbook. Миграция root manual excludes/root dependencies сохраняет исходный смысл и shared dependencies; неоднозначность требует ответа. Current roster/choice change делается в existing 1.0.0. Все будущие версии Redbook допускают composition changes; перед будущей перезаписью агент предлагает new-version option. Это отдельное решение от разрешения publish batch, текущий no-bump выбор уже сделан. Reader capability/schema epoch защищает old 1.0.0 builds: min_vibe_version alone недостаточен при mutable product version. @status:spec/done

