rapidkit 0.38.0 → 0.40.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 (80) hide show
  1. package/README.md +96 -31
  2. package/contracts/agent-customization-pack.v1.json +159 -0
  3. package/contracts/extension-cli-compatibility.v1.json +10 -0
  4. package/contracts/runtime-command-surface.v1.json +33 -0
  5. package/contracts/workspace-intelligence/workspace-dependency-graph.v1.json +92 -0
  6. package/contracts/workspace-intelligence/workspace-impact.v1.json +32 -2
  7. package/contracts/workspace-intelligence/workspace-model.v1.json +5 -0
  8. package/contracts/workspace-intelligence/workspace-verify.v1.json +103 -1
  9. package/dist/analyze-RHQM4AB2.js +1 -0
  10. package/dist/autopilot-release-S32GYUAQ.js +1 -0
  11. package/dist/chunk-3YLMCP3V.js +1 -0
  12. package/dist/chunk-4FJQWL7P.js +4 -0
  13. package/dist/chunk-4Q2ZZKGB.js +1 -0
  14. package/dist/chunk-6G2KSHP6.js +2 -0
  15. package/dist/{chunk-PPQYTYQG.js → chunk-6KD5F6LX.js} +4 -4
  16. package/dist/{chunk-NKNMGWAZ.js → chunk-CY2WXWYQ.js} +1 -1
  17. package/dist/{chunk-TVIOAZ6E.js → chunk-ERCD6NFF.js} +15 -15
  18. package/dist/chunk-G76C74EV.js +1 -0
  19. package/dist/chunk-GOM3RFB3.js +2 -0
  20. package/dist/chunk-HTYMXMQM.js +1 -0
  21. package/dist/chunk-KYH364KQ.js +1 -0
  22. package/dist/chunk-NAMOYGLS.js +2 -0
  23. package/dist/chunk-OWNGSAO3.js +2 -0
  24. package/dist/chunk-PYCJWW4B.js +1 -0
  25. package/dist/chunk-QPEBI6AB.js +2 -0
  26. package/dist/{chunk-5NBYSXOZ.js → chunk-RXWM5DSC.js} +2 -2
  27. package/dist/chunk-S5KTATOU.js +1 -0
  28. package/dist/chunk-TYZPPUBH.js +1 -0
  29. package/dist/chunk-VQMZC5TC.js +9 -0
  30. package/dist/{chunk-JBDQADHY.js → chunk-WHCON2VN.js} +11 -11
  31. package/dist/chunk-X7PWDIQW.js +1 -0
  32. package/dist/{chunk-7XW2I6MP.js → chunk-ZWKLRZE5.js} +2 -2
  33. package/dist/{create-Y3XJOKL5.js → create-XVDDQA42.js} +1 -1
  34. package/dist/{demo-kit-3VTLJBP7.js → demo-kit-RWGOEDW4.js} +1 -1
  35. package/dist/{doctor-QC662YLH.js → doctor-UOLOGJ2Z.js} +1 -1
  36. package/dist/{dotnet-webapi-clean-FX533F5U.js → dotnet-webapi-clean-RTBRPDPL.js} +1 -1
  37. package/dist/{gofiber-standard-35CJZ7S3.js → gofiber-standard-UGIRKPKL.js} +1 -1
  38. package/dist/{gogin-standard-SAX6C4ZK.js → gogin-standard-HJ7SPFNT.js} +1 -1
  39. package/dist/index.d.ts +32 -1
  40. package/dist/index.js +154 -154
  41. package/dist/pipeline-M52LR5FJ.js +5 -0
  42. package/dist/{springboot-standard-SFMSLTX4.js → springboot-standard-IWJSVDLZ.js} +1 -1
  43. package/dist/{workspace-WBKFXH4Z.js → workspace-L4ITCKMM.js} +1 -1
  44. package/dist/workspace-agent-sync-G7JU77IK.js +25 -0
  45. package/dist/{workspace-context-V4UGIHSC.js → workspace-context-NMMQMHNU.js} +1 -1
  46. package/dist/{workspace-foundation-T45HAWKL.js → workspace-foundation-HNIRAIBF.js} +1 -1
  47. package/dist/workspace-graph-ICB7OVAZ.js +3 -0
  48. package/dist/workspace-history-LHUTLE3S.js +1 -0
  49. package/dist/{workspace-intelligence-MGL3Z25K.js → workspace-intelligence-64IWAYHS.js} +1 -1
  50. package/dist/workspace-model-SDHH5RBC.js +1 -0
  51. package/dist/workspace-run-A26PEGQT.js +1 -0
  52. package/dist/workspace-verify-6Q6MGRG6.js +1 -0
  53. package/dist/workspace-watch-JDXVGW4H.js +1 -0
  54. package/docs/ci-workflows.md +21 -18
  55. package/docs/commands-reference.md +1 -1
  56. package/docs/contracts/ARTIFACT_CATALOG.md +194 -32
  57. package/docs/contracts/CLI_LOG_EVENT_STREAM.md +123 -0
  58. package/docs/contracts/README.md +9 -7
  59. package/docs/examples/ci-agent-grounding.yml +5 -2
  60. package/package.json +11 -6
  61. package/scripts/check-agent-customization-drift.mjs +75 -0
  62. package/dist/analyze-6RFG7C7Z.js +0 -1
  63. package/dist/autopilot-release-SBPGNGAB.js +0 -1
  64. package/dist/chunk-2ED6SPXP.js +0 -1
  65. package/dist/chunk-3R7UJAX5.js +0 -1
  66. package/dist/chunk-6E5TBB2C.js +0 -2
  67. package/dist/chunk-6P5DCHBQ.js +0 -4
  68. package/dist/chunk-ABPDGFVD.js +0 -2
  69. package/dist/chunk-B2KOIORF.js +0 -1
  70. package/dist/chunk-C7WILE56.js +0 -1
  71. package/dist/chunk-HEG6DIGW.js +0 -2
  72. package/dist/chunk-IW3KLQXE.js +0 -2
  73. package/dist/chunk-RELR4O5E.js +0 -2
  74. package/dist/chunk-T5LN7EO5.js +0 -9
  75. package/dist/chunk-XESEBTPE.js +0 -1
  76. package/dist/pipeline-C4UCLETO.js +0 -5
  77. package/dist/workspace-agent-sync-3FFFJYKF.js +0 -17
  78. package/dist/workspace-model-IKMGY2BX.js +0 -1
  79. package/dist/workspace-run-HOR56FON.js +0 -1
  80. package/dist/workspace-verify-A3J6D7T2.js +0 -1
@@ -0,0 +1,5 @@
1
+ import {c}from'./chunk-CY2WXWYQ.js';import {b}from'./chunk-WHCON2VN.js';import {b as b$1}from'./chunk-RXWM5DSC.js';import {a as a$1}from'./chunk-VQMZC5TC.js';import {a as a$2}from'./chunk-4FJQWL7P.js';import {a}from'./chunk-KMUWWZRT.js';import {f,e}from'./chunk-4Q2ZZKGB.js';import c$1 from'chalk';import D from'fs-extra';import u from'path';function C(t){return t===0?"pass":t===2?"warn":"fail"}function M(t){return t.some(s=>s.status==="fail")?"blocked":t.some(s=>s.status==="warn")?"needs-attention":"ready"}function F(t,s){if(s)return 3;let a=t.some(i=>i.status==="fail"),r=t.some(i=>i.status==="warn");return a?1:r?2:0}async function j(t){let s=await b$1(t,true),a=false;try{let{syncWorkspaceContract:r}=await import('./workspace-contract-D5O4OZD5.js');await r({workspacePath:t}),a=true;}catch{a=false;}return {sync:s,contractSynced:a}}async function G(t={}){let s=u.resolve(t.workspacePath??process.cwd()),a$3=a(s);if(!a$3)throw new Error("No RapidKit workspace found in current directory or parents");let r=[],i=[],l=false,p,y,m,f$1=Date.now();try{let{sync:e,contractSynced:n}=await j(a$3),o=e.workspaceFound&&(e.added.length>0||e.skipped>=0)||e.workspaceFound?"pass":"warn";r.push({name:"sync",status:o,durationMs:Date.now()-f$1,summary:e.workspaceFound?`registry sync complete (${e.added.length} added, ${e.skipped} existing)${n?", contract synced":""}`:"workspace not registered in global registry; contract sync attempted"}),e.workspaceFound||i.push("workspace registry entry missing \u2014 run rapidkit create workspace or register manually");}catch(e){l=true,r.push({name:"sync",status:"fail",durationMs:Date.now()-f$1,summary:`sync failed: ${e instanceof Error?e.message:String(e)}`}),i.push("workspace sync stage failed");}let w=Date.now();try{let e=await b({workspace:true,json:true,quiet:true,strict:t.strict===true,ci:t.strict!==true}),n=C(e),o=u.join(a$3,".rapidkit","reports","doctor-last-run.json");r.push({name:"doctor",status:n,durationMs:Date.now()-w,summary:n==="pass"?"doctor workspace passed":n==="warn"?"doctor workspace reported warnings":"doctor workspace reported errors",exitCode:e,evidencePath:o}),n==="fail"?i.push("doctor workspace gate failed"):n==="warn"&&i.push("doctor workspace reported warnings");}catch(e){l=true,r.push({name:"doctor",status:"fail",durationMs:Date.now()-w,summary:`doctor failed: ${e instanceof Error?e.message:String(e)}`}),i.push("doctor workspace stage failed");}if(t.skipAnalyze)r.push({name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped"});else {let e=Date.now();try{let n=await a$1({workspacePath:a$3,json:true,strict:t.strict===true});p=u.join(a$3,".rapidkit","reports","analyze-last-run.json");let o=n.summary.verdict==="blocked"?"fail":n.summary.verdict==="needs-attention"?"warn":"pass";r.push({name:"analyze",status:o,durationMs:Date.now()-e,summary:`analyze verdict: ${n.summary.verdict} (score ${n.summary.score}/100)`,evidencePath:p}),o==="fail"?i.push("analyze reported blocked verdict"):o==="warn"&&i.push("analyze reported needs-attention verdict");}catch(n){l=true,r.push({name:"analyze",status:"fail",durationMs:Date.now()-e,summary:`analyze failed: ${n instanceof Error?n.message:String(n)}`}),i.push("analyze stage failed");}}let h=Date.now();try{let e=await a$2({startPath:a$3,writeReport:true,skipVerify:t.skipVerify===true});y=e.evidencePath;let n=e.overallStatus==="pass"?"pass":e.overallStatus==="warn"?"warn":"fail";r.push({name:"readiness",status:n,durationMs:Date.now()-h,summary:`readiness overall: ${e.overallStatus}`,evidencePath:e.evidencePath}),n==="fail"?i.push(...e.blockingReasons.map(o=>`readiness: ${o}`)):n==="warn"&&i.push(...e.gates.filter(o=>o.status==="warn").map(o=>`readiness warn: ${o.gate}: ${o.summary}`));}catch(e){l=true,r.push({name:"readiness",status:"fail",durationMs:Date.now()-h,summary:`readiness failed: ${e instanceof Error?e.message:String(e)}`}),i.push("readiness stage failed");}if(t.skipAutopilot)r.push({name:"autopilot",status:"skipped",durationMs:0,summary:"autopilot stage skipped"});else {let e=Date.now(),n=t.autopilotMode??"audit";try{let o=await c({workspacePath:a$3,mode:n,json:true,skipPipelineStages:true});m=o.artifacts.reportPath;let P=o.summary.verdict==="approved"?"pass":o.summary.verdict==="partial"?"warn":"fail";r.push({name:"autopilot",status:P,durationMs:Date.now()-e,summary:`autopilot ${n}: ${o.summary.verdict}`,exitCode:o.summary.exitCode,evidencePath:m}),P!=="pass"&&i.push(...o.blockingReasons.slice(0,5));}catch(o){l=true,r.push({name:"autopilot",status:"fail",durationMs:Date.now()-e,summary:`autopilot failed: ${o instanceof Error?o.message:String(o)}`}),i.push("autopilot release stage failed");}}let z=M(r),k=F(r,l),g=u.join(a$3,".rapidkit","reports","pipeline-last-run.json"),d={schemaVersion:"rapidkit-pipeline-v1",generatedAt:new Date().toISOString(),workspacePath:a$3,summary:{verdict:z,exitCode:k,stagesPassed:r.filter(e=>e.status==="pass").length,stagesWarn:r.filter(e=>e.status==="warn").length,stagesFailed:r.filter(e=>e.status==="fail").length},stages:r,blockingReasons:[...new Set(i)],artifacts:{reportPath:g,analyzeEvidencePath:p,readinessEvidencePath:y,autopilotEvidencePath:m}};if(t.writeReport!==false){await D.ensureDir(u.dirname(g));let e$1=f(d,{commandId:"workspacePipeline",exitCode:k,generatedAt:d.generatedAt,blockers:d.blockingReasons,runId:e()});await D.writeJSON(g,e$1,{spaces:2});}if(t.writeReport!==false&&t.noAgentSync!==true&&process.env.RAPIDKIT_NO_AGENT_SYNC!=="1"&&t.agentSync!==false)try{let{syncWorkspaceAgentGrounding:e}=await import('./workspace-agent-sync-G7JU77IK.js'),n=await e({workspacePath:a$3,write:true,refreshContext:true,strict:false});d.agentGrounding={indexPath:n.indexPath,writtenFiles:n.writtenFiles,blockers:n.blockers};}catch{}return d}async function X(t){let s;try{s=await G(t);}catch(a){let r=a instanceof Error?a.message:String(a);t.json?console.log(JSON.stringify({schemaVersion:"rapidkit-pipeline-error-v1",ok:false,error:{message:r}},null,2)):console.log(c$1.red(`Pipeline failed: ${r}`)),process.exit(1);}if(t.json)console.log(JSON.stringify(s,null,2));else {console.log(c$1.bold.cyan(`
2
+ \u{1F517} RapidKit Governance Pipeline
3
+ `)),console.log(c$1.bold(`Workspace: ${c$1.cyan(u.basename(s.workspacePath))}`)),console.log(c$1.gray(`Path: ${s.workspacePath}`)),console.log(c$1.white(`Verdict: ${s.summary.verdict} Exit: ${s.summary.exitCode} (${s.summary.stagesPassed} pass / ${s.summary.stagesWarn} warn / ${s.summary.stagesFailed} fail)`));for(let a of s.stages){let r=a.status==="pass"?c$1.green("PASS"):a.status==="warn"?c$1.yellow("WARN"):a.status==="skipped"?c$1.gray("SKIP"):c$1.red("FAIL");console.log(` - ${a.name}: ${r} ${a.summary}`);}if(s.blockingReasons.length>0){console.log(c$1.bold(`
4
+ Blocking reasons:`));for(let a of s.blockingReasons.slice(0,8))console.log(c$1.gray(` \u2022 ${a}`));}console.log(c$1.gray(`
5
+ Evidence: ${s.artifacts.reportPath}`)),s.agentGrounding?.writtenFiles.length&&console.log(c$1.gray(`Agent grounding: ${s.agentGrounding.writtenFiles.length} file(s) synced (INDEX + AGENTS.md + Copilot/Cursor/Claude hooks)`));}s.summary.exitCode!==0&&process.exit(s.summary.exitCode);}export{G as runPipeline,X as runPipelineCommand};
@@ -1,4 +1,4 @@
1
- import {b as b$1,c}from'./chunk-3Q7264EJ.js';import {b}from'./chunk-PPQYTYQG.js';import {promises}from'fs';import g from'path';import r from'chalk';import R from'ora';import {execa}from'execa';var y="21",$="3.5.0",j="2.8.9";function u(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,".").replace(/^\.+|\.+$/g,"").replace(/\.{2,}/g,".").split(".").map(p=>p.replace(/^[^a-z]+/,"").replace(/[^a-z0-9]/g,"")).filter(Boolean).join(".")}function _(e,t){return e.replace(/[\r\n\t]+/g," ").trim()||t}function x(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function M(e,t){let s=u(e)||"com.rapidkit.apps",p=u(t)||"service";return `${s}.${p}`}function E(e){return e.replace(/\./g,"/")}function T(){return JSON.stringify({engine:"npm",runtime:"java"},null,2)}function A(e,t){return JSON.stringify({kit_name:"springboot.standard",runtime:"java",module_support:false,project_name:e.project_name,artifact_id:e.artifact_id,group_id:e.group_id,package_name:e.package_name,app_version:e.app_version,created_by:"rapidkit-npm",rapidkit_version:t,created_at:new Date().toISOString()},null,2)}function P(e){return `<?xml version="1.0" encoding="UTF-8"?>
1
+ import {b as b$1,c}from'./chunk-3Q7264EJ.js';import {b}from'./chunk-6KD5F6LX.js';import {promises}from'fs';import g from'path';import r from'chalk';import R from'ora';import {execa}from'execa';var y="21",$="3.5.0",j="2.8.9";function u(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,".").replace(/^\.+|\.+$/g,"").replace(/\.{2,}/g,".").split(".").map(p=>p.replace(/^[^a-z]+/,"").replace(/[^a-z0-9]/g,"")).filter(Boolean).join(".")}function _(e,t){return e.replace(/[\r\n\t]+/g," ").trim()||t}function x(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function M(e,t){let s=u(e)||"com.rapidkit.apps",p=u(t)||"service";return `${s}.${p}`}function E(e){return e.replace(/\./g,"/")}function T(){return JSON.stringify({engine:"npm",runtime:"java"},null,2)}function A(e,t){return JSON.stringify({kit_name:"springboot.standard",runtime:"java",module_support:false,project_name:e.project_name,artifact_id:e.artifact_id,group_id:e.group_id,package_name:e.package_name,app_version:e.app_version,created_by:"rapidkit-npm",rapidkit_version:t,created_at:new Date().toISOString()},null,2)}function P(e){return `<?xml version="1.0" encoding="UTF-8"?>
2
2
  <project xmlns="http://maven.apache.org/POM/4.0.0"
3
3
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
4
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -1 +1 @@
1
- export{e as createProject,d as createWorkspace,g as createWorkspaceShareBundle,f as listWorkspaces,c as registerProjectInWorkspace,a as registerWorkspace,b as syncWorkspaceProjects}from'./chunk-5NBYSXOZ.js';
1
+ export{e as createProject,d as createWorkspace,g as createWorkspaceShareBundle,f as listWorkspaces,c as registerProjectInWorkspace,a as registerWorkspace,b as syncWorkspaceProjects}from'./chunk-RXWM5DSC.js';
@@ -0,0 +1,25 @@
1
+ import {b,c,d}from'./chunk-OWNGSAO3.js';import n from'path';import g from'fs-extra';var U="rapidkit-agent-reports-index.v1",H="rapidkit-agent-customization-pack.v1",S=".rapidkit/reports/INDEX.json",z=".rapidkit/AGENT-GROUNDING.md",y=".rapidkit/reports/agent-customization-pack.json",O=[{relativePath:b,label:"Agent context pack",required:true},{relativePath:".rapidkit/reports/workspace-model.json",label:"Workspace model graph",required:false},{relativePath:".rapidkit/reports/doctor-last-run.json",label:"Workspace doctor",required:false},{relativePath:".rapidkit/reports/analyze-last-run.json",label:"Workspace analyze",required:false},{relativePath:".rapidkit/reports/pipeline-last-run.json",label:"Governance pipeline",required:false},{relativePath:".rapidkit/reports/release-readiness-last-run.json",label:"Release readiness",required:false},{relativePath:".rapidkit/reports/workspace-impact-last-run.json",label:"Workspace impact",required:false},{relativePath:".rapidkit/reports/workspace-verify-last-run.json",label:"Workspace verify",required:false}];function m(e){return `npx rapidkit ${e}`.trim()}function _(e){return e&&typeof e=="object"?e:null}function G(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function X(e){let t=G(e.blockers,12);if(t.length>0)return t;let r=G(e.blockingReasons,12);if(r.length>0)return r;let i=_(e.summary);return i&&Array.isArray(i.blockingReasons)?G(i.blockingReasons,12):[]}function F(e){for(let t of ["generatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}}function V(e,t,r){if(!e)return true;let i=Date.parse(e);return Number.isFinite(i)?r.getTime()-i>t*60*60*1e3:true}function B(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]):new Set(t)}function h(e,t){return e.has("all")||e.has(t)}function J(e){return h(e,"copilot")||h(e,"vscode")}function Z(e){return e??"enterprise"}function Y(e){return e.includes("hooks")||e.endsWith("rapidkit-agent-hooks.json")?"hook":e.includes("mcp")||e.endsWith("rapidkit-mcp-design.json")?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function Q(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function ee(e,t){return new Set([S,y,"AGENTS.md"]).has(e)?true:t==="minimal"?false:[".github/instructions/rapidkit-workspace.instructions.md",".github/prompts/rapidkit-diagnose.prompt.md",".github/skills/rapidkit-workspace-intelligence/SKILL.md",".github/agents/workspai-advisor.agent.md"].includes(e)}function te(e){return e.length>0&&!n.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function re(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(i=>i.targets.includes(r)).map(i=>i.path).sort()}]))}async function ne(e){try{if(!await g.pathExists(e))return null;let t=await g.readJson(e);return _(t)}catch{return null}}async function ie(e){let t=e.now??new Date,r=e.staleAfterHours??24,i=[],l=[];for(let d of O){let s=n.join(e.workspacePath,d.relativePath),u=await ne(s),x=u!==null;x&&u&&l.push(...X(u)),i.push({path:d.relativePath,label:d.label,required:d.required,exists:x,generatedAt:u?F(u):void 0,commandId:typeof u?.commandId=="string"?u.commandId:void 0,exitCode:typeof u?.exitCode=="number"?u.exitCode:void 0});}let T=[...new Set(l.map(d=>d.trim()).filter(Boolean))].slice(0,16);return {schemaVersion:U,generatedAt:t.toISOString(),workspaceRoot:e.workspacePath,readOrder:O.map(d=>d.relativePath),blockers:T,staleAfterHours:r,reports:i,refreshCommand:m("workspace agent-sync --write --refresh-context")}}function L(e){let t=["# RapidKit agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","","1. `.rapidkit/reports/INDEX.json` \u2014 latest blockers, timestamps, and report paths","2. `.rapidkit/reports/workspace-context-agent.json` \u2014 canonical agent context pack","3. Evidence artifacts listed in the index (doctor, analyze, pipeline, readiness, impact, verify)","","Do **not** full-repo scan until these reports are read or regenerated.","","## Regenerate intelligence","","```bash",m("workspace agent-sync --write --refresh-context"),m("workspace context --for-agent --json --write"),m("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t.push(`- ${r}`);t.push("");}if(e.context?.safeCommands?.length){t.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t.push(`- \`${r.display}\` \u2014 ${r.description}`);t.push("");}return t.push("## Rules","","- Treat `.rapidkit/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic RapidKit CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.",""),t.join(`
2
+ `)}function oe(e){return ["# RapidKit agent grounding","",`Generated: ${e.generatedAt}`,"","This file is tool-agnostic. Synced agents should read it together with `.rapidkit/reports/INDEX.json`.","","## Mandatory read order","",...e.readOrder.map((t,r)=>`${r+1}. \`${t}\``),"",e.blockers.length>0?"## Blockers":"",...e.blockers.length>0?e.blockers.map(t=>`- ${t}`):[],"","## Refresh","","```bash",e.refreshCommand,"```",""].filter(t=>t!=="").join(`
3
+ `)}function se(){return ["# RapidKit workspace grounding","","Before answering workspace, release, or architecture questions:","","1. Read `AGENTS.md` (managed RapidKit section).","2. Read `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","3. Use evidence reports before scanning the full repository.","","Regenerate stale intelligence:","","```bash",m("workspace agent-sync --write --refresh-context"),"```",""].join(`
4
+ `)}function ae(){return ["## Claude Code","","- Load `.rapidkit/reports/INDEX.json` before diagnosing blockers.","- Use `.claude/rules/rapidkit-evidence.md` when editing files under `.rapidkit/`.","- Refresh grounding with `npx rapidkit workspace agent-sync --write`.",""].join(`
5
+ `)}function ce(){return ["---","description: RapidKit workspace evidence and intelligence grounding","globs: []","alwaysApply: true","---","","Before proposing fixes in this workspace:","","1. Read `AGENTS.md` and `.rapidkit/reports/INDEX.json`.","2. Read `.rapidkit/reports/workspace-context-agent.json`.","3. Prefer evidence in `.rapidkit/reports/*` over full-repo exploration.","","Refresh when stale:","","```bash",m("workspace agent-sync --write --refresh-context"),"```",""].join(`
6
+ `)}function de(){return ["---",'applyTo: ".rapidkit/**,**/.rapidkit/**"',"description: RapidKit evidence and intelligence artifacts","---","","When working under `.rapidkit/`:","","- Treat JSON reports as canonical gate and health evidence.","- Start from `reports/INDEX.json` for read order and blockers.","- Do not invent pass/fail state \u2014 cite `exitCode`, `blockers`, and `generatedAt` fields.",""].join(`
7
+ `)}function pe(){return ["---",'applyTo: "**"',"description: RapidKit workspace scope, evidence, and command discipline","---","","# RapidKit Workspace Intelligence","","Use RapidKit reports as the workspace source of truth before giving architectural, repair, release, or project lifecycle advice.","","## Scope rules","","- Start from `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","- Distinguish workspace-level blockers from project-level blockers.","- When a project is active, cite its name, path, framework, and evidence source.","- Do not translate unsupported stack requests into unrelated native kits.","","## Answer contract","","Return answers with: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.",""].join(`
8
+ `)}function le(){return ["# RapidKit evidence","","Applies when reading or editing `.rapidkit/reports/*`.","","- Start from `INDEX.json`, then `workspace-context-agent.json`.","- Use report blockers as the primary fix target.","- Regenerate with `npx rapidkit workspace agent-sync --write`.",""].join(`
9
+ `)}function ue(){return ["---","description: Diagnose RapidKit workspace blockers from evidence reports","---","","Diagnose this workspace using RapidKit evidence only.","","Read:","","- `.rapidkit/reports/INDEX.json`","- `.rapidkit/reports/workspace-context-agent.json`","- Any fail/warn reports referenced in the index","","Return:","","1. Root cause grounded in report blockers","2. Smallest safe fix path (commands + file edits)","3. One verification command to prove recovery",""].join(`
10
+ `)}function E(e){return ["---",`description: ${e.description}`,"---","",e.objective,"","Read first:","","- `.rapidkit/reports/INDEX.json`","- `.rapidkit/reports/workspace-context-agent.json`","- Any report referenced by the current blocker or task","","Return:","",...e.expectedOutput.map((t,r)=>`${r+1}. ${t}`),"","Use the standard RapidKit answer contract: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.",""].join(`
11
+ `)}function A(e){return ["# "+e.title,"",...e.lines,""].join(`
12
+ `)}function ge(){return A({title:"MCP Tool Design",lines:["RapidKit MCP is a future read-mostly bridge. Use the CLI reports today; do not assume a running MCP server exists.","","Candidate read tools:","- `getWorkspaceModel` \u2014 read `.rapidkit/reports/workspace-model.json`.","- `getEvidenceIndex` \u2014 read `.rapidkit/reports/INDEX.json`.","- `getBlockers` \u2014 derive current blockers from INDEX and gate reports.","- `getSafeCommands` \u2014 read safe commands from `workspace-context-agent.json`.","- `getProjectContext` \u2014 return one project-scoped slice of the workspace model.","- `getArtifact` \u2014 read one explicit artifact path inside the workspace root.","- `refreshWorkspaceIntelligence` \u2014 explicit user-approved refresh command only.","","Write or repair tools require explicit approval boundaries and are intentionally not part of the first read-mostly design."]})}function me(e){return `${JSON.stringify({schemaVersion:"rapidkit-mcp-design.v1",generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,status:"design-only",mode:"read-mostly",safety:{writeToolsEnabled:false,approvalRequiredForRefresh:true,artifactReadsMustStayInsideWorkspace:true},candidateTools:[{name:"getWorkspaceModel",reads:[".rapidkit/reports/workspace-model.json"],mutates:false},{name:"getEvidenceIndex",reads:[".rapidkit/reports/INDEX.json"],mutates:false},{name:"getBlockers",reads:[".rapidkit/reports/INDEX.json",".rapidkit/reports/workspace-verify-last-run.json",".rapidkit/reports/pipeline-last-run.json"],mutates:false},{name:"getSafeCommands",reads:[".rapidkit/reports/workspace-context-agent.json"],mutates:false},{name:"getProjectContext",reads:[".rapidkit/reports/workspace-model.json",".rapidkit/reports/workspace-context-agent.json"],mutates:false},{name:"getArtifact",reads:["requested workspace-relative artifact path"],mutates:false},{name:"refreshWorkspaceIntelligence",command:m("workspace agent-sync --write --refresh-context"),mutates:true,approvalRequired:true}]},null,2)}
13
+ `}function ke(e){return `${JSON.stringify({schemaVersion:"rapidkit-agent-hooks.v1",generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,enabledByDefault:false,mode:"advisory",hooks:[{name:"rapidkit-pre-tool-use-workspace-boundary",event:"PreToolUse",purpose:"Block or warn on state-changing commands outside the active workspace root.",defaultAction:"warn",rules:["Allow read-only commands.","Warn before write/delete commands outside workspaceRoot.","Never run destructive commands without explicit user approval."]},{name:"rapidkit-post-tool-use-verify-suggestion",event:"PostToolUse",purpose:"Suggest non-destructive verification commands after edits.",defaultAction:"suggest",commands:[m("doctor workspace"),m("workspace verify --strict --json")]},{name:"rapidkit-user-prompt-submit-scope-hint",event:"UserPromptSubmit",purpose:"Inject lightweight workspace scope and evidence index hints.",defaultAction:"inject-context-hint",reads:[".rapidkit/reports/INDEX.json",".rapidkit/reports/workspace-context-agent.json"]}]},null,2)}
14
+ `}function fe(){return ["---","name: rapidkit-workspace-intelligence","description: Use RapidKit workspace intelligence reports to answer, repair, verify, and release with evidence","---","","# RapidKit Workspace Intelligence","","Use this skill for workspace architecture, project lifecycle, blocker repair, release readiness, agent grounding, and CI evidence questions.","","## Decision flow","","1. Load `resources/scope-model.md`.","2. Load `.rapidkit/reports/INDEX.json`.","3. Load `.rapidkit/reports/workspace-context-agent.json`.","4. Load the smallest evidence report required for the task.","5. Answer with Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Rules","","- Prefer RapidKit reports over full-repo scans.","- Never claim a gate passed without a cited report.","- Separate display commands from execution requests.","- Keep project-scoped fixes inside the active project unless workspace evidence says otherwise.",""].join(`
15
+ `)}function P(e){return ["---",`name: ${e.name}`,`description: ${e.description}`,`tools: [${e.tools.map(t=>`'${t}'`).join(", ")}]`,"---","",`You are the ${e.name} agent for RapidKit Workspace Intelligence.`,"",`Mode: ${e.mode}.`,"","Start every task by reading `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","","Use this answer contract:","","- Scope","- Evidence","- Diagnosis","- Fix Plan","- Run","- Verify","- Assumptions","","Do not invent health, readiness, or policy status. Cite report paths and command outputs.",""].join(`
16
+ `)}function he(){return ["---","name: rapidkit-grounding","description: Load RapidKit workspace intelligence reports before diagnosing or changing code","---","","# RapidKit grounding","","Use when the user asks about workspace health, release gates, doctor/pipeline failures, or project structure.","","## Workflow","","1. Read `.rapidkit/reports/INDEX.json`","2. Read `.rapidkit/reports/workspace-context-agent.json`","3. Read fail/warn evidence artifacts listed in the index","4. Propose the smallest safe fix with explicit verification commands","","## Refresh stale evidence","","```bash",m("workspace agent-sync --write --refresh-context"),"```",""].join(`
17
+ `)}async function p(e,t,r){return r?(await g.ensureDir(n.dirname(e)),await g.writeFile(e,t,"utf8"),"written"):"skipped"}async function W(e){if(!e.write)return "skipped";let t=await g.pathExists(e.absolutePath)?await g.readFile(e.absolutePath,"utf8"):null,{upsertManagedAgentSection:r}=await import('./managed-agent-markers-AXUM75OE.js'),i=r(t,e.generatedBody),l=e.preamble?`${e.preamble.trimEnd()}
18
+
19
+ ${i}`:i;return await g.ensureDir(n.dirname(e.absolutePath)),await g.writeFile(e.absolutePath,l,"utf8"),"written"}function je(e){if(!e?.trim())return;let t=new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]),r=e.split(",").map(i=>i.trim().toLowerCase()).filter(i=>t.has(i));return r.length>0?r:void 0}function we(e){let t=[...e.outputs].sort((r,i)=>r.path.localeCompare(i.path));return {schemaVersion:H,generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,preset:e.preset,targets:[...e.targets].sort(),sourceReports:e.index.reports.filter(r=>r.exists).map(r=>r.path).sort(),outputInventory:t,capabilityMatrix:re({targets:e.targets,outputs:t}),drift:{missingRequired:e.missingRequired,staleReports:e.staleReports,strictViolations:e.strictViolations},answerContract:["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"],refreshCommand:m(`workspace agent-sync --write --refresh-context --preset ${e.preset}`),experimental:{hooksEnabled:e.experimentalHooks,mcpReady:t.some(r=>r.kind==="mcp-design")}}}async function ve(e){let t=n.resolve(e.workspacePath),r=new Date,i=e.staleAfterHours??24,l=B(e.targets),T=[...l].sort(),d$1=Z(e.preset),s=e.write===true,u=e.strict===true,x,j=null;e.refreshContext&&(j=await c({workspacePath:t,agent:e.agent??"generic",scope:e.scope,includeEvidence:true}),s&&(x=await d(j,t)));let k=await ie({workspacePath:t,staleAfterHours:i,now:r}),v=k.reports.filter(o=>o.required&&!o.exists).map(o=>o.path),C=k.reports.filter(o=>o.exists&&V(o.generatedAt,i,r)).map(o=>o.path),R=[];u&&(v.length>0&&R.push(`Missing required reports: ${v.join(", ")}`),C.length>0&&R.push(`Stale reports (>${i}h): ${C.join(", ")}`));let I=[],N=[],D=[],a=(o,c)=>{o==="written"?I.push(c):N.push(c),D.push({path:c,kind:Y(c),targets:Q(c),required:ee(c,d$1),status:o==="written"?"written":e.dryRun?"planned":"skipped"});};if(a(await p(n.join(t,S),`${JSON.stringify(k,null,2)}
20
+ `,s),S),a(await p(n.join(t,z),`${oe(k)}
21
+ `,s),z),(h(l,"agents")||h(l,"vscode"))&&a(await W({absolutePath:n.join(t,"AGENTS.md"),generatedBody:L({index:k,context:j}),write:s}),"AGENTS.md"),h(l,"claude")){let o=n.join(t,"CLAUDE.md");if(s){let{upsertManagedAgentSection:c}=await import('./managed-agent-markers-AXUM75OE.js'),f=await g.pathExists(o)?await g.readFile(o,"utf8"):"",w=c(f,ae()),b=w.includes("@AGENTS.md")?w:`@AGENTS.md
22
+
23
+ ${w}`;await g.ensureDir(n.dirname(o)),await g.writeFile(o,b,"utf8"),I.push("CLAUDE.md");}else N.push("CLAUDE.md");a(await p(n.join(t,".claude/rules/rapidkit-evidence.md"),`${le()}
24
+ `,s),".claude/rules/rapidkit-evidence.md");}if(h(l,"cursor")&&a(await p(n.join(t,".cursor/rules/rapidkit-grounding.mdc"),ce(),s),".cursor/rules/rapidkit-grounding.mdc"),J(l)){if(a(await W({absolutePath:n.join(t,".github/copilot-instructions.md"),generatedBody:se(),write:s}),".github/copilot-instructions.md"),a(await p(n.join(t,".github/instructions/rapidkit-workspace.instructions.md"),pe(),s),".github/instructions/rapidkit-workspace.instructions.md"),a(await p(n.join(t,".github/instructions/rapidkit-evidence.instructions.md"),de(),s),".github/instructions/rapidkit-evidence.instructions.md"),a(await p(n.join(t,".github/prompts/rapidkit-diagnose.prompt.md"),ue(),s),".github/prompts/rapidkit-diagnose.prompt.md"),d$1==="enterprise"){let o=[[".github/prompts/rapidkit-repair.prompt.md",E({description:"Repair RapidKit blockers with evidence and verification",objective:"Plan the smallest safe repair for the current RapidKit blocker.",expectedOutput:["Blocker and affected workspace/project scope","Evidence paths and exact failing signals","Minimal fix plan","Human-run commands","Verification command and expected success signal"]})],[".github/prompts/rapidkit-release-readiness.prompt.md",E({description:"Assess RapidKit release readiness from evidence",objective:"Assess whether this workspace is release-ready using RapidKit gates.",expectedOutput:["Readiness verdict with cited reports","Blocking gates","Safe next command","Verification checklist"]})],[".github/prompts/rapidkit-project-onboard.prompt.md",E({description:"Onboard a project into RapidKit Workspace Intelligence",objective:"Guide project onboarding using workspace model and create planner capabilities.",expectedOutput:["Target project scope","Native create, external create-adopt, or adopt-only lane","Safe commands","Post-onboarding verification"]})],[".github/prompts/rapidkit-adopt-project.prompt.md",E({description:"Adopt an existing project into RapidKit governance",objective:"Adopt an existing project without changing its runtime behavior.",expectedOutput:["Detected stack and confidence","Adoption plan","Generated metadata expectations","Doctor and workspace model verification"]})]];for(let[c,f]of o)a(await p(n.join(t,c),f,s),c);}if(a(await p(n.join(t,".github/skills/rapidkit-grounding/SKILL.md"),he(),s),".github/skills/rapidkit-grounding/SKILL.md"),d$1==="enterprise"){a(await p(n.join(t,".github/skills/rapidkit-workspace-intelligence/SKILL.md"),fe(),s),".github/skills/rapidkit-workspace-intelligence/SKILL.md");let o=[["artifact-map.md",A({title:"Artifact Map",lines:O.map(f=>`- \`${f.relativePath}\` \u2014 ${f.label}`)})],["command-map.md",A({title:"Command Map",lines:["- `npx rapidkit workspace agent-sync --write --refresh-context` \u2014 refresh agent grounding.","- `npx rapidkit workspace model --json --write` \u2014 refresh workspace model.","- `npx rapidkit doctor workspace` \u2014 refresh health evidence.","- `npx rapidkit workspace verify --strict --json` \u2014 verify release gates."]})],["scope-model.md",A({title:"Scope Model",lines:["- Workspace scope is the default source of truth.","- Project scope is selected only when the active task targets a specific project.","- Always name the workspace and project when giving repair or lifecycle advice."]})],["runtime-support.md",A({title:"Runtime Support",lines:["- Native create is available only for RapidKit-owned scaffold contracts.","- Unsupported stacks should use external-create-adopt when a stable ecosystem generator exists.","- Existing projects should use adopt-only when native create is unavailable."]})],["create-planner-capabilities.md",A({title:"Create Planner Capabilities",lines:["- Use `contracts/create-planner-capabilities.v1.json` to decide native-create, external-create-adopt, or adopt-only.","- Do not map PHP, WordPress, Laravel, Rails, or Symfony requests to unrelated native kits.","- Explain unsupported native create requests and guide users to adopt/import."]})],["mcp-tools.md",ge()]];for(let[f,w]of o){let b=`.github/skills/rapidkit-workspace-intelligence/resources/${f}`;a(await p(n.join(t,b),w,s),b);}let c=[["workspai-advisor.agent.md",P({name:"Workspai Advisor",description:"Read-only workspace and project guidance using RapidKit evidence",mode:"read-only",tools:["search","read"]})],["workspai-repair.agent.md",P({name:"Workspai Repair",description:"Turn RapidKit blockers into minimal fixes and verification steps",mode:"repair",tools:["search","read","edit"]})],["workspai-release.agent.md",P({name:"Workspai Release",description:"Assess readiness, governance gates, and release safety from evidence",mode:"release",tools:["search","read"]})],["workspai-project-onboarder.agent.md",P({name:"Workspai Project Onboarder",description:"Guide create, import, and adopt flows with RapidKit contracts",mode:"onboard",tools:["search","read","edit"]})]];for(let[f,w]of c){let b=`.github/agents/${f}`;a(await p(n.join(t,b),w,s),b);}}}if(d$1==="enterprise"&&a(await p(n.join(t,".rapidkit/reports/rapidkit-mcp-design.json"),me({workspacePath:t,generatedAt:k.generatedAt}),s),".rapidkit/reports/rapidkit-mcp-design.json"),d$1==="enterprise"&&e.experimentalHooks===true&&a(await p(n.join(t,".vscode/rapidkit-agent-hooks.json"),ke({workspacePath:t,generatedAt:k.generatedAt}),s),".vscode/rapidkit-agent-hooks.json"),(h(l,"codex")||h(l,"orca"))&&(h(l,"agents")||a(await W({absolutePath:n.join(t,"AGENTS.md"),generatedBody:L({index:k,context:j}),write:s}),"AGENTS.md")),u){let o=D.map(c=>c.path).filter(c=>!te(c));o.length>0&&R.push(`Unsafe generated output paths: ${o.join(", ")}`);}let K=we({workspacePath:t,generatedAt:r.toISOString(),preset:d$1,targets:T,index:k,outputs:[...D,{path:y,kind:"report",targets:["agents","vscode","copilot","codex","orca"],required:true,status:s?"written":e.dryRun?"planned":"skipped"}],missingRequired:v,staleReports:C,strictViolations:R,experimentalHooks:e.experimentalHooks===true});return a(await p(n.join(t,y),`${JSON.stringify(K,null,2)}
25
+ `,s),y),{workspacePath:t,indexPath:n.join(t,S),packPath:n.join(t,y),pack:K,contextPath:x,writtenFiles:I,skippedFiles:N,blockers:k.blockers,missingRequired:v,staleReports:C,strictViolations:R}}export{y as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,H as AGENT_CUSTOMIZATION_PACK_SCHEMA,z as AGENT_GROUNDING_DOC_PATH,S as AGENT_REPORTS_INDEX_PATH,U as AGENT_REPORTS_INDEX_SCHEMA,O as AGENT_REPORT_CATALOG,ie as buildWorkspaceAgentReportsIndex,je as parseAgentGroundingTargets,ve as syncWorkspaceAgentGrounding};
@@ -1 +1 @@
1
- export{b as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,a as WORKSPACE_CONTEXT_SCHEMA_VERSION,c as buildWorkspaceAgentContext,d as writeWorkspaceAgentContext}from'./chunk-IW3KLQXE.js';
1
+ export{b as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,a as WORKSPACE_CONTEXT_SCHEMA_VERSION,c as buildWorkspaceAgentContext,d as writeWorkspaceAgentContext}from'./chunk-OWNGSAO3.js';
@@ -1 +1 @@
1
- import {b}from'./chunk-TVIOAZ6E.js';import {a}from'./chunk-RV6HBTFC.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-MIPHVB56.js');return await y(t),{workspacePath:t,created:s,status:s.length>0?"passed":"skipped"}}export{W as ensureWorkspaceFoundation};
1
+ import {b}from'./chunk-ERCD6NFF.js';import {a}from'./chunk-RV6HBTFC.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-MIPHVB56.js');return await y(t),{workspacePath:t,created:s,status:s.length>0?"passed":"skipped"}}export{W as ensureWorkspaceFoundation};
@@ -0,0 +1,3 @@
1
+ import {a as a$2}from'./chunk-PYCJWW4B.js';import {a as a$1}from'./chunk-HTYMXMQM.js';import {a,b}from'./chunk-S5KTATOU.js';function m(t,n){return [...t.values()].filter(r=>r.id!==n).map(r=>({id:r.id,distance:r.distance,path:r.path,via:r.via})).sort((r,s)=>r.distance-s.distance||r.id.localeCompare(s.id))}function x(t,n){let r=a(t);if(!r.nodeIds.has(n))return {project:n,found:false,centrality:null,directDependents:[],directDependencies:[],transitiveDependents:[],transitiveDependencies:[]};let e=a$1(t).byId.get(n)??null,o=b(r,[n],{direction:"dependents"}),u=b(r,[n],{direction:"dependencies"}),f=(r.reverse.get(n)??[]).slice().sort((d,i)=>d.localeCompare(i)),k=(r.forward.get(n)??[]).slice().sort((d,i)=>d.localeCompare(i));return {project:n,found:true,centrality:e,directDependents:f,directDependencies:k,transitiveDependents:m(o,n),transitiveDependencies:m(u,n)}}function c(t){return t.replace(/"/g,'\\"')}var G={"code-import":"solid","package-dep":"solid","event-pub-sub":"dashed","service-dependsOn":"bold","shared-resource":"dotted"};function C(t){let n=[...t.nodes].sort((e,o)=>e.id.localeCompare(o.id)),r=[...t.edges].sort((e,o)=>e.from.localeCompare(o.from)||e.to.localeCompare(o.to)||e.kind.localeCompare(o.kind)),s=["digraph workspace {"," rankdir=LR;"," node [shape=box];"];for(let e of n)s.push(` "${c(e.id)}";`);for(let e of r){let o=G[e.kind]??"solid";s.push(` "${c(e.from)}" -> "${c(e.to)}" [label="${e.kind}", style=${o}];`);}return s.push("}"),s.join(`
2
+ `)}function l(t){let n=t.replace(/[^A-Za-z0-9_]/g,"_");return /^[A-Za-z_]/.test(n)?n:`n_${n}`}function I(t){let n=[...t.nodes].sort((e,o)=>e.id.localeCompare(o.id)),r=[...t.edges].sort((e,o)=>e.from.localeCompare(o.from)||e.to.localeCompare(o.to)||e.kind.localeCompare(o.kind)),s=["flowchart LR"];for(let e of n)s.push(` ${l(e.id)}["${e.id}"]`);for(let e of r)s.push(` ${l(e.from)} -->|${e.kind}| ${l(e.to)}`);return s.join(`
3
+ `)}function $(t){return {graph:t,integrity:a$2(t),hotspots:a$1(t).hotspots}}export{$ as buildGraphEmit,x as explainGraphNode,C as renderGraphDot,I as renderGraphMermaid};
@@ -0,0 +1 @@
1
+ import a from'path';import i from'fs-extra';var c="workspace-intelligence-history.v1",y=".rapidkit/reports/workspace-intelligence-history.json",p=50;function H(e,t){return {generatedAt:e.generatedAt,kind:"verify",verdict:e.summary.verdict,risk:e.impact.risk,affectedProjects:e.impact.affectedProjects,freshness:e.freshness.verdict,gatePassed:t,blockingReasons:e.blockingReasons.length,policyViolations:e.policyViolations.length}}async function l(e){let t=a.join(e,y);try{if(!await i.pathExists(t))return null;let r=await i.readJson(t);return r?.schemaVersion!==c||!Array.isArray(r.entries)?null:{schemaVersion:c,retention:typeof r.retention=="number"?r.retention:p,entries:r.entries}}catch{return null}}function m(e,t,r=p){let o=Math.max(1,Math.floor(r)),s=[...e?.entries??[],t],n=s.slice(Math.max(0,s.length-o));return {schemaVersion:c,retention:o,entries:n}}async function h(e,t,r){let o=await l(e),s=m(o,t,r?.retention??p),n=a.join(e,y);return await i.ensureDir(a.dirname(n)),await i.writeJson(n,s,{spaces:2}),s}export{p as DEFAULT_HISTORY_RETENTION,y as WORKSPACE_HISTORY_PATH,c as WORKSPACE_HISTORY_SCHEMA_VERSION,m as appendHistoryEntry,H as historyEntryFromVerify,l as readWorkspaceHistory,h as recordWorkspaceHistory};
@@ -1 +1 @@
1
- export{f as WORKSPACE_IMPACT_REPORT_PATH,e as WORKSPACE_IMPACT_SCHEMA_VERSION,d as WORKSPACE_MODEL_DIFF_REPORT_PATH,b as WORKSPACE_MODEL_DIFF_SCHEMA_VERSION,c as WORKSPACE_MODEL_SNAPSHOT_REPORT_PATH,a as WORKSPACE_MODEL_SNAPSHOT_SCHEMA_VERSION,n as buildWorkspaceImpact,i as buildWorkspaceModelSnapshot,k as diffWorkspaceModel,g as isGitDiffSource,h as parseGitDiffRef,m as workspaceVerificationPlan,o as writeWorkspaceImpact,l as writeWorkspaceModelDiff,j as writeWorkspaceModelSnapshot}from'./chunk-ABPDGFVD.js';
1
+ export{f as WORKSPACE_IMPACT_REPORT_PATH,e as WORKSPACE_IMPACT_SCHEMA_VERSION,d as WORKSPACE_MODEL_DIFF_REPORT_PATH,b as WORKSPACE_MODEL_DIFF_SCHEMA_VERSION,c as WORKSPACE_MODEL_SNAPSHOT_REPORT_PATH,a as WORKSPACE_MODEL_SNAPSHOT_SCHEMA_VERSION,n as buildWorkspaceImpact,i as buildWorkspaceModelSnapshot,k as diffWorkspaceModel,g as isGitDiffSource,h as parseGitDiffRef,m as workspaceVerificationPlan,o as writeWorkspaceImpact,l as writeWorkspaceModelDiff,j as writeWorkspaceModelSnapshot}from'./chunk-QPEBI6AB.js';
@@ -0,0 +1 @@
1
+ export{c as WORKSPACE_MODEL_REPORT_PATH,b as WORKSPACE_MODEL_SCHEMA_VERSION,e as buildWorkspaceModel,f as buildWorkspaceModelCached,g as buildWorkspaceModelIncremental,d as validateWorkspaceModelStrict,h as writeWorkspaceModel}from'./chunk-TYZPPUBH.js';
@@ -0,0 +1 @@
1
+ export{a as runWorkspaceStage}from'./chunk-NAMOYGLS.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-FV5A3N3I.js';
@@ -0,0 +1 @@
1
+ import {a,b as b$2}from'./chunk-PYCJWW4B.js';import {b as b$1,c,d}from'./chunk-KYH364KQ.js';import {m,f,c as c$1,n,e as e$1}from'./chunk-QPEBI6AB.js';import {e}from'./chunk-TYZPPUBH.js';import {c as c$2}from'./chunk-FV5A3N3I.js';import u from'path';import h from'fs-extra';var _="workspace-verify.v1",H=".rapidkit/reports/workspace-verify-last-run.json";function T(e,s){return u.isAbsolute(s)?s:u.join(e,s)}async function q(e){let s=await h.readJson(e);if(!s||typeof s!="object"||Array.isArray(s))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let t=s;if(t.schemaVersion!==e$1)throw new Error(`Unsupported workspace impact schema: ${String(t.schemaVersion)}`);return t}function z(e){let s=new Set,t=[];for(let r of e){let n=`${r.scope}:${r.project??""}:${r.display}`;s.has(n)||(s.add(n),t.push(r));}return t}function L(e,s){if(!e||e==="workspace")return true;let t=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return s.scope==="workspace"?true:(s.project??"").trim().toLowerCase()===t}function B(e,s){if(e.id==="workspace.doctor")return u.join(s,".rapidkit","reports","doctor-last-run.json");if(e.id==="workspace.contract.verify")return u.join(s,".rapidkit","reports","workspace-contract-verify-last-run.json");if(e.id==="workspace.readiness")return u.join(s,".rapidkit","reports","release-readiness-last-run.json");if(e.id==="workspace.analyze")return u.join(s,".rapidkit","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return u.join(s,".rapidkit","reports","pipeline-last-run.json");if(e.id.startsWith("project.")&&(e.id.endsWith(".test")||e.id.endsWith(".build")))return u.join(s,".rapidkit","reports","workspace-run-last.json")}function b(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function J(e){let s=b(e.healthScore),t=typeof s?.errors=="number"?s.errors:0,r=typeof s?.percent=="number"?s.percent:void 0;return t>0?{status:"fail",message:`Doctor evidence reports ${t} error(s).`}:typeof r=="number"&&r<70?{status:"warn",message:`Doctor health score is ${r}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function K(e){let s=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return s==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:s==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:s==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${s}.`}}function G(e){let s=typeof e.status=="string"?e.status:"unknown";return s==="failed"||s==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:s==="passed"||s==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${s}.`}}function Y(e){let s=b(e.summary);if(s?.blocking===true||e.blocking===true)return {status:"fail",message:"Analyze evidence reports blocking findings."};let r=typeof s?.status=="string"?s.status:void 0;return r==="warn"||r==="warning"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is present."}}function U(e){let s=b(e.summary),t=typeof s?.verdict=="string"?s.verdict:void 0;return t==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:t==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:t==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function Q(e,s,t){let r=s.id.endsWith(".build")?"build":s.id.endsWith(".test")?"test":null,n=c$2(e,r);if(!n)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let c=n.stage;if(r&&c!==r)return {status:"missing",message:`Workspace run evidence is for stage "${c}", expected "${r}".`};let d=Array.isArray(n.projects)?n.projects:[],o=s.project?.toLowerCase();if(!o)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let p=d.find(g=>{let f=b(g);if(!f)return false;let i=typeof f.projectName=="string"?f.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(l=>f[l]).filter(l=>typeof l=="string"&&l.trim().length>0).map(l=>l.replace(/\\/g,"/").toLowerCase());return i===o||a.some(l=>l.endsWith(`/${o}`)||l===o)});if(p){let g=v(n.generatedAt,t,`Workspace run evidence for ${s.project??s.id}`);if(g)return {status:"fail",message:g};let f=b(p),i=typeof f?.status=="string"?f.status:"unknown";return i==="failed"?{status:"fail",message:`Workspace run evidence failed for ${s.project}.`}:i==="passed"?{status:"pass",message:`Workspace run evidence passed for ${s.project}.`}:i==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${s.project}.`}:{status:"warn",message:`Workspace run evidence status is ${i} for ${s.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${s.project}.`}}function v(e,s,t){if(typeof e!="string"||!s)return null;let r=Date.parse(e),n=Date.parse(s);return !Number.isFinite(r)||!Number.isFinite(n)?null:r<n?`${t} is stale: generated at ${e}, before impact ${s}.`:null}async function X(e,s,t,r){let n=B(e,s),c=n?u.relative(s,n).split(u.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!t)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};if(!n||!await h.pathExists(n))return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:c,message:c?`Missing evidence report: ${c}`:"No evidence mapping exists for this command."};let d=b(await h.readJson(n));if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:c,message:"Evidence report is not a JSON object."};let o;if(e.id==="workspace.doctor"){let p=v(d.generatedAt,r,"Doctor evidence");p?o={status:"fail",message:p}:o=J(d);}else if(e.id==="workspace.readiness"){let p=v(d.generatedAt,r,"Release readiness evidence");p?o={status:"fail",message:p}:o=K(d);}else if(e.id==="workspace.contract.verify"){let p=v(d.generatedAt,r,"Workspace contract verify evidence");p?o={status:"fail",message:p}:o=G(d);}else if(e.id==="workspace.analyze"){let p=v(d.generatedAt,r,"Analyze evidence");p?o={status:"fail",message:p}:o=Y(d);}else if(e.id==="workspace.pipeline"){let p=v(d.generatedAt,r,"Pipeline evidence");p?o={status:"fail",message:p}:o=U(d);}else if(e.id.startsWith("project."))o=Q(d,e,r);else {let p=v(d.generatedAt,r,"Evidence report");p?o={status:"fail",message:p}:o={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:o.status,required:e.required,evidencePath:c,message:o.message}}function Z(e,s={blockingReasons:[],needsAttention:false}){let t=e.filter(i=>i.status==="pass").length,r=e.filter(i=>i.status==="warn").length,n=e.filter(i=>i.status==="fail").length,c=e.filter(i=>i.status==="missing").length,d=e.filter(i=>i.status==="skipped").length,o=e.filter(i=>i.required&&(i.status==="fail"||i.status==="missing")).map(i=>`${i.id}: ${i.message}`),p=e.filter(i=>i.required&&i.status==="missing").length,g="ready",f=0;return o.length>0||s.blockingReasons.length>0?(g="blocked",f=2):(r>0||p>0||s.needsAttention)&&(g="needs-attention",f=1),{verdict:g,exitCode:f,stepsPassed:t,stepsWarn:r,stepsFailed:n,stepsMissing:c,stepsSkipped:d}}function ee(e,s){let t=j(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),r=new Set(t.map(a=>a.toLowerCase())),n=j(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!r.has(a.toLowerCase()))),c=new Map;for(let a of s){if(a.scope!=="project"||!a.project)continue;let l=a.project.toLowerCase(),y=c.get(l)??[];y.push(a),c.set(l,y);}let d=[],o=[],p=[],g=[],f=false,i=(a,l)=>{let y=c.get(a.toLowerCase())??[];if(y.length===0){p.push(a);return}let W=y.filter(k=>k.status==="fail"),w=y.filter(k=>k.status==="missing"),P=w.filter(k=>k.required),V=y.some(k=>k.status==="pass"||k.status==="warn");if(W.length>0){o.push(a),g.push(`graph.subgraph.${a}: ${l} has failed verification evidence (${W.map(k=>k.id).join(", ")}).`);return}if(P.length>0){o.push(a),g.push(`graph.subgraph.${a}: ${l} has missing required verification evidence (${P.map(k=>k.id).join(", ")}).`);return}if(w.length>0){o.push(a),f=true;return}if(V){d.push(a);return}p.push(a);};for(let a of t)i(a,"directly-changed");for(let a of n)i(a,"transitive dependent");return {subgraph:{totalProjects:t.length+n.length,directlyChanged:t,transitiveDependents:n,covered:j(d),uncovered:j(o),unverifiable:j(p)},blockingReasons:g,needsAttention:f}}function j(e){return [...new Set(e)].sort((s,t)=>s.localeCompare(t))}async function se(e$2){let s=u.resolve(e$2.workspacePath);if(e$2.fromImpactPath){let c=T(s,e$2.fromImpactPath);return {impact:await q(c),fromImpactRef:u.relative(s,c).split(u.sep).join("/")}}let t=u.join(s,f);if(await h.pathExists(t))return {impact:await q(t),fromImpactRef:f};let r=u.join(s,c$1);if(await h.pathExists(r))return {impact:await n({workspacePath:s,fromPath:c$1,scope:e$2.scope,includeAbsolutePaths:e$2.includeAbsolutePaths,includeEvidence:e$2.includeEvidence,observableScanDepth:e$2.observableScanDepth,now:e$2.now}),fromImpactRef:c$1};let n$1=await e({workspacePath:s,includeAbsolutePaths:e$2.includeAbsolutePaths,includeEvidence:e$2.includeEvidence,observableScanDepth:e$2.observableScanDepth,now:e$2.now});return {impact:{schemaVersion:e$1,generatedAt:(e$2.now??new Date).toISOString(),fromRef:"baseline",diffRef:".rapidkit/reports/workspace-model-diff-last-run.json",workspace:{name:n$1.workspace.name,profile:n$1.workspace.profile,type:n$1.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:n$1.graph?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:"workspace-model-diff.v1",generatedAt:(e$2.now??new Date).toISOString(),fromRef:"baseline",toRef:".rapidkit/reports/workspace-model.json",fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:n$1}}}}async function me(e){let s=u.resolve(e.workspacePath),{impact:t,fromImpactRef:r}=await se(e),n=t.diff.currentModel,c$1=z([...m(),...t.verificationPlan]).filter(m=>L(e.scope,m)),d$1=[];for(let m of c$1)d$1.push(await X(m,s,n.contracts.exists===true,t.generatedAt));let o=ee(t,d$1),p=a(n.graph??{nodes:[],edges:[]}),g=b$1(n),f=await ne(s),i=c(g,f?.freshness?.projectHashes),a$1={verdict:i.verdict,baseline:i.baseline,changed:i.changed,added:i.added,removed:i.removed,projectHashes:d(g)},l=b$2(p),y=n.policies?.mode??"warn",W=await te(n,s),w=re(y,W),P=Z(d$1,{blockingReasons:[...o.blockingReasons,...l,...w.blockingReasons],needsAttention:o.needsAttention||w.needsAttention}),V=d$1.filter(m=>m.status==="missing"&&m.evidencePath).map(m=>m.evidencePath),N=[...d$1.filter(m=>m.required&&(m.status==="fail"||m.status==="missing")).map(m=>`${m.id}: ${m.message}`),...o.blockingReasons,...l,...w.blockingReasons];return {schemaVersion:_,generatedAt:(e.now??new Date).toISOString(),workspacePath:s,mode:"evidence",fromImpactRef:r,scope:e.scope,impact:{changed:t.summary.changed,risk:t.summary.risk,affectedProjects:t.summary.affectedProjects,recommendedCommands:t.summary.recommendedCommands},summary:P,steps:d$1,missingEvidence:V,blockingReasons:N,verificationPlan:c$1,affectedSubgraph:o.subgraph,graphIntegrity:p,freshness:a$1,policyMode:y,policyViolations:W}}async function te(e,s){let t=[];for(let n of e.validation?.issues??[])t.push({source:"model",severity:n.severity,code:n.code,message:n.message,target:n.target});let r=u.join(s,".rapidkit","reports","workspace-contract-verify-last-run.json");try{if(await h.pathExists(r)){let n=await h.readJson(r);if(Array.isArray(n.violations))for(let c of n.violations)typeof c=="string"&&c.trim().length>0&&t.push({source:"contract",severity:"error",code:"contract.violation",message:c});}}catch{}return t.sort((n,c)=>n.source!==c.source?n.source.localeCompare(c.source):n.code!==c.code?n.code.localeCompare(c.code):n.message.localeCompare(c.message))}function re(e,s){let t=s.filter(r=>r.severity==="error");return e==="enforce"&&t.length>0?{blockingReasons:t.map(r=>`policy.${r.code}: ${r.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:t.length>0}}async function ne(e){let s=u.join(e,H);try{if(!await h.pathExists(s))return null;let t=await h.readJson(s);return t&&t.schemaVersion===_?t:null}catch{return null}}async function ke(e,s){let t=u.join(s,H);return await h.ensureDir(u.dirname(t)),await h.writeJson(t,e,{spaces:2}),t}function ie(e,s){let t=s?.strict?"strict":"default",r=[];if(e.summary.verdict==="blocked")return r.push(...e.blockingReasons),r.length===0&&r.push("verify verdict is blocked."),{passed:false,mode:t,exitCode:2,reasons:r};if(t==="strict"){if(e.summary.verdict!=="ready"&&r.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let n=[...e.freshness.changed,...e.freshness.added].slice(0,5);r.push(`freshness is stale${n.length>0?`: ${n.join(", ")}`:""} (strict requires fresh).`);}if(r.length>0)return {passed:false,mode:t,exitCode:1,reasons:r}}return {passed:true,mode:t,exitCode:e.summary.exitCode===2?0:e.summary.exitCode,reasons:r}}function he(e,s){let t=ie(e,s);return t.passed?e.summary.verdict==="blocked"?2:s?.strict&&e.summary.verdict!=="ready"?1:e.summary.exitCode:t.exitCode}export{H as WORKSPACE_VERIFY_REPORT_PATH,_ as WORKSPACE_VERIFY_SCHEMA_VERSION,me as buildWorkspaceVerify,ee as computeAffectedSubgraphGate,ie as evaluateWorkspaceVerifyGate,he as workspaceVerifyExitCode,ke as writeWorkspaceVerify};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-KYH364KQ.js';import {g as g$1}from'./chunk-TYZPPUBH.js';import {d}from'./chunk-X7PWDIQW.js';import b from'fs';var M="workspace-watch-event.v1";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 d({projects:o,edges:c})}function w(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??(()=>g$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=w(c,a),i=m(a),l=c?m(c)!==i:true;return {schemaVersion:M,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}}},P=new Set([".git",".hg",".svn","node_modules",".venv","venv","dist","build","out","target","coverage","htmlcov",".next",".turbo",".cache"]),R=new Set(["reports","cache","tmp",".cache"]);function y(t){if(!t)return false;let r=t.split(/[\\/]/).filter(Boolean);if(r.some(o=>P.has(o)))return false;for(let o=0;o<r.length-1;o+=1)if(r[o]===".rapidkit"&&R.has(r[o+1]))return false;return true}async function D(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({schemaVersion:M,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=>{y(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=b.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{M as WORKSPACE_WATCH_EVENT_SCHEMA_VERSION,k as WorkspaceWatchEngine,m as computeWatchModelHash,w as diffWatchModels,y as isWatchRelevantPath,D as runWorkspaceWatch};
@@ -4,14 +4,14 @@ Map of GitHub Actions workflows in this repository. Use this when editing CI to
4
4
 
5
5
  ## Workflows
6
6
 
7
- | Workflow | Path | Purpose |
8
- | --- | --- | --- |
9
- | Build / test matrix | `.github/workflows/ci.yml` | Build, lint, typecheck, tests, coverage, contract gates |
10
- | Workspace E2E matrix | `.github/workflows/workspace-e2e-matrix.yml` | Cross-OS workspace lifecycle smoke; setup `--warm-deps`; cache/mirror ops |
11
- | Windows bridge E2E | `.github/workflows/windows-bridge-e2e.yml` | Native Windows bridge and lifecycle checks |
12
- | E2E smoke | `.github/workflows/e2e-smoke.yml` | Focused bridge regression smoke |
13
- | Frontend generator smoke | `.github/workflows/frontend-generator-smoke.yml` | Official frontend generator drift gate |
14
- | Security | `.github/workflows/security.yml` | Security scanning and policy checks |
7
+ | Workflow | Path | Purpose |
8
+ | ------------------------ | ------------------------------------------------ | ------------------------------------------------------------------------- |
9
+ | Build / test matrix | `.github/workflows/ci.yml` | Build, lint, typecheck, tests, coverage, contract gates |
10
+ | Workspace E2E matrix | `.github/workflows/workspace-e2e-matrix.yml` | Cross-OS workspace lifecycle smoke; setup `--warm-deps`; cache/mirror ops |
11
+ | Windows bridge E2E | `.github/workflows/windows-bridge-e2e.yml` | Native Windows bridge and lifecycle checks |
12
+ | E2E smoke | `.github/workflows/e2e-smoke.yml` | Focused bridge regression smoke |
13
+ | Frontend generator smoke | `.github/workflows/frontend-generator-smoke.yml` | Official frontend generator drift gate |
14
+ | Security | `.github/workflows/security.yml` | Security scanning and policy checks |
15
15
 
16
16
  ## Consumer workspace: agent grounding CI
17
17
 
@@ -23,21 +23,24 @@ Minimal job:
23
23
 
24
24
  ```yaml
25
25
  - run: npx rapidkit pipeline --json --strict
26
- - run: npx rapidkit workspace agent-sync --write --refresh-context --strict --json
26
+ - run: npx rapidkit workspace agent-sync --write --refresh-context --strict --json --preset enterprise
27
+ - run: node ./node_modules/rapidkit/scripts/check-agent-customization-drift.mjs --workspace .
27
28
  ```
28
29
 
29
- `pipeline` writes governance evidence and **auto-syncs** agent hooks (`AGENTS.md`, Copilot, Cursor, Claude) unless `RAPIDKIT_NO_AGENT_SYNC=1` or `--no-agent-sync`.
30
+ `pipeline` writes governance evidence and **auto-syncs** agent grounding (`AGENTS.md`, Copilot, Cursor, Claude) unless `RAPIDKIT_NO_AGENT_SYNC=1` or `--no-agent-sync`.
31
+ Run the drift check after `agent-sync --write` so CI fails when generated agent customization files are stale.
30
32
 
31
33
  ## Local validation scripts
32
34
 
33
- | Script | Command |
34
- | --- | --- |
35
- | Runtime acceptance (default) | `npm run test:runtime-matrix` |
36
- | Runtime acceptance (full) | `npm run test:runtime-matrix:full` |
37
- | Frontend generators (dry-run) | `npm run smoke:frontend-generators` |
38
- | Frontend generators (network) | `npm run smoke:frontend-generators:network` |
39
- | Docs drift guard | `npm run check:docs-drift` |
40
- | README command smoke | `npm run smoke:readme` |
35
+ | Script | Command |
36
+ | ----------------------------- | ------------------------------------------------------------------------- |
37
+ | Runtime acceptance (default) | `npm run test:runtime-matrix` |
38
+ | Runtime acceptance (full) | `npm run test:runtime-matrix:full` |
39
+ | Frontend generators (dry-run) | `npm run smoke:frontend-generators` |
40
+ | Frontend generators (network) | `npm run smoke:frontend-generators:network` |
41
+ | Docs drift guard | `npm run check:docs-drift` |
42
+ | README command smoke | `npm run smoke:readme` |
43
+ | Agent customization drift | `npm run check:agent-customization-drift -- --workspace <workspace-root>` |
41
44
 
42
45
  ## Recommended pre-release checks
43
46
 
@@ -40,7 +40,7 @@ npx rapidkit workspace contract verify [--strict] [--json]
40
40
  npx rapidkit workspace contract graph [--json]
41
41
  npx rapidkit workspace model [--json] [--write] [--strict]
42
42
  npx rapidkit workspace context --for-agent [codex|claude|cursor|orca] [--json] [--write] [--no-agent-sync]
43
- npx rapidkit workspace agent-sync [--write] [--refresh-context] [--strict] [--json] [--target all|copilot,cursor,claude]
43
+ npx rapidkit workspace agent-sync [--write] [--refresh-context] [--strict] [--json] [--preset minimal|enterprise] [--target all|vscode|copilot,cursor,claude] [--experimental-hooks]
44
44
  npx rapidkit workspace snapshot [--json]
45
45
  npx rapidkit workspace diff --from <snapshot-or-report|git[:ref]> [--json]
46
46
  npx rapidkit workspace impact --from <snapshot-or-report> [--scope project:<name>] [--json]
@@ -21,32 +21,166 @@ Canonical map of **on-disk artifacts** produced by `rapidkit-npm` commands. Dash
21
21
 
22
22
  ## Governance evidence loop
23
23
 
24
- | Command | Primary artifact | Schema version | JSON Schema |
25
- | ------------------- | --------------------------------------------------- | ----------------------------------------------------------- | --------------------------------------------- | ------------------------------------- |
26
- | `doctor workspace` | `.rapidkit/reports/doctor-last-run.json` | `doctor-workspace-evidence-v1` | `contracts/doctor-workspace-evidence.v1.json` |
27
- | `doctor project` | `.rapidkit/reports/doctor-project-last-run.json` | `doctor-project-evidence-v1` | `contracts/doctor-project-evidence.v1.json` |
28
- | `analyze` | `.rapidkit/reports/analyze-last-run.json` | `rapidkit-analyze-v1` | `contracts/analyze-last-run.v1.json` |
29
- | `readiness` | `.rapidkit/reports/release-readiness-last-run.json` | `release-readiness-v1` | `contracts/release-readiness.v1.json` |
30
- | `pipeline` | `.rapidkit/reports/pipeline-last-run.json` | Also triggers agent grounding sync unless `--no-agent-sync` | `rapidkit-pipeline-v1` | `contracts/pipeline-last-run.v1.json` |
31
- | `autopilot release` | `.rapidkit/reports/autopilot-release-last-run.json` | `autopilot-release-v1` | — |
32
- | | `.rapidkit/reports/autopilot-release.json` | (alias, same payload) | — |
24
+ | Command | Primary artifact | Schema version | JSON Schema |
25
+ | ------------------- | --------------------------------------------------- | ------------------------------ | --------------------------------------------- |
26
+ | `doctor workspace` | `.rapidkit/reports/doctor-last-run.json` | `doctor-workspace-evidence-v1` | `contracts/doctor-workspace-evidence.v1.json` |
27
+ | `doctor project` | `.rapidkit/reports/doctor-project-last-run.json` | `doctor-project-evidence-v1` | `contracts/doctor-project-evidence.v1.json` |
28
+ | `analyze` | `.rapidkit/reports/analyze-last-run.json` | `rapidkit-analyze-v1` | `contracts/analyze-last-run.v1.json` |
29
+ | `readiness` | `.rapidkit/reports/release-readiness-last-run.json` | `release-readiness-v1` | `contracts/release-readiness.v1.json` |
30
+ | `pipeline` | `.rapidkit/reports/pipeline-last-run.json` | `rapidkit-pipeline-v1` | `contracts/pipeline-last-run.v1.json` |
31
+ | `autopilot release` | `.rapidkit/reports/autopilot-release-last-run.json` | `autopilot-release-v1` | — |
32
+ | | `.rapidkit/reports/autopilot-release.json` | (alias, same payload) | — |
33
33
 
34
34
  Side/cache (not gates): `.rapidkit/reports/doctor-workspace-cache.json` (`doctor-workspace-cache-v2`).
35
35
 
36
36
  ## Workspace intelligence
37
37
 
38
- | Command | Artifact | Schema | Contract file |
39
- | -------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------- | ---------------------------------------------------------- |
40
- | `workspace model --write` | `workspace-model.json` | `workspace-model.v1` | `contracts/workspace-intelligence/workspace-model.v1.json` |
41
- | `workspace snapshot` | `workspace-model-snapshot.json` | `workspace-model-snapshot.v1` | `workspace-model-snapshot.v1.json` |
42
- | `workspace diff` | `workspace-model-diff-last-run.json` | `workspace-model-diff.v1` | `workspace-model-diff.v1.json` |
43
- | `workspace impact --from <diff>` | `workspace-impact-last-run.json` | `workspace-impact.v1` | `workspace-impact.v1.json` |
44
- | `workspace verify` | `workspace-verify-last-run.json` | `workspace-verify.v1` | `workspace-verify.v1.json` |
45
- | `workspace context --write` | `workspace-context-agent.json` | `workspace-context.v1` | `workspace-context.v1.json` |
46
- | `workspace agent-sync --write` | `reports/INDEX.json`, `AGENT-GROUNDING.md`, `AGENTS.md`, Copilot/Cursor/Claude hooks | `rapidkit-agent-reports-index.v1` | |
38
+ | Command | Artifact | Schema | Contract file |
39
+ | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------- |
40
+ | `workspace model --write` | `workspace-model.json` | `workspace-model.v1` | `contracts/workspace-intelligence/workspace-model.v1.json` |
41
+ | `workspace snapshot` | `workspace-model-snapshot.json` | `workspace-model-snapshot.v1` | `workspace-model-snapshot.v1.json` |
42
+ | `workspace diff` | `workspace-model-diff-last-run.json` | `workspace-model-diff.v1` | `workspace-model-diff.v1.json` |
43
+ | `workspace impact --from <diff>` | `workspace-impact-last-run.json` | `workspace-impact.v1` | `workspace-impact.v1.json` |
44
+ | `workspace verify` | `workspace-verify-last-run.json` | `workspace-verify.v1` | `workspace-verify.v1.json` |
45
+ | `workspace context --write` | `workspace-context-agent.json` | `workspace-context.v1` | `workspace-context.v1.json` |
46
+ | `workspace agent-sync --write` | `reports/INDEX.json`, `reports/agent-customization-pack.json`, `reports/rapidkit-mcp-design.json`, `AGENT-GROUNDING.md`, `AGENTS.md`, Copilot/Cursor/Claude/VS Code agent surfaces | `rapidkit-agent-customization-pack.v1` | `contracts/agent-customization-pack.v1.json` |
47
47
 
48
48
  **CLI semantics:** `workspace diff --from` expects a **model or snapshot** baseline. `workspace impact --from` expects a **diff report**.
49
49
 
50
+ ### Dependency graph (`workspace-dependency-graph.v1`)
51
+
52
+ The dependency graph is the first-class structure that promotes inter-project
53
+ relationships out of `workspace run`'s private logic into one versioned source
54
+ of truth consumed by `impact` (transitive blast radius), `verify`
55
+ (subgraph-scoped gating), `run --blast-radius`, and risk weighting.
56
+
57
+ | Field | Meaning |
58
+ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
59
+ | `nodes` | Projects in the workspace (`id`, workspace-relative `path`). |
60
+ | `edges` | Directed `from → to` relationships (`from` depends on `to`). Each edge carries a typed `kind`, a `source` (provenance), a `confidence` bucket, and `evidence` (the files that justify it). |
61
+ | `stats` | Counts (`nodeCount`, `edgeCount`, per-source edge counts) and `hasCycle` for the integrity gate. |
62
+
63
+ Edge `kind` ∈ `code-import`, `package-dep`, `event-pub-sub`, `service-dependsOn`,
64
+ `shared-resource`. Edge `source` ∈ `inferred`, `contract`, `manual` (`manual`/`contract`
65
+ are authoritative and override an `inferred` edge of the same kind between the same
66
+ nodes). Canonical source: `src/contracts/workspace-dependency-graph-contract.ts`;
67
+ JSON Schema: `contracts/workspace-intelligence/workspace-dependency-graph.v1.json`.
68
+
69
+ **Inference engine.** The graph is derived deterministically by
70
+ `src/workspace-dependency-graph.ts` (`inferWorkspaceDependencyGraph`) from multiple
71
+ sources: package manifests (`package.json` deps, `pyproject.toml` path deps, `go.mod`
72
+ replace → `package-dep`), cross-boundary JS/TS source imports (`code-import`), the
73
+ workspace contract (`dependsOn` → `service-dependsOn`, matched `publishes`/`consumes`
74
+ → `event-pub-sub`, env↔port references → `shared-resource`), and an optional manual
75
+ override file. Node/edge ordering and `hashDependencyGraph` are stable, so the graph is
76
+ embedded as a first-class field of `workspace-model.v1` (`model.graph`) on every
77
+ `buildWorkspaceModel` run; `hashModel` normalizes the embedded `graph.generatedAt` so the
78
+ structural graph participates in the model hash without causing timestamp drift.
79
+ (`model.graph` is additive/optional for pre-graph readers.)
80
+
81
+ **Manual overrides.** `.rapidkit/workspace-graph.overrides.json` (`{ "edges": [{ "from",
82
+ "to", "kind", "evidence" }] }`) declares authoritative edges that win over inference for
83
+ the same `(from, to, kind)`.
84
+
85
+ **Graph-aware impact.** `workspace impact` consumes the graph for a true transitive
86
+ blast radius: alongside `affectedProjects` (directly changed) it emits `transitiveImpact[]`
87
+ — projects reached only through the graph, each with `origin: 'transitive'`, `distance`,
88
+ the shortest dependency `path`, and `via` (edge kind). `summary.blastRadius`
89
+ (`directlyAffected`, `transitivelyAffected`, `maxDistance`, `graphEdges`) summarizes the
90
+ reach. Both arrays feed the `verificationPlan`.
91
+
92
+ **Graph-aware verify.** `workspace verify` gates the **whole affected subgraph**, not just
93
+ the changed node. `affectedSubgraph` (`directlyChanged`, `transitiveDependents`, `covered`,
94
+ `uncovered`, `unverifiable`) records coverage per project: a dependent with failed or
95
+ missing-required verification evidence becomes a `graph.subgraph.<project>` blocking reason;
96
+ missing non-required evidence escalates the verdict to `needs-attention`; a dependent with no
97
+ applicable verification command is `unverifiable` (informational, never blocking).
98
+
99
+ **Centrality-weighted risk.** `workspace impact` computes graph centrality
100
+ (`fanIn`/`fanOut`/`reach`/`betweenness`) per project; each impact item carries `centrality`,
101
+ a directly-changed critical-path hotspot escalates its risk one level, and the report lists
102
+ `criticalPathHotspots[]` (ranked by reach then betweenness). Canonical source:
103
+ `src/workspace-graph-centrality.ts` (`computeGraphCentrality`).
104
+
105
+ **Graph integrity gate.** `workspace verify` emits `graphIntegrity` (`ok`, `cycles`,
106
+ `danglingEdges`, `orphans`, `stats`). Cycles and dangling edges are blocking
107
+ (`graph.integrity.cycle` / `graph.integrity.dangling` reasons); orphans are informational.
108
+ Canonical source: `src/workspace-graph-integrity.ts` (`checkGraphIntegrity`).
109
+
110
+ **Watch / daemon mode.** `workspace watch [--json] [--once]` keeps the model + graph in
111
+ memory and streams `workspace-watch-event.v1` records (`ready`/`changed`/`unchanged`/`error`)
112
+ on each settled change, driven by graph-aware incremental rebuilds. Events carry changed/added/
113
+ removed projects, graph edge deltas, structural `modelHash`, and `mode`/`durationMs`. Canonical
114
+ source: `src/workspace-watch.ts`.
115
+
116
+ **Health/impact history.** Each `workspace verify` run appends a compact record to
117
+ `.rapidkit/reports/workspace-intelligence-history.json` (`workspace-intelligence-history.v1`),
118
+ a ring buffer capped at the 50 most-recent entries (verdict, risk, freshness, gate, counts).
119
+ Canonical source: `src/workspace-history.ts`.
120
+
121
+ **Verify gate + policy violations.** `workspace verify --json` emits a `gate`
122
+ object (`passed`, `mode`, `exitCode`, `reasons`) from `evaluateWorkspaceVerifyGate` — the
123
+ definitive pre-action gate (default fails on `blocked`; `--strict` also fails on
124
+ `needs-attention` and `stale` freshness). It also emits `policyMode` + `policyViolations[]`
125
+ (model validation issues + contract `violations`); in `enforce` mode error-severity violations
126
+ block, in `warn` mode they escalate to needs-attention.
127
+
128
+ **Graph-aware freshness.** `workspace verify` emits a `freshness` block
129
+ (`verdict: fresh|stale|unknown`, `changed`/`added`/`removed`, `projectHashes`). Each project's
130
+ `transitiveInputsHash` chains its own content hash with its transitive dependencies' hashes, so
131
+ a dependency change makes every dependent stale deterministically. The verdict compares against
132
+ the previously written verify report. Canonical source: `src/workspace-graph-freshness.ts`.
133
+
134
+ **Graph command surface.** `workspace graph` emits the graph plus integrity + hotspots;
135
+ `workspace graph explain <project>` returns centrality and direct/transitive relationships;
136
+ `workspace graph dot|mermaid` render deterministic visualizations. Canonical source:
137
+ `src/workspace-graph.ts`. The `graph` subcommand is part of `WORKSPACE_SUBCOMMANDS` and is
138
+ published via `runtime-command-surface.v1` for IDE/CI capability detection.
139
+
140
+ ### Model cache (`workspace-model-cache.v1`)
141
+
142
+ On-disk path: `.rapidkit/cache/workspace-model.v1.json`. Opt-in (`workspace model --cache`)
143
+ cache keyed by `inputsHash` — a deterministic fingerprint of the project set, per-project
144
+ manifest contents, workspace files (contract/workspace.json/policies), build flags, and CLI
145
+ version. On a hit the stored model is returned byte-for-byte; on a miss it is rebuilt and
146
+ rewritten. Canonical source: `src/workspace-model-cache.ts` (`computeModelInputsHash`,
147
+ `buildWorkspaceModelCached`). Granularity is manifest/project-set level, not per-source-file.
148
+
149
+ The envelope also stores per-project signatures (`computeProjectSignatures`: manifest hashes +
150
+ a source fingerprint of `path:size:mtime`) and workspace-file signatures, powering
151
+ `workspace model --incremental` (`buildWorkspaceModelIncremental`): unchanged project models are
152
+ reused and the dependency graph re-infers only edges incident to changed projects
153
+ (`inferWorkspaceDependencyGraphIncremental`). It falls back to a full rebuild on workspace-file
154
+ changes or project renames, and rescans code-imports fully when the node set changes. Reported
155
+ modes: `full` / `incremental` / `unchanged`.
156
+
157
+ ### Freshness metadata (`rapidkit-freshness-metadata-v1`)
158
+
159
+ Intelligence reports carry a shared freshness envelope so any consumer (CLI
160
+ `workspace verify`, Workspai, CI) can detect staleness **without** re-running the
161
+ whole chain:
162
+
163
+ | Field | Meaning |
164
+ | ------------- | ----------------------------------------------------------------------------------------------------------------------- |
165
+ | `generatedAt` | ISO-8601 timestamp the report was produced. |
166
+ | `inputsHash` | Stable sha256 of the inputs that produced the report. If a freshly recomputed inputs hash differs, the report is stale. |
167
+
168
+ Canonical source: `src/contracts/freshness-metadata-contract.ts`
169
+ (`computeInputsHash`, `buildFreshnessMetadata`, `assessFreshness`). Verdicts:
170
+ `fresh` (hashes match), `stale` (hashes differ), `unknown` (either side missing,
171
+ e.g. legacy reports).
172
+
173
+ ### Run correlation (`runId`)
174
+
175
+ When a command runs through the CLI with the structured log stream active, the
176
+ persisted intelligence artifacts (`workspace-model.json`, `workspace-model-snapshot.json`,
177
+ `workspace-model-diff-last-run.json`, `workspace-impact*.json`, `workspace-context-agent.json`)
178
+ carry a top-level `runId`. It matches the `runId` on the `cli-log-event.v1` stream
179
+ (`run.started`/`progress`/`run.completed`), so a consumer can tie an on-disk report
180
+ to the exact run that produced it. `runId` is added at write time only and is
181
+ ignored by `modelHash`/diff comparisons, so deterministic hashing is unaffected.
182
+ Canonical source: `src/observability/run-correlation.ts` (`attachRunCorrelation`).
183
+
50
184
  ## Operational / platform
51
185
 
52
186
  | Command | Artifact | Notes |
@@ -69,6 +203,19 @@ Side/cache (not gates): `.rapidkit/reports/doctor-workspace-cache.json` (`doctor
69
203
  | `contracts/runtime-command-surface.v1.json` | `rapidkit-runtime-command-surface-v1` | Runtime commands, scaffold kits, and create planner summary |
70
204
  | `contracts/create-planner-capabilities.v1.json` | `rapidkit-create-planner-capabilities-v1` | Native create, external-create-adopt, and adopt-only lanes for CLI, CI, VS Code, and AI planners |
71
205
 
206
+ ## Observability stream (not on-disk)
207
+
208
+ Separate from the on-disk artifacts above, `rapidkit-npm` emits a structured
209
+ **NDJSON log stream on stderr** when `--log-format json` (or `RAPIDKIT_LOG_FORMAT=json`)
210
+ is set. This is the deterministic progress/outcome channel for IDEs and CI.
211
+
212
+ | Stream | Schema version | Contract file | Doc |
213
+ | ----------------------- | ------------------ | --------------------------------- | ---------------------------------------------------- |
214
+ | CLI log events (stderr) | `cli-log-event-v1` | `contracts/cli-log-event.v1.json` | [CLI_LOG_EVENT_STREAM.md](./CLI_LOG_EVENT_STREAM.md) |
215
+
216
+ **Channel rule:** command **results** go to stdout (`--json`); **progress/lifecycle**
217
+ events go to stderr (`--log-format json`). The two never mix.
218
+
72
219
  ## Registry commands
73
220
 
74
221
  | Command | Output |
@@ -86,26 +233,41 @@ Under `{project}/.rapidkit/reports/` when commands run at project scope (e.g. pr
86
233
  2. **Release gates:** follow chain doctor → analyze → readiness → verify → autopilot; use `pipeline-last-run.json` for orchestration summary.
87
234
  3. **Do not** use `workspace.json.projects` (removed in schema 1.0).
88
235
  4. Prefer `schemaVersion` constants in each artifact; legacy `v1` on readiness is accepted when reading old reports.
89
- 5. **Agent grounding:** read `.rapidkit/reports/INDEX.json` first, then `workspace-context-agent.json`; regenerate with `workspace agent-sync --write`.
236
+ 5. **Agent customization:** read `.rapidkit/reports/agent-customization-pack.json` first for generated surfaces, then `.rapidkit/reports/INDEX.json` and `workspace-context-agent.json`; regenerate with `workspace agent-sync --write --refresh-context --preset enterprise`.
90
237
 
91
- ## Agent grounding files (repo hooks)
238
+ ## Agent customization files (repo hooks)
92
239
 
93
- Written by `workspace agent-sync --write` (and by default after `workspace context --for-agent --write`):
240
+ Written by `workspace agent-sync --write --refresh-context --preset enterprise` (and by default after `workspace context --for-agent --write`):
94
241
 
95
- | Path | Consumer |
96
- | -------------------------------------------------------- | --------------------------------------------------------- |
97
- | `AGENTS.md` | Copilot, Cursor, Claude Code, Codex, Grok (open standard) |
98
- | `.github/copilot-instructions.md` | GitHub Copilot / VS Code Chat |
99
- | `.github/instructions/rapidkit-evidence.instructions.md` | Copilot scoped `.rapidkit/**` rules |
100
- | `.github/prompts/rapidkit-diagnose.prompt.md` | Copilot prompt library |
101
- | `.github/skills/rapidkit-grounding/SKILL.md` | Copilot skills |
102
- | `.cursor/rules/rapidkit-grounding.mdc` | Cursor always-on rule |
103
- | `CLAUDE.md` | Claude Code (imports `@AGENTS.md`) |
104
- | `.claude/rules/rapidkit-evidence.md` | Claude Code scoped evidence rule |
105
- | `.rapidkit/AGENT-GROUNDING.md` | Tool-agnostic operator doc |
242
+ | Path | Consumer |
243
+ | ----------------------------------------------------------------------- | -------------------------------------------------------------- |
244
+ | `AGENTS.md` | Copilot, Cursor, Claude Code, Codex, Grok (open standard) |
245
+ | `.github/copilot-instructions.md` | GitHub Copilot / VS Code Chat |
246
+ | `.github/instructions/rapidkit-workspace.instructions.md` | Copilot workspace scope and command discipline |
247
+ | `.github/instructions/rapidkit-evidence.instructions.md` | Copilot scoped `.rapidkit/**` rules |
248
+ | `.github/prompts/rapidkit-diagnose.prompt.md` | Copilot prompt library |
249
+ | `.github/prompts/rapidkit-repair.prompt.md` | Copilot repair workflow prompt |
250
+ | `.github/prompts/rapidkit-release-readiness.prompt.md` | Copilot release readiness workflow prompt |
251
+ | `.github/prompts/rapidkit-project-onboard.prompt.md` | Copilot project onboarding workflow prompt |
252
+ | `.github/prompts/rapidkit-adopt-project.prompt.md` | Copilot adopt/import workflow prompt |
253
+ | `.github/skills/rapidkit-grounding/SKILL.md` | Copilot skills |
254
+ | `.github/skills/rapidkit-workspace-intelligence/SKILL.md` | Enterprise Workspace Intelligence skill |
255
+ | `.github/skills/rapidkit-workspace-intelligence/resources/mcp-tools.md` | Future MCP tool design reference |
256
+ | `.github/agents/workspai-advisor.agent.md` | Read-only workspace advisor agent |
257
+ | `.github/agents/workspai-repair.agent.md` | Blocker repair agent |
258
+ | `.github/agents/workspai-release.agent.md` | Release safety agent |
259
+ | `.github/agents/workspai-project-onboarder.agent.md` | Project onboarding agent |
260
+ | `.cursor/rules/rapidkit-grounding.mdc` | Cursor always-on rule |
261
+ | `CLAUDE.md` | Claude Code (imports `@AGENTS.md`) |
262
+ | `.claude/rules/rapidkit-evidence.md` | Claude Code scoped evidence rule |
263
+ | `.rapidkit/AGENT-GROUNDING.md` | Tool-agnostic operator doc |
264
+ | `.rapidkit/reports/agent-customization-pack.json` | Versioned output inventory, target matrix, drift state |
265
+ | `.rapidkit/reports/rapidkit-mcp-design.json` | Read-mostly MCP-ready design manifest |
266
+ | `.vscode/rapidkit-agent-hooks.json` | Optional advisory VS Code agent hooks (`--experimental-hooks`) |
106
267
 
107
268
  ## See also
108
269
 
109
270
  - [README.md](./README.md)
110
271
  - [COMMAND_OWNERSHIP_MATRIX.md](./COMMAND_OWNERSHIP_MATRIX.md)
272
+ - [CLI_LOG_EVENT_STREAM.md](./CLI_LOG_EVENT_STREAM.md)
111
273
  - [commands-reference.md](../commands-reference.md)