diff --git a/docs/superpowers/plans/2026-05-10-serde-registry-integration.md b/docs/superpowers/plans/2026-05-10-serde-registry-integration.md new file mode 100644 index 0000000..c6f1dec --- /dev/null +++ b/docs/superpowers/plans/2026-05-10-serde-registry-integration.md @@ -0,0 +1,51 @@ +# Serde Integration & Private Registry Connection Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Enable Serde derivations for all generated Rust types and configure private Kellnr registry connections for Rust, Python, and NPM. + +**Architecture:** Update `build.rs` to inject Serde attributes during codegen and create environment-specific registry config files based on `vtuber-commons` templates. + +**Tech Stack:** Rust (tonic, prost, serde), Kellnr Registry, Pixi, GitHub Actions. + +--- + +### Task 1: Update Rust Dependencies + +**Files:** +- Modify: `Cargo.toml` + +- [ ] **Step 1: Move serde to core dependencies and enable derive feature** +- [ ] **Step 2: Enable serde feature for prost-types** + +### Task 2: Inject Serde Attributes in build.rs + +**Files:** +- Modify: `build.rs` + +- [ ] **Step 1: Update build.rs to use type_attribute for all messages and enums** +- [ ] **Step 2: Run cargo build to verify codegen contains Serialize/Deserialize** + +### Task 3: Implement Serde Unit Test + +**Files:** +- Create: `tests/serde_roundtrip.rs` + +- [ ] **Step 1: Create a test that serializes and deserializes ConversationDirective to/from JSON** +- [ ] **Step 2: Verify the test passes with cargo test** + +### Task 4: Configure Private Registry (Kellnr) + +**Files:** +- Create: `.cargo/config.toml` +- Create: `pip.conf` +- Create: `.npmrc` +- Modify: `Cargo.toml` + +- [ ] **Step 1: Set publish restriction in Cargo.toml** +- [ ] **Step 2: Create registry config files for Cargo, Pip, and NPM using Kellnr URL** + +### Task 5: Final Verification + +- [ ] **Step 1: Run full test suite (cargo test, pixi run test, buf lint)** +- [ ] **Step 2: Update STRUCTURE.tree and push changes** diff --git a/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md b/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md new file mode 100644 index 0000000..f7e4c09 --- /dev/null +++ b/docs/superpowers/specs/2026-05-10-serde-registry-integration-design.md @@ -0,0 +1,31 @@ +# Design Spec: Serde Integration & Private Registry Connection + +## ๐Ÿ“ Overview +This specification details the implementation of Serde support for all generated Rust types and the configuration of the project to use the private Kellnr registry. This ensures that contracts are easily serializable/deserializable for configuration purposes (YAML/TOML/JSON) and can be safely shared across the ecosystem. + +## ๐Ÿ”— Related Issues +- Fixes #6 (Connect to private package registry - Kellnr) +- Fixes #7 (Enable serde derivations for all generated types) + +## ๐Ÿ—๏ธ Architectural Changes + +### 1. Rust Serde Derivations (Issue #7) +- **Dependency Update:** Move `serde` with `derive` feature to core dependencies in `Cargo.toml`. +- **Prost Integration:** Enable the `serde` feature for `prost-types` to allow Google types (Timestamp, Struct) to be serialized correctly. +- **Codegen Modification:** Update `build.rs` to use `.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")`. +- **Convention:** Stick to original snake_case naming for maximum compatibility with existing persona YAMLs. + +### 2. Private Registry Configuration (Issue #6) +- **Cargo (Rust):** Create `.cargo/config.toml` pointing to `http://kellnr.cntm.labs:31500/api/v1/crates`. +- **Safety:** Add `publish = ["vtuber-registry"]` to `Cargo.toml` to prevent accidental leaks to public registries. +- **Pip (Python):** Create `pip.conf` with `extra-index-url` pointing to Kellnr and mark it as a trusted host. +- **NPM (Node.js):** Create `.npmrc` with scoped registry `@vtuber` pointing to Kellnr. + +## ๐Ÿงช Verification Plan +1. **Build Test:** Run `cargo build` and ensure it compiles without errors. +2. **Serde Verification:** Write a unit test in Rust that serializes a `ConversationDirective` to JSON and back. +3. **Registry Verification:** Run `cargo metadata --format-version 1` to ensure registry configuration is recognized. +4. **Consistency Check:** Ensure `buf generate` still produces synced code and passes CI linting. + +## โš–๏ธ Future Considerations +- Transitioning from manual file copying to BSR (Buf Schema Registry) once the initial local registry flow is stabilized.