Repository navigation
Commit f9e4f04
committed
feat(d5): OWN051 + real optimistic silence — untrack a local at a may/unknown call (TZ D6)
d5 §5's optimistic default says an unverified-ownership call site resolves
to 'the caller no longer owns' -> silence. The implementation lowered
may/unknown contracts to a PLAIN arg instead — which is not silence: plain
leaves the obligation with the caller, so DROPPING a local after a
may-call fabricated OWN001. The channel predates D1 (conditional
forwards), but the D1 fix widened it to every null-guard dispose helper:
'var r = new X(); Cleanup(r);' — the normal usage, Cleanup IS the
disposer — read as a leak.
Untrack makes the default real: _unverified_transfer_calls collects every
arg at a may/unknown position of a summarized callee; such locals are not
minted at all (acquire / fresh result / alias target skipped, branch-hoist
excluded), so neither a missing nor a defensive dispose after the call can
be charged. A call with may/unknown positions routes through the existing
per-argument $consume/$borrow channel (the overload path, now shared) so
an untracked name is never referenced in emitted code — the first run's
loud OWN030 (map-or-raise doing its job) proved why. Verified contracts
are untouched: borrow-drop keeps its true OWN001 (T3) and consume-reuse
its OWN002 (T2), both pinned.
The gap is now honest instead of silent-or-wrong: advisory OWN051
('ownership transfer unverified — local not checked past this call') at
the call site, gated on args that actually carry an obligation (acquired
or fresh-factory locals — no noise for plain values), advisory like
OWN050/052: warning, SARIF note, never the exit code, hidden at
--verbosity quiet. explain OWN051 answers. Seven existing may-shape tests
updated from 'empty' to 'exactly one OWN051 advisory'; three new tests pin
the closed FP, the preserved T3 recall, and the owned-local gate.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBmDyLWHqoQUGqiydSxroi1 parent c6262c0 commit f9e4f04
6 files changed
Lines changed: 253 additions & 48 deletions
File tree
- docs/notes
- ownlang
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
| |||
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
229 | 253 | | |
230 | 254 | | |
231 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
333 | | - | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
155 | 168 | | |
156 | 169 | | |
157 | 170 | | |
| |||
0 commit comments