@webpieces/rules-config 0.4.846 → 0.4.848
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/package.json +10 -7
- package/src/WebpiecesRulesConfig.d.ts +1 -2
- package/src/WebpiecesRulesConfig.js +0 -1
- package/src/WebpiecesRulesConfig.js.map +1 -1
- package/src/client-module-resolution.d.ts +9 -0
- package/src/client-module-resolution.js +102 -0
- package/src/client-module-resolution.js.map +1 -0
- package/src/config-error-banner.d.ts +0 -2
- package/src/config-error-banner.js +1 -3
- package/src/config-error-banner.js.map +1 -1
- package/src/config-file.d.ts +3 -6
- package/src/config-file.js +14 -1
- package/src/config-file.js.map +1 -1
- package/src/config-key-rules.js +16 -5
- package/src/config-key-rules.js.map +1 -1
- package/src/config-pruner.d.ts +5 -42
- package/src/config-pruner.js +31 -76
- package/src/config-pruner.js.map +1 -1
- package/src/config-repair-access.d.ts +4 -0
- package/src/config-repair-access.js +17 -0
- package/src/config-repair-access.js.map +1 -0
- package/src/config-repair-bootstrap-source.d.ts +2 -0
- package/src/config-repair-bootstrap-source.js +7 -0
- package/src/config-repair-bootstrap-source.js.map +1 -0
- package/src/config-repair-probe.d.ts +13 -0
- package/src/config-repair-probe.js +115 -0
- package/src/config-repair-probe.js.map +1 -0
- package/src/first-path-match.d.ts +14 -0
- package/src/first-path-match.js +35 -0
- package/src/first-path-match.js.map +1 -0
- package/src/index.d.ts +15 -8
- package/src/index.js +40 -10
- package/src/index.js.map +1 -1
- package/src/legacy-config-upgrade.d.ts +22 -0
- package/src/legacy-config-upgrade.js +328 -0
- package/src/legacy-config-upgrade.js.map +1 -0
- package/src/load-config.d.ts +11 -23
- package/src/load-config.js +50 -138
- package/src/load-config.js.map +1 -1
- package/src/pack-policy-files.d.ts +29 -0
- package/src/pack-policy-files.js +194 -0
- package/src/pack-policy-files.js.map +1 -0
- package/src/policy-field-constraints.d.ts +9 -0
- package/src/policy-field-constraints.js +31 -0
- package/src/policy-field-constraints.js.map +1 -0
- package/src/repository-path.d.ts +7 -0
- package/src/repository-path.js +50 -0
- package/src/repository-path.js.map +1 -0
- package/src/rule-pack-artifacts.d.ts +23 -0
- package/src/rule-pack-artifacts.js +180 -0
- package/src/rule-pack-artifacts.js.map +1 -0
- package/src/rule-pack-registry.d.ts +7 -0
- package/src/rule-pack-registry.js +149 -47
- package/src/rule-pack-registry.js.map +1 -1
- package/src/rule-pack-sync.d.ts +26 -0
- package/src/rule-pack-sync.js +236 -0
- package/src/rule-pack-sync.js.map +1 -0
- package/src/rule-runtime-modules.d.ts +27 -0
- package/src/rule-runtime-modules.js +135 -0
- package/src/rule-runtime-modules.js.map +1 -0
- package/src/rules-sync-cli.d.ts +7 -0
- package/src/rules-sync-cli.js +48 -0
- package/src/rules-sync-cli.js.map +1 -0
- package/src/seed-entry.js +1 -3
- package/src/seed-entry.js.map +1 -1
- package/src/types.d.ts +4 -6
- package/src/types.js +4 -7
- package/src/types.js.map +1 -1
- package/src/validate-config.d.ts +3 -29
- package/src/validate-config.js +99 -244
- package/src/validate-config.js.map +1 -1
- package/src/validate-pr-gate.d.ts +8 -0
- package/src/validate-pr-gate.js +161 -0
- package/src/validate-pr-gate.js.map +1 -0
- package/templates/webpieces.guard-matrix.md +5 -4
- package/src/rule-pack-selection.d.ts +0 -6
- package/src/rule-pack-selection.js +0 -50
- package/src/rule-pack-selection.js.map +0 -1
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PathScopeConfig = exports.NoCustomCssScope = exports.GENERATED_CODE_PATHS = exports.matchesAnyGlob = exports.isPathExcluded = exports.isWebpiecesStateDir = exports.ExcludePaths = exports.DESIGN_METADATA_KEYS = exports.isDocumentDesign = exports.DocumentDesign = exports.RulesConfigDesign = exports.atRoot = exports.CLAUDE_PROJECT_DIR_UNSET = exports.CLAUDE_PROJECT_DIR_ENV = exports.claudeEnv = exports.ClaudeEnv = exports.RETENTION_DAYS = exports.SweepCount = exports.AgedTreeSweeper = exports.INSTRUCT_AI_LEAF = exports.INSTRUCT_AI_DIR = exports.RepoRootFinder = exports.CONFIG_PARSE_RETRY_MILLIS = exports.CONFIG_PARSE_ATTEMPTS = exports.ConfigParseAttempt = exports.ConfigFile = exports.CONFIG_FILENAME = exports.findConfigFile = exports.
|
|
4
|
-
exports.HOME_KEY_WHOLE_REPO_BUILD_GUARD = exports.HOME_KEY_ORPHAN_DIR_SWEEP = exports.HOME_EXPERIMENTAL_SECTION = exports.HOME_CONFIG_FILE = exports.HOME_CONFIG_DIR = exports.RETIRED_HOME_CONFIG_KEYS = exports.RetiredHomeConfigKey = exports.HomeConfigService = exports.HomeConfig = exports.validateChecklistDocs = exports.PrunedKey = exports.PruneResult = exports.ConfigPruner = exports.retiredRuleFor = exports.retiredKeyErrorsIn = exports.retiredKeyError = exports.retiredEntry = exports.isRetiredKey = exports.RETIRED_SCOPE_RULE = exports.RETIRED_SCOPE_KEY = exports.RETIRED_CONFIG_KEYS = exports.COMMENT_KEY_SUFFIX = exports.validateTopLevelKeys = exports.isCommentKey = exports.unknownKeyErrors = exports.validateCommandsSection = exports.seedEntryForRule = exports.recommendedSeedModeFor = exports.recommendedSeedMode = exports.allRuleNames = exports.validateMatchRulesSection = exports.validateExcludePaths = exports.
|
|
5
|
-
exports.findNewMethodSignaturesInDiff = exports.getChangedLineNumbers = exports.getFileDiff = exports.getChangedFiles = exports.resolveBase = exports.detectBase = exports.SkipRuleResult = exports.HOTFIX_AUDIT_BANNER = exports.HOTFIX_BUILD_COMMAND = exports.shouldSkipRule = exports.sectionForRule = exports.isHookGuard = exports.schemaFieldNames = exports.DEFAULT_MATCH_RULES = exports.renderMatchRuleMessage = exports.compileMatchRulePatterns = exports.isMatchRuleAllowedPath = exports.findMatchRuleViolations = exports.MatchRuleViolation = exports.MatchRuleConfig = exports.OrphanSweepReport = exports.OrphanDirSweeper = exports.TRASH_RETENTION_DAYS = exports.TRASH_MANIFEST_FILE = exports.TRASH_STATE_DIR = exports.OrphanSweepManifest = exports.OrphanSweepResult = exports.FailedOrphan = exports.ArchivedOrphan = exports.OrphanDirArchiver = exports.OrphanCandidate = exports.OrphanDirScanner = exports.MAX_ROW_BYTES = exports.BUILDS_LOG_GENERATIONS = exports.MAX_BUILDS_LOG_BYTES = exports.BUILD_DONE_FAIL = exports.BUILD_DONE_SUCCESS = exports.BUILD_START = exports.BUILDS_LOCK_FILE = exports.BUILDS_LOG_FILE = exports.RunningBuild = exports.BuildTermination = exports.BuildTicket = exports.BuildsLog = exports.DOCUMENTATION_KEYS = exports.HOME_KEY_AI_DOC = exports.HOME_KEY_DOC = exports.DEFAULT_MAX_CONCURRENT_BUILDS = exports.HOME_KEY_TURN_OFF_ALL_REVIEWERS =
|
|
6
|
-
exports.ReviewerInstructionsService = exports.ChecklistInstructionsService = exports.ChecklistValidator = exports.formatFileList = exports.normalizeChecklistDoc = exports.toChecklist = exports.DEFAULT_REVIEWER_AGENT_NAME = exports.REVIEWER_AGENTS_PLACEHOLDER = exports.ReviewerAgentPolicy = exports.ChecklistDefinition = exports.MERGE_MODES = exports.MERGE_MODE_NONE = exports.MERGE_MODE_AUTO = exports.buildDevDeployConfig = exports.buildLandPrConfig = exports.buildPrGateConfig = exports.defaultDevDeployConfig = exports.defaultLandPrConfig = exports.defaultPrGateConfig = exports.defaultGates = exports.ReviewContextEntry = exports.DEFAULT_DEV_BRANCH = exports.DEFAULT_DEV_BRANCH_NAMESPACE = exports.DevDeployConfig = exports.LandPrConfig = exports.DEFAULT_BUILD_COMMAND = exports.PrGateConfig = exports.GateDefinition = exports.WP_FINISH_PUSH_DEV = exports.WP_PUSH_DEV = exports.WP_FINISH_UPSERT_PR = exports.WP_START_UPSERT_PR = exports.WP_FINISH_UPDATE = exports.WP_START_UPDATE = exports.SyncFlowGuidance = exports.WebpiecesRulesConfig = exports.UPGRADE_SHIM_COMMAND = exports.PRUNE_UNKNOWN_COMMAND = exports.PUSH_DEV_STATE_FILE = exports.MERGE_EXPLANATION_FILE = exports.MERGE_IN_PROGRESS_FILE = exports.MERGE_INFO_DIR = exports.hasDisable = exports.WEBPIECES_DISABLE = exports.AbstractRule = exports.ChangedFilesOptions = exports.DiffRange = exports.DiffScope = exports.isNewOrModified =
|
|
7
|
-
exports.prDirFor = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.VERDICT_STATUSES = exports.VERDICT_RED = exports.VERDICT_ORANGE = exports.VERDICT_YELLOW = exports.VERDICT_GREEN = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.CK_ORANGE = exports.CK_ORANGE_FIXED = exports.CK_OVERRIDDEN = exports.CK_WARN = exports.CK_PASS = exports.checklistOverrideService = exports.ChecklistOverrideService = exports.ChecklistOverride = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.PrSummary = exports.DEFAULT_RETENTION_DAYS = exports.ProvenanceWriteRequest = exports.OfferedContext = exports.ReviewerPaths = exports.ReviewerTranscript = exports.ReviewProvenance = exports.ReviewProvenanceService = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.TranscriptScan = exports.ExpectedReviewer = exports.ReviewerContext = exports.ReviewerEvidence = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = exports.computeGateToken = exports.GateTokenService = exports.ALL_DIFF_ONE_READ_LINES = exports.READ_TRUNCATION_LINES = exports.ContextEntry = exports.BriefedFile =
|
|
8
|
-
exports.
|
|
3
|
+
exports.PathScopeConfig = exports.NoCustomCssScope = exports.GENERATED_CODE_PATHS = exports.matchesAnyGlob = exports.isPathExcluded = exports.isWebpiecesStateDir = exports.ExcludePaths = exports.DESIGN_METADATA_KEYS = exports.isDocumentDesign = exports.DocumentDesign = exports.RulesConfigDesign = exports.atRoot = exports.CLAUDE_PROJECT_DIR_UNSET = exports.CLAUDE_PROJECT_DIR_ENV = exports.claudeEnv = exports.ClaudeEnv = exports.RETENTION_DAYS = exports.SweepCount = exports.AgedTreeSweeper = exports.INSTRUCT_AI_LEAF = exports.INSTRUCT_AI_DIR = exports.RepoRootFinder = exports.RawConfigFile = exports.CONFIG_PARSE_RETRY_MILLIS = exports.CONFIG_PARSE_ATTEMPTS = exports.ConfigParseAttempt = exports.ConfigFile = exports.CONFIG_FILENAME = exports.findConfigFile = exports.RETIRED_TOP_LEVEL_MARKER = exports.RETIRED_KEY_MARKER = exports.CONFIG_POLICY_DOC = exports.formatConfigErrorsBanner = exports.ConfigLoader = exports.LoadedConfig = exports.loadAndValidate = exports.runMain = exports.CliArgs = exports.CliArgsCheck = exports.CliArgSet = exports.CliFlag = exports.CliUsage = exports.CliExitError = exports.formatFixOptions = exports.Option = exports.renderRuleFailForHuman = exports.renderRuleFailForAi = exports.RuleFailError = exports.ResolvedRuleConfig = exports.ResolvedConfig = void 0;
|
|
4
|
+
exports.HOME_KEY_MAX_CONCURRENT_BUILDS = exports.HOME_KEY_WHOLE_REPO_BUILD_GUARD = exports.HOME_KEY_ORPHAN_DIR_SWEEP = exports.HOME_EXPERIMENTAL_SECTION = exports.HOME_CONFIG_FILE = exports.HOME_CONFIG_DIR = exports.RETIRED_HOME_CONFIG_KEYS = exports.RetiredHomeConfigKey = exports.HomeConfigService = exports.HomeConfig = exports.validateChecklistDocs = exports.PrunedKey = exports.PruneResult = exports.ConfigPruner = exports.retiredRuleFor = exports.retiredKeyErrorsIn = exports.retiredKeyError = exports.retiredEntry = exports.isRetiredKey = exports.RETIRED_SCOPE_RULE = exports.RETIRED_SCOPE_KEY = exports.RETIRED_CONFIG_KEYS = exports.COMMENT_KEY_SUFFIX = exports.validateTopLevelKeys = exports.isCommentKey = exports.unknownKeyErrors = exports.validateCommandsSection = exports.seedEntryForRule = exports.recommendedSeedModeFor = exports.recommendedSeedMode = exports.allRuleNames = exports.validateMatchRulesSection = exports.validateExcludePaths = exports.validateChecklistsSection = exports.validatePrGateSection = exports.validateWebpiecesConfig = exports.BUILD_LOG_DOC = exports.ReferenceMergeRun = exports.MergeRun = exports.MergeProcessText = exports.MERGE_PROCESS_DOC = exports.MergeProcessDoc = exports.InstructAiDocSet = exports.InstructAiDoc = exports.GitWorkflowDoc = exports.GIT_WORKFLOW_DOC = exports.TemplateWriter = exports.writeTemplate = exports.writeTemplateIfMissing = exports.loadTemplate = void 0;
|
|
5
|
+
exports.hasChangesInRange = exports.findNewMethodSignaturesInDiff = exports.getChangedLineNumbers = exports.getFileDiff = exports.getChangedFiles = exports.resolveBase = exports.detectBase = exports.SkipRuleResult = exports.HOTFIX_AUDIT_BANNER = exports.HOTFIX_BUILD_COMMAND = exports.shouldSkipRule = exports.sectionForRule = exports.isHookGuard = exports.schemaFieldNames = exports.DEFAULT_MATCH_RULES = exports.renderMatchRuleMessage = exports.compileMatchRulePatterns = exports.isMatchRuleAllowedPath = exports.findMatchRuleViolations = exports.MatchRuleViolation = exports.MatchRuleConfig = exports.OrphanSweepReport = exports.OrphanDirSweeper = exports.TRASH_RETENTION_DAYS = exports.TRASH_MANIFEST_FILE = exports.TRASH_STATE_DIR = exports.OrphanSweepManifest = exports.OrphanSweepResult = exports.FailedOrphan = exports.ArchivedOrphan = exports.OrphanDirArchiver = exports.OrphanCandidate = exports.OrphanDirScanner = exports.MAX_ROW_BYTES = exports.BUILDS_LOG_GENERATIONS = exports.MAX_BUILDS_LOG_BYTES = exports.BUILD_DONE_FAIL = exports.BUILD_DONE_SUCCESS = exports.BUILD_START = exports.BUILDS_LOCK_FILE = exports.BUILDS_LOG_FILE = exports.RunningBuild = exports.BuildTermination = exports.BuildTicket = exports.BuildsLog = exports.DOCUMENTATION_KEYS = exports.HOME_KEY_AI_DOC = exports.HOME_KEY_DOC = exports.DEFAULT_MAX_CONCURRENT_BUILDS = exports.HOME_KEY_TURN_OFF_ALL_REVIEWERS = void 0;
|
|
6
|
+
exports.ReviewerBriefing = exports.ReviewerInstructionsService = exports.ChecklistInstructionsService = exports.ChecklistValidator = exports.formatFileList = exports.normalizeChecklistDoc = exports.toChecklist = exports.DEFAULT_REVIEWER_AGENT_NAME = exports.REVIEWER_AGENTS_PLACEHOLDER = exports.ReviewerAgentPolicy = exports.ChecklistDefinition = exports.MERGE_MODES = exports.MERGE_MODE_NONE = exports.MERGE_MODE_AUTO = exports.buildDevDeployConfig = exports.buildLandPrConfig = exports.buildPrGateConfig = exports.defaultDevDeployConfig = exports.defaultLandPrConfig = exports.defaultPrGateConfig = exports.defaultGates = exports.ReviewContextEntry = exports.DEFAULT_DEV_BRANCH = exports.DEFAULT_DEV_BRANCH_NAMESPACE = exports.DevDeployConfig = exports.LandPrConfig = exports.DEFAULT_BUILD_COMMAND = exports.PrGateConfig = exports.GateDefinition = exports.WP_FINISH_PUSH_DEV = exports.WP_PUSH_DEV = exports.WP_FINISH_UPSERT_PR = exports.WP_START_UPSERT_PR = exports.WP_FINISH_UPDATE = exports.WP_START_UPDATE = exports.SyncFlowGuidance = exports.WebpiecesRulesConfig = exports.UPGRADE_SHIM_COMMAND = exports.PRUNE_UNKNOWN_COMMAND = exports.PUSH_DEV_STATE_FILE = exports.MERGE_EXPLANATION_FILE = exports.MERGE_IN_PROGRESS_FILE = exports.MERGE_INFO_DIR = exports.hasDisable = exports.WEBPIECES_DISABLE = exports.AbstractRule = exports.ChangedFilesOptions = exports.DiffRange = exports.DiffScope = exports.isNewOrModified = void 0;
|
|
7
|
+
exports.summaryJsonPath = exports.prDirFor = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.VERDICT_STATUSES = exports.VERDICT_RED = exports.VERDICT_ORANGE = exports.VERDICT_YELLOW = exports.VERDICT_GREEN = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.CK_ORANGE = exports.CK_ORANGE_FIXED = exports.CK_OVERRIDDEN = exports.CK_WARN = exports.CK_PASS = exports.checklistOverrideService = exports.ChecklistOverrideService = exports.ChecklistOverride = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.PrSummary = exports.DEFAULT_RETENTION_DAYS = exports.ProvenanceWriteRequest = exports.OfferedContext = exports.ReviewerPaths = exports.ReviewerTranscript = exports.ReviewProvenance = exports.ReviewProvenanceService = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.TranscriptScan = exports.ExpectedReviewer = exports.ReviewerContext = exports.ReviewerEvidence = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = exports.computeGateToken = exports.GateTokenService = exports.ALL_DIFF_ONE_READ_LINES = exports.READ_TRUNCATION_LINES = exports.ContextEntry = exports.BriefedFile = void 0;
|
|
8
|
+
exports.PathMatchCandidate = exports.FirstPathMatchResult = exports.FirstPathMatch = exports.RuntimeContributionGroup = exports.NodeRuleRuntimeModuleLoader = exports.RuleRuntimeModuleLoader = exports.RuleRuntimeModules = exports.RULE_CATALOG_FILE = exports.RULE_LOCK_FILE = exports.RuleArtifactContents = exports.RulePackArtifacts = exports.ConfigRepairBootstrap = exports.ConfigRepairAccess = exports.RulePackSyncOptions = exports.RulePackSync = exports.PackPolicyFiles = exports.PackPolicyFilesResult = exports.SelectedPolicyPack = exports.PackPolicyDeclaration = exports.LegacyUpgradeResult = exports.LegacyConfigDocument = exports.prepareLegacyUpgrade = exports.RulePackModuleLoader = exports.RulePackDiscovery = exports.NodeRulePackModuleLoader = exports.RulePackRegistry = exports.TMP_SCRATCH_PREFIX = exports.TMP_SCRATCH_RETENTION_DAYS = exports.TmpScratchSweeper = exports.SCRATCH_DIR_NAME = exports.RepoScratchDirs = exports.staleBinSweeper = exports.StaleBinSweeper = exports.StaleBinRemoval = exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.summaryJsonSchemaHint = void 0;
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
10
|
var types_1 = require("./types");
|
|
11
11
|
Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
|
|
@@ -40,7 +40,6 @@ Object.defineProperty(exports, "formatConfigErrorsBanner", { enumerable: true, g
|
|
|
40
40
|
Object.defineProperty(exports, "CONFIG_POLICY_DOC", { enumerable: true, get: function () { return config_error_banner_1.CONFIG_POLICY_DOC; } });
|
|
41
41
|
Object.defineProperty(exports, "RETIRED_KEY_MARKER", { enumerable: true, get: function () { return config_error_banner_1.RETIRED_KEY_MARKER; } });
|
|
42
42
|
Object.defineProperty(exports, "RETIRED_TOP_LEVEL_MARKER", { enumerable: true, get: function () { return config_error_banner_1.RETIRED_TOP_LEVEL_MARKER; } });
|
|
43
|
-
Object.defineProperty(exports, "SECTION_PLACEMENT_MARKER", { enumerable: true, get: function () { return config_error_banner_1.SECTION_PLACEMENT_MARKER; } });
|
|
44
43
|
var config_file_1 = require("./config-file");
|
|
45
44
|
Object.defineProperty(exports, "findConfigFile", { enumerable: true, get: function () { return config_file_1.findConfigFile; } });
|
|
46
45
|
Object.defineProperty(exports, "CONFIG_FILENAME", { enumerable: true, get: function () { return config_file_1.CONFIG_FILENAME; } });
|
|
@@ -48,6 +47,10 @@ Object.defineProperty(exports, "ConfigFile", { enumerable: true, get: function (
|
|
|
48
47
|
Object.defineProperty(exports, "ConfigParseAttempt", { enumerable: true, get: function () { return config_file_1.ConfigParseAttempt; } });
|
|
49
48
|
Object.defineProperty(exports, "CONFIG_PARSE_ATTEMPTS", { enumerable: true, get: function () { return config_file_1.CONFIG_PARSE_ATTEMPTS; } });
|
|
50
49
|
Object.defineProperty(exports, "CONFIG_PARSE_RETRY_MILLIS", { enumerable: true, get: function () { return config_file_1.CONFIG_PARSE_RETRY_MILLIS; } });
|
|
50
|
+
// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather
|
|
51
|
+
// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).
|
|
52
|
+
var config_file_2 = require("./config-file");
|
|
53
|
+
Object.defineProperty(exports, "RawConfigFile", { enumerable: true, get: function () { return config_file_2.RawConfigFile; } });
|
|
51
54
|
var repo_root_1 = require("./repo-root");
|
|
52
55
|
Object.defineProperty(exports, "RepoRootFinder", { enumerable: true, get: function () { return repo_root_1.RepoRootFinder; } });
|
|
53
56
|
Object.defineProperty(exports, "INSTRUCT_AI_DIR", { enumerable: true, get: function () { return repo_root_1.INSTRUCT_AI_DIR; } });
|
|
@@ -117,7 +120,6 @@ var validate_config_1 = require("./validate-config");
|
|
|
117
120
|
Object.defineProperty(exports, "validateWebpiecesConfig", { enumerable: true, get: function () { return validate_config_1.validateWebpiecesConfig; } });
|
|
118
121
|
Object.defineProperty(exports, "validatePrGateSection", { enumerable: true, get: function () { return validate_config_1.validatePrGateSection; } });
|
|
119
122
|
Object.defineProperty(exports, "validateChecklistsSection", { enumerable: true, get: function () { return validate_config_1.validateChecklistsSection; } });
|
|
120
|
-
Object.defineProperty(exports, "validateSectionPlacement", { enumerable: true, get: function () { return validate_config_1.validateSectionPlacement; } });
|
|
121
123
|
Object.defineProperty(exports, "validateExcludePaths", { enumerable: true, get: function () { return validate_config_1.validateExcludePaths; } });
|
|
122
124
|
Object.defineProperty(exports, "validateMatchRulesSection", { enumerable: true, get: function () { return validate_config_1.validateMatchRulesSection; } });
|
|
123
125
|
Object.defineProperty(exports, "allRuleNames", { enumerable: true, get: function () { return validate_config_1.allRuleNames; } });
|
|
@@ -380,6 +382,34 @@ Object.defineProperty(exports, "RulePackRegistry", { enumerable: true, get: func
|
|
|
380
382
|
Object.defineProperty(exports, "NodeRulePackModuleLoader", { enumerable: true, get: function () { return rule_pack_registry_1.NodeRulePackModuleLoader; } });
|
|
381
383
|
Object.defineProperty(exports, "RulePackDiscovery", { enumerable: true, get: function () { return rule_pack_registry_1.RulePackDiscovery; } });
|
|
382
384
|
Object.defineProperty(exports, "RulePackModuleLoader", { enumerable: true, get: function () { return rule_pack_registry_1.RulePackModuleLoader; } });
|
|
383
|
-
var
|
|
384
|
-
Object.defineProperty(exports, "
|
|
385
|
+
var legacy_config_upgrade_1 = require("./legacy-config-upgrade");
|
|
386
|
+
Object.defineProperty(exports, "prepareLegacyUpgrade", { enumerable: true, get: function () { return legacy_config_upgrade_1.prepareLegacyUpgrade; } });
|
|
387
|
+
Object.defineProperty(exports, "LegacyConfigDocument", { enumerable: true, get: function () { return legacy_config_upgrade_1.LegacyConfigDocument; } });
|
|
388
|
+
Object.defineProperty(exports, "LegacyUpgradeResult", { enumerable: true, get: function () { return legacy_config_upgrade_1.LegacyUpgradeResult; } });
|
|
389
|
+
var pack_policy_files_1 = require("./pack-policy-files");
|
|
390
|
+
Object.defineProperty(exports, "PackPolicyDeclaration", { enumerable: true, get: function () { return pack_policy_files_1.PackPolicyDeclaration; } });
|
|
391
|
+
Object.defineProperty(exports, "SelectedPolicyPack", { enumerable: true, get: function () { return pack_policy_files_1.SelectedPolicyPack; } });
|
|
392
|
+
Object.defineProperty(exports, "PackPolicyFilesResult", { enumerable: true, get: function () { return pack_policy_files_1.PackPolicyFilesResult; } });
|
|
393
|
+
Object.defineProperty(exports, "PackPolicyFiles", { enumerable: true, get: function () { return pack_policy_files_1.PackPolicyFiles; } });
|
|
394
|
+
var rule_pack_sync_1 = require("./rule-pack-sync");
|
|
395
|
+
Object.defineProperty(exports, "RulePackSync", { enumerable: true, get: function () { return rule_pack_sync_1.RulePackSync; } });
|
|
396
|
+
Object.defineProperty(exports, "RulePackSyncOptions", { enumerable: true, get: function () { return rule_pack_sync_1.RulePackSyncOptions; } });
|
|
397
|
+
var config_repair_access_1 = require("./config-repair-access");
|
|
398
|
+
Object.defineProperty(exports, "ConfigRepairAccess", { enumerable: true, get: function () { return config_repair_access_1.ConfigRepairAccess; } });
|
|
399
|
+
var config_repair_probe_1 = require("./config-repair-probe");
|
|
400
|
+
Object.defineProperty(exports, "ConfigRepairBootstrap", { enumerable: true, get: function () { return config_repair_probe_1.ConfigRepairBootstrap; } });
|
|
401
|
+
var rule_pack_artifacts_1 = require("./rule-pack-artifacts");
|
|
402
|
+
Object.defineProperty(exports, "RulePackArtifacts", { enumerable: true, get: function () { return rule_pack_artifacts_1.RulePackArtifacts; } });
|
|
403
|
+
Object.defineProperty(exports, "RuleArtifactContents", { enumerable: true, get: function () { return rule_pack_artifacts_1.RuleArtifactContents; } });
|
|
404
|
+
Object.defineProperty(exports, "RULE_LOCK_FILE", { enumerable: true, get: function () { return rule_pack_artifacts_1.RULE_LOCK_FILE; } });
|
|
405
|
+
Object.defineProperty(exports, "RULE_CATALOG_FILE", { enumerable: true, get: function () { return rule_pack_artifacts_1.RULE_CATALOG_FILE; } });
|
|
406
|
+
var rule_runtime_modules_1 = require("./rule-runtime-modules");
|
|
407
|
+
Object.defineProperty(exports, "RuleRuntimeModules", { enumerable: true, get: function () { return rule_runtime_modules_1.RuleRuntimeModules; } });
|
|
408
|
+
Object.defineProperty(exports, "RuleRuntimeModuleLoader", { enumerable: true, get: function () { return rule_runtime_modules_1.RuleRuntimeModuleLoader; } });
|
|
409
|
+
Object.defineProperty(exports, "NodeRuleRuntimeModuleLoader", { enumerable: true, get: function () { return rule_runtime_modules_1.NodeRuleRuntimeModuleLoader; } });
|
|
410
|
+
Object.defineProperty(exports, "RuntimeContributionGroup", { enumerable: true, get: function () { return rule_runtime_modules_1.RuntimeContributionGroup; } });
|
|
411
|
+
var first_path_match_1 = require("./first-path-match");
|
|
412
|
+
Object.defineProperty(exports, "FirstPathMatch", { enumerable: true, get: function () { return first_path_match_1.FirstPathMatch; } });
|
|
413
|
+
Object.defineProperty(exports, "FirstPathMatchResult", { enumerable: true, get: function () { return first_path_match_1.FirstPathMatchResult; } });
|
|
414
|
+
Object.defineProperty(exports, "PathMatchCandidate", { enumerable: true, get: function () { return first_path_match_1.PathMatchCandidate; } });
|
|
385
415
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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,OAAA;AAE1E,6DAAmC;AACnC,oEAA0C;AAC1C,2DAA2H;AAAlH,sHAAA,gBAAgB,OAAA;AAAE,8HAAA,wBAAwB,OAAA;AAAE,uHAAA,iBAAiB,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AAE5F,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\n\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n SECTION_PLACEMENT_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport type { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\n\n\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\n\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope, PathScopeConfig } from './no-custom-css-scope';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateSectionPlacement,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames } from './rule-schemas';\nexport {\n isHookGuard,\n sectionForRule,\n} from './sections';\nexport { shouldSkipRule, HOTFIX_BUILD_COMMAND, HOTFIX_AUDIT_BANNER } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport { WEBPIECES_DISABLE, hasDisable, MERGE_INFO_DIR, MERGE_IN_PROGRESS_FILE, MERGE_EXPLANATION_FILE, PUSH_DEV_STATE_FILE, PRUNE_UNKNOWN_COMMAND, UPGRADE_SHIM_COMMAND } from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\n\n\n\n\n\n\n\n\n\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\n\n\n\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\n\n\n\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\n\n\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n PrSummary,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_ORANGE_FIXED,\n CK_ORANGE,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_ORANGE,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n summaryJsonPath,\n summaryJsonSchemaHint,\n} from './review-json';\n\n\n\n\n\n\n\n\n\n\n\n\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport { TmpScratchSweeper, TMP_SCRATCH_RETENTION_DAYS, TMP_SCRATCH_PREFIX } from './tmp-scratch-sweep';\n\nexport * from './hook-fault-codes';\nexport * from './hook-config-diagnostics';\nexport { RulePackRegistry, NodeRulePackModuleLoader, RulePackDiscovery, RulePackModuleLoader } from './rule-pack-registry';\n\nexport { RulePackSelection } from './rule-pack-selection';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAE3C,qDAA+F;AAAtF,gHAAA,aAAa,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACnE,uGAAuG;AACvG,sFAAsF;AACtF,2CAAwD;AAA/C,oGAAA,MAAM,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACjC,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAAiF;AAAxE,oGAAA,QAAQ,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,qGAAA,SAAS,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AAC5D,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAEhB,6CAA4E;AAAnE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA;AACpD,iGAAiG;AACjG,sCAAsC;AACtC,6DAK+B;AAJ3B,+HAAA,wBAAwB,OAAA;AACxB,wHAAA,iBAAiB,OAAA;AACjB,yHAAA,kBAAkB,OAAA;AAClB,+HAAA,wBAAwB,OAAA;AAE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G5B,uDAA8F;AAArF,kHAAA,cAAc,OAAA;AAAE,wHAAA,oBAAoB,OAAA;AAAE,sHAAA,kBAAkB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport { RuleFailError, renderRuleFailForAi, renderRuleFailForHuman } from './rule-fail-error';\n// THE one representation of a cure, shared by RuleFailError (build-time) and FixHint (edit-time), plus\n// the one renderer that owns the \"Fix Option N:\" numbering and the \"(preferred)\" tag.\nexport { Option, formatFixOptions } from './fix-option';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliFlag, CliArgSet, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\n\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\n// The validation-failure banner: ONE cure (edit the file), plus the marker phrases the validator\n// messages embed rather than re-type.\nexport {\n formatConfigErrorsBanner,\n CONFIG_POLICY_DOC,\n RETIRED_KEY_MARKER,\n RETIRED_TOP_LEVEL_MARKER,\n} from './config-error-banner';\nexport {\n findConfigFile,\n CONFIG_FILENAME,\n ConfigFile,\n ConfigParseAttempt,\n CONFIG_PARSE_ATTEMPTS,\n CONFIG_PARSE_RETRY_MILLIS,\n} from './config-file';\n// The PARSED-BUT-UNVALIDATED config shape. Exported for readers that walk the file generically rather\n// than through the typed config (the pr-gate active-hatch dashboard section reads every rule's hatches).\nexport { RawConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR, INSTRUCT_AI_LEAF } from './repo-root';\n// The scoped `.webpieces` resolver. EVERY reader/writer of `.webpieces/...` goes through one of its two\n// named methods so the call site declares whether the state is repo-wide or worktree-private.\n\n// There is NO machine-global state root. `MachineStateHome`/`StateHome`/`WEBPIECES_STATE_HOME` and the\n// `PrBodyStore` that used them are DELETED: the one artifact that needed a scope above the clone was the\n// gated squash body, and GitHub holds it now (it IS the PR description). Every `.webpieces` path a\n// webpieces tool writes is `{repo}/.webpieces`, resolved through `DotWebpieces` above. See\n// `decisions/0005-the-pr-description-is-the-merge-body.md`.\nexport { AgedTreeSweeper, SweepCount, RETENTION_DAYS } from './aged-tree-sweep';\nexport {\n ClaudeEnv,\n claudeEnv,\n CLAUDE_PROJECT_DIR_ENV,\n CLAUDE_PROJECT_DIR_UNSET,\n} from './claude-env';\n\n// The ONE formatter for a remedy that must run in a named directory: `cd '<root>' && <command>`.\n// Single-quoted so a repo path containing a space is still runnable (and still un-smuggleable).\nexport { atRoot } from './at-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths, isWebpiecesStateDir } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\n// The machine-generated trees a line-count rule never fires on. A FLOOR, not a default value:\n// `max-file-lines.allowedPaths` adds to it, so configuring your own tree cannot lose it.\nexport { GENERATED_CODE_PATHS } from './generated-code-paths';\n// THE one `no-custom-css` path exemption. Both engines that enforce the rule (the edit-time hook and the\n// CI validator) consult this class, so `allowGlobs` cannot be honoured by one half and ignored by the other.\nexport { NoCustomCssScope, PathScopeConfig } from './no-custom-css-scope';\nexport {\n loadTemplate,\n writeTemplateIfMissing,\n writeTemplate,\n TemplateWriter,\n} from './load-template';\n// The instruct-ai docs are delivered as a SET: writing one writes the transitive closure of the docs it\n// links to, so a doc and everything it points at always land together. See instruct-ai-docs.ts.\nexport {\n GIT_WORKFLOW_DOC,\n GitWorkflowDoc,\n InstructAiDoc,\n InstructAiDocSet,\n MergeProcessDoc,\n} from './instruct-ai-docs';\nexport {\n MERGE_PROCESS_DOC,\n MergeProcessText,\n MergeRun,\n ReferenceMergeRun,\n} from './merge-process-doc';\nexport { BUILD_LOG_DOC } from './build-log-doc';\nexport {\n validateWebpiecesConfig,\n validatePrGateSection,\n validateChecklistsSection,\n validateExcludePaths,\n validateMatchRulesSection,\n allRuleNames,\n recommendedSeedMode,\n recommendedSeedModeFor,\n seedEntryForRule,\n} from './validate-config';\nexport { validateCommandsSection } from './commands-section-validators';\nexport {\n unknownKeyErrors,\n isCommentKey,\n validateTopLevelKeys,\n COMMENT_KEY_SUFFIX,\n} from './config-key-rules';\n// The retired-key table + the no-back-compat policy it enforces. Exported so the installer can migrate\n// what the errors instruct, and so consumers can enumerate retirements.\nexport {\n RETIRED_CONFIG_KEYS,\n RETIRED_SCOPE_KEY,\n RETIRED_SCOPE_RULE,\n isRetiredKey,\n retiredEntry,\n retiredKeyError,\n retiredKeyErrorsIn,\n retiredRuleFor,\n} from './retired-config-keys';\n// The MECHANICAL cure the unknown-rule error and the banner both name: strip every key no validator has a\n// schema for, so cleanliness is one command rather than a judgement call made while every Bash call is\n// blocked. `PRUNE_UNKNOWN_COMMAND` (constants.ts) is the single spelling of that command.\nexport { ConfigPruner, PruneResult, PrunedKey } from './config-pruner';\nexport { validateChecklistDocs } from './checklist-docs-validator';\n// The OPTIONAL machine-local `~/.webpieces/config.json`: absent (the normal state for every consumer) means\n// each key's declared default, silently; present means STRICT about what it understands and FORWARD-COMPATIBLE\n// about what it does not. A retired key (its own retirement table), a known key of the wrong TYPE and an\n// unparseable document all REJECT; a key this release simply does not recognise is IGNORED with a warning,\n// because the file is machine-global and the repos reading it pin different releases — rejecting a newer\n// release's key would hard-block every repo on the machine that is not yet on it. See home-config.ts.\n// `isHomeConfigPath` is what grants the file its unconditional Write/Edit PASS in the hook guards, which is\n// what keeps a rejection repairable. Every `experimental.*` key is an OPT-IN that defaults OFF, including\n// `whole-repo-build-guard`: ON requires an explicit `true`, and there is no per-key default to export.\nexport {\n HomeConfig,\n HomeConfigService,\n RetiredHomeConfigKey,\n RETIRED_HOME_CONFIG_KEYS,\n HOME_CONFIG_DIR,\n HOME_CONFIG_FILE,\n HOME_EXPERIMENTAL_SECTION,\n HOME_KEY_ORPHAN_DIR_SWEEP,\n HOME_KEY_WHOLE_REPO_BUILD_GUARD,\n HOME_KEY_MAX_CONCURRENT_BUILDS,\n HOME_KEY_TURN_OFF_ALL_REVIEWERS,\n DEFAULT_MAX_CONCURRENT_BUILDS,\n HOME_KEY_DOC,\n HOME_KEY_AI_DOC,\n DOCUMENTATION_KEYS,\n} from './home-config';\n// The MACHINE-WIDE build ledger, `~/.webpieces/builds.log`. THE one carve-out from\n// `no-machine-global-state.spec.ts`'s rule that webpieces writes only under `{repo}/.webpieces` — the\n// argument is in `decisions/0006-the-build-ledger-is-machine-global.md`, and the short form is that \"how\n// many builds are burning this box's CPU\" is a fact about the MACHINE, is not a cache of anything a\n// remote owns, and cannot be answered from a per-repo file because every linked worktree has its own\n// `.webpieces/` and would be blind to the sibling it is contending with. See builds-log.ts.\nexport {\n BuildsLog,\n BuildTicket,\n BuildTermination,\n RunningBuild,\n BUILDS_LOG_FILE,\n BUILDS_LOCK_FILE,\n BUILD_START,\n BUILD_DONE_SUCCESS,\n BUILD_DONE_FAIL,\n MAX_BUILDS_LOG_BYTES,\n BUILDS_LOG_GENERATIONS,\n MAX_ROW_BYTES,\n} from './builds-log';\n// The orphan-directory sweep: the corpse an `nx g move` leaves on every clone, which git cannot remove\n// because an ignored dist/ or node_modules/ outlives every tracked file under it. See orphan-dir-scan.ts\n// for why the predicate is git's own `clean -Xdn` answer rather than a hand-rolled ignore walk.\nexport { OrphanDirScanner, OrphanCandidate } from './orphan-dir-scan';\nexport {\n OrphanDirArchiver,\n ArchivedOrphan,\n FailedOrphan,\n OrphanSweepResult,\n OrphanSweepManifest,\n TRASH_STATE_DIR,\n TRASH_MANIFEST_FILE,\n TRASH_RETENTION_DAYS,\n} from './orphan-dir-archive';\nexport { OrphanDirSweeper, OrphanSweepReport } from './orphan-dir-sweep';\nexport {\n MatchRuleConfig,\n MatchRuleViolation,\n findMatchRuleViolations,\n isMatchRuleAllowedPath,\n compileMatchRulePatterns,\n renderMatchRuleMessage,\n DEFAULT_MATCH_RULES,\n} from './match-rules-config';\nexport type { ConfigSection } from './sections';\nexport { schemaFieldNames } from './rule-schemas';\nexport { isHookGuard, sectionForRule } from './sections';\nexport { shouldSkipRule, HOTFIX_BUILD_COMMAND, HOTFIX_AUDIT_BANNER } from './skip-rule';\nexport { SkipRuleResult } from './skip-rule';\nexport {\n detectBase,\n resolveBase,\n getChangedFiles,\n getFileDiff,\n getChangedLineNumbers,\n findNewMethodSignaturesInDiff,\n hasChangesInRange,\n isNewOrModified,\n DiffScope,\n DiffRange,\n ChangedFilesOptions,\n} from './diff-scope';\nexport { AbstractRule } from './abstract-rule';\nexport {\n WEBPIECES_DISABLE,\n hasDisable,\n MERGE_INFO_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\n PUSH_DEV_STATE_FILE,\n PRUNE_UNKNOWN_COMMAND,\n UPGRADE_SHIM_COMMAND,\n} from './constants';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n SyncFlowGuidance,\n WP_START_UPDATE,\n WP_FINISH_UPDATE,\n WP_START_UPSERT_PR,\n WP_FINISH_UPSERT_PR,\n WP_PUSH_DEV,\n WP_FINISH_PUSH_DEV,\n} from './sync-flow-guidance';\n\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\n\n// The `no-state-paths-in-templates` config, in its own module for the same reason no-client-creation is:\n// rule-configs.ts is at its file-size cap and a rule that carries real defaults belongs beside them.\n\nexport {\n GateDefinition,\n PrGateConfig,\n DEFAULT_BUILD_COMMAND,\n LandPrConfig,\n DevDeployConfig,\n DEFAULT_DEV_BRANCH_NAMESPACE,\n DEFAULT_DEV_BRANCH,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n defaultDevDeployConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n buildDevDeployConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\n ReviewerAgentPolicy,\n REVIEWER_AGENTS_PLACEHOLDER,\n DEFAULT_REVIEWER_AGENT_NAME,\n toChecklist,\n normalizeChecklistDoc,\n formatFileList,\n} from './checklist-config';\nexport type { RawChecklistItem } from './checklist-config';\nexport { ChecklistValidator } from './checklist-validator';\nexport { ChecklistInstructionsService } from './checklist-instructions';\nexport {\n ReviewerInstructionsService,\n ReviewerBriefing,\n BriefedFile,\n ContextEntry,\n READ_TRUNCATION_LINES,\n ALL_DIFF_ONE_READ_LINES,\n} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n ReviewerContext,\n ExpectedReviewer,\n TranscriptScan,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\n\nexport {\n ReviewProvenanceService,\n ReviewProvenance,\n ReviewerTranscript,\n ReviewerPaths,\n OfferedContext,\n ProvenanceWriteRequest,\n DEFAULT_RETENTION_DAYS,\n} from './review-provenance';\nexport {\n PrSummary,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n ChecklistOverride,\n ChecklistOverrideService,\n checklistOverrideService,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_ORANGE_FIXED,\n CK_ORANGE,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_ORANGE,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n prDirFor,\n summaryJsonPath,\n summaryJsonSchemaHint,\n} from './review-json';\n\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\nexport { StaleBinRemoval, StaleBinSweeper, staleBinSweeper } from './stale-bin-sweep';\nexport { RepoScratchDirs, SCRATCH_DIR_NAME } from './repo-scratch-dirs';\nexport {\n TmpScratchSweeper,\n TMP_SCRATCH_RETENTION_DAYS,\n TMP_SCRATCH_PREFIX,\n} from './tmp-scratch-sweep';\n\nexport * from './hook-fault-codes';\nexport * from './hook-config-diagnostics';\nexport {\n RulePackRegistry,\n NodeRulePackModuleLoader,\n RulePackDiscovery,\n RulePackModuleLoader,\n} from './rule-pack-registry';\n\nexport {\n prepareLegacyUpgrade,\n LegacyConfigDocument,\n LegacyUpgradeResult,\n} from './legacy-config-upgrade';\nexport {\n PackPolicyDeclaration,\n SelectedPolicyPack,\n PackPolicyFilesResult,\n PackPolicyFiles,\n} from './pack-policy-files';\nexport { RulePackSync, RulePackSyncOptions } from './rule-pack-sync';\nexport { ConfigRepairAccess } from './config-repair-access';\nexport { ConfigRepairBootstrap } from './config-repair-probe';\nexport {\n RulePackArtifacts,\n RuleArtifactContents,\n RULE_LOCK_FILE,\n RULE_CATALOG_FILE,\n} from './rule-pack-artifacts';\nexport {\n RuleRuntimeModules,\n RuleRuntimeModuleLoader,\n NodeRuleRuntimeModuleLoader,\n RuntimeContributionGroup,\n} from './rule-runtime-modules';\n\nexport { FirstPathMatch, FirstPathMatchResult, PathMatchCandidate } from './first-path-match';\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Previous-root conversion is reachable only through an explicit upgrade command; normal loading never calls it. */
|
|
2
|
+
import { RulePackRegistry } from './rule-pack-registry';
|
|
3
|
+
type Json = Record<string, unknown>;
|
|
4
|
+
type RuleEntry = Json;
|
|
5
|
+
type Section = Record<string, RuleEntry>;
|
|
6
|
+
export declare class LegacyConfigDocument {
|
|
7
|
+
readonly rules: Section;
|
|
8
|
+
readonly hookGuards: Section;
|
|
9
|
+
readonly commands: Json;
|
|
10
|
+
readonly excludePaths: string[];
|
|
11
|
+
readonly rulesDir: string[];
|
|
12
|
+
readonly 'match-rules': Json[];
|
|
13
|
+
readonly extends: string | undefined;
|
|
14
|
+
constructor(rules: Section, hookGuards: Section, commands: Json, excludePaths: string[], matches: Json[], rulesDir: string[], inheritedFrom: string | undefined);
|
|
15
|
+
}
|
|
16
|
+
export declare class LegacyUpgradeResult {
|
|
17
|
+
readonly config: LegacyConfigDocument;
|
|
18
|
+
readonly changes: string[];
|
|
19
|
+
constructor(config: LegacyConfigDocument, changes: string[]);
|
|
20
|
+
}
|
|
21
|
+
export declare function prepareLegacyUpgrade(existing: Json, registry: RulePackRegistry): LegacyUpgradeResult;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LegacyUpgradeResult = exports.LegacyConfigDocument = void 0;
|
|
4
|
+
exports.prepareLegacyUpgrade = prepareLegacyUpgrade;
|
|
5
|
+
const validate_config_1 = require("./validate-config");
|
|
6
|
+
const rule_schemas_1 = require("./rule-schemas");
|
|
7
|
+
const sections_1 = require("./sections");
|
|
8
|
+
const match_rules_config_1 = require("./match-rules-config");
|
|
9
|
+
const pr_gate_config_1 = require("./pr-gate-config");
|
|
10
|
+
const retired_config_keys_1 = require("./retired-config-keys");
|
|
11
|
+
// Explicit upgrade applies owner-declared retirements and writes reviewed settings.
|
|
12
|
+
const DEFAULT_UPSERT_PR = 'pnpm wp-start-upsert-pr';
|
|
13
|
+
const DEFAULT_MERGE_COMPLETE = 'pnpm wp-finish-upsert-pr';
|
|
14
|
+
class LegacyConfigDocument {
|
|
15
|
+
rules;
|
|
16
|
+
hookGuards;
|
|
17
|
+
commands;
|
|
18
|
+
excludePaths;
|
|
19
|
+
rulesDir;
|
|
20
|
+
'match-rules';
|
|
21
|
+
extends;
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
+
constructor(rules, hookGuards, commands, excludePaths, matches, rulesDir, inheritedFrom) {
|
|
24
|
+
this.rules = rules;
|
|
25
|
+
this.hookGuards = hookGuards;
|
|
26
|
+
this.commands = commands;
|
|
27
|
+
this.excludePaths = excludePaths;
|
|
28
|
+
this.rulesDir = rulesDir;
|
|
29
|
+
this['match-rules'] = matches;
|
|
30
|
+
this.extends = inheritedFrom;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.LegacyConfigDocument = LegacyConfigDocument;
|
|
34
|
+
class LegacyUpgradeResult {
|
|
35
|
+
config;
|
|
36
|
+
changes;
|
|
37
|
+
constructor(config, changes) {
|
|
38
|
+
this.config = config;
|
|
39
|
+
this.changes = changes;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.LegacyUpgradeResult = LegacyUpgradeResult;
|
|
43
|
+
// webpieces-disable no-function-outside-class -- sibling of the other seed* helpers; this module is config-shape builders by design
|
|
44
|
+
function seedRule(ruleName, registry) {
|
|
45
|
+
// Both escape hatches are seeded (and REQUIRED) so every rule block shows them: 0 = active,
|
|
46
|
+
// null = no branch scoping. A human/AI edits these to time-box or branch-scope a rule off.
|
|
47
|
+
//
|
|
48
|
+
// The ENTIRE entry comes from rules-config's seedEntryForRule() — the same module that owns the
|
|
49
|
+
// schema the loader validates against, so the installer can never emit an entry the loader
|
|
50
|
+
// rejects. It supplies: the recommended mode (the SAME recommendation the validator prints in its
|
|
51
|
+
// copy-paste snippet, so seed and advice cannot disagree), both hatches, and a default for every
|
|
52
|
+
// other schema-REQUIRED field. Seeding used to be a flat 'OFF' plus the two hatches, which was
|
|
53
|
+
// wrong twice over: adopters got nothing enforced, AND the entry was missing required fields
|
|
54
|
+
// (e.g. branch-creation-guard.autoReapMergedBranches), so the config failed to load on first run.
|
|
55
|
+
return (0, validate_config_1.seedEntryForRule)(ruleName, registry);
|
|
56
|
+
}
|
|
57
|
+
// The guard-hint command strings live under `guardHints`. The flat `upsertPr`/`mergeComplete` keys this
|
|
58
|
+
// used to seed are RETIRED and now fail validation — seeding them meant every freshly installed repo was
|
|
59
|
+
// born on a shape the validator rejects.
|
|
60
|
+
// Required excludePaths block: ONE glob list suppressing hook enforcement per file path. Seeded empty
|
|
61
|
+
// (enforce everywhere) — a client adds paths (e.g. "repositories/**") to exempt vendored trees.
|
|
62
|
+
//
|
|
63
|
+
// Deliberately NOT seeded with webpieces' own `.webpieces/` state dir. That exemption lives in CODE
|
|
64
|
+
// (`isWebpiecesStateDir`, consulted by `filterByExcludedPaths` ahead of this list and regardless of it),
|
|
65
|
+
// and a glob here would be a second, weaker spelling of it — weaker because `.webpieces/**` compiles to
|
|
66
|
+
// an anchored regex that misses the bare directory the predicate matches, and because a config entry
|
|
67
|
+
// invites a consumer to delete it and believe the exemption went with it.
|
|
68
|
+
// Bring an existing `excludePaths` forward to the single-list shape. Already a list → untouched.
|
|
69
|
+
// Legacy `{ rules, guards }` → unioned (order preserved, duplicates dropped) and recorded as a change
|
|
70
|
+
// so `pnpm wp-rules-sync --upgrade` is the migration path rather than a hand-edit. Anything else → seeded [].
|
|
71
|
+
// webpieces-disable no-any-unknown -- opaque legacy JSON is narrowed before use
|
|
72
|
+
// webpieces-disable no-function-outside-class -- pure legacy config conversion helper
|
|
73
|
+
function migrateExcludePaths(raw, changes) {
|
|
74
|
+
if (Array.isArray(raw))
|
|
75
|
+
return raw.filter((p) => typeof p === 'string');
|
|
76
|
+
if (typeof raw === 'object' && raw !== null) {
|
|
77
|
+
// webpieces-disable no-any-unknown -- narrowing the opaque legacy block from consumer JSON
|
|
78
|
+
const legacy = raw;
|
|
79
|
+
const rules = Array.isArray(legacy['rules']) ? legacy['rules'] : [];
|
|
80
|
+
const guards = Array.isArray(legacy['guards']) ? legacy['guards'] : [];
|
|
81
|
+
const merged = [
|
|
82
|
+
...new Set([...rules, ...guards].filter((p) => typeof p === 'string')),
|
|
83
|
+
];
|
|
84
|
+
changes.push(`migrated excludePaths {rules,guards} -> one list (${merged.length} path(s))`);
|
|
85
|
+
return merged;
|
|
86
|
+
}
|
|
87
|
+
changes.push('added excludePaths ([])');
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
/** One retired flat command string and the guardHints field it becomes. Data-only (per CLAUDE.md). */
|
|
91
|
+
class GuardHintMove {
|
|
92
|
+
retiredKey;
|
|
93
|
+
hintKey;
|
|
94
|
+
fallback;
|
|
95
|
+
constructor(retiredKey, hintKey, fallback) {
|
|
96
|
+
this.retiredKey = retiredKey;
|
|
97
|
+
this.hintKey = hintKey;
|
|
98
|
+
this.fallback = fallback;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Bring `commands` forward to the `guardHints` shape, moving the RETIRED flat `upsertPr`/`mergeComplete`
|
|
103
|
+
* strings and DELETING them. Deleting is the point: the validator now rejects them, so leaving them behind
|
|
104
|
+
* would keep the config failing after a "successful" sync.
|
|
105
|
+
*
|
|
106
|
+
* The consumer's own value wins over the default — a repo that renamed its gated command keeps that name.
|
|
107
|
+
*/
|
|
108
|
+
// webpieces-disable no-function-outside-class -- sibling of the other seed*/migrate* helpers; this module is config-shape builders by design
|
|
109
|
+
function migrateGuardHints(commands, changes) {
|
|
110
|
+
const hints = typeof commands['guardHints'] === 'object' && commands['guardHints'] !== null
|
|
111
|
+
? commands['guardHints']
|
|
112
|
+
: {};
|
|
113
|
+
const moves = [
|
|
114
|
+
new GuardHintMove('upsertPr', 'prCreationOrPush', DEFAULT_UPSERT_PR),
|
|
115
|
+
new GuardHintMove('mergeComplete', 'mergeInProgress', DEFAULT_MERGE_COMPLETE),
|
|
116
|
+
];
|
|
117
|
+
for (const move of moves) {
|
|
118
|
+
const retiredKey = move.retiredKey;
|
|
119
|
+
const hintKey = move.hintKey;
|
|
120
|
+
const fallback = move.fallback;
|
|
121
|
+
const carried = commands[retiredKey];
|
|
122
|
+
if (carried !== undefined) {
|
|
123
|
+
delete commands[retiredKey];
|
|
124
|
+
if (hints[hintKey] === undefined)
|
|
125
|
+
hints[hintKey] = carried;
|
|
126
|
+
changes.push(`moved retired commands.${retiredKey} -> commands.guardHints.${hintKey}`);
|
|
127
|
+
}
|
|
128
|
+
if (hints[hintKey] === undefined) {
|
|
129
|
+
hints[hintKey] = fallback;
|
|
130
|
+
changes.push(`added commands.guardHints.${hintKey}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
commands['guardHints'] = hints;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Apply the RETIRED rule/guard retirements in place. These used to be rewritten silently at load time, so
|
|
137
|
+
* a consumer's file kept the dead name forever; the loader now rejects it, which makes this the one
|
|
138
|
+
* command that can fix the file. Skips a rename when the new name is already configured, so an explicit
|
|
139
|
+
* entry is never clobbered by a stale one.
|
|
140
|
+
*
|
|
141
|
+
* NOT EVERY RETIREMENT IS A RENAME, and treating them all as one produced garbage. `whole-repo-build-guard`
|
|
142
|
+
* moved OUT of webpieces.config.json entirely — its `movedTo` is the PROSE destination
|
|
143
|
+
* `~/.webpieces/config.json → experimental.whole-repo-build-guard`, not a sibling key — so the rename
|
|
144
|
+
* branch below would have created a hookGuards entry literally named that whole sentence, which no
|
|
145
|
+
* validator knows and which the next run reports as another unknown rule. `prunable` is the discriminator:
|
|
146
|
+
* when the entry says deleting is the whole fix, DELETE it, exactly as `ConfigPruner` does.
|
|
147
|
+
*/
|
|
148
|
+
// webpieces-disable no-function-outside-class -- sibling of the other seed*/migrate* helpers; this module is config-shape builders by design
|
|
149
|
+
function migrateRetiredRuleNames(section, changes, registry) {
|
|
150
|
+
for (const entry of registry.migrations()) {
|
|
151
|
+
if (entry.scope !== retired_config_keys_1.RETIRED_SCOPE_RULE)
|
|
152
|
+
continue;
|
|
153
|
+
if (!(entry.key in section))
|
|
154
|
+
continue;
|
|
155
|
+
if (entry.prunable) {
|
|
156
|
+
delete section[entry.key];
|
|
157
|
+
changes.push(`deleted retired "${entry.key}" (it moved to ${entry.movedTo})`);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
mergeIntoDestination(section, entry.key, entry.movedTo, changes, registry);
|
|
161
|
+
}
|
|
162
|
+
fillRequiredFields(section, changes, registry);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Fold one retired key's entry into its destination, whether the destination exists yet or not.
|
|
166
|
+
*
|
|
167
|
+
* THIS IS N→1, NOT 1:1, and the difference is the whole reason this helper exists. Four retired keys
|
|
168
|
+
* now point at ONE destination (`branch-state-guard`, `pr-lifecycle-guard`). The previous code renamed
|
|
169
|
+
* the first key it met and then, finding the destination already present, DELETED each of the other
|
|
170
|
+
* three outright — so which guard's settings survived depended on RETIRED_CONFIG_KEYS declaration
|
|
171
|
+
* order rather than on the consumer's file, and the survivor carried only that one guard's fields, so
|
|
172
|
+
* it was missing required fields of the merged schema. `pnpm wp-rules-sync --upgrade` is the command advertised
|
|
173
|
+
* as the migration path; half-migrating every consumer into an invalid config is not an option.
|
|
174
|
+
*
|
|
175
|
+
* UNION, first writer wins per field. Earlier-declared keys are the more specific ones (only
|
|
176
|
+
* feature-branch-guard carries `branchNamingConvention`), and a field already present on the
|
|
177
|
+
* destination — because the consumer wrote it, or an earlier key contributed it — is never overwritten.
|
|
178
|
+
* Fields the merged schema does not know are dropped by the same pass, since carrying a deleted field
|
|
179
|
+
* across (`upsertPrCommand`) would produce a config the validator immediately rejects.
|
|
180
|
+
*/
|
|
181
|
+
// webpieces-disable no-function-outside-class -- sibling of the other seed*/migrate* helpers; this module is config-shape builders by design
|
|
182
|
+
function mergeIntoDestination(section, key, destination, changes, registry) {
|
|
183
|
+
const source = asSection(section[key]);
|
|
184
|
+
delete section[key];
|
|
185
|
+
const fields = (0, rule_schemas_1.schemaFieldNames)(destination, registry);
|
|
186
|
+
const target = asSection(section[destination]);
|
|
187
|
+
const existed = destination in section;
|
|
188
|
+
const carried = [];
|
|
189
|
+
const dropped = [];
|
|
190
|
+
for (const field of Object.keys(source)) {
|
|
191
|
+
if (fields !== null && !fields.includes(field)) {
|
|
192
|
+
dropped.push(field);
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (field in target)
|
|
196
|
+
continue;
|
|
197
|
+
target[field] = source[field];
|
|
198
|
+
carried.push(field);
|
|
199
|
+
}
|
|
200
|
+
section[destination] = target;
|
|
201
|
+
const verb = existed ? 'merged' : 'renamed';
|
|
202
|
+
const droppedNote = dropped.length > 0 ? `; dropped deleted field(s) ${dropped.join(', ')}` : '';
|
|
203
|
+
changes.push(`${verb} retired "${key}" -> "${destination}" (carried ${carried.join(', ') || 'nothing new'}${droppedNote})`);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Fill any schema-REQUIRED field a migrated entry ended up without.
|
|
207
|
+
*
|
|
208
|
+
* A union of four partial entries is not guaranteed to satisfy the destination's schema — the merged
|
|
209
|
+
* `branch-state-guard` needs `mode` and both escape hatches, and a consumer whose four old entries
|
|
210
|
+
* predate one of them would land short. Seeding the gap from the SAME source the installer and the
|
|
211
|
+
* validator use (seedEntryForRule) is what makes the install command a complete instruction
|
|
212
|
+
* rather than a first step. Only ever ADDS; a value the consumer stated is never touched.
|
|
213
|
+
*/
|
|
214
|
+
// webpieces-disable no-function-outside-class -- sibling of the other seed*/migrate* helpers; this module is config-shape builders by design
|
|
215
|
+
function fillRequiredFields(section, changes, registry) {
|
|
216
|
+
for (const name of Object.keys(section)) {
|
|
217
|
+
if ((0, rule_schemas_1.schemaFieldNames)(name, registry) === null)
|
|
218
|
+
continue;
|
|
219
|
+
// A rule ENTRY is a flat bag of scalars, so it is read as Json here rather than through
|
|
220
|
+
// asSection (whose values are whole entries). Same object either way; only the view differs.
|
|
221
|
+
const entry = asSection(section[name]);
|
|
222
|
+
const seed = (0, validate_config_1.seedEntryForRule)(name, registry);
|
|
223
|
+
const added = [];
|
|
224
|
+
for (const field of Object.keys(seed)) {
|
|
225
|
+
if (field in entry)
|
|
226
|
+
continue;
|
|
227
|
+
entry[field] = seed[field];
|
|
228
|
+
added.push(field);
|
|
229
|
+
}
|
|
230
|
+
if (added.length === 0)
|
|
231
|
+
continue;
|
|
232
|
+
section[name] = entry;
|
|
233
|
+
changes.push(`filled required field(s) on "${name}": ${added.join(', ')}`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Deep-copy the framework's default match-rules (the no-fetch guard) into plain JSON for the config
|
|
237
|
+
// file. Round-tripping through JSON turns the MatchRuleConfig instances into plain objects.
|
|
238
|
+
// webpieces-disable no-function-outside-class -- this module is deliberately DI-FREE: `pnpm wp-rules-sync --upgrade` must run on a half-written node_modules (see install-entry.ts), so it cannot build a container to hold a method
|
|
239
|
+
function seedMatchRules() {
|
|
240
|
+
return JSON.parse(JSON.stringify(match_rules_config_1.DEFAULT_MATCH_RULES));
|
|
241
|
+
}
|
|
242
|
+
// webpieces-disable no-function-outside-class -- this module is deliberately DI-FREE: `pnpm wp-rules-sync --upgrade` must run on a half-written node_modules (see install-entry.ts), so it cannot build a container to hold a method
|
|
243
|
+
function asSection(value) {
|
|
244
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
245
|
+
? value
|
|
246
|
+
: {};
|
|
247
|
+
}
|
|
248
|
+
// Migrate an existing config to the rules / hookGuards / commands layout and add any missing rules.
|
|
249
|
+
// Returns a human-readable list of what changed (empty = already up to date).
|
|
250
|
+
// webpieces-disable no-function-outside-class -- this module is deliberately DI-FREE: `pnpm wp-rules-sync --upgrade` must run on a half-written node_modules (see install-entry.ts), so it cannot build a container to hold a method
|
|
251
|
+
function prepareLegacyUpgrade(existing, registry) {
|
|
252
|
+
const changes = [];
|
|
253
|
+
const rules = asSection(existing['rules']);
|
|
254
|
+
const hookGuards = asSection(existing['hookGuards']);
|
|
255
|
+
const commands = typeof existing['commands'] === 'object' && existing['commands'] !== null
|
|
256
|
+
? existing['commands']
|
|
257
|
+
: {};
|
|
258
|
+
// Move a deprecated top-level pr-gate block under commands.
|
|
259
|
+
if (existing['pr-gate'] !== undefined && commands['pr-gate'] === undefined) {
|
|
260
|
+
commands['pr-gate'] = existing['pr-gate'];
|
|
261
|
+
changes.push('moved top-level "pr-gate" → commands["pr-gate"]');
|
|
262
|
+
}
|
|
263
|
+
// Apply retired RENAMES first, so a renamed guard is placed and presence-checked under its new name
|
|
264
|
+
// rather than being treated as unknown and re-added alongside its own stale entry.
|
|
265
|
+
migrateRetiredRuleNames(rules, changes, registry);
|
|
266
|
+
migrateRetiredRuleNames(hookGuards, changes, registry);
|
|
267
|
+
migratePolicySections(rules, hookGuards, changes, registry);
|
|
268
|
+
// Add any missing built-in into its correct section, ENFORCING at its recommended mode (not OFF).
|
|
269
|
+
for (const name of (0, validate_config_1.allRuleNames)(registry)) {
|
|
270
|
+
const target = (0, sections_1.sectionForRule)(name, registry) === 'hookGuards' ? hookGuards : rules;
|
|
271
|
+
if (!(name in target)) {
|
|
272
|
+
const entry = seedRule(name, registry);
|
|
273
|
+
target[name] = entry;
|
|
274
|
+
changes.push(`added "${name}" (${String(entry['mode'])}) to ${(0, sections_1.sectionForRule)(name, registry)}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
// Fill command defaults.
|
|
278
|
+
if (commands['pr-gate'] === undefined) {
|
|
279
|
+
commands['pr-gate'] = { mode: 'OFF', buildCommand: pr_gate_config_1.DEFAULT_BUILD_COMMAND, gates: [] };
|
|
280
|
+
changes.push('added commands["pr-gate"] (OFF)');
|
|
281
|
+
}
|
|
282
|
+
migrateGuardHints(commands, changes);
|
|
283
|
+
// Seed the now-required excludePaths list (empty = enforce everywhere) if the config predates it,
|
|
284
|
+
// and MIGRATE the legacy `{ rules: [], guards: [] }` object to the single list by unioning them.
|
|
285
|
+
// The union is behaviour-preserving for every config we have seen (both lists set identically), and
|
|
286
|
+
// widening is the safe direction anyway: a path either side excluded stays excluded.
|
|
287
|
+
const excludePaths = migrateExcludePaths(existing['excludePaths'], changes);
|
|
288
|
+
const matchRules = upgradeMatchRules(existing, changes);
|
|
289
|
+
const rulesDir = Array.isArray(existing['rulesDir'])
|
|
290
|
+
? existing['rulesDir']
|
|
291
|
+
: [];
|
|
292
|
+
const inherited = typeof existing['extends'] === 'string' ? existing['extends'] : undefined;
|
|
293
|
+
return new LegacyUpgradeResult(new LegacyConfigDocument(rules, hookGuards, commands, excludePaths, matchRules, rulesDir, inherited), changes);
|
|
294
|
+
}
|
|
295
|
+
// webpieces-disable no-function-outside-class -- explicit upgrade conversion remains independent of DI
|
|
296
|
+
function migratePolicySections(rules, hookGuards, changes, registry) {
|
|
297
|
+
// Move guards mistakenly left in rules into hookGuards.
|
|
298
|
+
for (const name of Object.keys(rules)) {
|
|
299
|
+
if ((0, sections_1.isHookGuard)(name, registry)) {
|
|
300
|
+
hookGuards[name] = rules[name];
|
|
301
|
+
delete rules[name];
|
|
302
|
+
changes.push(`moved "${name}" from rules → hookGuards`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// Move code rules mistakenly placed in hookGuards back into rules.
|
|
306
|
+
for (const name of Object.keys(hookGuards)) {
|
|
307
|
+
if (!(0, sections_1.isHookGuard)(name, registry) && (0, validate_config_1.allRuleNames)(registry).includes(name)) {
|
|
308
|
+
rules[name] = hookGuards[name];
|
|
309
|
+
delete hookGuards[name];
|
|
310
|
+
changes.push(`moved "${name}" from hookGuards → rules`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// webpieces-disable no-function-outside-class -- pure explicit-upgrade conversion
|
|
315
|
+
function upgradeMatchRules(existing, changes) {
|
|
316
|
+
// Seed the now-required match-rules array (with the default no-fetch guard) if the config predates
|
|
317
|
+
// it. A client that has already customized it keeps their array untouched.
|
|
318
|
+
let matchRules;
|
|
319
|
+
if (Array.isArray(existing['match-rules'])) {
|
|
320
|
+
matchRules = existing['match-rules'];
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
matchRules = seedMatchRules();
|
|
324
|
+
changes.push('added "match-rules" (seeded with the no-fetch guard)');
|
|
325
|
+
}
|
|
326
|
+
return matchRules;
|
|
327
|
+
}
|
|
328
|
+
//# sourceMappingURL=legacy-config-upgrade.js.map
|