@hraness/oh 0.3.0 → 0.3.2
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/README.md +41 -21
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/libsql-semantic-v2.d.ts +160 -0
- package/dist/libsql-semantic-v2.d.ts.map +1 -0
- package/dist/libsql-semantic.d.ts +19 -0
- package/dist/libsql-semantic.d.ts.map +1 -1
- package/dist/semantic-cloud.d.ts +1 -0
- package/dist/semantic-cloud.d.ts.map +1 -1
- package/dist/semantic-cloud.js +1570 -0
- package/package.json +1 -1
- package/skills/oh/SKILL.md +2 -2
- package/spec/README.md +8 -1
- package/spec/manifest.json +5 -1
- package/spec/v1/libsql-semantic-cache-schema-v1.sql +114 -0
- package/spec/v1/libsql-semantic-digest-fixture-v1.json +13 -0
- package/spec/v1/semantic-cloud.md +9 -0
- package/spec/v2/libsql-semantic-cache-schema-v2.sql +175 -0
- package/spec/v2/libsql-semantic-digest-fixture-v2.json +14 -0
- package/spec/v2/manifest.json +11 -0
- package/spec/v2/semantic-cloud.md +106 -0
- package/src/cli.ts +1 -1
- package/src/libsql-semantic-v2.test.ts +1114 -0
- package/src/libsql-semantic-v2.ts +1891 -0
- package/src/libsql-semantic.test.ts +157 -1
- package/src/libsql-semantic.ts +51 -0
- package/src/semantic-cloud.ts +1 -0
package/README.md
CHANGED
|
@@ -40,16 +40,16 @@ direct libSQL authority also support Node 24 serverless runtimes. Install the
|
|
|
40
40
|
exact current release from npm:
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
|
-
bun add --global @hraness/oh@0.3.
|
|
43
|
+
bun add --global @hraness/oh@0.3.2
|
|
44
44
|
oh --help
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
The identical package bytes and their checksum are available from the
|
|
48
|
-
[immutable GitHub Release](https://github.com/hraness/oh/releases/tag/v0.3.
|
|
48
|
+
[immutable GitHub Release](https://github.com/hraness/oh/releases/tag/v0.3.2),
|
|
49
49
|
including the mirrored
|
|
50
|
-
[`hraness-oh-0.3.
|
|
50
|
+
[`hraness-oh-0.3.2.tgz`](https://github.com/hraness/oh/releases/download/v0.3.2/hraness-oh-0.3.2.tgz)
|
|
51
51
|
and
|
|
52
|
-
[`SHA256SUMS`](https://github.com/hraness/oh/releases/download/v0.3.
|
|
52
|
+
[`SHA256SUMS`](https://github.com/hraness/oh/releases/download/v0.3.2/SHA256SUMS).
|
|
53
53
|
|
|
54
54
|
Oh writes to `.oh/oh.sqlite` and the `default` space unless you select another
|
|
55
55
|
path or space. Keep `.oh/` out of source control.
|
|
@@ -107,7 +107,7 @@ For a project dependency, pin the same immutable release in `package.json`:
|
|
|
107
107
|
```json
|
|
108
108
|
{
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@hraness/oh": "0.3.
|
|
110
|
+
"@hraness/oh": "0.3.2"
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
```
|
|
@@ -528,18 +528,24 @@ is absent.
|
|
|
528
528
|
|
|
529
529
|
## Add a hosted semantic cache
|
|
530
530
|
|
|
531
|
-
The hosted adapter uses the same source-record principle with a distinct,
|
|
531
|
+
The hosted V2 adapter uses the same source-record principle with a distinct,
|
|
532
532
|
profile-bound cache. It sends bounded inputs to Cloudflare Workers AI's
|
|
533
533
|
EmbeddingGemma model and stores only float32 vectors, input digests, record
|
|
534
534
|
digests, immutable generation membership, and a published pointer in direct
|
|
535
535
|
libSQL. It stores no title, body, record JSON, or query text.
|
|
536
536
|
|
|
537
|
+
Every cache call also binds an isolation SHA-256. The helper below derives a
|
|
538
|
+
safe authority-specific default. A private multi-tenant host should instead
|
|
539
|
+
derive an opaque digest from its private authority handle, cache epoch, and
|
|
540
|
+
profile identity, then pass that same digest to every cache operation.
|
|
541
|
+
|
|
537
542
|
```ts
|
|
538
543
|
import { createClient } from "@libsql/client";
|
|
539
544
|
import {
|
|
540
545
|
OhCloudflareEmbeddingClientV1,
|
|
541
|
-
|
|
542
|
-
|
|
546
|
+
bootstrapOhLibSqlSemanticCacheV2,
|
|
547
|
+
deriveOhSemanticIsolationSha256V2,
|
|
548
|
+
openOhLibSqlSemanticCacheV2,
|
|
543
549
|
} from "@hraness/oh/semantic-cloud";
|
|
544
550
|
|
|
545
551
|
// Deploy once with a short-lived schema credential.
|
|
@@ -547,40 +553,54 @@ const schemaClient = createClient({
|
|
|
547
553
|
authToken: process.env.OH_SEMANTIC_SCHEMA_TOKEN!,
|
|
548
554
|
url: process.env.OH_SEMANTIC_DATABASE_URL!,
|
|
549
555
|
});
|
|
550
|
-
await
|
|
556
|
+
await bootstrapOhLibSqlSemanticCacheV2(schemaClient);
|
|
551
557
|
schemaClient.close();
|
|
552
558
|
|
|
553
559
|
const client = createClient({
|
|
554
560
|
authToken: process.env.OH_SEMANTIC_RUNTIME_TOKEN!,
|
|
555
561
|
url: process.env.OH_SEMANTIC_DATABASE_URL!,
|
|
556
562
|
});
|
|
557
|
-
const cache = await
|
|
563
|
+
const cache = await openOhLibSqlSemanticCacheV2(client, { closeClient: true });
|
|
558
564
|
const embedder = new OhCloudflareEmbeddingClientV1({
|
|
559
565
|
accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
|
|
560
566
|
apiToken: process.env.CLOUDFLARE_WORKERS_AI_TOKEN!,
|
|
561
567
|
});
|
|
568
|
+
const authorityId = "thread:research/epoch:1";
|
|
569
|
+
const isolationSha256 = deriveOhSemanticIsolationSha256V2(authorityId);
|
|
562
570
|
|
|
563
571
|
const staged = await cache.stage({
|
|
564
|
-
authorityId
|
|
572
|
+
authorityId,
|
|
565
573
|
authoritySha256: snapshot.head.recordsSha256,
|
|
566
574
|
documents,
|
|
567
575
|
embeddingClient: embedder,
|
|
568
576
|
generation: snapshot.head.generation,
|
|
577
|
+
isolationSha256,
|
|
578
|
+
});
|
|
579
|
+
const published = await cache.publishedHead({
|
|
580
|
+
authorityId,
|
|
581
|
+
isolationSha256,
|
|
569
582
|
});
|
|
570
583
|
await cache.publish({
|
|
571
|
-
authorityId
|
|
572
|
-
expectedPublishedGeneration: null,
|
|
584
|
+
authorityId,
|
|
585
|
+
expectedPublishedGeneration: published?.generation ?? null,
|
|
573
586
|
generation: staged.generation,
|
|
587
|
+
isolationSha256,
|
|
574
588
|
});
|
|
575
589
|
```
|
|
576
590
|
|
|
577
591
|
Search requires the exact current authority generation and record digests, and
|
|
578
592
|
returns nothing from a stale or concurrently replaced head. Purge writes a
|
|
579
|
-
permanent authority tombstone before deleting memberships and
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
593
|
+
permanent authority tombstone before deleting memberships and every vector in
|
|
594
|
+
that authority's reserved isolation scopes. Its immutable marker and receipt
|
|
595
|
+
make retries return the same first-run counts while proving zero residual cache
|
|
596
|
+
rows. Distinct authority or cache-epoch isolation digests never reuse a vector,
|
|
597
|
+
and the digest never enters provider text. The same authority ID cannot be
|
|
598
|
+
resurrected; allocate a new epoch for a new lifetime. Hosted failure is a
|
|
599
|
+
missing convenience lane, never permission to weaken exact graph or Datalog
|
|
600
|
+
operations. Read the
|
|
601
|
+
[isolated hosted semantic-cache V2 specification](spec/v2/semantic-cloud.md).
|
|
602
|
+
The released V1 API and digests remain available unchanged for compatibility;
|
|
603
|
+
V1 and V2 cannot open the same semantic database simultaneously.
|
|
584
604
|
|
|
585
605
|
## Sync through libSQL or Turso
|
|
586
606
|
|
|
@@ -649,9 +669,9 @@ keep remote sync explicit.
|
|
|
649
669
|
You can also give an agent this prompt:
|
|
650
670
|
|
|
651
671
|
```text
|
|
652
|
-
Install @hraness/oh@0.3.
|
|
653
|
-
exact npm tarball and SHA256SUMS are mirrored by the immutable v0.3.
|
|
654
|
-
https://github.com/hraness/oh/releases/tag/v0.3.
|
|
672
|
+
Install @hraness/oh@0.3.2 from npm and use its packaged Oh Agent Skill. The
|
|
673
|
+
exact npm tarball and SHA256SUMS are mirrored by the immutable v0.3.2 Release at
|
|
674
|
+
https://github.com/hraness/oh/releases/tag/v0.3.2. Verify the CLI with
|
|
655
675
|
`oh --help` and `oh version`.
|
|
656
676
|
Do not create or modify an Oh database until I name its path and ask you to.
|
|
657
677
|
```
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { type Sha256Hex } from "./canonical";
|
|
2
|
+
import { type OhCloudflareEmbeddingClientV1 } from "./cloudflare-embedding";
|
|
3
|
+
import type { OhLibSqlClientV1 } from "./libsql";
|
|
4
|
+
export declare const OH_LIBSQL_SEMANTIC_LIMITS_V2: Readonly<{
|
|
5
|
+
chunksPerDocument: 64;
|
|
6
|
+
chunksPerGeneration: 4096;
|
|
7
|
+
documentsPerGeneration: 512;
|
|
8
|
+
embeddingBatch: 16;
|
|
9
|
+
searchLimit: 100;
|
|
10
|
+
searchPage: 128;
|
|
11
|
+
}>;
|
|
12
|
+
export declare class OhLibSqlSemanticV2Error extends Error {
|
|
13
|
+
readonly code: "conflict" | "integrity" | "invalid-input" | "purged" | "schema-unavailable";
|
|
14
|
+
constructor(code: OhLibSqlSemanticV2Error["code"], message: string);
|
|
15
|
+
}
|
|
16
|
+
export type OhSemanticAuthorityRefV2 = Readonly<{
|
|
17
|
+
authorityId: string;
|
|
18
|
+
authoritySha256: Sha256Hex;
|
|
19
|
+
generation: number;
|
|
20
|
+
/** Defaults to an authority-specific isolation when omitted. */
|
|
21
|
+
isolationSha256?: Sha256Hex;
|
|
22
|
+
records: readonly Readonly<{
|
|
23
|
+
key: string;
|
|
24
|
+
recordSha256: Sha256Hex;
|
|
25
|
+
}>[];
|
|
26
|
+
v: 2;
|
|
27
|
+
}>;
|
|
28
|
+
export type OhSemanticDocumentV2 = Readonly<{
|
|
29
|
+
content: string;
|
|
30
|
+
key: string;
|
|
31
|
+
recordSha256: Sha256Hex;
|
|
32
|
+
title: string;
|
|
33
|
+
v: 2;
|
|
34
|
+
}>;
|
|
35
|
+
export type OhSemanticStageResultV2 = Readonly<{
|
|
36
|
+
authorityId: string;
|
|
37
|
+
chunks: number;
|
|
38
|
+
documents: number;
|
|
39
|
+
embedded: number;
|
|
40
|
+
generation: number;
|
|
41
|
+
generationSha256: Sha256Hex;
|
|
42
|
+
isolationSha256: Sha256Hex;
|
|
43
|
+
membershipSha256: Sha256Hex;
|
|
44
|
+
reused: number;
|
|
45
|
+
status: "staged";
|
|
46
|
+
v: 2;
|
|
47
|
+
}>;
|
|
48
|
+
export type OhSemanticPublishResultV2 = Readonly<{
|
|
49
|
+
authorityId: string;
|
|
50
|
+
generation: number;
|
|
51
|
+
generationSha256: Sha256Hex;
|
|
52
|
+
isolationSha256: Sha256Hex;
|
|
53
|
+
published: boolean;
|
|
54
|
+
v: 2;
|
|
55
|
+
}>;
|
|
56
|
+
/** The exact, currently published cache pointer for one semantic authority. */
|
|
57
|
+
export type OhSemanticPublishedHeadV2 = Readonly<{
|
|
58
|
+
authorityId: string;
|
|
59
|
+
authoritySha256: Sha256Hex;
|
|
60
|
+
generation: number;
|
|
61
|
+
generationSha256: Sha256Hex;
|
|
62
|
+
isolationSha256: Sha256Hex;
|
|
63
|
+
membershipSha256: Sha256Hex;
|
|
64
|
+
profileSha256: Sha256Hex;
|
|
65
|
+
publishedAt: string;
|
|
66
|
+
rendererSha256: Sha256Hex;
|
|
67
|
+
v: 2;
|
|
68
|
+
}>;
|
|
69
|
+
export type OhSemanticSearchResultV2 = Readonly<{
|
|
70
|
+
chunkOrdinal: number;
|
|
71
|
+
key: string;
|
|
72
|
+
recordSha256: Sha256Hex;
|
|
73
|
+
score: number;
|
|
74
|
+
v: 2;
|
|
75
|
+
}>;
|
|
76
|
+
export type OhSemanticPurgeResultV2 = Readonly<{
|
|
77
|
+
authorityId: string;
|
|
78
|
+
countsRecorded: boolean;
|
|
79
|
+
generations: number;
|
|
80
|
+
isolationScopes: number;
|
|
81
|
+
isolationSha256: Sha256Hex;
|
|
82
|
+
memberships: number;
|
|
83
|
+
orphanVectors: number;
|
|
84
|
+
profileSha256: Sha256Hex;
|
|
85
|
+
publishedGeneration: number | null;
|
|
86
|
+
publishedGenerationSha256: Sha256Hex | null;
|
|
87
|
+
purgeMarkerSha256: Sha256Hex;
|
|
88
|
+
purgeReceiptSha256: Sha256Hex;
|
|
89
|
+
purgedAt: string;
|
|
90
|
+
residualGenerations: 0;
|
|
91
|
+
residualMemberships: 0;
|
|
92
|
+
residualScopedVectors: 0;
|
|
93
|
+
v: 2;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Derives the private-by-default cache scope used when a host does not supply
|
|
97
|
+
* its own epoch/profile isolation digest.
|
|
98
|
+
*/
|
|
99
|
+
export declare function deriveOhSemanticIsolationSha256V2(authorityId: string): Sha256Hex;
|
|
100
|
+
export declare function bootstrapOhLibSqlSemanticCacheV2(client: OhLibSqlClientV1, options?: Readonly<{
|
|
101
|
+
appliedAt?: string;
|
|
102
|
+
}>): Promise<Readonly<{
|
|
103
|
+
schemaSha256: Sha256Hex;
|
|
104
|
+
schemaVersion: 2;
|
|
105
|
+
v: 2;
|
|
106
|
+
}>>;
|
|
107
|
+
export declare class OhLibSqlSemanticCacheV2 {
|
|
108
|
+
#private;
|
|
109
|
+
private constructor();
|
|
110
|
+
/** @internal Public callers should use `openOhLibSqlSemanticCacheV2`. */
|
|
111
|
+
static open(client: OhLibSqlClientV1, closeClient: boolean): Promise<OhLibSqlSemanticCacheV2>;
|
|
112
|
+
close(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Reads the current compare-and-swap base without exposing cache rows or
|
|
115
|
+
* private source text. An absent or purged authority has no published head.
|
|
116
|
+
*/
|
|
117
|
+
publishedHead(input: Readonly<{
|
|
118
|
+
authorityId: string;
|
|
119
|
+
isolationSha256?: Sha256Hex;
|
|
120
|
+
}>): Promise<OhSemanticPublishedHeadV2 | null>;
|
|
121
|
+
stage(input: Readonly<{
|
|
122
|
+
authorityId: string;
|
|
123
|
+
authoritySha256: Sha256Hex;
|
|
124
|
+
createdAt?: string;
|
|
125
|
+
documents: readonly OhSemanticDocumentV2[];
|
|
126
|
+
embeddingClient: OhCloudflareEmbeddingClientV1;
|
|
127
|
+
generation: number;
|
|
128
|
+
isolationSha256?: Sha256Hex;
|
|
129
|
+
maximumChunksPerDocument?: number;
|
|
130
|
+
signal?: AbortSignal;
|
|
131
|
+
}>): Promise<OhSemanticStageResultV2>;
|
|
132
|
+
publish(input: Readonly<{
|
|
133
|
+
authorityId: string;
|
|
134
|
+
expectedPublishedGeneration: number | null;
|
|
135
|
+
generation: number;
|
|
136
|
+
isolationSha256?: Sha256Hex;
|
|
137
|
+
publishedAt?: string;
|
|
138
|
+
}>): Promise<OhSemanticPublishResultV2>;
|
|
139
|
+
search(input: Readonly<{
|
|
140
|
+
authority: OhSemanticAuthorityRefV2;
|
|
141
|
+
embeddingClient: OhCloudflareEmbeddingClientV1;
|
|
142
|
+
limit?: number;
|
|
143
|
+
query: string;
|
|
144
|
+
signal?: AbortSignal;
|
|
145
|
+
}>): Promise<readonly OhSemanticSearchResultV2[]>;
|
|
146
|
+
/** Reads the immutable, content-free receipt for a completed purge. */
|
|
147
|
+
purgeReceipt(input: Readonly<{
|
|
148
|
+
authorityId: string;
|
|
149
|
+
isolationSha256?: Sha256Hex;
|
|
150
|
+
}>): Promise<OhSemanticPurgeResultV2 | null>;
|
|
151
|
+
purgeAuthority(input: Readonly<{
|
|
152
|
+
authorityId: string;
|
|
153
|
+
isolationSha256?: Sha256Hex;
|
|
154
|
+
purgedAt?: string;
|
|
155
|
+
}>): Promise<OhSemanticPurgeResultV2>;
|
|
156
|
+
}
|
|
157
|
+
export declare function openOhLibSqlSemanticCacheV2(client: OhLibSqlClientV1, options?: Readonly<{
|
|
158
|
+
closeClient?: boolean;
|
|
159
|
+
}>): Promise<OhLibSqlSemanticCacheV2>;
|
|
160
|
+
//# sourceMappingURL=libsql-semantic-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libsql-semantic-v2.d.ts","sourceRoot":"","sources":["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nB,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAgFtC;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,QAAQ,CAAC;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAM,GAChD,OAAO,CAAC,uBAAuB,CAAC,CAElC"}
|
|
@@ -49,6 +49,18 @@ export type OhSemanticPublishResultV1 = Readonly<{
|
|
|
49
49
|
published: boolean;
|
|
50
50
|
v: 1;
|
|
51
51
|
}>;
|
|
52
|
+
/** The exact, currently published cache pointer for one semantic authority. */
|
|
53
|
+
export type OhSemanticPublishedHeadV1 = Readonly<{
|
|
54
|
+
authorityId: string;
|
|
55
|
+
authoritySha256: Sha256Hex;
|
|
56
|
+
generation: number;
|
|
57
|
+
generationSha256: Sha256Hex;
|
|
58
|
+
membershipSha256: Sha256Hex;
|
|
59
|
+
profileSha256: Sha256Hex;
|
|
60
|
+
publishedAt: string;
|
|
61
|
+
rendererSha256: Sha256Hex;
|
|
62
|
+
v: 1;
|
|
63
|
+
}>;
|
|
52
64
|
export type OhSemanticSearchResultV1 = Readonly<{
|
|
53
65
|
chunkOrdinal: number;
|
|
54
66
|
key: string;
|
|
@@ -77,6 +89,13 @@ export declare class OhLibSqlSemanticCacheV1 {
|
|
|
77
89
|
/** @internal Public callers should use `openOhLibSqlSemanticCacheV1`. */
|
|
78
90
|
static open(client: OhLibSqlClientV1, closeClient: boolean): Promise<OhLibSqlSemanticCacheV1>;
|
|
79
91
|
close(): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Reads the current compare-and-swap base without exposing cache rows or
|
|
94
|
+
* private source text. An absent or purged authority has no published head.
|
|
95
|
+
*/
|
|
96
|
+
publishedHead(input: Readonly<{
|
|
97
|
+
authorityId: string;
|
|
98
|
+
}>): Promise<OhSemanticPublishedHeadV1 | null>;
|
|
80
99
|
stage(input: Readonly<{
|
|
81
100
|
authorityId: string;
|
|
82
101
|
authoritySha256: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AC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAgFjC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC;QAC3B,SAAS,EAAE,wBAAwB,CAAC;QACpC,eAAe,EAAE,6BAA6B,CAAC;QAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,CAAC,GAAG,OAAO,CAAC,SAAS,wBAAwB,EAAE,CAAC;IAkG3C,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC;QACnC,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAyCtC;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,QAAQ,CAAC;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAM,GAChD,OAAO,CAAC,uBAAuB,CAAC,CAElC"}
|
package/dist/semantic-cloud.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-cloud.d.ts","sourceRoot":"","sources":["../src/semantic-cloud.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"semantic-cloud.d.ts","sourceRoot":"","sources":["../src/semantic-cloud.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|