@ai-primitives-hub/core 0.2.1 → 0.2.2-next.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/dist/domain/bundle/version.d.ts +13 -0
- package/dist/domain/bundle/version.d.ts.map +1 -1
- package/dist/domain/bundle/version.js +27 -0
- package/dist/domain/bundle/version.js.map +1 -1
- package/dist/domain/collection/apm-release-plan.d.ts +39 -0
- package/dist/domain/collection/apm-release-plan.d.ts.map +1 -0
- package/dist/domain/collection/apm-release-plan.js +185 -0
- package/dist/domain/collection/apm-release-plan.js.map +1 -0
- package/dist/domain/collection/contribution.d.ts +126 -0
- package/dist/domain/collection/contribution.d.ts.map +1 -0
- package/dist/domain/collection/contribution.js +462 -0
- package/dist/domain/collection/contribution.js.map +1 -0
- package/dist/domain/collection/diagnostics.d.ts +166 -0
- package/dist/domain/collection/diagnostics.d.ts.map +1 -0
- package/dist/domain/collection/diagnostics.js +3 -0
- package/dist/domain/collection/diagnostics.js.map +1 -0
- package/dist/domain/collection/manifest-validator.d.ts +3 -2
- package/dist/domain/collection/manifest-validator.d.ts.map +1 -1
- package/dist/domain/collection/manifest-validator.js +99 -17
- package/dist/domain/collection/manifest-validator.js.map +1 -1
- package/dist/domain/collection/release-manifest-plan.d.ts +9 -0
- package/dist/domain/collection/release-manifest-plan.d.ts.map +1 -1
- package/dist/domain/collection/release-manifest-plan.js +45 -14
- package/dist/domain/collection/release-manifest-plan.js.map +1 -1
- package/dist/domain/collection/validate.d.ts +5 -0
- package/dist/domain/collection/validate.d.ts.map +1 -1
- package/dist/domain/collection/validate.js +7 -2
- package/dist/domain/collection/validate.js.map +1 -1
- package/dist/domain/diagnostics/primitives/catalogue.d.ts +40 -0
- package/dist/domain/diagnostics/primitives/catalogue.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/catalogue.js +78 -0
- package/dist/domain/diagnostics/primitives/catalogue.js.map +1 -0
- package/dist/domain/diagnostics/primitives/classifier.d.ts +81 -0
- package/dist/domain/diagnostics/primitives/classifier.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/classifier.js +138 -0
- package/dist/domain/diagnostics/primitives/classifier.js.map +1 -0
- package/dist/domain/diagnostics/primitives/evaluators.d.ts +138 -0
- package/dist/domain/diagnostics/primitives/evaluators.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/evaluators.js +485 -0
- package/dist/domain/diagnostics/primitives/evaluators.js.map +1 -0
- package/dist/domain/diagnostics/primitives/fixture.d.ts +97 -0
- package/dist/domain/diagnostics/primitives/fixture.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/fixture.js +265 -0
- package/dist/domain/diagnostics/primitives/fixture.js.map +1 -0
- package/dist/domain/diagnostics/primitives/index.d.ts +18 -0
- package/dist/domain/diagnostics/primitives/index.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/index.js +34 -0
- package/dist/domain/diagnostics/primitives/index.js.map +1 -0
- package/dist/domain/diagnostics/primitives/known-gaps.d.ts +50 -0
- package/dist/domain/diagnostics/primitives/known-gaps.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/known-gaps.js +148 -0
- package/dist/domain/diagnostics/primitives/known-gaps.js.map +1 -0
- package/dist/domain/diagnostics/primitives/manifest-view.d.ts +28 -0
- package/dist/domain/diagnostics/primitives/manifest-view.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/manifest-view.js +50 -0
- package/dist/domain/diagnostics/primitives/manifest-view.js.map +1 -0
- package/dist/domain/diagnostics/primitives/placements.d.ts +51 -0
- package/dist/domain/diagnostics/primitives/placements.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/placements.js +76 -0
- package/dist/domain/diagnostics/primitives/placements.js.map +1 -0
- package/dist/domain/diagnostics/primitives/planner.d.ts +60 -0
- package/dist/domain/diagnostics/primitives/planner.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/planner.js +60 -0
- package/dist/domain/diagnostics/primitives/planner.js.map +1 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.d.ts +38 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.js +173 -0
- package/dist/domain/diagnostics/primitives/plugin-projection.js.map +1 -0
- package/dist/domain/diagnostics/primitives/report.d.ts +122 -0
- package/dist/domain/diagnostics/primitives/report.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/report.js +85 -0
- package/dist/domain/diagnostics/primitives/report.js.map +1 -0
- package/dist/domain/diagnostics/primitives/sandbox.d.ts +59 -0
- package/dist/domain/diagnostics/primitives/sandbox.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/sandbox.js +193 -0
- package/dist/domain/diagnostics/primitives/sandbox.js.map +1 -0
- package/dist/domain/diagnostics/primitives/support-matrix.d.ts +36 -0
- package/dist/domain/diagnostics/primitives/support-matrix.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/support-matrix.js +69 -0
- package/dist/domain/diagnostics/primitives/support-matrix.js.map +1 -0
- package/dist/domain/diagnostics/primitives/types.d.ts +117 -0
- package/dist/domain/diagnostics/primitives/types.d.ts.map +1 -0
- package/dist/domain/diagnostics/primitives/types.js +62 -0
- package/dist/domain/diagnostics/primitives/types.js.map +1 -0
- package/dist/domain/governance/catalogue.d.ts +11 -0
- package/dist/domain/governance/catalogue.d.ts.map +1 -0
- package/dist/domain/governance/catalogue.js +45 -0
- package/dist/domain/governance/catalogue.js.map +1 -0
- package/dist/domain/governance/effective-rules.d.ts +19 -0
- package/dist/domain/governance/effective-rules.d.ts.map +1 -0
- package/dist/domain/governance/effective-rules.js +49 -0
- package/dist/domain/governance/effective-rules.js.map +1 -0
- package/dist/domain/governance/evaluate.d.ts +16 -0
- package/dist/domain/governance/evaluate.d.ts.map +1 -0
- package/dist/domain/governance/evaluate.js +34 -0
- package/dist/domain/governance/evaluate.js.map +1 -0
- package/dist/domain/governance/hub-scope.d.ts +74 -0
- package/dist/domain/governance/hub-scope.d.ts.map +1 -0
- package/dist/domain/governance/hub-scope.js +202 -0
- package/dist/domain/governance/hub-scope.js.map +1 -0
- package/dist/domain/governance/hub-scoped-inventory.d.ts +22 -0
- package/dist/domain/governance/hub-scoped-inventory.d.ts.map +1 -0
- package/dist/domain/governance/hub-scoped-inventory.js +59 -0
- package/dist/domain/governance/hub-scoped-inventory.js.map +1 -0
- package/dist/domain/governance/index.d.ts +15 -0
- package/dist/domain/governance/index.d.ts.map +1 -0
- package/dist/domain/governance/index.js +31 -0
- package/dist/domain/governance/index.js.map +1 -0
- package/dist/domain/governance/rule-registry.d.ts +20 -0
- package/dist/domain/governance/rule-registry.d.ts.map +1 -0
- package/dist/domain/governance/rule-registry.js +40 -0
- package/dist/domain/governance/rule-registry.js.map +1 -0
- package/dist/domain/governance/rules/collection.d.ts +32 -0
- package/dist/domain/governance/rules/collection.d.ts.map +1 -0
- package/dist/domain/governance/rules/collection.js +153 -0
- package/dist/domain/governance/rules/collection.js.map +1 -0
- package/dist/domain/governance/rules/config.d.ts +15 -0
- package/dist/domain/governance/rules/config.d.ts.map +1 -0
- package/dist/domain/governance/rules/config.js +38 -0
- package/dist/domain/governance/rules/config.js.map +1 -0
- package/dist/domain/governance/rules/hub.d.ts +7 -0
- package/dist/domain/governance/rules/hub.d.ts.map +1 -0
- package/dist/domain/governance/rules/hub.js +10 -0
- package/dist/domain/governance/rules/hub.js.map +1 -0
- package/dist/domain/governance/types.d.ts +70 -0
- package/dist/domain/governance/types.d.ts.map +1 -0
- package/dist/domain/governance/types.js +7 -0
- package/dist/domain/governance/types.js.map +1 -0
- package/dist/domain/hub/diagnostics.d.ts +92 -0
- package/dist/domain/hub/diagnostics.d.ts.map +1 -0
- package/dist/domain/hub/diagnostics.js +11 -0
- package/dist/domain/hub/diagnostics.js.map +1 -0
- package/dist/domain/hub/profile-requirements.d.ts +16 -0
- package/dist/domain/hub/profile-requirements.d.ts.map +1 -0
- package/dist/domain/hub/profile-requirements.js +16 -0
- package/dist/domain/hub/profile-requirements.js.map +1 -0
- package/dist/domain/hub/replicate.d.ts +23 -0
- package/dist/domain/hub/replicate.d.ts.map +1 -1
- package/dist/domain/hub/replicate.js +13 -0
- package/dist/domain/hub/replicate.js.map +1 -1
- package/dist/domain/hub/types.d.ts +2 -0
- package/dist/domain/hub/types.d.ts.map +1 -1
- package/dist/domain/hub/validate.d.ts +150 -2
- package/dist/domain/hub/validate.d.ts.map +1 -1
- package/dist/domain/hub/validate.js +421 -37
- package/dist/domain/hub/validate.js.map +1 -1
- package/dist/domain/index.d.ts +17 -0
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +17 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/install/category.d.ts +31 -0
- package/dist/domain/install/category.d.ts.map +1 -0
- package/dist/domain/install/category.js +33 -0
- package/dist/domain/install/category.js.map +1 -0
- package/dist/domain/install/file-mode.d.ts +49 -0
- package/dist/domain/install/file-mode.d.ts.map +1 -0
- package/dist/domain/install/file-mode.js +54 -0
- package/dist/domain/install/file-mode.js.map +1 -0
- package/dist/domain/install/git-exclude.d.ts +22 -0
- package/dist/domain/install/git-exclude.d.ts.map +1 -0
- package/dist/domain/install/git-exclude.js +56 -0
- package/dist/domain/install/git-exclude.js.map +1 -0
- package/dist/domain/install/installable.d.ts +2 -0
- package/dist/domain/install/installable.d.ts.map +1 -1
- package/dist/domain/install/kind-route.d.ts +80 -0
- package/dist/domain/install/kind-route.d.ts.map +1 -0
- package/dist/domain/install/kind-route.js +135 -0
- package/dist/domain/install/kind-route.js.map +1 -0
- package/dist/domain/install/record-errors.d.ts +53 -0
- package/dist/domain/install/record-errors.d.ts.map +1 -0
- package/dist/domain/install/record-errors.js +104 -0
- package/dist/domain/install/record-errors.js.map +1 -0
- package/dist/domain/install/record-object.d.ts +21 -0
- package/dist/domain/install/record-object.d.ts.map +1 -0
- package/dist/domain/install/record-object.js +38 -0
- package/dist/domain/install/record-object.js.map +1 -0
- package/dist/domain/install/record-parse.d.ts +23 -0
- package/dist/domain/install/record-parse.d.ts.map +1 -0
- package/dist/domain/install/record-parse.js +73 -0
- package/dist/domain/install/record-parse.js.map +1 -0
- package/dist/domain/install/record-path.d.ts +26 -0
- package/dist/domain/install/record-path.d.ts.map +1 -0
- package/dist/domain/install/record-path.js +130 -0
- package/dist/domain/install/record-path.js.map +1 -0
- package/dist/domain/install/record-types.d.ts +183 -0
- package/dist/domain/install/record-types.d.ts.map +1 -0
- package/dist/domain/install/record-types.js +92 -0
- package/dist/domain/install/record-types.js.map +1 -0
- package/dist/domain/install/types.d.ts +2 -0
- package/dist/domain/install/types.d.ts.map +1 -1
- package/dist/domain/mcp/index.d.ts +1 -0
- package/dist/domain/mcp/index.d.ts.map +1 -1
- package/dist/domain/mcp/index.js +1 -0
- package/dist/domain/mcp/index.js.map +1 -1
- package/dist/domain/mcp/server-key.d.ts +35 -0
- package/dist/domain/mcp/server-key.d.ts.map +1 -0
- package/dist/domain/mcp/server-key.js +44 -0
- package/dist/domain/mcp/server-key.js.map +1 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts +8 -0
- package/dist/domain/plugin/agent-plugin-spec.d.ts.map +1 -1
- package/dist/domain/plugin/agent-plugin-spec.js +22 -8
- package/dist/domain/plugin/agent-plugin-spec.js.map +1 -1
- package/dist/domain/registry-error.d.ts +1 -1
- package/dist/domain/registry-error.d.ts.map +1 -1
- package/dist/domain/registry-error.js +2 -1
- package/dist/domain/registry-error.js.map +1 -1
- package/dist/domain/security/fingerprint.d.ts +18 -0
- package/dist/domain/security/fingerprint.d.ts.map +1 -0
- package/dist/domain/security/fingerprint.js +34 -0
- package/dist/domain/security/fingerprint.js.map +1 -0
- package/dist/domain/security/high-impact-rules.d.ts +30 -0
- package/dist/domain/security/high-impact-rules.d.ts.map +1 -0
- package/dist/domain/security/high-impact-rules.js +160 -0
- package/dist/domain/security/high-impact-rules.js.map +1 -0
- package/dist/domain/security/index.d.ts +10 -0
- package/dist/domain/security/index.d.ts.map +1 -0
- package/dist/domain/security/index.js +26 -0
- package/dist/domain/security/index.js.map +1 -0
- package/dist/domain/security/markdown-context.d.ts +17 -0
- package/dist/domain/security/markdown-context.d.ts.map +1 -0
- package/dist/domain/security/markdown-context.js +74 -0
- package/dist/domain/security/markdown-context.js.map +1 -0
- package/dist/domain/security/policy.d.ts +17 -0
- package/dist/domain/security/policy.d.ts.map +1 -0
- package/dist/domain/security/policy.js +31 -0
- package/dist/domain/security/policy.js.map +1 -0
- package/dist/domain/security/rating/findings-document.d.ts +22 -0
- package/dist/domain/security/rating/findings-document.d.ts.map +1 -0
- package/dist/domain/security/rating/findings-document.js +57 -0
- package/dist/domain/security/rating/findings-document.js.map +1 -0
- package/dist/domain/security/rating/index.d.ts +5 -0
- package/dist/domain/security/rating/index.d.ts.map +1 -0
- package/dist/domain/security/rating/index.js +21 -0
- package/dist/domain/security/rating/index.js.map +1 -0
- package/dist/domain/security/rating/scoring.d.ts +83 -0
- package/dist/domain/security/rating/scoring.d.ts.map +1 -0
- package/dist/domain/security/rating/scoring.js +115 -0
- package/dist/domain/security/rating/scoring.js.map +1 -0
- package/dist/domain/security/rating/security-rating-report.d.ts +111 -0
- package/dist/domain/security/rating/security-rating-report.d.ts.map +1 -0
- package/dist/domain/security/rating/security-rating-report.js +152 -0
- package/dist/domain/security/rating/security-rating-report.js.map +1 -0
- package/dist/domain/security/rating/types.d.ts +22 -0
- package/dist/domain/security/rating/types.d.ts.map +1 -0
- package/dist/domain/security/rating/types.js +11 -0
- package/dist/domain/security/rating/types.js.map +1 -0
- package/dist/domain/security/remediations.d.ts +17 -0
- package/dist/domain/security/remediations.d.ts.map +1 -0
- package/dist/domain/security/remediations.js +61 -0
- package/dist/domain/security/remediations.js.map +1 -0
- package/dist/domain/security/rule-engine.d.ts +8 -0
- package/dist/domain/security/rule-engine.d.ts.map +1 -0
- package/dist/domain/security/rule-engine.js +875 -0
- package/dist/domain/security/rule-engine.js.map +1 -0
- package/dist/domain/security/suppression.d.ts +19 -0
- package/dist/domain/security/suppression.d.ts.map +1 -0
- package/dist/domain/security/suppression.js +78 -0
- package/dist/domain/security/suppression.js.map +1 -0
- package/dist/domain/security/types.d.ts +91 -0
- package/dist/domain/security/types.d.ts.map +1 -0
- package/dist/domain/security/types.js +10 -0
- package/dist/domain/security/types.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/ports/app-storage.d.ts +11 -15
- package/dist/ports/app-storage.d.ts.map +1 -1
- package/dist/ports/app-storage.js +8 -8
- package/dist/ports/argv-process-runner.d.ts +6 -0
- package/dist/ports/argv-process-runner.d.ts.map +1 -0
- package/dist/ports/argv-process-runner.js +3 -0
- package/dist/ports/argv-process-runner.js.map +1 -0
- package/dist/ports/bundle-extractor.d.ts +16 -3
- package/dist/ports/bundle-extractor.d.ts.map +1 -1
- package/dist/ports/collection-contribution.d.ts +36 -0
- package/dist/ports/collection-contribution.d.ts.map +1 -0
- package/dist/ports/collection-contribution.js +3 -0
- package/dist/ports/collection-contribution.js.map +1 -0
- package/dist/ports/filesystem.d.ts +12 -0
- package/dist/ports/filesystem.d.ts.map +1 -1
- package/dist/ports/hub-collection-index.d.ts +27 -0
- package/dist/ports/hub-collection-index.d.ts.map +1 -0
- package/dist/ports/hub-collection-index.js +3 -0
- package/dist/ports/hub-collection-index.js.map +1 -0
- package/dist/ports/hub-contribution.d.ts +158 -0
- package/dist/ports/hub-contribution.d.ts.map +1 -0
- package/dist/ports/hub-contribution.js +3 -0
- package/dist/ports/hub-contribution.js.map +1 -0
- package/dist/ports/index.d.ts +12 -0
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js +12 -0
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/primitive-diagnostics-driver.d.ts +96 -0
- package/dist/ports/primitive-diagnostics-driver.d.ts.map +1 -0
- package/dist/ports/primitive-diagnostics-driver.js +3 -0
- package/dist/ports/primitive-diagnostics-driver.js.map +1 -0
- package/dist/ports/record-fs.d.ts +46 -0
- package/dist/ports/record-fs.d.ts.map +1 -0
- package/dist/ports/record-fs.js +9 -0
- package/dist/ports/record-fs.js.map +1 -0
- package/dist/ports/registry-operations.d.ts +3 -2
- package/dist/ports/registry-operations.d.ts.map +1 -1
- package/dist/ports/release-lookup.d.ts +24 -0
- package/dist/ports/release-lookup.d.ts.map +1 -0
- package/dist/ports/release-lookup.js +7 -0
- package/dist/ports/release-lookup.js.map +1 -0
- package/dist/ports/release-source.d.ts +17 -3
- package/dist/ports/release-source.d.ts.map +1 -1
- package/dist/ports/repository-exclusion.d.ts +30 -0
- package/dist/ports/repository-exclusion.d.ts.map +1 -0
- package/dist/ports/repository-exclusion.js +3 -0
- package/dist/ports/repository-exclusion.js.map +1 -0
- package/dist/ports/schema-validator.d.ts +25 -0
- package/dist/ports/schema-validator.d.ts.map +1 -0
- package/dist/ports/schema-validator.js +7 -0
- package/dist/ports/schema-validator.js.map +1 -0
- package/dist/ports/security-report-store.d.ts +9 -0
- package/dist/ports/security-report-store.d.ts.map +1 -0
- package/dist/ports/security-report-store.js +4 -0
- package/dist/ports/security-report-store.js.map +1 -0
- package/dist/ports/security-scan-engine.d.ts +32 -0
- package/dist/ports/security-scan-engine.d.ts.map +1 -0
- package/dist/ports/security-scan-engine.js +6 -0
- package/dist/ports/security-scan-engine.js.map +1 -0
- package/dist/ports/security-scan-input.d.ts +63 -0
- package/dist/ports/security-scan-input.d.ts.map +1 -0
- package/dist/ports/security-scan-input.js +3 -0
- package/dist/ports/security-scan-input.js.map +1 -0
- package/dist/ports/source-adapter.d.ts +11 -0
- package/dist/ports/source-adapter.d.ts.map +1 -1
- package/dist/public/schemas/collection.schema.json +0 -1
- package/dist/public/schemas/hub-governance.schema.json +21 -0
- package/dist/public/schemas/install-record.schema.json +343 -0
- package/dist/public/schemas/security-rating-report.schema.json +113 -0
- package/package.json +2 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COLLECTION_RULES = void 0;
|
|
4
|
+
exports.collectionGovernanceFindings = collectionGovernanceFindings;
|
|
5
|
+
exports.canonicalHubCollectionId = canonicalHubCollectionId;
|
|
6
|
+
exports.releaseFindings = releaseFindings;
|
|
7
|
+
exports.hubCollectionFindings = hubCollectionFindings;
|
|
8
|
+
const version_1 = require("../../bundle/version");
|
|
9
|
+
exports.COLLECTION_RULES = [
|
|
10
|
+
{ id: 'COL001', subjects: ['collection'], description: 'Collection IDs and names are unique within the repository',
|
|
11
|
+
defaultSeverity: 'error', disableable: false, configurable: true, needsNetwork: false },
|
|
12
|
+
{ id: 'COL002', subjects: ['collection'], description: 'Collection has a published release',
|
|
13
|
+
defaultSeverity: 'error', disableable: false, configurable: true, needsNetwork: true },
|
|
14
|
+
{ id: 'COL003', subjects: ['collection'], description: 'Collection author is non-empty',
|
|
15
|
+
defaultSeverity: 'error', disableable: true, configurable: true, needsNetwork: false },
|
|
16
|
+
{ id: 'COL004', subjects: ['collection'], description: 'Collection ID is registered to its source in the central collection index',
|
|
17
|
+
defaultSeverity: 'error', disableable: true, configurable: true, needsNetwork: false },
|
|
18
|
+
{ id: 'COL005', subjects: ['collection'], description: 'Collection structure and referenced files are valid',
|
|
19
|
+
defaultSeverity: 'error', disableable: false, configurable: true, needsNetwork: false },
|
|
20
|
+
{ id: 'COL006', subjects: ['collection'], description: 'Collection validation advisories',
|
|
21
|
+
defaultSeverity: 'warning', disableable: true, configurable: true, needsNetwork: false }
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Split a validator message such as `collections/a.collection.yml: items[0] referenced file not found: x.md`
|
|
25
|
+
* into the file, a short problem shared by every file (`Referenced file not found`) and the detail (`x.md`).
|
|
26
|
+
* The full message is kept for JSON output.
|
|
27
|
+
* @param message
|
|
28
|
+
*/
|
|
29
|
+
function splitCollectionMessage(message) {
|
|
30
|
+
const located = /^(\S+\.collection\.ya?ml): (.+)$/s.exec(message);
|
|
31
|
+
if (!located) {
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
const text = located[2].replace(/^items\[\d+\] /, '');
|
|
35
|
+
const duplicate = /^Duplicate collection (ID|name) '([^']+)' \(also in (.+)\)$/.exec(text);
|
|
36
|
+
if (duplicate) {
|
|
37
|
+
return { file: located[1], problem: `Duplicate collection ${duplicate[1]}`, detail: `${duplicate[2]}, also in ${duplicate[3]}` };
|
|
38
|
+
}
|
|
39
|
+
const withDetail = /^([^:]+): (.+)$/s.exec(text);
|
|
40
|
+
const [problem, detail] = withDetail ? [withDetail[1], withDetail[2]] : [text.split('. ')[0], undefined];
|
|
41
|
+
return { file: located[1], problem: `${problem.charAt(0).toUpperCase()}${problem.slice(1)}`, ...(detail ? { detail } : {}) };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Adapt existing collection validator results without duplicating structural validation.
|
|
45
|
+
* @param result Output of the established repository-wide collection validator.
|
|
46
|
+
*/
|
|
47
|
+
function collectionGovernanceFindings(result) {
|
|
48
|
+
const structuralErrors = new Set(result.fileResults.flatMap((file) => file.errors));
|
|
49
|
+
// The existing aggregator adds only repository-wide duplicate IDs/names to file errors.
|
|
50
|
+
const findings = result.errors.map((message) => ({
|
|
51
|
+
ruleId: structuralErrors.has(message) ? 'COL005' : 'COL001', severity: 'error', message, ...splitCollectionMessage(message)
|
|
52
|
+
}));
|
|
53
|
+
findings.push(...result.warnings.map((message) => ({ ruleId: 'COL006', severity: 'warning', message, ...splitCollectionMessage(message) })));
|
|
54
|
+
for (const file of result.fileResults) {
|
|
55
|
+
const collection = file.collection;
|
|
56
|
+
if (!collection || typeof collection !== 'object') {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (typeof collection.author !== 'string' || collection.author.trim() === '') {
|
|
60
|
+
findings.push({ ruleId: 'COL003', severity: 'error', message: 'Collection author must be non-empty.', problem: 'Collection author is empty', file: file.file });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return findings;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Remove only a known repository prefix and the established GitHub version suffix.
|
|
67
|
+
* @param bundleId Runtime bundle id or canonical collection id.
|
|
68
|
+
* @param repositorySlug `owner/repo` of the GitHub source.
|
|
69
|
+
*/
|
|
70
|
+
function canonicalHubCollectionId(bundleId, repositorySlug) {
|
|
71
|
+
const prefix = `${repositorySlug.replaceAll('/', '-')}-`;
|
|
72
|
+
const identity = (0, version_1.extractBundleIdentity)(bundleId, 'github');
|
|
73
|
+
return identity.startsWith(prefix) ? identity.slice(prefix.length) : identity;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Translate release evidence (COL002) while preserving unknown-data provenance.
|
|
77
|
+
* @param collection Canonical collection identity.
|
|
78
|
+
* @param result Release lookup evidence.
|
|
79
|
+
*/
|
|
80
|
+
function releaseFindings(collection, result) {
|
|
81
|
+
if (result.status === 'published') {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
const where = collection.repository ?? collection.sourceId;
|
|
85
|
+
const subject = { kind: 'collection', id: collection.id, source: collection.sourceId };
|
|
86
|
+
return [result.status === 'missing'
|
|
87
|
+
? {
|
|
88
|
+
ruleId: 'COL002', severity: 'error', verified: true, file: collection.file ?? collection.sourceId, subject,
|
|
89
|
+
problem: 'Collection has no published release',
|
|
90
|
+
message: `Collection '${collection.id}' has no published release in '${where}': no non-draft, non-prerelease release has a deployment manifest declaring this id and a .zip or .tar.gz bundle.`,
|
|
91
|
+
hint: 'Publish a release of this collection (for example with the collection publish workflow) before adding it to the hub.'
|
|
92
|
+
}
|
|
93
|
+
: {
|
|
94
|
+
ruleId: 'COL002', severity: 'error', verified: false, file: collection.file ?? collection.sourceId, subject,
|
|
95
|
+
problem: result.message ?? 'Releases could not be read',
|
|
96
|
+
message: `Could not check whether collection '${collection.id}' has a published release in '${where}'. Why: ${result.message ?? 'the releases could not be read.'}`,
|
|
97
|
+
hint: result.hint ?? 'Supply an accessible repository and retry.'
|
|
98
|
+
}];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Detect collisions across source identities (COL004) and report incomplete inventories.
|
|
102
|
+
* @param inventory Canonical hub-wide collection inventory.
|
|
103
|
+
* @param candidates
|
|
104
|
+
*/
|
|
105
|
+
function hubCollectionFindings(inventory, candidates = []) {
|
|
106
|
+
const unverified = inventory.unverifiedSources.map(({ sourceId, message, hint }) => ({
|
|
107
|
+
ruleId: 'COL004', severity: 'error', verified: false, file: sourceId, subject: { kind: 'source', id: sourceId }, problem: message,
|
|
108
|
+
message: `Could not read the collection IDs of source '${sourceId}', so hub-wide uniqueness cannot be confirmed. Why: ${message}`,
|
|
109
|
+
hint: hint ?? 'Fix access to this source and retry.'
|
|
110
|
+
}));
|
|
111
|
+
const registry = inventory.registry;
|
|
112
|
+
if (registry) {
|
|
113
|
+
return [...unverified, ...candidates.flatMap((collection) => {
|
|
114
|
+
const owner = registry.owners.get(collection.id);
|
|
115
|
+
const identified = registry.sources.has(collection.sourceId);
|
|
116
|
+
if (identified && owner === collection.sourceId) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
return [{ ruleId: 'COL004', severity: 'error', verified: identified, file: collection.file,
|
|
120
|
+
subject: { kind: 'collection', id: collection.id, source: collection.sourceId },
|
|
121
|
+
problem: identified ? (owner === undefined ? 'Collection ID is not registered' : 'Collection ID belongs to another source') : 'Collection source identity is unverified',
|
|
122
|
+
message: identified
|
|
123
|
+
? (owner === undefined
|
|
124
|
+
? `Collection ID '${collection.id}' is not registered in collection-index.yml.`
|
|
125
|
+
: `Collection ID '${collection.id}' is registered to source '${owner}', not '${collection.sourceId}'.`)
|
|
126
|
+
: `Could not establish the source identity for collection '${collection.id}'.`,
|
|
127
|
+
hint: identified
|
|
128
|
+
? (owner === undefined
|
|
129
|
+
? 'Register this collection ID and sourceId in the central collection-index.yml before publishing.'
|
|
130
|
+
: 'Choose a different collection ID; ownership transfers require an explicit registry review.')
|
|
131
|
+
: 'Supply --repository <owner/repo> matching exactly one enabled source in the trusted hub config.' }];
|
|
132
|
+
})];
|
|
133
|
+
}
|
|
134
|
+
const owners = new Map();
|
|
135
|
+
for (const collection of inventory.collections) {
|
|
136
|
+
const sources = owners.get(collection.id) ?? new Set();
|
|
137
|
+
sources.add(collection.sourceId);
|
|
138
|
+
owners.set(collection.id, sources);
|
|
139
|
+
}
|
|
140
|
+
const findings = [];
|
|
141
|
+
for (const [id, sources] of [...owners].toSorted(([a], [b]) => a.localeCompare(b))) {
|
|
142
|
+
if (sources.size > 1) {
|
|
143
|
+
findings.push({ ruleId: 'COL004', severity: 'error', verified: true,
|
|
144
|
+
subject: { kind: 'collection', id: `${id} (${[...sources].toSorted().join(', ')})` },
|
|
145
|
+
problem: 'The same collection ID is in more than one source',
|
|
146
|
+
message: `Collection ID '${id}' is used by more than one hub source: ${[...sources].toSorted().join(', ')}. Users could install the wrong collection.`,
|
|
147
|
+
hint: 'Rename the collection in one of the sources so every collection ID in the hub is unique.' });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
findings.push(...unverified);
|
|
151
|
+
return findings;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../../src/domain/governance/rules/collection.ts"],"names":[],"mappings":";;;AA4DA,oEAgBC;AAOD,4DAIC;AAOD,0CAmBC;AAOD,sDA+CC;AA9JD,kDAE8B;AASjB,QAAA,gBAAgB,GAA8B;IACzD,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,WAAW,EAAE,2DAA2D;QAChH,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE;IACzF,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAA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EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI;gBACjE,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBACpF,OAAO,EAAE,mDAAmD;gBAC5D,OAAO,EAAE,kBAAkB,EAAE,0CAA0C,CAAC,GAAG,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,6CAA6C;gBACtJ,IAAI,EAAE,0FAA0F,EAAE,CAAC,CAAC;QACxG,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;IAC7B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration rules CFG001-CFG003. Evaluated before any policy applies; never configurable.
|
|
3
|
+
* CFG001 (syntax/schema) is raised by the infra parser; CFG002-CFG003 are semantic and live here.
|
|
4
|
+
* @module domain/governance/rules/config
|
|
5
|
+
*/
|
|
6
|
+
import type { GovernanceFinding, GovernancePolicy, GovernanceRule } from '../types';
|
|
7
|
+
export declare const CONFIG_RULES: readonly GovernanceRule[];
|
|
8
|
+
/**
|
|
9
|
+
* Semantic configuration checks. Any finding here means the policy is ignored for the run.
|
|
10
|
+
* @param policy Parsed policy (already schema-valid).
|
|
11
|
+
* @param rules The rule registry.
|
|
12
|
+
* @param file Display path of the configuration file.
|
|
13
|
+
*/
|
|
14
|
+
export declare function configFindings(policy: GovernancePolicy, rules: readonly GovernanceRule[], file?: string): GovernanceFinding[];
|
|
15
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/domain/governance/rules/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,YAAY,EAAE,SAAS,cAAc,EAOjD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,IAAI,CAAC,EAAE,MAAM,GACZ,iBAAiB,EAAE,CAgBrB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONFIG_RULES = void 0;
|
|
4
|
+
exports.configFindings = configFindings;
|
|
5
|
+
exports.CONFIG_RULES = [
|
|
6
|
+
{ id: 'CFG001', subjects: ['hub', 'collection'], description: 'Governance configuration is readable YAML matching hub-governance.schema.json',
|
|
7
|
+
defaultSeverity: 'error', disableable: false, configurable: false, needsNetwork: false },
|
|
8
|
+
{ id: 'CFG002', subjects: ['hub', 'collection'], description: 'Governance configuration references only known, configurable rule ids',
|
|
9
|
+
defaultSeverity: 'error', disableable: false, configurable: false, needsNetwork: false },
|
|
10
|
+
{ id: 'CFG003', subjects: ['hub', 'collection'], description: 'Governance configuration does not disable or downgrade a floor rule',
|
|
11
|
+
defaultSeverity: 'error', disableable: false, configurable: false, needsNetwork: false }
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* Semantic configuration checks. Any finding here means the policy is ignored for the run.
|
|
15
|
+
* @param policy Parsed policy (already schema-valid).
|
|
16
|
+
* @param rules The rule registry.
|
|
17
|
+
* @param file Display path of the configuration file.
|
|
18
|
+
*/
|
|
19
|
+
function configFindings(policy, rules, file) {
|
|
20
|
+
const findings = [];
|
|
21
|
+
const add = (ruleId, message, source = file) => {
|
|
22
|
+
findings.push({ ruleId, severity: 'error', message, file: source });
|
|
23
|
+
};
|
|
24
|
+
for (const [id, override] of Object.entries(policy.rules ?? {}).toSorted(([a], [b]) => a.localeCompare(b))) {
|
|
25
|
+
const rule = rules.find((candidate) => candidate.id === id);
|
|
26
|
+
if (!rule) {
|
|
27
|
+
add('CFG002', `Unknown governance rule '${id}'.`);
|
|
28
|
+
}
|
|
29
|
+
else if (!rule.configurable) {
|
|
30
|
+
add('CFG002', `Rule '${id}' is not configurable.`);
|
|
31
|
+
}
|
|
32
|
+
else if (!rule.disableable && (override.enabled === false || override.severity === 'warning')) {
|
|
33
|
+
add('CFG003', `Rule '${id}' cannot be disabled or downgraded.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return findings;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/domain/governance/rules/config.ts"],"names":[],"mappings":";;;AA0BA,wCAoBC;AAnCY,QAAA,YAAY,GAA8B;IACrD,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,+EAA+E;QAC3I,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE;IAC1F,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,uEAAuE;QACnI,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE;IAC1F,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ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AAQ,KAAK,SAAS,CAAC,EAAE,CAAC;YAChG,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,qCAAqC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub rules. HUB001/HUB002 report the existing hub validator's results.
|
|
3
|
+
* @module domain/governance/rules/hub
|
|
4
|
+
*/
|
|
5
|
+
import type { GovernanceRule } from '../types';
|
|
6
|
+
export declare const HUB_RULES: readonly GovernanceRule[];
|
|
7
|
+
//# sourceMappingURL=hub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../../../src/domain/governance/rules/hub.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,SAAS,EAAE,SAAS,cAAc,EAK9C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HUB_RULES = void 0;
|
|
4
|
+
exports.HUB_RULES = [
|
|
5
|
+
{ id: 'HUB001', subjects: ['hub'], description: 'Hub syntax, schema, references and source policies',
|
|
6
|
+
defaultSeverity: 'error', disableable: false, configurable: true, needsNetwork: false },
|
|
7
|
+
{ id: 'HUB002', subjects: ['hub'], description: 'Hub validation advisories',
|
|
8
|
+
defaultSeverity: 'warning', disableable: true, configurable: true, needsNetwork: false }
|
|
9
|
+
];
|
|
10
|
+
//# sourceMappingURL=hub.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub.js","sourceRoot":"","sources":["../../../../src/domain/governance/rules/hub.ts"],"names":[],"mappings":";;;AAQa,QAAA,SAAS,GAA8B;IAClD,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,oDAAoD;QAClG,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE;IACzF,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,2BAA2B;QACzE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE;CAC3F,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Governance domain types. Pure: no IO.
|
|
3
|
+
* @module domain/governance/types
|
|
4
|
+
*/
|
|
5
|
+
/** What a governance run validates. */
|
|
6
|
+
export type GovernanceSubject = 'hub' | 'collection' | 'primitive';
|
|
7
|
+
export type GovernanceSeverity = 'error' | 'warning';
|
|
8
|
+
export interface GovernanceFinding {
|
|
9
|
+
ruleId: string;
|
|
10
|
+
severity: GovernanceSeverity;
|
|
11
|
+
message: string;
|
|
12
|
+
file?: string;
|
|
13
|
+
/** Whether the evidence behind the finding could be verified. */
|
|
14
|
+
verified?: boolean;
|
|
15
|
+
/** How to fix it, shown under the message in reports. */
|
|
16
|
+
hint?: string;
|
|
17
|
+
/** The source or collection the finding is about, so reports can group failures by problem. */
|
|
18
|
+
subject?: {
|
|
19
|
+
kind: 'source' | 'collection';
|
|
20
|
+
id: string;
|
|
21
|
+
source?: string;
|
|
22
|
+
};
|
|
23
|
+
/** Short plain-language problem used as the report row; defaults to the message. */
|
|
24
|
+
problem?: string;
|
|
25
|
+
/** The specific item within the affected file, for example a missing path; shown next to it in reports. */
|
|
26
|
+
detail?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Static description of one rule; the registry is the single source of truth. */
|
|
29
|
+
export interface GovernanceRule {
|
|
30
|
+
id: string;
|
|
31
|
+
subjects: readonly GovernanceSubject[];
|
|
32
|
+
description: string;
|
|
33
|
+
defaultSeverity: GovernanceSeverity;
|
|
34
|
+
/** False for floor rules: policy can neither disable nor downgrade them. */
|
|
35
|
+
disableable: boolean;
|
|
36
|
+
/** False for configuration rules, which are evaluated before any policy applies. */
|
|
37
|
+
configurable: boolean;
|
|
38
|
+
/** True when the rule must contact a source to produce evidence. */
|
|
39
|
+
needsNetwork: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface GovernanceRuleOverride {
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
severity?: GovernanceSeverity;
|
|
44
|
+
reason?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface GovernancePolicy {
|
|
47
|
+
rules?: Record<string, GovernanceRuleOverride>;
|
|
48
|
+
}
|
|
49
|
+
export interface GovernanceSuppression {
|
|
50
|
+
ruleId: string;
|
|
51
|
+
action: string;
|
|
52
|
+
reason?: string;
|
|
53
|
+
}
|
|
54
|
+
/** A network rule that applies to the subject but was not run. */
|
|
55
|
+
export interface GovernanceNotChecked {
|
|
56
|
+
ruleId: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
}
|
|
59
|
+
export interface GovernanceReport {
|
|
60
|
+
schemaVersion: 1;
|
|
61
|
+
subject: GovernanceSubject;
|
|
62
|
+
mode: 'offline' | 'sources';
|
|
63
|
+
verdict: 'pass' | 'fail';
|
|
64
|
+
findings: GovernanceFinding[];
|
|
65
|
+
suppressions: GovernanceSuppression[];
|
|
66
|
+
notChecked: GovernanceNotChecked[];
|
|
67
|
+
/** Explicit execution coverage. Omitted by older producers that do not track applicability. */
|
|
68
|
+
applicableRules?: string[];
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/governance/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,uCAAuC;AACvC,MAAM,MAAM,iBAAiB,GAAG,KAA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IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,CAAC,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/domain/governance/types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain layer — Structured hub configuration diagnostics, source ranges,
|
|
3
|
+
* inline decorations, and quick-fix descriptors.
|
|
4
|
+
*
|
|
5
|
+
* Used across `@ai-primitives-hub/infra`, `@ai-primitives-hub/app`, and the
|
|
6
|
+
* VS Code extension's visual editor and live YAML intelligence.
|
|
7
|
+
* @module domain/hub/diagnostics
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Machine-readable diagnostic codes for hub configuration validation.
|
|
11
|
+
*/
|
|
12
|
+
export type HubDiagnosticCode = 'HUB_YAML_SYNTAX_ERROR' | 'HUB_SCHEMA_VIOLATION' | 'HUB_MISSING_REQUIRED_FIELD' | 'HUB_INVALID_SEMVER' | 'HUB_INVALID_CHECKSUM' | 'HUB_DUPLICATE_SOURCE_ID' | 'HUB_DUPLICATE_PROFILE_ID' | 'HUB_PATH_TRAVERSAL' | 'HUB_SOURCE_FORBIDDEN_CONFIG' | 'HUB_SOURCE_REQUIRED_CONFIG' | 'HUB_UNKNOWN_SOURCE_REFERENCE' | 'HUB_INVALID_BUNDLE_PREFIX' | 'HUB_SOURCE_UNREACHABLE' | 'HUB_BUNDLE_NOT_FOUND' | 'HUB_BUNDLE_VERSION_NOT_FOUND' | 'HUB_STALE_UPDATED_AT';
|
|
13
|
+
/**
|
|
14
|
+
* 0-based line/column range within a YAML text document.
|
|
15
|
+
*/
|
|
16
|
+
export interface SourceRange {
|
|
17
|
+
startLine: number;
|
|
18
|
+
startColumn: number;
|
|
19
|
+
endLine: number;
|
|
20
|
+
endColumn: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Actionable quick fix attached to a validation diagnostic.
|
|
24
|
+
*/
|
|
25
|
+
export interface HubValidationQuickFix {
|
|
26
|
+
/** Human-readable title displayed in VS Code Quick Fix menu or Visual Editor. */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Quick fix kind identifier. */
|
|
29
|
+
kind: 'update-timestamp' | 'fix-bundle-prefix' | 'add-source-config' | 'remove-source-config' | 'create-missing-source';
|
|
30
|
+
/** Target JSON path within `hub-config.yml`. */
|
|
31
|
+
jsonPath: (string | number)[];
|
|
32
|
+
/** Replacement value or payload used by the document mutator. */
|
|
33
|
+
replacementValue?: unknown;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Structured validation diagnostic with JSON path, YAML source range, and
|
|
37
|
+
* optional quick-fix metadata.
|
|
38
|
+
*/
|
|
39
|
+
export interface HubValidationDiagnostic {
|
|
40
|
+
code: HubDiagnosticCode;
|
|
41
|
+
severity: 'error' | 'warning' | 'info';
|
|
42
|
+
message: string;
|
|
43
|
+
jsonPath: (string | number)[];
|
|
44
|
+
range?: SourceRange;
|
|
45
|
+
quickFix?: HubValidationQuickFix;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Inline hint decoration model for a YAML line in `hub-config.yml`.
|
|
49
|
+
*/
|
|
50
|
+
export interface HubInlineDecoration {
|
|
51
|
+
line: number;
|
|
52
|
+
text: string;
|
|
53
|
+
status: 'ok' | 'warning' | 'error' | 'info';
|
|
54
|
+
jsonPath: (string | number)[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Semantic entity enclosing a cursor line in `hub-config.yml`.
|
|
58
|
+
*/
|
|
59
|
+
export type HubCursorNodeContext = {
|
|
60
|
+
section: 'root';
|
|
61
|
+
} | {
|
|
62
|
+
section: 'metadata';
|
|
63
|
+
} | {
|
|
64
|
+
section: 'sources-header';
|
|
65
|
+
} | {
|
|
66
|
+
section: 'source';
|
|
67
|
+
index: number;
|
|
68
|
+
id?: string;
|
|
69
|
+
} | {
|
|
70
|
+
section: 'profiles-header';
|
|
71
|
+
} | {
|
|
72
|
+
section: 'profile';
|
|
73
|
+
index: number;
|
|
74
|
+
id?: string;
|
|
75
|
+
bundleIndex?: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Summary of structural changes between a base `hub-config.yml` and an edited
|
|
79
|
+
* `hub-config.yml`, used to generate commit messages and pull request bodies.
|
|
80
|
+
*/
|
|
81
|
+
export interface HubChangeSummary {
|
|
82
|
+
sourcesAdded: string[];
|
|
83
|
+
sourcesModified: string[];
|
|
84
|
+
sourcesRemoved: string[];
|
|
85
|
+
profilesAdded: string[];
|
|
86
|
+
profilesModified: string[];
|
|
87
|
+
profilesRemoved: string[];
|
|
88
|
+
suggestedCommitMessage: string;
|
|
89
|
+
suggestedPrTitle: string;
|
|
90
|
+
suggestedPrBody: string;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/domain/hub/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB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M,CAAC,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,OAAO,EAAE,UAAU,CAAA;CAAE,GACvB;IAAE,OAAO,EAAE,gBAAgB,CAAA;CAAE,GAC7B;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,OAAO,EAAE,iBAAiB,CAAA;CAAE,GAC9B;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Domain layer — Structured hub configuration diagnostics, source ranges,
|
|
4
|
+
* inline decorations, and quick-fix descriptors.
|
|
5
|
+
*
|
|
6
|
+
* Used across `@ai-primitives-hub/infra`, `@ai-primitives-hub/app`, and the
|
|
7
|
+
* VS Code extension's visual editor and live YAML intelligence.
|
|
8
|
+
* @module domain/hub/diagnostics
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../../src/domain/hub/diagnostics.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain layer — hub profile bundle requirements.
|
|
3
|
+
*
|
|
4
|
+
* A profile bundle marked `required: true` must be installed for the
|
|
5
|
+
* profile to count as activated; optional bundles may be missing.
|
|
6
|
+
* @module domain/hub/profile-requirements
|
|
7
|
+
*/
|
|
8
|
+
import type { HubProfileBundle } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* List the required profile bundles that were not installed.
|
|
11
|
+
* @param bundles - Bundles declared by the profile.
|
|
12
|
+
* @param installedBundleIds - Ids of the bundles that are installed after the activation attempt.
|
|
13
|
+
* @returns Ids of required bundles missing from `installedBundleIds`, in profile order.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findMissingRequiredBundles(bundles: readonly HubProfileBundle[], installedBundleIds: Iterable<string>): string[];
|
|
16
|
+
//# sourceMappingURL=profile-requirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-requirements.d.ts","sourceRoot":"","sources":["../../../src/domain/hub/profile-requirements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,GACnC,MAAM,EAAE,CAKV"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findMissingRequiredBundles = findMissingRequiredBundles;
|
|
4
|
+
/**
|
|
5
|
+
* List the required profile bundles that were not installed.
|
|
6
|
+
* @param bundles - Bundles declared by the profile.
|
|
7
|
+
* @param installedBundleIds - Ids of the bundles that are installed after the activation attempt.
|
|
8
|
+
* @returns Ids of required bundles missing from `installedBundleIds`, in profile order.
|
|
9
|
+
*/
|
|
10
|
+
function findMissingRequiredBundles(bundles, installedBundleIds) {
|
|
11
|
+
const installed = new Set(installedBundleIds);
|
|
12
|
+
return bundles
|
|
13
|
+
.filter((bundle) => bundle.required && !installed.has(bundle.id))
|
|
14
|
+
.map((bundle) => bundle.id);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=profile-requirements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-requirements.js","sourceRoot":"","sources":["../../../src/domain/hub/profile-requirements.ts"],"names":[],"mappings":";;AAiBA,gEAQC;AAdD;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,OAAoC,EACpC,kBAAoC;IAEpC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC9C,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SAChE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -28,11 +28,29 @@ export interface ReplicationCandidateDiscovery {
|
|
|
28
28
|
candidates: ReplicationCandidate[];
|
|
29
29
|
warnings: string[];
|
|
30
30
|
}
|
|
31
|
+
export interface ReplicationRepository {
|
|
32
|
+
key: string;
|
|
33
|
+
packageType: string;
|
|
34
|
+
rclass: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ReplicationRepositoryInspector {
|
|
37
|
+
inspect(targetRoot: string): Promise<ReplicationRepository>;
|
|
38
|
+
}
|
|
31
39
|
export interface ReplicationResult {
|
|
32
40
|
index: ArtifactorySourceIndex;
|
|
33
41
|
hubConfig: HubConfig;
|
|
34
42
|
warnings: string[];
|
|
35
43
|
selected: ReplicationCandidate[];
|
|
44
|
+
targetRepository?: ReplicationRepository;
|
|
45
|
+
}
|
|
46
|
+
export interface PreparedReplicationArchive {
|
|
47
|
+
bytes: Uint8Array;
|
|
48
|
+
packageName: string;
|
|
49
|
+
translated: boolean;
|
|
50
|
+
warnings: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface ReplicationArchivePreparer {
|
|
53
|
+
prepare(candidate: ReplicationCandidate, archive: Uint8Array): Promise<PreparedReplicationArchive>;
|
|
36
54
|
}
|
|
37
55
|
export interface ReplicationSourcePort {
|
|
38
56
|
getHubConfig(ownerRepo: string, ref: string): Promise<Record<string, unknown>>;
|
|
@@ -45,6 +63,11 @@ export interface ReplicationPublishOptions {
|
|
|
45
63
|
export interface ReplicationPublisherPort {
|
|
46
64
|
publish(path: string, data: Uint8Array, mediaType: string, options?: ReplicationPublishOptions): Promise<'uploaded' | 'skipped-existing' | 'skipped-unverified'>;
|
|
47
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Require the detected native repository contract before transition writes.
|
|
68
|
+
* @param repository
|
|
69
|
+
*/
|
|
70
|
+
export declare function requireAgentPackagesRepository(repository: ReplicationRepository): void;
|
|
48
71
|
export declare const stableReplicatedBundleId: (repo: string, manifest: Record<string, unknown>) => string;
|
|
49
72
|
export declare const normalizedReleaseVersion: (manifest: Record<string, unknown>, tag: string) => string | undefined;
|
|
50
73
|
export declare const selectReplications: (candidates: ReplicationCandidate[], requests: ReplicationRequest[], mode: "latest" | "all") => ReplicationSelection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replicate.d.ts","sourceRoot":"","sources":["../../../src/domain/hub/replicate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,SAAS,EACV,MAAM,S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E,OAAO,CAAC,EAAE,KAAK,MAAM,KAAG,MAAM,GAAG,SAQlG,CAAC;AACF,eAAO,MAAM,kBAAkB,GAAI,YAAY,oBAAoB,EAAE,EAAE,UAAU,kBAAkB,EAAE,EAAE,MAAM,QAAQ,GAAG,KAAK,KAAG,oBAkC/H,CAAC;AAqBF,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,kBAAkB,EAqBtF,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAAG,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE;AAEzG,eAAO,MAAM,yBAAyB,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,oBAAoB,EAAE,EAAE,qBAAoB,oBAAoB,EAAe,KAAG,4BA+ErK,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,WAAW,oBAAoB,EAAE,cAAc,MAAM,EAAE,aAAa,MAAM,EAAE,SAAS,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,KAAK,MAAM,KAAG,2BAG3K,CAAC"}
|
|
@@ -34,9 +34,22 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.makeReplicatedEntry = exports.resolveReplicatedProfiles = exports.requestsFromHubConfig = exports.selectReplications = exports.normalizedReleaseVersion = exports.stableReplicatedBundleId = void 0;
|
|
37
|
+
exports.requireAgentPackagesRepository = requireAgentPackagesRepository;
|
|
37
38
|
/* eslint-disable @stylistic/max-len, @stylistic/max-statements-per-line, unicorn/no-array-sort, @typescript-eslint/no-base-to-string -- compact domain contract helpers */
|
|
38
39
|
const semver = __importStar(require("semver"));
|
|
39
40
|
const registry_error_1 = require("../registry-error");
|
|
41
|
+
/**
|
|
42
|
+
* Require the detected native repository contract before transition writes.
|
|
43
|
+
* @param repository
|
|
44
|
+
*/
|
|
45
|
+
function requireAgentPackagesRepository(repository) {
|
|
46
|
+
if (repository.packageType.toLowerCase() !== 'agentpackages') {
|
|
47
|
+
throw new registry_error_1.RegistryError({
|
|
48
|
+
code: 'ARTIFACTORY.CONFIG_INVALID',
|
|
49
|
+
message: `APM transition requires an Agent Packages repository. Repository "${repository.key}" reports packageType "${repository.packageType}". No artifacts were published.`
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
40
53
|
const stableReplicatedBundleId = (repo, manifest) => {
|
|
41
54
|
const [owner, name] = repo.split('/', 2);
|
|
42
55
|
const id = typeof manifest.id === 'string' && manifest.id.length > 0 ? `-${manifest.id}` : '';
|