workspai 0.52.1 → 0.52.3
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/contracts/doctor-project-evidence.v1.json +57 -0
- package/contracts/doctor-workspace-evidence.v1.json +57 -0
- package/contracts/extension-cli-compatibility.v1.json +1 -1
- package/contracts/pipeline-last-run.v1.json +6 -1
- package/dist/artifact-remediation-plan-IDCJGULX.js +3 -0
- package/dist/autopilot-release-XRNPBYC6.js +1 -0
- package/dist/{chunk-JXSRYQAR.js → chunk-23JDMHSD.js} +55 -55
- package/dist/{chunk-U63L5CCD.js → chunk-2ZRMYFJG.js} +1 -1
- package/dist/chunk-3PTIIBRY.js +4 -0
- package/dist/chunk-NHVHRBBV.js +4 -0
- package/dist/{chunk-HPS5V7PI.js → chunk-OXNV7OJM.js} +1 -1
- package/dist/{doctor-D6MRX264.js → doctor-MYRJ5BFF.js} +1 -1
- package/dist/index.js +7 -7
- package/dist/pipeline-P6DFMDL4.js +5 -0
- package/dist/{verified-goal-75G64OUV.js → verified-goal-PSQF2TF2.js} +1 -1
- package/dist/{workspace-intelligence-runner-ZHAPAMT3.js → workspace-intelligence-runner-5VAAMKMK.js} +1 -1
- package/dist/workspace-run-HRKCACGR.js +1 -0
- package/docs/doctor-command.md +12 -1
- package/package.json +1 -1
- package/dist/artifact-remediation-plan-2UKY4TKO.js +0 -3
- package/dist/autopilot-release-QRJ6EN6W.js +0 -1
- package/dist/chunk-KHEJO3JU.js +0 -4
- package/dist/chunk-WHHK2DF5.js +0 -4
- package/dist/pipeline-OQPYAI3G.js +0 -5
- package/dist/workspace-run-5E5HWOOY.js +0 -1
|
@@ -159,10 +159,67 @@
|
|
|
159
159
|
},
|
|
160
160
|
"additionalProperties": false
|
|
161
161
|
}
|
|
162
|
+
},
|
|
163
|
+
"resolutionCandidates": {
|
|
164
|
+
"type": "array",
|
|
165
|
+
"items": { "$ref": "#/$defs/dependencyResolutionCandidate" }
|
|
162
166
|
}
|
|
163
167
|
},
|
|
164
168
|
"additionalProperties": false
|
|
165
169
|
},
|
|
170
|
+
"dependencyResolutionCandidate": {
|
|
171
|
+
"type": "object",
|
|
172
|
+
"required": [
|
|
173
|
+
"packageName",
|
|
174
|
+
"relationship",
|
|
175
|
+
"strategies",
|
|
176
|
+
"risk",
|
|
177
|
+
"autoExecutable",
|
|
178
|
+
"requiresCompatibilityVerification",
|
|
179
|
+
"ownerPackages",
|
|
180
|
+
"advisoryIds",
|
|
181
|
+
"reason"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"packageName": { "type": "string", "minLength": 1 },
|
|
185
|
+
"relationship": { "enum": ["direct", "transitive", "unknown"] },
|
|
186
|
+
"strategies": {
|
|
187
|
+
"type": "array",
|
|
188
|
+
"items": {
|
|
189
|
+
"enum": [
|
|
190
|
+
"direct-upgrade",
|
|
191
|
+
"owner-upgrade",
|
|
192
|
+
"constraint-update",
|
|
193
|
+
"transitive-override",
|
|
194
|
+
"replacement",
|
|
195
|
+
"policy-exception",
|
|
196
|
+
"upstream-wait"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"minItems": 1,
|
|
200
|
+
"uniqueItems": true
|
|
201
|
+
},
|
|
202
|
+
"risk": { "enum": ["safe", "guarded", "breaking", "unknown"] },
|
|
203
|
+
"autoExecutable": { "type": "boolean" },
|
|
204
|
+
"requiresCompatibilityVerification": { "type": "boolean" },
|
|
205
|
+
"currentVersion": { "type": "string", "minLength": 1 },
|
|
206
|
+
"currentRange": { "type": "string", "minLength": 1 },
|
|
207
|
+
"vulnerableRange": { "type": "string", "minLength": 1 },
|
|
208
|
+
"safeVersionConstraint": { "type": "string", "minLength": 1 },
|
|
209
|
+
"ownerPackages": {
|
|
210
|
+
"type": "array",
|
|
211
|
+
"items": { "type": "string", "minLength": 1 },
|
|
212
|
+
"uniqueItems": true
|
|
213
|
+
},
|
|
214
|
+
"advisoryIds": {
|
|
215
|
+
"type": "array",
|
|
216
|
+
"items": { "type": "string", "minLength": 1 },
|
|
217
|
+
"uniqueItems": true
|
|
218
|
+
},
|
|
219
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
220
|
+
},
|
|
221
|
+
"additionalProperties": false
|
|
222
|
+
},
|
|
166
223
|
"dependencyAuditSubject": {
|
|
167
224
|
"type": "object",
|
|
168
225
|
"required": ["name", "advisoryIds", "severities"],
|
|
@@ -169,10 +169,67 @@
|
|
|
169
169
|
},
|
|
170
170
|
"additionalProperties": false
|
|
171
171
|
}
|
|
172
|
+
},
|
|
173
|
+
"resolutionCandidates": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"items": { "$ref": "#/$defs/dependencyResolutionCandidate" }
|
|
172
176
|
}
|
|
173
177
|
},
|
|
174
178
|
"additionalProperties": false
|
|
175
179
|
},
|
|
180
|
+
"dependencyResolutionCandidate": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"required": [
|
|
183
|
+
"packageName",
|
|
184
|
+
"relationship",
|
|
185
|
+
"strategies",
|
|
186
|
+
"risk",
|
|
187
|
+
"autoExecutable",
|
|
188
|
+
"requiresCompatibilityVerification",
|
|
189
|
+
"ownerPackages",
|
|
190
|
+
"advisoryIds",
|
|
191
|
+
"reason"
|
|
192
|
+
],
|
|
193
|
+
"properties": {
|
|
194
|
+
"packageName": { "type": "string", "minLength": 1 },
|
|
195
|
+
"relationship": { "enum": ["direct", "transitive", "unknown"] },
|
|
196
|
+
"strategies": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": {
|
|
199
|
+
"enum": [
|
|
200
|
+
"direct-upgrade",
|
|
201
|
+
"owner-upgrade",
|
|
202
|
+
"constraint-update",
|
|
203
|
+
"transitive-override",
|
|
204
|
+
"replacement",
|
|
205
|
+
"policy-exception",
|
|
206
|
+
"upstream-wait"
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"minItems": 1,
|
|
210
|
+
"uniqueItems": true
|
|
211
|
+
},
|
|
212
|
+
"risk": { "enum": ["safe", "guarded", "breaking", "unknown"] },
|
|
213
|
+
"autoExecutable": { "type": "boolean" },
|
|
214
|
+
"requiresCompatibilityVerification": { "type": "boolean" },
|
|
215
|
+
"currentVersion": { "type": "string", "minLength": 1 },
|
|
216
|
+
"currentRange": { "type": "string", "minLength": 1 },
|
|
217
|
+
"vulnerableRange": { "type": "string", "minLength": 1 },
|
|
218
|
+
"safeVersionConstraint": { "type": "string", "minLength": 1 },
|
|
219
|
+
"ownerPackages": {
|
|
220
|
+
"type": "array",
|
|
221
|
+
"items": { "type": "string", "minLength": 1 },
|
|
222
|
+
"uniqueItems": true
|
|
223
|
+
},
|
|
224
|
+
"advisoryIds": {
|
|
225
|
+
"type": "array",
|
|
226
|
+
"items": { "type": "string", "minLength": 1 },
|
|
227
|
+
"uniqueItems": true
|
|
228
|
+
},
|
|
229
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
230
|
+
},
|
|
231
|
+
"additionalProperties": false
|
|
232
|
+
},
|
|
176
233
|
"dependencyAuditSubject": {
|
|
177
234
|
"type": "object",
|
|
178
235
|
"required": ["name", "advisoryIds", "severities"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "rapidkit-extension-cli-compatibility.v1",
|
|
3
3
|
"cli": "workspai",
|
|
4
|
-
"minimumVerifiedCliVersion": "0.52.
|
|
4
|
+
"minimumVerifiedCliVersion": "0.52.3",
|
|
5
5
|
"publishedContractSchemas": {
|
|
6
6
|
"workspaceContract": 1,
|
|
7
7
|
"runtimeCommandSurface": "rapidkit-runtime-command-surface-v1",
|
|
@@ -55,7 +55,12 @@
|
|
|
55
55
|
"durationMs": { "type": "integer", "minimum": 0 },
|
|
56
56
|
"summary": { "type": "string" },
|
|
57
57
|
"exitCode": { "type": "integer" },
|
|
58
|
-
"evidencePath": { "type": "string" }
|
|
58
|
+
"evidencePath": { "type": "string" },
|
|
59
|
+
"policyProfile": { "type": "string" },
|
|
60
|
+
"blockers": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": { "type": "string" }
|
|
63
|
+
}
|
|
59
64
|
},
|
|
60
65
|
"additionalProperties": true
|
|
61
66
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-ZTKIBREF.js';import {a as a$1}from'./chunk-2E6WGUN6.js';import {a,e,b}from'./chunk-MBRU3VWJ.js';import h from'path';import {existsSync}from'fs';import E from'fs-extra';var T=[{artifactKind:"bootstrap-compliance",cardId:"bootstrap",fileNames:["bootstrap-compliance.latest.json"]},{artifactKind:"doctor-workspace",cardId:"doctor",fileNames:["doctor-remediation-plan-last-run.json","doctor-last-run.json"]},{artifactKind:"analyze",cardId:"analyze",fileNames:["analyze-last-run.json"]},{artifactKind:"readiness",cardId:"readiness",fileNames:["release-readiness-last-run.json"]},{artifactKind:"pipeline",cardId:"pipeline",fileNames:["pipeline-last-run.json"]},{artifactKind:"workspace-run",cardId:"workspaceRun",fileNames:["workspace-run-last.json"]},{artifactKind:"workspace-verify",cardId:"workspaceVerify",fileNames:["workspace-verify-last-run.json"]}];function g(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function A(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0):[]}function R(e){return [...new Set(e.map(r=>r.trim()).filter(Boolean))]}function P(e,r,i){return i?r:h.relative(e,r).split(h.sep).join("/")}function B(e){let r=e?.trim()||"npx workspai bootstrap";if(!/(?:^|\s)--ci(?:\s|$)/.test(r)&&/(?:^|\s)--json(?:\s|$)/.test(r))return r.replace(/(?:^|\s)--json(?:\s|$)/,s=>{let o=s.startsWith(" ")?" ":"",a=s.endsWith(" ")?" ":"";return `${o}--ci --json${a}`}).trim();let i=/(?:^|\s)--ci(?:\s|$)/.test(r)?r:`${r} --ci`;return /(?:^|\s)--json(?:\s|$)/.test(i)?i:`${i} --json`}function V(e){return `${JSON.stringify({schemaVersion:"rapidkit.compatibility-matrix.v1",generatedAt:e,source:"workspai workspace remediation-plan",runtimes:{},notes:["Minimal enterprise baseline. Add runtime and toolchain entries as governance matures."]},null,2)}
|
|
2
|
+
`}function z(e){return `${JSON.stringify({schema_version:"1.0",enabled:false,strategy:"on-demand",artifacts:[],created_at:e,note:"Minimal enterprise baseline. Set enabled: true and add artifact entries to activate mirroring."},null,2)}
|
|
3
|
+
`}function _(e){let r=e.payload,i=A(r.blockers),s=A(r.blockingReasons),o=A(r.failures),a=A(r.reasons),c=A(r.policyViolations),n=g(r.summary),d=A(n?.blockers);if(e.artifactKind==="analyze"){let t=(Array.isArray(r.findings)?r.findings:[]).map(p=>g(p)).filter(p=>!!p).map(p=>String(p.message??p.title??p.id??"").trim()).filter(Boolean);return R([...i,...t,...s])}if(e.artifactKind==="workspace-run"){let f=g(r.stages),t=Object.entries(f??{}).flatMap(([p,u])=>{let k=g(u);return (Array.isArray(k?.projects)?k.projects:[]).map(m=>g(m)).filter(m=>!!m).filter(m=>m.status==="failed"||m.ok===false).map(m=>`${p}: ${String(m.project??m.name??"project")} failed`)});return R([...i,...t,...s])}return R([...i,...s,...o,...a,...c,...d])}function j(e){return {id:e.id,artifactKind:e.artifactKind,cardId:e.cardId,title:e.title,order:e.order,phase:e.phase,scope:e.scope??"workspace",...e.projectName?{projectName:e.projectName}:{},...e.projectPath?{projectPath:e.projectPath}:{},...e.sourceStepId?{sourceStepId:e.sourceStepId}:{},...e.dependsOn?{dependsOn:e.dependsOn}:{},...e.strategy?{strategy:structuredClone(e.strategy)}:{},...e.transaction?{transaction:structuredClone(e.transaction)}:{},status:e.status??"ready",mode:e.mode,risk:e.risk,requiresApproval:true,blocker:e.blocker,summary:e.summary,...e.command?{command:e.command}:{},verifyCommand:e.verifyCommand,cwd:e.cwd??"workspace",files:e.files??[],...e.operation?{operation:e.operation}:{},rollback:e.rollback??(e.operation?{available:true,strategy:"idempotent"}:{available:false,strategy:"none"}),notes:e.notes??[]}}function q(e){return (Array.isArray(e.report.payload.steps)?e.report.payload.steps:[]).flatMap((i,s)=>{let o=g(i),a=typeof o?.id=="string"?o.id.trim():"",c=typeof o?.projectName=="string"?o.projectName.trim():"",n=typeof o?.projectPath=="string"?o.projectPath.trim():"",d=typeof o?.originalCommand=="string"?o.originalCommand.trim():"";if(!o||!a||!c||!n)return [];let f=g(o.studioStatus),t=f?.state==="ready"||f?.state==="review-required"||f?.state==="blocked"||f?.state==="guidance-only"?f.state:"guidance-only",p=o.risk==="safe"||o.risk==="guarded"||o.risk==="invasive"?o.risk:"guarded",u=g(o.preview),k=P(e.workspacePath,n,e.includeAbsolutePaths),b=D({capability:{...o,command:d},absoluteProjectPath:n,includeAbsolutePaths:e.includeAbsolutePaths}),m=o.executableInCurrentEnvironment===true&&!!b,x=N({strategy:o.strategy,includeAbsolutePaths:e.includeAbsolutePaths}),w=g(o.transaction),l=w?.schemaVersion==="workspai.doctor-dependency-repair-transaction.v1"?structuredClone(w):void 0;return l&&(l.projectPath=k),[j({id:`doctor.${a}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof u?.title=="string"&&u.title.trim()?u.title.trim():`Repair ${c}`,order:e.startOrder+s,phase:typeof o.phase=="string"?o.phase:"doctor-remediation",blocker:typeof u?.summary=="string"&&u.summary.trim()?u.summary.trim():`Doctor remediation is pending for ${c}.`,summary:typeof u?.summary=="string"&&u.summary.trim()?u.summary.trim():`Execute the CLI-authored Doctor step for ${c}.`,mode:m?"run-command":"manual-guidance",risk:p,status:t,...m&&b?{command:b}:{},verifyCommand:typeof o.verifyCommand=="string"&&o.verifyCommand.trim()?o.verifyCommand.trim():"npx workspai doctor project --json",files:A(o.files).map(y=>{let v=h.isAbsolute(y)?y:h.resolve(n,y);return P(e.workspacePath,v,e.includeAbsolutePaths)}),notes:[`Source Doctor step: ${a}`,...typeof f?.reason=="string"?[f.reason]:[]],scope:"project",projectName:c,projectPath:k,sourceStepId:a,dependsOn:A(o.dependsOn).map(y=>`doctor.${y}`),strategy:x,transaction:l,cwd:"project",...g(o.rollback)?.available===true?{rollback:{available:true,strategy:"manual"}}:{}})]})}function D(e){let r=typeof e.capability.command=="string"?e.capability.command.trim():"";if(e.includeAbsolutePaths&&r)return r;let i=F({operation:e.capability.operation,absoluteProjectPath:e.absoluteProjectPath});if(i)return a$2(i);let s=g(e.capability.invocation),o=typeof s?.executable=="string"?s.executable.trim():"",a=A(s?.args);if(o)return [o,...a].map(n=>/^[a-zA-Z0-9_./:@=+-]+$/.test(n)?n:JSON.stringify(n)).join(" ");if(!r)return;let c=e.absoluteProjectPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return r.replace(new RegExp(`^cd\\s+["']?${c}["']?\\s*&&\\s*`,"i"),"").replaceAll(e.absoluteProjectPath,".")}function F(e){let r=g(e.operation);if(!r||typeof r.type!="string")return;let i=structuredClone(r);for(let s of ["path","sourcePath"]){let o=i[s];if(typeof o!="string")continue;let a=h.isAbsolute(o)?h.relative(e.absoluteProjectPath,o):o;if(!a||a===".."||a.startsWith(`..${h.sep}`)||h.isAbsolute(a))return;i[s]=a.split(h.sep).join("/");}return i}function N(e){if(!Array.isArray(e.strategy))return;let r=structuredClone(e.strategy);if(!e.includeAbsolutePaths)for(let i of r)i.invocation&&(i.invocation.cwd=".");return r}function L(e){let r=Array.isArray(e.report.payload.projects)?e.report.payload.projects:e.report.payload.project?[e.report.payload.project]:[],i=new Set,s=[];for(let o of r){let a=g(o);if(!a)continue;let c=typeof a.name=="string"?a.name.trim():"",n=typeof a.path=="string"?a.path.trim():"";if(!c||!n)continue;let d=Array.isArray(a.repairCapabilities)?a.repairCapabilities:Array.isArray(a.probes)?a.probes.map(f=>g(f)?.repairCapability).filter(f=>f!==void 0):[];for(let f of d){let t=g(f),p=typeof t?.id=="string"?t.id.trim():"";if(!t||!p)continue;let u=`${c}:${p}`;if(i.has(u))continue;i.add(u);let k=t.risk==="safe"||t.risk==="guarded"||t.risk==="invasive"?t.risk:"guarded",b=D({capability:t,absoluteProjectPath:n,includeAbsolutePaths:e.includeAbsolutePaths}),m=t.status==="available"&&!!b,x=g(t.transaction),w=x?.schemaVersion==="workspai.doctor-dependency-repair-transaction.v1"?structuredClone(x):void 0;w&&(w.projectPath=P(e.workspacePath,n,e.includeAbsolutePaths));let l=N({strategy:t.strategy,includeAbsolutePaths:e.includeAbsolutePaths}),y=A(t.files).map(C=>P(e.workspacePath,C,e.includeAbsolutePaths)),v=b?s.find(C=>C.projectName===c&&C.command===b&&C.cwd==="project"):void 0;if(v){v.files=R([...v.files,...y]),v.notes=R([...v.notes,`Also satisfies Doctor capability: ${p}`]);continue}s.push(j({id:`doctor.${c}.${p}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof t.title=="string"&&t.title.trim()?t.title.trim():`Repair ${c}`,order:e.startOrder+s.length,phase:w?"dependency-remediation":"doctor-remediation",blocker:typeof t.reason=="string"&&t.reason.trim()?t.reason.trim():`Doctor remediation is pending for ${c}.`,summary:typeof t.reason=="string"&&t.reason.trim()?t.reason.trim():`Execute the Doctor-authored repair capability for ${c}.`,mode:m?t.canEditFiles===true?"edit-file":"run-command":"manual-guidance",risk:k,status:m?"ready":t.status==="manual"?"guidance-only":"blocked",...b?{command:b}:{},verifyCommand:typeof t.verifyCommand=="string"&&t.verifyCommand.trim()?t.verifyCommand.trim():"npx workspai doctor project --json",files:y,notes:[`Source Doctor capability: ${p}`,...A(t.limitations)],scope:"project",projectName:c,projectPath:P(e.workspacePath,n,e.includeAbsolutePaths),sourceStepId:p,strategy:l,transaction:w,cwd:"project",...t.operation?{rollback:{available:true,strategy:"manual"}}:{}}));}}return s}function W(e){let r=[],i=B("npx workspai bootstrap --json");for(let s of e.blockers)s.includes("profile.enterprise.ci")&&r.push(j({id:"bootstrap.enterprise-ci",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Run bootstrap in deterministic CI mode",order:10,phase:"bootstrap-preflight",blocker:s,summary:"Enterprise bootstrap compliance requires --ci for deterministic execution.",mode:"run-command",risk:"safe",command:i,verifyCommand:i})),s.includes("profile.enterprise.compatibility-matrix")&&r.push(j({id:"bootstrap.compatibility-matrix",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise compatibility matrix baseline",order:20,phase:"bootstrap-config",blocker:s,summary:"Create the missing compatibility matrix baseline without overwriting user data.",mode:"edit-file",risk:"safe",verifyCommand:i,files:[".workspai/compatibility-matrix.json"],operation:{type:"file-create",path:".workspai/compatibility-matrix.json",content:V(e.generatedAt),overwrite:false}})),s.includes("profile.enterprise.mirror-config")&&r.push(j({id:"bootstrap.mirror-config",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise mirror config baseline",order:30,phase:"bootstrap-config",blocker:s,summary:"Create the missing mirror configuration baseline without enabling mirroring.",mode:"edit-file",risk:"safe",verifyCommand:i,files:[".workspai/mirror-config.json"],operation:{type:"file-create",path:".workspai/mirror-config.json",content:z(e.generatedAt),overwrite:false}}));return r}function J(e){let r=Array.isArray(e.report.payload.steps)?e.report.payload.steps:[],i=[],s=new Map;for(let o of r){let a=g(o),c=g(a?.command),n=typeof a?.id=="string"?a.id.trim():"",d=typeof a?.project=="string"?a.project.trim():"",f=typeof a?.status=="string"?a.status:"",t=typeof c?.display=="string"?c.display.trim():"",p=a?.required===true;if(!n.startsWith("project.")||!d||!p||f!=="fail"&&f!=="missing"||!/^npx\s+workspai\s+workspace\s+run\s+/i.test(t))continue;let u=n.split(".").at(-1)??"stage",k=`workspaceVerify.${n}`,b=s.get(d),m=/(?:^|\s)--no-gates(?:\s|$)/.test(t)?t:`${t} --no-gates`;i.push(j({id:k,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof a.label=="string"&&a.label.trim()?a.label.trim():`Run ${u} for ${d}`,order:e.startOrder+i.length,phase:"fleet-run",blocker:typeof a.message=="string"&&a.message.trim()?a.message.trim():`${u} evidence is not current for ${d}.`,summary:`Produce fresh ${u} evidence for ${d} without re-entering the blocked aggregate gates.`,mode:"run-command",risk:u==="start"?"guarded":"safe",status:"ready",command:m,verifyCommand:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",scope:"project",projectName:d,projectPath:d,sourceStepId:n,...b?{dependsOn:[b]}:{},cwd:"workspace",notes:[`Source Workspace Verify step: ${n}`,"Aggregate verification must run only after this project evidence producer completes."]})),s.set(d,k);}return i}function H(e){let r=R(e.blockers.flatMap(s=>{let o=s.match(/(?:project runtimes?|workspace)\s*\(([^)]+)\)\s+(?:is|are) not pinned/i);return o?.[1]?o[1].split(",").map(a=>a.trim().toLowerCase()).filter(a=>/^(python|node|go|java|dotnet|rust|php)$/.test(a)):[]})),i=[];for(let s of r){let o=`readiness.toolchain.${s}.setup`;i.push(j({id:o,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:`Pin ${s} in the workspace toolchain`,order:e.startOrder+i.length,phase:"toolchain-reconciliation",blocker:e.blockers.find(a=>a.toLowerCase().includes(`(${s})`)),summary:`Detect and persist the current ${s} runtime in the canonical workspace toolchain lock.`,mode:"run-command",risk:"safe",command:`npx workspai setup ${s} --json`,verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",notes:["Run from the workspace root so the canonical toolchain.lock is updated."]})),i.push(j({id:`readiness.toolchain.${s}.bootstrap`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:`Reconcile the ${s} workspace foundation`,order:e.startOrder+i.length,phase:"toolchain-reconciliation",blocker:`The ${s} runtime pin must be reconciled with the workspace foundation.`,summary:"Refresh the workspace foundation after the runtime pin is written.",mode:"run-command",risk:"guarded",command:"npx workspai bootstrap --ci --json",verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",dependsOn:[o]}));}return i}function U(e){if(e.report.artifactKind==="readiness"&&/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(e.blocker))return j({id:`${e.report.cardId}.doctor-owner.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:"Resolve dependency vulnerability through Doctor",order:e.order,phase:"dependency-remediation",blocker:e.blocker,summary:"Release Readiness is the aggregate gate; use the project-scoped Doctor remediation capability that owns this dependency failure.",mode:"verify-before-fix",risk:"guarded",status:"review-required",command:"npx workspai doctor workspace --plan --json",verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",notes:["Read doctor-remediation-plan-last-run.json and execute the matching surface-security-hygiene capability before rerunning Readiness.","Do not treat a Readiness refresh as remediation for a source dependency vulnerability."]});let i={analyze:{title:"Refresh analyze evidence",phase:"analysis",command:"npx workspai analyze --strict --json",verify:"npx workspai analyze --strict --json"},readiness:{title:"Refresh release readiness",phase:"release-readiness",command:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",verify:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json"},pipeline:{title:"Rerun governance pipeline",phase:"governance-pipeline",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"},"workspace-run":{title:"Rerun failed workspace stage",phase:"fleet-run",command:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json",verify:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json"},"workspace-verify":{title:"Refresh workspace verify gate",phase:"verification",command:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",verify:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json"},"doctor-workspace":{title:"Use Doctor remediation plan",phase:"doctor-remediation",command:"npx workspai doctor workspace --plan --json",verify:"npx workspai doctor workspace --json"}}[e.report.artifactKind]??{title:"Refresh artifact evidence",phase:"evidence-refresh",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"};return j({id:`${e.report.cardId}.refresh.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:i.title,order:e.order,phase:i.phase,blocker:e.blocker,summary:"No deterministic file operation is available for this artifact yet; refresh the evidence and continue with the card-specific plan.",mode:e.report.artifactKind==="doctor-workspace"?"verify-before-fix":"run-command",risk:"guarded",status:e.report.artifactKind==="doctor-workspace"?"review-required":"ready",command:i.command,verifyCommand:i.verify,notes:e.report.artifactKind==="doctor-workspace"?["Read doctor-remediation-plan-last-run.json for ordered file-level steps."]:[]})}async function Z(e){let r=[a(e,".workspai/reports"),b(e,".workspai/reports")],i=[],s=new Set;for(let o of T)for(let a of o.fileNames){let c=(await Promise.all(r.map(n=>h.join(n,a)))).find(n=>existsSync(n));if(!(!c||s.has(`${o.artifactKind}:${a}`))){s.add(`${o.artifactKind}:${a}`);try{let n=await E.readJSON(c),d=g(n);if(!d)continue;i.push({artifactKind:o.artifactKind,cardId:o.cardId,fileName:a,absolutePath:c,payload:d});break}catch{i.push({artifactKind:o.artifactKind,cardId:o.cardId,fileName:a,absolutePath:c,payload:{blockers:[`${o.artifactKind}: report exists but could not be parsed.`]}});break}}}return i}async function ae(e){let r=h.resolve(e.workspacePath),i=e.includeAbsolutePaths===true,s=e.ciMode===true,o=new Date().toISOString(),a$2=a(r,".workspai/reports"),c=await Z(r),n=[],d=1;for(let t of c){if(t.artifactKind==="doctor-workspace"){let l=Array.isArray(t.payload.steps)?q({report:t,workspacePath:r,includeAbsolutePaths:i,startOrder:d}):L({report:t,workspacePath:r,includeAbsolutePaths:i,startOrder:d});n.push(...l),d+=l.length;continue}let p=_(t);if(p.length===0)continue;if(t.artifactKind==="bootstrap-compliance"){n.push(...W({blockers:p,generatedAt:o})),d=n.length+1;continue}if(t.artifactKind==="workspace-verify"){let l=J({report:t,startOrder:d,ciMode:s});if(l.length>0){n.push(...l),d+=l.length;continue}}if(t.artifactKind==="readiness"){let l=H({report:t,blockers:p,startOrder:d,ciMode:s});if(l.length>0){n.push(...l),d+=l.length;continue}}let u=n.some(l=>l.transaction?.kind==="dependency-security"),k=t.artifactKind==="readiness"&&p.some(l=>/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(l));if(u&&k)continue;let b=p[0],m=U({report:t,blocker:b,order:d,ciMode:s}),w={readiness:new Set(["bootstrap","doctor"]),pipeline:new Set(["bootstrap","doctor","analyze","readiness"]),workspaceVerify:new Set(["bootstrap","doctor","readiness","workspaceRun"])}[t.cardId];if(t.cardId==="pipeline"){let l=["doctor","analyze","readiness"].find(y=>b.toLowerCase().includes(y));l&&(w=new Set([l]));}if(w){let l=n.filter(y=>w.has(y.cardId)&&y.risk!=="invasive"&&y.status!=="blocked"&&y.status!=="guidance-only").map(y=>y.id);l.length>0&&(m.dependsOn=R([...m.dependsOn??[],...l]),m.notes.push("This aggregate gate must run after its contract-owned upstream remediation actions."));}p.length>1&&m.notes.push(...p.slice(1,8).map(l=>`Related blocker: ${l}`)),n.push(m),d+=1;}let f={safe:n.filter(t=>t.risk==="safe").length,guarded:n.filter(t=>t.risk==="guarded").length,invasive:n.filter(t=>t.risk==="invasive").length};return {schemaVersion:a$1,generatedAt:o,workspace:{name:h.basename(r),...i?{path:r}:{}},source:{command:"workspace remediation-plan",reportsDir:P(r,a$2,i),includeAbsolutePaths:i,ciMode:s},summary:{artifactsScanned:c.length,cardsCovered:R(n.map(t=>t.cardId)).length,totalActions:n.length,executableActions:n.filter(t=>t.status==="ready").length,risk:f},actions:n}}async function ie(e$1,r){return e(r,".workspai/reports/artifact-remediation-plan-last-run.json",e$1)}export{ae as buildArtifactRemediationPlan,ie as writeArtifactRemediationPlan};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-OXNV7OJM.js';
|