Repository navigation
feat: M3-07 decode confidence and provenance on every element - #150
Conversation
Add ElementProvenance to DecodedElement with production scores for schema/typed/partition paths. Surface via rvt-elements, Python, viewer File Status, and JSON schemas; hide below 0.55 in default IFC export. Co-authored-by: DrunkOnJava <[email protected]>
Co-authored-by: DrunkOnJava <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5746c13. Configure here.
| class: class.name.clone(), | ||
| fields, | ||
| byte_range: start..cursor, | ||
| provenance: ElementProvenance::schema_generic("schema", start, &class.name), |
There was a problem hiding this comment.
Generic provenance uses fake stream
Medium Severity
Generic decode_instance provenance sets source_stream to schema, which is not an OLE stream. Production iter_elements reads instance bytes from Global/Latest, and the typed branch records that path, but the non-MVP branch leaves the placeholder. CLI and Python provenance therefore point callers at a stream that does not exist for most schema-walked elements.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 5746c13. Configure here.
## Summary - Add `ElementProvenance` to every `DecodedElement` (stream, offset, record kind, decoder, confidence, missing fields, warnings). - Production paths set honest scores (typed MVP ~0.9, ArcWall 0.85–0.95, partition MVP 0.55–0.75, generic schema 0.55). - Surface via `rvt-elements` / Python `decoded_elements()` / viewer File Status **Provenance** row + JSON schemas. - Default IFC emission hides elements below `DEFAULT_MIN_ELEMENT_CONFIDENCE` (0.55); CLI `--min-confidence` filter. Closes #28. ## Test plan - [x] `cargo test --lib element_provenance_defaults_and_filters` - [x] `cargo test --test json_schema_contracts` - [x] `cargo clippy --lib --bins -- -D warnings` - [x] `viewer` `tsc --noEmit` --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: DrunkOnJava <[email protected]>


Summary
ElementProvenanceto everyDecodedElement(stream, offset, record kind, decoder, confidence, missing fields, warnings).rvt-elements/ Pythondecoded_elements()/ viewer File Status Provenance row + JSON schemas.DEFAULT_MIN_ELEMENT_CONFIDENCE(0.55); CLI--min-confidencefilter.Closes #28.
Test plan
cargo test --lib element_provenance_defaults_and_filterscargo test --test json_schema_contractscargo clippy --lib --bins -- -D warningsviewertsc --noEmitNote
Medium Risk
Changes default IFC export and JSON contracts (required
provenance), so downstream consumers may see fewer exported elements or need schema updates; confidence scoring is heuristic and could hide or retain the wrong rows if thresholds are mis-tuned.Overview
Implements M3-07 by attaching
ElementProvenance(source stream/offset, record kind, decoder, confidence, missing fields, warnings) to everyDecodedElement, and threading it through CLI, Python, JSON schemas, IFC export, and the viewer.Production decoders now set explicit scores: typed MVP ~0.9, generic schema instances 0.55, ArcWall 0.85–0.95, and partition MVP recoveries (Level, Material, Room, floor loops, rect openings) in the 0.55–0.75 range with optional warning strings.
Consumers:
rvt-elementsgains--min-confidence(default 0 = show all); each element JSON includesprovenance. Pythondecoded_elements()mirrors that shape.decoded-elements.schema.jsonrequiresprovenance; export diagnostics add mean confidence, below-min count, andmin_element_confidence(0.55). Default IFC emission drops elements belowDEFAULT_MIN_ELEMENT_CONFIDENCE(0.55) and recordsbelow_min_element_confidencein skipped export items. The viewer File Status adds a Provenance row (mean %, hide floor, count below threshold).Docs mark M3-07 done;
.gitignoreadds_project_corpus/. Widespread testDecodedElementfixtures useprovenance: Default::default().Reviewed by Cursor Bugbot for commit 5746c13. Configure here.