@webpieces/rules-config 0.4.507 → 0.4.509

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/rules-config",
3
- "version": "0.4.507",
3
+ "version": "0.4.509",
4
4
  "description": "Shared webpieces.config.json loader. Single source of truth for validation rule configuration consumed by @webpieces/ai-hook-rules, @webpieces/code-rules, and @webpieces/nx-webpieces-rules.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
package/src/index.d.ts CHANGED
@@ -44,7 +44,7 @@ export { GateTokenService, computeGateToken, gateTokenMarker, extractGateToken,
44
44
  export { SubagentProvenanceService, ReviewerEvidence, EvidenceRequest, ProvenanceResult, PROVENANCE_OK, PROVENANCE_MISSING, PROVENANCE_SKIPPED, } from './subagent-provenance';
45
45
  export { ReviewJson, PrContext, ChecklistResult, ChecklistVerdict, CK_PASS, CK_WARN, CK_OVERRIDDEN, CK_FAIL, CK_MISSING, CK_BAD_FORMAT, VERDICT_GREEN, VERDICT_YELLOW, VERDICT_RED, VERDICT_STATUSES, RequiredChecklist, ChecklistReviewContext, ReviewJsonService, loadReviewJson, prDirFor, reviewJsonPath, reviewJsonSchemaHint, } from './review-json';
46
46
  export { MainSyncStatus, MainSyncLock, MainSyncStatusService, DEFAULT_HANG_TIMEOUT_MINUTES, mainSyncStatusPath, mainSyncLockPath, readMainSyncStatus, writeMainSyncStatus, readMainSyncLock, writeMainSyncLock, isLockStale, isRefreshInProgress, tryAcquireMainSyncLock, inProcessLock, finishedLock, computeMainSyncStatus, stampCleanMainSyncStatus, squashRecoverySteps, } from './main-sync-status';
47
- export { MergedBranch, DeletableBranch, DeletableWorktree, MergedBranchesCache, MergedBranchesService, CLASSIFICATION_MERGED_PR, CLASSIFICATION_BACKUP_OF_MERGED, CLASSIFICATION_NO_COMMITS, CLASSIFICATION_SUPERSEDED, CLASSIFICATION_CONTENT_IN_MAIN, CLASSIFICATION_NEVER_PROPOSED, CLASSIFICATION_IN_USE, CLASSIFICATION_PRUNABLE, CLASSIFICATION_LOCKED, CLASSIFICATION_CURRENT, CLASSIFICATION_DETACHED, PROMPTABLE_CLASSIFICATIONS, } from './merged-branches';
47
+ export { MergedBranch, DeletableBranch, DeletableWorktree, MergedBranchesCache, MergedBranchesService, CacheFreshness, CACHE_STALE_AFTER_MS, CLASSIFICATION_MERGED_PR, CLASSIFICATION_BACKUP_OF_MERGED, CLASSIFICATION_NO_COMMITS, CLASSIFICATION_SUPERSEDED, CLASSIFICATION_CONTENT_IN_MAIN, CLASSIFICATION_NEVER_PROPOSED, CLASSIFICATION_IN_USE, CLASSIFICATION_PRUNABLE, CLASSIFICATION_LOCKED, CLASSIFICATION_CURRENT, CLASSIFICATION_DETACHED, PROMPTABLE_CLASSIFICATIONS, } from './merged-branches';
48
48
  export { BranchArchiver, ArchiveResult, ARCHIVE_TAG_PREFIX, BRANCH_RETENTIONS, BRANCH_RETENTION_DELETE, BRANCH_RETENTION_ARCHIVE_TAG, BRANCH_RETENTION_KEEP, } from './branch-archiver';
49
49
  export { Worktree, WorktreeService, } from './worktrees';
50
50
  export { ReapedBranch, ReapResult, BranchReaper, } from './branch-reaper';
package/src/index.js CHANGED
@@ -4,7 +4,7 @@ exports.sectionForRule = exports.isHookGuard = exports.HOOK_GUARD_NAMES = export
4
4
  exports.BranchCreationGuardConfig = exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoCustomCssConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.WP_FINISH_UPSERT_PR = exports.WP_START_UPSERT_PR = exports.WP_FINISH_UPDATE = exports.WP_START_UPDATE = exports.SyncFlowGuidance = exports.WebpiecesRulesConfig = exports.MERGE_EXPLANATION_FILE = exports.MERGE_IN_PROGRESS_FILE = exports.PR_REVIEW_DIR = exports.MERGE_INFO_DIR = exports.WEBPIECES_TMP_DIR = exports.hasDisable = exports.RULE_NAMES = exports.WEBPIECES_DISABLE = exports.AbstractRule = exports.ChangedFilesOptions = exports.DiffRange = exports.DiffScope = exports.isNewOrModified = exports.hasChangesInRange = exports.findNewMethodSignaturesInDiff = exports.getChangedLineNumbers = exports.getFileDiff = exports.getChangedFiles = exports.resolveBase = exports.detectBase = exports.getCurrentBranch = exports.shouldSkipRule = exports.FieldDef = void 0;
5
5
  exports.normalizeChecklistDoc = exports.toChecklist = exports.ChecklistDefinition = exports.MERGE_MODES = exports.MERGE_MODE_NONE = exports.MERGE_MODE_AUTO = exports.buildLandPrConfig = exports.buildPrGateConfig = exports.defaultLandPrConfig = exports.defaultPrGateConfig = exports.defaultGates = exports.ReviewContextEntry = exports.LandPrConfig = exports.PrGateConfig = exports.GateDefinition = exports.StaleMainBashGuardConfig = exports.MergedBranchBashGuardConfig = exports.ReadStaleGuardConfig = exports.FeatureBranchGuardConfig = exports.CLIENT_CREATION_SEVERITIES = exports.NoClientCreationOutsideServerOrClientConfig = exports.VALIDATE_TS_MODES = exports.STRUCTURAL_MODES = exports.ON_OFF_MODES = exports.THROW_CAUSE_MODES = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.MODIFIED_CODE_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.FILE_LIMIT_MODES = exports.METHOD_LIMIT_MODES = exports.BaseRuleConfig = exports.ValidateEslintSyncConfig = exports.ValidateVersionsLockedConfig = exports.ValidatePackageJsonConfig = exports.ValidateNoArchitectureCyclesConfig = exports.ValidateArchitectureUnchangedConfig = exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.DiGraphConfig = exports.NxWiringConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.RedirectHowToMergeMainConfig = exports.PrMergeGuardConfig = exports.MergeInProgressGuardConfig = exports.PrCreationOrPushGuardConfig = void 0;
6
6
  exports.writeMainSyncLock = exports.readMainSyncLock = exports.writeMainSyncStatus = exports.readMainSyncStatus = exports.mainSyncLockPath = exports.mainSyncStatusPath = exports.DEFAULT_HANG_TIMEOUT_MINUTES = exports.MainSyncStatusService = exports.MainSyncLock = exports.MainSyncStatus = exports.reviewJsonSchemaHint = exports.reviewJsonPath = exports.prDirFor = exports.loadReviewJson = exports.ReviewJsonService = exports.ChecklistReviewContext = exports.RequiredChecklist = exports.VERDICT_STATUSES = exports.VERDICT_RED = exports.VERDICT_YELLOW = exports.VERDICT_GREEN = exports.CK_BAD_FORMAT = exports.CK_MISSING = exports.CK_FAIL = exports.CK_OVERRIDDEN = exports.CK_WARN = exports.CK_PASS = exports.ChecklistVerdict = exports.ChecklistResult = exports.PrContext = exports.ReviewJson = exports.PROVENANCE_SKIPPED = exports.PROVENANCE_MISSING = exports.PROVENANCE_OK = exports.ProvenanceResult = exports.EvidenceRequest = exports.ReviewerEvidence = exports.SubagentProvenanceService = exports.verifyGateToken = exports.extractGateToken = exports.gateTokenMarker = exports.computeGateToken = exports.GateTokenService = exports.ContextEntry = exports.BriefedFile = exports.ReviewerBriefing = exports.ReviewerInstructionsService = exports.ChecklistInstructionsService = exports.ChecklistValidator = exports.formatFileList = void 0;
7
- exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.WorktreeReaper = exports.WorktreeReapResult = exports.ReapedWorktree = exports.BranchReaper = exports.ReapResult = exports.ReapedBranch = exports.WorktreeService = exports.Worktree = exports.BRANCH_RETENTION_KEEP = exports.BRANCH_RETENTION_ARCHIVE_TAG = exports.BRANCH_RETENTION_DELETE = exports.BRANCH_RETENTIONS = exports.ARCHIVE_TAG_PREFIX = exports.ArchiveResult = exports.BranchArchiver = exports.PROMPTABLE_CLASSIFICATIONS = exports.CLASSIFICATION_DETACHED = exports.CLASSIFICATION_CURRENT = exports.CLASSIFICATION_LOCKED = exports.CLASSIFICATION_PRUNABLE = exports.CLASSIFICATION_IN_USE = exports.CLASSIFICATION_NEVER_PROPOSED = exports.CLASSIFICATION_CONTENT_IN_MAIN = exports.CLASSIFICATION_SUPERSEDED = exports.CLASSIFICATION_NO_COMMITS = exports.CLASSIFICATION_BACKUP_OF_MERGED = exports.CLASSIFICATION_MERGED_PR = exports.MergedBranchesService = exports.MergedBranchesCache = exports.DeletableWorktree = exports.DeletableBranch = exports.MergedBranch = exports.squashRecoverySteps = exports.stampCleanMainSyncStatus = exports.computeMainSyncStatus = exports.finishedLock = exports.inProcessLock = exports.tryAcquireMainSyncLock = exports.isRefreshInProgress = exports.isLockStale = void 0;
7
+ exports.DEFAULT_MERGE_COMPLETE_COMMAND = exports.DEFAULT_UPSERT_PR_COMMAND = exports.buildCommandsConfig = exports.CommandsConfig = exports.logBranchMutation = exports.branchMutationLogPath = exports.BranchMutationLog = exports.BranchMutationEvent = exports.WorktreeReaper = exports.WorktreeReapResult = exports.ReapedWorktree = exports.BranchReaper = exports.ReapResult = exports.ReapedBranch = exports.WorktreeService = exports.Worktree = exports.BRANCH_RETENTION_KEEP = exports.BRANCH_RETENTION_ARCHIVE_TAG = exports.BRANCH_RETENTION_DELETE = exports.BRANCH_RETENTIONS = exports.ARCHIVE_TAG_PREFIX = exports.ArchiveResult = exports.BranchArchiver = exports.PROMPTABLE_CLASSIFICATIONS = exports.CLASSIFICATION_DETACHED = exports.CLASSIFICATION_CURRENT = exports.CLASSIFICATION_LOCKED = exports.CLASSIFICATION_PRUNABLE = exports.CLASSIFICATION_IN_USE = exports.CLASSIFICATION_NEVER_PROPOSED = exports.CLASSIFICATION_CONTENT_IN_MAIN = exports.CLASSIFICATION_SUPERSEDED = exports.CLASSIFICATION_NO_COMMITS = exports.CLASSIFICATION_BACKUP_OF_MERGED = exports.CLASSIFICATION_MERGED_PR = exports.CACHE_STALE_AFTER_MS = exports.CacheFreshness = exports.MergedBranchesService = exports.MergedBranchesCache = exports.DeletableWorktree = exports.DeletableBranch = exports.MergedBranch = exports.squashRecoverySteps = exports.stampCleanMainSyncStatus = exports.computeMainSyncStatus = exports.finishedLock = exports.inProcessLock = exports.tryAcquireMainSyncLock = exports.isRefreshInProgress = exports.isLockStale = void 0;
8
8
  var types_1 = require("./types");
9
9
  Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
10
10
  Object.defineProperty(exports, "ResolvedRuleConfig", { enumerable: true, get: function () { return types_1.ResolvedRuleConfig; } });
@@ -260,6 +260,8 @@ Object.defineProperty(exports, "DeletableBranch", { enumerable: true, get: funct
260
260
  Object.defineProperty(exports, "DeletableWorktree", { enumerable: true, get: function () { return merged_branches_1.DeletableWorktree; } });
261
261
  Object.defineProperty(exports, "MergedBranchesCache", { enumerable: true, get: function () { return merged_branches_1.MergedBranchesCache; } });
262
262
  Object.defineProperty(exports, "MergedBranchesService", { enumerable: true, get: function () { return merged_branches_1.MergedBranchesService; } });
263
+ Object.defineProperty(exports, "CacheFreshness", { enumerable: true, get: function () { return merged_branches_1.CacheFreshness; } });
264
+ Object.defineProperty(exports, "CACHE_STALE_AFTER_MS", { enumerable: true, get: function () { return merged_branches_1.CACHE_STALE_AFTER_MS; } });
263
265
  Object.defineProperty(exports, "CLASSIFICATION_MERGED_PR", { enumerable: true, get: function () { return merged_branches_1.CLASSIFICATION_MERGED_PR; } });
264
266
  Object.defineProperty(exports, "CLASSIFICATION_BACKUP_OF_MERGED", { enumerable: true, get: function () { return merged_branches_1.CLASSIFICATION_BACKUP_OF_MERGED; } });
265
267
  Object.defineProperty(exports, "CLASSIFICATION_NO_COMMITS", { enumerable: true, get: function () { return merged_branches_1.CLASSIFICATION_NO_COMMITS; } });
package/src/index.js.map CHANGED
@@ -1 +1 @@
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;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAA6D;AAApD,oGAAA,QAAQ,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AACxC,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAA4E;AAAnE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA;AACpD,6CAA4E;AAAnE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,yGAAA,UAAU,OAAA;AACpD,yCAA8D;AAArD,2GAAA,cAAc,OAAA;AAAE,4GAAA,eAAe,OAAA;AACxC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,2BAA8E;AAArE,oGAAA,cAAc,OAAA;AAAE,sGAAA,gBAAgB,OAAA;AAAE,0GAAA,oBAAoB,OAAA;AAC/D,2DAAoD;AAA3C,kHAAA,YAAY,OAAA;AACrB,iDAAiE;AAAxD,+GAAA,cAAc,OAAA;AAAE,+GAAA,cAAc,OAAA;AACvC,iDAAgE;AAAvD,6GAAA,YAAY,OAAA;AAAE,gHAAA,eAAe,OAAA;AACtC,iDAAsG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AClB,iHAAA,cAAc,OAAA;AAGlB,6DAK+B;AAJ3B,0HAAA,mBAAmB,OAAA;AACnB,wHAAA,iBAAiB,OAAA;AACjB,4HAAA,qBAAqB,OAAA;AACrB,wHAAA,iBAAiB,OAAA;AAErB,qDAK2B;AAJvB,iHAAA,cAAc,OAAA;AACd,sHAAA,mBAAmB,OAAA;AACnB,4HAAA,yBAAyB,OAAA;AACzB,iIAAA,8BAA8B,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { RuleFailError } from './rule-fail-error';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\nexport { toError } from './to-error';\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\nexport { findConfigFile, CONFIG_FILENAME, ConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR } from './repo-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate, TemplateWriter } from './load-template';\nexport { validateWebpiecesConfig, validatePrGateSection, validateChecklistsSection, validateSectionPlacement, validateCommandsSection, validateExcludePaths, validateMatchRulesSection, allRuleNames } from './validate-config';\nexport { validateChecklistDocs } from './checklist-docs-validator';\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 { HOOK_GUARD_NAMES, isHookGuard, sectionForRule } from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport type { 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 RULE_NAMES,\n hasDisable,\n WEBPIECES_TMP_DIR,\n MERGE_INFO_DIR,\n PR_REVIEW_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\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} from './sync-flow-guidance';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n BranchCreationGuardConfig,\n PrCreationOrPushGuardConfig,\n MergeInProgressGuardConfig,\n PrMergeGuardConfig,\n RedirectHowToMergeMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NxWiringConfig,\n DiGraphConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n ValidateArchitectureUnchangedConfig,\n ValidateNoArchitectureCyclesConfig,\n ValidatePackageJsonConfig,\n ValidateVersionsLockedConfig,\n ValidateEslintSyncConfig,\n BaseRuleConfig,\n} from './rule-configs';\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\nexport {\n METHOD_LIMIT_MODES,\n FILE_LIMIT_MODES,\n RETURN_TYPE_MODES,\n INLINE_TYPE_MODES,\n MODIFIED_CODE_MODES,\n PROJECT_MODES,\n PRISMA_DTOS_MODES,\n PRISMA_CONVERTER_MODES,\n DIRECT_API_RESOLVER_MODES,\n THROW_CAUSE_MODES,\n ON_OFF_MODES,\n STRUCTURAL_MODES,\n VALIDATE_TS_MODES,\n} from './rule-configs';\nexport {\n NoClientCreationOutsideServerOrClientConfig,\n CLIENT_CREATION_SEVERITIES,\n} from './no-client-creation-config';\nexport type { ClientCreationSeverity } from './no-client-creation-config';\nexport type {\n MethodLimitMode,\n FileLimitMode,\n ReturnTypeMode,\n InlineTypeMode,\n ModifiedCodeMode,\n ProjectMode,\n PrismaValidateDtosMode,\n PrismaConverterMode,\n DirectApiResolverMode,\n ThrowCauseMode,\n OnOffMode,\n StructuralMode,\n ValidateTsMode,\n} from './rule-configs';\nexport {\n FeatureBranchGuardConfig,\n ReadStaleGuardConfig,\n MergedBranchBashGuardConfig,\n StaleMainBashGuardConfig,\n} from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n LandPrConfig,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\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} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n EvidenceRequest,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\nexport {\n ReviewJson,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n loadReviewJson,\n prDirFor,\n reviewJsonPath,\n reviewJsonSchemaHint,\n} from './review-json';\nexport {\n MainSyncStatus,\n MainSyncLock,\n MainSyncStatusService,\n DEFAULT_HANG_TIMEOUT_MINUTES,\n mainSyncStatusPath,\n mainSyncLockPath,\n readMainSyncStatus,\n writeMainSyncStatus,\n readMainSyncLock,\n writeMainSyncLock,\n isLockStale,\n isRefreshInProgress,\n tryAcquireMainSyncLock,\n inProcessLock,\n finishedLock,\n computeMainSyncStatus,\n stampCleanMainSyncStatus,\n squashRecoverySteps,\n} from './main-sync-status';\nexport {\n MergedBranch,\n DeletableBranch,\n DeletableWorktree,\n MergedBranchesCache,\n MergedBranchesService,\n CLASSIFICATION_MERGED_PR,\n CLASSIFICATION_BACKUP_OF_MERGED,\n CLASSIFICATION_NO_COMMITS,\n CLASSIFICATION_SUPERSEDED,\n CLASSIFICATION_CONTENT_IN_MAIN,\n CLASSIFICATION_NEVER_PROPOSED,\n CLASSIFICATION_IN_USE,\n CLASSIFICATION_PRUNABLE,\n CLASSIFICATION_LOCKED,\n CLASSIFICATION_CURRENT,\n CLASSIFICATION_DETACHED,\n PROMPTABLE_CLASSIFICATIONS,\n} from './merged-branches';\nexport {\n BranchArchiver,\n ArchiveResult,\n ARCHIVE_TAG_PREFIX,\n BRANCH_RETENTIONS,\n BRANCH_RETENTION_DELETE,\n BRANCH_RETENTION_ARCHIVE_TAG,\n BRANCH_RETENTION_KEEP,\n} from './branch-archiver';\nexport {\n Worktree,\n WorktreeService,\n} from './worktrees';\nexport {\n ReapedBranch,\n ReapResult,\n BranchReaper,\n} from './branch-reaper';\nexport {\n ReapedWorktree,\n WorktreeReapResult,\n WorktreeReaper,\n} from './worktree-reaper';\nexport type { MutationVerb, MutationPhase } from './branch-mutation-log';\nexport {\n BranchMutationEvent,\n BranchMutationLog,\n branchMutationLogPath,\n logBranchMutation,\n} from './branch-mutation-log';\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\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;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,mDAAgD;AAAvC,8GAAA,YAAY,OAAA;AACrB,uCAA6D;AAApD,oGAAA,QAAQ,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,mGAAA,OAAO,OAAA;AACxC,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAA4E;AAAnE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA;AAAE,2GAAA,YAAY,OAAA;AACpD,6CAA4E;AAAnE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,yGAAA,UAAU,OAAA;AACpD,yCAA8D;AAArD,2GAAA,cAAc,OAAA;AAAE,4GAAA,eAAe,OAAA;AACxC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,2B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BAAiB,OAAA;AACjB,0HAAA,uBAAuB,OAAA;AACvB,+HAAA,4BAA4B,OAAA;AAC5B,wHAAA,qBAAqB,OAAA;AAEzB,yCAGqB;AAFjB,qGAAA,QAAQ,OAAA;AACR,4GAAA,eAAe,OAAA;AAEnB,iDAIyB;AAHrB,6GAAA,YAAY,OAAA;AACZ,2GAAA,UAAU,OAAA;AACV,6GAAA,YAAY,OAAA;AAEhB,qDAI2B;AAHvB,iHAAA,cAAc,OAAA;AACd,qHAAA,kBAAkB,OAAA;AAClB,iHAAA,cAAc,OAAA;AAGlB,6DAK+B;AAJ3B,0HAAA,mBAAmB,OAAA;AACnB,wHAAA,iBAAiB,OAAA;AACjB,4HAAA,qBAAqB,OAAA;AACrB,wHAAA,iBAAiB,OAAA;AAErB,qDAK2B;AAJvB,iHAAA,cAAc,OAAA;AACd,sHAAA,mBAAmB,OAAA;AACnB,4HAAA,yBAAyB,OAAA;AACzB,iIAAA,8BAA8B,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { RuleFailError } from './rule-fail-error';\nexport { CliExitError } from './cli-exit-error';\nexport { CliUsage, CliArgsCheck, CliArgs } from './cli-args';\nexport { runMain } from './run-main';\nexport { toError } from './to-error';\nexport { loadAndValidate, LoadedConfig, ConfigLoader } from './load-config';\nexport { findConfigFile, CONFIG_FILENAME, ConfigFile } from './config-file';\nexport { RepoRootFinder, INSTRUCT_AI_DIR } from './repo-root';\nexport { RulesConfigDesign } from './rules-config-design';\nexport { DocumentDesign, isDocumentDesign, DESIGN_METADATA_KEYS } from './di';\nexport { ExcludePaths } from './exclude-hook-paths';\nexport { isPathExcluded, matchesAnyGlob } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate, TemplateWriter } from './load-template';\nexport { validateWebpiecesConfig, validatePrGateSection, validateChecklistsSection, validateSectionPlacement, validateCommandsSection, validateExcludePaths, validateMatchRulesSection, allRuleNames } from './validate-config';\nexport { validateChecklistDocs } from './checklist-docs-validator';\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 { HOOK_GUARD_NAMES, isHookGuard, sectionForRule } from './sections';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport type { 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 RULE_NAMES,\n hasDisable,\n WEBPIECES_TMP_DIR,\n MERGE_INFO_DIR,\n PR_REVIEW_DIR,\n MERGE_IN_PROGRESS_FILE,\n MERGE_EXPLANATION_FILE,\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} from './sync-flow-guidance';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n BranchCreationGuardConfig,\n PrCreationOrPushGuardConfig,\n MergeInProgressGuardConfig,\n PrMergeGuardConfig,\n RedirectHowToMergeMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NxWiringConfig,\n DiGraphConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n ValidateArchitectureUnchangedConfig,\n ValidateNoArchitectureCyclesConfig,\n ValidatePackageJsonConfig,\n ValidateVersionsLockedConfig,\n ValidateEslintSyncConfig,\n BaseRuleConfig,\n} from './rule-configs';\n// Mode unions + their value arrays — the single source of truth shared with code-rules.\nexport {\n METHOD_LIMIT_MODES,\n FILE_LIMIT_MODES,\n RETURN_TYPE_MODES,\n INLINE_TYPE_MODES,\n MODIFIED_CODE_MODES,\n PROJECT_MODES,\n PRISMA_DTOS_MODES,\n PRISMA_CONVERTER_MODES,\n DIRECT_API_RESOLVER_MODES,\n THROW_CAUSE_MODES,\n ON_OFF_MODES,\n STRUCTURAL_MODES,\n VALIDATE_TS_MODES,\n} from './rule-configs';\nexport {\n NoClientCreationOutsideServerOrClientConfig,\n CLIENT_CREATION_SEVERITIES,\n} from './no-client-creation-config';\nexport type { ClientCreationSeverity } from './no-client-creation-config';\nexport type {\n MethodLimitMode,\n FileLimitMode,\n ReturnTypeMode,\n InlineTypeMode,\n ModifiedCodeMode,\n ProjectMode,\n PrismaValidateDtosMode,\n PrismaConverterMode,\n DirectApiResolverMode,\n ThrowCauseMode,\n OnOffMode,\n StructuralMode,\n ValidateTsMode,\n} from './rule-configs';\nexport {\n FeatureBranchGuardConfig,\n ReadStaleGuardConfig,\n MergedBranchBashGuardConfig,\n StaleMainBashGuardConfig,\n} from './main-sync-guard-configs';\nexport {\n GateDefinition,\n PrGateConfig,\n LandPrConfig,\n ReviewContextEntry,\n defaultGates,\n defaultPrGateConfig,\n defaultLandPrConfig,\n buildPrGateConfig,\n buildLandPrConfig,\n MERGE_MODE_AUTO,\n MERGE_MODE_NONE,\n MERGE_MODES,\n} from './pr-gate-config';\nexport {\n ChecklistDefinition,\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} from './reviewer-instructions';\nexport {\n GateTokenService,\n computeGateToken,\n gateTokenMarker,\n extractGateToken,\n verifyGateToken,\n} from './gate-token';\nexport {\n SubagentProvenanceService,\n ReviewerEvidence,\n EvidenceRequest,\n ProvenanceResult,\n PROVENANCE_OK,\n PROVENANCE_MISSING,\n PROVENANCE_SKIPPED,\n} from './subagent-provenance';\nexport {\n ReviewJson,\n PrContext,\n ChecklistResult,\n ChecklistVerdict,\n CK_PASS,\n CK_WARN,\n CK_OVERRIDDEN,\n CK_FAIL,\n CK_MISSING,\n CK_BAD_FORMAT,\n VERDICT_GREEN,\n VERDICT_YELLOW,\n VERDICT_RED,\n VERDICT_STATUSES,\n RequiredChecklist,\n ChecklistReviewContext,\n ReviewJsonService,\n loadReviewJson,\n prDirFor,\n reviewJsonPath,\n reviewJsonSchemaHint,\n} from './review-json';\nexport {\n MainSyncStatus,\n MainSyncLock,\n MainSyncStatusService,\n DEFAULT_HANG_TIMEOUT_MINUTES,\n mainSyncStatusPath,\n mainSyncLockPath,\n readMainSyncStatus,\n writeMainSyncStatus,\n readMainSyncLock,\n writeMainSyncLock,\n isLockStale,\n isRefreshInProgress,\n tryAcquireMainSyncLock,\n inProcessLock,\n finishedLock,\n computeMainSyncStatus,\n stampCleanMainSyncStatus,\n squashRecoverySteps,\n} from './main-sync-status';\nexport {\n MergedBranch,\n DeletableBranch,\n DeletableWorktree,\n MergedBranchesCache,\n MergedBranchesService,\n CacheFreshness,\n CACHE_STALE_AFTER_MS,\n CLASSIFICATION_MERGED_PR,\n CLASSIFICATION_BACKUP_OF_MERGED,\n CLASSIFICATION_NO_COMMITS,\n CLASSIFICATION_SUPERSEDED,\n CLASSIFICATION_CONTENT_IN_MAIN,\n CLASSIFICATION_NEVER_PROPOSED,\n CLASSIFICATION_IN_USE,\n CLASSIFICATION_PRUNABLE,\n CLASSIFICATION_LOCKED,\n CLASSIFICATION_CURRENT,\n CLASSIFICATION_DETACHED,\n PROMPTABLE_CLASSIFICATIONS,\n} from './merged-branches';\nexport {\n BranchArchiver,\n ArchiveResult,\n ARCHIVE_TAG_PREFIX,\n BRANCH_RETENTIONS,\n BRANCH_RETENTION_DELETE,\n BRANCH_RETENTION_ARCHIVE_TAG,\n BRANCH_RETENTION_KEEP,\n} from './branch-archiver';\nexport {\n Worktree,\n WorktreeService,\n} from './worktrees';\nexport {\n ReapedBranch,\n ReapResult,\n BranchReaper,\n} from './branch-reaper';\nexport {\n ReapedWorktree,\n WorktreeReapResult,\n WorktreeReaper,\n} from './worktree-reaper';\nexport type { MutationVerb, MutationPhase } from './branch-mutation-log';\nexport {\n BranchMutationEvent,\n BranchMutationLog,\n branchMutationLogPath,\n logBranchMutation,\n} from './branch-mutation-log';\nexport {\n CommandsConfig,\n buildCommandsConfig,\n DEFAULT_UPSERT_PR_COMMAND,\n DEFAULT_MERGE_COMPLETE_COMMAND,\n} from './commands-config';\n"]}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * The VERDICT vocabulary — every data class and stable classification token the branch/worktree
3
+ * cleanup story is written in. Split out of merged-branches.ts, which holds the SERVICE that produces
4
+ * these values; this file holds only what they mean.
5
+ *
6
+ * Re-exported from merged-branches.ts, so every existing import path keeps working.
7
+ */
8
+ export declare class MergedBranch {
9
+ branch: string;
10
+ pr: number;
11
+ constructor(branch: string, pr: number);
12
+ }
13
+ /**
14
+ * WHY a branch is dead, or why it was spared — as a STABLE token, alongside the English prose.
15
+ *
16
+ * `sha`/`commits`/`prState` (below) let a human SEE a spared branch. This adds the other half: a token
17
+ * saying WHICH KIND of spared it is. Every spared branch used to report the identical string
18
+ * `no merged PR found — a human must decide`, and in one observed repo that one string covered three
19
+ * genuinely different situations — a PR CLOSED UNMERGED whose work landed under a later number, a
20
+ * branch that NEVER had a PR and holds the only copy of its commits, and content already in main.
21
+ * Reporting all three identically is why nobody ever decided, and why the pile grew to 6 branches
22
+ * against a cap of 5. A token lets wp-cleanup GROUP them and ask a question that can be answered.
23
+ */
24
+ export declare const CLASSIFICATION_MERGED_PR = "merged-pr";
25
+ export declare const CLASSIFICATION_BACKUP_OF_MERGED = "backup-of-merged";
26
+ /**
27
+ * NOT a proof of death — a SPARED verdict, and the reason this whole liveness model exists.
28
+ *
29
+ * "Zero commits of its own" used to be auto-deletable, on the reasoning that a branch holding no
30
+ * commits can lose no work. That reasoning is true of a REF and false of a WORKING TREE: every
31
+ * worktree created with `git worktree add -b … origin/main` has zero commits from the moment it is
32
+ * created until its first commit — i.e. for exactly the window in which an agent is doing its work
33
+ * in it. Observed 2026-07-30: three worktrees with live agents in them were listed as dead, under
34
+ * the sentence "so no work can be lost".
35
+ *
36
+ * Liveness is now the same single rule branches already use: reapable == a MERGED PR. Anything not
37
+ * provably merged is LIVE, and live means it is never deleted without an explicit human answer. A
38
+ * genuine husk still gets cleaned up — it is PROMPTABLE (see below), so wp-cleanup asks.
39
+ */
40
+ export declare const CLASSIFICATION_NO_COMMITS = "no-commits";
41
+ export declare const CLASSIFICATION_SUPERSEDED = "superseded";
42
+ export declare const CLASSIFICATION_CONTENT_IN_MAIN = "content-already-in-main";
43
+ export declare const CLASSIFICATION_NEVER_PROPOSED = "never-proposed";
44
+ export declare const CLASSIFICATION_IN_USE = "in-use";
45
+ /**
46
+ * WORKTREE-only classifications. A worktree verdict borrows every token above (its branch is what is
47
+ * being judged), but three of its outcomes have no branch analogue at all, and lumping them under
48
+ * `in-use` would tell wp-cleanup to shut up about exactly the ones a human might want to act on.
49
+ *
50
+ * - PRUNABLE — the directory is already gone; `git worktree prune` is the reap, not `remove`.
51
+ * - LOCKED — a human ran `git worktree lock`. Explicitly "do not touch"; never promptable.
52
+ * - CURRENT — the worktree the command is running IN. Removing your own cwd is a self-destruct.
53
+ * - DETACHED — detached HEAD, so there is no branch to judge and no branch to archive.
54
+ */
55
+ export declare const CLASSIFICATION_PRUNABLE = "prunable-worktree";
56
+ export declare const CLASSIFICATION_LOCKED = "locked-worktree";
57
+ export declare const CLASSIFICATION_CURRENT = "current-worktree";
58
+ export declare const CLASSIFICATION_DETACHED = "detached-worktree";
59
+ export declare const PROMPTABLE_CLASSIFICATIONS: readonly string[];
60
+ /**
61
+ * A local branch and the verdict on it. `pr` is 0 when no merged PR backs the verdict (a `keep`).
62
+ *
63
+ * `sha`, `commits` and `prState` exist for the SPARED branches specifically. When nothing is
64
+ * auto-reapable the branch cap has nothing safe to offer, and its only remaining advice was "raise
65
+ * maxLocalBranches" / "set turnOffRuleUntilEpoch" — both of which loosen the rule. An agent with no
66
+ * human present took the config edit, which is the exact failure the cap exists to prevent. To ask a
67
+ * human "may I delete these?" instead, the guard has to be able to SHOW what it would delete: tip SHA
68
+ * (so the delete is recoverable), PR state (closed? never opened?) and how much unique work is on it.
69
+ *
70
+ * All three are computed in the DETACHED refresher and read straight off merged-branches.json — the
71
+ * blocking hook path never recomputes them. Defaulted so a cache written by an older release (and
72
+ * every existing call site) revives without them.
73
+ */
74
+ export declare class DeletableBranch {
75
+ branch: string;
76
+ reason: string;
77
+ pr: number;
78
+ /** Short tip SHA — what makes the delete undoable (`git branch <name> <sha>`). '' when unknown. */
79
+ sha: string;
80
+ /** Commits on this branch that are not on origin/main. -1 when it could not be established. */
81
+ commits: number;
82
+ /** GitHub's state for the PR whose head is this branch: MERGED / CLOSED / OPEN, or '' for none. */
83
+ prState: string;
84
+ /**
85
+ * One of the CLASSIFICATION_* tokens. Defaulted like the fields above so every pre-existing call
86
+ * site — and every cache written by an older release — still constructs; an unclassified revived
87
+ * entry reads as 'never-proposed', the most conservative of the spared verdicts.
88
+ */
89
+ classification: string;
90
+ constructor(branch: string, reason: string, pr: number, sha?: string, commits?: number, prState?: string, classification?: string);
91
+ }
92
+ /**
93
+ * A worktree and the verdict on it. Carries `path` (what `git worktree remove` takes) AND `branch`
94
+ * (what `git branch -D` takes afterwards) because reaping a worktree is always those two steps, in
95
+ * that order — git refuses to delete a branch that is still checked out somewhere.
96
+ *
97
+ * `classification` is the same STABLE token the branch verdicts carry, plus the four worktree-only
98
+ * ones above. It exists for the same reason it does on DeletableBranch: `deletable` answers "may the
99
+ * tooling reap this unattended?", and everything false used to collapse into one undifferentiated
100
+ * "spared" that a human could not rule on. With a token, WorktreeReaper knows whether the reap is a
101
+ * `prune` or a `remove`, and wp-cleanup knows which spared worktrees are worth ASKING about.
102
+ * Defaulted so every pre-existing call site and every cache written by an older release still builds;
103
+ * an unclassified revived entry reads as 'never-proposed', the most conservative spared verdict.
104
+ */
105
+ export declare class DeletableWorktree {
106
+ path: string;
107
+ branch: string;
108
+ reason: string;
109
+ pr: number;
110
+ deletable: boolean;
111
+ classification: string;
112
+ constructor(path: string, branch: string, reason: string, pr: number, deletable: boolean, classification?: string);
113
+ }
114
+ /**
115
+ * `deletable` is PRECOMPUTED so the consumer just deletes the list — no re-deriving, no judgement
116
+ * call at block time. `keep` carries the branches we refuse to touch (no merged PR found), each with
117
+ * its reason, so a human can see what was spared and why.
118
+ *
119
+ * `worktrees` is the parallel verdict list for the SECOND budget (see worktrees.ts): every linked
120
+ * worktree, each flagged deletable or not. Both budgets are reaped from this one cache file.
121
+ */
122
+ export declare class MergedBranchesCache {
123
+ timestamp: string;
124
+ deletable: DeletableBranch[];
125
+ keep: DeletableBranch[];
126
+ worktrees: DeletableWorktree[];
127
+ constructor(timestamp: string, deletable: DeletableBranch[], keep: DeletableBranch[], worktrees?: DeletableWorktree[]);
128
+ }
129
+ /**
130
+ * How old the cache may get before a reader must stop asserting figures from it.
131
+ *
132
+ * The cache is ALLOWED to be stale — that is the whole design (see the file header): the slow lookup
133
+ * runs detached, and a branch that merged 30 seconds ago simply survives to the next refresh. What is
134
+ * NOT allowed is quoting a stale file as present-tense fact. Observed 2026-07-30: the guard announced
135
+ * "8 parked local branches … none of them are dead" when there was ONE, having counted branches that
136
+ * had been deleted minutes earlier, and then blocked a legitimate command on that figure.
137
+ *
138
+ * Five minutes, because the refresher is kicked off by the hooks themselves and normally rewrites the
139
+ * file within one tool call; anything older means the refresher did not run or could not finish.
140
+ */
141
+ export declare const CACHE_STALE_AFTER_MS: number;
142
+ /**
143
+ * Whether a cache read off disk may be quoted as fact, and how old it is — so a message can SAY
144
+ * "the cached verdicts are stale" instead of asserting a count it cannot stand behind.
145
+ */
146
+ export declare class CacheFreshness {
147
+ /** True when the file is older than CACHE_STALE_AFTER_MS, or its timestamp is missing/unparseable. */
148
+ stale: boolean;
149
+ /** Whole minutes since the cache was written. -1 when that cannot be established. */
150
+ ageMinutes: number;
151
+ /** The raw ISO timestamp as recorded, or '' — printed verbatim so a human can check it. */
152
+ timestamp: string;
153
+ constructor(stale: boolean, ageMinutes: number, timestamp: string);
154
+ }
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ /**
3
+ * The VERDICT vocabulary — every data class and stable classification token the branch/worktree
4
+ * cleanup story is written in. Split out of merged-branches.ts, which holds the SERVICE that produces
5
+ * these values; this file holds only what they mean.
6
+ *
7
+ * Re-exported from merged-branches.ts, so every existing import path keeps working.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.CacheFreshness = exports.CACHE_STALE_AFTER_MS = exports.MergedBranchesCache = exports.DeletableWorktree = exports.DeletableBranch = exports.PROMPTABLE_CLASSIFICATIONS = exports.CLASSIFICATION_DETACHED = exports.CLASSIFICATION_CURRENT = exports.CLASSIFICATION_LOCKED = exports.CLASSIFICATION_PRUNABLE = exports.CLASSIFICATION_IN_USE = exports.CLASSIFICATION_NEVER_PROPOSED = exports.CLASSIFICATION_CONTENT_IN_MAIN = exports.CLASSIFICATION_SUPERSEDED = exports.CLASSIFICATION_NO_COMMITS = exports.CLASSIFICATION_BACKUP_OF_MERGED = exports.CLASSIFICATION_MERGED_PR = exports.MergedBranch = void 0;
11
+ // Data-only (per CLAUDE.md, classes for data).
12
+ class MergedBranch {
13
+ branch;
14
+ pr;
15
+ constructor(branch, pr) {
16
+ this.branch = branch;
17
+ this.pr = pr;
18
+ }
19
+ }
20
+ exports.MergedBranch = MergedBranch;
21
+ /**
22
+ * WHY a branch is dead, or why it was spared — as a STABLE token, alongside the English prose.
23
+ *
24
+ * `sha`/`commits`/`prState` (below) let a human SEE a spared branch. This adds the other half: a token
25
+ * saying WHICH KIND of spared it is. Every spared branch used to report the identical string
26
+ * `no merged PR found — a human must decide`, and in one observed repo that one string covered three
27
+ * genuinely different situations — a PR CLOSED UNMERGED whose work landed under a later number, a
28
+ * branch that NEVER had a PR and holds the only copy of its commits, and content already in main.
29
+ * Reporting all three identically is why nobody ever decided, and why the pile grew to 6 branches
30
+ * against a cap of 5. A token lets wp-cleanup GROUP them and ask a question that can be answered.
31
+ */
32
+ // Dead by proof — these are auto-deletable. BOTH proofs are a MERGED PR; there is no other.
33
+ exports.CLASSIFICATION_MERGED_PR = 'merged-pr';
34
+ exports.CLASSIFICATION_BACKUP_OF_MERGED = 'backup-of-merged';
35
+ /**
36
+ * NOT a proof of death — a SPARED verdict, and the reason this whole liveness model exists.
37
+ *
38
+ * "Zero commits of its own" used to be auto-deletable, on the reasoning that a branch holding no
39
+ * commits can lose no work. That reasoning is true of a REF and false of a WORKING TREE: every
40
+ * worktree created with `git worktree add -b … origin/main` has zero commits from the moment it is
41
+ * created until its first commit — i.e. for exactly the window in which an agent is doing its work
42
+ * in it. Observed 2026-07-30: three worktrees with live agents in them were listed as dead, under
43
+ * the sentence "so no work can be lost".
44
+ *
45
+ * Liveness is now the same single rule branches already use: reapable == a MERGED PR. Anything not
46
+ * provably merged is LIVE, and live means it is never deleted without an explicit human answer. A
47
+ * genuine husk still gets cleaned up — it is PROMPTABLE (see below), so wp-cleanup asks.
48
+ */
49
+ exports.CLASSIFICATION_NO_COMMITS = 'no-commits';
50
+ // Spared, but a human should be ASKED — in descending order of "obviously fine to delete".
51
+ exports.CLASSIFICATION_SUPERSEDED = 'superseded';
52
+ exports.CLASSIFICATION_CONTENT_IN_MAIN = 'content-already-in-main';
53
+ exports.CLASSIFICATION_NEVER_PROPOSED = 'never-proposed';
54
+ // Spared for a mechanical reason, not a judgement call (checked out somewhere).
55
+ exports.CLASSIFICATION_IN_USE = 'in-use';
56
+ /**
57
+ * WORKTREE-only classifications. A worktree verdict borrows every token above (its branch is what is
58
+ * being judged), but three of its outcomes have no branch analogue at all, and lumping them under
59
+ * `in-use` would tell wp-cleanup to shut up about exactly the ones a human might want to act on.
60
+ *
61
+ * - PRUNABLE — the directory is already gone; `git worktree prune` is the reap, not `remove`.
62
+ * - LOCKED — a human ran `git worktree lock`. Explicitly "do not touch"; never promptable.
63
+ * - CURRENT — the worktree the command is running IN. Removing your own cwd is a self-destruct.
64
+ * - DETACHED — detached HEAD, so there is no branch to judge and no branch to archive.
65
+ */
66
+ exports.CLASSIFICATION_PRUNABLE = 'prunable-worktree';
67
+ exports.CLASSIFICATION_LOCKED = 'locked-worktree';
68
+ exports.CLASSIFICATION_CURRENT = 'current-worktree';
69
+ exports.CLASSIFICATION_DETACHED = 'detached-worktree';
70
+ // Spared classifications a human can meaningfully rule on, most-safe first. wp-cleanup prompts in
71
+ // exactly this order so the easy yeses come before the ones that need thought.
72
+ exports.PROMPTABLE_CLASSIFICATIONS = [
73
+ exports.CLASSIFICATION_SUPERSEDED,
74
+ exports.CLASSIFICATION_CONTENT_IN_MAIN,
75
+ exports.CLASSIFICATION_NEVER_PROPOSED,
76
+ // LAST deliberately. For a parked branch this is the most obvious yes in the whole list, but the
77
+ // identical verdict on a WORKTREE means "an agent may be working in here right now", and the
78
+ // prompt cannot tell the human which one they are looking at any better than by ordering it dead
79
+ // last, after the groups whose evidence is about the PAST rather than about work in flight.
80
+ exports.CLASSIFICATION_NO_COMMITS,
81
+ ];
82
+ /**
83
+ * A local branch and the verdict on it. `pr` is 0 when no merged PR backs the verdict (a `keep`).
84
+ *
85
+ * `sha`, `commits` and `prState` exist for the SPARED branches specifically. When nothing is
86
+ * auto-reapable the branch cap has nothing safe to offer, and its only remaining advice was "raise
87
+ * maxLocalBranches" / "set turnOffRuleUntilEpoch" — both of which loosen the rule. An agent with no
88
+ * human present took the config edit, which is the exact failure the cap exists to prevent. To ask a
89
+ * human "may I delete these?" instead, the guard has to be able to SHOW what it would delete: tip SHA
90
+ * (so the delete is recoverable), PR state (closed? never opened?) and how much unique work is on it.
91
+ *
92
+ * All three are computed in the DETACHED refresher and read straight off merged-branches.json — the
93
+ * blocking hook path never recomputes them. Defaulted so a cache written by an older release (and
94
+ * every existing call site) revives without them.
95
+ */
96
+ class DeletableBranch {
97
+ branch;
98
+ reason;
99
+ pr;
100
+ /** Short tip SHA — what makes the delete undoable (`git branch <name> <sha>`). '' when unknown. */
101
+ sha;
102
+ /** Commits on this branch that are not on origin/main. -1 when it could not be established. */
103
+ commits;
104
+ /** GitHub's state for the PR whose head is this branch: MERGED / CLOSED / OPEN, or '' for none. */
105
+ prState;
106
+ /**
107
+ * One of the CLASSIFICATION_* tokens. Defaulted like the fields above so every pre-existing call
108
+ * site — and every cache written by an older release — still constructs; an unclassified revived
109
+ * entry reads as 'never-proposed', the most conservative of the spared verdicts.
110
+ */
111
+ classification;
112
+ // eslint-disable-next-line @typescript-eslint/max-params
113
+ constructor(branch, reason, pr, sha = '', commits = -1, prState = '', classification = exports.CLASSIFICATION_NEVER_PROPOSED) {
114
+ this.branch = branch;
115
+ this.reason = reason;
116
+ this.pr = pr;
117
+ this.sha = sha;
118
+ this.commits = commits;
119
+ this.prState = prState;
120
+ this.classification = classification;
121
+ }
122
+ }
123
+ exports.DeletableBranch = DeletableBranch;
124
+ /**
125
+ * A worktree and the verdict on it. Carries `path` (what `git worktree remove` takes) AND `branch`
126
+ * (what `git branch -D` takes afterwards) because reaping a worktree is always those two steps, in
127
+ * that order — git refuses to delete a branch that is still checked out somewhere.
128
+ *
129
+ * `classification` is the same STABLE token the branch verdicts carry, plus the four worktree-only
130
+ * ones above. It exists for the same reason it does on DeletableBranch: `deletable` answers "may the
131
+ * tooling reap this unattended?", and everything false used to collapse into one undifferentiated
132
+ * "spared" that a human could not rule on. With a token, WorktreeReaper knows whether the reap is a
133
+ * `prune` or a `remove`, and wp-cleanup knows which spared worktrees are worth ASKING about.
134
+ * Defaulted so every pre-existing call site and every cache written by an older release still builds;
135
+ * an unclassified revived entry reads as 'never-proposed', the most conservative spared verdict.
136
+ */
137
+ class DeletableWorktree {
138
+ path;
139
+ branch;
140
+ reason;
141
+ pr;
142
+ deletable;
143
+ classification;
144
+ // eslint-disable-next-line @typescript-eslint/max-params
145
+ constructor(path, branch, reason, pr, deletable, classification = exports.CLASSIFICATION_NEVER_PROPOSED) {
146
+ this.path = path;
147
+ this.branch = branch;
148
+ this.reason = reason;
149
+ this.pr = pr;
150
+ this.deletable = deletable;
151
+ this.classification = classification;
152
+ }
153
+ }
154
+ exports.DeletableWorktree = DeletableWorktree;
155
+ /**
156
+ * `deletable` is PRECOMPUTED so the consumer just deletes the list — no re-deriving, no judgement
157
+ * call at block time. `keep` carries the branches we refuse to touch (no merged PR found), each with
158
+ * its reason, so a human can see what was spared and why.
159
+ *
160
+ * `worktrees` is the parallel verdict list for the SECOND budget (see worktrees.ts): every linked
161
+ * worktree, each flagged deletable or not. Both budgets are reaped from this one cache file.
162
+ */
163
+ class MergedBranchesCache {
164
+ timestamp;
165
+ deletable;
166
+ keep;
167
+ worktrees;
168
+ constructor(timestamp, deletable, keep, worktrees = []) {
169
+ this.timestamp = timestamp;
170
+ this.deletable = deletable;
171
+ this.keep = keep;
172
+ this.worktrees = worktrees;
173
+ }
174
+ }
175
+ exports.MergedBranchesCache = MergedBranchesCache;
176
+ /**
177
+ * How old the cache may get before a reader must stop asserting figures from it.
178
+ *
179
+ * The cache is ALLOWED to be stale — that is the whole design (see the file header): the slow lookup
180
+ * runs detached, and a branch that merged 30 seconds ago simply survives to the next refresh. What is
181
+ * NOT allowed is quoting a stale file as present-tense fact. Observed 2026-07-30: the guard announced
182
+ * "8 parked local branches … none of them are dead" when there was ONE, having counted branches that
183
+ * had been deleted minutes earlier, and then blocked a legitimate command on that figure.
184
+ *
185
+ * Five minutes, because the refresher is kicked off by the hooks themselves and normally rewrites the
186
+ * file within one tool call; anything older means the refresher did not run or could not finish.
187
+ */
188
+ exports.CACHE_STALE_AFTER_MS = 5 * 60 * 1000;
189
+ /**
190
+ * Whether a cache read off disk may be quoted as fact, and how old it is — so a message can SAY
191
+ * "the cached verdicts are stale" instead of asserting a count it cannot stand behind.
192
+ */
193
+ class CacheFreshness {
194
+ /** True when the file is older than CACHE_STALE_AFTER_MS, or its timestamp is missing/unparseable. */
195
+ stale;
196
+ /** Whole minutes since the cache was written. -1 when that cannot be established. */
197
+ ageMinutes;
198
+ /** The raw ISO timestamp as recorded, or '' — printed verbatim so a human can check it. */
199
+ timestamp;
200
+ constructor(stale, ageMinutes, timestamp) {
201
+ this.stale = stale;
202
+ this.ageMinutes = ageMinutes;
203
+ this.timestamp = timestamp;
204
+ }
205
+ }
206
+ exports.CacheFreshness = CacheFreshness;
207
+ //# sourceMappingURL=merged-branch-verdicts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merged-branch-verdicts.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/merged-branch-verdicts.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+CAA+C;AAC/C,MAAa,YAAY;IACrB,MAAM,CAAS;IACf,EAAE,CAAS;IAEX,YAAY,MAAc,EAAE,EAAU;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;CACJ;AARD,oCAQC;AAED;;;;;;;;;;GAUG;AACH,4FAA4F;AAC/E,QAAA,wBAAwB,GAAG,WAAW,CAAC;AACv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AS;IACnB,2FAA2F;IAC3F,SAAS,CAAS;IAElB,YAAY,KAAc,EAAE,UAAkB,EAAE,SAAiB;QAC7D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;CACJ;AAbD,wCAaC","sourcesContent":["/**\n * The VERDICT vocabulary — every data class and stable classification token the branch/worktree\n * cleanup story is written in. Split out of merged-branches.ts, which holds the SERVICE that produces\n * these values; this file holds only what they mean.\n *\n * Re-exported from merged-branches.ts, so every existing import path keeps working.\n */\n\n// Data-only (per CLAUDE.md, classes for data).\nexport class MergedBranch {\n branch: string;\n pr: number;\n\n constructor(branch: string, pr: number) {\n this.branch = branch;\n this.pr = pr;\n }\n}\n\n/**\n * WHY a branch is dead, or why it was spared — as a STABLE token, alongside the English prose.\n *\n * `sha`/`commits`/`prState` (below) let a human SEE a spared branch. This adds the other half: a token\n * saying WHICH KIND of spared it is. Every spared branch used to report the identical string\n * `no merged PR found — a human must decide`, and in one observed repo that one string covered three\n * genuinely different situations — a PR CLOSED UNMERGED whose work landed under a later number, a\n * branch that NEVER had a PR and holds the only copy of its commits, and content already in main.\n * Reporting all three identically is why nobody ever decided, and why the pile grew to 6 branches\n * against a cap of 5. A token lets wp-cleanup GROUP them and ask a question that can be answered.\n */\n// Dead by proof — these are auto-deletable. BOTH proofs are a MERGED PR; there is no other.\nexport const CLASSIFICATION_MERGED_PR = 'merged-pr';\nexport const CLASSIFICATION_BACKUP_OF_MERGED = 'backup-of-merged';\n/**\n * NOT a proof of death — a SPARED verdict, and the reason this whole liveness model exists.\n *\n * \"Zero commits of its own\" used to be auto-deletable, on the reasoning that a branch holding no\n * commits can lose no work. That reasoning is true of a REF and false of a WORKING TREE: every\n * worktree created with `git worktree add -b … origin/main` has zero commits from the moment it is\n * created until its first commit — i.e. for exactly the window in which an agent is doing its work\n * in it. Observed 2026-07-30: three worktrees with live agents in them were listed as dead, under\n * the sentence \"so no work can be lost\".\n *\n * Liveness is now the same single rule branches already use: reapable == a MERGED PR. Anything not\n * provably merged is LIVE, and live means it is never deleted without an explicit human answer. A\n * genuine husk still gets cleaned up — it is PROMPTABLE (see below), so wp-cleanup asks.\n */\nexport const CLASSIFICATION_NO_COMMITS = 'no-commits';\n// Spared, but a human should be ASKED — in descending order of \"obviously fine to delete\".\nexport const CLASSIFICATION_SUPERSEDED = 'superseded';\nexport const CLASSIFICATION_CONTENT_IN_MAIN = 'content-already-in-main';\nexport const CLASSIFICATION_NEVER_PROPOSED = 'never-proposed';\n// Spared for a mechanical reason, not a judgement call (checked out somewhere).\nexport const CLASSIFICATION_IN_USE = 'in-use';\n\n/**\n * WORKTREE-only classifications. A worktree verdict borrows every token above (its branch is what is\n * being judged), but three of its outcomes have no branch analogue at all, and lumping them under\n * `in-use` would tell wp-cleanup to shut up about exactly the ones a human might want to act on.\n *\n * - PRUNABLE — the directory is already gone; `git worktree prune` is the reap, not `remove`.\n * - LOCKED — a human ran `git worktree lock`. Explicitly \"do not touch\"; never promptable.\n * - CURRENT — the worktree the command is running IN. Removing your own cwd is a self-destruct.\n * - DETACHED — detached HEAD, so there is no branch to judge and no branch to archive.\n */\nexport const CLASSIFICATION_PRUNABLE = 'prunable-worktree';\nexport const CLASSIFICATION_LOCKED = 'locked-worktree';\nexport const CLASSIFICATION_CURRENT = 'current-worktree';\nexport const CLASSIFICATION_DETACHED = 'detached-worktree';\n\n// Spared classifications a human can meaningfully rule on, most-safe first. wp-cleanup prompts in\n// exactly this order so the easy yeses come before the ones that need thought.\nexport const PROMPTABLE_CLASSIFICATIONS: readonly string[] = [\n CLASSIFICATION_SUPERSEDED,\n CLASSIFICATION_CONTENT_IN_MAIN,\n CLASSIFICATION_NEVER_PROPOSED,\n // LAST deliberately. For a parked branch this is the most obvious yes in the whole list, but the\n // identical verdict on a WORKTREE means \"an agent may be working in here right now\", and the\n // prompt cannot tell the human which one they are looking at any better than by ordering it dead\n // last, after the groups whose evidence is about the PAST rather than about work in flight.\n CLASSIFICATION_NO_COMMITS,\n];\n\n/**\n * A local branch and the verdict on it. `pr` is 0 when no merged PR backs the verdict (a `keep`).\n *\n * `sha`, `commits` and `prState` exist for the SPARED branches specifically. When nothing is\n * auto-reapable the branch cap has nothing safe to offer, and its only remaining advice was \"raise\n * maxLocalBranches\" / \"set turnOffRuleUntilEpoch\" — both of which loosen the rule. An agent with no\n * human present took the config edit, which is the exact failure the cap exists to prevent. To ask a\n * human \"may I delete these?\" instead, the guard has to be able to SHOW what it would delete: tip SHA\n * (so the delete is recoverable), PR state (closed? never opened?) and how much unique work is on it.\n *\n * All three are computed in the DETACHED refresher and read straight off merged-branches.json — the\n * blocking hook path never recomputes them. Defaulted so a cache written by an older release (and\n * every existing call site) revives without them.\n */\nexport class DeletableBranch {\n branch: string;\n reason: string;\n pr: number;\n /** Short tip SHA — what makes the delete undoable (`git branch <name> <sha>`). '' when unknown. */\n sha: string;\n /** Commits on this branch that are not on origin/main. -1 when it could not be established. */\n commits: number;\n /** GitHub's state for the PR whose head is this branch: MERGED / CLOSED / OPEN, or '' for none. */\n prState: string;\n /**\n * One of the CLASSIFICATION_* tokens. Defaulted like the fields above so every pre-existing call\n * site — and every cache written by an older release — still constructs; an unclassified revived\n * entry reads as 'never-proposed', the most conservative of the spared verdicts.\n */\n classification: string;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n branch: string,\n reason: string,\n pr: number,\n sha: string = '',\n commits: number = -1,\n prState: string = '',\n classification: string = CLASSIFICATION_NEVER_PROPOSED,\n ) {\n this.branch = branch;\n this.reason = reason;\n this.pr = pr;\n this.sha = sha;\n this.commits = commits;\n this.prState = prState;\n this.classification = classification;\n }\n}\n\n/**\n * A worktree and the verdict on it. Carries `path` (what `git worktree remove` takes) AND `branch`\n * (what `git branch -D` takes afterwards) because reaping a worktree is always those two steps, in\n * that order — git refuses to delete a branch that is still checked out somewhere.\n *\n * `classification` is the same STABLE token the branch verdicts carry, plus the four worktree-only\n * ones above. It exists for the same reason it does on DeletableBranch: `deletable` answers \"may the\n * tooling reap this unattended?\", and everything false used to collapse into one undifferentiated\n * \"spared\" that a human could not rule on. With a token, WorktreeReaper knows whether the reap is a\n * `prune` or a `remove`, and wp-cleanup knows which spared worktrees are worth ASKING about.\n * Defaulted so every pre-existing call site and every cache written by an older release still builds;\n * an unclassified revived entry reads as 'never-proposed', the most conservative spared verdict.\n */\nexport class DeletableWorktree {\n path: string;\n branch: string;\n reason: string;\n pr: number;\n deletable: boolean;\n classification: string;\n\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n path: string,\n branch: string,\n reason: string,\n pr: number,\n deletable: boolean,\n classification: string = CLASSIFICATION_NEVER_PROPOSED,\n ) {\n this.path = path;\n this.branch = branch;\n this.reason = reason;\n this.pr = pr;\n this.deletable = deletable;\n this.classification = classification;\n }\n}\n\n/**\n * `deletable` is PRECOMPUTED so the consumer just deletes the list — no re-deriving, no judgement\n * call at block time. `keep` carries the branches we refuse to touch (no merged PR found), each with\n * its reason, so a human can see what was spared and why.\n *\n * `worktrees` is the parallel verdict list for the SECOND budget (see worktrees.ts): every linked\n * worktree, each flagged deletable or not. Both budgets are reaped from this one cache file.\n */\nexport class MergedBranchesCache {\n timestamp: string;\n deletable: DeletableBranch[];\n keep: DeletableBranch[];\n worktrees: DeletableWorktree[];\n\n constructor(\n timestamp: string,\n deletable: DeletableBranch[],\n keep: DeletableBranch[],\n worktrees: DeletableWorktree[] = [],\n ) {\n this.timestamp = timestamp;\n this.deletable = deletable;\n this.keep = keep;\n this.worktrees = worktrees;\n }\n}\n\n/**\n * How old the cache may get before a reader must stop asserting figures from it.\n *\n * The cache is ALLOWED to be stale — that is the whole design (see the file header): the slow lookup\n * runs detached, and a branch that merged 30 seconds ago simply survives to the next refresh. What is\n * NOT allowed is quoting a stale file as present-tense fact. Observed 2026-07-30: the guard announced\n * \"8 parked local branches … none of them are dead\" when there was ONE, having counted branches that\n * had been deleted minutes earlier, and then blocked a legitimate command on that figure.\n *\n * Five minutes, because the refresher is kicked off by the hooks themselves and normally rewrites the\n * file within one tool call; anything older means the refresher did not run or could not finish.\n */\nexport const CACHE_STALE_AFTER_MS = 5 * 60 * 1000;\n\n/**\n * Whether a cache read off disk may be quoted as fact, and how old it is — so a message can SAY\n * \"the cached verdicts are stale\" instead of asserting a count it cannot stand behind.\n */\nexport class CacheFreshness {\n /** True when the file is older than CACHE_STALE_AFTER_MS, or its timestamp is missing/unparseable. */\n stale: boolean;\n /** Whole minutes since the cache was written. -1 when that cannot be established. */\n ageMinutes: number;\n /** The raw ISO timestamp as recorded, or '' — printed verbatim so a human can check it. */\n timestamp: string;\n\n constructor(stale: boolean, ageMinutes: number, timestamp: string) {\n this.stale = stale;\n this.ageMinutes = ageMinutes;\n this.timestamp = timestamp;\n }\n}\n"]}