@eyeauras/insight-cli 0.8.0 → 0.8.2

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 (84) hide show
  1. package/.cli-package-build.json +1 -1
  2. package/SKILL.md +1 -1
  3. package/dist/src/cli.js +2 -0
  4. package/dist/src/contexts.d.ts +2 -1
  5. package/dist/src/contexts.js +22 -9
  6. package/dist/src/research.d.ts +1 -0
  7. package/dist/src/research.js +1 -1
  8. package/dist/src/work/backup.d.ts +66 -0
  9. package/dist/src/work/backup.js +434 -0
  10. package/dist/src/work/commands.d.ts +5 -0
  11. package/dist/src/work/commands.js +277 -0
  12. package/dist/src/work/dashboard.d.ts +12 -0
  13. package/dist/src/work/dashboard.js +103 -0
  14. package/dist/src/work/model.d.ts +131 -0
  15. package/dist/src/work/model.js +124 -0
  16. package/dist/src/work/store.d.ts +368 -0
  17. package/dist/src/work/store.js +1050 -0
  18. package/dist/src/work/timing.d.ts +26 -0
  19. package/dist/src/work/timing.js +80 -0
  20. package/dist/src/workspace.d.ts +2 -0
  21. package/dist/src/workspace.js +13 -1
  22. package/package.json +1 -1
  23. package/references/recovery.md +6 -0
  24. package/references/work-tracking.md +203 -0
  25. package/runtime/toolbox.json +1 -0
  26. package/skill-bundle/insight-artifacts/SKILL.md +1 -1
  27. package/skill-bundle/insight-artifacts/references/recovery.md +6 -0
  28. package/skill-bundle/insight-binary/SKILL.md +1 -1
  29. package/skill-bundle/insight-capture/SKILL.md +1 -1
  30. package/skill-bundle/insight-cli/SKILL.md +1 -1
  31. package/skill-bundle/insight-cli/references/recovery.md +6 -0
  32. package/skill-bundle/insight-die/SKILL.md +1 -1
  33. package/skill-bundle/insight-dnspy/SKILL.md +1 -1
  34. package/skill-bundle/insight-dotnet-dump/SKILL.md +1 -1
  35. package/skill-bundle/insight-dotnet-stack/SKILL.md +1 -1
  36. package/skill-bundle/insight-dotnet-trace/SKILL.md +1 -1
  37. package/skill-bundle/insight-frida/SKILL.md +1 -1
  38. package/skill-bundle/insight-ghidra/SKILL.md +1 -1
  39. package/skill-bundle/insight-ghidra/references/recovery.md +6 -0
  40. package/skill-bundle/insight-ilspy/SKILL.md +1 -1
  41. package/skill-bundle/insight-interop/SKILL.md +1 -1
  42. package/skill-bundle/insight-lldb/SKILL.md +1 -1
  43. package/skill-bundle/insight-llvm/SKILL.md +1 -1
  44. package/skill-bundle/insight-managed-heap/SKILL.md +1 -1
  45. package/skill-bundle/insight-managed-metadata/SKILL.md +1 -1
  46. package/skill-bundle/insight-mitmproxy/SKILL.md +1 -1
  47. package/skill-bundle/insight-overview/SKILL.md +1 -1
  48. package/skill-bundle/insight-procmon/SKILL.md +1 -1
  49. package/skill-bundle/insight-re/SKILL.md +5 -1
  50. package/skill-bundle/insight-re/references/recovery.md +6 -0
  51. package/skill-bundle/insight-re/references/work-tracking.md +203 -0
  52. package/skill-bundle/insight-sevenzip/SKILL.md +1 -1
  53. package/skill-bundle/insight-strace/SKILL.md +1 -1
  54. package/skill-bundle/insight-tshark/SKILL.md +1 -1
  55. package/skill-bundle/insight-windbg/SKILL.md +1 -1
  56. package/skill-bundle/manifest.json +1 -1
  57. package/skills/insight-artifacts/SKILL.md +1 -1
  58. package/skills/insight-artifacts/references/recovery.md +6 -0
  59. package/skills/insight-binary/SKILL.md +1 -1
  60. package/skills/insight-capture/SKILL.md +1 -1
  61. package/skills/insight-die/SKILL.md +1 -1
  62. package/skills/insight-dnspy/SKILL.md +1 -1
  63. package/skills/insight-dotnet-dump/SKILL.md +1 -1
  64. package/skills/insight-dotnet-stack/SKILL.md +1 -1
  65. package/skills/insight-dotnet-trace/SKILL.md +1 -1
  66. package/skills/insight-frida/SKILL.md +1 -1
  67. package/skills/insight-ghidra/SKILL.md +1 -1
  68. package/skills/insight-ghidra/references/recovery.md +6 -0
  69. package/skills/insight-ilspy/SKILL.md +1 -1
  70. package/skills/insight-interop/SKILL.md +1 -1
  71. package/skills/insight-lldb/SKILL.md +1 -1
  72. package/skills/insight-llvm/SKILL.md +1 -1
  73. package/skills/insight-managed-heap/SKILL.md +1 -1
  74. package/skills/insight-managed-metadata/SKILL.md +1 -1
  75. package/skills/insight-mitmproxy/SKILL.md +1 -1
  76. package/skills/insight-overview/SKILL.md +1 -1
  77. package/skills/insight-procmon/SKILL.md +1 -1
  78. package/skills/insight-re/SKILL.md +5 -1
  79. package/skills/insight-re/references/recovery.md +6 -0
  80. package/skills/insight-re/references/work-tracking.md +203 -0
  81. package/skills/insight-sevenzip/SKILL.md +1 -1
  82. package/skills/insight-strace/SKILL.md +1 -1
  83. package/skills/insight-tshark/SKILL.md +1 -1
  84. package/skills/insight-windbg/SKILL.md +1 -1
@@ -0,0 +1,26 @@
1
+ import { type DatabaseSync } from 'node:sqlite';
2
+ export declare function timingReport(db: DatabaseSync, project: string, selected?: string[]): {
3
+ rows: {
4
+ function: string;
5
+ authorTask: string;
6
+ authorStatus: "queued" | "cancelled" | "leased" | "submitted";
7
+ reviewTask: string | null;
8
+ authorMs: number | null;
9
+ waitForCompletedReviewMs: number | null;
10
+ reviewMs: number | null;
11
+ toDecisionMs: number | null;
12
+ approved: boolean | null;
13
+ decisionAt: number | null;
14
+ firstApprovalAt: number | null;
15
+ }[];
16
+ queue: Record<string, import("node:sqlite").SQLOutputValue>[];
17
+ selectedTasks: number;
18
+ batchToDecisionMs: number | null;
19
+ byFunction: {
20
+ [k: string]: {
21
+ firstVerdict: boolean;
22
+ firstDecisionAt: number;
23
+ firstApprovalAt: number | null;
24
+ };
25
+ };
26
+ };
@@ -0,0 +1,80 @@
1
+ import { fail, identifier } from './model.js';
2
+ // Report only the selected reconstruction attempts. A review names a version for
3
+ // each function separately, even when author and reviewer grouped them differently.
4
+ export function timingReport(db, project, selected) {
5
+ if (selected && (!selected.length || selected.length > 100 || new Set(selected).size !== selected.length))
6
+ fail('invalid', 'Select 1 to 100 distinct reconstruction task IDs.');
7
+ const taskQuery = db.prepare('SELECT data FROM tasks WHERE project=? AND id=? AND json_extract(data,\'$.kind\')=\'reconstruct\'');
8
+ const authors = selected ? selected.map(id => {
9
+ const row = taskQuery.get(project, identifier(id));
10
+ if (!row)
11
+ fail('notFound', 'Reconstruction task is absent from this project: ' + id);
12
+ return JSON.parse(String(row.data));
13
+ }) : db.prepare("SELECT data FROM tasks WHERE project=? AND json_extract(data,'$.kind')='reconstruct' ORDER BY rowid DESC LIMIT 10")
14
+ .all(project).reverse().map(row => JSON.parse(String(row.data)));
15
+ const taskEvents = db.prepare(`SELECT kind,json_extract(data,'$.at') AS at FROM events
16
+ WHERE project=? AND json_extract(data,'$.task')=? AND kind IN ('task.claimed','reconstruction.submitted','review.submitted') ORDER BY seq`);
17
+ const clocks = new Map();
18
+ function taskClock(id) {
19
+ const cached = clocks.get(id);
20
+ if (cached)
21
+ return cached;
22
+ const clock = {};
23
+ for (const row of taskEvents.iterate(project, id)) {
24
+ if (row.kind === 'task.claimed') {
25
+ clock.firstClaim ??= Number(row.at);
26
+ clock.claim = Number(row.at);
27
+ }
28
+ else
29
+ clock.submitted = Number(row.at);
30
+ }
31
+ clocks.set(id, clock);
32
+ return clock;
33
+ }
34
+ // Version history identifies the originating request, including comparisons
35
+ // and explicit reopenings between author submission and independent review.
36
+ // Unary + drops the TEXT column affinity without changing the request value;
37
+ // SQLite can then seek both parts of the JSON expression index.
38
+ const history = db.prepare(`SELECT e.kind,json_extract(e.data,'$.task') AS task,
39
+ json_extract(v.data,'$.review.approved') AS approved
40
+ FROM function_versions v CROSS JOIN events e
41
+ WHERE v.project=? AND v.id=? AND v.version>? AND e.project=v.project
42
+ AND json_extract(e.data,'$.request')=+v.request AND e.kind IN ('reconstruction.submitted','review.submitted')
43
+ ORDER BY v.version`);
44
+ function decisions(task, id) {
45
+ const found = [];
46
+ for (const row of history.iterate(project, id, task.versions[id] + 1)) {
47
+ if (row.kind === 'reconstruction.submitted')
48
+ break;
49
+ const reviewTask = String(row.task);
50
+ found.push({ reviewTask, clock: taskClock(reviewTask), approved: row.approved === 1 });
51
+ }
52
+ return found;
53
+ }
54
+ const elapsed = (start, end) => start === undefined || end === undefined ? null : end - start;
55
+ let start, end, complete = true;
56
+ const rows = authors.flatMap(task => task.functions.map(id => {
57
+ const author = taskClock(task.id);
58
+ const history = author.submitted === undefined ? [] : decisions(task, id), verdict = history[0];
59
+ const review = verdict?.clock;
60
+ if (author.firstClaim !== undefined)
61
+ start = Math.min(start ?? Infinity, author.firstClaim);
62
+ if (review?.submitted === undefined)
63
+ complete = false;
64
+ else
65
+ end = Math.max(end ?? -Infinity, review.submitted);
66
+ return { function: id, authorTask: task.id, authorStatus: task.status, reviewTask: verdict?.reviewTask ?? null,
67
+ authorMs: elapsed(author.claim, author.submitted), waitForCompletedReviewMs: elapsed(author.submitted, review?.claim),
68
+ reviewMs: elapsed(review?.claim, review?.submitted), toDecisionMs: elapsed(author.firstClaim, review?.submitted),
69
+ approved: verdict?.approved ?? null, decisionAt: review?.submitted ?? null, firstApprovalAt: history.find(v => v.approved)?.clock.submitted ?? null };
70
+ }));
71
+ const byFunction = new Map();
72
+ for (const row of rows.filter(r => r.decisionAt !== null).sort((a, b) => a.decisionAt - b.decisionAt)) {
73
+ const summary = byFunction.get(row.function) ?? { firstVerdict: row.approved, firstDecisionAt: row.decisionAt, firstApprovalAt: null };
74
+ if (row.firstApprovalAt !== null)
75
+ summary.firstApprovalAt = Math.min(summary.firstApprovalAt ?? Infinity, row.firstApprovalAt);
76
+ byFunction.set(row.function, summary);
77
+ }
78
+ const queue = db.prepare("SELECT json_extract(data,'$.kind') AS kind,status,count(*) AS count FROM tasks WHERE project=? AND status IN ('queued','leased') GROUP BY kind,status ORDER BY kind,status").all(project);
79
+ return { rows, queue, selectedTasks: authors.length, batchToDecisionMs: complete ? elapsed(start, end) : null, byFunction: Object.fromEntries(byFunction) };
80
+ }
@@ -207,6 +207,8 @@ export declare class Workspace {
207
207
  replay: boolean;
208
208
  };
209
209
  administrationByCaller(callerId: string): AdministrationRequest | undefined;
210
+ /** Synchronous metadata snapshot; consumers must not perform remote work in this callback. */
211
+ withAdministrationSnapshot<T>(prefix: string, read: (records: Iterable<AdministrationRequest>) => T): T;
210
212
  requestByCaller(callerId: string): ResearchRequest | undefined;
211
213
  administration(request: string): AdministrationRequest;
212
214
  unresolvedAdministration(): AdministrationRequest[];
@@ -443,6 +443,17 @@ export class Workspace {
443
443
  });
444
444
  }
445
445
  administrationByCaller(callerId) { const row = this.db.prepare('SELECT id FROM administration_requests WHERE caller_id=?').get(id(callerId)); return row ? this.administration(String(row.id)) : undefined; }
446
+ /** Synchronous metadata snapshot; consumers must not perform remote work in this callback. */
447
+ withAdministrationSnapshot(prefix, read) {
448
+ if (!/^[a-z]+\.$/.test(prefix))
449
+ fail('invalid', 'A literal administration namespace is required.');
450
+ return this.transaction(() => {
451
+ const rows = this.db.prepare("SELECT data FROM administration_requests WHERE json_extract(data,'$.operation') LIKE ? ORDER BY id").iterate(prefix + '%');
452
+ function* records() { for (const row of rows)
453
+ yield JSON.parse(String(row.data)); }
454
+ return read(records());
455
+ });
456
+ }
446
457
  requestByCaller(callerId) { const row = this.db.prepare('SELECT id FROM requests WHERE caller_id=?').get(id(callerId)); return row ? this.request(String(row.id)) : undefined; }
447
458
  administration(request) {
448
459
  const row = this.db.prepare('SELECT data FROM administration_requests WHERE id=?').get(id(request));
@@ -643,7 +654,8 @@ export class Workspace {
643
654
  this.knownSnapshot(sharedSnapshot);
644
655
  return this.transaction(() => {
645
656
  const previous = this.publication(publication), context = this.context(previous), request = this.request(previous.request), model = this.model(previous.target);
646
- if (!['commit_intent', 'unknown'].includes(previous.state) || observedRevision <= previous.expectedRevision ||
657
+ // The head equals the expected version when a check-in was sent and created no version.
658
+ if (!['commit_intent', 'unknown'].includes(previous.state) || observedRevision < previous.expectedRevision ||
647
659
  observedRevision < (model.sharedRevision ?? 1) || context.generation !== previous.generation || context.workingSnapshot?.id !== previous.snapshot.id ||
648
660
  context.nativeCheckout?.state !== 'active' || request.context !== context.id || request.operation !== 'ghidra.merge' ||
649
661
  !['running', 'unknown'].includes(request.state))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyeauras/insight-cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "description": "Agent-facing durable sessions and isolated Ghidra research contexts",
6
6
  "main": "./dist/src/index.js",
@@ -13,6 +13,12 @@ it. An empty merge can finish as failed/retained; an already published request k
13
13
  verified result. An unproved release or check-in outcome stays blocked for journal-based
14
14
  recovery. Preserve its project and receipts rather than repeating a mutation with a new ID.
15
15
 
16
+ A check-in that was sent and ended without an answer is settled from its journal and the repository
17
+ history. When the checkout still stands at its base, Ghidra still reports it modified, no check-in is
18
+ active and no version carries the request's marker, nothing was published: repeating the merge with its
19
+ original request ID reports `conflict` with reason `not_published`, the private work stays, and a merge
20
+ with a new request ID publishes it.
21
+
16
22
  If native `changes discard` loses its response, retry its original request ID or continue
17
23
  the same session/target. Recovery requires a completed native discard journal and matching
18
24
  new checkout identity/base, which Ghidra reports unmodified.
@@ -0,0 +1,203 @@
1
+ # Shared RE work ledger
2
+
3
+ Opt in when the project owner asks agents to share reconstruction state. Preserve existing
4
+ evidence. All clients use the same explicit profile and its Factory IPC owner. `work` launches
5
+ neither agents nor native tools. Its profile-owned SQLite is local, never shared over SMB.
6
+
7
+ ```text
8
+ insight-cli -p RE work context --json
9
+ insight-cli -p RE targets add CLIENT.exe --json
10
+ insight-cli -p RE work create --project client --target TARGET --name Client --request-id create-client --json
11
+ insight-cli -p RE work context --project client --json
12
+ insight-cli -p RE work import --project client --file functions.json --request-id import-page-1 --json
13
+ insight-cli -p RE work next --project client --worker agent-a --count 10 --request-id agent-a-next-1 --json
14
+ insight-cli -p RE work handoff --lease LEASE --json
15
+ insight-cli -p RE work heartbeat --lease LEASE --request-id agent-a-renew-1 --json
16
+ insight-cli -p RE work submit --lease LEASE --file submission.json --request-id agent-a-submit-1 --json
17
+ insight-cli -p RE work dashboard --project client --json
18
+ ```
19
+
20
+ Worker happy path: `next` → `handoff` → `heartbeat`… → `submit`/`review`. `next` plans and claims
21
+ atomically at the current state and returns `lease`, one opaque token for task, worker, fence and
22
+ epoch. It is a convenience handle, not a secret or authentication. The explicit
23
+ `--task/--worker/--fence` form and `plan --expect-revision` + `claim` remain for orchestrators.
24
+ On `work.taskCancelled` stop that task and run its `result.retry` (`next --functions …`) or plain
25
+ `next`; on other `stale*` errors read a
26
+ fresh `brief`/`handoff`. Every retry with changed input needs a new request ID.
27
+
28
+ Read generated leaf help. Task and package mutations require Factory Update and a unique request ID (local
29
+ dashboard/export/backup outputs instead require a new destination). After a
30
+ lost response reuse the same ID with identical captured inputs: the saved receipt is replayed,
31
+ and changed intent fails. `result` is the saved mutation. Dashboard refresh is deferred by default;
32
+ use `--refresh-dashboard` on a mutation to render the current revision. A rendering failure does not undo saved workflow state.
33
+
34
+ Plan at a freshly observed revision, then pass `handoff` to an independent agent. Queued and
35
+ leased tasks reserve function IDs, explicit resource keys and the targets of the function's own
36
+ non-rejected writer edges (`writes`, `initializes`, `owns`, `frees`). Calls and reads never lock.
37
+ No ownership closure is inferred from a call graph. Expired leases can be reclaimed with a higher fence; stale writes fail.
38
+ Release keeps the reservation; cancel at the current revision frees it for replanning.
39
+ Worker labels are cooperative attribution, not authentication. Ghidra workers still use
40
+ different private sessions and the existing merge/refresh/recovery protocol.
41
+
42
+ JSON inputs are captured before parsing (8 MiB). Source limit: 16 MiB; review note: 2 MiB.
43
+ Command paths resolve against the invoking client's working directory, including over IPC.
44
+ Manifest paths are relative to that manifest. `work evidence --sha256 HASH --size BYTES`
45
+ verifies and locates saved bytes. Originals can change without rewriting saved evidence.
46
+
47
+ Inventory: `{schema:1,kind:"function-definitions",binarySha256:FULL_SHA,reportedTotal:N,
48
+ functions:[{rva:"0x1000",name:"label",risk:"unknown",resources:["global:FULL_SHA:1234"]}]}`.
49
+ At most 5000 definitions per input. `reportedTotal` is an upstream claim, not completeness.
50
+ Unwind regions and source declarations are distinct. Extra provenance/body fields are retained.
51
+ Changed definitions under existing IDs fail. Function IDs use the full SHA plus entry RVA.
52
+ Revise them explicitly with `work revise-definition --project ID --function FN --expect-version V
53
+ --file revision.json --request-id NEW-ID`. Input: `{schema:1,kind:"function-definition-revision",
54
+ binarySha256:FULL_SHA,reason:"evidence/reason",definition:{rva:"0x1000",name:"label",resources:[]}}`.
55
+ The entry anchor must stay unchanged. Revision cancels/fences affected assignments and retains
56
+ old packages as invalidated history. `work history --project ID --function FN` pages versions.
57
+ Migration seeds only the current retained version. A new reconstruction submission clears invalidation;
58
+ old finite comparisons/reviews cannot validate a changed definition. A new non-rejected edge invalidates
59
+ retained packages (functions with source) at its function endpoints and cancels assignments that froze
60
+ those packages. New nodes, rejected edges and identical imports invalidate nothing; in-flight work on
61
+ functions without a package keeps its lease unless a new exclusive edge expands its reserved scope. Automatic planning skips a function whose exclusive
62
+ resource frontier exceeds 10,000 keys and pages beyond busy frontiers.
63
+ `--functions ID,ID` selects an exact slice. `--after-rva` advances a bounded planning frontier.
64
+ Functions and graph keyset pages include revisions; restart multi-page reads if it changes.
65
+
66
+ Graph: `{schema:1,kind:"dependency-graph",binarySha256:FULL_SHA,nodes:[],edges:[]}`.
67
+ Node fields: `id,kind,label,confidence,evidence`. Kinds: `global,type,vtable,dispatch-site,
68
+ packet,asset-package,subsystem,source-declaration`. IDs start with `KIND:FULL_SHA:`.
69
+ Edge fields: `id,source,target,kind,confidence,evidence`; endpoints must exist or arrive in
70
+ the same import. Confidence: `observed,reported,hypothesis,rejected`. Keep unresolved dispatch
71
+ and candidate edges explicit. Extra fields retain callsite, opcode/framing, ownership and
72
+ initialization details. Records are immutable by ID; corrections use new evidence IDs and
73
+ explicit supersession fields. `work import-graph` admits at most 5000 nodes/10000 edges.
74
+
75
+ Submission: `{functions:[{id:FUNCTION_ID,source:"method.cpp",contract:"passport.json"}]}`.
76
+ Cover exactly the leased slice. Passport text fields: `signature,abi,inputs,outputs,
77
+ memoryEffects,errors,threading,nondeterminism,recheck`. String arrays: `unknowns,dependencies,
78
+ observations,inferences,rejectedIdeas`. Additional language/tool/branch/allocator/init details
79
+ and raw-evidence hashes are retained. Unknowns keep a function partial even after corpus matches
80
+ and approval. A partial package is not re-offered by `next --kind reconstruct`; it goes to review.
81
+ Only rejected, invalidated or source-less packages return to the reconstruct lane, after new functions.
82
+ No declared unknowns means author-reported reconstructed, never proved 1:1.
83
+ Prefix every unknown with its cause: `[tool]` when better native tooling could resolve it
84
+ (missing analysis, unrecovered callees/parameters, decompiler artifacts) or `[intrinsic]` when it
85
+ needs new evidence (indirect targets, ownership, runtime values). This is a convention, not schema.
86
+
87
+ `work handoff --lease LEASE --materialize NEW-DIR` writes every assigned function's retained
88
+ source/contract and a manifest skeleton (`submission.json` or `review-manifest.json`) with paths
89
+ relative to it; a review skeleton leaves `approved: null` to be decided. Rows of `functions`/`brief`
90
+ carry `reviewState` (`none`, `approved`, `rejected`, `stale`); with unknowns an approved package
91
+ stays `partial`. Passport errors name the field path, e.g. `functions[0].contract.inputs`.
92
+ `noWork` lists `awaitingReconstructionIds` and `reservedBy` (task, status, worker, leaseUntil). A released
93
+ lease keeps its reservation: the task returns to `queued` and its scope stays locked until
94
+ `work claim --task ID` or `work cancel`.
95
+ For rework, `--materialize` also writes `<rva>/previous-review.md` (the retained review note) and
96
+ `<rva>/rework-reason.json` (review decision and reviewer; comparison cases, mismatches and up to five
97
+ mismatching inputs). Read them before changing the source.
98
+
99
+ `work reopen-review --project ID --function FN --source-sha256 SHA --expect-version V
100
+ --reason "new evidence" --request-id NEW-ID` withdraws a current approval without changing the
101
+ source, passport or definition. The exact source, package version and optional `--epoch` guard
102
+ stale intent; any queued/leased reservation blocks reopening. Prior decisions and artifacts stay
103
+ in immutable history and handoff. The current review becomes `stale`, the function becomes
104
+ `partial`, and `next --kind review` can assign it again to a worker other than its author.
105
+ Finite corpus matches cannot close that requirement. A new independent decision or a new
106
+ reconstruction submission clears the marker; rejection and existing unknowns remain blockers.
107
+ Rejected, invalidated and already reopened packages cannot be reopened through this command.
108
+ It uses the ordinary durable request-ID protocol; retry lost replies with identical inputs.
109
+ Explicit reconstruction planning is still available when the passport itself needs correction.
110
+
111
+ Review is a separate `--kind review` assignment and worker. Manifest:
112
+ `{functions:[{id:FUNCTION_ID,sourceSha256:SOURCE_SHA,approved:true,note:"review.md"}]}`.
113
+ The author cannot review their own reconstruction. Approval records that worker's decision.
114
+
115
+ `work compare --layout layout.json` takes original/reconstruction JSON files with `schema:1,binarySha256,function`
116
+ and nonempty `cases:[{input:"canonical input bytes/ID",outcome:{encoding:"hex-bytes-v1",
117
+ bytes:"lowercase even hex",layoutSha256:FULL_SHA}}]`. Reconstruction also binds `sourceSha256`.
118
+ The layout file is captured too; each outcome hash must name those retained bytes. It needs
119
+ `schema:1,kind:"observation-layout",description:"..."` and the exact serialization rules.
120
+ Retention and hash binding do not attest that the schema captures all required effects.
121
+ The layout hash identifies that return/write/error/ordering schema. Do not
122
+ round floating values or pointers through JSON numbers. Input sets match; duplicates fail.
123
+ Comparison is exact over supplied outcomes; **native execution is not attested**. A trusted
124
+ native-vs-reconstruction runner remains a separate future verifier. Compare after submitting
125
+ reconstruction and before reserving review: comparisons reject queued/leased/reclaimed function
126
+ reservations so they cannot invalidate another worker's assigned version or fence.
127
+ An independent rejection remains attached to unchanged source across mismatch/match sequences.
128
+ Address it in a new reconstruction submission; corpus equality cannot resolve review findings.
129
+
130
+ `work certify` fails closed. No supported replayable exhaustive/formal verifier exists.
131
+ All strict accepted counts are zero. Tags, approvals, passed flags and finite matches cannot
132
+ unlock them. Unknown boundaries and unproven capture coverage remain blockers.
133
+
134
+ Generate the HTML on demand with `work dashboard`, or refresh it on selected mutations with
135
+ `--refresh-dashboard`. The open file reloads every 8s; it reflects the last render.
136
+ `--output NEW.html` writes a static snapshot without overwriting files. Revision/time and
137
+ limits are visible: 200 functions,100 tasks,50 events; graph draws at most12 edges/16 nodes.
138
+ No global game-completion percentage is inferred. Keyset commands expose rows beyond the view.
139
+ Preserve the workspace and artifacts together; HTML is not a backup or another writable ledger.
140
+ `work request --request-id ID` retrieves the saved intent/receipt after a lost acknowledgment.
141
+ `work events --project ID --after SEQ` pages the durable event journal. Events link their
142
+ originating administration requests, retaining prior source/passport inputs after later work.
143
+ `work export --project ID --output NEW.jsonl` streams the full project at one consistent
144
+ revision, including functions, dependency records, assignments, events and originating requests.
145
+ Its final record and returned SHA identify the complete export; artifact payloads remain external.
146
+ This is a checkpoint projection, not automatic restore or a whole-profile backup.
147
+
148
+ M0 separates event `revision` from the latest planning barrier `planningRevision`. `next` does not
149
+ need an observed revision. The existing
150
+ `--expect-revision` accepts an observation between that barrier and the current revision.
151
+ Heartbeat/claim/release do not change the barrier; structural changes and competing plans do.
152
+ Storage schema 2 does not mean the proposed multi-artifact knowledge-model V2 is implemented.
153
+
154
+ ```text
155
+ insight-cli -p RE work backup --output NEW-DIRECTORY --json
156
+ insight-cli -p RE work verify-backup --directory DIRECTORY --json
157
+ insight-cli -p FRESH work restore --directory DIRECTORY --request-id NEW-RESTORE-ID --json
158
+ insight-cli -p FRESH work brief --project client --json
159
+ insight-cli -p FRESH work next --project client --worker agent-a --request-id NEW-NEXT-ID --json
160
+ ```
161
+
162
+ Backup includes all work metadata/history, administration intents/receipts, target bytes and
163
+ referenced payloads. It excludes native sessions, configuration, credentials and tool installs.
164
+ It refuses an existing destination or one inside the source workspace. The manifest is published
165
+ last; preserve failed partial output and use a new destination. Verification reads without changing
166
+ the external backup. Limits: state 2 GiB, record 16 MiB, manifest 32 MiB, 100,000 artifacts, 4 GiB
167
+ per artifact. Snapshot collection holds both local database write locks; payload copying does not.
168
+
169
+ Restore requires empty work storage. Its metadata transaction follows validation and immutable
170
+ payload/target staging; failed staging may leave unreferenced immutable materials. It never replaces
171
+ current work or resumes old locks. Outstanding tasks become cancelled/fenced in a fresh destination
172
+ epoch, so old workers receive `work.taskCancelled`. `--epoch` is optional everywhere; an explicit
173
+ mismatching epoch fails with `work.staleEpoch`. Use new request IDs.
174
+ The restore receipt exposes the total and at most 100 project summaries, with explicit completeness.
175
+ `claim` and `next` embed the epoch in the returned lease token. Historical requests remain inspectable through
176
+ `work request`, but cannot replay as mutations. A restore retry uses its exact backup and saved
177
+ local receipt after a lost ACK. No native context is restored and strict accepted counts stay zero.
178
+ If a caller label has outcomes from several incarnations, `work request` marks it ambiguous and
179
+ returns `histories`; every outcome is retained and none authorizes a new mutation.
180
+
181
+ ## Context, migration and timing
182
+
183
+ Start with `work context` to read the CLI version, profile and Work schema. Add
184
+ `--project ID` to see the bound target, binary SHA, epoch and revision. Register missing
185
+ definitions with `import` before assigning them. An older work database requires an Update
186
+ command such as `work migrate`. On an existing schema-2 profile the first writable open
187
+ reconciles under-reserved assignments and creates timing indexes once. Read-only access never migrates it. Standalone
188
+ `verify-backup` reads the supplied backup without opening the active ledger.
189
+
190
+ `work timing --project ID` reports the latest ten reconstruction tasks. Use
191
+ `--tasks ID1,ID2` for a reproducible cohort of up to 100. Queue counts cover the full
192
+ project. Rows pair each function's submitted version with its independent review.
193
+ Intervals are wall-clock milliseconds from recorded server events. Author and reviewer
194
+ durations use the final claim of each completed task; time to decision starts at the
195
+ author's first claim. A missing event yields null. The batch span is complete when
196
+ every selected row has a decision. For selected rework attempts, byFunction reports
197
+ the first verdict and first approval observed in that cohort. Approval is bounded by the
198
+ contract. Both pages and timing read stored metadata; neither rehashes the input binary.
199
+
200
+ On large inventories the automatic planner examines at most twenty 5,000-row pages
201
+ per lane. An empty result can describe that bounded window while later RVAs remain
202
+ eligible. Use `work plan --after-rva 0x... --expect-revision ...` to continue.
203
+ Timing uses the Work owner's wall clock; clock adjustments can affect intervals.
@@ -18,6 +18,7 @@
18
18
  "title": "Insight RE",
19
19
  "path": "skills/insight-re/SKILL.md",
20
20
  "resources": {
21
+ "references/work-tracking.md": "references/work-tracking.md",
21
22
  "references/recovery.md": "references/recovery.md",
22
23
  "references/artifacts.md": "references/artifacts.md",
23
24
  "references/agent-execution.md": "references/agent-execution.md",
@@ -3,7 +3,7 @@ name: insight-artifacts
3
3
  description: Retain a completed reverse-engineering evidence file or directory as an ordinary checkpoint using insight-cli artifacts save. Use after Ghidra or any external tool; preserve existing project formats and source of truth.
4
4
  ---
5
5
 
6
- # Insight Artifacts 0.8.0
6
+ # Insight Artifacts 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -13,6 +13,12 @@ it. An empty merge can finish as failed/retained; an already published request k
13
13
  verified result. An unproved release or check-in outcome stays blocked for journal-based
14
14
  recovery. Preserve its project and receipts rather than repeating a mutation with a new ID.
15
15
 
16
+ A check-in that was sent and ended without an answer is settled from its journal and the repository
17
+ history. When the checkout still stands at its base, Ghidra still reports it modified, no check-in is
18
+ active and no version carries the request's marker, nothing was published: repeating the merge with its
19
+ original request ID reports `conflict` with reason `not_published`, the private work stays, and a merge
20
+ with a new request ID publishes it.
21
+
16
22
  If native `changes discard` loses its response, retry its original request ID or continue
17
23
  the same session/target. Recovery requires a completed native discard journal and matching
18
24
  new checkout identity/base, which Ghidra reports unmodified.
@@ -3,7 +3,7 @@ name: insight-binary
3
3
  description: Query structured PE, ELF and thin Mach-O headers, sections, imports and exports, or make an explicitly guarded new PE subsystem copy through insight-cli binary. Use for scoped binary structure, linkage and copy-only header edits without target execution.
4
4
  ---
5
5
 
6
- # Insight Binary 0.8.0
6
+ # Insight Binary 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-capture
3
3
  description: Capture one explicitly authorized native program run, exact stdout/stderr and declared file snapshots through insight-cli capture, then inspect or compare retained reports without replay. Use for controlled input/output research, preserving original files and interrupted or unknown outcomes.
4
4
  ---
5
5
 
6
- # Insight Capture 0.8.0
6
+ # Insight Capture 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-cli
3
3
  description: Choose and prepare reverse-engineering capabilities from the insight-cli toolbox for binary, managed-code and runtime investigations. Use to discover the appropriate tool or its packaged skill before installing native runtimes.
4
4
  ---
5
5
 
6
- # insight-cli 0.8.0
6
+ # insight-cli 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -13,6 +13,12 @@ it. An empty merge can finish as failed/retained; an already published request k
13
13
  verified result. An unproved release or check-in outcome stays blocked for journal-based
14
14
  recovery. Preserve its project and receipts rather than repeating a mutation with a new ID.
15
15
 
16
+ A check-in that was sent and ended without an answer is settled from its journal and the repository
17
+ history. When the checkout still stands at its base, Ghidra still reports it modified, no check-in is
18
+ active and no version carries the request's marker, nothing was published: repeating the merge with its
19
+ original request ID reports `conflict` with reason `not_published`, the private work stays, and a merge
20
+ with a new request ID publishes it.
21
+
16
22
  If native `changes discard` loses its response, retry its original request ID or continue
17
23
  the same session/target. Recovery requires a completed native discard journal and matching
18
24
  new checkout identity/base, which Ghidra reports unmodified.
@@ -3,7 +3,7 @@ name: insight-die
3
3
  description: Classify unknown executable or container inputs by format, architecture and compiler/runtime/packer signatures with Detect It Easy before choosing managed or native analysis. Use insight-cli die for static triage and preserve scan uncertainty.
4
4
  ---
5
5
 
6
- # Insight Detect It Easy 0.8.0
6
+ # Insight Detect It Easy 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-dnspy
3
3
  description: Debug a managed Windows EXE at an IL breakpoint and read primitive arguments, or change one expected IL Int32 constant in a new assembly copy through insight-cli dnspy. Use when C# decompilation needs observed execution or a controlled binary edit.
4
4
  ---
5
5
 
6
- # Insight dnSpyEx 0.8.0
6
+ # Insight dnSpyEx 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-dotnet-dump
3
3
  description: Capture a managed heap dump or inspect compatible .NET dumps with SOS to recover waiting stacks, objects, fields and retention evidence.
4
4
  ---
5
5
 
6
- # Insight .NET Dump 0.8.0
6
+ # Insight .NET Dump 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-dotnet-stack
3
3
  description: Inspect live managed thread stacks to identify active or waiting work in an explicitly selected .NET process without taking a dump.
4
4
  ---
5
5
 
6
- # Insight .NET Stack 0.8.0
6
+ # Insight .NET Stack 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-dotnet-trace
3
3
  description: Collect and inspect bounded .NET EventPipe traces to identify sampled thread work, waits or runtime activity; distinguish wall-clock samples from CPU consumption.
4
4
  ---
5
5
 
6
- # Insight .NET Trace 0.8.0
6
+ # Insight .NET Trace 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-frida
3
3
  description: Observe native call arguments/results or inspect runtime modules and exports in an explicitly selected authorized process with bounded Frida scripts. Use insight-cli frida to corroborate static findings with actual execution on macOS ARM64.
4
4
  ---
5
5
 
6
- # Insight Frida 0.8.0
6
+ # Insight Frida 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-ghidra
3
3
  description: Inspect or edit native binaries with Ghidra through insight-cli; use isolated contexts, multi-agent merge/refresh, server, GUI or debugger workflows. Choose this for static native behavior and references, not C# recovery from managed IL.
4
4
  ---
5
5
 
6
- # Insight Ghidra 0.8.0
6
+ # Insight Ghidra 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -13,6 +13,12 @@ it. An empty merge can finish as failed/retained; an already published request k
13
13
  verified result. An unproved release or check-in outcome stays blocked for journal-based
14
14
  recovery. Preserve its project and receipts rather than repeating a mutation with a new ID.
15
15
 
16
+ A check-in that was sent and ended without an answer is settled from its journal and the repository
17
+ history. When the checkout still stands at its base, Ghidra still reports it modified, no check-in is
18
+ active and no version carries the request's marker, nothing was published: repeating the merge with its
19
+ original request ID reports `conflict` with reason `not_published`, the private work stays, and a merge
20
+ with a new request ID publishes it.
21
+
16
22
  If native `changes discard` loses its response, retry its original request ID or continue
17
23
  the same session/target. Recovery requires a completed native discard journal and matching
18
24
  new checkout identity/base, which Ghidra reports unmodified.
@@ -3,7 +3,7 @@ name: insight-ilspy
3
3
  description: Recover C#, inspect IL/types/metadata, extract resources or export projects from managed .NET assemblies through insight-cli ILSpy. Choose native analysis for NativeAOT or ordinary PE machine code.
4
4
  ---
5
5
 
6
- # Insight ILSpy 0.8.0
6
+ # Insight ILSpy 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-interop
3
3
  description: Trace a .NET P/Invoke declaration to an explicitly supplied native library export and Ghidra function through insight-cli ilspy query, binary query and scoped ghidra APIs. Use for managed/native linkage evidence while keeping static correspondence separate from observed loading or execution.
4
4
  ---
5
5
 
6
- # Insight Interop 0.8.0
6
+ # Insight Interop 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-lldb
3
3
  description: Observe native runtime arguments, return values, registers, stacks and bounded memory at a selected breakpoint using an owned LLDB launch. Use insight-cli lldb on macOS ARM64 when static findings need a concrete execution check.
4
4
  ---
5
5
 
6
- # Insight LLDB 0.8.0
6
+ # Insight LLDB 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-llvm
3
3
  description: Inspect PE, ELF and Mach-O headers, dependencies, exports and symbols; query PDB debug information or a small instruction window with insight-cli LLVM utilities before opening a full analysis project.
4
4
  ---
5
5
 
6
- # Insight LLVM 0.8.0
6
+ # Insight LLVM 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-managed-heap
3
3
  description: Query structured .NET heap objects, primitive fields and managed stacks from a retained CoreCLR dump through insight-cli dotnet-dump query. Use for bounded offline dump investigation with an explicit matching DAC, preserving uncertainty and immutable input identity.
4
4
  ---
5
5
 
6
- # Insight Managed Heap 0.8.0
6
+ # Insight Managed Heap 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-managed-metadata
3
3
  description: Query managed assembly metadata, MethodDef tokens, P/Invoke declarations and bounded IL, or compare two C#/.NET assemblies through insight-cli ilspy query/compare. Use for structured static evidence and changed-method research without executing the target.
4
4
  ---
5
5
 
6
- # Insight Managed Metadata 0.8.0
6
+ # Insight Managed Metadata 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-mitmproxy
3
3
  description: Record, inspect and compare HTTP request/response evidence with insight-cli mitmproxy. Use when an owned client can explicitly use a loopback proxy; read native flow archives or HAR without replaying traffic. System interception and global certificate trust are outside this facade.
4
4
  ---
5
5
 
6
- # Insight mitmproxy 0.8.0
6
+ # Insight mitmproxy 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized
@@ -3,7 +3,7 @@ name: insight-overview
3
3
  description: Choose bounded tool overviews and focused drilldown through insight-cli without flooding agent context with whole-program code, traces or dumps. Use for tool discovery, scoped evidence paging and keeping native partial coverage separate from complete results.
4
4
  ---
5
5
 
6
- # Insight Overview 0.8.0
6
+ # Insight Overview 0.8.2
7
7
 
8
8
  If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
9
  with the agent host's normal permission escalation, then use that route for later authorized