diff options
| author | aur-build <aur-build@localhost> | 2026-11-18 09:44:37 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-18 09:44:37 +0000 |
| commit | 5809493be2f6e47e3bbfc8a645ea0d82d5aedd82 (patch) | |
| tree | 7e532b1904c7327ca565885a5b7b91e1453d4922 /.pi/goals/goal_events.jsonl | |
| parent | bc543e4182d51917fe6bfa608af2c09c8b578671 (diff) | |
| download | aur-build-5809493be2f6e47e3bbfc8a645ea0d82d5aedd82.tar.gz aur-build-5809493be2f6e47e3bbfc8a645ea0d82d5aedd82.zip | |
vercmp: three real bugs, found by comparing against pacman's own binary
tests/versions.rs started as a hand-typed table of ALPM ordering vectors and
turned into something better: a differential test that runs the hand-written
comparator against pacman's `vercmp` over a 34-fragment cross-product (1156
pairs) of shapes that appear in real recipes. It found three bugs, all of which
would have shipped.
1. **Numeric vs alphabetic chunks were inverted.** The code had 'a numeric chunk
is always older than an alphabetic one'. It is the opposite: 1.0.1 > 1.0.a.
The unit test asserted the wrong direction with the comment 'alpha sorts
after numeric', so the suite was protecting the bug.
2. **Separators were ignored entirely.** They are not merely skipped. ALPM
distinguishes an alphabetic chunk glued to the previous chunk from one after
a separator, and the separated one is newer regardless of the letters:
1.0 > 1.0a, but 1.0 < 1.0.a, and 1.0z < 1.0.a. Two versions differing only in
where the dot sits were being called equal.
3. **The end-of-string rule looked at the wrong thing.** When one side runs out,
the decision comes from the other side's *next raw character* before any
separator skipping: a letter there makes the exhausted string newer (the
1.0rc1 < 1.0 rule), anything else makes it older.
The rewrite is character-wise rather than a chunk pre-pass, because the
glued-or-separated distinction cannot be made after the separators have been
thrown away. Rule 3 is the kind of thing nobody can be confident about from the
spec alone, which is exactly what the oracle is for; it is skipped with a note
when pacman is not installed, and the curated table — every pair of which was
also checked against the binary — always runs.
Also: the recipe parser's epoch is now exercised end to end (an epoch added to a
PKGBUILD must land on the candidate, and 1:0.9-1 must beat 1.0-1 rather than
read as a downgrade), and the downgrade path asserts the index keeps serving the
higher version, since a downgrade is a human decision and not an automatic
rebuild.
161 tests pass, clippy clean.
Diffstat (limited to '.pi/goals/goal_events.jsonl')
| -rw-r--r-- | .pi/goals/goal_events.jsonl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/.pi/goals/goal_events.jsonl b/.pi/goals/goal_events.jsonl index 1dedff7..42f2b5a 100644 --- a/.pi/goals/goal_events.jsonl +++ b/.pi/goals/goal_events.jsonl @@ -39,3 +39,5 @@ {"type":"task_started","goalId":"mwl5tehk-xhe7fk","taskId":"task-p4-world","at":"2026-11-18T09:04:51.588Z"} {"type":"task_complete","goalId":"mwl5tehk-xhe7fk","taskId":"task-p4-world","evidence":"src/pkginfo.rs is now the production home for tar+text parsing (no libalpm); shims delegate to it and steps.rs uses it. tests/world.rs (5 tests) builds real .pkg.tar.zst archives and asserts: pkginfo ","at":"2026-11-18T09:12:33.748Z"} {"type":"task_started","goalId":"mwl5tehk-xhe7fk","taskId":"task-p4-stale","at":"2026-11-18T09:14:30.194Z"} +{"type":"task_complete","goalId":"mwl5tehk-xhe7fk","taskId":"task-p4-stale","evidence":"tests/staleness.rs (6 tests): staleness_is_derived_on_read_and_nothing_stores_it (a sqlite_master/pragma_table_info scan asserts NO column anywhere stores staleness, and withdrawing a dependency flips","at":"2026-11-18T09:27:24.780Z"} +{"type":"task_started","goalId":"mwl5tehk-xhe7fk","taskId":"task-p4-deps","at":"2026-11-18T09:29:34.423Z"} |
