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
feat(semantic-facts): split effects confidence into event/target (P3a)
Executes P3a of docs/plans/2026-08-08-derived-artifact-hardening-execution-plan.md.
symbol_effects.confidence is split into event_confidence (certainty an
effect happened -- always "exact" in v1, every extraction site fires only
on a real syntactic raise/throw/write node) and target_confidence ("exact"
| "none" -- certainty about what the target is). This recovers 3 Python
throw facts the pre-P3 code silently dropped instead of recording with
degraded confidence:
- `raise e` (bound exception variable, PEP-8 casing heuristic can't
resolve it to a type)
- `raise factory()` (lowercase call, syntactically identical to
`raise SomeException()`)
- bare `raise` (re-raise) -- previously had no target text at all
structurally, so was skipped entirely rather than recorded
Java/TS/JS throw detection is untouched: those require a real
object_creation_expression/new_expression constructor node structurally,
so they're always target_confidence="exact" when they fire at all -- the
PEP-8 casing uncertainty is Python-specific (verified by reading
detect_java_throw/detect_tsjs_throw before assuming a blanket classifier
would be correct).
- schema.rs: symbol_effects gains event_confidence/target_confidence
columns (fresh-install CREATE TABLE + migrate_add_column for existing
installs; old confidence column left in place on upgraded DBs, matching
every other migration in run_migrations).
- SOURCE_EXTRACTION_VERSION bumped 1->2 -- the first live exercise of the
P1 drift-guard mechanism: it correctly failed first (hash mismatch) on
this exact change, then passed once the expected hash was updated
alongside the version bump.
- Confidence classification lives in walk_effects (language+kind aware),
not inside each per-language detect_* function -- keeps all 7 existing
detectors' signatures untouched.
- New symbol_info_surfaces_effect_confidence_split end-to-end test;
understand_surfaces_architecture_digest_and_t1_facts and P1's
derived_artifact_versions.rs updated for the schema/output change.
Deliberately deferred, not attempted: detect_go_write (P3b). Needs the
enclosing method's receiver PARAMETER NAME tracked through walk_effects's
recursive traversal (Go's receiver is a plain identifier, not a keyword
like Rust's self, so it can collide with an unrelated same-named local in
a different function) -- real design work the module's own doc comment
already flags as not wired. Left as its own future slice rather than
rushed alongside this phase.
Verified: full `cargo test --workspace --features embeddings` green (1054
calm-core + 367 calm-server + all other packages, 0 failures), clippy -D
warnings clean, rustfmt clean, locate/symbol_info/understand toolsnaps
regenerated.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: crates/calm-server/src/__toolsnaps__/locate.snap
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -347,12 +347,22 @@
347
347
"line": {
348
348
"type": "integer",
349
349
"format": "int64"
350
+
},
351
+
"event_confidence": {
352
+
"description": "P3 (docs/plans/2026-08-08-derived-artifact-hardening-execution-plan.md):\ncertainty THAT the effect happened -- currently always `\"exact\"`\n(every extraction site fires only on a real syntactic raise/throw/\nwrite node); kept as its own field for forward compatibility rather\nthan folded into `target_confidence`, which is a DIFFERENT question\n(certainty about WHAT the target is).",
353
+
"type": "string"
354
+
},
355
+
"target_confidence": {
356
+
"description": "`\"exact\"` | `\"none\"` -- certainty about what `target_text` names.\n`\"none\"` means the effect definitely happened but the exact target\ncouldn't be determined syntactically (e.g. Python `raise e` where\n`e` is a caught-exception variable, not a resolvable type) -- the\ntext is still the real syntax that was there, just not resolved.",
Copy file name to clipboardExpand all lines: crates/calm-server/src/__toolsnaps__/symbol_info.snap
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -231,12 +231,22 @@
231
231
"line": {
232
232
"type": "integer",
233
233
"format": "int64"
234
+
},
235
+
"event_confidence": {
236
+
"description": "P3 (docs/plans/2026-08-08-derived-artifact-hardening-execution-plan.md):\ncertainty THAT the effect happened -- currently always `\"exact\"`\n(every extraction site fires only on a real syntactic raise/throw/\nwrite node); kept as its own field for forward compatibility rather\nthan folded into `target_confidence`, which is a DIFFERENT question\n(certainty about WHAT the target is).",
237
+
"type": "string"
238
+
},
239
+
"target_confidence": {
240
+
"description": "`\"exact\"` | `\"none\"` -- certainty about what `target_text` names.\n`\"none\"` means the effect definitely happened but the exact target\ncouldn't be determined syntactically (e.g. Python `raise e` where\n`e` is a caught-exception variable, not a resolvable type) -- the\ntext is still the real syntax that was there, just not resolved.",
Copy file name to clipboardExpand all lines: crates/calm-server/src/__toolsnaps__/understand.snap
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -277,12 +277,22 @@
277
277
"line": {
278
278
"type": "integer",
279
279
"format": "int64"
280
+
},
281
+
"event_confidence": {
282
+
"description": "P3 (docs/plans/2026-08-08-derived-artifact-hardening-execution-plan.md):\ncertainty THAT the effect happened -- currently always `\"exact\"`\n(every extraction site fires only on a real syntactic raise/throw/\nwrite node); kept as its own field for forward compatibility rather\nthan folded into `target_confidence`, which is a DIFFERENT question\n(certainty about WHAT the target is).",
283
+
"type": "string"
284
+
},
285
+
"target_confidence": {
286
+
"description": "`\"exact\"` | `\"none\"` -- certainty about what `target_text` names.\n`\"none\"` means the effect definitely happened but the exact target\ncouldn't be determined syntactically (e.g. Python `raise e` where\n`e` is a caught-exception variable, not a resolvable type) -- the\ntext is still the real syntax that was there, just not resolved.",
0 commit comments