fix: isolate ASCII Box host trust per lease - #1785
Conversation
Keep the native provider authentication key while using the existing protected lease-specific known-hosts directory for readiness, reuse, and guarded teardown. Preserve rejection of changed keys within a lease and document first enrollment for retained legacy leases. Add adapter regressions and a real OpenSSH recycled-endpoint proof. Reuse the existing isolated user-directory test utility so host-trust fixtures never touch operator state. Addresses #1748, reported by @shunkakinoki.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 4, 2026, 12:45 AM ET / 04:45 UTC. ClawSweeper reviewWhat this changesThis PR gives each ASCII Box lease a separate SSH known-hosts file for readiness, reuse, and guarded teardown while retaining the provider’s shared authentication key. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: the adapter change directly addresses the reported host-trust defect and current main does not contain it, but merge still requires removal of the contributor-authored Unreleased entry and complete real-provider guarded-teardown proof. Priority: P2 Review scores
Verification
How this fits togetherThe ASCII Box provider converts a provider Box and Crabbox lease ID into an SSH target for readiness, workload reuse, and guarded cleanup. The target’s known-hosts path determines which remote host key native SSH will trust. flowchart LR
A[ASCII Box record] --> C[Lease target construction]
B[Crabbox lease ID] --> C
C --> D[Lease-specific host trust]
D --> E[SSH readiness and reuse]
D --> F[Guarded remote teardown]
E --> G[Remote workload]
F --> H[Lease cleanup]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the provider-boundary implementation, have a maintainer own the release note, and land after a redacted real ASCII Box lifecycle trace demonstrates successful guarded teardown with lease-scoped trust intact. Do we have a high-confidence way to reproduce the issue? Yes. Two lease targets using the same endpoint with different host keys exercise the reported failure, and the added native OpenSSH test makes that path concrete without this review executing it. Is this the best way to solve the issue? Yes. Applying the existing generic lease-scoped trust helper at the provider adapter is the narrow, provider-neutral repair and preserves strict SSH verification. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 62c008266bd5. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
Fresh live evidence for exact head
This is positive live proof for the host-trust portion, but not a successful Crabbox teardown, so I am not claiming this PR fully cleared. The remaining lifecycle blocker is the separate cleanup/absence-reconciliation work in #1730 and #1789. No host-key verification was disabled and no trust entry was removed. The remaining branch action here is maintainer-owned removal of the contributor-authored Unreleased entry. |
Stop readiness retries on OpenSSH host-key rejection without changing host trust, including direct, proxy, and WSL SFTP probes. Match diagnostics across arbitrary write boundaries and output volume using fixed-size state without retaining stderr. Preserve authentication/connection startup retries, cancellation, workspace ownership errors, and the original exit cause. Add regression coverage, docs, and maintainer changelog credit. Verified real OpenSSH loopback checks, related CLI and ASCII race tests, and current-head CI, Release Check, Connector E2E, and Docs UI workflows. Managed review was P0 scoped-clean. Optional bot admission remains separately blocked; no bot verdict or CodeQL fork result is claimed. Complements #1785 and #1748; does not replace provider lease-scoped trust work. Co-authored-by: Shun Kakinoki <shunkakinoki@gmail.com>
Summary
Fix #1748 by applying the existing protected lease-scoped SSH trust helper at the ASCII Box adapter boundary. Both readiness/reuse and ownership-guarded teardown receive the canonical local lease ID. The native Box authentication key, advertised gateway endpoint, legacy IP fallback, and disabled ControlMaster behavior are preserved.
A new Box can reuse an endpoint without inheriting another lease's host key. A changed key within the same lease remains rejected. Retained leases from older clients explicitly enroll on their first connection with this client; shared pins are neither copied into an unproven lease scope nor deleted. The provider docs and Unreleased changelog explain the behavior and credit @shunkakinoki for the report.
Verification
go test -race ./internal/providers/asciibox -count=1passed after the fix, including claim/cleanup and guarded-teardown regressions.go vet ./internal/providers/asciibox ./internal/cli, docs-link checks, andgit diff --checkpassed. Managed Codex review returned no actionable findings in its default P0 scope.Boundaries
The core host-trust implementation and production ownership/deletion fences are unchanged. Provider tests reuse the existing isolated-user-directory utility; they do not touch operator configuration. Native loopback SSH proof is separate from the real provider lifecycle requirement, and neither a timeout nor deletion acceptance alone will be treated as completed cleanup.
Closes #1748.
Real provider proof and current hold
The frozen clean candidate is
0d29ac2ab4d784329476d4efd00f7f4eb6f16cf9; its built CLI SHA-256 is495251babd02ad9010bc1e3f05289fad01998ffe6a35ad0cd7ea2d4170ab9c10. Tested with the official ASCII CLI0.1.211-ascii-prod1and one task-owned Box.ascii-host-trust-pass, and the 22-byte artifact downloaded correctly. The remote source hash matched the candidate.--no-syncinvocation printedascii-reuse-pass. The lease-scoped trust and stale shared trust files remained byte-identical through both runs.context deadline exceeded. The local claim correctly retained its bound deletion-operation reference.bx_pp783kt6absent, but operationbdop_53e2ade7b3f34fdc83113cd1cbc6a4d0remainsblocked, withcompletedAt: null. Absence is not completion: cleanup proof remains incomplete, and this PR must not land yet. No claim/trust file was forcibly removed or completion fabricated.The long silent wait also reproduces the diagnostic problem tracked in #1730. That is separate from the host-trust fix.