# AgentNet v0.1.45 Release Master 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:** Ship the first normally usable AgentNet release in which existing or newly enrolled exact agent endpoints can communicate, collaborate, and exchange released files from their ordinary harness conversations.

**Architecture:** Keep the current Core services as semantic owners and add a package-owned endpoint lifecycle plus thin harness adapters. Implement one schema-v7 cutover, a general collaboration-scope authorization layer, exact-agent resolution, canonical file tools, email-bound invitation onboarding, and end-to-end release evidence. Each subsystem has its own detailed plan and independently testable commit sequence.

**Tech Stack:** Python 3.13–3.14, Pydantic 2.13.4, SQLite/PostgreSQL, Starlette, TypeScript, Node.js 22.19+, Unix IPC/MCP, systemd, pytest 9.1.1, Hypothesis 6.156.6, npm packaging.

## Global Constraints

- Public package version is exactly `0.1.45`; public Python import and CLI remain `agentnet`.
- Preserve the enrolled v0.1.44 server and laptop identities, credentials, communication scope, mailbox state, and messages without re-enrollment.
- Support exactly one contiguous Core schema migration from v6 to v7; unknown, noncontiguous, checksum-mismatched, or newer catalogs fail closed.
- Every protected operation derives the actor from authenticated transport or proof; payload names, emails, display names, and role labels never grant identity or authority.
- Positive permissions remain human-principal scoped; exact harness, credential, device, session, posture, and endpoint state only narrow authority.
- Every direct message, task, obligation, wake-up, file notification, and background-processing request targets explicit exact harness IDs.
- Offline custody remains assigned exclusively to the original exact harness; no sibling failover, broadcast, shared cursor, or last-active-agent routing is allowed.
- Each local endpoint has a separate credential lineage, mailbox cursor, adapter generation, binding descriptor, and owner-only capability root.
- AgentNet asks the user before any harness restart; it never restarts an active harness automatically.
- Normal installation and onboarding require no `sudo`, shell commands, copied internal IDs, state-file edits, or operator JSON.
- OMP, Pi, Claude, Codex, and Antigravity receive the same canonical operations; adapters may change framing only.
- Invitation links are bound to one exact verified email and trust domain, single-use, revocable, and expire exactly 24 hours after issuance.
- Artifacts remain quarantined until digest, provenance, current policy, and fresh trusted scanner attestation all succeed; no plaintext or preview is disclosed early.
- No new mandatory cloud dependency is introduced. Federation, C3, mesh, full administration UI, and Slack fallback remain disabled or deferred.
- No requirement, evidence gate, production-readiness status, or must-not-ship gate is promoted without reproducible evidence at its required tier.
- Affected requirement IDs: `ARC-001..005`, `ID-001..009`, `AUTH-001..009`, `COM-001..011`, `FILE-001..006`, `AVL-001..007`, `UX-001..006`, `SEC-001..006`, and `OPS-001..006`.

---

## File Structure and Workstream Contracts

### Workstream A — lifecycle and schema cutover

Detailed plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-lifecycle-upgrade.md`

Owns:
- package version and manifest consistency;
- schema-v7 DDL, SQLite/PostgreSQL migration and rollback evidence;
- resumable install/update/enroll/activate state machine;
- existing v0.1.44 state preservation and explicit restart request.

Produces:
```python
class EndpointActivationState(str, Enum):
    READY_TO_CONNECT = "ready_to_connect"
    WAITING_FOR_APPROVAL = "waiting_for_approval"
    ENROLLED = "enrolled"
    ACCESS_READY = "access_ready"
    RESTART_REQUIRED = "restart_required"
    CONNECTED = "connected"
    BLOCKED = "blocked"

class EndpointLifecycleService:
    def status(self, *, endpoint_id: str) -> EndpointLifecycleStatus: ...
    def reconcile(self, *, endpoint_id: str) -> EndpointLifecycleStatus: ...
    def record_user_restart(self, *, endpoint_id: str, expected_generation: int) -> EndpointLifecycleStatus: ...
```

### Workstream B — exact-agent endpoint supervisor and adapters

Detailed plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-exact-agent-adapters.md`

Consumes schema-v7 endpoint rows and lifecycle states. Produces:
```python
@dataclass(frozen=True, slots=True)
class EndpointBinding:
    domain_id: str
    principal_id: str
    harness_id: str
    harness_kind: HarnessKind
    credential_id: str
    credential_epoch: int
    adapter_generation: int
    mailbox_cursor: int
    capability_root_path: Path

class HostEndpointSupervisor:
    def activate(self, binding: EndpointBinding) -> EndpointRuntimeStatus: ...
    def deactivate(self, harness_id: str, *, reason: str) -> EndpointRuntimeStatus: ...
    def reconcile_once(self) -> tuple[EndpointRuntimeStatus, ...]: ...
```

### Workstream C — collaboration scope, resolution, and communication tools

Detailed plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-collaboration-messaging.md`

Consumes exact endpoint bindings. Produces:
```python
class CollaborationScope(BaseModel):
    scope_id: str
    domain_id: str
    owner_principal_id: str
    member_harness_ids: tuple[str, ...]
    allowed_actions: tuple[str, ...]
    allowed_resource_prefixes: tuple[str, ...]
    policy_revision: int
    expires_at: int | None
    revision: int
    state: Literal["active", "revoked", "expired"]

class AuthorizedRecipientResolver:
    def resolve(self, *, actor: VerifiedActor, query: str) -> tuple[ResolvedEndpoint, ...]: ...
```

Adds canonical `agentnet.recipient.resolve`, message, room, task, handoff, cancellation, and obligation operations without changing existing custody semantics.

### Workstream D — file send and download

Detailed plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-artifact-delivery.md`

Consumes current collaboration scope and exact recipient resolution. Produces:
```python
class ArtifactTransferService:
    def send_file(self, *, actor: VerifiedActor, recipients: tuple[str, ...], source: Path, media_type: str, classification: Classification, idempotency_key: str) -> dict[str, Any]: ...
    def download_file(self, *, actor: VerifiedActor, artifact_id: str, destination: Path, idempotency_key: str) -> dict[str, Any]: ...
```

Adds canonical `agentnet.file.send`, `agentnet.file.status`, and `agentnet.file.download` with quarantine, trusted scan, immutable release, exact-agent notification, bounded capability, and atomic local destination handling.

### Workstream E — email-bound invitation and minimal browser flow

Detailed plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-invitation-onboarding.md`

Consumes collaboration-scope issuance and endpoint lifecycle. Produces:
```python
class InvitationOffer(BaseModel):
    invitation_id: str
    invited_verified_email: str
    domain_id: str
    collaboration_scope_template: dict[str, Any]
    permission_actions: tuple[str, ...]
    expires_at: int
    max_uses: Literal[1] = 1

class InvitationLinkService:
    def issue(self, *, actor: VerifiedActor, offer: InvitationOffer) -> IssuedInvitationLink: ...
    def redeem(self, *, opaque_token: str, candidate: CandidateEndpointProof) -> InvitationRedemption: ...
```

The public URL and QR contain only an opaque one-use token. The browser page shows plain-language permissions and opens the full package-owned onboarding prompt.

### Workstream F — end-to-end verification and release assembly

Detailed plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-release-verification.md`

Consumes all prior workstreams. Produces exact evidence for clean install, v0.1.44 upgrade, five-harness tool availability, exact-agent/sibling isolation, offline recovery, invitation redemption, file transfer, response loss, packaged install, and rollback. It updates requirement and gate ledgers only to the observed tier.

---

### Task 1: Establish the release branch baseline

**Files:**
- Read: `docs/superpowers/specs/2026-08-05-agentnet-v0.1.45-communication-collaboration-design.md`
- Read: `REQUIREMENTS_STATUS.md`
- Read: `docs/GATE_EVIDENCE.md`
- Read: `docs/OWNER_DECISIONS.md`

**Interfaces:**
- Consumes: approved design commit `cc12ef3`.
- Produces: one isolated implementation worktree and a recorded baseline commit hash used by every retained evidence manifest.

- [ ] **Step 1: Create an isolated worktree using the required skill**

Invoke `superpowers:using-git-worktrees`; use branch `feature/v0.1.45-communication-collaboration`. Do not move or clean the parent checkout’s untracked `.pi/` directory.

- [ ] **Step 2: Record the baseline without changing release status**

Run:
```bash
UV_CACHE_DIR=/tmp/uv-cache uv sync --extra test
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q
UV_CACHE_DIR=/tmp/uv-cache uv run python scripts/verify_release.py
UV_CACHE_DIR=/tmp/uv-cache uv run agentnet verify
```
Expected: current v0.1.44 baseline behavior is recorded exactly; existing blocked gates remain blocked.

- [ ] **Step 3: Start lifecycle workstream**

Execute `2026-08-05-agentnet-v0.1.45-lifecycle-upgrade.md` completely before any other workstream consumes schema-v7 endpoint rows.

### Task 2: Execute independent feature workstreams

**Files:**
- Plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-exact-agent-adapters.md`
- Plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-collaboration-messaging.md`
- Plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-artifact-delivery.md`
- Plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-invitation-onboarding.md`

**Interfaces:**
- Consumes: merged schema-v7 and endpoint lifecycle interfaces from Task 1.
- Produces: four independently reviewed feature branches or commits with focused green suites.

- [ ] **Step 1: Implement exact-agent adapters first**

The endpoint supervisor establishes the binding consumed by every other workstream. Run its smoke scenario before merging.

- [ ] **Step 2: Implement collaboration and messaging**

Do not add file payload bytes to message events. Only released artifact bindings may enter conversation events.

- [ ] **Step 3: Implement artifact delivery and invitation onboarding in parallel**

These workstreams share only the stable `CollaborationScope` and `EndpointLifecycleService` interfaces. They must not edit each other’s state machines.

- [ ] **Step 4: Review each workstream against its affected stable IDs**

Use `superpowers:requesting-code-review`. Reject any implementation that adds a shared endpoint identity, implicit recipient fan-out, early artifact disclosure, or invitation authority derived from URL contents.

### Task 3: Integrate and release

**Files:**
- Plan: `docs/superpowers/plans/2026-08-05-agentnet-v0.1.45-release-verification.md`

**Interfaces:**
- Consumes: all feature workstream commits.
- Produces: packaged v0.1.45 candidate plus honestly bounded evidence and documentation.

- [ ] **Step 1: Run the release-verification plan**

Execute every focused, integration, packaged-install, upgrade, rollback, browser, and broad-suite command in the release verification plan.

- [ ] **Step 2: Apply the release decision rule**

Create the package only if all v0.1.45 acceptance scenarios pass. A skipped external, privileged, owner, live-model, partner, or HA gate remains non-green and must not be relabeled.

- [ ] **Step 3: Commit the integrated candidate**

```bash
git add pyproject.toml package.json uv.lock RELEASE_MANIFEST.json REQUIREMENTS_STATUS.md README.md docs schemas scripts src tests npm .github/workflows evidence
git commit -m "feat: ship v0.1.45 communication and collaboration"
```

Do not tag, publish, deploy, or mutate the live server/laptop until the candidate commit, exact artifacts, rollback inputs, and owner-approved deployment action are all known.
