@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,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.
@@ -3,7 +3,7 @@ name: insight-sevenzip
3
3
  description: Inventory, integrity-check and recover files from archives and supported containers with insight-cli 7-Zip, then hand recovered binaries or configuration to the appropriate research tool.
4
4
  ---
5
5
 
6
- # Insight 7-Zip 0.8.0
6
+ # Insight 7-Zip 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-strace
3
3
  description: Observe actual file reads, writes, process creation and network syscalls in an authorized owned native Linux launch using insight-cli strace. Use when static inference needs concrete operating-system interaction evidence.
4
4
  ---
5
5
 
6
- # Insight strace 0.8.0
6
+ # Insight strace 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-tshark
3
3
  description: Inspect an offline PCAP or PCAPNG with insight-cli tshark to identify protocols, HTTP/DNS/TLS fields, packet evidence and reconstructed TCP/UDP streams. Use for captured traffic questions; live acquisition and TLS decryption are separate tasks.
4
4
  ---
5
5
 
6
- # Insight TShark 0.8.0
6
+ # Insight TShark 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-windbg
3
3
  description: Investigate Windows native user-mode minidumps using bounded stacks, threads, registers, modules, memory and disassembly through insight-cli windbg. Use on Windows x64 when a captured runtime state needs native debugger evidence.
4
4
  ---
5
5
 
6
- # Insight WinDbg 0.8.0
6
+ # Insight WinDbg 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