Registry Mirror
Skip to content

Conversation

@benvinegar

@benvinegar benvinegar commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Add hunk status: a read-only workspace overview that makes current changes and sibling worktrees understandable without leaving the terminal.

  • Separate, indented Tracked changes and Untracked files, with readable staging labels and shared-theme colors. Mixed staged/unstaged changes retain both facts.
  • Show up to 10 files per group, with independent keyboard/mouse expand and collapse actions. Keep a clear boundary before sibling worktrees.
  • Inspect another worktree in the same status surface, then open the existing Log or full multi-file diff and return to the previous selection.
  • Preserve the session's theme/custom palettes, transparency, review preferences, extension authority, and mounted broker target across these routes.
  • Support live refresh, shell-native static output, and complete versioned JSON output.

This is intentionally a draft for product/UX review. It adds one view—not staging controls, an agent dashboard, another diff renderer, or a repository manager. Log/Quit shortcuts are absent from the main action strip; existing keyboard/menu commands remain.

Architecture

Git implements an optional renderer-free ExtensionVcsAdapter.status capability, with bounded cancellable reads and separate current/sibling refreshes. This belongs alongside the existing provider-owned history capability: extensions supply VCS facts while the host retains terminal routing, trust, themes, and lifecycle ownership. No parallel review semantics or broker protocol.

Rebased onto 3fbb223e; extension API 26 follows main's API 25 asynchronous watch signatures. Includes docs/help and a minor Changeset. CI fixes synchronize the tracked package README and canonicalize worktree filesystem identities, with alias/junction regressions included in Windows coverage.

Visual evidence

Real source TUI captured in a Linux PTY through test/pty/harness.ts and the term-video keyframer/tuistory/ghostty renderer—not a mockup. Synthetic Git fixture: 11 tracked changes, 11 untracked files, and one linked sibling.

  • Command: status --no-extensions --theme nord --color always
  • Status: 100×38, plus 42×40 narrow captures and no-color coverage.
  • Existing diff: 100×32, auto layout, entered from status and returned with Q.
  • PTY tests exercise Enter/Space/mouse expansion, hidden-selection safety, resize, sibling inspection, and Log/diff return paths.

Actual grouped status with per-group expansion and sibling worktrees

Capture and behavior notes

Verification

Latest update: 87d7433a

Rebased onto 3fbb223e. Local validation passes packaging, typecheck/dependencies, 183 PTY tests (1 platform skip), and 11 TTY tests. A clean Git candidate checkout passes the full suite: 4,317 pass / 13 skip / 0 fail. The three cwd-dependent failures in the original JJ-colocated checkout also reproduce against fetched main; its same 62 relevant tests pass from a plain Git checkout. Native Windows results are being verified in the current remote CI run; see the latest rebase comment for details.

Earlier validation before this update

Post-rebase checks used the installed Bun 1.4.2 executable explicitly; both default-suite shard headers confirm that version. Equivalent commands below use $BUN for /home/bentlegen/.local/share/mise/installs/bun/1.4.2/bin/bun and prepend its directory to PATH.

  • $BUN run typecheck — pass.
  • $BUN run deps:check — pass, 486 modules / 1,999 edges.
  • $BUN scripts/generate/generate-docs.ts --check — pass.
  • $BUN scripts/test/run-test-suite.ts --group=integration — 175 pass / 1 platform skip.
  • HUNK_RUN_TTY_SMOKE=1 $BUN test ./test/smoke — 11 pass, including a real two-file diff entered via status and terminal restoration.
  • $BUN test ./test/review-conformance — 118 pass.
  • $BUN scripts/test/test-session-broker-node.ts — 4 pass.
  • $BUN scripts/test/run-test-suite.ts — 4,258 pass / 13 skip / 3 failures; not a green full-suite result.
  • Formatting/lint pre-commit hooks and git diff --check — pass.

The three failures expect Git but this colocated checkout detects JJ:

  1. resolveSessionVcsId > falls back to detection and reports an id nothing owns
  2. loadConfiguredSessionBootstrap > shares extension-aware loading and session fields across launch and reload callers
  3. registerVcsAdapter with junk > a detect() that throws does not stop other adapters being consulted

Before rebase, these were reproduced using pristine pre-feature 94b71186 sources from git archive HEAD, with dependencies linked and the original checkout cwd retained:

$BUN test \
  "$BASELINE/packages/hunk/src/extensions/apply.test.ts" \
  "$BASELINE/packages/hunk/src/app/sessionBootstrap.test.ts" \
  "$BASELINE/packages/hunk/src/extensions/publicApiRobustness.test.ts"

Result: 59 pass / the same 3 failures. Running both baseline and working sources from a temporary Git-only cwd produced 62 pass / 0 fail each. The assertions were not weakened; post-rebase failures have the same identities and mismatch.

Independent reviews covered provider correctness, routing/cleanup, shared state, refresh races, and the final grouped UX. Findings were fixed and rechecked; the rebase preserves main's direct-review metadata and reran the gates above.

Limits

  • Git-only initially; native JJ/Sapling detection reports unsupported rather than silently falling back. Use --vcs git explicitly when appropriate.
  • Human fetch age is omitted: local FETCH_HEAD mtime cannot attest when the configured upstream was fetched. JSON retains qualified provenance.
  • Linux PTY/TTY tested; Windows/macOS execution and installed-binary rebuild were not performed. Existing platform/provider/opt-in skips remain.
  • No automatic fetch, staging, commit, agent invocation, or sibling extension trust/discovery.

This PR description was generated by Pi using GPT-6 Astra

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Oct 12, 2026 6:27pm UTC

Request Review

@benvinegar

Copy link
Copy Markdown
Member Author

Rebased onto current main (3fbb223e) and pushed 87d7433a with the CI fixes.

  • Preserved main’s async-watch, overlay, PTY synchronization, and release changes; status now uses extension API 26 after main’s API 25.
  • Synchronized the tracked package README with the canonical root copy, fixing packaging.
  • Reused the canonical filesystem-path helper across status identities and added alias/junction round-trip coverage for the Windows short/long-path failures. Added renderer-free status regressions to the focused Windows suite.

Local verification: clean Git checkout full suite 4,317 pass / 13 skip; PTY 183 pass / 1 skip; TTY 11 pass; packaging, typecheck and dependency checks pass. Native Windows verification is pending the new CI run. The original JJ-colocated checkout’s three cwd-sensitive failures also reproduce on fetched main.

This comment was generated by Pi using GPT-6 Astra

@benvinegar
benvinegar force-pushed the feat/status-workspace-compass branch from 6c2d03a to 87d7433 Compare September 10, 2026 13:25
@benvinegar
benvinegar force-pushed the feat/status-workspace-compass branch from 753f5cb to 33ec7e7 Compare October 12, 2026 16:28
@benvinegar
benvinegar marked this pull request as ready for review October 12, 2026 17:45
@benvinegar
benvinegar merged commit 49bebf7 into main Oct 12, 2026
14 checks passed
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High impact] Adds a new workspace status command with UI and VCS integration.

The supplied repository requirements must be satisfied before merging; trailing status messages also need a scrolling fix.

Findings

  1. P2 Trailing status messages stay hidden ▶
  2. P2 Environment reads bypass required boundary ▶
  3. P2 New filenames violate naming rule ▶
  4. P2 Indentation violates formatting rule ▶
  5. P2 Status adoption is not measured ▶
Fix with agent prompt
### Issue 1
packages/hunk/src/ui/status/geometry.ts:269-273
In a short terminal, arrow keys and the mouse wheel cannot scroll past the last selectable file or worktree. `measureStatusRows` excludes headings from navigation, so sibling errors and remaining-worktree notices below that row can stay hidden. Allow scrolling past the last selectable row without forcing the viewport back to it.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
packages/hunk-git/src/status.ts:187
The new Git status reader copies `process.env` directly. The supplied guide forbids direct access and requires packages to receive environment values from their callers. Pass the environment through the status context instead. This also occurs in `loadStatusBootstrap`, `StatusApp`, and other new status code. This repository requirement must be satisfied before merging.

### Issue 3
packages/hunk/src/ui/status/StatusApp.tsx:1
The new `StatusApp.tsx` filename violates the supplied guide’s requirement to use dash-case for TypeScript files. Rename it and update its imports. `statusBootstrap.ts` and `runInteractiveStatus.tsx` have the same issue, with further instances among the added files. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 4
packages/hunk-git/src/status.ts:184-190
The added code uses two-space indentation, but the supplied guide requires four spaces. Update the new code to meet that requirement before merging. The repository-specific exception permits double-quoted strings; it does not waive the indentation requirement.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 5
packages/hunk/src/app/cli.ts:260-263
The new user-facing `status` command has no adoption metrics. The supplied guide requires them when a change affects what users see or experience. Add a way to measure use of this command under the project’s metrics policy. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds hunk status with live, static, and versioned JSON views.

  • Hunk status shows workspace changes and sibling worktrees in one terminal view.
  • Git reports staged changes, working-tree changes, and sibling worktrees to Hunk status.
  • VCS extensions can provide read-only workspace status facts to Hunk.
  • Status, Log, and comparisons keep one session's settings and extension authority.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["hunk status"] --> Bootstrap["Launch config and extensions"]
  Bootstrap --> Git["Git status capability"]
  Git --> Static["Static or JSON output"]
  Git --> Status["Live status"]
  Status --> Sibling["Inspect sibling"]
  Sibling --> Status
  Status --> Log["Existing Log"]
  Status --> Diff["Existing full diff"]
  Log --> Diff
  Diff --> Caller["Return to caller"]
  Caller --> Status
  Caller --> Log
Loading

Reviews (1) · Last reviewed commit: "fix(status): retain retiring cursor clea..." · Reviewed by Greptile

Comment on lines +269 to +273
const index = selected === null ? -1 : (geometry.navigationIndex.get(selected) ?? -1);
const next =
geometry.navigable[Math.max(0, Math.min(geometry.navigable.length - 1, index + delta))]?.id ??
null;
return { selected: next, top: statusViewportTop(geometry, next, top, height) };

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.

P2 Trailing status messages stay hidden

In a short terminal, arrow keys and the mouse wheel cannot scroll past the last selectable file or worktree. measureStatusRows excludes headings from navigation, so sibling errors and remaining-worktree notices below that row can stay hidden. Allow scrolling past the last selectable row without forcing the viewport back to it.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk/src/ui/status/geometry.ts
Line: 269-273

Comment:
**Trailing status messages stay hidden**

In a short terminal, arrow keys and the mouse wheel cannot scroll past the last selectable file or worktree. `measureStatusRows` excludes headings from navigation, so sibling errors and remaining-worktree notices below that row can stay hidden. Allow scrolling past the last selectable row without forcing the viewport back to it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

const result = await runAbortableCommand([context.gitExecutable, ...args], {
cwd: context.cwd,
signal: context.signal,
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },

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.

P2 Environment reads bypass required boundary

The new Git status reader copies process.env directly. The supplied guide forbids direct access and requires packages to receive environment values from their callers. Pass the environment through the status context instead. This also occurs in loadStatusBootstrap, StatusApp, and other new status code. This repository requirement must be satisfied before merging.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk-git/src/status.ts
Line: 187

Comment:
**Environment reads bypass required boundary**

The new Git status reader copies `process.env` directly. The supplied guide forbids direct access and requires packages to receive environment values from their callers. Pass the environment through the status context instead. This also occurs in `loadStatusBootstrap`, `StatusApp`, and other new status code. This repository requirement must be satisfied before merging.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@@ -0,0 +1,552 @@
import { useKeyboard, useTerminalDimensions } from "@opentui/react";

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.

P2 New filenames violate naming rule

The new StatusApp.tsx filename violates the supplied guide’s requirement to use dash-case for TypeScript files. Rename it and update its imports. statusBootstrap.ts and runInteractiveStatus.tsx have the same issue, with further instances among the added files. This repository requirement must be satisfied before merging.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk/src/ui/status/StatusApp.tsx
Line: 1

Comment:
**New filenames violate naming rule**

The new `StatusApp.tsx` filename violates the supplied guide’s requirement to use dash-case for TypeScript files. Rename it and update its imports. `statusBootstrap.ts` and `runInteractiveStatus.tsx` have the same issue, with further instances among the added files. This repository requirement must be satisfied before merging.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +184 to +190
const result = await runAbortableCommand([context.gitExecutable, ...args], {
cwd: context.cwd,
signal: context.signal,
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" },
maxOutputBytes: MAX_OUTPUT_BYTES,
timeoutMs: QUERY_TIMEOUT_MS,
strictUtf8: true,

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.

P2 Indentation violates formatting rule

The added code uses two-space indentation, but the supplied guide requires four spaces. Update the new code to meet that requirement before merging. The repository-specific exception permits double-quoted strings; it does not waive the indentation requirement.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk-git/src/status.ts
Line: 184-190

Comment:
**Indentation violates formatting rule**

The added code uses two-space indentation, but the supplied guide requires four spaces. Update the new code to meet that requirement before merging. The repository-specific exception permits double-quoted strings; it does not waive the indentation requirement.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +260 to +263
status: {
path: "status",
summary: "inspect the current workspace and sibling worktrees",
synopsis: ["hunk status [--static | --json]"],

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.

P2 Status adoption is not measured

The new user-facing status command has no adoption metrics. The supplied guide requires them when a change affects what users see or experience. Add a way to measure use of this command under the project’s metrics policy. This repository requirement must be satisfied before merging.

Context Used: guidelines.mdc Cursor rule (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk/src/app/cli.ts
Line: 260-263

Comment:
**Status adoption is not measured**

The new user-facing `status` command has no adoption metrics. The supplied guide requires them when a change affects what users see or experience. Add a way to measure use of this command under the project’s metrics policy. This repository requirement must be satisfied before merging.

**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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