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>
72 lines
2.2 KiB
TypeScript
72 lines
2.2 KiB
TypeScript
/**
|
|
* Proof of Concept: Harness Consolidation (Gen 3)
|
|
*
|
|
* This PoC demonstrates isolating the Agent Forum architecture from the main
|
|
* repository, maintaining clean root boundaries. Everything must live under
|
|
* the hidden `.forum/` directory so that indexers, linters, and compilers
|
|
* ignore the state management tools.
|
|
*/
|
|
|
|
import { existsSync } from "https://deno.land/std@0.210.0/fs/mod.ts";
|
|
import { join } from "https://deno.land/std@0.210.0/path/mod.ts";
|
|
|
|
export async function runHarnessConsolidationPoC(): Promise<void> {
|
|
console.log("Starting Harness Consolidation PoC...");
|
|
|
|
const rootPath = Deno.cwd();
|
|
const forumPath = join(rootPath, ".forum");
|
|
|
|
console.log(`Checking if framework is encapsulated in: ${forumPath}`);
|
|
|
|
if (!existsSync(forumPath)) {
|
|
throw new Error("Failure: '.forum' directory does not exist in root.");
|
|
}
|
|
|
|
// Ensure no agent-forum specific root files like "agent-forum.md" or "CONCEPTS.md"
|
|
// are lying in the root directory. They should be inside `.forum/`.
|
|
const bannedRootFiles = [
|
|
"agent-forum.md",
|
|
"CONCEPTS.md",
|
|
"ASSESSMENT.md",
|
|
];
|
|
|
|
for (const file of bannedRootFiles) {
|
|
const filePath = join(rootPath, file);
|
|
if (existsSync(filePath)) {
|
|
throw new Error(
|
|
`Failure: ${file} found in root. It MUST be moved into .forum/ to respect Harness Consolidation.`,
|
|
);
|
|
}
|
|
}
|
|
|
|
console.log("[OK] No banned protocol files found in the repository root.");
|
|
|
|
// Ensure the environment setup respects this isolation.
|
|
const requiredForumFiles = [
|
|
join(forumPath, "agent-forum.md"),
|
|
join(forumPath, "CONCEPTS.md"),
|
|
join(forumPath, "poc-g3", "BOUNDARIES.md"),
|
|
];
|
|
|
|
for (const file of requiredForumFiles) {
|
|
if (!existsSync(file)) {
|
|
throw new Error(
|
|
`Failure: Expected ${file} to be safely inside the .forum structure, but it is missing.`,
|
|
);
|
|
}
|
|
}
|
|
|
|
console.log(
|
|
"[OK] Required protocol files successfully located within .forum/ namespace.",
|
|
);
|
|
|
|
console.log(
|
|
"\\n[SUCCESS] Harness Consolidation verified. Framework files are correctly encapsulated and hidden from root indexers.",
|
|
);
|
|
}
|
|
|
|
// If run directly
|
|
if (import.meta.main) {
|
|
await runHarnessConsolidationPoC();
|
|
}
|