@lucern/graph-primitives 1.0.55 → 1.0.57
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/epistemicEdges.helpers.d.ts +1 -1
- package/dist/epistemicEvidence.d.ts +1 -0
- package/dist/epistemicEvidence.js +3 -16
- package/dist/epistemicEvidenceHelpers.d.ts +4 -3
- package/dist/epistemicEvidenceHelpers.js +3 -16
- package/dist/epistemicEvidenceMutations.js +3 -16
- package/dist/epistemicEvidenceQueries.js +1 -0
- package/dist/epistemicNodes.validators.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -16
- package/package.json +4 -4
- package/dist/proof-attestation.json +0 -45
|
@@ -5,7 +5,7 @@ import '@lucern/access-control/convex';
|
|
|
5
5
|
import '@lucern/contracts/convex/unsafeAnyApi';
|
|
6
6
|
import './topicScope-CL1IVOmv.js';
|
|
7
7
|
|
|
8
|
-
declare const epistemicLayerValidator: convex_values.VUnion<"
|
|
8
|
+
declare const epistemicLayerValidator: convex_values.VUnion<"ontological" | "L4" | "L3" | "L2" | "L1" | "organizational", [convex_values.VLiteral<"L4", "required">, convex_values.VLiteral<"L3", "required">, convex_values.VLiteral<"L2", "required">, convex_values.VLiteral<"L1", "required">, convex_values.VLiteral<"ontological", "required">, convex_values.VLiteral<"organizational", "required">], "required", never>;
|
|
9
9
|
declare const subjectiveOpinionValidator: convex_values.VObject<{
|
|
10
10
|
a: number;
|
|
11
11
|
b: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { canAudienceClassAccess, normalizeAudienceKey, classFromAudienceKey } from '@lucern/access-control/audience';
|
|
2
|
+
import { normalizeEvidenceKind, normalizeEvidenceSourceType } from '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
2
3
|
import { unsafeConvexAnyApi } from '@lucern/contracts/convex/unsafeAnyApi';
|
|
3
4
|
import { componentsGeneric, mutationGeneric, internalMutationGeneric, queryGeneric, internalQueryGeneric } from 'convex/server';
|
|
4
5
|
import { v } from 'convex/values';
|
|
@@ -522,24 +523,10 @@ function generateContentHash(text) {
|
|
|
522
523
|
return Math.abs(hash).toString(16).padStart(8, "0");
|
|
523
524
|
}
|
|
524
525
|
function normalizeKind(kind) {
|
|
525
|
-
|
|
526
|
-
return "observation";
|
|
527
|
-
}
|
|
528
|
-
const validKinds = [
|
|
529
|
-
"fact",
|
|
530
|
-
"observation",
|
|
531
|
-
"claim",
|
|
532
|
-
"quote",
|
|
533
|
-
"statistic",
|
|
534
|
-
"signal"
|
|
535
|
-
];
|
|
536
|
-
return validKinds.find((k) => kind.toLowerCase() === k) || "observation";
|
|
526
|
+
return normalizeEvidenceKind(kind, "evidence.kind");
|
|
537
527
|
}
|
|
538
528
|
function normalizeSourceType(sourceType) {
|
|
539
|
-
|
|
540
|
-
return sourceType;
|
|
541
|
-
}
|
|
542
|
-
return "ai_generated";
|
|
529
|
+
return normalizeEvidenceSourceType(sourceType, "evidence.sourceType");
|
|
543
530
|
}
|
|
544
531
|
async function markProjectGraphDirty(ctx, projectId, topicId) {
|
|
545
532
|
const normalizedProjectId = typeof projectId === "string" && projectId.trim().length > 0 ? projectId : void 0;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as _lucern_access_control_convex_js from '@lucern/access-control/convex.js';
|
|
2
2
|
import { r as resolveTopicProjectScope, T as TopicProjectScope } from './topicScope-CL1IVOmv.js';
|
|
3
3
|
import * as convex_values from 'convex/values';
|
|
4
|
+
import { EvidenceKind, EvidenceSourceType } from '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
5
|
+
export { EvidenceKind, EvidenceSourceType } from '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
4
6
|
import { Doc, QueryCtx, MutationCtx } from './convex.js';
|
|
5
7
|
import '@lucern/access-control/convex';
|
|
6
8
|
import '@lucern/contracts/convex/unsafeAnyApi';
|
|
7
9
|
|
|
8
|
-
type EvidenceKind = "fact" | "observation" | "claim" | "quote" | "statistic" | "signal";
|
|
9
10
|
type AudienceClass = "internal" | "restricted_external" | "public";
|
|
10
11
|
interface EvidenceScopeArgs {
|
|
11
12
|
projectId?: string | null;
|
|
@@ -18,7 +19,7 @@ declare const optionalEvidenceScopeArgs: {
|
|
|
18
19
|
};
|
|
19
20
|
declare function generateContentHash(text: string): string;
|
|
20
21
|
declare function normalizeKind(kind?: string): EvidenceKind;
|
|
21
|
-
declare function normalizeSourceType(sourceType?: string):
|
|
22
|
+
declare function normalizeSourceType(sourceType?: string): EvidenceSourceType;
|
|
22
23
|
declare function markProjectGraphDirty(ctx: QueryCtx | MutationCtx, projectId: string | undefined | null, topicId?: string | undefined | null): Promise<void>;
|
|
23
24
|
declare function clampEvidenceLimit(limit: number | undefined, fallback?: number): number;
|
|
24
25
|
declare function dedupeEvidenceNodes(nodes: EvidenceNodeDoc[]): EvidenceNodeDoc[];
|
|
@@ -84,4 +85,4 @@ declare function formatEvidenceNode(n: {
|
|
|
84
85
|
updatedAt: number;
|
|
85
86
|
};
|
|
86
87
|
|
|
87
|
-
export { type AudienceClass, type
|
|
88
|
+
export { type AudienceClass, type EvidenceNodeDoc, type EvidenceScopeArgs, clampEvidenceLimit, createEvidenceAudienceResolver, dedupeEvidenceNodes, evidenceMatchesScope, flattenEvidenceNode, formatEvidenceNode, generateContentHash, getEvidenceNodesForScope, markProjectGraphDirty, normalizeKind, normalizeSourceType, optionalEvidenceScopeArgs, resolveEvidenceLinkedWorktreeId, resolveEvidenceScopeOrNull };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeAudienceKey, classFromAudienceKey } from '@lucern/access-control/audience';
|
|
2
|
+
import { normalizeEvidenceKind, normalizeEvidenceSourceType } from '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
2
3
|
import { unsafeConvexAnyApi } from '@lucern/contracts/convex/unsafeAnyApi';
|
|
3
4
|
import { componentsGeneric } from 'convex/server';
|
|
4
5
|
import { v } from 'convex/values';
|
|
@@ -511,24 +512,10 @@ function generateContentHash(text) {
|
|
|
511
512
|
return Math.abs(hash).toString(16).padStart(8, "0");
|
|
512
513
|
}
|
|
513
514
|
function normalizeKind(kind) {
|
|
514
|
-
|
|
515
|
-
return "observation";
|
|
516
|
-
}
|
|
517
|
-
const validKinds = [
|
|
518
|
-
"fact",
|
|
519
|
-
"observation",
|
|
520
|
-
"claim",
|
|
521
|
-
"quote",
|
|
522
|
-
"statistic",
|
|
523
|
-
"signal"
|
|
524
|
-
];
|
|
525
|
-
return validKinds.find((k) => kind.toLowerCase() === k) || "observation";
|
|
515
|
+
return normalizeEvidenceKind(kind, "evidence.kind");
|
|
526
516
|
}
|
|
527
517
|
function normalizeSourceType(sourceType) {
|
|
528
|
-
|
|
529
|
-
return sourceType;
|
|
530
|
-
}
|
|
531
|
-
return "ai_generated";
|
|
518
|
+
return normalizeEvidenceSourceType(sourceType, "evidence.sourceType");
|
|
532
519
|
}
|
|
533
520
|
async function markProjectGraphDirty(ctx, projectId, topicId) {
|
|
534
521
|
const normalizedProjectId = typeof projectId === "string" && projectId.trim().length > 0 ? projectId : void 0;
|
|
@@ -5,6 +5,7 @@ import { v } from 'convex/values';
|
|
|
5
5
|
import { unsafeConvexAnyApi } from '@lucern/contracts/convex/unsafeAnyApi';
|
|
6
6
|
import { componentsGeneric, mutationGeneric, internalMutationGeneric } from 'convex/server';
|
|
7
7
|
import '@lucern/access-control/audience';
|
|
8
|
+
import { normalizeEvidenceKind, normalizeEvidenceSourceType } from '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
8
9
|
import { generateGlobalId, assertUuidV7Identity, assertUuidV7Reference, assertStorageEdgeVocabulary, assertUuidShapedEdgeEndpoint, isUuidV7 } from '@lucern/contracts/ids';
|
|
9
10
|
import { assertEdgePolicyAllowed } from '@lucern/contracts/manifests/edge-policy-manifest';
|
|
10
11
|
import { edgePolicyManifest } from '@lucern/contracts/manifests/edge-policy-manifest.data';
|
|
@@ -542,24 +543,10 @@ function generateContentHash(text) {
|
|
|
542
543
|
return Math.abs(hash).toString(16).padStart(8, "0");
|
|
543
544
|
}
|
|
544
545
|
function normalizeKind(kind) {
|
|
545
|
-
|
|
546
|
-
return "observation";
|
|
547
|
-
}
|
|
548
|
-
const validKinds = [
|
|
549
|
-
"fact",
|
|
550
|
-
"observation",
|
|
551
|
-
"claim",
|
|
552
|
-
"quote",
|
|
553
|
-
"statistic",
|
|
554
|
-
"signal"
|
|
555
|
-
];
|
|
556
|
-
return validKinds.find((k) => kind.toLowerCase() === k) || "observation";
|
|
546
|
+
return normalizeEvidenceKind(kind, "evidence.kind");
|
|
557
547
|
}
|
|
558
548
|
function normalizeSourceType(sourceType) {
|
|
559
|
-
|
|
560
|
-
return sourceType;
|
|
561
|
-
}
|
|
562
|
-
return "ai_generated";
|
|
549
|
+
return normalizeEvidenceSourceType(sourceType, "evidence.sourceType");
|
|
563
550
|
}
|
|
564
551
|
async function markProjectGraphDirty(ctx, projectId, topicId) {
|
|
565
552
|
const normalizedProjectId = typeof projectId === "string" && projectId.trim().length > 0 ? projectId : void 0;
|
|
@@ -5,6 +5,7 @@ import { permissiveReturn } from '@lucern/contracts/schema-helpers/validators';
|
|
|
5
5
|
import { v } from 'convex/values';
|
|
6
6
|
import { unsafeConvexAnyApi } from '@lucern/contracts/convex/unsafeAnyApi';
|
|
7
7
|
import { componentsGeneric, queryGeneric, internalQueryGeneric } from 'convex/server';
|
|
8
|
+
import '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
8
9
|
import { isUuidV7 } from '@lucern/contracts/ids';
|
|
9
10
|
import '@lucern/contracts/schema-helpers/spine/tables/epistemicNodes';
|
|
10
11
|
|
|
@@ -7,7 +7,7 @@ import * as convex_values from 'convex/values';
|
|
|
7
7
|
* L2: Claims, evidence, synthesis - compression boundary
|
|
8
8
|
* L1: Atomic facts, excerpts, sources - terminal leaves
|
|
9
9
|
*/
|
|
10
|
-
declare const epistemicLayerValidator: convex_values.VUnion<"
|
|
10
|
+
declare const epistemicLayerValidator: convex_values.VUnion<"ontological" | "L4" | "L3" | "L2" | "L1" | "organizational", [convex_values.VLiteral<"L4", "required">, convex_values.VLiteral<"L3", "required">, convex_values.VLiteral<"L2", "required">, convex_values.VLiteral<"L1", "required">, convex_values.VLiteral<"ontological", "required">, convex_values.VLiteral<"organizational", "required">], "required", never>;
|
|
11
11
|
declare const l4NodeTypeValidator: convex_values.VUnion<"decision", [convex_values.VLiteral<"decision", "required">], "required", never>;
|
|
12
12
|
declare const l3NodeTypeValidator: convex_values.VUnion<"belief" | "question" | "theme" | "deal", [convex_values.VLiteral<"belief", "required">, convex_values.VLiteral<"question", "required">, convex_values.VLiteral<"theme", "required">, convex_values.VLiteral<"deal", "required">], "required", never>;
|
|
13
13
|
declare const l2NodeTypeValidator: convex_values.VUnion<"evidence" | "synthesis" | "claim", [convex_values.VLiteral<"claim", "required">, convex_values.VLiteral<"evidence", "required">, convex_values.VLiteral<"synthesis", "required">], "required", never>;
|
|
@@ -17,7 +17,7 @@ declare const ontologicalNodeTypeValidator: convex_values.VUnion<"function" | "c
|
|
|
17
17
|
declare const organizationalNodeTypeValidator: convex_values.VUnion<"topic", [convex_values.VLiteral<"topic", "required">], "required", never>;
|
|
18
18
|
declare const nodeTypeValidator: convex_values.VUnion<"function" | "belief" | "question" | "evidence" | "answer" | "synthesis" | "theme" | "source" | "decision" | "deal" | "topic" | "claim" | "atomic_fact" | "excerpt" | "company" | "person" | "investor" | "value_chain", [convex_values.VLiteral<"decision", "required">, convex_values.VLiteral<"belief", "required">, convex_values.VLiteral<"question", "required">, convex_values.VLiteral<"theme", "required">, convex_values.VLiteral<"deal", "required">, convex_values.VLiteral<"claim", "required">, convex_values.VLiteral<"evidence", "required">, convex_values.VLiteral<"synthesis", "required">, convex_values.VLiteral<"answer", "required">, convex_values.VLiteral<"atomic_fact", "required">, convex_values.VLiteral<"excerpt", "required">, convex_values.VLiteral<"source", "required">, convex_values.VLiteral<"company", "required">, convex_values.VLiteral<"person", "required">, convex_values.VLiteral<"investor", "required">, convex_values.VLiteral<"function", "required">, convex_values.VLiteral<"value_chain", "required">, convex_values.VLiteral<"topic", "required">], "required", never>;
|
|
19
19
|
declare const sourceTypeValidator: convex_values.VUnion<"system" | "human" | "ai_generated" | "ai_extracted" | "imported", [convex_values.VLiteral<"human", "required">, convex_values.VLiteral<"ai_extracted", "required">, convex_values.VLiteral<"ai_generated", "required">, convex_values.VLiteral<"imported", "required">, convex_values.VLiteral<"system", "required">], "required", never>;
|
|
20
|
-
declare const statusValidator: convex_values.VUnion<"
|
|
20
|
+
declare const statusValidator: convex_values.VUnion<"deleted" | "active" | "archived" | "superseded", [convex_values.VLiteral<"active", "required">, convex_values.VLiteral<"superseded", "required">, convex_values.VLiteral<"archived", "required">, convex_values.VLiteral<"deleted", "required">], "required", never>;
|
|
21
21
|
declare const verificationStatusValidator: convex_values.VUnion<"ai_verified" | "contradicted" | "human_verified" | "outdated" | "unverified", [convex_values.VLiteral<"unverified", "required">, convex_values.VLiteral<"human_verified", "required">, convex_values.VLiteral<"ai_verified", "required">, convex_values.VLiteral<"contradicted", "required">, convex_values.VLiteral<"outdated", "required">], "required", never>;
|
|
22
22
|
|
|
23
23
|
export { epistemicLayerValidator, epistemicNodeTypeValidator, l1NodeTypeValidator, l2NodeTypeValidator, l3NodeTypeValidator, l4NodeTypeValidator, nodeTypeValidator, ontologicalNodeTypeValidator, organizationalNodeTypeValidator, sourceTypeValidator, statusValidator, verificationStatusValidator };
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ import './epistemicEdges.mutations.js';
|
|
|
49
49
|
import './epistemicEdges.queries.js';
|
|
50
50
|
import './epistemicEvidenceHelpers.js';
|
|
51
51
|
import '@lucern/access-control/convex.js';
|
|
52
|
+
import '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
52
53
|
import './epistemicEvidenceMutations.js';
|
|
53
54
|
import './epistemicEvidenceQueries.js';
|
|
54
55
|
import './epistemicNodes.queries.js';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { assertEdgePolicyAllowed } from '@lucern/contracts/manifests/edge-policy
|
|
|
14
14
|
import { edgePolicyManifest } from '@lucern/contracts/manifests/edge-policy-manifest.data';
|
|
15
15
|
import { listAudienceRegistryRows } from '@lucern/access-control/audienceRegistry';
|
|
16
16
|
import { REASONING_METHODS } from '@lucern/contracts/types/reasoning-method';
|
|
17
|
+
import { normalizeEvidenceKind, normalizeEvidenceSourceType } from '@lucern/contracts/schema-helpers/evidenceAdmission';
|
|
17
18
|
import { EVIDENCE_SOURCE_QUALITY_VALUES, EVIDENCE_METHODOLOGY_VALUES, EVIDENCE_INFORMATION_ASYMMETRY_VALUES } from '@lucern/contracts/evidence-taxonomy-target-scope.contract';
|
|
18
19
|
import { scoreEntityTypeMatch, scoreEntityConnection, rankEntityTypeMatches, rankEntityConnections } from '@lucern/contracts/v1/ontologies/v1';
|
|
19
20
|
import { wordTokenize, wordOverlapScore, tokenizeSearchText, tokenOverlapScore, stemToken, scoreLexicalSignals, scoreLexicalSignal, rerankLexicalWindow, rankWindowScore, prepareLexicalQuery, jaccardSimilarity, bigramTokenize } from '@lucern/contracts/text-matching.contract';
|
|
@@ -14311,24 +14312,10 @@ function generateContentHash5(text) {
|
|
|
14311
14312
|
return Math.abs(hash).toString(16).padStart(8, "0");
|
|
14312
14313
|
}
|
|
14313
14314
|
function normalizeKind(kind) {
|
|
14314
|
-
|
|
14315
|
-
return "observation";
|
|
14316
|
-
}
|
|
14317
|
-
const validKinds = [
|
|
14318
|
-
"fact",
|
|
14319
|
-
"observation",
|
|
14320
|
-
"claim",
|
|
14321
|
-
"quote",
|
|
14322
|
-
"statistic",
|
|
14323
|
-
"signal"
|
|
14324
|
-
];
|
|
14325
|
-
return validKinds.find((k) => kind.toLowerCase() === k) || "observation";
|
|
14315
|
+
return normalizeEvidenceKind(kind, "evidence.kind");
|
|
14326
14316
|
}
|
|
14327
14317
|
function normalizeSourceType(sourceType) {
|
|
14328
|
-
|
|
14329
|
-
return sourceType;
|
|
14330
|
-
}
|
|
14331
|
-
return "ai_generated";
|
|
14318
|
+
return normalizeEvidenceSourceType(sourceType, "evidence.sourceType");
|
|
14332
14319
|
}
|
|
14333
14320
|
async function markProjectGraphDirty2(ctx, projectId, topicId2) {
|
|
14334
14321
|
const normalizedProjectId = typeof projectId === "string" && projectId.trim().length > 0 ? projectId : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucern/graph-primitives",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"typecheck": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@lucern/access-control": "
|
|
36
|
-
"@lucern/confidence": "
|
|
37
|
-
"@lucern/contracts": "
|
|
35
|
+
"@lucern/access-control": "workspace:*",
|
|
36
|
+
"@lucern/confidence": "workspace:*",
|
|
37
|
+
"@lucern/contracts": "workspace:*",
|
|
38
38
|
"convex": "^1.39.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"proofIrVersion": "proof-ir/v1",
|
|
3
|
-
"manifestVersions": {
|
|
4
|
-
"@lucern/confidence": "0.3.0-alpha.0",
|
|
5
|
-
"@lucern/contracts": "0.3.0-alpha.0",
|
|
6
|
-
"edge-policy-manifest": "1.0.0"
|
|
7
|
-
},
|
|
8
|
-
"invariantsCovered": [
|
|
9
|
-
"INV-1: beliefs append-only",
|
|
10
|
-
"INV-14: no silent state transitions",
|
|
11
|
-
"MANIFEST-1: kernel projections declare epistemicAudit"
|
|
12
|
-
],
|
|
13
|
-
"invariantResults": [
|
|
14
|
-
{
|
|
15
|
-
"invariant": "INV-1: beliefs append-only",
|
|
16
|
-
"status": "passed",
|
|
17
|
-
"severity": "block_publish",
|
|
18
|
-
"evidenceRefs": []
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"invariant": "INV-14: no silent state transitions",
|
|
22
|
-
"status": "passed",
|
|
23
|
-
"severity": "block_publish",
|
|
24
|
-
"evidenceRefs": []
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"invariant": "MANIFEST-1: kernel projections declare epistemicAudit",
|
|
28
|
-
"status": "passed",
|
|
29
|
-
"severity": "block_publish",
|
|
30
|
-
"evidenceRefs": []
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"contractsCovered": [
|
|
34
|
-
"append_sl_scoring",
|
|
35
|
-
"create_evidence",
|
|
36
|
-
"list_beliefs",
|
|
37
|
-
"list_tasks"
|
|
38
|
-
],
|
|
39
|
-
"emittersUsed": [
|
|
40
|
-
"typescript-types",
|
|
41
|
-
"convex-validators",
|
|
42
|
-
"proof-attestation"
|
|
43
|
-
],
|
|
44
|
-
"signedAt": 1782827051581
|
|
45
|
-
}
|