Skip to content

Make trusted-peer pulls preparation-only - #3

Merged
lukisch merged 2 commits into
mainfrom
codex/v4-trusted-peer-preflight-20260730
Jul 30, 2026
Merged

Make trusted-peer pulls preparation-only#3
lukisch merged 2 commits into
mainfrom
codex/v4-trusted-peer-preflight-20260730

Conversation

@lukisch

@lukisch lukisch commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Replaced live trusted-peer publishing and pull --apply with a read-only validation and preparation boundary.
  • Added strict v2 registry/local-policy schemas plus a deterministic no-transfer receipt schema.
  • Enforced host-owned slot, schema/version, host/peer, freshness/expiry, pinned signature-reference, payload digest, known-host pin, exact remote-path allowlist, destination safety, and secret/content gates.
  • Kept direct and tailscale as provider-neutral labels only.
  • Updated English/German docs, protocol, templates, examples, security guidance, module metadata, and tests.

Why

The existing implementation exceeded the authorized V4 preparation scope by reading key/known-host files, publishing into the yard, and supporting live SFTP transfer. This change stops before connectivity: no peer contact, no referenced credential/key/signature reads, no file copy, no destination creation, no yard write, and no direct_pull mutation.

Impact

The stable trusted-peer-paths CLI now exposes only validate, list, resolve, and pull-plan. pull-plan returns a deterministic prepared-no-transfer receipt with executable=false. Compatibility API methods publish and pull fail closed.

Real two-host activation still requires a separately reviewed detached-signature verifier, real SSH host-key installation, server-side read-only ACL/authentication, route authorization, anti-replay state, a no-overwrite executor, negative two-host tests, and explicit activation approval.

Validation

  • ruff check system_gap_master/trusted_peer_paths.py tests/test_trusted_peer_paths.py
  • ruff format --check system_gap_master/trusted_peer_paths.py tests/test_trusted_peer_paths.py
  • python -m py_compile system_gap_master/trusted_peer_paths.py
  • python -m pytest -q — 80 passed, 1 platform skip
  • Draft 2020-12 schema checks plus generated registry/config/receipt instance validation
  • git diff --check
  • Source scan confirms no subprocess, Popen, --apply, --output, signing/verification key-file refs, or known-hosts-file refs in the trusted-peer module

Base commit: 01a4d29eae389b461e96acfaa5cc7f8d96a98022

Implementation commit: e2ff8f700cae7ffa5e7bc9663a7df633bbae0a17

@lukisch

lukisch commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Security follow-up pushed in 3839ebd. It rejects UNC/device/extended namespaces before filesystem access, blocks Windows-invalid and superscript COM/LPT aliases, binds JSON reads to one checked file identity, and replaces the vendor-specific route label with private-overlay. Verification: 22 focused tests passed; full suite 83 passed, 1 platform privilege skip; Ruff, format, compile, schema validation, and diff-check passed. Independent re-review of the exact pre-commit diff approved with no remaining P0/P1/P2. No merge performed.

@lukisch
lukisch marked this pull request as ready for review July 30, 2026 01:30
@lukisch
lukisch merged commit ffb143f into main Jul 30, 2026
6 checks passed
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