FA-9576 / Dependency resolution / Open access
Installed package reconciliation: Content drift at an equal version is ignored · case 01
Content drift at an equal version is ignored.
ROOT CAUSE
The implementation substitutes False for desired[name][1] != installed[name][1], so content drift at an equal version is ignored.
VERIFIED REPAIR
Reinstall when equal versions have different digests.
Unsuccessful approach: The attempted repair substitutes desired[name][1] == installed[name][1]. Fixture 6 still yields [] instead of [('a', 'reinstall')].
Case contract
For each desired package, emit install if missing, upgrade or downgrade for version movement, reinstall for digest drift, and remove installed packages absent from desired. Output actions sorted by package name.
Why this case matters
An offline model of installed package reconciliation, suitable for testing build and release tooling without external services.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(desired, installed):
actions = []
for name in sorted(set(desired) | set(installed)):
if name not in desired: actions.append((name, 'remove'))
elif name not in installed: actions.append((name, 'install'))
elif desired[name][0] > installed[name][0]: actions.append((name, 'upgrade'))
elif desired[name][0] < installed[name][0]: actions.append((name, 'downgrade'))
elif False: actions.append((name, 'reinstall'))
return actions
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, {}), [])
check('fixture 2', solve({'a': (1, 'x')}, {}), [('a', 'install')])
check('fixture 3', solve({}, {'a': (1, 'x')}), [('a', 'remove')])
check('fixture 4', solve({'a': (2, 'x')}, {'a': (1, 'x')}), [('a', 'upgrade')])
check('fixture 5', solve({'a': (1, 'x')}, {'a': (2, 'x')}), [('a', 'downgrade')])
check('fixture 6', solve({'a': (1, 'x')}, {'a': (1, 'y')}), [('a', 'reinstall')])
check('fixture 7', solve({'a': (1, 'x')}, {'a': (1, 'x')}), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'install']] | [['a', 'install']] | Passed |
| fixture 3 | [['a', 'remove']] | [['a', 'remove']] | Passed |
| fixture 4 | [['a', 'upgrade']] | [['a', 'upgrade']] | Passed |
| fixture 5 | [['a', 'downgrade']] | [['a', 'downgrade']] | Passed |
| fixture 6 | [] | [['a', 'reinstall']] | Failed |
| fixture 7 | [] | [] | Passed |
SHA-256 / aa8fd8336587f6dec09750250f98d63e5b67b407a3828067757c9122944d3927
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(desired, installed):
actions = []
for name in sorted(set(desired) | set(installed)):
if name not in desired: actions.append((name, 'remove'))
elif name not in installed: actions.append((name, 'install'))
elif desired[name][0] > installed[name][0]: actions.append((name, 'upgrade'))
elif desired[name][0] < installed[name][0]: actions.append((name, 'downgrade'))
elif desired[name][1] == installed[name][1]: actions.append((name, 'reinstall'))
return actions
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, {}), [])
check('fixture 2', solve({'a': (1, 'x')}, {}), [('a', 'install')])
check('fixture 3', solve({}, {'a': (1, 'x')}), [('a', 'remove')])
check('fixture 4', solve({'a': (2, 'x')}, {'a': (1, 'x')}), [('a', 'upgrade')])
check('fixture 5', solve({'a': (1, 'x')}, {'a': (2, 'x')}), [('a', 'downgrade')])
check('fixture 6', solve({'a': (1, 'x')}, {'a': (1, 'y')}), [('a', 'reinstall')])
check('fixture 7', solve({'a': (1, 'x')}, {'a': (1, 'x')}), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'install']] | [['a', 'install']] | Passed |
| fixture 3 | [['a', 'remove']] | [['a', 'remove']] | Passed |
| fixture 4 | [['a', 'upgrade']] | [['a', 'upgrade']] | Passed |
| fixture 5 | [['a', 'downgrade']] | [['a', 'downgrade']] | Passed |
| fixture 6 | [] | [['a', 'reinstall']] | Failed |
| fixture 7 | [['a', 'reinstall']] | [] | Failed |
SHA-256 / 06e900b86b879391ae20ee63f24bc3ddbcf01a80ed2b4a324e14cc37c345a5cc
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(desired, installed):
actions = []
for name in sorted(set(desired) | set(installed)):
if name not in desired: actions.append((name, 'remove'))
elif name not in installed: actions.append((name, 'install'))
elif desired[name][0] > installed[name][0]: actions.append((name, 'upgrade'))
elif desired[name][0] < installed[name][0]: actions.append((name, 'downgrade'))
elif desired[name][1] != installed[name][1]: actions.append((name, 'reinstall'))
return actions
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({}, {}), [])
check('fixture 2', solve({'a': (1, 'x')}, {}), [('a', 'install')])
check('fixture 3', solve({}, {'a': (1, 'x')}), [('a', 'remove')])
check('fixture 4', solve({'a': (2, 'x')}, {'a': (1, 'x')}), [('a', 'upgrade')])
check('fixture 5', solve({'a': (1, 'x')}, {'a': (2, 'x')}), [('a', 'downgrade')])
check('fixture 6', solve({'a': (1, 'x')}, {'a': (1, 'y')}), [('a', 'reinstall')])
check('fixture 7', solve({'a': (1, 'x')}, {'a': (1, 'x')}), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [] | [] | Passed |
| fixture 2 | [['a', 'install']] | [['a', 'install']] | Passed |
| fixture 3 | [['a', 'remove']] | [['a', 'remove']] | Passed |
| fixture 4 | [['a', 'upgrade']] | [['a', 'upgrade']] | Passed |
| fixture 5 | [['a', 'downgrade']] | [['a', 'downgrade']] | Passed |
| fixture 6 | [['a', 'reinstall']] | [['a', 'reinstall']] | Passed |
| fixture 7 | [] | [] | Passed |
SHA-256 / 2e56a3a777c168b4268bd463a24b625da992cd0fcf930e016882646dc5893ceb
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:31.120940+00:00.
Case digest / a3a1e25d0d1df7241f7dcd396ad84afbc88673018c951033b53dc981fc573a0b