/** * SandboxService — Creates, destroys, and resets governed sandbox environments. * * v2 architecture: Uses the ingestion pipeline to create issues from a technical spec, * then applies post-ingestion state simulation, violation injection, and seeding. * The sandbox eats ido4's own dogfood — the same pipeline that governs real projects * creates the demo project. * * Bootstraps standalone (like ProjectInitService) — creates its own GraphQL client. * Does NOT live in ServiceContainer. Each operation manages its own infrastructure. * * Create flow: * Phase 1: Project setup (ProjectInitService + ServiceContainer) * Phase 2: Ingest technical spec (IngestionService — creates capabilities + tasks) * Phase 3: Container assignment + state simulation (post-ingestion field updates) * Phase 4: Violation injection (methodology-specific governance violations) * Phase 5: Seeding (audit events, agents, PRs, comments, metadata, memory seed) */ import type { ILogger } from '../../shared/logger.js'; import type { IGraphQLClient } from '../../container/interfaces.js'; import type { ISandboxService, SandboxCreateOptions, SandboxCreateResult, SandboxDestroyResult, SandboxResetResult, ListOrphanSandboxesResult, DeleteOrphanSandboxResult } from './types.js'; export declare class SandboxService implements ISandboxService { private readonly graphqlClient; private readonly logger; private readonly configs; constructor(graphqlClient: IGraphQLClient, logger: ILogger); createSandbox(options: SandboxCreateOptions): Promise; /** * Inner createSandbox body that mutates `mutations` as each phase succeeds. * Splitting this from the public method keeps the try/catch + rollback * boilerplate visible in createSandbox without bloating it. */ private createSandboxWithRollback; destroySandbox(projectRoot: string): Promise; resetSandbox(options: SandboxCreateOptions): Promise; /** Overridable sleep for testing */ protected sleep(ms: number): Promise; /** * Injects a governance violation into a task using direct repository methods * (bypassing BRE — this is scenario setup, not real governance). */ private injectViolation; /** * Resolves task ref placeholders in comment templates to actual issue numbers. * Supports both #TASK_REF (e.g., #NCO-01) and legacy #T_REF patterns. */ private resolveTaskRefs; private seedAuditEvents; private seedAgents; private writeContainerMetadata; private writeMemorySeed; /** * Phase 5 OBS-06/03/04 fix: validate every external dependency BEFORE * createSandbox mutates anything. The dominant Phase 4 partial-smoke * failure mode (orphan issues + orphan project on a partially-failed * sandbox creation) traced to skipping default-branch validation — * the engine threw mid-flight at PR seeding, but by then issues + the * Project V2 + the local config were already written. * * Throws ValidationError with specific remediation if any check fails. * Zero mutations happen until this method returns successfully. */ private preflightCreate; /** * Phase 5 OBS-07 fix: walks the mutation log in reverse and best-efforts * each undo. Failures during rollback are logged but don't abort the * walk — we want to clean up as much as possible even when individual * undos fail (e.g., issue already closed, branch already deleted). * * Returns a structured summary the catch block uses to compose the * user-facing error. */ private rollbackCreate; /** * Direct GraphQL project deletion that doesn't depend on a ServiceContainer. * Used by rollback when the container couldn't bootstrap, and by orphan * cleanup which has no local config at all. */ private deleteProjectByIdViaGraphQL; /** * Phase 5 OBS-09: list ido4 Sandbox-titled Project V2 projects on the * viewer's account, identifying orphans whose linked repository no * longer exists. * * Read-only — no mutations. Caller (skill) presents the list to the * user, who confirms before any deletion via deleteOrphanSandbox. * * Scoped to the viewer's projects (not org-owned). Org-owned orphan * cleanup is v1.1 work — most ido4 sandbox use is on user-owned repos. */ listOrphanSandboxes(): Promise; /** * Phase 5 OBS-09: delete one orphan sandbox project. Gated by * verifySandboxProject (project title must contain "Sandbox") to defend * against accidentally deleting a non-sandbox project. * * Caller is expected to confirm with the user before invoking this — * deletion is irreversible at the GitHub Projects V2 layer. */ deleteOrphanSandbox(projectId: string): Promise; private ensureNoExistingSandbox; private deleteStaleRef; private verifySandboxProject; private static readonly SANDBOX_FILES; private removeLocalConfig; } //# sourceMappingURL=sandbox-service.d.ts.map