Skip to content

Land Stage 0–2 investment plan enforcement#522

Merged
proboscis merged 1 commit into
mainfrom
issue/doeff-plan-stage02-landing/run-20260714-171618
Jul 14, 2026
Merged

Land Stage 0–2 investment plan enforcement#522
proboscis merged 1 commit into
mainfrom
issue/doeff-plan-stage02-landing/run-20260714-171618

Conversation

@proboscis

Copy link
Copy Markdown
Owner

概要

doeff-plan-stage02-landing の変更セット19ファイルを、maintainer 指揮セッションの main checkout working tree から内容を変えずに移植します。

  • ADR-DOE-HY-001: defk / do! / defp / deftest の statement 位置にある未束縛 Program / EffectBase を初回実行時に RuntimeError とする bind guard
  • ADR-DOE-ENFORCE-001 R4: 開発ビルドで VM conformance oracle (invariant-checks) を常時有効化し、pytest で hard-fail 検証
  • enforcement ledger と Semgrep baseline の等値 ratchet(既存46件は封じ込め。解消は別 issue)
  • 実行可能ADR 5本、docs/adr/conftest.py、capability classes 文書、投資計画本文
  • ci-wire-enforcement-layerf5f592cc)の一部を実装

参照: doeff-plan-stage02-landing

利用者への影響

Hyマクロ内で bare Program / EffectBase を statement として捨てる silent-passthrough が決定的に検出されます。また、make sync で構築した開発VMは invariant oracle を常時有効にし、enforcement資産の減少・未記帳増加とSemgrep違反数の変動をpytestゲートで検出します。

Verification

Issueの検証項目 出荷されたテスト / guard 実行コマンド 結果
変更範囲が指定19ファイルのみ file-scope gate(git status + 全19ファイルの cmp git status --porcelain | grep -v __pycache__、変更元との全件 cmp 修正6 + 新規13のみ。全19ファイルが変更元とバイト一致
VM oracle が開発ビルドで有効 tests/test_vm_invariant_checks_enabled.py::test_vm_built_with_invariant_checks make sync && .venv/bin/python -c "import doeff_vm; print(doeff_vm.invariant_checks_enabled())" exit 0、True
通常pytestゲート 既定testpaths全ノード(上記VMテストとledgerテストを含む) PYTHONPYCACHEPREFIX=$(mktemp -d) uv run pytest -m "not e2e and not slow" -q 1096 passed, 78 skipped, 11 deselected
追加enforcement 3ゲート tests/test_semgrep_gate.py::test_semgrep_findings_match_baseline_ratchet
tests/test_enforcement_ledger.py::test_enforcement_inventory_matches_ledger
tests/test_vm_invariant_checks_enabled.py::test_vm_built_with_invariant_checks
uv run pytest tests/test_semgrep_gate.py tests/test_enforcement_ledger.py tests/test_vm_invariant_checks_enabled.py -q 3 passed
実行可能ADR docs/adr/defadr_*.hy の全40ノード PYTHONPYCACHEPREFIX=$(mktemp -d) uv run pytest docs/adr -q 意図どおり 38 passed, 2 failed。失敗ノードは下記2件のみ
lint中断と再取り込み 変更対象Python 5ファイルの Ruff gate uv run ruff check docs/adr/conftest.py packages/doeff-vm/doeff_vm/__init__.py tests/test_enforcement_ledger.py tests/test_semgrep_gate.py tests/test_vm_invariant_checks_enabled.py 初回移植後の make lint で96件中、差分内に PLW1510 1件を検出して中断。maintainer が変更元へ check=False と理由コメントを追加後、この1ファイルだけ再取り込み。対象Ruffは All checks passed!。差分外の既存95件はout of scope

意図的な段階的 red

docs/adr の次の2件だけは、投資計画に記録済みの意図的redです。

  • docs/adr/defadr_doeff_enforce_001_pytest_canonical_gate.hy::test_adr_doe_enforce_001_docs_adr_in_default_testpathsdocs/adr の既定 testpaths 追加は計画 T-B1 まで保留
  • docs/adr/defadr_doeff_domain_001_vocabulary_cohesion.hy::test_adr_doe_domain_001_defdomain_existsdefdomain 実装は後続段階

Verification deviations

なし。上記2件のredは置換や弱化ではなく、issueと計画が要求する段階的redです。Semgrep既存違反46件の解消、testpaths flip、defdomain 実装は明示的にout of scopeです。

@proboscis
proboscis marked this pull request as ready for review July 14, 2026 08:39
@proboscis
proboscis merged commit a5dc3eb into main Jul 14, 2026
1 check 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.

1 participant