Skip to content

feat(owen-ext): Owen extension substrate — Owen.Build host + Owen.TypedBuilder (OX-01) - #397

Merged
PhysShell merged 5 commits into
mainfrom
ccr-d3ed89e2-vnl6fk
Oct 3, 2026
Merged

PhysShell merged 5 commits into
mainfrom
ccr-d3ed89e2-vnl6fk

Conversation

@PhysShell

Copy link
Copy Markdown
Owner

Что и зачем

OX-01: Typed Builder превращается из сэмпла в монорепе в extension #1 для Owen Alpha на общем, generic extension substrate.

dotnet new web -n OrderBackend
dotnet add package Owen.TypedBuilder --version 0.1.0
dotnet build

После одной PackageReference, без Python, Rust toolchain, глобального owen и checkout'а:

  • typed API генерируется Roslyn incremental generator'ом в каждой компиляции;
  • draft.Approve(...) → CS1061;
  • draft.Submit(now); draft.Submit(now); → …\C8_stale_draft.cs(18): warning|error OWN002: … прямо в dotnet build и в Error List. По умолчанию это warning, с OwenSeverity=error — error;
  • obj/owen/extensions.json перечисляет активные extensions.

Что добавлено

пакет роль
Owen.Build generic host; extensions не знает
Owen.TypedBuilder extension #1
Owen.TestExtension синтетический, только для gate, не shipping
  • Owen.Build запакован из того же owen (publish-closure OwnSharp.Cli): bundled extractor, rust-core/<platform>/own-cli, без Python-ядра. Плюс build/ и buildTransitive/ targets.
  • Отдельный host-пакет нужен, потому что tool-пакет нельзя подключить PackageReference (NU1212, проверено), а engine должен быть один на все extensions.
  • owen build-check — новая подкоманда того же owen:
    • валидирует дескрипторы (OWENB001–005);
    • пишет манифест;
    • отдаёт extractor'у сгенерированный extension'ами C#;
    • один раз гоняет Rust core с --format msbuild;
    • отказы extractor'а и ядра превращает в навигируемые OWENB010 и OWENB011.
  • Генератор использует тот же TypedBuilderCore.cs, что и CLI. Вывод = #nullable enable + golden, байт-в-байт.
  • OwenRustCore.props — единый список платформ для Owen.Cli и Owen.Build.
  • Контракт: spec/OwenExtension.md + JSON schema.

Доставка генератора: вариант A (incremental generator). Выбран по замеру: вариант B (MSBuild pre-compile) отсутствует в design-time build, на котором работает IntelliSense.

Отчёты и исследования

  • Snipper audit (COPY/ADAPT/REJECT): docs/notes/owen-extension-snipper-salvage.md.
  • Модель диагностик уже есть (own_bridge::Finding): docs/notes/owen-diagnostics-model.md.
  • IDE, docs/notes/owen-extension-ide-feasibility.md:
    • E1 (VSIX): NOT EXECUTED — здесь нет Windows и Visual Studio. Спайк описан, оба блокера названы;
    • E2 (native Roslyn analyzer): REJECT — измерено на Linux; спайк в experiments/, вне shipping и CI.

Preregistration (до кода): docs/notes/owen-extension-alpha-preregistration.md, включая Amendment 1, закоммиченный до официального прогона. Отчёт и вердикт: docs/notes/owen-extension-alpha-report.md — GO_OWEN_EXTENSION_ALPHA.

Фундамент не тронут. git diff 88cb8cc3..HEAD -- ownlang rust spec/OwnIR.md spec/Bridge.md spec/ownir.schema.json frontend/roslyn/OwnSharp.Extractor docs/evidence/calibration scripts/perf_baseline.py пуст.

Тип изменения

  • feat — новая возможность
  • fix — исправление бага
  • docs — документация
  • refactor / chore / test / ci — без изменения поведения

Как проверено

  • python tests/run_tests.py. Локально падают два stage-1 контроля на owen-поверхности, только когда лаунчер собран; лаунчер с базового 88cb8cc3 падает так же. Это существующее поведение, на сервере они зелёные.
  • ruff check ., mypy, cargo fmt/clippy/test
  • typed_builder_gate.py --rust, protocol_gate.py --rust, heap_effects_gate.py — 0 failures
  • scripts/owen_extension_gate.py — изолированный consumer вне checkout. На PATH только dotnet и системный shell; python, cargo, rustc, owen отсутствуют:
    • A–E: генерация, CS, OWN, абсолютные координаты, отсутствие toolchain-утечек;
    • F: весь TB-MVP корпус через пакет, 30/30;
    • G: TB-MVP acceptance, 44/44, transcript байт-в-байт;
    • H: второй extension;
    • M1a/M1b/M2–M5/M7: мутации проверены, всё падает громко.
    • Итог: 55/55 — локально из чистого worktree и в server CI на Linux и Windows.
  • Server CI на 48c71e6: 36/36.
  • Payload Owen.Cli против базы: тот же список файлов, все не-сборочные файлы байт-в-байт.

Связанные issue

Refs #391 (TB-MVP-01). Ограничения, которые этот PR не трогает: #392, #393, #394, #395, #396.

Чеклист

  • изменение покрыто тестом/селфтестом (или объяснено, почему нет)
  • README/docs обновлены при необходимости
  • коммиты в conventional-commit стиле (feat:, fix:, docs: …)

🤖 Generated with Claude Code

https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL


Generated by Claude Code

claude added 5 commits October 3, 2026 19:10
…8cb8cc)

Registers the Owen extension substrate slice before any code: kill-first
findings (owen check is already the generic pipeline; explicit generated
inputs reach the extractor; incremental generator matches the golden while
an MSBuild pre-compile step is absent from design-time builds; a tool package
cannot be PackageReference'd, NU1212), the Owen.Build host + Owen.TypedBuilder
extension packages, the descriptor contract and its OWENB codes, platforms,
isolated-consumer acceptance A-H, mutations M1-M7 and the verdict.

The Snipper audit (read-only, PhysShell/snipper@43b395a) records
COPY/ADAPT/REJECT per mechanism.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
Implements docs/notes/owen-extension-alpha-preregistration.md (with its
Amendment 1, committed here before any official run):

- Owen.Build: the generic build host package. Packs the OwnSharp.Cli publish
  closure (the owen program, bundled extractor, rust-core/<platform>) minus
  the Python core, plus build/buildTransitive targets that run
  'owen build-check' after every build.
- owen build-check: validates extension descriptors (OWENB001-005), writes
  obj/owen/extensions.json, scans the project plus the declared generators'
  output, runs the Rust core once with --format msbuild, and turns
  extractor/core refusals into navigable OWENB010/011 errors. It names no
  extension.
- Owen.TypedBuilder: the Typed Builder as a Roslyn incremental generator
  over the SAME model/renderer as the CLI (TypedBuilderCore.cs, shared), plus
  the extension descriptor; output = '#nullable enable' + the golden.
- OwenRustCore.props: the one platform inventory, used by Owen.Cli and
  Owen.Build.
- spec/OwenExtension.md + schema; scripts/owen_extension_gate.py (isolated
  consumer A-H, mutations M1-M7) and the Linux/Windows CI job; a synthetic
  second extension under tests/owen-extensions.

No change under ownlang/, rust/, the extractor, OwnIR spec, T0 or calibration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
On windows-latest the checkout is on D: and the temp directory on C:, and
os.path.commonpath raises on paths from two drives. Two drives means the
consumer is certainly outside the checkout. Gate mechanics only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
…alpha readiness

- owen-diagnostics-model.md (P8): the model already exists
  (own_bridge::Finding -> render_finding/build_sarif); no new layer.
- owen-extension-ide-feasibility.md (P9/P10): E1 generic VSIX host NOT
  EXECUTED here (no Windows/VS), specified with its two blockers; E2 native
  Roslyn analyzer REJECT, measured on Linux (shadow copy defeats native
  resolution; only an explicit path via reflection-reached NativeLibrary
  works, .NET hosts only; the extractor cannot run inside an analyzer).
- experiments/owen-e2-native-analyzer: the E2 spike (outside shipping and CI).
- alpha-readiness.md: the PackageReference install path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
Official runs (local clean worktree 55/55; server CI Linux and Windows 55/55
each on 48c71e6, the first Windows run failing on a gate path bug fixed in
89bdb86), counts, mutations, kept TB-MVP guarantees, foundation diff,
Owen.Cli payload, Snipper/diagnostics/IDE summaries and findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ZFvhLx1fM9Gerg4dKsZcL
@PhysShell
PhysShell merged commit e889f8b into main Oct 3, 2026
82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants