Skip to content

fix(paseo): launch real opencode outside PID 1 - #559

Merged
wz-gsa merged 21 commits into
mainfrom
fix/548-guest-mount-map
Oct 31, 2026
Merged

wz-gsa merged 21 commits into
mainfrom
fix/548-guest-mount-map

Conversation

@wz-gsa

@wz-gsa wz-gsa commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Route a bare opencode invoked outside PID 1 to the real OpenCode binary; keep the PID-1 shim entrypoint and argument passthrough.
  • Reject wrapper symlink/hard-link aliases and tighten the Paseo verifier so skipped or incomplete checks do not produce a measured pass.
  • Document backend-dependent lifecycle and port behavior; cover wrapper dispatch, guest path spellings, and verifier verdicts with offline fixtures.

Eligibility & Accountability

  • I am a federal employee or contractor (author-of-record attestation for human confirmation).
  • I understand this change and can explain it in my own words (author-of-record attestation for human confirmation).
  • I have the right to release this work under CC0-1.0 (author-of-record attestation for human confirmation).

AI Assistance Disclosure

  • AI tools were used: OpenCode helped implement, test, document, and review this change.
  • Human author verified all AI-generated content and release rights; human confirmation remains required.
  • No third-party material was copied into this change.

Type of Change

  • New tool/editor integration (integrations/) update
  • Documentation update
  • Bug fix

Motivation

In #548, MSB runs the wrapper outside PID 1; the old no-argument route printed Paseo connect instructions and returned instead of opening the OpenCode TUI. A shell invocation should not repin the daemon worktree root.

Testing and validation

  • make validate passed in an isolated managed Ubuntu VM on exact tree ff9ce4d111d5d92f397feec40e7a43d2ccd64e80 (47/47 pattern files; existing advisory warnings).
  • 78/78 Paseo Node tests passed in a network-disabled, non-root, read-only container.
  • Managed VM pre-commit hooks passed on the exact tree, including acq-kit validation and Gitleaks; local push hook also scanned the 20-commit history without leaks.
  • Commits follow Conventional Commits and are signed; fixed-SHA independent agent QA/security static reviews found no new scoped blocker at 35efa98b74caa55a0161ea6505bcaebec33c4596.
  • Tested in a live MSB sandbox: PID-1 hold, real TUI routing, host-to-guest mount mapping, and same-daemon host identity remain unverified. The detached verifier deliberately returns exit 3 for skipped checks.

Safety checklist

  • Reviewed changed files for secrets, credentials, PII, CUI, internal infrastructure, and proprietary data; no such material identified.
  • No new pattern/output contract is introduced.

Reviewer notes

Review the wrapper PID-1/no-argument split and the verifier’s skip/transport classifications at this head. Independent agent reviews are supporting evidence, not a GitHub CODEOWNER approval. The pre-existing shim readiness fallback, mount registrar symlink boundary, and host-daemon identity check are separate concerns and are not claimed fixed here.

Related issues

Relates to #548. Human/live acceptance is pending before closure.

wz-gsa added 20 commits October 29, 2026 14:35
Keep the Paseo entrypoint shim only when the wrapper is PID 1. Bare opencode in an MSB shell or exec session opens the real terminal TUI without repinning the global Paseo worktree root. Update the verify contract and offline wrapper tests.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Resolve executable symlinks before choosing the real OpenCode binary. Keep non-PID-1 wrapper checks from claiming a TUI opened based on a non-TTY exit, and document direct-shim and startup-root limits accurately.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Do not claim a non-TTY exit proves the real TUI launched or a source-level check proves the live PID-1 hold. Fail on a root unrelated to the primary guest workspace and describe the live observation still needed.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Reject a stale worktrees.root even if another JSON object contains a matching root. Label PID-1 source checks as structural rather than live evidence, and clarify direct shim invocation.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Treat PID-1 source checks as structural evidence and leave live behavior explicitly unverified. Assert the verdict for the exact nested worktrees.root field, including an unrelated matching-key negative fixture.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Document conditional worktree-root initialization and state the detached verifier checks source structure, not a live PID-1 handoff.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Mark the PID-1 hold and real TUI as unmeasured in the detached verifier. Distinguish unavailable startup seeding from an incorrect seeded root, with positive and negative verdict fixtures.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Do not infer startup seeding solely from a usable workspace. Distinguish a preserved or unverified root from a measured mismatch, and qualify offline results when required validators were skipped.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Separate valid, missing, and invalid config results in the detached verifier. Report preserved roots as unverified, fail invalid data, and give skipped checks a distinct exit status instead of a verified pass.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Classify transport failure as unverified, reject malformed or relative worktree roots, and document the detached verifier exit-3 contract. Cover the typed outcomes with offline fixtures.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Accept usable absolute workspace paths with internal spaces and reject JSON control characters before shell transport can discard them. Correct detached lifecycle and backend-dependent host-port guidance.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Keep space-containing paths intact in the verifier, align host-port guidance with backend allocation, and document Paseo’s separate incomplete-coverage exit status.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Do not require readlink or the real OpenCode binary on the PID-1 entrypoint path. Clarify detached sandbox behavior and cover branch ordering with a regression test.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Reject a second PATH name for the wrapper inode and compare registered projects using physical paths resolved in the guest. Keep configured root equality distinct from physical containment evidence.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Match either the guest-visible mount path or its physical guest spelling when checking fixture projects; require the fixture to resolve before accepting a registration.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Apply the literal-or-physical guest path comparison to the complete project set and execute the aggregate loop against alias and unrelated path fixtures.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Canonicalize host-owned verification fixtures before resolving their guest paths so a host /var alias does not falsely fail when the guest mounts /private/var.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Validate the guest port override before command construction, return unverified for absent live tooling or incomplete bundle and ownership probes, and exercise the verdict branches offline.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Record an absent cache as unverified and only credit host bundle delivery when it matches an in-guest baseline.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
Reject port overrides inconsistent with the kit, require successful guest curl completion for a bundle baseline, and fail closed on cache traversal diagnostics.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #548
@wz-gsa
wz-gsa requested a review from a team as a code owner October 30, 2026 04:17

@basiliskus basiliskus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: request changes — 35efa98b74caa55a0161ea6505bcaebec33c4596

Must fix before merge: Fix the cache probe's newline handling and cover its actual output.

  • major — integrations/isolation/acq-kits/paseo/scripts/verify:638–643: A healthy agent-owned cache is reported as a failure. When find returns no foreign-owned file, printf "%s\n" "$result" still emits a newline before CACHE_PROBE_DONE. Removing only the marker leaves that newline, so [ -n "$bad_cache_owner" ] is true and the live verifier records a failure (exit 1). Confirmed by executing the actual guest probe against an empty, current-user-owned .npm; the same fixture passes at the base revision. Emit the separator only for a nonempty result, or remove the exact separator along with the marker. Add a regression test that executes the real probe: the existing fixture supplies CACHE_PROBE_DONE without the newline and misses this case.

Assisted-by: OpenCode [GPT 6.1 Sol Latest Guardrails Defaultv2] skill:change-review

Emit a cache-owner path separator only when find returns a foreign-owned entry. Run the actual probe for an absent cache and for empty and populated agent-owned caches.

Co-authored-by: OpenCode <william.zujkowski@gsa.gov>

Refs: #559

@basiliskus basiliskus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve — 475aa0a5244c62df268e3b3de24f17a02a8ad2dd

Must fix before merge: none.

The prior cache-probe finding is resolved in 475aa0a5: empty results no longer leave a separator, and the real-probe regression reproduces the old failure and passes with the fix. No new findings.

Live PID-1 hold, real TUI routing, mount transport, and same-daemon identity remain unverified; this review does not replace that acceptance work.

Assisted-by: OpenCode [GPT 6.1 Sol Latest Guardrails Defaultv2] skill:change-review

@wz-gsa
wz-gsa added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit ce4aa08 Oct 31, 2026
7 checks passed
@wz-gsa
wz-gsa deleted the fix/548-guest-mount-map branch October 31, 2026 03:45
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.

2 participants