docs(portable): Phase 6 verification and findings; harness collection-add

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ДмитрийandClaude Sonnet 5.5 committed 2026-10-07 05:54:49 +05:00
1 parent 843eb9b2eb
commit f6006edfaf
2 files changed
+146

No files matched your search

@@ -23,6 +23,7 @@
//! dump <character-id> the canonical JSON of the current revision (what a core import job carries)
//! collection-states <out.json> (owner store) the canonical account collections as messages
//! collection-apply <states.json> <account> <server-id> write the canonical collections to the realm account (known ids only, INSERT IGNORE)
//! collection-add <kind> <id>... (owner store) add ids to a profile collection by hand (a test aid)
//! collection-show [<account>] the Owner's collections (revision, count, hash) and, with an account, the realm's
//!
//! --collection-interval <seconds> how often host-run looks at the account collections (default 300; a session start and the final
@@ -213,6 +214,13 @@ fn run() -> Result<(), String> {
println!("{}: {:?}", state.kind, applied);
}
}
("collection-add", [kind, ids @ ..]) => {
let profile = store.default_profile().map_err(|e| e.to_string())?;
let ids = ids.iter().map(|i| i.parse::<u32>().map_err(|_| format!("{i:?} is not an id"))).collect::<Result<Vec<_>, _>>()?;
let set = coa_core::portable::collection::IdSet::from_ids(ids).map_err(|e| e.to_string())?;
let merge = store.merge_collection(profile, kind, &set).map_err(|e| e.to_string())?;
println!("{kind}: {} id(s) added{}", merge.added, merge.info.map(|i| format!(", revision {}, {} ids", i.revision, i.count)).unwrap_or_default());
}
("collection-show", rest) => {
let profile = store.default_profile().map_err(|e| e.to_string())?;
for kind in coa_core::portable::session::protocol::COLLECTION_KINDS {