From 17221a2683bac1a86b521a51c7de06f708995357 Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Tue, 30 Jun 2026 19:48:16 +0200 Subject: [PATCH] =?UTF-8?q?feat(cli):=20files=20kind=20in=20manifest=20+?= =?UTF-8?q?=20reconcile=20(=C2=A711.6=20files=20C4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - manifest: add CollectionKind::Files (+ "files" in as_str()); the string-or-table `collections` form now accepts { name, kind = "files" }. - apply_service: add "files" to COLLECTION_KINDS. The rest of the reconcile (CollectionSpec, diff_collections, validate_bundle, state_token, the app-owner rejection) is already kind-generic. - `pic collections ls` shows the files kind with no code change. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/manager-core/src/apply_service.rs | 2 +- crates/picloud-cli/src/manifest.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/manager-core/src/apply_service.rs b/crates/manager-core/src/apply_service.rs index 07383f9..d5f1a5c 100644 --- a/crates/manager-core/src/apply_service.rs +++ b/crates/manager-core/src/apply_service.rs @@ -110,7 +110,7 @@ fn default_collection_kind() -> String { } /// The shared-collection kinds the apply engine accepts. -const COLLECTION_KINDS: &[&str] = &["kv", "docs"]; +const COLLECTION_KINDS: &[&str] = &["kv", "docs", "files"]; #[derive(Debug, Clone, Deserialize)] pub struct BundleScript { diff --git a/crates/picloud-cli/src/manifest.rs b/crates/picloud-cli/src/manifest.rs index 89ba1d9..451e9c5 100644 --- a/crates/picloud-cli/src/manifest.rs +++ b/crates/picloud-cli/src/manifest.rs @@ -269,6 +269,7 @@ pub struct ManifestGroup { pub enum CollectionKind { Kv, Docs, + Files, } impl CollectionKind { @@ -277,6 +278,7 @@ impl CollectionKind { match self { Self::Kv => "kv", Self::Docs => "docs", + Self::Files => "files", } } } @@ -726,7 +728,8 @@ mod tests { // `{ name, kind }` table sets an explicit kind. Both coexist. let m = Manifest::parse( "[group]\nslug = \"acme\"\nname = \"ACME\"\n\n\ - collections = [\"catalog\", { name = \"articles\", kind = \"docs\" }]\n", + collections = [\"catalog\", { name = \"articles\", kind = \"docs\" }, \ + { name = \"assets\", kind = \"files\" }]\n", ) .expect("string-or-table collections must parse"); assert_eq!( @@ -734,6 +737,7 @@ mod tests { vec![ ("catalog".to_string(), "kv".to_string()), ("articles".to_string(), "docs".to_string()), + ("assets".to_string(), "files".to_string()), ] ); // An app manifest carrying `collections` is rejected (no such field +