Skip to content

tackroom dash --json prints the dash's answer once, without a terminal - #344

Merged
yourconscience merged 3 commits into
mainfrom
dash-json
Nov 28, 2026
Merged

yourconscience merged 3 commits into
mainfrom
dash-json

Conversation

@yourconscience

@yourconscience yourconscience commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

What and why

tackroom dash --json prints once, as JSON, the answer the terminal dash shows, and exits. It needs no terminal, so a script or a menu bar item can run it. Until now the combined headline ("1 failing, 5 need attention") existed only inside the dash and the Herdr panel; status --json covers sync alone.

The document has the level (ok, warn, fail), the headline, the two numbers behind it, the notes under it, the counts, the harnesses in sync, needing a sync or broken, the jobs that fail or need attention, the machines, and the time of the check. It is built from the dash's own collects and answer(), so the dash and the JSON cannot disagree.

Plain tackroom dash is unchanged; its "needs a terminal" error now names dash --json.

How I checked it

In a throwaway home with stub launchctl, crontab and ssh:

  • tackroom dash --json < /dev/null exits 0, prints valid JSON with no ANSI codes and nothing on stderr. On a healthy demo home: level ok, title "All clear", 6 harnesses in sync, counts 15 skills, 6 roles, 2 MCP servers, 1 hook, which is what the web view's Overview shows for the same home.

  • With one stub job reporting exit 1 and one pointing at a missing path: level fail, "1 failing, 1 needs attention", both jobs listed, the healthy one left out.

  • A moved role file puts the harness under needs_sync; a second host fills machines; a corrupt lock gives null config counts and a note.

  • tackroom dash without a terminal still exits non-zero with the new message.

  • go test ./... and go vet ./... pass

  • I can explain this change without an AI tool

Summary by Sourcery

Expose the dash's current health summary as a machine-readable JSON snapshot for scripts and menu bar integrations.

New Features:

  • Add tackroom dash --json to emit a one-time, terminal-independent JSON snapshot of sync status, scheduled jobs, harnesses, machines, counts, and check metadata.

Enhancements:

  • Keep the JSON document's headline, status, and reported values aligned with the interactive dash while preserving existing terminal behavior.

Documentation:

  • Document the new JSON mode, output schema, usage, and upgrade guidance.

@sourcery-ai

sourcery-ai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Define the JSON document and implement tackroom dash --json as a terminal-independent command that collects dashboard data and emits that document.

  • internal/app/dash_json.go L1-125

Add the --json dash option and update its usage and non-terminal error guidance.

  • internal/app/dash.go L47, L52-58

Implementation

Adapt dashboard status, answer, count, harness, and machine helpers so the JSON output can reuse the dash’s calculations and represent unknown counts.

  • internal/app/dash.go L1257-1274, L1374-1391, L1570-1574 (+10 small edits)

UI

Update command summaries to advertise the new one-shot JSON mode.

  • internal/app/app.go L664, L701

Documentation

Document the dash JSON option and its fields, update command references, and add the 3.3 upgrade note.

  • docs/commands.md L88, L224
  • docs/terminals.md L24, L55-82
  • docs/upgrading.md L5-10
  • skills/tackroom/SKILL.md L44

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f61c94f4-6ef6-4533-8d1d-5c48c9bb7eb0
Commits

Reviewing files that changed from the base of the PR and between af034bb and f48392a.

Files selected for processing: 7

  • docs/commands.md
  • docs/terminals.md
  • docs/upgrading.md
  • internal/app/app.go
  • internal/app/dash.go
  • internal/app/dash_json.go
  • skills/tackroom/SKILL.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sourcery-ai sourcery-ai 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="internal/app/dash.go" line_range="1378-1379" />
<code_context>
+// not be read.
+func (m dashModel) countNumbers() (numbers [5]*int) {
+	if s := m.status; s != nil {
+		for i, n := range []int{s.skills, s.roles, s.mcp, s.hooks} {
+			numbers[i] = &n
+		}
+	}
</code_context>
<issue_to_address>
**Unreadable counts appear as zero**

When `expectedSkills` or `agentrole.Load` fails while the rest of status collection succeeds, `collectDashStatus` leaves the skill or role count at zero, and `countNumbers` wraps it in a non-nil pointer, so JSON reports `0` instead of `null` and callers treat unreadable data as a real zero.

Preserve whether the skills and roles reads succeeded, and return nil pointers for counts whose reads failed.

Also at `docs/terminals.md:78`.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: internal/app/dash.go:1379


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread internal/app/dash.go Resolved

@sourcery-ai sourcery-ai 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.

Sourcery assessment

Approved.

@yourconscience
yourconscience merged commit 7862e82 into main Nov 28, 2026
11 checks passed
@yourconscience yourconscience mentioned this pull request Nov 30, 2026
1 of 2 tasks
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