Skip to content

Query filter: match civil Extended entities by their class name (R3.2) - #3389

Merged
HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
schoeller:fix/extended-type-filter
Nov 20, 2026
Merged

HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
schoeller:fix/extended-type-filter

Conversation

@schoeller

Copy link
Copy Markdown
Contributor

R3.2 — civil-aware querying: match Extended entities by their class name

Closes the R3.2 gap from the OCS parity requirements
(ocs-parity-requirements.md, row R3.2;
repro evidence: M2 artifact 2026-11-20T10-07_m2_ocs_roundtrip.json).

Repro (source-verified + artifact)

entity_type_matches (src/app/automation.rs:328-343) compared only
names::ui_name — "Extended Entity" for every civil/AEC entity — then
names::dxf_name, which returns the blacklisted placeholder "ENTITY" for
Extended variants, then the node-library names. An AECC entity's real class
identity (AECC_ALIGNMENT, AECC_COGO_POINT, …) never entered the
comparison, so ocs_query {"type":"AECC_ALIGNMENT"} matched nothing and
scripts had to fall back to where /data/Arch/dxf_name.

Fix

For EntityType::Extended, when the UI-name and dxf_name comparisons fail,
entity_type_matches additionally compares entity.class_name() (the class
record's dxf_name, e.g. AECC_ALIGNMENT, AECC_COGO_POINT) case-insensitively.
The "ENTITY" blacklist semantics are untouched; UI-name, native-type and
node-library matching are untouched.

Base: branch cut from current upstream main c0100157f ("fix(save): a read-only
session refuses every native write"); fork main f0374da43 was a snapshot 22
commits behind, with the acadrust pin moved to a7d3785 — this branch is rebased
and verified on the current pin. Overlap re-check vs upstream main and open PRs
(#3379/#3360/#3338/#3259): entity_type_matches unchanged upstream, no overlap.

Tests

Unit tests in type_name_tests (automation.rs), on the rebased branch
(cargo test --release type_name_tests): 3 passed / 0 failed

  • civil class names find Extended entities (Arch data, match / no-match, case-insensitivity)
  • UI-name matching and the "ENTITY" blacklist still behave; native types unaffected

Live verification (M2 recipe, BusBay example, authorized per D010)

Scratch copy of DE_Busbucht_2023.dwg (MD5 397f183a451459f39b19c0d839e77cba,
identical to the M2 source; original untouched), driven through MCP stdio on a
host booted from this branch's post-rebase cargo build --release exe
(base c0100157f, acadrust a7d3785) — numbers identical to the pre-rebase run:

filter before after
type=AECC_ALIGNMENT 0 6
type=AECC_COGO_POINT 0 5 (incl. M2 handle 202C515)
type=aecc_tin_surface 0 1 (case-insensitive)
type=Line / Line+layer 0 unchanged unchanged
type=Extended Entity unchanged unchanged
type=ENTITY 0 0 (still blacklisted)

Census on the same live document: 12,870 total / 722 Extended — exactly the
artifact 10-07 numbers; the change is query-only.

Census-passthrough statement

This PR touches only entity_type_matches (query filtering) and adds tests.
It cannot affect the save path: no entity, writer, or document code is
modified. The census invariants (12,870 total / 722 Extended / 585
AECC_COGO_POINT, dropped_on_save:0) are re-confirmed live above.

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.

2 participants