Tyler Gillispie 555c5eb384
feat(forum): add missing Gen 1 & Gen 2 PoCs with strict constraint enforcement (#69)
This commit implements the missing Proof of Concepts (PoCs) required by the `agent-forum-v4` architecture blueprint as identified in `CONCEPTS.md`.

Updates include:
- `execution_flywheel_poc.ts`: Implemented mock version (Gen 1) using in-memory state and physical version (Gen 2) utilizing actual file I/O tracking to prove state management bounds.
- `tool_sandbox_poc.ts`: Implemented mock version (Gen 1) yielding simulated telemetry and physical version (Gen 2) utilizing real production-grade tool invocations (Semgrep via CLI and Tree-sitter via WASM module).
- `git_hooks_poc.ts`: Implemented mock version (Gen 1) intercepting simulated events and physical version (Gen 2) configuring a physical Git temp directory executing native `.git/hooks/pre-commit` hooks.
- `BOUNDARIES.md`: Documented explicit technical boundaries in both `poc-g1` and `poc-g2` to enforce strict isolation vs production file-system operation.
- Fixed Deno Linting constraints across `poc-g2/` scripts.
- `CONCEPTS.md`: Status flags updated to .

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>
2026-08-29 00:28:19 -07:00

196 lines
5.8 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.",
},
{
name: "Code Intelligence PoC (Gen 2)",
file: "code_intelligence_poc.ts",
description: "Verifies true Semantic Code graph structure extraction using AST parsing via acorn.",
},
{
name: "CFG Security Proving PoC (Gen 2)",
file: "cfg_poc.ts",
description: "Verifies tracing taint to sinks via dynamic AST traversal.",
},
{
name: "Static Analysis Payloads PoC (Gen 2)",
file: "static_analysis_poc.ts",
description: "Verifies real CI/CD integration using Deno.Command to run deno lint and parse JSON output.",
},
{
name: "The Constitution PoC (Gen 2)",
file: "constitution_poc.ts",
description: "Verifies programmatic constraints parsing an actual markdown file.",
},
{
name: "Dependency Graphing PoC (Gen 2)",
file: "dependency_graph_poc.ts",
description: "Verifies calculating blast radius from a real Deno module dependency graph.",
},
{
name: "Ontology Traceability PoC (Gen 2)",
file: "ontology_poc.ts",
description: "Verifies JSON-LD semantic extraction from real markdown file I/O.",
},
{
name: "Orchestration Matrix PoC (Gen 2)",
file: "orchestration_matrix_poc.ts",
description: "Verifies programmatic routing via a real YAML matrix definition.",
},
{
name: "State Machine PoC (Gen 2)",
file: "state_machine_poc.ts",
description: "Verifies Bounded Model Checking rules loaded from filesystem.",
},
{
name: "Telemetry Parsing PoC (Gen 2)",
file: "telemetry_poc.ts",
description: "Verifies Analyst ingestion of real JSON telemetry payload files.",
},
{
name: "Orphan Branch (Meta-State) PoC (Gen 2)",
file: "orphan_branch_poc.ts",
description: "Verifies absolute isolation of state data in an actual orphan branch.",
},
{
name: "Mutation Testing PoC (Gen 2)",
file: "mutation_poc.ts",
description: "Verifies Adversary gate enforcement via structured mutation data files.",
},
{
name: "Embedded Vector DB PoC (Gen 2)",
file: "vector_db_poc.ts",
description: "Verifies fuzzy semantic retrieval using real SQLite UDFs for vector math.",
},
{
name: "Multi-Vec Isolation PoC (Gen 2)",
file: "multi_vec_poc.ts",
description: "Verifies cross-contamination prevention using physically isolated SQLite databases.",
},
{
name: "Protocol Buffers PoC (Gen 2)",
file: "protobuf_poc.ts",
description: "Verifies high-performance serialization using actual protobuf library.",
},
{
name: "Architectural Graveyard Anti-PoC (Gen 2)",
file: "graveyard_poc.ts",
description: "Mathematical proof of Local-First/Git-Native bounds violations.",
},
{
name: "Execution Flywheel PoC (Gen 2)",
file: "execution_flywheel_poc.ts",
description: "Verifies continuous feedback loop using physical file I/O for state tracking.",
},
{
name: "Tool Sandbox PoC (Gen 2)",
file: "tool_sandbox_poc.ts",
description: "Verifies execution constraints using real binary tooling (Semgrep, Tree-sitter WASM).",
},
{
name: "Automated Git Hooks PoC (Gen 2)",
file: "git_hooks_poc.ts",
description: "Verifies programmatic generation of code indexes via native Git pre-commit hooks.",
}
];
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);
}