- Renamed `forum/experiments` to `forum/poc-g1` to designate generation 1. - Created `forum/poc-g2` and a new `lab.ts` runner. - Non-destructively migrated `dag_engine_poc.ts`, `git_storage_poc.ts`, `merkle_diff_poc.ts`, and `frontmatter_poc.ts` to `poc-g2`. - Upgraded migrated PoCs to utilize actual production-ready tools (e.g. `std/yaml` parsing and isolated `Deno.Command` Git repos) per blueprint constraints. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
106 lines
2.7 KiB
TypeScript
106 lines
2.7 KiB
TypeScript
import {
|
|
dirname,
|
|
fromFileUrl,
|
|
join,
|
|
} from "https://deno.land/std@0.224.0/path/mod.ts";
|
|
import {
|
|
blue,
|
|
bold,
|
|
green,
|
|
red,
|
|
yellow,
|
|
} from "https://deno.land/std@0.224.0/fmt/colors.ts";
|
|
|
|
// Define the experiments to run
|
|
const EXPERIMENTS = [
|
|
{
|
|
name: "DAG Engine PoC (Gen 2)",
|
|
file: "dag_engine_poc.ts",
|
|
description: "Verifies dependency resolution parsing real YAML task graphs.",
|
|
},
|
|
{
|
|
name: "Git Storage PoC (Gen 2)",
|
|
file: "git_storage_poc.ts",
|
|
description: "Verifies ability to read/write Git Notes in an isolated environment.",
|
|
},
|
|
{
|
|
name: "Git Merkle DAG Diffing PoC (Gen 2)",
|
|
file: "merkle_diff_poc.ts",
|
|
description: "Verifies O(1) diffing using native Git tree hashes on an isolated history.",
|
|
},
|
|
{
|
|
name: "Declarative Frontmatter PoC (Gen 2)",
|
|
file: "frontmatter_poc.ts",
|
|
description: "Verifies extraction of UUIDv7 from Markdown using real YAML parsing.",
|
|
},
|
|
];
|
|
|
|
async function runExperiment(
|
|
file: string,
|
|
): Promise<{ success: boolean; output: string }> {
|
|
const currentDir = dirname(fromFileUrl(import.meta.url));
|
|
const filePath = join(currentDir, file);
|
|
|
|
try {
|
|
const command = new Deno.Command("deno", {
|
|
args: ["run", "-A", filePath],
|
|
stdout: "piped",
|
|
stderr: "piped",
|
|
});
|
|
|
|
const { code, stdout, stderr } = await command.output();
|
|
const decoder = new TextDecoder();
|
|
|
|
const outputString = decoder.decode(stdout) + decoder.decode(stderr);
|
|
|
|
return {
|
|
success: code === 0,
|
|
output: outputString.trim(),
|
|
};
|
|
} catch (error) {
|
|
return {
|
|
success: false,
|
|
output: `Failed to execute ${file}: ${error}`,
|
|
};
|
|
}
|
|
}
|
|
|
|
async function runLab() {
|
|
console.log(bold(blue("=== Agent Forum v4 - Experimental Laboratory (Generation 2) ===")));
|
|
console.log("Running advanced foundational proofs of concept with real production tools...\n");
|
|
|
|
let passed = 0;
|
|
let failed = 0;
|
|
|
|
for (const exp of EXPERIMENTS) {
|
|
console.log(bold(`[Running] ${exp.name}`));
|
|
console.log(`> ${exp.description}`);
|
|
|
|
const { success, output } = await runExperiment(exp.file);
|
|
|
|
if (success) {
|
|
console.log(green("✅ PASS\n"));
|
|
console.log(output);
|
|
passed++;
|
|
} else {
|
|
console.log(red("❌ FAIL\n"));
|
|
console.log(output);
|
|
failed++;
|
|
}
|
|
console.log(yellow("--------------------------------------------------\n"));
|
|
}
|
|
|
|
console.log(bold(blue("=== Laboratory Results ===")));
|
|
console.log(`Total Experiments: ${EXPERIMENTS.length}`);
|
|
console.log(green(`Passed: ${passed}`));
|
|
console.log(red(`Failed: ${failed}`));
|
|
|
|
if (failed > 0) {
|
|
Deno.exit(1);
|
|
}
|
|
}
|
|
|
|
if (import.meta.main) {
|
|
runLab().catch(console.error);
|
|
}
|