workspai 0.47.0 → 0.48.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 (90) hide show
  1. package/README.md +214 -119
  2. package/contracts/agent-customization-pack.v1.json +5 -0
  3. package/contracts/extension-cli-compatibility.v1.json +7 -2
  4. package/contracts/published-contract-catalog.v1.json +28 -1
  5. package/contracts/runtime-command-surface.v1.json +145 -1
  6. package/contracts/workspace-intelligence/model-usage-event.v1.json +82 -0
  7. package/contracts/workspace-intelligence/workspace-intelligence-evaluation-comparison.v1.json +53 -0
  8. package/contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json +120 -0
  9. package/contracts/workspace-intelligence-architecture.v1.json +31 -2
  10. package/contracts/workspace-intelligence-chain.v1.json +44 -3
  11. package/dist/analyze-EEEU3MIF.js +1 -0
  12. package/dist/{artifact-remediation-plan-EPALZ2LC.js → artifact-remediation-plan-SPOUHMK5.js} +1 -1
  13. package/dist/autopilot-release-XGVXPOZI.js +1 -0
  14. package/dist/{chunk-2TEDAKP6.js → chunk-32OJDBIG.js} +1 -1
  15. package/dist/{chunk-ZDN7RHXJ.js → chunk-37CVKXBD.js} +1 -1
  16. package/dist/{chunk-YCL3I2JO.js → chunk-3NU32T4A.js} +1 -1
  17. package/dist/chunk-3VFA7D5T.js +1 -0
  18. package/dist/{chunk-CW7PGBIQ.js → chunk-4HDYADHT.js} +1 -1
  19. package/dist/{chunk-PBHP6JNY.js → chunk-54EP5CEV.js} +1 -1
  20. package/dist/{chunk-QDWYIRHR.js → chunk-5S3DJQEP.js} +1 -1
  21. package/dist/{chunk-NOFM7MNA.js → chunk-AFL3ACCR.js} +1 -1
  22. package/dist/{chunk-MEMHNE7Y.js → chunk-BFLJ2R4D.js} +1 -1
  23. package/dist/{chunk-6SWRNA47.js → chunk-BGPXQQNY.js} +1 -1
  24. package/dist/chunk-BMWFQXGW.js +1 -0
  25. package/dist/{chunk-2GHUZDYA.js → chunk-CRHYBQI3.js} +1 -1
  26. package/dist/{chunk-76YOPAOT.js → chunk-ESLPI3XZ.js} +1 -1
  27. package/dist/{chunk-DV6GJD4K.js → chunk-HDXNIN4N.js} +1 -1
  28. package/dist/{chunk-TNQI5VCW.js → chunk-HZDXO65G.js} +14 -14
  29. package/dist/{chunk-BSRVO52Y.js → chunk-I46XEIPL.js} +1 -1
  30. package/dist/{chunk-COARSXRC.js → chunk-J5ENLXDF.js} +1 -1
  31. package/dist/chunk-LHOZXC2M.js +2 -0
  32. package/dist/{chunk-RWRLFSKW.js → chunk-NAJCUQ4X.js} +1 -1
  33. package/dist/{chunk-ZM5NQ5Z2.js → chunk-OW42TZFB.js} +1 -1
  34. package/dist/{chunk-SK6XRKGG.js → chunk-P3D5YQB2.js} +1 -1
  35. package/dist/{chunk-TWNFECMN.js → chunk-PHXQR6PX.js} +1 -1
  36. package/dist/{chunk-ITCAMC2E.js → chunk-PRTR2DQ2.js} +1 -1
  37. package/dist/{chunk-KZZ36CK5.js → chunk-QNONOO4F.js} +1 -1
  38. package/dist/{chunk-7VLCK5JW.js → chunk-RHQW3DTP.js} +1 -1
  39. package/dist/{chunk-22NJ2ZMG.js → chunk-T4YR4RAI.js} +1 -1
  40. package/dist/{chunk-HSGFUKCN.js → chunk-VU7NZHPM.js} +1 -1
  41. package/dist/{chunk-VBSQ7MF6.js → chunk-Y5UJLPS4.js} +19 -19
  42. package/dist/{chunk-U5EZHZBX.js → chunk-YJZOMRAS.js} +1 -1
  43. package/dist/{create-7JKJDAQV.js → create-DBQNAMKP.js} +1 -1
  44. package/dist/{doctor-PGPNIS76.js → doctor-4NNUDNGZ.js} +1 -1
  45. package/dist/{dotnet-webapi-clean-6TVFBTVI.js → dotnet-webapi-clean-A6MVDYXX.js} +4 -4
  46. package/dist/{gofiber-standard-2BL7GWZB.js → gofiber-standard-I5YPQG5V.js} +1 -1
  47. package/dist/{gogin-standard-XGP3KBXA.js → gogin-standard-VY2L4QT5.js} +1 -1
  48. package/dist/index.d.ts +32 -11
  49. package/dist/index.js +127 -125
  50. package/dist/{pipeline-IB6ILJSV.js → pipeline-TQM43A3K.js} +1 -1
  51. package/dist/{springboot-standard-JJNUID6M.js → springboot-standard-55XKCBIZ.js} +4 -4
  52. package/dist/{workspace-H3QXBFGB.js → workspace-NCWRINEF.js} +1 -1
  53. package/dist/{workspace-agent-sync-C7SG2Z5W.js → workspace-agent-sync-662QHXGF.js} +1 -1
  54. package/dist/{workspace-context-BKQBKA4C.js → workspace-context-23YYCUCP.js} +1 -1
  55. package/dist/{workspace-contract-RPQQBQXR.js → workspace-contract-TU2I7GC2.js} +1 -1
  56. package/dist/{workspace-dependency-graph-23BI2HG7.js → workspace-dependency-graph-BP4EXYQ5.js} +1 -1
  57. package/dist/workspace-explain-MWUEN643.js +1 -0
  58. package/dist/workspace-explain-contract-ZPI3JXJU.js +1 -0
  59. package/dist/{workspace-feedback-WAID3IOE.js → workspace-feedback-SUVH2LUJ.js} +1 -1
  60. package/dist/{workspace-foundation-5OOJEO2D.js → workspace-foundation-WXJ6I7ES.js} +1 -1
  61. package/dist/{workspace-history-C6OP3IAQ.js → workspace-history-BANOJRQ2.js} +1 -1
  62. package/dist/{workspace-intelligence-VKDL3H2J.js → workspace-intelligence-MFJE7W67.js} +1 -1
  63. package/dist/workspace-intelligence-evaluation-IPH7M3WV.js +1 -0
  64. package/dist/{workspace-intelligence-runner-LVALAZY7.js → workspace-intelligence-runner-THYLHHMF.js} +1 -1
  65. package/dist/{workspace-knowledge-graph-FE2NTZKV.js → workspace-knowledge-graph-ARDC6HHG.js} +1 -1
  66. package/dist/workspace-knowledge-graph-export-UYAYFTWX.js +10 -0
  67. package/dist/workspace-mcp-serve-EZR6O76D.js +3 -0
  68. package/dist/{workspace-model-S33CIB2R.js → workspace-model-7OU2M3LE.js} +1 -1
  69. package/dist/{workspace-registry-summary-A3YDL63D.js → workspace-registry-summary-ORDK7A36.js} +1 -1
  70. package/dist/workspace-run-RLIYSOTN.js +1 -0
  71. package/dist/{workspace-verify-ZGH3NXAH.js → workspace-verify-EBVL7FWT.js} +1 -1
  72. package/dist/{workspace-watch-EVBJTMV7.js → workspace-watch-3BPGLFLB.js} +1 -1
  73. package/docs/GLOSSARY.md +28 -24
  74. package/docs/README.md +17 -10
  75. package/docs/README_CONTENT_CONTRACT.md +154 -0
  76. package/docs/commands-reference.md +14 -1
  77. package/docs/contracts/ARTIFACT_CATALOG.md +28 -19
  78. package/docs/contracts/README.md +3 -0
  79. package/docs/graph-benchmark-methodology.md +2 -2
  80. package/docs/workspace-intelligence-evaluation.md +147 -0
  81. package/docs/workspace-knowledge-graph.md +31 -10
  82. package/package.json +1 -1
  83. package/dist/analyze-UVXPRGYZ.js +0 -1
  84. package/dist/autopilot-release-5BQ6F5L2.js +0 -1
  85. package/dist/chunk-LNRAB7UY.js +0 -1
  86. package/dist/chunk-NRYS4CLR.js +0 -2
  87. package/dist/workspace-explain-WVN7JH3U.js +0 -1
  88. package/dist/workspace-explain-contract-SEFTVF6J.js +0 -1
  89. package/dist/workspace-mcp-serve-KT2I676Z.js +0 -3
  90. package/dist/workspace-run-M4LNJILC.js +0 -1
@@ -1,4 +1,4 @@
1
- import {a as a$3}from'./chunk-PBHP6JNY.js';import {c}from'./chunk-QDWYIRHR.js';import {q}from'./chunk-MEMHNE7Y.js';import {d as d$1}from'./chunk-VBSQ7MF6.js';import {c as c$1}from'./chunk-FPJNWPKU.js';import {a as a$4}from'./chunk-6SWRNA47.js';import {f,e}from'./chunk-T3GJ7YVG.js';import {a}from'./chunk-22DT744Z.js';import {d,a as a$2,e as e$1}from'./chunk-2TEDAKP6.js';import {a as a$1}from'./chunk-LNRAB7UY.js';import c$2 from'chalk';import p from'path';function G(a){return a===0?"pass":a===2?"warn":"fail"}function I(a){return a.some(r=>r.status==="fail")?"blocked":a.some(r=>r.status==="warn")?"needs-attention":"ready"}function j(a,r){if(r)return 3;let i=a.some(o=>o.status==="fail"),t=a.some(o=>o.status==="warn");return i?1:t?2:0}function N(a,r){return a===2&&!r?0:a}async function O(a){let r=await d$1(a,true),i=false;try{let{syncWorkspaceContract:t}=await import('./workspace-contract-RPQQBQXR.js');await t({workspacePath:a}),i=true;}catch{i=false;}return {sync:r,contractSynced:i}}async function V(a$5={}){let r=p.resolve(a$5.workspacePath??process.cwd()),i=a(r);if(!i)throw new Error("No Workspai workspace found in current directory or parents");let t=[],o=[],l=false,d$1,f$1,m,y=Date.now();try{let{sync:e,contractSynced:s}=await O(i),n=e.workspaceFound&&(e.added.length>0||e.skipped>=0)||e.workspaceFound?"pass":"warn";t.push({name:"sync",status:n,durationMs:Date.now()-y,summary:e.workspaceFound?`registry sync complete (${e.added.length} added, ${e.skipped} existing)${s?", contract synced":""}`:"workspace not registered in global registry; contract sync attempted"}),e.workspaceFound||o.push("workspace registry entry missing \u2014 run workspai create workspace or register manually");}catch(e){l=true,t.push({name:"sync",status:"fail",durationMs:Date.now()-y,summary:`sync failed: ${e instanceof Error?e.message:String(e)}`}),o.push("workspace sync stage failed");}let w=Date.now();try{let e=await q({workspace:true,json:true,quiet:true,strict:a$5.strict===true,ci:a$5.strict!==true}),s=G(e),n=await d(i,a$1.doctor)??a$2(i,a$1.doctor);t.push({name:"doctor",status:s,durationMs:Date.now()-w,summary:s==="pass"?"doctor workspace passed":s==="warn"?"doctor workspace reported warnings":"doctor workspace did not pass",exitCode:e,evidencePath:n}),s==="fail"?o.push("doctor workspace gate failed"):s==="warn"&&o.push("doctor workspace reported warnings");}catch(e){l=true,t.push({name:"doctor",status:"fail",durationMs:Date.now()-w,summary:`doctor failed: ${e instanceof Error?e.message:String(e)}`}),o.push("doctor workspace stage failed");}if(a$5.skipAnalyze)t.push({name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped"});else {let e=Date.now();try{let s=await a$3({workspacePath:i,json:true,strict:a$5.strict===true});d$1=p.isAbsolute(s.enterpriseControls.evidencePath)?s.enterpriseControls.evidencePath:p.join(i,s.enterpriseControls.evidencePath);let n=s.summary.verdict==="blocked"?"fail":s.summary.verdict==="needs-attention"?"warn":"pass";t.push({name:"analyze",status:n,durationMs:Date.now()-e,summary:`analyze verdict: ${s.summary.verdict} (score ${s.summary.score}/100)`,evidencePath:d$1}),n==="fail"?o.push("analyze reported blocked verdict"):n==="warn"&&o.push("analyze reported needs-attention verdict");}catch(s){l=true,t.push({name:"analyze",status:"fail",durationMs:Date.now()-e,summary:`analyze failed: ${s instanceof Error?s.message:String(s)}`}),o.push("analyze stage failed");}}let h=Date.now();try{let e=await a$4({startPath:i,writeReport:true,skipVerify:a$5.skipVerify===true});f$1=e.evidencePath;let s=e.overallStatus==="pass"?"pass":e.overallStatus==="warn"?"warn":"fail";t.push({name:"readiness",status:s,durationMs:Date.now()-h,summary:`readiness overall: ${e.overallStatus}`,evidencePath:e.evidencePath}),s==="fail"?o.push(...e.blockingReasons.map(n=>`readiness: ${n}`)):s==="warn"&&o.push(...e.gates.filter(n=>n.status==="warn").map(n=>`readiness warn: ${n.gate}: ${n.summary}`));}catch(e){l=true,t.push({name:"readiness",status:"fail",durationMs:Date.now()-h,summary:`readiness failed: ${e instanceof Error?e.message:String(e)}`}),o.push("readiness stage failed");}if(a$5.skipAutopilot)t.push({name:"autopilot",status:"skipped",durationMs:0,summary:"autopilot stage skipped"});else {let e=Date.now(),s=a$5.autopilotMode??"audit";try{let n=await c({workspacePath:i,mode:s,json:true,skipPipelineStages:true});m=n.artifacts.reportPath;let P=n.summary.verdict==="approved"?"pass":n.summary.verdict==="partial"?"warn":"fail";t.push({name:"autopilot",status:P,durationMs:Date.now()-e,summary:`autopilot ${s}: ${n.summary.verdict}`,exitCode:n.summary.exitCode,evidencePath:m}),P!=="pass"&&o.push(...n.blockingReasons.slice(0,5));}catch(n){l=true,t.push({name:"autopilot",status:"fail",durationMs:Date.now()-e,summary:`autopilot failed: ${n instanceof Error?n.message:String(n)}`}),o.push("autopilot release stage failed");}}let M=I(t),k=j(t,l),F=p.join(i,".workspai","reports","pipeline-last-run.json"),u={schemaVersion:"rapidkit-pipeline-v1",generatedAt:new Date().toISOString(),workspacePath:i,summary:{verdict:M,exitCode:k,stagesPassed:t.filter(e=>e.status==="pass").length,stagesWarn:t.filter(e=>e.status==="warn").length,stagesFailed:t.filter(e=>e.status==="fail").length},stages:t,blockingReasons:[...new Set(o)],artifacts:{reportPath:F,analyzeEvidencePath:d$1,readinessEvidencePath:f$1,autopilotEvidencePath:m}};if(a$5.writeReport!==false){let e$2=f(u,{commandId:"workspacePipeline",exitCode:k,generatedAt:u.generatedAt,blockers:u.blockingReasons,runId:e()});await e$1(i,".workspai/reports/pipeline-last-run.json",e$2);}if(a$5.writeReport!==false&&a$5.noAgentSync!==true&&process.env.RAPIDKIT_NO_AGENT_SYNC!=="1"&&a$5.agentSync!==false)try{let{syncWorkspaceAgentGrounding:e}=await import('./workspace-agent-sync-C7SG2Z5W.js'),s=await e({workspacePath:i,write:true,refreshContext:true,strict:false});u.agentGrounding={indexPath:s.indexPath,writtenFiles:s.writtenFiles,blockers:s.blockers};}catch{}return u}async function ae(a){let r;try{r=await V(a);}catch(t){let o=t instanceof Error?t.message:String(t);a.json?console.log(JSON.stringify(c$1({operation:"pipeline",code:"pipeline.failed",message:o}),null,2)):console.log(c$2.red(`Pipeline failed: ${o}`)),process.exit(1);}if(a.json)console.log(JSON.stringify(r,null,2));else {console.log(c$2.bold.cyan(`
1
+ import {a as a$3}from'./chunk-54EP5CEV.js';import {c}from'./chunk-5S3DJQEP.js';import {q}from'./chunk-BFLJ2R4D.js';import {d as d$1}from'./chunk-Y5UJLPS4.js';import {c as c$1}from'./chunk-FPJNWPKU.js';import {a as a$4}from'./chunk-BGPXQQNY.js';import {f,e}from'./chunk-T3GJ7YVG.js';import {a}from'./chunk-22DT744Z.js';import {d,a as a$2,e as e$1}from'./chunk-32OJDBIG.js';import {a as a$1}from'./chunk-BMWFQXGW.js';import c$2 from'chalk';import p from'path';function G(a){return a===0?"pass":a===2?"warn":"fail"}function I(a){return a.some(r=>r.status==="fail")?"blocked":a.some(r=>r.status==="warn")?"needs-attention":"ready"}function j(a,r){if(r)return 3;let i=a.some(o=>o.status==="fail"),t=a.some(o=>o.status==="warn");return i?1:t?2:0}function N(a,r){return a===2&&!r?0:a}async function O(a){let r=await d$1(a,true),i=false;try{let{syncWorkspaceContract:t}=await import('./workspace-contract-TU2I7GC2.js');await t({workspacePath:a}),i=true;}catch{i=false;}return {sync:r,contractSynced:i}}async function V(a$5={}){let r=p.resolve(a$5.workspacePath??process.cwd()),i=a(r);if(!i)throw new Error("No Workspai workspace found in current directory or parents");let t=[],o=[],l=false,d$1,f$1,m,y=Date.now();try{let{sync:e,contractSynced:s}=await O(i),n=e.workspaceFound&&(e.added.length>0||e.skipped>=0)||e.workspaceFound?"pass":"warn";t.push({name:"sync",status:n,durationMs:Date.now()-y,summary:e.workspaceFound?`registry sync complete (${e.added.length} added, ${e.skipped} existing)${s?", contract synced":""}`:"workspace not registered in global registry; contract sync attempted"}),e.workspaceFound||o.push("workspace registry entry missing \u2014 run workspai create workspace or register manually");}catch(e){l=true,t.push({name:"sync",status:"fail",durationMs:Date.now()-y,summary:`sync failed: ${e instanceof Error?e.message:String(e)}`}),o.push("workspace sync stage failed");}let w=Date.now();try{let e=await q({workspace:true,json:true,quiet:true,strict:a$5.strict===true,ci:a$5.strict!==true}),s=G(e),n=await d(i,a$1.doctor)??a$2(i,a$1.doctor);t.push({name:"doctor",status:s,durationMs:Date.now()-w,summary:s==="pass"?"doctor workspace passed":s==="warn"?"doctor workspace reported warnings":"doctor workspace did not pass",exitCode:e,evidencePath:n}),s==="fail"?o.push("doctor workspace gate failed"):s==="warn"&&o.push("doctor workspace reported warnings");}catch(e){l=true,t.push({name:"doctor",status:"fail",durationMs:Date.now()-w,summary:`doctor failed: ${e instanceof Error?e.message:String(e)}`}),o.push("doctor workspace stage failed");}if(a$5.skipAnalyze)t.push({name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped"});else {let e=Date.now();try{let s=await a$3({workspacePath:i,json:true,strict:a$5.strict===true});d$1=p.isAbsolute(s.enterpriseControls.evidencePath)?s.enterpriseControls.evidencePath:p.join(i,s.enterpriseControls.evidencePath);let n=s.summary.verdict==="blocked"?"fail":s.summary.verdict==="needs-attention"?"warn":"pass";t.push({name:"analyze",status:n,durationMs:Date.now()-e,summary:`analyze verdict: ${s.summary.verdict} (score ${s.summary.score}/100)`,evidencePath:d$1}),n==="fail"?o.push("analyze reported blocked verdict"):n==="warn"&&o.push("analyze reported needs-attention verdict");}catch(s){l=true,t.push({name:"analyze",status:"fail",durationMs:Date.now()-e,summary:`analyze failed: ${s instanceof Error?s.message:String(s)}`}),o.push("analyze stage failed");}}let h=Date.now();try{let e=await a$4({startPath:i,writeReport:true,skipVerify:a$5.skipVerify===true});f$1=e.evidencePath;let s=e.overallStatus==="pass"?"pass":e.overallStatus==="warn"?"warn":"fail";t.push({name:"readiness",status:s,durationMs:Date.now()-h,summary:`readiness overall: ${e.overallStatus}`,evidencePath:e.evidencePath}),s==="fail"?o.push(...e.blockingReasons.map(n=>`readiness: ${n}`)):s==="warn"&&o.push(...e.gates.filter(n=>n.status==="warn").map(n=>`readiness warn: ${n.gate}: ${n.summary}`));}catch(e){l=true,t.push({name:"readiness",status:"fail",durationMs:Date.now()-h,summary:`readiness failed: ${e instanceof Error?e.message:String(e)}`}),o.push("readiness stage failed");}if(a$5.skipAutopilot)t.push({name:"autopilot",status:"skipped",durationMs:0,summary:"autopilot stage skipped"});else {let e=Date.now(),s=a$5.autopilotMode??"audit";try{let n=await c({workspacePath:i,mode:s,json:true,skipPipelineStages:true});m=n.artifacts.reportPath;let P=n.summary.verdict==="approved"?"pass":n.summary.verdict==="partial"?"warn":"fail";t.push({name:"autopilot",status:P,durationMs:Date.now()-e,summary:`autopilot ${s}: ${n.summary.verdict}`,exitCode:n.summary.exitCode,evidencePath:m}),P!=="pass"&&o.push(...n.blockingReasons.slice(0,5));}catch(n){l=true,t.push({name:"autopilot",status:"fail",durationMs:Date.now()-e,summary:`autopilot failed: ${n instanceof Error?n.message:String(n)}`}),o.push("autopilot release stage failed");}}let M=I(t),k=j(t,l),F=p.join(i,".workspai","reports","pipeline-last-run.json"),u={schemaVersion:"rapidkit-pipeline-v1",generatedAt:new Date().toISOString(),workspacePath:i,summary:{verdict:M,exitCode:k,stagesPassed:t.filter(e=>e.status==="pass").length,stagesWarn:t.filter(e=>e.status==="warn").length,stagesFailed:t.filter(e=>e.status==="fail").length},stages:t,blockingReasons:[...new Set(o)],artifacts:{reportPath:F,analyzeEvidencePath:d$1,readinessEvidencePath:f$1,autopilotEvidencePath:m}};if(a$5.writeReport!==false){let e$2=f(u,{commandId:"workspacePipeline",exitCode:k,generatedAt:u.generatedAt,blockers:u.blockingReasons,runId:e()});await e$1(i,".workspai/reports/pipeline-last-run.json",e$2);}if(a$5.writeReport!==false&&a$5.noAgentSync!==true&&process.env.RAPIDKIT_NO_AGENT_SYNC!=="1"&&a$5.agentSync!==false)try{let{syncWorkspaceAgentGrounding:e}=await import('./workspace-agent-sync-662QHXGF.js'),s=await e({workspacePath:i,write:true,refreshContext:true,strict:false});u.agentGrounding={indexPath:s.indexPath,writtenFiles:s.writtenFiles,blockers:s.blockers};}catch{}return u}async function ae(a){let r;try{r=await V(a);}catch(t){let o=t instanceof Error?t.message:String(t);a.json?console.log(JSON.stringify(c$1({operation:"pipeline",code:"pipeline.failed",message:o}),null,2)):console.log(c$2.red(`Pipeline failed: ${o}`)),process.exit(1);}if(a.json)console.log(JSON.stringify(r,null,2));else {console.log(c$2.bold.cyan(`
2
2
  \u{1F517} Workspai Governance Pipeline
3
3
  `)),console.log(c$2.bold(`Workspace: ${c$2.cyan(p.basename(r.workspacePath))}`)),console.log(c$2.gray(`Path: ${r.workspacePath}`)),console.log(c$2.white(`Verdict: ${r.summary.verdict} Exit: ${r.summary.exitCode} (${r.summary.stagesPassed} pass / ${r.summary.stagesWarn} warn / ${r.summary.stagesFailed} fail)`));for(let t of r.stages){let o=t.status==="pass"?c$2.green("PASS"):t.status==="warn"?c$2.yellow("WARN"):t.status==="skipped"?c$2.gray("SKIP"):c$2.red("FAIL");console.log(` - ${t.name}: ${o} ${t.summary}`);}if(r.blockingReasons.length>0){console.log(c$2.bold(`
4
4
  Blocking reasons:`));for(let t of r.blockingReasons.slice(0,8))console.log(c$2.gray(` \u2022 ${t}`));}console.log(c$2.gray(`
@@ -687,11 +687,11 @@ class ServiceRuntimeE2ETest {
687
687
  assertThat(response.getBody()).containsEntry("status", "UP");
688
688
  }
689
689
  }
690
- `}async function oe(e){try{await execa("mvn",["-N","wrapper:wrapper","-Dmaven=3.9.9"],{cwd:e,timeout:12e4});let t=g.join(e,"mvnw");return await promises.stat(t).then(()=>true).catch(()=>false)&&await promises.chmod(t,493),true}catch{return false}}async function ve(e,t){let s=E(t.artifact_id||t.project_name)||"service",p=f(t.group_id||"com.workspai.apps")||"com.workspai.apps",S=f(t.package_name||T(p,s))||"com.workspai.apps.service",r={project_name:t.project_name,artifact_id:s,group_id:p,package_name:S,author:h(t.author||"","Workspai User"),description:h(t.description||"",`Spring Boot service generated with Workspai - ${t.project_name}`),java_version:t.java_version||x,spring_boot_version:t.spring_boot_version||j,springdoc_version:t.springdoc_version||M,app_version:t.app_version||"0.1.0",port:t.port||"8080",skipGit:t.skipGit??false,skipInstall:t.skipInstall??false},b$2=c(),l=`${b(r.project_name)}Application`,o=A(r.package_name);try{await execa("mvn",["-version"],{timeout:3e3});}catch{console.log(i.yellow(`
690
+ `}async function oe(e){try{await execa("mvn",["-N","wrapper:wrapper","-Dmaven=3.9.9"],{cwd:e,timeout:12e4});let t=g.join(e,"mvnw");return await promises.stat(t).then(()=>true).catch(()=>false)&&await promises.chmod(t,493),true}catch{return false}}async function ve(e,t){let s=E(t.artifact_id||t.project_name)||"service",p=f(t.group_id||"com.workspai.apps")||"com.workspai.apps",S=f(t.package_name||T(p,s))||"com.workspai.apps.service",n={project_name:t.project_name,artifact_id:s,group_id:p,package_name:S,author:h(t.author||"","Workspai User"),description:h(t.description||"",`Spring Boot service generated with Workspai - ${t.project_name}`),java_version:t.java_version||x,spring_boot_version:t.spring_boot_version||j,springdoc_version:t.springdoc_version||M,app_version:t.app_version||"0.1.0",port:t.port||"8080",skipGit:t.skipGit??false,skipInstall:t.skipInstall??false},b$2=c(),l=`${b(n.project_name)}Application`,o=A(n.package_name);if(!n.skipInstall)try{await execa("mvn",["-version"],{timeout:3e3});}catch{console.log(i.yellow(`
691
691
  \u26A0 Maven not found in PATH - project will be scaffolded, but init/build commands require Maven 3.9+`)),console.log(i.gray(` Install: https://maven.apache.org/install.html
692
- `));}let c$2=R(`Generating Spring Boot project: ${r.project_name}...`).start();try{let n=(d,v)=>c$1(g.join(e,d),v),$=g.join(e,"rapidkit"),y=g.join(e,"rapidkit.cmd");if(await Promise.all([n("pom.xml",D(r)),n(".gitignore",Y()),n(".editorconfig",X()),n(".env.example",U(r)),n(".dockerignore",z()),n("Dockerfile",H(r)),n("docker-compose.yml",F(r)),n(".github/workflows/ci.yml",K(r)),n("README.md",Q(r)),n("src/main/resources/application.yml",J(r)),n("src/test/resources/application.yml",G()),n(`src/main/java/${o}/${l}.java`,B(r,l)),n(`src/main/java/${o}/config/ApplicationInfoProperties.java`,V(r)),n(`src/main/java/${o}/config/OpenApiConfiguration.java`,O(r)),n(`src/main/java/${o}/application/SystemInfoService.java`,q(r)),n(`src/main/java/${o}/api/http/dto/SystemInfoResponse.java`,L(r)),n(`src/main/java/${o}/api/http/SystemInfoController.java`,N(r)),n(`src/main/java/${o}/api/http/ApiExceptionHandler.java`,W(r)),n(`src/test/java/${o}/${l}Tests.java`,ne(r,l)),n(`src/test/java/${o}/api/http/SystemInfoControllerTest.java`,re(r)),n(`src/test/java/${o}/ServiceRuntimeE2ETest.java`,ie(r)),n("scripts/perf-smoke.sh",Z(r)),n(".workspai/project.json",C(r,b$2)),n(".workspai/context.json",P()),n("rapidkit",ee(r)),n("rapidkit.cmd",te())]),await promises.chmod($,493),await promises.chmod(y,493),await promises.chmod(g.join(e,"scripts","perf-smoke.sh"),493),r.skipInstall||await oe(e)||console.log(i.yellow("\u26A0 Maven Wrapper could not be generated automatically. Run `mvn -N wrapper:wrapper -Dmaven=3.9.9` inside the project.")),c$2.succeed(i.green(`Project created at ${e}`)),r.skipInstall)c$2.info(i.gray("Skipped Maven dependency warm-up (--skip-install)."));else try{c$2.start("Resolving Maven dependencies...");let d=g.join(e,process.platform==="win32"?"mvnw.cmd":"mvnw"),v=await promises.stat(d).then(()=>d).catch(()=>"mvn");await execa(v,["-B","-q","-DskipTests","dependency:go-offline"],{cwd:e,timeout:18e4}),c$2.succeed(i.gray("\u2713 maven dependency warm-up completed"));}catch{c$2.warn(i.yellow("\u26A0 Maven dependency warm-up failed - run manually: mvn -B -DskipTests dependency:go-offline"));}if(!r.skipGit)try{await b$1(e)?console.log(i.gray("\u26A0 git init skipped (target is inside an existing git worktree)")):(await execa("git",["init"],{cwd:e,env:a()}),await execa("git",["add","-A"],{cwd:e,env:a()}),await execa("git",["commit","-m","chore: initial scaffold (rapidkit springboot.standard)"],{cwd:e,env:a()}));}catch{console.log(i.yellow("\u26A0 Git initialization failed - continuing without initial commit"));}console.log(i.green(`
692
+ `));}let c$2=R(`Generating Spring Boot project: ${n.project_name}...`).start();try{let r=(d,v)=>c$1(g.join(e,d),v),$=g.join(e,"rapidkit"),y=g.join(e,"rapidkit.cmd");if(await Promise.all([r("pom.xml",D(n)),r(".gitignore",Y()),r(".editorconfig",X()),r(".env.example",U(n)),r(".dockerignore",z()),r("Dockerfile",H(n)),r("docker-compose.yml",F(n)),r(".github/workflows/ci.yml",K(n)),r("README.md",Q(n)),r("src/main/resources/application.yml",J(n)),r("src/test/resources/application.yml",G()),r(`src/main/java/${o}/${l}.java`,B(n,l)),r(`src/main/java/${o}/config/ApplicationInfoProperties.java`,V(n)),r(`src/main/java/${o}/config/OpenApiConfiguration.java`,O(n)),r(`src/main/java/${o}/application/SystemInfoService.java`,q(n)),r(`src/main/java/${o}/api/http/dto/SystemInfoResponse.java`,L(n)),r(`src/main/java/${o}/api/http/SystemInfoController.java`,N(n)),r(`src/main/java/${o}/api/http/ApiExceptionHandler.java`,W(n)),r(`src/test/java/${o}/${l}Tests.java`,ne(n,l)),r(`src/test/java/${o}/api/http/SystemInfoControllerTest.java`,re(n)),r(`src/test/java/${o}/ServiceRuntimeE2ETest.java`,ie(n)),r("scripts/perf-smoke.sh",Z(n)),r(".workspai/project.json",C(n,b$2)),r(".workspai/context.json",P()),r("rapidkit",ee(n)),r("rapidkit.cmd",te())]),await promises.chmod($,493),await promises.chmod(y,493),await promises.chmod(g.join(e,"scripts","perf-smoke.sh"),493),n.skipInstall||await oe(e)||console.log(i.yellow("\u26A0 Maven Wrapper could not be generated automatically. Run `mvn -N wrapper:wrapper -Dmaven=3.9.9` inside the project.")),c$2.succeed(i.green(`Project created at ${e}`)),n.skipInstall)c$2.info(i.gray("Skipped Maven dependency warm-up (--skip-install)."));else try{c$2.start("Resolving Maven dependencies...");let d=g.join(e,process.platform==="win32"?"mvnw.cmd":"mvnw"),v=await promises.stat(d).then(()=>d).catch(()=>"mvn");await execa(v,["-B","-q","-DskipTests","dependency:go-offline"],{cwd:e,timeout:18e4}),c$2.succeed(i.gray("\u2713 maven dependency warm-up completed"));}catch{c$2.warn(i.yellow("\u26A0 Maven dependency warm-up failed - run manually: mvn -B -DskipTests dependency:go-offline"));}if(!n.skipGit)try{await b$1(e)?console.log(i.gray("\u26A0 git init skipped (target is inside an existing git worktree)")):(await execa("git",["init"],{cwd:e,env:a()}),await execa("git",["add","-A"],{cwd:e,env:a()}),await execa("git",["commit","-m","chore: initial scaffold (rapidkit springboot.standard)"],{cwd:e,env:a()}));}catch{console.log(i.yellow("\u26A0 Git initialization failed - continuing without initial commit"));}console.log(i.green(`
693
693
  \u2728 Spring Boot project created successfully!
694
694
  `)),console.log(i.cyan("\u{1F4C2} Location:"),i.white(e)),console.log(i.cyan(`
695
695
  \u{1F680} Get started:
696
- `)),console.log(i.white(` cd ${r.project_name}`)),console.log(i.white(" npx workspai init")),console.log(i.white(` npx workspai dev
697
- `)),console.log(i.gray("Endpoints: /actuator/health, /api/v1/system/info, /docs"));}catch(n){c$2.fail("Failed to create Spring Boot project");try{await promises.rm(e,{recursive:true,force:true});}catch{}throw n}}export{x as DEFAULT_JAVA_VERSION,M as DEFAULT_SPRINGDOC_VERSION,j as DEFAULT_SPRING_BOOT_VERSION,ve as generateSpringBootKit};
696
+ `)),console.log(i.white(` cd ${n.project_name}`)),console.log(i.white(" npx workspai init")),console.log(i.white(` npx workspai dev
697
+ `)),console.log(i.gray("Endpoints: /actuator/health, /api/v1/system/info, /docs"));}catch(r){c$2.fail("Failed to create Spring Boot project");try{await promises.rm(e,{recursive:true,force:true});}catch{}throw r}}export{x as DEFAULT_JAVA_VERSION,M as DEFAULT_SPRINGDOC_VERSION,j as DEFAULT_SPRING_BOOT_VERSION,ve as generateSpringBootKit};
@@ -1 +1 @@
1
- export{h as createProject,g as createWorkspace,j as createWorkspaceShareBundle,i as listWorkspaces,a as normalizeWorkspaceEntry,f as registerProjectInWorkspace,e as registerProjectInWorkspaceStrict,c as registerWorkspace,b as registerWorkspaceStrict,d as syncWorkspaceProjects}from'./chunk-VBSQ7MF6.js';
1
+ export{h as createProject,g as createWorkspace,j as createWorkspaceShareBundle,i as listWorkspaces,a as normalizeWorkspaceEntry,f as registerProjectInWorkspace,e as registerProjectInWorkspaceStrict,c as registerWorkspace,b as registerWorkspaceStrict,d as syncWorkspaceProjects}from'./chunk-Y5UJLPS4.js';
@@ -1 +1 @@
1
- export{f as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,d as AGENT_CUSTOMIZATION_PACK_SCHEMA,e as AGENT_REPORTS_INDEX_PATH,c as AGENT_REPORTS_INDEX_SCHEMA,g as AGENT_REPORT_CATALOG,h as buildCanonicalAgentReportReadOrder,i as buildWorkspaceAgentReportsIndex,j as parseAgentGroundingTargets,k as syncWorkspaceAgentGrounding}from'./chunk-TNQI5VCW.js';export{f as AGENT_GROUNDING_DOC_PATH,g as LEGACY_AGENT_GROUNDING_DOC_PATH,A as LEGACY_COPILOT_GROUNDING_SKILL_PATH,m as LEGACY_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,C as LEGACY_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,i as LEGACY_CURSOR_GROUNDING_RULE_PATH,E as LEGACY_MCP_DESIGN_REPORT_PATH,G as LEGACY_VSCODE_AGENT_HOOKS_PATH,z as WORKSPAI_COPILOT_GROUNDING_SKILL_PATH,l as WORKSPAI_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,B as WORKSPAI_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,h as WORKSPAI_CURSOR_GROUNDING_RULE_PATH,D as WORKSPAI_MCP_DESIGN_REPORT_PATH,F as WORKSPAI_VSCODE_AGENT_HOOKS_PATH}from'./chunk-2GHUZDYA.js';
1
+ export{f as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,d as AGENT_CUSTOMIZATION_PACK_SCHEMA,e as AGENT_REPORTS_INDEX_PATH,c as AGENT_REPORTS_INDEX_SCHEMA,g as AGENT_REPORT_CATALOG,h as buildCanonicalAgentReportReadOrder,i as buildWorkspaceAgentReportsIndex,j as parseAgentGroundingTargets,k as syncWorkspaceAgentGrounding}from'./chunk-HZDXO65G.js';export{f as AGENT_GROUNDING_DOC_PATH,g as LEGACY_AGENT_GROUNDING_DOC_PATH,A as LEGACY_COPILOT_GROUNDING_SKILL_PATH,m as LEGACY_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,C as LEGACY_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,i as LEGACY_CURSOR_GROUNDING_RULE_PATH,E as LEGACY_MCP_DESIGN_REPORT_PATH,G as LEGACY_VSCODE_AGENT_HOOKS_PATH,z as WORKSPAI_COPILOT_GROUNDING_SKILL_PATH,l as WORKSPAI_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,B as WORKSPAI_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,h as WORKSPAI_CURSOR_GROUNDING_RULE_PATH,D as WORKSPAI_MCP_DESIGN_REPORT_PATH,F as WORKSPAI_VSCODE_AGENT_HOOKS_PATH}from'./chunk-CRHYBQI3.js';
@@ -1 +1 @@
1
- export{d as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,c as WORKSPACE_CONTEXT_SCHEMA_VERSION,e as buildWorkspaceAgentContext,f as writeWorkspaceAgentContext}from'./chunk-NRYS4CLR.js';
1
+ export{d as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,c as WORKSPACE_CONTEXT_SCHEMA_VERSION,e as buildWorkspaceAgentContext,f as writeWorkspaceAgentContext}from'./chunk-LHOZXC2M.js';
@@ -1 +1 @@
1
- export{d as WORKSPACE_CONTRACT_PATH,f as WORKSPACE_CONTRACT_SCHEMA_VERSION,e as WORKSPACE_CONTRACT_VERIFY_REPORT_PATH,g as WORKSPACE_CONTRACT_VERIFY_SCHEMA_VERSION,h as WorkspaceContractVerificationError,j as buildWorkspaceContract,n as buildWorkspaceContractGraph,i as discoverProjectJsonFiles,m as readWorkspaceContract,l as syncWorkspaceContract,o as verifyWorkspaceContract,k as writeWorkspaceContract,p as writeWorkspaceContractVerifyEvidence}from'./chunk-22NJ2ZMG.js';
1
+ export{d as WORKSPACE_CONTRACT_PATH,f as WORKSPACE_CONTRACT_SCHEMA_VERSION,e as WORKSPACE_CONTRACT_VERIFY_REPORT_PATH,g as WORKSPACE_CONTRACT_VERIFY_SCHEMA_VERSION,h as WorkspaceContractVerificationError,j as buildWorkspaceContract,n as buildWorkspaceContractGraph,i as discoverProjectJsonFiles,m as readWorkspaceContract,l as syncWorkspaceContract,o as verifyWorkspaceContract,k as writeWorkspaceContract,p as writeWorkspaceContractVerifyEvidence}from'./chunk-T4YR4RAI.js';
@@ -1 +1 @@
1
- export{c as WORKSPACE_GRAPH_OVERRIDES_PATH,d as graphHasCycle,e as hashDependencyGraph,f as inferWorkspaceDependencyGraph,g as inferWorkspaceDependencyGraphIncremental}from'./chunk-COARSXRC.js';
1
+ export{c as WORKSPACE_GRAPH_OVERRIDES_PATH,d as graphHasCycle,e as hashDependencyGraph,f as inferWorkspaceDependencyGraph,g as inferWorkspaceDependencyGraphIncremental}from'./chunk-J5ENLXDF.js';
@@ -0,0 +1 @@
1
+ export{b as buildWorkspaceExplain,a as resolveWorkspaceExplainArtifactPath,c as writeWorkspaceExplainReport}from'./chunk-4HDYADHT.js';export{c as WORKSPACE_EXPLAIN_REPORT_PATH,e as WORKSPACE_TRACE_REPORT_PATH,d as WORKSPACE_WHY_REPORT_PATH}from'./chunk-CRHYBQI3.js';export{e as WORKSPACE_MODEL_DIFF_REPORT_PATH}from'./chunk-AFL3ACCR.js';
@@ -0,0 +1 @@
1
+ export{a as WORKSPACE_EXPLAIN_SCHEMA_VERSION,b as WORKSPACE_EXPLAIN_TARGETS,e as isWorkspaceExplainReport,c as parseWorkspaceExplainTarget,d as resolveWorkspaceTraceTarget}from'./chunk-VU7NZHPM.js';export{c as WORKSPACE_EXPLAIN_REPORT_PATH,e as WORKSPACE_TRACE_REPORT_PATH,d as WORKSPACE_WHY_REPORT_PATH}from'./chunk-CRHYBQI3.js';
@@ -1 +1 @@
1
- import {b}from'./chunk-ICGWHIMK.js';import {b as b$1,f,j}from'./chunk-76YOPAOT.js';import o from'path';async function m(r){let t=o.resolve(r.workspacePath),n=b(r.payload);if(!n)return {ok:false,error:"Invalid agent-action-outcome payload",historyPath:o.join(t,b$1)};let c=f(n),p=o.join(t,b$1);return await j(t,c,{retention:r.retention}),{ok:true,entry:c,historyPath:p}}function l(r){let t=r.trim();if(!t)return null;try{return JSON.parse(t)}catch{return null}}async function h(){let r=[];for await(let t of process.stdin)r.push(typeof t=="string"?Buffer.from(t):t);return Buffer.concat(r).toString("utf8")}export{l as parseFeedbackStdinPayload,h as readStdinAll,m as recordWorkspaceFeedback};
1
+ import {b}from'./chunk-ICGWHIMK.js';import {b as b$1,f,j}from'./chunk-ESLPI3XZ.js';import o from'path';async function m(r){let t=o.resolve(r.workspacePath),n=b(r.payload);if(!n)return {ok:false,error:"Invalid agent-action-outcome payload",historyPath:o.join(t,b$1)};let c=f(n),p=o.join(t,b$1);return await j(t,c,{retention:r.retention}),{ok:true,entry:c,historyPath:p}}function l(r){let t=r.trim();if(!t)return null;try{return JSON.parse(t)}catch{return null}}async function h(){let r=[];for await(let t of process.stdin)r.push(typeof t=="string"?Buffer.from(t):t);return Buffer.concat(r).toString("utf8")}export{l as parseFeedbackStdinPayload,h as readStdinAll,m as recordWorkspaceFeedback};
@@ -1 +1 @@
1
- import {b}from'./chunk-BSRVO52Y.js';import {a}from'./chunk-GSWPGELT.js';import c from'path';import u from'fs-extra';async function W(t,r){let o=await a(t),d=o?.name||c.basename(t),n,i=c.join(t,".python-version");if(await u.pathExists(i)){let a=(await u.readFile(i,"utf-8")).trim();a&&(n=a);}let e=r?.profile||"polyglot",m=e==="python-only"||e==="polyglot"||e==="enterprise",f=r?.installMethod||o?.metadata?.npm?.installMethod||(m?"poetry":"venv"),s=await b(t,{workspaceName:d,installMethod:f,pythonVersion:n,profile:e,writeMarker:true,writeGitignore:true,onlyIfMissing:!r?.force}),{publishWorkspaceRegistrySummary:y}=await import('./workspace-registry-summary-A3YDL63D.js');return await y(t),{workspacePath:t,created:s,status:s.length>0?"passed":"skipped"}}export{W as ensureWorkspaceFoundation};
1
+ import {b}from'./chunk-I46XEIPL.js';import {a}from'./chunk-GSWPGELT.js';import c from'path';import u from'fs-extra';async function W(t,r){let o=await a(t),d=o?.name||c.basename(t),n,i=c.join(t,".python-version");if(await u.pathExists(i)){let a=(await u.readFile(i,"utf-8")).trim();a&&(n=a);}let e=r?.profile||"polyglot",m=e==="python-only"||e==="polyglot"||e==="enterprise",f=r?.installMethod||o?.metadata?.npm?.installMethod||(m?"poetry":"venv"),s=await b(t,{workspaceName:d,installMethod:f,pythonVersion:n,profile:e,writeMarker:true,writeGitignore:true,onlyIfMissing:!r?.force}),{publishWorkspaceRegistrySummary:y}=await import('./workspace-registry-summary-ORDK7A36.js');return await y(t),{workspacePath:t,created:s,status:s.length>0?"passed":"skipped"}}export{W as ensureWorkspaceFoundation};
@@ -1 +1 @@
1
- export{c as DEFAULT_HISTORY_RETENTION,b as WORKSPACE_HISTORY_PATH,a as WORKSPACE_HISTORY_SCHEMA_VERSION,i as appendHistoryEntry,f as historyEntryFromAgentAction,g as historyEntryFromDoctorFixResult,e as historyEntryFromVerify,d as normalizeHistoryEntry,h as readWorkspaceHistory,j as recordWorkspaceHistory}from'./chunk-76YOPAOT.js';
1
+ export{c as DEFAULT_HISTORY_RETENTION,b as WORKSPACE_HISTORY_PATH,a as WORKSPACE_HISTORY_SCHEMA_VERSION,i as appendHistoryEntry,f as historyEntryFromAgentAction,g as historyEntryFromDoctorFixResult,e as historyEntryFromVerify,d as normalizeHistoryEntry,h as readWorkspaceHistory,j as recordWorkspaceHistory}from'./chunk-ESLPI3XZ.js';
@@ -1 +1 @@
1
- export{g as WORKSPACE_IMPACT_REPORT_PATH,f as WORKSPACE_IMPACT_SCHEMA_VERSION,e as WORKSPACE_MODEL_DIFF_REPORT_PATH,c as WORKSPACE_MODEL_DIFF_SCHEMA_VERSION,d as WORKSPACE_MODEL_SNAPSHOT_REPORT_PATH,b as WORKSPACE_MODEL_SNAPSHOT_SCHEMA_VERSION,o as buildWorkspaceImpact,j as buildWorkspaceModelSnapshot,l as diffWorkspaceModel,h as isGitDiffSource,i as parseGitDiffRef,n as workspaceVerificationPlan,p as writeWorkspaceImpact,m as writeWorkspaceModelDiff,k as writeWorkspaceModelSnapshot}from'./chunk-NOFM7MNA.js';export{d as hashWorkspaceModel}from'./chunk-OA537ZQ5.js';
1
+ export{g as WORKSPACE_IMPACT_REPORT_PATH,f as WORKSPACE_IMPACT_SCHEMA_VERSION,e as WORKSPACE_MODEL_DIFF_REPORT_PATH,c as WORKSPACE_MODEL_DIFF_SCHEMA_VERSION,d as WORKSPACE_MODEL_SNAPSHOT_REPORT_PATH,b as WORKSPACE_MODEL_SNAPSHOT_SCHEMA_VERSION,o as buildWorkspaceImpact,j as buildWorkspaceModelSnapshot,l as diffWorkspaceModel,h as isGitDiffSource,i as parseGitDiffRef,n as workspaceVerificationPlan,p as writeWorkspaceImpact,m as writeWorkspaceModelDiff,k as writeWorkspaceModelSnapshot}from'./chunk-AFL3ACCR.js';export{d as hashWorkspaceModel}from'./chunk-OA537ZQ5.js';
@@ -0,0 +1 @@
1
+ import {a as a$2,b as b$1,c,d as d$1}from'./chunk-3VFA7D5T.js';import {a as a$1}from'./chunk-KB44JP4M.js';import {a}from'./chunk-BMWFQXGW.js';import d from'crypto';import s from'path';import {open,unlink,stat}from'fs/promises';import u from'fs-extra';var k=a.evaluationLive,O=a.evaluationLastRun,W="contracts/workspace-intelligence/model-usage-event.v1.json",E="contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json",P="contracts/workspace-intelligence/workspace-intelligence-evaluation-comparison.v1.json",_=3e4,N=100,b=25;function C(){return {modelCalls:0,toolCalls:0,tokenSources:{providerReported:0,tokenizerCounted:0,estimated:0,unavailable:0},tokens:{input:0,output:0,cachedInput:0,reasoning:0,observedTotal:0},latencyMs:0,costs:[],outcome:{status:"unknown",verified:false,blockersResolved:0},efficiency:{tokensPerVerifiedOutcome:null,noProgressDecisions:0,repeatedArtifactReads:0}}}function m(t){return t??0}function S(t){let e=C(),a=new Map,n=new Map;for(let o of t){if(o.kind==="model-call"){e.modelCalls+=1;let r={"provider-reported":"providerReported","tokenizer-counted":"tokenizerCounted",estimated:"estimated",unavailable:"unavailable"}[o.modelCall.source];if(e.tokenSources[r]+=1,e.tokens.input+=m(o.modelCall.inputTokens),e.tokens.output+=m(o.modelCall.outputTokens),e.tokens.cachedInput+=m(o.modelCall.cachedInputTokens),e.tokens.reasoning+=m(o.modelCall.reasoningTokens),e.latencyMs+=o.modelCall.latencyMs??0,o.modelCall.cost){let i=o.modelCall.cost.currency.toUpperCase(),l=n.get(i)??{currency:i,amount:0,providerReported:0,estimated:0};l.amount+=o.modelCall.cost.amount,o.modelCall.cost.source==="provider-reported"?l.providerReported+=o.modelCall.cost.amount:l.estimated+=o.modelCall.cost.amount,n.set(i,l);}continue}if(o.kind==="tool-call"){e.toolCalls+=1,e.latencyMs+=o.toolCall.durationMs??0,!o.toolCall.changedSource&&o.toolCall.result==="passed"&&(e.efficiency.noProgressDecisions+=1),o.toolCall.artifact&&a.set(o.toolCall.artifact,(a.get(o.toolCall.artifact)??0)+1);continue}o.kind==="outcome"&&(e.outcome={status:o.outcome.status,verified:o.outcome.verified,blockersResolved:o.outcome.blockersResolved});}return e.tokens.observedTotal=e.tokens.input+e.tokens.output,e.costs=[...n.values()].map(o=>({...o,amount:Number(o.amount.toFixed(8)),providerReported:Number(o.providerReported.toFixed(8)),estimated:Number(o.estimated.toFixed(8))})).sort((o,r)=>o.currency.localeCompare(r.currency)),e.efficiency.repeatedArtifactReads=[...a.values()].reduce((o,r)=>o+Math.max(0,r-1),0),e.efficiency.tokensPerVerifiedOutcome=e.outcome.verified&&e.outcome.status==="passed"?e.tokens.observedTotal:null,e}function x(t,e=new Date){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Evaluation event must be a JSON object.");let a=t,n={...a,schemaVersion:a$2,eventId:typeof a.eventId=="string"&&a.eventId.trim()?a.eventId.trim():d.randomUUID(),recordedAt:typeof a.recordedAt=="string"&&a.recordedAt.trim()?a.recordedAt:e.toISOString()};a$1(n,W,"workspace evaluation event");let o={"model-call":"modelCall","tool-call":"toolCall",outcome:"outcome",milestone:"milestone"}[n.kind],r=["modelCall","toolCall","outcome","milestone"].filter(i=>a[i]!==void 0);if(r.length!==1||r[0]!==o)throw new Error(`Evaluation event kind ${n.kind} requires only ${o}.`);if(n.kind==="model-call"&&n.modelCall.source!=="unavailable"&&n.modelCall.inputTokens===null&&n.modelCall.outputTokens===null)throw new Error("Measured model calls require at least one input or output token count.");return n}function J(t){let e=t.now??new Date,a=s.resolve(t.workspacePath),n={schemaVersion:b$1,runId:t.runId??d.randomUUID(),sessionId:t.sessionId??d.randomUUID(),status:"live",startedAt:e.toISOString(),updatedAt:e.toISOString(),workspace:{name:t.workspaceName?.trim()||s.basename(a),path:a},configuration:{taskId:t.taskId.trim(),strategy:t.strategy??"workspace-intelligence",...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{},...t.temperature!==void 0?{temperature:t.temperature}:{},...t.baselineRunId?{baselineRunId:t.baselineRunId}:{}},methodology:{id:"provider-usage-and-verified-outcome.v1",claimBoundary:"Provider-reported and tokenizer-counted values are measured; estimated values remain explicitly labelled. Verified task success is required before reporting tokens per successful outcome."},events:[],summary:C()};return a$1(n,E,"workspace evaluation"),n}async function L(t,e){await u.ensureDir(s.dirname(t));let a=`${t}.${process.pid}.${d.randomUUID()}.tmp`;try{await u.writeJson(a,e,{spaces:2}),await u.rename(a,t);}finally{await u.remove(a).catch(()=>{});}}async function A(t,e){let a=s.join(s.resolve(t),`${k}.lock`);await u.ensureDir(s.dirname(a));for(let n=0;n<N;n+=1)try{let o=await open(a,"wx");try{return await o.writeFile(JSON.stringify({pid:process.pid,acquiredAt:new Date().toISOString()})),await e()}finally{await o.close(),await unlink(a).catch(()=>{});}}catch(o){if(o.code!=="EEXIST")throw o;let i=await stat(a).catch(()=>null);if(i&&Date.now()-i.mtimeMs>_){await unlink(a).catch(()=>{});continue}await new Promise(l=>setTimeout(l,b));}throw new Error("Timed out waiting for the workspace evaluation writer lock.")}async function v(t,e,a=k){let n=s.join(s.resolve(t),a);return a$1(e,E,a),await L(n,e),n}async function T(t,e=k){let a=s.isAbsolute(e)?e:s.join(s.resolve(t),e),n=await u.readJson(a);return a$1(n,E,a),n}async function G(t){return A(t.workspacePath,async()=>{let e=await T(t.workspacePath);if(e.status!=="live")throw new Error(`Evaluation ${e.runId} is ${e.status}; initialize a new run.`);let a=x(t.payload,t.now);if(e.events.some(o=>o.eventId===a.eventId))return e;let n={...e,updatedAt:(t.now??new Date).toISOString(),events:[...e.events,a],summary:S([...e.events,a])};return await v(t.workspacePath,n),n})}async function H(t){return A(t.workspacePath,async()=>{let e=await T(t.workspacePath),a=(t.now??new Date).toISOString(),n={...e,status:t.status??"completed",updatedAt:a,completedAt:a,summary:S(e.events)},o=await v(t.workspacePath,n,O);return await v(t.workspacePath,n),{report:n,outputPath:o}})}function q(t,e){let a=t.summary.tokens.observedTotal,n=e.summary.tokens.observedTotal,o=a-n,r={schemaVersion:c,generatedAt:new Date().toISOString(),taskAligned:t.configuration.taskId===e.configuration.taskId,current:{runId:t.runId,strategy:t.configuration.strategy,tokens:a,verified:t.summary.outcome.verified,status:t.summary.outcome.status},baseline:{runId:e.runId,strategy:e.configuration.strategy,tokens:n,verified:e.summary.outcome.verified,status:e.summary.outcome.status},delta:{tokens:o,reductionPercent:n===0?null:Number((-o/n*100).toFixed(2)),modelCalls:t.summary.modelCalls-e.summary.modelCalls,toolCalls:t.summary.toolCalls-e.summary.toolCalls,latencyMs:Number((t.summary.latencyMs-e.summary.latencyMs).toFixed(2))},comparableOutcome:t.summary.outcome.verified&&e.summary.outcome.verified&&t.summary.outcome.status===e.summary.outcome.status};return a$1(r,P,"workspace evaluation comparison"),r}function B(){if(d$1.length!==4)throw new Error("Model usage source taxonomy is incomplete.")}export{O as WORKSPACE_EVALUATION_LAST_RUN_PATH,k as WORKSPACE_EVALUATION_LIVE_PATH,G as appendWorkspaceEvaluationEvent,B as assertWorkspaceEvaluationSourceTaxonomy,q as compareWorkspaceEvaluations,J as createWorkspaceEvaluation,H as finalizeWorkspaceEvaluation,x as normalizeWorkspaceEvaluationEvent,T as readWorkspaceEvaluation,S as summarizeWorkspaceEvaluation,v as writeWorkspaceEvaluation};
@@ -1 +1 @@
1
- import {b as b$1,c}from'./chunk-CW7PGBIQ.js';import {a as a$2}from'./chunk-PBHP6JNY.js';import {q}from'./chunk-MEMHNE7Y.js';import {d}from'./chunk-VBSQ7MF6.js';import {a as a$3}from'./chunk-6SWRNA47.js';import {k as k$2}from'./chunk-TNQI5VCW.js';import {a as a$1,e as e$2,f as f$1}from'./chunk-NRYS4CLR.js';import {f,g,h as h$1}from'./chunk-ZM5NQ5Z2.js';import {j,k as k$1,l as l$1,m,o,p}from'./chunk-NOFM7MNA.js';import {k,n}from'./chunk-ZDN7RHXJ.js';import {j as j$1,e as e$1}from'./chunk-76YOPAOT.js';import {l,o as o$1,p as p$1}from'./chunk-22NJ2ZMG.js';import {e}from'./chunk-2TEDAKP6.js';import {b as b$2}from'./chunk-YCL3I2JO.js';import {a,b,h,i,g as g$1,f as f$2}from'./chunk-LNRAB7UY.js';import se from'path';import ce from'fs-extra';function r(a,t){if(!a)throw new Error(`Workspace Intelligence run semantic violation: ${t}`)}function ee(a,t){return a.length===t.length&&a.every((d,l)=>d===t[l])}function te(a$2){b$2(a.intelligenceRun,a$2,"Workspace Intelligence run report"),r(a$2.chainSchemaVersion===a$1,`chainSchemaVersion must be ${a$1}`),r(a$2.artifactPath===a.intelligenceRun,`artifactPath must be ${a.intelligenceRun}`),r(a$2.preflight.length===g$1.length,`preflight must contain exactly ${g$1.length} entries`);for(let[o,i]of g$1.entries()){let s=a$2.preflight[o];r(s?.id===i,`preflight[${o}].id must be ${i}`),r(ee(s.artifacts,h[i]),`${i} preflight artifacts must match the runtime registry`),i==="sync"?r(s.status==="passed"&&s.result==="synchronized"||s.status==="failed"&&s.result==="failed","sync preflight status and result are incoherent"):r(s.status==="passed"&&(s.result==="created"||s.result==="reused")||s.status==="failed"&&s.result==="failed"||s.status==="skipped"&&s.result==="skipped","baseline preflight status and result are incoherent");}let t=a$2.preflight[1];r(a$2.baselineCreated===(t?.result==="created"),"baselineCreated must match the baseline preflight result"),r(a$2.stages.length===f$2.length,`stages must contain exactly ${f$2.length} canonical steps`);let d=a$2.preflight[0],l=d?.status==="failed";for(let[o,i$1]of f$2.entries()){let s=a$2.stages[o];r(s?.id===i$1,`stages[${o}].id must be ${i$1}`),r(ee(s.artifacts,i[i$1].produces),`${i$1} artifacts must match the runtime registry`),l&&r(s.status==="skipped",`${i$1} must be skipped after a hard failure`),s.status==="passed"?r(s.exitCode===0,`${i$1} passed stage must have exitCode 0`):s.status==="blocked"?r(s.exitCode!==0,`${i$1} blocked stage must have a non-zero exitCode`):s.status==="failed"?(r(s.exitCode===1,`${i$1} failed stage must have exitCode 1`),l=true):(r(s.exitCode===0,`${i$1} skipped stage must have exitCode 0`),r(s.durationMs===0,`${i$1} skipped stage must have durationMs 0`)),o===0&&((d?.status==="failed"||s.status==="failed")&&r(t?.status==="skipped","baseline must be skipped when sync or model fails"),t?.status==="skipped"&&r(d?.status==="failed"||s.status==="failed"||s.status==="skipped","baseline may be skipped only after an upstream failure"),t?.status!=="passed"&&(l=true));}let m=a$2.preflight.some(o=>o.status==="failed")||a$2.stages.some(o=>o.status==="failed"),E=a$2.stages.some(o=>o.status==="blocked"),n=m?"failed":E?"blocked":"passed",u=n==="failed"?1:n==="blocked"?2:0;r(a$2.status===n,`status must be ${n}`),r(a$2.exitCode===u,`exitCode must be ${u}`);}var le=a.intelligenceRun,de=b.intelligenceRun,ae=le;async function $e(a$4){let t=se.resolve(a$4.workspacePath),d$1=[],l$2=[],m$1=false,E=async(e,p)=>{let f=[...h[e]];if(m$1){d$1.push({id:e,status:"skipped",result:"skipped",durationMs:0,artifacts:f,message:"skipped because a required upstream operation failed"});return}let k=Date.now();try{let c=await p();d$1.push({id:e,status:"passed",result:c.result,durationMs:Date.now()-k,artifacts:f,message:c.message});}catch(c){m$1=true,d$1.push({id:e,status:"failed",result:"failed",durationMs:Date.now()-k,artifacts:f,message:c instanceof Error?c.message:String(c)});}},n$1=async(e,p)=>{let f=[...i[e].produces];if(m$1){l$2.push({id:e,status:"skipped",durationMs:0,artifacts:f,exitCode:0,message:"skipped because a required upstream stage failed"});return}let k=Date.now();try{let c=await p(),b=c.exitCode??0;l$2.push({id:e,status:c.blocked||b!==0?"blocked":"passed",durationMs:Date.now()-k,artifacts:f,exitCode:b,message:c.message});}catch(c){m$1=true,l$2.push({id:e,status:"failed",durationMs:Date.now()-k,artifacts:f,exitCode:1,message:c instanceof Error?c.message:String(c)});}};await E("sync",async()=>{let e=await d(t,true),p=await l({workspacePath:t});return {result:"synchronized",message:`registry ${e.added.length} added/${e.skipped} existing; contract ${p.contract.projects.length} projects`}});let u,o$2=()=>{if(!u)throw new Error("canonical workspace model is unavailable");return u};await n$1("model",async()=>(u=await k({workspacePath:t,includeEvidence:true}),await n(u,t),{message:`${u.summary.projectCount} projects modeled`}));let i$1=se.join(t,a.snapshot),s=false;await E("baseline",async()=>{if(!await ce.pathExists(i$1)){let e=await j({workspacePath:t,model:o$2()});return await k$1(e,t),s=true,{result:"created",message:"initial structural baseline created"}}return {result:"reused",message:"existing structural baseline reused"}}),await n$1("diff",async()=>{let e=await l$1({workspacePath:t,fromPath:a.snapshot,model:o$2()});return await m(e,t),{message:e.summary.changed?"workspace changes detected":"no workspace changes"}}),await n$1("impact",async()=>{let e=await o({workspacePath:t,fromPath:a.diff});return await p(e,t),{message:`${e.summary.risk} risk; ${e.summary.affectedProjects} affected`}}),await n$1("doctor-evidence",async()=>{let e=await q({workspace:t,json:true,quiet:true});return {exitCode:e,blocked:e!==0,message:`doctor exit ${e}`}}),await n$1("contract-evidence",async()=>{let e=await o$1({workspacePath:t,strict:true});return await p$1({workspacePath:t,result:e}),{exitCode:e.status==="passed"?0:1,blocked:e.status!=="passed",message:`contract ${e.status}`}}),await n$1("analyze-evidence",async()=>{let e=await a$2({workspacePath:t,json:true,strict:false});return {blocked:e.summary.verdict==="blocked"||a$4.strict===true&&e.summary.verdict==="needs-attention",exitCode:e.summary.verdict==="blocked"||a$4.strict===true&&e.summary.verdict==="needs-attention"?1:0,message:`analyze ${e.summary.verdict} (${e.summary.score}/100)`}}),await n$1("readiness-evidence",async()=>{let e=await a$3({startPath:t,writeReport:true,skipVerify:true});return {blocked:e.overallStatus==="fail"||a$4.strict===true&&e.overallStatus==="warn",exitCode:e.overallStatus==="fail"||a$4.strict===true&&e.overallStatus==="warn"?1:0,message:`pre-verify readiness ${e.overallStatus}`}}),await n$1("verify",async()=>{let e=await f({workspacePath:t,fromImpactPath:a.impact});await g(e,t);let p=h$1(e,{strict:a$4.strict===true});return await j$1(t,e$1(e,p.passed)),{blocked:!p.passed,exitCode:p.exitCode,message:`${e.summary.verdict}; gate ${p.passed?"passed":"blocked"}`}}),await n$1("context",async()=>{u=await k({workspacePath:t,includeEvidence:true});let e=await e$2({workspacePath:t,model:u,agent:a$4.agent??"generic",includeEvidence:true});return await f$1(e,t),{message:`context grounded for ${e.agent}`}}),await n$1("agent-sync",async()=>({message:`${(await k$2({workspacePath:t,agent:a$4.agent??"generic",write:true,refreshContext:false,strict:false,preset:"enterprise"})).writtenFiles.length} grounding files written`})),await n$1("explain",async()=>{let e=await b$1({workspacePath:t,target:{kind:"release-blocked"}});return await c(e,t),{message:e.summary}});let re=l$2.some(e=>e.status==="blocked"),W=m$1?"failed":re?"blocked":"passed",ie=m$1?1:W==="blocked"?2:0,R={schemaVersion:de,chainSchemaVersion:a$1,generatedAt:new Date().toISOString(),workspacePath:t,baselineCreated:s,preflight:d$1,status:W,exitCode:ie,stages:l$2,artifactPath:ae};return te(R),await e(t,ae,R),R}export{le as WORKSPACE_INTELLIGENCE_RUN_REPORT_PATH,de as WORKSPACE_INTELLIGENCE_RUN_SCHEMA_VERSION,$e as runWorkspaceIntelligenceChain};
1
+ import {b as b$1,c}from'./chunk-4HDYADHT.js';import {a as a$2}from'./chunk-54EP5CEV.js';import {q}from'./chunk-BFLJ2R4D.js';import {d}from'./chunk-Y5UJLPS4.js';import {a as a$3}from'./chunk-BGPXQQNY.js';import {k as k$2}from'./chunk-HZDXO65G.js';import {a as a$1,e as e$2,f as f$1}from'./chunk-LHOZXC2M.js';import {f,g,h as h$1}from'./chunk-OW42TZFB.js';import {j,k as k$1,l as l$1,m,o,p}from'./chunk-AFL3ACCR.js';import {k,n}from'./chunk-37CVKXBD.js';import {j as j$1,e as e$1}from'./chunk-ESLPI3XZ.js';import {l,o as o$1,p as p$1}from'./chunk-T4YR4RAI.js';import {e}from'./chunk-32OJDBIG.js';import {b as b$2}from'./chunk-3NU32T4A.js';import {a,b,h,i,g as g$1,f as f$2}from'./chunk-BMWFQXGW.js';import se from'path';import ce from'fs-extra';function r(a,t){if(!a)throw new Error(`Workspace Intelligence run semantic violation: ${t}`)}function ee(a,t){return a.length===t.length&&a.every((d,l)=>d===t[l])}function te(a$2){b$2(a.intelligenceRun,a$2,"Workspace Intelligence run report"),r(a$2.chainSchemaVersion===a$1,`chainSchemaVersion must be ${a$1}`),r(a$2.artifactPath===a.intelligenceRun,`artifactPath must be ${a.intelligenceRun}`),r(a$2.preflight.length===g$1.length,`preflight must contain exactly ${g$1.length} entries`);for(let[o,i]of g$1.entries()){let s=a$2.preflight[o];r(s?.id===i,`preflight[${o}].id must be ${i}`),r(ee(s.artifacts,h[i]),`${i} preflight artifacts must match the runtime registry`),i==="sync"?r(s.status==="passed"&&s.result==="synchronized"||s.status==="failed"&&s.result==="failed","sync preflight status and result are incoherent"):r(s.status==="passed"&&(s.result==="created"||s.result==="reused")||s.status==="failed"&&s.result==="failed"||s.status==="skipped"&&s.result==="skipped","baseline preflight status and result are incoherent");}let t=a$2.preflight[1];r(a$2.baselineCreated===(t?.result==="created"),"baselineCreated must match the baseline preflight result"),r(a$2.stages.length===f$2.length,`stages must contain exactly ${f$2.length} canonical steps`);let d=a$2.preflight[0],l=d?.status==="failed";for(let[o,i$1]of f$2.entries()){let s=a$2.stages[o];r(s?.id===i$1,`stages[${o}].id must be ${i$1}`),r(ee(s.artifacts,i[i$1].produces),`${i$1} artifacts must match the runtime registry`),l&&r(s.status==="skipped",`${i$1} must be skipped after a hard failure`),s.status==="passed"?r(s.exitCode===0,`${i$1} passed stage must have exitCode 0`):s.status==="blocked"?r(s.exitCode!==0,`${i$1} blocked stage must have a non-zero exitCode`):s.status==="failed"?(r(s.exitCode===1,`${i$1} failed stage must have exitCode 1`),l=true):(r(s.exitCode===0,`${i$1} skipped stage must have exitCode 0`),r(s.durationMs===0,`${i$1} skipped stage must have durationMs 0`)),o===0&&((d?.status==="failed"||s.status==="failed")&&r(t?.status==="skipped","baseline must be skipped when sync or model fails"),t?.status==="skipped"&&r(d?.status==="failed"||s.status==="failed"||s.status==="skipped","baseline may be skipped only after an upstream failure"),t?.status!=="passed"&&(l=true));}let m=a$2.preflight.some(o=>o.status==="failed")||a$2.stages.some(o=>o.status==="failed"),E=a$2.stages.some(o=>o.status==="blocked"),n=m?"failed":E?"blocked":"passed",u=n==="failed"?1:n==="blocked"?2:0;r(a$2.status===n,`status must be ${n}`),r(a$2.exitCode===u,`exitCode must be ${u}`);}var le=a.intelligenceRun,de=b.intelligenceRun,ae=le;async function $e(a$4){let t=se.resolve(a$4.workspacePath),d$1=[],l$2=[],m$1=false,E=async(e,p)=>{let f=[...h[e]];if(m$1){d$1.push({id:e,status:"skipped",result:"skipped",durationMs:0,artifacts:f,message:"skipped because a required upstream operation failed"});return}let k=Date.now();try{let c=await p();d$1.push({id:e,status:"passed",result:c.result,durationMs:Date.now()-k,artifacts:f,message:c.message});}catch(c){m$1=true,d$1.push({id:e,status:"failed",result:"failed",durationMs:Date.now()-k,artifacts:f,message:c instanceof Error?c.message:String(c)});}},n$1=async(e,p)=>{let f=[...i[e].produces];if(m$1){l$2.push({id:e,status:"skipped",durationMs:0,artifacts:f,exitCode:0,message:"skipped because a required upstream stage failed"});return}let k=Date.now();try{let c=await p(),b=c.exitCode??0;l$2.push({id:e,status:c.blocked||b!==0?"blocked":"passed",durationMs:Date.now()-k,artifacts:f,exitCode:b,message:c.message});}catch(c){m$1=true,l$2.push({id:e,status:"failed",durationMs:Date.now()-k,artifacts:f,exitCode:1,message:c instanceof Error?c.message:String(c)});}};await E("sync",async()=>{let e=await d(t,true),p=await l({workspacePath:t});return {result:"synchronized",message:`registry ${e.added.length} added/${e.skipped} existing; contract ${p.contract.projects.length} projects`}});let u,o$2=()=>{if(!u)throw new Error("canonical workspace model is unavailable");return u};await n$1("model",async()=>(u=await k({workspacePath:t,includeEvidence:true}),await n(u,t),{message:`${u.summary.projectCount} projects modeled`}));let i$1=se.join(t,a.snapshot),s=false;await E("baseline",async()=>{if(!await ce.pathExists(i$1)){let e=await j({workspacePath:t,model:o$2()});return await k$1(e,t),s=true,{result:"created",message:"initial structural baseline created"}}return {result:"reused",message:"existing structural baseline reused"}}),await n$1("diff",async()=>{let e=await l$1({workspacePath:t,fromPath:a.snapshot,model:o$2()});return await m(e,t),{message:e.summary.changed?"workspace changes detected":"no workspace changes"}}),await n$1("impact",async()=>{let e=await o({workspacePath:t,fromPath:a.diff});return await p(e,t),{message:`${e.summary.risk} risk; ${e.summary.affectedProjects} affected`}}),await n$1("doctor-evidence",async()=>{let e=await q({workspace:t,json:true,quiet:true});return {exitCode:e,blocked:e!==0,message:`doctor exit ${e}`}}),await n$1("contract-evidence",async()=>{let e=await o$1({workspacePath:t,strict:true});return await p$1({workspacePath:t,result:e}),{exitCode:e.status==="passed"?0:1,blocked:e.status!=="passed",message:`contract ${e.status}`}}),await n$1("analyze-evidence",async()=>{let e=await a$2({workspacePath:t,json:true,strict:false});return {blocked:e.summary.verdict==="blocked"||a$4.strict===true&&e.summary.verdict==="needs-attention",exitCode:e.summary.verdict==="blocked"||a$4.strict===true&&e.summary.verdict==="needs-attention"?1:0,message:`analyze ${e.summary.verdict} (${e.summary.score}/100)`}}),await n$1("readiness-evidence",async()=>{let e=await a$3({startPath:t,writeReport:true,skipVerify:true});return {blocked:e.overallStatus==="fail"||a$4.strict===true&&e.overallStatus==="warn",exitCode:e.overallStatus==="fail"||a$4.strict===true&&e.overallStatus==="warn"?1:0,message:`pre-verify readiness ${e.overallStatus}`}}),await n$1("verify",async()=>{let e=await f({workspacePath:t,fromImpactPath:a.impact});await g(e,t);let p=h$1(e,{strict:a$4.strict===true});return await j$1(t,e$1(e,p.passed)),{blocked:!p.passed,exitCode:p.exitCode,message:`${e.summary.verdict}; gate ${p.passed?"passed":"blocked"}`}}),await n$1("context",async()=>{u=await k({workspacePath:t,includeEvidence:true});let e=await e$2({workspacePath:t,model:u,agent:a$4.agent??"generic",includeEvidence:true});return await f$1(e,t),{message:`context grounded for ${e.agent}`}}),await n$1("agent-sync",async()=>({message:`${(await k$2({workspacePath:t,agent:a$4.agent??"generic",write:true,refreshContext:false,strict:false,preset:"enterprise"})).writtenFiles.length} grounding files written`})),await n$1("explain",async()=>{let e=await b$1({workspacePath:t,target:{kind:"release-blocked"}});return await c(e,t),{message:e.summary}});let re=l$2.some(e=>e.status==="blocked"),W=m$1?"failed":re?"blocked":"passed",ie=m$1?1:W==="blocked"?2:0,R={schemaVersion:de,chainSchemaVersion:a$1,generatedAt:new Date().toISOString(),workspacePath:t,baselineCreated:s,preflight:d$1,status:W,exitCode:ie,stages:l$2,artifactPath:ae};return te(R),await e(t,ae,R),R}export{le as WORKSPACE_INTELLIGENCE_RUN_REPORT_PATH,de as WORKSPACE_INTELLIGENCE_RUN_SCHEMA_VERSION,$e as runWorkspaceIntelligenceChain};
@@ -1 +1 @@
1
- export{b as WORKSPACE_KNOWLEDGE_GRAPH_REPORT_PATH,c as assertWorkspaceKnowledgeGraphSourceBinding,d as buildWorkspaceKnowledgeGraph,e as knowledgeEntityId}from'./chunk-RWRLFSKW.js';
1
+ export{b as WORKSPACE_KNOWLEDGE_GRAPH_REPORT_PATH,c as assertWorkspaceKnowledgeGraphSourceBinding,d as buildWorkspaceKnowledgeGraph,e as knowledgeEntityId}from'./chunk-NAJCUQ4X.js';
@@ -0,0 +1,10 @@
1
+ function r(t){return String(t).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function s(t){return Array.isArray(t)?JSON.stringify(t):String(t??"")}function l(t){let o=new Map(t.entities.map(e=>[e.id,e])),d={"@context":{wsp:"https://workspai.dev/ns/workspace#",id:"@id",type:"@type",label:"https://www.w3.org/2000/01/rdf-schema#label",from:{"@id":"wsp:from","@type":"@id"},to:{"@id":"wsp:to","@type":"@id"},proof:{"@id":"wsp:proof","@type":"@id"}},"@id":`urn:workspai:workspace:${encodeURIComponent(t.workspace.name)}`,"@type":"wsp:WorkspaceKnowledgeGraph",generatedAt:t.generatedAt,sourceHash:t.source.hash,"@graph":[...t.entities.map(e=>({"@id":`urn:workspai:entity:${encodeURIComponent(e.id)}`,"@type":`wsp:${e.kind}`,label:e.label,...e.projectId?{projectId:e.projectId}:{},identityKey:e.identity.key,attributes:e.attributes,proof:e.proofIds.map(n=>`urn:workspai:proof:${encodeURIComponent(n)}`)})),...t.relations.map(e=>({"@id":`urn:workspai:relation:${encodeURIComponent(e.id)}`,"@type":`wsp:${e.kind}`,from:`urn:workspai:entity:${encodeURIComponent(e.from)}`,to:`urn:workspai:entity:${encodeURIComponent(e.to)}`,fromLabel:o.get(e.from)?.label??e.from,toLabel:o.get(e.to)?.label??e.to,derivation:e.derivation,trust:e.trust,confidence:e.confidence,proof:e.proofIds.map(n=>`urn:workspai:proof:${encodeURIComponent(n)}`)})),...t.proofs.map(e=>({"@id":`urn:workspai:proof:${encodeURIComponent(e.id)}`,"@type":"wsp:Evidence",provider:e.provider,artifact:e.artifact,...e.pointer?{pointer:e.pointer}:{},derivation:e.derivation,trust:e.trust,confidence:e.confidence,freshness:e.freshness}))]};return JSON.stringify(d,null,2)}function g(t){let o=t.entities.map(e=>{let n=Object.entries(e.attributes).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>` <data key="attributes">${r(`${a}=${s(i)}`)}</data>`).join(`
2
+ `);return [` <node id="${r(e.id)}">`,` <data key="kind">${r(e.kind)}</data>`,` <data key="label">${r(e.label)}</data>`,...e.projectId?[` <data key="projectId">${r(e.projectId)}</data>`]:[],...n?[n]:[]," </node>"].join(`
3
+ `)}).join(`
4
+ `),d=t.relations.map(e=>[` <edge id="${r(e.id)}" source="${r(e.from)}" target="${r(e.to)}">`,` <data key="relationKind">${r(e.kind)}</data>`,` <data key="trust">${r(e.trust)}</data>`,` <data key="confidence">${r(e.confidence)}</data>`," </edge>"].join(`
5
+ `)).join(`
6
+ `);return ['<?xml version="1.0" encoding="UTF-8"?>','<graphml xmlns="http://graphml.graphdrawing.org/xmlns">',' <key id="kind" for="node" attr.name="kind" attr.type="string"/>',' <key id="label" for="node" attr.name="label" attr.type="string"/>',' <key id="projectId" for="node" attr.name="projectId" attr.type="string"/>',' <key id="attributes" for="node" attr.name="attributes" attr.type="string"/>',' <key id="relationKind" for="edge" attr.name="kind" attr.type="string"/>',' <key id="trust" for="edge" attr.name="trust" attr.type="string"/>',' <key id="confidence" for="edge" attr.name="confidence" attr.type="string"/>',` <graph id="${r(t.workspace.name)}" edgedefault="directed">`,o,d," </graph>","</graphml>"].join(`
7
+ `)}function m(t){let o=t.entities.map(e=>` <node id="${r(e.id)}" label="${r(e.label)}"><attvalues><attvalue for="0" value="${r(e.kind)}"/><attvalue for="1" value="${r(e.projectId??"")}"/></attvalues></node>`).join(`
8
+ `),d=t.relations.map((e,n)=>` <edge id="${n}" source="${r(e.from)}" target="${r(e.to)}" label="${r(e.kind)}" weight="${e.confidence==="high"?1:e.confidence==="medium"?.66:.33}"/>`).join(`
9
+ `);return ['<?xml version="1.0" encoding="UTF-8"?>','<gexf xmlns="http://gexf.net/1.3" version="1.3">',` <meta lastmodifieddate="${r(t.generatedAt.slice(0,10))}"><creator>Workspai</creator><description>${r(t.workspace.name)} evidence-backed workspace graph</description></meta>`,' <graph mode="static" defaultedgetype="directed">',' <attributes class="node"><attribute id="0" title="kind" type="string"/><attribute id="1" title="projectId" type="string"/></attributes>'," <nodes>",o," </nodes>"," <edges>",d," </edges>"," </graph>","</gexf>"].join(`
10
+ `)}export{m as renderWorkspaceKnowledgeGraphGexf,g as renderWorkspaceKnowledgeGraphGraphMl,l as renderWorkspaceKnowledgeGraphJsonLd};
@@ -0,0 +1,3 @@
1
+ import {b}from'./chunk-4HDYADHT.js';import {d,c as c$2,f,e as e$1}from'./chunk-WDKNMTJQ.js';import {c as c$1,e}from'./chunk-VU7NZHPM.js';import {c as c$4,b as b$1}from'./chunk-CRHYBQI3.js';import {d as d$2}from'./chunk-LHOZXC2M.js';import {d as d$3}from'./chunk-OW42TZFB.js';import {h}from'./chunk-37CVKXBD.js';import {c as c$3}from'./chunk-NAJCUQ4X.js';import {e as e$2}from'./chunk-T4YR4RAI.js';import {d as d$1}from'./chunk-32OJDBIG.js';import {a as a$2}from'./chunk-KB44JP4M.js';import {a as a$1,c}from'./chunk-BMWFQXGW.js';import {r}from'./chunk-5XATWNME.js';import u from'path';import N from'readline';import g from'fs-extra';var L=a$1.agentIndex,q=new Map(Object.keys(a$1).flatMap(e=>{let t=c[e];return t?[[a$1[e],t]]:[]}));function M(e,t){return e.kind!==t.kind?false:e.kind==="project"&&t.kind==="project"?e.project.toLowerCase()===t.project.toLowerCase():e.kind==="blocker"&&t.kind==="blocker"?e.blockerId===t.blockerId:e.kind==="trace"&&t.kind==="trace"?e.diffRef===t.diffRef:true}var J=[{name:"getWorkspaceModel",description:"Read workspace-model.json",inputSchema:{type:"object",properties:{}}},{name:"getWorkspaceKnowledgeGraph",description:"Read the current proof-backed workspace knowledge graph artifact",inputSchema:{type:"object",properties:{}}},{name:"getWorkspaceEvaluation",description:"Read the live or finalized provenance-aware model usage and verified-outcome report",inputSchema:{type:"object",properties:{live:{type:"boolean",description:"Read the live report instead of the finalized last-run report"}}}},{name:"queryWorkspaceEntities",description:"List workspace knowledge entities, optionally filtered by kind",inputSchema:{type:"object",properties:{kind:{type:"string",description:"Optional entity kind"}}}},{name:"searchWorkspaceGraph",description:"Return bounded, proof-carrying workspace context matching a text query",inputSchema:{type:"object",properties:{query:{type:"string",description:"Text, path, symbol, service, or concept to find"},kind:{type:"string",description:"Optional entity kind filter"},limit:{type:"integer",minimum:1,maximum:100,default:12}},required:["query"]}},{name:"getWorkspaceGraphEvidence",description:"Resolve portable evidence for a knowledge graph entity or relation",inputSchema:{type:"object",properties:{query:{type:"string"}},required:["query"]}},{name:"findWorkspaceGraphPath",description:"Find a shortest proof-carrying path between two workspace entities",inputSchema:{type:"object",properties:{from:{type:"string"},to:{type:"string"}},required:["from","to"]}},{name:"getEvidenceIndex",description:"Read agent reports INDEX.json",inputSchema:{type:"object",properties:{}}},{name:"getBlockers",description:"Aggregate blocking reasons from verify, explain, and contract-verify reports",inputSchema:{type:"object",properties:{}}},{name:"getSafeCommands",description:"Read safe commands from workspace-context-agent.json",inputSchema:{type:"object",properties:{}}},{name:"getProjectContext",description:"Read scoped project context from workspace-context-agent.json",inputSchema:{type:"object",properties:{project:{type:"string",description:"Optional project name; defaults to active scope"}}}},{name:"getArtifact",description:"Read one workspace-relative artifact path",inputSchema:{type:"object",properties:{relativePath:{type:"string"}},required:["relativePath"]}},{name:"listOperationalSkills",description:"Read workspace-skills-index.json",inputSchema:{type:"object",properties:{}}},{name:"getWorkspaceExplain",description:"Build or read workspace explain report",inputSchema:{type:"object",properties:{target:{type:"string",description:"release-blocked | project:<name> | blocker:<id> | trace:<diffRef> | <project>"}}}}];function H(e){let t=e.trim().replace(/\\/g,"/");return t.length>0&&!u.isAbsolute(t)&&!t.split("/").includes("..")&&(t.startsWith(".workspai/")||t.startsWith(".rapidkit/"))}async function a(e,t){if(!H(t))throw new Error(`Unsafe artifact path: ${t}`);let r$1=await d$1(e,t)??u.join(e,t);if(!await g.pathExists(r$1))return null;let n=await g.readJson(r$1),o=r(t),c=q.get(o);if(c&&a$2(n,c,`MCP artifact ${o}`),o===a$1.knowledgeGraph){let p=u.join(e,h);if(!await g.pathExists(p))throw new Error("Workspace knowledge graph cannot be consumed without its source model.");let l=await g.readJson(p);c$3(n,l);}return n}async function F(e$1){let t=[],r=new Set,o=((await a(e$1,d$3))?.blockingReasons??[]).filter(i=>typeof i=="string"&&i.trim().length>0);if(o.length>0){t.push({artifact:d$3,reasons:o});for(let i of o)r.add(i);}let c=await a(e$1,c$4);if(e(c)){let i=(c.blockingReasons??[]).filter(s=>typeof s=="string"&&s.trim().length>0);if(i.length>0){t.push({artifact:c$4,reasons:i});for(let s of i)r.add(s);}}let p=await a(e$1,e$2),l=(p?.violations??[]).filter(i=>typeof i=="string"&&i.trim().length>0);if(l.length>0||String(p?.status??"").toLowerCase()==="failed"){let i=l.length>0?l:["Workspace contract verification failed"];t.push({artifact:e$2,reasons:i});for(let s of i)r.add(s);}return {blockingReasons:[...r],sources:t}}async function I(e$2,t,r){switch(t){case "getWorkspaceModel":return a(e$2,h);case "getWorkspaceKnowledgeGraph":return a(e$2,a$1.knowledgeGraph);case "getWorkspaceEvaluation":return a(e$2,r.live===true?a$1.evaluationLive:a$1.evaluationLastRun);case "queryWorkspaceEntities":{let n=await a(e$2,a$1.knowledgeGraph);if(!n)return null;let o=String(r.kind??"").trim();return {schemaVersion:n.schemaVersion,generatedAt:n.generatedAt,entities:e$1(n,o||void 0)}}case "searchWorkspaceGraph":{let n=await a(e$2,a$1.knowledgeGraph);if(!n)return null;let o=typeof r.limit=="number"?r.limit:Number(r.limit??12);return f(n,{query:String(r.query??""),...typeof r.kind=="string"&&r.kind.trim()?{kind:r.kind.trim()}:{},limit:Number.isFinite(o)?o:12})}case "getWorkspaceGraphEvidence":{let n=await a(e$2,a$1.knowledgeGraph);return n?c$2(n,String(r.query??"")):null}case "findWorkspaceGraphPath":{let n=await a(e$2,a$1.knowledgeGraph);return n?d(n,String(r.from??""),String(r.to??"")):null}case "getEvidenceIndex":return a(e$2,L);case "getBlockers":return F(e$2);case "getSafeCommands":return {safeCommands:(await a(e$2,d$2))?.safeCommands??[]};case "getProjectContext":{let n=await a(e$2,d$2);if(!n)return null;let o=String(r.project??"").trim(),c=n.scope?.activeProject??void 0,p=o||c,l=Array.isArray(n.projects)?n.projects:[],i=p&&l.find(s=>typeof s.name=="string"&&s.name.toLowerCase()===p.toLowerCase());return {workspace:n.workspace??null,scope:n.scope??null,validation:n.validation??null,project:i??null,safeCommands:n.safeCommands??[]}}case "getArtifact":{let n=String(r.relativePath??"").trim();return a(e$2,n)}case "listOperationalSkills":return a(e$2,b$1);case "getWorkspaceExplain":{let n=String(r.target??"release-blocked").trim(),o=c$1(n);if(!o)throw new Error(`Invalid explain target: ${n}`);let c=await a(e$2,c$4);return e(c)&&M(c.target,o)?c:b({workspacePath:e$2,target:o})}default:throw new Error(`Unknown tool: ${t}`)}}function R(e,t){process.stdout.write(`${JSON.stringify({jsonrpc:"2.0",id:e??null,result:t})}
2
+ `);}function E(e,t){process.stdout.write(`${JSON.stringify({jsonrpc:"2.0",id:e??null,error:{code:-32e3,message:t}})}
3
+ `);}async function ce(e){let t=u.resolve(e.workspacePath),r=N.createInterface({input:process.stdin,terminal:false});for await(let n of r){let o=n.trim();if(!o)continue;let c;try{c=JSON.parse(o);}catch{E(null,"Invalid JSON-RPC request");continue}let{id:p,method:l,params:i}=c;try{if(l==="initialize"){R(p,{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"workspai-workspace-mcp",version:"0.1.0"}});continue}if(l==="notifications/initialized")continue;if(l==="tools/list"){R(p,{tools:J.map(s=>({name:s.name,description:s.description,inputSchema:s.inputSchema}))});continue}if(l==="tools/call"){let s=String(i?.name??""),K=i?.arguments&&typeof i.arguments=="object"?i.arguments:{},S=await I(t,s,K);R(p,{content:[{type:"text",text:JSON.stringify(S,null,2)}],isError:S==null});continue}E(p,`Unsupported method: ${l??"unknown"}`);}catch(s){E(p,s instanceof Error?s.message:String(s));}}}async function pe(e,t,r={}){return I(u.resolve(e),t,r)}export{J as WORKSPACE_MCP_READ_TOOLS,pe as invokeMcpToolForTest,ce as runWorkspaceMcpServe};
@@ -1 +1 @@
1
- export{h as WORKSPACE_MODEL_REPORT_PATH,g as WORKSPACE_MODEL_SCHEMA_VERSION,k as buildWorkspaceModel,l as buildWorkspaceModelCached,j as buildWorkspaceModelFacts,m as buildWorkspaceModelIncremental,i as validateWorkspaceModelStrict,n as writeWorkspaceModel}from'./chunk-ZDN7RHXJ.js';
1
+ export{h as WORKSPACE_MODEL_REPORT_PATH,g as WORKSPACE_MODEL_SCHEMA_VERSION,k as buildWorkspaceModel,l as buildWorkspaceModelCached,j as buildWorkspaceModelFacts,m as buildWorkspaceModelIncremental,i as validateWorkspaceModelStrict,n as writeWorkspaceModel}from'./chunk-37CVKXBD.js';
@@ -1 +1 @@
1
- export{a as WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH,b as WORKSPACE_REGISTRY_SUMMARY_SCHEMA_VERSION,f as buildWorkspaceRegistrySummary,g as formatWorkspaceRegistrySyncSummary,e as publishWorkspaceRegistrySummary,d as readWorkspaceRegistrySummary,c as resolveWorkspaceRegisteredProjects}from'./chunk-7VLCK5JW.js';
1
+ export{a as WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH,b as WORKSPACE_REGISTRY_SUMMARY_SCHEMA_VERSION,f as buildWorkspaceRegistrySummary,g as formatWorkspaceRegistrySyncSummary,e as publishWorkspaceRegistrySummary,d as readWorkspaceRegistrySummary,c as resolveWorkspaceRegisteredProjects}from'./chunk-RHQW3DTP.js';
@@ -0,0 +1 @@
1
+ export{a as runWorkspaceStage}from'./chunk-QNONOO4F.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-HDXNIN4N.js';
@@ -1 +1 @@
1
- export{d as WORKSPACE_VERIFY_REPORT_PATH,c as WORKSPACE_VERIFY_SCHEMA_VERSION,f as buildWorkspaceVerify,e as computeAffectedSubgraphGate,h as evaluateWorkspaceVerifyGate,i as workspaceVerifyExitCode,g as writeWorkspaceVerify}from'./chunk-ZM5NQ5Z2.js';
1
+ export{d as WORKSPACE_VERIFY_REPORT_PATH,c as WORKSPACE_VERIFY_SCHEMA_VERSION,f as buildWorkspaceVerify,e as computeAffectedSubgraphGate,h as evaluateWorkspaceVerifyGate,i as workspaceVerifyExitCode,g as writeWorkspaceVerify}from'./chunk-OW42TZFB.js';
@@ -1 +1 @@
1
- import {a}from'./chunk-ITCAMC2E.js';import {m as m$1}from'./chunk-ZDN7RHXJ.js';import {b as b$1}from'./chunk-COARSXRC.js';import {a as a$1}from'./chunk-KB44JP4M.js';import P from'fs';var w="workspace-watch-event.v1";function b(t){return a$1(t,"contracts/workspace-watch-event.v1.json","Workspace watch event"),t}function g(t){return `${t.from}\0${t.to}\0${t.kind}`}function f(t){return (t.graph?.edges??[]).map(r=>({from:r.from,to:r.to,kind:r.kind}))}function m(t){let o=[...a(t).entries()].sort((a,n)=>a[0].localeCompare(n[0])).map(([a,n])=>({id:a,hash:n})),c=f(t).map(g).sort((a,n)=>a.localeCompare(n));return b$1({projects:o,edges:c})}function R(t,r){let o=a(r),c=t?a(t):new Map,a$1=[],n=[];for(let[e,s]of o.entries())c.has(e)?c.get(e)!==s&&a$1.push(e):n.push(e);let d=[];for(let e of c.keys())o.has(e)||d.push(e);let i=new Map(t?f(t).map(e=>[g(e),e]):[]),l=new Map(f(r).map(e=>[g(e),e])),p=[];for(let[e,s]of l.entries())i.has(e)||p.push(s);let h=[];for(let[e,s]of i.entries())l.has(e)||h.push(s);let u=(e,s)=>g(e).localeCompare(g(s));return a$1.sort((e,s)=>e.localeCompare(s)),n.sort((e,s)=>e.localeCompare(s)),d.sort((e,s)=>e.localeCompare(s)),p.sort(u),h.sort(u),{changedProjects:a$1,addedProjects:n,removedProjects:d,edgesAdded:p,edgesRemoved:h}}var k=class{model=null;sequence=0;rebuild;now;constructor(r,o){this.rebuild=o?.rebuild??(()=>m$1({...r})),this.now=o?.now??(()=>new Date);}get currentModel(){return this.model}async start(){let r=Date.now(),{model:o}=await this.rebuild();return this.model=o,this.buildEvent("ready","initial",null,o,Date.now()-r)}async pulse(){let r=Date.now(),o=this.model,{model:c,mode:a}=await this.rebuild(),n=this.buildEvent(this.hasStructuralChange(o,c)?"changed":"unchanged",a,o,c,Date.now()-r);return this.model=c,n}hasStructuralChange(r,o){return r?m(r)!==m(o):true}buildEvent(r,o,c,a,n){let d=R(c,a),i=m(a),l=c?m(c)!==i:true;return b({schemaVersion:w,kind:r,sequence:this.sequence++,timestamp:this.now().toISOString(),mode:o,modelHash:i,modelHashChanged:l,changedProjects:d.changedProjects,addedProjects:d.addedProjects,removedProjects:d.removedProjects,graph:{nodeCount:a.graph?.nodes.length??0,edgeCount:a.graph?.edges.length??0,edgesAdded:d.edgesAdded,edgesRemoved:d.edgesRemoved},durationMs:n})}},C=new Set([".git",".hg",".svn","node_modules",".venv","venv","dist","build","out","target","coverage","htmlcov",".next",".turbo",".cache"]),y=new Set(["reports","cache","tmp",".cache"]);function S(t){if(!t)return false;let r=t.split(/[\\/]/).filter(Boolean);if(r.some(o=>C.has(o)))return false;for(let o=0;o<r.length-1;o+=1)if((r[o]===".workspai"||r[o]===".rapidkit")&&y.has(r[o+1]))return false;return true}async function I(t){let r=new k(t.buildOptions,t.engineOptions),o=await r.start();if(t.emit(o),t.once)return;let c=t.debounceMs??250,a=t.selfWriteSuppressionMs??Math.max(400,c+150),n=null,d=false,i=false,l=0,p=async()=>{if(d){i=true;return}d=true;try{let e=await r.pulse();t.emit(e);}catch(e){t.emit(b({schemaVersion:w,kind:"error",sequence:-1,timestamp:new Date().toISOString(),mode:"full",modelHash:r.currentModel?m(r.currentModel):"",modelHashChanged:false,changedProjects:[],addedProjects:[],removedProjects:[],graph:{nodeCount:0,edgeCount:0,edgesAdded:[],edgesRemoved:[]},durationMs:0,error:e instanceof Error?e.message:String(e)}));}finally{d=false,l=Date.now()+a,i&&(i=false,p());}},h=e=>{S(e)&&(d||Date.now()<l||(n&&clearTimeout(n),n=setTimeout(()=>{n=null,p();},c)));};t.onProgress?.(`Watching ${t.workspacePath} for changes (Ctrl+C to stop).`);let u=P.watch(t.workspacePath,{recursive:true},(e,s)=>{typeof s=="string"?h(s):s&&h(Buffer.from(s).toString("utf8"));});await new Promise(e=>{let s=()=>{n&&clearTimeout(n),u.close(),e();};if(t.signal){if(t.signal.aborted){s();return}t.signal.addEventListener("abort",s,{once:true});}u.on("error",()=>s());});}export{w as WORKSPACE_WATCH_EVENT_SCHEMA_VERSION,k as WorkspaceWatchEngine,m as computeWatchModelHash,R as diffWatchModels,S as isWatchRelevantPath,I as runWorkspaceWatch};
1
+ import {a}from'./chunk-PRTR2DQ2.js';import {m as m$1}from'./chunk-37CVKXBD.js';import {b as b$1}from'./chunk-J5ENLXDF.js';import {a as a$1}from'./chunk-KB44JP4M.js';import P from'fs';var w="workspace-watch-event.v1";function b(t){return a$1(t,"contracts/workspace-watch-event.v1.json","Workspace watch event"),t}function g(t){return `${t.from}\0${t.to}\0${t.kind}`}function f(t){return (t.graph?.edges??[]).map(r=>({from:r.from,to:r.to,kind:r.kind}))}function m(t){let o=[...a(t).entries()].sort((a,n)=>a[0].localeCompare(n[0])).map(([a,n])=>({id:a,hash:n})),c=f(t).map(g).sort((a,n)=>a.localeCompare(n));return b$1({projects:o,edges:c})}function R(t,r){let o=a(r),c=t?a(t):new Map,a$1=[],n=[];for(let[e,s]of o.entries())c.has(e)?c.get(e)!==s&&a$1.push(e):n.push(e);let d=[];for(let e of c.keys())o.has(e)||d.push(e);let i=new Map(t?f(t).map(e=>[g(e),e]):[]),l=new Map(f(r).map(e=>[g(e),e])),p=[];for(let[e,s]of l.entries())i.has(e)||p.push(s);let h=[];for(let[e,s]of i.entries())l.has(e)||h.push(s);let u=(e,s)=>g(e).localeCompare(g(s));return a$1.sort((e,s)=>e.localeCompare(s)),n.sort((e,s)=>e.localeCompare(s)),d.sort((e,s)=>e.localeCompare(s)),p.sort(u),h.sort(u),{changedProjects:a$1,addedProjects:n,removedProjects:d,edgesAdded:p,edgesRemoved:h}}var k=class{model=null;sequence=0;rebuild;now;constructor(r,o){this.rebuild=o?.rebuild??(()=>m$1({...r})),this.now=o?.now??(()=>new Date);}get currentModel(){return this.model}async start(){let r=Date.now(),{model:o}=await this.rebuild();return this.model=o,this.buildEvent("ready","initial",null,o,Date.now()-r)}async pulse(){let r=Date.now(),o=this.model,{model:c,mode:a}=await this.rebuild(),n=this.buildEvent(this.hasStructuralChange(o,c)?"changed":"unchanged",a,o,c,Date.now()-r);return this.model=c,n}hasStructuralChange(r,o){return r?m(r)!==m(o):true}buildEvent(r,o,c,a,n){let d=R(c,a),i=m(a),l=c?m(c)!==i:true;return b({schemaVersion:w,kind:r,sequence:this.sequence++,timestamp:this.now().toISOString(),mode:o,modelHash:i,modelHashChanged:l,changedProjects:d.changedProjects,addedProjects:d.addedProjects,removedProjects:d.removedProjects,graph:{nodeCount:a.graph?.nodes.length??0,edgeCount:a.graph?.edges.length??0,edgesAdded:d.edgesAdded,edgesRemoved:d.edgesRemoved},durationMs:n})}},C=new Set([".git",".hg",".svn","node_modules",".venv","venv","dist","build","out","target","coverage","htmlcov",".next",".turbo",".cache"]),y=new Set(["reports","cache","tmp",".cache"]);function S(t){if(!t)return false;let r=t.split(/[\\/]/).filter(Boolean);if(r.some(o=>C.has(o)))return false;for(let o=0;o<r.length-1;o+=1)if((r[o]===".workspai"||r[o]===".rapidkit")&&y.has(r[o+1]))return false;return true}async function I(t){let r=new k(t.buildOptions,t.engineOptions),o=await r.start();if(t.emit(o),t.once)return;let c=t.debounceMs??250,a=t.selfWriteSuppressionMs??Math.max(400,c+150),n=null,d=false,i=false,l=0,p=async()=>{if(d){i=true;return}d=true;try{let e=await r.pulse();t.emit(e);}catch(e){t.emit(b({schemaVersion:w,kind:"error",sequence:-1,timestamp:new Date().toISOString(),mode:"full",modelHash:r.currentModel?m(r.currentModel):"",modelHashChanged:false,changedProjects:[],addedProjects:[],removedProjects:[],graph:{nodeCount:0,edgeCount:0,edgesAdded:[],edgesRemoved:[]},durationMs:0,error:e instanceof Error?e.message:String(e)}));}finally{d=false,l=Date.now()+a,i&&(i=false,p());}},h=e=>{S(e)&&(d||Date.now()<l||(n&&clearTimeout(n),n=setTimeout(()=>{n=null,p();},c)));};t.onProgress?.(`Watching ${t.workspacePath} for changes (Ctrl+C to stop).`);let u=P.watch(t.workspacePath,{recursive:true},(e,s)=>{typeof s=="string"?h(s):s&&h(Buffer.from(s).toString("utf8"));});await new Promise(e=>{let s=()=>{n&&clearTimeout(n),u.close(),e();};if(t.signal){if(t.signal.aborted){s();return}t.signal.addEventListener("abort",s,{once:true});}u.on("error",()=>s());});}export{w as WORKSPACE_WATCH_EVENT_SCHEMA_VERSION,k as WorkspaceWatchEngine,m as computeWatchModelHash,R as diffWatchModels,S as isWatchRelevantPath,I as runWorkspaceWatch};
package/docs/GLOSSARY.md CHANGED
@@ -24,33 +24,37 @@ CI workflows, and AI consumers.
24
24
 
25
25
  ## Intelligence and governance
26
26
 
27
- | Term | Plain-language meaning |
28
- | --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
29
- | Unified runner | `workspace intelligence run`; the supported way to execute the complete intelligence chain in contract order. |
30
- | Preflight | `sync` and baseline resolution. These prepare the run but are not stages in the 11-stage intelligence chain. |
31
- | Stage | One contract-defined operation in the intelligence chain. Stage order comes from `workspace-intelligence-chain.v1.json`. |
32
- | Gate | A decision that can pass, need attention, or block automation according to evidence and policy. |
33
- | Blocked | The command completed, but evidence or policy prevents the requested release/action. The unified runner uses exit code `2`. |
34
- | Failed | Execution itself failed. The unified runner uses exit code `1`. |
35
- | Needs attention | Evidence is usable but contains warnings or non-blocking gaps. Strict policy can promote it to a blocking result. |
36
- | Fresh / stale | Whether an artifact still matches its governed inputs and dependency closure. A recent timestamp alone does not prove freshness. |
37
- | Snapshot | A stable baseline of the model used for later comparison. |
38
- | Diff | The structural change between the current model and a baseline model or snapshot. |
39
- | Impact | Direct and transitive consequences of a model diff, including verification scope and risk. |
40
- | Verify | The evidence-backed gate over the affected dependency subgraph and workspace policies. |
41
- | Context | A bounded, agent-oriented projection of current workspace evidence. |
42
- | Agent sync | Generation of tool-specific instructions, skills, prompts, indexes, and MCP metadata from canonical evidence. |
27
+ | Term | Plain-language meaning |
28
+ | ---------------- | -------------------------------------------------------------------------------------------------------------------------------- |
29
+ | Unified runner | `workspace intelligence run`; the supported way to execute the complete intelligence chain in contract order. |
30
+ | Preflight | `sync` and baseline resolution. These prepare the run but are not stages in the 11-stage intelligence chain. |
31
+ | Stage | One contract-defined operation in the intelligence chain. Stage order comes from `workspace-intelligence-chain.v1.json`. |
32
+ | Gate | A decision that can pass, need attention, or block automation according to evidence and policy. |
33
+ | Blocked | The command completed, but evidence or policy prevents the requested release/action. The unified runner uses exit code `2`. |
34
+ | Failed | Execution itself failed. The unified runner uses exit code `1`. |
35
+ | Needs attention | Evidence is usable but contains warnings or non-blocking gaps. Strict policy can promote it to a blocking result. |
36
+ | Fresh / stale | Whether an artifact still matches its governed inputs and dependency closure. A recent timestamp alone does not prove freshness. |
37
+ | Snapshot | A stable baseline of the model used for later comparison. |
38
+ | Diff | The structural change between the current model and a baseline model or snapshot. |
39
+ | Impact | Direct and transitive consequences of a model diff, including verification scope and risk. |
40
+ | Verify | The evidence-backed gate over the affected dependency subgraph and workspace policies. |
41
+ | Context | A bounded, agent-oriented projection of current workspace evidence. |
42
+ | Agent sync | Generation of tool-specific instructions, skills, prompts, indexes, and MCP metadata from canonical evidence. |
43
+ | Evaluation | A provenance-aware record of model calls, tool activity, cost, latency, and verified task outcome produced by `workspace eval`. |
44
+ | Verified outcome | A task result supported by the workspace verification path; smaller context alone is not treated as task success. |
43
45
 
44
46
  ## AI and integration
45
47
 
46
- | Term | Plain-language meaning |
47
- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
48
- | Agent grounding | Instructions and evidence references that keep an AI agent inside the correct workspace, contracts, and command loop. |
49
- | Bounded retrieval | Returning only the most relevant entities and proof paths for a question instead of injecting the complete graph or model. |
50
- | MCP | Model Context Protocol; Workspai exposes read-oriented workspace tools through `workspace mcp serve`. |
51
- | Module recommender | The optional embedding-based FastAPI/NestJS recommendation feature. It is separate from deterministic Workspace Intelligence. |
52
- | Canonical path | The current `.workspai` path that new writers and consumers should prefer. |
53
- | Legacy path | A `.rapidkit` compatibility path read for older workspaces; it is not the target for new integrations. |
48
+ | Term | Plain-language meaning |
49
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
50
+ | Agent grounding | Instructions and evidence references that keep an AI agent inside the correct workspace, contracts, and command loop. |
51
+ | Bounded retrieval | Returning only the most relevant entities and proof paths for a question instead of injecting the complete graph or model. |
52
+ | Retrieval benchmark | A deterministic comparison of readable proof-source corpus size with one bounded graph response; it is not billing evidence. |
53
+ | Token provenance | Whether a token value was provider-reported, counted by a named tokenizer, estimated, or unavailable. |
54
+ | MCP | Model Context Protocol; Workspai exposes read-oriented workspace tools through `workspace mcp serve`. |
55
+ | Module recommender | The optional embedding-based FastAPI/NestJS recommendation feature. It is separate from deterministic Workspace Intelligence. |
56
+ | Canonical path | The current `.workspai` path that new writers and consumers should prefer. |
57
+ | Legacy path | A `.rapidkit` compatibility path read for older workspaces; it is not the target for new integrations. |
54
58
 
55
59
  ## Where to continue
56
60
 
package/docs/README.md CHANGED
@@ -37,16 +37,18 @@ instructions; see the [Artifact Catalog](./contracts/ARTIFACT_CATALOG.md).
37
37
 
38
38
  ## Choose a guide by goal
39
39
 
40
- | I want to… | Start here | Expected outcome |
41
- | ---------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------- |
42
- | Create a workspace or project | [Creating workspaces and projects](./creating-workspaces-and-projects.md) | A registered project with canonical `.workspai` metadata |
43
- | Bring an existing repository under governance | [Workspace operations](./workspace-operations.md#import-and-adoption) | Source stays in place with `adopt`, or is copied/cloned with `import` |
44
- | Run the complete intelligence loop | [Unified runner](./workspace-intelligence-runner.md) | One ordered run report with durable stage evidence |
45
- | Ask an architecture or dependency question | [Workspace Knowledge Graph](./workspace-knowledge-graph.md) | A bounded answer with proof references rather than the whole graph |
46
- | Integrate CI or release gates | [CI workflows](./ci-workflows.md) | Machine-readable exit codes and uploadable evidence |
47
- | Find the writer, schema, or path for an output | [Artifact Catalog](./contracts/ARTIFACT_CATALOG.md) | One canonical source instead of path guessing |
48
- | Understand Workspai terminology | [Glossary](./GLOSSARY.md) | Shared meanings for model, graph, evidence, gate, and artifacts |
49
- | Contribute to the CLI | [Development](./DEVELOPMENT.md) | Local build, test, contract, and documentation gates |
40
+ | I want to… | Start here | Expected outcome |
41
+ | ------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------- |
42
+ | Create a workspace or project | [Creating workspaces and projects](./creating-workspaces-and-projects.md) | A registered project with canonical `.workspai` metadata |
43
+ | Bring an existing repository under governance | [Workspace operations](./workspace-operations.md#import-and-adoption) | Source stays in place with `adopt`, or is copied/cloned with `import` |
44
+ | Run the complete intelligence loop | [Unified runner](./workspace-intelligence-runner.md) | One ordered run report with durable stage evidence |
45
+ | Ask an architecture or dependency question | [Workspace Knowledge Graph](./workspace-knowledge-graph.md) | A bounded answer with proof references rather than the whole graph |
46
+ | Measure agent token, cost, and outcome efficiency | [Workspace Intelligence Evaluation](./workspace-intelligence-evaluation.md) | A live, provenance-aware report suitable for CLI, IDE, and CI |
47
+ | Integrate CI or release gates | [CI workflows](./ci-workflows.md) | Machine-readable exit codes and uploadable evidence |
48
+ | Find the writer, schema, or path for an output | [Artifact Catalog](./contracts/ARTIFACT_CATALOG.md) | One canonical source instead of path guessing |
49
+ | Understand Workspai terminology | [Glossary](./GLOSSARY.md) | Shared meanings for model, graph, evidence, gate, and artifacts |
50
+ | Review or change the main product README | [README content contract](./README_CONTENT_CONTRACT.md) | Stable narrative, claim boundaries, and machine-enforced drift rules |
51
+ | Contribute to the CLI | [Development](./DEVELOPMENT.md) | Local build, test, contract, and documentation gates |
50
52
 
51
53
  There are two different AI-facing features. Workspace Intelligence is
52
54
  deterministic, proof-backed, and does not require an AI API key. The optional
@@ -64,7 +66,9 @@ with [AI Quickstart](./AI_QUICKSTART.md) only when that is your goal.
64
66
  | [workspace-intelligence-runner.md](./workspace-intelligence-runner.md) | Canonical unified runner, execution envelope, report schema, exit codes, failure propagation, and CI consumption |
65
67
  | [workspace-knowledge-graph.md](./workspace-knowledge-graph.md) | Two-minute graph quickstart, proof model, AI/MCP consumption, performance, and honest token-efficiency measurement |
66
68
  | [graph-benchmark-methodology.md](./graph-benchmark-methodology.md) | Reproducible payload-reduction benchmark, formulas, claim boundaries, and publication rules |
69
+ | [workspace-intelligence-evaluation.md](./workspace-intelligence-evaluation.md) | Provider usage, cost provenance, verified outcomes, comparison, and extension consumption |
67
70
  | [GLOSSARY.md](./GLOSSARY.md) | Plain-language definitions for workspace, model, graph, evidence, gates, and AI integrations |
71
+ | [README_CONTENT_CONTRACT.md](./README_CONTENT_CONTRACT.md) | Required root README journey, architecture statements, claim policy, and drift guard |
68
72
  | [create-planner-capabilities.md](./create-planner-capabilities.md) | Native create, official, and existing lanes |
69
73
  | [../contracts/project-entry-capability.v1.json](../contracts/project-entry-capability.v1.json) | Contract: any readable project can enter through adopt/import when it can be registered |
70
74
  | [from-code-to-shared-understanding.md](./from-code-to-shared-understanding.md) | GitHub-rendered Workspace Intelligence diagram |
@@ -158,7 +162,10 @@ workspai/
158
162
  ├── releases/ # Per-version release notes
159
163
  └── docs/
160
164
  ├── README.md # This index
165
+ ├── README_CONTENT_CONTRACT.md
161
166
  ├── commands-reference.md
167
+ ├── workspace-knowledge-graph.md
168
+ ├── workspace-intelligence-evaluation.md
162
169
  ├── workspace-operations.md
163
170
  ├── workspace-run.md
164
171
  ├── ci-workflows.md
@@ -0,0 +1,154 @@
1
+ # README Content Contract
2
+
3
+ The repository README is Workspai's primary product entry point. It must help a
4
+ new user understand the problem, see a concrete result, run a safe quickstart,
5
+ and choose the next document without first learning the internal architecture.
6
+
7
+ This contract keeps that experience aligned with the CLI's machine-readable
8
+ contracts. It applies to the root `README.md`; the package README may add detail
9
+ but must not contradict it.
10
+
11
+ The npm package README at `packages/cli/README.md` is the operational product
12
+ entry point. It follows the same truth boundaries but adds beginner definitions,
13
+ a copyable workspace onboarding path, exact exit semantics, command families,
14
+ durable outputs, requirements, and troubleshooting.
15
+
16
+ ## Required reader journey
17
+
18
+ The root README keeps these sections in this order:
19
+
20
+ 1. `Workspace Intelligence for software systems` — the category, slogan, and
21
+ three user outcomes;
22
+ 2. `See your workspace as a system` — a concrete before/after mental model;
23
+ 3. `Start in two minutes` — install, connect software, run the canonical chain;
24
+ 4. `What Workspai gives you` — user questions mapped to product outcomes;
25
+ 5. `How Workspace Intelligence works` — sources, facts, model, graph, decisions,
26
+ and consumers;
27
+ 6. `Evidence, not guesses` — identity, proof, bounded retrieval, and unknown
28
+ relationships;
29
+ 7. `Measure context honestly` — reproducible numbers and claim boundaries;
30
+ 8. `One contract-backed intelligence chain` — the canonical runner and its
31
+ distinction from `pipeline`;
32
+ 9. `Choose your workflow` — goal-oriented routing;
33
+ 10. `Open outputs for every consumer` — human, CI, agent, MCP, IDE, and graph
34
+ interoperability surfaces;
35
+ 11. documentation, packages, contributor, community, and license routes.
36
+
37
+ Do not move package internals, exhaustive flags, troubleshooting, or contributor
38
+ implementation details above the user value and quickstart.
39
+
40
+ ## CLI package README journey
41
+
42
+ The CLI README keeps these sections in order:
43
+
44
+ 1. product category and the `See / Ask with proof / Act with confidence` value;
45
+ 2. plain-language definitions of Workspace, Project, Model, Graph, Evidence,
46
+ and Artifact;
47
+ 3. a copyable two-minute path that creates a minimal workspace, adopts source,
48
+ and runs the canonical chain;
49
+ 4. the Model → derived Graph architecture and its unknown-relationship rule;
50
+ 5. the exact intelligence chain, evidence, and bounded measurement semantics;
51
+ 6. grouped commands, outputs, onboarding choices, integrations, requirements,
52
+ documentation, and troubleshooting.
53
+
54
+ Measurement tables must not precede installation or the first successful run.
55
+ Advanced command inventories must be grouped by user goal instead of appearing
56
+ as one undifferentiated command wall.
57
+
58
+ ## Architectural statements that must remain true
59
+
60
+ - The **Workspace Model is the canonical source of truth**.
61
+ - The Knowledge Graph is a **derived, revision-bound representation** of
62
+ governed workspace knowledge.
63
+ - Providers emit facts and proofs; they do not independently own the canonical
64
+ graph.
65
+ - Missing relationships mean **not proven**, not independent.
66
+ - The graph is broader than a code graph, but it is not the entire product.
67
+ - The canonical runner is
68
+ `npx workspai workspace intelligence run --for-agent codex --strict --json`.
69
+ - `pipeline` is a broader governance/release orchestrator and must not be taught
70
+ as a replacement for the intelligence chain.
71
+ - The integrated CLI already exposes current capabilities. Future standalone
72
+ packages are extraction boundaries, not promises to add currently missing CLI
73
+ features.
74
+
75
+ Normative machine sources:
76
+
77
+ | Statement | Source of truth |
78
+ | ------------------------------ | ------------------------------------------------------- |
79
+ | Ordered intelligence chain | `contracts/workspace-intelligence-chain.v1.json` |
80
+ | Runtime commands and flags | `contracts/runtime-command-surface.v1.json` |
81
+ | Published schemas and paths | `contracts/published-contract-catalog.v1.json` |
82
+ | Architecture boundaries | `contracts/workspace-intelligence-architecture.v1.json` |
83
+ | Artifact writers and consumers | `docs/contracts/ARTIFACT_CATALOG.md` |
84
+
85
+ Markdown summarizes these contracts; it does not redefine them.
86
+
87
+ ## Claim policy
88
+
89
+ Every performance or token statement must identify:
90
+
91
+ - the workspace or pinned corpus;
92
+ - the query and result limit;
93
+ - whether token counts are estimated, tokenizer-counted, or provider-reported;
94
+ - the baseline;
95
+ - the date or revision;
96
+ - what the measurement does not prove.
97
+
98
+ The current fixture may be used only with wording equivalent to:
99
+
100
+ > On the current 16-project development fixture, one bounded query reduced the
101
+ > estimated retrieval payload by 97.9%; results vary by workspace and query.
102
+
103
+ Never turn a retrieval-payload result into a universal model-cost, answer-quality,
104
+ or task-success claim. Use `workspace eval` and a verified outcome before making
105
+ execution-efficiency comparisons.
106
+
107
+ ## Command policy
108
+
109
+ - Quickstarts must be copyable and use the canonical `workspai` package.
110
+ - `wspai` is described only as an optional short alias.
111
+ - A partial sequence such as `model → context` must not be taught as a replacement
112
+ for the canonical intelligence chain.
113
+ - Every documented command must exist in the runtime command surface or be an
114
+ ordinary shell command such as `cd` or `npm install`.
115
+ - Durable filenames must come from published contracts or the Artifact Catalog.
116
+
117
+ ## Information hierarchy
118
+
119
+ Write for three reading depths:
120
+
121
+ 1. **Ten seconds:** category, user problem, three outcomes.
122
+ 2. **Two minutes:** quickstart, concrete artifacts, architecture, proof example.
123
+ 3. **Deep evaluation:** measurements, contracts, guides, boundaries, contributor
124
+ material.
125
+
126
+ Prefer user questions and outcomes over internal phase names. Define unavoidable
127
+ terms in plain language and link to the glossary.
128
+
129
+ ## Validation
130
+
131
+ Run from `packages/cli`:
132
+
133
+ ```bash
134
+ npm run validate:docs
135
+ npm run check:generated-contracts
136
+ npm run check:contracts
137
+ ```
138
+
139
+ `docs-drift-guard.mjs` enforces the required root headings, their order,
140
+ canonical runner, Model/Graph truth boundary, honest measurement language,
141
+ documentation routes, and package-status semantics. `smoke-readme-commands.mjs`
142
+ executes representative documented CLI help surfaces.
143
+
144
+ ## Review checklist
145
+
146
+ Before merging a README change, confirm:
147
+
148
+ - a new user can explain Workspai without saying “chatbot” or “code generator”;
149
+ - the first quickstart reaches a durable evidence artifact;
150
+ - every architecture statement agrees with the generated contracts;
151
+ - every number is reproducible and bounded;
152
+ - every promised output exists today or is explicitly labelled as future work;
153
+ - links route users by goal rather than exposing the documentation tree;
154
+ - the package table cannot be read as a list of missing product capabilities.