Change Detection¶
Bear compares each artifact against its last deployed commit in the selected
environment (from bear.lock.yml). No base branch needed.
bear plan <environment> always runs this comparison to decide what to deploy.
bear validate --changed-since <environment>
runs the exact same comparison, opt-in, to decide what to validate instead —
without adopting any of plan's deployment semantics (no policy, no lock-file
write, no plan file).
What Triggers a Rebuild¶
| Trigger | Example |
|---|---|
| Uncommitted changes | Modified, staged, or untracked files in artifact dir |
| New commits | Commits since last deploy touching artifact dir |
| New artifact | No entry in lock file |
| Dependency changed | A library it depends on changed |
Each environment/artifact pair is tracked independently; they can be at different versions. Transitive dependency changes are compared against the consumer's deployment baseline, not the dependency's own history. Missing history means a new artifact in that environment. Legacy artifact-only history is retained but ignored rather than assigned to an environment.
Detecting uncommitted changes is not permission to deploy dirty source. A normal
plan with any deployments requires clean source before it runs; a plan with
nothing to deploy may start dirty. Plan itself never modifies HEAD or the tracked
working-tree diff — it runs no commands at all. bear apply verifies the saved
commit and fingerprint match before it runs anything, exactly as it would for any
other edited file. Ignored dependencies and outputs are outside that fingerprint.
See Source Safety.