@duckcodeailabs/dql-agent 1.6.21 → 1.6.23
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/agent-run-engine.d.ts +287 -0
- package/dist/agent-run-engine.d.ts.map +1 -0
- package/dist/agent-run-engine.js +916 -0
- package/dist/agent-run-engine.js.map +1 -0
- package/dist/agent-run-gates.d.ts +26 -0
- package/dist/agent-run-gates.d.ts.map +1 -0
- package/dist/agent-run-gates.js +170 -0
- package/dist/agent-run-gates.js.map +1 -0
- package/dist/agent-run-planner.d.ts +32 -0
- package/dist/agent-run-planner.d.ts.map +1 -0
- package/dist/agent-run-planner.js +280 -0
- package/dist/agent-run-planner.js.map +1 -0
- package/dist/answer-loop.d.ts +49 -0
- package/dist/answer-loop.d.ts.map +1 -1
- package/dist/answer-loop.js +292 -17
- package/dist/answer-loop.js.map +1 -1
- package/dist/app-builder.d.ts +6 -0
- package/dist/app-builder.d.ts.map +1 -1
- package/dist/app-builder.js +95 -2
- package/dist/app-builder.js.map +1 -1
- package/dist/app-planner.d.ts +78 -0
- package/dist/app-planner.d.ts.map +1 -0
- package/dist/app-planner.js +145 -0
- package/dist/app-planner.js.map +1 -0
- package/dist/embeddings/provider.d.ts +66 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +105 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/hints/git-store.d.ts +69 -0
- package/dist/hints/git-store.d.ts.map +1 -0
- package/dist/hints/git-store.js +244 -0
- package/dist/hints/git-store.js.map +1 -0
- package/dist/hints/retrieval.d.ts +49 -0
- package/dist/hints/retrieval.d.ts.map +1 -0
- package/dist/hints/retrieval.js +60 -0
- package/dist/hints/retrieval.js.map +1 -0
- package/dist/hints/store.d.ts +39 -0
- package/dist/hints/store.d.ts.map +1 -0
- package/dist/hints/store.js +279 -0
- package/dist/hints/store.js.map +1 -0
- package/dist/hints/types.d.ts +147 -0
- package/dist/hints/types.d.ts.map +1 -0
- package/dist/hints/types.js +92 -0
- package/dist/hints/types.js.map +1 -0
- package/dist/index.d.ts +43 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -3
- package/dist/index.js.map +1 -1
- package/dist/intent-controller.d.ts +63 -0
- package/dist/intent-controller.d.ts.map +1 -0
- package/dist/intent-controller.js +150 -0
- package/dist/intent-controller.js.map +1 -0
- package/dist/kg/build.d.ts.map +1 -1
- package/dist/kg/build.js +2 -0
- package/dist/kg/build.js.map +1 -1
- package/dist/kg/sqlite-fts.js +4 -0
- package/dist/kg/sqlite-fts.js.map +1 -1
- package/dist/kg/types.d.ts +10 -0
- package/dist/kg/types.d.ts.map +1 -1
- package/dist/metadata/catalog.d.ts +81 -4
- package/dist/metadata/catalog.d.ts.map +1 -1
- package/dist/metadata/catalog.js +208 -1
- package/dist/metadata/catalog.js.map +1 -1
- package/dist/metadata/drafts.d.ts +22 -0
- package/dist/metadata/drafts.d.ts.map +1 -1
- package/dist/metadata/drafts.js +126 -2
- package/dist/metadata/drafts.js.map +1 -1
- package/dist/metadata/grain-gate.d.ts +61 -0
- package/dist/metadata/grain-gate.d.ts.map +1 -0
- package/dist/metadata/grain-gate.js +265 -0
- package/dist/metadata/grain-gate.js.map +1 -0
- package/dist/metadata/identity.d.ts +47 -0
- package/dist/metadata/identity.d.ts.map +1 -0
- package/dist/metadata/identity.js +147 -0
- package/dist/metadata/identity.js.map +1 -0
- package/dist/metadata/metric-match.d.ts +93 -0
- package/dist/metadata/metric-match.d.ts.map +1 -0
- package/dist/metadata/metric-match.js +233 -0
- package/dist/metadata/metric-match.js.map +1 -0
- package/dist/metadata/sql-grounding.d.ts +149 -0
- package/dist/metadata/sql-grounding.d.ts.map +1 -0
- package/dist/metadata/sql-grounding.js +397 -0
- package/dist/metadata/sql-grounding.js.map +1 -0
- package/dist/metadata/sql-retrieval.d.ts +29 -0
- package/dist/metadata/sql-retrieval.d.ts.map +1 -0
- package/dist/metadata/sql-retrieval.js +79 -0
- package/dist/metadata/sql-retrieval.js.map +1 -0
- package/dist/narrate.d.ts +52 -0
- package/dist/narrate.d.ts.map +1 -0
- package/dist/narrate.js +263 -0
- package/dist/narrate.js.map +1 -0
- package/dist/propose/build-from-prompt.d.ts +160 -0
- package/dist/propose/build-from-prompt.d.ts.map +1 -0
- package/dist/propose/build-from-prompt.js +815 -0
- package/dist/propose/build-from-prompt.js.map +1 -0
- package/dist/propose/classify.d.ts +55 -0
- package/dist/propose/classify.d.ts.map +1 -0
- package/dist/propose/classify.js +167 -0
- package/dist/propose/classify.js.map +1 -0
- package/dist/propose/config.d.ts +39 -0
- package/dist/propose/config.d.ts.map +1 -0
- package/dist/propose/config.js +52 -0
- package/dist/propose/config.js.map +1 -0
- package/dist/propose/dbt-artifacts.d.ts +134 -0
- package/dist/propose/dbt-artifacts.d.ts.map +1 -0
- package/dist/propose/dbt-artifacts.js +320 -0
- package/dist/propose/dbt-artifacts.js.map +1 -0
- package/dist/propose/edit-block.d.ts +74 -0
- package/dist/propose/edit-block.d.ts.map +1 -0
- package/dist/propose/edit-block.js +133 -0
- package/dist/propose/edit-block.js.map +1 -0
- package/dist/propose/enrich.d.ts +48 -0
- package/dist/propose/enrich.d.ts.map +1 -0
- package/dist/propose/enrich.js +125 -0
- package/dist/propose/enrich.js.map +1 -0
- package/dist/propose/generate-sql.d.ts +61 -0
- package/dist/propose/generate-sql.d.ts.map +1 -0
- package/dist/propose/generate-sql.js +180 -0
- package/dist/propose/generate-sql.js.map +1 -0
- package/dist/propose/index.d.ts +24 -0
- package/dist/propose/index.d.ts.map +1 -0
- package/dist/propose/index.js +15 -0
- package/dist/propose/index.js.map +1 -0
- package/dist/propose/propose.d.ts +226 -0
- package/dist/propose/propose.d.ts.map +1 -0
- package/dist/propose/propose.js +668 -0
- package/dist/propose/propose.js.map +1 -0
- package/dist/propose/reflect-block.d.ts +99 -0
- package/dist/propose/reflect-block.d.ts.map +1 -0
- package/dist/propose/reflect-block.js +220 -0
- package/dist/propose/reflect-block.js.map +1 -0
- package/dist/propose/write-draft.d.ts +90 -0
- package/dist/propose/write-draft.d.ts.map +1 -0
- package/dist/propose/write-draft.js +185 -0
- package/dist/propose/write-draft.js.map +1 -0
- package/dist/providers/claude.d.ts +13 -1
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +20 -2
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/gemini.d.ts +13 -1
- package/dist/providers/gemini.d.ts.map +1 -1
- package/dist/providers/gemini.js +24 -3
- package/dist/providers/gemini.js.map +1 -1
- package/dist/providers/index.d.ts +3 -3
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -3
- package/dist/providers/index.js.map +1 -1
- package/dist/research-loop.d.ts +62 -0
- package/dist/research-loop.d.ts.map +1 -0
- package/dist/research-loop.js +210 -0
- package/dist/research-loop.js.map +1 -0
- package/dist/skills/defaults.d.ts +37 -0
- package/dist/skills/defaults.d.ts.map +1 -0
- package/dist/skills/defaults.js +152 -0
- package/dist/skills/defaults.js.map +1 -0
- package/dist/skills/loader.d.ts +60 -0
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +164 -2
- package/dist/skills/loader.js.map +1 -1
- package/package.json +7 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-store.js","sourceRoot":"","sources":["../../src/hints/git-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQvC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACtC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,OA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K,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;KAC/B,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC;AAED,SAAS,cAAc,CAAoC,GAAM;IAC/D,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,MAAM,GAAG,cAAc,CAAC,KAAgC,CAAC,CAAC;YAChE,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;gBAAG,GAA+B,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;YACnF,SAAS;QACX,CAAC;QACA,GAA+B,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAChD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fold approved scoped hints into the agent's context, AFTER certified routing.
|
|
3
|
+
*
|
|
4
|
+
* Retrieval order (extended, not replaced):
|
|
5
|
+
* certified artifacts → semantic context → graph anchors → APPROVED HINTS → Tier-2 draft.
|
|
6
|
+
*
|
|
7
|
+
* Approved-only is hard-enforced here: only `status === 'approved'` hints are
|
|
8
|
+
* ever returned in normal mode. A hint is applied only within its declared
|
|
9
|
+
* scope (metric / dbt model / domain / dialect / term / block).
|
|
10
|
+
*/
|
|
11
|
+
import type { QuestionScope } from './types.js';
|
|
12
|
+
import type { EmbeddingProvider } from '../embeddings/provider.js';
|
|
13
|
+
export interface AppliedHint {
|
|
14
|
+
hintId: string;
|
|
15
|
+
title: string;
|
|
16
|
+
guidance: string;
|
|
17
|
+
scopeReason: string;
|
|
18
|
+
score: number;
|
|
19
|
+
correctedSql?: string;
|
|
20
|
+
traceId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface HintRetrievalResult {
|
|
23
|
+
/** Approved, scoped hints to fold in as advisory context (cited). */
|
|
24
|
+
applied: AppliedHint[];
|
|
25
|
+
/** Approved hints whose scopes overlap and disagree — surfaced for review. */
|
|
26
|
+
conflicts: Array<{
|
|
27
|
+
hintIds: [string, string];
|
|
28
|
+
titles: [string, string];
|
|
29
|
+
reason: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export interface RetrieveScopedHintsOptions {
|
|
33
|
+
questionScope: QuestionScope;
|
|
34
|
+
limit?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Hybrid-rank weight. Defaults to 0 (pure FTS5, the safe default). Anything
|
|
37
|
+
* >0 blends the deterministic embedding similarity in.
|
|
38
|
+
*/
|
|
39
|
+
alpha?: number;
|
|
40
|
+
embeddingProvider?: EmbeddingProvider;
|
|
41
|
+
indexPath?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve approved scoped hints from the SQLite index. Returns an empty result
|
|
45
|
+
* (no error) when the index does not exist yet or no hints match — keeping the
|
|
46
|
+
* whole feature additive and backward-compatible.
|
|
47
|
+
*/
|
|
48
|
+
export declare function retrieveScopedHints(projectRoot: string, options: RetrieveScopedHintsOptions): Promise<HintRetrievalResult>;
|
|
49
|
+
//# sourceMappingURL=retrieval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieval.d.ts","sourceRoot":"","sources":["../../src/hints/retrieval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,8EAA8E;IAC9E,SAAS,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3F;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC,CA8B9B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fold approved scoped hints into the agent's context, AFTER certified routing.
|
|
3
|
+
*
|
|
4
|
+
* Retrieval order (extended, not replaced):
|
|
5
|
+
* certified artifacts → semantic context → graph anchors → APPROVED HINTS → Tier-2 draft.
|
|
6
|
+
*
|
|
7
|
+
* Approved-only is hard-enforced here: only `status === 'approved'` hints are
|
|
8
|
+
* ever returned in normal mode. A hint is applied only within its declared
|
|
9
|
+
* scope (metric / dbt model / domain / dialect / term / block).
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync } from 'node:fs';
|
|
12
|
+
import { defaultHintIndexPath } from './git-store.js';
|
|
13
|
+
import { HintStore } from './store.js';
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve approved scoped hints from the SQLite index. Returns an empty result
|
|
16
|
+
* (no error) when the index does not exist yet or no hints match — keeping the
|
|
17
|
+
* whole feature additive and backward-compatible.
|
|
18
|
+
*/
|
|
19
|
+
export async function retrieveScopedHints(projectRoot, options) {
|
|
20
|
+
const indexPath = options.indexPath ?? defaultHintIndexPath(projectRoot);
|
|
21
|
+
if (!existsSync(indexPath))
|
|
22
|
+
return { applied: [], conflicts: [] };
|
|
23
|
+
const store = new HintStore(indexPath);
|
|
24
|
+
try {
|
|
25
|
+
const matches = await store.searchApprovedHints({
|
|
26
|
+
questionScope: options.questionScope,
|
|
27
|
+
limit: options.limit ?? 6,
|
|
28
|
+
alpha: options.alpha,
|
|
29
|
+
embeddingProvider: options.embeddingProvider,
|
|
30
|
+
});
|
|
31
|
+
const applied = matches.map(toAppliedHint);
|
|
32
|
+
// Surface conflicts only among the hints we actually applied, so unrelated
|
|
33
|
+
// overlaps elsewhere in the project do not noise up an answer.
|
|
34
|
+
const appliedIds = new Set(applied.map((hint) => hint.hintId));
|
|
35
|
+
const conflicts = store
|
|
36
|
+
.conflictingApprovedHints()
|
|
37
|
+
.filter(([a, b]) => appliedIds.has(a.id) || appliedIds.has(b.id))
|
|
38
|
+
.map(([a, b]) => ({
|
|
39
|
+
hintIds: [a.id, b.id],
|
|
40
|
+
titles: [a.title, b.title],
|
|
41
|
+
reason: `Approved hints "${a.title}" and "${b.title}" overlap on scope and may disagree; review which is authoritative.`,
|
|
42
|
+
}));
|
|
43
|
+
return { applied, conflicts };
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
store.close();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function toAppliedHint(match) {
|
|
50
|
+
return {
|
|
51
|
+
hintId: match.hint.id,
|
|
52
|
+
title: match.hint.title,
|
|
53
|
+
guidance: match.hint.guidance,
|
|
54
|
+
scopeReason: match.scopeReason,
|
|
55
|
+
score: match.score,
|
|
56
|
+
correctedSql: match.hint.correctedSql,
|
|
57
|
+
traceId: match.hint.traceId,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=retrieval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieval.js","sourceRoot":"","sources":["../../src/hints/retrieval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAiCvC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,OAAmC;IAEnC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACzE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAElE,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,mBAAmB,CAAC;YAC9C,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;YACzB,KAAK,EAAE,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KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY;QACrC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite index for scoped correction hints.
|
|
3
|
+
*
|
|
4
|
+
* Git is the source of truth (`.dql/hints/*.hint.yaml`); this is a rebuildable
|
|
5
|
+
* FTS5 index living in the SAME file as the KG (`.dql/cache/agent-kg.sqlite`),
|
|
6
|
+
* extending the existing store rather than introducing a second cache file.
|
|
7
|
+
* Approved-only is enforced at the retrieval boundary (`searchApprovedHints`).
|
|
8
|
+
*/
|
|
9
|
+
import { type Hint, type HintStatus, type QuestionScope, type ScopedHintMatch } from './types.js';
|
|
10
|
+
import { type EmbeddingProvider } from '../embeddings/provider.js';
|
|
11
|
+
export interface SearchApprovedHintsOptions {
|
|
12
|
+
questionScope: QuestionScope;
|
|
13
|
+
limit?: number;
|
|
14
|
+
/** Hybrid-rank knobs (Part B). alpha=0 keeps pure FTS5 (the safe default). */
|
|
15
|
+
alpha?: number;
|
|
16
|
+
embeddingProvider?: EmbeddingProvider;
|
|
17
|
+
}
|
|
18
|
+
export declare class HintStore {
|
|
19
|
+
private db;
|
|
20
|
+
constructor(dbPath: string);
|
|
21
|
+
private initSchema;
|
|
22
|
+
/** Replace the whole index from the Git-authoritative hint set. */
|
|
23
|
+
rebuild(hints: Hint[]): void;
|
|
24
|
+
/** Upsert a single hint (keeps Git + SQLite in sync after a record/approve). */
|
|
25
|
+
upsert(hint: Hint): void;
|
|
26
|
+
private insertRow;
|
|
27
|
+
get(id: string): Hint | null;
|
|
28
|
+
list(status?: HintStatus): Hint[];
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve APPROVED hints that apply to a question's scope. This is the only
|
|
31
|
+
* retrieval entry point used outside review/dev mode — draft/candidate hints
|
|
32
|
+
* are never returned here.
|
|
33
|
+
*/
|
|
34
|
+
searchApprovedHints(options: SearchApprovedHintsOptions): Promise<ScopedHintMatch[]>;
|
|
35
|
+
/** Approved hints whose scopes overlap (surfaced as conflicts for review). */
|
|
36
|
+
conflictingApprovedHints(): Array<[Hint, Hint]>;
|
|
37
|
+
close(): void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/hints/store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAEL,KAAK,IAAI,EAET,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AAUnC,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,EAAE,CAAoB;gBAElB,MAAM,EAAE,MAAM;IAQ1B,OAAO,CAAC,UAAU;IAuClB,mEAAmE;IACnE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAsB5B,gFAAgF;IAChF,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAmBxB,OAAO,CAAC,SAAS;IAmCjB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAK5B,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,EAAE;IAOjC;;;;OAIG;IACG,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA0D1F,8EAA8E;IAC9E,wBAAwB,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAc/C,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite index for scoped correction hints.
|
|
3
|
+
*
|
|
4
|
+
* Git is the source of truth (`.dql/hints/*.hint.yaml`); this is a rebuildable
|
|
5
|
+
* FTS5 index living in the SAME file as the KG (`.dql/cache/agent-kg.sqlite`),
|
|
6
|
+
* extending the existing store rather than introducing a second cache file.
|
|
7
|
+
* Approved-only is enforced at the retrieval boundary (`searchApprovedHints`).
|
|
8
|
+
*/
|
|
9
|
+
import { dirname } from 'node:path';
|
|
10
|
+
import { mkdirSync } from 'node:fs';
|
|
11
|
+
import { createRequire } from 'node:module';
|
|
12
|
+
import { hintAppliesToScope, } from './types.js';
|
|
13
|
+
import { defaultEmbeddingProvider, hybridRank, } from '../embeddings/provider.js';
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
let databaseCtor = null;
|
|
16
|
+
function loadDatabase() {
|
|
17
|
+
databaseCtor ??= require('better-sqlite3');
|
|
18
|
+
return databaseCtor;
|
|
19
|
+
}
|
|
20
|
+
export class HintStore {
|
|
21
|
+
db;
|
|
22
|
+
constructor(dbPath) {
|
|
23
|
+
mkdirSync(dirname(dbPath), { recursive: true });
|
|
24
|
+
const Database = loadDatabase();
|
|
25
|
+
this.db = new Database(dbPath);
|
|
26
|
+
this.db.pragma('journal_mode = WAL');
|
|
27
|
+
this.initSchema();
|
|
28
|
+
}
|
|
29
|
+
initSchema() {
|
|
30
|
+
this.db.exec(`
|
|
31
|
+
CREATE TABLE IF NOT EXISTS agent_hints (
|
|
32
|
+
id TEXT PRIMARY KEY,
|
|
33
|
+
title TEXT NOT NULL,
|
|
34
|
+
guidance TEXT NOT NULL,
|
|
35
|
+
status TEXT NOT NULL DEFAULT 'candidate',
|
|
36
|
+
metric TEXT,
|
|
37
|
+
dbt_model TEXT,
|
|
38
|
+
domain TEXT,
|
|
39
|
+
dialect TEXT,
|
|
40
|
+
term TEXT,
|
|
41
|
+
block TEXT,
|
|
42
|
+
trace_id TEXT,
|
|
43
|
+
corrected_sql TEXT,
|
|
44
|
+
tags_json TEXT NOT NULL DEFAULT '[]',
|
|
45
|
+
author TEXT,
|
|
46
|
+
reviewer TEXT,
|
|
47
|
+
supersedes TEXT,
|
|
48
|
+
created_at TEXT NOT NULL,
|
|
49
|
+
updated_at TEXT NOT NULL,
|
|
50
|
+
source_path TEXT
|
|
51
|
+
);
|
|
52
|
+
CREATE INDEX IF NOT EXISTS idx_agent_hints_status ON agent_hints(status);
|
|
53
|
+
CREATE INDEX IF NOT EXISTS idx_agent_hints_metric ON agent_hints(metric);
|
|
54
|
+
CREATE INDEX IF NOT EXISTS idx_agent_hints_domain ON agent_hints(domain);
|
|
55
|
+
CREATE INDEX IF NOT EXISTS idx_agent_hints_model ON agent_hints(dbt_model);
|
|
56
|
+
|
|
57
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS agent_hints_fts USING fts5(
|
|
58
|
+
id UNINDEXED,
|
|
59
|
+
title,
|
|
60
|
+
guidance,
|
|
61
|
+
tags,
|
|
62
|
+
scope,
|
|
63
|
+
tokenize = 'porter unicode61'
|
|
64
|
+
);
|
|
65
|
+
`);
|
|
66
|
+
}
|
|
67
|
+
/** Replace the whole index from the Git-authoritative hint set. */
|
|
68
|
+
rebuild(hints) {
|
|
69
|
+
const insert = this.db.prepare(`
|
|
70
|
+
INSERT OR REPLACE INTO agent_hints (
|
|
71
|
+
id, title, guidance, status, metric, dbt_model, domain, dialect, term, block,
|
|
72
|
+
trace_id, corrected_sql, tags_json, author, reviewer, supersedes,
|
|
73
|
+
created_at, updated_at, source_path
|
|
74
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
75
|
+
`);
|
|
76
|
+
const insertFts = this.db.prepare(`
|
|
77
|
+
INSERT INTO agent_hints_fts (id, title, guidance, tags, scope)
|
|
78
|
+
VALUES (?, ?, ?, ?, ?)
|
|
79
|
+
`);
|
|
80
|
+
const txn = this.db.transaction(() => {
|
|
81
|
+
this.db.prepare('DELETE FROM agent_hints_fts').run();
|
|
82
|
+
this.db.prepare('DELETE FROM agent_hints').run();
|
|
83
|
+
for (const hint of hints) {
|
|
84
|
+
this.insertRow(hint, insert, insertFts);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
txn();
|
|
88
|
+
}
|
|
89
|
+
/** Upsert a single hint (keeps Git + SQLite in sync after a record/approve). */
|
|
90
|
+
upsert(hint) {
|
|
91
|
+
const insert = this.db.prepare(`
|
|
92
|
+
INSERT OR REPLACE INTO agent_hints (
|
|
93
|
+
id, title, guidance, status, metric, dbt_model, domain, dialect, term, block,
|
|
94
|
+
trace_id, corrected_sql, tags_json, author, reviewer, supersedes,
|
|
95
|
+
created_at, updated_at, source_path
|
|
96
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
97
|
+
`);
|
|
98
|
+
const insertFts = this.db.prepare(`
|
|
99
|
+
INSERT INTO agent_hints_fts (id, title, guidance, tags, scope)
|
|
100
|
+
VALUES (?, ?, ?, ?, ?)
|
|
101
|
+
`);
|
|
102
|
+
const txn = this.db.transaction(() => {
|
|
103
|
+
this.db.prepare('DELETE FROM agent_hints_fts WHERE id = ?').run(hint.id);
|
|
104
|
+
this.insertRow(hint, insert, insertFts);
|
|
105
|
+
});
|
|
106
|
+
txn();
|
|
107
|
+
}
|
|
108
|
+
insertRow(hint, insert, insertFts) {
|
|
109
|
+
insert.run(hint.id, hint.title, hint.guidance, hint.status, hint.scope.metric ?? null, hint.scope.dbtModel ?? null, hint.scope.domain ?? null, hint.scope.dialect ?? null, hint.scope.term ?? null, hint.scope.block ?? null, hint.traceId ?? null, hint.correctedSql ?? null, JSON.stringify(hint.tags ?? []), hint.author ?? null, hint.reviewer ?? null, hint.supersedes ?? null, hint.createdAt, hint.updatedAt, hint.sourcePath ?? null);
|
|
110
|
+
insertFts.run(hint.id, hint.title, hint.guidance, (hint.tags ?? []).join(' '), scopeText(hint.scope));
|
|
111
|
+
}
|
|
112
|
+
get(id) {
|
|
113
|
+
const row = this.db.prepare('SELECT * FROM agent_hints WHERE id = ?').get(id);
|
|
114
|
+
return row ? rowToHint(row) : null;
|
|
115
|
+
}
|
|
116
|
+
list(status) {
|
|
117
|
+
const rows = (status
|
|
118
|
+
? this.db.prepare('SELECT * FROM agent_hints WHERE status = ? ORDER BY updated_at DESC').all(status)
|
|
119
|
+
: this.db.prepare('SELECT * FROM agent_hints ORDER BY updated_at DESC').all());
|
|
120
|
+
return rows.map(rowToHint);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Retrieve APPROVED hints that apply to a question's scope. This is the only
|
|
124
|
+
* retrieval entry point used outside review/dev mode — draft/candidate hints
|
|
125
|
+
* are never returned here.
|
|
126
|
+
*/
|
|
127
|
+
async searchApprovedHints(options) {
|
|
128
|
+
const { questionScope, limit = 6 } = options;
|
|
129
|
+
const sanitized = sanitizeFtsQuery(questionScope.text);
|
|
130
|
+
// FTS narrows the candidate set when there is searchable text; otherwise fall
|
|
131
|
+
// back to all approved hints (scope filter still applies as a hard gate).
|
|
132
|
+
const ftsRows = sanitized
|
|
133
|
+
? this.db.prepare(`
|
|
134
|
+
SELECT h.*, bm25(agent_hints_fts) AS rank
|
|
135
|
+
FROM agent_hints_fts AS f
|
|
136
|
+
JOIN agent_hints AS h ON h.id = f.id
|
|
137
|
+
WHERE agent_hints_fts MATCH ?
|
|
138
|
+
AND h.status = 'approved'
|
|
139
|
+
ORDER BY rank
|
|
140
|
+
LIMIT ?
|
|
141
|
+
`).all(sanitized, Math.max(limit * 4, 24))
|
|
142
|
+
: this.db.prepare(`
|
|
143
|
+
SELECT h.*, 0 AS rank
|
|
144
|
+
FROM agent_hints AS h
|
|
145
|
+
WHERE h.status = 'approved'
|
|
146
|
+
ORDER BY updated_at DESC
|
|
147
|
+
LIMIT ?
|
|
148
|
+
`).all(Math.max(limit * 4, 24));
|
|
149
|
+
// Hard scope gate: drop any hint whose scope does not apply to the question.
|
|
150
|
+
const scoped = ftsRows
|
|
151
|
+
.map((row) => {
|
|
152
|
+
const hint = rowToHint(row);
|
|
153
|
+
const verdict = hintAppliesToScope(hint.scope, questionScope);
|
|
154
|
+
const ftsScore = row.rank ? 1 / (1 + Math.max(0, row.rank)) : 0.01;
|
|
155
|
+
return { hint, verdict, ftsScore };
|
|
156
|
+
})
|
|
157
|
+
.filter((entry) => entry.verdict.applies);
|
|
158
|
+
if (scoped.length === 0)
|
|
159
|
+
return [];
|
|
160
|
+
// Hybrid rank (Part B). alpha defaults to 0 → pure FTS5 ordering.
|
|
161
|
+
const ranked = await hybridRank(questionScope.text, scoped.map((entry) => ({
|
|
162
|
+
item: entry,
|
|
163
|
+
text: `${entry.hint.title} ${entry.hint.guidance} ${(entry.hint.tags ?? []).join(' ')}`,
|
|
164
|
+
ftsScore: entry.ftsScore,
|
|
165
|
+
})), {
|
|
166
|
+
alpha: options.alpha ?? 0,
|
|
167
|
+
provider: options.embeddingProvider ?? defaultEmbeddingProvider(),
|
|
168
|
+
});
|
|
169
|
+
return ranked.slice(0, limit).map((entry) => ({
|
|
170
|
+
hint: entry.item.hint,
|
|
171
|
+
score: entry.score,
|
|
172
|
+
scopeReason: entry.item.verdict.reason,
|
|
173
|
+
snippet: undefined,
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
176
|
+
/** Approved hints whose scopes overlap (surfaced as conflicts for review). */
|
|
177
|
+
conflictingApprovedHints() {
|
|
178
|
+
const approved = this.list('approved');
|
|
179
|
+
const pairs = [];
|
|
180
|
+
for (let i = 0; i < approved.length; i += 1) {
|
|
181
|
+
for (let j = i + 1; j < approved.length; j += 1) {
|
|
182
|
+
const a = approved[i];
|
|
183
|
+
const b = approved[j];
|
|
184
|
+
if (a.supersedes === b.id || b.supersedes === a.id)
|
|
185
|
+
continue;
|
|
186
|
+
if (scopesShareConstraint(a.scope, b.scope))
|
|
187
|
+
pairs.push([a, b]);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return pairs;
|
|
191
|
+
}
|
|
192
|
+
close() {
|
|
193
|
+
this.db.close();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function scopesShareConstraint(a, b) {
|
|
197
|
+
const fields = ['metric', 'dbtModel', 'domain', 'dialect', 'term', 'block'];
|
|
198
|
+
let shared = false;
|
|
199
|
+
for (const field of fields) {
|
|
200
|
+
const av = a[field];
|
|
201
|
+
const bv = b[field];
|
|
202
|
+
if (av && bv) {
|
|
203
|
+
if (av.trim().toLowerCase() !== bv.trim().toLowerCase())
|
|
204
|
+
return false;
|
|
205
|
+
shared = true;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return shared;
|
|
209
|
+
}
|
|
210
|
+
function scopeText(scope) {
|
|
211
|
+
return [scope.metric, scope.dbtModel, scope.domain, scope.dialect, scope.term, scope.block]
|
|
212
|
+
.filter(Boolean)
|
|
213
|
+
.join(' ');
|
|
214
|
+
}
|
|
215
|
+
function rowToHint(row) {
|
|
216
|
+
return {
|
|
217
|
+
id: row.id,
|
|
218
|
+
title: row.title,
|
|
219
|
+
guidance: row.guidance,
|
|
220
|
+
status: row.status,
|
|
221
|
+
scope: {
|
|
222
|
+
metric: row.metric ?? undefined,
|
|
223
|
+
dbtModel: row.dbt_model ?? undefined,
|
|
224
|
+
domain: row.domain ?? undefined,
|
|
225
|
+
dialect: row.dialect ?? undefined,
|
|
226
|
+
term: row.term ?? undefined,
|
|
227
|
+
block: row.block ?? undefined,
|
|
228
|
+
},
|
|
229
|
+
traceId: row.trace_id ?? undefined,
|
|
230
|
+
correctedSql: row.corrected_sql ?? undefined,
|
|
231
|
+
tags: safeJSON(row.tags_json, []),
|
|
232
|
+
author: row.author ?? undefined,
|
|
233
|
+
reviewer: row.reviewer ?? undefined,
|
|
234
|
+
supersedes: row.supersedes ?? undefined,
|
|
235
|
+
createdAt: row.created_at,
|
|
236
|
+
updatedAt: row.updated_at,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function safeJSON(raw, fallback) {
|
|
240
|
+
if (!raw)
|
|
241
|
+
return fallback;
|
|
242
|
+
try {
|
|
243
|
+
return JSON.parse(raw);
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
return fallback;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const STOP_WORDS = new Set([
|
|
250
|
+
'a', 'about', 'above', 'after', 'again', 'against', 'all', 'am', 'an', 'and', 'any', 'are', 'as', 'at',
|
|
251
|
+
'be', 'because', 'been', 'before', 'being', 'below', 'between', 'both', 'but', 'by',
|
|
252
|
+
'can', 'could', 'current', 'did', 'do', 'does', 'doing', 'down', 'during',
|
|
253
|
+
'each', 'explain', 'few', 'find', 'for', 'from', 'further',
|
|
254
|
+
'get', 'give',
|
|
255
|
+
'had', 'has', 'have', 'having', 'he', 'her', 'here', 'hers', 'herself', 'him', 'himself', 'his', 'how',
|
|
256
|
+
'i', 'if', 'in', 'into', 'is', 'it', 'its', 'itself',
|
|
257
|
+
'just',
|
|
258
|
+
'me', 'more', 'most', 'my', 'myself',
|
|
259
|
+
'no', 'nor', 'not', 'now',
|
|
260
|
+
'of', 'off', 'on', 'once', 'only', 'or', 'other', 'our', 'ours', 'ourselves', 'out', 'over', 'own',
|
|
261
|
+
'please',
|
|
262
|
+
'query',
|
|
263
|
+
'same', 'she', 'should', 'show', 'so', 'some', 'sql', 'such',
|
|
264
|
+
'than', 'that', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'there', 'these', 'they', 'this', 'those', 'through', 'to', 'too',
|
|
265
|
+
'under', 'until', 'up', 'using',
|
|
266
|
+
'very',
|
|
267
|
+
'was', 'we', 'were', 'what', 'when', 'where', 'which', 'while', 'who', 'whom', 'why', 'will', 'with', 'would',
|
|
268
|
+
'you', 'your', 'yours', 'yourself', 'yourselves',
|
|
269
|
+
]);
|
|
270
|
+
function sanitizeFtsQuery(raw) {
|
|
271
|
+
return raw
|
|
272
|
+
.split(/\s+/)
|
|
273
|
+
.map((t) => t.replace(/[^\p{L}\p{N}_]/gu, ''))
|
|
274
|
+
.filter((t) => t.length > 1 && !STOP_WORDS.has(t.toLowerCase()))
|
|
275
|
+
.slice(0, 48)
|
|
276
|
+
.map((t) => `"${t}"`)
|
|
277
|
+
.join(' OR ');
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/hints/store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EACL,kBAAkB,GAMnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,UAAU,GAEX,MAAM,2BAA2B,CAAC;AAEnC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,YAAY,GAA2B,IAAI,CAAC;AAEhD,SAAS,YAAY;IACnB,YAAY,KAAK,OAAO,CAAC,gBAAgB,CAAoB,CAAC;IAC9D,OAAO,YAAY,CAAC;AACtB,CAAC;AAUD,MAAM,OAAO,SAAS;IACZ,EAAE,CAAoB;IAE9B,YAAY,MAAc;QACxB,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC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AC,CAAC;SAC7C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;SAC/D,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scoped correction memory ("mini Hint Graph") types.
|
|
3
|
+
*
|
|
4
|
+
* When an analyst corrects a Tier-2 generated answer, that knowledge is captured
|
|
5
|
+
* as a scoped, approved-only, Git-versioned **hint**. Hints never override
|
|
6
|
+
* certified routing — they are folded into the agent's context AFTER certified
|
|
7
|
+
* artifacts, semantic context, and graph anchors, and only when `approved`.
|
|
8
|
+
*
|
|
9
|
+
* Source of truth = Git:
|
|
10
|
+
* - `.dql/traces/*.trace.json` — raw correction traces (what was wrong + the fix)
|
|
11
|
+
* - `.dql/hints/*.hint.yaml` — candidate/approved/rejected hints
|
|
12
|
+
* - `.dql/reviews/*.review.yaml` — human review decisions
|
|
13
|
+
*
|
|
14
|
+
* `.dql/cache/agent-kg.sqlite` carries a rebuildable FTS index of approved hints
|
|
15
|
+
* (Git authoritative; SQLite is just a fast scoped lookup).
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The scope an individual hint applies within. A hint is only eligible for a
|
|
19
|
+
* question when EVERY field it declares matches the question's resolved scope.
|
|
20
|
+
* Fields left undefined are wildcards (do not constrain).
|
|
21
|
+
*/
|
|
22
|
+
export interface HintScope {
|
|
23
|
+
/** Metric / KPI name, e.g. "revenue" or "active_users". */
|
|
24
|
+
metric?: string;
|
|
25
|
+
/** dbt model the hint is about, e.g. "fct_orders". */
|
|
26
|
+
dbtModel?: string;
|
|
27
|
+
/** Business domain, e.g. "growth". */
|
|
28
|
+
domain?: string;
|
|
29
|
+
/** Warehouse SQL dialect, e.g. "duckdb", "snowflake", "bigquery". */
|
|
30
|
+
dialect?: string;
|
|
31
|
+
/** Optional business term the hint refines. */
|
|
32
|
+
term?: string;
|
|
33
|
+
/** Optional certified block the hint relates to (objectKey or block name). */
|
|
34
|
+
block?: string;
|
|
35
|
+
}
|
|
36
|
+
export type HintStatus = 'candidate' | 'approved' | 'rejected';
|
|
37
|
+
/**
|
|
38
|
+
* A raw correction trace recorded when a Tier-2 generated answer is corrected.
|
|
39
|
+
* This is the immutable evidence a hint is later derived from.
|
|
40
|
+
*/
|
|
41
|
+
export interface CorrectionTrace {
|
|
42
|
+
/** Stable id, e.g. `trace_xxx`. */
|
|
43
|
+
id: string;
|
|
44
|
+
/** ISO-8601 timestamp. */
|
|
45
|
+
createdAt: string;
|
|
46
|
+
/** The original analyst question. */
|
|
47
|
+
question: string;
|
|
48
|
+
/** Scope the question resolved to (used to scope the derived hint). */
|
|
49
|
+
scope: HintScope;
|
|
50
|
+
/** What the Tier-2 draft answered (SQL and/or prose) that was wrong. */
|
|
51
|
+
wrongAnswer: string;
|
|
52
|
+
/** The analyst's correction (corrected SQL, rule, or guidance). */
|
|
53
|
+
correction: string;
|
|
54
|
+
/** Optional free-text rationale from the analyst. */
|
|
55
|
+
rationale?: string;
|
|
56
|
+
/** Who recorded the correction. */
|
|
57
|
+
author?: string;
|
|
58
|
+
/** contextPackId / blockId the correction was anchored to, when known. */
|
|
59
|
+
anchorObjectKey?: string;
|
|
60
|
+
/** id of the hint derived from this trace, once created. */
|
|
61
|
+
derivedHintId?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A scoped correction hint. Becomes usable in future draft generation only when
|
|
65
|
+
* `status === 'approved'`. Stored in Git (`.dql/hints/<id>.hint.yaml`) and
|
|
66
|
+
* indexed in SQLite for scoped retrieval.
|
|
67
|
+
*/
|
|
68
|
+
export interface Hint {
|
|
69
|
+
/** Stable id, e.g. `hint_xxx`. */
|
|
70
|
+
id: string;
|
|
71
|
+
/** Short title surfaced to reviewers and as a citation label. */
|
|
72
|
+
title: string;
|
|
73
|
+
/** The guidance the agent should apply within scope (plain language / rule). */
|
|
74
|
+
guidance: string;
|
|
75
|
+
/** The scope this hint applies within. */
|
|
76
|
+
scope: HintScope;
|
|
77
|
+
/** Lifecycle state. Approved-only is enforced at retrieval. */
|
|
78
|
+
status: HintStatus;
|
|
79
|
+
/** Trace this hint was derived from, for provenance. */
|
|
80
|
+
traceId?: string;
|
|
81
|
+
/** Optional canonical corrected SQL the hint endorses. */
|
|
82
|
+
correctedSql?: string;
|
|
83
|
+
/** Free-text searchable keywords. */
|
|
84
|
+
tags?: string[];
|
|
85
|
+
/** Who authored the candidate hint. */
|
|
86
|
+
author?: string;
|
|
87
|
+
/** Who approved/rejected (set by the review). */
|
|
88
|
+
reviewer?: string;
|
|
89
|
+
/** ISO-8601. */
|
|
90
|
+
createdAt: string;
|
|
91
|
+
/** ISO-8601. */
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
/** id of the hint this one supersedes (for conflict resolution). */
|
|
94
|
+
supersedes?: string;
|
|
95
|
+
}
|
|
96
|
+
/** Human review decision recorded in `.dql/reviews/<id>.review.yaml`. */
|
|
97
|
+
export interface HintReview {
|
|
98
|
+
id: string;
|
|
99
|
+
hintId: string;
|
|
100
|
+
decision: 'approved' | 'rejected';
|
|
101
|
+
reviewer: string;
|
|
102
|
+
note?: string;
|
|
103
|
+
createdAt: string;
|
|
104
|
+
}
|
|
105
|
+
/** A hint matched for a question, with its FTS relevance + scope match reason. */
|
|
106
|
+
export interface ScopedHintMatch {
|
|
107
|
+
hint: Hint;
|
|
108
|
+
/** Higher is better. Combines FTS/embedding relevance. */
|
|
109
|
+
score: number;
|
|
110
|
+
/** Plain-language scope match explanation, e.g. "metric=revenue, domain=growth". */
|
|
111
|
+
scopeReason: string;
|
|
112
|
+
/** Snippet from the FTS match, if any. */
|
|
113
|
+
snippet?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Resolve a question's scope from the route/context. Any field left undefined is
|
|
117
|
+
* treated as "unconstrained" (wildcards in hints still match).
|
|
118
|
+
*/
|
|
119
|
+
export interface QuestionScope {
|
|
120
|
+
metric?: string;
|
|
121
|
+
dbtModel?: string;
|
|
122
|
+
domain?: string;
|
|
123
|
+
dialect?: string;
|
|
124
|
+
term?: string;
|
|
125
|
+
block?: string;
|
|
126
|
+
/** Free-text keywords used for FTS search (typically the question). */
|
|
127
|
+
text: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Does a hint's scope apply to the question's resolved scope?
|
|
131
|
+
*
|
|
132
|
+
* Semantics: a hint scope field constrains ONLY when the hint declares it. For
|
|
133
|
+
* each declared field, the question must declare the same value (case-insensitive).
|
|
134
|
+
* If the question does not declare a field the hint constrains, the hint does
|
|
135
|
+
* NOT apply (we never apply a narrower-than-known hint to an unknown context),
|
|
136
|
+
* EXCEPT `dialect`, which applies when the question's dialect is unknown (so a
|
|
137
|
+
* project-wide dialect hint is not silently dropped before a warehouse is wired).
|
|
138
|
+
*
|
|
139
|
+
* Undeclared hint fields are wildcards and never block a match.
|
|
140
|
+
*/
|
|
141
|
+
export declare function hintAppliesToScope(scope: HintScope, question: QuestionScope): {
|
|
142
|
+
applies: boolean;
|
|
143
|
+
reason: string;
|
|
144
|
+
};
|
|
145
|
+
/** Two hints conflict when their scopes overlap on the same concept. */
|
|
146
|
+
export declare function hintsConflict(a: Hint, b: Hint): boolean;
|
|
147
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/hints/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC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