Repository navigation
fix(updates): accept real apt-get -s rows and keep the refusal reason in the journal - #407
Merged
Merged
Conversation
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix capable-image APT discovery and pinned installation rechecks against real
apt output, without changing eligible origins, holds or removal policy.
annotation names never become install targets. Retain the unchanged Orange Pi
nginx capture as the primary regression fixture.
and simulation banner as prose. Validate action rows strictly; malformed rows,
duplicate installs, broken configure output and removal/purge plans still refuse.
Solving dependencies...when an exit-zero pinned install simulationuses apt 3.0's fallback solver. The product correction adds only that operation
label beside
Calculating upgradein the shared exact progress skip.validation. This fixes the older punctuation-order mismatch that could refuse
libconfig++11/libconfig-docand similar library sets after download.LC_ALL=C,LANG=CandLANGUAGEunset, preservinginherited environment variables (now asserted with a real-child sentinel).
pinned-rechecksteps/dedupe identities. Hold-command failures are simulationfailures, not parser failures. Keep the 300-unit surrogate-safe display cut.
Why
The read-only 2026-10-22 Orange Pi capture exposed a shipped discovery failure on
ordinary nginx security updates. Independent review then found the first fix
also mistook apt-get's own weak-dependency headings for action rows, blocking
install rechecks whenever an upgrade introduced a package with weak dependencies.
Review also found a second regression:
Solving dependencies...was routed asa malformed row, preventing installs solvable by apt's fallback solver. These
are fail-closed availability bugs, not permission to install more packages.
Producer references: apt 3.0.3 commit
45bebdfb891535d15e66e860aab1ee7c7b2ecaab,pkgSimulate/ ShortBreaks,RelStr,and
ShowWeakDependencies/ DoInstall.Successful non-TTY stdout progress coverage
All source links use the immutable apt commit above. Each label is tested before
a valid row through actual discovery and pinned recheck, both
...and... Doneforms. Every label also precedes a genuinely malformedInstnegative.OpTextProgress:186–194
writes the operation plus
...to stdout. No other reachable stdout progresslabel was identified by the reviewer's source census for these commands.
Correcting dependencies...needs FixBroken (private-cachefile.cc:89–107);the product never passes
-f/--fix-broken. This is not a general prose allowlist.Existing test assertions changed, explicitly
The four previously reviewed changed lines are:
apt-all-inst-annotation.test.ts: remove only[libcurl4t64 ]from themalformed-suffix table. Apt's source and the unchanged capture disprove that
negative belief. The same form is now positive in discovery and pinned
recheck; all genuinely malformed cases remain.
trailing-space cases. The original three entries are unchanged.
apt-all-diagnostic-dedupe.test.ts: change the displayed detail expectationfrom 500 to 300
echaracters, tightening the required journal bound.The 520-character input, changed-tail and identical-repeat assertions remain.
Round 3 also changes these existing expectations/fixtures to implement review:
apt-all-row-grammar.test.ts: use the distinct valid namecontextbesidemalformed rows, so duplicate detection cannot mask invalid grammar. Round 3
inadvertently left the pinned expectation at
libc6:arm64, making that halfvacuous through a pair mismatch. Round 4 corrects it to the actual valid
[{ name: "context", version: "1" }]companion. The refusal reason remainsdiscovery_failed; T1/T2 now fail specifically when pinned malformed/unknownrows are skipped. Purge-reason and unknown-verb cases are additive.
apt-all-inst-annotation.test.ts: parameterize the malformed-case step byentry point: discovery remains
parse-simulation, pinned parsing is nowpinned-recheck. Every case still asserts the error class, same reason andsame sanitized offending row.
apt-all-diagnostic-text.test.ts: pinned removal still requiresremovals_required; its exact step changes fromparse-simulationtopinned-recheck, and the test title follows that provenance change.apt-all-journal.test.ts: the failed hold command's expected stage changesfrom
parsetosimulation; bounded/redacted production-JSON assertions remain.apt-all-command-locale.test.ts(introduced in this PR): the exact expectedreal-child environment additionally requires an inherited sentinel. The three
existing locale expectations remain; setup/teardown preserve the sentinel's
original presence/value. P3d now fails if the runner drops
...process.env.No test file or test function was deleted or skipped; the only removed table case is item 1's
[libcurl4t64 ], which moved to the positive table. A pinned-table coverage weakening introduced earlier in this PR is repaired above, not claimed never to have happened. Changes againstmain's existing tests are the annotation-table correction/reflow and per-path
step, the stricter dedupe bound/comment, and the pinned-removal step/title.
Other listed adjustments concern tests newly introduced within this PR.
Round 4 adds regressions; it changes no other pre-existing assertion.
How verified locally
tech-debt, agents budget and diff whitespace gates pass.
2026102201 and 987654321.
BUILD_ARCH=arm64andBUILD_ARCH=amd64backend builds pass; their ELFmachine types are checked independently.
outcomes and zero security violations. Conservative malformed-note refusals
remain stricter than the reference recognizer. Security seeds 7 and 8 each
complete 338 targeted attacks, 50,000 soup cases and argv probes with zero failures.
A1/F1 set accepts all seven, with
refused-or-wrong=0/7. Its actual product-boundaryrecheck proceeds to independent space preflight, where the host lacks apt-get;
it no longer ends in parser
failed/discovery_failed. This is not an install.set. The locale test observes real child environments at both simulation ports.
startSoftwareUpdatepath. The new persistent boundary test requires theindependent space port to be called and the exact
update_preflight_failedstate, not just a dispatch acknowledgement or presence of install argv.
all temporary mutations are restored before the final gates.
out on the final boundary test; a fresh
typescript-language-serversessionreturns empty syntax, semantic and suggestion diagnostics through its documented
typescript.tsserverRequestLSP command. Strict test tsc is also clean.round4-gate-*andround4-gates-summary.log(
failed=0, after the last repo edit). Normal hooks preserve identical verifiedbytes; no successful gate campaign was repeated.
Limits
APT's human display is not an escaped machine protocol: conservative malformed
release-display refusals remain. The 54-literal census includes seven action
tokens, which remain negative cases, and 47 prose/debug/diagnostic strings; it
does not make failed command exits acceptable. The install-shaped weak-dependency
fixture reuses real prose with reviewer plan identities, not a second board capture.
The discovery and install re-check fixes run only when the device image declares
apt-all-packages(capable mode); no released image does yet. The C-locale childenvironment and the CRLF normalisation of the kept-back list also reach the legacy
path; CeraLive images already pin
C.UTF-8with no translation catalogs, so theychange nothing visible there. No installed-board success is claimed here. The first-party-held policy refusal still shares the hold command's
simulationjournal stage; splitting it is not a one-line change and is left as afollow-up.