Improve schema setup and Notion ingest UX (#14)

* Improve schema setup and Notion ingest UX

* Handle Postgres network scan failures

* WIP: save local changes before main merge

* Refine setup prompt choices

* Tighten ingest reconciliation guidance

* Commit setup config updates

* Canonicalize unmapped fallback details

* Count reconciliation actions in reports

* Harden semantic layer source validation

* Return wiki content after edits

* Validate SL sources against manifests

* Validate wiki refs before writes

* Simplify CLI next steps

* Clarify agent setup summary

* Surface dbt target SL sources

* Recover SL write fallbacks

* Preserve failed context build metadata

* Track raw paths for ingest actions

* test(cli): update seeded demo expectations

* fix(ingest): scope fallback recovery checks

* fix(sl): tighten source validation guards

* fix(wiki): ignore empty embedding vectors

* Improve Notion ingest UX

* Enforce flat wiki keys

* test(context): update wiki key assertion

---------

Co-authored-by: Andrey Avtomonov <andreybavt@gmail.com>
This commit is contained in:
Luca Martial 2026-05-12 16:56:58 -04:00 committed by GitHub
parent 866d33e71a
commit 60457e9407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
116 changed files with 4177 additions and 610 deletions

View file

@ -0,0 +1,30 @@
import type { ToolSession } from './tool-session.js';
type ActionRawPathValidation =
| { ok: true; rawPaths?: string[] }
| { ok: false; error: string };
export function validateActionRawPaths(
session: ToolSession | undefined,
rawPaths: readonly string[] | undefined,
): ActionRawPathValidation {
if (!rawPaths || rawPaths.length === 0) {
return { ok: true };
}
const uniqueRawPaths = [...new Set(rawPaths)];
const allowedRawPaths = session?.allowedRawPaths;
if (!allowedRawPaths) {
return { ok: true, rawPaths: uniqueRawPaths };
}
const unavailable = uniqueRawPaths.filter((rawPath) => !allowedRawPaths.has(rawPath));
if (unavailable.length > 0) {
return {
ok: false,
error: `rawPaths include unavailable ingest file(s): ${unavailable.join(', ')}`,
};
}
return { ok: true, rawPaths: uniqueRawPaths };
}

View file

@ -31,6 +31,7 @@ export { ingestMetadataRequired, resolveIngestMetadata } from './context-ingest-
export type { SqlEdit } from './sql-edit-replacer.js';
export { applySqlEdits } from './sql-edit-replacer.js';
export type { IngestToolMetadata, MemoryAction, ToolSession } from './tool-session.js';
export { validateActionRawPaths } from './action-raw-paths.js';
export type { TouchedSlSource, TouchedSlSourceSet } from './touched-sl-sources.js';
export {
addTouchedSlSource,

View file

@ -16,6 +16,7 @@ export interface MemoryAction {
key: string;
detail: string;
targetConnectionId?: string | null;
rawPaths?: string[];
}
interface EvictionDecisionRecord {
@ -45,6 +46,7 @@ export interface ToolSession {
preHead: string | null;
touchedSlSources: TouchedSlSourceSet;
actions: MemoryAction[];
allowedRawPaths?: ReadonlySet<string>;
semanticLayerService: SemanticLayerService;
wikiService: KnowledgeWikiService;
configService: KtxFileStorePort;