@a-company/paradigm 6.2.0 → 6.3.0

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 (31) hide show
  1. package/dist/arch-loader-T3TARMSO.js +2 -0
  2. package/dist/chunk-32XL3FIQ.js +2 -0
  3. package/dist/chunk-ARLB6YYW.js +3 -0
  4. package/dist/chunk-EMGJWT7D.js +111 -0
  5. package/dist/chunk-SRWROALW.js +666 -0
  6. package/dist/chunk-SU5F5D4I.js +3 -0
  7. package/dist/{enforcement-46XWPNSA.js → enforcement-FXO6IYYE.js} +1 -1
  8. package/dist/{enforcement-BEGPQIUN.js → enforcement-VRE3WZOI.js} +1 -1
  9. package/dist/index.js +2 -2
  10. package/dist/mcp.js +3 -52
  11. package/dist/reindex-PJVOMN57.js +2 -0
  12. package/dist/rune-promotion-3JQ5LMWK.js +3 -0
  13. package/dist/{shift-3ATE2ONQ.js → shift-6Y3KQP62.js} +2 -2
  14. package/dist/tools-2XPMZZBT.js +2 -0
  15. package/dist/university-content/notes/N-para-001-shift-setup.md +2 -2
  16. package/dist/university-content/notes/N-para-301-enforcement-levels.md +18 -11
  17. package/dist/university-content/notes/N-para-301-paradigm-shift.md +2 -2
  18. package/dist/university-content/notes/N-para-301-rune-promotion.md +69 -0
  19. package/dist/university-content/notes/N-para-501-hook-enforcement.md +3 -1
  20. package/dist/university-content/notes/N-para-701-orchestration-enforcement.md +10 -1
  21. package/dist/university-content/quizzes/Q-para-301-enforcement-levels.yaml +21 -1
  22. package/dist/university-content/quizzes/Q-para-701-orchestration-enforcement.yaml +11 -1
  23. package/dist/university-ui/assets/{index-CkgaxOXi.js → index-SNyIB61M.js} +2 -2
  24. package/dist/university-ui/assets/{index-CkgaxOXi.js.map → index-SNyIB61M.js.map} +1 -1
  25. package/dist/university-ui/index.html +1 -1
  26. package/package.json +1 -1
  27. package/dist/chunk-K7EQHFZP.js +0 -111
  28. package/dist/chunk-KYA4TP26.js +0 -2
  29. package/dist/chunk-UMC4RC66.js +0 -636
  30. package/dist/reindex-GSRV4MQO.js +0 -2
  31. package/dist/tools-F34P22PW.js +0 -2
package/dist/mcp.js CHANGED
@@ -1,54 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {d,g,h,e,a as a$1,b as b$1,f,c}from'./chunk-UMC4RC66.js';import'./chunk-4UJ4NIEQ.js';import'./chunk-4N56FRNE.js';import'./chunk-Q527BPUF.js';import'./chunk-KLBH26PA.js';import'./chunk-JNSJVCTU.js';import'./chunk-XROULIQN.js';import'./chunk-ZUAUFZRJ.js';import'./chunk-3KVVC4WV.js';import {m as m$1,n,p,h as h$1,i,ua}from'./chunk-K7EQHFZP.js';import'./chunk-M4UMM6DC.js';import'./chunk-GRZQIKST.js';import'./chunk-KAFQA7HV.js';import {j as j$1}from'./chunk-6QXBXZF6.js';import {b,a}from'./chunk-EK4ZRIFJ.js';import'./chunk-LAYBUKMB.js';import'./chunk-DVZWCXB6.js';import'./chunk-QGZRM6ZB.js';import'./chunk-K7X3Z3GL.js';import'./chunk-5TAVYPOV.js';import {Server}from'@modelcontextprotocol/sdk/server/index.js';import {StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import {ListResourcesRequestSchema,ReadResourceRequestSchema}from'@modelcontextprotocol/sdk/types.js';import*as l from'fs';import*as m from'path';function se(e){return {id:e.id,symbol:`^${e.id}`,description:e.description,locks:e.locks?.map(s=>({id:s.id,description:s.description,keys:s.keys?.map(n=>n.expression||n),mode:s.mode||"all"})),prizes:e.prizes?.map(s=>({id:s.id,oneTime:s.oneTime}))}}function F(e){let s=e.gateConfig?.gates||[],n=i(e.index,"gate"),t=new Map;for(let o of n){let i=o.symbol.replace(/^\^/,"");t.set(i,{id:i,symbol:o.symbol,description:o.description,source:"purpose",filePath:o.filePath,data:o.data});}for(let o of s)t.set(o.id,{...se(o),source:"portal.yaml"});return Array.from(t.values())}function I(e){let s=e.gateConfig?.flows||[],n=i(e.index,"flow"),t=new Map;for(let o of n){let i=o.symbol.replace(/^\$/,"");t.set(i,{id:i,symbol:o.symbol,description:o.description,source:"purpose",filePath:o.filePath,data:o.data});}for(let o of s)t.set(o.id,{id:o.id,symbol:`$${o.id}`,description:o.description,gates:o.gates,source:"portal.yaml"});return Array.from(t.values())}function U(){return [{uri:"paradigm://wisdom/preferences",name:"Wisdom - Preferences",description:"Team preferences for patterns, testing, and code style",mimeType:"application/json"},{uri:"paradigm://wisdom/antipatterns",name:"Wisdom - Antipatterns",description:"What NOT to do, with reasons and alternatives",mimeType:"application/json"},{uri:"paradigm://wisdom/decisions",name:"Wisdom - Decisions",description:"Architectural Decision Records (ADRs) index",mimeType:"application/json"}]}async function z(e$1,s){if(e$1==="wisdom/preferences"){let n=await e(s);return {handled:true,text:JSON.stringify({version:n.preferences?.version||"1.0",global:n.preferences?.global||{},by_symbol:n.preferences?.by_symbol||{},symbol_count:Object.keys(n.preferences?.by_symbol||{}).length},null,2)}}if(e$1.startsWith("wisdom/preferences/")){let n=decodeURIComponent(e$1.replace("wisdom/preferences/","")),t=await e(s),o=a$1(t,n);return {handled:true,text:JSON.stringify({symbol:n,preferences:o.preferences,global:t.preferences?.global||{}},null,2)}}if(e$1==="wisdom/antipatterns"){let n=await e(s);return {handled:true,text:JSON.stringify({count:n.antipatterns.length,antipatterns:n.antipatterns},null,2)}}if(e$1.startsWith("wisdom/antipatterns/")){let n=decodeURIComponent(e$1.replace("wisdom/antipatterns/","")),t=await e(s),o=a$1(t,n);return {handled:true,text:JSON.stringify({symbol:n,count:o.antipatterns.length,antipatterns:o.antipatterns},null,2)}}if(e$1==="wisdom/decisions"){let n=await e(s);return {handled:true,text:JSON.stringify({count:n.decisions.length,decisions:n.decisions.map(t=>({id:t.id,title:t.title,status:t.status,date:t.date,symbols:t.symbols}))},null,2)}}if(e$1.startsWith("wisdom/decision/")){let n=e$1.replace("wisdom/decision/",""),t=await e(s),o=t.decisions.find(i=>i.id===n);return o?{handled:true,text:JSON.stringify(o,null,2)}:{handled:true,text:JSON.stringify({error:"Decision not found",id:n,available:t.decisions.map(i=>i.id)},null,2)}}if(e$1.startsWith("wisdom/expertise/")){let n=decodeURIComponent(e$1.replace("wisdom/expertise/","")),t=await e(s),o=b$1(t,{symbol:n});return {handled:true,text:JSON.stringify({symbol:n,count:o.length,experts:o.map(i=>({name:i.name,symbols:i.symbols,areas:i.areas,contact:i.contact}))},null,2)}}return {handled:false,text:""}}function G(){return [{uri:"paradigm://history/fragile",name:"History - Fragile Symbols",description:"Symbols with high fragility that need extra care when modifying",mimeType:"application/json"},{uri:"paradigm://history/validation/summary",name:"History - Validation Summary",description:"Overall validation statistics and pass rates",mimeType:"application/json"}]}async function $(e,s){if(e.startsWith("history/symbol/")&&!e.endsWith("/recent")){let n=decodeURIComponent(e.replace("history/symbol/","")),t=await f(s),o=c(t,n);return {handled:true,text:JSON.stringify({symbol:n,summary:o.summary?{total_changes:o.summary.total_changes,last_modified:o.summary.last_modified,stability_score:o.summary.stability_score,fragility:o.summary.fragility,contributors:o.summary.contributors}:null,recent:o.recent,co_changes:o.co_changes,validation:o.validation},null,2)}}if(e.startsWith("history/symbol/")&&e.endsWith("/recent")){let n=decodeURIComponent(e.replace("history/symbol/","").replace("/recent","")),t=await f(s),o=c(t,n);return {handled:true,text:JSON.stringify({symbol:n,fragility:o.summary?.fragility||"unknown",stability_score:o.summary?.stability_score,recent:o.recent.slice(0,5)},null,2)}}if(e==="history/fragile"){let n=await f(s);return {handled:true,text:JSON.stringify({count:n.index?.fragile_symbols?.length||0,fragile_symbols:n.index?.fragile_symbols||[],recommendation:"Consider adding extra test coverage and reviewing recent changes before modifying these symbols"},null,2)}}if(e.startsWith("history/cochanges/")){let n=decodeURIComponent(e.replace("history/cochanges/","")),o=(await f(s)).index?.co_changes?.filter(i=>i.symbols.includes(n))||[];return {handled:true,text:JSON.stringify({symbol:n,count:o.length,co_changes:o.map(i=>({with:i.symbols.filter(r=>r!==n),frequency:i.frequency,correlation:i.correlation})),recommendation:o.length>0?"These symbols often change together - consider if they need updates too":"No strong co-change patterns detected"},null,2)}}if(e==="history/validation/summary"){let n=await f(s);return {handled:true,text:JSON.stringify({last_run:n.validation?.last_run,total_validations:n.validation?.total_validations||0,pass_rate:n.validation?.pass_rate||0,by_symbol:n.validation?.by_symbol||{}},null,2)}}return {handled:false,text:""}}function q(){return [{uri:"paradigm://context/agent-protocol",name:"Agent Protocol",description:"IMPORTANT: Read this first. Workflow instructions for using Paradigm MCP tools effectively.",mimeType:"text/markdown"},{uri:"paradigm://context/session",name:"Session Info",description:"Current MCP session statistics and context usage estimate",mimeType:"application/json"},{uri:"paradigm://context/handoff-guide",name:"Handoff Guide",description:"When and how to perform context handoffs",mimeType:"text/markdown"}]}async function H(e,s){if(e==="context/agent-protocol")return {handled:true,text:`# Agent Protocol for Paradigm MCP Tools
3
-
4
- ## Query Before Modify
5
-
6
- **Always query before making changes** - this ensures you understand impact and dependencies.
7
-
8
- | Before doing this... | Call this MCP tool |
9
- |---------------------|-------------------|
10
- | Modifying a symbol | \`paradigm_ripple\` with the symbol |
11
- | Starting a session | \`paradigm_status\` for project overview |
12
- | Understanding code | \`paradigm_navigate\` with explore intent |
13
- | Checking dependencies | \`paradigm_related\` for connections |
14
-
15
- ## Example Workflow
16
-
17
- 1. **Get oriented**: Call \`paradigm_status\` to see project symbols and health
18
- 2. **Find relevant code**: Call \`paradigm_navigate\` with intent "find" or "explore"
19
- 3. **Before editing**: Call \`paradigm_ripple\` on symbols you'll modify
20
- 4. **Check context**: Call \`paradigm_session_health\` every 10-15 tool calls
21
-
22
- ## Benefits
23
-
24
- - **Fresh data**: Always current from live project index
25
- - **Precise**: Only get the data you need
26
- - **Token-efficient**: ~100 tokens per query vs ~2000 for reading files
27
-
28
- ## Context Monitoring
29
-
30
- Call \`paradigm_session_health\` periodically to monitor session health:
31
- - **<50%**: Continue working
32
- - **50-70%**: Plan a stopping point
33
- - **70-85%**: Prepare handoff soon
34
- - **>85%**: Handoff after current task
35
-
36
- ## Available Tools Summary
37
-
38
- | Tool | Purpose |
39
- |------|---------|
40
- | \`paradigm_status\` | Project overview and health |
41
- | \`paradigm_search\` | Find symbols by name/description |
42
- | \`paradigm_ripple\` | Impact analysis before changes |
43
- | \`paradigm_related\` | Symbol dependencies |
44
- | \`paradigm_navigate\` | Codebase exploration |
45
- | \`paradigm_session_health\` | Session health monitoring |
46
- | \`paradigm_handoff_prepare\` | Prepare context handoff |
47
-
48
- ---
49
-
50
- *This protocol ensures efficient, safe modifications to the codebase.*
51
- `};if(e==="context/session"){let n=j$1(),t=n.getStats(),o=n.getDurationMinutes();return {handled:true,text:JSON.stringify({session:{durationMinutes:o,startTime:new Date(t.startTime).toISOString(),lastActivity:new Date(t.lastActivity).toISOString()},interactions:{toolCalls:t.totals.toolCallCount,resourceReads:t.totals.resourceReadCount,totalInteractions:t.totals.toolCallCount+t.totals.resourceReadCount},tokens:{estimatedMcpContribution:t.totals.totalTokens,note:"Use paradigm_session_health tool for full analysis with handoff recommendations"}},null,2)}}return e==="context/handoff-guide"?{handled:true,text:`# Context Handoff Guide
2
+ import {d,g,h,e,a as a$1,b as b$2,f,c}from'./chunk-SRWROALW.js';import {b as b$1,ga}from'./chunk-EMGJWT7D.js';import'./chunk-4UJ4NIEQ.js';import'./chunk-4N56FRNE.js';import'./chunk-Q527BPUF.js';import'./chunk-KLBH26PA.js';import'./chunk-ARLB6YYW.js';import {p,q as q$1,k,l as l$1}from'./chunk-SU5F5D4I.js';import'./chunk-JNSJVCTU.js';import'./chunk-XROULIQN.js';import'./chunk-ZUAUFZRJ.js';import'./chunk-3KVVC4WV.js';import'./chunk-M4UMM6DC.js';import'./chunk-GRZQIKST.js';import'./chunk-KAFQA7HV.js';import {j as j$1}from'./chunk-6QXBXZF6.js';import {b,a}from'./chunk-EK4ZRIFJ.js';import'./chunk-LAYBUKMB.js';import'./chunk-DVZWCXB6.js';import'./chunk-QGZRM6ZB.js';import'./chunk-K7X3Z3GL.js';import'./chunk-5TAVYPOV.js';import {Server}from'@modelcontextprotocol/sdk/server/index.js';import {StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import {ListResourcesRequestSchema,ReadResourceRequestSchema}from'@modelcontextprotocol/sdk/types.js';import*as l from'fs';import*as m from'path';function se(e){return {id:e.id,symbol:`^${e.id}`,description:e.description,locks:e.locks?.map(s=>({id:s.id,description:s.description,keys:s.keys?.map(n=>n.expression||n),mode:s.mode||"all"})),prizes:e.prizes?.map(s=>({id:s.id,oneTime:s.oneTime}))}}function L(e){let s=e.gateConfig?.gates||[],n=l$1(e.index,"gate"),t=new Map;for(let o of n){let i=o.symbol.replace(/^\^/,"");t.set(i,{id:i,symbol:o.symbol,description:o.description,source:"purpose",filePath:o.filePath,data:o.data});}for(let o of s)t.set(o.id,{...se(o),source:"portal.yaml"});return Array.from(t.values())}function F(e){let s=e.gateConfig?.flows||[],n=l$1(e.index,"flow"),t=new Map;for(let o of n){let i=o.symbol.replace(/^\$/,"");t.set(i,{id:i,symbol:o.symbol,description:o.description,source:"purpose",filePath:o.filePath,data:o.data});}for(let o of s)t.set(o.id,{id:o.id,symbol:`$${o.id}`,description:o.description,gates:o.gates,source:"portal.yaml"});return Array.from(t.values())}function z(){return [{uri:"paradigm://wisdom/preferences",name:"Wisdom - Preferences",description:"Team preferences for patterns, testing, and code style",mimeType:"application/json"},{uri:"paradigm://wisdom/antipatterns",name:"Wisdom - Antipatterns",description:"What NOT to do, with reasons and alternatives",mimeType:"application/json"},{uri:"paradigm://wisdom/decisions",name:"Wisdom - Decisions",description:"Architectural Decision Records (ADRs) index",mimeType:"application/json"}]}async function U(e$1,s){if(e$1==="wisdom/preferences"){let n=await e(s);return {handled:true,text:JSON.stringify({version:n.preferences?.version||"1.0",global:n.preferences?.global||{},by_symbol:n.preferences?.by_symbol||{},symbol_count:Object.keys(n.preferences?.by_symbol||{}).length},null,2)}}if(e$1.startsWith("wisdom/preferences/")){let n=decodeURIComponent(e$1.replace("wisdom/preferences/","")),t=await e(s),o=a$1(t,n);return {handled:true,text:JSON.stringify({symbol:n,preferences:o.preferences,global:t.preferences?.global||{}},null,2)}}if(e$1==="wisdom/antipatterns"){let n=await e(s);return {handled:true,text:JSON.stringify({count:n.antipatterns.length,antipatterns:n.antipatterns},null,2)}}if(e$1.startsWith("wisdom/antipatterns/")){let n=decodeURIComponent(e$1.replace("wisdom/antipatterns/","")),t=await e(s),o=a$1(t,n);return {handled:true,text:JSON.stringify({symbol:n,count:o.antipatterns.length,antipatterns:o.antipatterns},null,2)}}if(e$1==="wisdom/decisions"){let n=await e(s);return {handled:true,text:JSON.stringify({count:n.decisions.length,decisions:n.decisions.map(t=>({id:t.id,title:t.title,status:t.status,date:t.date,symbols:t.symbols}))},null,2)}}if(e$1.startsWith("wisdom/decision/")){let n=e$1.replace("wisdom/decision/",""),t=await e(s),o=t.decisions.find(i=>i.id===n);return o?{handled:true,text:JSON.stringify(o,null,2)}:{handled:true,text:JSON.stringify({error:"Decision not found",id:n,available:t.decisions.map(i=>i.id)},null,2)}}if(e$1.startsWith("wisdom/expertise/")){let n=decodeURIComponent(e$1.replace("wisdom/expertise/","")),t=await e(s),o=b$2(t,{symbol:n});return {handled:true,text:JSON.stringify({symbol:n,count:o.length,experts:o.map(i=>({name:i.name,symbols:i.symbols,areas:i.areas,contact:i.contact}))},null,2)}}return {handled:false,text:""}}function $(){return [{uri:"paradigm://history/fragile",name:"History - Fragile Symbols",description:"Symbols with high fragility that need extra care when modifying",mimeType:"application/json"},{uri:"paradigm://history/validation/summary",name:"History - Validation Summary",description:"Overall validation statistics and pass rates",mimeType:"application/json"}]}async function G(e,s){if(e.startsWith("history/symbol/")&&!e.endsWith("/recent")){let n=decodeURIComponent(e.replace("history/symbol/","")),t=await f(s),o=c(t,n);return {handled:true,text:JSON.stringify({symbol:n,summary:o.summary?{total_changes:o.summary.total_changes,last_modified:o.summary.last_modified,stability_score:o.summary.stability_score,fragility:o.summary.fragility,contributors:o.summary.contributors}:null,recent:o.recent,co_changes:o.co_changes,validation:o.validation},null,2)}}if(e.startsWith("history/symbol/")&&e.endsWith("/recent")){let n=decodeURIComponent(e.replace("history/symbol/","").replace("/recent","")),t=await f(s),o=c(t,n);return {handled:true,text:JSON.stringify({symbol:n,fragility:o.summary?.fragility||"unknown",stability_score:o.summary?.stability_score,recent:o.recent.slice(0,5)},null,2)}}if(e==="history/fragile"){let n=await f(s);return {handled:true,text:JSON.stringify({count:n.index?.fragile_symbols?.length||0,fragile_symbols:n.index?.fragile_symbols||[],recommendation:"Consider adding extra test coverage and reviewing recent changes before modifying these symbols"},null,2)}}if(e.startsWith("history/cochanges/")){let n=decodeURIComponent(e.replace("history/cochanges/","")),o=(await f(s)).index?.co_changes?.filter(i=>i.symbols.includes(n))||[];return {handled:true,text:JSON.stringify({symbol:n,count:o.length,co_changes:o.map(i=>({with:i.symbols.filter(a=>a!==n),frequency:i.frequency,correlation:i.correlation})),recommendation:o.length>0?"These symbols often change together - consider if they need updates too":"No strong co-change patterns detected"},null,2)}}if(e==="history/validation/summary"){let n=await f(s);return {handled:true,text:JSON.stringify({last_run:n.validation?.last_run,total_validations:n.validation?.total_validations||0,pass_rate:n.validation?.pass_rate||0,by_symbol:n.validation?.by_symbol||{}},null,2)}}return {handled:false,text:""}}function q(){return [{uri:"paradigm://context/agent-protocol",name:"Agent Protocol",description:"IMPORTANT: Read this first. Workflow instructions for using Paradigm MCP tools effectively.",mimeType:"text/markdown"},{uri:"paradigm://context/session",name:"Session Info",description:"Current MCP session statistics and context usage estimate",mimeType:"application/json"},{uri:"paradigm://context/handoff-guide",name:"Handoff Guide",description:"When and how to perform context handoffs",mimeType:"text/markdown"}]}async function H(e,s){if(e==="context/agent-protocol")return {handled:true,text:'# Agent Protocol for Paradigm MCP Tools\n\n## What Paradigm Is\n\nParadigm adds a metadata layer (`.purpose` files + `portal.yaml`) to any codebase so AI agents can query architecture context via MCP instead of reading source files directly.\n\n**What it does**\n- Tracks codebase symbols: `#components`, `$flows`, `^gates`, `!signals`, `~aspects`\n- Answers queries about structure, dependencies, authorization, and history without file reads\n- Enforces coverage: hooks block sessions that modify code without updating `.purpose` files\n\n**Tool surface (50+ tools)**\n- Navigation: `paradigm_status`, `paradigm_search`, `paradigm_navigate`, `paradigm_related`\n- Impact: `paradigm_ripple`, `paradigm_flows_affected`\n- Authorization: `paradigm_gates_for_route`, `paradigm_portal_add_gate`\n- History: `paradigm_history_context`, `paradigm_lore_record`, `paradigm_lore_search`\n- Agents: `paradigm_agent_list`, `paradigm_orchestrate_inline`, `paradigm_ambient_events`\n- Compliance: `paradigm_aspect_check`, `paradigm_protocol_search`\n- Session: `paradigm_session_health`, `paradigm_handoff_prepare`\n\n**Setup** (if not already initialized)\nRun `paradigm shift` \u2014 auto-detects language/framework, creates `.paradigm/` config, scaffolds `.purpose` and `portal.yaml`, installs hooks.\n\n---\n\n## Query Before Modify\n\n**Always query before making changes** - this ensures you understand impact and dependencies.\n\n| Before doing this... | Call this MCP tool |\n|---------------------|-------------------|\n| Modifying a symbol | `paradigm_ripple` with the symbol |\n| Starting a session | `paradigm_status` for project overview |\n| Understanding code | `paradigm_navigate` with explore intent |\n| Checking dependencies | `paradigm_related` for connections |\n\n## Example Workflow\n\n1. **Get oriented**: Call `paradigm_status` to see project symbols and health\n2. **Find relevant code**: Call `paradigm_navigate` with intent "find" or "explore"\n3. **Before editing**: Call `paradigm_ripple` on symbols you\'ll modify\n4. **Check context**: Call `paradigm_session_health` every 10-15 tool calls\n\n## Benefits\n\n- **Fresh data**: Always current from live project index\n- **Precise**: Only get the data you need\n- **Token-efficient**: ~100 tokens per query vs ~2000 for reading files\n\n## Context Monitoring\n\nCall `paradigm_session_health` periodically to monitor session health:\n- **<50%**: Continue working\n- **50-70%**: Plan a stopping point\n- **70-85%**: Prepare handoff soon\n- **>85%**: Handoff after current task\n\n## Tool Surface by Category\n\n| Category | Tools |\n|----------|-------|\n| Navigation | `paradigm_status`, `paradigm_search`, `paradigm_navigate`, `paradigm_related` |\n| Impact analysis | `paradigm_ripple`, `paradigm_flows_affected` |\n| Authorization | `paradigm_gates_for_route`, `paradigm_portal_add_gate` |\n| History & lore | `paradigm_history_context`, `paradigm_lore_record`, `paradigm_lore_search` |\n| Agent team | `paradigm_agent_list`, `paradigm_orchestrate_inline`, `paradigm_captain_brief` |\n| Compliance | `paradigm_aspect_check`, `paradigm_protocol_search`, `paradigm_aspect_drift` |\n| Session | `paradigm_session_health`, `paradigm_handoff_prepare`, `paradigm_session_recover` |\n| Architecture | `paradigm_arch_status`, `paradigm_arch_diagram` |\n\n---\n\n*This protocol ensures efficient, safe modifications to the codebase.*\n'};if(e==="context/session"){let n=j$1(),t=n.getStats(),o=n.getDurationMinutes();return {handled:true,text:JSON.stringify({session:{durationMinutes:o,startTime:new Date(t.startTime).toISOString(),lastActivity:new Date(t.lastActivity).toISOString()},interactions:{toolCalls:t.totals.toolCallCount,resourceReads:t.totals.resourceReadCount,totalInteractions:t.totals.toolCallCount+t.totals.resourceReadCount},tokens:{estimatedMcpContribution:t.totals.totalTokens,note:"Use paradigm_session_health tool for full analysis with handoff recommendations"}},null,2)}}return e==="context/handoff-guide"?{handled:true,text:`# Context Handoff Guide
52
3
 
53
4
  ## When to Handoff
54
5
 
@@ -97,7 +48,7 @@ Call the \`paradigm_session_health\` tool to get:
97
48
  - List specific file paths modified
98
49
  - Include any blockers or decisions needed
99
50
  - Reference relevant symbols (@feature, #component, etc.)
100
- `}:{handled:false,text:""}}var ce={"add-feature":"Pathway for adding a new user-facing feature with proper symbol definitions","add-gate":"Add a new gate (portal) for authorization control","debug-auth":"Debug authentication and authorization issues","implement-ftux":"Implement First-Time User Experience (FTUX) flow","implement-sandbox":"Set up a sandbox environment for testing","read-docs":"Read and understand existing documentation",refactor:"Refactor existing code with proper planning","run-e2e-tests":"Run and debug end-to-end tests","trace-flow":"Trace a flow through the system","validate-portals":"Validate portal.yaml configuration"};function pe(e,s){let n=[m.join(__dirname,"../../../../paradigm/templates/paradigm",e),m.join(s.rootDir,"node_modules/@a-company/paradigm/templates/paradigm",e),m.join(s.rootDir,"../../packages/paradigm/templates/paradigm",e),m.join(process.env.HOME||"",".paradigm/templates",e),m.resolve(__dirname,"../../../paradigm/templates/paradigm",e)];for(let t of n)try{if(l.existsSync(t))return t}catch{}return null}function J(e){return pe("prompts",e)}function de(e){return Math.ceil(e.length/3.5)}function B(e){let s=J(e);if(!s)return [];try{return l.readdirSync(s).filter(t=>t.endsWith(".md")).map(t=>{let o=t.replace(".md",""),i=m.join(s,t),r=l.statSync(i),a=l.readFileSync(i,"utf8");return {name:o,description:ce[o]||`Prompt template: ${o}`,filename:t,size:r.size,tokens:de(a)}})}catch{return []}}function le(e,s){let n=J(s);if(!n)return {found:false,content:"",error:"Prompts directory not found. Ensure @a-company/paradigm is installed."};let t=m.join(n,`${e}.md`);try{if(!l.existsSync(t)){let i=B(s).map(r=>r.name);return {found:!1,content:"",error:`Prompt "${e}" not found. Available prompts: ${i.join(", ")}`}}return {content:l.readFileSync(t,"utf8"),found:!0}}catch(o){return {found:false,content:"",error:`Error reading prompt: ${o.message}`}}}function V(){return [{uri:"paradigm://prompts",name:"Prompts",description:"List all available prompt templates with metadata (name, description, size)",mimeType:"application/json"},{uri:"paradigm://prompts/{name}",name:"Prompt Content",description:"Get a specific prompt template content. Replace {name} with prompt name (e.g., add-feature)",mimeType:"text/markdown"}]}async function Y(e,s){let n=`paradigm://${e}`;if(e==="prompts"){let t=B(s),o=t.reduce((a,p)=>a+p.size,0),i=t.reduce((a,p)=>a+p.tokens,0),r=JSON.stringify({count:t.length,totalSize:o,totalTokens:i,prompts:t.map(a=>({name:a.name,description:a.description,size:a.size,tokens:a.tokens,uri:`paradigm://prompts/${a.name}`})),usage:"Read a specific prompt with paradigm://prompts/{name}"},null,2);return p(r.length,n),{handled:true,text:r,mimeType:"application/json"}}if(e.startsWith("prompts/")){let t=decodeURIComponent(e.replace("prompts/","")),{content:o,found:i,error:r}=le(t,s);if(!i){let a=JSON.stringify({error:r,name:t},null,2);return p(a.length,n),{handled:true,text:a,mimeType:"application/json"}}return p(o.length,n),{handled:true,text:o,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}var A={disciplines:"Language and discipline-agnostic symbol mappings for different domains",scan:"Paradigm Probe protocol for visual discovery and UI-to-code mapping","context-tracking":"Context tracking system for session monitoring and handoffs"};function me(e,s){let n=[m.join(__dirname,"../../../../paradigm/templates/paradigm",e),m.join(s.rootDir,"node_modules/@a-company/paradigm/templates/paradigm",e),m.join(s.rootDir,"../../packages/paradigm/templates/paradigm",e),m.join(process.env.HOME||"",".paradigm/templates",e),m.resolve(__dirname,"../../../paradigm/templates/paradigm",e)];for(let t of n)try{if(l.existsSync(t))return t}catch{}return null}function Q(e){return me("specs",e)}function ge(e){return Math.ceil(e.length/3.5)}function ue(e){let s=Q(e);if(!s)return [];let n=[];for(let[t,o]of Object.entries(A)){let i=`${t}.md`,r=m.join(s,i);try{if(l.existsSync(r)){let a=l.statSync(r),p=l.readFileSync(r,"utf8");n.push({name:t,description:o,filename:i,size:a.size,tokens:ge(p)});}}catch{}}return n}function fe(e,s){if(!A[e]){let o=Object.keys(A);return {found:false,content:"",error:`"${e}" is not a reference spec. Reference specs available via MCP: ${o.join(", ")}. Project-specific specs should be read from .paradigm/specs/ directly.`}}let n=Q(s);if(!n)return {found:false,content:"",error:"Specs directory not found. Ensure @a-company/paradigm is installed."};let t=m.join(n,`${e}.md`);try{return l.existsSync(t)?{content:l.readFileSync(t,"utf8"),found:!0}:{found:!1,content:"",error:`Spec "${e}" file not found at expected location.`}}catch(o){return {found:false,content:"",error:`Error reading spec: ${o.message}`}}}function K(){return [{uri:"paradigm://specs",name:"Reference Specs",description:"List reference specifications (disciplines, scan, context-tracking)",mimeType:"application/json"},{uri:"paradigm://specs/{name}",name:"Spec Content",description:"Get a reference spec. Available: disciplines, scan, context-tracking",mimeType:"text/markdown"}]}async function X(e,s){let n=`paradigm://${e}`;if(e==="specs"){let t=ue(s),o=t.reduce((a,p)=>a+p.size,0),i=t.reduce((a,p)=>a+p.tokens,0),r=JSON.stringify({count:t.length,totalSize:o,totalTokens:i,note:"These are reference specs served via MCP. Project-specific specs (logger, symbols, etc.) should be read from .paradigm/specs/ directly.",specs:t.map(a=>({name:a.name,description:a.description,size:a.size,tokens:a.tokens,uri:`paradigm://specs/${a.name}`}))},null,2);return p(r.length,n),{handled:true,text:r,mimeType:"application/json"}}if(e.startsWith("specs/")&&e!=="specs/"){let t=decodeURIComponent(e.replace("specs/","")),{content:o,found:i,error:r}=fe(t,s);if(!i){let a=JSON.stringify({error:r,name:t},null,2);return p(a.length,n),{handled:true,text:a,mimeType:"application/json"}}return p(o.length,n),{handled:true,text:o,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}var M={commands:"Complete CLI command reference with examples and usage guidance",queries:"jq query examples for querying the constellation symbol graph"};function he(e,s){let n=[m.join(__dirname,"../../../../paradigm/templates/paradigm",e),m.join(s.rootDir,"node_modules/@a-company/paradigm/templates/paradigm",e),m.join(s.rootDir,"../../packages/paradigm/templates/paradigm",e),m.join(process.env.HOME||"",".paradigm/templates",e),m.resolve(__dirname,"../../../paradigm/templates/paradigm",e)];for(let t of n)try{if(l.existsSync(t))return t}catch{}return null}function Z(e){return he("docs",e)}function ye(e){return Math.ceil(e.length/3.5)}function be(e){let s=Z(e);if(!s)return [];let n=[];for(let[t,o]of Object.entries(M)){let i=`${t}.md`,r=m.join(s,i);try{if(l.existsSync(r)){let a=l.statSync(r),p=l.readFileSync(r,"utf8");n.push({name:t,description:o,filename:i,size:a.size,tokens:ye(p)});}}catch{}}return n}function we(e,s){if(!M[e]){let o=Object.keys(M);return {found:false,content:"",error:`"${e}" is not a reference doc. Reference docs available via MCP: ${o.join(", ")}. Project-specific docs (patterns, troubleshooting, etc.) should be read from .paradigm/docs/ directly.`}}let n=Z(s);if(!n)return {found:false,content:"",error:"Docs directory not found. Ensure @a-company/paradigm is installed."};let t=m.join(n,`${e}.md`);try{return l.existsSync(t)?{content:l.readFileSync(t,"utf8"),found:!0}:{found:!1,content:"",error:`Doc "${e}" file not found at expected location.`}}catch(o){return {found:false,content:"",error:`Error reading doc: ${o.message}`}}}function ee(){return [{uri:"paradigm://docs",name:"Reference Docs",description:"List reference documentation (commands, queries)",mimeType:"application/json"},{uri:"paradigm://docs/{name}",name:"Doc Content",description:"Get a reference doc. Available: commands, queries",mimeType:"text/markdown"}]}async function te(e,s){let n=`paradigm://${e}`;if(e==="docs"){let t=be(s),o=t.reduce((a,p)=>a+p.size,0),i=t.reduce((a,p)=>a+p.tokens,0),r=JSON.stringify({count:t.length,totalSize:o,totalTokens:i,note:"These are reference docs served via MCP. Project-specific docs (patterns, troubleshooting, etc.) should be read from .paradigm/docs/ directly.",docs:t.map(a=>({name:a.name,description:a.description,size:a.size,tokens:a.tokens,uri:`paradigm://docs/${a.name}`}))},null,2);return p(r.length,n),{handled:true,text:r,mimeType:"application/json"}}if(e.startsWith("docs/")&&e!=="docs/"){let t=decodeURIComponent(e.replace("docs/","")),{content:o,found:i,error:r}=we(t,s);if(!i){let a=JSON.stringify({error:r,name:t},null,2);return p(a.length,n),{handled:true,text:a,mimeType:"application/json"}}return p(o.length,n),{handled:true,text:o,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}var j={logging:{description:"Paradigm logger usage, symbol-to-method mapping by directory",generate:()=>"# Paradigm Logging Guide\n\n**IMPORTANT:** Use the Paradigm logger instead of raw console.log/print.\n\n## Usage Pattern\n\n```typescript\nlog.component('#login-handler').info('Starting login', { email });\nlog.component('#database').debug('Query executed', { duration });\nlog.gate('^authenticated').warn('Access denied', { userId });\nlog.signal('!login-success').info('User authenticated');\nlog.flow('$checkout').info('Flow step reached');\nlog.aspect('~audit-required').info('Audit triggered');\n```\n\n## Symbol Mapping by Directory\n\n| Directory | Symbol | Logger Method |\n|-----------|--------|---------------|\n| `features/**` | `#` | `log.component()` |\n| `routes/**` | `#` | `log.component()` |\n| `api/**` | `#` | `log.component()` |\n| `endpoints/**` | `#` | `log.component()` |\n| `commands/**` | `#` | `log.component()` |\n| `models/**` | `#` | `log.component()` |\n| `components/**` | `#` | `log.component()` |\n| `lib/**` | `#` | `log.component()` |\n| `utils/**` | `#` | `log.component()` |\n| `services/**` | `#` | `log.component()` |\n| `core/**` | `#` | `log.component()` |\n| `drivers/**` | `#` | `log.component()` |\n| `systems/**` | `#` | `log.component()` |\n| `integrations/**` | `#` | `log.component()` |\n| `external/**` | `#` | `log.component()` |\n| `vendors/**` | `#` | `log.component()` |\n| `stores/**` | `#` | `log.component()` |\n| `state/**` | `#` | `log.component()` |\n| `reducers/**` | `#` | `log.component()` |\n| `config/**` | `#` | `log.component()` |\n| `middleware/**` | `^` | `log.gate()` |\n| `auth/**` | `^` | `log.gate()` |\n| `guards/**` | `^` | `log.gate()` |\n| `policies/**` | `^` | `log.gate()` |\n| `events/**` | `!` | `log.signal()` |\n| `handlers/**` | `!` | `log.signal()` |\n| `listeners/**` | `!` | `log.signal()` |\n| `hooks/**` | `!` | `log.signal()` |\n| `flows/**` | `$` | `log.flow()` |\n| `sagas/**` | `$` | `log.flow()` |\n| `workflows/**` | `$` | `log.flow()` |\n| `pipelines/**` | `$` | `log.flow()` |\n| `aspects/**` | `~` | `log.aspect()` |\n| `rules/**` | `~` | `log.aspect()` |\n| `constraints/**` | `~` | `log.aspect()` |\n\nSee `.paradigm/specs/logger.md` for full specification."},portal:{description:"Portal protocol \u2014 authorization, gates, portal.yaml structure and workflow",generate:()=>`# Portal Protocol (Authorization)
51
+ `}:{handled:false,text:""}}var ce={"add-feature":"Pathway for adding a new user-facing feature with proper symbol definitions","add-gate":"Add a new gate (portal) for authorization control","debug-auth":"Debug authentication and authorization issues","implement-ftux":"Implement First-Time User Experience (FTUX) flow","implement-sandbox":"Set up a sandbox environment for testing","read-docs":"Read and understand existing documentation",refactor:"Refactor existing code with proper planning","run-e2e-tests":"Run and debug end-to-end tests","trace-flow":"Trace a flow through the system","validate-portals":"Validate portal.yaml configuration"};function de(e,s){let n=[m.join(__dirname,"../../../../paradigm/templates/paradigm",e),m.join(s.rootDir,"node_modules/@a-company/paradigm/templates/paradigm",e),m.join(s.rootDir,"../../packages/paradigm/templates/paradigm",e),m.join(process.env.HOME||"",".paradigm/templates",e),m.resolve(__dirname,"../../../paradigm/templates/paradigm",e)];for(let t of n)try{if(l.existsSync(t))return t}catch{}return null}function J(e){return de("prompts",e)}function pe(e){return Math.ceil(e.length/3.5)}function B(e){let s=J(e);if(!s)return [];try{return l.readdirSync(s).filter(t=>t.endsWith(".md")).map(t=>{let o=t.replace(".md",""),i=m.join(s,t),a=l.statSync(i),r=l.readFileSync(i,"utf8");return {name:o,description:ce[o]||`Prompt template: ${o}`,filename:t,size:a.size,tokens:pe(r)}})}catch{return []}}function le(e,s){let n=J(s);if(!n)return {found:false,content:"",error:"Prompts directory not found. Ensure @a-company/paradigm is installed."};let t=m.join(n,`${e}.md`);try{if(!l.existsSync(t)){let i=B(s).map(a=>a.name);return {found:!1,content:"",error:`Prompt "${e}" not found. Available prompts: ${i.join(", ")}`}}return {content:l.readFileSync(t,"utf8"),found:!0}}catch(o){return {found:false,content:"",error:`Error reading prompt: ${o.message}`}}}function V(){return [{uri:"paradigm://prompts",name:"Prompts",description:"List all available prompt templates with metadata (name, description, size)",mimeType:"application/json"},{uri:"paradigm://prompts/{name}",name:"Prompt Content",description:"Get a specific prompt template content. Replace {name} with prompt name (e.g., add-feature)",mimeType:"text/markdown"}]}async function Y(e,s){let n=`paradigm://${e}`;if(e==="prompts"){let t=B(s),o=t.reduce((r,d)=>r+d.size,0),i=t.reduce((r,d)=>r+d.tokens,0),a=JSON.stringify({count:t.length,totalSize:o,totalTokens:i,prompts:t.map(r=>({name:r.name,description:r.description,size:r.size,tokens:r.tokens,uri:`paradigm://prompts/${r.name}`})),usage:"Read a specific prompt with paradigm://prompts/{name}"},null,2);return b$1(a.length,n),{handled:true,text:a,mimeType:"application/json"}}if(e.startsWith("prompts/")){let t=decodeURIComponent(e.replace("prompts/","")),{content:o,found:i,error:a}=le(t,s);if(!i){let r=JSON.stringify({error:a,name:t},null,2);return b$1(r.length,n),{handled:true,text:r,mimeType:"application/json"}}return b$1(o.length,n),{handled:true,text:o,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}var A={disciplines:"Language and discipline-agnostic symbol mappings for different domains",scan:"Paradigm Probe protocol for visual discovery and UI-to-code mapping","context-tracking":"Context tracking system for session monitoring and handoffs"};function me(e,s){let n=[m.join(__dirname,"../../../../paradigm/templates/paradigm",e),m.join(s.rootDir,"node_modules/@a-company/paradigm/templates/paradigm",e),m.join(s.rootDir,"../../packages/paradigm/templates/paradigm",e),m.join(process.env.HOME||"",".paradigm/templates",e),m.resolve(__dirname,"../../../paradigm/templates/paradigm",e)];for(let t of n)try{if(l.existsSync(t))return t}catch{}return null}function Q(e){return me("specs",e)}function ge(e){return Math.ceil(e.length/3.5)}function ue(e){let s=Q(e);if(!s)return [];let n=[];for(let[t,o]of Object.entries(A)){let i=`${t}.md`,a=m.join(s,i);try{if(l.existsSync(a)){let r=l.statSync(a),d=l.readFileSync(a,"utf8");n.push({name:t,description:o,filename:i,size:r.size,tokens:ge(d)});}}catch{}}return n}function fe(e,s){if(!A[e]){let o=Object.keys(A);return {found:false,content:"",error:`"${e}" is not a reference spec. Reference specs available via MCP: ${o.join(", ")}. Project-specific specs should be read from .paradigm/specs/ directly.`}}let n=Q(s);if(!n)return {found:false,content:"",error:"Specs directory not found. Ensure @a-company/paradigm is installed."};let t=m.join(n,`${e}.md`);try{return l.existsSync(t)?{content:l.readFileSync(t,"utf8"),found:!0}:{found:!1,content:"",error:`Spec "${e}" file not found at expected location.`}}catch(o){return {found:false,content:"",error:`Error reading spec: ${o.message}`}}}function K(){return [{uri:"paradigm://specs",name:"Reference Specs",description:"List reference specifications (disciplines, scan, context-tracking)",mimeType:"application/json"},{uri:"paradigm://specs/{name}",name:"Spec Content",description:"Get a reference spec. Available: disciplines, scan, context-tracking",mimeType:"text/markdown"}]}async function X(e,s){let n=`paradigm://${e}`;if(e==="specs"){let t=ue(s),o=t.reduce((r,d)=>r+d.size,0),i=t.reduce((r,d)=>r+d.tokens,0),a=JSON.stringify({count:t.length,totalSize:o,totalTokens:i,note:"These are reference specs served via MCP. Project-specific specs (logger, symbols, etc.) should be read from .paradigm/specs/ directly.",specs:t.map(r=>({name:r.name,description:r.description,size:r.size,tokens:r.tokens,uri:`paradigm://specs/${r.name}`}))},null,2);return b$1(a.length,n),{handled:true,text:a,mimeType:"application/json"}}if(e.startsWith("specs/")&&e!=="specs/"){let t=decodeURIComponent(e.replace("specs/","")),{content:o,found:i,error:a}=fe(t,s);if(!i){let r=JSON.stringify({error:a,name:t},null,2);return b$1(r.length,n),{handled:true,text:r,mimeType:"application/json"}}return b$1(o.length,n),{handled:true,text:o,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}var M={commands:"Complete CLI command reference with examples and usage guidance",queries:"jq query examples for querying the constellation symbol graph"};function he(e,s){let n=[m.join(__dirname,"../../../../paradigm/templates/paradigm",e),m.join(s.rootDir,"node_modules/@a-company/paradigm/templates/paradigm",e),m.join(s.rootDir,"../../packages/paradigm/templates/paradigm",e),m.join(process.env.HOME||"",".paradigm/templates",e),m.resolve(__dirname,"../../../paradigm/templates/paradigm",e)];for(let t of n)try{if(l.existsSync(t))return t}catch{}return null}function Z(e){return he("docs",e)}function ye(e){return Math.ceil(e.length/3.5)}function be(e){let s=Z(e);if(!s)return [];let n=[];for(let[t,o]of Object.entries(M)){let i=`${t}.md`,a=m.join(s,i);try{if(l.existsSync(a)){let r=l.statSync(a),d=l.readFileSync(a,"utf8");n.push({name:t,description:o,filename:i,size:r.size,tokens:ye(d)});}}catch{}}return n}function _e(e,s){if(!M[e]){let o=Object.keys(M);return {found:false,content:"",error:`"${e}" is not a reference doc. Reference docs available via MCP: ${o.join(", ")}. Project-specific docs (patterns, troubleshooting, etc.) should be read from .paradigm/docs/ directly.`}}let n=Z(s);if(!n)return {found:false,content:"",error:"Docs directory not found. Ensure @a-company/paradigm is installed."};let t=m.join(n,`${e}.md`);try{return l.existsSync(t)?{content:l.readFileSync(t,"utf8"),found:!0}:{found:!1,content:"",error:`Doc "${e}" file not found at expected location.`}}catch(o){return {found:false,content:"",error:`Error reading doc: ${o.message}`}}}function ee(){return [{uri:"paradigm://docs",name:"Reference Docs",description:"List reference documentation (commands, queries)",mimeType:"application/json"},{uri:"paradigm://docs/{name}",name:"Doc Content",description:"Get a reference doc. Available: commands, queries",mimeType:"text/markdown"}]}async function te(e,s){let n=`paradigm://${e}`;if(e==="docs"){let t=be(s),o=t.reduce((r,d)=>r+d.size,0),i=t.reduce((r,d)=>r+d.tokens,0),a=JSON.stringify({count:t.length,totalSize:o,totalTokens:i,note:"These are reference docs served via MCP. Project-specific docs (patterns, troubleshooting, etc.) should be read from .paradigm/docs/ directly.",docs:t.map(r=>({name:r.name,description:r.description,size:r.size,tokens:r.tokens,uri:`paradigm://docs/${r.name}`}))},null,2);return b$1(a.length,n),{handled:true,text:a,mimeType:"application/json"}}if(e.startsWith("docs/")&&e!=="docs/"){let t=decodeURIComponent(e.replace("docs/","")),{content:o,found:i,error:a}=_e(t,s);if(!i){let r=JSON.stringify({error:a,name:t},null,2);return b$1(r.length,n),{handled:true,text:r,mimeType:"application/json"}}return b$1(o.length,n),{handled:true,text:o,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}var j={logging:{description:"Paradigm logger usage, symbol-to-method mapping by directory",generate:()=>"# Paradigm Logging Guide\n\n**IMPORTANT:** Use the Paradigm logger instead of raw console.log/print.\n\n## Usage Pattern\n\n```typescript\nlog.component('#login-handler').info('Starting login', { email });\nlog.component('#database').debug('Query executed', { duration });\nlog.gate('^authenticated').warn('Access denied', { userId });\nlog.signal('!login-success').info('User authenticated');\nlog.flow('$checkout').info('Flow step reached');\nlog.aspect('~audit-required').info('Audit triggered');\n```\n\n## Symbol Mapping by Directory\n\n| Directory | Symbol | Logger Method |\n|-----------|--------|---------------|\n| `features/**` | `#` | `log.component()` |\n| `routes/**` | `#` | `log.component()` |\n| `api/**` | `#` | `log.component()` |\n| `endpoints/**` | `#` | `log.component()` |\n| `commands/**` | `#` | `log.component()` |\n| `models/**` | `#` | `log.component()` |\n| `components/**` | `#` | `log.component()` |\n| `lib/**` | `#` | `log.component()` |\n| `utils/**` | `#` | `log.component()` |\n| `services/**` | `#` | `log.component()` |\n| `core/**` | `#` | `log.component()` |\n| `drivers/**` | `#` | `log.component()` |\n| `systems/**` | `#` | `log.component()` |\n| `integrations/**` | `#` | `log.component()` |\n| `external/**` | `#` | `log.component()` |\n| `vendors/**` | `#` | `log.component()` |\n| `stores/**` | `#` | `log.component()` |\n| `state/**` | `#` | `log.component()` |\n| `reducers/**` | `#` | `log.component()` |\n| `config/**` | `#` | `log.component()` |\n| `middleware/**` | `^` | `log.gate()` |\n| `auth/**` | `^` | `log.gate()` |\n| `guards/**` | `^` | `log.gate()` |\n| `policies/**` | `^` | `log.gate()` |\n| `events/**` | `!` | `log.signal()` |\n| `handlers/**` | `!` | `log.signal()` |\n| `listeners/**` | `!` | `log.signal()` |\n| `hooks/**` | `!` | `log.signal()` |\n| `flows/**` | `$` | `log.flow()` |\n| `sagas/**` | `$` | `log.flow()` |\n| `workflows/**` | `$` | `log.flow()` |\n| `pipelines/**` | `$` | `log.flow()` |\n| `aspects/**` | `~` | `log.aspect()` |\n| `rules/**` | `~` | `log.aspect()` |\n| `constraints/**` | `~` | `log.aspect()` |\n\nSee `.paradigm/specs/logger.md` for full specification."},portal:{description:"Portal protocol \u2014 authorization, gates, portal.yaml structure and workflow",generate:()=>`# Portal Protocol (Authorization)
101
52
 
102
53
  **Portal.yaml is REQUIRED when the project has protected routes.**
103
54
 
@@ -463,4 +414,4 @@ components:
463
414
  | When | Tool | Purpose |
464
415
  |------|------|---------|
465
416
  | Starting any task | \`paradigm_pm_preflight\` | Get compliance plan |
466
- | Finishing any task | _(handled by stop hook)_ | Auto-checks compliance |`}};function xe(e){return Math.ceil(e.length/3.5)}function oe(){return [{uri:"paradigm://guidance",name:"Guidance Topics",description:"List all available on-demand guidance topics (logging, portal, flows, orchestration, etc.)",mimeType:"application/json"},{uri:"paradigm://guidance/{topic}",name:"Guidance Content",description:`Get guidance for a topic. Available: ${Object.keys(j).join(", ")}`,mimeType:"text/markdown"}]}async function ne(e,s){let n=`paradigm://${e}`;if(e==="guidance"){let t=Object.entries(j).map(([i,r])=>{let a=r.generate();return {name:i,description:r.description,tokens:xe(a)}}),o=JSON.stringify({count:t.length,totalTokens:t.reduce((i,r)=>i+r.tokens,0),note:"These guidance topics were previously baked into CLAUDE.md. Load on-demand to save context.",topics:t.map(i=>({...i,uri:`paradigm://guidance/${i.name}`}))},null,2);return p(o.length,n),{handled:true,text:o,mimeType:"application/json"}}if(e.startsWith("guidance/")&&e!=="guidance/"){let t=decodeURIComponent(e.replace("guidance/","")),o=j[t];if(!o){let r=Object.keys(j),a=JSON.stringify({error:`Unknown guidance topic: "${t}"`,available:r},null,2);return p(a.length,n),{handled:true,text:a,mimeType:"application/json"}}let i=o.generate();return p(i.length,n),{handled:true,text:i,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}function ie(e,s){e.setRequestHandler(ListResourcesRequestSchema,async()=>({resources:[{uri:"paradigm://symbols",name:"All Symbols",description:"Overview of all Paradigm symbols in the project",mimeType:"application/json"},{uri:"paradigm://symbols/type/feature",name:"Features",description:"All @feature symbols",mimeType:"application/json"},{uri:"paradigm://symbols/type/component",name:"Components",description:"All #component symbols",mimeType:"application/json"},{uri:"paradigm://symbols/type/gate",name:"Gates",description:"All ^gate symbols (authorization)",mimeType:"application/json"},{uri:"paradigm://symbols/type/flow",name:"Flows",description:"All $flow symbols (processes)",mimeType:"application/json"},{uri:"paradigm://symbols/type/signal",name:"Signals",description:"All !signal symbols (events)",mimeType:"application/json"},{uri:"paradigm://symbols/type/state",name:"States",description:"All %state symbols",mimeType:"application/json"},{uri:"paradigm://gates",name:"Gates (Detailed)",description:"All gates with locks, keys, and prizes from portal.yaml",mimeType:"application/json"},{uri:"paradigm://flows",name:"Flows (Detailed)",description:"All flows with gate sequences",mimeType:"application/json"},...U(),...G(),...q(),...V(),...K(),...ee(),...oe()]})),e.setRequestHandler(ReadResourceRequestSchema,async n$1=>{let t=n$1.params.uri;if(!t?.startsWith("paradigm://"))throw new Error(`Unknown URI scheme: ${t}`);let o=s(),i$1=t.replace("paradigm://","");if(i$1==="symbols"){let r=m$1(o.index),a=n(o.index),p$1=JSON.stringify({project:o.projectName,counts:r,total:Object.values(r).reduce((d,k)=>d+k,0),symbols:a.map(d=>({symbol:d.symbol,type:d.type,description:d.description}))},null,2);return p(p$1.length,t),{contents:[{uri:t,mimeType:"application/json",text:p$1}]}}if(i$1.startsWith("symbol/")){let r=decodeURIComponent(i$1.replace("symbol/","")),a=h$1(o.index,r);if(!a){let d=JSON.stringify({error:"Symbol not found",symbol:r,available:n(o.index).filter(k=>k.symbol.includes(r.slice(1))).slice(0,5).map(k=>k.symbol)},null,2);return p(d.length,t),{contents:[{uri:t,mimeType:"application/json",text:d}]}}let p$1=JSON.stringify({symbol:a.symbol,type:a.type,description:a.description,filePath:a.filePath,references:a.references,referencedBy:a.referencedBy,tags:a.tags,data:a.data},null,2);return p(p$1.length,t),{contents:[{uri:t,mimeType:"application/json",text:p$1}]}}if(i$1.startsWith("symbols/type/")){let r=i$1.replace("symbols/type/",""),a=i(o.index,r),p$1=JSON.stringify({type:r,count:a.length,symbols:a.map(d=>({symbol:d.symbol,description:d.description,filePath:d.filePath,referencesCount:d.references.length,referencedByCount:d.referencedBy.length}))},null,2);return p(p$1.length,t),{contents:[{uri:t,mimeType:"application/json",text:p$1}]}}if(i$1==="gates"){let r=F(o),a=JSON.stringify({count:r.length,gates:r},null,2);return p(a.length,t),{contents:[{uri:t,mimeType:"application/json",text:a}]}}if(i$1==="flows"){let r=I(o),a=JSON.stringify({count:r.length,flows:r},null,2);return p(a.length,t),{contents:[{uri:t,mimeType:"application/json",text:a}]}}if(i$1.startsWith("wisdom/")){let r=await z(i$1,o);if(r.handled)return p(r.text.length),{contents:[{uri:t,mimeType:"application/json",text:r.text}]}}if(i$1.startsWith("history/")){let r=await $(i$1,o);if(r.handled)return p(r.text.length),{contents:[{uri:t,mimeType:"application/json",text:r.text}]}}if(i$1.startsWith("context/")){let r=await H(i$1);if(r.handled)return p(r.text.length),{contents:[{uri:t,mimeType:r.text.startsWith("#")?"text/markdown":"application/json",text:r.text}]}}if(i$1==="prompts"||i$1.startsWith("prompts/")){let r=await Y(i$1,o);if(r.handled)return {contents:[{uri:t,mimeType:r.mimeType,text:r.text}]}}if(i$1==="specs"||i$1.startsWith("specs/")){let r=await X(i$1,o);if(r.handled)return {contents:[{uri:t,mimeType:r.mimeType,text:r.text}]}}if(i$1==="docs"||i$1.startsWith("docs/")){let r=await te(i$1,o);if(r.handled)return {contents:[{uri:t,mimeType:r.mimeType,text:r.text}]}}if(i$1==="guidance"||i$1.startsWith("guidance/")){let r=await ne(i$1);if(r.handled)return {contents:[{uri:t,mimeType:r.mimeType,text:r.text}]}}throw new Error(`Unknown resource: ${i$1}`)});}b();var _=process.argv[2]||process.cwd(),w=null;function re(){if(!w)throw new Error("Project context not loaded");return w}async function je(){w=await d(_),ua(_,w).catch(e=>{a.component("#paradigm-mcp").warn("Background reindex failed",{error:e.message});});}async function Te(){a.component("#paradigm-mcp").info("Loading project",{projectDir:_});try{w=await d(_),j$1().setRootDir(w.rootDir),a.component("#paradigm-mcp").info("Project loaded",{symbols:w.aggregation.symbols.length,project:w.projectName});}catch(n){a.component("#paradigm-mcp").error("Error loading project",{error:n.message}),process.exit(1);}g(_);let e=new Server({name:"paradigm",version:"0.1.0"},{capabilities:{resources:{},tools:{}}});ie(e,re),h(e,re,je),e.onerror=n=>{a.component("#paradigm-mcp").error("Server error",{error:String(n)});};let s=new StdioServerTransport;await e.connect(s),a.component("#paradigm-mcp").info("Server running on stdio");}Te().catch(e=>{a.component("#paradigm-mcp").error("Fatal error",{error:e.message}),process.exit(1);});
417
+ | Finishing any task | _(handled by stop hook)_ | Auto-checks compliance |`}};function we(e){return Math.ceil(e.length/3.5)}function oe(){return [{uri:"paradigm://guidance",name:"Guidance Topics",description:"List all available on-demand guidance topics (logging, portal, flows, orchestration, etc.)",mimeType:"application/json"},{uri:"paradigm://guidance/{topic}",name:"Guidance Content",description:`Get guidance for a topic. Available: ${Object.keys(j).join(", ")}`,mimeType:"text/markdown"}]}async function ne(e,s){let n=`paradigm://${e}`;if(e==="guidance"){let t=Object.entries(j).map(([i,a])=>{let r=a.generate();return {name:i,description:a.description,tokens:we(r)}}),o=JSON.stringify({count:t.length,totalTokens:t.reduce((i,a)=>i+a.tokens,0),note:"These guidance topics were previously baked into CLAUDE.md. Load on-demand to save context.",topics:t.map(i=>({...i,uri:`paradigm://guidance/${i.name}`}))},null,2);return b$1(o.length,n),{handled:true,text:o,mimeType:"application/json"}}if(e.startsWith("guidance/")&&e!=="guidance/"){let t=decodeURIComponent(e.replace("guidance/","")),o=j[t];if(!o){let a=Object.keys(j),r=JSON.stringify({error:`Unknown guidance topic: "${t}"`,available:a},null,2);return b$1(r.length,n),{handled:true,text:r,mimeType:"application/json"}}let i=o.generate();return b$1(i.length,n),{handled:true,text:i,mimeType:"text/markdown"}}return {handled:false,text:"",mimeType:"application/json"}}function ie(e,s){e.setRequestHandler(ListResourcesRequestSchema,async()=>({resources:[{uri:"paradigm://symbols",name:"All Symbols",description:"Overview of all Paradigm symbols in the project",mimeType:"application/json"},{uri:"paradigm://symbols/type/feature",name:"Features",description:"All @feature symbols",mimeType:"application/json"},{uri:"paradigm://symbols/type/component",name:"Components",description:"All #component symbols",mimeType:"application/json"},{uri:"paradigm://symbols/type/gate",name:"Gates",description:"All ^gate symbols (authorization)",mimeType:"application/json"},{uri:"paradigm://symbols/type/flow",name:"Flows",description:"All $flow symbols (processes)",mimeType:"application/json"},{uri:"paradigm://symbols/type/signal",name:"Signals",description:"All !signal symbols (events)",mimeType:"application/json"},{uri:"paradigm://symbols/type/state",name:"States",description:"All %state symbols",mimeType:"application/json"},{uri:"paradigm://gates",name:"Gates (Detailed)",description:"All gates with locks, keys, and prizes from portal.yaml",mimeType:"application/json"},{uri:"paradigm://flows",name:"Flows (Detailed)",description:"All flows with gate sequences",mimeType:"application/json"},...z(),...$(),...q(),...V(),...K(),...ee(),...oe()]})),e.setRequestHandler(ReadResourceRequestSchema,async n=>{let t=n.params.uri;if(!t?.startsWith("paradigm://"))throw new Error(`Unknown URI scheme: ${t}`);let o=s(),i=t.replace("paradigm://","");if(i==="symbols"){let a=p(o.index),r=q$1(o.index),d=JSON.stringify({project:o.projectName,counts:a,total:Object.values(a).reduce((p,k)=>p+k,0),symbols:r.map(p=>({symbol:p.symbol,type:p.type,description:p.description}))},null,2);return b$1(d.length,t),{contents:[{uri:t,mimeType:"application/json",text:d}]}}if(i.startsWith("symbol/")){let a=decodeURIComponent(i.replace("symbol/","")),r=k(o.index,a);if(!r){let p=JSON.stringify({error:"Symbol not found",symbol:a,available:q$1(o.index).filter(k=>k.symbol.includes(a.slice(1))).slice(0,5).map(k=>k.symbol)},null,2);return b$1(p.length,t),{contents:[{uri:t,mimeType:"application/json",text:p}]}}let d=JSON.stringify({symbol:r.symbol,type:r.type,description:r.description,filePath:r.filePath,references:r.references,referencedBy:r.referencedBy,tags:r.tags,data:r.data},null,2);return b$1(d.length,t),{contents:[{uri:t,mimeType:"application/json",text:d}]}}if(i.startsWith("symbols/type/")){let a=i.replace("symbols/type/",""),r=l$1(o.index,a),d=JSON.stringify({type:a,count:r.length,symbols:r.map(p=>({symbol:p.symbol,description:p.description,filePath:p.filePath,referencesCount:p.references.length,referencedByCount:p.referencedBy.length}))},null,2);return b$1(d.length,t),{contents:[{uri:t,mimeType:"application/json",text:d}]}}if(i==="gates"){let a=L(o),r=JSON.stringify({count:a.length,gates:a},null,2);return b$1(r.length,t),{contents:[{uri:t,mimeType:"application/json",text:r}]}}if(i==="flows"){let a=F(o),r=JSON.stringify({count:a.length,flows:a},null,2);return b$1(r.length,t),{contents:[{uri:t,mimeType:"application/json",text:r}]}}if(i.startsWith("wisdom/")){let a=await U(i,o);if(a.handled)return b$1(a.text.length),{contents:[{uri:t,mimeType:"application/json",text:a.text}]}}if(i.startsWith("history/")){let a=await G(i,o);if(a.handled)return b$1(a.text.length),{contents:[{uri:t,mimeType:"application/json",text:a.text}]}}if(i.startsWith("context/")){let a=await H(i);if(a.handled)return b$1(a.text.length),{contents:[{uri:t,mimeType:a.text.startsWith("#")?"text/markdown":"application/json",text:a.text}]}}if(i==="prompts"||i.startsWith("prompts/")){let a=await Y(i,o);if(a.handled)return {contents:[{uri:t,mimeType:a.mimeType,text:a.text}]}}if(i==="specs"||i.startsWith("specs/")){let a=await X(i,o);if(a.handled)return {contents:[{uri:t,mimeType:a.mimeType,text:a.text}]}}if(i==="docs"||i.startsWith("docs/")){let a=await te(i,o);if(a.handled)return {contents:[{uri:t,mimeType:a.mimeType,text:a.text}]}}if(i==="guidance"||i.startsWith("guidance/")){let a=await ne(i);if(a.handled)return {contents:[{uri:t,mimeType:a.mimeType,text:a.text}]}}throw new Error(`Unknown resource: ${i}`)});}b();var v=process.argv[2]||process.cwd(),_=null;function ae(){if(!_)throw new Error("Project context not loaded");return _}async function je(){_=await d(v),ga(v,_).catch(e=>{a.component("#paradigm-mcp").warn("Background reindex failed",{error:e.message});});}async function Te(){a.component("#paradigm-mcp").info("Loading project",{projectDir:v});try{_=await d(v),j$1().setRootDir(_.rootDir),a.component("#paradigm-mcp").info("Project loaded",{symbols:_.aggregation.symbols.length,project:_.projectName});}catch(n){a.component("#paradigm-mcp").error("Error loading project",{error:n.message}),process.exit(1);}g(v);let e=new Server({name:"paradigm",version:"0.1.0"},{capabilities:{resources:{},tools:{}}});ie(e,ae),h(e,ae,je),e.onerror=n=>{a.component("#paradigm-mcp").error("Server error",{error:String(n)});};let s=new StdioServerTransport;await e.connect(s),a.component("#paradigm-mcp").info("Server running on stdio");}Te().catch(e=>{a.component("#paradigm-mcp").error("Fatal error",{error:e.message}),process.exit(1);});
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{ea as getReindexToolsList,fa as handleReindexTool,ga as rebuildStaticFiles}from'./chunk-EMGJWT7D.js';import'./chunk-SU5F5D4I.js';import'./chunk-M4UMM6DC.js';import'./chunk-GRZQIKST.js';import'./chunk-6QXBXZF6.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-LAYBUKMB.js';import'./chunk-5TAVYPOV.js';
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as d from'path';import*as a from'js-yaml';var u=new Set(["symbol-syntax","dependency-question","auth-question"]),c={state:"pending",snoozed_until:null,snooze_count:0,opted_in_level:null};function m(r){return d.join(r,".paradigm","config.yaml")}function f(r){let t=m(r);if(!i.existsSync(t))return {...c};try{let n=a.load(i.readFileSync(t,"utf8"))?.rune?.promotion;return {state:n?.state??"pending",snoozed_until:n?.snoozed_until??null,snooze_count:n?.snooze_count??0,opted_in_level:n?.opted_in_level??null}}catch{return {...c}}}function p(r,t){let e=m(r);if(!i.existsSync(e))return;let s;try{if(s=a.load(i.readFileSync(e,"utf8")),!s||typeof s!="object")return}catch{return}let n=s.rune??{},o=n.promotion??{};if(t==="snooze"){let l=new Date;l.setDate(l.getDate()+7),o.state="snoozed",o.snoozed_until=l.toISOString().slice(0,10),o.snooze_count=(o.snooze_count??0)+1;}else t==="never"?(o.state="never",o.snoozed_until=null):(o.state="opted-in",o.opted_in_level=t,o.snoozed_until=null);n.promotion=o,s.rune=n,i.writeFileSync(e,a.dump(s,{lineWidth:-1,noRefs:true,sortKeys:false,quotingType:"'"}),"utf8");}function g(r,t){let e=f(r);return e.state==="opted-in"||e.state==="never"||e.state==="snoozed"&&e.snoozed_until&&new Date<new Date(e.snoozed_until)?false:t.some(n=>u.has(n))?true:t.filter(n=>!u.has(n)).length>=2}function y(){return ["## Symbol Tracking Available","","Paradigm's symbol system (#components, $flows, ^gates, !signals, ~aspects) helps document and enforce","architecture across sessions. Enforcement is currently set to **none** \u2014 all checks are off.","","Would you like to enable symbol tracking?","","**Options:**","- `minimal` \u2014 warnings only, no blocking. Good starting point.","- `balanced` \u2014 blocks on missing purpose files, warns on everything else.","- `snooze` \u2014 ask me again in 7 days.","- `never` \u2014 don't ask again.","","Call `paradigm_compliance_promote` with your choice, or just tell me which you prefer."].join(`
3
+ `)}export{y as buildAskText,f as getRunePromotionState,p as recordPromotion,g as shouldPromote};
@@ -48,7 +48,7 @@ Generated by paradigm shift.
48
48
 
49
49
  Generated by paradigm shift.
50
50
  `},{path:".cursor/rules/",defaultContent:"",isDir:true},{path:".claude/hooks/",defaultContent:"",isDir:true}];async function Q(o){let n=[],l=[];for(let r of ae){let f=d.join(o,r.path);if(r.isDir)await X(f)?l.push(r.path):(await C.mkdir(f,{recursive:true}),n.push(r.path));else if(await X(f))l.push(r.path);else {let i=d.dirname(f);await C.mkdir(i,{recursive:true}),await C.writeFile(f,r.defaultContent,"utf-8"),n.push(r.path);}}return {created:n,existed:l}}async function X(o){try{return await C.access(o),!0}catch{return false}}var ie=4,se=50,ce=['description: ""',"components: []","description: ''"],le={"claude-code":["opus","sonnet","haiku"],cursor:["sonnet","sonnet","haiku"],fallback:["sonnet","sonnet","sonnet"]};async function Z(o){let n=await Promise.allSettled([de(o),pe(o),fe(o),me(o),ue(o),ge(o),ye(o),he(o),we()]),l=[];for(let i of n)i.status==="fulfilled"&&i.value&&l.push(i.value);l.sort((i,b)=>i.priority-b.priority);let r=l.filter(i=>i.type==="action"),f=l.filter(i=>i.type==="info");return [...r.slice(0,ie),...f]}function ee(o){if(o.length===0)return "";let n=o.filter(m=>m.type==="action"),l=o.filter(m=>m.type==="info"),r=[];r.push(""),r.push(e.bold(" Recommendations")),r.push(e.gray(" "+"\u2500".repeat(49)));for(let m=0;m<n.length;m++){let i=n[m],b=e.white(` ${m+1}. `),S=e.white(i.message);i.command?(r.push(b+S),r.push(" "+e.cyan(i.command))):r.push(b+S);}if(l.length>0){r.push("");for(let m of l)r.push(e.dim(" "+m.message));}let f=n.length;if(f>0){r.push("");let m=f===1?"item needs":"items need";r.push(e.dim(` ${f} ${m} attention.`));}return r.push(""),r.join(`
51
- `)}async function de(o){let n=d.join(o,".purpose");try{let l=await C.readFile(n,"utf-8");if(l.trim().length<se)return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"};if(ce.some(f=>l.includes(f)))return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"}}catch{return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"}}return null}async function pe(o){let n=["src","packages","apps"];for(let r of n){let f=d.join(o,r);if(!a.existsSync(f))continue;if(await te(f))return null}return n.some(r=>a.existsSync(d.join(o,r)))?{id:"no-sub-purpose",priority:2,message:"Add `.purpose` files to feature directories",command:void 0,type:"action"}:null}async function fe(o){let n=d.join(o,"portal.yaml");try{let l=await C.readFile(n,"utf-8"),r=l.includes("gates:")&&!l.match(/gates:\s*(\[\]|\{\})\s*$/m)&&!l.match(/gates:\s*(\[\]|\{\})\s*\n/),f=l.includes("routes:")&&!l.match(/routes:\s*(\[\]|\{\})\s*$/m)&&!l.match(/routes:\s*(\[\]|\{\})\s*\n/);if(!r&&!f)return {id:"empty-portal",priority:3,message:"Define auth gates in `portal.yaml` if your project has auth",command:void 0,type:"action"}}catch{return {id:"empty-portal",priority:3,message:"Define auth gates in `portal.yaml` if your project has auth",command:void 0,type:"action"}}return null}async function me(o){let n=d.join(o,".paradigm","agents.yaml");try{let l=await C.readFile(n,"utf-8");if(l.includes("agents: []")||l.trim().length<40)return {id:"agents-unconfigured",priority:4,message:"Review agent roles",command:"paradigm agent list",type:"action"}}catch{return null}return null}async function ue(o){let n=d.join(o,".paradigm",".pending-scope-reviews");return a.existsSync(n)?{id:"pending-scope-reviews",priority:2,message:"Review agent scopes",command:"paradigm agent review",type:"action"}:null}async function ge(o){let n=d.join(o,".paradigm","config.yaml");try{let l=await C.readFile(n,"utf-8");if(!l.includes("model-resolution"))return null;let r=l.match(/tier-1:\s*(\S+)/),f=l.match(/tier-2:\s*(\S+)/),m=l.match(/tier-3:\s*(\S+)/);if(!r||!f||!m)return null;let i=[r[1].replace(/['"]/g,""),f[1].replace(/['"]/g,""),m[1].replace(/['"]/g,"")];if(Object.values(le).some(S=>S[0]===i[0]&&S[1]===i[1]&&S[2]===i[2]))return {id:"model-tiers-default",priority:5,message:"Fine-tune model tiers",command:"paradigm team models",type:"action"}}catch{return null}return null}async function ye(o){let n=d.join(o,".paradigm","lore","entries");try{if((await C.readdir(n)).filter(f=>!f.startsWith(".")).length===0)return {id:"no-lore",priority:8,message:"Lore records automatically as you work",command:void 0,type:"info"}}catch{return {id:"no-lore",priority:8,message:"Lore records automatically as you work",command:void 0,type:"info"}}return null}async function he(o){let n=d.join(o,".paradigm","notebooks");try{if((await C.readdir(n)).filter(f=>!f.startsWith(".")).length===0)return {id:"no-notebooks",priority:8,message:"Agent notebooks build over time",command:void 0,type:"info"}}catch{return {id:"no-notebooks",priority:8,message:"Agent notebooks build over time",command:void 0,type:"info"}}return null}async function we(){return {id:"verify-not-run",priority:6,message:"Verify setup health",command:"paradigm doctor --verify",type:"action"}}async function te(o,n=0){if(n>4)return false;try{let l=await C.readdir(o,{withFileTypes:!0});for(let r of l)if(!(r.isDirectory()&&["node_modules","dist",".git",".next",".paradigm","build","out","target",".turbo"].includes(r.name))&&(r.name===".purpose"&&!r.isDirectory()||r.isDirectory()&&await te(d.join(o,r.name),n+1)))return !0}catch{a$1.operation("shift-recommendations").debug("Could not read directory",{dir:o});}return false}var oe=new Set(["architect","builder","reviewer","security","advocate","tester","compliance","documentor"]),I={architect:{nickname:"Apex",role:"System design, specifications"},builder:{nickname:"Kit",role:"Implementation, tests"},reviewer:{nickname:"Judge",role:"Code quality, compliance"},security:{nickname:"Aegis",role:"Auth flows, vulnerability scanning"},advocate:{nickname:"Jinx",role:"Stress testing, edge cases"},tester:{nickname:"Probe",role:"Unit and integration tests"},compliance:{nickname:"Rune",role:"Symbol compliance enforcement"},documentor:{nickname:"Scribe",role:".purpose, portal.yaml maintenance"}};function ke(o){let n=[],l=d.join(ne.homedir(),".paradigm","agents");for(let[r,f]of Object.entries(o.agents)){let m,i=r,b=d.join(l,`${r}.agent`);if(a.existsSync(b))try{let v=a.readFileSync(b,"utf8"),E=h.load(v);E?.nickname&&(m=E.nickname),E?.role&&(i=E.role);}catch{}!m&&I[r]&&(m=I[r].nickname,i=I[r].role);let S=f.source==="core"||f.source==="ecosystem"?f.source:oe.has(r)?"core":"ecosystem";n.push({id:r,nickname:m,role:i,source:S});}return n}async function be(o,n,l){if(!a.existsSync(n))return;let r;try{r=h.load(a.readFileSync(n,"utf8"))??{active:[]};}catch{return}let f=Array.isArray(r.active)?r.active:[];if(f.includes("compliance"))return;let{isCohortC:m}=await import('./migration-notices-MRZ6PVDS.js');if(!m(o))return;let i=d.join(o,".paradigm",".compliance-nomination-skipped");if(a.existsSync(i)&&!l.force)return;if(!process.stdin.isTTY||l.prompt===false){try{a.writeFileSync(i,"","utf8");}catch{}return}console.log(""),console.log(e.cyan("Step 2c-nominate/6: Symbol enforcement")),console.log(""),console.log(" This project defines ~aspects but no compliance-archetype agent"),console.log(" (Rune) is on the roster."),console.log(""),console.log(" Without a claimant, paradigm 6.0.4 no longer enforces aspect"),console.log(" coverage. You can:"),console.log(""),console.log(` ${e.green("[Y]")} Add Rune (compliance) to the roster \u2014 recommended`),console.log(" Authority defaults will be written to .paradigm/authority.yaml."),console.log(" Default mode: advise (Rune surfaces findings, never blocks)."),console.log(""),console.log(` ${e.yellow("[N]")} Skip \u2014 opt out of aspect enforcement for this project`),console.log(" This decision is remembered. Re-run with --force to revisit."),console.log("");let S=(await import('readline/promises')).createInterface({input:process.stdin,output:process.stdout}),v="";try{v=(await S.question(" Add Rune to roster? [Y/n]: ")).trim().toLowerCase();}catch{v="";}finally{S.close();}if(v===""||v==="y"||v==="yes"){r.active=[...f,"compliance"].sort();try{a.writeFileSync(n,h.dump(r,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(" \u2713 Rune (compliance) added to roster"));}catch(x){a$1.operation("shift").debug("Roster update failed",{error:x.message});return}try{let{writeArchetypeDefaults:x}=await import('./authority-GCMPX7RW.js');await x(o,"archetype-default"),console.log(e.gray(" \u2713 Authority defaults written to .paradigm/authority.yaml"));}catch(x){a$1.operation("shift").debug("Authority defaults write failed",{error:x.message});}if(a.existsSync(i))try{a.unlinkSync(i);}catch{}}else {try{a.writeFileSync(i,"","utf8");}catch{}console.log(e.gray(" Skipped \u2014 opt out of aspect enforcement for this project"));}}async function Le(o={}){let n=process.cwd(),l=d.basename(n),r=d.join(n,".paradigm"),f$1=a.existsSync(r)&&a.statSync(r).isDirectory();console.log(e.blue(`
51
+ `)}async function de(o){let n=d.join(o,".purpose");try{let l=await C.readFile(n,"utf-8");if(l.trim().length<se)return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"};if(ce.some(f=>l.includes(f)))return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"}}catch{return {id:"empty-purpose",priority:1,message:"Edit `.purpose` to define your project's features",command:void 0,type:"action"}}return null}async function pe(o){let n=["src","packages","apps"];for(let r of n){let f=d.join(o,r);if(!a.existsSync(f))continue;if(await te(f))return null}return n.some(r=>a.existsSync(d.join(o,r)))?{id:"no-sub-purpose",priority:2,message:"Add `.purpose` files to feature directories",command:void 0,type:"action"}:null}async function fe(o){let n=d.join(o,"portal.yaml");try{let l=await C.readFile(n,"utf-8"),r=l.includes("gates:")&&!l.match(/gates:\s*(\[\]|\{\})\s*$/m)&&!l.match(/gates:\s*(\[\]|\{\})\s*\n/),f=l.includes("routes:")&&!l.match(/routes:\s*(\[\]|\{\})\s*$/m)&&!l.match(/routes:\s*(\[\]|\{\})\s*\n/);if(!r&&!f)return {id:"empty-portal",priority:3,message:"Define auth gates in `portal.yaml` if your project has auth",command:void 0,type:"action"}}catch{return {id:"empty-portal",priority:3,message:"Define auth gates in `portal.yaml` if your project has auth",command:void 0,type:"action"}}return null}async function me(o){let n=d.join(o,".paradigm","agents.yaml");try{let l=await C.readFile(n,"utf-8");if(l.includes("agents: []")||l.trim().length<40)return {id:"agents-unconfigured",priority:4,message:"Review agent roles",command:"paradigm agent list",type:"action"}}catch{return null}return null}async function ue(o){let n=d.join(o,".paradigm",".pending-scope-reviews");return a.existsSync(n)?{id:"pending-scope-reviews",priority:2,message:"Review agent scopes",command:"paradigm agent review",type:"action"}:null}async function ge(o){let n=d.join(o,".paradigm","config.yaml");try{let l=await C.readFile(n,"utf-8");if(!l.includes("model-resolution"))return null;let r=l.match(/tier-1:\s*(\S+)/),f=l.match(/tier-2:\s*(\S+)/),m=l.match(/tier-3:\s*(\S+)/);if(!r||!f||!m)return null;let i=[r[1].replace(/['"]/g,""),f[1].replace(/['"]/g,""),m[1].replace(/['"]/g,"")];if(Object.values(le).some(S=>S[0]===i[0]&&S[1]===i[1]&&S[2]===i[2]))return {id:"model-tiers-default",priority:5,message:"Fine-tune model tiers",command:"paradigm team models",type:"action"}}catch{return null}return null}async function ye(o){let n=d.join(o,".paradigm","lore","entries");try{if((await C.readdir(n)).filter(f=>!f.startsWith(".")).length===0)return {id:"no-lore",priority:8,message:"Lore records automatically as you work",command:void 0,type:"info"}}catch{return {id:"no-lore",priority:8,message:"Lore records automatically as you work",command:void 0,type:"info"}}return null}async function he(o){let n=d.join(o,".paradigm","notebooks");try{if((await C.readdir(n)).filter(f=>!f.startsWith(".")).length===0)return {id:"no-notebooks",priority:8,message:"Agent notebooks build over time",command:void 0,type:"info"}}catch{return {id:"no-notebooks",priority:8,message:"Agent notebooks build over time",command:void 0,type:"info"}}return null}async function we(){return {id:"verify-not-run",priority:6,message:"Verify setup health",command:"paradigm doctor --verify",type:"action"}}async function te(o,n=0){if(n>4)return false;try{let l=await C.readdir(o,{withFileTypes:!0});for(let r of l)if(!(r.isDirectory()&&["node_modules","dist",".git",".next",".paradigm","build","out","target",".turbo"].includes(r.name))&&(r.name===".purpose"&&!r.isDirectory()||r.isDirectory()&&await te(d.join(o,r.name),n+1)))return !0}catch{a$1.operation("shift-recommendations").debug("Could not read directory",{dir:o});}return false}var oe=new Set(["architect","builder","reviewer","security","advocate","tester","compliance","documentor"]),I={architect:{nickname:"Apex",role:"System design, specifications"},builder:{nickname:"Kit",role:"Implementation, tests"},reviewer:{nickname:"Judge",role:"Code quality, compliance"},security:{nickname:"Aegis",role:"Auth flows, vulnerability scanning"},advocate:{nickname:"Jinx",role:"Stress testing, edge cases"},tester:{nickname:"Probe",role:"Unit and integration tests"},compliance:{nickname:"Rune",role:"Symbol compliance enforcement"},documentor:{nickname:"Scribe",role:".purpose, portal.yaml maintenance"}};function ke(o){let n=[],l=d.join(ne.homedir(),".paradigm","agents");for(let[r,f]of Object.entries(o.agents)){let m,i=r,b=d.join(l,`${r}.agent`);if(a.existsSync(b))try{let v=a.readFileSync(b,"utf8"),E=h.load(v);E?.nickname&&(m=E.nickname),E?.role&&(i=E.role);}catch{}!m&&I[r]&&(m=I[r].nickname,i=I[r].role);let S=f.source==="core"||f.source==="ecosystem"?f.source:oe.has(r)?"core":"ecosystem";n.push({id:r,nickname:m,role:i,source:S});}return n}async function be(o,n,l){if(!a.existsSync(n))return;let r;try{r=h.load(a.readFileSync(n,"utf8"))??{active:[]};}catch{return}let f=Array.isArray(r.active)?r.active:[];if(f.includes("compliance"))return;let{isCohortC:m}=await import('./migration-notices-MRZ6PVDS.js');if(!m(o))return;let i=d.join(o,".paradigm",".compliance-nomination-skipped");if(a.existsSync(i)&&!l.force)return;if(!process.stdin.isTTY||l.prompt===false){try{a.writeFileSync(i,"","utf8");}catch{}return}console.log(""),console.log(e.cyan("Step 2c-nominate/6: Symbol enforcement")),console.log(""),console.log(" This project defines ~aspects but no compliance-archetype agent"),console.log(" (Rune) is on the roster."),console.log(""),console.log(" Without a claimant, paradigm 6.0.4 no longer enforces aspect"),console.log(" coverage. You can:"),console.log(""),console.log(` ${e.green("[Y]")} Add Rune (compliance) to the roster \u2014 recommended`),console.log(" Authority defaults will be written to .paradigm/authority.yaml."),console.log(" Default mode: advise (Rune surfaces findings, never blocks)."),console.log(""),console.log(` ${e.yellow("[N]")} Skip \u2014 opt out of aspect enforcement for this project`),console.log(" This decision is remembered. Re-run with --force to revisit."),console.log("");let S=(await import('readline/promises')).createInterface({input:process.stdin,output:process.stdout}),v="";try{v=(await S.question(" Add Rune to roster? [Y/n]: ")).trim().toLowerCase();}catch{v="";}finally{S.close();}if(v===""||v==="y"||v==="yes"){r.active=[...f,"compliance"].sort();try{a.writeFileSync(n,h.dump(r,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(" \u2713 Rune (compliance) added to roster"));}catch(R){a$1.operation("shift").debug("Roster update failed",{error:R.message});return}try{let{writeArchetypeDefaults:R}=await import('./authority-GCMPX7RW.js');await R(o,"archetype-default"),console.log(e.gray(" \u2713 Authority defaults written to .paradigm/authority.yaml"));}catch(R){a$1.operation("shift").debug("Authority defaults write failed",{error:R.message});}if(a.existsSync(i))try{a.unlinkSync(i);}catch{}}else {try{a.writeFileSync(i,"","utf8");}catch{}console.log(e.gray(" Skipped \u2014 opt out of aspect enforcement for this project"));}}async function Le(o={}){let n=process.cwd(),l=d.basename(n),r=d.join(n,".paradigm"),f$1=a.existsSync(r)&&a.statSync(r).isDirectory();console.log(e.blue(`
52
52
  \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(e.blue("\u2502")+e.white.bold(" paradigm shift ")+e.blue("\u2502")),console.log(e.blue("\u2502")+e.gray(" Full project setup in one command ")+e.blue("\u2502")),console.log(e.blue(`\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
53
53
  `)),console.log(e.white(` \u{1F4C1} Project: ${e.cyan(l)}`)),console.log(e.white(` \u{1F4CD} Status: ${f$1?e.green("Paradigm detected"):e.yellow("New project")}`)),console.log("");let m=a$1.command("shift").start("Running paradigm shift",{project:l}),i=Se();if(!f$1||o.force){i.start("Step 1/6: Initializing Paradigm...");try{await a$2({force:o.force,quick:!0,name:l,stack:o.stack}),i.succeed(e.green("Paradigm initialized"));}catch(t){i.fail(e.red(`Init failed: ${t.message}`)),m.error("Shift failed at init",{error:t.message});return}}else {i.succeed(e.gray("Step 1/6: Already initialized (use --force to reinit)"));let t=d.join(r,"config.yaml");if(a.existsSync(t))try{let s=a.readFileSync(t,"utf8"),c=h.load(s);if(!c.discipline||c.discipline==="auto"){let p=a$3(n);if(p!=="backend"){let u=s.replace(/^discipline:\s*auto\b.*$/m,`discipline: ${p}`);u!==s&&(a.writeFileSync(t,u,"utf8"),console.log(e.green(` \u2713 Detected discipline: ${e.cyan(p)} (updated config.yaml)`)));}else if(!c.discipline){let u=s.replace(/^(project:\s*.+)$/m,`$1
54
54
  discipline: ${p}`);u!==s&&(a.writeFileSync(t,u,"utf8"),console.log(e.green(` \u2713 Added discipline: ${e.cyan(p)} to config.yaml`)));}}}catch(s){a$1.operation("shift").debug("Discipline detection failed",{error:s.message});}}if(f$1){i.start("Step 1b/6: Checking for migrations...");try{let{migrateCommand:t}=await import('./migrate-R64OQGSM.js');await t({apply:!0,quiet:!0,noSync:!0}),i.succeed(e.green("Migrations applied"));}catch(t){i.warn(e.yellow(`Migration warning: ${t.message}`));}}{let t=d.join(r,"config.yaml");if(o.workspace&&a.existsSync(t)){let s=o.workspacePath?d.resolve(n,o.workspacePath):d.join(d.dirname(n),".paradigm-workspace");if(a.existsSync(s))try{let c=h.load(a.readFileSync(s,"utf8")),p=d.basename(n),u=d.dirname(s),g="./"+d.relative(u,n);if(c.members.some(j=>d.resolve(u,j.path)===n))console.log(e.green(` \u2713 Already a member of workspace: ${e.cyan(c.name)}`));else {let j=d$1(p,n);c.members.push({name:p,path:g,...j&&{role:j}}),a.writeFileSync(s,h.dump(c,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(` \u2713 Joined workspace: ${e.cyan(c.name)} (added as member)`));}}catch(c){console.log(e.yellow(` \u26A0 Failed to join workspace: ${c.message}`));}else try{let c=d.basename(n),p=d.dirname(s),u="./"+d.relative(p,n),g=d$1(c,n),y={version:"1.0",name:o.workspace,members:[{name:c,path:u,...g&&{role:g}}]};a.mkdirSync(d.dirname(s),{recursive:!0}),a.writeFileSync(s,h.dump(y,{indent:2,lineWidth:120,noRefs:!0,sortKeys:!1,quotingType:'"'}),"utf8"),console.log(e.green(` \u2713 Created workspace: ${e.cyan(o.workspace)} at ${e.gray(d.relative(n,s))}`));}catch(c){console.log(e.yellow(` \u26A0 Failed to create workspace: ${c.message}`));}try{let c=a.readFileSync(t,"utf8"),p=h.load(c),u=d.relative(n,s);if(p.workspace!==u){if(p.workspace){let g=c.replace(/^workspace:\s*.*$/m,`workspace: "${u}"`);a.writeFileSync(t,g,"utf8");}else {let g=c.trimEnd()+`
@@ -57,4 +57,4 @@ workspace: "${u}"
57
57
  workspace: "${j}"
58
58
  `;a.writeFileSync(t,re,"utf8"),console.log(e.green(` \u2713 Found workspace: ${e.cyan(j)} (added to config.yaml)`));break}let y=d.dirname(p);if(y===p)break;p=y;}}}catch(s){a$1.operation("shift").debug("Workspace auto-detect failed",{error:s.message});}}if(!d$2(n)||o.force){console.log(e.cyan(" Step 2/6: Initializing team configuration..."));try{await b(n,{force:o.force,json:!1,configureModels:o.configureModels||!1,noConfigureModels:!o.configureModels}),console.log(e.green(` \u2713 Team configuration initialized
59
59
  `));}catch(t){console.log(e.yellow(` \u26A0 Team init warning: ${t.message}
60
- `));}}else i.succeed(e.gray("Step 2/6: Team already configured (use --force to reinit)"));if(o.force){let t=d.join(n,".paradigm",".compliance-nomination-skipped");if(a.existsSync(t))try{a.unlinkSync(t);}catch{}}let S=d.join(n,".paradigm","roster.yaml");if(!a.existsSync(S)||o.force)try{let t=a$4(n),s=b$1[t]||b$1.generic,c={version:"1.0",project:l,type:t,active:s.sort()};a.writeFileSync(S,h.dump(c,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(` \u2713 Agent roster set: ${e.cyan(s.length)} agents for ${e.cyan(t)}`));}catch(t){a$1.operation("shift").debug("Roster setup failed",{error:t.message});}else try{let s=h.load(a.readFileSync(S,"utf8"))?.active?.length??0;console.log(e.gray(` \u2713 Agent roster exists (${s} agents active)`));}catch{console.log(e.gray(" \u2713 Agent roster exists"));}await be(n,S,o);{let t=d.join(n,".paradigm","adoptions.yaml"),s=a.existsSync(t);try{let c=a$4(n),p=s?await a$5(n):null,u=p&&Object.keys(p.agents).length>0;if(!u&&a.existsSync(S))p=await d$3(n),await b$2(n,p),a$1.operation("shift").debug("Migrated roster to adoptions",{count:Object.keys(p.agents).length});else if(!u){p=e$1(c);let g=a.existsSync(S)?h.load(a.readFileSync(S,"utf8")):{active:[]},y=new Date().toISOString();for(let j of g.active||[])p.agents[j]={adopted:y,source:oe.has(j)?"core":"ecosystem",defaultsAccepted:!0};Object.keys(p.agents).length>0&&await b$2(n,p);}if(p&&Object.keys(p.agents).length>0){let g=ke(p),y=f(g,c);console.log(y),console.log(e.green(` \u2713 ${Object.keys(p.agents).length} agents adopted`));}if(p&&p.agents.compliance){let g=d.join(n,".paradigm","authority.yaml");if(!a.existsSync(g))try{let{writeArchetypeDefaults:y}=await import('./authority-GCMPX7RW.js');await y(n,"archetype-default"),a$1.operation("shift").debug("Wrote archetype-default authority.yaml",{source:"default-adoption"});}catch(y){a$1.operation("shift").debug("Authority defaults write failed",{error:y.message});}}}catch(c){a$1.operation("shift").debug("Adoption ceremony failed",{error:c.message});}}{let t=d.join(r,"config.yaml");if(a.existsSync(t))try{let s=a.readFileSync(t,"utf8"),c=h.load(s);if(!c["model-resolution"]||o.force){let{ModelDiscovery:p}=await import('./model-discovery-HMB3YI4L.js'),g=new p(n).detectEnvironment(),y;g==="claude-code"?y={"tier-1":"opus","tier-2":"sonnet","tier-3":"haiku"}:g==="cursor"?y={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"haiku"}:y={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"sonnet"},c["model-resolution"]=y,a.writeFileSync(t,h.dump(c,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(` \u2713 Model tiers configured for ${e.cyan(g)}: tier-1=${y["tier-1"]}, tier-2=${y["tier-2"]}, tier-3=${y["tier-3"]}`));}}catch(s){a$1.operation("shift").debug("Model tier config failed",{error:s.message});}}try{let{ensureEnforcementDefaults:t}=await import('./enforcement-BEGPQIUN.js');t(n)&&console.log(e.green(` \u2713 Enforcement config initialized (${e.cyan("balanced")} preset)`));}catch(t){a$1.operation("shift").debug("Enforcement config setup failed",{error:t.message});}{i.start("Ensuring core files...");try{let{created:t,existed:s}=await Q(n);i.succeed(e.green(`Core files ensured: ${e.cyan(String(t.length))} created, ${e.cyan(String(s.length))} already existed`));}catch(t){i.warn(e.yellow(`Guaranteed files warning: ${t.message}`));}}if(o.quick)i.succeed(e.gray("Step 3/6: Skipped scan (--quick mode)"));else {i.start("Step 3/6: Scanning and indexing symbols...");try{await b$3(n,{quiet:!0}),i.succeed(e.green("Symbols indexed"));}catch(t){i.warn(e.yellow(`Scan warning: ${t.message}`));}}{let t=d.join(r,"config.yaml");if(a.existsSync(t))try{if(h.load(a.readFileSync(t,"utf8")).workspace){i.start("Step 3b/6: Reindexing workspace members...");try{let{workspaceReindexCommand:c}=await import('./workspace-VMSPYIBV.js');await c({quiet:!0}),i.succeed(e.green("Workspace members reindexed"));}catch(c){i.warn(e.yellow(`Workspace reindex: ${c.message}`));}}}catch(s){a$1.operation("shift").debug("Workspace config read failed",{error:s.message});}}let v=d.join(n,"portal.yaml");a.existsSync(v)||a.writeFileSync(v,h.dump({version:"1.0.0",gates:{},routes:{}},{lineWidth:-1,noRefs:true}),"utf8");let E=d.join(n,".paradigm","lore");a.existsSync(E)||a.mkdirSync(E,{recursive:true});let x=d.join(n,".paradigm","university");for(let t of ["content/notes","content/policies","content/quizzes","content/paths","diplomas"]){let s=d.join(x,t);a.existsSync(s)||a.mkdirSync(s,{recursive:true});}let N=d.join(x,"config.yaml");if(!a.existsSync(N)){let t="Project";try{let c=d.join(n,".paradigm","config.yaml");if(a.existsSync(c)){let p=h.load(a.readFileSync(c,"utf8"));p.project&&typeof p.project=="string"&&(t=p.project);}}catch{}let s={branding:{name:`${t} University`,tagline:`Learn the ${t} codebase`,institution:t},theme:{primary:"#6366f1",secondary:"#8b5cf6",accent:"#f59e0b",background:"#0f172a",surface:"#1e293b",text:"#f8fafc",textMuted:"#94a3b8",success:"#22c55e",error:"#ef4444",font:"Inter, system-ui, sans-serif"},content:{categories:[],defaultDifficulty:"beginner",requireApproval:false},diplomas:{includeGlobalPLSAT:true}};a.writeFileSync(N,h.dump(s,{lineWidth:-1,noRefs:true}),"utf8");}i.start("Step 4/6: Syncing IDE configurations...");try{let t=o.ide?[o.ide]:["claude","cursor","copilot","windsurf","agents"],s=[];for(let c of t)try{await a$6(c,{quiet:!0,force:!0}),s.push(c);}catch{}s.length>0?i.succeed(e.green(`IDE configs synced: ${s.join(", ")}`)):i.warn(e.yellow("No IDE configs to sync"));}catch(t){i.warn(e.yellow(`Sync warning: ${t.message}`));}i.start("Step 5/6: Installing hooks...");try{await a$7({force:o.force}),i.succeed(e.green("Hooks installed (git + Claude Code + Cursor)"));}catch(t){i.warn(e.yellow(`Hooks warning: ${t.message}`));}if(o.verify){i.start("Step 6/6: Running health checks...");try{await a$8({quiet:!0})?i.succeed(e.green("All health checks passed")):i.warn(e.yellow("Some health checks need attention"));}catch(t){i.warn(e.yellow(`Doctor warning: ${t.message}`));}}else i.succeed(e.gray("Step 6/6: Skipped verify (use --verify to check health)"));console.log(""),console.log(e.blue("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")),console.log(e.blue("\u2502")+e.white.bold(" \u2728 Paradigm shift complete! ")+e.blue("\u2502")),console.log(e.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")),console.log(""),console.log(e.white(" Created/Updated:")),console.log(e.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));let O=[{path:".paradigm/config.yaml",desc:"Project configuration"},{path:".paradigm/navigator.yaml",desc:"Symbol navigation map"},{path:".paradigm/agents.yaml",desc:"Team agent configuration"},{path:".paradigm/adoptions.yaml",desc:"Agent adoption records"},{path:".purpose",desc:"Root feature definitions"},{path:".paradigm/lore/",desc:"Project lore timeline",isDir:true},{path:"portal.yaml",desc:"Authorization gates"},{path:".paradigm/roster.yaml",desc:"Agent roster for this project"},{path:"CLAUDE.md",desc:"Claude Code AI instructions"},{path:"AGENTS.md",desc:"Universal AI agent instructions"},{path:".cursor/rules/",desc:"Cursor AI instructions",isDir:true},{path:".claude/hooks/",desc:"Claude Code enforcement hooks",isDir:true,optional:true},{path:".cursor/hooks/",desc:"Cursor enforcement hooks",isDir:true,optional:true}],W=d.join(r,"config.yaml");if(a.existsSync(W))try{let t=h.load(a.readFileSync(W,"utf8"));if(typeof t.workspace=="string"){let s=d.resolve(n,t.workspace),c=d.relative(n,s);O.push({path:c,desc:"Multi-project workspace",optional:!0});}}catch(t){a$1.operation("shift").debug("Summary config read failed",{error:t.message});}for(let t of O){let s=d.join(n,t.path);a.existsSync(s)?console.log(e.green(" \u2713 ")+e.white(t.path.padEnd(28))+e.gray(t.desc)):t.optional||console.log(e.yellow(" \u25CB ")+e.gray(t.path.padEnd(28))+e.gray(`(${t.desc})`));}try{let t=await Z(n),s=ee(t);s&&console.log(s);}catch(t){a$1.operation("shift").debug("Recommendations engine failed",{error:t.message}),console.log(""),console.log(e.white(" Next steps:")),console.log(e.gray(" "+"\u2500".repeat(49))),console.log(e.white(" 1. ")+e.gray("Edit ")+e.cyan(".purpose")+e.gray(" to define your features")),console.log(e.white(" 2. ")+e.gray("Run ")+e.cyan("paradigm shift --verify")+e.gray(" to check health")),console.log("");}try{let{captureSnapshot:t,seedMetricsConsent:s}=await import('./metrics-UESGUHTA.js');s(n),t(n);}catch(t){a$1.operation("shift").debug("metrics snapshot failed",{error:t.message});}m.success("Paradigm shift complete",{project:l});}export{be as runComplianceNominationStep,Le as shiftCommand};
60
+ `));}}else i.succeed(e.gray("Step 2/6: Team already configured (use --force to reinit)"));if(o.force){let t=d.join(n,".paradigm",".compliance-nomination-skipped");if(a.existsSync(t))try{a.unlinkSync(t);}catch{}}let S=d.join(n,".paradigm","roster.yaml");if(!a.existsSync(S)||o.force)try{let t=a$4(n),s=b$1[t]||b$1.generic,c={version:"1.0",project:l,type:t,active:s.sort()};a.writeFileSync(S,h.dump(c,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(` \u2713 Agent roster set: ${e.cyan(s.length)} agents for ${e.cyan(t)}`));}catch(t){a$1.operation("shift").debug("Roster setup failed",{error:t.message});}else try{let s=h.load(a.readFileSync(S,"utf8"))?.active?.length??0;console.log(e.gray(` \u2713 Agent roster exists (${s} agents active)`));}catch{console.log(e.gray(" \u2713 Agent roster exists"));}await be(n,S,o);{let t=d.join(n,".paradigm","adoptions.yaml"),s=a.existsSync(t);try{let c=a$4(n),p=s?await a$5(n):null,u=p&&Object.keys(p.agents).length>0;if(!u&&a.existsSync(S))p=await d$3(n),await b$2(n,p),a$1.operation("shift").debug("Migrated roster to adoptions",{count:Object.keys(p.agents).length});else if(!u){p=e$1(c);let g=a.existsSync(S)?h.load(a.readFileSync(S,"utf8")):{active:[]},y=new Date().toISOString();for(let j of g.active||[])p.agents[j]={adopted:y,source:oe.has(j)?"core":"ecosystem",defaultsAccepted:!0};Object.keys(p.agents).length>0&&await b$2(n,p);}if(p&&Object.keys(p.agents).length>0){let g=ke(p),y=f(g,c);console.log(y),console.log(e.green(` \u2713 ${Object.keys(p.agents).length} agents adopted`));}if(p&&p.agents.compliance){let g=d.join(n,".paradigm","authority.yaml");if(!a.existsSync(g))try{let{writeArchetypeDefaults:y}=await import('./authority-GCMPX7RW.js');await y(n,"archetype-default"),a$1.operation("shift").debug("Wrote archetype-default authority.yaml",{source:"default-adoption"});}catch(y){a$1.operation("shift").debug("Authority defaults write failed",{error:y.message});}}}catch(c){a$1.operation("shift").debug("Adoption ceremony failed",{error:c.message});}}{let t=d.join(r,"config.yaml");if(a.existsSync(t))try{let s=a.readFileSync(t,"utf8"),c=h.load(s);if(!c["model-resolution"]||o.force){let{ModelDiscovery:p}=await import('./model-discovery-HMB3YI4L.js'),g=new p(n).detectEnvironment(),y;g==="claude-code"?y={"tier-1":"opus","tier-2":"sonnet","tier-3":"haiku"}:g==="cursor"?y={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"haiku"}:y={"tier-1":"sonnet","tier-2":"sonnet","tier-3":"sonnet"},c["model-resolution"]=y,a.writeFileSync(t,h.dump(c,{lineWidth:-1,noRefs:!0}),"utf8"),console.log(e.green(` \u2713 Model tiers configured for ${e.cyan(g)}: tier-1=${y["tier-1"]}, tier-2=${y["tier-2"]}, tier-3=${y["tier-3"]}`));}}catch(s){a$1.operation("shift").debug("Model tier config failed",{error:s.message});}}try{let{ensureEnforcementDefaults:t}=await import('./enforcement-VRE3WZOI.js');t(n)&&(console.log(e.green(` \u2713 Enforcement config initialized (${e.cyan("none")} preset)`)),console.log(e.dim(" Enforcement: none \u2014 symbol tracking available when you're ready. Rune will guide you.")));}catch(t){a$1.operation("shift").debug("Enforcement config setup failed",{error:t.message});}{i.start("Ensuring core files...");try{let{created:t,existed:s}=await Q(n);i.succeed(e.green(`Core files ensured: ${e.cyan(String(t.length))} created, ${e.cyan(String(s.length))} already existed`));}catch(t){i.warn(e.yellow(`Guaranteed files warning: ${t.message}`));}}if(o.quick)i.succeed(e.gray("Step 3/6: Skipped scan (--quick mode)"));else {i.start("Step 3/6: Scanning and indexing symbols...");try{await b$3(n,{quiet:!0}),i.succeed(e.green("Symbols indexed"));}catch(t){i.warn(e.yellow(`Scan warning: ${t.message}`));}}{let t=d.join(r,"config.yaml");if(a.existsSync(t))try{if(h.load(a.readFileSync(t,"utf8")).workspace){i.start("Step 3b/6: Reindexing workspace members...");try{let{workspaceReindexCommand:c}=await import('./workspace-VMSPYIBV.js');await c({quiet:!0}),i.succeed(e.green("Workspace members reindexed"));}catch(c){i.warn(e.yellow(`Workspace reindex: ${c.message}`));}}}catch(s){a$1.operation("shift").debug("Workspace config read failed",{error:s.message});}}let v=d.join(n,"portal.yaml");a.existsSync(v)||a.writeFileSync(v,h.dump({version:"1.0.0",gates:{},routes:{}},{lineWidth:-1,noRefs:true}),"utf8");let E=d.join(n,".paradigm","lore");a.existsSync(E)||a.mkdirSync(E,{recursive:true});let R=d.join(n,".paradigm","university");for(let t of ["content/notes","content/policies","content/quizzes","content/paths","diplomas"]){let s=d.join(R,t);a.existsSync(s)||a.mkdirSync(s,{recursive:true});}let N=d.join(R,"config.yaml");if(!a.existsSync(N)){let t="Project";try{let c=d.join(n,".paradigm","config.yaml");if(a.existsSync(c)){let p=h.load(a.readFileSync(c,"utf8"));p.project&&typeof p.project=="string"&&(t=p.project);}}catch{}let s={branding:{name:`${t} University`,tagline:`Learn the ${t} codebase`,institution:t},theme:{primary:"#6366f1",secondary:"#8b5cf6",accent:"#f59e0b",background:"#0f172a",surface:"#1e293b",text:"#f8fafc",textMuted:"#94a3b8",success:"#22c55e",error:"#ef4444",font:"Inter, system-ui, sans-serif"},content:{categories:[],defaultDifficulty:"beginner",requireApproval:false},diplomas:{includeGlobalPLSAT:true}};a.writeFileSync(N,h.dump(s,{lineWidth:-1,noRefs:true}),"utf8");}i.start("Step 4/6: Syncing IDE configurations...");try{let t=o.ide?[o.ide]:["claude","cursor","copilot","windsurf","agents"],s=[];for(let c of t)try{await a$6(c,{quiet:!0,force:!0}),s.push(c);}catch{}s.length>0?i.succeed(e.green(`IDE configs synced: ${s.join(", ")}`)):i.warn(e.yellow("No IDE configs to sync"));}catch(t){i.warn(e.yellow(`Sync warning: ${t.message}`));}i.start("Step 5/6: Installing hooks...");try{await a$7({force:o.force}),i.succeed(e.green("Hooks installed (git + Claude Code + Cursor)"));}catch(t){i.warn(e.yellow(`Hooks warning: ${t.message}`));}if(o.verify){i.start("Step 6/6: Running health checks...");try{await a$8({quiet:!0})?i.succeed(e.green("All health checks passed")):i.warn(e.yellow("Some health checks need attention"));}catch(t){i.warn(e.yellow(`Doctor warning: ${t.message}`));}}else i.succeed(e.gray("Step 6/6: Skipped verify (use --verify to check health)"));console.log(""),console.log(e.blue("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")),console.log(e.blue("\u2502")+e.white.bold(" \u2728 Paradigm shift complete! ")+e.blue("\u2502")),console.log(e.blue("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")),console.log(""),console.log(e.white(" Created/Updated:")),console.log(e.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));let O=[{path:".paradigm/config.yaml",desc:"Project configuration"},{path:".paradigm/navigator.yaml",desc:"Symbol navigation map"},{path:".paradigm/agents.yaml",desc:"Team agent configuration"},{path:".paradigm/adoptions.yaml",desc:"Agent adoption records"},{path:".purpose",desc:"Root feature definitions"},{path:".paradigm/lore/",desc:"Project lore timeline",isDir:true},{path:"portal.yaml",desc:"Authorization gates"},{path:".paradigm/roster.yaml",desc:"Agent roster for this project"},{path:"CLAUDE.md",desc:"Claude Code AI instructions"},{path:"AGENTS.md",desc:"Universal AI agent instructions"},{path:".cursor/rules/",desc:"Cursor AI instructions",isDir:true},{path:".claude/hooks/",desc:"Claude Code enforcement hooks",isDir:true,optional:true},{path:".cursor/hooks/",desc:"Cursor enforcement hooks",isDir:true,optional:true}],W=d.join(r,"config.yaml");if(a.existsSync(W))try{let t=h.load(a.readFileSync(W,"utf8"));if(typeof t.workspace=="string"){let s=d.resolve(n,t.workspace),c=d.relative(n,s);O.push({path:c,desc:"Multi-project workspace",optional:!0});}}catch(t){a$1.operation("shift").debug("Summary config read failed",{error:t.message});}for(let t of O){let s=d.join(n,t.path);a.existsSync(s)?console.log(e.green(" \u2713 ")+e.white(t.path.padEnd(28))+e.gray(t.desc)):t.optional||console.log(e.yellow(" \u25CB ")+e.gray(t.path.padEnd(28))+e.gray(`(${t.desc})`));}try{let t=await Z(n),s=ee(t);s&&console.log(s);}catch(t){a$1.operation("shift").debug("Recommendations engine failed",{error:t.message}),console.log(""),console.log(e.white(" Next steps:")),console.log(e.gray(" "+"\u2500".repeat(49))),console.log(e.white(" 1. ")+e.gray("Edit ")+e.cyan(".purpose")+e.gray(" to define your features")),console.log(e.white(" 2. ")+e.gray("Run ")+e.cyan("paradigm shift --verify")+e.gray(" to check health")),console.log("");}try{let{captureSnapshot:t,seedMetricsConsent:s}=await import('./metrics-UESGUHTA.js');s(n),t(n);}catch(t){a$1.operation("shift").debug("metrics snapshot failed",{error:t.message});}m.success("Paradigm shift complete",{project:l});}export{be as runComplianceNominationStep,Le as shiftCommand};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export{h as registerTools}from'./chunk-SRWROALW.js';import'./chunk-EMGJWT7D.js';import'./chunk-4UJ4NIEQ.js';import'./chunk-4N56FRNE.js';import'./chunk-Q527BPUF.js';import'./chunk-KLBH26PA.js';import'./chunk-ARLB6YYW.js';import'./chunk-SU5F5D4I.js';import'./chunk-JNSJVCTU.js';import'./chunk-XROULIQN.js';import'./chunk-ZUAUFZRJ.js';import'./chunk-3KVVC4WV.js';import'./chunk-M4UMM6DC.js';import'./chunk-GRZQIKST.js';import'./chunk-KAFQA7HV.js';import'./chunk-6QXBXZF6.js';import'./chunk-EK4ZRIFJ.js';import'./chunk-LAYBUKMB.js';import'./chunk-DVZWCXB6.js';import'./chunk-QGZRM6ZB.js';import'./chunk-K7X3Z3GL.js';import'./chunk-5TAVYPOV.js';
@@ -4,7 +4,7 @@ title: Your First paradigm shift
4
4
  type: note
5
5
  author: paradigm
6
6
  created: '2026-04-22'
7
- updated: '2026-04-22'
7
+ updated: '2026-05-04'
8
8
  tags:
9
9
  - course
10
10
  - para-001
@@ -59,7 +59,7 @@ Each file has a specific job:
59
59
 
60
60
  `paradigm shift` also installed Git hooks and Claude Code hooks. These run automatically when you commit or finish a task, checking that your Paradigm metadata stays in sync with your code.
61
61
 
62
- By default, hooks use **minimal enforcement** — they warn but never block. You will not lose work or get stuck. As you get comfortable, you can upgrade to balanced or strict enforcement (covered in PARA 301).
62
+ By default, hooks use **none enforcement** — all 13 compliance checks are off, so you will never see a blocking warning simply from working. Hooks are there and ready; they only activate if you choose a higher enforcement level. As you get comfortable with Paradigm's symbol system, you can enable compliance guidance starting with `minimal` (warn-only) and working up from there. The compliance agent Rune will invite you when you seem ready.
63
63
 
64
64
  ### Try It: Explore What Was Created
65
65
 
@@ -4,12 +4,12 @@ title: Enforcement Levels
4
4
  type: note
5
5
  author: paradigm
6
6
  created: '2026-04-22'
7
- updated: '2026-04-22'
7
+ updated: '2026-05-04'
8
8
  tags:
9
9
  - course
10
10
  - para-301
11
- - three-enforcement-levels
12
- - minimal-is-the
11
+ - four-enforcement-levels
12
+ - none-is-the
13
13
  - 13-checks-control
14
14
  symbols: []
15
15
  difficulty: beginner
@@ -20,13 +20,19 @@ origin: imported
20
20
  source: courses/para-301.json
21
21
  ---
22
22
 
23
- ## The Three Enforcement Levels
23
+ ## The Four Enforcement Levels
24
24
 
25
25
  Paradigm enforcement is configurable. Not every project needs the same rigor — a weekend prototype has different needs than a healthcare platform. Enforcement levels control which compliance checks **block** (stop you), **warn** (notify but continue), or are **off** (silent).
26
26
 
27
+ ### None — The Default
28
+
29
+ `none` is the default for all new projects created by `paradigm shift`. All 13 checks are set to `off`. Hooks install but never trigger compliance violations. You can build freely with agents, Sentinel, or Conductor without seeing a compliance warning.
30
+
31
+ This is intentional. Many teams adopt Paradigm for agent orchestration, session memory, or ambient intelligence — not for symbol compliance. When you are ready to add symbol tracking, the compliance agent Rune will invite you. See [Rune's Promotion Model](N-para-301-rune-promotion.md).
32
+
27
33
  ### Minimal — For Learning and Prototyping
28
34
 
29
- Minimal enforcement is the default for new projects created by `paradigm shift`. Only two checks are active, both as warnings:
35
+ Minimal enforcement is not the default you opt into it when you are ready to start symbol tracking. Only two checks are active, both as warnings:
30
36
 
31
37
  - `purpose-coverage` — warns if source directories lack `.purpose` files
32
38
  - `habits-blocking` — warns if defined habits are being violated
@@ -58,7 +64,7 @@ Set the level in `.paradigm/config.yaml`:
58
64
 
59
65
  ```yaml
60
66
  enforcement:
61
- level: balanced # minimal | balanced | strict
67
+ level: balanced # none | minimal | balanced | strict
62
68
  ```
63
69
 
64
70
  Override individual checks when a preset does not quite fit:
@@ -93,10 +99,11 @@ Per-check overrides take precedence over the preset. This lets you start with a
93
99
 
94
100
  ## Progression Strategy
95
101
 
96
- Most teams follow this path:
102
+ The default progression is opt-in, not imposed:
97
103
 
98
- 1. **Start minimal** — learn Paradigm, build habits, no blocking
99
- 2. **Move to balanced** after 1-2 weeks catch issues early, still flexible
100
- 3. **Upgrade to strict** for production-critical or regulated codebases
104
+ 1. **Start at none** — Build freely. Agents, Sentinel, and Conductor all work without compliance warnings.
105
+ 2. **Rune invites you to minimal** When you show readiness signals (referencing symbol syntax, asking about auth gates, touching 3+ files), Rune invites you to enable `minimal` enforcement. You are not forced — you choose when you want guidance.
106
+ 3. **Move to balanced** after you have adopted symbol-writing habits catch issues early, still flexible.
107
+ 4. **Upgrade to strict** for production-critical or regulated codebases.
101
108
 
102
- You can change levels at any time. The switch is immediate no migration needed.
109
+ You can change levels at any time. Teams adopting Paradigm purely for agents or Sentinel can stay at `none` indefinitely.
@@ -4,7 +4,7 @@ title: The paradigm shift Command
4
4
  type: note
5
5
  author: paradigm
6
6
  created: '2026-04-22'
7
- updated: '2026-04-22'
7
+ updated: '2026-05-04'
8
8
  tags:
9
9
  - course
10
10
  - para-301
@@ -80,7 +80,7 @@ After `paradigm shift`, your project has:
80
80
 
81
81
  ```
82
82
  .paradigm/
83
- config.yaml # Project configuration
83
+ config.yaml # Project configuration (enforcement.level: none by default)
84
84
  tags.yaml # Tag taxonomy
85
85
  roster.yaml # Agent team roster
86
86
  agents.yaml # Agent tier assignments
@@ -0,0 +1,69 @@
1
+ ---
2
+ id: N-para-301-rune-promotion
3
+ title: "Rune's Promotion Model"
4
+ type: note
5
+ author: paradigm
6
+ created: '2026-05-04'
7
+ updated: '2026-05-04'
8
+ tags:
9
+ - course
10
+ - para-301
11
+ - rune-promotion
12
+ - none-enforcement
13
+ - readiness-signals
14
+ symbols: []
15
+ difficulty: beginner
16
+ estimatedMinutes: 3
17
+ prerequisites:
18
+ - N-para-301-enforcement-levels
19
+ category: paradigm-core
20
+ origin: authored
21
+ ---
22
+
23
+ ## Enforcement You Earn, Not Enforcement You Endure
24
+
25
+ New Paradigm projects start at `none` enforcement — all 13 compliance checks off. This is deliberate. Teams using Paradigm for agent orchestration, Sentinel, or Conductor should not be interrupted by symbol-coverage warnings they never asked for.
26
+
27
+ But compliance tracking has real value once you are writing `.purpose` files and referencing symbols. The challenge is knowing when a team has crossed that threshold.
28
+
29
+ Rune — the compliance archetype agent — solves this with a promotion model. Instead of waiting for developers to read documentation and manually edit `config.yaml`, Rune watches for behavioral signals that indicate readiness and extends an invitation.
30
+
31
+ ## Readiness Signals
32
+
33
+ Rune monitors the active session for signals that suggest the developer is already thinking in Paradigm terms:
34
+
35
+ - **Symbol syntax usage** — The developer references `#component`, `$flow`, `^gate`, `!signal`, or `~aspect` in prompts or commit messages
36
+ - **Auth and dependency questions** — The developer asks about protecting routes, declaring gates, or understanding component dependencies
37
+ - **Multi-file reach** — The session touches 3 or more source files, which is the threshold where `.purpose` coverage starts to matter
38
+
39
+ Any one of these signals suggests the developer is past the "I'm just exploring" stage. Two or more Tier B signals (or any Tier A signal) trigger Rune's invitation.
40
+
41
+ ## The Invitation
42
+
43
+ When readiness signals accumulate, Rune surfaces a single, non-blocking message:
44
+
45
+ > Paradigm's symbol system (#components, $flows, ^gates, !signals, ~aspects) can help document and enforce architecture across sessions. Enforcement is currently **none** — all checks are off. Would you like to enable symbol tracking?
46
+ >
47
+ > Options: `minimal` (warn-only), `balanced` (blocks on missing purpose files), `snooze` (ask in 7 days), or `never` (don't ask again).
48
+
49
+ Rune does not repeat the invitation more than once per session.
50
+
51
+ ## Why This Approach
52
+
53
+ Starting at `none` and inviting up avoids the "turned off warnings I found annoying" decay pattern. A developer who has never been interrupted by a compliance warning has no reason to resent Rune's invitation. The invitation arrives as helpful context — not friction.
54
+
55
+ Teams that never reference symbols, never ask about gates, and never touch 3+ files in a session will never see Rune's invitation. This is correct behavior — they do not need compliance tracking.
56
+
57
+ ## After Accepting
58
+
59
+ When a developer accepts, Paradigm updates `enforcement.level` in `.paradigm/config.yaml` immediately. The developer can always return to `none` at any time.
60
+
61
+ ## The Progression Path
62
+
63
+ ```
64
+ none → minimal → balanced → strict
65
+ (Rune (team (regulated
66
+ invites) ready) domains)
67
+ ```
68
+
69
+ There is no mandatory progression. Many teams run at `balanced` indefinitely. Strict is reserved for regulated domains where compliance is not optional.
@@ -4,7 +4,7 @@ title: Hook Enforcement & Automation
4
4
  type: note
5
5
  author: paradigm
6
6
  created: '2026-04-22'
7
- updated: '2026-04-22'
7
+ updated: '2026-05-04'
8
8
  tags:
9
9
  - course
10
10
  - para-501
@@ -26,6 +26,8 @@ Paradigm's value depends on discipline. Purpose files must be updated when code
26
26
 
27
27
  Hooks close this gap. They are automated checks that run at specific points in the development workflow, catching violations before they become technical debt. Paradigm uses three hooks, each with a distinct role and severity.
28
28
 
29
+ One important nuance: the stop hook's compliance checks are gated by your project's enforcement level. On the default level (`none`), all 13 checks are `off` — the hook runs but nothing fires. Compliance checking only begins when you move to `minimal` or higher. If you are at `none` and want to see what the stop hook would catch, run `paradigm doctor` — it runs all checks regardless of enforcement level.
30
+
29
31
  ## The Stop Hook
30
32
 
31
33
  The stop hook is the primary enforcer. It runs before an agent session completes and can **block** the session from finishing if compliance checks fail.
@@ -4,7 +4,7 @@ title: 'Lesson 7: Orchestration Enforcement'
4
4
  type: note
5
5
  author: paradigm
6
6
  created: '2026-04-22'
7
- updated: '2026-04-22'
7
+ updated: '2026-05-04'
8
8
  tags:
9
9
  - course
10
10
  - para-701
@@ -54,6 +54,15 @@ This habit fires at **preflight** (session start). It checks whether `paradigm_o
54
54
 
55
55
  The severity is `warn`, not `block`. This is deliberate. Blocking on orchestration would prevent quick fixes, hot patches, and simple tasks that genuinely do not need multi-agent coordination. The warning surfaces the recommendation; the human decides whether to follow it.
56
56
 
57
+ Note: on the default enforcement level (`none`), this check is `off` — no warning fires. It activates at `minimal` or higher. To get orchestration nudges on a `none` project without enabling all checks, override just this one:
58
+
59
+ ```yaml
60
+ enforcement:
61
+ level: none
62
+ checks:
63
+ orchestration-required: warn
64
+ ```
65
+
57
66
  ### 2. agent-coverage-validated (postflight, advisory)
58
67
 
59
68
  ```typescript
@@ -3,7 +3,7 @@ title: 'PARA 301: Operations — Enforcement Levels'
3
3
  description: 'Quiz for lesson: Enforcement Levels'
4
4
  author: paradigm
5
5
  created: '2026-04-22'
6
- updated: '2026-04-22'
6
+ updated: '2026-05-04'
7
7
  tags:
8
8
  - course
9
9
  - para-301
@@ -44,3 +44,23 @@ questions:
44
44
  E: aspect-anchors check failed — aspects in src/payments/ have broken anchors
45
45
  correct: B
46
46
  explanation: 'On balanced enforcement, purpose-coverage is the only check set to block (besides habits-blocking). The error message says "missing .purpose file" which means the directory lacks one entirely — that is purpose-coverage, not purpose-exists (which checks that referenced files exist) or purpose-freshness (which checks staleness). Fix: create a .purpose file in src/payments/ describing its components.'
47
+ - id: q4
48
+ question: A developer runs `paradigm shift` on a brand-new project. What enforcement level is active by default?
49
+ choices:
50
+ A: Minimal — warn-only enforcement so the developer can learn without getting blocked
51
+ B: Balanced — the practical default for most development teams
52
+ C: None — all 13 checks are off; hooks install but never trigger compliance violations
53
+ D: Strict — the safest default for new projects
54
+ E: No enforcement section is created — the developer must configure it manually
55
+ correct: C
56
+ explanation: "Since the `none` preset was introduced, fresh `paradigm shift` produces `enforcement.level: none`. All 13 checks start at off. This means teams adopting Paradigm for agent orchestration, Sentinel, or Conductor never see compliance warnings unless they explicitly enable them."
57
+ - id: q5
58
+ question: A developer at `none` enforcement starts referencing symbol syntax in their prompts and asks about authentication gates. What happens next?
59
+ choices:
60
+ A: Nothing — `none` is permanent until the developer edits config.yaml manually
61
+ B: The stop hook automatically upgrades enforcement to minimal
62
+ C: Rune detects these readiness signals and proactively invites the developer to enable `minimal` or `balanced` enforcement
63
+ D: Paradigm blocks the session until the developer chooses an enforcement level
64
+ E: The developer must run `paradigm doctor` to trigger enforcement selection
65
+ correct: C
66
+ explanation: "Rune's promotion model monitors behavioral signals — using symbol syntax, asking about auth or dependencies, touching 3+ files. When these appear, Rune invites (never forces) the developer to step up to `minimal` or `balanced`. The developer chooses whether to accept."