From 4c35d6d7f79e29dd16a910930f9e3c0fe9090cbf Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Wed, 26 Nov 2025 11:08:59 -0800 Subject: [PATCH] refactor: update Cargo.toml and FK handling --- apps/server/Cargo.toml | 9 --- core/src/infra/db/entities/entry.rs | 2 + core/src/infra/sync/fk_mapper.rs | 99 ++++++++--------------------- whitepaper/.gitignore | 14 ++++ whitepaper/spacedrive.out | 89 +++++++++++++------------- 5 files changed, 85 insertions(+), 128 deletions(-) create mode 100644 whitepaper/.gitignore diff --git a/apps/server/Cargo.toml b/apps/server/Cargo.toml index d949e337d..c5ca573f3 100644 --- a/apps/server/Cargo.toml +++ b/apps/server/Cargo.toml @@ -3,11 +3,6 @@ name = "sd-server" version = "0.1.0" edition = "2021" -[features] -default = [] -# Include bundled web assets (production builds) -assets = [] - [dependencies] # Spacedrive core sd-core = { path = "../../core", features = ["ffmpeg", "heif"] } @@ -23,10 +18,6 @@ tower-http = { version = "0.5", features = ["fs", "cors"] } # Auth secstr = "0.5" -# Static assets -include_dir = "0.7" -mime_guess = "2.0" - # Serialization serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/core/src/infra/db/entities/entry.rs b/core/src/infra/db/entities/entry.rs index 42f4fc4c8..0762fbe9f 100644 --- a/core/src/infra/db/entities/entry.rs +++ b/core/src/infra/db/entities/entry.rs @@ -86,6 +86,8 @@ impl crate::infra::sync::Syncable for Model { } fn foreign_key_mappings() -> Vec { + // All FKs use dependency tracking - NEVER set to NULL on missing reference + // Source data with NULL values is handled correctly (null UUID → null FK) vec![ crate::infra::sync::FKMapping::new("parent_id", "entries"), crate::infra::sync::FKMapping::new("metadata_id", "user_metadata"), diff --git a/core/src/infra/sync/fk_mapper.rs b/core/src/infra/sync/fk_mapper.rs index fa7335a0c..e74f6b225 100644 --- a/core/src/infra/sync/fk_mapper.rs +++ b/core/src/infra/sync/fk_mapper.rs @@ -39,9 +39,6 @@ pub struct FKMapping { /// Target table name (e.g., "devices") pub target_table: &'static str, - - /// Whether this FK can be null (for circular dependencies) - pub nullable: bool, } impl FKMapping { @@ -49,15 +46,6 @@ impl FKMapping { Self { local_field, target_table, - nullable: false, - } - } - - pub fn new_nullable(local_field: &'static str, target_table: &'static str) -> Self { - Self { - local_field, - target_table, - nullable: true, } } @@ -209,29 +197,18 @@ pub async fn map_sync_json_to_local( // Map UUID to local ID // If the referenced record doesn't exist yet (sync dependency), return error for retry - let local_id = match lookup_local_id_for_uuid(fk.target_table, uuid, db).await { - Ok(id) => id, - Err(e) => { - // Referenced record not found - this is a sync dependency issue - // For nullable FKs (circular dependencies), set to NULL instead of erroring - if fk.nullable { - data[fk.local_field] = Value::Null; - if let Some(obj) = data.as_object_mut() { - obj.remove(&uuid_field); - } - continue; - } - - // For non-nullable FKs, propagate error so caller can buffer/retry - return Err(anyhow::anyhow!( + // NEVER set to NULL - that corrupts data. Caller must use dependency tracking. + let local_id = lookup_local_id_for_uuid(fk.target_table, uuid, db) + .await + .map_err(|e| { + anyhow::anyhow!( "Sync dependency missing: {} -> {} (uuid={}): {}", fk.local_field, fk.target_table, uuid, e - )); - } - }; + ) + })?; // Replace UUID with local ID data[fk.local_field] = json!(local_id); @@ -250,8 +227,8 @@ pub async fn map_sync_json_to_local( pub struct BatchFkMapResult { /// Records that were successfully mapped (all FKs resolved) pub succeeded: Vec, - /// Records that failed due to missing non-nullable FK references - /// Contains (record, missing_fk_field, missing_uuid) for retry/buffering + /// Records that failed due to missing FK references + /// Contains (record, missing_fk_field, missing_uuid) for retry/dependency tracking pub failed: Vec<(Value, String, Uuid)>, } @@ -260,8 +237,8 @@ pub struct BatchFkMapResult { /// This function processes multiple records at once, using batch FK lookups /// to reduce database queries from N*M (N records × M FKs) to M (one per FK type). /// -/// Records with missing non-nullable FK references are returned in `failed` for retry. -/// Records with missing nullable FK references have the FK set to NULL and succeed. +/// Records with missing FK references are returned in `failed` for retry via dependency tracking. +/// NEVER sets FK to NULL on missing reference - that would corrupt data. pub async fn batch_map_sync_json_to_local( records: Vec, mappings: Vec, @@ -330,48 +307,31 @@ pub async fn batch_map_sync_json_to_local( { Some(uuid) => uuid, None => { - // Invalid UUID format - set to NULL (this is a data error, not missing dep) + // Invalid UUID format - this is a data error, mark as failed tracing::warn!( fk_field = %fk.local_field, - "Invalid UUID format in FK field, setting to NULL" + "Invalid UUID format in FK field" ); - data[fk.local_field] = Value::Null; - if let Some(obj) = data.as_object_mut() { - obj.remove(&uuid_field); - } + // Use a nil UUID to indicate parse failure + failed_records.insert(idx, (fk.local_field.to_string(), Uuid::nil())); continue; } }; // Look up local ID from batch results + // NEVER set to NULL on missing - that corrupts data. Always fail for retry. let local_id = match uuid_to_id_map.get(&uuid) { Some(&id) => id, None => { - // Referenced record not found - if fk.nullable { - // Nullable FK - set to NULL and continue - tracing::debug!( - fk_field = %fk.local_field, - target_table = %fk.target_table, - uuid = %uuid, - "Nullable FK reference not found, setting to NULL" - ); - data[fk.local_field] = Value::Null; - if let Some(obj) = data.as_object_mut() { - obj.remove(&uuid_field); - } - continue; - } else { - // Non-nullable FK - mark record as failed for retry - tracing::debug!( - fk_field = %fk.local_field, - target_table = %fk.target_table, - uuid = %uuid, - "Non-nullable FK reference not found, marking for retry" - ); - failed_records.insert(idx, (fk.local_field.to_string(), uuid)); - continue; - } + // Referenced record not found - mark for retry via dependency tracking + tracing::debug!( + fk_field = %fk.local_field, + target_table = %fk.target_table, + uuid = %uuid, + "FK reference not found, marking for retry" + ); + failed_records.insert(idx, (fk.local_field.to_string(), uuid)); + continue; } }; @@ -469,13 +429,4 @@ mod tests { let fk = FKMapping::new("entry_id", "entries"); assert_eq!(fk.uuid_field_name(), "entry_uuid"); } - - #[test] - fn test_fk_mapping_nullable() { - let non_nullable = FKMapping::new("device_id", "devices"); - assert!(!non_nullable.nullable, "default should be non-nullable"); - - let nullable = FKMapping::new_nullable("parent_id", "entries"); - assert!(nullable.nullable, "new_nullable should create nullable FK"); - } } diff --git a/whitepaper/.gitignore b/whitepaper/.gitignore new file mode 100644 index 000000000..0791de1bb --- /dev/null +++ b/whitepaper/.gitignore @@ -0,0 +1,14 @@ +# LaTeX build artifacts +*.aux +*.bbl +*.blg +*.fdb_latexmk +*.fls +*.log +*.out +*.synctex.gz +*.synctex(busy) +*.cut + +# Keep PDF output +!spacedrive.pdf diff --git a/whitepaper/spacedrive.out b/whitepaper/spacedrive.out index 5fbf15d6d..9ba1a56ec 100644 --- a/whitepaper/spacedrive.out +++ b/whitepaper/spacedrive.out @@ -14,50 +14,49 @@ \BOOKMARK [2][-]{subsection.3.2}{\376\377\0003\000.\0002\000\040\000S\000p\000a\000c\000e\000d\000r\000i\000v\000e\000\040\000v\0002\000\040\000a\000s\000\040\000a\000n\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000a\000l\000\040\000S\000o\000l\000u\000t\000i\000o\000n}{section.3}% 14 \BOOKMARK [1][-]{section.4}{\376\377\0004\000\040\000T\000h\000e\000\040\000S\000p\000a\000c\000e\000d\000r\000i\000v\000e\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e}{}% 15 \BOOKMARK [2][-]{subsection.4.1}{\376\377\0004\000.\0001\000\040\000T\000h\000e\000\040\000V\000D\000F\000S\000\040\000M\000o\000d\000e\000l}{section.4}% 16 -\BOOKMARK [2][-]{subsection.4.2}{\376\377\0004\000.\0002\000\040\000C\000o\000n\000t\000e\000n\000t\000\040\000I\000d\000e\000n\000t\000i\000t\000y\000:\000\040\000T\000h\000e\000\040\000F\000o\000u\000n\000d\000a\000t\000i\000o\000n\000\040\000f\000o\000r\000\040\000D\000e\000d\000u\000p\000l\000i\000c\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000R\000e\000d\000u\000n\000d\000a\000n\000c\000y}{section.4}% 17 -\BOOKMARK [2][-]{subsection.4.3}{\376\377\0004\000.\0003\000\040\000T\000h\000e\000\040\000I\000n\000d\000e\000x\000i\000n\000g\000\040\000E\000n\000g\000i\000n\000e\000:\000\040\000A\000\040\000M\000u\000l\000t\000i\000-\000P\000h\000a\000s\000e\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e}{section.4}% 18 +\BOOKMARK [2][-]{subsection.4.2}{\376\377\0004\000.\0002\000\040\000C\000o\000n\000t\000e\000n\000t\000\040\000I\000d\000e\000n\000t\000i\000t\000y\000:\000\040\000D\000e\000d\000u\000p\000l\000i\000c\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000R\000e\000d\000u\000n\000d\000a\000n\000c\000y}{section.4}% 17 +\BOOKMARK [2][-]{subsection.4.3}{\376\377\0004\000.\0003\000\040\000T\000h\000e\000\040\000I\000n\000d\000e\000x\000i\000n\000g\000\040\000E\000n\000g\000i\000n\000e}{section.4}% 18 \BOOKMARK [2][-]{subsection.4.4}{\376\377\0004\000.\0004\000\040\000T\000h\000e\000\040\000T\000r\000a\000n\000s\000a\000c\000t\000i\000o\000n\000a\000l\000\040\000A\000c\000t\000i\000o\000n\000\040\000S\000y\000s\000t\000e\000m}{section.4}% 19 \BOOKMARK [2][-]{subsection.4.5}{\376\377\0004\000.\0005\000\040\000L\000i\000b\000r\000a\000r\000y\000\040\000S\000y\000n\000c\000\040\000a\000n\000d\000\040\000N\000e\000t\000w\000o\000r\000k\000i\000n\000g}{section.4}% 20 -\BOOKMARK [2][-]{subsection.4.6}{\376\377\0004\000.\0006\000\040\000P\000r\000a\000c\000t\000i\000c\000a\000l\000\040\000C\000o\000n\000f\000l\000i\000c\000t\000\040\000R\000e\000s\000o\000l\000u\000t\000i\000o\000n}{section.4}% 21 -\BOOKMARK [2][-]{subsection.4.7}{\376\377\0004\000.\0007\000\040\000A\000I\000-\000N\000a\000t\000i\000v\000e\000\040\000V\000D\000F\000S\000:\000\040\000F\000r\000o\000m\000\040\000S\000e\000m\000a\000n\000t\000i\000c\000\040\000S\000e\000a\000r\000c\000h\000\040\000t\000o\000\040\000I\000n\000t\000e\000l\000l\000i\000g\000e\000n\000t\000\040\000M\000a\000n\000a\000g\000e\000m\000e\000n\000t}{section.4}% 22 -\BOOKMARK [2][-]{subsection.4.8}{\376\377\0004\000.\0008\000\040\000T\000e\000m\000p\000o\000r\000a\000l\000-\000S\000e\000m\000a\000n\000t\000i\000c\000\040\000S\000e\000a\000r\000c\000h\000:\000\040\000A\000n\000\040\000A\000s\000y\000n\000c\000h\000r\000o\000n\000o\000u\000s\000,\000\040\000J\000o\000b\000-\000B\000a\000s\000e\000d\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e}{section.4}% 23 -\BOOKMARK [2][-]{subsection.4.9}{\376\377\0004\000.\0009\000\040\000N\000a\000t\000i\000v\000e\000\040\000S\000t\000o\000r\000a\000g\000e\000\040\000T\000i\000e\000r\000i\000n\000g\000:\000\040\000R\000e\000c\000o\000n\000c\000i\000l\000i\000n\000g\000\040\000P\000h\000y\000s\000i\000c\000a\000l\000\040\000R\000e\000a\000l\000i\000t\000y\000\040\000a\000n\000d\000\040\000U\000s\000e\000r\000\040\000I\000n\000t\000e\000n\000t}{section.4}% 24 -\BOOKMARK [2][-]{subsection.4.10}{\376\377\0004\000.\0001\0000\000\040\000V\000o\000l\000u\000m\000e\000\040\000C\000l\000a\000s\000s\000i\000f\000i\000c\000a\000t\000i\000o\000n}{section.4}% 25 -\BOOKMARK [2][-]{subsection.4.11}{\376\377\0004\000.\0001\0001\000\040\000P\000l\000a\000t\000f\000o\000r\000m\000\040\000I\000n\000t\000e\000g\000r\000a\000t\000i\000o\000n\000s\000:\000\040\000U\000n\000i\000f\000i\000e\000d\000\040\000A\000c\000c\000e\000s\000s\000\040\000t\000o\000\040\000T\000r\000a\000d\000i\000t\000i\000o\000n\000a\000l\000\040\000a\000n\000d\000\040\000M\000o\000d\000e\000r\000n\000\040\000S\000t\000o\000r\000a\000g\000e}{section.4}% 26 -\BOOKMARK [1][-]{section.5}{\376\377\0005\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000a\000l\000\040\000A\000p\000p\000l\000i\000c\000a\000t\000i\000o\000n\000:\000\040\000A\000\040\000N\000a\000t\000i\000v\000e\000\040\000C\000l\000o\000u\000d\000\040\000S\000e\000r\000v\000i\000c\000e}{}% 27 -\BOOKMARK [2][-]{subsection.5.1}{\376\377\0005\000.\0001\000\040\000C\000o\000r\000e\000\040\000P\000r\000i\000n\000c\000i\000p\000l\000e\000:\000\040\000M\000a\000n\000a\000g\000e\000d\000\040\000C\000o\000r\000e\000s\000\040\000a\000s\000\040\000F\000i\000r\000s\000t\000-\000C\000l\000a\000s\000s\000\040\000D\000e\000v\000i\000c\000e\000s}{section.5}% 28 -\BOOKMARK [2][-]{subsection.5.2}{\376\377\0005\000.\0002\000\040\000I\000n\000t\000e\000g\000r\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000U\000s\000e\000r\000\040\000E\000x\000p\000e\000r\000i\000e\000n\000c\000e}{section.5}% 29 -\BOOKMARK [2][-]{subsection.5.3}{\376\377\0005\000.\0003\000\040\000C\000l\000o\000u\000d\000-\000N\000a\000t\000i\000v\000e\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e\000\040\000a\000n\000d\000\040\000D\000a\000t\000a\000\040\000I\000s\000o\000l\000a\000t\000i\000o\000n}{section.5}% 30 -\BOOKMARK [2][-]{subsection.5.4}{\376\377\0005\000.\0004\000\040\000B\000e\000n\000e\000f\000i\000t\000s\000\040\000o\000f\000\040\000t\000h\000e\000\040\000H\000y\000b\000r\000i\000d\000\040\000M\000o\000d\000e\000l}{section.5}% 31 -\BOOKMARK [2][-]{subsection.5.5}{\376\377\0005\000.\0005\000\040\000E\000n\000t\000e\000r\000p\000r\000i\000s\000e\000\040\000D\000e\000p\000l\000o\000y\000m\000e\000n\000t\000\040\000a\000n\000d\000\040\000D\000a\000t\000a\000\040\000S\000o\000v\000e\000r\000e\000i\000g\000n\000t\000y}{section.5}% 32 -\BOOKMARK [2][-]{subsection.5.6}{\376\377\0005\000.\0006\000\040\000C\000o\000l\000l\000a\000b\000o\000r\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000P\000u\000b\000l\000i\000c\000\040\000S\000h\000a\000r\000i\000n\000g}{section.5}% 33 -\BOOKMARK [1][-]{section.6}{\376\377\0006\000\040\000I\000m\000p\000l\000e\000m\000e\000n\000t\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000E\000v\000a\000l\000u\000a\000t\000i\000o\000n}{}% 34 -\BOOKMARK [2][-]{subsection.6.1}{\376\377\0006\000.\0001\000\040\000T\000e\000c\000h\000n\000o\000l\000o\000g\000y\000\040\000S\000t\000a\000c\000k}{section.6}% 35 -\BOOKMARK [2][-]{subsection.Alph0.1}{\376\377\000.\0001\000\040\000D\000a\000t\000a\000b\000a\000s\000e\000\040\000S\000c\000h\000e\000m\000a\000\040\000O\000p\000t\000i\000m\000i\000z\000a\000t\000i\000o\000n}{section.6}% 36 -\BOOKMARK [2][-]{subsection.Alph0.2}{\376\377\000.\0002\000\040\000T\000e\000s\000t\000i\000n\000g\000\040\000a\000n\000d\000\040\000V\000a\000l\000i\000d\000a\000t\000i\000o\000n\000\040\000F\000r\000a\000m\000e\000w\000o\000r\000k}{section.6}% 37 -\BOOKMARK [2][-]{subsection.Alph0.3}{\376\377\000.\0003\000\040\000C\000o\000m\000p\000a\000t\000i\000b\000i\000l\000i\000t\000y\000\040\000a\000n\000d\000\040\000I\000n\000t\000e\000r\000o\000p\000e\000r\000a\000b\000i\000l\000i\000t\000y}{section.6}% 38 -\BOOKMARK [2][-]{subsection.Alph0.4}{\376\377\000.\0004\000\040\000S\000c\000a\000l\000a\000b\000i\000l\000i\000t\000y\000\040\000L\000i\000m\000i\000t\000s\000\040\000a\000n\000d\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000a\000l\000\040\000B\000o\000u\000n\000d\000a\000r\000i\000e\000s}{section.6}% 39 -\BOOKMARK [2][-]{subsection.Alph0.5}{\376\377\000.\0005\000\040\000F\000a\000i\000l\000u\000r\000e\000\040\000R\000e\000c\000o\000v\000e\000r\000y\000\040\000S\000c\000e\000n\000a\000r\000i\000o\000s}{section.6}% 40 -\BOOKMARK [2][-]{subsection.Alph0.6}{\376\377\000.\0006\000\040\000E\000x\000t\000e\000n\000s\000i\000b\000i\000l\000i\000t\000y\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e}{section.6}% 41 -\BOOKMARK [2][-]{subsection.Alph0.7}{\376\377\000.\0007\000\040\000E\000x\000t\000e\000n\000s\000i\000b\000i\000l\000i\000t\000y\000\040\000B\000e\000y\000o\000n\000d\000\040\000S\000t\000o\000r\000a\000g\000e\000:\000\040\000D\000a\000t\000a\000\040\000I\000n\000g\000e\000s\000t\000i\000o\000n\000\040\000A\000g\000e\000n\000t\000s}{section.6}% 42 -\BOOKMARK [1][-]{appendix.A}{\376\377\000A\000\040\000S\000e\000c\000u\000r\000i\000t\000y\000\040\000a\000n\000d\000\040\000P\000r\000i\000v\000a\000c\000y\000\040\000M\000o\000d\000e\000l}{}% 43 -\BOOKMARK [2][-]{subsection.A.1}{\376\377\000A\000.\0001\000\040\000D\000a\000t\000a\000\040\000P\000r\000o\000t\000e\000c\000t\000i\000o\000n\000\040\000a\000t\000\040\000R\000e\000s\000t}{appendix.A}% 44 -\BOOKMARK [2][-]{subsection.A.2}{\376\377\000A\000.\0002\000\040\000N\000e\000t\000w\000o\000r\000k\000\040\000S\000e\000c\000u\000r\000i\000t\000y}{appendix.A}% 45 -\BOOKMARK [2][-]{subsection.A.3}{\376\377\000A\000.\0003\000\040\000C\000r\000e\000d\000e\000n\000t\000i\000a\000l\000\040\000M\000a\000n\000a\000g\000e\000m\000e\000n\000t}{appendix.A}% 46 -\BOOKMARK [2][-]{subsection.A.4}{\376\377\000A\000.\0004\000\040\000T\000h\000r\000e\000a\000t\000\040\000M\000o\000d\000e\000l}{appendix.A}% 47 -\BOOKMARK [2][-]{subsection.A.5}{\376\377\000A\000.\0005\000\040\000C\000e\000r\000t\000i\000f\000i\000c\000a\000t\000e\000\040\000P\000i\000n\000n\000i\000n\000g\000\040\000a\000n\000d\000\040\000A\000P\000I\000\040\000S\000e\000c\000u\000r\000i\000t\000y}{appendix.A}% 48 -\BOOKMARK [2][-]{subsection.A.6}{\376\377\000A\000.\0006\000\040\000R\000a\000t\000e\000\040\000L\000i\000m\000i\000t\000i\000n\000g\000\040\000a\000n\000d\000\040\000A\000b\000u\000s\000e\000\040\000P\000r\000e\000v\000e\000n\000t\000i\000o\000n}{appendix.A}% 49 -\BOOKMARK [2][-]{subsection.A.7}{\376\377\000A\000.\0007\000\040\000A\000u\000d\000i\000t\000\040\000L\000o\000g\000\040\000S\000y\000s\000t\000e\000m}{appendix.A}% 50 -\BOOKMARK [2][-]{subsection.A.8}{\376\377\000A\000.\0008\000\040\000S\000p\000a\000c\000e\000d\000r\000i\000v\000e\000\040\000C\000l\000o\000u\000d\000\040\000S\000e\000r\000v\000i\000c\000e\000\040\000P\000r\000i\000v\000a\000c\000y\000\040\000M\000o\000d\000e\000l}{appendix.A}% 51 -\BOOKMARK [2][-]{subsection.A.9}{\376\377\000A\000.\0009\000\040\000P\000r\000i\000v\000a\000c\000y\000-\000P\000r\000e\000s\000e\000r\000v\000i\000n\000g\000\040\000A\000I}{appendix.A}% 52 -\BOOKMARK [2][-]{subsection.A.10}{\376\377\000A\000.\0001\0000\000\040\000B\000a\000l\000a\000n\000c\000i\000n\000g\000\040\000P\000r\000i\000v\000a\000c\000y\000\040\000a\000n\000d\000\040\000P\000u\000b\000l\000i\000c\000\040\000S\000h\000a\000r\000i\000n\000g}{appendix.A}% 53 -\BOOKMARK [1][-]{appendix.B}{\376\377\000B\000\040\000C\000o\000n\000c\000l\000u\000s\000i\000o\000n}{}% 54 -\BOOKMARK [2][-]{subsection.B.1}{\376\377\000B\000.\0001\000\040\000K\000e\000y\000\040\000C\000o\000n\000t\000r\000i\000b\000u\000t\000i\000o\000n\000s\000\040\000a\000n\000d\000\040\000R\000e\000a\000l\000-\000W\000o\000r\000l\000d\000\040\000I\000m\000p\000a\000c\000t}{appendix.B}% 55 -\BOOKMARK [2][-]{subsection.B.2}{\376\377\000B\000.\0002\000\040\000S\000y\000s\000t\000e\000m\000\040\000I\000n\000t\000e\000g\000r\000a\000t\000i\000o\000n}{appendix.B}% 56 -\BOOKMARK [2][-]{subsection.B.3}{\376\377\000B\000.\0003\000\040\000V\000a\000l\000i\000d\000a\000t\000i\000o\000n\000\040\000i\000n\000\040\000P\000r\000o\000d\000u\000c\000t\000i\000o\000n}{appendix.B}% 57 -\BOOKMARK [2][-]{subsection.B.4}{\376\377\000B\000.\0004\000\040\000F\000u\000t\000u\000r\000e\000\040\000W\000o\000r\000k\000\040\000a\000n\000d\000\040\000R\000o\000a\000d\000m\000a\000p}{appendix.B}% 58 -\BOOKMARK [2][-]{subsection.B.5}{\376\377\000B\000.\0005\000\040\000L\000i\000m\000i\000t\000a\000t\000i\000o\000n\000s}{appendix.B}% 59 -\BOOKMARK [2][-]{subsection.B.6}{\376\377\000B\000.\0006\000\040\000B\000r\000o\000a\000d\000e\000r\000\040\000I\000m\000p\000l\000i\000c\000a\000t\000i\000o\000n\000s}{appendix.B}% 60 -\BOOKMARK [1][-]{section*.74}{\376\377\000A\000c\000k\000n\000o\000w\000l\000e\000d\000g\000m\000e\000n\000t\000s}{}% 61 -\BOOKMARK [1][-]{appendix.A}{\376\377\000A\000\040\000G\000l\000o\000s\000s\000a\000r\000y\000\040\000o\000f\000\040\000T\000e\000r\000m\000s}{}% 62 -\BOOKMARK [1][-]{section*.84}{\376\377\000R\000e\000f\000e\000r\000e\000n\000c\000e\000s}{}% 63 +\BOOKMARK [2][-]{subsection.4.6}{\376\377\0004\000.\0006\000\040\000A\000I\000-\000N\000a\000t\000i\000v\000e\000\040\000V\000D\000F\000S\000:\000\040\000F\000r\000o\000m\000\040\000S\000e\000m\000a\000n\000t\000i\000c\000\040\000S\000e\000a\000r\000c\000h\000\040\000t\000o\000\040\000I\000n\000t\000e\000l\000l\000i\000g\000e\000n\000t\000\040\000M\000a\000n\000a\000g\000e\000m\000e\000n\000t}{section.4}% 21 +\BOOKMARK [2][-]{subsection.4.7}{\376\377\0004\000.\0007\000\040\000T\000e\000m\000p\000o\000r\000a\000l\000-\000S\000e\000m\000a\000n\000t\000i\000c\000\040\000S\000e\000a\000r\000c\000h\000:\000\040\000A\000n\000\040\000A\000s\000y\000n\000c\000h\000r\000o\000n\000o\000u\000s\000,\000\040\000J\000o\000b\000-\000B\000a\000s\000e\000d\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e}{section.4}% 22 +\BOOKMARK [2][-]{subsection.4.8}{\376\377\0004\000.\0008\000\040\000N\000a\000t\000i\000v\000e\000\040\000S\000t\000o\000r\000a\000g\000e\000\040\000T\000i\000e\000r\000i\000n\000g\000:\000\040\000R\000e\000c\000o\000n\000c\000i\000l\000i\000n\000g\000\040\000P\000h\000y\000s\000i\000c\000a\000l\000\040\000R\000e\000a\000l\000i\000t\000y\000\040\000a\000n\000d\000\040\000U\000s\000e\000r\000\040\000I\000n\000t\000e\000n\000t}{section.4}% 23 +\BOOKMARK [2][-]{subsection.4.9}{\376\377\0004\000.\0009\000\040\000V\000o\000l\000u\000m\000e\000\040\000C\000l\000a\000s\000s\000i\000f\000i\000c\000a\000t\000i\000o\000n}{section.4}% 24 +\BOOKMARK [2][-]{subsection.4.10}{\376\377\0004\000.\0001\0000\000\040\000P\000l\000a\000t\000f\000o\000r\000m\000\040\000I\000n\000t\000e\000g\000r\000a\000t\000i\000o\000n\000s\000:\000\040\000U\000n\000i\000f\000i\000e\000d\000\040\000A\000c\000c\000e\000s\000s\000\040\000t\000o\000\040\000T\000r\000a\000d\000i\000t\000i\000o\000n\000a\000l\000\040\000a\000n\000d\000\040\000M\000o\000d\000e\000r\000n\000\040\000S\000t\000o\000r\000a\000g\000e}{section.4}% 25 +\BOOKMARK [1][-]{section.5}{\376\377\0005\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000a\000l\000\040\000A\000p\000p\000l\000i\000c\000a\000t\000i\000o\000n\000:\000\040\000A\000\040\000N\000a\000t\000i\000v\000e\000\040\000C\000l\000o\000u\000d\000\040\000S\000e\000r\000v\000i\000c\000e}{}% 26 +\BOOKMARK [2][-]{subsection.5.1}{\376\377\0005\000.\0001\000\040\000C\000o\000r\000e\000\040\000P\000r\000i\000n\000c\000i\000p\000l\000e\000:\000\040\000M\000a\000n\000a\000g\000e\000d\000\040\000C\000o\000r\000e\000s\000\040\000a\000s\000\040\000F\000i\000r\000s\000t\000-\000C\000l\000a\000s\000s\000\040\000D\000e\000v\000i\000c\000e\000s}{section.5}% 27 +\BOOKMARK [2][-]{subsection.5.2}{\376\377\0005\000.\0002\000\040\000I\000n\000t\000e\000g\000r\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000U\000s\000e\000r\000\040\000E\000x\000p\000e\000r\000i\000e\000n\000c\000e}{section.5}% 28 +\BOOKMARK [2][-]{subsection.5.3}{\376\377\0005\000.\0003\000\040\000C\000l\000o\000u\000d\000-\000N\000a\000t\000i\000v\000e\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e\000\040\000a\000n\000d\000\040\000D\000a\000t\000a\000\040\000I\000s\000o\000l\000a\000t\000i\000o\000n}{section.5}% 29 +\BOOKMARK [2][-]{subsection.5.4}{\376\377\0005\000.\0004\000\040\000B\000e\000n\000e\000f\000i\000t\000s\000\040\000o\000f\000\040\000t\000h\000e\000\040\000H\000y\000b\000r\000i\000d\000\040\000M\000o\000d\000e\000l}{section.5}% 30 +\BOOKMARK [2][-]{subsection.5.5}{\376\377\0005\000.\0005\000\040\000E\000n\000t\000e\000r\000p\000r\000i\000s\000e\000\040\000D\000e\000p\000l\000o\000y\000m\000e\000n\000t\000\040\000a\000n\000d\000\040\000D\000a\000t\000a\000\040\000S\000o\000v\000e\000r\000e\000i\000g\000n\000t\000y}{section.5}% 31 +\BOOKMARK [2][-]{subsection.5.6}{\376\377\0005\000.\0006\000\040\000C\000o\000l\000l\000a\000b\000o\000r\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000P\000u\000b\000l\000i\000c\000\040\000S\000h\000a\000r\000i\000n\000g}{section.5}% 32 +\BOOKMARK [1][-]{section.6}{\376\377\0006\000\040\000I\000m\000p\000l\000e\000m\000e\000n\000t\000a\000t\000i\000o\000n\000\040\000a\000n\000d\000\040\000E\000v\000a\000l\000u\000a\000t\000i\000o\000n}{}% 33 +\BOOKMARK [2][-]{subsection.6.1}{\376\377\0006\000.\0001\000\040\000T\000e\000c\000h\000n\000o\000l\000o\000g\000y\000\040\000S\000t\000a\000c\000k}{section.6}% 34 +\BOOKMARK [2][-]{subsection.Alph0.1}{\376\377\000.\0001\000\040\000D\000a\000t\000a\000b\000a\000s\000e\000\040\000S\000c\000h\000e\000m\000a\000\040\000O\000p\000t\000i\000m\000i\000z\000a\000t\000i\000o\000n}{section.6}% 35 +\BOOKMARK [2][-]{subsection.Alph0.2}{\376\377\000.\0002\000\040\000T\000e\000s\000t\000i\000n\000g\000\040\000a\000n\000d\000\040\000V\000a\000l\000i\000d\000a\000t\000i\000o\000n\000\040\000F\000r\000a\000m\000e\000w\000o\000r\000k}{section.6}% 36 +\BOOKMARK [2][-]{subsection.Alph0.3}{\376\377\000.\0003\000\040\000C\000o\000m\000p\000a\000t\000i\000b\000i\000l\000i\000t\000y\000\040\000a\000n\000d\000\040\000I\000n\000t\000e\000r\000o\000p\000e\000r\000a\000b\000i\000l\000i\000t\000y}{section.6}% 37 +\BOOKMARK [2][-]{subsection.Alph0.4}{\376\377\000.\0004\000\040\000S\000c\000a\000l\000a\000b\000i\000l\000i\000t\000y\000\040\000L\000i\000m\000i\000t\000s\000\040\000a\000n\000d\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000a\000l\000\040\000B\000o\000u\000n\000d\000a\000r\000i\000e\000s}{section.6}% 38 +\BOOKMARK [2][-]{subsection.Alph0.5}{\376\377\000.\0005\000\040\000F\000a\000i\000l\000u\000r\000e\000\040\000R\000e\000c\000o\000v\000e\000r\000y\000\040\000S\000c\000e\000n\000a\000r\000i\000o\000s}{section.6}% 39 +\BOOKMARK [2][-]{subsection.Alph0.6}{\376\377\000.\0006\000\040\000E\000x\000t\000e\000n\000s\000i\000b\000i\000l\000i\000t\000y\000\040\000A\000r\000c\000h\000i\000t\000e\000c\000t\000u\000r\000e}{section.6}% 40 +\BOOKMARK [2][-]{subsection.Alph0.7}{\376\377\000.\0007\000\040\000E\000x\000t\000e\000n\000s\000i\000b\000i\000l\000i\000t\000y\000\040\000B\000e\000y\000o\000n\000d\000\040\000S\000t\000o\000r\000a\000g\000e\000:\000\040\000D\000a\000t\000a\000\040\000I\000n\000g\000e\000s\000t\000i\000o\000n\000\040\000A\000g\000e\000n\000t\000s}{section.6}% 41 +\BOOKMARK [1][-]{appendix.A}{\376\377\000A\000\040\000S\000e\000c\000u\000r\000i\000t\000y\000\040\000a\000n\000d\000\040\000P\000r\000i\000v\000a\000c\000y\000\040\000M\000o\000d\000e\000l}{}% 42 +\BOOKMARK [2][-]{subsection.A.1}{\376\377\000A\000.\0001\000\040\000D\000a\000t\000a\000\040\000P\000r\000o\000t\000e\000c\000t\000i\000o\000n\000\040\000a\000t\000\040\000R\000e\000s\000t}{appendix.A}% 43 +\BOOKMARK [2][-]{subsection.A.2}{\376\377\000A\000.\0002\000\040\000N\000e\000t\000w\000o\000r\000k\000\040\000S\000e\000c\000u\000r\000i\000t\000y}{appendix.A}% 44 +\BOOKMARK [2][-]{subsection.A.3}{\376\377\000A\000.\0003\000\040\000C\000r\000e\000d\000e\000n\000t\000i\000a\000l\000\040\000M\000a\000n\000a\000g\000e\000m\000e\000n\000t}{appendix.A}% 45 +\BOOKMARK [2][-]{subsection.A.4}{\376\377\000A\000.\0004\000\040\000T\000h\000r\000e\000a\000t\000\040\000M\000o\000d\000e\000l}{appendix.A}% 46 +\BOOKMARK [2][-]{subsection.A.5}{\376\377\000A\000.\0005\000\040\000C\000e\000r\000t\000i\000f\000i\000c\000a\000t\000e\000\040\000P\000i\000n\000n\000i\000n\000g\000\040\000a\000n\000d\000\040\000A\000P\000I\000\040\000S\000e\000c\000u\000r\000i\000t\000y}{appendix.A}% 47 +\BOOKMARK [2][-]{subsection.A.6}{\376\377\000A\000.\0006\000\040\000R\000a\000t\000e\000\040\000L\000i\000m\000i\000t\000i\000n\000g\000\040\000a\000n\000d\000\040\000A\000b\000u\000s\000e\000\040\000P\000r\000e\000v\000e\000n\000t\000i\000o\000n}{appendix.A}% 48 +\BOOKMARK [2][-]{subsection.A.7}{\376\377\000A\000.\0007\000\040\000A\000u\000d\000i\000t\000\040\000L\000o\000g\000\040\000S\000y\000s\000t\000e\000m}{appendix.A}% 49 +\BOOKMARK [2][-]{subsection.A.8}{\376\377\000A\000.\0008\000\040\000S\000p\000a\000c\000e\000d\000r\000i\000v\000e\000\040\000C\000l\000o\000u\000d\000\040\000S\000e\000r\000v\000i\000c\000e\000\040\000P\000r\000i\000v\000a\000c\000y\000\040\000M\000o\000d\000e\000l}{appendix.A}% 50 +\BOOKMARK [2][-]{subsection.A.9}{\376\377\000A\000.\0009\000\040\000P\000r\000i\000v\000a\000c\000y\000-\000P\000r\000e\000s\000e\000r\000v\000i\000n\000g\000\040\000A\000I}{appendix.A}% 51 +\BOOKMARK [2][-]{subsection.A.10}{\376\377\000A\000.\0001\0000\000\040\000B\000a\000l\000a\000n\000c\000i\000n\000g\000\040\000P\000r\000i\000v\000a\000c\000y\000\040\000a\000n\000d\000\040\000P\000u\000b\000l\000i\000c\000\040\000S\000h\000a\000r\000i\000n\000g}{appendix.A}% 52 +\BOOKMARK [1][-]{appendix.B}{\376\377\000B\000\040\000C\000o\000n\000c\000l\000u\000s\000i\000o\000n}{}% 53 +\BOOKMARK [2][-]{subsection.B.1}{\376\377\000B\000.\0001\000\040\000K\000e\000y\000\040\000C\000o\000n\000t\000r\000i\000b\000u\000t\000i\000o\000n\000s\000\040\000a\000n\000d\000\040\000R\000e\000a\000l\000-\000W\000o\000r\000l\000d\000\040\000I\000m\000p\000a\000c\000t}{appendix.B}% 54 +\BOOKMARK [2][-]{subsection.B.2}{\376\377\000B\000.\0002\000\040\000S\000y\000s\000t\000e\000m\000\040\000I\000n\000t\000e\000g\000r\000a\000t\000i\000o\000n}{appendix.B}% 55 +\BOOKMARK [2][-]{subsection.B.3}{\376\377\000B\000.\0003\000\040\000V\000a\000l\000i\000d\000a\000t\000i\000o\000n\000\040\000i\000n\000\040\000P\000r\000o\000d\000u\000c\000t\000i\000o\000n}{appendix.B}% 56 +\BOOKMARK [2][-]{subsection.B.4}{\376\377\000B\000.\0004\000\040\000F\000u\000t\000u\000r\000e\000\040\000W\000o\000r\000k\000\040\000a\000n\000d\000\040\000R\000o\000a\000d\000m\000a\000p}{appendix.B}% 57 +\BOOKMARK [2][-]{subsection.B.5}{\376\377\000B\000.\0005\000\040\000L\000i\000m\000i\000t\000a\000t\000i\000o\000n\000s}{appendix.B}% 58 +\BOOKMARK [2][-]{subsection.B.6}{\376\377\000B\000.\0006\000\040\000B\000r\000o\000a\000d\000e\000r\000\040\000I\000m\000p\000l\000i\000c\000a\000t\000i\000o\000n\000s}{appendix.B}% 59 +\BOOKMARK [1][-]{section*.57}{\376\377\000A\000c\000k\000n\000o\000w\000l\000e\000d\000g\000m\000e\000n\000t\000s}{}% 60 +\BOOKMARK [1][-]{appendix.A}{\376\377\000A\000\040\000G\000l\000o\000s\000s\000a\000r\000y\000\040\000o\000f\000\040\000T\000e\000r\000m\000s}{}% 61 +\BOOKMARK [1][-]{section*.67}{\376\377\000R\000e\000f\000e\000r\000e\000n\000c\000e\000s}{}% 62