@precisionutilityguild/liquid-shadow 1.0.5 → 1.0.6

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.
@@ -1 +1 @@
1
- import{parentPort as c,workerData as h}from"worker_threads";import m from"pino";var y={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},M=m({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(t,e){return{level:t,severity:y[e]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),o=M;var u=process.env.EMBEDDING_MODEL??"Xenova/all-MiniLM-L6-v2",a=process.env.EMBEDDING_DTYPE??"fp32",i=null;async function E(){return i||(i=await import("@xenova/transformers"),i.env.cacheDir=h?.cacheDir||"./.cache",i.env.allowLocalModels=!0),i}var l=null;function p(t=!1){let e=(a||"").toLowerCase(),r={};return a&&(r.dtype=a),t?(r.quantized=!1,r):(e==="fp32"||e==="fp16"||e==="float32"||e==="float16"?r.quantized=!1:e.startsWith("q")&&(r.quantized=!0),r)}async function b(){let{pipeline:t}=await E(),e=p(!1);try{l=await t("feature-extraction",u,e)}catch(r){let n=r?.message||"";if(!(n.includes("/onnx/model_quantized.onnx")||n.includes("model_quantized.onnx")))throw r;o.warn({model:u,dtype:a},"Quantized ONNX artifact missing, retrying with unquantized ONNX"),l=await t("feature-extraction",u,p(!0))}}async function w(t){if(t.length===0)return[];try{let e=await l(t,{pooling:"mean",normalize:!0}),[r,n]=e.dims,s=[];for(let d=0;d<r;d++){let g=d*n,f=g+n;s.push(Array.from(e.data.slice(g,f)))}return s}catch(e){o.error({err:e,batchSize:t.length},"Vectorized batch embedding failed, falling back to sequential");let r=[];for(let n of t){if(!n||n.trim().length===0){r.push(null);continue}try{let s=await l(n,{pooling:"mean",normalize:!0});r.push(Array.from(s.data))}catch{r.push(null)}}return r}}async function v(t){if(t.type==="shutdown"&&process.exit(0),t.type==="embed")try{let e=await w(t.texts),r={type:"result",id:t.id,embeddings:e};c?.postMessage(r)}catch(e){let r={type:"error",id:t.id,error:e instanceof Error?e.message:String(e)};c?.postMessage(r)}}async function z(){await b();let t={type:"ready"};c?.postMessage(t),c?.on("message",e=>{v(e).catch(r=>{o.error({error:r},"Worker error")})})}z().catch(t=>{o.error({error:t},"Failed to initialize embedding worker"),process.exit(1)});
1
+ import{parentPort as c,workerData as E}from"worker_threads";import g from"os";import y from"pino";var M={10:"TRACE",20:"DEBUG",30:"INFO",40:"WARN",50:"ERROR",60:"FATAL"},h=y({level:process.env.LOG_LEVEL||"warn",base:{service:"liquid-shadow"},formatters:{level(e,r){return{level:e,severity:M[r]??"INFO"}}},transport:{target:"pino-pretty",options:{colorize:!0,translateTime:"HH:MM:ss",destination:2,levelKey:"severity",messageKey:"message"}}}),o=h;try{g.setPriority(g.constants.priority.PRIORITY_BELOW_NORMAL)}catch{}var u=process.env.EMBEDDING_MODEL??"Xenova/all-MiniLM-L6-v2",a=process.env.EMBEDDING_DTYPE??"fp32",s=null;async function w(){if(!s){s=await import("@xenova/transformers"),s.env.cacheDir=E?.cacheDir||"./.cache",s.env.allowLocalModels=!0;let{ONNX:e}=s;if(e?.InferenceSession?.create){let r=e.InferenceSession.create.bind(e.InferenceSession);e.InferenceSession.create=(t,n={})=>r(t,{...n,intraOpNumThreads:2,extra:{"session.intra_op.allow_spinning":"0","session.force_spinning_stop":"1","ep.dynamic.workload_type":"Efficient",...n.extra??{}}})}}return s}var l=null;function f(e=!1){let r=(a||"").toLowerCase(),t={};return a&&(t.dtype=a),e?(t.quantized=!1,t):(r==="fp32"||r==="fp16"||r==="float32"||r==="float16"?t.quantized=!1:r.startsWith("q")&&(t.quantized=!0),t)}async function b(){let{pipeline:e}=await w(),r=f(!1);try{l=await e("feature-extraction",u,r)}catch(t){let n=t?.message||"";if(!(n.includes("/onnx/model_quantized.onnx")||n.includes("model_quantized.onnx")))throw t;o.warn({model:u,dtype:a},"Quantized ONNX artifact missing, retrying with unquantized ONNX"),l=await e("feature-extraction",u,f(!0))}}async function v(e){if(e.length===0)return[];try{let r=await l(e,{pooling:"mean",normalize:!0}),[t,n]=r.dims,i=[];for(let d=0;d<t;d++){let p=d*n,m=p+n;i.push(Array.from(r.data.slice(p,m)))}return i}catch(r){o.error({err:r,batchSize:e.length},"Vectorized batch embedding failed, falling back to sequential");let t=[];for(let n of e){if(!n||n.trim().length===0){t.push(null);continue}try{let i=await l(n,{pooling:"mean",normalize:!0});t.push(Array.from(i.data))}catch{t.push(null)}}return t}}async function R(e){if(e.type==="shutdown"&&process.exit(0),e.type==="embed")try{let r=await v(e.texts),t={type:"result",id:e.id,embeddings:r};c?.postMessage(t)}catch(r){let t={type:"error",id:e.id,error:r instanceof Error?r.message:String(r)};c?.postMessage(t)}}async function z(){await b();let e={type:"ready"};c?.postMessage(e),c?.on("message",r=>{R(r).catch(t=>{o.error({error:t},"Worker error")})})}z().catch(e=>{o.error({error:e},"Failed to initialize embedding worker"),process.exit(1)});
@@ -26,6 +26,9 @@ Comprehensive health audit using Shadow analyze toolkit.
26
26
  | **Circular Deps** | `shadow_analyze_debt` (mode: "circular-deps") |
27
27
  | **Layers** | `shadow_recon_topography` — detailed breakdown if needed |
28
28
  | **Config Audit** | `shadow_search_config` (kind: "Env", **showUsage: true**) — find orphaned env vars |
29
+ | **Event Mesh** | `shadow_analyze_mesh` (repoPath) — audit all HTTP routes, socket events, pubsub topics |
30
+ | **Type Integrity** | `shadow_analyze_type_graph` (filePath, repoPath) — interface/type inheritance chains |
31
+ | **Theme Patterns** | `shadow_ops_crystallize_theme` (query, repoPath) — recurring issues across missions |
29
32
 
30
33
  ## 💡 Intelligence Options
31
34
 
@@ -25,22 +25,30 @@ description: Get briefing, pick one mission from next_work_candidates, then work
25
25
  - **Surgical Discovery:** `shadow_analyze_flow` (symbolName, filePath, repoPath).
26
26
  - **Execute Step**: Set in-progress → implement → `shadow_ops_track` (missionId, stepId, status: "completed", contextPivot, repoPath).
27
27
  - **Atomic Logging:** At least once per step. `shadow_ops_log` (missionId, type: "decision", content, symbolName, repoPath).
28
+ - **Inter-agent handoff** (multi-agent pipelines only): When handing off findings to another agent, call `shadow_ops_handoff` (missionId, role, summary, findings, repoPath) to persist a typed artifact with embedding. The receiving agent calls `shadow_ops_handoff_read` (missionId, query, repoPath) to semantically retrieve relevant prior handoffs.
28
29
  - **Seal the mission**: `shadow_ops_track` (missionId, status: "completed", repoPath).
29
30
  - This **auto-triggers**: ADR synthesis, Git Notes persistence, and cascade parent completion (if all sibling missions are also done, the parent auto-completes too).
30
31
  - No need to call `shadow_ops_synthesize` separately — it's automatic on completion.
31
32
  - **Optional — Crystallize** (for long-running missions with many logs): `shadow_ops_crystallize` (missionId, repoPath) compresses raw intent logs into a single crystal summary. Useful mid-mission to keep briefings lean.
33
+ - **Optional — Theme Crystallize** (cross-mission patterns): `shadow_ops_crystallize_theme` (query, repoPath) clusters semantically related intent logs across ALL missions to surface recurring architectural themes. Use when you sense a pattern repeating across missions.
32
34
 
33
35
  ## 🛠 Precise Tooling
34
36
 
35
- | Action | Atomic Tool | Example |
36
- | :--------------------- | :----------------------- | :------------------------------------------------------- |
37
- | **Context (one shot)** | `shadow_ops_context` | repoPath — hologram + chronicle + briefing |
38
- | **Briefing** | `shadow_ops_briefing` | scope: "project", altitude: "orbit", repoPath |
39
- | **Flow Trace** | `shadow_analyze_flow` | symbolName: "handleRequest", filePath, repoPath |
40
- | **Step Update** | `shadow_ops_track` | missionId: 4, stepId: "s2", status: "completed" |
41
- | **Intent Log** | `shadow_ops_log` | missionId: 4, type: "fix", content: "..." |
42
- | **Complete Mission** | `shadow_ops_track` | missionId: 4, status: "completed" — auto-synthesizes ADR |
43
- | **Crystallize** | `shadow_ops_crystallize` | missionId: 4 — compress logs mid-mission |
37
+ | Action | Atomic Tool | Example |
38
+ | :--------------------- | :----------------------------- | :--------------------------------------------------------------- |
39
+ | **Context (one shot)** | `shadow_ops_context` | repoPath — hologram + chronicle + briefing |
40
+ | **Briefing** | `shadow_ops_briefing` | scope: "project", altitude: "orbit", repoPath |
41
+ | **Flow Trace** | `shadow_analyze_flow` | symbolName: "handleRequest", filePath, repoPath |
42
+ | **Step Update** | `shadow_ops_track` | missionId: 4, stepId: "s2", status: "completed" |
43
+ | **Intent Log** | `shadow_ops_log` | missionId: 4, type: "fix", content: "..." |
44
+ | **Complete Mission** | `shadow_ops_track` | missionId: 4, status: "completed" — auto-synthesizes ADR |
45
+ | **Crystallize** | `shadow_ops_crystallize` | missionId: 4 — compress logs mid-mission |
46
+ | **Theme Crystallize** | `shadow_ops_crystallize_theme` | query: "auth patterns" — cross-mission semantic clustering |
47
+ | **Handoff (write)** | `shadow_ops_handoff` | missionId, role: "RECON", summary, findings — persist artifact |
48
+ | **Handoff (read)** | `shadow_ops_handoff_read` | missionId, query: "auth findings" — semantic retrieval |
49
+ | **Event Mesh** | `shadow_analyze_mesh` | repoPath — surface all HTTP routes, socket events, pubsub topics |
50
+ | **Type Graph** | `shadow_analyze_type_graph` | filePath, repoPath — interface/type inheritance map |
51
+ | **Explain Diff** | `shadow_analyze_explain_diff` | fromCommit, toCommit, repoPath — semantic diff narrative |
44
52
 
45
53
  _Note: Always use `symbolName` in `shadow_ops_log` to create Liquid Anchors._
46
54
 
@@ -52,4 +60,4 @@ _Note: Always use `symbolName` in `shadow_ops_log` to create Liquid Anchors._
52
60
 
53
61
  ---
54
62
 
55
- **Tools:** `shadow_ops_context` (optional start), `shadow_ops_briefing`, `shadow_ops_track`, `shadow_ops_log`, `shadow_ops_crystallize`, `shadow_sync_trace`. For discovery: `shadow_search_*`, `shadow_recon_*`, `shadow_analyze_*`.
63
+ **Tools:** `shadow_ops_context` (optional start), `shadow_ops_briefing`, `shadow_ops_track`, `shadow_ops_log`, `shadow_ops_crystallize`, `shadow_ops_crystallize_theme`, `shadow_ops_handoff`, `shadow_ops_handoff_read`, `shadow_sync_trace`. For discovery: `shadow_search_*`, `shadow_recon_*`, `shadow_analyze_*` (including `shadow_analyze_mesh`, `shadow_analyze_type_graph`, `shadow_analyze_explain_diff`).
@@ -23,14 +23,17 @@ Define the objective, strategy, and success criteria for a new mission. This wor
23
23
 
24
24
  ## Precise Tooling
25
25
 
26
- | Setup Action | Precise Tool Call | Usage |
27
- | :-------------------- | :----------------------------------------- | :----------------------------------------------------------- |
28
- | **Session Start** | `shadow_ops_context` | **START HERE** — hologram + chronicle + briefing in one call |
29
- | **Establish Plan** | `shadow_ops_plan` | Create the mission and strategy. |
30
- | **Architectural Map** | `shadow_recon_topography` | Contextualize the target layers (if context wasn't enough). |
31
- | **Detailed Briefing** | `shadow_ops_briefing` (altitude: "ground") | Full analytics, collisions, working sets. |
32
- | **Lean Briefing** | `shadow_ops_briefing` (altitude: "orbit") | Counts + candidates only (~200 tokens). |
33
- | **Graph View** | `shadow_ops_graph` | Visualize the initiative's hierarchy. |
26
+ | Setup Action | Precise Tool Call | Usage |
27
+ | :-------------------- | :----------------------------------------- | :-------------------------------------------------------------------------------------------------- |
28
+ | **Session Start** | `shadow_ops_context` | **START HERE** — hologram + chronicle + briefing in one call |
29
+ | **Establish Plan** | `shadow_ops_plan` | Create the mission and strategy. |
30
+ | **Architectural Map** | `shadow_recon_topography` | Contextualize the target layers (if context wasn't enough). |
31
+ | **Detailed Briefing** | `shadow_ops_briefing` (altitude: "ground") | Full analytics, collisions, working sets. |
32
+ | **Lean Briefing** | `shadow_ops_briefing` (altitude: "orbit") | Counts + candidates only (~200 tokens). |
33
+ | **Graph View** | `shadow_ops_graph` | Visualize the initiative's hierarchy. |
34
+ | **Theme Patterns** | `shadow_ops_crystallize_theme` | Before planning: surface recurring themes across past missions to avoid repeating solved problems. |
35
+ | **Prior Handoffs** | `shadow_ops_handoff_read` | In multi-agent contexts: retrieve typed findings from a prior RECON agent before defining strategy. |
36
+ | **Event Mesh** | `shadow_analyze_mesh` | When planning event-driven or API work: map all HTTP routes, socket events, pubsub topics. |
34
37
 
35
38
  _Note: **Always start with `shadow_ops_context`** for instant mission landscape + architectural context. Ensure the `outcomeContract` is binary and verifiable. Parent initiatives auto-cascade on child completion — no manual closing needed._
36
39
 
@@ -17,19 +17,23 @@ Initialize and analyze a new repository for deep intelligence.
17
17
  5. **Architectural Deep Dive** (optional):
18
18
  - `shadow_recon_topography` (repoPath) — View layers (Entry/Logic/Data/Utility/Test).
19
19
  - `shadow_ops_chronicle` (limit: 5, repoPath) — Narrative feed.
20
- 6. **Hooks Activation**: `shadow_env_hooks` (action: "install", repoPath).
20
+ - `shadow_analyze_mesh` (repoPath) — If repo is event-driven: map HTTP routes, socket events, pubsub topics immediately.
21
+ - `shadow_env_diagnose` (repoPath) — Verify environment health: hooks installed, index state, ember daemon status.
22
+ 6. **Hooks Activation**: `shadow_env_hooks` (action: "install", repoPath) — installs post-commit and **post-checkout** hooks. Post-checkout fires incremental reindex in background on every branch switch.
21
23
  7. **Establish Mission**: `shadow_ops_plan` (name, goal, repoPath).
22
24
 
23
25
  ## Precise Tooling
24
26
 
25
- | Action | Atomic Tool |
26
- | :---------------- | :--------------------------------------------------------------- |
27
- | **Index** | `shadow_recon_onboard` |
28
- | **Hologram** | `shadow_recon_hologram` (repoPath) |
29
- | **Layers** | `shadow_recon_topography` |
30
- | **History** | `shadow_ops_chronicle` (limit: 10) |
31
- | **Resume (lean)** | `shadow_ops_briefing` (scope: "project", altitude: "orbit") |
32
- | **Resume (full)** | `shadow_ops_briefing` (scope: "project", altitude: "atmosphere") |
33
- | **Hooks** | `shadow_env_hooks` (action: "install") |
27
+ | Action | Atomic Tool |
28
+ | :---------------- | :----------------------------------------------------------------------------------- |
29
+ | **Index** | `shadow_recon_onboard` |
30
+ | **Hologram** | `shadow_recon_hologram` (repoPath) |
31
+ | **Layers** | `shadow_recon_topography` |
32
+ | **History** | `shadow_ops_chronicle` (limit: 10) |
33
+ | **Resume (lean)** | `shadow_ops_briefing` (scope: "project", altitude: "orbit") |
34
+ | **Resume (full)** | `shadow_ops_briefing` (scope: "project", altitude: "atmosphere") |
35
+ | **Hooks** | `shadow_env_hooks` (action: "install") |
36
+ | **Env Health** | `shadow_env_diagnose` (repoPath) — hooks status, index state, ember warming progress |
37
+ | **Event Mesh** | `shadow_analyze_mesh` (repoPath) — event-driven repos: routes + topics surface |
34
38
 
35
- _Note: Always use absolute paths for `repoPath`. Call `shadow_recon_hologram` immediately after init for instant architectural context._
39
+ _Note: Always use absolute paths for `repoPath`. Call `shadow_recon_hologram` immediately after init for instant architectural context. `shadow_env_hooks` now installs both post-commit and post-checkout hooks — branch switches will auto-reindex in background via Ember daemon._
@@ -23,12 +23,13 @@ Distill mission logs into an Architectural Decision Record (ADR) and persist it
23
23
 
24
24
  ## Precise Tooling
25
25
 
26
- | Action | Atomic Tool | Usage |
27
- | :-------------------- | :--------------------------------------- | :---------------------------------------------- |
28
- | **Complete & Seal** | `shadow_ops_track` (status: "completed") | **Primary**. Triggers auto-synthesis + cascade. |
29
- | **Manual Distill** | `shadow_ops_synthesize` | Re-run synthesis manually (re-gen only). |
30
- | **Crystallize First** | `shadow_ops_crystallize` | Compress raw logs before synthesis. |
31
- | **View Chronicle** | `shadow_ops_chronicle` | View the combined narrative feed. |
26
+ | Action | Atomic Tool | Usage |
27
+ | :-------------------- | :--------------------------------------- | :---------------------------------------------------------------- |
28
+ | **Complete & Seal** | `shadow_ops_track` (status: "completed") | **Primary**. Triggers auto-synthesis + cascade. |
29
+ | **Manual Distill** | `shadow_ops_synthesize` | Re-run synthesis manually (re-gen only). |
30
+ | **Crystallize First** | `shadow_ops_crystallize` | Compress raw logs before synthesis. |
31
+ | **Theme Crystallize** | `shadow_ops_crystallize_theme` | Cross-mission: cluster semantic themes across ALL missions' logs. |
32
+ | **View Chronicle** | `shadow_ops_chronicle` | View the combined narrative feed. |
32
33
 
33
34
  _Note: Synthesis consolidation includes all child missions recursively. Cascade parent completion propagates upward through the entire hierarchy._
34
35
 
@@ -19,27 +19,33 @@ Find the high-signal path to understanding complex logic.
19
19
  - `shadow_analyze_impact` (symbolName, filePath, depth: 3, repoPath) — Blast radius.
20
20
  - `shadow_analyze_deps` (filePath, direction: "imported_by", repoPath) — Who depends on this?
21
21
  - `shadow_search_concept` (query, repoPath) — Semantic search.
22
+ - `shadow_analyze_mesh` (repoPath) — When the system is event-driven: map all HTTP routes, socket events, pubsub topics and their producers/consumers.
23
+ - `shadow_analyze_type_graph` (filePath, repoPath) — When understanding a type system: interface/class inheritance chains.
22
24
  4. **Mechanics (The How)**:
23
25
  - **For Logic**: `shadow_analyze_flow` (symbolName, filePath, repoPath) — Trace execution.
24
26
  - **For Objects**: `shadow_inspect_file` (filePath, detailLevel: "signatures", repoPath) — All exports.
25
27
  - **For Symbol Deep Dive**: `shadow_inspect_symbol` (symbolName, filePath, context: "full", repoPath) — With deps.
28
+ - **For Change History**: `shadow_analyze_explain_diff` (fromCommit, toCommit, repoPath) — Semantic narrative of what changed and why between commits.
26
29
  5. **Synthesis**: `shadow_ops_log` (missionId, type: "discovery", content, symbolName, repoPath).
27
30
 
28
31
  ## Precise Tooling
29
32
 
30
- | Discovery Layer | Atomic Tool |
31
- | :----------------- | :------------------------------------------------------------------------------------------------ |
32
- | **Session Start** | `shadow_ops_context` (repoPath) — **START HERE** |
33
- | **Hologram** | `shadow_recon_hologram` (repoPath) — if you need standalone hologram |
34
- | **History** | `shadow_ops_chronicle` (limit: 5) — if you need more than 5 from context |
35
- | **Layers** | `shadow_recon_topography` — detailed breakdown |
36
- | **Mission Detail** | `shadow_ops_briefing` (altitude: "ground") — full logs + working set |
37
- | **Blast Radius** | `shadow_analyze_impact` (symbolName, depth: 3) |
38
- | **Dependents** | `shadow_analyze_deps` (filePath, direction: "imported_by") |
39
- | **Flow Trace** | `shadow_analyze_flow` (symbolName, filePath) |
40
- | **Structure** | `shadow_inspect_file` (detailLevel: "signatures") |
41
- | **Deep Dive** | `shadow_inspect_symbol` (context: "full") |
42
- | **File Discovery** | `shadow_search_path` (query, **ranked: true**) — gravity-sorted results with layer classification |
33
+ | Discovery Layer | Atomic Tool |
34
+ | :----------------- | :--------------------------------------------------------------------------------------------------- |
35
+ | **Session Start** | `shadow_ops_context` (repoPath) — **START HERE** |
36
+ | **Hologram** | `shadow_recon_hologram` (repoPath) — if you need standalone hologram |
37
+ | **History** | `shadow_ops_chronicle` (limit: 5) — if you need more than 5 from context |
38
+ | **Layers** | `shadow_recon_topography` — detailed breakdown |
39
+ | **Mission Detail** | `shadow_ops_briefing` (altitude: "ground") — full logs + working set |
40
+ | **Blast Radius** | `shadow_analyze_impact` (symbolName, depth: 3) |
41
+ | **Dependents** | `shadow_analyze_deps` (filePath, direction: "imported_by") |
42
+ | **Flow Trace** | `shadow_analyze_flow` (symbolName, filePath) |
43
+ | **Structure** | `shadow_inspect_file` (detailLevel: "signatures") |
44
+ | **Deep Dive** | `shadow_inspect_symbol` (context: "full") |
45
+ | **File Discovery** | `shadow_search_path` (query, **ranked: true**) — gravity-sorted results with layer classification |
46
+ | **Event Mesh** | `shadow_analyze_mesh` (repoPath) — HTTP routes, socket events, pubsub topics + producers/consumers |
47
+ | **Type Graph** | `shadow_analyze_type_graph` (filePath) — interface/class inheritance chains |
48
+ | **Explain Diff** | `shadow_analyze_explain_diff` (fromCommit, toCommit) — semantic narrative of changes between commits |
43
49
 
44
50
  _Note: **ALWAYS start with `shadow_ops_context`** for instant architectural context + history + mission state in ONE call. Use `context: "definition"` for token-efficient single symbol inspection._
45
51
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.5",
2
+ "version": "1.0.6",
3
3
  "toolsByPrefix": {
4
4
  "RECON": {
5
5
  "subcommands": [
@@ -15,8 +15,11 @@
15
15
  "subcommands": [
16
16
  "debt",
17
17
  "deps",
18
+ "explain_diff",
18
19
  "flow",
19
- "impact"
20
+ "impact",
21
+ "mesh",
22
+ "type_graph"
20
23
  ],
21
24
  "description": "Calculate blast radius and Strategic Risk Scoring of changing a symbol."
22
25
  },
@@ -35,12 +38,16 @@
35
38
  "chronicle",
36
39
  "context",
37
40
  "crystallize",
41
+ "crystallize_theme",
38
42
  "graph",
43
+ "handoff",
44
+ "handoff_read",
39
45
  "health",
40
46
  "log",
41
47
  "plan",
42
48
  "synthesize",
43
- "track"
49
+ "track",
50
+ "working_set_check"
44
51
  ],
45
52
  "description": "Create a new development mission or strategic initiative with goals and strategy."
46
53
  },
@@ -57,7 +64,7 @@
57
64
  "repair",
58
65
  "trace"
59
66
  ],
60
- "description": "Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state."
67
+ "description": "Full lifecycle synchronization - Repairs index, analyzes changes, and re-hydrates state. Lifecycle status mutation is opt-in via flags."
61
68
  },
62
69
  "ENV": {
63
70
  "subcommands": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@precisionutilityguild/liquid-shadow",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Tactical Repository Intelligence Operative - Liquid Shadow Ecosystem",
5
5
  "homepage": "https://liquidshadow.pugcorp.online/",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "dev": "tsx src/entry/cli/index.ts",
42
42
  "mcp": "tsx src/entry/mcp/server.ts",
43
43
  "start": "node dist/entry/cli/index.js",
44
- "start-mcp": "node dist/mcp/server.js",
44
+ "start-mcp": "node dist/entry/mcp/server.js",
45
45
  "lint": "tsc --noEmit",
46
46
  "test": "vitest run",
47
47
  "test:watch": "vitest",
@@ -26,6 +26,9 @@ Comprehensive health audit using Shadow analyze toolkit.
26
26
  | **Circular Deps** | `shadow_analyze_debt` (mode: "circular-deps") |
27
27
  | **Layers** | `shadow_recon_topography` — detailed breakdown if needed |
28
28
  | **Config Audit** | `shadow_search_config` (kind: "Env", **showUsage: true**) — find orphaned env vars |
29
+ | **Event Mesh** | `shadow_analyze_mesh` (repoPath) — audit all HTTP routes, socket events, pubsub topics |
30
+ | **Type Integrity** | `shadow_analyze_type_graph` (filePath, repoPath) — interface/type inheritance chains |
31
+ | **Theme Patterns** | `shadow_ops_crystallize_theme` (query, repoPath) — recurring issues across missions |
29
32
 
30
33
  ## 💡 Intelligence Options
31
34
 
@@ -25,22 +25,30 @@ description: Get briefing, pick one mission from next_work_candidates, then work
25
25
  - **Surgical Discovery:** `shadow_analyze_flow` (symbolName, filePath, repoPath).
26
26
  - **Execute Step**: Set in-progress → implement → `shadow_ops_track` (missionId, stepId, status: "completed", contextPivot, repoPath).
27
27
  - **Atomic Logging:** At least once per step. `shadow_ops_log` (missionId, type: "decision", content, symbolName, repoPath).
28
+ - **Inter-agent handoff** (multi-agent pipelines only): When handing off findings to another agent, call `shadow_ops_handoff` (missionId, role, summary, findings, repoPath) to persist a typed artifact with embedding. The receiving agent calls `shadow_ops_handoff_read` (missionId, query, repoPath) to semantically retrieve relevant prior handoffs.
28
29
  - **Seal the mission**: `shadow_ops_track` (missionId, status: "completed", repoPath).
29
30
  - This **auto-triggers**: ADR synthesis, Git Notes persistence, and cascade parent completion (if all sibling missions are also done, the parent auto-completes too).
30
31
  - No need to call `shadow_ops_synthesize` separately — it's automatic on completion.
31
32
  - **Optional — Crystallize** (for long-running missions with many logs): `shadow_ops_crystallize` (missionId, repoPath) compresses raw intent logs into a single crystal summary. Useful mid-mission to keep briefings lean.
33
+ - **Optional — Theme Crystallize** (cross-mission patterns): `shadow_ops_crystallize_theme` (query, repoPath) clusters semantically related intent logs across ALL missions to surface recurring architectural themes. Use when you sense a pattern repeating across missions.
32
34
 
33
35
  ## 🛠 Precise Tooling
34
36
 
35
- | Action | Atomic Tool | Example |
36
- | :--------------------- | :----------------------- | :------------------------------------------------------- |
37
- | **Context (one shot)** | `shadow_ops_context` | repoPath — hologram + chronicle + briefing |
38
- | **Briefing** | `shadow_ops_briefing` | scope: "project", altitude: "orbit", repoPath |
39
- | **Flow Trace** | `shadow_analyze_flow` | symbolName: "handleRequest", filePath, repoPath |
40
- | **Step Update** | `shadow_ops_track` | missionId: 4, stepId: "s2", status: "completed" |
41
- | **Intent Log** | `shadow_ops_log` | missionId: 4, type: "fix", content: "..." |
42
- | **Complete Mission** | `shadow_ops_track` | missionId: 4, status: "completed" — auto-synthesizes ADR |
43
- | **Crystallize** | `shadow_ops_crystallize` | missionId: 4 — compress logs mid-mission |
37
+ | Action | Atomic Tool | Example |
38
+ | :--------------------- | :----------------------------- | :--------------------------------------------------------------- |
39
+ | **Context (one shot)** | `shadow_ops_context` | repoPath — hologram + chronicle + briefing |
40
+ | **Briefing** | `shadow_ops_briefing` | scope: "project", altitude: "orbit", repoPath |
41
+ | **Flow Trace** | `shadow_analyze_flow` | symbolName: "handleRequest", filePath, repoPath |
42
+ | **Step Update** | `shadow_ops_track` | missionId: 4, stepId: "s2", status: "completed" |
43
+ | **Intent Log** | `shadow_ops_log` | missionId: 4, type: "fix", content: "..." |
44
+ | **Complete Mission** | `shadow_ops_track` | missionId: 4, status: "completed" — auto-synthesizes ADR |
45
+ | **Crystallize** | `shadow_ops_crystallize` | missionId: 4 — compress logs mid-mission |
46
+ | **Theme Crystallize** | `shadow_ops_crystallize_theme` | query: "auth patterns" — cross-mission semantic clustering |
47
+ | **Handoff (write)** | `shadow_ops_handoff` | missionId, role: "RECON", summary, findings — persist artifact |
48
+ | **Handoff (read)** | `shadow_ops_handoff_read` | missionId, query: "auth findings" — semantic retrieval |
49
+ | **Event Mesh** | `shadow_analyze_mesh` | repoPath — surface all HTTP routes, socket events, pubsub topics |
50
+ | **Type Graph** | `shadow_analyze_type_graph` | filePath, repoPath — interface/type inheritance map |
51
+ | **Explain Diff** | `shadow_analyze_explain_diff` | fromCommit, toCommit, repoPath — semantic diff narrative |
44
52
 
45
53
  _Note: Always use `symbolName` in `shadow_ops_log` to create Liquid Anchors._
46
54
 
@@ -52,4 +60,4 @@ _Note: Always use `symbolName` in `shadow_ops_log` to create Liquid Anchors._
52
60
 
53
61
  ---
54
62
 
55
- **Tools:** `shadow_ops_context` (optional start), `shadow_ops_briefing`, `shadow_ops_track`, `shadow_ops_log`, `shadow_ops_crystallize`, `shadow_sync_trace`. For discovery: `shadow_search_*`, `shadow_recon_*`, `shadow_analyze_*`.
63
+ **Tools:** `shadow_ops_context` (optional start), `shadow_ops_briefing`, `shadow_ops_track`, `shadow_ops_log`, `shadow_ops_crystallize`, `shadow_ops_crystallize_theme`, `shadow_ops_handoff`, `shadow_ops_handoff_read`, `shadow_sync_trace`. For discovery: `shadow_search_*`, `shadow_recon_*`, `shadow_analyze_*` (including `shadow_analyze_mesh`, `shadow_analyze_type_graph`, `shadow_analyze_explain_diff`).
@@ -23,14 +23,17 @@ Define the objective, strategy, and success criteria for a new mission. This wor
23
23
 
24
24
  ## Precise Tooling
25
25
 
26
- | Setup Action | Precise Tool Call | Usage |
27
- | :-------------------- | :----------------------------------------- | :----------------------------------------------------------- |
28
- | **Session Start** | `shadow_ops_context` | **START HERE** — hologram + chronicle + briefing in one call |
29
- | **Establish Plan** | `shadow_ops_plan` | Create the mission and strategy. |
30
- | **Architectural Map** | `shadow_recon_topography` | Contextualize the target layers (if context wasn't enough). |
31
- | **Detailed Briefing** | `shadow_ops_briefing` (altitude: "ground") | Full analytics, collisions, working sets. |
32
- | **Lean Briefing** | `shadow_ops_briefing` (altitude: "orbit") | Counts + candidates only (~200 tokens). |
33
- | **Graph View** | `shadow_ops_graph` | Visualize the initiative's hierarchy. |
26
+ | Setup Action | Precise Tool Call | Usage |
27
+ | :-------------------- | :----------------------------------------- | :-------------------------------------------------------------------------------------------------- |
28
+ | **Session Start** | `shadow_ops_context` | **START HERE** — hologram + chronicle + briefing in one call |
29
+ | **Establish Plan** | `shadow_ops_plan` | Create the mission and strategy. |
30
+ | **Architectural Map** | `shadow_recon_topography` | Contextualize the target layers (if context wasn't enough). |
31
+ | **Detailed Briefing** | `shadow_ops_briefing` (altitude: "ground") | Full analytics, collisions, working sets. |
32
+ | **Lean Briefing** | `shadow_ops_briefing` (altitude: "orbit") | Counts + candidates only (~200 tokens). |
33
+ | **Graph View** | `shadow_ops_graph` | Visualize the initiative's hierarchy. |
34
+ | **Theme Patterns** | `shadow_ops_crystallize_theme` | Before planning: surface recurring themes across past missions to avoid repeating solved problems. |
35
+ | **Prior Handoffs** | `shadow_ops_handoff_read` | In multi-agent contexts: retrieve typed findings from a prior RECON agent before defining strategy. |
36
+ | **Event Mesh** | `shadow_analyze_mesh` | When planning event-driven or API work: map all HTTP routes, socket events, pubsub topics. |
34
37
 
35
38
  _Note: **Always start with `shadow_ops_context`** for instant mission landscape + architectural context. Ensure the `outcomeContract` is binary and verifiable. Parent initiatives auto-cascade on child completion — no manual closing needed._
36
39
 
@@ -17,19 +17,23 @@ Initialize and analyze a new repository for deep intelligence.
17
17
  5. **Architectural Deep Dive** (optional):
18
18
  - `shadow_recon_topography` (repoPath) — View layers (Entry/Logic/Data/Utility/Test).
19
19
  - `shadow_ops_chronicle` (limit: 5, repoPath) — Narrative feed.
20
- 6. **Hooks Activation**: `shadow_env_hooks` (action: "install", repoPath).
20
+ - `shadow_analyze_mesh` (repoPath) — If repo is event-driven: map HTTP routes, socket events, pubsub topics immediately.
21
+ - `shadow_env_diagnose` (repoPath) — Verify environment health: hooks installed, index state, ember daemon status.
22
+ 6. **Hooks Activation**: `shadow_env_hooks` (action: "install", repoPath) — installs post-commit and **post-checkout** hooks. Post-checkout fires incremental reindex in background on every branch switch.
21
23
  7. **Establish Mission**: `shadow_ops_plan` (name, goal, repoPath).
22
24
 
23
25
  ## Precise Tooling
24
26
 
25
- | Action | Atomic Tool |
26
- | :---------------- | :--------------------------------------------------------------- |
27
- | **Index** | `shadow_recon_onboard` |
28
- | **Hologram** | `shadow_recon_hologram` (repoPath) |
29
- | **Layers** | `shadow_recon_topography` |
30
- | **History** | `shadow_ops_chronicle` (limit: 10) |
31
- | **Resume (lean)** | `shadow_ops_briefing` (scope: "project", altitude: "orbit") |
32
- | **Resume (full)** | `shadow_ops_briefing` (scope: "project", altitude: "atmosphere") |
33
- | **Hooks** | `shadow_env_hooks` (action: "install") |
27
+ | Action | Atomic Tool |
28
+ | :---------------- | :----------------------------------------------------------------------------------- |
29
+ | **Index** | `shadow_recon_onboard` |
30
+ | **Hologram** | `shadow_recon_hologram` (repoPath) |
31
+ | **Layers** | `shadow_recon_topography` |
32
+ | **History** | `shadow_ops_chronicle` (limit: 10) |
33
+ | **Resume (lean)** | `shadow_ops_briefing` (scope: "project", altitude: "orbit") |
34
+ | **Resume (full)** | `shadow_ops_briefing` (scope: "project", altitude: "atmosphere") |
35
+ | **Hooks** | `shadow_env_hooks` (action: "install") |
36
+ | **Env Health** | `shadow_env_diagnose` (repoPath) — hooks status, index state, ember warming progress |
37
+ | **Event Mesh** | `shadow_analyze_mesh` (repoPath) — event-driven repos: routes + topics surface |
34
38
 
35
- _Note: Always use absolute paths for `repoPath`. Call `shadow_recon_hologram` immediately after init for instant architectural context._
39
+ _Note: Always use absolute paths for `repoPath`. Call `shadow_recon_hologram` immediately after init for instant architectural context. `shadow_env_hooks` now installs both post-commit and post-checkout hooks — branch switches will auto-reindex in background via Ember daemon._
@@ -23,12 +23,13 @@ Distill mission logs into an Architectural Decision Record (ADR) and persist it
23
23
 
24
24
  ## Precise Tooling
25
25
 
26
- | Action | Atomic Tool | Usage |
27
- | :-------------------- | :--------------------------------------- | :---------------------------------------------- |
28
- | **Complete & Seal** | `shadow_ops_track` (status: "completed") | **Primary**. Triggers auto-synthesis + cascade. |
29
- | **Manual Distill** | `shadow_ops_synthesize` | Re-run synthesis manually (re-gen only). |
30
- | **Crystallize First** | `shadow_ops_crystallize` | Compress raw logs before synthesis. |
31
- | **View Chronicle** | `shadow_ops_chronicle` | View the combined narrative feed. |
26
+ | Action | Atomic Tool | Usage |
27
+ | :-------------------- | :--------------------------------------- | :---------------------------------------------------------------- |
28
+ | **Complete & Seal** | `shadow_ops_track` (status: "completed") | **Primary**. Triggers auto-synthesis + cascade. |
29
+ | **Manual Distill** | `shadow_ops_synthesize` | Re-run synthesis manually (re-gen only). |
30
+ | **Crystallize First** | `shadow_ops_crystallize` | Compress raw logs before synthesis. |
31
+ | **Theme Crystallize** | `shadow_ops_crystallize_theme` | Cross-mission: cluster semantic themes across ALL missions' logs. |
32
+ | **View Chronicle** | `shadow_ops_chronicle` | View the combined narrative feed. |
32
33
 
33
34
  _Note: Synthesis consolidation includes all child missions recursively. Cascade parent completion propagates upward through the entire hierarchy._
34
35
 
@@ -19,27 +19,33 @@ Find the high-signal path to understanding complex logic.
19
19
  - `shadow_analyze_impact` (symbolName, filePath, depth: 3, repoPath) — Blast radius.
20
20
  - `shadow_analyze_deps` (filePath, direction: "imported_by", repoPath) — Who depends on this?
21
21
  - `shadow_search_concept` (query, repoPath) — Semantic search.
22
+ - `shadow_analyze_mesh` (repoPath) — When the system is event-driven: map all HTTP routes, socket events, pubsub topics and their producers/consumers.
23
+ - `shadow_analyze_type_graph` (filePath, repoPath) — When understanding a type system: interface/class inheritance chains.
22
24
  4. **Mechanics (The How)**:
23
25
  - **For Logic**: `shadow_analyze_flow` (symbolName, filePath, repoPath) — Trace execution.
24
26
  - **For Objects**: `shadow_inspect_file` (filePath, detailLevel: "signatures", repoPath) — All exports.
25
27
  - **For Symbol Deep Dive**: `shadow_inspect_symbol` (symbolName, filePath, context: "full", repoPath) — With deps.
28
+ - **For Change History**: `shadow_analyze_explain_diff` (fromCommit, toCommit, repoPath) — Semantic narrative of what changed and why between commits.
26
29
  5. **Synthesis**: `shadow_ops_log` (missionId, type: "discovery", content, symbolName, repoPath).
27
30
 
28
31
  ## Precise Tooling
29
32
 
30
- | Discovery Layer | Atomic Tool |
31
- | :----------------- | :------------------------------------------------------------------------------------------------ |
32
- | **Session Start** | `shadow_ops_context` (repoPath) — **START HERE** |
33
- | **Hologram** | `shadow_recon_hologram` (repoPath) — if you need standalone hologram |
34
- | **History** | `shadow_ops_chronicle` (limit: 5) — if you need more than 5 from context |
35
- | **Layers** | `shadow_recon_topography` — detailed breakdown |
36
- | **Mission Detail** | `shadow_ops_briefing` (altitude: "ground") — full logs + working set |
37
- | **Blast Radius** | `shadow_analyze_impact` (symbolName, depth: 3) |
38
- | **Dependents** | `shadow_analyze_deps` (filePath, direction: "imported_by") |
39
- | **Flow Trace** | `shadow_analyze_flow` (symbolName, filePath) |
40
- | **Structure** | `shadow_inspect_file` (detailLevel: "signatures") |
41
- | **Deep Dive** | `shadow_inspect_symbol` (context: "full") |
42
- | **File Discovery** | `shadow_search_path` (query, **ranked: true**) — gravity-sorted results with layer classification |
33
+ | Discovery Layer | Atomic Tool |
34
+ | :----------------- | :--------------------------------------------------------------------------------------------------- |
35
+ | **Session Start** | `shadow_ops_context` (repoPath) — **START HERE** |
36
+ | **Hologram** | `shadow_recon_hologram` (repoPath) — if you need standalone hologram |
37
+ | **History** | `shadow_ops_chronicle` (limit: 5) — if you need more than 5 from context |
38
+ | **Layers** | `shadow_recon_topography` — detailed breakdown |
39
+ | **Mission Detail** | `shadow_ops_briefing` (altitude: "ground") — full logs + working set |
40
+ | **Blast Radius** | `shadow_analyze_impact` (symbolName, depth: 3) |
41
+ | **Dependents** | `shadow_analyze_deps` (filePath, direction: "imported_by") |
42
+ | **Flow Trace** | `shadow_analyze_flow` (symbolName, filePath) |
43
+ | **Structure** | `shadow_inspect_file` (detailLevel: "signatures") |
44
+ | **Deep Dive** | `shadow_inspect_symbol` (context: "full") |
45
+ | **File Discovery** | `shadow_search_path` (query, **ranked: true**) — gravity-sorted results with layer classification |
46
+ | **Event Mesh** | `shadow_analyze_mesh` (repoPath) — HTTP routes, socket events, pubsub topics + producers/consumers |
47
+ | **Type Graph** | `shadow_analyze_type_graph` (filePath) — interface/class inheritance chains |
48
+ | **Explain Diff** | `shadow_analyze_explain_diff` (fromCommit, toCommit) — semantic narrative of changes between commits |
43
49
 
44
50
  _Note: **ALWAYS start with `shadow_ops_context`** for instant architectural context + history + mission state in ONE call. Use `context: "definition"` for token-efficient single symbol inspection._
45
51