SLOPSHOPPER

nixie-throw-hook-catch

Spike: a policy mod whose throwing tool.call hook has a .catch handler

newguard
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · nixie-throw-hook-catch
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ Denied by nixie-throw-hook-catch: nixie policy failed (throw: nixie-throw-hook-catch: hook failed), so the ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts
README

<h1>nixie</h1>

A personal assistant platform that its owner runs and controls: every rule readable and editable, every decision recorded, and personal data kept on the owner's own hosts.

<a href="./docs/README.md">Documentation</a> • <a href="./docs/README.md#decisions">Decisions</a> • <a href="./AGENTS.md">Agent Guidelines</a>

Status

nixie is in Phase 2, Research, and has no product code. The work runs in 4 phases: brainstorm, research, design, and decide. Decisions are recorded as research settles each question.

Checks

bun install
bun run check        # format, lint, and the prose check

Layout

  • docs/ holds the overview, the principles, the scope, the decision records, and the designs for what is not built yet. Start with the overview.
  • spikes/ holds throwaway experiments that answer research questions.
Source 1 files
hooks/register.js 16 lines
1function handleToolCall() {
2  throw new Error('nixie-throw-hook-catch: hook failed');
3}
4
5function handleFailure($, e, next) {
6  return {
7    deny: `nixie policy failed (${next.error.kind}: ${next.error.message}), so the command did not run.`,
8  };
9}
10
11export function register(on) {
12  // `.catch` here is the mods API's error handler on a registration, not a promise method.
13  // oxlint-disable-next-line promise/prefer-await-to-then
14  on('tool.call', { tool: 'Bash' }, handleToolCall).catch(handleFailure);
15}
16