olympus-ai 4.4.21 → 4.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olympus-ai",
3
- "version": "4.4.21",
3
+ "version": "4.4.22",
4
4
  "description": "Olympus: Multi-agent orchestration for Claude Code. Summon the gods of code.",
5
5
  "author": {
6
6
  "name": "mikev10",
@@ -21,14 +21,14 @@ export interface DecompositionTree {
21
21
  * Converts a unit title into a prefixed slug suitable for directory names.
22
22
  *
23
23
  * Examples:
24
- * "Auth Service", 1 -> "u-001-auth-service"
25
- * "API Gateway", 2 -> "u-002-api-gateway"
26
- * "User Onboarding", 3 -> "u-003-user-onboarding"
27
- * "", 1 -> "u-001-untitled" (fallback)
24
+ * "Auth Service", 1 -> "UNIT-001-auth-service"
25
+ * "API Gateway", 2 -> "UNIT-002-api-gateway"
26
+ * "User Onboarding", 3 -> "UNIT-003-user-onboarding"
27
+ * "", 1 -> "UNIT-001-untitled" (fallback)
28
28
  *
29
29
  * @param title - The human-readable unit title
30
- * @param index - 1-based unit index for the u-XXX prefix
31
- * @returns A prefixed, lowercase, hyphen-separated slug (e.g., "u-001-auth-service")
30
+ * @param index - 1-based unit index for the UNIT-XXX prefix
31
+ * @returns A prefixed, lowercase, hyphen-separated slug (e.g., "UNIT-001-auth-service")
32
32
  */
33
33
  export declare function slugifyUnitName(title: string, index: number): string;
34
34
  /**
@@ -15,17 +15,17 @@ const DEFAULT_MAX_UNITS = 10;
15
15
  * Converts a unit title into a prefixed slug suitable for directory names.
16
16
  *
17
17
  * Examples:
18
- * "Auth Service", 1 -> "u-001-auth-service"
19
- * "API Gateway", 2 -> "u-002-api-gateway"
20
- * "User Onboarding", 3 -> "u-003-user-onboarding"
21
- * "", 1 -> "u-001-untitled" (fallback)
18
+ * "Auth Service", 1 -> "UNIT-001-auth-service"
19
+ * "API Gateway", 2 -> "UNIT-002-api-gateway"
20
+ * "User Onboarding", 3 -> "UNIT-003-user-onboarding"
21
+ * "", 1 -> "UNIT-001-untitled" (fallback)
22
22
  *
23
23
  * @param title - The human-readable unit title
24
- * @param index - 1-based unit index for the u-XXX prefix
25
- * @returns A prefixed, lowercase, hyphen-separated slug (e.g., "u-001-auth-service")
24
+ * @param index - 1-based unit index for the UNIT-XXX prefix
25
+ * @returns A prefixed, lowercase, hyphen-separated slug (e.g., "UNIT-001-auth-service")
26
26
  */
27
27
  export function slugifyUnitName(title, index) {
28
- const prefix = `u-${String(index).padStart(3, '0')}`;
28
+ const prefix = `UNIT-${String(index).padStart(3, '0')}`;
29
29
  if (!title || !title.trim()) {
30
30
  return `${prefix}-untitled`;
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"decomposition.js","sourceRoot":"","sources":["../../../../src/features/workflow-engine/construction/decomposition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAexB,yCAAyC;AACzC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,KAAa;IAC1D,MAAM,MAAM,GAAG,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAErD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5B,OAAO,GAAG,MAAM,WAAW,CAAC;IAC9B,CAAC;IAED,MAAM,IAAI,GAAG,KAAK;SACf,WAAW,EAAE;SACb,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEzB,IAAI,CAAC,I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ACd,KAAK;KACN,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAuB;IAC9C,MAAM,KAAK,GAAuB,EAAE,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"decomposition.js","sourceRoot":"","sources":["../../../../src/features/workflow-engine/construction/decomposition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAexB,yCAAyC;AACzC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,KAAa;IAC1D,MAAM,MAAM,GAAG,QAAQ,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IAExD,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QAC5B,OAAO,GAAG,MAAM,WAAW,CAAC;IAC9B,CAAC;IAED,MAAM,IAAI,GAAG,KAAK;SACf,WAAW,EAAE;SACb,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEzB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,GAAG,MAAM,WAAW,CAAC;IAC9B,CAAC;IAED,kEAAkE;IAClE,I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IAC9C,MAAM,KAAK,GAAuB,EAAE,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -958,7 +958,7 @@ Do not use placeholder text \u2014 write real documentation.`}function Fv(e,t){l
958
958
  `,"utf-8"),{created:!r,added:!0}}function Bp(e,t){let n=Mv(t);return n.length===0?{envVarsDetected:[],envExampleResult:{created:!1,added:[],existing:[]},gitignoreResult:{created:!1,added:!1}}:{envVarsDetected:n,envExampleResult:Uv(n,e),gitignoreResult:Wv(e)}}var Qe=T(X(),1),Tn=require("path"),qp=require("child_process"),Gv=["**/*.ts","**/*.js","**/*.tsx","**/*.jsx","**/*.py","**/*.java","**/*.go"],Bv=["**/node_modules/**","**/__tests__/**","**/test/**","**/fixtures/**","**/dist/**","**/*.d.ts"];function Hv(e){let t=e.replace(/\\/g,"/"),n="",r=0;for(;r<t.length;)t[r]==="*"&&t[r+1]==="*"?t[r+2]==="/"?(n+="(?:.+/)?",r+=3):(n+=".*",r+=2):t[r]==="*"?(n+="[^/]*",r++):t[r]==="?"?(n+="[^/]",r++):(n+=t[r].replace(/[.+^${}()|[\]\\]/g,"\\$&"),r++);return new RegExp(`^${n}$`)}function Yp(e,t){return Hv(t).test(e)}function Hp(e,t){return t.some(n=>Yp(e,n))}function Kp(e){let t=[],n;try{n=Qe.readdirSync(e,{withFileTypes:!0})}catch{return t}for(let r of n){let o=(0,Tn.join)(e,r.name);r.isDirectory()?t.push(...Kp(o)):r.isFile()&&t.push(o)}return t}function Vv(e,t){let n=t.includeGlobs??Gv,r=t.excludeGlobs??Bv;return Kp(e).filter(o=>{let s=(0,Tn.relative)(e,o).replace(/\\/g,"/");return Hp(s,n)&&!Hp(s,r)})}function Zi(e,t){return(e.substring(0,t).match(/\n/g)||[]).length+1}var qv=[{name:"AWS Access Key",pattern:/AKIA[0-9A-Z]{16}/g},{name:"Generic API Key",pattern:/['"]?api[_-]?key['"]?\s*[:=]\s*['"][a-zA-Z0-9]{20,}['"]/gi},{name:"Generic Secret",pattern:/['"]?secret['"]?\s*[:=]\s*['"][a-zA-Z0-9]{20,}['"]/gi},{name:"Private Key",pattern:/-----BEGIN\s+(RSA\s+)?PRIVATE KEY-----/g},{name:"Bearer Token",pattern:/Bearer\s+[a-zA-Z0-9\-._~+/]+=*/g},{name:"Connection String",pattern:/(?:mongodb|postgres|mysql|redis):\/\/[^\s'"]+/gi},{name:"JWT Token",pattern:/eyJ[a-zA-Z0-9_-]{10,}\.[a-zA-Z0-9_-]{10,}\.[a-zA-Z0-9_-]{10,}/g}];function ea(e,t){let n=[];for(let{name:r,pattern:o}of qv){o.lastIndex=0;let s;for(;(s=o.exec(e))!==null;)n.push({id:`sec-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,category:"hardcoded-secret",severity:"critical",message:`${r} detected`,file:t,line:Zi(e,s.index),pattern:r});o.lastIndex=0}return n}var Yv=[{name:"String concatenation in SQL query",pattern:/(?:['"`]\s*\+\s*\w+.*(?:SELECT|INSERT|UPDATE|DELETE|DROP|FROM|WHERE)|(?:SELECT|INSERT|UPDATE|DELETE|DROP|FROM|WHERE).*['"`]\s*\+\s*\w+)/gi},{name:"Template literal in SQL query",pattern:/(?:\$\{[^}]+\}.*(?:SELECT|INSERT|UPDATE|DELETE|DROP|FROM|WHERE)|(?:SELECT|INSERT|UPDATE|DELETE|DROP|FROM|WHERE)[^\n]*\$\{)/gi},{name:"Unparameterized query construction",pattern:/(?:query|execute|sql)\s*\(\s*['"`].*\+/gi}];function Kv(e,t){let n=[];for(let{name:r,pattern:o}of Yv){o.lastIndex=0;let s;for(;(s=o.exec(e))!==null;)n.push({id:`sec-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,category:"sql-injection",severity:"warning",message:`${r} detected`,file:t,line:Zi(e,s.index),pattern:r});o.lastIndex=0}return n}var Jv=[{name:"innerHTML assignment",pattern:/\.innerHTML\s*=/g},{name:"dangerouslySetInnerHTML",pattern:/dangerouslySetInnerHTML/g},{name:"document.write",pattern:/document\.write\s*\(/g},{name:"eval usage",pattern:/\beval\s*\(/g}];function ta(e,t){let n=[];for(let{name:r,pattern:o}of Jv){o.lastIndex=0;let s;for(;(s=o.exec(e))!==null;)n.push({id:`sec-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,category:"xss",severity:"warning",message:`${r} detected`,file:t,line:Zi(e,s.index),pattern:r});o.lastIndex=0}return n}function Vp(e){let t=JSON.parse(e),n=[],r=t.vulnerabilities||{};for(let[o,s]of Object.entries(r)){let i=s.severity,a=i==="critical"||i==="high"?"critical":i==="moderate"?"warning":"info";n.push({id:`sec-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,category:"dependency-cve",severity:a,message:`Vulnerable dependency: ${o} (${i})`,pattern:o})}return n}function zv(e){try{let t=(0,qp.execSync)("npm audit --json",{cwd:e,timeout:6e4,encoding:"utf-8",stdio:["pipe","pipe","pipe"]});return Vp(t)}catch(t){try{if(t.stdout)return Vp(t.stdout)}catch{}return[]}}function Qv(e){let t=(0,Tn.join)(e,".olympus","security-ignore.json");try{if(Qe.existsSync(t))return Qe.readJsonSync(t)}catch{}return{}}function Xv(e,t){let n=t.paths||[],r=t.patterns||[],o=t.reasons||{};return e.map(s=>{if(s.file&&n.length>0){let i=s.file.replace(/\\/g,"/");for(let a of n)if(Yp(i,a)||i.includes(a.replace(/\\/g,"/")))return{...s,suppressed:!0,suppress_reason:o[a]||`Path suppressed: ${a}`}}return s.pattern&&r.includes(s.pattern)?{...s,suppressed:!0,suppress_reason:o[s.pattern]||`Pattern suppressed: ${s.pattern}`}:s})}function Zv(e){switch(e){case"hardcoded-secret":return"Hardcoded Secrets";case"sql-injection":return"SQL Injection";case"xss":return"Cross-Site Scripting (XSS)";case"dependency-cve":return"Dependency CVEs";case"risky-pattern":return"Risky Patterns"}}function eT(e,t){let{unitId:n,workflowId:r,filesScanned:o,scanDate:s}=t,i=s||new Date().toISOString(),a=e.filter(y=>!y.suppressed),c=a.filter(y=>y.severity==="critical").length,l=a.filter(y=>y.severity==="warning").length,u=a.filter(y=>y.severity==="info").length,d=e.filter(y=>y.suppressed).length,p=c>0?"failed":"passed",f=["---",`unit: ${n}`,`workflow: ${r}`,`scan_date: ${i}`,`files_scanned: ${o}`,`findings_critical: ${c}`,`findings_warning: ${l}`,`findings_info: ${u}`,`findings_suppressed: ${d}`,`status: ${p}`,"---","",`# Security Report: ${n}`,"",`**Status**: ${p==="passed"?"PASSED":"FAILED"} `,`**Scan Date**: ${i} `,`**Files Scanned**: ${o} `,"","## Summary","","| Severity | Count |","|----------|-------|",`| Critical | ${c} |`,`| Warning | ${l} |`,`| Info | ${u} |`,`| Suppressed | ${d} |`,""],m=["hardcoded-secret","sql-injection","xss","dependency-cve","risky-pattern"];for(let y of m){let w=a.filter(k=>k.category===y);if(w.length!==0){f.push(`## ${Zv(y)}`,"");for(let k of w){let h=k.file?` \u2014 \`${k.file}\`${k.line?`:${k.line}`:""}`:"";f.push(`- **[${k.severity.toUpperCase()}]** ${k.message}${h}`)}f.push("")}}let g=e.filter(y=>y.suppressed);if(g.length>0){f.push("## Suppressed Findings","");for(let y of g){let w=y.file?` \u2014 \`${y.file}\`${y.line?`:${y.line}`:""}`:"";f.push(`- ~~**[${y.severity.toUpperCase()}]** ${y.message}${w}~~ *(${y.suppress_reason||"suppressed"})*`)}f.push("")}return f.join(`
959
959
  `)}async function Jp(e){let t=Date.now();try{let n=Vv(e.projectPath,e),r=[];for(let c of n)try{let l=Qe.readFileSync(c,"utf-8");r.push(...ea(l,c)),r.push(...Kv(l,c)),r.push(...ta(l,c))}catch{}r.push(...zv(e.projectPath));let o=Qv(e.projectPath),s=Xv(r,o),i=(0,Tn.join)(e.projectPath,"aidlc-docs",e.workflowId,"construction",e.unitId,"security");Qe.ensureDirSync(i);let a=(0,Tn.join)(i,"security-report.md");return Qe.writeFileSync(a,eT(s,{unitId:e.unitId,workflowId:e.workflowId,outputDir:i,filesScanned:n.length}),"utf-8"),{status:"completed",findings:s,scanned_files:n.length,scan_duration_ms:Date.now()-t,report_path:a}}catch{return{status:"failed",findings:[],scanned_files:0,scan_duration_ms:Date.now()-t,report_path:""}}}var Vo=T(require("fs"),1),qo=T(require("path"),1);function tT(e){let t=e.construction_units?Object.values(e.construction_units):[],n=0,r=0,o=0,s=0,i=0,a=0,c=0,l=0,u=0,d=t.filter(_=>_.code_generation_status==="completed").length;for(let _ of t)n+=_.tests_total??0,r+=_.tests_passed??0,o+=_.tests_failed??0,_.coverage_percentage!=null&&(s+=_.coverage_percentage,i++),a+=_.security_findings_critical??0,c+=_.security_findings_warning??0,l+=_.security_findings_info??0,u+=_.regressions_count??0;let p=0,f=e.phases??{},m=0;for(let _ of["discovery","inception","construction","operations"]){let j=f[_];j&&j.status&&j.status!=="not_started"&&m++}let g=e.metrics,y={inception_ms:g?.inception_duration_ms??0,construction_ms:g?.construction_duration_ms??0,operations_ms:g?.operations_duration_ms??0},w=g?.validation_pass_rate??0,k=g?.rework_count??0,h=0;for(let _ of t){let j=_.regressions_count??0,R=_.tests_failed??0;j>0&&R===0&&(h+=j)}let v=0,S=0;for(let _ of t)_.recreation_readiness_score!=null&&(v+=_.recreation_readiness_score,S++);let b=S>0?Math.round(v/S*10)/10:null;return{tests_total:n,tests_passed:r,tests_failed:o,coverage_percentage:i>0?Math.round(s/i*10)/10:null,security_findings:{critical:a,warning:c,info:l},units_completed:d,units_total:t.length,regressions_count:u,gate_bypass_count:p,data_sources:nT(t),phases_completed:m,time_per_phase:y,validation_pass_rate:w,rework_count:k,regressions_fixed:h,average_recreation_readiness_score:b}}function nT(e){let t=e.some(i=>(i.tests_total??0)>0),n=e.some(i=>i.coverage_percentage!=null),r=e.some(i=>i.security_scan_status==="completed"),o=e.some(i=>i.feature_doc_status==="completed"),s=e.some(i=>i.recreation_readiness_score!=null);return{tests:t?"connected":"pending",coverage:n?"connected":"pending",security:r?"connected":"pending",documentation:o?"connected":"pending",recreation_readiness:s?"connected":"pending"}}function rT(e,t){let n=qo.join(t.projectPath,"aidlc-docs",t.workflowId,"quality-scorecard.md"),r=["---",`workflow: ${t.workflowId}`,`feature: "${t.featureName}"`,`generated_at: ${new Date().toISOString()}`,`tests_total: ${e.tests_total}`,`tests_passed: ${e.tests_passed}`,`tests_failed: ${e.tests_failed}`,`coverage_percentage: ${e.coverage_percentage??"null"}`,`security_critical: ${e.security_findings.critical}`,`security_warning: ${e.security_findings.warning}`,`security_info: ${e.security_findings.info}`,`units_completed: ${e.units_completed}`,`units_total: ${e.units_total}`,`regressions_count: ${e.regressions_count}`,`gate_bypass_count: ${e.gate_bypass_count}`,`phases_completed: ${e.phases_completed??0}`,`validation_pass_rate: ${e.validation_pass_rate??0}`,`rework_count: ${e.rework_count??0}`,`regressions_fixed: ${e.regressions_fixed??0}`,`average_recreation_readiness_score: ${e.average_recreation_readiness_score??"null"}`,"---",""].join(`
960
960
  `),o=e.tests_total>0?Math.round(e.tests_passed/e.tests_total*100):0,s=[`# Quality Scorecard: ${t.featureName}`,"","## Test Results","","| Metric | Value |","|--------|-------|",`| Tests Total | ${e.tests_total} |`,`| Tests Passed | ${e.tests_passed} |`,`| Tests Failed | ${e.tests_failed} |`,`| Pass Rate | ${o}% |`,`| Coverage | ${e.coverage_percentage!=null?e.coverage_percentage+"%":"pending"} |`,`| Regressions | ${e.regressions_count} |`,"","## Security","","| Severity | Count |","|----------|-------|",`| Critical | ${e.security_findings.critical} |`,`| Warning | ${e.security_findings.warning} |`,`| Info | ${e.security_findings.info} |`,"","## Unit Completion","","| Metric | Value |","|--------|-------|",`| Units Completed | ${e.units_completed} |`,`| Units Total | ${e.units_total} |`,`| Gate Bypasses | ${e.gate_bypass_count} |`,"","## Methodology Metrics","","| Metric | Value |","|--------|-------|",`| Phases Completed | ${e.phases_completed??0} |`,`| Inception Time | ${e.time_per_phase?.inception_ms??0}ms |`,`| Construction Time | ${e.time_per_phase?.construction_ms??0}ms |`,`| Operations Time | ${e.time_per_phase?.operations_ms??0}ms |`,`| Validation Pass Rate | ${e.validation_pass_rate??0}% |`,`| Rework Count | ${e.rework_count??0} |`,`| Regressions Fixed | ${e.regressions_fixed??0} |`,"","## Recreation Readiness","","| Metric | Value |","|--------|-------|",`| Average Score | ${e.average_recreation_readiness_score!=null?e.average_recreation_readiness_score:"pending"} |`,"","## Data Sources","","| Source | Status |","|--------|--------|",...Object.entries(e.data_sources).map(([i,a])=>`| ${i} | ${a} |`),""].join(`
961
- `);return Vo.mkdirSync(qo.dirname(n),{recursive:!0}),Vo.writeFileSync(n,r+s),n}function zp(e,t){let n=tT(e),r=rT(n,t);return{data:n,reportPath:r}}var er=T(X(),1),Qp=T(require("path"),1),oT=10;function Xp(e,t){let n=`u-${String(t).padStart(3,"0")}`;if(!e||!e.trim())return`${n}-untitled`;let r=e.toLowerCase().replace(/[_\s]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");return r?r.length>60?`${n}-${r.substring(0,60).replace(/-$/,"")}`:`${n}-${r}`:`${n}-untitled`}async function na(e){try{if(!await er.default.pathExists(e))return[];let r=(await er.default.readdir(e)).filter(s=>s.startsWith("INTENT-")&&s.endsWith(".md")),o=[];for(let s of r)try{let i=Qp.default.join(e,s),c=(await er.default.readFile(i,"utf-8")).match(/^---\n([\s\S]*?)\n---/);if(!c){console.error(`No frontmatter found in ${s}`);continue}let u=c[1].split(`
961
+ `);return Vo.mkdirSync(qo.dirname(n),{recursive:!0}),Vo.writeFileSync(n,r+s),n}function zp(e,t){let n=tT(e),r=rT(n,t);return{data:n,reportPath:r}}var er=T(X(),1),Qp=T(require("path"),1),oT=10;function Xp(e,t){let n=`UNIT-${String(t).padStart(3,"0")}`;if(!e||!e.trim())return`${n}-untitled`;let r=e.toLowerCase().replace(/[_\s]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");return r?r.length>60?`${n}-${r.substring(0,60).replace(/-$/,"")}`:`${n}-${r}`:`${n}-untitled`}async function na(e){try{if(!await er.default.pathExists(e))return[];let r=(await er.default.readdir(e)).filter(s=>s.startsWith("INTENT-")&&s.endsWith(".md")),o=[];for(let s of r)try{let i=Qp.default.join(e,s),c=(await er.default.readFile(i,"utf-8")).match(/^---\n([\s\S]*?)\n---/);if(!c){console.error(`No frontmatter found in ${s}`);continue}let u=c[1].split(`
962
962
  `),d={};for(let f of u){let m=f.match(/^(\w+):\s*(.+)$/);if(m){let[,g,y]=m;y.startsWith("[")?d[g]=JSON.parse(y.replace(/'/g,'"')):isNaN(Number(y))?d[g]=y.trim():d[g]=Number(y)}}let p={id:d.id||s.replace(".md",""),type:"intent",title:d.title||"Untitled Intent",parent_id:null,children_ids:[],status:d.status||"pending",assigned_agent:d.assigned_agent||null,estimated_effort:d.estimated_effort||0};o.push(p)}catch(i){console.error(`Failed to parse ${s}:`,i)}return o}catch(t){return console.error(`Failed to read intents from ${e}:`,t),[]}}async function ra(e){try{if(!await er.default.pathExists(e))return null;let n=await er.default.readFile(e,"utf-8"),r=[],o=n.match(/### Proposed UNITs\s*\n([\s\S]*?)(?=\n##[^#]|\n---|\Z|$)/);if(o){let s=o[1],i=/^-\s+\*\*([^*]+)\*\*:\s*(.+)$/gm,a,c=0;for(;(a=i.exec(s))!==null;){let l=a[1].trim(),u=a[2].trim(),d=Xp(l,c+1);r.push({id:d,title:l,description:u}),c++}}return{content:n,proposedUnits:r}}catch(t){return console.error(`Failed to parse intent from ${e}:`,t),null}}function oa(e,t,n=oT){let r=t;r.length>n&&(console.warn(`[decomposition] Unit specs (${r.length}) exceed maxUnits limit (${n}). Truncating to ${n}.`),r=r.slice(0,n));let o=[];for(let s=0;s<r.length;s++){let i=r[s],a=Xp(i.title,s+1),c={id:a,type:"unit",title:i.title,parent_id:e.id,children_ids:[],status:"pending",assigned_agent:null,estimated_effort:i.estimated_effort};o.push(c),e.children_ids.push(a)}return o}function sa(e){let t=new Map;function n(r,o){t.set(r.id,r);for(let s of r.children_ids){let i=o.find(a=>a.id===s);i&&n(i,o)}}for(let r of e)t.set(r.id,r);return{roots:e,nodes:t}}var tr=T(X(),1),nr=T(require("path"),1);function ef(e,t){let n=[],r=1;for(let o of e){let s=on(o.title),i=sT(t,s),a=Zp(i,"input"),c=Zp(i,"output"),l=iT(o,e);n.push({id:`IFACE-${String(r++).padStart(3,"0")}`,unit_id:o.id,name:aT(o.title),inputs:a,outputs:c,dependencies:l,description:`Interface contract for ${o.title}`})}return n}function tf(e,t){let n=[],r=1;for(let o of e){let s=t.filter(c=>c.unit_id===o.id),i=[],a=[];for(let c of s){i.push({id:`COMP-${c.id}`,name:c.name,type:"interface"});for(let l of c.dependencies){let u=t.find(d=>d.id===l);u&&a.push({from:`COMP-${u.id}`,to:`COMP-${c.id}`,data:`Data from ${u.name}`,direction:"unidirectional"})}if(lT(c)){let l=`STORE-${c.id}`;i.push({id:l,name:`${c.name}Store`,type:"store"}),a.push({from:`COMP-${c.id}`,to:l,data:"Persisted data",direction:"bidirectional"})}}n.push({id:`DFD-${String(r++).padStart(3,"0")}`,unit_id:o.id,components:i,flows:a,description:`Data flow diagram for ${o.title}`})}return n}function nf(e,t,n){let r=[],o=1;for(let s of e){let i=t.filter(u=>u.unit_id===s.id),a=n.find(u=>u.unit_id===s.id),c=a?a.components.filter(u=>u.type==="store").map(u=>u.name):[],l=uT(s,i);r.push({id:`COMP-${String(o++).padStart(3,"0")}`,unit_id:s.id,name:cT(s.title),responsibilities:l,interfaces_used:i.map(u=>u.id),data_stores:c,description:`Component design for ${s.title}`})}return r}function ia(e,t){let n=[];for(let a of e.interfaces)a.inputs.length===0&&a.outputs.length===0&&n.push(`Interface ${a.id} (${a.name}) has no inputs or outputs`);for(let a of e.dataFlows){let c=new Set(a.components.map(l=>l.id));for(let l of a.flows)c.has(l.from)||n.push(`DFD ${a.id}: Flow references invalid source component ${l.from}`),c.has(l.to)||n.push(`DFD ${a.id}: Flow references invalid target component ${l.to}`)}let r=new Set(e.interfaces.map(a=>a.id));for(let a of e.components)for(let c of a.interfaces_used)r.has(c)||n.push(`Component ${a.id} (${a.name}) references invalid interface ${c}`);for(let a of e.components)a.responsibilities.length===0&&n.push(`Component ${a.id} (${a.name}) has no defined responsibilities`);let o=dT(t),s=pT(e),i=fT(o,s);return{passed:n.length===0,coverage_percentage:i,blocking_issues:n,reviewer:"design-validator",timestamp:new Date().toISOString()}}async function rf(e,t,n){let r=nr.default.join(e,"aidlc-docs",t,"construction","design");try{await tr.default.ensureDir(r),await tr.default.writeJson(nr.default.join(r,"interfaces.json"),n.interfaces,{spaces:2}),await tr.default.writeJson(nr.default.join(r,"data-flow.json"),n.dataFlows,{spaces:2}),await tr.default.writeJson(nr.default.join(r,"components.json"),n.components,{spaces:2});let o=ia(n,"");await tr.default.writeJson(nr.default.join(r,"validation.json"),o,{spaces:2})}catch(o){throw console.error("Failed to write design artifacts:",o),o}}function on(e){let t=new Set(["the","a","an","and","or","but","in","on","at","to","for"]);return e.toLowerCase().split(/\s+/).filter(n=>n.length>2&&!t.has(n))}function sT(e,t){let n=e.split(`
963
963
  `),r=[];for(let o of n){let s=o.toLowerCase();t.some(i=>s.includes(i))&&r.push(o)}return r.join(`
964
964
  `)}function Zp(e,t){let n=[],r=/(\w+):\s*(\w+)/g,o;for(;(o=r.exec(e))!==null;)n.push({name:o[1],type:o[2],required:!0,description:`${t} field ${o[1]}`});return n}function iT(e,t){let n=new Set(on(e.title)),r=[];for(let o of t){if(o.id===e.id)continue;on(o.title).filter(a=>n.has(a)).length>0&&r.push(o.id)}return r}function aT(e){return e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")+"Interface"}function cT(e){return e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join("")+"Component"}function lT(e){let t=["store","save","persist","database","repository"],n=e.name.toLowerCase();return t.some(r=>n.includes(r))}function uT(e,t){let n=[];n.push(`Implement ${e.title}`);for(let r of t)r.inputs.length>0&&n.push(`Process inputs for ${r.name}`),r.outputs.length>0&&n.push(`Generate outputs for ${r.name}`);return n}function dT(e){return new Set(on(e))}function pT(e){let t=new Set;for(let n of e.interfaces)on(n.name).forEach(r=>t.add(r)),on(n.description).forEach(r=>t.add(r));for(let n of e.components)on(n.name).forEach(r=>t.add(r)),on(n.description).forEach(r=>t.add(r));return t}function fT(e,t){if(e.size===0)return 100;let n=0;for(let r of e)t.has(r)&&n++;return Math.round(n/e.size*100)}var En=require("fs"),aa=require("path"),mT=[1,2,4,8,16];function gT(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return null;let n=t[1];try{let r={},o=n.split(`
@@ -24,7 +24,7 @@ export declare const HOOKS_DIR: string;
24
24
  export declare const SETTINGS_FILE: string;
25
25
  export declare const VERSION_FILE: string;
26
26
  /** Current version - MUST match package.json */
27
- export declare const VERSION = "4.4.21";
27
+ export declare const VERSION = "4.4.22";
28
28
  /** Installation result */
29
29
  export interface InstallResult {
30
30
  success: boolean;
@@ -40,7 +40,7 @@ export const HOOKS_DIR = join(CLAUDE_CONFIG_DIR, 'hooks');
40
40
  export const SETTINGS_FILE = join(CLAUDE_CONFIG_DIR, 'settings.json');
41
41
  export const VERSION_FILE = join(CLAUDE_CONFIG_DIR, '.olympus-version.json');
42
42
  /** Current version - MUST match package.json */
43
- export const VERSION = '4.4.21';
43
+ export const VERSION = '4.4.22';
44
44
  /**
45
45
  * Read a content file from the resources/ directory.
46
46
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olympus-ai",
3
- "version": "4.4.21",
3
+ "version": "4.4.22",
4
4
  "description": "Olympus: Multi-agent orchestration for Claude Code. Summon the gods of code.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -139,3 +139,20 @@ flowchart TD
139
139
  - OPERATIONS is placeholder for future expansion
140
140
  - Simple changes may skip conditional INCEPTION stages
141
141
  - Complex changes get full INCEPTION and CONSTRUCTION treatment
142
+
143
+ ## Approval Gate Safety Rule
144
+
145
+ **CRITICAL**: NEVER present an approval gate while background agents are still running.
146
+
147
+ All background agents and parallel tasks MUST complete — and their results MUST be fully incorporated — BEFORE presenting any approval prompt to the user.
148
+
149
+ **Why**: When a background agent completes, it triggers a new processing turn for the orchestrator. If an approval gate has already been presented, the orchestrator will resume processing from the agent completion notification instead of waiting for the user's response. This bypasses the approval gate entirely.
150
+
151
+ **Rule**: Before displaying any "You may: Request Changes / Continue" prompt:
152
+ 1. Confirm zero pending background agents or tasks
153
+ 2. Incorporate all returned results into the current artifact
154
+ 3. Only then present the approval prompt
155
+
156
+ If exploration or file reading is needed during planning, either:
157
+ - Run it in the **foreground** (blocking) so it completes before the approval gate, OR
158
+ - Run it in the background but **wait for completion** before presenting the approval prompt — do NOT present the prompt while agents are still running
@@ -160,6 +160,14 @@ When managing code generation, the orchestrator MUST leverage Olympus capabiliti
160
160
  - [ ] Ensure plan is executable step-by-step
161
161
  - [ ] Emphasize that this plan is the single source of truth for Code Generation
162
162
 
163
+ ## Step 4b: Background Agent Completion Gate (MANDATORY)
164
+ - [ ] Before presenting the approval prompt, verify ALL background agents and tasks have completed
165
+ - [ ] If any agents are still running, WAIT for them to finish — do NOT proceed to Step 5
166
+ - [ ] Incorporate all agent results into the plan (update scope, file lists, step counts if needed)
167
+ - [ ] Only after zero pending agents remain, proceed to Step 5
168
+
169
+ **Why this gate exists**: Background agent completion triggers a new orchestrator processing turn. If the approval prompt has already been displayed, the orchestrator resumes from the agent notification instead of waiting for the user — silently bypassing the approval gate.
170
+
163
171
  ## Step 5: Present Plan Summary and Approval Request
164
172
  - [ ] Present plan summary in this structure:
165
173