ConusAI vendor v0.1.0-dev.20261027+9b1131fb
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261027+9b1131fb
2026-10-27 18:05:17 +00:00
commit 3102273ec7
538 changed files with 80203 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
// The module's migration is its own file and exactly `schemaStatements()` over the agent runtime's
// two entities (decision AT-D20).
import { readFileSync } from "node:fs"
import { AGENT_ENTITIES } from "@conusai-kit/agent"
import { schemaStatements } from "@conusai-kit/data-kysely"
import { describe, expect, it } from "vitest"
import { agentModule } from "../index.js"
function tablesOf(entities: Parameters<typeof schemaStatements>[0]): string {
const kernel = schemaStatements([]).length
return `${schemaStatements(entities)
.slice(kernel)
.map((statement) => `${statement};`)
.join("\n\n")}\n`
}
describe("the migration of the agent module", () => {
it("is its own file, exactly its two tables", async () => {
await expect(
`-- SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0\n${tablesOf(AGENT_ENTITIES)}`,
).toMatchFileSnapshot("../migrations/0001_agent.sql")
})
it("is declared by the manifest, and every table is row-level secured", () => {
expect(agentModule.migrations).toEqual({ postgres: "migrations" })
const sql = readFileSync(new URL("../migrations/0001_agent.sql", import.meta.url), "utf8")
for (const table of ["agent_run", "agent_step"]) {
expect(sql).toContain(`create table "${table}"`)
expect(sql).toContain(`alter table "${table}" force row level security`)
}
})
})