Automated Dart dependency lower-bound validator and synthetic runtime isolation engine.
lower_bound verifies that a Dart package or monorepo compiles cleanly against
the minimal satisfiable dependency floors specified in pubspec.yaml.
- Synthetic Runtime Isolation:
- Stages
lib/andbin/directories in temporary isolation to prevent source tree mutations. - Strips
dev_dependenciescompletely to prevent test-tooling dependencies (e.g.package:test,package:lints) from artificially elevating transitive dependency floors. - Strips
resolution: workspaceso published dependencies resolve their declared lower bounds directly frompub.dev. - Sanitizes
analysis_options.yaml(stripping all dev/relative includes).
- Stages
- Minimal Satisfiable Floor Resolution:
- Executes
pub downgradewithin the isolated staging sandbox to compute the lowest jointly satisfiable dependency versions allowed by all declared version constraints.
- Executes
- Opt-in Local Sibling Overrides:
- When
--allow-local-siblingsis passed, unpublished local monorepo siblings (with-wipversions orpublish_to: none) are linked via local path overrides. - By default (
--no-allow-local-siblings), external dependencies must be published onpub.devto verify genuine consumer installability.
- When
- Target Resolution Protocol:
- Explicit paths: validates specified directories, automatically expanding workspace members if pointed at a workspace root.
- Current directory (
.): auto-detectspubspec.yamlworkspace members or single packages without heuristics.
- Rich Output Formats:
text(human-readable summary table with warnings and diagnostics).github(GitHub Actions line annotations and Step Summary).json(machine-readable structured JSON).
- Sticky PR Comments:
- Supports
--comment-outputand--max-comment-rowsfor paginated, sticky PR comments.
- Supports
Run directly in any Dart or Flutter project without prior installation or
pubspec.yaml changes (requires Dart SDK 3.12.0 or greater):
Validate the current package or monorepo workspace:
dart run lower_bound@Validate a specific package directory or monorepo root (workspace members are automatically expanded):
dart run lower_bound@ path/to/my_packageOutput results as JSON:
dart run lower_bound@ --format=jsonGenerate a sticky PR comment report:
dart run lower_bound@ --comment-output=comment.md --max-comment-rows=10Add lower_bound to your GitHub Actions workflow:
name: Dependency Lower-Bound Validation
on:
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
permissions:
pull-requests: write # Required for sticky PR comment summaries
contents: read
steps:
- name: Checkout Codebase
uses: actions/checkout@v7
- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1
- name: Validate Dependency Lower Bounds
uses: kevmoo/lower_bound.dart@main
with:
format: "github"
fail-on-error: "true"| Input | Default | Description |
|---|---|---|
package-path |
. |
Path to target package or workspace root to validate. |
targets |
lib,bin |
Comma-separated list of target directories or files to analyze. |
allow-local-siblings |
false |
Allow unreleased local sibling packages via path overrides. |
sdk |
None | Simulate specific Dart SDK version during pub resolution. |
fail-on-error |
true |
Exit with non-zero status if lower bound validation fails. |
format |
github |
Output format: github (summary table + annotations), text, or json. |
max-comment-rows |
0 |
Maximum table rows in the sticky PR comment (0 = unlimited). |