Update hypaware-query skill and add subagent#86
Conversation
Dual-agent review —
|
| Source | Finding (severity, evidence) | Intersects |
|---|---|---|
| Codex | Security surface: path-traversal via agent.name (major) — activation.js:276, core_commands.js:3124, walkthrough.js:1172 |
Targets (createAgentRegistry, runAgentsInstall, walkthrough agents.install); Risks #1. Independently confirmed by Claude follow-up. |
| Claude | Walkthrough finale install untested (major) — walkthrough.js:1155-1192 | Direct callers (walkthrough finale); Risks #2 |
| Claude | CLI install error/early-return paths untested (minor) — core_commands.js:3101-3133 | Targets (runAgentsInstall); Risks #3 |
Codex review
Fix Validations
hypaware-query skill referenced nonexistent query subcommands
- Status: correct
- Evidence: src/core/cli/core_commands.js:86, src/core/cli/core_commands.js:92, src/core/cli/core_commands.js:98, src/core/cli/core_commands.js:104, src/core/cli/core_commands.js:110, hypaware-core/plugins-workspace/claude/skills/hypaware-query/SKILL.md:34, hypaware-core/plugins-workspace/codex/skills/hypaware-query/SKILL.md:34
- Assessment: The skill docs now match the registered
hyp querysubcommands:schema,status,sql,refresh, andmaintain. The priorcatalog/logs/traces/metricsguidance is removed and replaced with SQL/status discovery guidance.
SQL/stderr guardrails were missing from the skill
- Status: correct
- Evidence: hypaware-core/plugins-workspace/claude/skills/hypaware-query/SKILL.md:38, hypaware-core/plugins-workspace/claude/skills/hypaware-query/SKILL.md:59, hypaware-core/plugins-workspace/codex/skills/hypaware-query/SKILL.md:38, hypaware-core/plugins-workspace/codex/skills/hypaware-query/SKILL.md:59
- Assessment: The updated skill documents the
JSON_EXTRACTpitfall and explicitly tells agents not to discard stderr, which addresses the described operational failure mode.
Findings
6) Security Surface
- Severity: major
- Confidence: high
- Evidence: src/core/runtime/activation.js:275, src/core/runtime/activation.js:287, src/core/cli/core_commands.js:3124, src/core/cli/walkthrough.js:1172
- Why it matters:
agent.nameis only validated as a non-empty string, then interpolated into filesystem destinations, so a plugin can register a name containing..or path separators and causehyp agents installor onboarding to copy outside the intended<agent_dir>. - Suggested fix: Reject agent names that are not a safe basename, for example disallow
/,\,.., absolute paths, and empty/hidden traversal segments inagents.register; also resolve the final path and assert it remains underpath.resolve(homeDir, agentDir). Add regression coverage for traversal names through both CLI install and walkthrough install.
No Finding
-
- Behavioral Correctness
-
- Contract & Interface Fidelity
-
- Change Impact / Blast Radius
-
- Concurrency, Ordering & State Safety
-
- Error Handling & Resilience
-
- Resource Lifecycle & Cleanup
-
- Release Safety
-
- Test Evidence Quality
-
- Architectural Consistency
-
- Debuggability & Operability
Evidence Bundle
- Changed hot paths: agent registry creation;
ctx.agentsactivation/dispatch wiring;hyp agents install; picker finale agent install; client descriptor cataloging ofagent_dir; Claude plugin agent registration;hypaware-queryskill docs. - Impacted callers: src/core/cli/dispatch.js:183; src/core/cli/core_commands.js:2430; src/core/cli/core_commands.js:2636; src/core/cli/core_commands.js:3101; src/core/cli/walkthrough.js:783; src/core/cli/walkthrough.js:1167; hypaware-core/plugins-workspace/claude/src/index.js:253.
- Impacted tests: test/core/agents-install.test.js:21; test/core/agents-install.test.js:56; test/core/agents-install.test.js:87; test/core/agents-install.test.js:116; test/core/config.test.js:291; test/core/sink-materialize.test.js:128.
- Unresolved uncertainty: I did not run
npm test; this review used the diff plus targeted call-site tracing.
Claude review
Claude review
Five parallel reviewers (guidance compliance, shallow bug scan, historical
context, contracts & callers, comments & tests) examined PR #86 at its head
commit (f4a9c92) in a detached worktree. The scoped core suite passes
(516 pass / 0 fail / 1 skipped once node_modules is resolved). The
implementation is unusually clean: the new agents contribution type is a
faithful, fully-wired mirror of the existing skills machinery — registry,
CLI install, walkthrough finale, plugin_doctor, manifest descriptor, types,
docs anchor, and packaging are all consistent. No logic bugs, no contract
drift, no dropped guard in history, and no guidance violations (no
semicolons, no inline import() types, no new @typedef, .d.ts
interfaces used correctly).
The only findings surviving the ≥80 confidence filter are test-coverage
gaps. (Reviewers independently agreed the code is correct; these are
about unexercised new behavior, not defects.) The shallow-bug-scan and
contracts reviewers did not surface the path-traversal issue Codex found;
on follow-up that finding was independently confirmed (see risk capstone).
Walkthrough finale agent-install path has zero test coverage
- Severity: major
- Confidence: 80
- Evidence: src/core/cli/walkthrough.js:1155-1192 (new
agents.installspan block: dry-run rendering, realmkdir+copyFile,descriptorMapgating,summary.agentsInstalled); finale count line at src/core/cli/walkthrough.js:959-962. No test referencesagentsInstalled,agents.install, orWould install agent(grep acrosstest/matches only the unit file). - Why it matters: The walkthrough is the primary path users actually hit during onboarding; its new agent-install branch ships completely unexercised, so a regression in the real install, dry-run, or gating logic is invisible to CI — directly against the repo's "add traditional tests for deterministic logic" and log-driven-verification guidance.
- Suggested fix: Add a
runPickerFinale/walkthrough test (the existingwalkthrough-*.test.jsfiles provide a harness) that, with anagents.list()stub and a pickedclaudeclient, asserts: (a) real install writes<home>/.claude/agents/<name>.md; (b)dryRun: trueemits(dry-run) Would install agentand writes nothing; (c)summary.agentsInstalledis populated.
hyp agents install error / early-return paths untested
- Severity: minor
- Confidence: 88
- Evidence: src/core/cli/core_commands.js:3101-3111 (
(no agents registered)early return;HOME is not set→ exit 1) and src/core/cli/core_commands.js:3130-3133 (per-agentcopyFilefailure →warning: … failed:). None of these branches/strings are asserted in test/core/agents-install.test.js. - Why it matters: The empty-registry, missing-HOME (distinct exit code 1), and copy-failure branches are real operator-facing behaviors; a refactor could silently change an exit code or swallow the warning with no test to catch it.
- Suggested fix: Add three small cases: empty registry → stdout
(no agents registered), exit 0;envwithoutHOME→ exit 1 +HOME is not set; an agent whosesourceFileis missing → exit 0, stderr matchesfailed:, count line shows0.
Reports: /Users/phil/workspace/hypaware/.git/dual-review/pr-86
97711e6 to
437c669
Compare
🧭 Decision map — where to spend your attentionThis casts no verdict — it points at the 4 forks where the author made a real choice, so you can skim the rest. Scanned: 59 hunks across 23 files (+711 / −45). Most is mechanical: a new 1. Path-traversal containment for plugin-supplied install paths · contract / security
export function isSafeContributionName(name) {
if (name === '.' || name === '..') return false
if (name.includes('/') || name.includes('\\')) return false
if (path.isAbsolute(name)) return false
return path.basename(name) === name
2. Fan-out worker pinned to
|
hypaware-analystsubagent: a fan-out worker for parallel analysis of local HypAware recordings (one agent per date/gateway/conversation slice), returning structured summaries instead of raw query output.hypaware-querySKILL.md (claude + codex) corrected to the real installed CLI: removed nonexistentcatalog/logs/traces/metricssubcommands, added SQL dialect notes (JSON_EXTRACTpitfalls, regex extraction pattern), per-table schema guidance, and stderr guardrails.