Skip to content

docs(causal): accept DESIGN-causal.md — typed causal hypothesis graphs (review-only)#367

Merged
rizumita merged 4 commits into
ymm-oss:mainfrom
imaimai17468:feat/issue-320-causal-design
Jul 19, 2026
Merged

docs(causal): accept DESIGN-causal.md — typed causal hypothesis graphs (review-only)#367
rizumita merged 4 commits into
ymm-oss:mainfrom
imaimai17468:feat/issue-320-causal-design

Conversation

@imaimai17468

Copy link
Copy Markdown
Contributor

Problem (issue #320)

Phases #321#323, #360, #364 of the causal profile all cite an accepted docs/DESIGN-causal.md as their sole design authority, but the normative content lived only in issue #320's body, with eight open decisions unresolved.

Change

Add docs/DESIGN-causal.md as the accepted design contract. It preserves #320's normative content — three-plane architecture, guarantee-boundary table, surface syntax + variable/claim field contracts, scope declaration & three-valued containment, claim content version & retired lifecycle, time semantics (lag/persists, Minkowski sums, unknown propagation, fail-closed clock mapping shared verbatim with #323), feedback semantics (instantaneous-loop error, polarity sign products, unknown absorption, loop_class witnesses, the narrow feedback_without_damping_story rule), typed CausalModel IR + invariants, JSON contracts, authority surface, and algorithm constraints — and resolves the eight open decisions (§10):

# Decision
1 standalone causal block is final; nested sugar not adopted
2 timebase = closed enum tick|hour|day|week; custom units rejected in v0
3 persists adopted (required claim field); no quantitative convolution
4 uses <alias> from "<path>" + alias-qualified 2-segment refs
5 undeclared positive-lag cycle = warning (matches #321's causal_unacknowledged_feedback); instantaneous loop stays error
6 evidence-artifact validation confined to Phase 2; Phase 1 never opens artifact files
7 causal schemas stay independent under schemas/fslc/causal/
8 moderated_by deferred — reserved, no v0 grammar

Also: docs/README.md design map row, CHANGELOG.md [Unreleased] entry.

Acceptance criteria mapping

  • feat(causal): causal check/analyzeとcausal-graph.v0を追加する #321 can start from this document alone: syntax, IR, diagnostics severity, JSON shapes, and algorithm constraints are all normative here.
  • "No changes to Public Kernel v1 / runtime / solver / verifier" is stated as a design invariant (§1, §9).
  • No output path attaches proved/verified to a causal claim (§1, §11 non-goals).
  • Scope three-valued judgment, polarity products/unknown absorption, and loop classification are normative with Phase 1 test obligations pinned (§12).
  • Claim version pinning + retired lifecycle guarantee old-version evidence never supports a current claim and refuted history is never lost (§4.5).
  • Clock-mapping fail-closed conditions are identical to feat(causal-expectation): 明示的な観測期待を既存kernel propertyへ限定loweringする #323's expectation-compiler gates (§5).

Notes

Closes #320

🤖 Generated with Claude Code

Promote issue ymm-oss#320's normative content into the accepted design contract
for the review-only causal profile, resolving all eight open decisions:

1. canonical syntax: standalone top-level causal block (business-nested
   sugar not adopted; revisitable only as pure sugar).
2. timebase: closed enum tick|hour|day|week; custom units rejected in v0.
3. persists: adopted as a required claim field (powers observation-window
   and cadence findings); no quantitative convolution.
4. imports: uses <alias> from "<path>" with alias-qualified two-segment
   reference paths.
5. undeclared positive-lag cycles: warning, not error; instantaneous
   loops stay errors.
6. per-property evidence dependency confined to Phase 2 (ymm-oss#322); Phase 1
   records references only and never opens artifact files.
7. causal schemas stay under schemas/fslc/causal/ — no Public Kernel v2
   merge without a separate accepted design.
8. moderated_by: deferred (reserved future work, no v0 grammar).

The design fixes: three-plane architecture, guarantee-boundary
vocabulary, scope-token declaration + three-valued containment
(subsumes / partial_overlap / disjoint), claim content version + retired
lifecycle, discrete time semantics (Minkowski lag sums, unknown
propagation, fail-closed clock mapping identical to ymm-oss#323's gates),
delayed-feedback polarity sign products with unknown absorption and
reinforcing/balancing/unknown loop_class, typed CausalModel IR
invariants, causal-check.v0 / finding / causal-graph.v0 JSON shapes, the
authority surface (runtime/solver/verifier/Public Kernel v1 untouched),
and Phase 1 test obligations.

Closes ymm-oss#320

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@rizumita rizumita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran an independent adversarial design review of the full 734-line docs/DESIGN-causal.md. Phase 1 (check/analyze/diff) is specified well enough that two implementers would converge — good work there. But given this doc is being accepted as the sole normative authority for a 5-phase implementation (PR #369 already ships all 4 phases against it), a few gaps matter enough to request changes before final acceptance:

  1. Claim-version/retired lifecycle (§4.5/§12) is honor-system. No content-digest pinning is specified, so a claim's content (e.g. polarity) can change without a version bump while old evidence keeps counting as current support. retired is never stated to be terminal — a claim could go retired → active again with stale evidence silently re-activating. "Re-proposing an already-refuted hypothesis is detectable" names no actual mechanism.
  2. Authority-scope mismatch for Phases 2–5. The evidence schema/lifecycle (#322), support-aggregation table, and observation bridge (#360) are deferred to bare issue references with almost no normative content here. The observation bridge in particular (production replay → evidence feeding causal_support) looks like exactly the "temporal co-occurrence becoming causal support" the doc's own §11 lists as a non-goal, with no stated constraint distinguishing the two. Similarly, the expectation compiler's leadsTo lowering (§3, real kernel-provable) has no output-shape contract for how a proved verdict on the lowered form should be labeled relative to the causal claim — exactly the seam where a reader could misattribute validated-causality semantics.
  3. confidence: 0.92 in the §8 JSON example has no defined semantics, contradicting the doc's own no-probability/fully-deterministic stance.
  4. basis: supported vs. the content-version contract: unclear whether derived support is version-relevant content or presentation-only — implementers could reasonably build either, and one choice is a version-integrity bug.
  5. Feedback-cycle classification with lag: unknown edges (§5×§6 seam) is undefined for a cycle with all-zero known lags plus an unknown-lag edge — could misclassify an instantaneous (physically impossible) loop as an allowed delayed one, or vice versa. (Note: I found this materialized as an actual bug in PR #369's implementation — rust/fsl-tools/src/causal.rs's validate_loops excludes Lag::Unknown from the zero-lag check, contradicting its own doc comment.)
  6. Evidence-side scope-dimension comparison (dimension present on one side, absent on the other) is unspecified.

Recommend either specifying sections for the #322/#360 contracts here, or explicitly scoping this doc's "sole authority" claim to Phase 1, plus tightening 1–4 above. Happy to re-review once addressed.

imaimai17468 added a commit to imaimai17468/fsl that referenced this pull request Jul 17, 2026
…e, authority, and lag:unknown

Review findings from @rizumita:

1. Claim version/retired lifecycle: content changes without version bumps
   are now detectable via causal diff; retired is terminal (no retired→active);
   re-proposal detection via source/target/polarity match with retired claims.
2. Authority scope: §1 now explicitly scopes normative authority per phase
   and clarifies that observation replay never converts temporal co-occurrence
   into directed support, and expectation verdicts label the kernel property
   not the causal claim.
3. confidence field: clarified as deterministic structural score, not a
   probability or Bayesian posterior.
4. basis: explicitly version-relevant content requiring a version bump.
5. lag:unknown in feedback cycles: documented as treated like lag.min==0
   (cannot prove positive delay); all-unknown cycles are instantaneous errors.
6. Missing scope dimensions: specified as unassessable per dimension; empty
   scope is never silently universal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@imaimai17468

Copy link
Copy Markdown
Contributor Author

@rizumita レビューありがとうございます。6件すべて対応しました(PR #369のブランチで修正、このPRにマージ時に反映されます)。

1. Claim version/retired lifecycle (§4.5)

  • content変更をversion bump無しで行った場合、causal diffcontent_changed_without_version_bumpとして検出
  • retiredはterminalと明記 — retired→active再遷移は不可、再提案には新IDが必要
  • 再提案検出: causal diffがretired claimと同じsource/target/polarityの新claimをretired_hypothesis_reproposedとして報告

2. Authority scope (§1)

  • §1にフェーズごとの規範的権威範囲を明記
  • observation bridge (§16) はtemporal co-occurrenceをdirected supportに変換しないことを明示
  • expectation verdict (§14) のラベルはkernel propertyに付き、causal claimには付かないことを明示

3. confidence: 0.92 (§8)

  • deterministic structural score(グラフ構造から計算)であり、確率・ベイズ事後分布・p値ではないことを明記

4. basis: supported (§4.5)

  • basisはversion-relevant contentと明示 — hypothesis↔assumption変更にはversion bumpが必要

5. lag: unknown in feedback cycles (§6)

6. Evidence scope missing dimension (§4.4)

  • 片方にしかない次元はunassessable、空scope(次元なし)は全体unassessableと明記
  • missing scopeをuniversalとして黙認しないことを明示

commit c6fc9ea docs(causal): address PR #367 review

imaimai17468 and others added 2 commits July 19, 2026 13:44
…e, authority, and lag:unknown

Review findings from @rizumita:

1. Claim version/retired lifecycle: content changes without version bumps
   are now detectable via causal diff; retired is terminal (no retired→active);
   re-proposal detection via source/target/polarity match with retired claims.
2. Authority scope: §1 now explicitly scopes normative authority per phase
   and clarifies that observation replay never converts temporal co-occurrence
   into directed support, and expectation verdicts label the kernel property
   not the causal claim.
3. confidence field: clarified as deterministic structural score, not a
   probability or Bayesian posterior.
4. basis: explicitly version-relevant content requiring a version bump.
5. lag:unknown in feedback cycles: documented as treated like lag.min==0
   (cannot prove positive delay); all-unknown cycles are instantaneous errors.
6. Missing scope dimensions: specified as unassessable per dimension; empty
   scope is never silently universal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@rizumita rizumita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

再レビュー済みです。指摘した authority scope、claim version/retired lifecycle、missing scope dimension、lag:unknown の契約が #367 自身へ反映され、最新 main との競合も解消されています。CI 5件すべて成功を確認しました。

@rizumita rizumita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新 main (#411) の取り込み後も差分と競合解消を再確認しました。承認を更新します。

@rizumita
rizumita merged commit 97f5305 into ymm-oss:main Jul 19, 2026
5 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.

design(causal): typed CausalModel、時間意味論、evidence境界、JSON契約を固定する

2 participants