@lucern/contracts 0.3.0-alpha.7 → 0.3.0-alpha.9
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/context-pack.contract.d.ts +5 -3
- package/dist/context-pack.contract.js.map +1 -1
- package/dist/edge-policy-manifest-Dw5IhT1L.d.ts +133 -0
- package/dist/function-registry/beliefs.js +4 -4
- package/dist/function-registry/beliefs.js.map +1 -1
- package/dist/function-registry/coding.js +4 -4
- package/dist/function-registry/coding.js.map +1 -1
- package/dist/function-registry/context.js +5 -5
- package/dist/function-registry/context.js.map +1 -1
- package/dist/function-registry/contracts.js +4 -4
- package/dist/function-registry/contracts.js.map +1 -1
- package/dist/function-registry/coordination.js +4 -4
- package/dist/function-registry/coordination.js.map +1 -1
- package/dist/function-registry/edges.js +53 -35
- package/dist/function-registry/edges.js.map +1 -1
- package/dist/function-registry/evidence.js +8 -8
- package/dist/function-registry/evidence.js.map +1 -1
- package/dist/function-registry/graph.js +4 -4
- package/dist/function-registry/graph.js.map +1 -1
- package/dist/function-registry/helpers.js +4 -4
- package/dist/function-registry/helpers.js.map +1 -1
- package/dist/function-registry/identity.js +4 -4
- package/dist/function-registry/identity.js.map +1 -1
- package/dist/function-registry/index.js +4 -4
- package/dist/function-registry/index.js.map +1 -1
- package/dist/function-registry/judgments.js +4 -4
- package/dist/function-registry/judgments.js.map +1 -1
- package/dist/function-registry/legacy.js +4 -4
- package/dist/function-registry/legacy.js.map +1 -1
- package/dist/function-registry/lenses.js +4 -4
- package/dist/function-registry/lenses.js.map +1 -1
- package/dist/function-registry/ontologies.js +4 -4
- package/dist/function-registry/ontologies.js.map +1 -1
- package/dist/function-registry/pipeline.js +4 -4
- package/dist/function-registry/pipeline.js.map +1 -1
- package/dist/function-registry/questions.js +4 -4
- package/dist/function-registry/questions.js.map +1 -1
- package/dist/function-registry/tasks.js +4 -4
- package/dist/function-registry/tasks.js.map +1 -1
- package/dist/function-registry/topics.js +4 -4
- package/dist/function-registry/topics.js.map +1 -1
- package/dist/function-registry/worktrees.js +4 -4
- package/dist/function-registry/worktrees.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +45 -37
- package/dist/index.js.map +1 -1
- package/dist/manifests/edge-policy-manifest.d.ts +1 -1
- package/dist/manifests/edge-policy-manifest.data.d.ts +6 -20
- package/dist/manifests/edge-policy-manifest.data.js +18 -26
- package/dist/manifests/edge-policy-manifest.data.js.map +1 -1
- package/dist/manifests/edge-policy-manifest.js +31 -4
- package/dist/manifests/edge-policy-manifest.js.map +1 -1
- package/dist/sdk-tools.contract.js +4 -4
- package/dist/sdk-tools.contract.js.map +1 -1
- package/dist/tenant-bootstrap-seed.contract.d.ts +4 -4
- package/dist/tenant-bootstrap-seed.contract.js +2 -2
- package/dist/tenant-bootstrap-seed.contract.js.map +1 -1
- package/dist/tool-contracts.js +4 -4
- package/dist/tool-contracts.js.map +1 -1
- package/package.json +1 -1
- package/dist/edge-policy-manifest-Byv6cQPP.d.ts +0 -132
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'zod';
|
|
2
|
-
export { E as EdgePolicyEntry, a as EdgePolicyEntrySchema, b as EdgePolicyManifest, c as EdgePolicyManifestSchema, d as EdgePolicyViolation,
|
|
2
|
+
export { E as EdgePolicyEntry, a as EdgePolicyEntrySchema, b as EdgePolicyManifest, c as EdgePolicyManifestSchema, d as EdgePolicyViolation, i as assertEdgePolicyAllowed, j as findEdgePolicy } from '../edge-policy-manifest-Dw5IhT1L.js';
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
declare const edgePolicyManifest: {
|
|
2
2
|
manifestVersion: "1.0.0";
|
|
3
|
-
policies:
|
|
4
|
-
edgeType: string;
|
|
5
|
-
fromKinds: "epistemic_node"[];
|
|
6
|
-
fromNodeTypes: "evidence"[];
|
|
7
|
-
toKinds: "epistemic_node"[];
|
|
8
|
-
toNodeTypes: "evidence"[];
|
|
9
|
-
description: string;
|
|
10
|
-
} | {
|
|
11
|
-
edgeType: string;
|
|
12
|
-
fromKinds: "epistemic_node"[];
|
|
13
|
-
fromNodeTypes: "evidence"[];
|
|
14
|
-
toKinds: "epistemic_node"[];
|
|
15
|
-
toNodeTypes: "belief"[];
|
|
3
|
+
policies: {
|
|
16
4
|
description: string;
|
|
17
|
-
} | {
|
|
18
5
|
edgeType: string;
|
|
19
|
-
fromKinds: "epistemic_node"[];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
toNodeTypes
|
|
23
|
-
|
|
24
|
-
})[];
|
|
6
|
+
fromKinds: ("epistemic_node" | "external_belief")[];
|
|
7
|
+
toKinds: ("epistemic_node" | "external_belief")[];
|
|
8
|
+
fromNodeTypes?: ("function" | "belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "source" | "lens" | "decision" | "claim" | "answer" | "theme" | "deal" | "synthesis" | "atomic_fact" | "excerpt" | "company" | "person" | "investor" | "value_chain")[] | undefined;
|
|
9
|
+
toNodeTypes?: ("function" | "belief" | "evidence" | "question" | "edge" | "contradiction" | "topic" | "ontology" | "source" | "lens" | "decision" | "claim" | "answer" | "theme" | "deal" | "synthesis" | "atomic_fact" | "excerpt" | "company" | "person" | "investor" | "value_chain")[] | undefined;
|
|
10
|
+
}[];
|
|
25
11
|
};
|
|
26
12
|
|
|
27
13
|
export { edgePolicyManifest };
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/schemas/enums.ts
|
|
4
|
+
z.enum(["decision", "belief", "question", "theme", "deal", "topic", "claim", "evidence", "synthesis", "answer", "atomic_fact", "excerpt", "source", "company", "person", "investor", "function", "value_chain"]);
|
|
5
|
+
var EDGE_TYPE_VALUES = ["supports", "informs", "depends_on", "derived_from", "contains", "tests", "supersedes", "responds_to", "belongs_to", "relates_to_thesis", "works_at", "invested_in", "competes_with", "participates_in", "founded_by", "evaluates", "performs", "function_in", "impacts", "raised_from", "mentioned_in", "perspective_on", "plays_theme", "answers", "explores", "qualifies", "based_on", "based_on_belief", "based_on_question", "blocked_by_contradiction", "informed_by_theme", "same_as", "reinforces", "parent_of", "child_of", "falsified_by", "exclusive_with", "collapses_if", "cascade_from", "counterfactual_of", "cascade_to", "mutually_exclusive", "correlates_with", "amplifies", "precondition_for", "in_tension_with", "strengthened_by", "weakened_by", "alternative_to", "subsumes", "validated_by", "required_for", "blocks", "prerequisite_for", "parallel_to", "corroborates", "extends", "same_source_as", "same_theme_as", "assumes", "would_predict", "analogous_to", "independent_of", "implements", "violates", "co_changes_with", "migrating_from", "migrating_to", "scoped_by", "about_entity", "entity_referenced_in", "contradicts", "cites", "summarizes", "related_to", "partially_answers", "refines", "branches_from"];
|
|
6
|
+
var STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, "extracted_from"];
|
|
7
|
+
z.enum(EDGE_TYPE_VALUES);
|
|
8
|
+
z.enum(STORAGE_EDGE_TYPE_VALUES);
|
|
9
|
+
z.enum(["active", "archived", "watching"]);
|
|
10
|
+
z.enum(["private", "team", "firm", "external", "public"]);
|
|
11
|
+
|
|
1
12
|
// src/manifests/edge-policy-manifest.data.ts
|
|
13
|
+
var publicEpistemicNodeEdgePolicy = (edgeType) => ({
|
|
14
|
+
edgeType,
|
|
15
|
+
fromKinds: ["epistemic_node"],
|
|
16
|
+
toKinds: ["epistemic_node"],
|
|
17
|
+
description: "Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics."
|
|
18
|
+
});
|
|
2
19
|
var edgePolicyManifest = {
|
|
3
20
|
manifestVersion: "1.0.0",
|
|
4
|
-
policies:
|
|
5
|
-
{
|
|
6
|
-
edgeType: "evidence_derived_from_evidence",
|
|
7
|
-
fromKinds: ["epistemic_node"],
|
|
8
|
-
fromNodeTypes: ["evidence"],
|
|
9
|
-
toKinds: ["epistemic_node"],
|
|
10
|
-
toNodeTypes: ["evidence"],
|
|
11
|
-
description: "Evidence E2 was synthesized from evidence E1 by a transformation. Provides chain-of-evidence lineage."
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
edgeType: "evidence_supports_belief",
|
|
15
|
-
fromKinds: ["epistemic_node"],
|
|
16
|
-
fromNodeTypes: ["evidence"],
|
|
17
|
-
toKinds: ["epistemic_node"],
|
|
18
|
-
toNodeTypes: ["belief"],
|
|
19
|
-
description: "Existing link_evidence_to_belief semantics promoted to the create_edge policy source."
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
edgeType: "evidence_supports_question",
|
|
23
|
-
fromKinds: ["epistemic_node"],
|
|
24
|
-
fromNodeTypes: ["evidence"],
|
|
25
|
-
toKinds: ["epistemic_node"],
|
|
26
|
-
toNodeTypes: ["question"],
|
|
27
|
-
description: "Existing link_evidence_to_question semantics promoted to the create_edge policy source."
|
|
28
|
-
}
|
|
29
|
-
]
|
|
21
|
+
policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy)
|
|
30
22
|
};
|
|
31
23
|
|
|
32
24
|
export { edgePolicyManifest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/manifests/edge-policy-manifest.data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/enums.ts","../../src/manifests/edge-policy-manifest.data.ts"],"names":[],"mappings":";;;AAMyB,EAAE,IAAA,CAAK,CAAC,YAAY,QAAA,EAAU,UAAA,EAAY,OAAA,EAAS,MAAA,EAAQ,OAAA,EAAS,OAAA,EAAS,YAAY,WAAA,EAAa,QAAA,EAAU,eAAe,SAAA,EAAW,QAAA,EAAU,WAAW,QAAA,EAAU,UAAA,EAAY,UAAA,EAAY,aAAa,CAAC;AAEjO,IAAM,mBAAmB,CAAC,UAAA,EAAY,SAAA,EAAW,YAAA,EAAc,gBAAgB,UAAA,EAAY,OAAA,EAAS,YAAA,EAAc,aAAA,EAAe,cAAc,mBAAA,EAAqB,UAAA,EAAY,aAAA,EAAe,eAAA,EAAiB,mBAAmB,YAAA,EAA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A,CAAA;AAEO,IAAM,kBAAA,GAAqB;AAAA,EAChC,eAAA,EAAiB,OAAA;AAAA,EACjB,QAAA,EAAU,gBAAA,CAAiB,GAAA,CAAI,6BAA6B;AAC9D","file":"edge-policy-manifest.data.js","sourcesContent":["/**\n * Shared schema enums referenced by the initial table manifest.\n */\n\nimport { z } from 'zod';\n\nexport const NODE_TYPE = z.enum([\"decision\", \"belief\", \"question\", \"theme\", \"deal\", \"topic\", \"claim\", \"evidence\", \"synthesis\", \"answer\", \"atomic_fact\", \"excerpt\", \"source\", \"company\", \"person\", \"investor\", \"function\", \"value_chain\"]);\n\nexport const EDGE_TYPE_VALUES = [\"supports\", \"informs\", \"depends_on\", \"derived_from\", \"contains\", \"tests\", \"supersedes\", \"responds_to\", \"belongs_to\", \"relates_to_thesis\", \"works_at\", \"invested_in\", \"competes_with\", \"participates_in\", \"founded_by\", \"evaluates\", \"performs\", \"function_in\", \"impacts\", \"raised_from\", \"mentioned_in\", \"perspective_on\", \"plays_theme\", \"answers\", \"explores\", \"qualifies\", \"based_on\", \"based_on_belief\", \"based_on_question\", \"blocked_by_contradiction\", \"informed_by_theme\", \"same_as\", \"reinforces\", \"parent_of\", \"child_of\", \"falsified_by\", \"exclusive_with\", \"collapses_if\", \"cascade_from\", \"counterfactual_of\", \"cascade_to\", \"mutually_exclusive\", \"correlates_with\", \"amplifies\", \"precondition_for\", \"in_tension_with\", \"strengthened_by\", \"weakened_by\", \"alternative_to\", \"subsumes\", \"validated_by\", \"required_for\", \"blocks\", \"prerequisite_for\", \"parallel_to\", \"corroborates\", \"extends\", \"same_source_as\", \"same_theme_as\", \"assumes\", \"would_predict\", \"analogous_to\", \"independent_of\", \"implements\", \"violates\", \"co_changes_with\", \"migrating_from\", \"migrating_to\", \"scoped_by\", \"about_entity\", \"entity_referenced_in\", \"contradicts\", \"cites\", \"summarizes\", \"related_to\", \"partially_answers\", \"refines\", \"branches_from\"] as const;\n\nexport const STORAGE_EDGE_TYPE_VALUES = [...EDGE_TYPE_VALUES, \"extracted_from\"] as const;\n\nexport const EDGE_TYPE = z.enum(EDGE_TYPE_VALUES);\n\n// Storage accepts the legacy provenance spelling while existing rows migrate.\n// Public surfaces should continue to expose EDGE_TYPE only.\nexport const STORAGE_EDGE_TYPE = z.enum(STORAGE_EDGE_TYPE_VALUES);\n\nexport const TOPIC_STATUS = z.enum([\"active\", \"archived\", \"watching\"]);\n\nexport const TOPIC_VISIBILITY = z.enum([\"private\", \"team\", \"firm\", \"external\", \"public\"]);\n","import { EDGE_TYPE_VALUES } from \"../schemas/enums.js\";\nimport type {\n EdgePolicyEntry,\n EdgePolicyManifest,\n} from \"./edge-policy-manifest.js\";\n\nconst publicEpistemicNodeEdgePolicy = (\n edgeType: (typeof EDGE_TYPE_VALUES)[number]\n): EdgePolicyEntry => ({\n edgeType,\n fromKinds: [\"epistemic_node\"],\n toKinds: [\"epistemic_node\"],\n description:\n \"Canonical public create_edge policy for graph-node relationships. The policy layer gates edge-type membership, not endpoint semantics.\",\n});\n\nexport const edgePolicyManifest = {\n manifestVersion: \"1.0.0\",\n policies: EDGE_TYPE_VALUES.map(publicEpistemicNodeEdgePolicy),\n} satisfies EdgePolicyManifest;\n"]}
|
|
@@ -1,17 +1,44 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
// src/manifests/edge-policy-manifest.ts
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
// src/schema-helpers/spine/tables/epistemicNodes.ts
|
|
6
|
+
var NODE_TYPES = [
|
|
7
|
+
"decision",
|
|
5
8
|
"belief",
|
|
6
|
-
"evidence",
|
|
7
9
|
"question",
|
|
8
|
-
"
|
|
10
|
+
"theme",
|
|
11
|
+
"deal",
|
|
9
12
|
"topic",
|
|
13
|
+
"claim",
|
|
14
|
+
"evidence",
|
|
15
|
+
"synthesis",
|
|
16
|
+
"answer",
|
|
17
|
+
"atomic_fact",
|
|
18
|
+
"excerpt",
|
|
19
|
+
"source",
|
|
20
|
+
"company",
|
|
21
|
+
"person",
|
|
22
|
+
"investor",
|
|
23
|
+
"function",
|
|
24
|
+
"value_chain"
|
|
25
|
+
];
|
|
26
|
+
new Set(NODE_TYPES);
|
|
27
|
+
|
|
28
|
+
// src/types/graph-ref.ts
|
|
29
|
+
var GRAPH_REF_EXTRA_NODE_TYPES = [
|
|
10
30
|
"edge",
|
|
11
31
|
"ontology",
|
|
12
32
|
"lens",
|
|
13
33
|
"contradiction"
|
|
14
|
-
]
|
|
34
|
+
];
|
|
35
|
+
var GRAPH_REF_NODE_TYPES = [
|
|
36
|
+
...NODE_TYPES,
|
|
37
|
+
...GRAPH_REF_EXTRA_NODE_TYPES
|
|
38
|
+
];
|
|
39
|
+
var EpistemicNodeTypeSchema = z.enum(
|
|
40
|
+
GRAPH_REF_NODE_TYPES
|
|
41
|
+
);
|
|
15
42
|
z.discriminatedUnion("kind", [
|
|
16
43
|
z.object({
|
|
17
44
|
kind: z.literal("epistemic_node"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/graph-ref.ts","../../src/manifests/edge-policy-manifest.ts"],"names":["z"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/schema-helpers/spine/tables/epistemicNodes.ts","../../src/types/graph-ref.ts","../../src/manifests/edge-policy-manifest.ts"],"names":["z"],"mappings":";;;;;AA4BO,IAAM,UAAA,GAAa;AAAA,EACxB,UAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,aAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA;AAEsB,IAAI,GAAA,CAAY,UAAU;;;AC9ChD,IAAM,0BAAA,GAA6B;AAAA,EAC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Content":["export type NodeType =\n | \"decision\"\n | \"belief\"\n | \"question\"\n | \"theme\"\n | \"deal\"\n | \"topic\"\n | \"claim\"\n | \"evidence\"\n | \"synthesis\"\n | \"answer\"\n | \"atomic_fact\"\n | \"excerpt\"\n | \"source\"\n | \"company\"\n | \"person\"\n | \"investor\"\n | \"function\"\n | \"value_chain\";\n\nexport type EpistemicLayer =\n | \"L4\"\n | \"L3\"\n | \"L2\"\n | \"L1\"\n | \"ontological\"\n | \"organizational\";\n\nexport const NODE_TYPES = [\n \"decision\",\n \"belief\",\n \"question\",\n \"theme\",\n \"deal\",\n \"topic\",\n \"claim\",\n \"evidence\",\n \"synthesis\",\n \"answer\",\n \"atomic_fact\",\n \"excerpt\",\n \"source\",\n \"company\",\n \"person\",\n \"investor\",\n \"function\",\n \"value_chain\",\n] as const satisfies readonly NodeType[];\n\nconst NODE_TYPE_SET = new Set<string>(NODE_TYPES);\nconst NODE_TYPE_TO_LAYER = new Map<NodeType, EpistemicLayer>([\n [\"decision\", \"L4\"],\n [\"belief\", \"L3\"],\n [\"question\", \"L3\"],\n [\"theme\", \"L3\"],\n [\"deal\", \"L3\"],\n [\"claim\", \"L2\"],\n [\"evidence\", \"L2\"],\n [\"synthesis\", \"L2\"],\n [\"answer\", \"L2\"],\n [\"atomic_fact\", \"L1\"],\n [\"excerpt\", \"L1\"],\n [\"source\", \"L1\"],\n [\"topic\", \"organizational\"],\n [\"company\", \"ontological\"],\n [\"person\", \"ontological\"],\n [\"investor\", \"ontological\"],\n [\"function\", \"ontological\"],\n [\"value_chain\", \"ontological\"],\n]);\n\n// Backward compatibility type guard: callers depend on the exported predicate.\nexport function isNodeType(value: string): value is NodeType {\n return NODE_TYPE_SET.has(value);\n}\n\nexport function getLayerForNodeType(type: NodeType): EpistemicLayer {\n const layer = NODE_TYPE_TO_LAYER.get(type);\n if (!layer) {\n throw new Error(`Unknown node type: ${type}`);\n }\n return layer;\n}\n\nexport function resolveKnownLayerForNodeType(\n type: string\n): EpistemicLayer | undefined {\n return isNodeType(type) ? NODE_TYPE_TO_LAYER.get(type) : undefined;\n}\n\nexport function isEpistemicNodeType(type: NodeType): boolean {\n return getLayerForNodeType(type) !== \"ontological\";\n}\n","import { z } from \"zod\";\nimport { NODE_TYPES } from \"../schema-helpers/spine/tables/epistemicNodes.js\";\n\nconst GRAPH_REF_EXTRA_NODE_TYPES = [\n \"edge\",\n \"ontology\",\n \"lens\",\n \"contradiction\",\n] as const;\n\nexport const GRAPH_REF_NODE_TYPES = [\n ...NODE_TYPES,\n ...GRAPH_REF_EXTRA_NODE_TYPES,\n] as const;\n\ntype GraphRefNodeType = (typeof GRAPH_REF_NODE_TYPES)[number];\n\nexport const EpistemicNodeTypeSchema = z.enum(\n GRAPH_REF_NODE_TYPES as unknown as [GraphRefNodeType, ...GraphRefNodeType[]]\n);\n\nexport type EpistemicNodeType = z.infer<typeof EpistemicNodeTypeSchema>;\n\nexport type GraphRef =\n | { kind: \"epistemic_node\"; nodeId: string; nodeType: EpistemicNodeType }\n | { kind: \"external_belief\"; ref: { tenantId: string; beliefId: string } };\n\nexport const GraphRefSchema = z.discriminatedUnion(\"kind\", [\n z.object({\n kind: z.literal(\"epistemic_node\"),\n nodeId: z.string(),\n nodeType: EpistemicNodeTypeSchema,\n }),\n z.object({\n kind: z.literal(\"external_belief\"),\n ref: z.object({\n tenantId: z.string(),\n beliefId: z.string(),\n }),\n }),\n]);\n","import { z } from \"zod\";\nimport {\n EpistemicNodeTypeSchema,\n type EpistemicNodeType,\n type GraphRef,\n} from \"../types/graph-ref.js\";\n\nconst graphRefKind = z.enum([\"epistemic_node\", \"external_belief\"]);\n\nexport const EdgePolicyEntrySchema = z.object({\n edgeType: z.string(),\n fromKinds: z.array(graphRefKind),\n fromNodeTypes: z.array(EpistemicNodeTypeSchema).optional(),\n toKinds: z.array(graphRefKind),\n toNodeTypes: z.array(EpistemicNodeTypeSchema).optional(),\n description: z.string(),\n});\n\nexport const EdgePolicyManifestSchema = z.object({\n manifestVersion: z.literal(\"1.0.0\"),\n policies: z.array(EdgePolicyEntrySchema),\n});\n\nexport type EdgePolicyEntry = z.infer<typeof EdgePolicyEntrySchema>;\nexport type EdgePolicyManifest = z.infer<typeof EdgePolicyManifestSchema>;\n\nexport type EdgePolicyViolation = {\n code: \"POLICY_VIOLATION\";\n edgeType: string;\n from: GraphRef;\n to: GraphRef;\n};\n\nexport function findEdgePolicy(\n manifest: EdgePolicyManifest,\n edgeType: string\n): EdgePolicyEntry | undefined {\n return manifest.policies.find((policy) => policy.edgeType === edgeType);\n}\n\nfunction nodeTypeAllowed(\n allowed: EpistemicNodeType[] | undefined,\n ref: GraphRef\n): boolean {\n return (\n ref.kind !== \"epistemic_node\" ||\n !allowed ||\n allowed.includes(ref.nodeType)\n );\n}\n\nexport function assertEdgePolicyAllowed(\n manifest: EdgePolicyManifest,\n edgeType: string,\n from: GraphRef,\n to: GraphRef\n): void {\n const policy = findEdgePolicy(manifest, edgeType);\n const allowed =\n Boolean(policy) &&\n policy!.fromKinds.includes(from.kind) &&\n policy!.toKinds.includes(to.kind) &&\n nodeTypeAllowed(policy!.fromNodeTypes, from) &&\n nodeTypeAllowed(policy!.toNodeTypes, to);\n\n if (!allowed) {\n const error = new Error(\n `Edge policy violation for ${edgeType}: ${from.kind} -> ${to.kind}`\n ) as Error & { code: \"POLICY_VIOLATION\"; details: EdgePolicyViolation };\n error.code = \"POLICY_VIOLATION\";\n error.details = { code: \"POLICY_VIOLATION\", edgeType, from, to };\n throw error;\n }\n}\n"]}
|
|
@@ -2081,15 +2081,15 @@ var IDENTITY_WHOAMI = {
|
|
|
2081
2081
|
};
|
|
2082
2082
|
var COMPILE_CONTEXT = {
|
|
2083
2083
|
name: "compile_context",
|
|
2084
|
-
description: "Compile a focused reasoning context
|
|
2084
|
+
description: "Compile a focused reasoning context. If topicId is omitted, Lucern resolves the best topic from the query. Like `git log --graph --decorate` for the reasoning substrate \u2014 returns the canonical Pillar 3 context pack through the public API shape.",
|
|
2085
2085
|
parameters: {
|
|
2086
2086
|
topicId: {
|
|
2087
2087
|
type: "string",
|
|
2088
|
-
description: "
|
|
2088
|
+
description: "Optional topic scope ID. Omit to resolve the topic from query."
|
|
2089
2089
|
},
|
|
2090
2090
|
query: {
|
|
2091
2091
|
type: "string",
|
|
2092
|
-
description: "
|
|
2092
|
+
description: "Focus query used to resolve the topic and rank context items. Required when topicId is omitted."
|
|
2093
2093
|
},
|
|
2094
2094
|
budget: {
|
|
2095
2095
|
type: "number",
|
|
@@ -2113,7 +2113,7 @@ var COMPILE_CONTEXT = {
|
|
|
2113
2113
|
description: "Include related ontological entities in the compiled result"
|
|
2114
2114
|
}
|
|
2115
2115
|
},
|
|
2116
|
-
required: [
|
|
2116
|
+
required: [],
|
|
2117
2117
|
response: {
|
|
2118
2118
|
description: "Compiled context pack for the requested topic",
|
|
2119
2119
|
fields: {
|