Skip to content

feat(desktop): add fresh setup checks and terminal handoff - #819

Open
roodboi wants to merge 64 commits into
feat/desktop-app-doctorfrom
feat/desktop-app-setup
Open

roodboi wants to merge 64 commits into
feat/desktop-app-doctorfrom
feat/desktop-app-setup

Conversation

@roodboi

@roodboi roodboi commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The desktop preview now checks setup from fresh observations and offers Run setup again in Doctor. Ordered cards cover the required CLI, Compose/native runtime, hackd, routing, trust and login service. Unknown and skipped checks remain unresolved; session skips survive rechecks and nothing persists as a first-run flag.

Only fixed daemon start/install actions run in the app, followed by fresh checks. Install needs explicit manager availability, ownership of the ordinary home and enabled service-management guards; unavailable or unconfirmed managers get a reason and documentation. Native projects get native docs instead of global install/trust. Compose CA export never proves trust.

Checks and fixes use the same checked absolute CLI and allowlisted non-secret home/backend/guard context. Terminal hand-offs clear the login environment, quote each authored argument, wait for Enter before execution, retain output until Enter-to-close and preserve the exit code. No password, arbitrary finding command or whole environment reaches a script. The reusable context wrapper composes with authored command sequences without changing CommandSpec { program, args }. Machine effects share a symmetric gate with all project effects.

Stack: base feat/desktop-app-doctor (#806), ultimately next. Optional desktop capability (feat); no CLI contract implementation or release wiring.

Validation: Rust1.98.1,143 core tests, fmt, default/screenshots Clippy with warnings denied, both builds and privacy. Fake CLI/terminal adapters and isolated homes; no actual daemon, Docker, network, login service, sudo or owner desktop interaction. Offscreen light/dark fixtures inspected, including unavailable-manager cards with no Run. macOS/live terminal/focus/host effects and hosted exact-head CI remain separate gates; second-family review is coordinated by the lead.

Setup flow

Supported setup actions Unavailable login manager
Setup light Unavailable dark

Update (Nov 15)

  • Merged the Doctor view (with next e47681e and fix(desktop): isolate process tests and close unlisted Apple child descriptors #846's macOS spawn boundary).
  • The clean CLI environment of the checked execution context now reaches the child on macOS too: the spawn boundary takes the clean-environment mode explicitly (it previously rebuilt the child environment from the app's).
  • Terminal hand-off launches go through the same descriptor-closing spawn path, with the launcher's output discarded so it cannot block.

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hack-docs Ready Ready Preview Nov 15, 2026 2:50pm UTC

Request Review

@roodboi

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T14:57:42.252031Z c886c22 Manual request
🔒 Security Review ✅ Completed 2026-11-15T15:04:51.904537Z c886c22 Manual request

Security findings

Advisory findings (5)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…ktop-app-setup

# Conflicts:
#	apps/desktop/app/src/view.rs
#	apps/desktop/core/tests/dump_state.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 330b81f2eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/core/src/setup_io.rs Resolved
Comment thread apps/desktop/core/src/setup.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 330b81f2eb

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 0ab8c0036e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ktop-app-setup

# Conflicts:
#	apps/desktop/app/src/main.rs
#	apps/desktop/app/src/screenshots.rs
#	apps/desktop/app/src/view.rs
#	apps/desktop/core/src/source.rs
#	apps/desktop/core/src/viewmodel.rs
#	apps/desktop/core/tests/dump_state.rs
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 0ab8c0036e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

…at/desktop-app-setup

# Conflicts:
#	apps/desktop/app/src/main.rs
#	apps/desktop/app/src/screenshots.rs
#	apps/desktop/core/src/viewmodel.rs
…ktop-app-setup

# Conflicts:
#	apps/desktop/app/src/view.rs
@roodboi

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 90b4355dee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 90b4355dee

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@roodboi

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

# Conflicts:
#	apps/desktop/DESIGN.md
#	apps/desktop/README.md
#	apps/desktop/app/src/main.rs
#	apps/desktop/app/src/screenshots.rs
#	apps/desktop/app/src/view.rs
#	apps/desktop/core/src/bin/hack-desktop-state.rs
#	apps/desktop/core/src/fixtures.rs
#	apps/desktop/core/src/lib.rs
#	apps/desktop/core/src/runner.rs
#	apps/desktop/core/src/source.rs
#	apps/desktop/core/src/viewmodel.rs
#	apps/desktop/core/tests/dump_state.rs
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

Some(with_path("hack restart", root))
} else if PROJECT_FIX_IDS.contains(&id) {
Some(with_path("hack doctor --fix", root))

P2 Badge Bind Doctor remedies to the selected CLI and checked context

When the app is launched with the documented HACK_DESKTOP_CLI selection for hack-next while stable v4 remains on PATH, Doctor checks use the selected v5 executable but these copied repairs invoke plain hack. The installation guide explicitly says the terminal function “does not replace the stable executable” (docs/versions/v5/install.md:71–73), so copying a repair into another terminal can run v4 against the v5 checkout; machine remedies can likewise target a different Hack home. Carry the checked executable and execution context into Doctor remedies, as setup already does, rather than emitting unbound command strings.


runner: CliRunner::selected(std::env::var_os("HACK_DESKTOP_CLI").as_deref()),
daemon: socket.map(|s| DaemonClient::new(s, Duration::from_secs(3))),

P2 Badge Discover the selected candidate's effective daemon socket

When HACK_DESKTOP_CLI selects hack-next in native mode, the runner and daemon client can address different homes. The candidate launcher overrides HACK_HOME with its version-private cli-home (scripts/installer/channel.ts:518–535), but this daemon client still uses the app's inherited home, normally ~/.hack. Starting hackd through setup therefore starts the private daemon while subsequent socket reads continue checking the ordinary home: project discovery remains unavailable and setup cannot confirm the daemon. Obtain the effective socket from the selected CLI's read-only status before constructing or refreshing the daemon client, rather than assuming its home matches the parent environment.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3c4abf4779

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: d6eb90d974

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: d6eb90d

The base is feat/desktop-app-doctor, so this is stacked on #806 (ready at aa8c30e), which contains next at 34b5053. It is mergeable and is not a draft.

What changed since the last note: fixes for the bot findings.

  • Copied commands are bound to the checked context. Report::command puts HACK_MCP_COMMAND=<checked CLI> right before the program, so a copied daemon restart starts the checked CLI.
  • Open Terminal on macOS runs /usr/bin/open -g -a /System/Applications/Utilities/Terminal.app, naming the app by path rather than by name. The bundle and every folder above it must be root-owned and not writable by group or others; otherwise only Copy command is offered.
  • Bound commands and terminal hand-offs keep only PATH folders no other user can change, falling back to /usr/bin:/bin.
  • Merged in feat(desktop): add the Doctor view (HACK-2214) #806's Doctor fixes: the dirname wrapper and the native runtime check described in feat(desktop): add the Doctor view (HACK-2214) #806's note.

What ran

  • apps/desktop: cargo fmt --check, workspace clippy with all features and -D warnings, core clippy for aarch64-apple-darwin, and bash scripts/test.sh (Linux, 196 passed, 1 skipped). All hermetic: temp HOME, no Docker, no real Hack home or services.
  • Hosted: Desktop app (Linux build, core tests) passed. No failing checks.
  • Persistent reviewer (Codex gpt-6.1-sol): clean at this SHA.
  • @codex review: clean at d6eb90d974. computer pr review-status: CLEAR at d6eb90d.

Not verified or not waited for

  • Hosted macOS jobs (Desktop app macOS build and core tests, and the other macOS jobs) were queued and I did not wait for them.
  • The automatic Codex security review of this head was still running when I posted this; it is non-blocking.
  • The real macOS Terminal hand-off and Setup actions were not run on a Mac.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: d6eb90d974

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

# Conflicts:
#	apps/desktop/README.md
#	apps/desktop/app/src/main.rs
#	apps/desktop/app/src/screenshots.rs
#	apps/desktop/app/src/view.rs
#	apps/desktop/core/src/source.rs
@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f47a1cbc4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/core/src/setup.rs Resolved
Comment thread apps/desktop/core/src/source.rs Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6f47a1cbc4

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

…emon recovery

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20e79a9664

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/core/src/setup_io.rs Resolved
@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: ac40fbbe92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…s read

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: f601833c58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 52cef18415

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: c886c22637

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@roodboi

roodboi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: c886c22

The base is feat/desktop-app-doctor (stacked on #806, ready at 4eb4eee), which contains next at 081a526. It is mergeable and not a draft.

What changed since the last note

  • Merged feat(desktop): add the Doctor view (HACK-2214) #806, which includes the new next. Logs-tab conflicts were resolved:
    • Fixtures: setup, logs and app fixtures work together.
    • Screenshots: HackApp::new now takes the window.
    • The test helper now sets HOME, so one clean-env test builds its own runner.
  • Bot fixes:
    • Docker card: taken from the machine Doctor run's docker daemon check. The daemon's own runtime_ok reflects the daemon's environment and is no longer used.
    • Project-pane recovery: Start/Restart hackd pins HACK_MCP_COMMAND to the selected CLI.
    • Status reads: every automatic daemon status read runs on Doctor's private tool PATH, with startup variables removed and no docker. The CLI's status command would otherwise run docker info from the ordinary PATH.

The three Doctor security limits listed on #806 apply here too.

What ran

  • apps/desktop: fmt, clippy with all features, aarch64-apple-darwin clippy, and bash scripts/test.sh (Linux, 222 passed, 1 skipped). All hermetic.
  • Lead instruction checks: the diff against next touches only apps/desktop/, so the CLI reference, machine-output table, error-code reference and TLA coverage doc need no regeneration, and the contract and spawn-bound tests and the nine acceptance scripts do not apply.
  • Persistent reviewer (Codex gpt-6.1-sol, rounds 44 to 51): clean at this SHA.
  • @codex review: clean at c886c22637. review-status: CLEAR at c886c22. Desktop app (Linux) passed.

Not verified or not waited for: hosted macOS jobs; the automatic security review of this head (running, non-blocking); no live Setup or Terminal hand-off on a Mac.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: c886c22637

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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