You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fc9b7a2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ownir): fail-loud on unknown resource kind + spec the effects block
Review follow-ups on PR #172.
- CodeRabbit (Major): a present-but-unknown resource kind fell through the §4
routing to the owned/subscription path and was mis-classified -- the same
silent-misroute that N1 fixes for flow ops. load() now rejects a
present-but-unknown "resource" against the known-kinds set
(_KNOWN_RESOURCE_KINDS); an ABSENT field still defaults to "subscription"
(additive). So a new kind is a vocabulary change that must bump OWNIR_VERSION
-- spec/OwnIR.md section 2 table + IR3/IR4 updated, docstring corrected
(field-vs-value). Pinned by two test_ownir checks (unknown kind raises; absent
defaults). 213/213.
- Codex (P2): the top-level "effects" block (OwnTS emits it, effects.py consumes
it -> EFF001) was missing from the spec envelope -- generating types from the
spec would drop/reject effect facts. Added to section 1 and a new section 7
documenting its shape (io/line/deps/bindings); Rules/Conformance renumbered;
conformance updated.
- Register section 2: correct the now-inaccurate "unknown kinds coerce to
subscription" note to the closed-enum-for-present-values reality.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJSfUpRbRXegrwJNV1rx1X
`ownir_version` (int) and `module` (string) are required; `components`,
31
-
`functions`, and `services` are each optional and default to empty.`load()`
32
-
([`ownir.py`](../ownlang/ownir.py)) validates the shape and raises`OwnIRError`
33
-
(a `ValueError`) with an actionable message on any violation — types, the
34
-
`bool`-is-`int` trap, empty identity strings, and unknown DI lifetime enums are
35
-
all rejected at load, before any analysis.
32
+
`functions`, `services`, and `effects` are each optional and default to empty.
33
+
`load()` ([`ownir.py`](../ownlang/ownir.py)) validates the shape and raises
34
+
`OwnIRError`(a `ValueError`) with an actionable message on any violation — types,
35
+
the `bool`-is-`int` trap, empty identity strings, unknown DI lifetime enums, and
36
+
a present-but-unknown resource kind are all rejected at load, before any analysis.
36
37
37
38
## 2. Versioning and the evolution policy (normative)
38
39
@@ -48,20 +49,29 @@ What bumps the version — the rule that keeps the three producers honest:
48
49
49
50
| Change | Bumps `OWNIR_VERSION`? |
50
51
|---|---|
51
-
| Add an **optional** field with a safe default (e.g. `resource`, `type`, `source_type`) |**No** — an older core reads the record without it (see §4). |
52
-
| Add a new **resource kind** discriminator value (§4) |**No** — unknown kinds coerce to `subscription` by design; additive. |
52
+
| Add an **optional** field with a safe default (e.g. `type`, `source_type`) |**No** — an older core reads the record without it (see §4). |
53
+
| Add a new **resource kind** discriminator value (§4) |**Yes** — the kind selects the analysis path (§4 routing), so it is a vocabulary change, not additive metadata; a present-but-unknown kind is rejected at load. |
53
54
| Add, rename, remove, or change the meaning of a **flow op** (§5) |**Yes** — vocabulary change (see the guard below). |
54
55
| Remove or rename a required field, or change a field's semantics |**Yes** — not backward-readable. |
55
56
56
-
**Fail-loud guarantee (unknown flow op).** The flow lowerer (`_lower_flow`)
57
-
handles exactly the ops in [§5](#5-flow-bodies-functions). Encountering any other
58
-
op raises `OwnIRError` — it is **never** silently skipped, because skipping a
59
-
compound op would drop the acquire/release facts nested inside it and flip
60
-
verdicts (a fabricated leak from a lost release, or a hidden leak from a lost
61
-
acquire) while every existing fixture still passes. A newer extractor that emits
62
-
a new op against an un-bumped core therefore fails the run instead of
63
-
mis-analyzing it. This is why a new op **must** bump `OWNIR_VERSION` per the
64
-
table above.
57
+
**Fail-loud guarantee (unknown vocabulary).** Two discriminators select an
58
+
analysis path and so must never be silently mis-read:
59
+
60
+
-**Flow op (§5).** The flow lowerer (`_lower_flow`) handles exactly the ops in
61
+
[§5](#5-flow-bodies-functions); any other op raises `OwnIRError` — never a
62
+
silent skip, because skipping a compound op would drop the acquire/release facts
63
+
nested inside it and flip verdicts (a fabricated leak from a lost release, or a
64
+
hidden leak from a lost acquire) while every existing fixture still passes.
65
+
-**Resource kind (§4).** A `resource` value the core does not know changes
66
+
routing (`capture` → the region engine, `pool` → a pooled buffer, …), so a
67
+
present-but-unknown kind raises at load rather than falling through to the
68
+
`subscription` path and mis-classifying the fact. An **absent**`resource`
69
+
field still defaults to `subscription` — that is the old-extractor-predates-the-
70
+
field case, and adding the field is genuinely additive.
71
+
72
+
A newer extractor that introduces either against an un-bumped core therefore fails
73
+
the run instead of mis-analyzing it — which is why both **must** bump
74
+
`OWNIR_VERSION` per the table above.
65
75
66
76
## 3. What OwnIR is not
67
77
@@ -144,32 +154,57 @@ source proven to outlive the subscriber escalates its OWN001 warning to **OWN014
144
154
(a proven captive/region escape); a co-lifetimed-or-shorter source is refuted and
145
155
silent; an unresolved `source_type` stays the honest OWN001 warning.
146
156
147
-
## 7. Rules
157
+
## 7. Reactive effects (`effects[]`)
158
+
159
+
An optional top-level array feeding the **EFF001** effect-storm check (P-020, the
160
+
OwnTS `Own.React` profile) — a separate core analysis
161
+
([`ownlang/effects.py`](../ownlang/effects.py)) over an effect's dependency array
162
+
and the stability of the render-scope values it closes over:
0 commit comments