@evo-dev/core 0.0.1-alpha.15 → 0.0.1-alpha.16
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/config/index.js +26 -2
- package/dist/index.js +12873 -11411
- package/package.json +1 -1
- package/src/config/settings.ts +18 -7
- package/src/evolution/candidates/index.ts +50 -0
- package/src/evolution/evidence/session-memory/retention.ts +2 -1
- package/src/evolution/knowledge/change-store.ts +558 -0
- package/src/evolution/knowledge/changes.ts +453 -0
- package/src/evolution/knowledge/freshness.ts +109 -0
- package/src/evolution/knowledge/index.ts +471 -55
- package/src/evolution/knowledge/review.ts +446 -0
- package/src/evolution/schema.ts +28 -1
- package/src/evolution/shared.ts +108 -0
- package/src/index.ts +4 -0
package/dist/config/index.js
CHANGED
|
@@ -627,6 +627,11 @@ var DEFAULT_MAX_RAW_EVENT_BYTES = 64 * 1024;
|
|
|
627
627
|
// packages/core/src/evolution/knowledge/index.ts
|
|
628
628
|
import { mkdir, readFile as readFile2, readdir as readdir2, rename, rm, stat as stat2, writeFile } from "node:fs/promises";
|
|
629
629
|
import { dirname as dirname3, isAbsolute as isAbsolute3, join as join3, relative as relative2, resolve as resolve2 } from "node:path";
|
|
630
|
+
|
|
631
|
+
// packages/core/src/evolution/knowledge/change-store.ts
|
|
632
|
+
var KNOWLEDGE_CHANGE_LOCK_STALE_MS = 5 * 60 * 1000;
|
|
633
|
+
|
|
634
|
+
// packages/core/src/evolution/knowledge/index.ts
|
|
630
635
|
var RESERVED_OKF_FILENAMES = new Set(["index.md", "log.md"]);
|
|
631
636
|
var ACTIVE_OKF_REVIEW_STATES = ["accepted", "auto-accepted"];
|
|
632
637
|
var OKF_REVIEW_STATES = [
|
|
@@ -881,6 +886,7 @@ function parseOkfConceptFile(okfDir, filePath, content) {
|
|
|
881
886
|
reviewState,
|
|
882
887
|
lifecycle: lifecycleParsed.lifecycle,
|
|
883
888
|
lifecyclePersisted: lifecycleParsed.persisted,
|
|
889
|
+
verificationSnapshot: parseOkfVerificationSnapshot(frontmatter),
|
|
884
890
|
title,
|
|
885
891
|
description,
|
|
886
892
|
tags,
|
|
@@ -891,6 +897,21 @@ function parseOkfConceptFile(okfDir, filePath, content) {
|
|
|
891
897
|
body: parsed.body
|
|
892
898
|
};
|
|
893
899
|
}
|
|
900
|
+
function parseOkfVerificationSnapshot(frontmatter) {
|
|
901
|
+
const block = extractNestedYamlBlock(frontmatter, "evodev", "verificationSnapshot");
|
|
902
|
+
if (block === null)
|
|
903
|
+
return null;
|
|
904
|
+
const schemaVersion = readIndentedYamlScalar(block, "schemaVersion");
|
|
905
|
+
const verifiedAt = normalizeIsoDateString(readIndentedYamlScalar(block, "verifiedAt"));
|
|
906
|
+
if (schemaVersion !== "1" || verifiedAt === null)
|
|
907
|
+
return null;
|
|
908
|
+
return {
|
|
909
|
+
schemaVersion: 1,
|
|
910
|
+
verifiedAt,
|
|
911
|
+
evidenceRefs: readYamlList(block, "evidenceRefs"),
|
|
912
|
+
repository: null
|
|
913
|
+
};
|
|
914
|
+
}
|
|
894
915
|
function matchesConceptFilters(concept, input, equivalentProjectKeys) {
|
|
895
916
|
const projectKeys = (equivalentProjectKeys ?? []).map(sanitizeSlug);
|
|
896
917
|
if (input.projectKey !== undefined && concept.repoTags.length > 0 && ![sanitizeSlug(input.projectKey), ...projectKeys].some((projectKey) => concept.repoTags.includes(projectKey) || concept.tags.includes(`repo:${projectKey}`))) {
|
|
@@ -1456,7 +1477,7 @@ function createDefaultTeamRuntimeSettings() {
|
|
|
1456
1477
|
}
|
|
1457
1478
|
function createDefaultMemorySettings() {
|
|
1458
1479
|
return {
|
|
1459
|
-
|
|
1480
|
+
reviewKnowledgeUpdates: true,
|
|
1460
1481
|
runtimeInjection: true,
|
|
1461
1482
|
staleReview: true,
|
|
1462
1483
|
lexicalIndex: true,
|
|
@@ -1586,8 +1607,11 @@ function parseEvolutionSettings(value, path) {
|
|
|
1586
1607
|
function parseMemorySettings(value, path) {
|
|
1587
1608
|
const input = expectRecord2(value, path);
|
|
1588
1609
|
const defaults = createDefaultMemorySettings();
|
|
1610
|
+
if (input.autoAccept !== undefined) {
|
|
1611
|
+
expectBoolean(input.autoAccept, `${path}.autoAccept`);
|
|
1612
|
+
}
|
|
1589
1613
|
return {
|
|
1590
|
-
|
|
1614
|
+
reviewKnowledgeUpdates: input.reviewKnowledgeUpdates === undefined ? defaults.reviewKnowledgeUpdates : expectBoolean(input.reviewKnowledgeUpdates, `${path}.reviewKnowledgeUpdates`),
|
|
1591
1615
|
runtimeInjection: input.runtimeInjection === undefined ? defaults.runtimeInjection : expectBoolean(input.runtimeInjection, `${path}.runtimeInjection`),
|
|
1592
1616
|
staleReview: input.staleReview === undefined ? defaults.staleReview : expectBoolean(input.staleReview, `${path}.staleReview`),
|
|
1593
1617
|
lexicalIndex: input.lexicalIndex === undefined ? defaults.lexicalIndex : expectBoolean(input.lexicalIndex, `${path}.lexicalIndex`),
|