rapidkit 0.37.1 → 0.38.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.
- package/README.md +158 -118
- package/contracts/create-planner-capabilities.v1.json +251 -0
- package/contracts/runtime-command-surface.v1.json +52 -0
- package/dist/autopilot-release-SBPGNGAB.js +1 -0
- package/dist/chunk-2ED6SPXP.js +1 -0
- package/dist/chunk-3R7UJAX5.js +1 -0
- package/dist/{chunk-RUUDLAKJ.js → chunk-5NBYSXOZ.js} +1 -1
- package/dist/chunk-7XW2I6MP.js +13 -0
- package/dist/{chunk-U6QUN6V2.js → chunk-ABPDGFVD.js} +1 -1
- package/dist/chunk-IW3KLQXE.js +2 -0
- package/dist/{chunk-7RBZGQ7T.js → chunk-NKNMGWAZ.js} +1 -1
- package/dist/{chunk-IOIWVHRO.js → chunk-TVIOAZ6E.js} +13 -13
- package/dist/chunk-XESEBTPE.js +1 -0
- package/dist/{create-HN5HOGQ4.js → create-Y3XJOKL5.js} +1 -1
- package/dist/index.js +150 -144
- package/dist/{pipeline-IMB3C3JY.js → pipeline-C4UCLETO.js} +1 -1
- package/dist/{workspace-2AL5C3QZ.js → workspace-WBKFXH4Z.js} +1 -1
- package/dist/{workspace-agent-sync-4R7S3F6T.js → workspace-agent-sync-3FFFJYKF.js} +1 -1
- package/dist/{workspace-context-CKACDTVE.js → workspace-context-V4UGIHSC.js} +1 -1
- package/dist/{workspace-foundation-L6ZBGMVE.js → workspace-foundation-T45HAWKL.js} +1 -1
- package/dist/{workspace-intelligence-3TWXJQ7Y.js → workspace-intelligence-MGL3Z25K.js} +1 -1
- package/dist/{workspace-model-NQVZN5W4.js → workspace-model-IKMGY2BX.js} +1 -1
- package/dist/workspace-run-HOR56FON.js +1 -0
- package/dist/{workspace-verify-EO435PS4.js → workspace-verify-A3J6D7T2.js} +1 -1
- package/docs/README.md +1 -0
- package/docs/contracts/ARTIFACT_CATALOG.md +63 -56
- package/docs/contracts/README.md +15 -14
- package/docs/create-planner-capabilities.md +81 -0
- package/package.json +1 -1
- package/dist/autopilot-release-QNZ2IL7K.js +0 -1
- package/dist/chunk-3SWQKRXH.js +0 -2
- package/dist/chunk-C7OVQQXT.js +0 -1
- package/dist/chunk-UXKB4KGZ.js +0 -13
- package/dist/chunk-YJ24EV3P.js +0 -1
- package/dist/workspace-run-PNMZJNDC.js +0 -1
- /package/dist/{chunk-TRXYRHD7.js → chunk-6E5TBB2C.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-NKNMGWAZ.js';import {b}from'./chunk-JBDQADHY.js';import {b as b$1}from'./chunk-5NBYSXOZ.js';import {a as a$1}from'./chunk-T5LN7EO5.js';import {a as a$2}from'./chunk-6P5DCHBQ.js';import {a}from'./chunk-KMUWWZRT.js';import {e,d}from'./chunk-B2KOIORF.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=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,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,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$1={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=e(d$1,{commandId:"workspacePipeline",exitCode:k,generatedAt:d$1.generatedAt,blockers:d$1.blockingReasons,runId:d()});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-3FFFJYKF.js'),n=await e({workspacePath:a$3,write:true,refreshContext:true,strict:false});d$1.agentGrounding={indexPath:n.indexPath,writtenFiles:n.writtenFiles,blockers:n.blockers};}catch{}return d$1}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
2
|
\u{1F517} RapidKit Governance Pipeline
|
|
3
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
4
|
Blocking reasons:`));for(let a of s.blockingReasons.slice(0,8))console.log(c$1.gray(` \u2022 ${a}`));}console.log(c$1.gray(`
|
|
@@ -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-
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import {b,c,d}from'./chunk-
|
|
1
|
+
import {b,c,d}from'./chunk-IW3KLQXE.js';import i from'path';import c$1 from'fs-extra';var O="rapidkit-agent-reports-index.v1",E=".rapidkit/reports/INDEX.json",G=".rapidkit/AGENT-GROUNDING.md",S=[{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 k(e){return `npx rapidkit ${e}`.trim()}function I(e){return e&&typeof e=="object"?e:null}function j(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function q(e){let t=j(e.blockers,12);if(t.length>0)return t;let r=j(e.blockingReasons,12);if(r.length>0)return r;let n=I(e.summary);return n&&Array.isArray(n.blockingReasons)?j(n.blockingReasons,12):[]}function _(e){for(let t of ["generatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}}function $(e,t,r){if(!e)return true;let n=Date.parse(e);return Number.isFinite(n)?r.getTime()-n>t*60*60*1e3:true}function K(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","agents","copilot","cursor","claude","codex","orca"]):new Set(t)}function u(e,t){return e.has("all")||e.has(t)}async function X(e){try{if(!await c$1.pathExists(e))return null;let t=await c$1.readJson(e);return I(t)}catch{return null}}async function F(e){let t=e.now??new Date,r=e.staleAfterHours??24,n=[],d=[];for(let l of S){let h=i.join(e.workspacePath,l.relativePath),a=await X(h),p=a!==null;p&&a&&d.push(...q(a)),n.push({path:l.relativePath,label:l.label,required:l.required,exists:p,generatedAt:a?_(a):void 0,commandId:typeof a?.commandId=="string"?a.commandId:void 0,exitCode:typeof a?.exitCode=="number"?a.exitCode:void 0});}let s=[...new Set(d.map(l=>l.trim()).filter(Boolean))].slice(0,16);return {schemaVersion:O,generatedAt:t.toISOString(),workspaceRoot:e.workspacePath,readOrder:S.map(l=>l.relativePath),blockers:s,staleAfterHours:r,reports:n,refreshCommand:k("workspace agent-sync --write --refresh-context")}}function N(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",k("workspace agent-sync --write --refresh-context"),k("workspace context --for-agent --json --write"),k("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
2
|
`)}function B(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
3
|
`)}function H(){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",k("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
4
4
|
`)}function L(){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(`
|
|
@@ -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-
|
|
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 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
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 +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-
|
|
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 +1 @@
|
|
|
1
|
-
export{b as WORKSPACE_MODEL_REPORT_PATH,a as WORKSPACE_MODEL_SCHEMA_VERSION,d as buildWorkspaceModel,c as validateWorkspaceModelStrict,e as writeWorkspaceModel}from'./chunk-
|
|
1
|
+
export{b as WORKSPACE_MODEL_REPORT_PATH,a as WORKSPACE_MODEL_SCHEMA_VERSION,d as buildWorkspaceModel,c as validateWorkspaceModelStrict,e as writeWorkspaceModel}from'./chunk-XESEBTPE.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as runWorkspaceStage}from'./chunk-6E5TBB2C.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-FV5A3N3I.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {m,f as f$1,c,n,e}from'./chunk-U6QUN6V2.js';import {d}from'./chunk-C7OVQQXT.js';import {c as c$1}from'./chunk-FV5A3N3I.js';import p from'path';import g from'fs-extra';var R="workspace-verify.v1",S=".rapidkit/reports/workspace-verify-last-run.json";function C(e,s){return p.isAbsolute(s)?s:p.join(e,s)}async function P(e$1){let s=await g.readJson(e$1);if(!s||typeof s!="object"||Array.isArray(s))throw new Error(`Workspace impact input is not a JSON object: ${e$1}`);let r=s;if(r.schemaVersion!==e)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);return r}function I(e){let s=new Set,r=[];for(let a of e){let i=`${a.scope}:${a.project??""}:${a.display}`;s.has(i)||(s.add(i),r.push(a));}return r}function V(e,s){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return s.scope==="workspace"?true:(s.project??"").trim().toLowerCase()===r}function A(e,s){if(e.id==="workspace.doctor")return p.join(s,".rapidkit","reports","doctor-last-run.json");if(e.id==="workspace.contract.verify")return p.join(s,".rapidkit","reports","workspace-contract-verify-last-run.json");if(e.id==="workspace.readiness")return p.join(s,".rapidkit","reports","release-readiness-last-run.json");if(e.id==="workspace.analyze")return p.join(s,".rapidkit","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return p.join(s,".rapidkit","reports","pipeline-last-run.json");if(e.id.startsWith("project.")&&(e.id.endsWith(".test")||e.id.endsWith(".build")))return p.join(s,".rapidkit","reports","workspace-run-last.json")}function k(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function $(e){let s=k(e.healthScore),r=typeof s?.errors=="number"?s.errors:0,a=typeof s?.percent=="number"?s.percent:void 0;return r>0?{status:"fail",message:`Doctor evidence reports ${r} error(s).`}:typeof a=="number"&&a<70?{status:"warn",message:`Doctor health score is ${a}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function M(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 O(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 x(e){let s=k(e.summary);if(s?.blocking===true||e.blocking===true)return {status:"fail",message:"Analyze evidence reports blocking findings."};let a=typeof s?.status=="string"?s.status:void 0;return a==="warn"||a==="warning"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is present."}}function _(e){let s=k(e.summary),r=typeof s?.verdict=="string"?s.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function D(e,s,r){let a=s.id.endsWith(".build")?"build":s.id.endsWith(".test")?"test":null,i=c$1(e,a);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let u=i.stage;if(a&&u!==a)return {status:"missing",message:`Workspace run evidence is for stage "${u}", expected "${a}".`};let c=Array.isArray(i.projects)?i.projects:[],o=s.project?.toLowerCase();if(!o)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let n=c.find(d=>{let t=k(d);if(!t)return false;let m=typeof t.projectName=="string"?t.projectName.toLowerCase():"",E=["projectPath","relativePath","path"].map(l=>t[l]).filter(l=>typeof l=="string"&&l.trim().length>0).map(l=>l.replace(/\\/g,"/").toLowerCase());return m===o||E.some(l=>l.endsWith(`/${o}`)||l===o)});if(n){let d=f(i.generatedAt,r,`Workspace run evidence for ${s.project??s.id}`);if(d)return {status:"fail",message:d};let t=k(n),m=typeof t?.status=="string"?t.status:"unknown";return m==="failed"?{status:"fail",message:`Workspace run evidence failed for ${s.project}.`}:m==="passed"?{status:"pass",message:`Workspace run evidence passed for ${s.project}.`}:m==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${s.project}.`}:{status:"warn",message:`Workspace run evidence status is ${m} for ${s.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${s.project}.`}}function f(e,s,r){if(typeof e!="string"||!s)return null;let a=Date.parse(e),i=Date.parse(s);return !Number.isFinite(a)||!Number.isFinite(i)?null:a<i?`${r} is stale: generated at ${e}, before impact ${s}.`:null}async function F(e,s,r,a){let i=A(e,s),u=i?p.relative(s,i).split(p.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)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(!i||!await g.pathExists(i))return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:u,message:u?`Missing evidence report: ${u}`:"No evidence mapping exists for this command."};let c=k(await g.readJson(i));if(!c)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:u,message:"Evidence report is not a JSON object."};let o;if(e.id==="workspace.doctor"){let n=f(c.generatedAt,a,"Doctor evidence");n?o={status:"fail",message:n}:o=$(c);}else if(e.id==="workspace.readiness"){let n=f(c.generatedAt,a,"Release readiness evidence");n?o={status:"fail",message:n}:o=M(c);}else if(e.id==="workspace.contract.verify"){let n=f(c.generatedAt,a,"Workspace contract verify evidence");n?o={status:"fail",message:n}:o=O(c);}else if(e.id==="workspace.analyze"){let n=f(c.generatedAt,a,"Analyze evidence");n?o={status:"fail",message:n}:o=x(c);}else if(e.id==="workspace.pipeline"){let n=f(c.generatedAt,a,"Pipeline evidence");n?o={status:"fail",message:n}:o=_(c);}else if(e.id.startsWith("project."))o=D(c,e,a);else {let n=f(c.generatedAt,a,"Evidence report");n?o={status:"fail",message:n}: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:u,message:o.message}}function q(e){let s=e.filter(t=>t.status==="pass").length,r=e.filter(t=>t.status==="warn").length,a=e.filter(t=>t.status==="fail").length,i=e.filter(t=>t.status==="missing").length,u=e.filter(t=>t.status==="skipped").length,c=e.filter(t=>t.required&&(t.status==="fail"||t.status==="missing")).map(t=>`${t.id}: ${t.message}`),o=e.filter(t=>t.required&&t.status==="missing").length,n="ready",d=0;return c.length>0?(n="blocked",d=2):(r>0||o>0)&&(n="needs-attention",d=1),{verdict:n,exitCode:d,stepsPassed:s,stepsWarn:r,stepsFailed:a,stepsMissing:i,stepsSkipped:u}}async function N(e$1){let s=p.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let u=C(s,e$1.fromImpactPath);return {impact:await P(u),fromImpactRef:p.relative(s,u).split(p.sep).join("/")}}let r=p.join(s,f$1);if(await g.pathExists(r))return {impact:await P(r),fromImpactRef:f$1};let a=p.join(s,c);if(await g.pathExists(a))return {impact:await n({workspacePath:s,fromPath:c,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:c};let i=await d({workspacePath:s,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:e,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:".rapidkit/reports/workspace-model-diff-last-run.json",workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0},affectedProjects:[],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$1.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:i}}}}async function Y(e){let s=p.resolve(e.workspacePath),{impact:r,fromImpactRef:a}=await N(e),i=r.diff.currentModel,u=I([...m(),...r.verificationPlan]).filter(t=>V(e.scope,t)),c=[];for(let t of u)c.push(await F(t,s,i.contracts.exists===true,r.generatedAt));let o=q(c),n=c.filter(t=>t.status==="missing"&&t.evidencePath).map(t=>t.evidencePath),d=c.filter(t=>t.required&&(t.status==="fail"||t.status==="missing")).map(t=>`${t.id}: ${t.message}`);return {schemaVersion:R,generatedAt:(e.now??new Date).toISOString(),workspacePath:s,mode:"evidence",fromImpactRef:a,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:o,steps:c,missingEvidence:n,blockingReasons:d,verificationPlan:u}}async function U(e,s){let r=p.join(s,S);return await g.ensureDir(p.dirname(r)),await g.writeJson(r,e,{spaces:2}),r}function Q(e,s){return e.summary.verdict==="blocked"?2:s?.strict&&e.summary.verdict!=="ready"?1:e.summary.exitCode}export{S as WORKSPACE_VERIFY_REPORT_PATH,R as WORKSPACE_VERIFY_SCHEMA_VERSION,Y as buildWorkspaceVerify,Q as workspaceVerifyExitCode,U as writeWorkspaceVerify};
|
|
1
|
+
import {m,f as f$1,c,n,e}from'./chunk-ABPDGFVD.js';import {d}from'./chunk-XESEBTPE.js';import {c as c$1}from'./chunk-FV5A3N3I.js';import p from'path';import g from'fs-extra';var R="workspace-verify.v1",S=".rapidkit/reports/workspace-verify-last-run.json";function C(e,s){return p.isAbsolute(s)?s:p.join(e,s)}async function P(e$1){let s=await g.readJson(e$1);if(!s||typeof s!="object"||Array.isArray(s))throw new Error(`Workspace impact input is not a JSON object: ${e$1}`);let r=s;if(r.schemaVersion!==e)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);return r}function I(e){let s=new Set,r=[];for(let a of e){let i=`${a.scope}:${a.project??""}:${a.display}`;s.has(i)||(s.add(i),r.push(a));}return r}function V(e,s){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return s.scope==="workspace"?true:(s.project??"").trim().toLowerCase()===r}function A(e,s){if(e.id==="workspace.doctor")return p.join(s,".rapidkit","reports","doctor-last-run.json");if(e.id==="workspace.contract.verify")return p.join(s,".rapidkit","reports","workspace-contract-verify-last-run.json");if(e.id==="workspace.readiness")return p.join(s,".rapidkit","reports","release-readiness-last-run.json");if(e.id==="workspace.analyze")return p.join(s,".rapidkit","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return p.join(s,".rapidkit","reports","pipeline-last-run.json");if(e.id.startsWith("project.")&&(e.id.endsWith(".test")||e.id.endsWith(".build")))return p.join(s,".rapidkit","reports","workspace-run-last.json")}function k(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function $(e){let s=k(e.healthScore),r=typeof s?.errors=="number"?s.errors:0,a=typeof s?.percent=="number"?s.percent:void 0;return r>0?{status:"fail",message:`Doctor evidence reports ${r} error(s).`}:typeof a=="number"&&a<70?{status:"warn",message:`Doctor health score is ${a}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function M(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 O(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 x(e){let s=k(e.summary);if(s?.blocking===true||e.blocking===true)return {status:"fail",message:"Analyze evidence reports blocking findings."};let a=typeof s?.status=="string"?s.status:void 0;return a==="warn"||a==="warning"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is present."}}function _(e){let s=k(e.summary),r=typeof s?.verdict=="string"?s.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function D(e,s,r){let a=s.id.endsWith(".build")?"build":s.id.endsWith(".test")?"test":null,i=c$1(e,a);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let u=i.stage;if(a&&u!==a)return {status:"missing",message:`Workspace run evidence is for stage "${u}", expected "${a}".`};let c=Array.isArray(i.projects)?i.projects:[],o=s.project?.toLowerCase();if(!o)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let n=c.find(d=>{let t=k(d);if(!t)return false;let m=typeof t.projectName=="string"?t.projectName.toLowerCase():"",E=["projectPath","relativePath","path"].map(l=>t[l]).filter(l=>typeof l=="string"&&l.trim().length>0).map(l=>l.replace(/\\/g,"/").toLowerCase());return m===o||E.some(l=>l.endsWith(`/${o}`)||l===o)});if(n){let d=f(i.generatedAt,r,`Workspace run evidence for ${s.project??s.id}`);if(d)return {status:"fail",message:d};let t=k(n),m=typeof t?.status=="string"?t.status:"unknown";return m==="failed"?{status:"fail",message:`Workspace run evidence failed for ${s.project}.`}:m==="passed"?{status:"pass",message:`Workspace run evidence passed for ${s.project}.`}:m==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${s.project}.`}:{status:"warn",message:`Workspace run evidence status is ${m} for ${s.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${s.project}.`}}function f(e,s,r){if(typeof e!="string"||!s)return null;let a=Date.parse(e),i=Date.parse(s);return !Number.isFinite(a)||!Number.isFinite(i)?null:a<i?`${r} is stale: generated at ${e}, before impact ${s}.`:null}async function F(e,s,r,a){let i=A(e,s),u=i?p.relative(s,i).split(p.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)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(!i||!await g.pathExists(i))return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:u,message:u?`Missing evidence report: ${u}`:"No evidence mapping exists for this command."};let c=k(await g.readJson(i));if(!c)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:u,message:"Evidence report is not a JSON object."};let o;if(e.id==="workspace.doctor"){let n=f(c.generatedAt,a,"Doctor evidence");n?o={status:"fail",message:n}:o=$(c);}else if(e.id==="workspace.readiness"){let n=f(c.generatedAt,a,"Release readiness evidence");n?o={status:"fail",message:n}:o=M(c);}else if(e.id==="workspace.contract.verify"){let n=f(c.generatedAt,a,"Workspace contract verify evidence");n?o={status:"fail",message:n}:o=O(c);}else if(e.id==="workspace.analyze"){let n=f(c.generatedAt,a,"Analyze evidence");n?o={status:"fail",message:n}:o=x(c);}else if(e.id==="workspace.pipeline"){let n=f(c.generatedAt,a,"Pipeline evidence");n?o={status:"fail",message:n}:o=_(c);}else if(e.id.startsWith("project."))o=D(c,e,a);else {let n=f(c.generatedAt,a,"Evidence report");n?o={status:"fail",message:n}: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:u,message:o.message}}function q(e){let s=e.filter(t=>t.status==="pass").length,r=e.filter(t=>t.status==="warn").length,a=e.filter(t=>t.status==="fail").length,i=e.filter(t=>t.status==="missing").length,u=e.filter(t=>t.status==="skipped").length,c=e.filter(t=>t.required&&(t.status==="fail"||t.status==="missing")).map(t=>`${t.id}: ${t.message}`),o=e.filter(t=>t.required&&t.status==="missing").length,n="ready",d=0;return c.length>0?(n="blocked",d=2):(r>0||o>0)&&(n="needs-attention",d=1),{verdict:n,exitCode:d,stepsPassed:s,stepsWarn:r,stepsFailed:a,stepsMissing:i,stepsSkipped:u}}async function N(e$1){let s=p.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let u=C(s,e$1.fromImpactPath);return {impact:await P(u),fromImpactRef:p.relative(s,u).split(p.sep).join("/")}}let r=p.join(s,f$1);if(await g.pathExists(r))return {impact:await P(r),fromImpactRef:f$1};let a=p.join(s,c);if(await g.pathExists(a))return {impact:await n({workspacePath:s,fromPath:c,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:c};let i=await d({workspacePath:s,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:e,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:".rapidkit/reports/workspace-model-diff-last-run.json",workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0},affectedProjects:[],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$1.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:i}}}}async function Y(e){let s=p.resolve(e.workspacePath),{impact:r,fromImpactRef:a}=await N(e),i=r.diff.currentModel,u=I([...m(),...r.verificationPlan]).filter(t=>V(e.scope,t)),c=[];for(let t of u)c.push(await F(t,s,i.contracts.exists===true,r.generatedAt));let o=q(c),n=c.filter(t=>t.status==="missing"&&t.evidencePath).map(t=>t.evidencePath),d=c.filter(t=>t.required&&(t.status==="fail"||t.status==="missing")).map(t=>`${t.id}: ${t.message}`);return {schemaVersion:R,generatedAt:(e.now??new Date).toISOString(),workspacePath:s,mode:"evidence",fromImpactRef:a,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:o,steps:c,missingEvidence:n,blockingReasons:d,verificationPlan:u}}async function U(e,s){let r=p.join(s,S);return await g.ensureDir(p.dirname(r)),await g.writeJson(r,e,{spaces:2}),r}function Q(e,s){return e.summary.verdict==="blocked"?2:s?.strict&&e.summary.verdict!=="ready"?1:e.summary.exitCode}export{S as WORKSPACE_VERIFY_REPORT_PATH,R as WORKSPACE_VERIFY_SCHEMA_VERSION,Y as buildWorkspaceVerify,Q as workspaceVerifyExitCode,U as writeWorkspaceVerify};
|
package/docs/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Hub for user and contributor documentation. Start with the [main README](../READ
|
|
|
18
18
|
| [commands-reference.md](./commands-reference.md) | Full CLI syntax, profiles, and policy keys |
|
|
19
19
|
| [workspace-operations.md](./workspace-operations.md) | Import, adopt, snapshots, archives, contracts, infra |
|
|
20
20
|
| [workspace-run.md](./workspace-run.md) | Polyglot fleet orchestration (`workspace run`) |
|
|
21
|
+
| [create-planner-capabilities.md](./create-planner-capabilities.md) | Native create, external-create-adopt, and adopt-only lanes |
|
|
21
22
|
| [from-code-to-shared-understanding.md](./from-code-to-shared-understanding.md) | GitHub-rendered Workspace Intelligence diagram |
|
|
22
23
|
| [OPEN_SOURCE_USER_SCENARIOS.md](./OPEN_SOURCE_USER_SCENARIOS.md) | Role-based workflows (junior → enterprise) |
|
|
23
24
|
| [doctor-command.md](./doctor-command.md) | Doctor scopes, CI exit codes, JSON evidence |
|
|
@@ -4,70 +4,77 @@ Canonical map of **on-disk artifacts** produced by `rapidkit-npm` commands. Dash
|
|
|
4
4
|
|
|
5
5
|
## Authority layers (identity)
|
|
6
6
|
|
|
7
|
-
| Artifact
|
|
8
|
-
|
|
|
9
|
-
| Workspace manifest | `.rapidkit/workspace.json`
|
|
10
|
-
| Workspace contract | `.rapidkit/workspace.contract.json`
|
|
11
|
-
| Registry summary
|
|
12
|
-
| Workspace marker
|
|
7
|
+
| Artifact | Path | Writer | Reader purpose |
|
|
8
|
+
| ------------------ | -------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
9
|
+
| Workspace manifest | `.rapidkit/workspace.json` | `create workspace`, `foundation ensure`, `bootstrap` (profile) | Profile, engine, bootstrap metadata — **not** project list |
|
|
10
|
+
| Workspace contract | `.rapidkit/workspace.contract.json` | `workspace sync`, `workspace contract *`, import/adopt | Operational project registry (ports, contracts) |
|
|
11
|
+
| Registry summary | `.rapidkit/workspace-registry.v1.json` | `workspace sync`, contract sync, `registry status --refresh` | **Canonical** project count + authority for UI/CI |
|
|
12
|
+
| Workspace marker | `.rapidkit-workspace` | `create workspace`, `foundation ensure` | Root detection |
|
|
13
13
|
|
|
14
14
|
## Naming conventions
|
|
15
15
|
|
|
16
|
-
| Pattern
|
|
17
|
-
|
|
|
18
|
-
| `*-last-run.json` | Latest gate/run evidence
|
|
19
|
-
| `*.latest.json`
|
|
20
|
-
| Static state
|
|
16
|
+
| Pattern | Meaning | Examples |
|
|
17
|
+
| ----------------- | -------------------------------------- | ------------------------------------------------------------ |
|
|
18
|
+
| `*-last-run.json` | Latest gate/run evidence | `doctor-last-run.json`, `pipeline-last-run.json` |
|
|
19
|
+
| `*.latest.json` | Rolling alias + timestamped siblings | `bootstrap-compliance.latest.json`, `mirror-ops.latest.json` |
|
|
20
|
+
| Static state | Current model/state (not a single run) | `workspace-model.json`, `workspace.contract.json` |
|
|
21
21
|
|
|
22
22
|
## Governance evidence loop
|
|
23
23
|
|
|
24
|
-
| Command
|
|
25
|
-
|
|
|
26
|
-
| `doctor workspace`
|
|
27
|
-
| `doctor project`
|
|
28
|
-
| `analyze`
|
|
29
|
-
| `readiness`
|
|
30
|
-
| `pipeline`
|
|
31
|
-
| `autopilot release` | `.rapidkit/reports/autopilot-release-last-run.json` | `autopilot-release-v1`
|
|
32
|
-
|
|
|
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) | — |
|
|
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
|
|
39
|
-
|
|
|
40
|
-
| `workspace model --write`
|
|
41
|
-
| `workspace snapshot`
|
|
42
|
-
| `workspace diff`
|
|
43
|
-
| `workspace impact --from <diff>` | `workspace-impact-last-run.json`
|
|
44
|
-
| `workspace verify`
|
|
45
|
-
| `workspace context --write`
|
|
46
|
-
| `workspace agent-sync --write`
|
|
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` | — |
|
|
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
50
|
## Operational / platform
|
|
51
51
|
|
|
52
|
-
| Command
|
|
53
|
-
|
|
|
54
|
-
| `workspace run`
|
|
55
|
-
| `autopilot release` (run stages) | same `workspace-run-last.json`
|
|
56
|
-
| `bootstrap`
|
|
57
|
-
| `mirror status`
|
|
58
|
-
| `mirror` (transparency)
|
|
59
|
-
| `infra plan`
|
|
60
|
-
| `workspace archive`
|
|
61
|
-
| `workspace share`
|
|
62
|
-
| `import` / `adopt`
|
|
63
|
-
| `workspace contract verify`
|
|
52
|
+
| Command | Artifact | Notes |
|
|
53
|
+
| -------------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
54
|
+
| `workspace run` | `workspace-run-last.json` | `workspace-run-v1` (multi-stage: `stages.test`, `stages.build`, …) | `contracts/workspace-run-last.v1.json` |
|
|
55
|
+
| `autopilot release` (run stages) | same `workspace-run-last.json` | Autopilot publishes test/build into aggregate (no separate `autopilot-workspace-run-*.json`) | — |
|
|
56
|
+
| `bootstrap` | `bootstrap-compliance-{ts}.json`, `bootstrap-compliance.latest.json` | |
|
|
57
|
+
| `mirror status` | `mirror-ops-{ts}.json`, `mirror-ops.latest.json` | |
|
|
58
|
+
| `mirror` (transparency) | `transparency-evidence-{ts}.json`, `transparency-evidence.latest.json` | |
|
|
59
|
+
| `infra plan` | `infra-plan.json` | `rapidkit.infra-plan.v1` |
|
|
60
|
+
| `workspace archive` | `archive-manifest.json` | Root `.rapidkit/`, handoff |
|
|
61
|
+
| `workspace share` | `reports/share-bundle.json` (default) | Aggregation bundle |
|
|
62
|
+
| `import` / `adopt` | `{project}/.rapidkit/import-readiness.json` | Per project |
|
|
63
|
+
| `workspace contract verify` | `workspace-contract-verify-last-run.json` | CLI verify cache |
|
|
64
|
+
|
|
65
|
+
## Static capability contracts
|
|
66
|
+
|
|
67
|
+
| Contract | Schema version | Consumer purpose |
|
|
68
|
+
| ----------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
69
|
+
| `contracts/runtime-command-surface.v1.json` | `rapidkit-runtime-command-surface-v1` | Runtime commands, scaffold kits, and create planner summary |
|
|
70
|
+
| `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 |
|
|
64
71
|
|
|
65
72
|
## Registry commands
|
|
66
73
|
|
|
67
|
-
| Command
|
|
68
|
-
|
|
|
69
|
-
| `workspace sync [--json]`
|
|
70
|
-
| `workspace registry status [--refresh] [--json]` | Reads or publishes registry summary
|
|
74
|
+
| Command | Output |
|
|
75
|
+
| ------------------------------------------------ | -------------------------------------------------------------------------------- |
|
|
76
|
+
| `workspace sync [--json]` | Updates contract + `workspace-registry.v1.json`; JSON includes `registrySummary` |
|
|
77
|
+
| `workspace registry status [--refresh] [--json]` | Reads or publishes registry summary |
|
|
71
78
|
|
|
72
79
|
## Project-scoped reports
|
|
73
80
|
|
|
@@ -85,17 +92,17 @@ Under `{project}/.rapidkit/reports/` when commands run at project scope (e.g. pr
|
|
|
85
92
|
|
|
86
93
|
Written by `workspace agent-sync --write` (and by default after `workspace context --for-agent --write`):
|
|
87
94
|
|
|
88
|
-
| Path
|
|
89
|
-
|
|
|
90
|
-
| `AGENTS.md`
|
|
91
|
-
| `.github/copilot-instructions.md`
|
|
92
|
-
| `.github/instructions/rapidkit-evidence.instructions.md` | Copilot scoped `.rapidkit/**` rules
|
|
93
|
-
| `.github/prompts/rapidkit-diagnose.prompt.md`
|
|
94
|
-
| `.github/skills/rapidkit-grounding/SKILL.md`
|
|
95
|
-
| `.cursor/rules/rapidkit-grounding.mdc`
|
|
96
|
-
| `CLAUDE.md`
|
|
97
|
-
| `.claude/rules/rapidkit-evidence.md`
|
|
98
|
-
| `.rapidkit/AGENT-GROUNDING.md`
|
|
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 |
|
|
99
106
|
|
|
100
107
|
## See also
|
|
101
108
|
|
package/docs/contracts/README.md
CHANGED
|
@@ -6,25 +6,25 @@ Contract documentation for JSON payloads, support matrices, and cross-repo parit
|
|
|
6
6
|
|
|
7
7
|
Canonical JSON lives in **`../contracts/`** (npm package root, published in the tarball).
|
|
8
8
|
|
|
9
|
-
| Script
|
|
10
|
-
|
|
|
11
|
-
| `npm run generate:contracts`
|
|
12
|
-
| `npm run check:generated-contracts` | Verify committed JSON matches generators
|
|
13
|
-
| `npm run sync:parity-snapshot`
|
|
14
|
-
| `npm run check:parity-snapshot`
|
|
15
|
-
| `npm run validate:contracts`
|
|
9
|
+
| Script | Purpose |
|
|
10
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `npm run generate:contracts` | Regenerate runtime surface, create planner, import-stack parity, module-layout, infra-stack |
|
|
12
|
+
| `npm run check:generated-contracts` | Verify committed JSON matches generators |
|
|
13
|
+
| `npm run sync:parity-snapshot` | Copy canonical → vscode `contracts/` mirror |
|
|
14
|
+
| `npm run check:parity-snapshot` | Verify mirrors match canonical |
|
|
15
|
+
| `npm run validate:contracts` | Generate check + mirror check + contract tests |
|
|
16
16
|
|
|
17
17
|
Workflow: change code → `npm run generate:contracts` → `npm run sync:parity-snapshot` → commit npm + vscode `contracts/`.
|
|
18
18
|
|
|
19
19
|
## Documents in this folder
|
|
20
20
|
|
|
21
|
-
| File
|
|
22
|
-
|
|
|
23
|
-
| [ARTIFACT_CATALOG.md](./ARTIFACT_CATALOG.md)
|
|
24
|
-
| [COMMAND_OWNERSHIP_MATRIX.md](./COMMAND_OWNERSHIP_MATRIX.md)
|
|
25
|
-
| [RUNTIME_SUPPORT_MATRIX.md](./RUNTIME_SUPPORT_MATRIX.md)
|
|
26
|
-
| [RUNTIME_ACCEPTANCE_MATRIX.md](./RUNTIME_ACCEPTANCE_MATRIX.md) | Runtime acceptance matrix expectations
|
|
27
|
-
| [rapidkit-cli-contracts.json](./rapidkit-cli-contracts.json)
|
|
21
|
+
| File | Purpose |
|
|
22
|
+
| -------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
23
|
+
| [ARTIFACT_CATALOG.md](./ARTIFACT_CATALOG.md) | On-disk artifact paths, schema versions, and consumer rules |
|
|
24
|
+
| [COMMAND_OWNERSHIP_MATRIX.md](./COMMAND_OWNERSHIP_MATRIX.md) | Which commands the npm wrapper owns vs Python Core |
|
|
25
|
+
| [RUNTIME_SUPPORT_MATRIX.md](./RUNTIME_SUPPORT_MATRIX.md) | Scaffold, import, lifecycle, and module support tiers |
|
|
26
|
+
| [RUNTIME_ACCEPTANCE_MATRIX.md](./RUNTIME_ACCEPTANCE_MATRIX.md) | Runtime acceptance matrix expectations |
|
|
27
|
+
| [rapidkit-cli-contracts.json](./rapidkit-cli-contracts.json) | Core CLI JSON schema fragments |
|
|
28
28
|
|
|
29
29
|
## Workspace intelligence schemas
|
|
30
30
|
|
|
@@ -36,6 +36,7 @@ Published under `../contracts/` (not duplicated in this folder):
|
|
|
36
36
|
- `doctor-workspace-evidence.v1.json` / `doctor-project-evidence.v1.json` — doctor evidence
|
|
37
37
|
- `analyze-last-run.v1.json` — analyze evidence
|
|
38
38
|
- `pipeline-last-run.v1.json` — governance pipeline orchestration
|
|
39
|
+
- `create-planner-capabilities.v1.json` — native-create, external-create-adopt, and adopt-only capability lanes
|
|
39
40
|
|
|
40
41
|
Workspace intelligence (`../contracts/workspace-intelligence/`):
|
|
41
42
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Create Planner Capabilities
|
|
2
|
+
|
|
3
|
+
RapidKit is a Workspace Intelligence platform, not a blind scaffold wrapper.
|
|
4
|
+
The create planner separates project creation into three lanes so developers,
|
|
5
|
+
CI, and AI agents share the same expectations.
|
|
6
|
+
|
|
7
|
+
## Lanes
|
|
8
|
+
|
|
9
|
+
| Lane | Status | Meaning |
|
|
10
|
+
| ----------------------- | --------- | --------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `native-create` | Available | RapidKit owns the scaffold contract, marker, registry, doctor, bootstrap, and workspace model path. |
|
|
12
|
+
| `external-create-adopt` | Planned | A stable ecosystem generator exists, but RapidKit does not yet own the full post-create contract. |
|
|
13
|
+
| `adopt-only` | Available | The project enters Workspace Intelligence through import/adopt, not native create. |
|
|
14
|
+
|
|
15
|
+
## Native create
|
|
16
|
+
|
|
17
|
+
Native create is reserved for kits with deterministic RapidKit contracts:
|
|
18
|
+
|
|
19
|
+
- FastAPI
|
|
20
|
+
- NestJS
|
|
21
|
+
- Go Fiber and Go Gin
|
|
22
|
+
- Spring Boot
|
|
23
|
+
- ASP.NET Core Web API
|
|
24
|
+
- Frontend kits (`frontend.nextjs`, `frontend.vite-react`, `frontend.angular`, and related frontend generators)
|
|
25
|
+
|
|
26
|
+
These kits can be exposed through `rapidkit create project` because RapidKit can
|
|
27
|
+
create the project and immediately produce the expected `.rapidkit` metadata,
|
|
28
|
+
workspace registry entries, doctor evidence, and workspace model data.
|
|
29
|
+
|
|
30
|
+
## External create, then adopt
|
|
31
|
+
|
|
32
|
+
Some ecosystems have stable external commands but are not RapidKit-native create
|
|
33
|
+
targets yet:
|
|
34
|
+
|
|
35
|
+
- WordPress site: `wp core download`, `wp config create`, `wp db create`, `wp core install`
|
|
36
|
+
- WordPress block/plugin: `npx @wordpress/create-block@latest <slug>`
|
|
37
|
+
- Laravel: `composer create-project laravel/laravel <name>`
|
|
38
|
+
- Symfony: `composer create-project symfony/skeleton <name>`
|
|
39
|
+
- Rails: `rails new <name>`
|
|
40
|
+
|
|
41
|
+
These are `external-create-adopt` candidates, not active native kits. Until the
|
|
42
|
+
post-create contract is implemented end to end, RapidKit should guide users to
|
|
43
|
+
create externally and then adopt/import the project.
|
|
44
|
+
|
|
45
|
+
## Adopt only
|
|
46
|
+
|
|
47
|
+
If a project already exists, or if the requested runtime has no RapidKit-owned
|
|
48
|
+
create contract, the correct lane is `adopt-only`.
|
|
49
|
+
|
|
50
|
+
Adoption still gives the project Workspace Intelligence:
|
|
51
|
+
|
|
52
|
+
- framework and runtime detection
|
|
53
|
+
- workspace registry membership
|
|
54
|
+
- doctor and analyze evidence
|
|
55
|
+
- workspace model and context generation
|
|
56
|
+
- governance, Advisor, Studio, and agent grounding
|
|
57
|
+
|
|
58
|
+
## Product rule
|
|
59
|
+
|
|
60
|
+
Do not convert an unsupported or ambiguous stack request into a different native
|
|
61
|
+
kit. For example, a PHP, WordPress, Laravel, Symfony, or Rails request must not
|
|
62
|
+
be translated into FastAPI, NestJS, Go, Java, .NET, or a frontend kit.
|
|
63
|
+
|
|
64
|
+
If native create is unavailable, the planner should explain the supported lane
|
|
65
|
+
and guide the user to `adopt-only` or a future `external-create-adopt` flow.
|
|
66
|
+
|
|
67
|
+
## CLI guard
|
|
68
|
+
|
|
69
|
+
`rapidkit create project <kit> <name>` must check the capability lane before
|
|
70
|
+
running any native generator or delegating to the Core engine.
|
|
71
|
+
|
|
72
|
+
If the request resolves to `external-create-adopt` or an explicit `adopt-only`
|
|
73
|
+
runtime, the CLI must stop early and explain:
|
|
74
|
+
|
|
75
|
+
- native create is not available yet for the requested stack
|
|
76
|
+
- whether the future lane is `external-create-adopt` or current `adopt-only`
|
|
77
|
+
- which external generator commands are relevant, when known
|
|
78
|
+
- how to run `npx rapidkit adopt <project-path>` after the project exists
|
|
79
|
+
|
|
80
|
+
This keeps AI surfaces, CI, and developer terminals aligned: unsupported stacks
|
|
81
|
+
are never silently rewritten into unrelated native kits.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapidkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Open-source workspace intelligence CLI for software systems: create, adopt, govern, verify, and align polyglot workspaces for humans, CI, IDEs, and AI agents.",
|
|
6
6
|
"keywords": [
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-7RBZGQ7T.js';
|
package/dist/chunk-3SWQKRXH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {d}from'./chunk-C7OVQQXT.js';import d$1 from'path';import l from'fs-extra';var k="workspace-context.v1",f=".rapidkit/reports/workspace-context-agent.json";function w(e){if(typeof e!="string"||!e.trim()||e==="true")return "generic";let t=e.trim().toLowerCase();return t==="codex"||t==="claude"||t==="cursor"||t==="orca"?t:"generic"}function h(e){return `npx --yes --package rapidkit rapidkit ${e}`.trim()}function y(e){return `npx rapidkit ${e}`.trim()}function i(e){return {id:e.id,scope:e.scope,display:y(e.args),execute:h(e.args),description:e.description,...e.project?{project:e.project}:{}}}function g(e,t){return `workspace run ${t} --scope project:${e.name}`}function j(e){return (e.startsWith("project:")?e.slice(8):e).trim().toLowerCase()}function v(e){return [e.name,e.path,d$1.basename(e.path),e.absolutePath].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim().toLowerCase())}function x(e,t){let s=[i({id:"workspace.model",scope:"workspace",args:"workspace model --json",description:"Read the canonical workspace intelligence model."}),i({id:"workspace.doctor",scope:"workspace",args:"doctor workspace --json",description:"Check workspace health before claiming verification."}),i({id:"workspace.pipeline",scope:"workspace",args:"pipeline --json",description:"Run the governed sync, doctor, analyze, readiness, and autopilot loop."}),i({id:"workspace.contract.verify",scope:"workspace",args:"workspace contract verify --json",description:"Verify workspace contract and dependency edges."}),i({id:"workspace.verify",scope:"workspace",args:"workspace verify --json",description:"Evaluate evidence freshness and verification gates before release decisions."})],o=t?[t]:e.projects;for(let r of o)r.commands.fleetStages.includes("test")&&s.push(i({id:`project.${r.name}.test`,scope:"project",project:r.name,args:g(r,"test"),description:`Run tests for ${r.name} through workspace orchestration.`})),r.commands.fleetStages.includes("build")&&s.push(i({id:`project.${r.name}.build`,scope:"project",project:r.name,args:g(r,"build"),description:`Build ${r.name} through workspace orchestration.`}));return s}function C(e){return e.commands.fleetStages.filter(t=>t==="test"||t==="build").map(t=>`workspace run ${t}`)}function W(e,t){if(!t?.startsWith("project:"))return;let s=j(t);if(s)return e.projects.find(o=>v(o).includes(s))}function b(e,t,s){let o=[...e.validation?.issues??[]];t?.startsWith("project:")&&!s&&o.push({severity:"error",code:"context.scope.project.missing",message:`Requested project scope was not found: ${t}`,target:t});let r=o.filter(a=>a.severity==="error").length,c=o.filter(a=>a.severity==="warning").length;return {status:r>0?"failed":c>0?"warning":"passed",errors:r,warnings:c,issues:o}}function S(e){let t=[],s=[];for(let[o,r]of Object.entries(e.evidence))r?.exists?t.push(`${o}: ${r.path}`):s.push(o);return {available:t.sort(),missing:s.sort()}}function P(e){let t=e.summary.projectCount,s=e.summary.runtimes.length?e.summary.runtimes.join(", "):"no runtime",o=e.identity.surfaces.length?e.identity.surfaces.join(", "):"no detected surfaces";return `${e.workspace.name} is a ${e.identity.workspaceType} with ${t} project${t===1?"":"s"}, ${s} runtime coverage, and ${o}.`}function A(e){let t=["Do not claim a command passed unless a report or command output proves it.","Do not infer secrets or environment values from file names.","Do not change project scope without checking the selected project."];return e.contracts.exists||t.push("Workspace contract is missing; dependency and API edges may be incomplete."),e.summary.observedProjects>0&&t.push("Some projects are observed rather than first-class; command support may be partial."),t}async function O(e){let t=e.model??await d({workspacePath:e.workspacePath,includeEvidence:e.includeEvidence===true,observableScanDepth:e.observableScanDepth,now:e.now}),s=w(e.agent),o=W(t,e.scope),r=b(t,e.scope,o);if(e.strict===true&&r.status!=="passed"){let n=r.issues.map(p=>`${p.severity}:${p.code}:${p.target}`).join(", ");throw new Error(`Workspace context strict validation failed: ${n}`)}let c=(o?[o]:t.projects).map(n=>({name:n.name,path:n.path,kind:n.kind,runtime:n.runtime,framework:n.frameworkDisplayName,...n.generator?{generator:n.generator}:{},supportTier:n.supportTier,safeCommands:C(n),importantFiles:n.importantFiles})),a=S(t),m=P(t);return {schemaVersion:k,generatedAt:(e.now??new Date).toISOString(),agent:s,workspaceSummary:m,modelRef:".rapidkit/reports/workspace-model.json",workspace:{name:t.workspace.name,root:t.workspace.root,type:t.identity.workspaceType,...t.workspace.profile?{profile:t.workspace.profile}:{}},scope:{requested:e.scope??"workspace",...o?{activeProject:o.name}:{}},projects:c,safeCommands:x(t,o),evidence:a,policies:{mode:t.policies.mode,source:t.policies.source},contracts:{exists:t.contracts.exists,path:t.contracts.workspaceContractPath},validation:r,agentInstructions:["Read `.rapidkit/reports/INDEX.json` first, then this context pack and linked evidence reports.","Use this context as the workspace source of truth before inspecting random files.","Prefer workspace-level evidence over generic framework assumptions.","Use `display` commands when explaining steps to a human.","Use `execute` commands when launching commands from automation or tooling.","Keep project-scoped advice tied to the active project scope.","Regenerate stale grounding with `npx rapidkit workspace agent-sync --write --refresh-context`."],unsafeAssumptions:A(t),humanSummary:[m,`Evidence available: ${a.available.length}. Missing evidence groups: ${a.missing.join(", ")||"none"}.`,o?`Active project scope: ${o.name} (${o.frameworkDisplayName}).`:"Scope: whole workspace."].join(`
|
|
2
|
-
`)}}async function D(e,t){let s=d$1.join(t,f);return await l.ensureDir(d$1.dirname(s)),await l.writeJSON(s,e,{spaces:2}),s}export{k as a,f as b,O as c,D as d};
|
package/dist/chunk-C7OVQQXT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-YJ24EV3P.js';import {a}from'./chunk-RV6HBTFC.js';import {a as a$3,q as q$1,k as k$1}from'./chunk-YBS2HGO3.js';import {i,h}from'./chunk-UZW5QFRW.js';import {a as a$2}from'./chunk-VKLL63TL.js';import {a as a$1}from'./chunk-HHJAANUC.js';import p from'path';import f from'fs-extra';var V="workspace-model.v1",K=".rapidkit/reports/workspace-model.json",L=["package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","deno.jsonc","bun.lock","bun.lockb","deps.edn","project.clj","build.sbt","docker-compose.yml","docker-compose.yaml","terraform.tf"],q=new Set([".git",".hg",".svn",".rapidkit",".venv","node_modules","dist","build","target","coverage","htmlcov",".next",".turbo"]);function _(t,e){return (p.relative(t,e)||".").split(p.sep).join("/")}async function N(t){try{if(!await f.pathExists(t))return null;let e=await f.readJSON(t);return e&&typeof e=="object"?e:null}catch{return null}}async function z(t,e){for(let r of e)if(await f.pathExists(p.join(t,r)))return true;return false}function H(t){let e=Number.parseInt(process.env.RAPIDKIT_WORKSPACE_MODEL_SCAN_DEPTH??"",10),r=typeof t=="number"&&Number.isFinite(t)?t:Number.isFinite(e)?e:4;return Math.min(12,Math.max(1,Math.trunc(r)))}async function J(t,e){let r=p.resolve(t),n=[{dirPath:r,depth:0}],s=new Set,o=new Set;for(;n.length>0;){let i=n.shift();if(!i)continue;let a=p.resolve(i.dirPath);if(o.has(a))continue;if(o.add(a),a!==r&&await z(a,L)){s.add(a);continue}if(i.depth>=e)continue;let g=[];try{g=await f.readdir(a,{withFileTypes:true});}catch{continue}for(let m of g)!m.isDirectory()||q.has(m.name)||m.name.startsWith(".")&&m.name!==".config"||n.push({dirPath:p.join(a,m.name),depth:i.depth+1});}return Array.from(s).sort((i,a)=>i.localeCompare(a))}function G(t){let e=new Set,r=[];for(let n of t){let s=p.resolve(n);e.has(s)||(e.add(s),r.push(s));}return r.sort((n,s)=>n.localeCompare(s))}function D(t,e){let r=t?.[e];return typeof r=="string"&&r.trim()?r.trim():void 0}function U(t,e){return t?.[e]===true}function Q(t,e,r){let n=t?.frontend&&typeof t.frontend=="object"&&!Array.isArray(t.frontend)?t.frontend:void 0,s=D(n,"generator"),o=D(n,"command_display"),i=typeof e=="string"&&e.startsWith("frontend.");if(!(!s&&!i))return {...s?{id:s}:{},...e?{kit:e}:{},displayName:r,source:U(n,"official_generator")?"official-generator":"metadata",...o?{commandDisplay:o}:{}}}async function X(t){let e=[".rapidkit/project.json",".rapidkit/context.json","package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","Dockerfile","docker-compose.yml","README.md"],r=[];for(let n of e)await f.pathExists(p.join(t,n))&&r.push(n);return r}async function k(t,e,r){let n=p.join(t,e),s=await f.pathExists(n),o={path:e.split(p.sep).join("/"),exists:s};if(s&&r){let i=await N(n);typeof i?.generatedAt=="string"&&(o.generatedAt=i.generatedAt);let a=i?.status??i?.result??i?.verdict;typeof a=="string"&&(o.status=a);}return o}async function Y(t,e,r){let s=`${_(t,e)}/.rapidkit/reports`,o=await k(t,`${s}/doctor-project-last-run.json`,r);return {doctor:o?.exists===true?o:await k(t,`${s}/doctor-last-run.json`,r),analyze:await k(t,`${s}/analyze-last-run.json`,r),readiness:await k(t,`${s}/release-readiness-last-run.json`,r)}}async function Z(t,e,r){let n=a$3(e),s=i(e,n),o=q$1(e),i$1=k$1(s.runtime),a=await a$4(e,n),g=typeof n?.name=="string"&&n.name.trim()?n.name.trim():p.basename(e),m=typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0,y=typeof n?.engine=="string"?n.engine:o.engine!=="unknown"?o.engine:void 0,c=Q(n,m,s.displayName);return {name:g,path:_(t,e),...r.includeAbsolutePaths?{absolutePath:e}:{},kind:a,runtime:s.runtime,runtimeCandidates:h(e),framework:s.key,frameworkDisplayName:s.displayName,confidence:s.confidence,detectionSource:s.source,supportTier:s.supportTier,runtimeSupportTier:i$1.tier,runtimeDoctorSupport:i$1.doctorSupport,moduleSupport:o.moduleSupport,...m?{kit:m}:{},...y?{engine:y}:{},...c?{generator:c}:{},commands:{supported:o.supportedCommands,unsupported:o.unsupportedCommands,global:o.globalCommands,fleetStages:o.fleetStages,localOnly:o.localOnlyCommands,map:o.commandMap},importantFiles:await X(e),evidence:await Y(t,e,r.includeEvidence),provenance:{path:"filesystem discovery",runtime:s.source,framework:s.source,commands:"project command capability matrix",evidence:"project .rapidkit/reports"}}}async function ee(t){return N(p.join(t,".rapidkit","workspace.json"))}function te(t){return t.some(e=>e.kind==="frontend")&&t.length>1?"full-stack-workspace":t.some(e=>e.kind==="frontend")?"frontend-workspace":t.length>1?"backend-platform":"backend-workspace"}function oe(t){let e=new Set;for(let r of t){let n=`${r.name} ${r.path}`.toLowerCase();for(let s of ["auth","billing","payment","notification","order","admin","report","search","analytics"])n.includes(s)&&e.add(s);}return Array.from(e).sort()}function u(t,e,r,n){return {severity:t,code:e,message:r,target:n}}function $(t){let e=[];t.workspace.name.trim()||e.push(u("error","workspace.name.missing","Workspace name could not be resolved.","workspace")),t.workspace.type==="observed-workspace"&&e.push(u("warning","workspace.marker.missing","Workspace marker is missing; model is based on filesystem observation.","workspace.marker")),t.summary.projectCount===0&&e.push(u("warning","workspace.projects.empty","No project roots were detected in this workspace.","projects")),t.contracts.exists||e.push(u("warning","workspace.contract.missing","Workspace contract is missing; dependency and API edges may be incomplete.",t.contracts.workspaceContractPath));let r=new Map;for(let o of t.projects){let i=o.name.toLowerCase(),a=r.get(i)??[];a.push(o),r.set(i,a),o.importantFiles.length||e.push(u("warning","project.markers.missing",`Project ${o.name} has no important manifest files recorded.`,o.path)),o.runtime==="unknown"&&e.push(u("warning","project.runtime.unknown",`Project ${o.name} runtime could not be confidently detected.`,o.path));let g=["test","build"];for(let c of g)o.commands.supported.includes(c)&&o.commands.unsupported.includes(c)&&e.push(u("error","project.commands.conflict",`Project ${o.name} marks ${c} as both supported and unsupported.`,o.path));let m=new Set(o.commands.fleetStages),y=new Set(o.commands.localOnly);for(let c of o.commands.fleetStages){y.has(c)&&e.push(u("error","project.commands.scope-conflict",`Project ${o.name} marks ${c} as both fleet and local-only.`,o.path));let d=o.commands.map[c];(!d||d.status!=="supported"||d.fleetEligible!==true||d.executionScope!=="fleet")&&e.push(u("error","project.commands.fleet-stage-invalid",`Project ${o.name} advertises ${c} as a fleet stage without a supported fleet capability.`,o.path));}for(let c of o.commands.localOnly){let d=o.commands.map[c];(!d||d.status!=="supported"||d.executionScope!=="local-only"||d.fleetEligible===true)&&e.push(u("error","project.commands.local-only-invalid",`Project ${o.name} advertises ${c} as local-only without a matching local-only capability.`,o.path));}for(let c of Object.values(o.commands.map))c.status==="supported"&&(c.fleetEligible===true&&!m.has(c.command)&&e.push(u("error","project.commands.fleet-stage-missing",`Project ${o.name} capability ${c.command} is fleet-eligible but missing from fleetStages.`,o.path)),c.executionScope==="local-only"&&c.fleetEligible!==true&&!y.has(c.command)&&e.push(u("error","project.commands.local-only-missing",`Project ${o.name} capability ${c.command} is local-only but missing from localOnly commands.`,o.path)));}for(let[o,i]of r.entries())i.length>1&&e.push(u("error","project.name.duplicate",`Project name "${o}" is ambiguous across ${i.length} project roots.`,i.map(a=>a.path).join(", ")));let n=e.filter(o=>o.severity==="error").length,s=e.filter(o=>o.severity==="warning").length;return {status:n>0?"failed":s>0?"warning":"passed",errors:n,warnings:s,issues:e}}function ge(t){return $(t)}async function ke(t){let e=p.resolve(t.workspacePath),r=t.includeAbsolutePaths===true,n=t.includeEvidence===true,s=H(t.observableScanDepth),o=t.now??new Date,[i,a$3,g,m,y]=await Promise.all([a(e),ee(e),a$1(e),a$2(e,{descendIntoMatchedProjects:false}),J(e,s)]),c=G([...m,...y,...g.map(l=>p.isAbsolute(l.path)?l.path:p.join(e,l.path))]),d=await Promise.all(c.map(l=>Z(e,l,{includeAbsolutePaths:r,includeEvidence:n}))),B=typeof a$3?.workspace_name=="string"?a$3.workspace_name:typeof a$3?.name=="string"?a$3.name:i?.name||p.basename(e),b=typeof a$3?.profile=="string"?a$3.profile:typeof a$3?.mode=="string"?a$3.mode:void 0,F=Array.from(new Set(d.map(l=>l.kind))).sort(),w=Array.from(new Set(d.map(l=>l.runtime))).sort(),I=Array.from(new Set(d.map(l=>l.framework))).sort(),h=[".rapidkit/policies.yml",".rapidkit/policies.yaml"].find(l=>f.existsSync(p.join(e,l))),j=".rapidkit/workspace.contract.json",v=await f.pathExists(p.join(e,j)),P={schemaVersion:V,generatedAt:o.toISOString(),workspace:{name:B,root:e,...b?{profile:b}:{},type:i?"rapidkit-workspace":"observed-workspace",...i?{marker:{createdBy:i.createdBy,version:i.version,createdAt:i.createdAt}}:{}},identity:{workspaceType:te(d),surfaces:F,runtimeFamilies:w,businessCapabilities:oe(d)},discovery:{observableScanDepth:s},projects:d,policies:{mode:typeof a$3?.policy_mode=="string"?a$3.policy_mode:typeof a$3?.policyMode=="string"?a$3.policyMode:"warn",source:h??null,exists:!!h},contracts:{workspaceContractPath:j,exists:v,status:v?"known":"missing"},evidence:{doctor:await k(e,".rapidkit/reports/doctor-last-run.json",n),analyze:await k(e,".rapidkit/reports/analyze-last-run.json",n),readiness:await k(e,".rapidkit/reports/release-readiness-last-run.json",n),pipeline:await k(e,".rapidkit/reports/pipeline-last-run.json",n)},summary:{projectCount:d.length,runtimes:w,frameworks:I,firstClassProjects:d.filter(l=>l.supportTier==="first-class").length,observedProjects:d.filter(l=>l.supportTier==="observed").length}},T=$(P);return {...P,validation:T}}async function ye(t,e){let r=p.join(e,K);return await f.ensureDir(p.dirname(r)),await f.writeJSON(r,t,{spaces:2}),r}export{V as a,K as b,ge as c,ke as d,ye as e};
|