Skip to content

feat(desktop): add the Logs tab (HACK-2214) - #808

Merged
roodboi merged 73 commits into
nextfrom
feat/desktop-app-logs
Nov 15, 2026
Merged

roodboi merged 73 commits into
nextfrom
feat/desktop-app-logs

Conversation

@roodboi

@roodboi roodboi commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Adds the Logs tab for HACK-2214 on next, after merged #801. Compose projects get a generation-owned hack logs --json stream with Pause/Resume, search, one-service filtering, expandable lines, and reconnect. Stopped projects get a finite read; native projects retain a terminal-command note.

The memory-only ring holds at most 10,000 lines and 8 MiB. A nonblocking 1,024-event queue discards overflow while continuing to consume CLI stdout, and shows a cumulative skipped-event count. Valid event messages are capped at 64 KiB; raw records over 1 MiB leave a visible marker. Bounded stdout/stderr diagnostic tails preserve pretty CLI failure-envelope messages and human-readable exit status. No copy-all or disk logging.

Accepted refreshes invalidate tails and replace streams when project root or backend changes; rejected sequence/action-epoch tokens have no Logs side effects. Services-tail polling stops on the Logs tab. Final core warmups, daemon-unavailable states, explicit recovery gates and generation ordering are preserved.

Validation on Linux: 95 unit + 4 integration tests; fmt; Clippy default and screenshots with warnings denied; both app builds; all 46 offscreen fixture images. Cargo jobs were bounded to 2 with an independent target. Fake CLI runs use temporary HOME/HACK_HOME and disable daemon autostart. Tests include flood completion without UI drain, exact queue loss/bounds, multiline error envelopes, stderr diagnostics, process groups and inherited pipe draining.

Light Logs board · Dark Logs board

Logs, dark

Exact-head Codex and the lead's persistent second-family review are acceptance gates; this description does not assert readiness. macOS, live project streams, interactive gestures and crash/force-quit cleanup remain unqualified by these hermetic Linux checks. Release intent: optional desktop capability (feat), no release or onboarding integration.


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

roodboi and others added 13 commits November 13, 2026 19:01
…CK-2214)

New Cargo workspace under apps/desktop, separate from runtime-core:
- core: lenient models for hack --json and hackd payloads, a CLI runner
  that kills the whole process group on timeout, a read-only hackd socket
  client, project state derivation, list/detail view models and fixtures
  for every designed state. 33 hermetic unit tests.
- app: the gpui-kit window (sidebar, header with Start/Stop/Restart/Open,
  services table, log tail, status bar, light and dark), --fixtures mode
  and offscreen PNG rendering behind the screenshots feature.
- A separate, non-required Linux CI job for the desktop workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…finished one-shot services as completed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eout, drop stale log tails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…abel Docker state as Docker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arden chunk parsing, never count unknown as stopped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, gate native actions and logs, clear recovered failures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er peer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iled log read as failed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r and machine rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r, long lines, end states)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 9:20am UTC

Request Review

@roodboi

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@linear-code

linear-code Bot commented Nov 14, 2026

Copy link
Copy Markdown

HACK-2214

@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-15T09:21:55.654745Z 7ab1542 Manual request
🔒 Security Review ✅ Completed 2026-11-15T09:27:11.112347Z 7ab1542 Manual request

Security findings

Advisory findings (2)

ℹ️ 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.

… as down

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

@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: 8366c34336

ℹ️ 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/app/src/logs_view.rs Resolved
Comment thread apps/desktop/app/src/logs_view.rs Resolved
Comment thread apps/desktop/core/src/logs.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: 8366c34336

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 and others added 4 commits November 13, 2026 19:56
…ling lines and error reasons, follow selection changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s; mark oversized records

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/desktop-app-logs

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

roodboi commented Nov 14, 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: 6bee49a882

ℹ️ 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/app/src/logs_view.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: 6bee49a882

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.

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

roodboi commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

# Conflicts:
#	apps/desktop/README.md
#	apps/desktop/core/src/runner.rs
#	apps/desktop/core/src/source.rs
#	apps/desktop/core/tests/dump_state.rs
@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. You're on a roll.

Reviewed commit: 7934a74780

ℹ️ 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: 7934a74780

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 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. More of your lovely PRs please.

Reviewed commit: 5ff6ee6c16

ℹ️ 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: 5ff6ee6c16

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 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 5ff6ee6

Two merges of next since your acceptance at 2dd1f19, plus the fixture nit.

  • 95df616: the failed Logs fixture reports Loki WebSocket error instead of a Docker daemon error, so it agrees with "Docker ok" in the status bar.
  • 7934a74: merge of next e47681e. Conflicts: runner.rs imports (next's crate::process::Child, keeping the atomics behind the skipped-event count); source.rs and tests/dump_state.rs fake-CLI setup (next's test_support::script); README (Logs section, then next's test-runner text under "Process-cleanup tests").
  • 5ff6ee6: merge of next bf74aaf (next moved after the freeze note). It only adds next's one-line DESIGN.md R3 status update, which touched this PR's file.
  • bash scripts/test.sh (Linux, pinned nextest, temp HOME/HACK_HOME, autostart disabled): 100 of 100, doctests ok. fmt, Clippy with all features (-D warnings) and Apple-target Clippy for core: clean.
  • Persistent second-family reviewer (Codex gpt-6.1-sol): clean on 7934a74 and 5ff6ee6 (empty remerge diff). It confirmed finite and streaming reads both go through the new macOS spawn boundary.
  • Codex bot at this head: no findings (code and security). computer pr review-status: CLEAR at 5ff6ee6.
  • Hosted: desktop Linux job passed. The desktop macOS job was still pending; I did not wait for it or for the remaining test shards.

Not verified by me: anything on a real Mac.

🤖 Generated with Claude Code

roodboi and others added 2 commits November 15, 2026 02:38
# Conflicts:
#	apps/desktop/core/src/runner.rs
The Logs tab's poll reaps the stream's child when it exits, but Drop
then sent SIGKILL to that PID and process group. Once reaped, the PID can
belong to another process. The stream now records that it was reaped and
Drop sends no signal; a test counts group signals after a reaped drop.

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. Keep them coming!

Reviewed commit: fb6a5eda88

ℹ️ 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: fb6a5eda88

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 15, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: fb6a5ed

Changes since my 5ff6ee6 note:

  • b98f53a: merge of next 345dc0d (fix(cli)!: standardize HACK-2218 machine output contracts #835, feat(projects): share backend-aware service state across CLI and daemon #831). The conflict was in runner.rs. I kept Logs' stream additions (diagnostic tail, field caps, bounded line reader, skipped count) and next's LogStream doc comment. Drop first drops Logs' receiver, then runs next's signal, retry, detach and reap sequence.
  • fb6a5ed: my reviewer found that the merge combined Logs' poll(), which reaps the child once it exits, with next's Drop, which then sent SIGKILL to that PID and process group. A reaped PID can belong to another process. The stream now records that it was reaped, and Drop sends no signal. The test dropping_a_stream_after_poll_reaped_it_sends_no_signal counts group signals and fails without the fix.

Evidence:

  • bash scripts/test.sh: 105 passed, 1 skipped (the skip comes from next). fmt, Clippy with all features and Apple-target Clippy: clean. Nothing outside apps/desktop changes; the contract tests pass (89/89).
  • Persistent reviewer: clean at this head. Codex bot at this head: no findings (code and security). computer pr review-status: CLEAR at fb6a5ed.
  • Hosted: 15 pass. The desktop macOS job was still pending; I did not wait for it.

Not verified by me: macOS. The new Drop path is worth a Logs open, close and reopen on the Mac.

🤖 Generated with Claude Code

roodboi added a commit that referenced this pull request Nov 15, 2026
Adds the names-only Env tab: read on open, project change and Check
again, missing required names first, locked/unknown key readability, and
explicit empty versus unreadable states. Uses `hack env list --json
--path <root>` without a value flag; exit 1 still accepts a bare report.
Typed models discard values/materialized fields and raw diagnostics.
Generations drop stale selections; marker/discovery guards refuse
missing or ancestor-shadowed roots. Canonical selected-scope absence
differs from project-wide absence; empty legacy scope arrays show
global.

Visible copy explains that key readability can be unknown and that Set
indicates storage, not confirmed readability. The locked state shows
`hack doctor` beside **Copy command**. The available app/core tabs and
fixtures contain no internal request/ticket IDs outside source comments;
the core always-on tooltip and README are aligned. No native Env, key
handling, badge styling or upstream CLI-shape changes.

Based on `next`; core warmups, ordered snapshots, log-tail invalidation
and recovery gates are preserved. Local Linux at
**08db90a75609b1fea06791eeb9847b95949ec55e**: Rust 1.98.1, own target,
jobs 2; fmt, 77 unit + 6 integration tests, both Clippy modes with
warnings denied, both builds and privacy pass. Eight affected Env
light/dark screenshots were rendered and inspected at the copy-fix head
bb70d35; the subsequent frozen-next merge changes no UI/fixtures and
retains those receipts. Loading/error renders are retained unchanged.
Fake CLI/temp HOME/HACK_HOME/autostart disabled; no real env command,
owner registry/daemon, Docker, sudo or GUI window.

Normal merge of frozen next 8e7242d is pushed at 08db90a. README
preserves Env docs and incoming process-retirement test guidance; runner
tests match next/843. No app/Env read logic changed. Root and desktop
scripts/test.sh are absent, so pinned own-target Cargo checks were used;
no unmerged 846 wrapper was imported. Exact-head Codex and SAME
persistent Claude r5 are clean; review-status CLEAR. Both hosted desktop
jobs and successful replacement CI selected shards/fan-in pass. **[Final
Ready for
lead](#818 (comment)
at frozen 08db90a supersedes all earlier holds; superseded cancellation
excluded. Absolutely no more pushes. No PR merge during next.17 freeze;
lead only after publication. Lead's macOS build/renders/state pass
covers the previous 609d5cc head; new copy has fresh Linux offscreen
evidence and the frozen merge head has hosted Linux/macOS desktop
success; runtime limitations remain. Separately tracked macOS spawn
flakes are not changed here. No full-CI-green, merge or release claim.

Limits: real env CLI rejects native roots, so native Env is Unreadable
pending CLI support; fake native tests prove backend selection/parser
behavior only. macOS keychain prompting remains unverified. Reads are
bounded but not deduplicated; stale results are discarded. Marker
pre/post checks are not an atomic filesystem fence. No merge or watcher
by this unit.

![Names-only Env,
light](https://raw.githubusercontent.com/hack-dance/hack/feat/desktop-app-env/apps/desktop/screenshots/env-normal-light.png)
![Locked Env,
dark](https://raw.githubusercontent.com/hack-dance/hack/feat/desktop-app-env/apps/desktop/screenshots/env-locked-dark.png)

Freeze branch-update order: #846 → #818 → #808. Env MERGE PUSHED is
complete, so Logs can be NEXT. Preserve shared
tab/fixture/screenshot/source hooks. No PR merges during freeze; lead
only after publication. No new shape adoption or scope.

---------

Co-authored-by: Dimitri Kennedy <344842+roodboi@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	apps/desktop/README.md
#	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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 7ab1542673

ℹ️ 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: 7ab1542

Merge of next 34b5053 (with #818's Env tab) into fb6a5ed, my previous ready note.

The Logs and Env tabs now live in the same app:

  • Tabs: Services, Logs and Env are enabled; Activity stays disabled. Switching tabs opens or closes the log stream and resets or re-reads Env.
  • Refresh: both refresh paths go through Logs' apply_refresh(). When the selected project changes, it also resets Env and re-reads it if the Env tab is open.
  • Screenshots: the Logs fixture list is filtered by --fixtures when one is given.
  • Source: the trait, the live source and the fixture source keep both open_logs and env.
  • README: Logs, then "Not yet" (the Activity tab only), then Env, then Process-cleanup tests.

Evidence:

  • bash scripts/test.sh (Linux, pinned nextest, temp HOME/HACK_HOME, autostart disabled): 112 passed, 1 skipped (the skip comes from next). fmt, Clippy with all features (-D warnings) and Apple-target Clippy for core: clean.
  • Offscreen renders, checked by eye: env-normal and logs-following both show Logs and Env enabled and working.
  • Nothing outside apps/desktop changes. tests/machine-output-contract.test.ts and tests/sync-spawn-bound.test.ts: 89/89 on this next tree. No generated files or acceptance scripts apply.
  • Persistent second-family reviewer (Codex gpt-6.1-sol): clean at this head.
  • Codex bot at this head: the code review found no issues. The security review is marked completed, and its summary flag says "has findings", but it posted nothing for this commit. There is no open thread, and computer pr review-status is CLEAR at 7ab1542.
  • Hosted: all 16 checks pass, including the desktop macOS build and core tests.

Not verified by me: interactive use on a Mac. The committed logs-light/dark.png boards predate Env being enabled; they still show the Env tab greyed out.

🤖 Generated with Claude Code

@roodboi
roodboi merged commit 081a526 into next Nov 15, 2026
23 checks passed
@roodboi
roodboi deleted the feat/desktop-app-logs branch November 15, 2026 14:08
roodboi added a commit that referenced this pull request Nov 15, 2026
…econcile

Brings in next at 081a526 (#811 supervisor opt-in runner, #863 candidate launcher names HACK-2251, #808 desktop Logs tab). No conflicts. The CLI reference, machine-output table and error-code reference regenerate unchanged; E_DAEMON_SERVICE kept.

#863 changes which launcher printed commands name and the candidate update refusal; it does not change the executing-CLI identity, the service program checks, durability or the post-update binding, and a candidate install is still refused before any install or reconcile. #811's supervisor reads process identities through process-tree.ts and runs its own sibling binary; it does not use this PR's ps/lsof helpers, process-ancestry or the orphan sweep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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