@@ -362,12 +362,13 @@ Json Component_Gallery::documentation() const {
cases . push_back ( make_doc_case ( " polymorphic " , " adapters " , " Polymorphic Adapter " , " variant 的 discriminator、可选类型和每个子类型 Descriptor 都进入协议,AMIS 自动生成类型切换与子表单。 " , " Polymorphic_Adapter<Gallery_Target, Json>::variants() " , examples [ " polymorphic_descriptor " ] , examples [ " polymorphic_amis " ] , examples [ " polymorphic_amis " ] , string_array ( { " polymorphic_adapter " , " discriminator " , " variant " } ) , string_array ( { " /admin/gallery/advanced/polymorphic/descriptor " , " /admin/gallery/advanced/polymorphic/data " , " /admin/gallery/advanced/polymorphic/amis " } ) ) ) ;
cases . push_back ( make_doc_case ( " object-transaction " , " runtime " , " Object Adapter + Resource Transaction " , " 运行时对象通过 Object_Adapter snapshot/commit 映射到可描述 Model;事务实验台覆盖 success、prepare reject、commit fail、rollback fail。 " , " Object_Adapter<Gallery_Runtime_Config>; Resource_Transaction<Gallery_Runtime_Model> " , examples [ " object_adapter_view " ] , examples [ " object_adapter_amis " ] , examples [ " object_adapter_amis " ] , string_array ( { " object_adapter " , " resource_transaction " , " prepare " , " commit " , " rollback " , " request_context " } ) , string_array ( { " /admin/gallery/advanced/object/data " , " /admin/gallery/transaction/{scenario} " } ) ) ) ;
cases . push_back ( make_doc_case ( " managed-synchronization " , " runtime " , " Managed_Value 与同步拓扑 " , " Managed_Value 使用 Structive 的同步拓扑;后端 writable、前端 editable/creatable 和 synchronized 分别展示,避免把权限和锁混为一谈。 " , " Managed_Value<Gallery_Config>; value.resolved_synchronization(); value.member<&T::field>().write(...) " , examples [ " managed_synchronization " ] , Json { { " transport " , " Resource_Service<Managed_Value<T>> " } } , make_gallery_note ( " Managed / Synchronization " , " 同步拓扑和字段能力来自运行中的 Managed_Value,而不是第二套前端字段表。 " ) , string_array ( { " managed_value " , " managed_update " , " synchronization_topology " , " unsynchronized_field " , " backend_writable " , " frontend_editable " } ) , string_array ( { " /admin/gallery/config/data " , " /admin/gallery/managed " } ) ) ) ;
cases . push_back ( make_doc_case ( " validation-boundaries " , " safety " , " Validation 与协议边界 " , " 字段校验、nested path、object validator、readonly 提交、多态 discriminator、非法 Composition/Manifest 和非法 Collection query 都有可重复的标准错误。 " , " apply_frontend_patch(...); validate_composition_view(...); validate_composition_slot_contracts(...) " , examples [ " protocol_boundaries " ] , examples [ " validation_422 " ] , make_gallery_note ( " 协议边界 " , " 在“协议边界”页面可以逐项执行真实请求并查看标准错误。 " ) , string_array ( { " validation_422 " , " field_errors " , " nested_path " , " object_validator " , " readonly_reject " , " invalid_grid " , " invalid_tab " , " missing_slot_contract " , " duplicate_slot " , " invalid_sort " , " invalid_filter " } ) , string_array ( { " /admin/gallery/boundaries " , " /admin/gallery/items?orderBy=color&orderDir=asc " , " /admin/gallery/lab/invalid-filter " } ) ) ) ;
cases . push_back ( make_doc_case ( " status " , " runtime " , " Status Polling: overview + item " , " 状态 Descriptor 与轮询 renderer 分离;完整运行时同时展示 overview status 和 Collection item status。 " , " make_amis_status_service<Json>(descriptor, api, interval); collection.register_status<&T::status>() " , status_descriptor , status_amis , status_amis , string_array ( { " status_polling " , " overview_status " , " item_status " } ) , string_array ( { " /admin/status " , " /admin/radio-states /{id}/status" } ) ) ) ;
cases . push_back ( make_doc_case ( " validation-boundaries " , " safety " , " Validation 与协议边界 " , " 字段校验、nested path、object validator、readonly 提交、多态 discriminator、非法 Composition/Manifest 和非法 Collection query 都有可重复的标准错误。 " , " apply_frontend_patch(...); validate_composition_view(...); validate_composition_slot_contracts(...) " , examples [ " protocol_boundaries " ] , examples [ " validation_422 " ] , make_gallery_note ( " 协议边界 " , " 在“协议边界”页面可以逐项执行真实请求并查看标准错误。 " ) , string_array ( { " validation_422 " , " field_errors " , " nested_path " , " object_validator " , " readonly_reject " , " invalid_grid " , " invalid_tab " , " missing_slot_contract " , " duplicate_slot " , " invalid_sort " , " invalid_filter " } ) , string_array ( { " /admin/gallery/boundaries " , " /admin/gallery/items?orderBy=color&orderDir=asc " , " /admin/gallery/items?score=92 " } ) ) ) ;
Json status_endpoints = Json : : array ( { " /admin/status " , std : : string ( radio_states_api ) + " /{id}/status " } ) ;
cases . push_back ( make_doc_case ( " status " , " runtime " , " Status Polling: overview + item " , " 状态 Descriptor 与轮询 renderer 分离;完整运行时同时展示 overview status 和 Collection item status。 " , " make_amis_status_service<Json>(descriptor, api, interval); collection.register_status<&T::status>() " , status_descriptor , status_amis , status_amis , string_array ( { " status_polling " , " overview_status " , " item_status " } ) , std : : move ( status_endpoints ) ) ) ;
cases . push_back ( make_doc_case ( " http-adapters " , " adapters " , " HTTP Adapter: Httplib + Drogon " , " Httplib 现在与 Drogon 一样可以通过 context_factory 构造 Request_Context;真实 localhost 黑盒测试覆盖 CRUD、查询、状态和上下文传递。 " , " resource.bind(server, Httplib_Bind_Options{.context_factory = ...}); Drogon_Bind_Options{...} " , Json { { " httplib " , " context_factory -> Request_Context " } , { " drogon " , " context_factory + executor/filter " } } , Json { { " tests " , string_array ( { " Adminive_Httplib_Adapter_Test " , " Adminive_Drogon_Adapter_Test " } ) } } , make_gallery_note ( " Transport Adapter " , " 当前 Gallery 本身运行在 Httplib; Drogon 契约由同一 service 层和独立 adapter test 验证。 " ) , string_array ( { " httplib " , " drogon " , " request_context " , " real_http_test " } ) , string_array ( { " /admin/gallery/config/data " } ) ) ) ;
const Json verification_view = Json { { " ctest_labels " , string_array ( { " unit " , " protocol " , " http " , " install " , " concurrency " , " package " } ) } , { " sanitizers " , string_array ( { " ASan " , " UBSan " , " TSan " } ) } , { " configurations " , string_array ( { " Debug " , " Release " } ) } } ;
const Json verification_runtime = Json { { " frontend " , string_array ( { " node_test " , " playwright_chromium " , " playwright_msedge " } ) } } ;
cases . push_back ( make_doc_case ( " verification " , " engineering " , " 工程验证 Gate " , " Release-safe test checks、安装消费测试 、真实 HTTP、CTest labels、 Debug/Release、ASan/UBSan/TSan、前端单测和 Playwright 都有正式入口。 " , " ctest -L unit ; ctest -L http ; ctest -L install; python scripts/verify.py " , verification_view , verification_runtime , make_gallery_note ( " Verification Gate " , " 测试断言在 Release 下不会被 NDEBUG 清除;install consumer 只通过 find_package(Adminive) 消费安装结果。 " ) , string_array ( { " release_safe_checks " , " install_consumer " , " debug " , " release " , " asan " , " ubsan " , " tsan " , " frontend_unit " , " playwright " , " edge " } ) ) ) ;
const Json verification_view = Json { { " ctest_labels " , string_array ( { " unit " , " protocol " , " http " , " install " , " package " , " header " , " concurrency " } ) } , { " sanitizer_matrix " , Json { { " clang_gnu " , string_array ( { " ASan " , " UBSan " , " TSan " } ) } , { " msvc " , string_array ( { " ASan " } ) } , { " unsupported_configuration " , " configure_error " } } } , { " configurations " , string_array ( { " Debug " , " Release " } ) } } ;
const Json verification_runtime = Json { { " headers " , " all public Adminive headers compile standalone " } , { " install_consumers " , string_array ( { " Adminive::Core " , " Adminive::Default + Httplib " } ) } , { " package_zip " , " exact root files + no stale nested project " } , { " frontend " , string_array ( { " node_test " , " playwright_chromium " , " playwright_msedge " } ) } } ;
cases . push_back ( make_doc_case ( " verification " , " engineering " , " 工程验证 Gate " , " Release-safe test checks、公共头独立编译、源码包结构、Core + Default/Httplib 安装消费、真实 HTTP、Debug/Release 和平台真实支持的 Sanitizer 都有正式入口。 " , " ctest -L header ; ctest -L package ; ctest -L install; python scripts/verify.py " , verification_view , verification_runtime , make_gallery_note ( " Verification Gate " , " 测试断言在 Release 下不会被 NDEBUG 清除;不支持的 sanitizer 配置会明确失败或 SKIP,不会假通过。 " ) , string_array ( { " release_safe_checks " , " public_header_compile " , " package_zip " , " install_consumer " , " debug " , " release " , " asan " , " ubsan " , " tsan " , " frontend_unit " , " playwright " , " edge " } ) ) ) ;
Json layers = Json : : array ( ) ;
layers . push_back ( Json { { " name " , " Object Schema " } , { " purpose " , " 字段结构、读写能力、约束与同步事实 " } } ) ;
layers . push_back ( Json { { " name " , " Field Presentation " } , { " purpose " , " 单字段 label、description、control、options、visible_on " } } ) ;
@@ -416,12 +417,6 @@ void Component_Gallery::bind(httplib::Server& server) {
server . Get ( " /admin/gallery/boundaries " , [ ] ( const httplib : : Request & , httplib : : Response & response ) {
write_http_response ( response , make_http_success < Json > ( protocol_boundaries ( ) ) ) ;
} ) ;
server . Get ( " /admin/gallery/lab/invalid-filter " , [ ] ( const httplib : : Request & , httplib : : Response & response ) {
Collection_Service < Gallery_Row , Json > collection ( " /lab " , make_rows ( ) ) ;
Collection_Query query ;
query . fields . emplace ( " score " , " 92 " ) ;
write_http_response ( response , collection . list_response ( std : : move ( query ) ) ) ;
} ) ;
server . Post ( R " (/admin/gallery/transaction/(success|prepare-reject|commit-fail|rollback-fail)) " , [ ] ( const httplib : : Request & request , httplib : : Response & response ) {
write_http_response ( response , transaction_scenario ( request . matches [ 1 ] . str ( ) , request ) ) ;
} ) ;