{
  "schema_version": "0.1",
  "artifact_type": "prd",
  "canonical": true,
  "artifact_id": "PRD-010",
  "agent_summary": {
    "title": "Portable repository module contract",
    "status": "approved",
    "summary": "Define the PRD Plugin-owned portable desired-state contract that lets AI-Collab admit, bind, and project PRD-enabled repositories without scraping plugin internals or accepting repository declarations as runtime authority.",
    "last_reviewed_at": "2026-07-15",
    "load_notes": "Canonical JSON. The approved human-readable contract and schema are under docs/specs/repository-module-contract-v1/."
  },
  "goals": [
    "Compile fragmented repository-owned PRD Plugin authorities into one source-pinned module.manifest.",
    "Publish one normative package consisting of JSON Schema, Markdown rules, and conformance fixtures.",
    "Preserve a hard ownership seam between portable desired declarations and AI-Collab-owned admission/effective runtime state.",
    "Support passive, agent-routable, native, and legacy-adapted repositories through one normalized contract."
  ],
  "non_goals": [
    "Define or persist AI-Collab's live module.binding, provider accounts, participants, sessions, health, or current roster.",
    "Treat a repository declaration as a permission grant or let repository defaults override workspace policy or the consent floor.",
    "Store resolved secret values, provider credentials, or sensitive provider diagnostics in repository, Fork, log, replay, wiki, or index surfaces.",
    "Add module-specific semantics to Fork before tests prove a missing generic substrate primitive.",
    "Perform a flag-day rewrite of existing core modules or put legacy compatibility logic in each Hub."
  ],
  "requirements": [
    {"id": "PRD-REQ-073", "priority": "must", "summary": "Define one canonical module.manifest with versioned sections for stable identity, compatibility, consumes, needs, offers, governance, migration, and provenance.", "source_ids": ["BR-REQ-027", "BR-REQ-028", "MSG-mrmmvp3c-xcrxm6"], "acceptance_ids": ["PRD-ACC-086"], "status": "approved"},
    {"id": "PRD-REQ-074", "priority": "must", "summary": "Publish the contract as JSON Schema, human-readable Markdown, and positive/negative conformance fixtures with a pinned source cutoff and explicit shipped/target classification.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-087"], "status": "approved"},
    {"id": "PRD-REQ-075", "priority": "must", "summary": "Keep PRD Plugin authoritative for portable desired declarations, compilation, validation, migrations, provenance, and conformance evidence while AI-Collab owns admission, effective grants, live bindings, reconciliation, health, providers, runners, routes, participants, and roster.", "source_ids": ["BR-REQ-028", "MSG-mrmmvp3c-xcrxm6"], "acceptance_ids": ["PRD-ACC-088"], "status": "approved"},
    {"id": "PRD-REQ-076", "priority": "must", "summary": "Use a complete UTCP-first tool catalog as the source of tool metadata and treat MCP only as a generated compatibility projection while preserving handler-level validation and authorization.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-089"], "status": "approved"},
    {"id": "PRD-REQ-077", "priority": "must", "summary": "Forbid resolved secret values and provider credentials; allow only typed opaque secret requirements and references resolved and injected at the authorized runner boundary.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-090"], "status": "approved"},
    {"id": "PRD-REQ-078", "priority": "must", "summary": "Allow passive modules without a repo expert and require at least one repo_expert agent profile for every agent-routable module.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-091"], "status": "approved"},
    {"id": "PRD-REQ-079", "priority": "must", "summary": "Keep roles, agent profiles, team templates, provider capability policy, prompt-layer references, and requested permissions portable while excluding live agent instances, sessions, quotas, health, assignments, and concrete provider accounts.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-092"], "status": "approved"},
    {"id": "PRD-REQ-080", "priority": "must", "summary": "Declare offers for tools, knowledge, configuration, skills, workflows, data contracts, app contributions, runners, observability, and agent profiles without granting discovery, read, invoke, dispatch, mutate, or mount authority.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-093"], "status": "approved"},
    {"id": "PRD-REQ-081", "priority": "must", "summary": "Declare consumes and needs with compatibility ranges, permissions, approvals, required or optional policy, and explicit block or degrade fallback.", "source_ids": ["BR-REQ-027", "MSG-mrmmvp3c-xcrxm6"], "acceptance_ids": ["PRD-ACC-094"], "status": "approved"},
    {"id": "PRD-REQ-082", "priority": "must", "summary": "Carry source authority, artifact digests, field provenance, adapter kind/version, conformance level, missing fields, compatibility warnings, legacy entry points, replacements, parity evidence, state migrations, and rollback metadata.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-095"], "status": "approved"},
    {"id": "PRD-REQ-083", "priority": "must", "summary": "Require both domain specs to enforce stable logical binding identity, monotonic desired generation, exact digest/revision/policy matching, and the invariant that stale observed state never authorizes, while leaving the binding schema to AI-Collab.", "source_ids": ["BR-REQ-028", "MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-096"], "status": "approved"},
    {"id": "PRD-REQ-084", "priority": "must", "summary": "Default-deny unknown, incompatible, denied, stale, or unverifiable capabilities and preserve workspace policy, autonomy, approvals, and the consent floor as higher authority than repository requests.", "source_ids": ["MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"], "acceptance_ids": ["PRD-ACC-097"], "status": "approved"}
  ],
  "non_functional_requirements": [
    {"id": "PRD-NFR-038", "summary": "Security: no resolved secret or credential material may enter durable/shared surfaces, and secret readiness or provider diagnostics are permission-filtered.", "source_ids": ["PRD-REQ-077", "PRD-REQ-084"]},
    {"id": "PRD-NFR-039", "summary": "Authority: manifest declarations are admission requests rather than runtime grants; every execution and mutation boundary rechecks effective policy.", "source_ids": ["PRD-REQ-075", "PRD-REQ-080", "PRD-REQ-084"]},
    {"id": "PRD-NFR-040", "summary": "Compatibility: stable module and capability identities, one normalization boundary, explicit conformance levels, parity evidence, and verified rollback enable additive migration.", "source_ids": ["PRD-REQ-082", "PRD-REQ-083"]},
    {"id": "PRD-NFR-041", "summary": "Traceability: every compiled field and artifact is source-pinned, digest-backed, status-classified, and reviewable without treating stale manuals or dirty candidates as shipped truth.", "source_ids": ["PRD-REQ-073", "PRD-REQ-074", "PRD-REQ-082"]},
    {"id": "PRD-NFR-042", "summary": "Portability: the schema remains repository- and provider-neutral, supports passive modules, and does not require an AI-Collab runtime for local PRD Plugin operation.", "source_ids": ["PRD-REQ-073", "PRD-REQ-078"]}
  ],
  "acceptance_criteria": [
    {"id": "PRD-ACC-086", "summary": "A valid manifest has one stable module identity and all required identity, compatibility, consumes, needs, offers, governance, migration, and provenance sections; unknown top-level fields fail validation.", "requirement_ids": ["PRD-REQ-073"]},
    {"id": "PRD-ACC-087", "summary": "The pinned Markdown, Draft 2020-12 JSON Schema, and fixtures are parseable, internally consistent, and covered by an automated conformance test.", "requirement_ids": ["PRD-REQ-074", "PRD-NFR-041"]},
    {"id": "PRD-ACC-088", "summary": "Cross-spec review assigns every desired/compiler/validator concern to PRD Plugin and every admitted/effective/live/reconciled concern to AI-Collab, with no dual authority.", "requirement_ids": ["PRD-REQ-075", "PRD-NFR-039"]},
    {"id": "PRD-ACC-089", "summary": "Fixtures and migration tests reject MCP as catalog authority, permit only generated MCP projection, and prove complete UTCP metadata drives all supported transports.", "requirement_ids": ["PRD-REQ-076"]},
    {"id": "PRD-ACC-090", "summary": "Schema and recursive security checks reject resolved secret/credential fields; runtime fixtures expose only authorized readiness classes and runner-scoped handles.", "requirement_ids": ["PRD-REQ-077", "PRD-NFR-038"]},
    {"id": "PRD-ACC-091", "summary": "The passive fixture validates without an expert, the routable fixture validates with one, and the routable-without-expert fixture fails.", "requirement_ids": ["PRD-REQ-078", "PRD-NFR-042"]},
    {"id": "PRD-ACC-092", "summary": "Agent/team fixtures preserve desired role/profile/team/provider capability metadata and reject live runtime/account/session/assignment state in the portable manifest.", "requirement_ids": ["PRD-REQ-079"]},
    {"id": "PRD-ACC-093", "summary": "Each offer type has stable IDs, contract/schema references, permission metadata, provenance, and no implied grant; nine-Hub projections are derived only from admitted effective state.", "requirement_ids": ["PRD-REQ-080", "PRD-NFR-039"]},
    {"id": "PRD-ACC-094", "summary": "Required needs can only block on failure; optional needs declare explicit degradation/skip/local behavior; incompatible or unknown consumes are quarantined and denied.", "requirement_ids": ["PRD-REQ-081", "PRD-REQ-084"]},
    {"id": "PRD-ACC-095", "summary": "Legacy and native fixtures normalize through one adapter boundary, preserve stable capability IDs and state/config, reach declared conformance levels, prove parity, and retain a tested rollback.", "requirement_ids": ["PRD-REQ-082", "PRD-NFR-040"]},
    {"id": "PRD-ACC-096", "summary": "Cross-domain fixtures prove late or stale observed results cannot project a capability unless generation, digest, implementation revision, and admission-policy version all match current desired state.", "requirement_ids": ["PRD-REQ-083", "PRD-NFR-040"]},
    {"id": "PRD-ACC-097", "summary": "Policy tests prove repository declarations can narrow but cannot widen workspace authority, and every unknown, denied, stale, or unverifiable capability remains default-denied.", "requirement_ids": ["PRD-REQ-084", "PRD-NFR-039"]}
  ],
  "dependencies": [
    "AI-Collab publishes the companion admission/module.binding specification with the same glossary and conformance fixtures.",
    "The official UTCP manual and MCP compatibility bridge remain versioned inputs to the tool-catalog migration.",
    "Existing repository service, config, skill, workflow, wiki, health, and state authorities remain readable to the future compiler."
  ],
  "open_questions": [],
  "traceability": {
    "source_ids": ["BR-REQ-027", "BR-REQ-028", "MSG-mrmmvp3c-xcrxm6", "SP-mrmmvg11-vkf9fe"],
    "request_ids": [],
    "architecture_ids": ["ARCH-COMP-058", "ARCH-COMP-059", "ARCH-COMP-060", "ARCH-COMP-061", "ARCH-COMP-062", "ARCH-COMP-063", "ARCH-COMP-064"],
    "implementation_task_ids": ["IMP-TASK-089", "IMP-TASK-090", "IMP-TASK-091", "IMP-TASK-092", "IMP-TASK-093", "IMP-TASK-094", "IMP-TASK-095", "IMP-TASK-096"],
    "tracking_ids": [],
    "health_ids": []
  }
}
