Skip to content

Migrate analysis to SmolVM and document the v0.0.1 foundation - #5

Merged
hudsonaikins merged 9 commits into
mainfrom
codex/backintel-v2
Nov 13, 2026
Merged

hudsonaikins merged 9 commits into
mainfrom
codex/backintel-v2

Conversation

@hudsonaikins

@hudsonaikins hudsonaikins commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

BackIntel's analysis specialist now executes generated code in SmolVM and requires a structured completion before exporting a report. If a model ends with prose, one bounded recovery prompt runs within the original call budget; a second incomplete response fails without publishing artifacts.

This change also brings the public README, version metadata and roadmap together around an experimental v0.0.1 baseline.

  • Pin and prepare SmolVM 1.31.1 for macOS ARM64, with bounded compute, read-only inputs, disabled guest internet access and explicit local data-service bridges. Docker remains for image preparation and test data services.
  • Preserve the GPT-6.1 Sol specialist default and render final artifacts in a fresh sandbox.
  • Document setup, architecture, tools and skills, source support, safety boundaries, measured capabilities, contribution checks and phased release gates.
  • Add a validated retail analysis brief and concrete next increments linked to the existing Linear backlog.
  • Reconcile the already squash-merged baseline with main. Both baseline trees were identical, and the reconciliation changed no files.

Validation:

  • Fresh checkout from the committed candidate: frozen Python 3.12 dependency installation, CLI help and preparation of all 17 development acceptance cases passed.
  • Ruff, formatting and Vulture passed; pytest: 152 passed, 14 skipped.
  • README/roadmap local links and the example brief schema passed.
  • The runtime-evidence verification passed all six existing stores on SmolVM after fixing the stale Docker caller found in review: valid evidence accepted, broken second evidence rejected, 99,441 orders in each store, zero model calls or data reloads, and service state restored.
  • The structured-completion tests previously passed in a real SmolVM, including the bounded recovery path and call-limit behavior.
  • Live Sol energy rerun on SmolVM: 1/1 selected case passed with 2.1791666667 kWh and 23.5185185% observation coverage. This live run completed directly (zero recovery prompts); recovery is covered separately by the deterministic tests.

Energy experiment

Limits: the prior four-case live run was 3/4; the selected energy rerun does not establish a new 4/4 result. This is an experimental source checkout, not a production release, unattended service or broad reliability claim. SmolVM execution is qualified on macOS ARM64; Linux CI runs the non-live checks. The expanded four-case comparison harness remains separate pending work and is not included here.

Tracking: artifact release and development/release workflow.

hudsonaikins-crown added 8 commits November 10, 2026 19:12
Add the specialist runtime prerequisites, isolated analysis workspace, and report artifacts. Resolve the specialist model from the CLI, then BACKINTEL_ANALYSIS_MODEL, then ChatGPT-plan Sol with medium reasoning; preserve explicit overrides and subscription limits.

Validation: staged snapshot passed 126 tests with 10 optional skips, Ruff checks, and a redacted secret scan.
Separate invalid evaluations from capability coverage, classify subscription outages as infrastructure, reject incomplete acceptance campaigns, and reserve unique local experiments. Decouple ad-hoc questions from evaluator references.

Require Docker for model-generated Python, remap local sources outside workspace roots, and isolate assigned endpoints on disposable internal networks. Keep trusted host execution exclusively in repository-owned test fixtures.

Validation: 146 tests passed with 11 optional skips; Docker acceptance 8 passed with the large-data test skipped. Ruff, Vulture, and Gitleaks passed.
Use pinned offline microVMs for benchmark Python, specialist analysis and artifact rendering. Preserve read-only sources, bounded resources and assigned-service access; serialize image staging to prevent concurrent cold-start corruption.

Validate the scoped snapshot with 155 passing tests and 6 optional skips, including real SmolVM acceptance. Ruff, Vulture and Gitleaks pass. The qualified runtime is macOS ARM64; Docker remains for image preparation and optional source services.
@hudsonaikins
hudsonaikins marked this pull request as ready for review November 13, 2026 04:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T04:46:28.610824Z b6da322 New commits
🔒 Security Review ✅ Completed 2026-11-13T04:42:44.269139Z b6da322 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc25047eb1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/backintel/sandbox.py Resolved
@hudsonaikins
hudsonaikins merged commit 81930b6 into main Nov 13, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6da322781

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/backintel/settings.py
model=env.get("BACKINTEL_MODEL") or DEFAULT_MODEL,
judge_model=env.get("BACKINTEL_JUDGE_MODEL") or DEFAULT_JUDGE_MODEL,
sandbox=env.get("BACKINTEL_SANDBOX") or "docker",
sandbox=env.get("BACKINTEL_SANDBOX") or "smolvm",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prepare SmolVM in the benchmark setup

On a fresh checkout, following docs/benchmark.md:105-116 now builds only the Docker image and immediately runs backintel sandbox check. Because this default selects SmolVM and runtime() rejects an unprepared installation, that documented benchmark setup deterministically stops before its store and benchmark checks; add uv run python -m scripts.prepare_smolvm before the check, as the README already does.

AGENTS.md reference: AGENTS.md:L3-L4

Useful? React with 👍 / 👎.

Comment on lines +596 to +597
if not missing:
raise RuntimeError(f"SmolVM cleanup failed for {self.name}; retain its identity.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow cleanup to retry after a delete failure

When smolvm machine delete times out or returns a transient non-NOT_FOUND error, cleanup raises here after self.closed was already set at line 561. Every later close() therefore returns immediately, leaving the task-owned VM metadata and overlay behind; repeated runs can accumulate leaked VM resources, so deletion should remain retryable until it succeeds.

Useful? React with 👍 / 👎.

Comment on lines 299 to 300
self.started_at = time.monotonic()
self._watchdog = threading.Timer(p.run_timeout_s, self.cancel)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include VM startup in the run deadline

PythonSandbox(timeout_s=30) and run_analysis(timeout_s=...) both enter start() before any deadline is established, but started_at and the watchdog are created only after the image-lock wait, two independent 120-second CLI calls, and the readiness loop. If image staging or startup stalls, a configured run can therefore exceed its declared limit by several minutes; establish the overall deadline before startup and pass the remaining time to each setup operation.

AGENTS.md reference: AGENTS.md:L28-L30

Useful? React with 👍 / 👎.

"--workdir",
"/workspace",
"--timeout",
f"{max(1, int(timeout))}s",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the native exec timeout behind the host deadline

For PythonSandbox, the run and command limits are equal, so remaining is already fractional when execution starts and int(timeout) schedules SmolVM's deadline almost one second before the host deadline. The official SmolVM timeout report identifies exit 124 as the expected machine exec --timeout result; consequently a command reaching this earlier native limit returns as an ordinary nonzero result with timed_out=false, and the VM remains open for retries instead of being cancelled. Preserve the fractional duration or interpret the native timeout result and cancel the sandbox.

AGENTS.md reference: AGENTS.md:L28-L30

Useful? React with 👍 / 👎.

)
if result.returncode:
# Never echo arguments: explicitly assigned store credentials may be present.
raise RuntimeError(f"SmolVM operation failed: {result.stderr[:1000]}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Classify SmolVM operation failures as infrastructure

When machine creation, startup, or execution returns nonzero, _checked() raises a plain RuntimeError. Harness.answer() at src/backintel/bench/run.py:229-240 does not classify that type as infrastructure, so it records failure_class="agent"; score() then assigns failed agent scores instead of nulling the invalid run. A broken SmolVM runner can therefore corrupt benchmark comparisons as an apparent model regression, so raise or recognize a dedicated infrastructure exception.

AGENTS.md reference: AGENTS.md:L69-L72

Useful? React with 👍 / 👎.

os.environ.get("BACKINTEL_SMOLVM") or RUNTIME_HOME / f"runtimes/smolvm-{VERSION}-darwin-arm64/smolvm"
)
binary = engine.parent / "smolvm-bin"
if not engine.is_file() or not binary.is_file() or digest(binary) != BINARY_SHA256:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify the launcher that is actually executed

When BACKINTEL_SMOLVM names a modified launcher, or the installed launcher is corrupted, admission hashes only its sibling smolvm-bin; the unchecked engine file is then returned and executed for every sandbox command. A replacement launcher therefore passes validation whenever a valid smolvm-bin is copied beside it and can run model-generated command arguments or capture store credentials on the host, bypassing the intended SmolVM boundary. Hash the launcher as well, or execute the verified binary directly.

AGENTS.md reference: AGENTS.md:L24-L26

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant