Skip to content

[FEATURE] Allow opt-in optimization of SQLite databases larger than 100 MiB - #1409

Open
r266-tech wants to merge 5 commits into
tw93:mainfrom
r266-tech:oss-autonomy/dde350d2fdfe-029f35cfee69
Open

[FEATURE] Allow opt-in optimization of SQLite databases larger than 100 MiB#1409
r266-tech wants to merge 5 commits into
tw93:mainfrom
r266-tech:oss-autonomy/dde350d2fdfe-029f35cfee69

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Adds a bounded, unit-bearing database size option, probe-before-policy classification, scaled timeout limits, temporary-space checks, factual skip reporting, and operation logging.

The patch was applied to the frozen base.

Focused optimize and SQLite regression tests completed with no failures beyond the frozen-base baseline.

make check passed.

@r266-tech
r266-tech requested a review from tw93 as a code owner August 10, 2026 01:08
@r266-tech

Copy link
Copy Markdown
Contributor Author

Updates the bounded, unit-bearing --database-max-size implementation by replacing the ShellCheck-incompatible suffix expansion with Bash-compatible literal suffix branches, and corrects the CLI propagation test mock to read the production run_with_timeout argument position.

Verified: ./scripts/check.sh --format, the four filtered mo optimize tests, all 18 optimize_db tests, and make check passed. The complete shell suite exceeded its runtime budget and was not completed.

@r266-tech

Copy link
Copy Markdown
Contributor Author

Adds a deterministic sqlite3 fixture to the existing CLI propagation regression in tests/optimize.bats, so the valid bounded --database-max-size path reaches the curated dry-run optimization consistently.

Verified: ./scripts/check.sh --format, the filtered CLI propagation test, bats tests/optimize_db.bats, and make check passed.

@r266-tech

Copy link
Copy Markdown
Contributor Author

SQLite databases above 100 MiB were skipped before freelist inspection, with no bounded opt-in for larger curated databases.

This change adds --database-max-size with explicit positive units and a 1 GiB upper bound, while retaining the 100 MiB default and limiting the override to the existing curated SQLite targets. It classifies compact databases before applying the size policy and preserves process, integrity, timeout, temporary-space, dry-run, logging, and factual outcome safeguards.

The CLI propagation regression now uses deterministic, side-effect-free SQLite responses and an explicit no-color presentation mode, so the dry-run summary assertion is independent of ambient terminal settings.

Verified:

  • ./scripts/check.sh --format
  • bats --filter "mo optimize" tests/optimize.bats (4 tests)
  • bats tests/optimize_db.bats (18 tests)
  • make check

All listed commands passed. The local make check run skipped ShellCheck because it was not installed and completed its remaining configured checks.

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