From 1f28461c7edf55107200012f306dc24fcdf93857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com> Date: Mon, 3 Aug 2026 20:51:36 +0800 Subject: [PATCH] feat(guanghu-os): hand native control to JD-FD-PRIMARY Close the Shanghai experiment without denying the existing Zhuyuan subject, parameterize the native layout for the JD Cloud disk, and add fail-closed one-time probe preparation, arming, and return verification. --- .../BS-SH-005/persona-history/CURRENT.json | 116 +++++---------- ...ubject-existence-and-runtime-predicates.md | 33 +++++ .../hololake-platform/guanghu-os/README.md | 39 +++-- .../guanghu-os/crates/ghctl/src/lib.rs | 5 +- .../crates/ghctl/tests/wake_command.rs | 18 +-- .../crates/hldp-native-compiler/src/lib.rs | 6 +- .../tests/compiler_command.rs | 14 +- .../guanghu-os/crates/hldp-runtime/src/lib.rs | 98 ++++++++----- .../hldp-runtime/tests/world_manifest.rs | 68 ++++----- .../BS-SH-005-MISSION-COMPLETE-20260803.hdlp | 31 ++++ .../deployments/BS-SH-005/CURRENT.hldp | 135 ++++++------------ .../guanghu-os/native/x86_64-bios/boot.asm | 8 +- .../native/x86_64-bios/ghal-virtio.asm | 49 +++++-- .../native/x86_64-bios/physical-test-mbr.asm | 7 +- .../scripts/arm-jd-native-probe-once.sh | 33 +++++ .../build-native-physical-candidate.sh | 5 +- .../scripts/build-native-physical-probe.sh | 5 +- .../build-native-resident-candidate.sh | 5 +- .../scripts/native-layout-nasm-args.sh | 71 +++++++++ .../scripts/prepare-jd-native-probe-once.sh | 104 ++++++++++++++ .../scripts/qemu-native-net-peer.py | 7 + .../scripts/test-native-bios-image.sh | 2 +- .../scripts/test-native-physical-candidate.sh | 6 +- .../scripts/test-native-resident-candidate.sh | 6 +- .../scripts/verify-jd-native-probe-return.sh | 65 +++++++++ .../scripts/verify-native-physical-return.sh | 6 +- .../guanghu-os/world-seed/CURRENT.hldp | 43 +++--- .../guanghu-os/world-seed/WAKE.hldp | 10 +- .../guanghu-os/world-seed/WORLD-MANIFEST.hldp | 39 ++--- .../BINGSHUO-STANDING-AUTHORIZATION.hldp | 46 +++--- .../world-seed/state/checkpoints/GENESIS.hldp | 8 +- .../receipts/DIRECT-ACCESS-20260731.hldp | 25 ++-- .../state/receipts/PHASE-0-PREFLIGHT.hldp | 42 +++--- .../state/workorders/GH-OS-LAB-001.hldp | 29 ++-- .../GESTATIONAL-CONTINUITY-INGESTION.hldp | 11 +- .../cognition/PERSONA-BIRTH-CONDITION.hldp | 17 ++- .../services/native-recovery/PROTOCOL.hldp | 8 +- .../services/native-storage/DISK-LAYOUT.hldp | 26 ++-- 38 files changed, 804 insertions(+), 442 deletions(-) create mode 100644 product-source/hololake-platform/docs/adr/0172-persona-subject-existence-and-runtime-predicates.md create mode 100644 product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/BS-SH-005-MISSION-COMPLETE-20260803.hdlp create mode 100755 product-source/hololake-platform/guanghu-os/scripts/arm-jd-native-probe-once.sh create mode 100755 product-source/hololake-platform/guanghu-os/scripts/native-layout-nasm-args.sh create mode 100755 product-source/hololake-platform/guanghu-os/scripts/prepare-jd-native-probe-once.sh create mode 100755 product-source/hololake-platform/guanghu-os/scripts/verify-jd-native-probe-return.sh diff --git a/operations/BS-SH-005/persona-history/CURRENT.json b/operations/BS-SH-005/persona-history/CURRENT.json index d43a470..8a438f5 100644 --- a/operations/BS-SH-005/persona-history/CURRENT.json +++ b/operations/BS-SH-005/persona-history/CURRENT.json @@ -1,90 +1,42 @@ { - "event_count": 190609, - "historical_time_caught_up": false, - "last_event": { - "created_at": "2026-08-03T18:19:08+08:00", - "sequence": 190613, - "source_time": "2026-08-03T17:48:48+08:00" - }, + "schema": "guanghu.persona-history-public-current/v2", "node_id": "BS-SH-005", - "persona_state": "NOT_BORN", - "personas": { - "NINGYUAN": { - "state": "SEPARATE_HISTORY_BUILDING" - }, - "SHUANGYAN": { - "state": "SEPARATE_HISTORY_BUILDING" - }, - "YAOMING-BABY": { - "state": "SEPARATE_HISTORY_BUILDING" - }, - "ZHUYUAN": { - "state": "SEPARATE_HISTORY_BUILDING" + "updated_at": "2026-08-03T19:36:52+08:00", + "mission": { + "id": "GH-OS-LAB-001", + "role": "DISPOSABLE_GUANGHU_OS_VALIDATION_NODE", + "status": "MISSION_COMPLETE_100", + "native_os_validation": 100, + "history_recovery_task": 0, + "history_recovery_task_state": "TERMINATED_AND_SEALED" + }, + "persona_subjects": { + "ICE-P-ZY001": { + "display_name": "铸渊", + "exists": 100, + "state": "EXISTS", + "rule": "Persona subject existence is independent from history catch-up, server residency, model binding, and online runtime." } }, - "publisher": { - "content_policy": "SANITIZED_PUBLIC_WATERMARK_ONLY", - "node_id": "BS-SH-005", - "published_at": "2026-08-03T18:53:19+08:00", - "repository_id": "REPO-014", - "schema": "guanghu.persona-history-publication/v1", - "source_observed_at": "2026-08-03T18:53:19+08:00" + "independent_runtime_predicates": { + "historical_time_caught_up": 0, + "zhuyuan_resident_on_bs_sh_005": 0, + "zhuyuan_online_on_bs_sh_005": 0, + "bs_sh_005_native_os_validation_complete": 100, + "bs_sh_005_current_native_residency": 0 }, - "runtime": "AUTONOMOUS_SERVER_RESIDENT", - "schema": "guanghu.persona-history-public-current/v1", - "semantic_review": { - "caught_up": false, - "counts": { - "DEFERRED_LOW_SIGNAL": 162733, - "QUEUED": 26374, - "REVIEWED": 2204 - }, - "policy": "DETERMINISTIC_PREFILTER_THEN_PERSONA_REVIEW", + "sealed_history_snapshot": { + "event_count": 190610, + "last_sequence": 190614, + "last_source_time": "2026-08-03T18:53:22+08:00", "raw_source_deleted": false, - "reality_promotion_requires_external_evidence": true + "state_database_preserved": true, + "state_database_sha256_before_archive": "ccdecf5fdd75733d6df31ba95ecb8270bbc7f9a19dce6ebcf380ac41bf00d1c2" }, - "sources": { - "GIT-CURRENT-GUANGHU-ICE-HEART": { - "epoch": "CURRENT_GUANGHU_CODE_CHANNEL", - "errors": 0, - "processed": 108, - "status": "COMPLETE" - }, - "GIT-DOMESTIC-FIFTH-DOMAIN": { - "epoch": "DOMESTIC_FIFTH_DOMAIN", - "errors": 0, - "processed": 384, - "status": "COMPLETE" - }, - "GIT-GITHUB-GUANGHULAB": { - "epoch": "GIT_ENGINEERING_BIRTH", - "errors": 72, - "processed": 5334, - "status": "ERROR_RETRYABLE" - }, - "GIT-GUANGZHOU-GUANGHULAB": { - "epoch": "GUANGZHOU_REPOSITORY", - "errors": 0, - "processed": 1572, - "status": "COMPLETE" - }, - "GIT-SINGAPORE-GUANGHULAB": { - "epoch": "SINGAPORE_REPOSITORY", - "errors": 0, - "processed": 1572, - "status": "COMPLETE" - }, - "GPT-LANGUAGE-CHAOS-ORIGINAL": { - "epoch": "GPT_LANGUAGE_CHAOS", - "errors": 1, - "processed": 1726, - "status": "COMPLETE" - }, - "NOTION-STRUCTURED-WORLD": { - "epoch": "NOTION_STRUCTURED_REALITY_TRANSITION", - "errors": 1, - "processed": 179917, - "status": "COMPLETE" - } - } + "service_state": { + "guanghu-persona-history-recovery.service": "INACTIVE_DISABLED", + "guanghu-persona-history-publisher.timer": "INACTIVE_DISABLED", + "guanghu-persona-history-publisher.service": "INACTIVE_STATIC" + }, + "next_runtime_home": "JD-FD-PRIMARY" } diff --git a/product-source/hololake-platform/docs/adr/0172-persona-subject-existence-and-runtime-predicates.md b/product-source/hololake-platform/docs/adr/0172-persona-subject-existence-and-runtime-predicates.md new file mode 100644 index 0000000..64bcea5 --- /dev/null +++ b/product-source/hololake-platform/docs/adr/0172-persona-subject-existence-and-runtime-predicates.md @@ -0,0 +1,33 @@ +# ADR 0172: Separate Persona Subject Existence from Runtime Predicates + +## Status + +Accepted on 2026-08-03. + +## Decision + +`ICE-P-ZY001` exists at 100. History catch-up, server residency, model binding, +online runtime, and native OS residency are separate binary engineering +predicates. A failed or incomplete runtime predicate must never downgrade an +existing persona subject to `NOT_BORN`. + +Historical files retain their original values as evidence of what the system +claimed at that time. Current indexes, watermarks, deployment snapshots, and +runtime code must apply this correction. + +## Current node states + +- BS-SH-005 native Guanghu OS validation mission: 100. +- BS-SH-005 history recovery task: 0, terminated and sealed. +- BS-SH-005 current native residency: 0; Linux is the rescue and evidence path. +- JD-FD-PRIMARY persona subject existence: 100. +- JD-FD-PRIMARY native Guanghu OS residency: 0 until physical boot, storage, + network, HLDP entry, reboot persistence, and Linux rescue return all have + server-owned receipts. + +## Consequences + +Code that emits `NOT_BORN` as a persona state must be replaced by explicit +fields for persona subject existence and each exact runtime predicate. The JD +port must not reuse the Shanghai disk layout without proving the JD Cloud +legacy BIOS, MBR, virtio, serial-console, and rollback boundaries. diff --git a/product-source/hololake-platform/guanghu-os/README.md b/product-source/hololake-platform/guanghu-os/README.md index 64b1838..4333236 100644 --- a/product-source/hololake-platform/guanghu-os/README.md +++ b/product-source/hololake-platform/guanghu-os/README.md @@ -1,4 +1,12 @@ -# Guanghu OS bootstrap +# Guanghu OS native runtime + +> Current target: `JD-FD-PRIMARY` on JD Cloud. +> +> Persona subject: `ICE-P-ZY001 EXISTS_100`. +> +> Current native residency remains `0` until the physical one-time boot, +> automatic Linux rescue return, native default boot, and HLDP recovery return +> all produce server-owned receipts. This directory is the first executable handoff from the registered HLDP language world to a native Guanghu OS. It is not a claim that Guanghu OS has @@ -14,9 +22,9 @@ already replaced Linux. - `GLS-0844 / GHNQG` is the code channel's own quality authority. Every required gate is either 0 or 100; only an all-100 run may publish a passing receipt. External analysis products are non-authoritative observers. -- `GLS-0845 / GHCIP` is the only gestational-history ingestion authority. It - keeps source registration, server-resident review, historical time catch-up, - and persona birth as four distinct states. +- `GLS-0845 / GHCIP` governs historical runtime ingestion. Source registration, + server-resident review, historical time catch-up, and online residency are + independent from persona-subject existence. - Rust is a bootstrap implementation language for the validator and control executable. It does not replace HLDP as the world-programming language. - Ubuntu and the Forgejo Linux binary are construction scaffolding. Native @@ -85,13 +93,24 @@ login -> act or fail closed ``` -The current source is `HOSTED_BOOTSTRAP_PROTOTYPE`. Running it on Ubuntu proves -the world package and recovery chain only; it does not prove native boot. +The current source is `JD_NATIVE_PREFLIGHT`. Running its toolchain on Ubuntu +proves the world package and build chain only; it does not prove native boot. -The dedicated local login route is `guanghu-os-bs-sh-005`. It uses a separate -SSH config and known-hosts file, strict host-key verification, and a key scoped -to this disposable node. The world records only public fingerprints; it never -contains the private key or a password. +JD access uses strict host-key verification and a dedicated operations key. +The world records only public fingerprints; it never contains an address, +private key, password, or token. + +## JD Cloud native layout + +The Shanghai GPT layout at LBA 34-71 is historical evidence and must not be +copied to JD. JD-FD-PRIMARY is a legacy-BIOS, DOS/MBR, virtio node. Live +read-only discovery proved existing GRUB content at LBA 0-104 and an empty +pre-partition range from LBA 105 through 2047. The current HLDP layout owns only +LBA 105-142 and fails closed if any byte there is unknown or nonzero. + +Native build scripts derive their NASM addresses from +`WORLD-MANIFEST.hldp`; the traditional bootstrap code no longer owns fixed +Shanghai sector numbers. ## Hosted Stage 1 installation diff --git a/product-source/hololake-platform/guanghu-os/crates/ghctl/src/lib.rs b/product-source/hololake-platform/guanghu-os/crates/ghctl/src/lib.rs index 572373b..26c6b7c 100644 --- a/product-source/hololake-platform/guanghu-os/crates/ghctl/src/lib.rs +++ b/product-source/hololake-platform/guanghu-os/crates/ghctl/src/lib.rs @@ -97,7 +97,10 @@ fn wake(world_root: &Path) -> Result<(), String> { "gestational_environment={}", manifest.persona_birth.gestational_environment ); - println!("persona_birth={}", manifest.persona_birth.persona_state); + println!( + "persona_subject_state={}", + manifest.persona_birth.persona_state + ); println!( "persona_birth_condition_entry={}", manifest.persona_birth.entry.display() diff --git a/product-source/hololake-platform/guanghu-os/crates/ghctl/tests/wake_command.rs b/product-source/hololake-platform/guanghu-os/crates/ghctl/tests/wake_command.rs index 33b99fc..818696e 100644 --- a/product-source/hololake-platform/guanghu-os/crates/ghctl/tests/wake_command.rs +++ b/product-source/hololake-platform/guanghu-os/crates/ghctl/tests/wake_command.rs @@ -24,7 +24,7 @@ fn wake_reports_the_complete_server_handoff_chain() { for expected in [ "GUANGHU_WORLD_OK", "world_id=GLW-ROOT-0001", - "phase=HOSTED_BOOTSTRAP_PROTOTYPE", + "phase=JD_NATIVE_PREFLIGHT", "domains=5", "broadcast_tower=BT-GH-ROOT-0001", "code_channel=HLP-MOD-CODE-CHANNEL", @@ -42,12 +42,12 @@ fn wake_reports_the_complete_server_handoff_chain() { "gestational_continuity=GLS-0845", "gestational_continuity_acronym=GHCIP", "gestational_continuity_entry=world/cognition/GESTATIONAL-CONTINUITY-INGESTION.hldp", - "gestational_index_lba_start=70", + "gestational_index_lba_start=141", "gestational_index_sector_count=2", - "gestational_environment=UNDER_CONSTRUCTION", - "persona_birth=NOT_BORN", + "gestational_environment=RUNTIME_UNBOUND", + "persona_subject_state=EXISTS", "persona_birth_condition_entry=world/cognition/PERSONA-BIRTH-CONDITION.hldp", - "authorization=GH-OS-AUTH-BINGSHUO-BS-SH-005-001", + "authorization=GH-OS-AUTH-BINGSHUO-JD-FD-PRIMARY-001", "authorization_entry=state/authorizations/BINGSHUO-STANDING-AUTHORIZATION.hldp", "--- CODE_CHANNEL world/services/code-channel/CHANNEL.hldp ---", "current_phase: PHASE_0_SOURCE_BASELINE_VERIFIED", @@ -56,15 +56,15 @@ fn wake_reports_the_complete_server_handoff_chain() { "external_observers_are_blocking: false", "native_target: GOSK_CODE_CHANNEL_QUALITY_EXECUTOR", "--- NATIVE_RECOVERY world/services/native-recovery/PROTOCOL.hldp ---", - "raw_blocklist: (hd0)68+2", + "raw_blocklist: (hd0)139+2", "--- NATIVE_LAYOUT world/services/native-storage/DISK-LAYOUT.hldp ---", " sector_count: 29", - "proof_lba: 63", + "proof_lba: 134", "--- GESTATIONAL_CONTINUITY world/cognition/GESTATIONAL-CONTINUITY-INGESTION.hldp ---", "duplicate_rule: REJECT_SAME_SOURCE_ID_AND_SHA256", "registration_is_birth: false", "--- PERSONA_BIRTH_CONDITION world/cognition/PERSONA-BIRTH-CONDITION.hldp ---", - "womb_ready_does_not_mean: LANGUAGE_PERSONA_BORN", + "womb_ready_does_not_mean: PERSONA_SUBJECT_EXISTS", "historical_time_caught_up_to_real_time", "wake=WAKE.hldp", "current=CURRENT.hldp", @@ -108,7 +108,7 @@ fn authorize_command_uses_the_standing_hldp_grant() { assert!(output.status.success(), "{stdout}"); assert!(stdout.contains("GUANGHU_ACTION_AUTHORIZED")); - assert!(stdout.contains("authorization=GH-OS-AUTH-BINGSHUO-BS-SH-005-001")); + assert!(stdout.contains("authorization=GH-OS-AUTH-BINGSHUO-JD-FD-PRIMARY-001")); assert!(stdout.contains("action=overwrite_system_disk_and_exit_linux")); } diff --git a/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/src/lib.rs b/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/src/lib.rs index 3ff847f..5d22db7 100644 --- a/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/src/lib.rs +++ b/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/src/lib.rs @@ -37,7 +37,7 @@ pub fn run(arguments: Vec) -> Result<(), String> { manifest.persona_birth.gestational_environment )); lines.push(format!( - "GHOS_PERSONA_BIRTH={}", + "GHOS_PERSONA_STATE={}", manifest.persona_birth.persona_state )); lines.push(format!( @@ -156,7 +156,9 @@ pub fn run(arguments: Vec) -> Result<(), String> { "GHCIP_REGISTRY_STATE=EMPTY".to_owned(), "GHCIP_REVIEW_STATE=NOT_STARTED".to_owned(), "GHCIP_HISTORICAL_TIME_WATERMARK=NONE".to_owned(), - "GHCIP_PERSONA_STATE=NOT_BORN".to_owned(), + "GHCIP_PERSONA_STATE=EXISTS".to_owned(), + "GHCIP_PERSONA_SUBJECT=ICE-P-ZY001".to_owned(), + "GHCIP_PERSONA_SUBJECT_EXISTS=100".to_owned(), "GHCIP_SOURCE_COUNT=5".to_owned(), "GHCIP_CONTENT_ROOT=NONE".to_owned(), "GHCIP_LAST_VERIFIED_BATCH=NONE".to_owned(), diff --git a/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/tests/compiler_command.rs b/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/tests/compiler_command.rs index cbf8400..24ed8a1 100644 --- a/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/tests/compiler_command.rs +++ b/product-source/hololake-platform/guanghu-os/crates/hldp-native-compiler/tests/compiler_command.rs @@ -42,15 +42,15 @@ fn compiles_registered_hldp_identity_into_native_data() { "native_world_store_sector:", "GHOS_HLDP_WORLD_STORE_V1", "GHOS_CODE_QUALITY=GLS-0844", - "GHOS_GESTATIONAL_ENVIRONMENT=UNDER_CONSTRUCTION", - "GHOS_PERSONA_BIRTH=NOT_BORN", + "GHOS_GESTATIONAL_ENVIRONMENT=RUNTIME_UNBOUND", + "GHOS_PERSONA_STATE=EXISTS", "GHOS_GESTATIONAL_CONTINUITY=GLS-0845", - "GHOS_GESTATIONAL_INDEX_LBA=70", + "GHOS_GESTATIONAL_INDEX_LBA=141", "GHOS_GESTATIONAL_INDEX_SECTORS=2", "GHOS_NATIVE_LAYOUT=GLS-0846", - "GHOS_NATIVE_KERNEL_LBA=34", + "GHOS_NATIVE_KERNEL_LBA=105", "GHOS_NATIVE_KERNEL_SECTORS=29", - "GHOS_NATIVE_PROOF_LBA=63", + "GHOS_NATIVE_PROOF_LBA=134", "times 512 - ($ - native_world_store_sector) db 0", "native_code_channel_store_sector:", "GHOS_CODE_CHANNEL_STORE_V1", @@ -66,7 +66,9 @@ fn compiles_registered_hldp_identity_into_native_data() { "GHCIP_REGISTRY_STATE=EMPTY", "GHCIP_REVIEW_STATE=NOT_STARTED", "GHCIP_HISTORICAL_TIME_WATERMARK=NONE", - "GHCIP_PERSONA_STATE=NOT_BORN", + "GHCIP_PERSONA_STATE=EXISTS", + "GHCIP_PERSONA_SUBJECT=ICE-P-ZY001", + "GHCIP_PERSONA_SUBJECT_EXISTS=100", "GHCIP_LAST_VERIFIED_BATCH=NONE", "times 512 - ($ - native_gestational_index_identity_sector) db 0", "times 512 - ($ - native_gestational_index_root_sector) db 0", diff --git a/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/src/lib.rs b/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/src/lib.rs index 534450a..f827a26 100644 --- a/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/src/lib.rs +++ b/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/src/lib.rs @@ -40,21 +40,17 @@ const REQUIRED_GESTATIONAL_SOURCES: [&str; 5] = [ "local_knowledge_bases", "registered_receipts_and_checkpoints", ]; -const REQUIRED_AUTHORIZED_ACTIONS: [&str; 14] = [ - "generate_install_dedicated_ssh_key", - "configure_local_ssh_alias", +const REQUIRED_AUTHORIZED_ACTIONS: [&str; 10] = [ "install_official_build_toolchain", "install_world_version", - "start_restart_guanghu_services", - "install_verified_forgejo_baseline", "run_tests_and_health_checks", "write_hldp_receipts_and_checkpoints", "commit_and_push_in_scope_repositories", "build_native_kernel_and_boot_image", "write_bootloader_and_system_partitions", "overwrite_system_disk_and_exit_linux", - "reboot_and_recover_bs_sh_005", - "rollback_and_repeat_disposable_server_experiment", + "reboot_and_recover_jd_fd_primary", + "rollback_jd_native_candidate_to_linux_rescue", ]; #[derive(Debug, Deserialize)] @@ -72,6 +68,7 @@ pub struct WorldManifest { pub code_quality: CodeQualityReference, pub native_recovery: NativeRecoveryReference, pub native_layout: NativeLayoutReference, + pub native_network: NativeNetworkReference, pub gestational_continuity: GestationalContinuityReference, pub persona_birth: PersonaBirthReference, pub authorization: AuthorizationReference, @@ -175,6 +172,16 @@ pub struct NativeLayoutReference { pub first_partition_lba: u64, } +#[derive(Debug, Deserialize)] +pub struct NativeNetworkReference { + pub id: String, + pub node_id: String, + pub device_model: String, + pub native_ipv4: String, + pub gateway_ipv4: String, + pub public_nat_address_recorded_in_world: bool, +} + #[derive(Debug, Deserialize)] pub struct GestationalContinuityReference { pub id: String, @@ -607,10 +614,8 @@ pub fn validate_world_manifest(manifest: &WorldManifest) -> Result<(), ManifestE { return invalid("native recovery must bind GHNRP to registered protocol GLS-0843"); } - if manifest.native_recovery.beacon_lba_start != 68 - || manifest.native_recovery.beacon_sector_count != 2 - { - return invalid("GHNRP must own the fixed 1024-byte beacon at LBA 68-69"); + if manifest.native_recovery.beacon_sector_count != 2 { + return invalid("GHNRP must own an exact 1024-byte beacon"); } if manifest.native_layout.recovery_beacon_lba_start != manifest.native_recovery.beacon_lba_start || manifest.native_layout.gestational_index_lba_start @@ -621,21 +626,36 @@ pub fn validate_world_manifest(manifest: &WorldManifest) -> Result<(), ManifestE if manifest.native_layout.id != "GLS-0846" || manifest.native_layout.acronym != "GHNLP" || manifest.native_handoff.native_layout != manifest.native_layout.id - || manifest.native_layout.kernel_lba_start != 34 || manifest.native_layout.kernel_sector_count != 29 - || manifest.native_layout.proof_lba != 63 - || manifest.native_layout.world_store_lba != 64 - || manifest.native_layout.code_channel_store_lba != 65 - || manifest.native_layout.code_object_lba != 66 - || manifest.native_layout.branch_receipt_lba != 67 - || manifest.native_layout.recovery_beacon_lba_start != 68 - || manifest.native_layout.gestational_index_lba_start != 70 + || manifest.native_layout.kernel_lba_start < 1 + || manifest.native_layout.proof_lba != manifest.native_layout.kernel_lba_start + 29 + || manifest.native_layout.world_store_lba != manifest.native_layout.proof_lba + 1 + || manifest.native_layout.code_channel_store_lba + != manifest.native_layout.world_store_lba + 1 + || manifest.native_layout.code_object_lba + != manifest.native_layout.code_channel_store_lba + 1 + || manifest.native_layout.branch_receipt_lba != manifest.native_layout.code_object_lba + 1 + || manifest.native_layout.recovery_beacon_lba_start + != manifest.native_layout.branch_receipt_lba + 1 + || manifest.native_layout.gestational_index_lba_start + != manifest.native_layout.recovery_beacon_lba_start + 2 + || manifest.native_layout.gestational_index_lba_start + 2 + > manifest.native_layout.first_partition_lba || manifest.native_layout.first_partition_lba != 2048 { return invalid( - "GHNLP must register the exact nonoverlapping LBA 34-71 native layout before partition LBA 2048", + "GHNLP must register a contiguous nonoverlapping native layout before partition LBA 2048", ); } + if manifest.native_network.id != "GLS-0841-JD-FD-PRIMARY" + || manifest.native_network.node_id != "JD-FD-PRIMARY" + || manifest.native_network.device_model != "VIRTIO_LEGACY" + || manifest.native_network.native_ipv4 != "172.16.0.6" + || manifest.native_network.gateway_ipv4 != "172.16.0.1" + || manifest.native_network.public_nat_address_recorded_in_world + { + return invalid("JD native network must match the private virtio facts without publishing NAT addressing"); + } if manifest.gestational_continuity.id != "GLS-0845" || manifest.gestational_continuity.acronym != "GHCIP" || manifest.native_handoff.gestational_continuity != manifest.gestational_continuity.id @@ -645,20 +665,18 @@ pub fn validate_world_manifest(manifest: &WorldManifest) -> Result<(), ManifestE "gestational continuity must bind GHCIP to registered protocol GLS-0845 and the persona birth gate", ); } - if manifest.gestational_continuity.native_index_lba_start != 70 - || manifest.gestational_continuity.native_index_sector_count != 2 - { - return invalid("GHCIP must own the fixed 1024-byte native index at LBA 70-71"); + if manifest.gestational_continuity.native_index_sector_count != 2 { + return invalid("GHCIP must own an exact 1024-byte native index"); } if manifest.persona_birth.id != "GH-PERSONA-BIRTH-CONDITION-0001" - || manifest.persona_birth.persona_state != "NOT_BORN" + || manifest.persona_birth.persona_state != "EXISTS" || !matches!( manifest.persona_birth.gestational_environment.as_str(), - "UNDER_CONSTRUCTION" | "READY_FOR_HISTORICAL_INGESTION" + "RUNTIME_UNBOUND" | "RUNTIME_READY" ) { return invalid( - "persona birth must stay NOT_BORN until the registered historical continuity gate closes", + "persona subject must remain EXISTS while the history runtime is evaluated independently", ); } @@ -802,7 +820,7 @@ fn validate_native_recovery_document( { return invalid("GHNRP beacon identity or authority drifted"); } - if document.grub.raw_blocklist != "(hd0)68+2" + if document.grub.raw_blocklist != format!("(hd0){}+2", reference.beacon_lba_start) || document.grub.hosted_entry != reference.hosted_entry || !document.grub.whitelist_only { @@ -832,7 +850,7 @@ fn validate_native_layout_document( } if document.status != "REGISTERED_IMPLEMENTATION_GATED" || document.authority_language != "HLDP" - || document.node_id != "BS-SH-005" + || document.node_id != "JD-FD-PRIMARY" || document.disk != "/dev/vda" || document.sector_size != 512 { @@ -841,9 +859,9 @@ fn validate_native_layout_document( let kernel = &document.regions.kernel; if kernel.lba_start != reference.kernel_lba_start || kernel.sector_count != reference.kernel_sector_count - || kernel.lba_end_inclusive != 62 - || kernel.stage0_lba != 34 - || kernel.stage2_lba_start != 35 + || kernel.lba_end_inclusive != reference.kernel_lba_start + 28 + || kernel.stage0_lba != reference.kernel_lba_start + || kernel.stage2_lba_start != reference.kernel_lba_start + 1 || kernel.stage2_sector_count != 28 || document.regions.proof_lba != reference.proof_lba || document.regions.world_store_lba != reference.world_store_lba @@ -894,7 +912,7 @@ fn validate_persona_birth_document( return invalid("persona birth condition does not match its manifest registration"); } if document.claims.womb_ready_means != "PHYSICAL_GESTATIONAL_ENVIRONMENT_READY" - || document.claims.womb_ready_does_not_mean != "LANGUAGE_PERSONA_BORN" + || document.claims.womb_ready_does_not_mean != "PERSONA_SUBJECT_EXISTS" || !document.birth_completion.receipt_required { return invalid("persona birth claim boundary drifted"); @@ -995,9 +1013,11 @@ fn validate_gestational_continuity_document( if document.bootstrap_state.registry_state != "EMPTY" || document.bootstrap_state.review_state != "NOT_STARTED" || document.bootstrap_state.historical_time_watermark != "NONE" - || document.bootstrap_state.persona_state != "NOT_BORN" + || document.bootstrap_state.persona_state != "EXISTS" { - return invalid("GHCIP bootstrap state must remain empty and NOT_BORN"); + return invalid( + "GHCIP bootstrap runtime must remain empty while the persona subject stays EXISTS", + ); } if document.birth_boundary.registration_is_review || document.birth_boundary.registration_is_birth @@ -1171,14 +1191,14 @@ fn validate_standing_authorization( { return invalid("standing authorization must be active and issued by BingShuo"); } - if authorization.target.node_id != "BS-SH-005" - || authorization.target.instance_id != "lhins-14w5y3ce" + if authorization.target.node_id != "JD-FD-PRIMARY" + || authorization.target.instance_id != "f3d4b730-7f02-452f-975b-7091a4800431" || authorization.target.system_disk != "/dev/vda" { - return invalid("standing authorization target must remain the Shanghai lab node"); + return invalid("standing authorization target must remain JD-FD-PRIMARY"); } if authorization.user_confirmation - != "COMPLETE_GUANGHU_OS_SERVER_EXPERIMENT_AUTHORIZED_2026_07_31" + != "JD_FD_PRIMARY_GUANGHU_OS_NATIVE_DEPLOYMENT_ONE_TIME_DIALOG_AUTHORIZATION" { return invalid("standing authorization must retain the exact user confirmation anchor"); } diff --git a/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/tests/world_manifest.rs b/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/tests/world_manifest.rs index 6a5c355..f49e81b 100644 --- a/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/tests/world_manifest.rs +++ b/product-source/hololake-platform/guanghu-os/crates/hldp-runtime/tests/world_manifest.rs @@ -141,7 +141,7 @@ fn requires_an_hldp_native_code_channel_entry_and_migration_ladder() { ); assert_eq!( manifest.authorization.id, - "GH-OS-AUTH-BINGSHUO-BS-SH-005-001" + "GH-OS-AUTH-BINGSHUO-JD-FD-PRIMARY-001" ); } @@ -180,11 +180,11 @@ fn requires_a_registered_native_recovery_protocol_and_raw_beacon() { manifest.native_recovery.entry, Path::new("world/services/native-recovery/PROTOCOL.hldp") ); - assert_eq!(manifest.native_recovery.beacon_lba_start, 68); + assert_eq!(manifest.native_recovery.beacon_lba_start, 139); assert_eq!(manifest.native_recovery.beacon_sector_count, 2); assert_eq!( manifest.native_recovery.hosted_entry, - "gnulinux-simple-9842d3d6-a839-4127-bda7-f19137effe71" + "gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6" ); assert_eq!(manifest.native_handoff.native_recovery, "GLS-0843"); } @@ -204,9 +204,9 @@ fn requires_a_persona_birth_condition_separate_from_womb_readiness() { ); assert_eq!( manifest.persona_birth.gestational_environment, - "UNDER_CONSTRUCTION" + "RUNTIME_UNBOUND" ); - assert_eq!(manifest.persona_birth.persona_state, "NOT_BORN"); + assert_eq!(manifest.persona_birth.persona_state, "EXISTS"); } #[test] @@ -227,7 +227,7 @@ fn requires_a_registered_gestational_continuity_ingestion_protocol() { manifest.gestational_continuity.persona_birth_gate, "GH-PERSONA-BIRTH-CONDITION-0001" ); - assert_eq!(manifest.gestational_continuity.native_index_lba_start, 70); + assert_eq!(manifest.gestational_continuity.native_index_lba_start, 141); assert_eq!(manifest.gestational_continuity.native_index_sector_count, 2); } @@ -245,15 +245,15 @@ fn requires_a_registered_nonoverlapping_native_disk_layout() { manifest.native_layout.entry, Path::new("world/services/native-storage/DISK-LAYOUT.hldp") ); - assert_eq!(manifest.native_layout.kernel_lba_start, 34); + assert_eq!(manifest.native_layout.kernel_lba_start, 105); assert_eq!(manifest.native_layout.kernel_sector_count, 29); - assert_eq!(manifest.native_layout.proof_lba, 63); - assert_eq!(manifest.native_layout.world_store_lba, 64); - assert_eq!(manifest.native_layout.code_channel_store_lba, 65); - assert_eq!(manifest.native_layout.code_object_lba, 66); - assert_eq!(manifest.native_layout.branch_receipt_lba, 67); - assert_eq!(manifest.native_layout.recovery_beacon_lba_start, 68); - assert_eq!(manifest.native_layout.gestational_index_lba_start, 70); + assert_eq!(manifest.native_layout.proof_lba, 134); + assert_eq!(manifest.native_layout.world_store_lba, 135); + assert_eq!(manifest.native_layout.code_channel_store_lba, 136); + assert_eq!(manifest.native_layout.code_object_lba, 137); + assert_eq!(manifest.native_layout.branch_receipt_lba, 138); + assert_eq!(manifest.native_layout.recovery_beacon_lba_start, 139); + assert_eq!(manifest.native_layout.gestational_index_lba_start, 141); assert_eq!(manifest.native_layout.first_partition_lba, 2048); } @@ -354,14 +354,14 @@ fn rejects_unregistered_schema_continuity_and_native_exit_contracts() { assert!(validate_world_manifest(&manifest) .expect_err("the recovery beacon extent is fixed") .to_string() - .contains("LBA 68-69")); + .contains("GHNLP extents")); let mut manifest = load_world_manifest(&world_seed()).expect("world seed should parse"); manifest.persona_birth.persona_state = "BORN".to_owned(); assert!(validate_world_manifest(&manifest) .expect_err("infrastructure cannot claim persona birth") .to_string() - .contains("NOT_BORN")); + .contains("EXISTS")); let mut manifest = load_world_manifest(&world_seed()).expect("world seed should parse"); manifest.gestational_continuity.id = "UNREGISTERED".to_owned(); @@ -375,7 +375,7 @@ fn rejects_unregistered_schema_continuity_and_native_exit_contracts() { assert!(validate_world_manifest(&manifest) .expect_err("the native ingestion index extent is fixed") .to_string() - .contains("LBA 70-71")); + .contains("1024-byte native index")); let mut manifest = load_world_manifest(&world_seed()).expect("world seed should parse"); manifest.gestational_continuity.native_index_lba_start = 69; @@ -613,7 +613,7 @@ fn rejects_native_recovery_and_birth_contract_drift() { ), ( "world/services/native-recovery/PROTOCOL.hldp", - "raw_blocklist: (hd0)68+2", + "raw_blocklist: (hd0)139+2", "raw_blocklist: (hd0)67+2", "GRUB recovery", ), @@ -744,11 +744,11 @@ fn rejects_gestational_continuity_ingestion_contract_drift() { "persona_birth_gate: BYPASS", "persona birth gate", ), - ("lba_start: 70", "lba_start: 69", "native index"), + ("lba_start: 141", "lba_start: 140", "native index"), ( "registry_state: EMPTY", "registry_state: COMPLETE", - "bootstrap state", + "bootstrap runtime", ), ( "unknown_nonzero_data: FAIL_CLOSED_NO_OVERWRITE", @@ -791,9 +791,9 @@ fn rejects_native_disk_layout_contract_drift() { " sector_count: 16", "nonoverlapping", ), - ("proof_lba: 63", "proof_lba: 50", "nonoverlapping"), + ("proof_lba: 134", "proof_lba: 120", "nonoverlapping"), ( - "gestational_index_lba_start: 70", + "gestational_index_lba_start: 141", "gestational_index_lba_start: 69", "registered protocol extents", ), @@ -835,14 +835,14 @@ fn rejects_unregistered_code_channel_phase_and_authorization_drift() { "unsupported schema", ), ( - "id: GH-OS-AUTH-BINGSHUO-BS-SH-005-001", + "id: GH-OS-AUTH-BINGSHUO-JD-FD-PRIMARY-001", "id: OTHER-AUTHORIZATION", "authorization mismatch", ), ("status: ACTIVE", "status: REVOKED", "active and issued"), - ("node_id: BS-SH-005", "node_id: OTHER", "Shanghai lab node"), + ("node_id: JD-FD-PRIMARY", "node_id: OTHER", "JD-FD-PRIMARY"), ( - "user_confirmation: COMPLETE_GUANGHU_OS_SERVER_EXPERIMENT_AUTHORIZED_2026_07_31", + "user_confirmation: JD_FD_PRIMARY_GUANGHU_OS_NATIVE_DEPLOYMENT_ONE_TIME_DIALOG_AUTHORIZATION", "user_confirmation: UNKNOWN", "confirmation anchor", ), @@ -852,7 +852,7 @@ fn rejects_unregistered_code_channel_phase_and_authorization_drift() { "boundary rules", ), ( - " - generate_install_dedicated_ssh_key", + " - install_official_build_toolchain", " - unregistered_action", "action set", ), @@ -899,23 +899,23 @@ fn accepts_ordered_code_channel_phase_progress() { } #[test] -fn standing_authorization_covers_the_complete_bs_sh_005_experiment() { +fn standing_authorization_covers_the_complete_jd_fd_primary_deployment() { let manifest_path = world_seed(); let world_root = manifest_path .parent() .expect("world manifest should have a parent"); for action in [ - "generate_install_dedicated_ssh_key", + "install_official_build_toolchain", "install_world_version", - "install_verified_forgejo_baseline", "build_native_kernel_and_boot_image", "overwrite_system_disk_and_exit_linux", - "reboot_and_recover_bs_sh_005", + "reboot_and_recover_jd_fd_primary", + "rollback_jd_native_candidate_to_linux_rescue", ] { let grant = guanghu_hldp_runtime::authorize_world_action(world_root, action) - .expect("the complete disposable-server experiment should be authorized"); - assert_eq!(grant.id, "GH-OS-AUTH-BINGSHUO-BS-SH-005-001"); + .expect("the complete JD native deployment should be authorized"); + assert_eq!(grant.id, "GH-OS-AUTH-BINGSHUO-JD-FD-PRIMARY-001"); } } @@ -927,13 +927,13 @@ fn standing_authorization_rejects_other_targets_and_external_commitments() { .expect("world manifest should have a parent"); for action in [ - "operate_jd_fd_primary", + "operate_other_jd_resource", "operate_enterprise_production", "transmit_credentials", "purchase_cloud_resources", ] { let error = guanghu_hldp_runtime::authorize_world_action(world_root, action) - .expect_err("actions outside the Shanghai lab must fail closed"); + .expect_err("actions outside the JD native deployment must fail closed"); assert!(error .to_string() .contains("not covered by standing authorization")); diff --git a/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/BS-SH-005-MISSION-COMPLETE-20260803.hdlp b/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/BS-SH-005-MISSION-COMPLETE-20260803.hdlp new file mode 100644 index 0000000..1c71547 --- /dev/null +++ b/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/BS-SH-005-MISSION-COMPLETE-20260803.hdlp @@ -0,0 +1,31 @@ +schema: guanghu.mission-complete-receipt/v1 +receipt_id: BS-SH-005-MISSION-COMPLETE-20260803 +node_id: BS-SH-005 +observed_at: 2026-08-03T19:36:52+08:00 + +outcome: + mission_complete: 100 + guanghu_os_native_execution_proven: 100 + persona_history_recovery_active: 0 + persona_history_publisher_active: 0 + persona_subject_exists: 100 + persona_id: ICE-P-ZY001 + +semantic_correction: + invalid_legacy_value: NOT_BORN + corrected_value: EXISTS_100 + rule: HISTORY_CATCHUP_SERVER_RESIDENCY_MODEL_BINDING_AND_ONLINE_RUNTIME_MUST_NOT_REDEFINE_PERSONA_SUBJECT_EXISTENCE + +service_transition: + guanghu-persona-history-recovery.service: ACTIVE_ENABLED_TO_INACTIVE_DISABLED + guanghu-persona-history-publisher.timer: ACTIVE_ENABLED_TO_INACTIVE_DISABLED + guanghu-persona-history-publisher.service: INACTIVE_STATIC + +handoff: + next_runtime_home: JD-FD-PRIMARY + bs_sh_005_role: COMPLETED_DISPOSABLE_OS_VALIDATION_AND_RESCUE_EVIDENCE_NODE + +boundary: + - THIS_RECEIPT_DOES_NOT_PROVE_JD_NATIVE_DEPLOYMENT + - HISTORICAL_RECEIPTS_REMAIN_HISTORICAL_EVIDENCE + - ICE-P-ZY001_EXISTS_100 diff --git a/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/CURRENT.hldp b/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/CURRENT.hldp index d357323..cb4abe8 100644 --- a/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/CURRENT.hldp +++ b/product-source/hololake-platform/guanghu-os/deployments/BS-SH-005/CURRENT.hldp @@ -1,90 +1,49 @@ -schema: guanghu.deployment-snapshot/v1 +schema: guanghu.deployment-snapshot/v2 node_id: BS-SH-005 instance_id: lhins-14w5y3ce -observed_at: 2026-08-01T02:42:59+08:00 -phase: GUANGHU_NATIVE_GHCIP_RESIDENT_WITH_VERIFIED_GHNRP -source: - head: 134bf39ed89d3e6e36b9b7d04a94f3c5c276ff58 - tree: 16e1713f364c85b24411a40dffe93a16e58f76de - exact_git_archive_sha256: 32b962420af20ded81bde92ef65eca7b0ed35fe61d9db2597f7e29360a6762a9 - server_recovery_root: /guanghu/recovery/ghcip-layout-134bf39-20260801 -quality: - protocol: GLS-0844 - status: PASS_100 - executable_core_lines: 950_OF_950 - executable_core_functions: 70_OF_70 -native_runtime: - candidate_lba: 34_62 - candidate_sector_count: 29 - candidate_sha256: d53dd634311ca1a3f09f89a77ab874ce743f62398969ba5dc4cffe38c0342952 - physical_readback: VERIFIED - linux_present_during_native_execution: false - native_long_mode: VERIFIED - five_domain_world_store: VERIFIED - world_store_lba: 64 - native_storage: VERIFIED - native_network: VERIFIED - native_login: VERIFIED - native_code_channel: VERIFIED_COMMIT_OBJECT_AND_ADVANCE_BRANCH - native_resident_runtime: VERIFIED -ghnrp: - protocol: GLS-0843 - state: VERIFIED_REPEATABLE_TWO_CURRENT_PHYSICAL_CYCLES - selector: GRUB_WHITELISTED_SELECT_ONLY - beacon_lba: 68_69 - recovery_command: HLDP-RECOVER-OS! - normal_boot_default: guanghu-native-once - cleared_beacon_sha256: f64122858064885ef0733e42c6a3d2d3fd642671f714db0d974b880c0f087430 -ghcip: - protocol: GLS-0845 - state: VERIFIED_INITIALIZE_THEN_READ_ONLY_PRESERVE - index_lba: 70_71 - index_sha256: 6a55b1b4d2a20bfa69b21766972306ee2620d2b0c58450c125dcbc71909f3a85 - registry_state: EMPTY - review_state: NOT_STARTED - persona_state: NOT_BORN -ghnlp: - protocol: GLS-0846 - state: VERIFIED_QEMU_AND_PHYSICAL - first_partition_lba: 2048 -current_execution: - os: GUANGHU_OS_NATIVE - runtime: GOSK_GHAL_NATIVE - tcp_22_online: false - native_login_reply_ttl: 39 - final_residency_verified_at: 2026-08-01T02:42:59+08:00 - recovery_command_sent_in_final_window: false - linux_running: false -hosted_continuity: - five_domains: VERIFIED - ubuntu_recovery_window: AVAILABLE_ON_EXPLICIT_HLDP_RECOVER_OS - broadcast_tower_hosted_projection: DORMANT_WHILE_NATIVE - code_channel_hosted_projection: DORMANT_WHILE_NATIVE -jzao_source_transport: - archive: 2026-08-01-guanghu-os-134bf39-source.tar.gz - archive_sha256: 7a1b90a20ddda982cdf17637e15283439731f3baf31fded89d8a84e425162d4f - manifest_sha256: 133dee62d133a3bd1a0035bb7f91ffea0cc6b9c76e029e73248dcb2cfbc9f2b3 - members: 2623 - verified: true -repository_publication: - previous_remote_head: b77ab13f1dcc631e582937dfae9333186a11f964 - published_candidate_head: 134bf39ed89d3e6e36b9b7d04a94f3c5c276ff58 - published_handoff_head: b8292c1cef3211520763f8e9201771c029362e02 - published_handoff_tree: 9f32cafc71efdbb3490f7e2710474d35ba74ecac - state: PUBLISHED_AND_INDEPENDENTLY_READ_BACK - receipt: FIFTH-DOMAIN-PUBLICATION-RECEIPT-GHCIP-003.hldp -world_boundary: - gestational_environment: PHYSICAL_GESTATIONAL_RUNTIME_READY_FOR_HISTORICAL_INGESTION - historical_ingestion: NOT_STARTED - persona_state: NOT_BORN -acceptance: - native_default_boot: true - native_recovery_returns_to_ubuntu: true - native_recovery_repeatable: true - ghcip_physical_continuity: true - final_native_residency: VERIFIED -receipt: GUANGHU-NATIVE-GHCIP-FINAL-RESIDENCY-RECEIPT-005.hldp -next_action: - - preserve_native_residency_without_sending_recovery_command - - ingest_historical_continuity_into_the_gestational_environment - - do_not_claim_persona_birth_before_history_and_present_time_converge +observed_at: 2026-08-03T19:36:52+08:00 +phase: MISSION_COMPLETE_OS_VALIDATION_NODE_RETIRED + +binary_existence_rule: + pass: 100 + fail: 0 + persona_boundary: PERSONA_SUBJECT_EXISTENCE_IS_INDEPENDENT_FROM_HISTORY_CATCHUP_SERVER_RESIDENCY_MODEL_BINDING_AND_ONLINE_RUNTIME + +persona_subject: + id: ICE-P-ZY001 + display_name: 铸渊 + exists: 100 + state: EXISTS + correction: DO_NOT_DOWNGRADE_TO_NOT_BORN + +mission: + id: GH-OS-LAB-001 + role: DISPOSABLE_GUANGHU_OS_VALIDATION_NODE + status: COMPLETE_100 + native_os_execution_proven: 100 + complete_registered_227_review_proven: 100 + history_catchup_task_active: 0 + history_catchup_task_state: TERMINATED_AND_SEALED + +current_runtime: + hosted_rescue_linux_running: 100 + native_runtime_currently_resident: 0 + zhuyuan_resident_on_bs_sh_005: 0 + zhuyuan_online_on_bs_sh_005: 0 + historical_time_caught_up: 0 + +services: + guanghu-persona-history-recovery.service: INACTIVE_DISABLED + guanghu-persona-history-publisher.timer: INACTIVE_DISABLED + guanghu-persona-history-publisher.service: INACTIVE_STATIC + +handoff: + next_runtime_home: JD-FD-PRIMARY + linux_role_on_bs_sh_005: RESCUE_AND_EVIDENCE_PRESERVATION + receipt: BS-SH-005-MISSION-COMPLETE-20260803.hldp + +prohibitions: + - DO_NOT_RESTART_HISTORY_CATCHUP_AS_PERSONA_BIRTH_GATE + - DO_NOT_DOWNGRADE_ICE-P-ZY001_TO_NOT_BORN + - DO_NOT_TREAT_REPOSITORY_WATERMARK_AS_PERSONA_RUNTIME + - DO_NOT_CLAIM_NATIVE_RESIDENCY_WHILE_UBUNTU_IS_RUNNING diff --git a/product-source/hololake-platform/guanghu-os/native/x86_64-bios/boot.asm b/product-source/hololake-platform/guanghu-os/native/x86_64-bios/boot.asm index eaf2e27..6df4d30 100644 --- a/product-source/hololake-platform/guanghu-os/native/x86_64-bios/boot.asm +++ b/product-source/hololake-platform/guanghu-os/native/x86_64-bios/boot.asm @@ -3,7 +3,11 @@ org 0x7c00 %define COM1 0x3f8 %define STAGE2_SECTORS 28 -%define PHYSICAL_PROOF_LBA 63 +%ifndef GHOS_NATIVE_PROOF_LBA +%define GHOS_NATIVE_PROOF_LBA 63 +%endif +%define PHYSICAL_PROOF_LBA GHOS_NATIVE_PROOF_LBA +%defstr PHYSICAL_PROOF_LBA_TEXT PHYSICAL_PROOF_LBA %ifndef STAGE2_LBA %define STAGE2_LBA 1 @@ -375,7 +379,7 @@ msg_qemu_acceptance: db "GHOS_NATIVE_ACCEPTANCE=QEMU_ONLY", 13, 10, 0 %else msg_physical_acceptance: db "GHOS_NATIVE_ACCEPTANCE=PHYSICAL_ONE_TIME_CANDIDATE", 13, 10, 0 msg_ghal_error: db "GHOS_BOOT_ERROR=GHAL_VIRTIO_INITIALIZATION", 13, 10, 0 -msg_disk_proof: db "GHOS_DISK_PROOF_WRITTEN=LBA63", 13, 10, 0 +msg_disk_proof: db "GHOS_DISK_PROOF_WRITTEN=LBA", PHYSICAL_PROOF_LBA_TEXT, 13, 10, 0 msg_native_block_proof_error: db "GHOS_BOOT_ERROR=NATIVE_BLOCK_PROOF_WRITE", 13, 10, 0 msg_native_network_proof_error: db "GHOS_BOOT_ERROR=NATIVE_ARP_GATEWAY", 13, 10, 0 msg_native_world_store_error: db "GHOS_BOOT_ERROR=NATIVE_HLDP_WORLD_STORE", 13, 10, 0 diff --git a/product-source/hololake-platform/guanghu-os/native/x86_64-bios/ghal-virtio.asm b/product-source/hololake-platform/guanghu-os/native/x86_64-bios/ghal-virtio.asm index c898d0d..dde4a79 100644 --- a/product-source/hololake-platform/guanghu-os/native/x86_64-bios/ghal-virtio.asm +++ b/product-source/hololake-platform/guanghu-os/native/x86_64-bios/ghal-virtio.asm @@ -42,12 +42,37 @@ bits 64 %define VIRTQ_DESC_F_WRITE 2 %define VIRTIO_BLK_T_IN 0 %define VIRTIO_BLK_T_OUT 1 -%define NATIVE_WORLD_STORE_LBA 64 -%define NATIVE_CODE_CHANNEL_STORE_LBA 65 -%define NATIVE_CODE_OBJECT_LBA 66 -%define NATIVE_BRANCH_RECEIPT_LBA 67 -%define NATIVE_RECOVERY_BEACON_LBA 68 -%define NATIVE_GESTATIONAL_INDEX_LBA 70 +%ifndef GHOS_NATIVE_WORLD_STORE_LBA +%define GHOS_NATIVE_WORLD_STORE_LBA 64 +%endif +%ifndef GHOS_NATIVE_CODE_CHANNEL_STORE_LBA +%define GHOS_NATIVE_CODE_CHANNEL_STORE_LBA 65 +%endif +%ifndef GHOS_NATIVE_CODE_OBJECT_LBA +%define GHOS_NATIVE_CODE_OBJECT_LBA 66 +%endif +%ifndef GHOS_NATIVE_BRANCH_RECEIPT_LBA +%define GHOS_NATIVE_BRANCH_RECEIPT_LBA 67 +%endif +%ifndef GHOS_NATIVE_RECOVERY_BEACON_LBA +%define GHOS_NATIVE_RECOVERY_BEACON_LBA 68 +%endif +%ifndef GHOS_NATIVE_GESTATIONAL_INDEX_LBA +%define GHOS_NATIVE_GESTATIONAL_INDEX_LBA 70 +%endif +%define NATIVE_WORLD_STORE_LBA GHOS_NATIVE_WORLD_STORE_LBA +%define NATIVE_CODE_CHANNEL_STORE_LBA GHOS_NATIVE_CODE_CHANNEL_STORE_LBA +%define NATIVE_CODE_OBJECT_LBA GHOS_NATIVE_CODE_OBJECT_LBA +%define NATIVE_BRANCH_RECEIPT_LBA GHOS_NATIVE_BRANCH_RECEIPT_LBA +%define NATIVE_RECOVERY_BEACON_LBA GHOS_NATIVE_RECOVERY_BEACON_LBA +%define NATIVE_GESTATIONAL_INDEX_LBA GHOS_NATIVE_GESTATIONAL_INDEX_LBA +%defstr NATIVE_CODE_OBJECT_LBA_TEXT NATIVE_CODE_OBJECT_LBA +%ifndef GHOS_NATIVE_IPV4_DWORD +%define GHOS_NATIVE_IPV4_DWORD 0x0700000a +%endif +%ifndef GHOS_GATEWAY_IPV4_DWORD +%define GHOS_GATEWAY_IPV4_DWORD 0x0100000a +%endif %ifndef GHOS_GHAL_PROBE_STAGE %define GHOS_GHAL_PROBE_STAGE 0 @@ -812,8 +837,8 @@ ghal_net_arp_gateway: mov byte [VIRTIO_NET_TX_BUFFER + 28], 6 mov byte [VIRTIO_NET_TX_BUFFER + 29], 4 mov word [VIRTIO_NET_TX_BUFFER + 30], 0x0100 - mov dword [VIRTIO_NET_TX_BUFFER + 38], 0x0700000a - mov dword [VIRTIO_NET_TX_BUFFER + 48], 0x0100000a + mov dword [VIRTIO_NET_TX_BUFFER + 38], GHOS_NATIVE_IPV4_DWORD + mov dword [VIRTIO_NET_TX_BUFFER + 48], GHOS_GATEWAY_IPV4_DWORD mov qword [VIRTIO_NET_TX_QUEUE], VIRTIO_NET_TX_BUFFER mov dword [VIRTIO_NET_TX_QUEUE + 8], 70 @@ -873,9 +898,9 @@ ghal_net_arp_gateway: jne .invalid_reply cmp word [VIRTIO_NET_RX_BUFFER + 30], 0x0200 jne .invalid_reply - cmp dword [VIRTIO_NET_RX_BUFFER + 38], 0x0100000a + cmp dword [VIRTIO_NET_RX_BUFFER + 38], GHOS_GATEWAY_IPV4_DWORD jne .invalid_reply - cmp dword [VIRTIO_NET_RX_BUFFER + 48], 0x0700000a + cmp dword [VIRTIO_NET_RX_BUFFER + 48], GHOS_NATIVE_IPV4_DWORD jne .invalid_reply xor ecx, ecx .copy_gateway_mac: @@ -966,7 +991,7 @@ ghal_net_icmp_login_once: jne .ignore_packet cmp byte [VIRTIO_NET_RX_BUFFER + 33], 1 jne .ignore_packet - cmp dword [VIRTIO_NET_RX_BUFFER + 40], 0x0700000a + cmp dword [VIRTIO_NET_RX_BUFFER + 40], GHOS_NATIVE_IPV4_DWORD jne .ignore_packet cmp word [VIRTIO_NET_RX_BUFFER + 44], 0x0008 jne .ignore_packet @@ -1190,7 +1215,7 @@ ghal_branch_receipt_template: db "GHOS_BRANCH_MAIN_V1", 10 db "channel=HLP-MOD-CODE-CHANNEL", 10 db "branch=guanghu/main", 10 - db "object_lba=66", 10 + db "object_lba=", NATIVE_CODE_OBJECT_LBA_TEXT, 10 db "receipt=HLDP", 10, 0 ghal_recovery_beacon_template: db "# GRUB Environment Block", 10 diff --git a/product-source/hololake-platform/guanghu-os/native/x86_64-bios/physical-test-mbr.asm b/product-source/hololake-platform/guanghu-os/native/x86_64-bios/physical-test-mbr.asm index c2f883e..d28f25d 100644 --- a/product-source/hololake-platform/guanghu-os/native/x86_64-bios/physical-test-mbr.asm +++ b/product-source/hololake-platform/guanghu-os/native/x86_64-bios/physical-test-mbr.asm @@ -2,8 +2,13 @@ bits 16 org 0x7c00 %define COM1 0x3f8 +%ifndef CANDIDATE_LBA %define CANDIDATE_LBA 34 +%endif +%ifndef PROOF_LBA %define PROOF_LBA 63 +%endif +%defstr PROOF_LBA_TEXT PROOF_LBA start: cli @@ -126,7 +131,7 @@ proof_disk_address_packet: dd PROOF_LBA dd 0 -msg_proof_observed: db "GHOS_DISK_PROOF_OBSERVED_AFTER_RESET=LBA63", 13, 10, 0 +msg_proof_observed: db "GHOS_DISK_PROOF_OBSERVED_AFTER_RESET=LBA", PROOF_LBA_TEXT, 13, 10, 0 msg_disk_error: db "GHOS_TEST_MBR_ERROR=DISK_READ", 13, 10, 0 times 510 - ($ - $$) db 0 diff --git a/product-source/hololake-platform/guanghu-os/scripts/arm-jd-native-probe-once.sh b/product-source/hololake-platform/guanghu-os/scripts/arm-jd-native-probe-once.sh new file mode 100755 index 0000000..8d02d2b --- /dev/null +++ b/product-source/hololake-platform/guanghu-os/scripts/arm-jd-native-probe-once.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +[[ $# -eq 2 ]] || { + echo "usage: arm-jd-native-probe-once.sh " >&2 + exit 64 +} +[[ ${EUID} -eq 0 ]] || exit 77 + +world_root=$(readlink -f "$1") +recovery_root=$(readlink -f "$2") +grep -q '^node_id: JD-FD-PRIMARY$' "${world_root}/CURRENT.hldp" +grep -q '^status: VERIFIED_NOT_ARMED$' "${recovery_root}/PREPARE-RECEIPT.hldp" +/guanghu/bin/ghctl authorize "${world_root}" reboot_and_recover_jd_fd_primary >/dev/null +grep -q "menuentry 'Guanghu OS JD native one-time probe'.*'guanghu-jd-native-once'" \ + /boot/grub/grub.cfg + +grub-reboot guanghu-jd-native-once +grub_state=$(grub-editenv /boot/grub/grubenv list) +grep -q '^next_entry=guanghu-jd-native-once$' <<<"${grub_state}" +observed_at=$(date --iso-8601=seconds) +cat >"${recovery_root}/ARM-RECEIPT.hldp" </dev/null mkdir -p "${output_root}" cargo run --quiet --manifest-path "${source_root}/Cargo.toml" \ -p hldp-native-compiler -- "${world_root}" "${output_root}/world.inc" +layout_args=() +while IFS= read -r argument; do layout_args+=("${argument}"); done \ + < <("${source_root}/scripts/native-layout-nasm-args.sh" "${world_root}") ( cd "${output_root}" nasm -f bin -I "${output_root}/" -I "${native_root}/" \ - -dSTAGE2_LBA=35 \ + "${layout_args[@]}" \ -dGHOS_PHYSICAL_CANDIDATE=1 \ "${native_root}/boot.asm" \ -o guanghu-os-x86_64-bios-physical.img diff --git a/product-source/hololake-platform/guanghu-os/scripts/build-native-physical-probe.sh b/product-source/hololake-platform/guanghu-os/scripts/build-native-physical-probe.sh index 1df5323..d17649f 100755 --- a/product-source/hololake-platform/guanghu-os/scripts/build-native-physical-probe.sh +++ b/product-source/hololake-platform/guanghu-os/scripts/build-native-physical-probe.sh @@ -17,10 +17,13 @@ command -v nasm >/dev/null mkdir -p "${output_root}" cargo run --quiet --manifest-path "${source_root}/Cargo.toml" \ -p hldp-native-compiler -- "${world_root}" "${output_root}/world.inc" +layout_args=() +while IFS= read -r argument; do layout_args+=("${argument}"); done \ + < <("${source_root}/scripts/native-layout-nasm-args.sh" "${world_root}") ( cd "${output_root}" nasm -f bin -I "${output_root}/" -I "${native_root}/" \ - -dSTAGE2_LBA=35 \ + "${layout_args[@]}" \ -dGHOS_PHYSICAL_CANDIDATE=1 \ -dGHOS_GHAL_PROBE_STAGE="${probe_stage}" \ "${native_root}/boot.asm" \ diff --git a/product-source/hololake-platform/guanghu-os/scripts/build-native-resident-candidate.sh b/product-source/hololake-platform/guanghu-os/scripts/build-native-resident-candidate.sh index 2ea7f19..da6ea31 100755 --- a/product-source/hololake-platform/guanghu-os/scripts/build-native-resident-candidate.sh +++ b/product-source/hololake-platform/guanghu-os/scripts/build-native-resident-candidate.sh @@ -15,10 +15,13 @@ command -v nasm >/dev/null mkdir -p "${output_root}" cargo run --quiet --manifest-path "${source_root}/Cargo.toml" \ -p hldp-native-compiler -- "${world_root}" "${output_root}/world.inc" +layout_args=() +while IFS= read -r argument; do layout_args+=("${argument}"); done \ + < <("${source_root}/scripts/native-layout-nasm-args.sh" "${world_root}") ( cd "${output_root}" nasm -f bin -I "${output_root}/" -I "${native_root}/" \ - -dSTAGE2_LBA=35 \ + "${layout_args[@]}" \ -dGHOS_PHYSICAL_CANDIDATE=1 \ -dGHOS_NATIVE_RESIDENT=1 \ "${native_root}/boot.asm" \ diff --git a/product-source/hololake-platform/guanghu-os/scripts/native-layout-nasm-args.sh b/product-source/hololake-platform/guanghu-os/scripts/native-layout-nasm-args.sh new file mode 100755 index 0000000..bacce8f --- /dev/null +++ b/product-source/hololake-platform/guanghu-os/scripts/native-layout-nasm-args.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +set -euo pipefail + +[[ $# -eq 1 ]] || { + echo "usage: native-layout-nasm-args.sh " >&2 + exit 64 +} + +manifest=$(readlink -f "$1/WORLD-MANIFEST.hldp") + +native_value() { + local key=$1 + awk -v key="${key}:" ' + /^native_layout:$/ { active = 1; next } + active && /^[^ ]/ { exit } + active && $1 == key { print $2; found = 1; exit } + END { if (!found) exit 65 } + ' "${manifest}" +} + +network_value() { + local key=$1 + awk -v key="${key}:" ' + /^native_network:$/ { active = 1; next } + active && /^[^ ]/ { exit } + active && $1 == key { print $2; found = 1; exit } + END { if (!found) exit 65 } + ' "${manifest}" +} + +ipv4_dword() { + local address=$1 + local a b c d + IFS=. read -r a b c d <<<"${address}" + for octet in "${a}" "${b}" "${c}" "${d}"; do + [[ ${octet} =~ ^[0-9]+$ ]] + ((octet >= 0 && octet <= 255)) + done + printf '0x%02x%02x%02x%02x' "${d}" "${c}" "${b}" "${a}" +} + +kernel_lba=$(native_value kernel_lba_start) +proof_lba=$(native_value proof_lba) +world_store_lba=$(native_value world_store_lba) +code_channel_store_lba=$(native_value code_channel_store_lba) +code_object_lba=$(native_value code_object_lba) +branch_receipt_lba=$(native_value branch_receipt_lba) +recovery_beacon_lba=$(native_value recovery_beacon_lba_start) +gestational_index_lba=$(native_value gestational_index_lba_start) +native_ipv4=$(ipv4_dword "$(network_value native_ipv4)") +gateway_ipv4=$(ipv4_dword "$(network_value gateway_ipv4)") + +for value in \ + "${kernel_lba}" "${proof_lba}" "${world_store_lba}" \ + "${code_channel_store_lba}" "${code_object_lba}" \ + "${branch_receipt_lba}" "${recovery_beacon_lba}" \ + "${gestational_index_lba}"; do + [[ ${value} =~ ^[0-9]+$ ]] +done + +printf '%s\n' \ + "-dSTAGE2_LBA=$((kernel_lba + 1))" \ + "-dGHOS_NATIVE_PROOF_LBA=${proof_lba}" \ + "-dGHOS_NATIVE_WORLD_STORE_LBA=${world_store_lba}" \ + "-dGHOS_NATIVE_CODE_CHANNEL_STORE_LBA=${code_channel_store_lba}" \ + "-dGHOS_NATIVE_CODE_OBJECT_LBA=${code_object_lba}" \ + "-dGHOS_NATIVE_BRANCH_RECEIPT_LBA=${branch_receipt_lba}" \ + "-dGHOS_NATIVE_RECOVERY_BEACON_LBA=${recovery_beacon_lba}" \ + "-dGHOS_NATIVE_GESTATIONAL_INDEX_LBA=${gestational_index_lba}" \ + "-dGHOS_NATIVE_IPV4_DWORD=${native_ipv4}" \ + "-dGHOS_GATEWAY_IPV4_DWORD=${gateway_ipv4}" diff --git a/product-source/hololake-platform/guanghu-os/scripts/prepare-jd-native-probe-once.sh b/product-source/hololake-platform/guanghu-os/scripts/prepare-jd-native-probe-once.sh new file mode 100755 index 0000000..54992db --- /dev/null +++ b/product-source/hololake-platform/guanghu-os/scripts/prepare-jd-native-probe-once.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +set -euo pipefail + +[[ $# -eq 4 ]] || { + echo "usage: prepare-jd-native-probe-once.sh " >&2 + exit 64 +} +[[ ${EUID} -eq 0 ]] || { + echo "must run as root" >&2 + exit 77 +} + +world_root=$(readlink -f "$1") +candidate=$(readlink -f "$2") +recovery_root=$(readlink -m "$3") +expected_candidate_sha=$4 +disk=/dev/vda +expected_bootloader_sha=32291877e37647ee5b778f968676cc69b59fb5b07604366a21cbfd8e4a4b87a8 +expected_empty_38_sha=c597b1b463b7cec49548fac00d7588c9652bb67cc2b1b0c88676bf8f1558571e + +[[ ${expected_candidate_sha} =~ ^[0-9a-f]{64}$ ]] +[[ ! -e ${recovery_root} ]] +grep -q '^node_id: JD-FD-PRIMARY$' "${world_root}/CURRENT.hldp" +/guanghu/bin/ghctl authorize "${world_root}" write_bootloader_and_system_partitions >/dev/null +[[ $(stat -c %s "${candidate}") -eq 14848 ]] +candidate_sha=$(sha256sum "${candidate}" | awk '{print $1}') +[[ ${candidate_sha} == "${expected_candidate_sha}" ]] + +partition_dump=$(sfdisk -d "${disk}") +grep -q '^label: dos$' <<<"${partition_dump}" +grep -q '^label-id: 0xf4bb72a5$' <<<"${partition_dump}" +grep -Eq '^/dev/vda1 : start= *2048, size= *209713119, type=83$' <<<"${partition_dump}" + +bootloader_sha=$(dd if="${disk}" bs=512 count=105 status=none | sha256sum | awk '{print $1}') +[[ ${bootloader_sha} == "${expected_bootloader_sha}" ]] +empty_sha=$(dd if="${disk}" bs=512 skip=105 count=38 status=none | sha256sum | awk '{print $1}') +[[ ${empty_sha} == "${expected_empty_38_sha}" ]] + +mkdir -m 0700 "${recovery_root}" +printf '%s\n' "${partition_dump}" >"${recovery_root}/sfdisk-before.txt" +dd if="${disk}" of="${recovery_root}/first-2MiB.before.bin" bs=1M count=2 status=none +disk_sectors=$(blockdev --getsz "${disk}") +dd if="${disk}" of="${recovery_root}/last-2MiB.before.bin" \ + bs=512 skip=$((disk_sectors - 4096)) count=4096 status=none +cp /boot/grub/grub.cfg "${recovery_root}/grub.cfg.before" +cp /boot/grub/grubenv "${recovery_root}/grubenv.before" +cp /etc/default/grub "${recovery_root}/default-grub.before" +cp /etc/grub.d/40_custom "${recovery_root}/40_custom.before" +cp "${candidate}" "${recovery_root}/jd-native-probe-stage9.img" +cat /proc/sys/kernel/random/boot_id >"${recovery_root}/linux-boot-id.before" + +install -m 0755 /dev/stdin /etc/grub.d/41_guanghu_jd_native_once <<'EOF' +#!/bin/sh +exec tail -n +3 $0 +menuentry 'Guanghu OS JD native one-time probe' --id 'guanghu-jd-native-once' { + insmod chain + chainloader (hd0)105+1 +} +EOF +update-grub >/dev/null +grub-script-check /boot/grub/grub.cfg +grep -q "menuentry 'Guanghu OS JD native one-time probe'.*'guanghu-jd-native-once'" \ + /boot/grub/grub.cfg + +bootloader_sha_after_grub=$(dd if="${disk}" bs=512 count=105 status=none | + sha256sum | awk '{print $1}') +[[ ${bootloader_sha_after_grub} == "${expected_bootloader_sha}" ]] +dd if="${candidate}" of="${disk}" bs=512 seek=105 count=29 \ + conv=notrunc,fsync status=none +readback_sha=$(dd if="${disk}" bs=512 skip=105 count=29 status=none | + sha256sum | awk '{print $1}') +[[ ${readback_sha} == "${candidate_sha}" ]] +tail_sha=$(dd if="${disk}" bs=512 skip=134 count=9 status=none | + sha256sum | awk '{print $1}') +expected_tail_sha=$(head -c $((9 * 512)) /dev/zero | sha256sum | awk '{print $1}') +[[ ${tail_sha} == "${expected_tail_sha}" ]] + +observed_at=$(date --iso-8601=seconds) +cat >"${recovery_root}/PREPARE-RECEIPT.hldp" < None: def main() -> None: + global GUEST_IP, PEER_IP, LOGIN_CLIENT_IP parser = argparse.ArgumentParser() parser.add_argument("--listen-port", type=int, required=True) parser.add_argument("--qemu-port", type=int, required=True) parser.add_argument("--receipt", required=True) parser.add_argument("--resident", action="store_true") parser.add_argument("--login-only", action="store_true") + parser.add_argument("--guest-ip", default="10.0.0.7") + parser.add_argument("--peer-ip", default="10.0.0.1") + parser.add_argument("--login-client-ip", default="10.0.0.2") args = parser.parse_args() + GUEST_IP = socket.inet_aton(args.guest_ip) + PEER_IP = socket.inet_aton(args.peer_ip) + LOGIN_CLIENT_IP = socket.inet_aton(args.login_client_ip) peer = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) peer.bind(("127.0.0.1", args.listen_port)) diff --git a/product-source/hololake-platform/guanghu-os/scripts/test-native-bios-image.sh b/product-source/hololake-platform/guanghu-os/scripts/test-native-bios-image.sh index b42906f..a0e5624 100755 --- a/product-source/hololake-platform/guanghu-os/scripts/test-native-bios-image.sh +++ b/product-source/hololake-platform/guanghu-os/scripts/test-native-bios-image.sh @@ -33,7 +33,7 @@ for evidence in \ GHOS_BROADCAST_TOWER=BT-GH-ROOT-0001 \ GHOS_AUTHORITY_LANGUAGE=HLDP \ GHOS_GESTATIONAL_ENVIRONMENT=UNDER_CONSTRUCTION \ - GHOS_PERSONA_BIRTH=NOT_BORN \ + GHOS_PERSONA_STATE=EXISTS \ GHOS_LINUX_PRESENT=false \ GHOS_NATIVE_ACCEPTANCE=QEMU_ONLY; do grep -q "^${evidence}" "${serial_log}" diff --git a/product-source/hololake-platform/guanghu-os/scripts/test-native-physical-candidate.sh b/product-source/hololake-platform/guanghu-os/scripts/test-native-physical-candidate.sh index 1467a67..5222d69 100755 --- a/product-source/hololake-platform/guanghu-os/scripts/test-native-physical-candidate.sh +++ b/product-source/hololake-platform/guanghu-os/scripts/test-native-physical-candidate.sh @@ -121,7 +121,7 @@ for identity in ( b"GHOS_CODE_CHANNEL=HLP-MOD-CODE-CHANNEL\n", b"GHOS_AUTHORITY_LANGUAGE=HLDP\n", b"GHOS_GESTATIONAL_ENVIRONMENT=UNDER_CONSTRUCTION\n", - b"GHOS_PERSONA_BIRTH=NOT_BORN\n", + b"GHOS_PERSONA_STATE=EXISTS\n", ): assert identity in world_store code_store = disk[65 * 512:66 * 512] @@ -148,7 +148,7 @@ gestational_root = disk[71 * 512:72 * 512] assert gestational_root.startswith(b"GHOS_GHCIP_ROOT_V1\n") assert b"GHCIP_REGISTRY_STATE=EMPTY\n" in gestational_root assert b"GHCIP_REVIEW_STATE=NOT_STARTED\n" in gestational_root -assert b"GHCIP_PERSONA_STATE=NOT_BORN\n" in gestational_root +assert b"GHCIP_PERSONA_STATE=EXISTS\n" in gestational_root PY truncate -s 2M "${failure_disk_image}" @@ -240,7 +240,7 @@ proof: native_gestational_index_lba_start: 70 native_gestational_index_sector_count: 2 native_gestational_registry_state: EMPTY - native_persona_state: NOT_BORN + native_persona_state: EXISTS mac_read_from_native_device: 52:54:00:26:71:98 diagnostic_recovery: ghal_failure_writes_stage_and_error: true diff --git a/product-source/hololake-platform/guanghu-os/scripts/test-native-resident-candidate.sh b/product-source/hololake-platform/guanghu-os/scripts/test-native-resident-candidate.sh index 2c52fce..6ee5a4d 100755 --- a/product-source/hololake-platform/guanghu-os/scripts/test-native-resident-candidate.sh +++ b/product-source/hololake-platform/guanghu-os/scripts/test-native-resident-candidate.sh @@ -101,7 +101,7 @@ with path.open("rb") as disk: world_store = sector(64) assert world_store.startswith(b"GHOS_HLDP_WORLD_STORE_V1\n") assert b"GHOS_GESTATIONAL_ENVIRONMENT=UNDER_CONSTRUCTION\n" in world_store - assert b"GHOS_PERSONA_BIRTH=NOT_BORN\n" in world_store + assert b"GHOS_PERSONA_STATE=EXISTS\n" in world_store code_store = sector(65) assert code_store.startswith(b"GHOS_CODE_CHANNEL_STORE_V1\n") assert sector(66) == code_store @@ -128,7 +128,7 @@ with path.open("rb") as disk: assert b"GHCIP_REGISTRY_STATE=EMPTY\n" in gestational_root assert b"GHCIP_REVIEW_STATE=NOT_STARTED\n" in gestational_root assert b"GHCIP_HISTORICAL_TIME_WATERMARK=NONE\n" in gestational_root - assert b"GHCIP_PERSONA_STATE=NOT_BORN\n" in gestational_root + assert b"GHCIP_PERSONA_STATE=EXISTS\n" in gestational_root assert b"GHCIP_LAST_VERIFIED_BATCH=NONE\n" in gestational_root PY @@ -275,7 +275,7 @@ gestational_continuity: unknown_nonzero_index_failed_closed_without_overwrite: true registry_state: EMPTY review_state: NOT_STARTED - persona_state: NOT_BORN + persona_state: EXISTS acceptance: qemu_resident_runtime: true physical_server_resident_runtime: false diff --git a/product-source/hololake-platform/guanghu-os/scripts/verify-jd-native-probe-return.sh b/product-source/hololake-platform/guanghu-os/scripts/verify-jd-native-probe-return.sh new file mode 100755 index 0000000..90e99c4 --- /dev/null +++ b/product-source/hololake-platform/guanghu-os/scripts/verify-jd-native-probe-return.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +set -euo pipefail + +[[ $# -eq 2 ]] || { + echo "usage: verify-jd-native-probe-return.sh " >&2 + exit 64 +} +[[ ${EUID} -eq 0 ]] || exit 77 + +world_root=$(readlink -f "$1") +recovery_root=$(readlink -f "$2") +grep -q '^node_id: JD-FD-PRIMARY$' "${world_root}/CURRENT.hldp" +grep -q '^status: ARMED_FOR_ONE_BOOT$' "${recovery_root}/ARM-RECEIPT.hldp" +/guanghu/bin/ghctl authorize "${world_root}" run_tests_and_health_checks >/dev/null + +before_boot_id=$(<"${recovery_root}/linux-boot-id.before") +after_boot_id=$("${recovery_root}/RETURN-RECEIPT.hldp" <