Skip to content

feat(analytical): PanelsBySolid source evidence record, rebound by SnapToJunctions (Q4) - #230

Merged
michaldengusiak merged 4 commits into
sow/2026-Q4from
feat/panelsbysolid-source-evidence-q4
Nov 4, 2026
Merged

michaldengusiak merged 4 commits into
sow/2026-Q4from
feat/panelsbysolid-source-evidence-q4

Conversation

@michaldengusiak

@michaldengusiak michaldengusiak commented Nov 3, 2026 •

Copy link
Copy Markdown

Draft for owner review. SAM producer half of design rev 5 (contact-aware void guard); the SAM_OCCT consumer is a separate PR (SAM-BIM/SAM_OCCT#89). Until both land nothing changes for users: no existing code reads the record.

What it does

  • PanelsBySolid stamps an optional, all-or-nothing SourceEvidence record on host panels (frame, guaranteed thickness, Support, Origin, BoundFootprint), only for closed, valid, layered prismatic solids (closure by edge pairing, positional metre-based classification, one section per layer, definite-result intersections). Any other solid gets no record, so behaviour is unchanged.
  • Panel saves, reloads and copies the record.
  • Query.ValidSourceEvidence accepts it only while its frame equals the panel's and the panel's footprint equals BoundFootprint, so a same-plane edit makes it stale.
  • Query.SnapToJunctions rebinds a record that is valid on the input panel to the snapped footprint and drops any other, so stale evidence cannot become valid again by snapping back to the bound footprint.
  • Owner-review fix (6eddd56d): panels and their copies share one record, and FromJsonObject was public. SourceEvidence is now immutable once constructed: IJSAMObject.FromJsonObject is explicit and always refuses; the JSON constructor is the only reader; returned regions and frame are copies.

Tested

  • Tested content SHA 6eddd56d98ac9f19f613481b923f0b90096f470b; final head 1aa1c3a227c49513ef3d85cb2eb203ba303dc7b9 (record-only docs commit on top). GitHub checks at this head (read from the logs): Release build, SPDX and Release SAM.Tests all passed, 4020/4020 (build, tests).
  • Local, Debug, dotnet test SAM/SAM.Tests/SAM.Tests.csproj --no-build: 4020 passed, 0 failed, 0 skipped (39 new in PanelsBySolidSourceEvidenceTests). Existing tests unchanged.
  • Fail-first: the overwrite-through-the-JSON-reader test fails on the previous SourceEvidence.cs; letting snapping carry a stale record fails the stale-then-snap test.
  • Earlier head aeafa38f, hosted (owner-reported): Release build and SPDX passed, Release SAM.Tests 4017/4017.
  • Not run: SAM.Core.Grasshopper.Tests, the Softthouse N0/N1/N2 chain and census.

Record: documentation/PanelsBySolid-SourceEvidence-Q4.md. Merge order: SAM first. Marked ready for review at 1aa1c3a2 after the owner verified the fix and the hosted checks. Not merged, not approved.

🤖 Generated with Claude Code

michaldengusiak and others added 2 commits November 3, 2026 21:41
…SnapToJunctions rebinds (Q4)

Producer half of the contact-aware void guard (design rev 5). A panel carries an
optional, all-or-nothing SourceEvidence record: the panel's frame at extraction, the
guaranteed slab thickness, the Support region where that slab is proved to be material,
the panel's Origin face, and the BoundFootprint the panel had when an evidence-aware SAM
tool last wrote it.

- Create.PanelsBySolid certifies material only for closed, valid, layered prismatic
  solids: closure by edge pairing, positional (metres, not angular) parallel/perpendicular
  classification, one section per layer, definite-result intersections. Anything else
  gets no record, so behaviour is unchanged.
- Panel saves and reloads the record; every copy of a panel carries it.
- Query.ValidSourceEvidence accepts a record only while its frame equals the panel's and
  the panel's footprint equals BoundFootprint, so a same-plane edit makes it stale.
- Query.SnapToJunctions rebinds only a record that is valid on the input panel, to the
  snapped footprint, and drops any other, so stale evidence cannot become valid by
  snapping back to the bound footprint.

The SAM_OCCT consumer is a separate change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
michaldengusiak and others added 2 commits November 4, 2026 10:45
Panels and their copies share one SourceEvidence instance, and its public
FromJsonObject could overwrite the certified thickness or support of all of
them without going through the rebinding check. FromJsonObject is now an
explicit interface implementation that always refuses; the JSON constructor
is the only reader. The regions and frame the record returns were already
copies.

Regression tests: overwriting a panel's record (and the one the validity
query returns, and a copy's) through the JSON reader changes neither the
panel nor its copy; regions and frame handed to a caller are copies; a
record is still read by Core.Create.IJSAMObject<SourceEvidence>.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@michaldengusiak
michaldengusiak marked this pull request as ready for review November 4, 2026 09:55
@michaldengusiak michaldengusiak changed the title feat(analytical): PanelsBySolid source evidence record, rebound by SnapToJunctions (Q4, draft) feat(analytical): PanelsBySolid source evidence record, rebound by SnapToJunctions (Q4) Nov 4, 2026
@michaldengusiak
michaldengusiak merged commit 3a029e3 into sow/2026-Q4 Nov 4, 2026
3 checks passed
@michaldengusiak
michaldengusiak deleted the feat/panelsbysolid-source-evidence-q4 branch November 4, 2026 10:06
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.

1 participant