Code Rooms
import fs from "node:fs";
import path from "node:path";
import os from "node:os";
import { spawnSync } from "node:child_process";
const root = path.resolve(new URL("..", import.meta.url).pathname);
const expectedSkills = [
"brotherizer-codex-runtime",
"dext3r",
"fastlane",
"git-postman",
"kognit1v",
"m1nd-first",
"m1nd-operator",
"omx-codex-app-bridge",
"pathos",
"pattern-architect",
"proof-grown-systems",
"tempofastlane",
"universal-triple-flow"
];
function run(command, args, options = {}) {
return spawnSync(command, args, {
cwd: options.cwd ?? root,
stdio: options.capture ? "pipe" : "inherit",
encoding: "utf8"
});
}
function exists(relativePath) {
return fs.existsSync(path.join(root, relativePath));
const failures = [];
for (const relativePath of [
"scripts/bootstrap-kognit1v.mjs",
"skills/kognit1v/SKILL.md",
"skills/kognit1v/agents/openai.yaml"
]) {
if (!exists(relativePath)) failures.push(`missing required file: ${relativePath}`);
const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), "kognit1v-smoke-"));
const codexHome = path.join(tmpRoot, "codex-home");
try {
const install = run("node", [
"--install-skills",
"--codex-home",
codexHome
], { capture: true });
if (install.status !== 0) {
failures.push(`bootstrap install failed: ${(install.stderr || install.stdout || "").trim()}`);
const installedRoot = path.join(codexHome, "skills");
for (const skill of expectedSkills) {
const skillPath = path.join(installedRoot, skill, "SKILL.md");
if (!fs.existsSync(skillPath)) failures.push(`skill did not install: ${skill}`);
const installedSkills = fs.existsSync(installedRoot)
? fs.readdirSync(installedRoot).filter((entry) => fs.statSync(path.join(installedRoot, entry)).isDirectory()).sort()
: [];
for (const skill of installedSkills) {
if (!expectedSkills.includes(skill)) {
failures.push(`unexpected skill installed: ${skill}`);
const report = {
id: "proof.kognit1v.smoke_install.latest",
repo: "kognit1v-intelligence-systems",
codex_home: "<temporary-codex-home>",
expected_skills: expectedSkills,
installed_skills: installedSkills,
status: failures.length ? "failed" : "passed",
failures
};
fs.mkdirSync(path.join(root, "proofs", "validation"), { recursive: true });
fs.writeFileSync(
path.join(root, "proofs", "validation", "smoke-install-latest.json"),
`${JSON.stringify(report, null, 2)}\n`
);
console.log(JSON.stringify(report, null, 2));
} finally {
fs.rmSync(tmpRoot, { recursive: true, force: true });
if (failures.length) {
process.exitCode = 1;