# AgentNet v0.1.45 Release Verification 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:** Prove the integrated v0.1.45 candidate behaves end to end from package install or v0.1.44 upgrade through exact-agent messaging, collaboration, invitation, and file transfer, while keeping all higher-tier gates honest.

**Architecture:** Verify from narrow contracts outward: schema/model tests, service integrations, multi-process local flows, browser flow, isolated packed npm installs, exact v0.1.44 upgrade/rollback, and finally a bounded live server↔laptop canary. Retain reproducible manifests that bind source revision, environment, commands, versions, fixtures, outputs, artifacts, and operator; only then update release metadata and status ledgers.

**Tech Stack:** pytest/Hypothesis, uv, npm pack/install, GitHub Actions, systemd test host, PostgreSQL test server, browser automation, ClamAV test service, release verifier.

## Global Constraints

- Verification uses exact candidate bytes. Source tests cannot substitute for installed-package or live-host evidence.
- Every test database is disposable and mutation-authorized. Never use production, shared, or valuable PostgreSQL data.
- Existing v0.1.44 identity/credential/scope/message state is snapshotted and compared after upgrade; no test may rewrite expected IDs to make the candidate pass.
- Browser confirmation includes visible copy and explicit user-restart behavior; HTTP-only tests cannot substitute for browser verification.
- File transfer proof includes byte digest, scanner evidence, release state, exact-recipient event custody, bounded download, and destination digest.
- Exact-agent proof includes at least two sibling endpoints for one principal, one offline target, and zero sibling dequeue/wake/acknowledgement/response facts.
- Skips, mocks, deterministic no-inference runs, interface tests, and local-only results are recorded at their actual tier and never promoted.
- No tag, npm publication, server deployment, or laptop update occurs until the candidate commit, package digests, rollback inputs, and exact deployment command are frozen and reviewed.
- Must-not-ship gates remain non-green unless this run supplies their required `H`, `L`, `P`, `E`, or `O` evidence.
- Affected IDs: all stable IDs named in the release master plan; gate families `G01..G19` are reviewed, not presumed passed.

---

### Task 1: Freeze integrated schema, public interfaces, and version metadata

**Files:**
- Modify: `pyproject.toml:5-24`
- Modify: `package.json:1-54`
- Modify: `src/agentnet/__init__.py`
- Modify: `src/agentnet/storage/migrations/__init__.py`
- Modify: `src/agentnet/storage/sqlite.py`
- Modify: `schemas/v1/*.json`
- Modify: `scripts/export_schemas.py`
- Modify: `npm/scripts/check-package.mjs`
- Test: `tests/test_version.py`
- Test: `tests/storage/test_schema_catalog.py`
- Test: `tests/protocol/test_exported_schemas.py`

**Interfaces:**
- Consumes: all merged feature workstreams.
- Produces exact public version `0.1.45`, schema version 7, one frozen migration-7 checksum, strict exported schemas, and exact canonical tool list.

- [ ] **Step 1: Add failing consistency assertions before changing versions**

```python
def test_release_versions_are_exactly_v0145():
    assert python_project_version() == "0.1.45"
    assert npm_package_version() == "0.1.45"
    assert runtime_version() == "0.1.45"


def test_schema_v7_contains_every_release_table(store):
    assert current_schema_version(store) == 7
    assert required_relations(store) >= {
        "endpoint_lifecycle",
        "collaboration_scopes",
        "collaboration_scope_members",
        "artifact_transfers",
        "artifact_transfer_recipients",
        "invitation_links",
    }
```

- [ ] **Step 2: Verify consistency tests fail**

```bash
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q tests/test_version.py tests/storage/test_schema_catalog.py tests/protocol/test_exported_schemas.py
```
Expected: FAIL while metadata remains v0.1.44 or schemas are incomplete.

- [ ] **Step 3: Freeze versions and regenerate schemas**

Set every public version field to `0.1.45`; do not hand-edit generated JSON. Run:
```bash
UV_CACHE_DIR=/tmp/uv-cache uv lock
UV_CACHE_DIR=/tmp/uv-cache uv run python scripts/export_schemas.py
```
Then inspect the generated diff for strict `additionalProperties: false`, exact enum values, and no secret/private-key fields.

- [ ] **Step 4: Verify version and schema consistency**

```bash
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q tests/test_version.py tests/storage/test_schema_catalog.py tests/protocol/test_exported_schemas.py
npm run check:package
```
Expected: PASS.

- [ ] **Step 5: Commit**

```bash
git add pyproject.toml package.json uv.lock src/agentnet/version.py src/agentnet/storage schemas scripts/export_schemas.py npm/scripts/check-package.mjs tests/test_version.py tests/storage/test_schema_catalog.py tests/protocol/test_exported_schemas.py
git commit -m "chore(release): freeze v0.1.45 interfaces"
```

### Task 2: Run focused adversarial and regression suites

**Files:**
- Test: all files added or changed by the feature plans
- Modify only if a real defect is reproduced; never weaken a negative assertion or secure default.

**Interfaces:**
- Consumes: frozen integrated candidate.
- Produces hermetic evidence for identity, authorization, exact routing, collaboration, artifacts, invitation, lifecycle, race, and recovery contracts.

- [ ] **Step 1: Run focused suites**

```bash
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q \
  tests/operations/test_endpoint_lifecycle.py \
  tests/operations/test_client_setup.py \
  tests/bindings/test_endpoint_binding.py \
  tests/supervisor/test_host_endpoints.py \
  tests/adapters/test_all_harnesses.py \
  tests/authorization/test_collaboration_scope.py \
  tests/authorization/test_collaboration_scope_service.py \
  tests/discovery/test_recipient_resolver.py \
  tests/integration/test_collaboration_scope_messaging.py \
  tests/integration/test_obligation_background_wakeup.py \
  tests/artifacts/test_backend_parity.py \
  tests/artifacts/test_clamav_scanner.py \
  tests/artifacts/test_transfer_service.py \
  tests/artifacts/test_safe_download.py \
  tests/integration/test_file_tools_e2e.py \
  tests/identity/test_invitation_links.py \
  tests/identity/test_invitation_redemption.py \
  tests/integration/test_invitation_browser_journey.py
```
Expected: PASS; no unexpected skip in a v0.1.45 acceptance case.

- [ ] **Step 2: Run affected existing suites**

```bash
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q \
  tests/identity tests/authorization tests/discovery tests/messaging tests/mailbox \
  tests/rooms tests/organization tests/artifacts tests/bindings tests/supervisor \
  tests/operations tests/storage tests/console tests/integration
```
Expected: PASS except explicitly configured higher-tier tests whose prerequisites are absent.

- [ ] **Step 3: Run exact dedicated PostgreSQL tests**

```bash
AGENTNET_TEST_POSTGRES_URL='postgresql:///agentnet_test_v0145?host=/tmp/agentnet-pgsocket&port=55432' \
AGENTNET_TEST_POSTGRES_ALLOW_MUTATION=1 \
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q tests/storage tests/artifacts/test_backend_parity.py tests/integration/test_collaboration_scope_messaging.py
```
Expected: PASS against a disposable dedicated database; afterward confirm the test server and database are intentionally retained or removed according to the fixture contract.

- [ ] **Step 4: Run broad source suite**

```bash
UV_CACHE_DIR=/tmp/uv-cache uv run pytest -q
```
Expected: PASS with only documented external/privileged/live gates skipped.

### Task 3: Prove clean install and exact v0.1.44 upgrade/rollback

**Files:**
- Modify: `scripts/ci/ordinary-server-setup-e2e.sh`
- Modify: `scripts/ci/ordinary-server-upgrade-e2e.sh`
- Modify: `.github/workflows/server-setup-e2e.yml`
- Modify: `.github/workflows/server-setup-upgrade-e2e.yml`
- Modify: `npm/scripts/check-packed-package.mjs`

**Interfaces:**
- Consumes: exact v0.1.45 npm tarball and wheel/sdist built from one commit; retained v0.1.44 package artifact.
- Produces clean-install, successful-upgrade, injected-failure rollback, and installed-byte communication evidence.

- [ ] **Step 1: Build twice and compare reproducible artifacts**

```bash
SOURCE_DATE_EPOCH=1580601600 PYTHONDONTWRITEBYTECODE=1 UV_CACHE_DIR=/tmp/uv-cache UV_LINK_MODE=copy uv build --offline --no-build-isolation --out-dir /tmp/agentnet-v0145-a
SOURCE_DATE_EPOCH=1580601600 PYTHONDONTWRITEBYTECODE=1 UV_CACHE_DIR=/tmp/uv-cache UV_LINK_MODE=copy uv build --offline --no-build-isolation --out-dir /tmp/agentnet-v0145-b
sha256sum /tmp/agentnet-v0145-a/* /tmp/agentnet-v0145-b/*
```
Expected: corresponding wheel and sdist digests are byte-identical.

- [ ] **Step 2: Pack and install npm candidate in an unrelated prefix**

```bash
npm pack --json --ignore-scripts
npm run check:packed
```
Expected: package check PASS, no source-tree mutation, and no residue in the unrelated workspace.

- [ ] **Step 3: Run clean ordinary-server setup E2E**

```bash
UV_CACHE_DIR=/tmp/uv-cache scripts/ci/ordinary-server-setup-e2e.sh
```
Expected: clean v0.1.45 setup reaches healthy Core/Approval/supervisor/scanner services, enrolled endpoint state, and messaging/file readiness without hidden manual state edits.

- [ ] **Step 4: Run exact v0.1.44→v0.1.45 upgrade E2E**

```bash
UV_CACHE_DIR=/tmp/uv-cache scripts/ci/ordinary-server-upgrade-e2e.sh
```
Expected: exact principal/harness/credential IDs, credential epochs, communication/collaboration scope, mailbox/event digests, and historical receipts match the pre-upgrade snapshot; endpoint ends `restart_required` or `connected` only after the test records explicit restart.

- [ ] **Step 5: Inject upgrade failures and verify rollback**

Run the upgrade E2E once per supported failpoint: after file journal, schema migration, unit install, Core restart, supervisor start, and scanner readiness. Expected: exact v0.1.44 package/config/state restored, or an honest blocked conflict if external mutation prevents safe rollback. No partial v7 service claims remain.

### Task 4: Prove browser, exact-agent, collaboration, and file stories

**Files:**
- Create: `scripts/ci/packaged_v0145_user_journey.py`
- Modify: `npm/scripts/check-packed-package.mjs`
- Modify: `.github/workflows/cross-platform.yml`

**Interfaces:**
- Consumes: isolated installed package plus local PostgreSQL, Approval, ClamAV, server endpoint, laptop endpoint, and sibling endpoints.
- Produces one JSON user-journey report with no protected content.

- [ ] **Step 1: Define the exact journey assertions**

```python
assert report == {
    "schema": "agentnet.v0145-user-journey.v1",
    "clean_install": True,
    "upgrade_preserved_state": True,
    "invitation_redeemed": True,
    "explicit_restart_observed": True,
    "tools_available": ["omp", "pi", "claude", "codex", "antigravity"],
    "message_state": "recipient_committed",
    "response_obligation_state": "completed",
    "file_state": "recipient_custody_recorded",
    "file_digest_match": True,
    "offline_queue_owner_exact": True,
    "sibling_reactions": 0,
    "foreground_turns_injected": 0,
    "residual_processes": 0,
}
```

- [ ] **Step 2: Drive the invitation UI in a real browser**

Start the packaged console through a supervised process, open it with the browser tool, create a link/QR, complete the test work-account/passkey flow, verify the plain-language pages and restart prompt, then close the browser and stop the process. Expected: visual state and Core state agree.

- [ ] **Step 3: Run exact-agent messaging and obligation flow**

Address one exact endpoint while at least two same-principal siblings are online. Verify only the target dequeues/acknowledges/responds. Take it offline, send another request, verify exclusive queue ownership, reconnect it, and verify exactly one terminal response.

- [ ] **Step 4: Run file transfer flow**

Send a safe text file, verify ClamAV attestation and release, download at the exact recipient, compare SHA-256, retry the same idempotency keys, and verify one artifact/event/download. Send EICAR and a secret fixture; verify quarantine/rejection and no recipient preview or byte access.

- [ ] **Step 5: Run installed user journey and cross-platform contracts**

```bash
UV_CACHE_DIR=/tmp/uv-cache uv run python scripts/ci/packaged_v0145_user_journey.py
npm run check:packed
```
Expected: report matches the exact structure above. Cross-platform CI must at minimum validate install, schema, MCP bootstrap, explicit restart state, and canonical tool registration on Linux/macOS/Windows; host-specific live process evidence remains honestly scoped.

- [ ] **Step 6: Commit integration runner**

```bash
git add scripts/ci/packaged_v0145_user_journey.py npm/scripts/check-packed-package.mjs .github/workflows/cross-platform.yml
git commit -m "test(release): prove packaged v0.1.45 journey"
```

### Task 5: Run a bounded live server↔laptop canary

**Files:**
- Create under evidence only after execution: `evidence/local/2026-08-05-v0.1.45-canary/manifest.json`
- No live secret, identity file, private message, token, or credential may enter the repository.

**Interfaces:**
- Consumes: frozen package digests, current enrolled v0.1.44 server/laptop, reviewed rollback command, and explicit deployment authorization.
- Produces bounded live facts for upgrade preservation, tool activation, message/reply, file transfer, exact recipient routing, and rollback readiness.

- [ ] **Step 1: Record non-secret preflight**

Capture package version/digests, service names, redacted health, schema version, principal/harness/credential IDs as hashes, message/event counts, scope digests, and rollback artifact digests. Verify exactly one server endpoint and one laptop endpoint are selected; do not infer by last-active time.

- [ ] **Step 2: Upgrade server first with rollback armed**

Use the package-owned v0.1.44→v0.1.45 setup/upgrade path. Verify Core, Approval, supervisor, scanner, PostgreSQL, endpoint lifecycle, old message access, and no duplicate units/processes before touching the laptop.

- [ ] **Step 3: Update laptop and ask for restart**

Use the user-level npm update path without `sudo`. Confirm state preservation and `Restart your agent to enable AgentNet`; obtain the user’s explicit restart action before expecting tools in the existing conversation.

- [ ] **Step 4: Exercise exact live stories**

From the ordinary laptop conversation: resolve the enrolled server, send one C1 question with response obligation, receive one reply, send one safe file, download/verify it on the server, and send one reply/file back. Report only event/artifact IDs, digests, and honest states.

- [ ] **Step 5: Verify sibling isolation and offline recovery if safe**

If a second enrolled same-principal endpoint exists, keep it online and verify zero reactions. Temporarily stop only the target endpoint supervisor, send one bounded message, verify exact queued custody, restart that endpoint, and verify one delivery. Do not stop unrelated services.

- [ ] **Step 6: Retain bounded evidence or roll back**

On any invariant failure, stop new traffic, run the reviewed exact rollback, verify restored v0.1.44 state, and report the failing phase. On success, retain only redacted evidence and leave services healthy with no temporary credentials/processes.

### Task 6: Update truthful release evidence and assemble the candidate

**Files:**
- Modify: `RELEASE_MANIFEST.json`
- Modify: `docs/RELEASE_MANIFEST.md`
- Modify: `REQUIREMENTS_STATUS.md`
- Modify: `docs/GATE_EVIDENCE.md`
- Modify: `README.md`
- Modify: `docs/implementation-guide.md`
- Modify: `docs/ARCHITECTURE.md`
- Modify: `docs/SCHEMAS_INTERFACES.md`
- Create: `evidence/local/2026-08-05-v0.1.45/manifest.json`
- Create: `evidence/local/2026-08-05-v0.1.45/artifacts/RETENTION.md`

**Interfaces:**
- Consumes: exact outputs from Tasks 1–5.
- Produces source-bound release manifest and documentation that distinguish local usability evidence from production certification.

- [ ] **Step 1: Generate exact manifest hashes**

Hash authoritative inputs, source tree, migration catalog, exported schemas, wheel, sdist, npm tarball, focused/broad test reports, packaged journey report, upgrade report, rollback report, and live canary report if performed. Record command, environment, versions, source revision, operator, and timestamp.

- [ ] **Step 2: Update requirement and gate ledgers conservatively**

Promote only acceptance criteria directly proven at the observed tier. Keep `G04`, independently administered identity/OOB, privileged host isolation, HA/PITR, external harness/model, partner/federation, owner decisions, and other absent higher-tier gates non-green.

- [ ] **Step 3: Run final release checks**

```bash
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
npm run check:package
npm run check:packed
```
Expected: all local release checks PASS; release posture may still be `BLOCKED` for production certification and must say why.

- [ ] **Step 4: Request final code and security review**

Use `superpowers:requesting-code-review` and the repository reviewer. Require review of migration/rollback, endpoint isolation, authority flow, invitation single-use, scanner trust, local paths, response loss, docs/evidence, and package contents. Resolve every P0/P1 finding and rerun the affected evidence.

- [ ] **Step 5: Commit the release candidate**

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

- [ ] **Step 6: Publish and deploy only the exact reviewed commit**

Tag, npm publish, and live deployment are separate externally visible mutations. Execute only after the exact candidate commit and artifact digests are reviewed and the authorized release action is explicit. Verify the registry package and installed server/laptop bytes match the retained digests before reporting success.
