projscan 4.3.1 → 4.4.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/CONTRIBUTING.md +5 -1
- package/PRIVACY.md +1 -0
- package/README.md +253 -229
- package/THIRD-PARTY-NOTICES.md +31 -31
- package/dist/analyzers/architectureCheck.js.map +1 -1
- package/dist/analyzers/crossPackageImportCheck.js +3 -2
- package/dist/analyzers/crossPackageImportCheck.js.map +1 -1
- package/dist/analyzers/deadCodeCheck.js +10 -2
- package/dist/analyzers/deadCodeCheck.js.map +1 -1
- package/dist/analyzers/dependencyRiskCheck.js +1 -5
- package/dist/analyzers/dependencyRiskCheck.js.map +1 -1
- package/dist/analyzers/eslintCheck.js +3 -1
- package/dist/analyzers/eslintCheck.js.map +1 -1
- package/dist/analyzers/prettierCheck.js +16 -3
- package/dist/analyzers/prettierCheck.js.map +1 -1
- package/dist/analyzers/pythonDependencyRiskCheck.js +4 -17
- package/dist/analyzers/pythonDependencyRiskCheck.js.map +1 -1
- package/dist/analyzers/pythonLinterCheck.js +2 -12
- package/dist/analyzers/pythonLinterCheck.js.map +1 -1
- package/dist/analyzers/securityCheck.js +26 -9
- package/dist/analyzers/securityCheck.js.map +1 -1
- package/dist/analyzers/supplyChainCheck.js +6 -2
- package/dist/analyzers/supplyChainCheck.js.map +1 -1
- package/dist/analyzers/testCheck.js +10 -1
- package/dist/analyzers/testCheck.js.map +1 -1
- package/dist/analyzers/unusedDependencyCheck.js +8 -8
- package/dist/analyzers/unusedDependencyCheck.js.map +1 -1
- package/dist/cli/_shared.d.ts +2 -1
- package/dist/cli/_shared.js +14 -2
- package/dist/cli/_shared.js.map +1 -1
- package/dist/cli/commands/agentBrief.js +7 -1
- package/dist/cli/commands/agentBrief.js.map +1 -1
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/applyFix.js +1 -1
- package/dist/cli/commands/applyFix.js.map +1 -1
- package/dist/cli/commands/audit.js +4 -2
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/badge.js.map +1 -1
- package/dist/cli/commands/bugHunt.js +2 -2
- package/dist/cli/commands/bugHunt.js.map +1 -1
- package/dist/cli/commands/ci.js.map +1 -1
- package/dist/cli/commands/claim.js +3 -3
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/collision.js +4 -2
- package/dist/cli/commands/collision.js.map +1 -1
- package/dist/cli/commands/coordinate.js +4 -2
- package/dist/cli/commands/coordinate.js.map +1 -1
- package/dist/cli/commands/coupling.js.map +1 -1
- package/dist/cli/commands/coverage.js.map +1 -1
- package/dist/cli/commands/dataflow.js.map +1 -1
- package/dist/cli/commands/dependencies.js +1 -1
- package/dist/cli/commands/dependencies.js.map +1 -1
- package/dist/cli/commands/diff.js.map +1 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/dogfood.js +30 -5
- package/dist/cli/commands/dogfood.js.map +1 -1
- package/dist/cli/commands/evidencePack.js.map +1 -1
- package/dist/cli/commands/explainIssue.js +1 -1
- package/dist/cli/commands/explainIssue.js.map +1 -1
- package/dist/cli/commands/feedback.js +19 -5
- package/dist/cli/commands/feedback.js.map +1 -1
- package/dist/cli/commands/file.js +1 -1
- package/dist/cli/commands/file.js.map +1 -1
- package/dist/cli/commands/fix.js.map +1 -1
- package/dist/cli/commands/fixSuggest.js +12 -4
- package/dist/cli/commands/fixSuggest.js.map +1 -1
- package/dist/cli/commands/hotspots.js.map +1 -1
- package/dist/cli/commands/impact.js +1 -1
- package/dist/cli/commands/impact.js.map +1 -1
- package/dist/cli/commands/init.js +13 -5
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/installHook.js +2 -2
- package/dist/cli/commands/installHook.js.map +1 -1
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/memory.js +5 -2
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/mergeRisk.js +1 -1
- package/dist/cli/commands/mergeRisk.js.map +1 -1
- package/dist/cli/commands/missionProof.js +13 -12
- package/dist/cli/commands/missionProof.js.map +1 -1
- package/dist/cli/commands/outdated.js +1 -1
- package/dist/cli/commands/outdated.js.map +1 -1
- package/dist/cli/commands/plugin.js +10 -6
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/cli/commands/prDiff.js +1 -1
- package/dist/cli/commands/prDiff.js.map +1 -1
- package/dist/cli/commands/preflight.js +1 -5
- package/dist/cli/commands/preflight.js.map +1 -1
- package/dist/cli/commands/privacyCheck.js +3 -1
- package/dist/cli/commands/privacyCheck.js.map +1 -1
- package/dist/cli/commands/qualityScorecard.js.map +1 -1
- package/dist/cli/commands/recipes.js.map +1 -1
- package/dist/cli/commands/regressionPlan.js.map +1 -1
- package/dist/cli/commands/releaseTrain.js.map +1 -1
- package/dist/cli/commands/review.js +1 -1
- package/dist/cli/commands/review.js.map +1 -1
- package/dist/cli/commands/route.js.map +1 -1
- package/dist/cli/commands/search.js +5 -2
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/semanticGraph.js.map +1 -1
- package/dist/cli/commands/session.js +2 -2
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/start.js +3 -1177
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/startAction.d.ts +36 -0
- package/dist/cli/commands/startAction.js +70 -0
- package/dist/cli/commands/startAction.js.map +1 -0
- package/dist/cli/commands/startConsole.d.ts +7 -0
- package/dist/cli/commands/startConsole.js +309 -0
- package/dist/cli/commands/startConsole.js.map +1 -0
- package/dist/cli/commands/startMissionBundle.d.ts +41 -0
- package/dist/cli/commands/startMissionBundle.js +645 -0
- package/dist/cli/commands/startMissionBundle.js.map +1 -0
- package/dist/cli/commands/startOutput.d.ts +31 -0
- package/dist/cli/commands/startOutput.js +232 -0
- package/dist/cli/commands/startOutput.js.map +1 -0
- package/dist/cli/commands/startShortcuts.d.ts +26 -0
- package/dist/cli/commands/startShortcuts.js +117 -0
- package/dist/cli/commands/startShortcuts.js.map +1 -0
- package/dist/cli/commands/telemetry.js +2 -1
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/trial.js +19 -4
- package/dist/cli/commands/trial.js.map +1 -1
- package/dist/cli/commands/understand.js +3 -1
- package/dist/cli/commands/understand.js.map +1 -1
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/watch.js +1 -1
- package/dist/cli/commands/watch.js.map +1 -1
- package/dist/cli/commands/workplan.js.map +1 -1
- package/dist/cli/commands/workspace.js +1 -1
- package/dist/cli/commands/workspace.js.map +1 -1
- package/dist/cli/commands/workspaces.js +1 -1
- package/dist/cli/commands/workspaces.js.map +1 -1
- package/dist/cli/index.js +2 -117
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/registerCommands.d.ts +4 -0
- package/dist/cli/registerCommands.js +125 -0
- package/dist/cli/registerCommands.js.map +1 -0
- package/dist/core/adoption.d.ts +2 -1
- package/dist/core/adoption.js +40 -13
- package/dist/core/adoption.js.map +1 -1
- package/dist/core/agentBrief.js +19 -6
- package/dist/core/agentBrief.js.map +1 -1
- package/dist/core/applyFix.js.map +1 -1
- package/dist/core/ast.js +30 -19
- package/dist/core/ast.js.map +1 -1
- package/dist/core/auditRunner.js.map +1 -1
- package/dist/core/bugHunt.js +119 -17
- package/dist/core/bugHunt.js.map +1 -1
- package/dist/core/claims.js +5 -2
- package/dist/core/claims.js.map +1 -1
- package/dist/core/codeGraph.js +10 -0
- package/dist/core/codeGraph.js.map +1 -1
- package/dist/core/codeGraphReexports.d.ts +9 -0
- package/dist/core/codeGraphReexports.js +59 -0
- package/dist/core/codeGraphReexports.js.map +1 -0
- package/dist/core/collisionDetector.js +14 -4
- package/dist/core/collisionDetector.js.map +1 -1
- package/dist/core/coordination.js +4 -6
- package/dist/core/coordination.js.map +1 -1
- package/dist/core/couplingAnalyzer.d.ts +2 -1
- package/dist/core/couplingAnalyzer.js.map +1 -1
- package/dist/core/coverageParser.js.map +1 -1
- package/dist/core/dataflow.js +11 -2
- package/dist/core/dataflow.js.map +1 -1
- package/dist/core/dataflowFilters.js +8 -3
- package/dist/core/dataflowFilters.js.map +1 -1
- package/dist/core/dependencyAnalyzer.js +4 -1
- package/dist/core/dependencyAnalyzer.js.map +1 -1
- package/dist/core/dogfood.d.ts +1 -1
- package/dist/core/dogfood.js +39 -5
- package/dist/core/dogfood.js.map +1 -1
- package/dist/core/embeddings.js.map +1 -1
- package/dist/core/evidenceComment.js +34 -12
- package/dist/core/evidenceComment.js.map +1 -1
- package/dist/core/explainIssue.js +1 -2
- package/dist/core/explainIssue.js.map +1 -1
- package/dist/core/feedback.d.ts +1 -1
- package/dist/core/feedback.js +15 -4
- package/dist/core/feedback.js.map +1 -1
- package/dist/core/fileInspector.js +8 -2
- package/dist/core/fileInspector.js.map +1 -1
- package/dist/core/fixFirst.d.ts +3 -1
- package/dist/core/fixFirst.js +17 -4
- package/dist/core/fixFirst.js.map +1 -1
- package/dist/core/fixSuggest.js +20 -12
- package/dist/core/fixSuggest.js.map +1 -1
- package/dist/core/frameworkDetector.js +5 -3
- package/dist/core/frameworkDetector.js.map +1 -1
- package/dist/core/frameworkSources.js +22 -2
- package/dist/core/frameworkSources.js.map +1 -1
- package/dist/core/graphCorpus.d.ts +1 -1
- package/dist/core/graphCorpus.js +9 -1
- package/dist/core/graphCorpus.js.map +1 -1
- package/dist/core/graphQuery.js.map +1 -1
- package/dist/core/hotspotAnalyzer.js +26 -6
- package/dist/core/hotspotAnalyzer.js.map +1 -1
- package/dist/core/impact.d.ts +1 -1
- package/dist/core/impact.js.map +1 -1
- package/dist/core/importGraph.js.map +1 -1
- package/dist/core/indexCache.js.map +1 -1
- package/dist/core/intent.d.ts +1 -1
- package/dist/core/intent.js +143 -46
- package/dist/core/intent.js.map +1 -1
- package/dist/core/intentRouter.js +5467 -445
- package/dist/core/intentRouter.js.map +1 -1
- package/dist/core/issueEngine.js +1 -1
- package/dist/core/issueEngine.js.map +1 -1
- package/dist/core/languageDetector.js +1 -9
- package/dist/core/languageDetector.js.map +1 -1
- package/dist/core/languages/cppAdapter.js +3 -1
- package/dist/core/languages/cppAdapter.js.map +1 -1
- package/dist/core/languages/cppExports.js +6 -1
- package/dist/core/languages/cppExports.js.map +1 -1
- package/dist/core/languages/cppFunctions.js +3 -1
- package/dist/core/languages/cppFunctions.js.map +1 -1
- package/dist/core/languages/csharpAdapter.js.map +1 -1
- package/dist/core/languages/csharpFunctions.js +3 -1
- package/dist/core/languages/csharpFunctions.js.map +1 -1
- package/dist/core/languages/csharpImports.js +2 -1
- package/dist/core/languages/csharpImports.js.map +1 -1
- package/dist/core/languages/goAdapter.js.map +1 -1
- package/dist/core/languages/goExports.js.map +1 -1
- package/dist/core/languages/goFunctions.js +9 -3
- package/dist/core/languages/goFunctions.js.map +1 -1
- package/dist/core/languages/javaAdapter.js +1 -2
- package/dist/core/languages/javaAdapter.js.map +1 -1
- package/dist/core/languages/javaFunctions.js +6 -2
- package/dist/core/languages/javaFunctions.js.map +1 -1
- package/dist/core/languages/javascriptAdapter.js +43 -8
- package/dist/core/languages/javascriptAdapter.js.map +1 -1
- package/dist/core/languages/kotlinAdapter.js +5 -2
- package/dist/core/languages/kotlinAdapter.js.map +1 -1
- package/dist/core/languages/kotlinFunctions.js +5 -6
- package/dist/core/languages/kotlinFunctions.js.map +1 -1
- package/dist/core/languages/kotlinImports.js +3 -1
- package/dist/core/languages/kotlinImports.js.map +1 -1
- package/dist/core/languages/kotlinManifests.js +7 -1
- package/dist/core/languages/kotlinManifests.js.map +1 -1
- package/dist/core/languages/phpAdapter.js +4 -1
- package/dist/core/languages/phpAdapter.js.map +1 -1
- package/dist/core/languages/phpExports.js.map +1 -1
- package/dist/core/languages/phpFunctions.js +18 -6
- package/dist/core/languages/phpFunctions.js.map +1 -1
- package/dist/core/languages/phpManifests.js.map +1 -1
- package/dist/core/languages/pythonAdapter.js.map +1 -1
- package/dist/core/languages/pythonFunctions.js +9 -3
- package/dist/core/languages/pythonFunctions.js.map +1 -1
- package/dist/core/languages/pythonManifests.js.map +1 -1
- package/dist/core/languages/rubyAdapter.js.map +1 -1
- package/dist/core/languages/rubyFunctions.js +6 -2
- package/dist/core/languages/rubyFunctions.js.map +1 -1
- package/dist/core/languages/rustAdapter.js.map +1 -1
- package/dist/core/languages/rustFunctions.js +6 -2
- package/dist/core/languages/rustFunctions.js.map +1 -1
- package/dist/core/languages/swiftAdapter.js +3 -1
- package/dist/core/languages/swiftAdapter.js.map +1 -1
- package/dist/core/languages/swiftCyclomatic.js.map +1 -1
- package/dist/core/languages/swiftFunctions.js +3 -1
- package/dist/core/languages/swiftFunctions.js.map +1 -1
- package/dist/core/languages/swiftImports.js.map +1 -1
- package/dist/core/mergeRisk.js +5 -1
- package/dist/core/mergeRisk.js.map +1 -1
- package/dist/core/missionOutcome.d.ts +1 -1
- package/dist/core/missionOutcome.js +9 -4
- package/dist/core/missionOutcome.js.map +1 -1
- package/dist/core/missionProof.d.ts +1 -1
- package/dist/core/missionProof.js +8 -6
- package/dist/core/missionProof.js.map +1 -1
- package/dist/core/missionProofBaseline.d.ts +1 -1
- package/dist/core/missionProofBaseline.js +8 -2
- package/dist/core/missionProofBaseline.js.map +1 -1
- package/dist/core/missionProofMarkdown.d.ts +1 -1
- package/dist/core/missionProofMarkdown.js +4 -1
- package/dist/core/missionProofMarkdown.js.map +1 -1
- package/dist/core/missionProofSummary.d.ts +1 -1
- package/dist/core/monorepo.d.ts +1 -1
- package/dist/core/monorepo.js +4 -2
- package/dist/core/monorepo.js.map +1 -1
- package/dist/core/onboarding.d.ts +2 -1
- package/dist/core/onboarding.js.map +1 -1
- package/dist/core/outdatedDetector.js +5 -1
- package/dist/core/outdatedDetector.js.map +1 -1
- package/dist/core/ownership.js +3 -1
- package/dist/core/ownership.js.map +1 -1
- package/dist/core/pathClassifiers.js.map +1 -1
- package/dist/core/pluginDx.js +2 -1
- package/dist/core/pluginDx.js.map +1 -1
- package/dist/core/pluginTrust.js +1 -3
- package/dist/core/pluginTrust.js.map +1 -1
- package/dist/core/plugins.js +5 -5
- package/dist/core/plugins.js.map +1 -1
- package/dist/core/prDiff.d.ts +1 -2
- package/dist/core/prDiff.js +5 -1
- package/dist/core/prDiff.js.map +1 -1
- package/dist/core/preflight.js +15 -6
- package/dist/core/preflight.js.map +1 -1
- package/dist/core/privacy.js.map +1 -1
- package/dist/core/qualityScorecard.d.ts +1 -1
- package/dist/core/qualityScorecard.js +43 -11
- package/dist/core/qualityScorecard.js.map +1 -1
- package/dist/core/regressionPlan.js +25 -7
- package/dist/core/regressionPlan.js.map +1 -1
- package/dist/core/releaseEvidence.js +41 -17
- package/dist/core/releaseEvidence.js.map +1 -1
- package/dist/core/releaseTrain.js +66 -38
- package/dist/core/releaseTrain.js.map +1 -1
- package/dist/core/repositoryScanner.js +1 -3
- package/dist/core/repositoryScanner.js.map +1 -1
- package/dist/core/review.d.ts +1 -1
- package/dist/core/review.js +72 -10
- package/dist/core/review.js.map +1 -1
- package/dist/core/reviewDataflow.js +7 -1
- package/dist/core/reviewDataflow.js.map +1 -1
- package/dist/core/reviewPublicSurface.d.ts +13 -0
- package/dist/core/reviewPublicSurface.js +134 -0
- package/dist/core/reviewPublicSurface.js.map +1 -0
- package/dist/core/roadmapCatalog.js +122 -23
- package/dist/core/roadmapCatalog.js.map +1 -1
- package/dist/core/searchIndex.js +124 -17
- package/dist/core/searchIndex.js.map +1 -1
- package/dist/core/semanticGraph.js.map +1 -1
- package/dist/core/semanticSearch.js +20 -4
- package/dist/core/semanticSearch.js.map +1 -1
- package/dist/core/session.js +1 -2
- package/dist/core/session.js.map +1 -1
- package/dist/core/sessionResources.js +6 -2
- package/dist/core/sessionResources.js.map +1 -1
- package/dist/core/start.d.ts +3 -9
- package/dist/core/start.js +22 -3231
- package/dist/core/start.js.map +1 -1
- package/dist/core/startAdoptionLoop.d.ts +2 -0
- package/dist/core/startAdoptionLoop.js +41 -0
- package/dist/core/startAdoptionLoop.js.map +1 -0
- package/dist/core/startEvidence.d.ts +5 -0
- package/dist/core/startEvidence.js +62 -0
- package/dist/core/startEvidence.js.map +1 -0
- package/dist/core/startExecutionPlan.d.ts +16 -0
- package/dist/core/startExecutionPlan.js +185 -0
- package/dist/core/startExecutionPlan.js.map +1 -0
- package/dist/core/startHarness.d.ts +3 -0
- package/dist/core/startHarness.js +47 -0
- package/dist/core/startHarness.js.map +1 -0
- package/dist/core/startIntentTargets.d.ts +24 -0
- package/dist/core/startIntentTargets.js +1106 -0
- package/dist/core/startIntentTargets.js.map +1 -0
- package/dist/core/startMissionControl.d.ts +16 -0
- package/dist/core/startMissionControl.js +145 -0
- package/dist/core/startMissionControl.js.map +1 -0
- package/dist/core/startMissionPolicy.d.ts +19 -0
- package/dist/core/startMissionPolicy.js +246 -0
- package/dist/core/startMissionPolicy.js.map +1 -0
- package/dist/core/startMode.d.ts +11 -0
- package/dist/core/startMode.js +139 -0
- package/dist/core/startMode.js.map +1 -0
- package/dist/core/startOptions.d.ts +18 -0
- package/dist/core/startOptions.js +29 -0
- package/dist/core/startOptions.js.map +1 -0
- package/dist/core/startResume.d.ts +7 -0
- package/dist/core/startResume.js +468 -0
- package/dist/core/startResume.js.map +1 -0
- package/dist/core/startReviewGate.d.ts +11 -0
- package/dist/core/startReviewGate.js +200 -0
- package/dist/core/startReviewGate.js.map +1 -0
- package/dist/core/startRouteActions.d.ts +7 -0
- package/dist/core/startRouteActions.js +497 -0
- package/dist/core/startRouteActions.js.map +1 -0
- package/dist/core/startRunbook.d.ts +24 -0
- package/dist/core/startRunbook.js +271 -0
- package/dist/core/startRunbook.js.map +1 -0
- package/dist/core/startSuccessCriteria.d.ts +14 -0
- package/dist/core/startSuccessCriteria.js +497 -0
- package/dist/core/startSuccessCriteria.js.map +1 -0
- package/dist/core/taint.js +12 -3
- package/dist/core/taint.js.map +1 -1
- package/dist/core/telemetry.js +19 -5
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/trial.d.ts +1 -1
- package/dist/core/trial.js +15 -6
- package/dist/core/trial.js.map +1 -1
- package/dist/core/understand.d.ts +1 -1
- package/dist/core/understand.js +165 -51
- package/dist/core/understand.js.map +1 -1
- package/dist/core/upgradePreview.js +1 -1
- package/dist/core/upgradePreview.js.map +1 -1
- package/dist/core/watcher.js +18 -3
- package/dist/core/watcher.js.map +1 -1
- package/dist/core/workplan.js +87 -17
- package/dist/core/workplan.js.map +1 -1
- package/dist/core/workspace.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp/pagination.js.map +1 -1
- package/dist/mcp/prompts.js +28 -20
- package/dist/mcp/prompts.js.map +1 -1
- package/dist/mcp/server.js +6 -74
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/serverPayload.d.ts +13 -0
- package/dist/mcp/serverPayload.js +61 -0
- package/dist/mcp/serverPayload.js.map +1 -0
- package/dist/mcp/tokenBudget.js.map +1 -1
- package/dist/mcp/tools/_shared.js.map +1 -1
- package/dist/mcp/tools/agentBrief.js +7 -1
- package/dist/mcp/tools/agentBrief.js.map +1 -1
- package/dist/mcp/tools/applyFix.js +1 -1
- package/dist/mcp/tools/applyFix.js.map +1 -1
- package/dist/mcp/tools/audit.js.map +1 -1
- package/dist/mcp/tools/bugHunt.js +2 -2
- package/dist/mcp/tools/bugHunt.js.map +1 -1
- package/dist/mcp/tools/claim.js +8 -3
- package/dist/mcp/tools/claim.js.map +1 -1
- package/dist/mcp/tools/collision.js +3 -1
- package/dist/mcp/tools/collision.js.map +1 -1
- package/dist/mcp/tools/coordinate.js.map +1 -1
- package/dist/mcp/tools/coordinateWatch.js +5 -2
- package/dist/mcp/tools/coordinateWatch.js.map +1 -1
- package/dist/mcp/tools/costSummary.js.map +1 -1
- package/dist/mcp/tools/coupling.js.map +1 -1
- package/dist/mcp/tools/coverage.js.map +1 -1
- package/dist/mcp/tools/dataflow.js.map +1 -1
- package/dist/mcp/tools/dependencies.js +4 -1
- package/dist/mcp/tools/dependencies.js.map +1 -1
- package/dist/mcp/tools/doctor.js.map +1 -1
- package/dist/mcp/tools/explainIssue.js +4 -1
- package/dist/mcp/tools/explainIssue.js.map +1 -1
- package/dist/mcp/tools/fixSuggest.js +5 -2
- package/dist/mcp/tools/fixSuggest.js.map +1 -1
- package/dist/mcp/tools/hotspots.js +4 -1
- package/dist/mcp/tools/hotspots.js.map +1 -1
- package/dist/mcp/tools/impact.js +10 -3
- package/dist/mcp/tools/impact.js.map +1 -1
- package/dist/mcp/tools/mergeRisk.js.map +1 -1
- package/dist/mcp/tools/plugin.js +6 -1
- package/dist/mcp/tools/plugin.js.map +1 -1
- package/dist/mcp/tools/prDiff.js.map +1 -1
- package/dist/mcp/tools/preflight.js +1 -5
- package/dist/mcp/tools/preflight.js.map +1 -1
- package/dist/mcp/tools/review.js.map +1 -1
- package/dist/mcp/tools/reviewWatch.d.ts +1 -1
- package/dist/mcp/tools/reviewWatch.js +9 -9
- package/dist/mcp/tools/reviewWatch.js.map +1 -1
- package/dist/mcp/tools/route.js +1 -1
- package/dist/mcp/tools/route.js.map +1 -1
- package/dist/mcp/tools/search.js.map +1 -1
- package/dist/mcp/tools/semanticGraph.js +8 -2
- package/dist/mcp/tools/semanticGraph.js.map +1 -1
- package/dist/mcp/tools/start.js.map +1 -1
- package/dist/mcp/tools/structure.js +7 -1
- package/dist/mcp/tools/structure.js.map +1 -1
- package/dist/mcp/tools/understand.js.map +1 -1
- package/dist/mcp/tools/workspaceGraph.js +10 -1
- package/dist/mcp/tools/workspaceGraph.js.map +1 -1
- package/dist/mcp/tools.js +3 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/projscan-sbom.cdx.json +2136 -904
- package/dist/reporters/consoleAnalysisReporter.d.ts +2 -0
- package/dist/reporters/consoleAnalysisReporter.js +89 -0
- package/dist/reporters/consoleAnalysisReporter.js.map +1 -0
- package/dist/reporters/consoleArchitectureReporter.d.ts +3 -0
- package/dist/reporters/consoleArchitectureReporter.js +47 -0
- package/dist/reporters/consoleArchitectureReporter.js.map +1 -0
- package/dist/reporters/consoleAuditReporter.d.ts +2 -0
- package/dist/reporters/consoleAuditReporter.js +46 -0
- package/dist/reporters/consoleAuditReporter.js.map +1 -0
- package/dist/reporters/consoleCiReporter.d.ts +2 -0
- package/dist/reporters/consoleCiReporter.js +27 -0
- package/dist/reporters/consoleCiReporter.js.map +1 -0
- package/dist/reporters/consoleCouplingReporter.d.ts +2 -0
- package/dist/reporters/consoleCouplingReporter.js +53 -0
- package/dist/reporters/consoleCouplingReporter.js.map +1 -0
- package/dist/reporters/consoleCoverageReporter.d.ts +2 -0
- package/dist/reporters/consoleCoverageReporter.js +62 -0
- package/dist/reporters/consoleCoverageReporter.js.map +1 -0
- package/dist/reporters/consoleDependencyReporter.d.ts +2 -0
- package/dist/reporters/consoleDependencyReporter.js +64 -0
- package/dist/reporters/consoleDependencyReporter.js.map +1 -0
- package/dist/reporters/consoleDiffReporter.d.ts +2 -0
- package/dist/reporters/consoleDiffReporter.js +80 -0
- package/dist/reporters/consoleDiffReporter.js.map +1 -0
- package/dist/reporters/consoleExplanationReporter.d.ts +2 -0
- package/dist/reporters/consoleExplanationReporter.js +33 -0
- package/dist/reporters/consoleExplanationReporter.js.map +1 -0
- package/dist/reporters/consoleFileReporter.d.ts +2 -0
- package/dist/reporters/consoleFileReporter.js +133 -0
- package/dist/reporters/consoleFileReporter.js.map +1 -0
- package/dist/reporters/consoleFixGuidanceReporter.d.ts +8 -0
- package/dist/reporters/consoleFixGuidanceReporter.js +135 -0
- package/dist/reporters/consoleFixGuidanceReporter.js.map +1 -0
- package/dist/reporters/consoleHealthReporter.d.ts +13 -0
- package/dist/reporters/consoleHealthReporter.js +111 -0
- package/dist/reporters/consoleHealthReporter.js.map +1 -0
- package/dist/reporters/consoleHotspotReporter.d.ts +2 -0
- package/dist/reporters/consoleHotspotReporter.js +68 -0
- package/dist/reporters/consoleHotspotReporter.js.map +1 -0
- package/dist/reporters/consoleImpactReporter.d.ts +2 -0
- package/dist/reporters/consoleImpactReporter.js +65 -0
- package/dist/reporters/consoleImpactReporter.js.map +1 -0
- package/dist/reporters/consoleOutdatedReporter.d.ts +2 -0
- package/dist/reporters/consoleOutdatedReporter.js +54 -0
- package/dist/reporters/consoleOutdatedReporter.js.map +1 -0
- package/dist/reporters/consolePrDiffReporter.d.ts +2 -0
- package/dist/reporters/consolePrDiffReporter.js +75 -0
- package/dist/reporters/consolePrDiffReporter.js.map +1 -0
- package/dist/reporters/consoleReporter.d.ts +21 -38
- package/dist/reporters/consoleReporter.js +19 -1000
- package/dist/reporters/consoleReporter.js.map +1 -1
- package/dist/reporters/consoleReviewReporter.d.ts +2 -0
- package/dist/reporters/consoleReviewReporter.js +101 -0
- package/dist/reporters/consoleReviewReporter.js.map +1 -0
- package/dist/reporters/consoleUpgradeReporter.d.ts +2 -0
- package/dist/reporters/consoleUpgradeReporter.js +67 -0
- package/dist/reporters/consoleUpgradeReporter.js.map +1 -0
- package/dist/reporters/consoleWorkspaceReporter.d.ts +2 -0
- package/dist/reporters/consoleWorkspaceReporter.js +24 -0
- package/dist/reporters/consoleWorkspaceReporter.js.map +1 -0
- package/dist/reporters/htmlReporter.d.ts +2 -1
- package/dist/reporters/htmlReporter.js +9 -3
- package/dist/reporters/htmlReporter.js.map +1 -1
- package/dist/reporters/jsonReporter.d.ts +2 -1
- package/dist/reporters/jsonReporter.js.map +1 -1
- package/dist/reporters/markdownAnalysisReporter.d.ts +2 -0
- package/dist/reporters/markdownAnalysisReporter.js +40 -0
- package/dist/reporters/markdownAnalysisReporter.js.map +1 -0
- package/dist/reporters/markdownAuditReporter.d.ts +2 -0
- package/dist/reporters/markdownAuditReporter.js +27 -0
- package/dist/reporters/markdownAuditReporter.js.map +1 -0
- package/dist/reporters/markdownDependencyReporter.d.ts +2 -0
- package/dist/reporters/markdownDependencyReporter.js +33 -0
- package/dist/reporters/markdownDependencyReporter.js.map +1 -0
- package/dist/reporters/markdownDiffReporter.d.ts +2 -0
- package/dist/reporters/markdownDiffReporter.js +65 -0
- package/dist/reporters/markdownDiffReporter.js.map +1 -0
- package/dist/reporters/markdownFileReporter.d.ts +2 -0
- package/dist/reporters/markdownFileReporter.js +92 -0
- package/dist/reporters/markdownFileReporter.js.map +1 -0
- package/dist/reporters/markdownFixGuidanceReporter.d.ts +8 -0
- package/dist/reporters/markdownFixGuidanceReporter.js +95 -0
- package/dist/reporters/markdownFixGuidanceReporter.js.map +1 -0
- package/dist/reporters/markdownImpactReporter.d.ts +2 -0
- package/dist/reporters/markdownImpactReporter.js +52 -0
- package/dist/reporters/markdownImpactReporter.js.map +1 -0
- package/dist/reporters/markdownReporter.d.ts +10 -16
- package/dist/reporters/markdownReporter.js +9 -452
- package/dist/reporters/markdownReporter.js.map +1 -1
- package/dist/reporters/markdownReviewReporter.d.ts +2 -0
- package/dist/reporters/markdownReviewReporter.js +84 -0
- package/dist/reporters/markdownReviewReporter.js.map +1 -0
- package/dist/reporters/markdownUpgradeReporter.d.ts +2 -0
- package/dist/reporters/markdownUpgradeReporter.js +47 -0
- package/dist/reporters/markdownUpgradeReporter.js.map +1 -0
- package/dist/reporters/sarifReporter.js.map +1 -1
- package/dist/tool-manifest.json +4 -4
- package/dist/types/agentBrief.d.ts +48 -0
- package/dist/types/agentBrief.js +2 -0
- package/dist/types/agentBrief.js.map +1 -0
- package/dist/types/analysis.d.ts +32 -0
- package/dist/types/analysis.js +2 -0
- package/dist/types/analysis.js.map +1 -0
- package/dist/types/baseline.d.ts +59 -0
- package/dist/types/baseline.js +2 -0
- package/dist/types/baseline.js.map +1 -0
- package/dist/types/bugHunt.d.ts +41 -0
- package/dist/types/bugHunt.js +2 -0
- package/dist/types/bugHunt.js.map +1 -0
- package/dist/types/common.d.ts +34 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config.d.ts +56 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/coupling.d.ts +40 -0
- package/dist/types/coupling.js +2 -0
- package/dist/types/coupling.js.map +1 -0
- package/dist/types/coverage.d.ts +32 -0
- package/dist/types/coverage.js +2 -0
- package/dist/types/coverage.js.map +1 -0
- package/dist/types/dependencyHealth.d.ts +61 -0
- package/dist/types/dependencyHealth.js +2 -0
- package/dist/types/dependencyHealth.js.map +1 -0
- package/dist/types/dogfood.d.ts +185 -0
- package/dist/types/dogfood.js +2 -0
- package/dist/types/dogfood.js.map +1 -0
- package/dist/types/evidencePack.d.ts +76 -0
- package/dist/types/evidencePack.js +2 -0
- package/dist/types/evidencePack.js.map +1 -0
- package/dist/types/fixes.d.ts +77 -0
- package/dist/types/fixes.js +2 -0
- package/dist/types/fixes.js.map +1 -0
- package/dist/types/graph.d.ts +80 -0
- package/dist/types/graph.js +2 -0
- package/dist/types/graph.js.map +1 -0
- package/dist/types/graphCorpus.d.ts +16 -0
- package/dist/types/graphCorpus.js +2 -0
- package/dist/types/graphCorpus.js.map +1 -0
- package/dist/types/hotspots.d.ts +42 -0
- package/dist/types/hotspots.js +2 -0
- package/dist/types/hotspots.js.map +1 -0
- package/dist/types/impact.d.ts +62 -0
- package/dist/types/impact.js +2 -0
- package/dist/types/impact.js.map +1 -0
- package/dist/types/inspection.d.ts +47 -0
- package/dist/types/inspection.js +2 -0
- package/dist/types/inspection.js.map +1 -0
- package/dist/types/mcp.d.ts +39 -0
- package/dist/types/mcp.js +2 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/pluginDx.d.ts +42 -0
- package/dist/types/pluginDx.js +2 -0
- package/dist/types/pluginDx.js.map +1 -0
- package/dist/types/prDiff.d.ts +41 -0
- package/dist/types/prDiff.js +2 -0
- package/dist/types/prDiff.js.map +1 -0
- package/dist/types/preflight.d.ts +122 -0
- package/dist/types/preflight.js +2 -0
- package/dist/types/preflight.js.map +1 -0
- package/dist/types/qualityScorecard.d.ts +34 -0
- package/dist/types/qualityScorecard.js +2 -0
- package/dist/types/qualityScorecard.js.map +1 -0
- package/dist/types/regressionPlan.d.ts +32 -0
- package/dist/types/regressionPlan.js +2 -0
- package/dist/types/regressionPlan.js.map +1 -0
- package/dist/types/releaseTrain.d.ts +37 -0
- package/dist/types/releaseTrain.js +2 -0
- package/dist/types/releaseTrain.js.map +1 -0
- package/dist/types/review.d.ts +203 -0
- package/dist/types/review.js +2 -0
- package/dist/types/review.js.map +1 -0
- package/dist/types/reviewContract.d.ts +9 -0
- package/dist/types/reviewContract.js +2 -0
- package/dist/types/reviewContract.js.map +1 -0
- package/dist/types/scanning.d.ts +111 -0
- package/dist/types/scanning.js +2 -0
- package/dist/types/scanning.js.map +1 -0
- package/dist/types/session.d.ts +42 -0
- package/dist/types/session.js +2 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/start.d.ts +437 -0
- package/dist/types/start.js +2 -0
- package/dist/types/start.js.map +1 -0
- package/dist/types/trial.d.ts +27 -0
- package/dist/types/trial.js +2 -0
- package/dist/types/trial.js.map +1 -0
- package/dist/types/understand.d.ts +153 -0
- package/dist/types/understand.js +2 -0
- package/dist/types/understand.js.map +1 -0
- package/dist/types/workplan.d.ts +67 -0
- package/dist/types/workplan.js +2 -0
- package/dist/types/workplan.js.map +1 -0
- package/dist/types/workplanHandoff.d.ts +11 -0
- package/dist/types/workplanHandoff.js +2 -0
- package/dist/types/workplanHandoff.js.map +1 -0
- package/dist/types/workspace.d.ts +18 -0
- package/dist/types/workspace.js +2 -0
- package/dist/types/workspace.js.map +1 -0
- package/dist/types.d.ts +34 -2348
- package/dist/types.js +0 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/banner.js +15 -6
- package/dist/utils/banner.js.map +1 -1
- package/dist/utils/baseline.js +11 -9
- package/dist/utils/baseline.js.map +1 -1
- package/dist/utils/changedFiles.js +1 -1
- package/dist/utils/changedFiles.js.map +1 -1
- package/dist/utils/config.d.ts +2 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/formatSupport.d.ts +1 -1
- package/dist/utils/formatSupport.js +7 -1
- package/dist/utils/formatSupport.js.map +1 -1
- package/dist/utils/packageJsonLocator.js.map +1 -1
- package/docs/GUIDE.md +186 -146
- package/docs/PLUGIN-GALLERY.md +9 -1
- package/docs/ROADMAP.md +69 -68
- package/docs/demos/projscan-4-1-demo.html +46 -79
- package/docs/examples/plugins/graph-context.mjs +1 -2
- package/docs/examples/plugins/security-sensitive-files.mjs +2 -1
- package/package.json +10 -5
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
export async function writeMissionBundle(rootPath, bundleDir, report, context) {
|
|
5
|
+
const targetDir = path.resolve(rootPath, bundleDir);
|
|
6
|
+
const files = missionBundleFiles(targetDir);
|
|
7
|
+
const manifest = {
|
|
8
|
+
schemaVersion: 1,
|
|
9
|
+
kind: 'projscan.mission-bundle',
|
|
10
|
+
directory: targetDir,
|
|
11
|
+
...(report.missionControl.intent ? { intent: report.missionControl.intent } : {}),
|
|
12
|
+
mode: report.mode,
|
|
13
|
+
status: report.missionControl.status,
|
|
14
|
+
currentStep: missionBundleCurrentStep(report),
|
|
15
|
+
quickCommands: missionBundleQuickCommands(),
|
|
16
|
+
files,
|
|
17
|
+
};
|
|
18
|
+
await fs.mkdir(targetDir, { recursive: true });
|
|
19
|
+
await fs.writeFile(path.join(targetDir, 'README.md'), missionBundleReadme(report, files, context), 'utf-8');
|
|
20
|
+
await fs.writeFile(path.join(targetDir, 'next-command.txt'), missionBundleNextCommand(report), 'utf-8');
|
|
21
|
+
await fs.writeFile(path.join(targetDir, 'next-tool-call.json'), JSON.stringify(context.nextToolCall ?? null) + '\n', 'utf-8');
|
|
22
|
+
await fs.writeFile(path.join(targetDir, 'handoff-prompt.txt'), report.missionControl.handoffPrompt.trimEnd() + '\n', 'utf-8');
|
|
23
|
+
await fs.writeFile(path.join(targetDir, 'resume-prompt.txt'), report.missionControl.resume.prompt.trimEnd() + '\n', 'utf-8');
|
|
24
|
+
await fs.writeFile(path.join(targetDir, 'task-card.md'), report.missionControl.taskCard.markdown, 'utf-8');
|
|
25
|
+
await fs.writeFile(path.join(targetDir, 'review-gate.md'), report.missionControl.reviewGate.markdown, 'utf-8');
|
|
26
|
+
await fs.writeFile(path.join(targetDir, 'review-gate.json'), JSON.stringify(report.missionControl.reviewGate, null, 2) + '\n', 'utf-8');
|
|
27
|
+
await fs.writeFile(path.join(targetDir, 'review-policy.json'), JSON.stringify(report.missionControl.reviewGate.policy, null, 2) + '\n', 'utf-8');
|
|
28
|
+
await fs.writeFile(path.join(targetDir, 'review-replies.txt'), context.reviewReplies.join('\n') + '\n', 'utf-8');
|
|
29
|
+
await fs.writeFile(path.join(targetDir, 'runbook.md'), report.missionControl.runbook.markdown.trimEnd() + '\n', 'utf-8');
|
|
30
|
+
await fs.writeFile(path.join(targetDir, 'handoff.json'), JSON.stringify(report.missionControl.handoff, null, 2) + '\n', 'utf-8');
|
|
31
|
+
await fs.writeFile(path.join(targetDir, 'resume.json'), JSON.stringify(report.missionControl.resume, null, 2) + '\n', 'utf-8');
|
|
32
|
+
await fs.writeFile(path.join(targetDir, 'ready-tool-calls.json'), JSON.stringify(context.readyToolCalls, null, 2) + '\n', 'utf-8');
|
|
33
|
+
await fs.writeFile(path.join(targetDir, 'shortcuts.json'), JSON.stringify(context.shortcutIndex, null, 2) + '\n', 'utf-8');
|
|
34
|
+
await fs.mkdir(path.join(targetDir, 'proof-logs'), { recursive: true });
|
|
35
|
+
await fs.writeFile(path.join(targetDir, 'proof-logs', 'README.md'), missionProofLogsReadme(report, context.proofCommands), 'utf-8');
|
|
36
|
+
await fs.writeFile(path.join(targetDir, 'proof-logs', 'status.jsonl'), '', 'utf-8');
|
|
37
|
+
await fs.writeFile(path.join(targetDir, 'proof-logs', 'run-report.md'), missionInitialRunReport(), 'utf-8');
|
|
38
|
+
await fs.writeFile(path.join(targetDir, 'proof-logs', 'summary.json'), JSON.stringify(missionInitialRunSummary(), null, 2) + '\n', 'utf-8');
|
|
39
|
+
const missionScriptPath = path.join(targetDir, 'mission.sh');
|
|
40
|
+
await fs.writeFile(missionScriptPath, buildMissionScript(report, context.proofCommands, { proofLogs: true }), 'utf-8');
|
|
41
|
+
await fs.chmod(missionScriptPath, 0o755).catch(() => undefined);
|
|
42
|
+
const statusScriptPath = path.join(targetDir, 'status.sh');
|
|
43
|
+
await fs.writeFile(statusScriptPath, buildMissionStatusScript(), 'utf-8');
|
|
44
|
+
await fs.chmod(statusScriptPath, 0o755).catch(() => undefined);
|
|
45
|
+
const reviewScriptPath = path.join(targetDir, 'review.sh');
|
|
46
|
+
await fs.writeFile(reviewScriptPath, buildMissionReviewScript(report), 'utf-8');
|
|
47
|
+
await fs.chmod(reviewScriptPath, 0o755).catch(() => undefined);
|
|
48
|
+
await fs.writeFile(path.join(targetDir, 'proof-commands.txt'), context.proofCommands.join('\n') + '\n', 'utf-8');
|
|
49
|
+
await fs.writeFile(path.join(targetDir, 'manifest.json'), JSON.stringify(manifest, null, 2) + '\n', 'utf-8');
|
|
50
|
+
return manifest;
|
|
51
|
+
}
|
|
52
|
+
export function printMissionBundle(manifest) {
|
|
53
|
+
console.log(chalk.green(`Wrote Mission Control bundle to ${manifest.directory}`));
|
|
54
|
+
for (const file of manifest.files) {
|
|
55
|
+
console.log(`- ${file.name}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function buildMissionScript(report, proofCommands, options = {}) {
|
|
59
|
+
const mission = report.missionControl;
|
|
60
|
+
const cursor = mission.executionPlan.cursor;
|
|
61
|
+
const unsafeCommand = findMissionUnsafeCommand(cursor.command, proofCommands);
|
|
62
|
+
const proofLogs = shouldWriteProofLogs(options, unsafeCommand, cursor.command);
|
|
63
|
+
const lines = missionScriptHeader(report, unsafeCommand);
|
|
64
|
+
if (unsafeCommand) {
|
|
65
|
+
return missionScript(lines, missionUnsafeCommandBlock());
|
|
66
|
+
}
|
|
67
|
+
if (proofLogs) {
|
|
68
|
+
lines.push(...missionProofLogSetup(report));
|
|
69
|
+
}
|
|
70
|
+
if (!cursor.command) {
|
|
71
|
+
return missionScript(lines, missionMissingCommandBlock(cursor));
|
|
72
|
+
}
|
|
73
|
+
lines.push(...scriptCommandBlock('Run current command', cursor.command, proofLogs
|
|
74
|
+
? { id: `current-${cursor.stepId}`, logName: `current-${cursor.stepId}.log` }
|
|
75
|
+
: undefined));
|
|
76
|
+
lines.push(...missionProofCommandBlocks(proofCommands, proofLogs));
|
|
77
|
+
if (proofLogs) {
|
|
78
|
+
lines.push(...missionSuccessfulProofLogLines(report, proofCommands));
|
|
79
|
+
}
|
|
80
|
+
lines.push(...missionReviewGateLines(mission.reviewGate));
|
|
81
|
+
return lines.join('\n') + '\n';
|
|
82
|
+
}
|
|
83
|
+
function missionScript(lines, tail) {
|
|
84
|
+
return [...lines, ...tail].join('\n') + '\n';
|
|
85
|
+
}
|
|
86
|
+
function findMissionUnsafeCommand(cursorCommand, proofCommands) {
|
|
87
|
+
return [cursorCommand, ...proofCommands]
|
|
88
|
+
.filter((command) => typeof command === 'string')
|
|
89
|
+
.find(commandHasShellExpansionSyntax);
|
|
90
|
+
}
|
|
91
|
+
function shouldWriteProofLogs(options, unsafeCommand, cursorCommand) {
|
|
92
|
+
return options.proofLogs === true && !unsafeCommand && typeof cursorCommand === 'string';
|
|
93
|
+
}
|
|
94
|
+
function missionScriptHeader(report, unsafeCommand) {
|
|
95
|
+
const mission = report.missionControl;
|
|
96
|
+
const cursor = mission.executionPlan.cursor;
|
|
97
|
+
return [
|
|
98
|
+
'#!/usr/bin/env sh',
|
|
99
|
+
'set -eu',
|
|
100
|
+
'',
|
|
101
|
+
scriptPrint('projscan Mission Control'),
|
|
102
|
+
...(mission.intent && !unsafeCommand ? [scriptPrint(`Intent: ${mission.intent}`)] : []),
|
|
103
|
+
scriptPrint(`Mode: ${report.mode}`),
|
|
104
|
+
scriptPrint(`Status: ${mission.status}`),
|
|
105
|
+
scriptPrint(`Current step: ${cursor.stepId} in ${cursor.phaseId}`),
|
|
106
|
+
scriptPrint(''),
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
function missionUnsafeCommandBlock() {
|
|
110
|
+
return [
|
|
111
|
+
scriptPrintError('Blocked: mission command contains shell expansion syntax; inspect --next-command before running it.'),
|
|
112
|
+
'exit 2',
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
function missionProofLogSetup(report) {
|
|
116
|
+
return [
|
|
117
|
+
'MISSION_DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)',
|
|
118
|
+
'PROOF_LOG_DIR="${MISSION_DIR}/proof-logs"',
|
|
119
|
+
'PROOF_STATUS_FILE="${PROOF_LOG_DIR}/status.jsonl"',
|
|
120
|
+
'PROOF_REPORT_FILE="${PROOF_LOG_DIR}/run-report.md"',
|
|
121
|
+
'PROOF_SUMMARY_FILE="${PROOF_LOG_DIR}/summary.json"',
|
|
122
|
+
'mkdir -p "$PROOF_LOG_DIR"',
|
|
123
|
+
': > "$PROOF_STATUS_FILE"',
|
|
124
|
+
': > "$PROOF_REPORT_FILE"',
|
|
125
|
+
...scriptInitRunReport(report),
|
|
126
|
+
scriptWriteSummaryJson('running'),
|
|
127
|
+
scriptPrintExpanded('Proof logs: ${PROOF_LOG_DIR}'),
|
|
128
|
+
scriptPrintExpanded('Run report: ${PROOF_REPORT_FILE}'),
|
|
129
|
+
scriptPrintExpanded('Summary: ${PROOF_SUMMARY_FILE}'),
|
|
130
|
+
scriptPrint(''),
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
function missionMissingCommandBlock(cursor) {
|
|
134
|
+
return [scriptPrintError(`Blocked: ${cursor.instruction ?? cursor.label}`), 'exit 2'];
|
|
135
|
+
}
|
|
136
|
+
function missionProofCommandBlocks(proofCommands, proofLogs) {
|
|
137
|
+
if (proofCommands.length === 0)
|
|
138
|
+
return [];
|
|
139
|
+
const lines = [scriptPrint(''), scriptPrint('Run remaining proof')];
|
|
140
|
+
for (const [index, command] of proofCommands.entries()) {
|
|
141
|
+
lines.push(...scriptCommandBlock(`Proof ${index + 1}`, command, proofLogs ? { id: `proof-${index + 1}`, logName: `proof-${index + 1}.log` } : undefined));
|
|
142
|
+
}
|
|
143
|
+
return lines;
|
|
144
|
+
}
|
|
145
|
+
function missionSuccessfulProofLogLines(report, proofCommands) {
|
|
146
|
+
const cursor = report.missionControl.executionPlan.cursor;
|
|
147
|
+
const totalLoggedCommands = typeof cursor.command === 'string' ? 1 + proofCommands.length : proofCommands.length;
|
|
148
|
+
const reviewGate = report.missionControl.reviewGate;
|
|
149
|
+
return [
|
|
150
|
+
...scriptAppendRunReportResult('passed'),
|
|
151
|
+
scriptWriteSummaryJson('passed', { totalCommands: totalLoggedCommands }),
|
|
152
|
+
...scriptAppendRunReportReviewGate(reviewGate.stopCondition, reviewGate.commands),
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
function missionReviewGateLines(reviewGate) {
|
|
156
|
+
return [
|
|
157
|
+
scriptPrint(''),
|
|
158
|
+
scriptPrint('Review gate'),
|
|
159
|
+
scriptPrint(reviewGate.stopCondition),
|
|
160
|
+
...reviewGate.commands.map((command) => scriptPrint(`Capture: ${command}`)),
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
function missionBundleQuickCommands() {
|
|
164
|
+
return [
|
|
165
|
+
{
|
|
166
|
+
id: 'run',
|
|
167
|
+
command: './mission.sh',
|
|
168
|
+
description: 'Run the current command and remaining proof.',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: 'status',
|
|
172
|
+
command: './status.sh',
|
|
173
|
+
description: 'Print the latest mission state and next action.',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 'review',
|
|
177
|
+
command: './review.sh',
|
|
178
|
+
description: 'Print the review packet for approval.',
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
function missionBundleFiles(targetDir) {
|
|
183
|
+
return [
|
|
184
|
+
{
|
|
185
|
+
name: 'README.md',
|
|
186
|
+
path: path.join(targetDir, 'README.md'),
|
|
187
|
+
description: 'Quickstart for humans opening the bundle.',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'next-command.txt',
|
|
191
|
+
path: path.join(targetDir, 'next-command.txt'),
|
|
192
|
+
description: 'Current shell command or resume instruction.',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'next-tool-call.json',
|
|
196
|
+
path: path.join(targetDir, 'next-tool-call.json'),
|
|
197
|
+
description: 'Current MCP tool call, or null when no mapped call exists.',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'handoff-prompt.txt',
|
|
201
|
+
path: path.join(targetDir, 'handoff-prompt.txt'),
|
|
202
|
+
description: 'Copyable prompt for handing this mission to another agent.',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'resume-prompt.txt',
|
|
206
|
+
path: path.join(targetDir, 'resume-prompt.txt'),
|
|
207
|
+
description: 'Focused prompt for resuming the current cursor.',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'task-card.md',
|
|
211
|
+
path: path.join(targetDir, 'task-card.md'),
|
|
212
|
+
description: 'Paste-ready Markdown task card for PRs, issues, and handoffs.',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'review-gate.md',
|
|
216
|
+
path: path.join(targetDir, 'review-gate.md'),
|
|
217
|
+
description: 'Stop-and-review gate for approving another slice, release, publish, or deploy.',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'review-gate.json',
|
|
221
|
+
path: path.join(targetDir, 'review-gate.json'),
|
|
222
|
+
description: 'Machine-readable review gate with policy, proof, decisions, and worktree evidence.',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'review-policy.json',
|
|
226
|
+
path: path.join(targetDir, 'review-policy.json'),
|
|
227
|
+
description: 'Machine-readable review approval boundary and blocked actions.',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'review-replies.txt',
|
|
231
|
+
path: path.join(targetDir, 'review-replies.txt'),
|
|
232
|
+
description: 'Copy-only reviewer reply choices for approving or redirecting the stopped mission.',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: 'runbook.md',
|
|
236
|
+
path: path.join(targetDir, 'runbook.md'),
|
|
237
|
+
description: 'Human-readable Mission Control runbook.',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'handoff.json',
|
|
241
|
+
path: path.join(targetDir, 'handoff.json'),
|
|
242
|
+
description: 'Structured Mission Control handoff object.',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: 'resume.json',
|
|
246
|
+
path: path.join(targetDir, 'resume.json'),
|
|
247
|
+
description: 'Focused resume object for the current cursor.',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'ready-tool-calls.json',
|
|
251
|
+
path: path.join(targetDir, 'ready-tool-calls.json'),
|
|
252
|
+
description: 'Current cursor MCP call followed by remaining MCP-callable proof.',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: 'shortcuts.json',
|
|
256
|
+
path: path.join(targetDir, 'shortcuts.json'),
|
|
257
|
+
description: 'Machine-readable Mission Control shortcut command index.',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'mission.sh',
|
|
261
|
+
path: path.join(targetDir, 'mission.sh'),
|
|
262
|
+
description: 'Shell script that runs the current cursor command and remaining proof queue.',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: 'status.sh',
|
|
266
|
+
path: path.join(targetDir, 'status.sh'),
|
|
267
|
+
description: 'Shell script that prints the latest mission run state from summary.json.',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: 'review.sh',
|
|
271
|
+
path: path.join(targetDir, 'review.sh'),
|
|
272
|
+
description: 'Shell script that prints status, review evidence, run report, and reviewer replies.',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'proof-logs/README.md',
|
|
276
|
+
path: path.join(targetDir, 'proof-logs', 'README.md'),
|
|
277
|
+
description: 'Proof-log index for output written by mission.sh.',
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: 'proof-logs/status.jsonl',
|
|
281
|
+
path: path.join(targetDir, 'proof-logs', 'status.jsonl'),
|
|
282
|
+
description: 'Runtime status rows written by mission.sh.',
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'proof-logs/run-report.md',
|
|
286
|
+
path: path.join(targetDir, 'proof-logs', 'run-report.md'),
|
|
287
|
+
description: 'Human-readable run report refreshed by mission.sh.',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'proof-logs/summary.json',
|
|
291
|
+
path: path.join(targetDir, 'proof-logs', 'summary.json'),
|
|
292
|
+
description: 'Machine-readable mission run state refreshed by mission.sh.',
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: 'proof-commands.txt',
|
|
296
|
+
path: path.join(targetDir, 'proof-commands.txt'),
|
|
297
|
+
description: 'Remaining ready proof commands, one per line.',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'manifest.json',
|
|
301
|
+
path: path.join(targetDir, 'manifest.json'),
|
|
302
|
+
description: 'Bundle index with mode, status, current step, and file paths.',
|
|
303
|
+
},
|
|
304
|
+
];
|
|
305
|
+
}
|
|
306
|
+
function missionBundleReadme(report, files, context) {
|
|
307
|
+
const mission = report.missionControl;
|
|
308
|
+
const cursor = mission.executionPlan.cursor;
|
|
309
|
+
const lines = [
|
|
310
|
+
'# Mission Bundle',
|
|
311
|
+
'',
|
|
312
|
+
...(mission.intent ? [`Intent: ${mission.intent}`] : []),
|
|
313
|
+
`Mode: ${report.mode}`,
|
|
314
|
+
`Status: ${mission.status}`,
|
|
315
|
+
`Current step: ${cursor.stepId} in ${cursor.phaseId}`,
|
|
316
|
+
'',
|
|
317
|
+
'## Quick Commands',
|
|
318
|
+
'',
|
|
319
|
+
'```sh',
|
|
320
|
+
'./mission.sh',
|
|
321
|
+
'./status.sh',
|
|
322
|
+
'./review.sh',
|
|
323
|
+
'```',
|
|
324
|
+
'',
|
|
325
|
+
'- `./mission.sh` runs the current command and remaining proof.',
|
|
326
|
+
'- `./status.sh` prints the latest mission state and next action.',
|
|
327
|
+
'- `./review.sh` prints the review packet for approval.',
|
|
328
|
+
'',
|
|
329
|
+
'## Run Next',
|
|
330
|
+
'',
|
|
331
|
+
];
|
|
332
|
+
if (cursor.command) {
|
|
333
|
+
lines.push('```sh', cursor.command, '```');
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
lines.push(mission.resume.instruction);
|
|
337
|
+
}
|
|
338
|
+
if (context.nextToolCall) {
|
|
339
|
+
lines.push('', `MCP call: \`${context.nextToolCall.tool} ${JSON.stringify(context.nextToolCall.args ?? {})}\``);
|
|
340
|
+
}
|
|
341
|
+
if (context.reviewReplies.length > 0) {
|
|
342
|
+
lines.push('', '## Reviewer Replies', '', ...context.reviewReplies);
|
|
343
|
+
}
|
|
344
|
+
lines.push('', '## Files');
|
|
345
|
+
for (const file of files) {
|
|
346
|
+
lines.push(`- \`${file.name}\`: ${file.description}`);
|
|
347
|
+
}
|
|
348
|
+
return lines.join('\n').trimEnd() + '\n';
|
|
349
|
+
}
|
|
350
|
+
function missionBundleNextCommand(report) {
|
|
351
|
+
return `${report.missionControl.executionPlan.cursor.command ?? report.missionControl.resume.instruction}\n`;
|
|
352
|
+
}
|
|
353
|
+
function missionBundleCurrentStep(report) {
|
|
354
|
+
const cursor = report.missionControl.executionPlan.cursor;
|
|
355
|
+
return {
|
|
356
|
+
phaseId: cursor.phaseId,
|
|
357
|
+
stepId: cursor.stepId,
|
|
358
|
+
...(cursor.command ? { command: cursor.command } : {}),
|
|
359
|
+
...(cursor.tool
|
|
360
|
+
? {
|
|
361
|
+
toolCall: {
|
|
362
|
+
tool: cursor.tool,
|
|
363
|
+
...(typeof cursor.args !== 'undefined' ? { args: cursor.args } : {}),
|
|
364
|
+
},
|
|
365
|
+
}
|
|
366
|
+
: {}),
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
function buildMissionStatusScript() {
|
|
370
|
+
return [
|
|
371
|
+
'#!/usr/bin/env sh',
|
|
372
|
+
'set -eu',
|
|
373
|
+
'',
|
|
374
|
+
'MISSION_DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)',
|
|
375
|
+
'SUMMARY_FILE="${MISSION_DIR}/proof-logs/summary.json"',
|
|
376
|
+
'',
|
|
377
|
+
'if ! command -v node >/dev/null 2>&1; then',
|
|
378
|
+
` ${scriptPrintError('Node.js is required to read proof-logs/summary.json.')}`,
|
|
379
|
+
' exit 2',
|
|
380
|
+
'fi',
|
|
381
|
+
'',
|
|
382
|
+
'node - "$SUMMARY_FILE" <<\'NODE\'',
|
|
383
|
+
'const fs = require("node:fs");',
|
|
384
|
+
'const summaryPath = process.argv[2];',
|
|
385
|
+
'let summary;',
|
|
386
|
+
'try {',
|
|
387
|
+
' summary = JSON.parse(fs.readFileSync(summaryPath, "utf8"));',
|
|
388
|
+
'} catch (error) {',
|
|
389
|
+
' console.error(`Unable to read ${summaryPath}: ${error.message}`);',
|
|
390
|
+
' process.exit(2);',
|
|
391
|
+
'}',
|
|
392
|
+
'const status = typeof summary.status === "string" ? summary.status : "unknown";',
|
|
393
|
+
'console.log(`Mission status: ${status}`);',
|
|
394
|
+
'if (summary.report) console.log(`Report: ${summary.report}`);',
|
|
395
|
+
'if (summary.statusRows) console.log(`Status rows: ${summary.statusRows}`);',
|
|
396
|
+
'if (summary.totalCommands !== undefined) console.log(`Total commands: ${summary.totalCommands}`);',
|
|
397
|
+
'if (summary.failedStep) console.log(`Failed step: ${summary.failedStep}`);',
|
|
398
|
+
'if (summary.exitCode !== undefined) console.log(`Exit code: ${summary.exitCode}`);',
|
|
399
|
+
'if (summary.log) console.log(`Log: ${summary.log}`);',
|
|
400
|
+
`const nextActions = ${JSON.stringify(missionRunNextActions)};`,
|
|
401
|
+
'const nextAction = typeof summary.nextAction === "string" ? summary.nextAction : nextActions[status] ?? "inspect proof-logs/summary.json.";',
|
|
402
|
+
'console.log(`Next action: ${nextAction}`);',
|
|
403
|
+
'process.exitCode = status === "passed" ? 0 : status === "failed" ? 1 : 2;',
|
|
404
|
+
'NODE',
|
|
405
|
+
'',
|
|
406
|
+
].join('\n');
|
|
407
|
+
}
|
|
408
|
+
function buildMissionReviewScript(report) {
|
|
409
|
+
const evidenceCommands = report.missionControl.reviewGate.commands;
|
|
410
|
+
return [
|
|
411
|
+
'#!/usr/bin/env sh',
|
|
412
|
+
'set -eu',
|
|
413
|
+
'',
|
|
414
|
+
'MISSION_DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)',
|
|
415
|
+
'status_code=2',
|
|
416
|
+
'',
|
|
417
|
+
scriptPrint('Mission Review'),
|
|
418
|
+
scriptPrint(''),
|
|
419
|
+
'if [ -x "${MISSION_DIR}/status.sh" ]; then',
|
|
420
|
+
' set +e',
|
|
421
|
+
' "${MISSION_DIR}/status.sh"',
|
|
422
|
+
' status_code=$?',
|
|
423
|
+
' set -e',
|
|
424
|
+
'else',
|
|
425
|
+
` ${scriptPrintError('Missing status.sh; run projscan start --save-mission again.')}`,
|
|
426
|
+
'fi',
|
|
427
|
+
'',
|
|
428
|
+
scriptPrint(''),
|
|
429
|
+
scriptPrint('Review gate: review-gate.md'),
|
|
430
|
+
'if [ -f "${MISSION_DIR}/review-gate.md" ]; then',
|
|
431
|
+
' sed -n \'1,220p\' "${MISSION_DIR}/review-gate.md"',
|
|
432
|
+
'else',
|
|
433
|
+
` ${scriptPrintError('Missing review-gate.md.')}`,
|
|
434
|
+
'fi',
|
|
435
|
+
'',
|
|
436
|
+
scriptPrint(''),
|
|
437
|
+
scriptPrint('Run report: proof-logs/run-report.md'),
|
|
438
|
+
'if [ -f "${MISSION_DIR}/proof-logs/run-report.md" ]; then',
|
|
439
|
+
' sed -n \'1,220p\' "${MISSION_DIR}/proof-logs/run-report.md"',
|
|
440
|
+
'else',
|
|
441
|
+
` ${scriptPrintError('Missing proof-logs/run-report.md. Run ./mission.sh to create proof output.')}`,
|
|
442
|
+
'fi',
|
|
443
|
+
'',
|
|
444
|
+
scriptPrint(''),
|
|
445
|
+
scriptPrint('Evidence commands'),
|
|
446
|
+
...evidenceCommands.map((command) => scriptPrint(`- ${command}`)),
|
|
447
|
+
'',
|
|
448
|
+
scriptPrint(''),
|
|
449
|
+
scriptPrint('Reviewer replies:'),
|
|
450
|
+
'if [ -f "${MISSION_DIR}/review-replies.txt" ]; then',
|
|
451
|
+
' cat "${MISSION_DIR}/review-replies.txt"',
|
|
452
|
+
'else',
|
|
453
|
+
` ${scriptPrintError('Missing review-replies.txt.')}`,
|
|
454
|
+
'fi',
|
|
455
|
+
'',
|
|
456
|
+
'exit "$status_code"',
|
|
457
|
+
'',
|
|
458
|
+
].join('\n');
|
|
459
|
+
}
|
|
460
|
+
function missionProofLogsReadme(report, proofCommands) {
|
|
461
|
+
const entries = missionProofLogEntries(report, proofCommands);
|
|
462
|
+
const lines = [
|
|
463
|
+
'# Mission Proof Logs',
|
|
464
|
+
'',
|
|
465
|
+
'Run `./mission.sh` from this bundle to write command output here.',
|
|
466
|
+
'Read `run-report.md` first for pass/fail proof after `mission.sh` runs.',
|
|
467
|
+
'Read `summary.json` for the latest not_run, running, passed, or failed state.',
|
|
468
|
+
'Read `status.jsonl` for command exit codes after `mission.sh` runs.',
|
|
469
|
+
'',
|
|
470
|
+
'## Expected Logs',
|
|
471
|
+
'',
|
|
472
|
+
];
|
|
473
|
+
if (entries.length === 0) {
|
|
474
|
+
lines.push('No runnable proof logs are planned for this mission.');
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
for (const entry of entries) {
|
|
478
|
+
lines.push(`- \`${entry.name}\`: \`${entry.command}\``);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return lines.join('\n').trimEnd() + '\n';
|
|
482
|
+
}
|
|
483
|
+
function missionInitialRunReport() {
|
|
484
|
+
return [
|
|
485
|
+
'# Mission Run Report',
|
|
486
|
+
'',
|
|
487
|
+
'Run `./mission.sh` to refresh this report with command exit codes and log links.',
|
|
488
|
+
'Review `status.jsonl` for machine-readable status rows.',
|
|
489
|
+
'',
|
|
490
|
+
].join('\n');
|
|
491
|
+
}
|
|
492
|
+
function missionInitialRunSummary() {
|
|
493
|
+
return {
|
|
494
|
+
schemaVersion: 1,
|
|
495
|
+
status: 'not_run',
|
|
496
|
+
nextAction: missionRunNextActions.not_run,
|
|
497
|
+
report: 'proof-logs/run-report.md',
|
|
498
|
+
statusRows: 'proof-logs/status.jsonl',
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function missionProofLogEntries(report, proofCommands) {
|
|
502
|
+
const cursor = report.missionControl.executionPlan.cursor;
|
|
503
|
+
const unsafeCommand = [cursor.command, ...proofCommands]
|
|
504
|
+
.filter((command) => typeof command === 'string')
|
|
505
|
+
.find(commandHasShellExpansionSyntax);
|
|
506
|
+
if (unsafeCommand || !cursor.command)
|
|
507
|
+
return [];
|
|
508
|
+
return [
|
|
509
|
+
{ name: `current-${cursor.stepId}.log`, command: cursor.command },
|
|
510
|
+
...proofCommands.map((command, index) => ({ name: `proof-${index + 1}.log`, command })),
|
|
511
|
+
];
|
|
512
|
+
}
|
|
513
|
+
function scriptCommandBlock(label, command, logTarget) {
|
|
514
|
+
if (!logTarget)
|
|
515
|
+
return [scriptPrint(label), command];
|
|
516
|
+
return [
|
|
517
|
+
scriptPrint(label),
|
|
518
|
+
scriptPrint(`Writing proof-logs/${logTarget.logName}`),
|
|
519
|
+
'set +e',
|
|
520
|
+
'{',
|
|
521
|
+
` ${command}`,
|
|
522
|
+
`} > "$PROOF_LOG_DIR/${logTarget.logName}" 2>&1`,
|
|
523
|
+
'status=$?',
|
|
524
|
+
'set -e',
|
|
525
|
+
scriptAppendStatusJsonl(logTarget.id, label, logTarget.logName, command),
|
|
526
|
+
scriptAppendReportRow(logTarget.id, label, logTarget.logName),
|
|
527
|
+
'if [ "$status" -ne 0 ]; then',
|
|
528
|
+
` ${scriptPrintError(`Command failed. See proof-logs/${logTarget.logName}.`)}`,
|
|
529
|
+
...scriptAppendReportFailure(logTarget.id, logTarget.logName),
|
|
530
|
+
` ${scriptWriteSummaryJson('failed', { failedStep: logTarget.id, logName: logTarget.logName })}`,
|
|
531
|
+
` ${scriptPrintExpanded('Run report: ${PROOF_REPORT_FILE}')}`,
|
|
532
|
+
` ${scriptPrintExpanded('Summary: ${PROOF_SUMMARY_FILE}')}`,
|
|
533
|
+
' exit "$status"',
|
|
534
|
+
'fi',
|
|
535
|
+
];
|
|
536
|
+
}
|
|
537
|
+
function scriptPrint(value) {
|
|
538
|
+
return `printf '%s\\n' ${shellQuote(value)}`;
|
|
539
|
+
}
|
|
540
|
+
function scriptPrintExpanded(value) {
|
|
541
|
+
return `printf '%s\\n' "${value.replace(/(["\\])/g, '\\$1')}"`;
|
|
542
|
+
}
|
|
543
|
+
function scriptAppendStatusJsonl(id, label, logName, command) {
|
|
544
|
+
const prefix = JSON.stringify({
|
|
545
|
+
id,
|
|
546
|
+
label,
|
|
547
|
+
log: logName,
|
|
548
|
+
command,
|
|
549
|
+
}).replace(/}$/, ',"exitCode":');
|
|
550
|
+
return `printf '%s%s%s\\n' ${shellQuote(prefix)} "$status" '}' >> "$PROOF_STATUS_FILE"`;
|
|
551
|
+
}
|
|
552
|
+
function scriptInitRunReport(report) {
|
|
553
|
+
const mission = report.missionControl;
|
|
554
|
+
return [
|
|
555
|
+
'{',
|
|
556
|
+
` ${scriptPrint('# Mission Run Report')}`,
|
|
557
|
+
` ${scriptPrint('')}`,
|
|
558
|
+
...(mission.intent ? [` ${scriptPrint(`Intent: ${mission.intent}`)}`] : []),
|
|
559
|
+
` ${scriptPrint(`Mode: ${report.mode}`)}`,
|
|
560
|
+
` ${scriptPrint(`Status: ${mission.status}`)}`,
|
|
561
|
+
` ${scriptPrint(`Current step: ${mission.executionPlan.cursor.stepId} in ${mission.executionPlan.cursor.phaseId}`)}`,
|
|
562
|
+
` ${scriptPrint('')}`,
|
|
563
|
+
` ${scriptPrint('| Step | Label | Exit | Log |')}`,
|
|
564
|
+
` ${scriptPrint('| --- | --- | ---: | --- |')}`,
|
|
565
|
+
'} >> "$PROOF_REPORT_FILE"',
|
|
566
|
+
];
|
|
567
|
+
}
|
|
568
|
+
function scriptAppendReportRow(id, label, logName) {
|
|
569
|
+
return `printf '| %s | %s | %s | %s |\\n' ${shellQuote(id)} ${shellQuote(label)} "$status" ${shellQuote(`proof-logs/${logName}`)} >> "$PROOF_REPORT_FILE"`;
|
|
570
|
+
}
|
|
571
|
+
function scriptAppendReportFailure(id, logName) {
|
|
572
|
+
return [
|
|
573
|
+
...scriptAppendRunReportResult('failed'),
|
|
574
|
+
' {',
|
|
575
|
+
` ${scriptPrint(`Failed step: ${id}`)}`,
|
|
576
|
+
` ${scriptPrint(`Log: proof-logs/${logName}`)}`,
|
|
577
|
+
' } >> "$PROOF_REPORT_FILE"',
|
|
578
|
+
];
|
|
579
|
+
}
|
|
580
|
+
const missionRunNextActions = {
|
|
581
|
+
not_run: 'run ./mission.sh to generate proof.',
|
|
582
|
+
running: 'wait for ./mission.sh to finish, or inspect proof-logs/status.jsonl.',
|
|
583
|
+
failed: 'inspect the failed log, fix the issue, then rerun ./mission.sh.',
|
|
584
|
+
passed: 'run ./review.sh and choose a reviewer reply.',
|
|
585
|
+
};
|
|
586
|
+
function scriptWriteSummaryJson(status, options = {}) {
|
|
587
|
+
const base = {
|
|
588
|
+
schemaVersion: 1,
|
|
589
|
+
status,
|
|
590
|
+
nextAction: missionRunNextActions[status],
|
|
591
|
+
report: 'proof-logs/run-report.md',
|
|
592
|
+
statusRows: 'proof-logs/status.jsonl',
|
|
593
|
+
...(typeof options.totalCommands === 'number' ? { totalCommands: options.totalCommands } : {}),
|
|
594
|
+
...(options.failedStep ? { failedStep: options.failedStep } : {}),
|
|
595
|
+
...(options.logName ? { log: `proof-logs/${options.logName}` } : {}),
|
|
596
|
+
};
|
|
597
|
+
if (status !== 'failed') {
|
|
598
|
+
return `printf '%s\\n' ${shellQuote(JSON.stringify(base))} > "$PROOF_SUMMARY_FILE"`;
|
|
599
|
+
}
|
|
600
|
+
const prefix = JSON.stringify(base).replace(/}$/, ',"exitCode":');
|
|
601
|
+
return `printf '%s%s%s\\n' ${shellQuote(prefix)} "$status" '}' > "$PROOF_SUMMARY_FILE"`;
|
|
602
|
+
}
|
|
603
|
+
function scriptAppendRunReportResult(status) {
|
|
604
|
+
const message = status === 'passed'
|
|
605
|
+
? 'All current and proof commands exited 0.'
|
|
606
|
+
: 'Mission stopped before completion.';
|
|
607
|
+
return [
|
|
608
|
+
'{',
|
|
609
|
+
` ${scriptPrint('')}`,
|
|
610
|
+
` ${scriptPrint('## Result')}`,
|
|
611
|
+
` ${scriptPrint(message)}`,
|
|
612
|
+
'} >> "$PROOF_REPORT_FILE"',
|
|
613
|
+
];
|
|
614
|
+
}
|
|
615
|
+
function scriptAppendRunReportReviewGate(stopCondition, commands) {
|
|
616
|
+
return [
|
|
617
|
+
'{',
|
|
618
|
+
` ${scriptPrint('')}`,
|
|
619
|
+
` ${scriptPrint('## Review Gate')}`,
|
|
620
|
+
` ${scriptPrint(stopCondition)}`,
|
|
621
|
+
...commands.map((command) => ` ${scriptPrint(`- ${command}`)}`),
|
|
622
|
+
'} >> "$PROOF_REPORT_FILE"',
|
|
623
|
+
];
|
|
624
|
+
}
|
|
625
|
+
function scriptPrintError(value) {
|
|
626
|
+
return `${scriptPrint(value)} >&2`;
|
|
627
|
+
}
|
|
628
|
+
function commandHasShellExpansionSyntax(command) {
|
|
629
|
+
let backslashCount = 0;
|
|
630
|
+
for (const char of command) {
|
|
631
|
+
if (char === '\\') {
|
|
632
|
+
backslashCount += 1;
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
const escaped = backslashCount % 2 === 1;
|
|
636
|
+
if ((char === '$' || char === '`') && !escaped)
|
|
637
|
+
return true;
|
|
638
|
+
backslashCount = 0;
|
|
639
|
+
}
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
function shellQuote(value) {
|
|
643
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
644
|
+
}
|
|
645
|
+
//# sourceMappingURL=startMissionBundle.js.map
|