@herjarsa/omo-meta-governor 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/dist/index.js +16 -16
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -322,6 +322,60 @@ No user action required. All changes are internal or additive:
|
|
|
322
322
|
|
|
323
323
|
All audit findings are now closed. Future work focuses on new features and user-driven feedback.
|
|
324
324
|
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
## v0.17.1 — Audit args fix (patch)
|
|
328
|
+
|
|
329
|
+
v0.17.1 is a single-bug patch release. The fix addresses an issue discovered during v0.17.0 verification:
|
|
330
|
+
|
|
331
|
+
### The bug
|
|
332
|
+
|
|
333
|
+
The `tool.execute.before` hook passed an empty `{}` object as the second argument to `auditToolCall()`. This meant the audit function never saw the tool's args (e.g. file content for write tools) and could never detect:
|
|
334
|
+
|
|
335
|
+
- `@ts-ignore` / `@ts-expect-error` directives
|
|
336
|
+
- `as any` type assertions
|
|
337
|
+
- `catch(e) {}` empty catch blocks
|
|
338
|
+
|
|
339
|
+
The hook signature was also incomplete — it didn't receive the `output` parameter that contains the mutable args, even though the SDK provides it.
|
|
340
|
+
|
|
341
|
+
### The fix
|
|
342
|
+
|
|
343
|
+
Two changes in `src/plugin.ts`:
|
|
344
|
+
|
|
345
|
+
1. **Hook signature updated** to receive the `output` parameter:
|
|
346
|
+
```ts
|
|
347
|
+
"tool.execute.before": async (
|
|
348
|
+
toolInput: { tool: string; sessionID: string; callID: string },
|
|
349
|
+
_output: { args: unknown },
|
|
350
|
+
): Promise<void> => {
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
2. **Audit call** now passes `_output.args` instead of `{}`:
|
|
354
|
+
```ts
|
|
355
|
+
const violations = auditToolCall(toolInput.tool, _output.args, { ... })
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Tests
|
|
359
|
+
|
|
360
|
+
Added 4 new tests in `src/plugin.test.ts`:
|
|
361
|
+
- `@ts-ignore + as any` in args → `no-type-suppression` violation detected and injected
|
|
362
|
+
- `catch(e) {}` in args → `no-empty-catch` violation detected and injected
|
|
363
|
+
- Clean code → no violation injected (false-positive guard)
|
|
364
|
+
- `auditToolCalls: false` → audit short-circuits (regression check)
|
|
365
|
+
|
|
366
|
+
### Test & build status
|
|
367
|
+
|
|
368
|
+
- **518/518 tests pass** (up from 514 in v0.17.0 — 4 new audit tests).
|
|
369
|
+
- `bun run typecheck` clean.
|
|
370
|
+
- `bun build.ts` clean (0.34 MB dist).
|
|
371
|
+
|
|
372
|
+
### Migration
|
|
373
|
+
|
|
374
|
+
No user action required. The audit detection now correctly fires when the agent writes forbidden patterns. This means:
|
|
375
|
+
|
|
376
|
+
- **If your agent previously wrote `@ts-ignore` without being flagged**: it will now be flagged with `[GRAVE] no-type-suppression: ...` injected as a synthetic user message.
|
|
377
|
+
- **If you want to disable the audit**: set `protocolEnforcement.auditToolCalls: false` (already supported).
|
|
378
|
+
|
|
325
379
|
## Auto-upgrade (v0.12.0)
|
|
326
380
|
|
|
327
381
|
On plugin load, queries npm/pip registries to check whether newer versions
|