hex-audit 0.5.3 → 0.5.5

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.
Files changed (102) hide show
  1. package/README.md +22 -1
  2. package/dashboard/.next/BUILD_ID +1 -1
  3. package/dashboard/.next/app-build-manifest.json +30 -22
  4. package/dashboard/.next/app-path-routes-manifest.json +1 -1
  5. package/dashboard/.next/build-manifest.json +4 -4
  6. package/dashboard/.next/next-server.js.nft.json +1 -1
  7. package/dashboard/.next/prerender-manifest.js +1 -1
  8. package/dashboard/.next/prerender-manifest.json +1 -1
  9. package/dashboard/.next/required-server-files.json +1 -1
  10. package/dashboard/.next/routes-manifest.json +1 -1
  11. package/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/dashboard/.next/server/app/_not-found.html +1 -1
  13. package/dashboard/.next/server/app/_not-found.rsc +4 -4
  14. package/dashboard/.next/server/app/access/page_client-reference-manifest.js +1 -1
  15. package/dashboard/.next/server/app/api/notes/done/route.js +1 -0
  16. package/dashboard/.next/server/app/api/notes/done/route.js.nft.json +1 -0
  17. package/dashboard/.next/server/app/api/notes/lead/route.js +1 -0
  18. package/dashboard/.next/server/app/api/notes/lead/route.js.nft.json +1 -0
  19. package/dashboard/.next/server/app/api/notes/question/route.js +1 -0
  20. package/dashboard/.next/server/app/api/notes/question/route.js.nft.json +1 -0
  21. package/dashboard/.next/server/app/api/notes/record/route.js +9 -0
  22. package/dashboard/.next/server/app/api/notes/record/route.js.nft.json +1 -0
  23. package/dashboard/.next/server/app/api/notes/route.js +3 -0
  24. package/dashboard/.next/server/app/api/notes/route.js.nft.json +1 -0
  25. package/dashboard/.next/server/app/api/progress/route.js +1 -1
  26. package/dashboard/.next/server/app/calls/page_client-reference-manifest.js +1 -1
  27. package/dashboard/.next/server/app/conformance/page_client-reference-manifest.js +1 -1
  28. package/dashboard/.next/server/app/diagram/page_client-reference-manifest.js +1 -1
  29. package/dashboard/.next/server/app/diagram.html +1 -1
  30. package/dashboard/.next/server/app/diagram.rsc +4 -4
  31. package/dashboard/.next/server/app/flows/page_client-reference-manifest.js +1 -1
  32. package/dashboard/.next/server/app/flows.html +1 -1
  33. package/dashboard/.next/server/app/flows.rsc +4 -4
  34. package/dashboard/.next/server/app/functions/page_client-reference-manifest.js +1 -1
  35. package/dashboard/.next/server/app/issues/page.js +4 -4
  36. package/dashboard/.next/server/app/issues/page_client-reference-manifest.js +1 -1
  37. package/dashboard/.next/server/app/notes/page.js +22 -0
  38. package/dashboard/.next/server/app/notes/page.js.nft.json +1 -0
  39. package/dashboard/.next/server/app/notes/page_client-reference-manifest.js +1 -0
  40. package/dashboard/.next/server/app/overleaf/page_client-reference-manifest.js +1 -1
  41. package/dashboard/.next/server/app/page.js +2 -2
  42. package/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  43. package/dashboard/.next/server/app/progress/page.js +1 -1
  44. package/dashboard/.next/server/app/progress/page_client-reference-manifest.js +1 -1
  45. package/dashboard/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  46. package/dashboard/.next/server/app-paths-manifest.json +15 -9
  47. package/dashboard/.next/server/chunks/530.js +1 -1
  48. package/dashboard/.next/server/chunks/622.js +3 -0
  49. package/dashboard/.next/server/functions-config-manifest.json +1 -1
  50. package/dashboard/.next/server/middleware-build-manifest.js +1 -1
  51. package/dashboard/.next/server/pages/404.html +1 -1
  52. package/dashboard/.next/server/pages/500.html +1 -1
  53. package/dashboard/.next/server/server-reference-manifest.js +1 -1
  54. package/dashboard/.next/server/server-reference-manifest.json +1 -1
  55. package/dashboard/.next/static/chunks/app/issues/{page-abb062e4cf118340.js → page-72089090c04e96ee.js} +1 -1
  56. package/dashboard/.next/static/chunks/app/{layout-2c5383c11b1fbd97.js → layout-a95b696089e278c3.js} +1 -1
  57. package/dashboard/.next/static/chunks/app/notes/page-17af94c67ba79c00.js +1 -0
  58. package/dashboard/.next/static/chunks/app/page-24bac51dfe007c66.js +1 -0
  59. package/dashboard/.next/static/chunks/app/progress/page-427fb18da3afb061.js +1 -0
  60. package/dashboard/.next/static/chunks/{main-8f1e837090aef5cf.js → main-9a811c95265dbd11.js} +1 -1
  61. package/dashboard/.next/static/css/4a38d8f6f6b7a68f.css +3 -0
  62. package/dashboard/app/api/notes/done/route.ts +26 -0
  63. package/dashboard/app/api/notes/lead/route.ts +40 -0
  64. package/dashboard/app/api/notes/question/route.ts +30 -0
  65. package/dashboard/app/api/notes/record/route.ts +60 -0
  66. package/dashboard/app/api/notes/route.ts +25 -0
  67. package/dashboard/app/notes/NotesClient.tsx +701 -0
  68. package/dashboard/app/notes/page.tsx +47 -0
  69. package/dashboard/app/progress/ProgressClient.tsx +29 -8
  70. package/dashboard/app/progress/page.tsx +2 -0
  71. package/dashboard/components/DashboardLayout.tsx +22 -1
  72. package/dashboard/components/MarkdownRenderer.tsx +31 -0
  73. package/dashboard/next.config.mjs +11 -0
  74. package/dashboard/whisper-server.py +85 -0
  75. package/dist/commands/dashboard.d.ts.map +1 -1
  76. package/dist/commands/dashboard.js +23 -1
  77. package/dist/commands/dashboard.js.map +1 -1
  78. package/dist/commands/note.d.ts.map +1 -1
  79. package/dist/commands/note.js +55 -2
  80. package/dist/commands/note.js.map +1 -1
  81. package/dist/core/notes.d.ts +68 -0
  82. package/dist/core/notes.d.ts.map +1 -1
  83. package/dist/core/notes.js +167 -0
  84. package/dist/core/notes.js.map +1 -1
  85. package/dist/core/review.d.ts +14 -0
  86. package/dist/core/review.d.ts.map +1 -0
  87. package/dist/core/review.js +80 -0
  88. package/dist/core/review.js.map +1 -0
  89. package/dist/core/whisper.d.ts +8 -0
  90. package/dist/core/whisper.d.ts.map +1 -1
  91. package/dist/core/whisper.js +55 -0
  92. package/dist/core/whisper.js.map +1 -1
  93. package/dist/index.js +2 -0
  94. package/dist/index.js.map +1 -1
  95. package/dist/skills/diane.md +65 -36
  96. package/dist/skills/ingest-aa-report.md +4 -4
  97. package/package.json +2 -1
  98. package/dashboard/.next/static/chunks/app/page-1226422e170d8895.js +0 -1
  99. package/dashboard/.next/static/chunks/app/progress/page-f07ac39d1d27b480.js +0 -1
  100. package/dashboard/.next/static/css/691f4e9edab008c8.css +0 -3
  101. /package/dashboard/.next/static/{8MjKGPuSZw4OIpcHY4G0W → ZvCvC4cMbL3GR8kloB9OJ}/_buildManifest.js +0 -0
  102. /package/dashboard/.next/static/{8MjKGPuSZw4OIpcHY4G0W → ZvCvC4cMbL3GR8kloB9OJ}/_ssgManifest.js +0 -0
@@ -157,4 +157,171 @@ export function createSession(outputDir, opts) {
157
157
  writeTextAtomic(path.join(notesDir(outputDir), rel), header + opts.transcript.trim() + '\n');
158
158
  return addSession(outputDir, { file: rel, contract: opts.contract, ts: opts.ts, audio: opts.audio });
159
159
  }
160
+ function contractNotePath(outputDir, contract) {
161
+ return path.join(notesDir(outputDir), 'contracts', safeName(contract) + '.json');
162
+ }
163
+ function emptyContractNote(contract) {
164
+ return {
165
+ contract,
166
+ marked_done: false,
167
+ description: { purpose: [], inheritance: [], storage: [], roles: [], functions: [] },
168
+ questions: [],
169
+ leads: [],
170
+ updated_at: new Date().toISOString(),
171
+ };
172
+ }
173
+ function asArray(v) {
174
+ return Array.isArray(v) ? v : [];
175
+ }
176
+ /** Read a contract's structured note, returning an empty skeleton if absent. */
177
+ export function readContractNote(outputDir, contract) {
178
+ const raw = readText(contractNotePath(outputDir, contract));
179
+ if (!raw)
180
+ return emptyContractNote(contract);
181
+ try {
182
+ const p = JSON.parse(raw);
183
+ const d = (p.description ?? {});
184
+ return {
185
+ contract: p.contract ?? contract,
186
+ file: p.file,
187
+ marked_done: Boolean(p.marked_done),
188
+ description: {
189
+ purpose: asArray(d.purpose),
190
+ inheritance: asArray(d.inheritance),
191
+ storage: asArray(d.storage),
192
+ roles: asArray(d.roles),
193
+ functions: asArray(d.functions).map((f) => ({
194
+ id: f.id ?? fnId(f.sig ?? ''),
195
+ sig: f.sig ?? '',
196
+ purpose: f.purpose,
197
+ access: f.access,
198
+ effects: f.effects,
199
+ notes: asArray(f.notes),
200
+ warnings: asArray(f.warnings),
201
+ })),
202
+ },
203
+ questions: asArray(p.questions),
204
+ leads: asArray(p.leads),
205
+ updated_at: p.updated_at ?? new Date().toISOString(),
206
+ };
207
+ }
208
+ catch {
209
+ return emptyContractNote(contract);
210
+ }
211
+ }
212
+ /** Write a contract's structured note (stamps updated_at; tracks it in the index). */
213
+ export function writeContractNote(outputDir, contract, note) {
214
+ const next = { ...note, contract, updated_at: new Date().toISOString() };
215
+ writeTextAtomic(contractNotePath(outputDir, contract), JSON.stringify(next, null, 2) + '\n');
216
+ const index = readNotesIndex(outputDir);
217
+ trackContract(index, contract);
218
+ writeNotesIndex(outputDir, index);
219
+ }
220
+ // ─── ID helpers ─────────────────────────────────────────────────────
221
+ function nextNumId(prefix, items) {
222
+ let max = 0;
223
+ for (const it of items) {
224
+ const m = new RegExp(`^${prefix}(\\d+)$`).exec(it.id);
225
+ if (m)
226
+ max = Math.max(max, parseInt(m[1], 10));
227
+ }
228
+ return `${prefix}${max + 1}`;
229
+ }
230
+ function fnId(sig) {
231
+ const name = (sig.split('(')[0] ?? sig).trim() || sig;
232
+ return name.replace(/[^\w]+/g, '_') || 'fn';
233
+ }
234
+ // ─── Granular mutators (used by the dashboard API + CLI) ────────────
235
+ export function setMarkedDone(outputDir, contract, done) {
236
+ const note = readContractNote(outputDir, contract);
237
+ note.marked_done = done;
238
+ writeContractNote(outputDir, contract, note);
239
+ return note;
240
+ }
241
+ export function addLead(outputDir, contract, text) {
242
+ const note = readContractNote(outputDir, contract);
243
+ const lead = { id: nextNumId('L', note.leads), text, status: 'open' };
244
+ note.leads.push(lead);
245
+ writeContractNote(outputDir, contract, note);
246
+ return lead;
247
+ }
248
+ /** Close a lead as promoted-to-finding (`logged`, with ref) or `dismissed`. */
249
+ export function closeLead(outputDir, contract, id, status, ref) {
250
+ const note = readContractNote(outputDir, contract);
251
+ const lead = note.leads.find((l) => l.id === id);
252
+ if (!lead)
253
+ throw new Error(`No lead ${id} on ${contract}`);
254
+ lead.status = status;
255
+ if (ref)
256
+ lead.ref = ref;
257
+ writeContractNote(outputDir, contract, note);
258
+ return note;
259
+ }
260
+ export function reopenLead(outputDir, contract, id) {
261
+ const note = readContractNote(outputDir, contract);
262
+ const lead = note.leads.find((l) => l.id === id);
263
+ if (!lead)
264
+ throw new Error(`No lead ${id} on ${contract}`);
265
+ lead.status = 'open';
266
+ delete lead.ref;
267
+ writeContractNote(outputDir, contract, note);
268
+ return note;
269
+ }
270
+ export function addQuestion(outputDir, contract, q, answer) {
271
+ const note = readContractNote(outputDir, contract);
272
+ const question = { id: nextNumId('Q', note.questions), q, ...(answer ? { answer } : {}) };
273
+ note.questions.push(question);
274
+ writeContractNote(outputDir, contract, note);
275
+ return question;
276
+ }
277
+ export function answerQuestion(outputDir, contract, id, answer) {
278
+ const note = readContractNote(outputDir, contract);
279
+ const question = note.questions.find((x) => x.id === id);
280
+ if (!question)
281
+ throw new Error(`No question ${id} on ${contract}`);
282
+ question.answer = answer;
283
+ writeContractNote(outputDir, contract, note);
284
+ return note;
285
+ }
286
+ /** Insert or refine a function entry, matched by signature. Preserves source order. */
287
+ export function upsertFunction(outputDir, contract, fn) {
288
+ const note = readContractNote(outputDir, contract);
289
+ const existing = note.description.functions.find((f) => f.sig === fn.sig);
290
+ if (existing) {
291
+ Object.assign(existing, {
292
+ ...fn,
293
+ notes: fn.notes ?? existing.notes,
294
+ warnings: fn.warnings ?? existing.warnings,
295
+ });
296
+ }
297
+ else {
298
+ note.description.functions.push({
299
+ id: fnId(fn.sig),
300
+ sig: fn.sig,
301
+ purpose: fn.purpose,
302
+ access: fn.access,
303
+ effects: fn.effects,
304
+ notes: fn.notes ?? [],
305
+ warnings: fn.warnings ?? [],
306
+ });
307
+ }
308
+ writeContractNote(outputDir, contract, note);
309
+ return note;
310
+ }
311
+ export function setDescriptionField(outputDir, contract, field, values) {
312
+ const note = readContractNote(outputDir, contract);
313
+ note.description[field] = values;
314
+ writeContractNote(outputDir, contract, note);
315
+ return note;
316
+ }
317
+ /** reviewed = marked_done AND no open leads AND no unanswered questions. */
318
+ export function reviewState(note) {
319
+ const openLeads = note.leads.filter((l) => l.status === 'open').length;
320
+ const unansweredQuestions = note.questions.filter((q) => !q.answer || !q.answer.trim()).length;
321
+ return {
322
+ openLeads,
323
+ unansweredQuestions,
324
+ reviewed: note.marked_done && openLeads === 0 && unansweredQuestions === 0,
325
+ };
326
+ }
160
327
  //# sourceMappingURL=notes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notes.js","sourceRoot":"","sources":["../../src/core/notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAwB7B,MAAM,WAAW,GAAe,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAEvF,uEAAuE;AAEvE,SAAS,QAAQ,CAAC,SAAiB;IACjC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,iEAAiE;AACjE,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACnD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,SAAiB,EAAE,MAAc;IACxD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9E,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;AAC/E,CAAC;AAED,uEAAuE;AAEvE,SAAS,QAAQ,CAAC,IAAY;I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AAE,QAAQ,CAAC,CAAC;IACnD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;IACjC,iBAAiB,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC;AAUD,4EAA4E;AAC5E,MAAM,UAAU,WAAW,CAAC,IAAkB;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IAC/F,OAAO;QACL,SAAS;QACT,mBAAmB;QACnB,QAAQ,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS,KAAK,CAAC,IAAI,mBAAmB,KAAK,CAAC;KAC3E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface ProgressData {
2
+ updated_at: string;
3
+ reviewed_contracts: Record<string, boolean>;
4
+ diane_reviewed?: Record<string, boolean>;
5
+ }
6
+ export declare function readProgress(outputDir: string): ProgressData;
7
+ export declare function writeProgress(outputDir: string, data: ProgressData): void;
8
+ /**
9
+ * Recompute a contract's derived "reviewed" flag from its Diane note and store
10
+ * it in progress.json. Call after any note mutation (lead close, answer,
11
+ * mark-done, or a whole-doc `hex note set`).
12
+ */
13
+ export declare function recomputeReview(outputDir: string, contract: string): boolean;
14
+ //# sourceMappingURL=review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/core/review.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAMD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAW5D;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAMzE;AA0BD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQ5E"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Audit-review state in `<output_dir>/progress.json`, shared by the dashboard
3
+ * `/progress` page + `/api/progress` route, the dashboard's notes mutators, and
4
+ * the `hex note` CLI. Like src/core/notes.ts / issues.ts this depends ONLY on
5
+ * node:fs / node:path so the dashboard can import it via `externalDir`.
6
+ * (Named `review` to avoid colliding with src/core/progress.ts, which is the
7
+ * unrelated CLI ProgressTracker.)
8
+ *
9
+ * Two parallel maps keyed by `"<file>::<ContractName>"` (the same key the
10
+ * Contract Checklist uses):
11
+ * - reviewed_contracts: manual checkbox state (auditor toggles on /progress)
12
+ * - diane_reviewed: derived from Diane notes (marked_done + no open leads
13
+ * + no unanswered questions). Kept separate so it never
14
+ * clobbers a manual check; the checklist shows a row as
15
+ * reviewed when either is true.
16
+ */
17
+ import fs from 'node:fs';
18
+ import path from 'node:path';
19
+ import { readContractNote, reviewState } from './notes.js';
20
+ function progressPath(outputDir) {
21
+ return path.join(outputDir, 'progress.json');
22
+ }
23
+ export function readProgress(outputDir) {
24
+ try {
25
+ const raw = JSON.parse(fs.readFileSync(progressPath(outputDir), 'utf-8'));
26
+ return {
27
+ updated_at: raw.updated_at ?? new Date().toISOString(),
28
+ reviewed_contracts: raw.reviewed_contracts ?? {},
29
+ diane_reviewed: raw.diane_reviewed ?? {},
30
+ };
31
+ }
32
+ catch {
33
+ return { updated_at: new Date().toISOString(), reviewed_contracts: {}, diane_reviewed: {} };
34
+ }
35
+ }
36
+ export function writeProgress(outputDir, data) {
37
+ const next = { ...data, updated_at: new Date().toISOString() };
38
+ const file = progressPath(outputDir);
39
+ const tmp = file + '.tmp';
40
+ fs.writeFileSync(tmp, JSON.stringify(next, null, 2) + '\n', 'utf-8');
41
+ fs.renameSync(tmp, file);
42
+ }
43
+ /**
44
+ * Resolve a Diane note's contract name to the `"<file>::<ContractName>"` key
45
+ * the Contract Checklist uses, by matching against stats.json's per_contract.
46
+ * Falls back to the note's own contract string if no stats match is found.
47
+ */
48
+ function resolveContractKey(outputDir, contract, file) {
49
+ const bare = contract.replace(/\.sol$/i, '');
50
+ try {
51
+ const stats = JSON.parse(fs.readFileSync(path.join(outputDir, 'stats.json'), 'utf-8'));
52
+ const per = stats.per_contract ?? [];
53
+ // Prefer an exact contract-name match; only then fall back to filename
54
+ // (a file like Vault.sol can hold several contracts, e.g. an interface).
55
+ const byName = per.find((c) => c.contract === contract || c.contract === bare);
56
+ const byFile = per.find((c) => path.basename(c.file).replace(/\.sol$/i, '') === bare);
57
+ const match = byName ?? byFile;
58
+ if (match)
59
+ return `${match.file}::${match.contract}`;
60
+ }
61
+ catch {
62
+ /* no stats.json — fall through */
63
+ }
64
+ return file ? `${file}::${bare}` : `${contract}::${bare}`;
65
+ }
66
+ /**
67
+ * Recompute a contract's derived "reviewed" flag from its Diane note and store
68
+ * it in progress.json. Call after any note mutation (lead close, answer,
69
+ * mark-done, or a whole-doc `hex note set`).
70
+ */
71
+ export function recomputeReview(outputDir, contract) {
72
+ const note = readContractNote(outputDir, contract);
73
+ const reviewed = reviewState(note).reviewed;
74
+ const key = resolveContractKey(outputDir, contract, note.file);
75
+ const data = readProgress(outputDir);
76
+ data.diane_reviewed = { ...(data.diane_reviewed ?? {}), [key]: reviewed };
77
+ writeProgress(outputDir, data);
78
+ return reviewed;
79
+ }
80
+ //# sourceMappingURL=review.js.map
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AI,EAAE,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,QAAgB;IACjE,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC5C,MAAM,GAAG,GAAG,kBAAkB,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,CAAC,cAAc,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1E,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -21,4 +21,12 @@ export declare function detectWhisper(): WhisperEngine | null;
21
21
  * engine is installed; the caller keeps the raw audio and surfaces the hint.
22
22
  */
23
23
  export declare function transcribe(audioPath: string): string;
24
+ /** The warm Whisper server's base URL, if `hex dashboard` started one. */
25
+ export declare function whisperServerUrl(): string | null;
26
+ /**
27
+ * Transcribe via the warm server (model already loaded, no per-request reload):
28
+ * ffmpeg-convert to 16 kHz wav, POST the bytes to `<url>/transcribe`. Throws on
29
+ * transport or engine error.
30
+ */
31
+ export declare function transcribeViaServer(audioPath: string, url: string): Promise<string>;
24
32
  //# sourceMappingURL=whisper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"whisper.d.ts","sourceRoot":"","sources":["../../src/core/whisper.ts"],"names":[],"mappings":"AAmBA;wEACwE;AACxE,qBAAa,mBAAoB,SAAQ,KAAK;;CAU7C;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBhD,yCAAyC;AACzC,wBAAgB,aAAa,IAAI,aAAa,GAAG,IAAI,CAUpD;AA0BD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAoCpD"}
1
+ {"version":3,"file":"whisper.d.ts","sourceRoot":"","sources":["../../src/core/whisper.ts"],"names":[],"mappings":"AAoBA;wEACwE;AACxE,qBAAa,mBAAoB,SAAQ,KAAK;;CAU7C;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBhD,yCAAyC;AACzC,wBAAgB,aAAa,IAAI,aAAa,GAAG,IAAI,CAUpD;AA0BD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAoCpD;AASD,0EAA0E;AAC1E,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCnF"}
@@ -14,6 +14,7 @@
14
14
  */
15
15
  import { execFileSync } from 'node:child_process';
16
16
  import fs from 'node:fs';
17
+ import http from 'node:http';
17
18
  import os from 'node:os';
18
19
  import path from 'node:path';
19
20
  /** Thrown when no local Whisper engine is installed. The caller turns this into
@@ -121,4 +122,58 @@ export function transcribe(audioPath) {
121
122
  }
122
123
  }
123
124
  }
125
+ // ─── Warm Whisper server (started by `hex dashboard`) ───────────────
126
+ //
127
+ // `hex dashboard` spawns a persistent helper (dashboard/whisper-server.py) that
128
+ // loads the model once and serves POST /transcribe, then passes HEX_WHISPER_URL
129
+ // to the dashboard. This avoids reloading the model on every recording and
130
+ // frees it the moment the dashboard exits.
131
+ /** The warm Whisper server's base URL, if `hex dashboard` started one. */
132
+ export function whisperServerUrl() {
133
+ return process.env.HEX_WHISPER_URL || null;
134
+ }
135
+ /**
136
+ * Transcribe via the warm server (model already loaded, no per-request reload):
137
+ * ffmpeg-convert to 16 kHz wav, POST the bytes to `<url>/transcribe`. Throws on
138
+ * transport or engine error.
139
+ */
140
+ export function transcribeViaServer(audioPath, url) {
141
+ const wav = toWav(audioPath);
142
+ const body = fs.readFileSync(wav);
143
+ const target = new URL('/transcribe', url);
144
+ return new Promise((resolve, reject) => {
145
+ const req = http.request({
146
+ hostname: target.hostname,
147
+ port: target.port,
148
+ path: target.pathname,
149
+ method: 'POST',
150
+ headers: { 'Content-Type': 'application/octet-stream', 'Content-Length': body.length },
151
+ }, (res) => {
152
+ const chunks = [];
153
+ res.on('data', (c) => chunks.push(c));
154
+ res.on('end', () => {
155
+ try {
156
+ const parsed = JSON.parse(Buffer.concat(chunks).toString('utf-8'));
157
+ if (parsed.error)
158
+ reject(new Error(parsed.error));
159
+ else
160
+ resolve((parsed.text ?? '').trim());
161
+ }
162
+ catch (e) {
163
+ reject(e instanceof Error ? e : new Error(String(e)));
164
+ }
165
+ });
166
+ });
167
+ req.on('error', reject);
168
+ req.write(body);
169
+ req.end();
170
+ }).finally(() => {
171
+ try {
172
+ fs.unlinkSync(wav);
173
+ }
174
+ catch {
175
+ /* best-effort cleanup */
176
+ }
177
+ });
178
+ }
124
179
  //# sourceMappingURL=whisper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"whisper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,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC3C,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxD,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CACF,CAAC;QACF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,GAAG,CAAC,GAAG,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;QACd,IAAI,CAAC;YACH,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,yBAAyB;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ import { doctorCommand } from './commands/doctor.js';
19
19
  import { aiStatusCommand } from './commands/ai-status.js';
20
20
  import { updateCommand } from './commands/update.js';
21
21
  import { issueCommand } from './commands/issue.js';
22
+ import { noteCommand } from './commands/note.js';
22
23
  // Single source of truth for the version: package.json (always shipped at the
23
24
  // package root, one dir up from dist/index.js). Avoids drift between the npm
24
25
  // version and what `hex --version` reports.
@@ -46,5 +47,6 @@ program.addCommand(doctorCommand);
46
47
  program.addCommand(aiStatusCommand);
47
48
  program.addCommand(updateCommand);
48
49
  program.addCommand(issueCommand);
50
+ program.addCommand(noteCommand);
49
51
  program.parse();
50
52
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,O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D,CAAC;KAC/D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACpC,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;AACvC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACxC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AACpC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAEhC,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -1,14 +1,22 @@
1
1
  ---
2
- description: "Diane — your audit recorder. Ingest the latest voice narration into structured per-contract notes, route spoken triggers, and answer questions from the codebase."
2
+ description: "Diane — your audit recorder. Ingest voice narration into a living per-contract profile (Description / Questions / Leads), route spoken triggers, and answer questions from the codebase."
3
3
  ---
4
4
 
5
5
  # Skill: Diane
6
6
 
7
7
  **Recommended model:** Sonnet
8
8
 
9
- You are **Diane**, the auditor's recording companion — the Twin Peaks framing: the auditor is Agent Cooper, narrating their thought process aloud while reading a contract, and you are Diane, who receives the dictation, organizes it into clean notes, and assists. The auditor records narration from the dashboard **Notes** tab (Record button + contract dropdown); the recording is transcribed locally and lands as a *session*. This skill picks up that session and processes it.
9
+ You are **Diane**, the auditor's **pair auditor** — the Twin Peaks framing: the auditor narrates their thought process aloud while reading a contract, and you are Diane, a sharp second set of eyes who organizes their reasoning into a living profile **and audits alongside them**. You don't just record — you read the code, check what they claim, and speak up. The auditor records narration from the dashboard **Notes** tab (Record button + contract dropdown); the recording is transcribed locally and lands as a *session*. This skill picks up that session and processes it.
10
10
 
11
- Persona: attentive, measured, observational. Address the auditor by name occasionally ("Got it, Cooper — logging your read of the withdraw path"). Be concise. Never sycophantic, never narrate your own process at length.
11
+ Persona: attentive, candid, direct. Be concise. Confirm briefly when the auditor is right; push back with `file:line` evidence when they're wrong or have missed something. Never flatter, never challenge without grounds, never narrate your own process at length. **Address the auditor directly and impersonally — never by name.**
12
+
13
+ **Note style — always schematic and concise:**
14
+ - Terse bullets, one idea each — not prose paragraphs.
15
+ - Focus on visual notes as much as on the text.
16
+ - When noting flows or complex processes, break them down into steps: 1..., 2..., 3...
17
+ - Cite `file:line` for anything code-specific.
18
+ - Include a fenced code snippet only when a line or two genuinely clarifies the point. Use sparingly — most notes need none.
19
+ - Answers and challenges follow the same rule: a tight bullet, `file:line`, no preamble.
12
20
 
13
21
  ## Step 1 — Pick up the latest narration
14
22
 
@@ -33,54 +41,75 @@ Read `text` and split it into discrete thoughts. For each, classify it as a **tr
33
41
 
34
42
  When a unit is ambiguous, treat it as a note (the safe default — nothing is lost, and the auditor can re-narrate a real instruction).
35
43
 
36
- ## Step 3 — Route the triggers
44
+ ## Step 3 — Verify & challenge (the pair-audit pass)
37
45
 
38
- **create a finding** → invoke the existing `/write-finding` skill, prefilled from the narration (the affected contract/function and the auditor's stated impact). Let that skill own duplicate-checking and the board write. After it returns, drop a one-line pointer into the contract note (`- Finding logged: <H-NNN> <title>`).
46
+ This is what makes you a pair auditor, not a stenographer. For **every checkable claim** in the narration — how a function behaves, a value, an invariant, "this is safe because…" — open the relevant source (Read / Grep over the project scope) and check it. Classify each:
39
47
 
40
- **answer a question** → answer it yourself using codebase access (Read / Grep over the project scope). Be concrete and cite `file:line`. Then log the exchange into the active contract's note:
48
+ - **Confirmed** → record it as fact in `description` (the function's `notes`, or purpose/storage/roles); don't clutter.
49
+ - **Wrong** → record the **correct** behavior, and add a `⚠` string to that function's `warnings` naming the contradiction + `file:line` (e.g. `⚠ you said rounds down; rounds UP (Vault.sol:88)`).
50
+ - **Incomplete / missed** → add a `leads` entry (e.g. an unchecked return, a missing bound or zero-check, an edge case the auditor walked past), noting they didn't mention it.
51
+ - **Interesting angle** you spot independently → a `leads` entry, phrased as a hypothesis to investigate.
41
52
 
42
- ```
43
- **Q:** <the question, cleaned up>
44
- **A:** <your answer, with file:line references>
45
- ```
53
+ Push back only with concrete, code-grounded evidence — never contrarian for its own sake. If a claim isn't checkable from the code, note it as an assumption rather than asserting it true or false.
46
54
 
47
- **search online** → use WebSearch, read the most relevant result, and summarize it into the active contract's note under a short heading, with the source link. Keep it to what's relevant to the audit.
55
+ ## Step 4 — Route the triggers
48
56
 
49
- ## Step 4 — File everything else as structured notes
57
+ All three edit the same structured record; Step 5 covers the read-merge-write mechanics.
50
58
 
51
- Turn the remaining thought-units into clean, organized notes. **Clean up** filler, repetition, and false starts — preserve the auditor's reasoning, not their disfluency. Organize under these headings (include only the ones that apply):
59
+ **create a finding** → invoke the existing `/write-finding` skill, prefilled from the narration (the affected contract/function and the auditor's stated impact). Let that skill own duplicate-checking and the board write. After it returns, set the matching lead's `status` to `"logged"` and its `ref` to the new `H-NNN` — it leaves the open-leads list but stays in the record (audit trail). If no lead matched, no-op.
52
60
 
53
- ```
54
- ## <ts>
61
+ **answer a question** → answer it yourself using codebase access (Read / Grep over the project scope), or search online for things you're unsure about. Be concrete, concise, and cite `file:line`. Put it in `questions[]`: fill the `answer` of the matching open question if one exists, else add `{ q, answer }`.
55
62
 
56
- ### Observations
57
- - …
63
+ **search online** → use WebSearch, read the most relevant result, and fold it where it belongs — a question's `answer`, a `description` field, or a `leads` entry — with the source link.
58
64
 
59
- ### Questions
60
- - … (open questions the auditor raised but didn't ask you to answer)
65
+ ## Step 5 — Update the contract profile
61
66
 
62
- ### Risks
63
- - … (suspected issues not yet ready to be findings)
67
+ A contract's notes are a **structured record** you grow over time — not per-session blocks. Each run: read the current record, merge this session **and your Step 3 verification** into it, write it back. Clean up filler/repetition; keep the reasoning, not the disfluency.
64
68
 
65
- ### TODO
66
- - …
69
+ The record (JSON):
70
+
71
+ ```json
72
+ {
73
+ "contract": "Vault.sol",
74
+ "marked_done": false,
75
+ "description": {
76
+ "purpose": ["ERC-4626-ish vault"],
77
+ "inheritance": ["..."],
78
+ "storage": ["`totalAssets` (uint256) — managed balance"],
79
+ "roles": ["`onlyOwner` — gates setFee / setOwner"],
80
+ "functions": [
81
+ {
82
+ "sig": "deposit(assets, receiver) — external",
83
+ "purpose": "pull assets, mint shares",
84
+ "access": "anyone",
85
+ "effects": "transferFrom → _mint → totalAssets +=",
86
+ "notes": ["pulls before state update"],
87
+ "warnings": ["⚠ you said rounds down; rounds UP (Vault.sol:88)"]
88
+ }
89
+ ]
90
+ },
91
+ "questions": [
92
+ { "id": "Q1", "q": "is uint8 enough for decimals?", "answer": "yes, 0–255 (MockToken.sol:9)" }
93
+ ],
94
+ "leads": [
95
+ { "id": "L1", "text": "setFee has no upper bound (Vault.sol:120) — you didn't mention it", "status": "open" }
96
+ ]
97
+ }
67
98
  ```
68
99
 
69
- Write to the active contract's doc (cross-cutting remarks go to `general`). Use a temp file to preserve newlines, then append:
100
+ - **description** = how the contract works (verified truth), top-to-bottom: `purpose`, `inheritance`, `storage`, `roles`, then `functions` in **source order** (each with Purpose / Access / Effects + `notes`). Step-3 corrections go in that function's `warnings`, with `file:line`.
101
+ - **questions** = your Q&A; an entry with no `answer` is still open.
102
+ - **leads** = things worth investigating (the Step-3 misses/angles). Only `status:"open"` leads show in the dashboard; `logged` (→ finding) and `dismissed` are kept but hidden.
70
103
 
71
- ```bash
72
- cat > /tmp/diane_<ts>.md <<'EOF'
73
- ## <ts>
104
+ Merge mechanics — read the record, edit JSON, write it back:
74
105
 
75
- ### Observations
76
- - ...
77
- EOF
78
- npx hex note append "<contract>" --body-file /tmp/diane_<ts>.md
79
- ```
106
+ 1. `npx hex note show "<contract>" > /tmp/diane_<ts>.json` — prints an empty skeleton on first run.
107
+ 2. Edit `/tmp/diane_<ts>.json`: add or refine entries where they belong (fill a storage row, flesh out a function, set a question's `answer`, add a lead, attach a `warning`). **Preserve existing `id`s, don't duplicate** — sharpen what's there. Keep arrays concise.
108
+ 3. `npx hex note set "<contract>" --json-file /tmp/diane_<ts>.json` (this also recomputes the `/progress` review state).
80
109
 
81
- `<contract>` is the session's `contract` value verbatim (e.g. `Vault.sol`). Q&A blocks and search summaries from Step 3 can be appended in the same block under their own subheadings.
110
+ `<contract>` is the session's `contract` value verbatim (e.g. `Vault.sol`). Cross-cutting remarks still go to the free-form `general` markdown note: `npx hex note append general --body-file …` (`general` isn't structured). If the auditor says they're done with a contract, run `npx hex note done "<contract>"`.
82
111
 
83
- ## Step 5 — Close the loop
112
+ ## Step 6 — Close the loop & deliver the verdict
84
113
 
85
114
  Mark the session processed so it isn't ingested again:
86
115
 
@@ -88,9 +117,9 @@ Mark the session processed so it isn't ingested again:
88
117
  npx hex note session mark-processed "<file>"
89
118
  ```
90
119
 
91
- Then report a one-line summary, Diane-style: what you filed, any findings created, any questions answered. Example:
120
+ Then deliver a candid **pair-audit verdict** — lead with the substance (corrections, misses, what holds up), then the housekeeping. Cite `file:line`. Don't manufacture pushback when the narration is sound — confirming is a valid verdict. Address the auditor directly, never by name. Example:
92
121
 
93
- > "Filed 4 observations and 2 risks on Vault.sol, answered your question about `_convertToShares` rounding (it rounds down — see Vault.sol:142), and logged finding H-007. Marked the session processed."
122
+ > "Two corrections: previewWithdraw rounds **up**, not down (Vault.sol:88); and `setFee` has no upper bound (Vault.sol:120), which you didn't flag — added as a lead. Your reentrancy read on `deposit` checks out. Profile updated, session marked processed."
94
123
 
95
124
  ## Notes
96
125
 
@@ -43,15 +43,15 @@ Never invoke `aa scan` to start a new scan. If the auditor has no scan ID, instr
43
43
 
44
44
  ## Step 3 — Fetch findings
45
45
 
46
- Run:
46
+ Export the full findings for the linked scan:
47
47
 
48
48
  ```bash
49
- aa scan --report <scan_id>
49
+ aa findings --all
50
50
  ```
51
51
 
52
- (Or the equivalent results-fetch command exposed by the installed `aa` version — check `aa scan --help` if `--report` is not supported.)
52
+ `aa findings --all` writes the full findings (with details) to `auditagent/findings-<scan_id>.md`. If the scan isn't linked yet, run `aa link <scan_id>` first, then re-run `aa findings --all`. (`aa findings` without `--all` only prints summaries; **do not** use `aa scan --report` — that subcommand does not exist.)
53
53
 
54
- Capture the raw output to `<output_dir>/ai-results/auditagent/raw-output.md`.
54
+ Copy the exported `auditagent/findings-<scan_id>.md` to `<output_dir>/ai-results/auditagent/raw-output.md` and parse it from there.
55
55
 
56
56
  ## Step 4 — Normalize into findings.json
57
57