Skip to content

feat: add dotagents view to launch HarnessKit read-only inspector - #159

Open
yourconscience wants to merge 4 commits into
mainfrom
feat/harnesskit-integration
Open

feat: add dotagents view to launch HarnessKit read-only inspector#159
yourconscience wants to merge 4 commits into
mainfrom
feat/harnesskit-integration

Conversation

@yourconscience

@yourconscience yourconscience commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Adds dotagents view — a thin launcher that shells out to HarnessKit (hk serve) for a read-only web UI over every detected harness (skills, MCP, hooks, configs) in one place.

HarnessKit was verified live to detect and read the full stack dotagents targets — Claude Code, Codex, Oh My Pi (~/.omp), Hermes (~/.hermes), plus Gemini CLI, Copilot, OpenCode, Grok Build — i.e. it already covers the Pi/OMP + Hermes surface that other config UIs miss. Rather than rebuild a viewer, dotagents launches HarnessKit and stays the single source of truth.

Boundary invariant

dotagents remains the only writer of the five managed surfaces. view is read-only by intent: it never mutates skills, MCP, hooks, roles, or plugins. HarnessKit's convergence-style write actions (enable/disable/deploy) are deliberately out of scope — the command banner and docs say so.

Changes

  • cmd/dotagents/view.gorunView: exec.LookPath("hk"), forward args to hk serve, install hint when absent, read-only banner. hkLookPath indirected for tests.
  • cmd/dotagents/view_test.go — arg construction + missing-binary guidance (no server launched).
  • main.go — dispatch + help --all canonical form (kept out of the curated 6-family short help).
  • README.md, skills/dotagents/SKILL.md — pointer docs (no duplicated harness-compat table).
  • docs/harnesskit-integration.md — design notes; open questions init shared dotagents layer #1improve ghpr PR merge gate #3 resolved against hk 1.10.0.

Testing

  • go build ./..., go vet ./cmd/dotagents/, gofmt clean.
  • go test ./... — full suite passes.

Follow-ups (out of scope here)

  • L1: optional opt-in hk install at setup/deps (gated on install-method + publish-age policy).
  • L3: whether HK edits can route through dotagents — spike only; no known pluggable write backend.

🤖 Generated with Claude Code

Summary by Sourcery

Add a thin dotagents view launcher for inspecting detected harness configurations through HarnessKit without coupling HarnessKit writes to dotagents.

New Features:

  • Add the dotagents view command to launch HarnessKit's cross-harness inspection web UI and forward server options.

Enhancements:

  • Document HarnessKit as an inspection and audit surface while clarifying that dotagents remains the source of truth and managed-surface writer.

Documentation:

  • Add CLI help, README, skill guidance, and integration design notes for HarnessKit usage, boundaries, and deferred follow-ups.

Tests:

  • Add coverage for HarnessKit argument forwarding and missing-binary installation guidance.

@sourcery-ai

sourcery-ai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces dotagents view as a dependency-light launcher for HarnessKit’s hk serve, with argument passthrough, actionable missing-install behavior, read-only safety framing, tests, and supporting documentation/design notes.

Sequence diagram for the dotagents view launcher

sequenceDiagram
    actor User
    participant Dotagents
    participant PATH
    participant HarnessKit
    User->>Dotagents: view(args)
    Dotagents->>PATH: LookPath(hk)
    alt hk is available
        PATH-->>Dotagents: executable path
        Dotagents->>Dotagents: hkServeArgs(args)
        Dotagents->>HarnessKit: exec hk serve(args)
        HarnessKit-->>User: Read-only web inspector
    else hk is missing
        PATH-->>Dotagents: error
        Dotagents-->>User: hkInstallHint
    end
Loading

File-Level Changes

Change Details Files
Add a thin view subcommand that locates HarnessKit and forwards arguments to its server.
  • Dispatch dotagents view and expose it in full help while keeping short help curated.
  • Resolve hk via exec.LookPath, show an installation hint when unavailable, and run hk serve with inherited stdio.
  • Forward server flags verbatim, including port, host, and token options.
  • Add unit coverage for argument construction and missing-binary guidance.
cmd/dotagents/main.go
cmd/dotagents/view.go
cmd/dotagents/view_test.go
Document HarnessKit as the read-only inspection surface while preserving dotagents ownership of managed writes.
  • Add CLI usage and read-only boundary guidance to the README.
  • Document invocation, requirements, forwarded flags, and non-deployment intent in the dotagents skill.
  • Record HarnessKit coverage, integration rationale, resolved CLI behavior, and deferred installation/write-through work.
README.md
skills/dotagents/SKILL.md
docs/harnesskit-integration.md

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 Sep 6, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 2d5fbf2a-9fbb-4caf-baac-f6ae5e98a0b8


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

Comment @coderabbitai help to get the list of available commands.

@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 2 issues

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

## Individual Comments

### Comment 1
<location path="cmd/dotagents/view.go" line_range="42" />
<code_context>
+		return errors.New(hkInstallHint)
+	}
+	fmt.Fprintln(os.Stdout, "Launching HarnessKit (read-only). dotagents stays the source of truth — avoid HarnessKit's enable/disable/deploy actions on dotagents-managed skills, MCP, and hooks.")
+	cmd := exec.Command(path, hkServeArgs(args)...) // nosemgrep: go.lang.security.audit.dangerous-exec-command
+	cmd.Stdin = os.Stdin
+	cmd.Stdout = os.Stdout
</code_context>
<issue_to_address>
**issue (broader_impact):** `runView` launches the full `hk serve` UI, which includes HarnessKit's enable/disable/deploy write actions, while presenting the command as read-only; a user can therefore mutate dotagents-managed native links/configuration through the launched UI despite the boundary invariant and warning banner.

**Triggers:** When a user follows the advertised `dotagents view` workflow and uses one of HarnessKit's write actions.

**Suggested fix:** Use a HarnessKit mode that disables write actions if available; otherwise do not describe or present the full server as read-only, or add an explicit enforcement layer before shipping the launcher.
</issue_to_address>

### Comment 2
<location path="docs/harnesskit-integration.md" line_range="41" />
<code_context>
+New subcommand that starts HK pointed at the active dotagents config root and opens the browser:
+
+- Resolves the config root the same way the rest of the CLI does (`--config``$DOTAGENTS_HOME``~/.agents`).
+- Spawns the HK local server (127.0.0.1, token in URL — as observed at `:7070`), prints the URL, optionally opens it. Mirrors the existing external-CLI launch path (`external_cli.go`, `cli_launch_test.go`).
+- Read-only intent: we launch HK as a viewer over what dotagents already materialized.
+
</code_context>
<issue_to_address>
**nitpick:** The design notes state that the L2 launcher opens a browser, but `runView` only starts `hk serve` and forwards its standard streams; no browser-opening command or helper is invoked, so the documented launch behavior does not occur.

**Triggers:** When a user expects `dotagents view` to open the inspector automatically based on the integration design.

**Suggested fix:** Either open the server URL after startup or change the design notes and user-facing documentation to say that the command only starts the server.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and this launches an external server that can read harness configuration and exposes host, token, and other serve flags without enforcing read-only behavior, so a mistaken invocation or HarnessKit behavior could expose sensitive data or perform writes before the process is stopped. Reverting removes the command, but it cannot undo any exposure or mutation that occurred while the server was running.

Blocking findings: cmd/dotagents/view.go:42


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

Comment thread cmd/dotagents/view.go
Comment thread docs/harnesskit-integration.md Outdated

@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: c6401d36c1

ℹ️ 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 cmd/dotagents/view.go Outdated
Comment on lines +41 to +42
fmt.Fprintln(os.Stdout, "Launching HarnessKit (read-only). dotagents stays the source of truth — avoid HarnessKit's enable/disable/deploy actions on dotagents-managed skills, MCP, and hooks.")
cmd := exec.Command(path, hkServeArgs(args)...) // nosemgrep: go.lang.security.audit.dangerous-exec-command

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce read-only mode for the launched server

When a user invokes HarnessKit's enable/disable/deploy controls, this process can write to the native harness directories: the added design notes explicitly describe HK's convergence writer (docs/harnesskit-integration.md:15) and its enable/disable commands (docs/harnesskit-integration.md:67). This invocation enables no read-only mode and blocks no mutation endpoints; the printed warning is only advisory. Consequently, a command advertised as a read-only inspector can alter managed symlinks or unrelated native configuration. Enforce a genuine read-only mode or sandbox before presenting the mutable server under this contract.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Comment thread cmd/dotagents/view.go
Comment on lines +36 to +37
func runView(args []string) error {
path, err := hkLookPath(hkBinary)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the active dotagents harness configuration

When a valid configuration uses nonstandard skill_root/agent_root paths or enables only a subset of installed harnesses, runView never loads that configuration or performs dotagents harness detection; it delegates directly to HK's fixed discovery. The added design notes state that HK has no --config/--root option and reads fixed native homes (docs/harnesskit-integration.md:68), so configured materialized directories can be omitted while unrelated installed harnesses are shown, contrary to the documented active-config and detected-harness behavior. Resolve the active config and account for its roots and selection, or reject/document configurations that this viewer cannot represent.

AGENTS.md reference: AGENTS.md:L5-L11

Useful? React with 👍 / 👎.

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