repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

chore(hygiene): remove tracked scratch artifacts

4ff4214bedbf820fc561120d45c3b3e40366c446

HallucyGenie Agent <agent@hallucygenie.local> ·

SSH signature · not checked

Browse filesCompare with HEAD

Changed files (1)

+0 / −80 text lines

Diff layout

tmp/audit_check.py

Deleted
deleted file mode 100644

+0 / −80 text lines

1import json
2
3issues = []
4
5# SM-004 issues
6issues.append({
7 "id": "AUDIT-001",
8 "severity": "P1",
9 "file": "docs/spec-sm-004-architecture.md",
10 "line": "181",
11 "issue": "SM-004 defines struct SessionEntry { type_: String, id: String, timestamp: u64, payload: Vec<u8> } which contradicts SM-006's pub enum SessionEntry with variants like Session, User, Assistant, etc.",
12 "evidence": "Line 181: struct SessionEntry vs SM-006 line 249: pub enum SessionEntry"
13})
15issues.append({
16 "id": "AUDIT-002",
17 "severity": "P1",
18 "file": "docs/spec-sm-004-architecture.md",
19 "line": "230",
20 "issue": "SM-004 uses enum variant syntax SessionEntry::Session { version, .. } on a struct defined at line 181. Self-contradictory.",
21 "evidence": "Line 230: match e { SessionEntry::Session { version, .. } => ... } but line 181 defines struct SessionEntry, not enum"
22})
24# SM-009 issues
25issues.append({
26 "id": "AUDIT-003",
27 "severity": "P2",
28 "file": "docs/spec-sm-009-harness.md",
29 "line": "164",
30 "issue": "dispatch_event only handles PluginEvent::ToolCall and silently ignores all other PluginEvent variants. Non-tool event handlers never fire.",
31 "evidence": "Lines 164-170: only 'if let PluginEvent::ToolCall { ... } = event' branch exists; no else branch or other event dispatching"
32})
34issues.append({
35 "id": "AUDIT-004",
36 "severity": "P2",
37 "file": "docs/spec-sm-009-harness.md",
38 "line": "142",
39 "issue": "agent_event_to_plugin_event has incomplete match arms with '// ... etc' comment. Mapping undefined for AgentEnd, TurnEnd, MessageUpdate, MessageEnd, ToolExecutionEnd, ToolExecutionUpdate, TextDelta, ThinkingDelta, Error.",
40 "evidence": "Line 150: '// ... etc' instead of exhaustive match arms for all AgentEvent variants"
41})
43issues.append({
44 "id": "AUDIT-005",
45 "severity": "P2",
46 "file": "docs/spec-sm-009-harness.md",
47 "line": "118",
48 "issue": "PluginEvent enum missing ToolExecutionUpdate variant to correspond with AgentEvent::ToolExecutionUpdate from SM-006.",
49 "evidence": "PluginEvent variants listed at line 118: AgentStart, AgentEnd, TurnStart, TurnEnd, MessageStart, MessageUpdate, MessageEnd, ToolExecutionStart, ToolExecutionEnd, ToolCall, TextDelta, ThinkingDelta, Error — no ToolExecutionUpdate"
50})
52issues.append({
53 "id": "AUDIT-006",
54 "severity": "P2",
55 "file": "docs/spec-sm-009-harness.md",
56 "line": "167",
57 "issue": "dispatch_event passes only tool_call_id and tool_name to Lua handlers, not the input args. Plugins cannot inspect tool arguments to make informed blocking decisions.",
58 "evidence": "Line 167: lua.call_function(handler.clone(), (tool_call_id, tool_name)) — missing input/args parameter"
59})
61# SM-008 issues
62issues.append({
63 "id": "AUDIT-007",
64 "severity": "P2",
65 "file": "docs/spec-sm-008-tui.md",
66 "line": "257",
67 "issue": "dispatch_event calls widget.as_any_mut() but Component trait (line 152) does not define fn as_any_mut. Code will not compile.",
68 "evidence": "Line 257: widget.as_any_mut().downcast_mut::<dyn Focusable>() — Component trait at line 152 has render, handle_event, invalidate only"
69})
71issues.append({
72 "id": "AUDIT-008",
73 "severity": "P3",
74 "file": "docs/spec-sm-009-harness.md",
75 "line": "308",
76 "issue": "Bash security comment says 'If any event handler returns Block' which is vague. Lua handlers don't return a 'Block' value; they error via mlua::Error which gets converted to BlockReason::BlockedByPlugin.",
77 "evidence": "Line 308: 'returns Block' vs actual mechanism at line 169: Err(BlockReason::BlockedByPlugin(e.to_string()))"
78})
80print(json.dumps({"issues_found": len(issues), "issues": issues}, indent=2))