@hivelore/core 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +34 -38
- package/dist/index.js +47 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1047,6 +1047,7 @@ declare const PROCESS_GATE_CODES: Set<string>;
|
|
|
1047
1047
|
* being committed. These are the findings the gate is entitled to refuse on.
|
|
1048
1048
|
*/
|
|
1049
1049
|
declare const CONTENT_CATCH_CODES: Set<string>;
|
|
1050
|
+
/** Every code that describes the diff rather than the repo's standing state. */
|
|
1050
1051
|
/** Setup/baseline gates — about the repo's knowledge layer being cold, not the change just made. */
|
|
1051
1052
|
declare const SETUP_GATE_CODES: Set<string>;
|
|
1052
1053
|
/**
|
|
@@ -1061,14 +1062,12 @@ interface GatePolicyInput {
|
|
|
1061
1062
|
mode?: "off" | "advisory" | "strict";
|
|
1062
1063
|
processGate?: "warn" | "block";
|
|
1063
1064
|
humanCommits?: "relaxed" | "strict";
|
|
1064
|
-
scoreThreshold?: number;
|
|
1065
1065
|
}
|
|
1066
1066
|
interface GatePolicy {
|
|
1067
1067
|
posture: GatePosture;
|
|
1068
1068
|
mode: "off" | "advisory" | "strict";
|
|
1069
1069
|
processGate: "warn" | "block";
|
|
1070
1070
|
humanCommits: "relaxed" | "strict";
|
|
1071
|
-
scoreThreshold: number;
|
|
1072
1071
|
/** Which fields the user pinned explicitly, so `doctor` can show posture vs. override. */
|
|
1073
1072
|
overrides: string[];
|
|
1074
1073
|
}
|
|
@@ -1084,40 +1083,15 @@ interface GateVerdictInput {
|
|
|
1084
1083
|
/** Env signals that identified the agent, for the actor label. */
|
|
1085
1084
|
agentSignals?: string[];
|
|
1086
1085
|
}
|
|
1087
|
-
interface BaselineHealth {
|
|
1088
|
-
/**
|
|
1089
|
-
* Health of the repo's KNOWLEDGE LAYER, 0–100. Deliberately not a verdict on the change: content
|
|
1090
|
-
* catches are excluded, because a number that moves both when the repo is cold and when this
|
|
1091
|
-
* particular diff repeated a lesson cannot be tracked over time — it never means one thing.
|
|
1092
|
-
*/
|
|
1093
|
-
score: number;
|
|
1094
|
-
threshold: number;
|
|
1095
|
-
checks: {
|
|
1096
|
-
total: number;
|
|
1097
|
-
ok: number;
|
|
1098
|
-
warn: number;
|
|
1099
|
-
error: number;
|
|
1100
|
-
};
|
|
1101
|
-
}
|
|
1102
1086
|
interface GateVerdict {
|
|
1103
1087
|
findings: GateFinding[];
|
|
1104
1088
|
should_block: boolean;
|
|
1105
1089
|
actor: string;
|
|
1106
|
-
baseline_health: BaselineHealth;
|
|
1107
1090
|
/** Content catches that refuse this change, one entry per memory (never the same lesson twice). */
|
|
1108
1091
|
refusals: GateFinding[];
|
|
1109
1092
|
/** Why process gates did or did not bind on this run. */
|
|
1110
1093
|
process_gate_reason: string;
|
|
1111
1094
|
}
|
|
1112
|
-
/**
|
|
1113
|
-
* Baseline health, computed from the repo's STANDING STATE only.
|
|
1114
|
-
*
|
|
1115
|
-
* Content catches are excluded on purpose. They are a verdict about one diff; folding them into a
|
|
1116
|
-
* health percentage meant the number dropped because of a change under review and rose again when
|
|
1117
|
-
* that change was fixed, while also encoding "the corpus is cold". One number, two meanings, and so
|
|
1118
|
-
* no meaning at all — nobody could act on a trend in it.
|
|
1119
|
-
*/
|
|
1120
|
-
declare function computeBaselineHealth(findings: GateFinding[], threshold: number): BaselineHealth;
|
|
1121
1095
|
/**
|
|
1122
1096
|
* Collapse content catches so one lesson is reported once.
|
|
1123
1097
|
*
|
|
@@ -1132,13 +1106,6 @@ declare function dedupeRefusals(findings: GateFinding[]): GateFinding[];
|
|
|
1132
1106
|
* Decide the whole verdict in one pass. Pure: same inputs, same answer, anywhere.
|
|
1133
1107
|
*/
|
|
1134
1108
|
declare function decideVerdict(input: GateVerdictInput): GateVerdict;
|
|
1135
|
-
/**
|
|
1136
|
-
* The health finding, emitted only when it is worth reading: below target, and nothing else refused.
|
|
1137
|
-
*
|
|
1138
|
-
* When a documented lesson refuses a change, that lesson is the message. Appending "health 2% — top
|
|
1139
|
-
* penalties: …" underneath buries the one line the developer needs.
|
|
1140
|
-
*/
|
|
1141
|
-
declare function buildBaselineHealthFinding(findings: GateFinding[], health: BaselineHealth, shouldBlock: boolean): GateFinding | null;
|
|
1142
1109
|
|
|
1143
1110
|
/**
|
|
1144
1111
|
* How much does an anchor actually TELL US?
|
|
@@ -1251,7 +1218,7 @@ declare function compareVersions(a: string, b: string): number;
|
|
|
1251
1218
|
*
|
|
1252
1219
|
* Pure: the registry lookup and the tag listing happen in the caller.
|
|
1253
1220
|
*/
|
|
1254
|
-
type NpmPublicationCode = "npm-published" | "npm-publish-pending" | "npm-releases-skipped" | "npm-publication-unverified";
|
|
1221
|
+
type NpmPublicationCode = "npm-published" | "npm-publish-pending" | "npm-releases-skipped" | "npm-publication-incoherent" | "npm-publication-unverified";
|
|
1255
1222
|
interface NpmPublicationInput {
|
|
1256
1223
|
packageName: string;
|
|
1257
1224
|
/** Version in the working tree (the lockstep version). */
|
|
@@ -1270,6 +1237,37 @@ interface NpmPublicationVerdict {
|
|
|
1270
1237
|
fix?: string;
|
|
1271
1238
|
}
|
|
1272
1239
|
declare function classifyNpmPublication(input: NpmPublicationInput): NpmPublicationVerdict;
|
|
1240
|
+
/** One lockstep package as seen from the registry. */
|
|
1241
|
+
interface LockstepPackageState {
|
|
1242
|
+
packageName: string;
|
|
1243
|
+
/** Latest version on the registry, or null when it could not be reached. */
|
|
1244
|
+
publishedVersion: string | null;
|
|
1245
|
+
/** Tagged versions strictly between `publishedVersion` and the local version. */
|
|
1246
|
+
taggedBetween?: readonly string[];
|
|
1247
|
+
}
|
|
1248
|
+
interface LockstepPublicationInput {
|
|
1249
|
+
/** The lockstep version in the working tree — every package should end up here. */
|
|
1250
|
+
localVersion: string;
|
|
1251
|
+
packages: readonly LockstepPackageState[];
|
|
1252
|
+
publishHint?: string;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* Judge the WHOLE lockstep set, not one representative package.
|
|
1256
|
+
*
|
|
1257
|
+
* Checking a single package assumes publication is atomic. It is not: `publish:all` runs one
|
|
1258
|
+
* `pnpm publish` per package, so any of them can fail on its own (an expired OTP, a 403) while the
|
|
1259
|
+
* others land. That produces the one state nobody was watching — a PARTIAL publish, where the
|
|
1260
|
+
* registry holds a set that cannot install itself. It happened on 0.60.0: core, cli and embeddings
|
|
1261
|
+
* shipped, `@hivelore/mcp` did not, and since cli pins its siblings exactly, every
|
|
1262
|
+
* `npm i -g @hivelore/cli` failed with `ETARGET No matching version found for @hivelore/mcp@0.60.0`.
|
|
1263
|
+
* `finish` said `npm-publish-pending` about core and nothing at all about the break.
|
|
1264
|
+
*
|
|
1265
|
+
* The severity split of {@link classifyNpmPublication} is preserved and extended:
|
|
1266
|
+
* - nothing published yet → informational (the normal state before publishing),
|
|
1267
|
+
* - some published, some not → WARN, because dependents are broken right now,
|
|
1268
|
+
* - a tagged version the registry skipped entirely → WARN, as before.
|
|
1269
|
+
*/
|
|
1270
|
+
declare function classifyLockstepPublication(input: LockstepPublicationInput): NpmPublicationVerdict;
|
|
1273
1271
|
|
|
1274
1272
|
/**
|
|
1275
1273
|
* Did the tags that were meant to be releases become GitHub Releases?
|
|
@@ -2200,8 +2198,6 @@ interface HaiveConfig {
|
|
|
2200
2198
|
* Default: 180.
|
|
2201
2199
|
*/
|
|
2202
2200
|
decayAfterDays?: number;
|
|
2203
|
-
/** Minimum score required for strict enforcement gates. */
|
|
2204
|
-
scoreThreshold?: number;
|
|
2205
2201
|
/** Remove generated Hivelore runtime/cache files during cleanup gates. */
|
|
2206
2202
|
cleanupGeneratedArtifacts?: boolean;
|
|
2207
2203
|
/**
|
|
@@ -4238,4 +4234,4 @@ interface ReviewDraftOptions {
|
|
|
4238
4234
|
/** Template review learnings into proposed-memory drafts (reuses the scanner-ingest draft shape). */
|
|
4239
4235
|
declare function reviewLearningsToDrafts(learnings: ReviewLearning[], options?: ReviewDraftOptions): MemoryDraft[];
|
|
4240
4236
|
|
|
4241
|
-
export { ADAPTIVE_FLOOR_MIN_SAMPLES, AUTOPILOT_DEFAULTS, type Activation, type ActivationContext, ActivationSchema, type AgentContext, type Anchor, type AnchorAuditRow, type AnchorChurn, AnchorSchema, type AntiPatternGate, type AppendFrictionInput, type AppendFrictionResult, type AppliedConflictResolution, type AstExport, type AutoPromoteRule, BRIDGE_MARKERS, BRIDGE_TARGETS, BRIDGE_TARGET_PATH, BRIEFING_MARKER_TTL_MS, BRIEFING_PRESET_DEFAULTS, type BaselineHealth, type BehaviourCoverageInput, type BehaviourCoverageMetrics, type BehaviourOracleInfo, type BootstrapAssessment, type BootstrapGap, type BootstrapGate, type BootstrapMetrics, type BootstrapState, type BootstrapStateInput, type BreakingChange, type BridgeFileOutput, type BridgeMemoryEntry, type BridgeSensor, type BridgeTarget, type BriefingBudgetNumbers, type BriefingBudgetPreset, type BriefingMarker, type BriefingProofLineOptions, type BudgetPart, type BudgetSlice, type BuildCodeMapOptions, CHARS_PER_TOKEN, CODE_MAP_DEFAULT_EXCLUDE, CODE_MAP_DEFAULT_INCLUDE, CODE_MAP_FILE, CODE_STOPWORDS, CONFIG_FILE, CONTENT_CATCH_CODES, type CaughtForYouOptions, type CaughtForYouRow, type CaughtForYouSummary, type CodeExport, type CodeExportKind, type CodeFileEntry, type CodeMap, type CodeMapQueryOptions, type CollectTimelineOpts, type CommandSensorSpec, type ConfidenceLevel, type ConfidenceThresholds, type ConflictCandidatePair, type ConflictCandidatesOpts, type ConflictResolution, type ContractCheck, type ContractDiffResult, type ContractFile, type ContractSnapshot, type CoverageGap, type CoverageOptions, CrossRepoProvenanceSchema, type CrossRepoReport, type CrossRepoSource, DECAY_DAYS, DEFAULT_AUTO_PROMOTE_RULE, DEFAULT_BRIEFING_EXCLUDE_TAGS, DEFAULT_CONFIDENCE_THRESHOLDS, DEFAULT_CONFIG, DEFAULT_DORMANT_DAYS, DEFAULT_POSTURE, DEFAULT_PRIORITY_SIGNALS, DEFAULT_SPECIFICITY, type DashboardOptions, type DashboardReport, type DepChange, type DepTrackResult, type DependencySnapshot, type DetectStacksInput, type DetectableStack, type DistilledFailureLesson, type DocFrequency, type DormantRow, type DraftOptions, type DraftsOptions, ENV_WORKAROUND_TAGS, type EvalDelta, type EvalHistoryEntry, type EvalReport, type EvalSpec, type EvalTrend, FRICTION_FIELD_MAX, FRICTION_LOG_FILE, FRICTION_STATE_FILE, type FailureCoverageOptions, type FailureObservation, type FeedbackAdjustment, type FeedbackAdjustmentAction, type FeedbackAdjustmentOptions, type Finding, type FindingFormat, type FindingSeverity, type FrictionGroup, type FrictionKind, type FrictionReport, type FrictionState, type FrictionStateEntry, type FrictionStatus, GATE_REMINDER_WINDOW_MS, GUESSABLE_THRESHOLD, type GateFinding, type GateMissProposal, type GatePolicy, type GatePolicyInput, type GatePosture, type GatePrecision, type GatePrecisionDelta, type GatePrecisionMetricDelta, type GateSeverity, type GateStage, type GateTuningSuggestion, type GateVerdict, type GateVerdictInput, type GenerateBridgesOptions, type GitCommit, type GitWatchPlan, type GitWatchState, type GithubReleaseCode, type GithubReleaseInput, type GithubReleaseVerdict, HAIVE_DIR, HAIVE_OWNED_FILES, HANDOFF_FILENAME, HIVELORE_ATTRIBUTION, type HaiveConfig, type HaivePaths, type HotFile, type HotFileSource, type ImpactOptions, type ImpactRow, type ImpactScore, type ImpactSummary, type ImpactTier, type IncidentHints, type InvalidMemoryFile, LEGACY_CONFIG_FILE, type LexicalRankResult, type LoadedMemory, MEMORIES_DIR, MIN_WORD_LEN, type Memory, type MemoryDraft, type MemoryFrontmatter, MemoryFrontmatterSchema, type MemoryPriority, type MemoryScope, MemoryScopeSchema, type MemoryStatus, MemoryStatusSchema, type MemoryType, MemoryTypeSchema, type MemoryUsage, type MergeResult, type MetricDelta, type NpmPublicationCode, type NpmPublicationInput, type NpmPublicationVerdict, PREVENTION_DEBOUNCE_MS, PREVENTION_RECEIPT_MARKER, PROCESS_GATE_CODES, PROJECT_CONTEXT_FILE, PROJECT_CONTEXT_THROTTLE_MS, type PostIncidentLesson, type PreventionCommentFinding, type PreventionEvent, type PreventionEventDetail, type PreventionReceipt, type PreventionReceiptRow, type PreventionRow, type PreventionSource, type PreventionTrend, type PrioritySignals, type ProposedEvalSpec, type ProposedSensorVerdict, RECAP_HISTORY_HEADING, RECAP_HISTORY_MAX, REVIEW_LEARNING_MARKER, RUNTIME_JOURNAL_FILENAME, type RecurrenceReport, type RecurrenceRow, type ResolveProjectInfo, type RetirementSignal, type RetrievalAggregate, type RetrievalCase, type RetrievalCaseResult, type ReviewDraftOptions, type ReviewLearning, type RuntimeJournalEntry, SCAFFOLD_MARKER_RE, SEED_QUALITY_FLOOR, SENSOR_ABSENT_LOOKBACK, SENSOR_ABSENT_WINDOW, SESSION_RECAP_TTL_MS, SETUP_GATE_CODES, STACK_PACK_TAG, type ScaffoldLoopGap, type ScaffoldOptions, type ScaffoldStyle, type SeedProposal, type SelfEvalOptions, type Sensor, type SensorAggregate, type SensorCase, type SensorCaseResult, type SensorEvaluation, type SensorEvaluationOutcome, type SensorEvaluationStage, type SensorFlap, type SensorHealth, type SensorHit, type SensorRow, SensorSchema, type SensorSeed, type SensorSelfCheck, type SensorSuggestionOptions, type SensorTarget, type SensorWaiver, type SensorWeakening, type SessionHandoffData, type SkillActivation, TEST_FRAMEWORKS, type TestFramework, type TestScaffold, type TierContractCheck, type TimelineEntry, type TopicStatusPair, type TruncateOptions, type TruncateResult, USAGE_FILE, USAGE_LOG_DIR, USAGE_LOG_FILE, type UncapturedFailure, type UncoveredAreaSuggestion, type UsageAggregate, type UsageEvent, type UsageIndex, type VerifyOptions, type VerifyResult, WEAK_ANCHOR_CHURN_RATIO, adaptiveSemanticFloor, addedLineNumbersFromDiff, addedLinesFromDiff, aggregateRetrieval, aggregateSensors, aggregateUsage, allocateBudget, anchorMatchesComponent, anchorSpecificity, antiPatternGateParams, appendEvalHistory, appendFrictionReport, appendPreventionEvent, appendProposedRetrievalCases, appendRuntimeJournalEntry, appendSensorEvaluations, appendUsageEvent, applyConflictResolution, applyFeedbackAdjustment, approveProposedCases, assessBehaviourCoverage, assessBootstrapState, assessScaffoldLoop, assessSensorHealth, auditAnchorSpecificity, bridgeMemorySummary, briefingMarkerPath, briefingMarkersDir, briefingProofLine, buildBaselineHealthFinding, buildCodeMap, buildCoverageIndex, buildDashboard, buildDocFrequency, buildFrontmatter, buildHandoffMarkdown, buildPreventionReceipt, buildProposeCommand, buildRecapWithHistory, buildReport, bumpRead, changedPathsFromDiff, churnForAnchors, classifyGithubRelease, classifyMemoryPriority, classifyNpmPublication, codeMapContentHash, codeMapPath, collectTimelineEntries, compactAutoRecapBody, compareEvalReports, compareGatePrecision, compareImpact, compareVersions, compileRegexSensor, componentOf, computeBaselineHealth, computeEvalTrend, computeGatePrecision, computeImpact, computePreventionTrend, computeRecurrence, computeScopeHash, configPath, contractLockPath, countSourceFilesOnDisk, decideVerdict, dedupeRefusals, deriveConfidence, deriveMainAreas, describePosture, detectAgentContext, detectSensorWeakening, detectStacksFromManifests, diffContract, diffHasDistinctiveOverlap, distillFailureObservations, distinctiveCap, draftsFromFindings, emptyUsage, emptyUsageIndex, enforcementDir, estimateTokens, evalHistoryPath, evaluateSkillActivation, existingGateMissShas, explainSensorRejection, extractActionsBriefBody, extractCorrectApproachExamples, extractReferencedPaths, extractReviewLearnings, extractSensorExamples, extractSnippet, extractTestFilePathsFromCommand, filterNewDrafts, findCoverageGaps, findLexicalConflictPairs, findProjectRoot, findTopicStatusConflictPairs, findUncapturedFailures, findingBody, findingToDraft, firstMemoryOneLine, formatFrictionIssue, frictionFingerprint, frictionLogPath, frictionStatePath, gatePassedShas, generateBridges, getUsage, globToRegExp, groupFriction, handoffAgeMs, handoffFilePath, hasPendingTestMarker, hasRecentBriefingMarker, hashProjectContext, incidentHintsFromDiff, incidentSuffix, inferModulesFromPaths, isAutoPromoteEligible, isAutoRecap, isCovered, isDecaying, isDistinctiveToken, isEnvWorkaroundMemory, isFreshIsoDate, isGlobPath, isHarnessErrorOutput, isLikelyGuessable, isNoiseSubject, isProductionCodeFile, isRetiredMemory, isSensorScannablePath, isSkill, isSkillSuppressed, isStackPackSeed, isStylisticRule, isTemplateProjectContext, isWeakAnchor, judgeProposedSensor, lessonShortName, listMarkdownFilesRecursive, literalMatchesAllTokens, literalMatchesAnyToken, loadCodeMap, loadConfig, loadConfigSync, loadEvalHistory, loadFrictionState, loadMemoriesFromDir, loadMemoriesFromDirDetailed, loadMemory, loadPreventionEvents, loadSensorLedger, loadUsageIndex, looksLikeGenericAdvice, meetsSeedQualityFloor, memoryFilePath, memoryHasExcludedTag, memoryMatchesAnchorPaths, mergeHotFiles, mergeMemoryVersions, mineSensorSeedFromDiff, moduleNameOf, newMemoryId, normalizeChurnPath, normalizeFindingSeverity, normalizeFramework, normalizeFrictionSummary, normalizeKind, normalizeScaffoldStyle, normalizeSessionId, overallScore, parseEslintJson, parseFileAst, parseFindings, parseLessonFields, parseMemory, parseNpmAudit, parseSarif, parseSince, parseSonar, pathsOverlap, pickSnippetNeedle, pickTestFramework, planConflictResolution, planGitWatch, prepareBridgeData, preventionLogPath, priorityRank, prioritySignals, projectContextRecentlyEmitted, proposeGateMissDrafts, proposeSeedsFromCommits, pullCrossRepoSources, quarantineNote, queryCodeMap, rankMemoriesLexical, readFrictionReports, readRecentBriefingMarker, readRuntimeJournalTail, readSessionHandoff, readUsageEvents, recapBriefingExcerpt, recommendFeedbackAdjustment, recordApplied, recordGateReminder, recordPrevention, recordPreventionHits, recordProjectContextEmission, recordRejection, relPathFrom, renderBehaviourCoverageLine, renderBootstrapChecklist, renderCaughtForYou, renderPreventionComment, renderPreventionReceipt, renderPreventionReceiptShare, resolveBriefingBudget, resolveConfigPath, resolveGatePolicy, resolveHaivePaths, resolveManifestFiles, resolveProjectInfo, retirementSignal, revertedShaFromCommit, reviewLearningsToDrafts, runPresenceSensors, runRegexSensor, runSensors, runTierContract, runValidationContract, runtimeJournalPath, saveCodeMap, saveConfig, saveFrictionState, saveUsageIndex, scaffoldPostIncidentTest, scannableSensorTargets, scoreRetrievalCase, scoreSensorCase, scrubbedCommandEnv, selectCommandSensors, sensorAppliesToPath, sensorLedgerPath, sensorPatternBrittleness, sensorPromotedAtMap, sensorSelfCheck, sensorTargetsFromDiff, sensorWaiverOnLine, serializeCodeMap, serializeMemory, setFrictionStatus, shouldExpandGateReminder, snapshotContract, specificityScore, stripCommentsForScan, stripPrivate, suggestGate, suggestSensorFromMemory, suggestSensorSeed, suggestTopicKey, summarizeCaughtForYou, summarizeImpact, synthesizeSelfEvalCases, tallyHotFiles, titleFromBody, tokenizeQuery, tokenizeWords, trackDependencies, trackReads, truncateToTokens, usageLogPath, usageLogSize, usagePath, verifyAnchor, watchContracts, withQuarantineNote, withoutQuarantineNote, writeBriefingMarker, writeSessionHandoff };
|
|
4237
|
+
export { ADAPTIVE_FLOOR_MIN_SAMPLES, AUTOPILOT_DEFAULTS, type Activation, type ActivationContext, ActivationSchema, type AgentContext, type Anchor, type AnchorAuditRow, type AnchorChurn, AnchorSchema, type AntiPatternGate, type AppendFrictionInput, type AppendFrictionResult, type AppliedConflictResolution, type AstExport, type AutoPromoteRule, BRIDGE_MARKERS, BRIDGE_TARGETS, BRIDGE_TARGET_PATH, BRIEFING_MARKER_TTL_MS, BRIEFING_PRESET_DEFAULTS, type BehaviourCoverageInput, type BehaviourCoverageMetrics, type BehaviourOracleInfo, type BootstrapAssessment, type BootstrapGap, type BootstrapGate, type BootstrapMetrics, type BootstrapState, type BootstrapStateInput, type BreakingChange, type BridgeFileOutput, type BridgeMemoryEntry, type BridgeSensor, type BridgeTarget, type BriefingBudgetNumbers, type BriefingBudgetPreset, type BriefingMarker, type BriefingProofLineOptions, type BudgetPart, type BudgetSlice, type BuildCodeMapOptions, CHARS_PER_TOKEN, CODE_MAP_DEFAULT_EXCLUDE, CODE_MAP_DEFAULT_INCLUDE, CODE_MAP_FILE, CODE_STOPWORDS, CONFIG_FILE, CONTENT_CATCH_CODES, type CaughtForYouOptions, type CaughtForYouRow, type CaughtForYouSummary, type CodeExport, type CodeExportKind, type CodeFileEntry, type CodeMap, type CodeMapQueryOptions, type CollectTimelineOpts, type CommandSensorSpec, type ConfidenceLevel, type ConfidenceThresholds, type ConflictCandidatePair, type ConflictCandidatesOpts, type ConflictResolution, type ContractCheck, type ContractDiffResult, type ContractFile, type ContractSnapshot, type CoverageGap, type CoverageOptions, CrossRepoProvenanceSchema, type CrossRepoReport, type CrossRepoSource, DECAY_DAYS, DEFAULT_AUTO_PROMOTE_RULE, DEFAULT_BRIEFING_EXCLUDE_TAGS, DEFAULT_CONFIDENCE_THRESHOLDS, DEFAULT_CONFIG, DEFAULT_DORMANT_DAYS, DEFAULT_POSTURE, DEFAULT_PRIORITY_SIGNALS, DEFAULT_SPECIFICITY, type DashboardOptions, type DashboardReport, type DepChange, type DepTrackResult, type DependencySnapshot, type DetectStacksInput, type DetectableStack, type DistilledFailureLesson, type DocFrequency, type DormantRow, type DraftOptions, type DraftsOptions, ENV_WORKAROUND_TAGS, type EvalDelta, type EvalHistoryEntry, type EvalReport, type EvalSpec, type EvalTrend, FRICTION_FIELD_MAX, FRICTION_LOG_FILE, FRICTION_STATE_FILE, type FailureCoverageOptions, type FailureObservation, type FeedbackAdjustment, type FeedbackAdjustmentAction, type FeedbackAdjustmentOptions, type Finding, type FindingFormat, type FindingSeverity, type FrictionGroup, type FrictionKind, type FrictionReport, type FrictionState, type FrictionStateEntry, type FrictionStatus, GATE_REMINDER_WINDOW_MS, GUESSABLE_THRESHOLD, type GateFinding, type GateMissProposal, type GatePolicy, type GatePolicyInput, type GatePosture, type GatePrecision, type GatePrecisionDelta, type GatePrecisionMetricDelta, type GateSeverity, type GateStage, type GateTuningSuggestion, type GateVerdict, type GateVerdictInput, type GenerateBridgesOptions, type GitCommit, type GitWatchPlan, type GitWatchState, type GithubReleaseCode, type GithubReleaseInput, type GithubReleaseVerdict, HAIVE_DIR, HAIVE_OWNED_FILES, HANDOFF_FILENAME, HIVELORE_ATTRIBUTION, type HaiveConfig, type HaivePaths, type HotFile, type HotFileSource, type ImpactOptions, type ImpactRow, type ImpactScore, type ImpactSummary, type ImpactTier, type IncidentHints, type InvalidMemoryFile, LEGACY_CONFIG_FILE, type LexicalRankResult, type LoadedMemory, type LockstepPackageState, type LockstepPublicationInput, MEMORIES_DIR, MIN_WORD_LEN, type Memory, type MemoryDraft, type MemoryFrontmatter, MemoryFrontmatterSchema, type MemoryPriority, type MemoryScope, MemoryScopeSchema, type MemoryStatus, MemoryStatusSchema, type MemoryType, MemoryTypeSchema, type MemoryUsage, type MergeResult, type MetricDelta, type NpmPublicationCode, type NpmPublicationInput, type NpmPublicationVerdict, PREVENTION_DEBOUNCE_MS, PREVENTION_RECEIPT_MARKER, PROCESS_GATE_CODES, PROJECT_CONTEXT_FILE, PROJECT_CONTEXT_THROTTLE_MS, type PostIncidentLesson, type PreventionCommentFinding, type PreventionEvent, type PreventionEventDetail, type PreventionReceipt, type PreventionReceiptRow, type PreventionRow, type PreventionSource, type PreventionTrend, type PrioritySignals, type ProposedEvalSpec, type ProposedSensorVerdict, RECAP_HISTORY_HEADING, RECAP_HISTORY_MAX, REVIEW_LEARNING_MARKER, RUNTIME_JOURNAL_FILENAME, type RecurrenceReport, type RecurrenceRow, type ResolveProjectInfo, type RetirementSignal, type RetrievalAggregate, type RetrievalCase, type RetrievalCaseResult, type ReviewDraftOptions, type ReviewLearning, type RuntimeJournalEntry, SCAFFOLD_MARKER_RE, SEED_QUALITY_FLOOR, SENSOR_ABSENT_LOOKBACK, SENSOR_ABSENT_WINDOW, SESSION_RECAP_TTL_MS, SETUP_GATE_CODES, STACK_PACK_TAG, type ScaffoldLoopGap, type ScaffoldOptions, type ScaffoldStyle, type SeedProposal, type SelfEvalOptions, type Sensor, type SensorAggregate, type SensorCase, type SensorCaseResult, type SensorEvaluation, type SensorEvaluationOutcome, type SensorEvaluationStage, type SensorFlap, type SensorHealth, type SensorHit, type SensorRow, SensorSchema, type SensorSeed, type SensorSelfCheck, type SensorSuggestionOptions, type SensorTarget, type SensorWaiver, type SensorWeakening, type SessionHandoffData, type SkillActivation, TEST_FRAMEWORKS, type TestFramework, type TestScaffold, type TierContractCheck, type TimelineEntry, type TopicStatusPair, type TruncateOptions, type TruncateResult, USAGE_FILE, USAGE_LOG_DIR, USAGE_LOG_FILE, type UncapturedFailure, type UncoveredAreaSuggestion, type UsageAggregate, type UsageEvent, type UsageIndex, type VerifyOptions, type VerifyResult, WEAK_ANCHOR_CHURN_RATIO, adaptiveSemanticFloor, addedLineNumbersFromDiff, addedLinesFromDiff, aggregateRetrieval, aggregateSensors, aggregateUsage, allocateBudget, anchorMatchesComponent, anchorSpecificity, antiPatternGateParams, appendEvalHistory, appendFrictionReport, appendPreventionEvent, appendProposedRetrievalCases, appendRuntimeJournalEntry, appendSensorEvaluations, appendUsageEvent, applyConflictResolution, applyFeedbackAdjustment, approveProposedCases, assessBehaviourCoverage, assessBootstrapState, assessScaffoldLoop, assessSensorHealth, auditAnchorSpecificity, bridgeMemorySummary, briefingMarkerPath, briefingMarkersDir, briefingProofLine, buildCodeMap, buildCoverageIndex, buildDashboard, buildDocFrequency, buildFrontmatter, buildHandoffMarkdown, buildPreventionReceipt, buildProposeCommand, buildRecapWithHistory, buildReport, bumpRead, changedPathsFromDiff, churnForAnchors, classifyGithubRelease, classifyLockstepPublication, classifyMemoryPriority, classifyNpmPublication, codeMapContentHash, codeMapPath, collectTimelineEntries, compactAutoRecapBody, compareEvalReports, compareGatePrecision, compareImpact, compareVersions, compileRegexSensor, componentOf, computeEvalTrend, computeGatePrecision, computeImpact, computePreventionTrend, computeRecurrence, computeScopeHash, configPath, contractLockPath, countSourceFilesOnDisk, decideVerdict, dedupeRefusals, deriveConfidence, deriveMainAreas, describePosture, detectAgentContext, detectSensorWeakening, detectStacksFromManifests, diffContract, diffHasDistinctiveOverlap, distillFailureObservations, distinctiveCap, draftsFromFindings, emptyUsage, emptyUsageIndex, enforcementDir, estimateTokens, evalHistoryPath, evaluateSkillActivation, existingGateMissShas, explainSensorRejection, extractActionsBriefBody, extractCorrectApproachExamples, extractReferencedPaths, extractReviewLearnings, extractSensorExamples, extractSnippet, extractTestFilePathsFromCommand, filterNewDrafts, findCoverageGaps, findLexicalConflictPairs, findProjectRoot, findTopicStatusConflictPairs, findUncapturedFailures, findingBody, findingToDraft, firstMemoryOneLine, formatFrictionIssue, frictionFingerprint, frictionLogPath, frictionStatePath, gatePassedShas, generateBridges, getUsage, globToRegExp, groupFriction, handoffAgeMs, handoffFilePath, hasPendingTestMarker, hasRecentBriefingMarker, hashProjectContext, incidentHintsFromDiff, incidentSuffix, inferModulesFromPaths, isAutoPromoteEligible, isAutoRecap, isCovered, isDecaying, isDistinctiveToken, isEnvWorkaroundMemory, isFreshIsoDate, isGlobPath, isHarnessErrorOutput, isLikelyGuessable, isNoiseSubject, isProductionCodeFile, isRetiredMemory, isSensorScannablePath, isSkill, isSkillSuppressed, isStackPackSeed, isStylisticRule, isTemplateProjectContext, isWeakAnchor, judgeProposedSensor, lessonShortName, listMarkdownFilesRecursive, literalMatchesAllTokens, literalMatchesAnyToken, loadCodeMap, loadConfig, loadConfigSync, loadEvalHistory, loadFrictionState, loadMemoriesFromDir, loadMemoriesFromDirDetailed, loadMemory, loadPreventionEvents, loadSensorLedger, loadUsageIndex, looksLikeGenericAdvice, meetsSeedQualityFloor, memoryFilePath, memoryHasExcludedTag, memoryMatchesAnchorPaths, mergeHotFiles, mergeMemoryVersions, mineSensorSeedFromDiff, moduleNameOf, newMemoryId, normalizeChurnPath, normalizeFindingSeverity, normalizeFramework, normalizeFrictionSummary, normalizeKind, normalizeScaffoldStyle, normalizeSessionId, overallScore, parseEslintJson, parseFileAst, parseFindings, parseLessonFields, parseMemory, parseNpmAudit, parseSarif, parseSince, parseSonar, pathsOverlap, pickSnippetNeedle, pickTestFramework, planConflictResolution, planGitWatch, prepareBridgeData, preventionLogPath, priorityRank, prioritySignals, projectContextRecentlyEmitted, proposeGateMissDrafts, proposeSeedsFromCommits, pullCrossRepoSources, quarantineNote, queryCodeMap, rankMemoriesLexical, readFrictionReports, readRecentBriefingMarker, readRuntimeJournalTail, readSessionHandoff, readUsageEvents, recapBriefingExcerpt, recommendFeedbackAdjustment, recordApplied, recordGateReminder, recordPrevention, recordPreventionHits, recordProjectContextEmission, recordRejection, relPathFrom, renderBehaviourCoverageLine, renderBootstrapChecklist, renderCaughtForYou, renderPreventionComment, renderPreventionReceipt, renderPreventionReceiptShare, resolveBriefingBudget, resolveConfigPath, resolveGatePolicy, resolveHaivePaths, resolveManifestFiles, resolveProjectInfo, retirementSignal, revertedShaFromCommit, reviewLearningsToDrafts, runPresenceSensors, runRegexSensor, runSensors, runTierContract, runValidationContract, runtimeJournalPath, saveCodeMap, saveConfig, saveFrictionState, saveUsageIndex, scaffoldPostIncidentTest, scannableSensorTargets, scoreRetrievalCase, scoreSensorCase, scrubbedCommandEnv, selectCommandSensors, sensorAppliesToPath, sensorLedgerPath, sensorPatternBrittleness, sensorPromotedAtMap, sensorSelfCheck, sensorTargetsFromDiff, sensorWaiverOnLine, serializeCodeMap, serializeMemory, setFrictionStatus, shouldExpandGateReminder, snapshotContract, specificityScore, stripCommentsForScan, stripPrivate, suggestGate, suggestSensorFromMemory, suggestSensorSeed, suggestTopicKey, summarizeCaughtForYou, summarizeImpact, synthesizeSelfEvalCases, tallyHotFiles, titleFromBody, tokenizeQuery, tokenizeWords, trackDependencies, trackReads, truncateToTokens, usageLogPath, usageLogSize, usagePath, verifyAnchor, watchContracts, withQuarantineNote, withoutQuarantineNote, writeBriefingMarker, writeSessionHandoff };
|
package/dist/index.js
CHANGED
|
@@ -1328,10 +1328,8 @@ var PROCESS_GATE_CODES = /* @__PURE__ */ new Set([
|
|
|
1328
1328
|
"bootstrap-incomplete"
|
|
1329
1329
|
]);
|
|
1330
1330
|
var CONTENT_CATCH_CODES = /* @__PURE__ */ new Set(["sensor-block", "precommit-policy-block"]);
|
|
1331
|
-
var CONTENT_CODES = /* @__PURE__ */ new Set([...CONTENT_CATCH_CODES, "sensor-warn"]);
|
|
1332
1331
|
var SETUP_GATE_CODES = /* @__PURE__ */ new Set([
|
|
1333
|
-
...PROCESS_GATE_CODES
|
|
1334
|
-
"enforcement-score-below-threshold"
|
|
1332
|
+
...PROCESS_GATE_CODES
|
|
1335
1333
|
]);
|
|
1336
1334
|
var DEFAULT_POSTURE = "balanced";
|
|
1337
1335
|
var POSTURE_DEFAULTS = {
|
|
@@ -1355,7 +1353,6 @@ function resolveGatePolicy(input) {
|
|
|
1355
1353
|
mode: cfg.mode ?? base.mode,
|
|
1356
1354
|
processGate: cfg.processGate ?? base.processGate,
|
|
1357
1355
|
humanCommits: cfg.humanCommits ?? base.humanCommits,
|
|
1358
|
-
scoreThreshold: cfg.scoreThreshold ?? 80,
|
|
1359
1356
|
overrides
|
|
1360
1357
|
};
|
|
1361
1358
|
}
|
|
@@ -1385,25 +1382,6 @@ function processGateDecision(policy, stage, isAgent) {
|
|
|
1385
1382
|
}
|
|
1386
1383
|
return { refuses: true, reason: "enforced: process gates bind at this sharing point." };
|
|
1387
1384
|
}
|
|
1388
|
-
function penaltyOf(finding) {
|
|
1389
|
-
if (finding.severity === "error") return finding.impact ?? 25;
|
|
1390
|
-
if (finding.severity === "warn") return finding.impact ?? 8;
|
|
1391
|
-
return 0;
|
|
1392
|
-
}
|
|
1393
|
-
function computeBaselineHealth(findings, threshold) {
|
|
1394
|
-
const baseline = findings.filter((f) => !CONTENT_CODES.has(f.code));
|
|
1395
|
-
const penalty = baseline.reduce((sum, f) => sum + penaltyOf(f), 0);
|
|
1396
|
-
return {
|
|
1397
|
-
score: Math.max(0, Math.min(100, 100 - penalty)),
|
|
1398
|
-
threshold,
|
|
1399
|
-
checks: {
|
|
1400
|
-
total: findings.length,
|
|
1401
|
-
ok: findings.filter((f) => f.severity === "ok").length,
|
|
1402
|
-
warn: findings.filter((f) => f.severity === "warn").length,
|
|
1403
|
-
error: findings.filter((f) => f.severity === "error").length
|
|
1404
|
-
}
|
|
1405
|
-
};
|
|
1406
|
-
}
|
|
1407
1385
|
function dedupeRefusals(findings) {
|
|
1408
1386
|
const byMemory = /* @__PURE__ */ new Map();
|
|
1409
1387
|
const out = [];
|
|
@@ -1434,29 +1412,16 @@ function decideVerdict(input) {
|
|
|
1434
1412
|
message: `${finding.message} (${process2.reason})`
|
|
1435
1413
|
};
|
|
1436
1414
|
});
|
|
1437
|
-
const baselineHealth = computeBaselineHealth(findings, policy.scoreThreshold);
|
|
1438
1415
|
const refusals = dedupeRefusals(findings);
|
|
1439
1416
|
const hasErrors = findings.some((f) => f.severity === "error");
|
|
1440
1417
|
return {
|
|
1441
1418
|
findings,
|
|
1442
1419
|
should_block: policy.mode === "strict" && hasErrors,
|
|
1443
1420
|
actor: isAgent ? `agent (${(input.agentSignals ?? []).join(", ")})` : process2.refuses ? "human \u2014 strict (enforcement.humanCommits)" : "human \u2014 process gates relaxed",
|
|
1444
|
-
baseline_health: baselineHealth,
|
|
1445
1421
|
refusals,
|
|
1446
1422
|
process_gate_reason: process2.reason
|
|
1447
1423
|
};
|
|
1448
1424
|
}
|
|
1449
|
-
function buildBaselineHealthFinding(findings, health, shouldBlock) {
|
|
1450
|
-
if (shouldBlock || health.score >= health.threshold) return null;
|
|
1451
|
-
const topPenalties = findings.filter((f) => !CONTENT_CODES.has(f.code)).map((f) => ({ code: f.code, penalty: penaltyOf(f) })).filter((p) => p.penalty > 0).sort((a, b) => b.penalty - a.penalty).slice(0, 3);
|
|
1452
|
-
return {
|
|
1453
|
-
severity: "warn",
|
|
1454
|
-
code: "enforcement-score-below-threshold",
|
|
1455
|
-
message: `Repo knowledge-layer health ${health.score}% is below the ${health.threshold}% target` + (topPenalties.length > 0 ? ` \u2014 top gaps: ${topPenalties.map((p) => `${p.code} (\u2212${p.penalty})`).join(", ")}` : "") + ". This measures the repo's baseline, not this change; it never blocks.",
|
|
1456
|
-
fix: "Fill the gaps above (bootstrap, briefing, recap), then rerun `hivelore enforce check`.",
|
|
1457
|
-
impact: 0
|
|
1458
|
-
};
|
|
1459
|
-
}
|
|
1460
1425
|
|
|
1461
1426
|
// src/anchor-specificity.ts
|
|
1462
1427
|
var WEAK_ANCHOR_CHURN_RATIO = 0.35;
|
|
@@ -1570,6 +1535,51 @@ function classifyNpmPublication(input) {
|
|
|
1570
1535
|
fix: hint
|
|
1571
1536
|
};
|
|
1572
1537
|
}
|
|
1538
|
+
function classifyLockstepPublication(input) {
|
|
1539
|
+
const { localVersion } = input;
|
|
1540
|
+
const hint = input.publishHint ?? `publish the lockstep packages at ${localVersion}`;
|
|
1541
|
+
const reachable = input.packages.filter((pkg) => pkg.publishedVersion !== null);
|
|
1542
|
+
if (reachable.length === 0) {
|
|
1543
|
+
return {
|
|
1544
|
+
code: "npm-publication-unverified",
|
|
1545
|
+
severity: "info",
|
|
1546
|
+
message: `Could not reach the registry to check whether the ${input.packages.length} lockstep package(s) are published at ${localVersion}.`
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
const behind = reachable.filter((pkg) => compareVersions(pkg.publishedVersion, localVersion) < 0);
|
|
1550
|
+
if (behind.length === 0) {
|
|
1551
|
+
return {
|
|
1552
|
+
code: "npm-published",
|
|
1553
|
+
severity: "ok",
|
|
1554
|
+
message: `All ${reachable.length} lockstep package(s) are on npm at ${localVersion}.`
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
const names = behind.map((pkg) => `${pkg.packageName} (${pkg.publishedVersion})`).join(", ");
|
|
1558
|
+
if (behind.length < reachable.length) {
|
|
1559
|
+
const ahead = reachable.filter((pkg) => !behind.includes(pkg));
|
|
1560
|
+
return {
|
|
1561
|
+
code: "npm-publication-incoherent",
|
|
1562
|
+
severity: "warn",
|
|
1563
|
+
message: `npm holds an INCOHERENT lockstep set: ${ahead.length} package(s) are at ${localVersion} but ${behind.length} are behind \u2014 ${names}. Packages that pin their siblings exactly cannot be installed at all (ETARGET), so this breaks users right now.`,
|
|
1564
|
+
fix: `Publish the missing package(s) at ${localVersion}: ${hint}. If a publish step reports success while the registry stays behind, its credentials are missing \u2014 a workflow that SKIPS publishing still reports green.`
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
const skipped = [...new Set(behind.flatMap((pkg) => [...pkg.taggedBetween ?? []]))].sort(compareVersions);
|
|
1568
|
+
if (skipped.length > 0) {
|
|
1569
|
+
return {
|
|
1570
|
+
code: "npm-releases-skipped",
|
|
1571
|
+
severity: "warn",
|
|
1572
|
+
message: `${skipped.length} tagged release(s) never reached npm \u2014 the lockstep packages are behind: ${names}. Skipped: ${skipped.map((v) => `v${v}`).join(", ")}.`,
|
|
1573
|
+
fix: `Registry versions are not cumulative, so publishing the newest is enough: ${hint}. If the release workflow keeps skipping, its publish credentials are missing.`
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
return {
|
|
1577
|
+
code: "npm-publish-pending",
|
|
1578
|
+
severity: "info",
|
|
1579
|
+
message: `The ${behind.length} lockstep package(s) are not on npm at ${localVersion} yet (${names}) \u2014 expected at this point; publish is the next step.`,
|
|
1580
|
+
fix: hint
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1573
1583
|
|
|
1574
1584
|
// src/github-release.ts
|
|
1575
1585
|
var MAX_LISTED = 5;
|
|
@@ -4211,7 +4221,6 @@ var DEFAULT_CONFIG = {
|
|
|
4211
4221
|
humanCommits: "relaxed",
|
|
4212
4222
|
commandSensorUnrunnable: "warn",
|
|
4213
4223
|
sensorWeakeningGate: "warn",
|
|
4214
|
-
scoreThreshold: 80,
|
|
4215
4224
|
cleanupGeneratedArtifacts: true,
|
|
4216
4225
|
toolProfile: "enforcement",
|
|
4217
4226
|
policyPacks: ["architecture", "gotchas", "security", "domain", "release"],
|
|
@@ -4247,7 +4256,6 @@ var AUTOPILOT_DEFAULTS = {
|
|
|
4247
4256
|
humanCommits: "relaxed",
|
|
4248
4257
|
commandSensorUnrunnable: "warn",
|
|
4249
4258
|
sensorWeakeningGate: "warn",
|
|
4250
|
-
scoreThreshold: 85,
|
|
4251
4259
|
cleanupGeneratedArtifacts: true,
|
|
4252
4260
|
toolProfile: "enforcement",
|
|
4253
4261
|
policyPacks: ["architecture", "gotchas", "security", "domain", "release"],
|
|
@@ -7735,7 +7743,6 @@ export {
|
|
|
7735
7743
|
briefingMarkerPath,
|
|
7736
7744
|
briefingMarkersDir,
|
|
7737
7745
|
briefingProofLine,
|
|
7738
|
-
buildBaselineHealthFinding,
|
|
7739
7746
|
buildCodeMap,
|
|
7740
7747
|
buildCoverageIndex,
|
|
7741
7748
|
buildDashboard,
|
|
@@ -7750,6 +7757,7 @@ export {
|
|
|
7750
7757
|
changedPathsFromDiff,
|
|
7751
7758
|
churnForAnchors,
|
|
7752
7759
|
classifyGithubRelease,
|
|
7760
|
+
classifyLockstepPublication,
|
|
7753
7761
|
classifyMemoryPriority,
|
|
7754
7762
|
classifyNpmPublication,
|
|
7755
7763
|
codeMapContentHash,
|
|
@@ -7762,7 +7770,6 @@ export {
|
|
|
7762
7770
|
compareVersions,
|
|
7763
7771
|
compileRegexSensor,
|
|
7764
7772
|
componentOf,
|
|
7765
|
-
computeBaselineHealth,
|
|
7766
7773
|
computeEvalTrend,
|
|
7767
7774
|
computeGatePrecision,
|
|
7768
7775
|
computeImpact,
|