Repository navigation
Conversation
Teaches agents how to build and run herdr-web-ui in test mode, drive it in a real browser via Playwright, and capture evidence (screenshots, console errors, performance traces). Includes a feature map documenting stable selectors, data attributes, routes, and keyboard shortcuts for browser testing. Reuses existing browser regression scripts and test harness instead of inventing new infra. Part of making the repo more agent-trustworthy. Co-authored-by: Hako <devswha@gmail.com>
Static analysis to ensure all paneSendText and paneSendKeys calls in agent pane input paths pass an authorization guard. The guard is called right before herdr receives the write, preventing race conditions where a sender's permission could lapse during Bun.connect() (#624, #666, #760). The check runs in the fast lane (bun run check fast) and fails if any call site bypasses the guard without being in an allowed exception list. Allowed exceptions include: - Test files (run against owned panes) - HTTP POST handlers (synchronous request context) - prompt.ts (uses its own authorization model) - Secret input Enter (#589: must follow paste immediately) - submitText (authorize() called synchronously before each send) Includes tests for the guard: passing and violating fixtures. Co-authored-by: Hako <devswha@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
|
Closing. The skill doc repeats commands already kept in docs/development.md and AGENTS.md (which ask not to copy them) and assumes a Cursor workspace. The input guard problem is real (#624, #666, #760), but a regex scan with a pattern allowlist is brittle and already allowlists a known unguarded path (submitText). A sturdier fix is to make the guard a required parameter of paneSendText/paneSendKeys so the type checker finds every call, with explicit, explained opt-outs for the HTTP handlers and tests; that can come as its own PR. |
Change
Make this repo more agent-trustworthy following Lauren Tan's approach: agents must prove work by running the app; give them a feature map; seal bad shortcuts with mechanical CI checks rather than prose rules.
1. Verification skill (
.cursor/skills/verify-herdr-web-ui/)Teaches agents how to:
Reuses the repo's existing browser regression scripts and harness (
scripts/ci-browser.sh,scripts/ui-regression.ts, the*-regression.tsscripts) instead of inventing new infra.Verification of the skill (ran locally):
2. Feature map (
.cursor/skills/verify-herdr-web-ui/feature-map.md)Documents how to reach each major feature with stable selectors/data attributes actually present in the code:
/?pane={id},/?settings,/?new, etc.)data-workspace,data-pane,data-status, etc.)3. CI guard against input dispatch bypass (
scripts/input-guard-check.ts)Static analysis that fails CI when a new
paneSendTextorpaneSendKeyscall bypasses the authorization guard. This pattern appeared in:dispatchPendingText, fixed by PR fix(chat): steer Claude with Ctrl+Enter, guard pending writes, restore a stopped send #760paneSendText/paneSendKeysaccept an optionalguardfunction called right before herdr receives the write; without it, a sender's permission can lapse duringBun.connect()(fix(terminal): recheck the sender's right to type right before herdr is written to #624, server: queued chat delivery (paste and Enter) skips #624's write-time authority check #666, fix(chat): steer Claude with Ctrl+Enter, guard pending writes, restore a stopped send #760)How the guard works:
server/**/*.tsforpaneSendText/paneSendKeyscallsprompt.ts(uses its own authorization model)submitText(authorize() called synchronously before each send)Wired into
bun run check fastlane.Tests (
scripts/input-guard-check.test.ts):Validation
bun run typecheck: passbun run build: passbun run test:unit: 2554 pass, 8 skip, 0 failbun scripts/input-guard-check.ts: pass (30 call sites, 10 with guards, 20 in allowed exceptions)settings-pages-demo-regression.ts): all PASS