Skip to content

feat(id-worlds): template manifest + strip-rules export (#8282 slice 1) - #14097

Merged
dezren39 merged 1 commit into
mainfrom
queue/20114-8282-template-world-export
Nov 24, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/20114-8282-template-world-export

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

First slice of #8282 (design #6278, decision D5): template-world snapshot export half in a new id-worlds module (world_template).

  • TemplateManifest format (v1): program bundle references (identity + content hash, reusing program_bundle::ProgramIdentity), role definitions (no members), template-scoped state, plus stripped / retained accounting entries.
  • Strip rules over a serializable TemplateSource projection: member lists, credentials/secrets, per-user data and grants are stripped by construction (the types that carry them are never read into the bundle); every stripped category is counted in the manifest.
  • export_template validates its inputs (empty role name, empty program hash rejected) and is otherwise total.
  • Import (fresh world identity, empty roles, hash-verified install via the ordinary D4 path) and the round-trip acceptance are the next slices, not this PR.

Evidence

Oracle for the tests: the D5 invariant — a template never carries another user's identity material — plus exact manifest accounting.

  • Before: world_template does not exist on origin/main; cargo test -p id-worlds world_template matches 0 tests.
  • After (worktree at 4b430b959e1, laptop build through ~/tools/fleet-build-lock):
    • cargo test -p id-worlds world_template → 8 passed, 0 failed (3 unit incl. the id: implement template-world snapshot export/import (from #6278) #8282 acceptance fixture in miniature, 2 validation, 3 proptest properties: explained-strings-only, exact strip accounting, verbatim carried content).
    • cargo clippy -p id-worlds --tests → no findings in world_template; rustfmt --check clean.
    • Two proptest iterations caught real formulation bugs during development (substring false-positive on short strings; dropped map keys) — the final explained-strings property is positional and exact.
  • New test code lives in-module (#[cfg(test)]), so no new test file and no .github/test-suite-registry.json row is required (registry check prints nothing for this path).

Merge Danger

Low. Purely additive: one new file + one pub mod line in lib.rs. No existing type, test, or behavior touched. No migration (read-only design data), no secrets, no network. Revert = delete the module + the mod line.

Closes nothing (slice 1 of #8282); follow-up slice is template import.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T05:14:50Z",
    "session_id": "ses_e5df41ff89bffeJWncgxN8BlWI",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/worktrees/20114-template",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/worktrees/20114-template",
      "repo": "developing-today/code",
      "branch": "queue/20114-8282-template-world-export",
      "sha": "4b430b959e14638f6f5ed837739367a45f9e4bcf"
    },
    "auth_subject": "oc-code-04",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

First slice of #8282 (design #6278 D5): TemplateManifest format,
SourcedRole/Credential/UserDatum strip rules, and export_template
with the D5 invariant (a template never carries another user's
identity material) stated as property tests plus a fixture unit
test. Import with fresh world identity is the next slice.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 82d76d18-2011-4cf2-9fa7-ecb61f2897a8
Commits

Reviewing files that changed from the base of the PR and between bff8a0e and 4b430b9.

Files selected for processing: 2

  • pkgs/id/crates/id-worlds/src/lib.rs
  • pkgs/id/crates/id-worlds/src/world_template.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit eb27aa6 into main Nov 24, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/20114-8282-template-world-export branch November 24, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant