rapidkit 0.40.1 → 0.41.1
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 +48 -7
- package/contracts/agent-customization-pack.v1.json +52 -2
- package/contracts/extension-cli-compatibility.v1.json +14 -2
- package/contracts/runtime-command-surface.v1.json +7 -1
- package/contracts/workspace-intelligence/agent-action-outcome.v1.json +38 -0
- package/contracts/workspace-intelligence/blocker-resolution.v1.json +65 -0
- package/contracts/workspace-intelligence/doctor-fix-result.v1.json +34 -0
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +91 -0
- package/contracts/workspace-intelligence/workspace-contract-verify.v1.json +51 -0
- package/contracts/workspace-intelligence/workspace-dependency-graph.v1.json +61 -1
- package/contracts/workspace-intelligence/workspace-explain.v1.json +31 -0
- package/contracts/workspace-intelligence/workspace-intelligence-history.v1.json +36 -0
- package/contracts/workspace-intelligence/workspace-operational-skill.v1.json +37 -0
- package/contracts/workspace-intelligence/workspace-skills-index.v1.json +27 -0
- package/dist/analyze-QYHMGLSG.js +1 -0
- package/dist/autopilot-release-AHMQEUFH.js +1 -0
- package/dist/chunk-33LR2QEM.js +2 -0
- package/dist/chunk-3PTJID76.js +2 -0
- package/dist/chunk-46AGNYI7.js +50 -0
- package/dist/chunk-64RTZBHU.js +2 -0
- package/dist/chunk-AQ4XZZC6.js +1 -0
- package/dist/{chunk-RXWM5DSC.js → chunk-BFEBZABL.js} +3 -3
- package/dist/{chunk-3YLMCP3V.js → chunk-CDCYRBAY.js} +1 -1
- package/dist/chunk-CDPR2YKL.js +13 -0
- package/dist/chunk-CKXJR3YT.js +7 -0
- package/dist/chunk-E5ZVQL3C.js +13 -0
- package/dist/chunk-ELU3G6DQ.js +9 -0
- package/dist/chunk-EN6YCX36.js +1 -0
- package/dist/chunk-FMBSON6H.js +33 -0
- package/dist/chunk-GBJBQ43T.js +1 -0
- package/dist/chunk-ICGWHIMK.js +1 -0
- package/dist/{chunk-4FJQWL7P.js → chunk-ITJ6RKUW.js} +3 -3
- package/dist/{workspace-graph-ICB7OVAZ.js → chunk-JEI6BTZI.js} +1 -1
- package/dist/{chunk-G76C74EV.js → chunk-JU3VNLTY.js} +1 -1
- package/dist/chunk-JW2FSKT3.js +2 -0
- package/dist/chunk-KIUSCFHF.js +1 -0
- package/dist/chunk-LKX3L7TE.js +2 -0
- package/dist/chunk-MIWDCR6I.js +2 -0
- package/dist/{chunk-6G2KSHP6.js → chunk-OLDPVVSV.js} +1 -1
- package/dist/{chunk-4Q2ZZKGB.js → chunk-PCXSTKZ5.js} +1 -1
- package/dist/{chunk-6KD5F6LX.js → chunk-Q2KZIBV4.js} +1 -1
- package/dist/{chunk-ERCD6NFF.js → chunk-RSYUNEH7.js} +13 -13
- package/dist/chunk-TJN7G2MA.js +1 -0
- package/dist/chunk-UQR6G7KH.js +32 -0
- package/dist/chunk-VMJA36WD.js +1 -0
- package/dist/chunk-WRMCPKGA.js +1 -0
- package/dist/{create-XVDDQA42.js → create-RNP5ACQL.js} +1 -1
- package/dist/demo-kit-N5U3NGAE.js +149 -0
- package/dist/{doctor-UOLOGJ2Z.js → doctor-XM6QDTDC.js} +1 -1
- package/dist/{dotnet-webapi-clean-RTBRPDPL.js → dotnet-webapi-clean-K33C77EI.js} +1 -1
- package/dist/{gofiber-standard-UGIRKPKL.js → gofiber-standard-BQ4HCXL2.js} +1 -1
- package/dist/{gogin-standard-HJ7SPFNT.js → gogin-standard-PUBCYW3A.js} +1 -1
- package/dist/index.d.ts +45 -7
- package/dist/index.js +145 -127
- package/dist/{pipeline-XK62WL4D.js → pipeline-DH6Z47O4.js} +1 -1
- package/dist/platform-capabilities-TSLK667K.js +1 -0
- package/dist/{pythonRapidkitExec-MNWRC4F2.js → pythonRapidkitExec-SGKW76XM.js} +1 -1
- package/dist/{springboot-standard-IWJSVDLZ.js → springboot-standard-XFVQI37R.js} +1 -1
- package/dist/{workspace-L4ITCKMM.js → workspace-E554C5SM.js} +1 -1
- package/dist/workspace-agent-sync-2HRPM5ZD.js +1 -0
- package/dist/{workspace-context-NMMQMHNU.js → workspace-context-VJTXW3K4.js} +1 -1
- package/dist/workspace-contract-OO4GMENV.js +1 -0
- package/dist/workspace-explain-3WSJLIJ6.js +1 -0
- package/dist/workspace-explain-contract-24RQ7KIW.js +1 -0
- package/dist/workspace-feedback-65NR3EZH.js +1 -0
- package/dist/{workspace-foundation-HNIRAIBF.js → workspace-foundation-LISDH53T.js} +1 -1
- package/dist/workspace-graph-2A5THUCI.js +1 -0
- package/dist/workspace-history-VPDADQKG.js +1 -0
- package/dist/{workspace-intelligence-64IWAYHS.js → workspace-intelligence-E3KXEZCM.js} +1 -1
- package/dist/workspace-mcp-serve-RFYDCA2L.js +3 -0
- package/dist/workspace-model-YL7W3573.js +1 -0
- package/dist/workspace-registry-summary-X5WRUU3T.js +1 -0
- package/dist/workspace-run-GCIQD73R.js +1 -0
- package/dist/workspace-verify-NRYH7RNB.js +1 -0
- package/dist/workspace-watch-H2AETGFI.js +1 -0
- package/docs/DEVELOPMENT.md +1 -1
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +1 -1
- package/docs/README.md +1 -1
- package/docs/commands-reference.md +10 -2
- package/docs/contracts/ARTIFACT_CATALOG.md +3 -1
- package/docs/contracts/NAMING_AND_COEXISTENCE.md +58 -0
- package/docs/workspace-run.md +25 -1
- package/package.json +7 -3
- package/scripts/enterprise-package-smoke.mjs +427 -0
- package/scripts/prepack-enterprise.mjs +40 -0
- package/templates/generator.js +175 -0
- package/templates/kits/fastapi-ddd/README.md.j2 +122 -0
- package/templates/kits/fastapi-ddd/common/env.example.j2 +10 -0
- package/templates/kits/fastapi-ddd/env.example.j2 +1 -0
- package/templates/kits/fastapi-ddd/pyproject.toml.j2 +64 -0
- package/templates/kits/fastapi-ddd/src/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/__init__.py.j2 +11 -0
- package/templates/kits/fastapi-ddd/src/app/application/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/application/interfaces.py.j2 +43 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/health.py.j2 +14 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/notes.py.j2 +24 -0
- package/templates/kits/fastapi-ddd/src/app/config/__init__.py.j2 +16 -0
- package/templates/kits/fastapi-ddd/src/app/domain/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/health.py.j2 +16 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/note.py.j2 +27 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/health.py.j2 +17 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/notes.py.j2 +28 -0
- package/templates/kits/fastapi-ddd/src/app/main.py.j2 +61 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/dependencies/__init__.py.j2 +19 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/router.py.j2 +10 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/health.py.j2 +27 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/notes.py.j2 +50 -0
- package/templates/kits/fastapi-ddd/src/app/shared/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/shared/result.py.j2 +28 -0
- package/templates/kits/fastapi-ddd/src/cli.py.j2 +167 -0
- package/templates/kits/fastapi-ddd/src/main.py.j2 +35 -0
- package/templates/kits/fastapi-ddd/src/modules/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/routing/__init__.py.j2 +13 -0
- package/templates/kits/fastapi-ddd/src/routing/health.py.j2 +7 -0
- package/templates/kits/fastapi-ddd/src/routing/notes.py.j2 +7 -0
- package/templates/kits/fastapi-ddd/tests/__init__.py.j2 +1 -0
- package/templates/kits/fastapi-ddd/tests/test_app_factory.py.j2 +22 -0
- package/templates/kits/fastapi-ddd/tests/test_health.py.j2 +17 -0
- package/templates/kits/fastapi-ddd/tests/test_notes.py.j2 +27 -0
- package/templates/kits/fastapi-standard/README.md.j2 +145 -0
- package/templates/kits/fastapi-standard/common/env.example.j2 +10 -0
- package/templates/kits/fastapi-standard/env.example.j2 +1 -0
- package/templates/kits/fastapi-standard/pyproject.toml.j2 +64 -0
- package/templates/kits/fastapi-standard/src/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-standard/src/cli.py.j2 +168 -0
- package/templates/kits/fastapi-standard/src/main.py.j2 +66 -0
- package/templates/kits/fastapi-standard/src/modules/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-standard/src/routing/__init__.py.j2 +16 -0
- package/templates/kits/fastapi-standard/src/routing/examples.py.j2 +71 -0
- package/templates/kits/fastapi-standard/src/routing/health.py.j2 +22 -0
- package/templates/kits/fastapi-standard/tests/__init__.py.j2 +1 -0
- package/templates/kits/fastapi-standard/tests/test_examples.py.j2 +29 -0
- package/templates/kits/fastapi-standard/tests/test_health.py.j2 +17 -0
- package/templates/kits/nestjs-standard/Dockerfile.j2 +41 -0
- package/templates/kits/nestjs-standard/README.md.j2 +139 -0
- package/templates/kits/nestjs-standard/docker-compose.yml.j2 +94 -0
- package/templates/kits/nestjs-standard/docs/README.md.j2 +15 -0
- package/templates/kits/nestjs-standard/env.example.j2 +18 -0
- package/templates/kits/nestjs-standard/eslint.config.cjs.j2 +9 -0
- package/templates/kits/nestjs-standard/jest.config.ts.j2 +22 -0
- package/templates/kits/nestjs-standard/nest-cli.json.j2 +10 -0
- package/templates/kits/nestjs-standard/package.json.j2 +101 -0
- package/templates/kits/nestjs-standard/src/app.controller.ts.j2 +14 -0
- package/templates/kits/nestjs-standard/src/app.module.ts.j2 +26 -0
- package/templates/kits/nestjs-standard/src/app.service.ts.j2 +16 -0
- package/templates/kits/nestjs-standard/src/auth/auth.controller.ts.j2 +20 -0
- package/templates/kits/nestjs-standard/src/auth/auth.module.ts.j2 +13 -0
- package/templates/kits/nestjs-standard/src/auth/auth.service.ts.j2 +6 -0
- package/templates/kits/nestjs-standard/src/auth/entities/token.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/auth/entities/user.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/auth/entities/webauthn.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/config/configuration.ts.j2 +85 -0
- package/templates/kits/nestjs-standard/src/config/index.ts.j2 +2 -0
- package/templates/kits/nestjs-standard/src/config/validation.ts.j2 +21 -0
- package/templates/kits/nestjs-standard/src/examples/dto/create-note.dto.ts.j2 +11 -0
- package/templates/kits/nestjs-standard/src/examples/examples.controller.ts.j2 +24 -0
- package/templates/kits/nestjs-standard/src/examples/examples.module.ts.j2 +10 -0
- package/templates/kits/nestjs-standard/src/examples/examples.service.ts.j2 +33 -0
- package/templates/kits/nestjs-standard/src/main.ts.j2 +53 -0
- package/templates/kits/nestjs-standard/src/modules/index.ts.j2 +25 -0
- package/templates/kits/nestjs-standard/test/app.controller.spec.ts.j2 +24 -0
- package/templates/kits/nestjs-standard/test/app.e2e-spec.ts.j2 +60 -0
- package/templates/kits/nestjs-standard/test/examples.controller.spec.ts.j2 +28 -0
- package/templates/kits/nestjs-standard/test/jest-e2e.json.j2 +15 -0
- package/templates/kits/nestjs-standard/tsconfig.build.json.j2 +12 -0
- package/templates/kits/nestjs-standard/tsconfig.json.j2 +26 -0
- package/dist/analyze-RHQM4AB2.js +0 -1
- package/dist/autopilot-release-OJTLXPMX.js +0 -1
- package/dist/chunk-5VBRMLRU.js +0 -7
- package/dist/chunk-7VI4U7Q5.js +0 -2
- package/dist/chunk-FV5A3N3I.js +0 -2
- package/dist/chunk-GDGATWR5.js +0 -2
- package/dist/chunk-GOM3RFB3.js +0 -2
- package/dist/chunk-GX7UU7LL.js +0 -33
- package/dist/chunk-KYH364KQ.js +0 -1
- package/dist/chunk-OWNGSAO3.js +0 -2
- package/dist/chunk-QPEBI6AB.js +0 -2
- package/dist/chunk-TYZPPUBH.js +0 -1
- package/dist/chunk-VQMZC5TC.js +0 -9
- package/dist/chunk-WHCON2VN.js +0 -50
- package/dist/chunk-X7PWDIQW.js +0 -1
- package/dist/chunk-Z5LKRG57.js +0 -1
- package/dist/chunk-ZWKLRZE5.js +0 -13
- package/dist/demo-kit-RWGOEDW4.js +0 -141
- package/dist/workspace-agent-sync-G7JU77IK.js +0 -25
- package/dist/workspace-contract-D5O4OZD5.js +0 -1
- package/dist/workspace-history-LHUTLE3S.js +0 -1
- package/dist/workspace-model-SDHH5RBC.js +0 -1
- package/dist/workspace-registry-summary-MIPHVB56.js +0 -1
- package/dist/workspace-run-SPP32MPV.js +0 -1
- package/dist/workspace-verify-6Q6MGRG6.js +0 -1
- package/dist/workspace-watch-JDXVGW4H.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
@@ -1 +0,0 @@
|
|
|
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};
|