@shrkcrft/inspector 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/acceptance-replay.d.ts +63 -0
- package/dist/acceptance-replay.d.ts.map +1 -0
- package/dist/acceptance-replay.js +240 -0
- package/dist/action-hint-diagnostics.d.ts +32 -0
- package/dist/action-hint-diagnostics.d.ts.map +1 -0
- package/dist/action-hint-diagnostics.js +133 -0
- package/dist/adoption-check.d.ts +28 -0
- package/dist/adoption-check.d.ts.map +1 -0
- package/dist/adoption-check.js +181 -0
- package/dist/adoption-checkpoint.d.ts +97 -0
- package/dist/adoption-checkpoint.d.ts.map +1 -0
- package/dist/adoption-checkpoint.js +209 -0
- package/dist/adoption-merge-preview.d.ts +28 -0
- package/dist/adoption-merge-preview.d.ts.map +1 -0
- package/dist/adoption-merge-preview.js +254 -0
- package/dist/adoption-report-renderer.d.ts +33 -0
- package/dist/adoption-report-renderer.d.ts.map +1 -0
- package/dist/adoption-report-renderer.js +257 -0
- package/dist/adoption-state.d.ts +100 -0
- package/dist/adoption-state.d.ts.map +1 -0
- package/dist/adoption-state.js +296 -0
- package/dist/adoption-three-way.d.ts +46 -0
- package/dist/adoption-three-way.d.ts.map +1 -0
- package/dist/adoption-three-way.js +181 -0
- package/dist/agent-brief.d.ts +77 -0
- package/dist/agent-brief.d.ts.map +1 -0
- package/dist/agent-brief.js +490 -0
- package/dist/agent-contract-gate.d.ts +108 -0
- package/dist/agent-contract-gate.d.ts.map +1 -0
- package/dist/agent-contract-gate.js +412 -0
- package/dist/agent-contract-templates.d.ts +63 -0
- package/dist/agent-contract-templates.d.ts.map +1 -0
- package/dist/agent-contract-templates.js +346 -0
- package/dist/agent-contract.d.ts +65 -0
- package/dist/agent-contract.d.ts.map +1 -0
- package/dist/agent-contract.js +555 -0
- package/dist/agent-handoff.d.ts +123 -0
- package/dist/agent-handoff.d.ts.map +1 -0
- package/dist/agent-handoff.js +470 -0
- package/dist/agent-instructions.d.ts +2 -0
- package/dist/agent-instructions.d.ts.map +1 -0
- package/dist/agent-instructions.js +21 -0
- package/dist/agent-orchestration.d.ts +61 -0
- package/dist/agent-orchestration.d.ts.map +1 -0
- package/dist/agent-orchestration.js +285 -0
- package/dist/agent-task-prep.d.ts +31 -0
- package/dist/agent-task-prep.d.ts.map +1 -0
- package/dist/agent-task-prep.js +73 -0
- package/dist/ai-readiness.d.ts +30 -0
- package/dist/ai-readiness.d.ts.map +1 -0
- package/dist/ai-readiness.js +279 -0
- package/dist/api-report.d.ts +51 -0
- package/dist/api-report.d.ts.map +1 -0
- package/dist/api-report.js +254 -0
- package/dist/apply-dispatch-trace.d.ts +93 -0
- package/dist/apply-dispatch-trace.d.ts.map +1 -0
- package/dist/apply-dispatch-trace.js +283 -0
- package/dist/apply-gate-result.d.ts +52 -0
- package/dist/apply-gate-result.d.ts.map +1 -0
- package/dist/apply-gate-result.js +44 -0
- package/dist/architecture-map.d.ts +118 -0
- package/dist/architecture-map.d.ts.map +1 -0
- package/dist/architecture-map.js +543 -0
- package/dist/area-explore.d.ts +75 -0
- package/dist/area-explore.d.ts.map +1 -0
- package/dist/area-explore.js +438 -0
- package/dist/area-map.d.ts +57 -0
- package/dist/area-map.d.ts.map +1 -0
- package/dist/area-map.js +214 -0
- package/dist/asset-provenance.d.ts +123 -0
- package/dist/asset-provenance.d.ts.map +1 -0
- package/dist/asset-provenance.js +209 -0
- package/dist/barrel-operations.d.ts +45 -0
- package/dist/barrel-operations.d.ts.map +1 -0
- package/dist/barrel-operations.js +159 -0
- package/dist/boundaries-changed-only.d.ts +62 -0
- package/dist/boundaries-changed-only.d.ts.map +1 -0
- package/dist/boundaries-changed-only.js +97 -0
- package/dist/boundary-suggestions.d.ts +20 -0
- package/dist/boundary-suggestions.d.ts.map +1 -0
- package/dist/boundary-suggestions.js +51 -0
- package/dist/bundle-diff.d.ts +98 -0
- package/dist/bundle-diff.d.ts.map +1 -0
- package/dist/bundle-diff.js +531 -0
- package/dist/bundle-replay.d.ts +68 -0
- package/dist/bundle-replay.d.ts.map +1 -0
- package/dist/bundle-replay.js +273 -0
- package/dist/bundle-validate-html.d.ts +11 -0
- package/dist/bundle-validate-html.d.ts.map +1 -0
- package/dist/bundle-validate-html.js +60 -0
- package/dist/change-intent.d.ts +36 -0
- package/dist/change-intent.d.ts.map +1 -0
- package/dist/change-intent.js +259 -0
- package/dist/changed-preflight.d.ts +59 -0
- package/dist/changed-preflight.d.ts.map +1 -0
- package/dist/changed-preflight.js +358 -0
- package/dist/changed-scope.d.ts +112 -0
- package/dist/changed-scope.d.ts.map +1 -0
- package/dist/changed-scope.js +172 -0
- package/dist/changes-summary.d.ts +87 -0
- package/dist/changes-summary.d.ts.map +1 -0
- package/dist/changes-summary.js +323 -0
- package/dist/check-result-v1.d.ts +90 -0
- package/dist/check-result-v1.d.ts.map +1 -0
- package/dist/check-result-v1.js +335 -0
- package/dist/ci-integrity-report.d.ts +38 -0
- package/dist/ci-integrity-report.d.ts.map +1 -0
- package/dist/ci-integrity-report.js +324 -0
- package/dist/ci-permissions-fix.d.ts +38 -0
- package/dist/ci-permissions-fix.d.ts.map +1 -0
- package/dist/ci-permissions-fix.js +382 -0
- package/dist/ci-permissions.d.ts +51 -0
- package/dist/ci-permissions.d.ts.map +1 -0
- package/dist/ci-permissions.js +431 -0
- package/dist/ci-predict.d.ts +42 -0
- package/dist/ci-predict.d.ts.map +1 -0
- package/dist/ci-predict.js +300 -0
- package/dist/ci-scaffold.d.ts +47 -0
- package/dist/ci-scaffold.d.ts.map +1 -0
- package/dist/ci-scaffold.js +638 -0
- package/dist/codemod-assist.d.ts +97 -0
- package/dist/codemod-assist.d.ts.map +1 -0
- package/dist/codemod-assist.js +261 -0
- package/dist/command-recommender.d.ts +25 -0
- package/dist/command-recommender.d.ts.map +1 -0
- package/dist/command-recommender.js +145 -0
- package/dist/command-suggester.d.ts +61 -0
- package/dist/command-suggester.d.ts.map +1 -0
- package/dist/command-suggester.js +159 -0
- package/dist/command-taxonomy.d.ts +38 -0
- package/dist/command-taxonomy.d.ts.map +1 -0
- package/dist/command-taxonomy.js +164 -0
- package/dist/compliance-evidence.d.ts +58 -0
- package/dist/compliance-evidence.d.ts.map +1 -0
- package/dist/compliance-evidence.js +260 -0
- package/dist/compliance-profiles.d.ts +42 -0
- package/dist/compliance-profiles.d.ts.map +1 -0
- package/dist/compliance-profiles.js +171 -0
- package/dist/construct-adoption-diff.d.ts +55 -0
- package/dist/construct-adoption-diff.d.ts.map +1 -0
- package/dist/construct-adoption-diff.js +331 -0
- package/dist/construct-adoption.d.ts +71 -0
- package/dist/construct-adoption.d.ts.map +1 -0
- package/dist/construct-adoption.js +331 -0
- package/dist/construct-inference.d.ts +44 -0
- package/dist/construct-inference.d.ts.map +1 -0
- package/dist/construct-inference.js +391 -0
- package/dist/construct-registry.d.ts +32 -0
- package/dist/construct-registry.d.ts.map +1 -0
- package/dist/construct-registry.js +198 -0
- package/dist/contract-file-rule.d.ts +37 -0
- package/dist/contract-file-rule.d.ts.map +1 -0
- package/dist/contract-file-rule.js +99 -0
- package/dist/contract-template-registry.d.ts +28 -0
- package/dist/contract-template-registry.d.ts.map +1 -0
- package/dist/contract-template-registry.js +161 -0
- package/dist/contradictions.d.ts +52 -0
- package/dist/contradictions.d.ts.map +1 -0
- package/dist/contradictions.js +391 -0
- package/dist/convention-registry.d.ts +44 -0
- package/dist/convention-registry.d.ts.map +1 -0
- package/dist/convention-registry.js +195 -0
- package/dist/coverage-report.d.ts +25 -0
- package/dist/coverage-report.d.ts.map +1 -0
- package/dist/coverage-report.js +190 -0
- package/dist/custom-checks.d.ts +146 -0
- package/dist/custom-checks.d.ts.map +1 -0
- package/dist/custom-checks.js +260 -0
- package/dist/dashboard/dashboard-data.d.ts +59 -0
- package/dist/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/dashboard/dashboard-data.js +653 -0
- package/dist/dashboard-export.d.ts +67 -0
- package/dist/dashboard-export.d.ts.map +1 -0
- package/dist/dashboard-export.js +203 -0
- package/dist/decision-records.d.ts +47 -0
- package/dist/decision-records.d.ts.map +1 -0
- package/dist/decision-records.js +255 -0
- package/dist/demo-package.d.ts +49 -0
- package/dist/demo-package.d.ts.map +1 -0
- package/dist/demo-package.js +305 -0
- package/dist/demo-script.d.ts +25 -0
- package/dist/demo-script.d.ts.map +1 -0
- package/dist/demo-script.js +198 -0
- package/dist/demo-workflow.d.ts +28 -0
- package/dist/demo-workflow.d.ts.map +1 -0
- package/dist/demo-workflow.js +178 -0
- package/dist/dev-cycle.d.ts +41 -0
- package/dist/dev-cycle.d.ts.map +1 -0
- package/dist/dev-cycle.js +94 -0
- package/dist/dev-session-html.d.ts +13 -0
- package/dist/dev-session-html.d.ts.map +1 -0
- package/dist/dev-session-html.js +223 -0
- package/dist/dev-session-report.d.ts +11 -0
- package/dist/dev-session-report.d.ts.map +1 -0
- package/dist/dev-session-report.js +206 -0
- package/dist/dev-session.d.ts +257 -0
- package/dist/dev-session.d.ts.map +1 -0
- package/dist/dev-session.js +568 -0
- package/dist/diagnostics-suggest.d.ts +17 -0
- package/dist/diagnostics-suggest.d.ts.map +1 -0
- package/dist/diagnostics-suggest.js +69 -0
- package/dist/docs-check.d.ts +40 -0
- package/dist/docs-check.d.ts.map +1 -0
- package/dist/docs-check.js +221 -0
- package/dist/doctor-acknowledgements.d.ts +69 -0
- package/dist/doctor-acknowledgements.d.ts.map +1 -0
- package/dist/doctor-acknowledgements.js +150 -0
- package/dist/doctor-result.d.ts +51 -0
- package/dist/doctor-result.d.ts.map +1 -0
- package/dist/doctor-result.js +7 -0
- package/dist/doctor-suppressions.d.ts +91 -0
- package/dist/doctor-suppressions.d.ts.map +1 -0
- package/dist/doctor-suppressions.js +238 -0
- package/dist/drift-baseline.d.ts +29 -0
- package/dist/drift-baseline.d.ts.map +1 -0
- package/dist/drift-baseline.js +80 -0
- package/dist/drift.d.ts +38 -0
- package/dist/drift.d.ts.map +1 -0
- package/dist/drift.js +107 -0
- package/dist/entrypoint-matrix.d.ts +61 -0
- package/dist/entrypoint-matrix.d.ts.map +1 -0
- package/dist/entrypoint-matrix.js +221 -0
- package/dist/examples-check.d.ts +36 -0
- package/dist/examples-check.d.ts.map +1 -0
- package/dist/examples-check.js +168 -0
- package/dist/execution-graph.d.ts +98 -0
- package/dist/execution-graph.d.ts.map +1 -0
- package/dist/execution-graph.js +484 -0
- package/dist/export-bundle.d.ts +10 -0
- package/dist/export-bundle.d.ts.map +1 -0
- package/dist/export-bundle.js +90 -0
- package/dist/failure-diagnostics.d.ts +63 -0
- package/dist/failure-diagnostics.d.ts.map +1 -0
- package/dist/failure-diagnostics.js +243 -0
- package/dist/feature-bundle.d.ts +111 -0
- package/dist/feature-bundle.d.ts.map +1 -0
- package/dist/feature-bundle.js +211 -0
- package/dist/feedback-actions-v2.d.ts +65 -0
- package/dist/feedback-actions-v2.d.ts.map +1 -0
- package/dist/feedback-actions-v2.js +183 -0
- package/dist/feedback-ingestion.d.ts +96 -0
- package/dist/feedback-ingestion.d.ts.map +1 -0
- package/dist/feedback-ingestion.js +400 -0
- package/dist/fix-preview.d.ts +82 -0
- package/dist/fix-preview.d.ts.map +1 -0
- package/dist/fix-preview.js +365 -0
- package/dist/fuzzy-impact.d.ts +50 -0
- package/dist/fuzzy-impact.d.ts.map +1 -0
- package/dist/fuzzy-impact.js +446 -0
- package/dist/generated-code.d.ts +97 -0
- package/dist/generated-code.d.ts.map +1 -0
- package/dist/generated-code.js +395 -0
- package/dist/git-helpers.d.ts +38 -0
- package/dist/git-helpers.d.ts.map +1 -0
- package/dist/git-helpers.js +173 -0
- package/dist/golden-output.d.ts +33 -0
- package/dist/golden-output.d.ts.map +1 -0
- package/dist/golden-output.js +92 -0
- package/dist/grounding/build-grounding.d.ts +53 -0
- package/dist/grounding/build-grounding.d.ts.map +1 -0
- package/dist/grounding/build-grounding.js +51 -0
- package/dist/grounding/nx-projects.d.ts +29 -0
- package/dist/grounding/nx-projects.d.ts.map +1 -0
- package/dist/grounding/nx-projects.js +109 -0
- package/dist/grounding/validate-extracted-plan.d.ts +20 -0
- package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
- package/dist/grounding/validate-extracted-plan.js +127 -0
- package/dist/healing-plan.d.ts +33 -0
- package/dist/healing-plan.d.ts.map +1 -0
- package/dist/healing-plan.js +346 -0
- package/dist/helper-registry.d.ts +90 -0
- package/dist/helper-registry.d.ts.map +1 -0
- package/dist/helper-registry.js +529 -0
- package/dist/impact-analysis.d.ts +150 -0
- package/dist/impact-analysis.d.ts.map +1 -0
- package/dist/impact-analysis.js +697 -0
- package/dist/impact-graph-render.d.ts +51 -0
- package/dist/impact-graph-render.d.ts.map +1 -0
- package/dist/impact-graph-render.js +139 -0
- package/dist/impact-graph.d.ts +17 -0
- package/dist/impact-graph.d.ts.map +1 -0
- package/dist/impact-graph.js +119 -0
- package/dist/impact-render.d.ts +22 -0
- package/dist/impact-render.d.ts.map +1 -0
- package/dist/impact-render.js +422 -0
- package/dist/import-graph-analysis.d.ts +28 -0
- package/dist/import-graph-analysis.d.ts.map +1 -0
- package/dist/import-graph-analysis.js +193 -0
- package/dist/import-hygiene.d.ts +93 -0
- package/dist/import-hygiene.d.ts.map +1 -0
- package/dist/import-hygiene.js +366 -0
- package/dist/index.d.ts +224 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +234 -0
- package/dist/ingest-adoption.d.ts +50 -0
- package/dist/ingest-adoption.d.ts.map +1 -0
- package/dist/ingest-adoption.js +183 -0
- package/dist/ingest-apply.d.ts +80 -0
- package/dist/ingest-apply.d.ts.map +1 -0
- package/dist/ingest-apply.js +227 -0
- package/dist/ingest-body-extractor.d.ts +28 -0
- package/dist/ingest-body-extractor.d.ts.map +1 -0
- package/dist/ingest-body-extractor.js +129 -0
- package/dist/ingest-drafts.d.ts +16 -0
- package/dist/ingest-drafts.d.ts.map +1 -0
- package/dist/ingest-drafts.js +482 -0
- package/dist/inspector-cache.d.ts +41 -0
- package/dist/inspector-cache.d.ts.map +1 -0
- package/dist/inspector-cache.js +104 -0
- package/dist/install-smoke.d.ts +44 -0
- package/dist/install-smoke.d.ts.map +1 -0
- package/dist/install-smoke.js +31 -0
- package/dist/knowledge-authoring.d.ts +151 -0
- package/dist/knowledge-authoring.d.ts.map +1 -0
- package/dist/knowledge-authoring.js +586 -0
- package/dist/knowledge-graph.d.ts +76 -0
- package/dist/knowledge-graph.d.ts.map +1 -0
- package/dist/knowledge-graph.js +336 -0
- package/dist/knowledge-lint.d.ts +97 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +302 -0
- package/dist/knowledge-rename.d.ts +38 -0
- package/dist/knowledge-rename.d.ts.map +1 -0
- package/dist/knowledge-rename.js +88 -0
- package/dist/knowledge-stale.d.ts +124 -0
- package/dist/knowledge-stale.d.ts.map +1 -0
- package/dist/knowledge-stale.js +892 -0
- package/dist/languages/command-inference.d.ts +27 -0
- package/dist/languages/command-inference.d.ts.map +1 -0
- package/dist/languages/command-inference.js +214 -0
- package/dist/languages/dependency-scan.d.ts +33 -0
- package/dist/languages/dependency-scan.d.ts.map +1 -0
- package/dist/languages/dependency-scan.js +343 -0
- package/dist/languages/index.d.ts +14 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +13 -0
- package/dist/languages/language-boundaries.d.ts +30 -0
- package/dist/languages/language-boundaries.d.ts.map +1 -0
- package/dist/languages/language-boundaries.js +176 -0
- package/dist/languages/language-cache.d.ts +54 -0
- package/dist/languages/language-cache.d.ts.map +1 -0
- package/dist/languages/language-cache.js +236 -0
- package/dist/languages/language-detection.d.ts +30 -0
- package/dist/languages/language-detection.d.ts.map +1 -0
- package/dist/languages/language-detection.js +584 -0
- package/dist/languages/language-id.d.ts +15 -0
- package/dist/languages/language-id.d.ts.map +1 -0
- package/dist/languages/language-id.js +15 -0
- package/dist/languages/language-runner.d.ts +90 -0
- package/dist/languages/language-runner.d.ts.map +1 -0
- package/dist/languages/language-runner.js +346 -0
- package/dist/languages/polyglot-boundary.d.ts +80 -0
- package/dist/languages/polyglot-boundary.d.ts.map +1 -0
- package/dist/languages/polyglot-boundary.js +373 -0
- package/dist/languages/polyglot-ci.d.ts +25 -0
- package/dist/languages/polyglot-ci.d.ts.map +1 -0
- package/dist/languages/polyglot-ci.js +278 -0
- package/dist/languages/test-impact.d.ts +19 -0
- package/dist/languages/test-impact.d.ts.map +1 -0
- package/dist/languages/test-impact.js +157 -0
- package/dist/loader-diagnostics.d.ts +40 -0
- package/dist/loader-diagnostics.d.ts.map +1 -0
- package/dist/loader-diagnostics.js +49 -0
- package/dist/memory-diff.d.ts +60 -0
- package/dist/memory-diff.d.ts.map +1 -0
- package/dist/memory-diff.js +302 -0
- package/dist/migration-profile-registry.d.ts +26 -0
- package/dist/migration-profile-registry.d.ts.map +1 -0
- package/dist/migration-profile-registry.js +135 -0
- package/dist/migration-readiness.d.ts +101 -0
- package/dist/migration-readiness.d.ts.map +1 -0
- package/dist/migration-readiness.js +253 -0
- package/dist/monorepo-onboarding.d.ts +51 -0
- package/dist/monorepo-onboarding.d.ts.map +1 -0
- package/dist/monorepo-onboarding.js +235 -0
- package/dist/onboarding-adoption-diff.d.ts +53 -0
- package/dist/onboarding-adoption-diff.d.ts.map +1 -0
- package/dist/onboarding-adoption-diff.js +285 -0
- package/dist/onboarding-adoption.d.ts +136 -0
- package/dist/onboarding-adoption.d.ts.map +1 -0
- package/dist/onboarding-adoption.js +702 -0
- package/dist/onboarding-agent-import.d.ts +40 -0
- package/dist/onboarding-agent-import.d.ts.map +1 -0
- package/dist/onboarding-agent-import.js +114 -0
- package/dist/onboarding-diff.d.ts +39 -0
- package/dist/onboarding-diff.d.ts.map +1 -0
- package/dist/onboarding-diff.js +240 -0
- package/dist/onboarding-drafts-merge.d.ts +71 -0
- package/dist/onboarding-drafts-merge.d.ts.map +1 -0
- package/dist/onboarding-drafts-merge.js +174 -0
- package/dist/onboarding-drafts.d.ts +42 -0
- package/dist/onboarding-drafts.d.ts.map +1 -0
- package/dist/onboarding-drafts.js +268 -0
- package/dist/onboarding-report.d.ts +8 -0
- package/dist/onboarding-report.d.ts.map +1 -0
- package/dist/onboarding-report.js +239 -0
- package/dist/onboarding.d.ts +134 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +729 -0
- package/dist/ownership.d.ts +38 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +102 -0
- package/dist/pack-author-ux.d.ts +58 -0
- package/dist/pack-author-ux.d.ts.map +1 -0
- package/dist/pack-author-ux.js +219 -0
- package/dist/pack-author.d.ts +94 -0
- package/dist/pack-author.d.ts.map +1 -0
- package/dist/pack-author.js +208 -0
- package/dist/pack-compatibility.d.ts +21 -0
- package/dist/pack-compatibility.d.ts.map +1 -0
- package/dist/pack-compatibility.js +114 -0
- package/dist/pack-contributions-inventory.d.ts +121 -0
- package/dist/pack-contributions-inventory.d.ts.map +1 -0
- package/dist/pack-contributions-inventory.js +732 -0
- package/dist/pack-docs.d.ts +11 -0
- package/dist/pack-docs.d.ts.map +1 -0
- package/dist/pack-docs.js +101 -0
- package/dist/pack-doctor.d.ts +50 -0
- package/dist/pack-doctor.d.ts.map +1 -0
- package/dist/pack-doctor.js +302 -0
- package/dist/pack-helper-registry.d.ts +29 -0
- package/dist/pack-helper-registry.d.ts.map +1 -0
- package/dist/pack-helper-registry.js +144 -0
- package/dist/pack-pending.d.ts +68 -0
- package/dist/pack-pending.d.ts.map +1 -0
- package/dist/pack-pending.js +189 -0
- package/dist/pack-quality-score.d.ts +44 -0
- package/dist/pack-quality-score.d.ts.map +1 -0
- package/dist/pack-quality-score.js +155 -0
- package/dist/pack-release-check.d.ts +24 -0
- package/dist/pack-release-check.d.ts.map +1 -0
- package/dist/pack-release-check.js +258 -0
- package/dist/pack-signature-status.d.ts +72 -0
- package/dist/pack-signature-status.d.ts.map +1 -0
- package/dist/pack-signature-status.js +222 -0
- package/dist/pack-symbol-compat.d.ts +73 -0
- package/dist/pack-symbol-compat.d.ts.map +1 -0
- package/dist/pack-symbol-compat.js +519 -0
- package/dist/pack-test-runner.d.ts +59 -0
- package/dist/pack-test-runner.d.ts.map +1 -0
- package/dist/pack-test-runner.js +211 -0
- package/dist/pipeline-command-dictionary.d.ts +2 -0
- package/dist/pipeline-command-dictionary.d.ts.map +1 -0
- package/dist/pipeline-command-dictionary.js +20 -0
- package/dist/pipeline-lint.d.ts +30 -0
- package/dist/pipeline-lint.d.ts.map +1 -0
- package/dist/pipeline-lint.js +134 -0
- package/dist/plan-dependency-graph.d.ts +25 -0
- package/dist/plan-dependency-graph.d.ts.map +1 -0
- package/dist/plan-dependency-graph.js +195 -0
- package/dist/plan-review.d.ts +64 -0
- package/dist/plan-review.d.ts.map +1 -0
- package/dist/plan-review.js +242 -0
- package/dist/plan-simulation.d.ts +108 -0
- package/dist/plan-simulation.d.ts.map +1 -0
- package/dist/plan-simulation.js +767 -0
- package/dist/playbook-registry.d.ts +25 -0
- package/dist/playbook-registry.d.ts.map +1 -0
- package/dist/playbook-registry.js +148 -0
- package/dist/playbook-script.d.ts +60 -0
- package/dist/playbook-script.d.ts.map +1 -0
- package/dist/playbook-script.js +161 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
- package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
- package/dist/plugin-lifecycle-profile-registry.js +202 -0
- package/dist/plugin-lifecycle.d.ts +132 -0
- package/dist/plugin-lifecycle.d.ts.map +1 -0
- package/dist/plugin-lifecycle.js +477 -0
- package/dist/policy-engine.d.ts +101 -0
- package/dist/policy-engine.d.ts.map +1 -0
- package/dist/policy-engine.js +321 -0
- package/dist/policy-override-audit.d.ts +18 -0
- package/dist/policy-override-audit.d.ts.map +1 -0
- package/dist/policy-override-audit.js +54 -0
- package/dist/policy-overrides.d.ts +35 -0
- package/dist/policy-overrides.d.ts.map +1 -0
- package/dist/policy-overrides.js +84 -0
- package/dist/policy-test.d.ts +83 -0
- package/dist/policy-test.d.ts.map +1 -0
- package/dist/policy-test.js +342 -0
- package/dist/pr-summary.d.ts +34 -0
- package/dist/pr-summary.d.ts.map +1 -0
- package/dist/pr-summary.js +220 -0
- package/dist/product-coherence.d.ts +21 -0
- package/dist/product-coherence.d.ts.map +1 -0
- package/dist/product-coherence.js +158 -0
- package/dist/profile-registry.d.ts +42 -0
- package/dist/profile-registry.d.ts.map +1 -0
- package/dist/profile-registry.js +104 -0
- package/dist/project-coupling-audit.d.ts +64 -0
- package/dist/project-coupling-audit.d.ts.map +1 -0
- package/dist/project-coupling-audit.js +282 -0
- package/dist/project-overview.d.ts +14 -0
- package/dist/project-overview.d.ts.map +1 -0
- package/dist/project-overview.js +27 -0
- package/dist/propose-knowledge.d.ts +64 -0
- package/dist/propose-knowledge.d.ts.map +1 -0
- package/dist/propose-knowledge.js +367 -0
- package/dist/quality-baseline.d.ts +123 -0
- package/dist/quality-baseline.d.ts.map +1 -0
- package/dist/quality-baseline.js +433 -0
- package/dist/quality-html.d.ts +7 -0
- package/dist/quality-html.d.ts.map +1 -0
- package/dist/quality-html.js +64 -0
- package/dist/quality-report.d.ts +49 -0
- package/dist/quality-report.d.ts.map +1 -0
- package/dist/quality-report.js +296 -0
- package/dist/query-resolver.d.ts +38 -0
- package/dist/query-resolver.d.ts.map +1 -0
- package/dist/query-resolver.js +163 -0
- package/dist/ranker-explainability.d.ts +91 -0
- package/dist/ranker-explainability.d.ts.map +1 -0
- package/dist/ranker-explainability.js +550 -0
- package/dist/reference-lookup.d.ts +8 -0
- package/dist/reference-lookup.d.ts.map +1 -0
- package/dist/reference-lookup.js +18 -0
- package/dist/registration-hint-registry.d.ts +55 -0
- package/dist/registration-hint-registry.d.ts.map +1 -0
- package/dist/registration-hint-registry.js +327 -0
- package/dist/registry-lifecycle.d.ts +47 -0
- package/dist/registry-lifecycle.d.ts.map +1 -0
- package/dist/registry-lifecycle.js +214 -0
- package/dist/release-readiness.d.ts +64 -0
- package/dist/release-readiness.d.ts.map +1 -0
- package/dist/release-readiness.js +456 -0
- package/dist/release-smoke.d.ts +138 -0
- package/dist/release-smoke.d.ts.map +1 -0
- package/dist/release-smoke.js +459 -0
- package/dist/release-train.d.ts +33 -0
- package/dist/release-train.d.ts.map +1 -0
- package/dist/release-train.js +104 -0
- package/dist/repo-memory.d.ts +95 -0
- package/dist/repo-memory.d.ts.map +1 -0
- package/dist/repo-memory.js +614 -0
- package/dist/report-site.d.ts +92 -0
- package/dist/report-site.d.ts.map +1 -0
- package/dist/report-site.js +658 -0
- package/dist/reposet.d.ts +56 -0
- package/dist/reposet.d.ts.map +1 -0
- package/dist/reposet.js +160 -0
- package/dist/repository-intelligence.d.ts +145 -0
- package/dist/repository-intelligence.d.ts.map +1 -0
- package/dist/repository-intelligence.js +729 -0
- package/dist/repository-knowledge-model.d.ts +218 -0
- package/dist/repository-knowledge-model.d.ts.map +1 -0
- package/dist/repository-knowledge-model.js +939 -0
- package/dist/repository-map.d.ts +72 -0
- package/dist/repository-map.d.ts.map +1 -0
- package/dist/repository-map.js +332 -0
- package/dist/repository-stats.d.ts +66 -0
- package/dist/repository-stats.d.ts.map +1 -0
- package/dist/repository-stats.js +329 -0
- package/dist/review-comment-renderer.d.ts +59 -0
- package/dist/review-comment-renderer.d.ts.map +1 -0
- package/dist/review-comment-renderer.js +181 -0
- package/dist/review-comment-v2.d.ts +9 -0
- package/dist/review-comment-v2.d.ts.map +1 -0
- package/dist/review-comment-v2.js +178 -0
- package/dist/review-html.d.ts +13 -0
- package/dist/review-html.d.ts.map +1 -0
- package/dist/review-html.js +79 -0
- package/dist/review-packet-v2.d.ts +29 -0
- package/dist/review-packet-v2.d.ts.map +1 -0
- package/dist/review-packet-v2.js +81 -0
- package/dist/review-packet-v3.d.ts +22 -0
- package/dist/review-packet-v3.d.ts.map +1 -0
- package/dist/review-packet-v3.js +181 -0
- package/dist/review-packet.d.ts +49 -0
- package/dist/review-packet.d.ts.map +1 -0
- package/dist/review-packet.js +129 -0
- package/dist/risk-signals.d.ts +28 -0
- package/dist/risk-signals.d.ts.map +1 -0
- package/dist/risk-signals.js +68 -0
- package/dist/role-views.d.ts +50 -0
- package/dist/role-views.d.ts.map +1 -0
- package/dist/role-views.js +334 -0
- package/dist/rounds.d.ts +52 -0
- package/dist/rounds.d.ts.map +1 -0
- package/dist/rounds.js +172 -0
- package/dist/rule-drift.d.ts +42 -0
- package/dist/rule-drift.d.ts.map +1 -0
- package/dist/rule-drift.js +148 -0
- package/dist/rule-quality.d.ts +73 -0
- package/dist/rule-quality.d.ts.map +1 -0
- package/dist/rule-quality.js +356 -0
- package/dist/rule-scaffold.d.ts +71 -0
- package/dist/rule-scaffold.d.ts.map +1 -0
- package/dist/rule-scaffold.js +258 -0
- package/dist/safety-audit-deep.d.ts +38 -0
- package/dist/safety-audit-deep.d.ts.map +1 -0
- package/dist/safety-audit-deep.js +162 -0
- package/dist/safety-audit.d.ts +91 -0
- package/dist/safety-audit.d.ts.map +1 -0
- package/dist/safety-audit.js +138 -0
- package/dist/safety-html.d.ts +7 -0
- package/dist/safety-html.d.ts.map +1 -0
- package/dist/safety-html.js +70 -0
- package/dist/scaffold-coverage.d.ts +46 -0
- package/dist/scaffold-coverage.d.ts.map +1 -0
- package/dist/scaffold-coverage.js +273 -0
- package/dist/scaffold-patterns.d.ts +38 -0
- package/dist/scaffold-patterns.d.ts.map +1 -0
- package/dist/scaffold-patterns.js +282 -0
- package/dist/schema-inventory.d.ts +55 -0
- package/dist/schema-inventory.d.ts.map +1 -0
- package/dist/schema-inventory.js +301 -0
- package/dist/search-index.d.ts +75 -0
- package/dist/search-index.d.ts.map +1 -0
- package/dist/search-index.js +531 -0
- package/dist/search-tuning-explain.d.ts +68 -0
- package/dist/search-tuning-explain.d.ts.map +1 -0
- package/dist/search-tuning-explain.js +207 -0
- package/dist/search-tuning-registry.d.ts +54 -0
- package/dist/search-tuning-registry.d.ts.map +1 -0
- package/dist/search-tuning-registry.js +303 -0
- package/dist/self-audit.d.ts +59 -0
- package/dist/self-audit.d.ts.map +1 -0
- package/dist/self-audit.js +192 -0
- package/dist/self-config-doctor-v2.d.ts +57 -0
- package/dist/self-config-doctor-v2.d.ts.map +1 -0
- package/dist/self-config-doctor-v2.js +653 -0
- package/dist/self-config-doctor.d.ts +47 -0
- package/dist/self-config-doctor.d.ts.map +1 -0
- package/dist/self-config-doctor.js +432 -0
- package/dist/sharkcraft-inspector.d.ts +73 -0
- package/dist/sharkcraft-inspector.d.ts.map +1 -0
- package/dist/sharkcraft-inspector.js +745 -0
- package/dist/spec/spec-cross-validate.d.ts +17 -0
- package/dist/spec/spec-cross-validate.d.ts.map +1 -0
- package/dist/spec/spec-cross-validate.js +53 -0
- package/dist/spec/spec-discovery.d.ts +27 -0
- package/dist/spec/spec-discovery.d.ts.map +1 -0
- package/dist/spec/spec-discovery.js +78 -0
- package/dist/spec/spec-review.d.ts +36 -0
- package/dist/spec/spec-review.d.ts.map +1 -0
- package/dist/spec/spec-review.js +37 -0
- package/dist/stability-map.d.ts +62 -0
- package/dist/stability-map.d.ts.map +1 -0
- package/dist/stability-map.js +404 -0
- package/dist/start-here.d.ts +49 -0
- package/dist/start-here.d.ts.map +1 -0
- package/dist/start-here.js +259 -0
- package/dist/surface-profile-detect.d.ts +42 -0
- package/dist/surface-profile-detect.d.ts.map +1 -0
- package/dist/surface-profile-detect.js +76 -0
- package/dist/symbol-index.d.ts +108 -0
- package/dist/symbol-index.d.ts.map +1 -0
- package/dist/symbol-index.js +483 -0
- package/dist/task-decompose.d.ts +38 -0
- package/dist/task-decompose.d.ts.map +1 -0
- package/dist/task-decompose.js +154 -0
- package/dist/task-packet.d.ts +104 -0
- package/dist/task-packet.d.ts.map +1 -0
- package/dist/task-packet.js +156 -0
- package/dist/task-ranker.d.ts +51 -0
- package/dist/task-ranker.d.ts.map +1 -0
- package/dist/task-ranker.js +410 -0
- package/dist/task-risk.d.ts +84 -0
- package/dist/task-risk.d.ts.map +1 -0
- package/dist/task-risk.js +731 -0
- package/dist/task-routing-hint-registry.d.ts +36 -0
- package/dist/task-routing-hint-registry.d.ts.map +1 -0
- package/dist/task-routing-hint-registry.js +186 -0
- package/dist/template-authoring.d.ts +113 -0
- package/dist/template-authoring.d.ts.map +1 -0
- package/dist/template-authoring.js +521 -0
- package/dist/template-body-inference-v2.d.ts +19 -0
- package/dist/template-body-inference-v2.d.ts.map +1 -0
- package/dist/template-body-inference-v2.js +468 -0
- package/dist/template-body-inference.d.ts +59 -0
- package/dist/template-body-inference.d.ts.map +1 -0
- package/dist/template-body-inference.js +277 -0
- package/dist/template-drift.d.ts +39 -0
- package/dist/template-drift.d.ts.map +1 -0
- package/dist/template-drift.js +353 -0
- package/dist/template-lint.d.ts +31 -0
- package/dist/template-lint.d.ts.map +1 -0
- package/dist/template-lint.js +113 -0
- package/dist/test-definitions.d.ts +41 -0
- package/dist/test-definitions.d.ts.map +1 -0
- package/dist/test-definitions.js +6 -0
- package/dist/test-impact.d.ts +30 -0
- package/dist/test-impact.d.ts.map +1 -0
- package/dist/test-impact.js +173 -0
- package/dist/test-runner.d.ts +87 -0
- package/dist/test-runner.d.ts.map +1 -0
- package/dist/test-runner.js +560 -0
- package/dist/uncertainty-report.d.ts +46 -0
- package/dist/uncertainty-report.d.ts.map +1 -0
- package/dist/uncertainty-report.js +108 -0
- package/dist/uncertainty.d.ts +38 -0
- package/dist/uncertainty.d.ts.map +1 -0
- package/dist/uncertainty.js +115 -0
- package/dist/universal-search.d.ts +64 -0
- package/dist/universal-search.d.ts.map +1 -0
- package/dist/universal-search.js +347 -0
- package/dist/upgrade-advisor.d.ts +22 -0
- package/dist/upgrade-advisor.d.ts.map +1 -0
- package/dist/upgrade-advisor.js +109 -0
- package/dist/why-file.d.ts +75 -0
- package/dist/why-file.d.ts.map +1 -0
- package/dist/why-file.js +202 -0
- package/dist/workflow-simulation.d.ts +46 -0
- package/dist/workflow-simulation.d.ts.map +1 -0
- package/dist/workflow-simulation.js +154 -0
- package/package.json +65 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
/**
|
|
3
|
+
* CI workflow permissions audit.
|
|
4
|
+
*
|
|
5
|
+
* Reads a workflow YAML and produces a structured assessment of:
|
|
6
|
+
* - which write scopes the workflow requests,
|
|
7
|
+
* - whether the workflow posts comments,
|
|
8
|
+
* - whether it uses external actions or container images,
|
|
9
|
+
* - whether it uploads artifacts,
|
|
10
|
+
* - a least-privilege recommendation.
|
|
11
|
+
*
|
|
12
|
+
* The audit is intentionally regex-based — no YAML parser, no network
|
|
13
|
+
* resolution. The goal is "deterministic explanation of what this file
|
|
14
|
+
* implies", not full schema validation.
|
|
15
|
+
*/
|
|
16
|
+
export const CI_PERMISSIONS_AUDIT_SCHEMA = 'sharkcraft.ci-permissions-audit/v1';
|
|
17
|
+
const PROVIDER_HINT_FILES = {
|
|
18
|
+
'github-actions': /\.github\/workflows\/[^/]+\.ya?ml$/i,
|
|
19
|
+
gitlab: /\.gitlab-ci\.ya?ml$|\.gitlab\/[^/]+\.ya?ml$/i,
|
|
20
|
+
bitbucket: /bitbucket-pipelines\.ya?ml$/i,
|
|
21
|
+
azure: /azure-pipelines\.ya?ml$|azure-pipelines.*\.ya?ml$/i,
|
|
22
|
+
jenkins: /Jenkinsfile$/,
|
|
23
|
+
};
|
|
24
|
+
function detectProvider(file, override) {
|
|
25
|
+
if (override)
|
|
26
|
+
return override;
|
|
27
|
+
for (const [p, re] of Object.entries(PROVIDER_HINT_FILES)) {
|
|
28
|
+
if (re.test(file))
|
|
29
|
+
return p;
|
|
30
|
+
}
|
|
31
|
+
return 'github-actions';
|
|
32
|
+
}
|
|
33
|
+
function findLines(body, re) {
|
|
34
|
+
const hits = [];
|
|
35
|
+
const lines = body.split(/\r?\n/);
|
|
36
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
37
|
+
const m = re.exec(lines[i]);
|
|
38
|
+
if (m)
|
|
39
|
+
hits.push({ line: i + 1, match: m[0] });
|
|
40
|
+
}
|
|
41
|
+
return hits;
|
|
42
|
+
}
|
|
43
|
+
function findAllExternalActions(body) {
|
|
44
|
+
const found = new Set();
|
|
45
|
+
// `- uses: actions/checkout@v4` or `uses: org/action@hash`
|
|
46
|
+
for (const hit of findLines(body, /uses:\s*([\w\-]+\/[\w\-./]+@[\w.\-]+)/)) {
|
|
47
|
+
const m = /uses:\s*([^\s]+)/.exec(hit.match);
|
|
48
|
+
if (m && m[1])
|
|
49
|
+
found.add(m[1]);
|
|
50
|
+
}
|
|
51
|
+
return [...found].sort();
|
|
52
|
+
}
|
|
53
|
+
function findAllExternalImages(body) {
|
|
54
|
+
const found = new Set();
|
|
55
|
+
// GitHub Actions: `container: image: foo/bar:tag` or `services: image:`
|
|
56
|
+
for (const hit of findLines(body, /image:\s*([\w\-./]+(:\S+)?)/)) {
|
|
57
|
+
const m = /image:\s*(\S+)/.exec(hit.match);
|
|
58
|
+
if (m && m[1])
|
|
59
|
+
found.add(m[1]);
|
|
60
|
+
}
|
|
61
|
+
return [...found].sort();
|
|
62
|
+
}
|
|
63
|
+
function detectGithubAudit(body, file) {
|
|
64
|
+
const findings = [];
|
|
65
|
+
const notes = [];
|
|
66
|
+
// permissions block?
|
|
67
|
+
const permsLines = findLines(body, /^\s*permissions:/);
|
|
68
|
+
const writePerm = findLines(body, /^\s*(?:contents|pull-requests|issues|deployments|actions):\s*write\b/);
|
|
69
|
+
if (permsLines.length === 0) {
|
|
70
|
+
findings.push({
|
|
71
|
+
code: 'permissions-block-missing',
|
|
72
|
+
severity: 'info',
|
|
73
|
+
message: 'No top-level `permissions:` block — workflow inherits the repository default. Pinning least-privilege explicitly is safer.',
|
|
74
|
+
lines: [],
|
|
75
|
+
suggestion: 'Add a `permissions:` block scoped to `contents: read`.',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (writePerm.length > 0) {
|
|
79
|
+
findings.push({
|
|
80
|
+
code: 'permissions-write-requested',
|
|
81
|
+
severity: 'warning',
|
|
82
|
+
message: `Workflow requests write scopes on ${writePerm.length} line(s). Confirm each is required.`,
|
|
83
|
+
lines: writePerm.map((h) => h.line),
|
|
84
|
+
suggestion: 'Remove unused write scopes; only enable them on the specific job that needs them.',
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// Comment posting hints — `gh pr comment`, `actions/github-script@`, `peter-evans/create-or-update-comment`.
|
|
88
|
+
const commentHits = [
|
|
89
|
+
...findLines(body, /\bgh\s+pr\s+(comment|review)/),
|
|
90
|
+
...findLines(body, /actions\/github-script@/),
|
|
91
|
+
...findLines(body, /peter-evans\/create-or-update-comment/),
|
|
92
|
+
...findLines(body, /thollander\/actions-comment-pull-request/),
|
|
93
|
+
];
|
|
94
|
+
const postsComments = commentHits.length > 0;
|
|
95
|
+
if (postsComments) {
|
|
96
|
+
findings.push({
|
|
97
|
+
code: 'comment-posting-detected',
|
|
98
|
+
severity: 'warning',
|
|
99
|
+
message: 'Workflow posts PR comments. This requires `pull-requests: write` and a token with that scope.',
|
|
100
|
+
lines: commentHits.map((h) => h.line),
|
|
101
|
+
suggestion: 'Either keep the comment-posting step disabled (recommended for demos) or scope `pull-requests: write` to just that job.',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const tokenHits = findLines(body, /\$\{\{\s*secrets\.(GITHUB_TOKEN|GH_TOKEN)\s*\}\}/);
|
|
105
|
+
if (tokenHits.length > 0) {
|
|
106
|
+
findings.push({
|
|
107
|
+
code: 'token-usage',
|
|
108
|
+
severity: 'info',
|
|
109
|
+
message: 'Workflow uses GITHUB_TOKEN / GH_TOKEN. Make sure the permissions block scopes match the operations.',
|
|
110
|
+
lines: tokenHits.map((h) => h.line),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const externalActions = findAllExternalActions(body);
|
|
114
|
+
const externalImages = findAllExternalImages(body);
|
|
115
|
+
if (externalActions.length > 0) {
|
|
116
|
+
findings.push({
|
|
117
|
+
code: 'external-action',
|
|
118
|
+
severity: 'info',
|
|
119
|
+
message: `Uses ${externalActions.length} external action(s).`,
|
|
120
|
+
lines: [],
|
|
121
|
+
suggestion: 'Pin actions to a specific commit SHA when possible to mitigate supply-chain risk.',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (externalImages.length > 0) {
|
|
125
|
+
findings.push({
|
|
126
|
+
code: 'external-image',
|
|
127
|
+
severity: 'info',
|
|
128
|
+
message: `Uses ${externalImages.length} external container image(s).`,
|
|
129
|
+
lines: [],
|
|
130
|
+
suggestion: 'Pin image digests in supply-chain-sensitive workflows.',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
const uploadsArtifacts = findLines(body, /actions\/upload-artifact@/).length > 0;
|
|
134
|
+
if (uploadsArtifacts) {
|
|
135
|
+
findings.push({
|
|
136
|
+
code: 'artifact-upload',
|
|
137
|
+
severity: 'info',
|
|
138
|
+
message: 'Workflow uploads artifacts via actions/upload-artifact.',
|
|
139
|
+
lines: [],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Recommendation
|
|
143
|
+
const recommendation = postsComments
|
|
144
|
+
? `permissions:\n contents: read\n pull-requests: write # required by the comment-posting step\n`
|
|
145
|
+
: `permissions:\n contents: read # least-privilege default for the SharkCraft review surface\n`;
|
|
146
|
+
if (!postsComments) {
|
|
147
|
+
notes.push('No comment-posting step detected — `pull-requests: write` is NOT required for this workflow.');
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
notes.push('Comment-posting step detected — scope `pull-requests: write` to just the job that needs it.');
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
154
|
+
provider: 'github-actions',
|
|
155
|
+
workflowFile: file,
|
|
156
|
+
exists: true,
|
|
157
|
+
postsComments,
|
|
158
|
+
requestsWritePermissions: writePerm.length > 0,
|
|
159
|
+
usesTokens: tokenHits.length > 0,
|
|
160
|
+
externalActions,
|
|
161
|
+
externalImages,
|
|
162
|
+
uploadsArtifacts,
|
|
163
|
+
findings,
|
|
164
|
+
recommendation,
|
|
165
|
+
notes,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function detectGitlabAudit(body, file) {
|
|
169
|
+
const findings = [];
|
|
170
|
+
const notes = [];
|
|
171
|
+
const commentHits = [
|
|
172
|
+
...findLines(body, /merge_requests\/\$CI_MERGE_REQUEST_IID\/notes/),
|
|
173
|
+
...findLines(body, /\bPRIVATE-TOKEN\b/),
|
|
174
|
+
];
|
|
175
|
+
const postsComments = commentHits.length > 0;
|
|
176
|
+
if (postsComments) {
|
|
177
|
+
findings.push({
|
|
178
|
+
code: 'comment-posting-detected',
|
|
179
|
+
severity: 'warning',
|
|
180
|
+
message: 'Pipeline posts MR comments via the GitLab API.',
|
|
181
|
+
lines: commentHits.map((h) => h.line),
|
|
182
|
+
suggestion: 'Use a PRIVATE-TOKEN with scope api or write_repository — keep the value in a masked CI/CD variable, not the file.',
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
const tokenHits = findLines(body, /\$CI_JOB_TOKEN|\$PRIVATE_TOKEN|\$REVIEW_TOKEN/);
|
|
186
|
+
if (tokenHits.length > 0) {
|
|
187
|
+
findings.push({
|
|
188
|
+
code: 'token-usage',
|
|
189
|
+
severity: 'info',
|
|
190
|
+
message: 'Pipeline uses a CI token / PRIVATE-TOKEN. Scope it to the minimum needed.',
|
|
191
|
+
lines: tokenHits.map((h) => h.line),
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const externalImages = findAllExternalImages(body);
|
|
195
|
+
if (externalImages.length > 0) {
|
|
196
|
+
findings.push({
|
|
197
|
+
code: 'external-image',
|
|
198
|
+
severity: 'info',
|
|
199
|
+
message: `Uses ${externalImages.length} container image(s).`,
|
|
200
|
+
lines: [],
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
const uploadsArtifacts = findLines(body, /artifacts:/).length > 0;
|
|
204
|
+
if (uploadsArtifacts) {
|
|
205
|
+
findings.push({
|
|
206
|
+
code: 'artifact-upload',
|
|
207
|
+
severity: 'info',
|
|
208
|
+
message: 'Pipeline declares `artifacts:` blocks.',
|
|
209
|
+
lines: [],
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
notes.push(postsComments
|
|
213
|
+
? 'Comment-posting step detected — use a CI/CD variable holding a token with `api` scope.'
|
|
214
|
+
: 'No comment-posting step detected — the default $CI_JOB_TOKEN is read-only for repo metadata.');
|
|
215
|
+
const recommendation = postsComments
|
|
216
|
+
? '# Use a masked CI/CD variable named REVIEW_TOKEN with scope api on the project.\n# Avoid Project Access Tokens with owner scope — Reporter+api is enough for notes.'
|
|
217
|
+
: '# No write permissions required; $CI_JOB_TOKEN is sufficient.';
|
|
218
|
+
return {
|
|
219
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
220
|
+
provider: 'gitlab',
|
|
221
|
+
workflowFile: file,
|
|
222
|
+
exists: true,
|
|
223
|
+
postsComments,
|
|
224
|
+
requestsWritePermissions: false,
|
|
225
|
+
usesTokens: tokenHits.length > 0,
|
|
226
|
+
externalActions: [],
|
|
227
|
+
externalImages,
|
|
228
|
+
uploadsArtifacts,
|
|
229
|
+
findings,
|
|
230
|
+
recommendation,
|
|
231
|
+
notes,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function detectBitbucketAudit(body, file) {
|
|
235
|
+
const findings = [];
|
|
236
|
+
const notes = [];
|
|
237
|
+
const commentHits = findLines(body, /pullrequests\/.*\/comments/i);
|
|
238
|
+
const postsComments = commentHits.length > 0;
|
|
239
|
+
if (postsComments) {
|
|
240
|
+
findings.push({
|
|
241
|
+
code: 'comment-posting-detected',
|
|
242
|
+
severity: 'warning',
|
|
243
|
+
message: 'Pipeline posts PR comments via the Bitbucket REST API.',
|
|
244
|
+
lines: commentHits.map((h) => h.line),
|
|
245
|
+
suggestion: 'Use a repository access token with PR write scope — stored as a Pipelines secured variable.',
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
const tokenHits = findLines(body, /\$BITBUCKET_TOKEN|\$BITBUCKET_REPO_ACCESS_TOKEN/);
|
|
249
|
+
if (tokenHits.length > 0) {
|
|
250
|
+
findings.push({
|
|
251
|
+
code: 'token-usage',
|
|
252
|
+
severity: 'info',
|
|
253
|
+
message: 'Pipeline uses a Bitbucket token. Scope it tightly.',
|
|
254
|
+
lines: tokenHits.map((h) => h.line),
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
const externalImages = findAllExternalImages(body);
|
|
258
|
+
if (externalImages.length > 0) {
|
|
259
|
+
findings.push({
|
|
260
|
+
code: 'external-image',
|
|
261
|
+
severity: 'info',
|
|
262
|
+
message: `Uses ${externalImages.length} container image(s).`,
|
|
263
|
+
lines: [],
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
notes.push(postsComments ? 'Comment-posting step detected.' : 'No comment-posting step detected.');
|
|
267
|
+
return {
|
|
268
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
269
|
+
provider: 'bitbucket',
|
|
270
|
+
workflowFile: file,
|
|
271
|
+
exists: true,
|
|
272
|
+
postsComments,
|
|
273
|
+
requestsWritePermissions: false,
|
|
274
|
+
usesTokens: tokenHits.length > 0,
|
|
275
|
+
externalActions: [],
|
|
276
|
+
externalImages,
|
|
277
|
+
uploadsArtifacts: findLines(body, /^\s*artifacts:/m).length > 0,
|
|
278
|
+
findings,
|
|
279
|
+
recommendation: postsComments
|
|
280
|
+
? '# Create a Repository Access Token with `pullrequest:write` scope; store as a Pipelines secured variable.'
|
|
281
|
+
: '# No write permissions required.',
|
|
282
|
+
notes,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function detectAzureAudit(body, file) {
|
|
286
|
+
const findings = [];
|
|
287
|
+
const notes = [];
|
|
288
|
+
const tokenHits = findLines(body, /\$\(System\.AccessToken\)|System\.AccessToken/);
|
|
289
|
+
const usesTokens = tokenHits.length > 0;
|
|
290
|
+
if (usesTokens) {
|
|
291
|
+
findings.push({
|
|
292
|
+
code: 'token-usage',
|
|
293
|
+
severity: 'info',
|
|
294
|
+
message: 'Pipeline uses $(System.AccessToken). Restrict scopes in Project Settings.',
|
|
295
|
+
lines: tokenHits.map((h) => h.line),
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
const uploadsArtifacts = findLines(body, /PublishPipelineArtifact|publish:|UploadPipelineArtifact|publishLocation/).length > 0;
|
|
299
|
+
if (uploadsArtifacts) {
|
|
300
|
+
findings.push({
|
|
301
|
+
code: 'artifact-upload',
|
|
302
|
+
severity: 'info',
|
|
303
|
+
message: 'Pipeline publishes artifacts.',
|
|
304
|
+
lines: [],
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
notes.push('Restrict pipeline scope to read-only repo access; explicitly grant write only on the job that needs it.');
|
|
308
|
+
return {
|
|
309
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
310
|
+
provider: 'azure',
|
|
311
|
+
workflowFile: file,
|
|
312
|
+
exists: true,
|
|
313
|
+
postsComments: false,
|
|
314
|
+
requestsWritePermissions: false,
|
|
315
|
+
usesTokens,
|
|
316
|
+
externalActions: [],
|
|
317
|
+
externalImages: findAllExternalImages(body),
|
|
318
|
+
uploadsArtifacts,
|
|
319
|
+
findings,
|
|
320
|
+
recommendation: '# Use a project-level service connection limited to read scope, plus a dedicated write-scope token only for jobs that need it.',
|
|
321
|
+
notes,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function detectJenkinsAudit(body, file) {
|
|
325
|
+
const findings = [];
|
|
326
|
+
const notes = [];
|
|
327
|
+
const tokenHits = findLines(body, /credentials\(['"]([^'"]+)['"]\)|withCredentials/);
|
|
328
|
+
if (tokenHits.length > 0) {
|
|
329
|
+
findings.push({
|
|
330
|
+
code: 'token-usage',
|
|
331
|
+
severity: 'info',
|
|
332
|
+
message: 'Pipeline uses Jenkins credentials. Make sure they\'re scoped to the right folder/job.',
|
|
333
|
+
lines: tokenHits.map((h) => h.line),
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
const archiveHits = findLines(body, /archiveArtifacts|publishHTML|publishArtifacts/);
|
|
337
|
+
const uploadsArtifacts = archiveHits.length > 0;
|
|
338
|
+
if (uploadsArtifacts) {
|
|
339
|
+
findings.push({
|
|
340
|
+
code: 'artifact-upload',
|
|
341
|
+
severity: 'info',
|
|
342
|
+
message: 'Pipeline archives artifacts.',
|
|
343
|
+
lines: archiveHits.map((h) => h.line),
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
notes.push('No write to source repo is required by the SharkCraft review surface.');
|
|
347
|
+
return {
|
|
348
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
349
|
+
provider: 'jenkins',
|
|
350
|
+
workflowFile: file,
|
|
351
|
+
exists: true,
|
|
352
|
+
postsComments: false,
|
|
353
|
+
requestsWritePermissions: false,
|
|
354
|
+
usesTokens: tokenHits.length > 0,
|
|
355
|
+
externalActions: [],
|
|
356
|
+
externalImages: findAllExternalImages(body),
|
|
357
|
+
uploadsArtifacts,
|
|
358
|
+
findings,
|
|
359
|
+
recommendation: '# Use a Jenkins credential scoped to the folder; never store tokens in the Jenkinsfile itself.',
|
|
360
|
+
notes,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
export function auditCiWorkflow(input) {
|
|
364
|
+
const file = input.file;
|
|
365
|
+
if (!existsSync(file)) {
|
|
366
|
+
return {
|
|
367
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
368
|
+
provider: detectProvider(file, input.provider ?? null),
|
|
369
|
+
workflowFile: file,
|
|
370
|
+
exists: false,
|
|
371
|
+
postsComments: false,
|
|
372
|
+
requestsWritePermissions: false,
|
|
373
|
+
usesTokens: false,
|
|
374
|
+
externalActions: [],
|
|
375
|
+
externalImages: [],
|
|
376
|
+
uploadsArtifacts: false,
|
|
377
|
+
findings: [
|
|
378
|
+
{
|
|
379
|
+
code: 'shell-step',
|
|
380
|
+
severity: 'error',
|
|
381
|
+
message: `Workflow file not found: ${file}`,
|
|
382
|
+
lines: [],
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
recommendation: '',
|
|
386
|
+
notes: [],
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
let body = '';
|
|
390
|
+
try {
|
|
391
|
+
body = readFileSync(file, 'utf8');
|
|
392
|
+
}
|
|
393
|
+
catch (e) {
|
|
394
|
+
return {
|
|
395
|
+
schema: CI_PERMISSIONS_AUDIT_SCHEMA,
|
|
396
|
+
provider: detectProvider(file, input.provider ?? null),
|
|
397
|
+
workflowFile: file,
|
|
398
|
+
exists: true,
|
|
399
|
+
postsComments: false,
|
|
400
|
+
requestsWritePermissions: false,
|
|
401
|
+
usesTokens: false,
|
|
402
|
+
externalActions: [],
|
|
403
|
+
externalImages: [],
|
|
404
|
+
uploadsArtifacts: false,
|
|
405
|
+
findings: [
|
|
406
|
+
{
|
|
407
|
+
code: 'shell-step',
|
|
408
|
+
severity: 'error',
|
|
409
|
+
message: `Failed to read workflow: ${e.message}`,
|
|
410
|
+
lines: [],
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
recommendation: '',
|
|
414
|
+
notes: [],
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
const provider = detectProvider(file, input.provider ?? null);
|
|
418
|
+
switch (provider) {
|
|
419
|
+
case 'gitlab':
|
|
420
|
+
return detectGitlabAudit(body, file);
|
|
421
|
+
case 'bitbucket':
|
|
422
|
+
return detectBitbucketAudit(body, file);
|
|
423
|
+
case 'azure':
|
|
424
|
+
return detectAzureAudit(body, file);
|
|
425
|
+
case 'jenkins':
|
|
426
|
+
return detectJenkinsAudit(body, file);
|
|
427
|
+
case 'github-actions':
|
|
428
|
+
default:
|
|
429
|
+
return detectGithubAudit(body, file);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type IUncertaintyReport } from './uncertainty-report.js';
|
|
2
|
+
export declare const CI_PREDICT_SCHEMA = "sharkcraft.ci-predict/v1";
|
|
3
|
+
export declare enum CiPredictProfileId {
|
|
4
|
+
GithubPr = "github-pr",
|
|
5
|
+
Release = "release",
|
|
6
|
+
Pack = "pack",
|
|
7
|
+
Self = "self"
|
|
8
|
+
}
|
|
9
|
+
export declare enum CiPredictVerdict {
|
|
10
|
+
Pass = "pass",
|
|
11
|
+
Warn = "warn",
|
|
12
|
+
Fail = "fail",
|
|
13
|
+
Unknown = "unknown"
|
|
14
|
+
}
|
|
15
|
+
export interface ICiPredictGate {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly verdict: CiPredictVerdict;
|
|
19
|
+
readonly summary: string;
|
|
20
|
+
readonly report?: string;
|
|
21
|
+
readonly nextCommand?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ICiPredictReport {
|
|
24
|
+
readonly schema: typeof CI_PREDICT_SCHEMA;
|
|
25
|
+
readonly profileId: CiPredictProfileId;
|
|
26
|
+
readonly generatedAt: string;
|
|
27
|
+
readonly verdict: CiPredictVerdict;
|
|
28
|
+
readonly gates: readonly ICiPredictGate[];
|
|
29
|
+
readonly missingReports: readonly string[];
|
|
30
|
+
readonly nextCommands: readonly string[];
|
|
31
|
+
/** Uncertainty report (confidence + signals + safe fallback). */
|
|
32
|
+
readonly uncertainty?: IUncertaintyReport;
|
|
33
|
+
}
|
|
34
|
+
export interface ICiPredictOptions {
|
|
35
|
+
readonly projectRoot: string;
|
|
36
|
+
readonly profileId: CiPredictProfileId;
|
|
37
|
+
readonly reportsDir?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare function buildCiPredictReport(options: ICiPredictOptions): ICiPredictReport;
|
|
40
|
+
export declare function renderCiPredictText(report: ICiPredictReport): string;
|
|
41
|
+
export declare function renderCiPredictMarkdown(report: ICiPredictReport): string;
|
|
42
|
+
//# sourceMappingURL=ci-predict.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-predict.d.ts","sourceRoot":"","sources":["../src/ci-predict.ts"],"names":[],"mappings":"AAUA,OAAO,EAA0B,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE1F,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAE5D,oBAAY,kBAAkB;IAC5B,QAAQ,cAAc;IACtB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,iBAAiB,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,iEAAiE;IACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAC3C;AA0ID,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CA8GjF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAmBpE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgBxE"}
|