feat: harden runtime readiness and session workflow

This commit is contained in:
User
2026-07-14 10:27:25 +02:00
parent 6d7738d538
commit 6dbf93fff9
52 changed files with 1464 additions and 169 deletions
+11
View File
@@ -24,6 +24,17 @@ test("sessionNew parses id from JSON", async () => {
expect(await r.sessionNew({ question: "q" })).toEqual({ id: "2026-06-27-100000-x" });
});
test("searchPack persists retrieval context with session and workspace", async () => {
const calls: any[] = [];
const r = new ThtRunner({ thtBin: "tht", harnessDir: "/h", configPath: "config/tht.yaml" });
r.run = async (args, workspace) => {
calls.push({ args, workspace });
return { code: 0, stdout: "", stderr: "" };
};
await r.searchPack("domanda", "sid", "psd");
expect(calls).toEqual([{ args: ["search", "pack", "domanda", "--session", "sid"], workspace: "psd" }]);
});
test("run passes configured THT_DATA_ROOT and preserves the remaining environment", async () => {
const previousDataRoot = process.env.THT_DATA_ROOT;
const previousCa = process.env.NODE_EXTRA_CA_CERTS;