@hivelore/core 0.57.1 → 0.57.4
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 +117 -1
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1159,6 +1159,101 @@ declare function auditAnchorSpecificity(memories: ReadonlyArray<{
|
|
|
1159
1159
|
anchorPaths: readonly string[];
|
|
1160
1160
|
}>, fileChurn: AnchorChurn, totalCommits: number): AnchorAuditRow[];
|
|
1161
1161
|
|
|
1162
|
+
/**
|
|
1163
|
+
* One ordering for dotted version strings, shared by everything in the release chain.
|
|
1164
|
+
*
|
|
1165
|
+
* There were three byte-identical copies of this — two in core, one in the CLI — because each new
|
|
1166
|
+
* release check wrote its own rather than look for one. Ordering is the kind of thing that must
|
|
1167
|
+
* not disagree with itself between two gates reading the same tags.
|
|
1168
|
+
*
|
|
1169
|
+
* Deliberately lenient, not a semver parser: it splits on `.` and `-`, reads each part as an
|
|
1170
|
+
* integer and treats anything unparseable as 0. Inputs here are tags and registry versions the
|
|
1171
|
+
* repo produced itself, and a comparator that throws would turn an advisory check into a crash.
|
|
1172
|
+
*/
|
|
1173
|
+
declare function compareVersions(a: string, b: string): number;
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Did the tagged releases actually reach the registry?
|
|
1177
|
+
*
|
|
1178
|
+
* `enforce finish` verified commit, version, tag, push and CI — the whole release chain except its
|
|
1179
|
+
* last link. Three consecutive releases sat tagged and green while npm stayed several versions
|
|
1180
|
+
* behind, because the publish workflow SKIPS (rather than fails) when its token is absent. Nothing
|
|
1181
|
+
* reported it: green CI on an unpublished release looks exactly like a shipped one.
|
|
1182
|
+
*
|
|
1183
|
+
* The severity split is the whole design. `finish` runs BEFORE you publish, so "HEAD's version is
|
|
1184
|
+
* not on the registry yet" is the NORMAL state and can only ever be informational — a gate that
|
|
1185
|
+
* cannot pass in the normal flow is a gate people switch off. What is a real defect is an
|
|
1186
|
+
* INTERMEDIATE tagged version the registry skipped: it was tagged, so it was meant to ship, and it
|
|
1187
|
+
* silently never did.
|
|
1188
|
+
*
|
|
1189
|
+
* Pure: the registry lookup and the tag listing happen in the caller.
|
|
1190
|
+
*/
|
|
1191
|
+
type NpmPublicationCode = "npm-published" | "npm-publish-pending" | "npm-releases-skipped" | "npm-publication-unverified";
|
|
1192
|
+
interface NpmPublicationInput {
|
|
1193
|
+
packageName: string;
|
|
1194
|
+
/** Version in the working tree (the lockstep version). */
|
|
1195
|
+
localVersion: string;
|
|
1196
|
+
/** Latest version on the registry, or null when it could not be reached. */
|
|
1197
|
+
publishedVersion: string | null;
|
|
1198
|
+
/** Tagged versions strictly between `publishedVersion` and `localVersion`. */
|
|
1199
|
+
taggedBetween: readonly string[];
|
|
1200
|
+
/** How to publish, injected so core stays free of tooling opinions. */
|
|
1201
|
+
publishHint?: string;
|
|
1202
|
+
}
|
|
1203
|
+
interface NpmPublicationVerdict {
|
|
1204
|
+
code: NpmPublicationCode;
|
|
1205
|
+
severity: "ok" | "info" | "warn";
|
|
1206
|
+
message: string;
|
|
1207
|
+
fix?: string;
|
|
1208
|
+
}
|
|
1209
|
+
declare function classifyNpmPublication(input: NpmPublicationInput): NpmPublicationVerdict;
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Did the tags that were meant to be releases become GitHub Releases?
|
|
1213
|
+
*
|
|
1214
|
+
* The npm check ([[npm-publication.ts]]) closed one end of the release chain. This closes the
|
|
1215
|
+
* other. They are not the same signal: npm is where the code is *installed from*, a GitHub Release
|
|
1216
|
+
* is where the version is *announced* — changelog, provenance, and the thing listing directories
|
|
1217
|
+
* and score checkers read to decide whether a project ships. This repo carried 190 version tags
|
|
1218
|
+
* and zero Releases, and the only reason anyone noticed was a third-party listing scoring it down.
|
|
1219
|
+
*
|
|
1220
|
+
* ## The pre-adoption rule is the whole design
|
|
1221
|
+
*
|
|
1222
|
+
* A repo that adopts Releases at version 0.57 has 189 older tags that were never going to be
|
|
1223
|
+
* Releases. Calling those "skipped" would mean a permanent warning that no action can ever clear,
|
|
1224
|
+
* and a warning you cannot clear is one people learn to scroll past. So only tags **newer than the
|
|
1225
|
+
* oldest Release** count: gaps that opened *after* the repo started releasing. Adopting the
|
|
1226
|
+
* practice retroactively cleans nothing, and is not asked to.
|
|
1227
|
+
*
|
|
1228
|
+
* Severities mirror the npm check exactly, and for the same reason — `finish` runs BEFORE you
|
|
1229
|
+
* publish, so "HEAD has no Release yet" is the normal state and can only be info. Never an error:
|
|
1230
|
+
* publishing is the human's call.
|
|
1231
|
+
*
|
|
1232
|
+
* Pure: listing tags and asking GitHub happen in the caller.
|
|
1233
|
+
*/
|
|
1234
|
+
type GithubReleaseCode = "github-release-published" | "github-release-pending" | "github-releases-skipped" | "github-releases-absent" | "github-release-unverified";
|
|
1235
|
+
interface GithubReleaseInput {
|
|
1236
|
+
/** Version in the working tree (the lockstep version). */
|
|
1237
|
+
localVersion: string;
|
|
1238
|
+
/**
|
|
1239
|
+
* Versions that have a published, non-draft GitHub Release. `null` means the lookup could not
|
|
1240
|
+
* run at all — no `gh`, no network, not a GitHub remote — which is "cannot tell", not a defect.
|
|
1241
|
+
*/
|
|
1242
|
+
releasedVersions: readonly string[] | null;
|
|
1243
|
+
/** Every version tag in the repo, without the `v` prefix. */
|
|
1244
|
+
taggedVersions: readonly string[];
|
|
1245
|
+
/** How to create one, injected so core stays free of tooling opinions. */
|
|
1246
|
+
releaseHint?: string;
|
|
1247
|
+
}
|
|
1248
|
+
interface GithubReleaseVerdict {
|
|
1249
|
+
code: GithubReleaseCode;
|
|
1250
|
+
severity: "ok" | "info" | "warn";
|
|
1251
|
+
message: string;
|
|
1252
|
+
fix?: string;
|
|
1253
|
+
}
|
|
1254
|
+
/** `null` when there is nothing worth saying — an untagged repo has no release chain to check. */
|
|
1255
|
+
declare function classifyGithubRelease(input: GithubReleaseInput): GithubReleaseVerdict | null;
|
|
1256
|
+
|
|
1162
1257
|
type MemoryPriority = "must_read" | "useful" | "background";
|
|
1163
1258
|
/**
|
|
1164
1259
|
* Normalized priority evidence. A caller fills only the signals it can compute; unknown ones default
|
|
@@ -1981,6 +2076,27 @@ interface HaiveConfig {
|
|
|
1981
2076
|
commandSensorUnrunnable?: "warn" | "block";
|
|
1982
2077
|
/** Require explicit resolution of a diff that demotes, rewrites, or removes a BLOCK sensor. */
|
|
1983
2078
|
sensorWeakeningGate?: "warn" | "block";
|
|
2079
|
+
/**
|
|
2080
|
+
* Whether `hivelore enforce finish` checks that tagged releases actually reached the npm
|
|
2081
|
+
* registry. Default on; set "off" for repos that publish elsewhere or not at all.
|
|
2082
|
+
*
|
|
2083
|
+
* It never blocks. `finish` runs BEFORE you publish, so "HEAD is not on npm yet" is the normal
|
|
2084
|
+
* state and is reported as info. A tagged version the registry SKIPPED is reported as a warning:
|
|
2085
|
+
* it was tagged, so it was meant to ship. Three consecutive releases were lost that way — the
|
|
2086
|
+
* publish workflow skips rather than fails when NPM_TOKEN is absent, and green CI on an
|
|
2087
|
+
* unpublished release looks exactly like a shipped one.
|
|
2088
|
+
*/
|
|
2089
|
+
npmPublishCheck?: "off" | "warn";
|
|
2090
|
+
/**
|
|
2091
|
+
* Whether `hivelore enforce finish` checks that tagged versions became GitHub Releases.
|
|
2092
|
+
* Default on; set "off" for repos that deliberately tag without releasing.
|
|
2093
|
+
*
|
|
2094
|
+
* It never blocks, and it never asks you to backfill: only tags NEWER than the oldest existing
|
|
2095
|
+
* Release are reported as gaps, so adopting Releases mid-history does not produce a warning
|
|
2096
|
+
* that no action can clear. A repo with tags and no Release at all gets one info line — tags
|
|
2097
|
+
* are not Releases, and listing/scoring tools read Releases.
|
|
2098
|
+
*/
|
|
2099
|
+
githubReleaseCheck?: "off" | "warn";
|
|
1984
2100
|
/**
|
|
1985
2101
|
* How `hivelore enforce finish` reacts to hard failures observed this session that were never
|
|
1986
2102
|
* captured as a lesson (`mem_tried`):
|
|
@@ -3976,4 +4092,4 @@ interface ReviewDraftOptions {
|
|
|
3976
4092
|
/** Template review learnings into proposed-memory drafts (reuses the scanner-ingest draft shape). */
|
|
3977
4093
|
declare function reviewLearningsToDrafts(learnings: ReviewLearning[], options?: ReviewDraftOptions): MemoryDraft[];
|
|
3978
4094
|
|
|
3979
|
-
export { 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, 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, 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, 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 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, 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, buildReport, bumpRead, churnForAnchors, classifyMemoryPriority, codeMapContentHash, codeMapPath, collectTimelineEntries, compactAutoRecapBody, compareEvalReports, compareGatePrecision, compareImpact, 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, recommendFeedbackAdjustment, recordApplied, recordGateReminder, recordPrevention, recordPreventionHits, recordProjectContextEmission, recordRejection, relPathFrom, renderBehaviourCoverageLine, renderBootstrapChecklist, renderCaughtForYou, renderPreventionComment, renderPreventionReceipt, renderPreventionReceiptShare, resolveBriefingBudget, resolveConfigPath, resolveGatePolicy, resolveHaivePaths, resolveManifestFiles, resolveProjectInfo, retirementSignal, revertedShaFromCommit, reviewLearningsToDrafts, runRegexSensor, runSensors, runTierContract, runValidationContract, runtimeJournalPath, saveCodeMap, saveConfig, saveFrictionState, saveUsageIndex, scaffoldPostIncidentTest, scannableSensorTargets, scoreRetrievalCase, scoreSensorCase, scrubbedCommandEnv, selectCommandSensors, sensorAppliesToPath, sensorLedgerPath, sensorPatternBrittleness, sensorPromotedAtMap, sensorSelfCheck, sensorTargetsFromDiff, serializeCodeMap, serializeMemory, setFrictionStatus, shouldExpandGateReminder, snapshotContract, specificityScore, stripPrivate, suggestGate, suggestSensorFromMemory, suggestSensorSeed, suggestTopicKey, summarizeCaughtForYou, summarizeImpact, synthesizeSelfEvalCases, tallyHotFiles, titleFromBody, tokenizeQuery, tokenizeWords, trackDependencies, trackReads, truncateToTokens, usageLogPath, usageLogSize, usagePath, verifyAnchor, watchContracts, withQuarantineNote, withoutQuarantineNote, writeBriefingMarker, writeSessionHandoff };
|
|
4095
|
+
export { 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, 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 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, 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, buildReport, bumpRead, 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, recommendFeedbackAdjustment, recordApplied, recordGateReminder, recordPrevention, recordPreventionHits, recordProjectContextEmission, recordRejection, relPathFrom, renderBehaviourCoverageLine, renderBootstrapChecklist, renderCaughtForYou, renderPreventionComment, renderPreventionReceipt, renderPreventionReceiptShare, resolveBriefingBudget, resolveConfigPath, resolveGatePolicy, resolveHaivePaths, resolveManifestFiles, resolveProjectInfo, retirementSignal, revertedShaFromCommit, reviewLearningsToDrafts, runRegexSensor, runSensors, runTierContract, runValidationContract, runtimeJournalPath, saveCodeMap, saveConfig, saveFrictionState, saveUsageIndex, scaffoldPostIncidentTest, scannableSensorTargets, scoreRetrievalCase, scoreSensorCase, scrubbedCommandEnv, selectCommandSensors, sensorAppliesToPath, sensorLedgerPath, sensorPatternBrittleness, sensorPromotedAtMap, sensorSelfCheck, sensorTargetsFromDiff, serializeCodeMap, serializeMemory, setFrictionStatus, shouldExpandGateReminder, snapshotContract, specificityScore, 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
|
@@ -1462,6 +1462,109 @@ function auditAnchorSpecificity(memories, fileChurn, totalCommits) {
|
|
|
1462
1462
|
return rows.sort((a, b) => a.specificity - b.specificity);
|
|
1463
1463
|
}
|
|
1464
1464
|
|
|
1465
|
+
// src/version-order.ts
|
|
1466
|
+
function compareVersions(a, b) {
|
|
1467
|
+
const pa = a.split(/[.-]/).map((part) => Number.parseInt(part, 10) || 0);
|
|
1468
|
+
const pb = b.split(/[.-]/).map((part) => Number.parseInt(part, 10) || 0);
|
|
1469
|
+
const len = Math.max(pa.length, pb.length, 3);
|
|
1470
|
+
for (let i = 0; i < len; i++) {
|
|
1471
|
+
const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
1472
|
+
if (diff !== 0) return diff;
|
|
1473
|
+
}
|
|
1474
|
+
return 0;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
// src/npm-publication.ts
|
|
1478
|
+
function classifyNpmPublication(input) {
|
|
1479
|
+
const { packageName, localVersion, publishedVersion } = input;
|
|
1480
|
+
const hint = input.publishHint ?? `publish ${packageName} ${localVersion}`;
|
|
1481
|
+
if (!publishedVersion) {
|
|
1482
|
+
return {
|
|
1483
|
+
code: "npm-publication-unverified",
|
|
1484
|
+
severity: "info",
|
|
1485
|
+
message: `Could not reach the registry to check whether ${packageName} ${localVersion} is published.`
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
if (compareVersions(publishedVersion, localVersion) >= 0) {
|
|
1489
|
+
return {
|
|
1490
|
+
code: "npm-published",
|
|
1491
|
+
severity: "ok",
|
|
1492
|
+
message: `${packageName} ${publishedVersion} is on npm.`
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
const skipped = [...input.taggedBetween].sort(compareVersions);
|
|
1496
|
+
if (skipped.length > 0) {
|
|
1497
|
+
return {
|
|
1498
|
+
code: "npm-releases-skipped",
|
|
1499
|
+
severity: "warn",
|
|
1500
|
+
message: `${skipped.length} tagged release(s) never reached npm \u2014 ${packageName} is on ${publishedVersion}: ${skipped.map((v) => `v${v}`).join(", ")}.`,
|
|
1501
|
+
fix: `Registry versions are not cumulative, so publishing the newest is enough: ${hint}. If the release workflow keeps skipping, its publish credentials are missing.`
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
return {
|
|
1505
|
+
code: "npm-publish-pending",
|
|
1506
|
+
severity: "info",
|
|
1507
|
+
message: `${packageName} ${localVersion} is not on npm yet (registry has ${publishedVersion}) \u2014 expected at this point; publish is the next step.`,
|
|
1508
|
+
fix: hint
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
// src/github-release.ts
|
|
1513
|
+
var MAX_LISTED = 5;
|
|
1514
|
+
function listGap(versions) {
|
|
1515
|
+
const shown = versions.slice(0, MAX_LISTED).map((v) => `v${v}`).join(", ");
|
|
1516
|
+
const rest = versions.length - MAX_LISTED;
|
|
1517
|
+
return rest > 0 ? `${shown} and ${rest} more` : shown;
|
|
1518
|
+
}
|
|
1519
|
+
function classifyGithubRelease(input) {
|
|
1520
|
+
const { localVersion, releasedVersions, taggedVersions } = input;
|
|
1521
|
+
const hint = input.releaseHint ?? `create a GitHub Release for v${localVersion}`;
|
|
1522
|
+
if (releasedVersions === null) {
|
|
1523
|
+
return {
|
|
1524
|
+
code: "github-release-unverified",
|
|
1525
|
+
severity: "info",
|
|
1526
|
+
message: `Could not check whether v${localVersion} has a GitHub Release.`
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
const tags = [...new Set(taggedVersions)].sort(compareVersions);
|
|
1530
|
+
if (releasedVersions.length === 0) {
|
|
1531
|
+
if (tags.length === 0) return null;
|
|
1532
|
+
return {
|
|
1533
|
+
code: "github-releases-absent",
|
|
1534
|
+
severity: "info",
|
|
1535
|
+
message: `${tags.length} version tag(s) exist but the repository has no GitHub Release. Tags are not Releases: listing and scoring tools read Releases.`,
|
|
1536
|
+
fix: `Start with the current version \u2014 ${hint}. Older tags stay as they are; only gaps after the first Release are reported.`
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
const released = new Set(releasedVersions);
|
|
1540
|
+
const oldestReleased = [...releasedVersions].sort(compareVersions)[0];
|
|
1541
|
+
const newestReleased = [...releasedVersions].sort(compareVersions).at(-1);
|
|
1542
|
+
const skipped = tags.filter(
|
|
1543
|
+
(v) => !released.has(v) && compareVersions(v, oldestReleased) > 0 && compareVersions(v, localVersion) < 0
|
|
1544
|
+
);
|
|
1545
|
+
if (skipped.length > 0) {
|
|
1546
|
+
return {
|
|
1547
|
+
code: "github-releases-skipped",
|
|
1548
|
+
severity: "warn",
|
|
1549
|
+
message: `${skipped.length} tagged version(s) after v${oldestReleased} never became a GitHub Release: ${listGap(skipped)}.`,
|
|
1550
|
+
fix: `Releases are not cumulative, so the newest is the one that matters: ${hint}. If the gap is deliberate, turn the check off with \`enforcement.githubReleaseCheck: "off"\`.`
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
if (compareVersions(newestReleased, localVersion) >= 0) {
|
|
1554
|
+
return {
|
|
1555
|
+
code: "github-release-published",
|
|
1556
|
+
severity: "ok",
|
|
1557
|
+
message: `v${newestReleased} has a GitHub Release.`
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
return {
|
|
1561
|
+
code: "github-release-pending",
|
|
1562
|
+
severity: "info",
|
|
1563
|
+
message: `v${localVersion} has no GitHub Release yet (newest is v${newestReleased}) \u2014 expected at this point; the Release comes after the tag is pushed.`,
|
|
1564
|
+
fix: hint
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1465
1568
|
// src/priority.ts
|
|
1466
1569
|
var DEFAULT_PRIORITY_SIGNALS = {
|
|
1467
1570
|
type: "",
|
|
@@ -7302,7 +7405,9 @@ export {
|
|
|
7302
7405
|
buildReport,
|
|
7303
7406
|
bumpRead,
|
|
7304
7407
|
churnForAnchors,
|
|
7408
|
+
classifyGithubRelease,
|
|
7305
7409
|
classifyMemoryPriority,
|
|
7410
|
+
classifyNpmPublication,
|
|
7306
7411
|
codeMapContentHash,
|
|
7307
7412
|
codeMapPath,
|
|
7308
7413
|
collectTimelineEntries,
|
|
@@ -7310,6 +7415,7 @@ export {
|
|
|
7310
7415
|
compareEvalReports,
|
|
7311
7416
|
compareGatePrecision,
|
|
7312
7417
|
compareImpact,
|
|
7418
|
+
compareVersions,
|
|
7313
7419
|
compileRegexSensor,
|
|
7314
7420
|
componentOf,
|
|
7315
7421
|
computeBaselineHealth,
|