feat(selector): 增加离线候选遍历与严格回放验证 Demo

- 新增 selector_candidate_demo,移除 provenance intent 后枚举候选 selector
- 对候选分支执行有界重建与严格 STEP 比较
- 仅在候选遍历完整且唯一 strict 通过时生成 selector 映射记录
- 增加 selector 候选搜索、预算限制和记录生成的测试
- 保持生产 selector resolver 不受 Demo 逻辑影响
- 更新 CADFS 能力台账,记录 IMPRINT 派生 profile 的 lineage selector 缺口
This commit is contained in:
2026-09-10 15:12:57 +08:00
parent d8fc2a9207
commit 994d06aaea
36 changed files with 9268 additions and 753 deletions
+346 -13
View File
@@ -202,6 +202,18 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
strict 仍因 max/p99 surface `0.01 mm` 与体积/面积阈值失败而保留为诊断。单元测试还覆盖
copy、boolean、pattern 与 delete 均清空 lineage;没有能唯一表示的 nested source-member
chain 仍属未完成 contract,继续保留明确诊断。
`SWEPT_BODY@1511` 另有一条不能与上述 successor lineage 混同的即时终止 contract:只有
singleton `qUnion([makeQuery(..., SWEPT_BODY, EntityType.BODY)])` 引用紧邻前序独立、无 draft、
`new_body` blind prism,且其 producer body record 仍唯一 active 时,单侧 `up_to_body` 才能
以 `active_body_member` / `direct_new_body` 解析该 record。resolver 以 producer identity 与
active-member lifecycle 证明 `body_member`,不读 stable ID、binding ID、几何、aggregate 或
current body。`00694309` F3 是正向 body-member evidence;该样本的 F4 strict/RP pass 由下述
独立 `CAP_EDGE` continuation contract 证明,而非放宽 body-member 规则。later successor、`ADD`、cut、
revolve、sweep、`COPY`、boolean/pattern/delete、多 body/multiple-query 和其它 FeatureScript
version 都不属于这个 contract。fresh `output/core-17-swept-body-up-to-body-member-20260910` 的
`tier=all` pipeline/RP run 完成 17/17,分类为 1 `comparison_timeout`、10 `rebuild_failed`、
1 `rebuilt_approximate`、5 `rebuilt_rejected`;它只证明本窄 selector contract 未改变核心集
的既有分类,不能标记 general `SWEPT_BODY` 或 `up_to_body` 完成。
2. 在 adapter 层记录每次建模操作的 `preserved`、`modified`、`generated`、`deleted`
topology delta 及 CAP/SWEPT/boolean 等输出角色;runtime 以该记录完成后继 selector
绑定,不以“当前形状中最相近元素”猜测。当前增量已覆盖 OCC 刚体
@@ -232,7 +244,13 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
sweep/loft direct-builder cap role;registry 只会在
relation 的唯一 result snapshot 上写入 `TopologyRecord.output_roles`,resolver 要求
owner、active body snapshot 与唯一 role 命中,并拒绝 stable ID、geometry、snapshot ID
混用。CADFS lowering 现对独立 `new_body` blind prism 的 CAP_FACE,以及满足全部条件的
混用。`extrude_add_blind`/`extrude_cut_blind` 的
`params.end_condition.reference` 与 `shell` 的 `feature.selectors` 各有一个有界 direct-cap
contract:仅紧邻前序、`result_mode: new_body`、blind extrusion 的 `extrude.start`/
`extrude.end` 可作为 `up_to_surface` reference 或 shell removal face,且必须由该 producer 的
完整/已证明 cap role 解析;schema、semantic preflight 与 runtime 同时拒绝非紧邻 producer、
其它 role、stable ID、binding ID 和 geometry fallback。CADFS lowering 现对独立 `new_body`
blind prism 的 CAP_FACE,以及满足全部条件的
`LocOpe_DPrism` drafted extrusion 生成该 contract:单一闭合外环、无内环、单向 blind
extent,且拉伸方向与实际端盖法向同向。`extrude_from_face` 直接拉伸该 B-rep 面,不能把
CAP_FACE 还原为原始草图。registry 只会让唯一 OCC `modified`/`preserved` relation 跨
@@ -244,8 +262,99 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
RP 通过(bbox delta `0.0008 mm`、体积相对误差 `0.00020848`、面积相对误差
`0.00021742`)。`00268467` 的 drafted 内环则明确保留 capability diagnostic 和可执行
前缀,不伪造可绑定 selector。
3. 建立统一 selector resolver:owner body、source feature、output role、几何签名、
snapshot 和唯一性证明。找不到或多解必须稳定诊断。
`TopologyDeltaRelation` 还必须显式记录 `source_kind` 与 `result_kind`,禁止把 face、edge
或其它 subshape 的 relation 混作同一种后继。每个 `TopologyDelta` 必须随操作输出 input/
output snapshot、body member 和 history 状态证据;当前 contract 的状态为 `proven`、
`partial`、`unknown` 或 `rejected`,并可带原因。只有完整、可追溯的 kernel relation 才能
进入 lineage;`IsDeleted` 不等于存在 replacement,缺失的 `IsDeleted` 也不等于 deleted。
boolean 的 section edge 可以作为 builder 生成事实记录,但没有 source-face 的精确 relation
时不得被提升为 source-qualified lineage。当前 `INTERSECT@1511` 仅有一个受限 consumer:
explicit `boolean_bodies` 的单一 target/tool subtract/intersect 中,两个 direct-prism
`CAP_FACE`/`SWEPT_FACE` input 必须分别由 OCC `Generated(face)` 返回同一 `SectionEdges()`
edge,且三个 handle 都以 `IsSame` 绑定 input/final snapshot;resolver 再要求唯一 relation、
`intersection`/`one` policy 和 active result member。另有一条同样受限的 primary `REMOVE` 路径:
immediate `extrude_cut_blind` 只可在一个 active target solid/member、一个 direct-prism tool、完整
source anchor/history 且 source query 没有未核实 disambiguation 时注册 `transient:<feature>` tool
snapshot;它仅作紧随 cut 的 source-qualified section 历史输入,永不成为 active/selectable topology。
普通 `SectionEdges()`、多输出、keep-tools、多 member、COPY/transform/pattern/TDD/IMPRINT/non-prism、
primary query 的未核实 `disambiguationData` inputs 均不执行。
这不构成通用 INTERSECT coverage,真实语料 RP 矩阵仍待补齐。这些记录是通用 topology 事实,不是由 stable ID
或最终几何相似性反推的替代品。
3. 建立统一 selector resolver,并让 runtime 与诊断性的 prefix binder 共用
`TopologyRegistry.resolve` 及已导出的 topology facts。resolver 按“语义 source -> kernel
lineage -> derivation policy/cardinality -> active body member”顺序绑定,报告实际分支使用的
`resolution_mode` 和 evidence,而不是从 selector 字段事后推断模式。stable ID 只可定位
source,不能直接在 active record 上成功;owner、output role 或 geometry 也不能绕过完整
lineage、允许的 derivation policy、operation-wide cardinality 与 active-body 证明。
`none`、`source_qualified`、`one` 与 `all_fragments` 都必须有明确、可审计的语义:merge 即使
最终只有一个 result 仍按 N:1 检查,`all_fragments` 遇到任一分支缺失或 partial 必须拒绝。
resolver 失败不得自动改走 legacy 成功路径;只有已文档化的 legacy explicit-geometry selector
可保留 geometry fallback,provenance/COPY instance selector 不得回退到几何相近、current body
或普通 context selector。找不到、多解、历史不完整、版本不支持和 policy/cardinality 不满足
都必须稳定诊断并保留可执行前缀。
`selector_intent.version` 是唯一 canonical intent version;顶层
`selector_intent_version` 仅为兼容字段,存在时必须一致。schema 可接收只有
`selector_intent` 的语义 selector,并将 FeatureScript 标准库路径、精确 import version、全部 direct
import 列表与 source language version 元数据和 runtime ID 分离保存。lowering 不得为缺失 source
version 虚构 `"0"`;resolver 应返回 `selector_query_version_unknown`。query family/language
version/direct standard-library revision 通过显式 allow-list 注册,不得从 `15xx` 数字前缀、相同 import
path 或单一样本推断兼容性。当前
`FEATURESCRIPT_QUERY_CAPABILITY_MATRIX.md` 将 FeatureScript `1511` 的受限
`CAP_FACE`、`OFFSET_FACE` 以及 direct-prism `SWEPT_FACE`/`SWEPT_EDGE` contract 标为
端到端可执行。后两者只适用于紧邻独立、无 draft、`new_body` blind prism 的 consumer:
adapter 必须保留 direct source-profile edge/vertex construction handle,并分别由
`BRepPrimAPI_MakePrism.Generated(edge)` 的 edge -> side-face 或
`Generated(vertex)` 的 vertex -> vertical-edge relation 完整证明;resolver 再检查
`boundary` policy、source qualification 和 active member。`00111611` F3、`00974931` F2、
`00594348` F2 和 `00000715` F3 是这些受限路径的真实语料证据。`SWEPT_EDGE` 的 direct
profile contract 现还接受一个 analytic contour region 的 hole wires:adapter 将外环和全部内环一次
交给 `BRepBuilderAPI_MakeFace`,只在 source edge/vertex 经 finished-face `IsSame` 验证后登记
anchor;`00007264` F2 的四个 selector 已 `kernel_lineage` resolved(最终 comparison rejected),
`00039669` F2 strict/RP passing,`00151159` F2 RP passing。含 hole 的多 region profile 必须继续走
既有 `Face.make_holes` geometry path 且不登记 anchor,避免改变 prism combine 语义;`00248377` 是
该拒绝/保留边界,仍导出 F4 checkpoint。`00594348` 的 immediate
shell 仅接受 direct source 的 non-construction line wall,并从同一 edge -> face relation
解析两张 removal face;它不输出 geometry 或 stable-ID hint。direct all-circle construction 可保留一个
annular hole 的 outer/inner source edge;多个独立 direct circle region 只在每个 prism
result 都仍位于 final snapshot 时保留各自 relation(当前为原子证据,尚非多语料完成项)。
`CAP_FACE` 还可作为上述受限 `up_to_surface` nested reference 或 immediate shell removal
face 的 cap role;`00212904` F2 与 `00789939` F2 分别以 `extrude.start` 和 `extrude.end`
的 `operation_role` 执行。fresh `output/cap-face-immediate-shell-00212904-20260910-v1`
证明前者执行到 F5,但 strict/RP 均拒绝;fresh
`output/cap-face-immediate-shell-00789939-20260910-v1` 证明 F2 及后续同一 direct-cap
shell F5 都执行,F6 仍为 `selector_query_unsupported` 并保留 F5 STEP checkpoint。fresh
`output/core-17-cap-face-immediate-shell-20260910-v1` 的 `tier=all` / pipeline / RP run 为
17/17 completed、1 `rebuilt_strict`、1 `rebuilt_approximate`、6 `rebuilt_rejected`、8
`rebuild_failed`、1 `comparison_timeout`;其中 `00212904` 的分类由 selector failure 变为
executable-but-rejected,不能将此记为几何相似通过。它们不允许在 producer 后续 mutation、
non-immediate owner、stable ID、binding ID 或 geometry fallback 中继续解析;
direct-prism `SWEPT_FACE` 也可作为单侧 `up_to_surface` reference,但它不是 output role:lowering
只保留一个 direct source-profile edge anchor,resolver 必须逐段验证 `boundary` 以及后续
`continuation` 的 complete/proven kernel relation、operation-wide cardinality 和 active body。
`00925274` 的 F3 以 `extrude.start` 的 `operation_role` 解析;F6、F9、F12 与 F15 都以 F1 E0
side-wall `kernel_lineage` 依次经过 complete/proven 的 F3、F6、F9、F12 target-side subtract
continuation 解析。单实体 primary cut 现在始终保留其 cut builder 的 target snapshot history;仅
transient tool snapshot 仍要求 direct-prism tool history,故没有扩大 source-qualified `INTERSECT`
的工具可选范围。resolver 只在 selector 请求的 source/result topology kind 内计算 complete/proven
final-snapshot relation 的基数;没有 final snapshot member 的 partial intermediate handle 及 cross-kind
section diagnostic 保留在 delta 中但不伪造成 face fragment。任何绑定到 final result 的 partial、split、
merge、inactive 或无 history relation 仍稳定拒绝,绝不以 geometry、stable ID、binding ID 或 current
body 猜测。fresh `output/core-17-swept-face-final-20260910` 的 `tier=all` / pipeline / RP run 完成
17/17:2 `rebuilt_strict`(`00694309`、`00925274`)、1 `rebuilt_approximate`、6
`rebuilt_rejected`、7 `rebuild_failed`、1 `comparison_timeout`;`00925274` 为 strict/RP pass,不能
推广为一般到面终止或 general SWEPT_FACE completion。受控完整 `0040` shard 的 fresh
`output/shard-0040-swept-face-final-20260910-v2` 也完成 71/71:7 strict、9 approximate、16 rejected、
34 rebuild-failed、3 runtime-ineligible、1 timeout、1 deferred,并保留 32 个 comparison artifact;它是
shared runtime 回归分类证据,不把非 strict/RP 样本重述为 selector success。IMPRINT/split source profile、draft、多/two-sided extent、fused source result、未证明或
split continuation、boolean/SPLIT 后继、revolve、
sweep、loft、copy/pattern 及一般 SWEPT query 仍未完成,绝不能标记为 query-family 完成。
CADFS production rebuild 以一个 `IncrementalCdslExecution` 按 history 顺序执行:每个 feature
在执行前只对本 session 已登记的 topology snapshot 调用 resolver,随后立即执行并登记新的
body/history evidence。`binding_feature_id` 读取同一 session 保留的历史 snapshot,不能通过
重建 prefix 或复制 OCC body 获得结果。feature 或 selector 失败时,系统直接从该 session 导出
最后已执行 checkpoint;不会为尝试更早 prefix 而重放历史。`bind_candidate_selectors` 仍可为
不完整的外部/诊断 CDSL 显式运行 legacy prefix adapter,但不得进入 production success/failure
path,也不得将 provenance 或 output-role selector 降级为 geometry binding。
4. 完成草图 region/wire 模型:多轮廓、内环、开口 reference geometry、B-spline/ellipse、
profile query、显式 construction 和退化检测。
非周期 `skFitSpline` 的两点受限变体现已贯通:仅当端点不同、同时给出两端导数,且
@@ -263,7 +372,62 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
`SWEPT_EDGE`、`OFFSET_FACE`、`INTERSECT`、`MID_CAP_EDGE`,将其物化为可追溯的
profile/wire,而不是复用原草图或写入样本特例。现有 direct-prism,以及单闭合无内环、
法向同向的 `LocOpe_DPrism` draft CAP_FACE,是受限例外:它们以 builder-proven output
role 直接消费物理 B-rep 面,未试图物化或重建 profile。
role 直接消费物理 B-rep 面,未试图物化或重建 profile。`OFFSET_FACE` 的端到端 status
同样只限于 capability matrix 所列、带 TDD source cap 的 direct shell output role;它不代表
任意 offset query 已可重放。`SWEPT_FACE` 与 `SWEPT_EDGE` 现在各有一条 1511 direct-prism
纵向 contract:source profile edge 经 `Generated(edge)` 到 side face,以及由完整 incident
source-edge set 唯一命名的 source vertex 经 `Generated(vertex)` 到 vertical edge。lowering 只在
producer 紧邻、独立、无 draft、`new_body` blind prism 且原 profile 未变时产生语义 selector;
adapter 只将 direct wire/face construction 中 exact `IsSame` anchor 注册为 transient source fact,
resolver 则只沿 complete/proven 跨 kind relation 解析。单一 analytic region 的 direct hole wires
也可在 finished face identity 未改变时提供这份 evidence:`00007264` 的四个 vertical-edge selector
皆已解析,`00039669` strict/RP passing,`00151159` RP passing;含 hole 的 multi-region profile
继续使用旧 geometry path 并明确不产生 anchor。`00111611` F3 的圆 edge -> side face、
`00974931` F2 的 direct annulus outer edge -> side face,与 `00000715` F3 的两个 incident-edge
pair -> vertical edge 为其它真实语料证据。direct all-circle construction 还保留 annular inner edge
及每个 direct circle region 的独立 delta;后者目前只有原子 executor evidence。IMPRINT 或 split
profile、draft、multiple/two-sided extent、fused result、boolean/SPLIT、revolve、
sweep、loft、copy/pattern 及 profile/wire consumer 也未覆盖。因此这只是两个受限 end-to-end
contract,`SWEPT_*` family 和 P1 的通用派生 profile 目标仍未完成,不能由 AST、unit relation
或上述两个样本提前完成。
`CAP_EDGE` 现在也有一条独立的 1511 direct-prism contract,但它不物化 profile/wire:source
sketch entity 必须仍对应一个 exact direct-profile edge,query 的 `isStart` 被保存为
`lineage_role: extrude.start|extrude.end`,adapter 以
`BRepPrimAPI_MakePrism.FirstShape(source_edge)` / `LastShape(source_edge)` 取得 cap edge,并以
final snapshot 的 `IsSame` 证明该 handle 未失效。resolver 只沿这个 source edge 与 role-qualified
`boundary` relation 解析;stable ID、几何、owner propagation 和 current-body 均不是回退路径。
`00021014` F2 的九个 CAP_EDGE selector 覆盖两个 role,完整 history strict/RP 通过。该例外只接受
紧邻、独立、无 draft 的 `new_body` blind prism 与未变 direct profile。一个 direct all-circle
annulus(一个外圆和一个包含的内圆)也可保留 outer/inner 的 exact source anchor:`00479470`、
`00501170`、`00526649` 在 F2 的 CAP_EDGE consumer 后 RP 通过,`00621329` strict/RP 通过;
`00566233` 的两个 F2 selector 已由 kernel lineage 解析,随后才因 OCC chamfer feasibility 失败,
`00614954`/`00678961` 也都在 F2 解析后才被后续未支持 query 截断。对于线段外环加圆孔,solver
仅给同一 source circle 拆出的全部四条 arc 加 `logical_circle_source_entity_id`;adapter 再要求这个
ID 在原 profile 中唯一指向一个未拆分圆、重建 native wire,并以 finished-face `IsSame` 重新证明。
任一 marker、source 或 final membership 缺失都没有 anchor。`00735367` 的 F2 因而以
`kernel_lineage` 解析、F1--F3 执行,随后 F4 才以 `selector_query_unsupported` 导出 F3 checkpoint。
不完整 logical-circle loop 不产生该 circle 的 anchor;含 hole 的 multi-region、trimmed/split profile、
draft、multiple/two-sided extent、fused result、boolean/SPLIT successor、revolve、sweep、loft、copy/
pattern 继续拒绝。
对 direct-prism `CAP_EDGE` 的 fillet/chamfer consumer,boundary-only policy 另可在运行时存在
完整 kernel continuation 时扩展为 `boundary + continuation`:每一跳都必须为 exact
`preserved`/`modified` relation、`coverage: complete`、`status: proven`,且 operation-wide
cardinality 保持 1:1;任何 partial、split/merge、inactive result 或无 history 都稳定拒绝。
`00694309` 证明这一条:F4 的 F1 `extrude.start` cap edge 经 F3 primary-cut `preserved`
continuation 解析为 `body:f_F3:edge:1`,完整 pipeline `output/cap-edge-continuation-after-primary-cut-20260910-v1`
的三 feature history strict/RP passing。任何 boolean/SPLIT、COPY/pattern 或其它中间操作也必须
提供同样完整的 1:1 relation;它们目前没有独立的 corpus coverage,不能仅按 owner/operation 名称
通过。这个 contract 也不接受任意 CAP_EDGE source,且没有 geometry、stable-ID、
binding-ID 或 current-body fallback。fresh
`output/core-17-cap-edge-continuation-20260910-v1` 的 `tier=all` / pipeline / RP run 完成 17/17:
1 `rebuilt_strict`(`00694309`)、1 `rebuilt_approximate`、5 `rebuilt_rejected`、9
`rebuild_failed`、1 `comparison_timeout`。这只确认该完整 relation contract 将此样本从 F3
executable prefix 推进为实际 strict/RP pass,不能作为 CAP_EDGE family completion 或 general
boolean continuation 的证据。
共享 selector/runtime suite 为 261 passed、1 skipped;强制 core-17
重跑 `output/core-17-direct-prism-cap-edge-hole-20260910` 为 1 RP、5 rejected、10 rebuild-failed、1
comparison timeout,与 selector-migration 基线分类一致。因此 `CAP_EDGE` family 与 P1 的通用派生
profile 目标仍未完成。
`OFFSET_FACE` 现有一个独立的受限 profile 物化路径:只有 inward shell 直接消费一个
`new_body` blind additive prism,shell 恰移除该 prism 的一个 CAP,且 OFFSET query 恰指向
其未修改、单闭合凸线性 profile 中的一条非 construction line,lowering 才根据 source
@@ -302,11 +466,23 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
`INTERSECT` 的第一条通用受限路径现以 CDSL `planar_imprint` 保存同一草图的原始
analytic entities、IMPRINT 面侧、可选 INTERSECT vertex order 与 fragment side;solver
仅转换这些精确曲线,adapter 用 OCP `BOPAlgo_Splitter` 切分有界 support face 后选取实际
B-rep region。没有唯一 fragment、选中无界 support-boundary region、construction/source
alias、split failure 或不完整 query 都稳定拒绝,不把 B-spline/arc 采样成多边形,也不复用
整张草图。该路径覆盖 bounded line/arc/circle/ellipse/B-spline arrangement 的 shared
contract,但尚未覆盖不同 sketch、surface/topology producer、trim/copy/pattern 后继或完整
FeatureScript IMPRINT query grammar,因此仍是 P1 部分完成项。工件
B-rep region。top-level `IMPRINT FACE` 的 multi-face query 只有既有的
`_profile_selection_sketch` 不能将它缩减为单一/圆形/open 专用 profile 时,才进入该 typed
arrangement profile;不能把 nested `INTERSECT` 误当作 outer profile family,也不能抢占
existing circle/open/surface IMPRINT contracts。没有唯一 fragment、选中无界 support-boundary
region、construction/source alias、split failure 或不完整 query 都稳定拒绝,不把 B-spline/arc
采样成多边形,也不复用整张草图。该路径覆盖 bounded line/arc/circle/ellipse/B-spline
arrangement 的 shared contract,但尚未覆盖不同 sketch、surface/topology producer、trim/copy/
pattern 后继或完整 FeatureScript IMPRINT query grammar,因此仍是 P1 部分完成项。
`output/planar-imprint-multiface-20260910` 的 seven-source forced RP matrix 验证这个收紧后的
分派:`00304488`、`00253824` rebuilt_rejected;`00354246` 在 F2 deferred `SWEPT_FACE` 时保留
F1 checkpoint,`00306689` 在 F1 OCC `BRep_API: command not done` 失败,`00784127` 在 F1、
`00782218` 在 F2 因 selected region unbounded 拒绝(后者保留 F1 checkpoint),`00429745`
在 F1 OCC extrude 无有效 solid 时拒绝。该 matrix 不把任一 IMPRINT-derived profile 的下游
`SWEPT_FACE` 视为完成:它们保留 source intent 并由 shared resolver 有界拒绝。当前 shared
selector/runtime suite 为 262 passed、1 skipped;强制 core-17
`output/core-17-planar-imprint-multiface-20260910` 为 1 RP、5 rejected、10 rebuild-failed、1
comparison timeout,与 selector-migration 基线一致。工件
`output/planar-imprint-intersect-20260909-runtime` 是 CAP_FACE 扩展前的历史工件:
`00082324` 与当时的 `00835610` 都保留可执行 STEP 但 `rp.passed == false`,`00071859` 和
`00093912` 分别保留既有 `TopoDS::Solid` 和 revolution-segmentation runtime failure。
@@ -350,6 +526,26 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
作为受限 CDSL output-role selector 供 downstream feature 消费;同一 contract 还支持
independent blind prism CAP_FACE 的 `extrude_from_face`。这些路径仍不能代替完整的
derived-topology selector 语义,CADFS lowering 也尚未以此表示一般 CAP/SWEPT query。
capability matrix 中 `SWEPT_FACE@1511` 与 `SWEPT_EDGE@1511` 另有 direct-prism 的受限
end-to-end contract:独立、无 draft、`new_body` blind prism 的 direct source profile edge/
vertex(含一个 analytic region 的 exact hole wires)由 exact construction anchor 和 `Generated`
cross-kind history 绑定给紧邻 consumer;含 hole 的 multi-region profile 不产生这类 anchor。
这不覆盖本段 sweep/loft/revolve 的 output role,亦不把任一受限 output role 或特征专用
selector 升级为通用 CADFS query-family 支持。
对 `sweep.path`,另有一个 source-sketch-only lowering contract:FeatureScript 1511 的 exact
`qUnion([qConstructionFilter(qBodyType(qCreatedBy(sketch, EDGE), WIRE), NO)])` 仅在 source 还直接 import
`onshape/std/geometry.fs@1511.0`、owner 是 source
sketch、恰有一个 non-construction `line` 或 `bspline` entity 时解为路径,不能作为 runtime
`qBodyType` selector。两点 `skFitSpline` 只有 source 明确给出 start/end derivative 时才会保留为
B-spline 并由 OCC 执行;没有两个导数时拒绝,绝不改成 chord。`00896761` F2(F1/E2 two-point
B-spline)现在 converted/rebuilt 且无 runtime diagnostic,artifact bundle
`output/qbodytype-direct-sketch-wire-20260910-v2` 包含 STEP、GLB 和七视图;但 RP comparison 在 60s
预算超时,分类为 `comparison_timeout`,不是相似通过。fresh seven-sample RP matrix
`output/qbodytype-direct-sketch-wire-matrix-20260910-v1` confirms all direct-path cases rebuild: `00191739`
strict, `00726304` RP-only approximate, `00227428`/`00287471`/`00500952`/`00816123` rejected, and
`00896761` timed out during comparison. These classifications are evidence of executable paths, not a claim
that rejected/timeout output is similar. `00786708` F2 因多个 non-construction path entity 继续 deferred。这不是 generic `qBodyType`、qConstructionFilter、sweep
path、loft guide、arc/circle path 或 sweep complete 的完成声明。
2. `shell`:单一 selected solid 的 direct-builder topology delta 与有限 output-role
evidence 已覆盖。CADFS lowering 现额外接受一个受限的 removal selector:直接 blind 或
two-sided linear extrusion 的立即后继 shell,可从同一未修改 source profile 中唯一的、非
@@ -413,7 +609,22 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
都不继承该 contract。该受限路径不覆盖 sweep、surface/partial/fused revolve、
multi-section loft、generated/trimmed/transformed profile 或 boolean/pattern 后继;任一
端点、axis 或 owner 不唯一时必须保留前缀并诊断。内核不能完成时不能伪造较小半径或不同
孔型。
孔型。这里的 endpoint-bbox/revolve selector 不属于 capability matrix 的 direct-prism
`SWEPT_EDGE` provenance contract,不能借其成功。只有该受限 blind-prism path 具备 query
source semantics、lowering、adapter evidence、consumer 和真实语料回归;其它 generator/
consumer 仍须逐一补齐后,才可将整个 query family 标记为完成。
`hole` 现增加一个独立且更窄的 source-location/body-scope contract:lowering 仅接受原始
`sQuery`/`sketchEntityQuery(VERTEX, ...)` 的 `skPoint`、`skCircle.center`、`skLineSegment`
或 `skArc` 的 `.start`/`.end`,并要求所有 location 都来自同一显式草图平面;派生 suffix、
CAP/SWEPT/COPY topology、query combinator 与几何邻近性均不会成为 location fallback。CADFS
`scope` 必须是一个直接 `SWEPT_BODY`,并在 lowering-time body graph 中仍是唯一独立成员,才写入
`hole_wizard.params.scope_feature_id`。schema、semantic validation、capability preflight 和 executor
共同检查该成员仍是唯一 active solid;executor 在每次切除后保留原 scope member key,因而后续
CADFS hole 可以继续引用同一 body,而无 scope 的既有 CDSL hole 仍保留 feature-owned lifecycle。
`00406667` 的 F1/F3/F5 是端到端证据:两个 `skCircle.center` hole 与同一 F1 revolve scope 完整执行,
`output/hole-direct-sketch-vertex-20260910-v2` 分类为 `rebuilt_approximate`(RP passed,strict failed)。
这不覆盖 B-spline/interior vertex、多个 host plane、多个 scope body、COPY/boolean/pattern successor、
non-direct query、全部 hole start/end styles 或完整孔型/螺纹语义。
4. `booleanBodies`、`mirror`、`circularPattern`:显式 source/target bodies、实例输出、
nested pattern、remove/intersect/keep-tools 和 transform 后继。当前 direct circular
`NEW` COPY -> rigid transform,以及 direct mirror 的 `NEW` source -> `instance 1`
@@ -471,6 +682,69 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
`output/core-17-cplane-offset-opposite-20260909` 分类保持 3 strict、3 RP、9 rejected、1
rebuild failure、1 comparison timeout。它仍只是 cPlane 的一项通用 frame contract,不覆盖
曲面/曲线 attachment、退化输入或完整 derived-topology plane semantics。
`LINE_ANGLE` 现额外覆盖单一 direct `skCircle` edge:FeatureScript 1511 的
`cplane.fs::lineAnglePlane` 将该选择传入 `evAxis`,而同版本 `query.fs` 将 circle
列为 `ALLOWS_AXIS`。lowering 因此只用 circle centre 与 source sketch plane normal
作为 axis,并按同版本 `vector.fs::perpendicularVector` 的确定性阈值分支适配 zero-angle
direction,再按
`angle` 和 `oppositeDirection` 的 signed angle 旋转;不会以 circle centre vertex、
`CAP_EDGE`/`SWEPT_*`/COPY 等派生 topology 或 current body 替代这个 source contract。
该语义依据来自 MIT 许可的 Onshape standard-library mirror 的 1511.0 commit
`eaef87b22d3b15e9377d8b1c6cb701f8111b6a0c`;适配该 MIT 算法但未引入依赖。`00030209`
的 F1/F2/F4/F5 是现有的四个真实 direct-circle evidence:
`output/cplane-line-angle-direct-circle-20260910` 不再含 cPlane diagnostic,并保留
四个 executable `reference_plane`。该 source 后续因 arc sweep path 未实现而没有
solid feature,pipeline 正确分类为 `runtime_ineligible`,没有将工作平面 lowering
误报为 STEP/RP 成功。多实体 reference、direct arc/cylinder/cone 等其他 `evAxis`
输入和一般 derived topology 仍未覆盖。focused shared selector/runtime suite 为
`263 passed, 1 skipped`(142.98 s;仅既有 build123d deprecation 与 workplane
re-orthogonalization warnings)。强制 RP Core-17 refresh
`output/core-17-line-angle-direct-circle-20260910` 为 1 `comparison_timeout`、10
`rebuild_failed`、1 `rebuilt_approximate`、5 `rebuilt_rejected`,与既有核心集分类一致;
它只证明共享改动没有改写这些既有结果,不构成 generic `LINE_ANGLE` 或 STEP/RP success。
两实体 `LINE_ANGLE` 现额外覆盖 source-only contract:direct `skLineSegment`/`skCircle`
提供 axis,默认 datum 或已 lower reference plane、direct `skPoint` 或 direct line endpoint
提供第二 reference。实现严格镜像 1511 `cplane.fs::lineAnglePlane`:第一个 selection
不是 axis 而第二个是 axis 时交换;两个非平行 axis 用第二 direction,平行 axis 用两 origin
之差,plane 用 `cross(axis, plane.normal)`,point 用 `point - axis.origin`,再以 signed angle
旋转 `cross(axis, secondInPlaneDirection)`。共线/零长度选择明确 defer。此 direct branch
只接受未组合的 `sQuery`/`sketchEntityQuery`,不通过 `_query_line`、current body 或 geometry hint
推导 CAP/SWEPT/COPY/trim/derived query;
它继续引用 MIT-licensed Onshape standard-library mirror commit
`eaef87b22d3b15e9377d8b1c6cb701f8111b6a0c`,未引入依赖或复制外部代码。lowering regression
覆盖 datum-first swap、axis-first、nonparallel/parallel-offset axes、direct point、reversed
point/axis、`oppositeDirection`、degenerate reject,并断言 direct helper 不接受 `CAP_EDGE`。
真实 matrix `output/cplane-line-angle-two-entity-matrix-20260910` 的六条直接 axis/default-plane
history(`00067847`、`00185138`、`00217351`、`00298026`、`00586156`、`00831400`)均无 cPlane
diagnostic 且保留 rebuild STEP:`00586156` strict/RP pass,`00298026` RP pass/strict diagnostic,
前三条为独立 `rebuilt_rejected`,`00831400` 在后续 F5 `BRep_API: command not done` 保留 prefix。
这只证明受限 frame lowering,不能将后续 geometry 分类归为 `LINE_ANGLE` 成功;direct arc、
non-source vertex、任意 derived topology、一般 face/curve/mate-connector axis 和完整 cPlane
coverage 仍未完成。既有圆柱母线 compatibility path 也已收紧为单一 direct `makeQuery`
`CAP_EDGE` 或 `SWEPT_FACE` 的 source `skCircle`,要求 producer start/end frame 与另一显式 datum/
lowered reference plane;qAdjacent/qUnion composition、CAP/SWEPT line、trim/COPY/boolean source 均稳定
defer,不能因 AST 内出现 source token 获得 `_query_line` fallback。1511 `query.fs`/`evaluate.fs` 确实
将 arc 列为 `ALLOWS_AXIS`/`evAxis` 输入,但当前 9,347 条 corpus 未发现 direct `skArc` 被
`LINE_ANGLE` 实际选择的 history;这只是待验证语义,不能提前宣称 direct-arc coverage。
`CURVE_POINT` 现额外接受同一 direct source curve 的精确切线:`skArc.start/end` 由解析
圆心、半径和方向生成切线,`skFitSpline.start/end` 只在 FeatureScript 导出了相应 endpoint
derivative 时执行。它还受限支持 source token `E<n>.<index>.internal`:必须是同一 direct、
non-periodic `skFitSpline`,并有完整 interpolation points、centripetal parameters 与两端
derivatives。lowerer 复用 runtime 的 `Edge.make_spline(..., scale=False)` 构造,再在显式
parameter[index] 以 OCC `BRepAdaptor_Curve.D1` 读取导数,同时核验返回点仍等于 source
interpolation point;绝不以 adjacent interpolation-point chord 代替曲线切线。`00827798`
F1 与 `00845891` F3 是两个真实 B-spline endpoint 证据,`00456498` F1 (`E0.2.internal`)
与 `00812557` F2 (`E0.3.internal`) 是 source interpolation-token 证据;`00057273` 的受控
`skArc` endpoint 变体覆盖圆弧方向。derived suffix、越界 index、无完整 interpolation
data、无导数/periodic spline、curve/surface topology source 和退化 tangent 继续明确拒绝。
两条新增样本 pipeline `output/cplane-curve-point-bspline-interpolation-20260910` 均已无
cPlane diagnostic;`00456498` 在后续 sweep OCC solid failure 停止,`00812557` 在后续
sweep OCC valid-solid failure 停止,保留诊断和可用工件,不误报为整体成功。shared
selector/runtime suite 为 `277 passed, 1 skipped`(既有 workplane re-orthogonalization
warning)。RP Core-17 refresh `output/core-17-cplane-curve-point-bspline-interpolation-20260910`
为 1 `comparison_timeout`、10 `rebuild_failed`、1 `rebuilt_approximate`、5
`rebuilt_rejected`,与 prior semantic-selector baseline 分类一致;它不构成完整 cPlane
或 generic curve-attachment completion。
### P3:尚未支持的 FeatureScript 操作
@@ -495,14 +769,22 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
一项能力仅在满足以下条件时可标记完成:
1. 有版本化的 CDSL 表达,且 schema/semantic validation 拒绝不完整或歧义输入。
1. 有版本化的 CDSL 表达,且 schema/semantic validation 拒绝不完整或歧义输入。对
FeatureScript query,`selector_intent.version`、source query family、精确 language version 和直接
standard-library import path/version 必须有明确契约;缺版本和未注册 family/language/library revision
必须诊断,不能以 legacy 顶层版本、数字前缀、相同路径或默认版本补齐。
2. lowering 仅根据 FeatureScript source 产生该表达,并保留 source feature、selector
和 body provenance。仅有 runtime CDSL contract 而未由 lowering 产生的能力必须标为
部分完成。
3. runtime/adapter 按通用算法执行,记录结果 body 和 topology delta,不依赖样本信息。
3. runtime/adapter 按通用算法执行,记录结果 body 和 topology delta,不依赖样本信息。派生
selector 必须具有 source/result kind、输入/输出 snapshot、body member、history status 及
kernel relation evidence;resolver 必须据此证明 derivation policy、operation-wide cardinality
和 active member,并输出实际 `resolution_mode` 与 evidence。
4. 能力矩阵记录对应 FeatureScript API/query 的源版本文档或标准库依据、采用的语义和
未覆盖边界;原子语义矩阵包含正向、边界和拒绝测试,且至少多个真实语料样本覆盖
不同几何和生命周期组合。
不同几何和生命周期组合。只有 parser/AST 或 resolver unit test 的 query family 只能标为
resolver-level/部分完成;必须同时具备 lowering、schema、adapter、consumer 和多个真实样本
的端到端证据后才可标为 complete。
5. 受影响核心集、扩展集和全量 shard 有可复现结果,工程相似通过率、失败数和剩余
exception 均更新到本地台账。
6. 代码审查确认没有 sample-specific 分支、gold STEP 参数回填、隐式默认尺寸或为
@@ -518,3 +800,54 @@ instance 生命周期。每项采用或拒绝外部方案的决定、理由和
全量目标完成时,报告必须按“工程相似”“严格一致”“source exception”“未实现能力”
和“基础设施失败”分别给出分母、样本 ID、工件和原因。任何仍可执行的模型都必须
保留输出,不能因未满足最终几何目标而丢弃。
## Selector 迁移台账(2026-09-09)
已完成第一条迁移边界,而非完整 query-family 实现:CDSL schema 允许保留未知的
大写 FeatureScript query family;CADFS lowering 对全部 topology fallback 写入 source
AST、版本、语义 family 和 `feature_script_query` evidence。未在版本化 capability matrix
登记的 query 使用非空 derivation policy 加 `multiplicity: none`,因此 resolver 在 stable ID、
geometry、owner 或 current-body fallback 前稳定返回 `selector_query_unsupported`。嵌套的
extent、COPY 和 INTERSECT selector 同样递归写入 source metadata;COPY/INTERSECT 保留外层
query family,不错误继承其内部 CAP/SWEPT component。显式 datum plane 单独为
`GEOMETRIC` / `explicit_datum`,不构成派生 topology 的逃逸通道。
此前 core-17 candidate inventory 中有 14 个 runtime-snapshot edge、7 个 runtime-snapshot
face、7 个 SolidWorks face 和 2 个 plane legacy selector,只有少数 direct-prism provenance
selector。此次不把这些历史 geometry hint 宣称为 lineage:`00005267`(FeatureScript 1793)F4
的四个 loft `SWEPT_EDGE` 已从 strict geometry success 改为 F3 executable checkpoint 加
`selector_query_unsupported`。同类未实现的 CAP/SWEPT/OFFSET/COPY/INTERSECT paths 必须保留
候选、bound CDSL、最后 STEP/GLB(可生成时)和诊断,直到具备 source API evidence、lowering、
adapter history、resolver policy 和 corpus regression 的完整 contract。受限
`CAP_EDGE@1511`、`SWEPT_FACE@1511` 和 `SWEPT_EDGE@1511` direct-prism contracts 不受影响;
它们仍只在 capability matrix 的已证明边界内执行。
2026-09-10 的 source-version migration 补齐了 import-level evidence:parser 逐条保留直接
`onshape/std/*` import 的 `{path, version}`,CDSL 顶层 `source_featurescript` 和嵌套 selector
`source_query` 同时保留 primary import 与完整 import list。resolver 对 provenance selector 先要求
language version、direct `standard_library` 和 `standard_library_version`,再按 capability matrix 的精确
三元组匹配。缺 import version 返回 `selector_query_version_unknown`;未登记 library revision 返回
`selector_query_unsupported`,且不会进入 stable-ID、geometry、owner 或 current-body fallback。全量
9,347 条 source scan 记录到 `geometry.fs` 与 FeatureScript 版本一一成对变化;只有现有
`1511` / `geometry.fs@1511.0` direct contracts 保持 executable。该迁移只完善来源证据门槛,不新增
`COPY`、`SPLIT` 或其他 query family 的执行能力。验证包括 parser/lowering/provenance suite
`140 passed`、runtime foundation `130 passed, 1 skipped`、以及 fresh `00212904` RP pipeline
(完整 F1--F5 replay,`rebuilt_rejected`)和 `core-17-selector-standard-library-revision-20260910-v1`
(1 strict、1 approximate、6 rejected、8 rebuild-failed、1 timeout);所有结果保留各自 STEP/checkpoint。
同步的 integration/binder regression 也确认现有 immediate CAP shell contract 的真实前缀:`00789939`
执行 F2/F5 后在 F6 停止并保留两-solid F5 checkpoint,`00090436` 与 `00107631` 的 outward F1/F2
prefix 都可 rebuild;combined selector/lowering/binding/integration suite 为 `168 passed`。
`intersection_of` vertex 是由 `ExecutionSession` 从已解析的 face component 直接计算的特殊
consumer,因而不能绕开 outer selector 的 provenance gate。runtime 现将 nested/legacy version
一致性、FeatureScript source version、capability allow-list 和 derivation policy 抽为
`TopologyRegistry.resolve` 与该 session path 共用的 contract:`multiplicity:none`、未知 version 或
未登记 capability 的 outer `INTERSECT` 在任何 component resolve 或 OCC 求交前稳定拒绝。没有
`selector_intent` 的既有显式几何 intersection selector 仍维持其 legacy contract。原子回归覆盖这三种
拒绝以及 legacy 正向路径(`backend.tests.test_selector_provenance_contract`: 21 passed);这只关闭
provenance bypass,不新增 general `INTERSECT`、vertex provenance 或 source-qualified section-edge 覆盖。
当前代码的 shared selector/runtime suite 为 `264 passed, 1 skipped, 43 subtests`(142.57 s;仅既有
build123d deprecation 与 workplane re-orthogonalization warnings)。真实 `00423838` 以
`output/session-intersection-outer-gate-20260910` 强制 single-sample pipeline 验证:F7 outer deferred
`INTERSECT` 在 incremental replay 中报告 `selector_query_unsupported`,并导出 F6 的三个 feature
executable `rebuild.step` checkpoint;结果是 `rebuild_failed`,不是该 query family 的 RP 成功。