Skip to content

fix(dab): mongo crash recovery + vendor common_scaffold for per-query validators#9

Merged
kentwelcome merged 1 commit into
mainfrom
fix/dab-mongo-stability-and-common-scaffold
Jun 11, 2026
Merged

fix(dab): mongo crash recovery + vendor common_scaffold for per-query validators#9
kentwelcome merged 1 commit into
mainfrom
fix/dab-mongo-stability-and-common-scaffold

Conversation

@kentwelcome

Copy link
Copy Markdown
Contributor

Two independent DAB trial-stability bugfixes, each with a regression test.

1. Mongo crash recovery (compose.py)

mongo:8 intermittently SIGSEGVs (exit 139) on startup, and its WiredTiger cache auto-sizes to ~half of host RAM (≈7GB on a 15GB box), starving the agent. We now:

  • Cap the cache: command: ["--wiredTigerCacheSizeGB", "1"]
  • restart: on-failure

Because the data dir is already populated, a restarted mongod comes straight back up with data and the healthcheck recovers. Without this, a single crash bricks the whole trial — main's healthcheck fails for its entire retry window and the trial is cancelled.

2. Vendor common_scaffold on the per-query path (prepare.py)

9 of 54 DAB validators do from common_scaffold.validate.levenshtein import levenshtein. verify.py exec_module's validate.py inside the dab-agent container, which has no common_scaffold installed, so the import raised, no reward.json was written, and harbor reported RewardFileNotFoundError (the verifier appeared never to run).

The batch path already vendored common_scaffold next to verify.py; the per-query path now does too (/tests is sys.path[0]), so the import resolves.

Tests

  • test_mongo_has_restart_and_cache_cap
  • test_per_query_materializes_common_scaffold_for_upstream_validators

All 14 tests in the two affected files pass.

🤖 Generated with Claude Code

… validators

Two independent DAB trial-stability bugfixes:

1. compose.py — mongo:8 intermittently SIGSEGVs (exit 139) on startup, and
   its WiredTiger cache auto-sizes to ~half of host RAM, starving the agent.
   Cap the cache at 1GB and set restart: on-failure so a crashed mongod comes
   back up against the already-populated data dir and the healthcheck recovers.
   Without this, a single crash bricks the whole trial.

2. prepare.py — 9 of 54 DAB validators do `from common_scaffold.validate
   .levenshtein import levenshtein`. verify.py exec_module's validate.py inside
   the dab-agent container, which has no common_scaffold installed, so the
   import raised, no reward.json was written, and harbor reported
   RewardFileNotFoundError. Vendor common_scaffold next to verify.py on the
   per-query path (the batch path already did this) so the import resolves.

Both paths covered by new regression tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 11, 2026 15:50

Copilot AI 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.

Pull request overview

Improves DAB trial stability by hardening MongoDB service behavior in generated docker-compose output and ensuring common_scaffold is vendored for per-query validator execution inside the dab-agent container.

Changes:

  • Add restart: on-failure and cap WiredTiger cache size for dab-mongo in generated compose output.
  • Vendor common_scaffold into per-query task /tests so upstream validators importing it can run successfully.
  • Add regression tests covering both the compose Mongo settings and the per-query common_scaffold materialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/razorback-plugin-dab/tests/unit/test_prepare_per_query.py Adds regression test ensuring per-query tasks vendor common_scaffold and validators can import it.
packages/razorback-plugin-dab/tests/unit/test_compose_mongo.py Adds regression test asserting Mongo restart policy and WiredTiger cache cap are emitted.
packages/razorback-plugin-dab/src/razorback_plugin_dab/generate/prepare.py Ensures per-query task materialization also installs common_scaffold into /tests.
packages/razorback-plugin-dab/src/razorback_plugin_dab/generate/compose.py Updates generated dab-mongo service to restart on failure and cap WiredTiger cache size.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kentwelcome kentwelcome merged commit 857e9e4 into main Jun 11, 2026
1 check passed
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.

2 participants