@opum-ai/lore 0.1.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/LICENSE +21 -0
- package/README.md +306 -0
- package/bin/lore.cjs +109 -0
- package/package.json +67 -0
- package/src/adapters/backlog.ts +1084 -0
- package/src/adapters/git.ts +221 -0
- package/src/cli.ts +667 -0
- package/src/commands/agent.ts +301 -0
- package/src/commands/agents.ts +302 -0
- package/src/commands/args.ts +209 -0
- package/src/commands/changed.ts +70 -0
- package/src/commands/check.ts +1031 -0
- package/src/commands/codex-bridge.ts +49 -0
- package/src/commands/concurrency.ts +48 -0
- package/src/commands/context.ts +292 -0
- package/src/commands/discover.ts +89 -0
- package/src/commands/explorer.ts +253 -0
- package/src/commands/export.ts +93 -0
- package/src/commands/fswrite.ts +928 -0
- package/src/commands/graph.ts +291 -0
- package/src/commands/help.ts +151 -0
- package/src/commands/impact.ts +59 -0
- package/src/commands/init.ts +583 -0
- package/src/commands/instructions.ts +91 -0
- package/src/commands/link.ts +929 -0
- package/src/commands/new.ts +476 -0
- package/src/commands/orphans.ts +457 -0
- package/src/commands/path.ts +67 -0
- package/src/commands/provenance.ts +68 -0
- package/src/commands/query.ts +312 -0
- package/src/commands/reconcile-shared.ts +280 -0
- package/src/commands/rename.ts +585 -0
- package/src/commands/replace.ts +320 -0
- package/src/commands/scaffold.ts +346 -0
- package/src/commands/schema.ts +293 -0
- package/src/commands/snapshot.ts +130 -0
- package/src/commands/supersede.ts +400 -0
- package/src/commands/sync.ts +371 -0
- package/src/commands/tasks.ts +271 -0
- package/src/commands/traversal.ts +151 -0
- package/src/commands/validate.ts +226 -0
- package/src/config.ts +598 -0
- package/src/core/agent-bridge.ts +287 -0
- package/src/core/agent-context.ts +498 -0
- package/src/core/agent-profile.ts +447 -0
- package/src/core/bundle.ts +893 -0
- package/src/core/check.ts +853 -0
- package/src/core/codex-bridge.ts +100 -0
- package/src/core/concept.ts +597 -0
- package/src/core/consumer-scaffold.ts +433 -0
- package/src/core/context.ts +271 -0
- package/src/core/explorer-contract.ts +441 -0
- package/src/core/explorer-qualification.ts +58 -0
- package/src/core/explorer.ts +518 -0
- package/src/core/finding.ts +31 -0
- package/src/core/graph.ts +201 -0
- package/src/core/indexes.ts +436 -0
- package/src/core/instructions.ts +209 -0
- package/src/core/ladybug-driver.ts +1795 -0
- package/src/core/ladybug-lifecycle.ts +1178 -0
- package/src/core/ladybug-native.ts +95 -0
- package/src/core/ladybug-source.ts +667 -0
- package/src/core/links.ts +681 -0
- package/src/core/log.ts +253 -0
- package/src/core/managed-block.ts +540 -0
- package/src/core/manifest.ts +718 -0
- package/src/core/order.ts +13 -0
- package/src/core/profile.ts +1007 -0
- package/src/core/projection.ts +195 -0
- package/src/core/query.ts +542 -0
- package/src/core/reconcile.ts +236 -0
- package/src/core/replace.ts +419 -0
- package/src/core/retrieval.ts +213 -0
- package/src/core/rewrite.ts +940 -0
- package/src/core/scaffold.ts +255 -0
- package/src/core/schema.ts +366 -0
- package/src/core/snapshot-runtime.ts +52 -0
- package/src/core/snapshot-store.ts +287 -0
- package/src/core/snapshot.ts +711 -0
- package/src/core/template.ts +429 -0
- package/src/core/traversal.ts +487 -0
- package/src/core/validate.ts +517 -0
- package/src/core/workspace-contract.ts +473 -0
- package/src/core/workspace-projection.ts +365 -0
- package/src/core/workspace-retrieval.ts +196 -0
- package/src/core/workspace-source.ts +174 -0
- package/src/errors.ts +697 -0
- package/src/meta.ts +7 -0
- package/src/output.ts +589 -0
- package/src/scripts/upstream-backlog-watch.ts +288 -0
- package/src/state.ts +390 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy native boundary for the repository-local Ladybug projection.
|
|
3
|
+
*
|
|
4
|
+
* This module is safe to import on every supported Lore platform. It contains
|
|
5
|
+
* only the exact compatibility facts selected by LCLI-283.1.2 and a dynamic
|
|
6
|
+
* loader for the private driver. The @ladybugdb/core addon is evaluated only
|
|
7
|
+
* when {@link loadLadybugNativeDriver} is called on a supported host.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { LoreError } from "../errors";
|
|
11
|
+
import type { BundleGraph } from "./bundle";
|
|
12
|
+
import type { LadybugProjectionSource } from "./ladybug-source";
|
|
13
|
+
import type { QueryOptions, QueryResult } from "./query";
|
|
14
|
+
import type { TraversalSourceRecords } from "./traversal";
|
|
15
|
+
|
|
16
|
+
/** Exact package/runtime version frozen into ladybug-projection/1 fingerprints. */
|
|
17
|
+
export const EXPECTED_LADYBUG_VERSION = "0.19.0";
|
|
18
|
+
/** Exact storage version reported by @ladybugdb/core 0.19.0. */
|
|
19
|
+
export const EXPECTED_LADYBUG_STORAGE_VERSION = "43";
|
|
20
|
+
|
|
21
|
+
/** Structural facts proven by a complete read-only native verification. */
|
|
22
|
+
export interface LadybugDatabaseVerification {
|
|
23
|
+
readonly repositoryScopeKey: string;
|
|
24
|
+
readonly snapshotKey: string;
|
|
25
|
+
readonly sourceFingerprint: string;
|
|
26
|
+
readonly exportDigest: string;
|
|
27
|
+
readonly taskSnapshotDigest: string;
|
|
28
|
+
readonly sourceRecordsDigest: string;
|
|
29
|
+
readonly recordKeysDigest: string;
|
|
30
|
+
readonly recordCount: number;
|
|
31
|
+
readonly conceptCount: number;
|
|
32
|
+
readonly taskCount: number;
|
|
33
|
+
readonly authoredEdgeCount: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Repository-contained indexed operations over one verified immutable generation. */
|
|
37
|
+
export interface LadybugIndexedReader {
|
|
38
|
+
/** Read promoted graph metadata and edges; load one body only when context needs it. */
|
|
39
|
+
readBundleGraph(bodyId?: string): Promise<BundleGraph>;
|
|
40
|
+
/** Read one body through the concept's primary-key lookup. */
|
|
41
|
+
readConceptBody(id: string): Promise<string | undefined>;
|
|
42
|
+
/** Read exact typed authored records for storage-neutral bounded traversal. */
|
|
43
|
+
readTraversalRecords?(): Promise<TraversalSourceRecords>;
|
|
44
|
+
/** Execute Lore's exact deterministic BM25/filter contract through persisted postings. */
|
|
45
|
+
query(options: QueryOptions): Promise<QueryResult>;
|
|
46
|
+
/** Release the native connection and database handle. Safe to call more than once. */
|
|
47
|
+
close(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The private capabilities exposed by the dynamically loaded native driver. */
|
|
51
|
+
export interface LadybugNativeDriver {
|
|
52
|
+
readonly LADYBUG_VERSION: string;
|
|
53
|
+
readonly LADYBUG_STORAGE_VERSION: string;
|
|
54
|
+
buildLadybugDatabase(databasePath: string, source: LadybugProjectionSource): Promise<void>;
|
|
55
|
+
verifyLadybugDatabase(databasePath: string, source: LadybugProjectionSource): Promise<LadybugDatabaseVerification>;
|
|
56
|
+
verifyLadybugDatabaseMetadata(
|
|
57
|
+
databasePath: string,
|
|
58
|
+
expected: LadybugDatabaseVerification,
|
|
59
|
+
): Promise<LadybugDatabaseVerification>;
|
|
60
|
+
readLadybugBundleGraph(databasePath: string, source: LadybugProjectionSource): Promise<BundleGraph>;
|
|
61
|
+
openLadybugIndexedReader(databasePath: string, source: LadybugProjectionSource): LadybugIndexedReader;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type LadybugNativeLoader = () => Promise<LadybugNativeDriver>;
|
|
65
|
+
|
|
66
|
+
/** Share one dynamic import/native-module evaluation across one retrieval operation. */
|
|
67
|
+
export function memoizeLadybugNativeLoader(loader: LadybugNativeLoader): LadybugNativeLoader {
|
|
68
|
+
let pending: Promise<LadybugNativeDriver> | undefined;
|
|
69
|
+
return () => (pending ??= loader());
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Bun 1.2.23 segfaults while evaluating the Ladybug addon on Windows. Native
|
|
74
|
+
* Windows qualification belongs to LCLI-283.1.4, so indexed routing must select
|
|
75
|
+
* the reference fallback before invoking the dynamic loader there.
|
|
76
|
+
*/
|
|
77
|
+
export function supportsLadybugNative(platform: NodeJS.Platform = process.platform): boolean {
|
|
78
|
+
return platform !== "win32";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Dynamically evaluate and verify the exact private native driver. */
|
|
82
|
+
export async function loadLadybugNativeDriver(): Promise<LadybugNativeDriver> {
|
|
83
|
+
const driver = await import("./ladybug-driver");
|
|
84
|
+
if (
|
|
85
|
+
driver.LADYBUG_VERSION !== EXPECTED_LADYBUG_VERSION ||
|
|
86
|
+
driver.LADYBUG_STORAGE_VERSION !== EXPECTED_LADYBUG_STORAGE_VERSION
|
|
87
|
+
) {
|
|
88
|
+
throw new LoreError(
|
|
89
|
+
"validation",
|
|
90
|
+
"installed Ladybug runtime does not match the projection compatibility contract",
|
|
91
|
+
"reinstall the exact locked dependencies before rebuilding the disposable projection",
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
return driver;
|
|
95
|
+
}
|