feat(enterprise-org-vault): Dev-A — relicario-core org module #6
Reference in New Issue
Block a user
Delete Branch "feature/enterprise-org-vault-dev-a"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
x25519-dalek 2(static_secrets) torelicario-core.OrgId,MemberId,OrgRole(+can_manage_members/can_manage_owners),OrgMember,OrgMembers(validate()rejects non-hex ids),CollectionDef,OrgCollections(slug validation rejects empty ///.),OrgMeta,OrgManifest,OrgManifestEntry(+filter_for_member).generate_org_key,wrap_org_key,unwrap_org_key— ed25519→X25519 via SHA-512 + RFC 7748 clamp, SHA-256 domain-separated KDF bindingshared || ephemeral_pk || recipient_pk, XChaCha20-Poly1305 inner cipher delegated tocrate::crypto, all KDF intermediates held inZeroizing. Output layout:ephemeral_x25519_pk(32) || version(1) || nonce(24) || ct+tag.encrypt_org_manifest/decrypt_org_manifestvault wrappers + crate re-exports.tests/org.rs(5 acceptance tests) + org unit tests, including a pinned RFC 8032 ed25519→X25519 known-answer vector that guards the birational map against dep-bump drift.Test plan
cargo test -p relicario-core --test org— 5/5 integration tests pass (independently re-run by controller)cargo test -p relicario-core— unit tests green (org::tests::*+vault::tests::org_manifest_round_trip)cargo test— full workspace green (26/26 test-result sections, 0 failed)cargo build -p relicario-wasm --target wasm32-unknown-unknown— clean (feature-unification check)Review
Per-task spec+quality reviews after A2/A3/A4; final whole-branch review on Opus: Ready to merge = YES, no Critical/Important findings. Three non-blocking Minors (a
.0→.as_ref()dep-layout nit consistent with existingdevice.rs;added_bynot validated; noOrgId::is_valid()) deferred to the A5 docs sweep.Coordination
Prerequisite for Dev-B (CLI org commands) and Dev-C (server pre-receive hook) — both import
relicario_core::organd are blocked until A2–A3 merge. Dev-D (extension) is deferred this lift.Plan:
docs/superpowers/plans/2026-06-06-enterprise-org-vault.md(Tasks A1–A4).🤖 Generated with Claude Code
Corrects every critical/high finding from the adversarial review and adds the two scope expansions (full item CRUD + extension parity): - Device-key helpers built on the real devices/<name>/signing.{key,pub} layout + ssh-key CLI dep (was: invented ~/.config/relicario/device.key) - Signature-verifying pre-receive hook on every commit + path-scoped write authz via items/<slug>/<id>.enc (was: bare %GF, unenforceable flat items) - Org item CRUD (add/get/list/edit/rm/restore/purge), collection-scoped - Audit attributed to verified signer + TAMPERED flag (was: spoofable trailers) - rotate-key re-encrypts every item blob (was: manifest only) - Zeroize KDF intermediates; fix ssh_key::PrivateKey::from test helpers - Owner-only role-gating; fingerprint-based member matching; %x1e/%x1f audit parser framing; signed org commits via org_git_run - Extension stream (WASM bindings + SW org session + switcher + 3 vitest tests) - Stream-prefixed task IDs (A/B/C/D) with explicit cross-stream deps - Living-docs task Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Re-verification gate cleared all original criticals; these close the residual defects the reassembly leaked back in: HIGH: - H-D1: add ssh-key dep to relicario-wasm; two-step PrivateKey::from; drop false note - H-D2: org_open_with_registered_device unwraps inside WASM (DEVICE_STATE seed, session-only); device private key never crosses to JS - H-D3: extension grant-filters the org manifest (members.json → member grants → filter_for_member) to honor the spec parity promise - H-C1: hook diffs {commit}^:members.json, rejects owner/admin escalation unless signer is Owner; adds signed-commit hook test - H-B4: reorder B4 tests to "org init --dir <path>" (subcommand-scoped global) MEDIUM: trash=item-delete + item-restore vocabulary reconciled; real transfer-ownership (demote caller unless --keep-owner); delete-org local-only caveat in spec; pinned RFC8032 X25519 KAT. LOW: org init honors RELICARIO_ORG_DIR; D3 VaultEntry type pinned; static_secrets in File Map/Tech Stack; --format <table|json>; hook slug-in-collections check; spec-mandated integration tests (TAMPERED, audit JSON, rotate race, remove→rotate decrypt-denial). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Pull request closed