FA-9556 / Dependency resolution / Open access
Installed package reconciliation: Undeclared packages remain installed · case 01
Undeclared packages remain installed.
ROOT CAUSE
The implementation substitutes pass for actions.append((name, 'remove')), so undeclared packages remain installed.
THE FAILURE
The implementation substitutes pass for actions.append((name, 'remove')), so undeclared packages remain installed.
Unsuccessful approach: The attempted repair substitutes actions.append((name, 'install')). Fixture 3 still yields [('a', 'install')] instead of [('a', 'remove')].
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: pass
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']] | Failed |
| 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 / 7a6985a834280bfdcca773dcbd027661c065e3da5d0856e8dbbd793e4c0097c5
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, 'install'))
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', 'install']] | [['a', 'remove']] | Failed |
| 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 / 415d8e450b51c30259b72cb669e8bbd76d025d84362589cb5a46db6a5317d388
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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 / 53ffc79602c0ba0c071ee863c76f4f29afa0d9b2f888930b57e52fabf6dcf6ab