@eyeauras/insight-cli 0.8.1 → 0.8.3

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 (89) hide show
  1. package/.cli-package-build.json +1 -1
  2. package/README.md +53 -7
  3. package/SKILL.md +4 -8
  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.js +3 -3
  9. package/dist/src/work/commands.js +1 -1
  10. package/dist/src/work/store.js +3 -3
  11. package/dist/src/workspace.js +2 -1
  12. package/package.json +1 -1
  13. package/references/agent-setup.md +2 -11
  14. package/references/debugger.md +1 -1
  15. package/references/managed-runtime.md +1 -2
  16. package/references/recovery.md +8 -34
  17. package/references/research.md +5 -5
  18. package/references/setup.md +0 -4
  19. package/references/work-tracking.md +9 -3
  20. package/skill-bundle/insight-artifacts/SKILL.md +3 -7
  21. package/skill-bundle/insight-artifacts/references/recovery.md +8 -34
  22. package/skill-bundle/insight-binary/SKILL.md +3 -7
  23. package/skill-bundle/insight-capture/SKILL.md +3 -7
  24. package/skill-bundle/insight-cli/SKILL.md +4 -8
  25. package/skill-bundle/insight-cli/references/agent-setup.md +2 -11
  26. package/skill-bundle/insight-cli/references/managed-runtime.md +1 -2
  27. package/skill-bundle/insight-cli/references/recovery.md +8 -34
  28. package/skill-bundle/insight-cli/references/setup.md +0 -4
  29. package/skill-bundle/insight-die/SKILL.md +3 -7
  30. package/skill-bundle/insight-dnspy/SKILL.md +3 -7
  31. package/skill-bundle/insight-dotnet-dump/SKILL.md +3 -7
  32. package/skill-bundle/insight-dotnet-stack/SKILL.md +3 -7
  33. package/skill-bundle/insight-dotnet-trace/SKILL.md +3 -7
  34. package/skill-bundle/insight-frida/SKILL.md +3 -7
  35. package/skill-bundle/insight-ghidra/SKILL.md +13 -36
  36. package/skill-bundle/insight-ghidra/references/debugger.md +1 -1
  37. package/skill-bundle/insight-ghidra/references/managed-runtime.md +1 -2
  38. package/skill-bundle/insight-ghidra/references/recovery.md +8 -34
  39. package/skill-bundle/insight-ghidra/references/research.md +5 -5
  40. package/skill-bundle/insight-ghidra/references/setup.md +0 -4
  41. package/skill-bundle/insight-ilspy/SKILL.md +3 -7
  42. package/skill-bundle/insight-interop/SKILL.md +3 -7
  43. package/skill-bundle/insight-lldb/SKILL.md +3 -7
  44. package/skill-bundle/insight-llvm/SKILL.md +3 -7
  45. package/skill-bundle/insight-managed-heap/SKILL.md +3 -7
  46. package/skill-bundle/insight-managed-metadata/SKILL.md +3 -7
  47. package/skill-bundle/insight-mitmproxy/SKILL.md +3 -7
  48. package/skill-bundle/insight-overview/SKILL.md +3 -7
  49. package/skill-bundle/insight-procmon/SKILL.md +3 -7
  50. package/skill-bundle/insight-re/SKILL.md +4 -8
  51. package/skill-bundle/insight-re/references/recovery.md +8 -34
  52. package/skill-bundle/insight-re/references/work-tracking.md +9 -3
  53. package/skill-bundle/insight-sevenzip/SKILL.md +3 -7
  54. package/skill-bundle/insight-strace/SKILL.md +3 -7
  55. package/skill-bundle/insight-tshark/SKILL.md +3 -7
  56. package/skill-bundle/insight-windbg/SKILL.md +3 -7
  57. package/skill-bundle/manifest.json +1 -1
  58. package/skills/insight-artifacts/SKILL.md +3 -7
  59. package/skills/insight-artifacts/references/recovery.md +8 -34
  60. package/skills/insight-binary/SKILL.md +3 -7
  61. package/skills/insight-capture/SKILL.md +3 -7
  62. package/skills/insight-die/SKILL.md +3 -7
  63. package/skills/insight-dnspy/SKILL.md +3 -7
  64. package/skills/insight-dotnet-dump/SKILL.md +3 -7
  65. package/skills/insight-dotnet-stack/SKILL.md +3 -7
  66. package/skills/insight-dotnet-trace/SKILL.md +3 -7
  67. package/skills/insight-frida/SKILL.md +3 -7
  68. package/skills/insight-ghidra/SKILL.md +13 -36
  69. package/skills/insight-ghidra/references/debugger.md +1 -1
  70. package/skills/insight-ghidra/references/managed-runtime.md +1 -2
  71. package/skills/insight-ghidra/references/recovery.md +8 -34
  72. package/skills/insight-ghidra/references/research.md +5 -5
  73. package/skills/insight-ghidra/references/setup.md +0 -4
  74. package/skills/insight-ilspy/SKILL.md +3 -7
  75. package/skills/insight-interop/SKILL.md +3 -7
  76. package/skills/insight-lldb/SKILL.md +3 -7
  77. package/skills/insight-llvm/SKILL.md +3 -7
  78. package/skills/insight-managed-heap/SKILL.md +3 -7
  79. package/skills/insight-managed-metadata/SKILL.md +3 -7
  80. package/skills/insight-mitmproxy/SKILL.md +3 -7
  81. package/skills/insight-overview/SKILL.md +3 -7
  82. package/skills/insight-procmon/SKILL.md +3 -7
  83. package/skills/insight-re/SKILL.md +4 -8
  84. package/skills/insight-re/references/recovery.md +8 -34
  85. package/skills/insight-re/references/work-tracking.md +9 -3
  86. package/skills/insight-sevenzip/SKILL.md +3 -7
  87. package/skills/insight-strace/SKILL.md +3 -7
  88. package/skills/insight-tshark/SKILL.md +3 -7
  89. package/skills/insight-windbg/SKILL.md +3 -7
@@ -1 +1 @@
1
- {"version":1,"artifact":"d692afaf6eb8c5f2285c41a7866af49b9d20f89a54e57682a9910728dde44f02"}
1
+ {"version":1,"artifact":"39f4082a394ae17275f6edbfab438b30140d00026bcda57c8d6e1f0fc068ee58"}
package/README.md CHANGED
@@ -5,6 +5,7 @@ less time managing Ghidra processes or writing scripts around missing analysis m
5
5
 
6
6
  - Search raw strings and code references, and inspect functions in sparse Ghidra databases.
7
7
  - Give each agent an isolated research context, with saved work and explicit merge/refresh.
8
+ - Coordinate several agents reconstructing one program with the `work` ledger.
8
9
  - Use structured JSON results and a persistent client for sequences of research calls.
9
10
 
10
11
  ## Install
@@ -47,12 +48,57 @@ Results include scan coverage and a continuation cursor when incomplete. New imp
47
48
  skip full automatic analysis by default; add `--analysis` to the first `open` to opt in.
48
49
  Continue with the [research guide](https://github.com/iXab3r/insight-cli/blob/main/skills/ghidra-coordinator/references/research.md).
49
50
 
50
- ## Benchmarks
51
+ ## Other tools
51
52
 
52
- In a fresh-agent PoE 2 investigation, installed insight-cli 0.4.0 with its persistent
53
- client finished in **16:35**, versus **19:43** through Ghidra MCP: **15.9% less wall time**,
54
- with comparable core findings. This is one adaptive research pair, not a general speed guarantee.
53
+ Besides Ghidra, the CLI manages pinned runtimes for ILSpy, dnSpyEx, 7-Zip, LLVM, DiE, LLDB,
54
+ WinDbg, Frida, ProcMon, strace, TShark, mitmproxy and .NET diagnostics (dump, stack, trace,
55
+ heap, metadata). All of them share the same targets, sessions and profile storage.
56
+ `insight-cli tools list` shows what is available; `insight-cli tools show <tool>` describes one
57
+ tool and locates its agent skill (for example `insight-cli skill insight-ilspy`).
55
58
 
56
- [Benchmarks](https://github.com/iXab3r/insight-cli/blob/main/BENCHMARKS.md) includes phases, earlier runs and comparison limits.
57
- [Development history and detailed reports](https://github.com/iXab3r/insight-cli/blob/main/docs/PROJECT-HISTORY.md) covers architecture,
58
- acceptance, other experiments and releases. See [Contributing](https://github.com/iXab3r/insight-cli/blob/main/CONTRIBUTING.md) for development.
59
+ ## Several agents on one reconstruction
60
+
61
+ `insight-cli work` is an opt-in ledger for agents that reconstruct functions of one binary
62
+ together: nonoverlapping leased slices, retained source and contracts, evidence, and review by
63
+ a different worker. Every change takes a request ID, so a lost reply can be retried safely.
64
+
65
+ ```sh
66
+ insight-cli -p RE work create --project client --target TARGET --name Client --request-id create-client --json
67
+ insight-cli -p RE work import --project client --file functions.json --request-id import-1 --json
68
+ insight-cli -p RE work next --project client --worker agent-a --request-id agent-a-next-1 --json
69
+ ```
70
+
71
+ The [work tracking reference](https://github.com/iXab3r/insight-cli/blob/main/skills/ghidra-coordinator/references/work-tracking.md) has the complete
72
+ workflow and input formats; [Work ledger](https://github.com/iXab3r/insight-cli/blob/main/docs/WORK.md) explains the model.
73
+
74
+ ## Development
75
+
76
+ ```sh
77
+ git clone https://github.com/iXab3r/insight-cli.git
78
+ cd insight-cli
79
+ npm ci # locked dependencies
80
+ npm run build # TypeScript -> skills/ghidra-coordinator/dist
81
+ npm test # build + offline tests (no Ghidra, no network)
82
+ node skills/ghidra-coordinator/dist/src/bin.js --help
83
+ ```
84
+
85
+ [Contributing](https://github.com/iXab3r/insight-cli/blob/main/CONTRIBUTING.md) covers running from source, test rules, packaging and the
86
+ native acceptance suites.
87
+
88
+ | Path | Contents |
89
+ | --- | --- |
90
+ | `skills/ghidra-coordinator/` | The CLI package `@eyeauras/insight-cli` (npm workspace) |
91
+ | `…/src/` | TypeScript sources; `work/` and `tool-runtime/` are the Work ledger and shared tool runtime |
92
+ | `…/tests/` | Offline `node:test` suites, compiled to `dist/tests` |
93
+ | `…/SKILL.md`, `…/references/`, `…/skills/` | Agent skill entrypoint, references and per-tool skills shipped in the package |
94
+ | `…/runtime/` | Tool catalog (`toolbox.json`), pinned distributions and native helper binaries |
95
+ | `scripts/` | Build, packaging, release, coverage audit and native acceptance runners |
96
+ | `tests/acceptance/` | Gherkin acceptance (Reqnroll/.NET) for native, business and toolbox gates |
97
+ | `vendor/` | Prepared Factory dependency tarballs with provenance |
98
+ | `docs/` | Design and maintainer documentation |
99
+ | `build/teamcity.sh` | CI entrypoint for verification and npm release |
100
+
101
+ Documentation: [design](https://github.com/iXab3r/insight-cli/blob/main/docs/DESIGN.md), [CLI scenarios](https://github.com/iXab3r/insight-cli/blob/main/docs/CLI-SCENARIOS.md),
102
+ [Work ledger](https://github.com/iXab3r/insight-cli/blob/main/docs/WORK.md), [tool runtime](https://github.com/iXab3r/insight-cli/blob/main/docs/TOOL-RUNTIME.md),
103
+ [adding tools](https://github.com/iXab3r/insight-cli/blob/main/docs/ADDING-TOOLS.md), [Gherkin acceptance](https://github.com/iXab3r/insight-cli/blob/main/docs/ACCEPTANCE-AUTOMATION.md),
104
+ [release CI](https://github.com/iXab3r/insight-cli/blob/main/docs/RELEASE-CI.md).
package/SKILL.md CHANGED
@@ -3,14 +3,10 @@ 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.1
7
-
8
- If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
- with the agent host's normal permission escalation, then use that route for later authorized
10
- CLI calls too. An explicit **no command was sent** denial is known undispatched and can be
11
- retried through that route. Keep HOME, profile and owner state; see
12
- [host execution permissions](references/agent-execution.md). A lost mutation reply needs
13
- request/status recovery, never blind retry.
6
+ # insight-cli 0.8.3
7
+
8
+ AppData/IPC access denied: follow [host execution permissions](references/agent-execution.md).
9
+ A lost mutation reply needs request/status recovery, never a blind retry.
14
10
 
15
11
  Read the project's RE instructions and existing findings first. They own tool choices,
16
12
  evidence layout, formats and source of truth. These skills fill the remaining gaps.
@@ -320,10 +320,11 @@ export declare class GhidraContexts {
320
320
  revision: number;
321
321
  snapshot: Artifact;
322
322
  conflict: string;
323
+ reason?: 'not_published';
323
324
  } | {
324
325
  state: 'unknown';
325
326
  }>;
326
- /** Only the completed head-race branch before checkin() has this journal shape. */
327
+ /** A request that published nothing: the completed head-race branch before checkin(), or a check-in that was sent and created no version. */
327
328
  private recoverNativeRefusal;
328
329
  recoverModel(targetId: string): Promise<boolean>;
329
330
  dispose(): Promise<void>;
@@ -2279,7 +2279,7 @@ public class ${name} extends GhidraScript {
2279
2279
  const shared = await this.serverView(publication.target, revisionNumber, checkout.fileId);
2280
2280
  return { state: 'verified', revision: revisionNumber, snapshot: shared.snapshot };
2281
2281
  }
2282
- /** Only the completed head-race branch before checkin() has this journal shape. */
2282
+ /** A request that published nothing: the completed head-race branch before checkin(), or a check-in that was sent and created no version. */
2283
2283
  async recoverNativeRefusal(publication, checkout, saved) {
2284
2284
  const unknown = { state: 'unknown' }, context = this.workspace.context(publication);
2285
2285
  if (context.generation !== publication.generation || context.workingSnapshot?.id !== publication.snapshot.id ||
@@ -2301,19 +2301,31 @@ public class ${name} extends GhidraScript {
2301
2301
  return unknown;
2302
2302
  throw error;
2303
2303
  }
2304
- const result = object(journal.result ?? {}), before = object(journal.before ?? {});
2305
- if (stable(journal.request) !== stable(q) || journal.marker !== undefined || journal.checkoutId !== checkout.checkoutId || journal.baseVersion !== checkout.baseVersion ||
2306
- !Number.isSafeInteger(journal.headVersion) || Number(journal.headVersion) <= publication.expectedRevision || result.state !== 'conflict' ||
2304
+ const result = object(journal.result ?? {}), before = object(journal.before ?? {}), marker = 'insight native ' + publication.id;
2305
+ // A check-in that was sent and whose helper ended without a result. Ghidra's check-in either creates the version
2306
+ // with this marker and moves the checkout to it, or leaves both as they were: the checkout still at its base,
2307
+ // still modified, no check-in active and no version carrying the marker establish that nothing was published.
2308
+ const issued = journal.marker === marker && journal.result === undefined;
2309
+ if (stable(journal.request) !== stable(q) || journal.checkoutId !== checkout.checkoutId || journal.baseVersion !== checkout.baseVersion ||
2310
+ !Number.isSafeInteger(journal.headVersion) || before.fileId !== checkout.fileId || before.version !== checkout.baseVersion)
2311
+ return unknown;
2312
+ if (issued) {
2313
+ if (journal.headVersion !== publication.expectedRevision)
2314
+ return unknown;
2315
+ }
2316
+ else if (journal.marker !== undefined || Number(journal.headVersion) <= publication.expectedRevision || result.state !== 'conflict' ||
2307
2317
  result.conflict !== 'Shared head changed before native check-in' || result.nativeMergeInvocations !== 0 || !Array.isArray(result.nativePhases) || result.nativePhases.length !== 0 ||
2308
2318
  result.checkoutId !== checkout.checkoutId || result.baseVersion !== checkout.baseVersion || typeof result.modified !== 'boolean' ||
2309
- before.fingerprint !== saved.fingerprint || before.fileId !== checkout.fileId || before.version !== checkout.baseVersion || stable(result.saved) !== stable(before))
2319
+ before.fingerprint !== saved.fingerprint || stable(result.saved) !== stable(before))
2310
2320
  return unknown;
2311
- const observed = await this.nativeOperation(checkout, 'status');
2321
+ // The status call needs the project: a helper still running this check-in would hold it.
2322
+ const observed = await this.nativeOperation(checkout, 'status'), local = object(observed.saved ?? {});
2312
2323
  if (observed.state !== 'ready' || observed.checkedOut !== true || observed.recoverable !== false || observed.checkinActive !== false ||
2313
2324
  observed.fileId !== checkout.fileId || observed.checkoutId !== checkout.checkoutId || observed.baseVersion !== checkout.baseVersion ||
2314
- observed.modified !== result.modified || stable(observed.saved) !== stable(before))
2325
+ (issued ? observed.modified !== true || local.fileId !== checkout.fileId || local.version !== checkout.baseVersion :
2326
+ observed.modified !== result.modified || stable(observed.saved) !== stable(before)))
2315
2327
  return unknown;
2316
- const server = this.server(), marker = 'insight native ' + publication.id;
2328
+ const server = this.server();
2317
2329
  const history = (value) => {
2318
2330
  if (value.repository !== checkout.repository || value.path !== checkout.path || value.checkinActive !== false || !Number.isSafeInteger(value.version) ||
2319
2331
  Number(value.version) < Number(journal.headVersion) || !Array.isArray(value.versions) || !value.versions.length ||
@@ -2336,7 +2348,8 @@ public class ${name} extends GhidraScript {
2336
2348
  !await this.neverStartedOrClosed(context) || stable((await this.nativeOperation(checkout, 'status'))) !== stable(observed) ||
2337
2349
  stable(JSON.parse(await readFile(path, 'utf8'))) !== stable(journal))
2338
2350
  return unknown;
2339
- return { state: 'refused', revision: shared.revision, snapshot: shared.snapshot, conflict: String(result.conflict) };
2351
+ return { state: 'refused', revision: shared.revision, snapshot: shared.snapshot,
2352
+ ...(issued ? { reason: 'not_published', conflict: 'The native check-in was sent and created no version; the private work is retained. Merge again with a new request ID.' } : { conflict: String(result.conflict) }) };
2340
2353
  }
2341
2354
  async recoverModel(targetId) {
2342
2355
  if (this.workspace.activePublication(targetId))
@@ -126,6 +126,7 @@ export interface ResearchBackend {
126
126
  revision: number;
127
127
  snapshot: Artifact;
128
128
  conflict: string;
129
+ reason?: 'not_published';
129
130
  } | {
130
131
  state: 'unknown';
131
132
  }>;
@@ -560,7 +560,7 @@ export class Research {
560
560
  if (observed.state === 'verified' && backend.dropNative)
561
561
  await backend.dropNative(active);
562
562
  if (observed.state === 'refused')
563
- this.workspace.finishRefusedPublication(active.id, observed.revision, observed.snapshot, { session: active.session, target: active.target, state: 'conflict', reason: 'shared_changed', applied: 0,
563
+ this.workspace.finishRefusedPublication(active.id, observed.revision, observed.snapshot, { session: active.session, target: active.target, state: 'conflict', reason: observed.reason ?? 'shared_changed', applied: 0,
564
564
  pendingChanges: active.scalars.length + (active.complexChanges?.length ?? Number(active.complex)),
565
565
  conflicts: [{ engine: 'ghidra', message: observed.conflict }], reconciled: true });
566
566
  }
@@ -33,7 +33,7 @@ function references(value, refs, depth = 0) {
33
33
  fail('backup', 'Conflicting artifact declarations.');
34
34
  refs.set(a.id, a);
35
35
  if (refs.size > artifactLimit)
36
- fail('limit', 'M0 backup exceeds 100000 artifact references.');
36
+ fail('limit', 'Work backup exceeds 100000 artifact references.');
37
37
  }
38
38
  if (r.record === 'row') {
39
39
  const row = object(r.row);
@@ -76,11 +76,11 @@ async function scanState(path, expected, visit) {
76
76
  const line = pending.slice(0, index);
77
77
  pending = pending.slice(index + 1);
78
78
  if (!line || Buffer.byteLength(line) > lineLimit)
79
- fail('limit', 'State record exceeds the M0 budget.');
79
+ fail('limit', 'State record exceeds the backup record budget.');
80
80
  visit(object(JSON.parse(line)));
81
81
  }
82
82
  if (Buffer.byteLength(pending) > lineLimit)
83
- fail('limit', 'State record exceeds the M0 budget.');
83
+ fail('limit', 'State record exceeds the backup record budget.');
84
84
  }
85
85
  if (pending || size !== expected.size || hash.digest('hex') !== expected.sha256)
86
86
  fail('backup', 'State is incomplete or its hash changed.');
@@ -139,7 +139,7 @@ export function workCommands(access) {
139
139
  const input = await json(w, resolve(c.cwd, string(o.file)));
140
140
  return { input: { project: o.project, artifact: input.artifact, epoch: o.epoch }, project: identifier(o.project), apply: () => s.importInventory(identifier(o.project), input.value, input.artifact, o.epoch === undefined ? undefined : identifier(o.epoch)) };
141
141
  }),
142
- changing('import-graph', 'Add dependencies; new evidence conservatively invalidates M0 scopes', [project, file, epoch], async (s, w, o, c) => {
142
+ changing('import-graph', 'Add dependencies; new evidence conservatively invalidates affected scopes', [project, file, epoch], async (s, w, o, c) => {
143
143
  const input = await json(w, resolve(c.cwd, string(o.file)));
144
144
  return { input: { project: o.project, artifact: input.artifact, epoch: o.epoch }, project: identifier(o.project), apply: () => s.importGraph(identifier(o.project), input.value, input.artifact, o.epoch === undefined ? undefined : identifier(o.epoch)) };
145
145
  }),
@@ -111,7 +111,7 @@ export class WorkStore {
111
111
  affected.add(project);
112
112
  }
113
113
  for (const id of affected) {
114
- const project = this.project(id), reason = 'M0 migrated direct graph reservations; legacy scopes require replanning.';
114
+ const project = this.project(id), reason = 'Migration added direct graph reservations; legacy scopes require replanning.';
115
115
  const cancelledTasks = this.invalidateTasks(project, reason).length;
116
116
  this.invalidatePackages(project, reason);
117
117
  this.event(project, 'resources.migrated', { reason, cancelledTasks });
@@ -330,7 +330,7 @@ export class WorkStore {
330
330
  .all(project.id, functionId, integer(after, 0, Number.MAX_SAFE_INTEGER), integer(limit, 1, 1000) + 1);
331
331
  return { project: project.id, function: functionId, items: rows.slice(0, limit).map(row => ({ version: Number(row.version), data: JSON.parse(String(row.data)),
332
332
  reason: String(row.reason), at: Number(row.at), request: row.request === null ? null : String(row.request) })),
333
- nextAfterVersion: rows.length > limit ? Number(rows[limit - 1].version) : null, historyScope: 'Retained M0 versions; earlier package history is available only where legacy events captured it.' };
333
+ nextAfterVersion: rows.length > limit ? Number(rows[limit - 1].version) : null, historyScope: 'Retained ledger versions; earlier package history is available only where legacy events captured it.' };
334
334
  });
335
335
  }
336
336
  /** Explicitly withdraw a current approval without inventing a definition/source change. */
@@ -936,7 +936,7 @@ export class WorkStore {
936
936
  const line = (value) => {
937
937
  const data = Buffer.from(stable(value) + '\n');
938
938
  if (data.length > 16 * 1024 * 1024 || bytes + data.length > 2 * 1024 * 1024 * 1024)
939
- fail('limit', 'Work backup metadata exceeds the M0 record/total budget.');
939
+ fail('limit', 'Work backup metadata exceeds the record/total budget.');
940
940
  let offset = 0;
941
941
  while (offset < data.length)
942
942
  offset += writeSync(fd, data, offset);
@@ -654,7 +654,8 @@ export class Workspace {
654
654
  this.knownSnapshot(sharedSnapshot);
655
655
  return this.transaction(() => {
656
656
  const previous = this.publication(publication), context = this.context(previous), request = this.request(previous.request), model = this.model(previous.target);
657
- 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 ||
658
659
  observedRevision < (model.sharedRevision ?? 1) || context.generation !== previous.generation || context.workingSnapshot?.id !== previous.snapshot.id ||
659
660
  context.nativeCheckout?.state !== 'active' || request.context !== context.id || request.operation !== 'ghidra.merge' ||
660
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.1",
3
+ "version": "0.8.3",
4
4
  "type": "module",
5
5
  "description": "Agent-facing durable sessions and isolated Ghidra research contexts",
6
6
  "main": "./dist/src/index.js",
@@ -52,17 +52,8 @@ Keep unrelated profiles outside the write scope and pass the assigned `--profile
52
52
  Do not grant broad external network access merely to reach a local socket.
53
53
 
54
54
  An inaccessible profile means readiness is unknown. Inspect access failures; stopping a shared
55
- owner does not grant access to it. Existing restricted-host evaluation has not established a
56
- complete facade workflow yet; a successful metadata call or filesystem grant alone is insufficient.
57
-
58
- ## Behavioral acceptance
59
-
60
- Give a fresh agent an input and business question without commands/tool names. Verify startup
61
- metadata, implicit skill selection, intended public-tool use, correct findings, saved ordinary
62
- project files and cleanup. Ghidra edits additionally require merge and independent readback.
63
- Repeat cold-runtime and prepared-runtime cases; retain failures and distinguish an external-tool
64
- fallback from acceptance of the intended adapter. Package/skill existence is structural evidence,
65
- not proof that a model completed research.
55
+ owner does not grant access to it. A successful metadata call or filesystem grant alone does not
56
+ show that research commands will work.
66
57
 
67
58
  The project bundle is a symlink. A plain `find` does not follow it and can misleadingly
68
59
  show no files. Use the host skill inventory, a named `.../<skill>/SKILL.md` path, or
@@ -42,7 +42,7 @@ On macOS 15+ ARM64, GUI uses the private LLDB/Python dependency described in
42
42
  compatible local LLDB and Python; select an executable supported by that host. GUI startup
43
43
  prepares the Python wheels already supplied with Ghidra in owned storage; it does not install
44
44
  packages into system Python. System-backend Python overrides and the Windows debugger
45
- directory are Factory profile settings. Native Windows/Linux acceptance remains deferred.
45
+ directory are Factory profile settings.
46
46
 
47
47
  Use generated help for exact flags. A retained static breakpoint bookmark may remain after its live trace placement is
48
48
  removed; `trace_location_count` distinguishes current placements from that static metadata.
@@ -135,8 +135,7 @@ bottles with native components (macOS 14+, ARM64 or x64); no installed Homebrew
135
135
  and Windows x64 use the official Ghidra zip and Temurin archive. The installed `runtime/tool-catalog.json` pins mirror assets; repository
136
136
  `scripts/tool-distributions/` recipes retain upstream provenance. Published tool releases include
137
137
  original licenses/notices and required source/build companions, independent of CLI releases.
138
- Unsupported platforms fail explicitly and may use compatible external profile paths. Native
139
- acceptance for this delivery is macOS ARM64; catalog availability is not Windows/Linux native proof.
138
+ Unsupported platforms fail explicitly and may use compatible external profile paths.
140
139
 
141
140
  The host provides Node/npm, OS frameworks, display/keychain access and debugger authorization.
142
141
  On macOS 15+ ARM64 the managed debugger below supplies private LLDB/Python; Apple developer
@@ -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.
@@ -21,7 +27,7 @@ preserve the project and any `.keep` file.
21
27
 
22
28
  A Ghidra session that ends abruptly can leave unsaved changes as Ghidra recovery data in the
23
29
  working copy. Opening the program would delete them, so `ghidra open` and every native
24
- operation refuse with `blocked` and name the two ways out. Neither needs Ghidra itself:
30
+ operation refuse with `blocked` and name the two ways out; run either with the context closed:
25
31
  `ghidra changes recover-unsaved --session <id> --target <id>` has Ghidra restore those changes
26
32
  and save them into the working copy; `ghidra changes discard-unsaved --session <id> --target <id>`
27
33
  (Destructive) has Ghidra delete them. Saved work stays in both cases, nothing is published, and
@@ -195,51 +201,19 @@ without replay. Unproved native work stays blocked and retained. An unproved pro
195
201
  storage and credential store. Do not delete another session's project, stop a process by guessed
196
202
  PID/port, or blindly repeat a script/external action to turn uncertainty into success.
197
203
 
198
- The older prototype's `workers`, `findings`, `integrate` and batch `recover` commands are not the
199
- public facade API. Its coordinator journals remain separate and are never silently migrated.
200
-
201
204
  A lost UI navigation response can be verified from the live authenticated cursor without another
202
205
  goto. If its original owned GUI process has exited, continuation reports the uncertain UI action
203
206
  as disconnected and retains saved program work. It does not recreate the old cursor or re-enable
204
207
  a previous prompt policy. Other unproved live UI effects remain retained until their outcome is
205
208
  established or the original process is known to have ended.
206
209
 
207
- ## Native unknown attempts and legacy abandonment
210
+ ## Native unknown attempts
208
211
 
209
212
  For native contexts the snapshot-based `ghidra abandon` rollback is unsupported: replacing the
210
213
  DB from a detached snapshot would lose native ancestry and could discard acknowledged private
211
214
  work. Preserve the original project/journal and reconcile provable effects. Do not use discard,
212
215
  GC, another request ID or a new server checkout as evidence that an unknown script did nothing.
213
216
 
214
- The historical snapshot-based abandonment contract below applies only to its retained legacy
215
- fixtures, not to native contexts admitted by the primary CLI.
216
-
217
- ### Historical detached abandonment
218
-
219
- A post-mutation save timeout does not repeat the script or issue another save in the
220
- error handler. Status exposes the original request identity and retained phase/budget.
221
- Arbitrary script effects are never inferred from metadata or from an unverified DB.
222
- After inspecting the retained attempt, explicitly stop only its verified owned worker
223
- (`tools processes`, then `tools processes kill <process>` if required). Resume the
224
- last acknowledged private snapshot with:
225
-
226
- ```sh
227
- insight-cli permissions grant Destructive
228
- insight-cli ghidra abandon --session <session> --target <target> \
229
- --request-id <original-request> --acknowledge-unknown-effects --json
230
- insight-cli ghidra open --session <session> --target <target> --json
231
- ```
232
-
233
- Abandon requires exactly one unresolved private program operation, an unchanged verified
234
- previous snapshot/generation, a stopped original worker and no active publication or live
235
- debugger. It retains the native project, candidate artifacts, original intent/execution and
236
- previous diagnostic result. Its terminal request is `failed` / `state: abandoned` with
237
- `outcome: unknown`; no effect is marked applied. Repeating abandonment retrieves the same
238
- result. Earlier saved private edits remain pending. The original changing request ID cannot
239
- execute again. Abandoning never undoes external effects or establishes what an arbitrary
240
- script did; the acknowledgement explicitly accepts that uncertainty. Publication recovery,
241
- initial import, UI and debugger attempts use their own protocols and cannot use this command.
242
-
243
217
  ## Explicit legacy migration
244
218
 
245
219
  Legacy models require `ghidra migrate --target <target> --dry-run`, then the same
@@ -40,23 +40,23 @@ text) represents a null/absent comment. Successful edits are checked by readback
40
40
  `applied`. A later read sees the local result; another session remains independent. These edits
41
41
  do not publish themselves. Use `ghidra merge` to publish the selected context explicitly.
42
42
 
43
- Another session retains its saved native checkout until `ghidra refresh`. The service stops the
44
- worker and calls native Update on that same project: checkout identity survives, the base advances,
43
+ Another session retains its saved native checkout until `ghidra refresh`. The service closes the
44
+ worker's project (keeping its JVM when possible) and calls native Update on that same project: checkout identity survives, the base advances,
45
45
  and local changes merge through Ghidra. Native conflicts reject the whole Update and retain the
46
46
  original working copy/base. Status reports the native conflict description. The legacy scalar
47
47
  `--resolve-conflict` option is unsupported for native decisions; no coordinator winner is invented.
48
48
 
49
49
  Types, signatures, structures and other analysis edits use Ghidra's stock resolvers and native
50
50
  checkout change sets. Divergence alone is not a category conflict. `ghidra merge` performs native
51
- Update, then journaled check-in. Independent read-only history/exact-version buffer verification
52
- precedes any further step. By default the context then stays open: check-in keeps the checkout, and
51
+ Update, then journaled check-in; Ghidra's check-in result establishes the publication, and only a
52
+ lost check-in reply is settled from repository history. By default the context then stays open: check-in keeps the checkout, and
53
53
  the context continues in it at the published version, so an agent can merge repeatedly during one
54
54
  long session without reopening. Backups that Update left and its journals prove disposable are
55
55
  removed. `ghidra merge --close` (or a kept checkout that cannot be proved unchanged) releases and
56
56
  drops the project instead; continued work then receives a fresh checkout. During Update/check-in the
57
57
  warm worker only closes its project and reopens it afterwards at the new base, so the next command
58
58
  needs no new JVM (a worker that ran agent scripts, or whose project cannot be proved released or
59
- reopened, restarts as before); worker/owner restart before publication reopens the same project without packed-snapshot
59
+ reopened, restarts); worker/owner restart before publication reopens the same project without packed-snapshot
60
60
  import.
61
61
 
62
62
  Ordinary saves retain the native DB and lightweight saved-view receipts. Full packed exports are
@@ -81,10 +81,6 @@ reason `runtime_changed` when its context is next used, and an unused one stops
81
81
  `contextIdleMinutes` (default 15, range 1–1440). `maxContexts` (default 4, range 1–16) bounds the
82
82
  workers kept at once; at that limit the longest-idle one is stopped first.
83
83
 
84
- Native acceptance separates macOS GUI/LLDB workflows from selected headless Windows/Linux
85
- SDK, Version Tracking and FID/BSim workflows. Native Windows/Linux debugger/GUI acceptance
86
- remains deferred. CI stays offline and refuses native proofs.
87
-
88
84
  On macOS 15+ ARM64, `ghidra install` delivers an owned LLDB/Python debugger backend;
89
85
  OS debugger authorization remains required. Other host profiles need their supported debugger. Its
90
86
  Ghidra Python dependencies are prepared from the installed SDK wheels into owned GUI storage.
@@ -11,9 +11,15 @@ insight-cli -p RE work create --project client --target TARGET --name Client --r
11
11
  insight-cli -p RE work context --project client --json
12
12
  insight-cli -p RE work import --project client --file functions.json --request-id import-page-1 --json
13
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
14
+ insight-cli -p RE work handoff --lease LEASE --materialize task-a --json
15
+ # write each <rva>/<rva>.cpp and <rva>/<rva>.contract.json named in task-a/submission.json
15
16
  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 submit --lease LEASE --file task-a/submission.json --request-id agent-a-submit-1 --json
18
+ insight-cli -p RE work next --project client --worker agent-b --kind review --request-id agent-b-next-1 --json
19
+ insight-cli -p RE work handoff --lease LEASE --materialize review-b --json
20
+ # decide "approved" and write the note for every entry of review-b/review-manifest.json
21
+ insight-cli -p RE work review --lease LEASE --file review-b/review-manifest.json --request-id agent-b-review-1 --json
22
+ insight-cli -p RE work brief --project client --json
17
23
  insight-cli -p RE work dashboard --project client --json
18
24
  ```
19
25
 
@@ -145,7 +151,7 @@ revision, including functions, dependency records, assignments, events and origi
145
151
  Its final record and returned SHA identify the complete export; artifact payloads remain external.
146
152
  This is a checkpoint projection, not automatic restore or a whole-profile backup.
147
153
 
148
- M0 separates event `revision` from the latest planning barrier `planningRevision`. `next` does not
154
+ The ledger separates event `revision` from the latest planning barrier `planningRevision`. `next` does not
149
155
  need an observed revision. The existing
150
156
  `--expect-revision` accepts an observation between that barrier and the current revision.
151
157
  Heartbeat/claim/release do not change the barrier; structural changes and competing plans do.
@@ -3,14 +3,10 @@ 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.1
6
+ # Insight Artifacts 0.8.3
7
7
 
8
- If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
- with the agent host's normal permission escalation, then use that route for later authorized
10
- CLI calls too. An explicit **no command was sent** denial is known undispatched and can be
11
- retried through that route. Keep HOME, profile and owner state; see
12
- [host execution permissions](references/agent-execution.md). A lost mutation reply needs
13
- request/status recovery, never blind retry.
8
+ AppData/IPC access denied: follow [host execution permissions](references/agent-execution.md).
9
+ A lost mutation reply needs request/status recovery, never a blind retry.
14
10
 
15
11
  Keep evidence as ordinary files in the project's existing layout. This supporting application
16
12
  copies a completed file or stable directory; it has no native runtime to download or install.
@@ -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.
@@ -21,7 +27,7 @@ preserve the project and any `.keep` file.
21
27
 
22
28
  A Ghidra session that ends abruptly can leave unsaved changes as Ghidra recovery data in the
23
29
  working copy. Opening the program would delete them, so `ghidra open` and every native
24
- operation refuse with `blocked` and name the two ways out. Neither needs Ghidra itself:
30
+ operation refuse with `blocked` and name the two ways out; run either with the context closed:
25
31
  `ghidra changes recover-unsaved --session <id> --target <id>` has Ghidra restore those changes
26
32
  and save them into the working copy; `ghidra changes discard-unsaved --session <id> --target <id>`
27
33
  (Destructive) has Ghidra delete them. Saved work stays in both cases, nothing is published, and
@@ -195,51 +201,19 @@ without replay. Unproved native work stays blocked and retained. An unproved pro
195
201
  storage and credential store. Do not delete another session's project, stop a process by guessed
196
202
  PID/port, or blindly repeat a script/external action to turn uncertainty into success.
197
203
 
198
- The older prototype's `workers`, `findings`, `integrate` and batch `recover` commands are not the
199
- public facade API. Its coordinator journals remain separate and are never silently migrated.
200
-
201
204
  A lost UI navigation response can be verified from the live authenticated cursor without another
202
205
  goto. If its original owned GUI process has exited, continuation reports the uncertain UI action
203
206
  as disconnected and retains saved program work. It does not recreate the old cursor or re-enable
204
207
  a previous prompt policy. Other unproved live UI effects remain retained until their outcome is
205
208
  established or the original process is known to have ended.
206
209
 
207
- ## Native unknown attempts and legacy abandonment
210
+ ## Native unknown attempts
208
211
 
209
212
  For native contexts the snapshot-based `ghidra abandon` rollback is unsupported: replacing the
210
213
  DB from a detached snapshot would lose native ancestry and could discard acknowledged private
211
214
  work. Preserve the original project/journal and reconcile provable effects. Do not use discard,
212
215
  GC, another request ID or a new server checkout as evidence that an unknown script did nothing.
213
216
 
214
- The historical snapshot-based abandonment contract below applies only to its retained legacy
215
- fixtures, not to native contexts admitted by the primary CLI.
216
-
217
- ### Historical detached abandonment
218
-
219
- A post-mutation save timeout does not repeat the script or issue another save in the
220
- error handler. Status exposes the original request identity and retained phase/budget.
221
- Arbitrary script effects are never inferred from metadata or from an unverified DB.
222
- After inspecting the retained attempt, explicitly stop only its verified owned worker
223
- (`tools processes`, then `tools processes kill <process>` if required). Resume the
224
- last acknowledged private snapshot with:
225
-
226
- ```sh
227
- insight-cli permissions grant Destructive
228
- insight-cli ghidra abandon --session <session> --target <target> \
229
- --request-id <original-request> --acknowledge-unknown-effects --json
230
- insight-cli ghidra open --session <session> --target <target> --json
231
- ```
232
-
233
- Abandon requires exactly one unresolved private program operation, an unchanged verified
234
- previous snapshot/generation, a stopped original worker and no active publication or live
235
- debugger. It retains the native project, candidate artifacts, original intent/execution and
236
- previous diagnostic result. Its terminal request is `failed` / `state: abandoned` with
237
- `outcome: unknown`; no effect is marked applied. Repeating abandonment retrieves the same
238
- result. Earlier saved private edits remain pending. The original changing request ID cannot
239
- execute again. Abandoning never undoes external effects or establishes what an arbitrary
240
- script did; the acknowledgement explicitly accepts that uncertainty. Publication recovery,
241
- initial import, UI and debugger attempts use their own protocols and cannot use this command.
242
-
243
217
  ## Explicit legacy migration
244
218
 
245
219
  Legacy models require `ghidra migrate --target <target> --dry-run`, then the same
@@ -3,14 +3,10 @@ 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.1
6
+ # Insight Binary 0.8.3
7
7
 
8
- If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
- with the agent host's normal permission escalation, then use that route for later authorized
10
- CLI calls too. An explicit **no command was sent** denial is known undispatched and can be
11
- retried through that route. Keep HOME, profile and owner state; see
12
- [host execution permissions](references/agent-execution.md). A lost mutation reply needs
13
- request/status recovery, never blind retry.
8
+ AppData/IPC access denied: follow [host execution permissions](references/agent-execution.md).
9
+ A lost mutation reply needs request/status recovery, never a blind retry.
14
10
 
15
11
  Keep project RE/evidence conventions. LIEF is an internal packaged library. The native
16
12
  helper is included with insight-cli; no separate download/install, SDK or compiler is
@@ -3,14 +3,10 @@ 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.1
6
+ # Insight Capture 0.8.3
7
7
 
8
- If local help/status reports AppData or IPC access denied, retry that **read-only probe**
9
- with the agent host's normal permission escalation, then use that route for later authorized
10
- CLI calls too. An explicit **no command was sent** denial is known undispatched and can be
11
- retried through that route. Keep HOME, profile and owner state; see
12
- [host execution permissions](references/agent-execution.md). A lost mutation reply needs
13
- request/status recovery, never blind retry.
8
+ AppData/IPC access denied: follow [host execution permissions](references/agent-execution.md).
9
+ A lost mutation reply needs request/status recovery, never a blind retry.
14
10
 
15
11
  Follow project RE and evidence conventions. Use this only for an authorized runtime
16
12
  observation. The current native host/input profile is macOS14+ ARM64 thin Mach-O