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:
@@ -172,7 +172,16 @@ class WorkflowCoordinator:
|
||||
for atomic_id in self.runtime.supported_atomic_ids()
|
||||
}
|
||||
repair_instruction = "" if state.repair_count == 0 else "Return a complete replacement document. Preserve only features confirmed in executed_feature_ids unless the diagnostic identifies that feature. Features that did not execute may be corrected. Keep local names unless the diagnostic identifies a name conflict. Never add IDs, stable selectors, snapshots, or tokens."
|
||||
content = json.dumps({"requirements": requirements, "supported_operations": operation_schemas, "previous_authoring": previous, "diagnostics": diagnostics}, ensure_ascii=False)
|
||||
content = json.dumps({
|
||||
"requirements": self._authoring_requirements_context(requirements),
|
||||
"supported_operations": operation_schemas,
|
||||
"authoring_selector_contract": {
|
||||
"face_cap_source_pattern": r"^[a-z][a-z0-9_]{0,63}\.(top_planar_face|bottom_planar_face|end_face|start_face)$",
|
||||
"face_cap_roles": ["top_planar_face", "bottom_planar_face", "end_face", "start_face"],
|
||||
},
|
||||
"previous_authoring": previous,
|
||||
"diagnostics": diagnostics,
|
||||
}, ensure_ascii=False)
|
||||
try:
|
||||
raw = await self._tool_call(
|
||||
task_id, author, "write_authoring_cdsl", AuthoringDocument.model_json_schema(),
|
||||
@@ -343,6 +352,20 @@ class WorkflowCoordinator:
|
||||
},
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _authoring_requirements_context(requirements: dict[str, Any]) -> dict[str, list[str]]:
|
||||
"""Pass requirement meaning to the author without leaking analysis field names.
|
||||
|
||||
``acceptance_targets.expected`` is intentionally an open-ended
|
||||
reporting record. It may contain descriptive keys from a user request,
|
||||
while Authoring CDSL has a closed protocol. Passing it through verbatim
|
||||
invites a model to treat analysis labels as output fields.
|
||||
"""
|
||||
return {
|
||||
key: [item for item in requirements.get(key, []) if isinstance(item, str)]
|
||||
for key in ("explicit_requirements", "assumptions", "manual_targets")
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def _validate_repair_document(
|
||||
previous: dict[str, Any], replacement: dict[str, Any], diagnostics: dict[str, Any] | None,
|
||||
|
||||
Reference in New Issue
Block a user