Skip to content

Rebuild BackIntel analyst and benchmark with a Sol analysis specialist - #4

Merged
hudsonaikins merged 4 commits into
mainfrom
codex/backintel-v2
Nov 12, 2026
Merged

hudsonaikins merged 4 commits into
mainfrom
codex/backintel-v2

Conversation

@hudsonaikins

@hudsonaikins hudsonaikins commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

BackIntel needs reproducible analysis and evaluation before broader automation. This branch replaces the earlier demo implementation with a Deep Agents analyst, an evidence-checked LangSmith benchmark, and an opt-in sandboxed report specialist. Running backintel analyze without a model now selects chatgpt-plan/gpt-6.1-sol with medium reasoning.

Scope

This PR contains the full branch since main, including the existing rebuild and supervised-improvement work, not just the final default change .

  • Add native read-only data access, schema discovery, isolated Python execution, independently computed references, evidence replay, and LangSmith scoring across the documented benchmark levels.
  • Add controlled development/reserved cases and a bounded baseline/candidate improvement workflow.
  • Add a persistent Docker analysis workspace and trusted HTML, chart, CSV, and XLSX rendering with source-evidence checks and explicit resource limits.
  • Support the operator's ChatGPT subscription with call limits, usage reporting, and no automatic paid API fallback. Resolve specialist selection from --model, then BACKINTEL_ANALYSIS_MODEL, then Sol; preserve explicit model and reasoning overrides.
  • Replace the previous demo/web/runtime implementation and its workflows with the Python implementation and CI. The previous implementation remains in Git history.

Validation

  • Earlier live specialist comparison: Sol passed 4/4 controlled cases; Luna passed 2/4. These small synthetic trials support the default choice, not production readiness or a general model ranking. Sol experiment.
  • Hosted CI is separate from these local results and will run on this PR.

Review fixes

Commit 0a9ff10 addresses the eight code/security findings:

  • Capability metrics and coverage exclude invalid evaluations, with separate attempted/invalid counts.
  • Subscription outages remain invalid infrastructure results; incomplete acceptance campaigns return exit code 1.
  • Ad-hoc questions no longer load benchmark answers, and local experiments cannot collide or append to an existing run.
  • Model-generated Python requires Docker. Host execution is restricted to fixed, repository-owned test fixtures.
  • Local source mounts move under /sources. Each analysis run gets a disposable internal network with only assigned endpoints; existing source/backend connections remain intact.

Current local validation: 146 passed, 11 optional skips. Docker acceptance: 8 passed, 1 large-data opt-in skip, covering network isolation, source access, resource limits and cleanup. Ruff, Vulture, Gitleaks and diff checks passed. No model-provider calls were used for these fixes.

Review boundaries

This is an experimental implementation, not a production release. Durable background scheduling and hosted delivery remain future work. Human calibration was waived by the owner; method-judge scores remain uncalibrated.

Pending local version-reset edits, expanded specialist benchmark scripts/tests, and additional sandbox/comparison documentation are excluded from this PR. The historical branch and README “v2” wording does not establish a stable product version.

Specialist documentation: docs/specialist-default.md. Related development tracking: INT-454.

hudsonaikins-crown added 3 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.
@hudsonaikins
hudsonaikins marked this pull request as ready for review November 12, 2026 03:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-12T03:43:17.942855Z 0a9ff10 New commits
🔒 Security Review ✅ Completed 2026-11-12T03:43:35.620926Z 0a9ff10 New commits

Security findings

Advisory findings (2)

ℹ️ 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: dfe4c6450f

ℹ️ 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/bench/scorecard.py Resolved
Comment thread src/backintel/cli.py Resolved
Comment thread src/backintel/analysis_sandbox.py Resolved
Comment thread src/backintel/analysis_sandbox.py Resolved
Comment thread src/backintel/bench/run.py Resolved
Comment thread src/backintel/bench/commands.py Resolved
Comment thread src/backintel/bench/run.py Resolved

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: dfe4c6450f

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/backintel/sandbox.py Resolved
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.
@hudsonaikins
hudsonaikins merged commit dfd8c90 into main Nov 12, 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: 0a9ff10722

ℹ️ 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 results/scorecard.md
| olist-files-gpt-6-luna-L123-20261110-0127-240c2aa3 | 1 | 8 | 100% | 100% | 100% | 0.727 | 100% | 0 | 11.9 | 0.0076 | 6.5 |
| olist-files-gpt-6-luna-L123-20261110-0127-240c2aa3 | 2 | 8 | 100% | 100% | 100% | 0.686 | 100% | 0 | 18.4 | 0.0126 | 8.125 |
| olist-files-gpt-6-luna-L123-20261110-0127-240c2aa3 | 3 | 8 | 100% | 100% | 100% | 0.748 | 100% | 0 | 15.6 | 0.0091 | 7.375 |
| olist-files-gpt-6-luna-L123-20261110-0213-b3df2153 | 1 | 1 | 0% | 0% | 0% | 0.0 | 0% | 1 | 0.6 | 0.0000 | 0.0 |

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 Regenerate scorecards with invalid-run accounting

Fresh evidence after the aggregation fix is that the committed scorecard was not regenerated: this provider-credit failure is still published as n=1 with 0% capability, while the current aggregate() would report zero valid evaluations plus attempted/invalid counts. The machine-readable scorecard has the same stale schema and values, so users and downstream consumers still interpret an infrastructure outage as an analyst regression; rebuild both scorecard artifacts from the corrected records before publishing them.

AGENTS.md reference: AGENTS.md:L61-L63

Useful? React with 👍 / 👎.

Comment thread src/backintel/sandbox.py
Comment on lines +80 to +81
"--network",
network or "none",

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 Isolate benchmark Python from unrelated store peers

When run_python is used against any network-backed store while another testbed service is running, this attaches model-generated code directly to the shared backintel-net, which also contains PostgreSQL, ClickHouse, Garage, FerretDB, and its DocumentDB backend; Docker documents that containers on the same user-defined network can communicate by container name or IP (Docker CLI reference). The fresh evidence beyond the earlier analysis-sandbox issue is that source-specific isolation was added only to AnalysisSandbox, while the benchmark's PythonSandbox still exposes every peer and can let an experiment inspect data outside its bound store. Give each invocation a disposable network containing only the selected endpoint and required backend peers.

AGENTS.md reference: AGENTS.md:L54-L58

Useful? React with 👍 / 👎.


import base64
import contextlib
import fcntl

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 Replace the Unix-only lock on the Windows benchmark host

On the Windows desktop designated for scale factors above 1, importing backintel.bench.run unconditionally imports this module for PlanUsageStopped, but Python on Windows has no fcntl module. Consequently backintel bench run fails with ModuleNotFoundError before opening any TPC-H scenario, even when the selected provider is not chatgpt-plan; use a portable file lock or conditionally load the platform-specific implementation.

AGENTS.md reference: AGENTS.md:L78-L79

Useful? React with 👍 / 👎.

Comment thread src/backintel/cli.py
judge=not args.no_judge,
)
try:
scenarios = select(harness.scenarios.values(), levels=levels, ids=ids, limit=args.limit)

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 Reject empty benchmark selections

When --ids contains a typo or --levels matches no scenarios, this proceeds with an empty list; in the --no-langsmith path, run_local() then creates an empty experiment file and the command exits successfully after rebuilding the scorecard. Unlike the acceptance command's selection checks, this lets automation record a completed benchmark that evaluated nothing, so validate the requested IDs and levels and fail before starting the run.

AGENTS.md reference: AGENTS.md:L61-L63

Useful? React with 👍 / 👎.

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 0a9ff10722

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

NETWORK = "backintel-net"
IMAGE = "postgres:17"
HOST_PORT = 55432
ADMIN_PASSWORD = "backintel-local-admin" # local container bound to 127.0.0.1 only

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 Security Review · Automatically triggered

P2 Badge Security: Isolate the database superuser from model code

When a Docker-backed run uses postgres:*, a malicious or compromised model can make run_python log in to backintel-postgres with this published postgres password and issue writes. The store is automatically attached to the sandbox network, so the read-only analyst DSN and SQL filter do not apply; mutations persist in backintel-postgres-data. This build is local and pre-production, which caps severity at P2, but the model still crosses from read-only analysis to superuser access. Generate a private loader credential and make privileged authentication unreachable or disable it before model execution.

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