feat: add dotagents view to launch HarnessKit read-only inspector - #159
feat: add dotagents view to launch HarnessKit read-only inspector#159yourconscience wants to merge 4 commits into
dotagents view to launch HarnessKit read-only inspector#159Conversation
Reviewer's GuideIntroduces Sequence diagram for the dotagents view launchersequenceDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 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. Comment |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
💡 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".
| 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 |
There was a problem hiding this comment.
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 👍 / 👎.
| func runView(args []string) error { | ||
| path, err := hkLookPath(hkBinary) |
There was a problem hiding this comment.
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 👍 / 👎.
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.
viewis 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.go—runView:exec.LookPath("hk"), forward args tohk serve, install hint when absent, read-only banner.hkLookPathindirected for tests.cmd/dotagents/view_test.go— arg construction + missing-binary guidance (no server launched).main.go— dispatch +help --allcanonical 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 #1–improve ghpr PR merge gate #3 resolved againsthk1.10.0.Testing
go build ./...,go vet ./cmd/dotagents/,gofmtclean.go test ./...— full suite passes.Follow-ups (out of scope here)
hkinstall atsetup/deps(gated on install-method + publish-age policy).🤖 Generated with Claude Code
Summary by Sourcery
Add a thin
dotagents viewlauncher for inspecting detected harness configurations through HarnessKit without coupling HarnessKit writes to dotagents.New Features:
dotagents viewcommand to launch HarnessKit's cross-harness inspection web UI and forward server options.Enhancements:
Documentation:
Tests: