feat: admit signed education workbench module

This commit is contained in:
冰朔 2026-08-19 03:17:00 +08:00
commit df5e8f8e3c
24 changed files with 4986 additions and 20 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,8 @@ mod code_repo_login;
mod direct_local_broker;
mod direct_local_session;
mod dynamic_capability_routing;
mod education_translation;
mod education_workspace;
mod enterprise_work_channel;
mod glp_envelope;
mod gls_bootstrap_compiler;

View file

@ -45,6 +45,13 @@ const PERSONA_CHANNEL_BODY_PACKAGE: &[u8] = include_bytes!(
const PERSONA_CHANNEL_BODY_SIGNATURE: &str = include_str!(
"../../fixtures/module-packages/HLP-MOD-LOCAL-PERSONA-CHANNEL-BODY-0001-0.1.0.ghmod.sig"
);
const EDUCATION_WORKBENCH_NUMBER: &str = "HLP-MOD-OFFICIAL-EDUCATION-WORKBENCH-0001";
const EDUCATION_WORKBENCH_PACKAGE: &[u8] = include_bytes!(
"../../fixtures/module-packages/HLP-MOD-OFFICIAL-EDUCATION-WORKBENCH-0001-0.1.0.ghmod"
);
const EDUCATION_WORKBENCH_SIGNATURE: &str = include_str!(
"../../fixtures/module-packages/HLP-MOD-OFFICIAL-EDUCATION-WORKBENCH-0001-0.1.0.ghmod.sig"
);
struct BundledModuleSource {
module_number: &'static str,
@ -68,6 +75,11 @@ const BUNDLED_MODULES: &[BundledModuleSource] = &[
package: PERSONA_CHANNEL_BODY_PACKAGE,
signature: PERSONA_CHANNEL_BODY_SIGNATURE,
},
BundledModuleSource {
module_number: EDUCATION_WORKBENCH_NUMBER,
package: EDUCATION_WORKBENCH_PACKAGE,
signature: EDUCATION_WORKBENCH_SIGNATURE,
},
];
#[derive(Debug, Deserialize)]
@ -1513,7 +1525,7 @@ mod tests {
assert_eq!(package.manifest.adapter, "channel-workbench-v1");
assert_eq!(package.manifest.permissions.len(), 4);
assert!(is_sha256(&digest));
assert_eq!(BUNDLED_MODULES.len(), 3);
assert_eq!(BUNDLED_MODULES.len(), 4);
}
#[test]
@ -1534,6 +1546,25 @@ mod tests {
assert!(is_sha256(&digest));
}
#[test]
fn bundled_education_workbench_is_an_official_signed_module() {
let (_, package, digest) = read_verified_package_bytes(
EDUCATION_WORKBENCH_PACKAGE,
EDUCATION_WORKBENCH_SIGNATURE,
RELEASE_TRUST_RAW,
)
.unwrap();
assert_eq!(package.manifest.module_number, EDUCATION_WORKBENCH_NUMBER);
assert_eq!(package.manifest.registration_class, "OFFICIAL_LIGHTHOUSE");
assert_eq!(package.manifest.adapter, "education-workbench-v1");
assert_eq!(package.manifest.permissions.len(), 8);
assert_eq!(
package.payload["adapterConfig"]["importDefaultScope"],
"UNASSIGNED"
);
assert!(is_sha256(&digest));
}
#[cfg(unix)]
#[test]
fn symlinked_package_input_is_rejected_before_signature_processing() {

View file

@ -53,7 +53,7 @@ fn validate_tree() -> Result<(), String> {
|| tree.record_id != "HLP-UNIFIED-NUMBER-TREE-001"
|| tree.state != "MACHINE_COMPILED_STARTUP_ENFORCED"
|| tree.root_number != "HLP-NUMBER-WORLD-ROOT-001"
|| tree.route_count != 106
|| tree.route_count != 124
|| tree.routes.len() != tree.route_count
|| !tree.invariants.number_is_stable_coordinate_not_authority
|| !tree.invariants.path_is_unique_navigation

View file

@ -934,7 +934,7 @@ mod tests {
#[test]
fn registry_is_closed_and_contains_every_migrated_command() {
let registry = load_registry().unwrap();
assert_eq!(registry.operations.len(), 84);
assert_eq!(registry.operations.len(), 102);
assert!(!registry.runtime.legacy_direct_commands_allowed);
}

View file

@ -167,6 +167,67 @@ pub(crate) async fn dispatch(
"channel_growth::update_channel_growth_sharing" => {
json(crate::channel_growth::update_channel_growth_sharing(app, input(&payload)?).await?)
}
"education_workspace::get_education_workspace_snapshot" => {
json(crate::education_workspace::get_education_workspace_snapshot(app).await?)
}
"education_workspace::create_education_document" => json(
crate::education_workspace::create_education_document(app, input(&payload)?).await?,
),
"education_workspace::read_education_document" => {
json(crate::education_workspace::read_education_document(app, input(&payload)?).await?)
}
"education_workspace::save_education_document" => {
json(crate::education_workspace::save_education_document(app, input(&payload)?).await?)
}
"education_workspace::archive_education_document" => json(
crate::education_workspace::archive_education_document(app, input(&payload)?).await?,
),
"education_workspace::create_education_table" => {
json(crate::education_workspace::create_education_table(app, input(&payload)?).await?)
}
"education_workspace::read_education_table" => {
json(crate::education_workspace::read_education_table(app, input(&payload)?).await?)
}
"education_workspace::save_education_table" => {
json(crate::education_workspace::save_education_table(app, input(&payload)?).await?)
}
"education_workspace::archive_education_table" => {
json(crate::education_workspace::archive_education_table(app, input(&payload)?).await?)
}
"education_workspace::assign_imported_table_to_education" => json(
crate::education_workspace::assign_imported_table_to_education(app, input(&payload)?)
.await?,
),
"education_translation::import_education_tables_from_dialog" => {
json(crate::education_translation::import_education_tables_from_dialog(app).await?)
}
"education_translation::export_education_table_to_dialog" => json(
crate::education_translation::export_education_table_to_dialog(app, input(&payload)?)
.await?,
),
"education_translation::get_education_recognition_capability" => {
json(crate::education_translation::get_education_recognition_capability(app)?)
}
"education_workspace::create_education_automation_rule" => json(
crate::education_workspace::create_education_automation_rule(app, input(&payload)?)
.await?,
),
"education_workspace::save_education_automation_rule" => json(
crate::education_workspace::save_education_automation_rule(app, input(&payload)?)
.await?,
),
"education_workspace::archive_education_automation_rule" => json(
crate::education_workspace::archive_education_automation_rule(app, input(&payload)?)
.await?,
),
"education_workspace::preview_education_automation_rule" => json(
crate::education_workspace::preview_education_automation_rule(app, input(&payload)?)
.await?,
),
"education_workspace::execute_education_automation_rule" => json(
crate::education_workspace::execute_education_automation_rule(app, input(&payload)?)
.await?,
),
"local_development_bridge::acquire_development_write_lane" => json(
crate::local_development_bridge::acquire_development_write_lane(app, input(&payload)?)
.await?,