Skip to content

fix(updates): accept real apt-get -s rows and keep the refusal reason in the journal - #407

Merged
andrescera merged 18 commits into
mainfrom
fix/apt-all-discovery-real-apt-output
Oct 22, 2026
Merged

andrescera merged 18 commits into
mainfrom
fix/apt-all-discovery-real-apt-output

Conversation

@andrescera

@andrescera andrescera commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What

Fix capable-image APT discovery and pinned installation rechecks against real
apt output, without changing eligible origins, holds or removal policy.

  • Parse apt's trailing-space temporary-break lists and reverse-dependency notes;
    annotation names never become install targets. Retain the unchanged Orange Pi
    nginx capture as the primary regression fixture.
  • Accept apt-get install's Suggested/Recommended, additional/NEW package lists
    and simulation banner as prose. Validate action rows strictly; malformed rows,
    duplicate installs, broken configure output and removal/purge plans still refuse.
  • Accept Solving dependencies... when an exit-zero pinned install simulation
    uses apt 3.0's fallback solver. The product correction adds only that operation
    label beside Calculating upgrade in the shared exact progress skip.
  • Use one code-unit comparator for discovery order and detached pinned-argv
    validation. This fixes the older punctuation-order mismatch that could refuse
    libconfig++11/libconfig-doc and similar library sets after download.
  • Run APT children with LC_ALL=C, LANG=C and LANGUAGE unset, preserving
    inherited environment variables (now asserted with a real-child sentinel).
  • Journal bounded, redacted refusal context, with distinct discovery and
    pinned-recheck steps/dedupe identities. Hold-command failures are simulation
    failures, not parser failures. Keep the 300-unit surrogate-safe display cut.
  • Retain the legacy CRLF package-list correction and the parser sweep coverage.

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 as
a 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
... Done forms. Every label also precedes a genuinely malformed Inst negative.

Operation Producer
Reading package lists pkgcachegen.cc:1884–1886
Building dependency tree depcache.cc:239–243
Reading state information depcache.cc:289–293
Calculating upgrade upgrade.cc:213–218
Solving dependencies edsp.cc:791–799; successful fallback private-install.cc:983–1035

OpTextProgress:186–194
writes the operation plus ... to stdout. No other reachable stdout progress
label 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:

  1. apt-all-inst-annotation.test.ts: remove only [libcurl4t64 ] from the
    malformed-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.
  2. The same file's positive table was reflowed from three entries to five, adding
    trailing-space cases. The original three entries are unchanged.
  3. apt-all-diagnostic-dedupe.test.ts: change the displayed detail expectation
    from 500 to 300 e characters, tightening the required journal bound.
    The 520-character input, changed-tail and identical-repeat assertions remain.
  4. Its associated Given comment changed; this is not an assertion.

Round 3 also changes these existing expectations/fixtures to implement review:

  • apt-all-row-grammar.test.ts: use the distinct valid name context beside
    malformed rows, so duplicate detection cannot mask invalid grammar. Round 3
    inadvertently left the pinned expectation at libc6:arm64, making that half
    vacuous through a pair mismatch. Round 4 corrects it to the actual valid
    [{ name: "context", version: "1" }] companion. The refusal reason remains
    discovery_failed; T1/T2 now fail specifically when pinned malformed/unknown
    rows are skipped. Purge-reason and unknown-verb cases are additive.
  • apt-all-inst-annotation.test.ts: parameterize the malformed-case step by
    entry point: discovery remains parse-simulation, pinned parsing is now
    pinned-recheck. Every case still asserts the error class, same reason and
    same sanitized offending row.
  • apt-all-diagnostic-text.test.ts: pinned removal still requires
    removals_required; its exact step changes from parse-simulation to
    pinned-recheck, and the test title follows that provenance change.
  • apt-all-journal.test.ts: the failed hold command's expected stage changes
    from parse to simulation; bounded/redacted production-JSON assertions remain.
  • apt-all-command-locale.test.ts (introduced in this PR): the exact expected
    real-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 against
main'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

  • Backend check/exec guard, strict test-project tsc, dot-free-path Biome,
    tech-debt, agents budget and diff whitespace gates pass.
  • Touched suites: 216 tests / 1,610 assertions, zero failures, on seeds 31337,
    2026102201 and 987654321.
  • Full backend: 10,819 pass, 8 existing skips, 0 fail, 1,015 files.
  • Both BUILD_ARCH=arm64 and BUILD_ARCH=amd64 backend builds pass; their ELF
    machine types are checked independently.
  • Reviewer fuzz: all five required seeds, 30,000 total cases, zero looser
    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.
  • Reviewer's F1 driver accepts all five forms; the round-3 driver's expanded
    A1/F1 set accepts all seven, with refused-or-wrong=0/7. Its actual product-boundary
    recheck 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.
  • The ordering regression checks all 380 ordered pairs from a generated 20-name
    set. The locale test observes real child environments at both simulation ports.
  • A1 is red first on bf39d3f in both the pinned parser and the actual
    startSoftwareUpdate path. The new persistent boundary test requires the
    independent space port to be called and the exact update_preflight_failed
    state, not just a dispatch acknowledgement or presence of install argv.
  • Mutants A1/T1/T2/P3d are killed with 3/6/4/1 assertion failures respectively;
    all temporary mutations are restored before the final gates.
  • Fresh tool diagnostics are clean on five changed TS files. The wrapper times
    out on the final boundary test; a fresh typescript-language-server session
    returns empty syntax, semantic and suggestion diagnostics through its documented
    typescript.tsserverRequest LSP command. Strict test tsc is also clean.
  • Result-of-record logs: round4-gate-* and round4-gates-summary.log
    (failed=0, after the last repo edit). Normal hooks preserve identical verified
    bytes; 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 child
environment and the CRLF normalisation of the kept-back list also reach the legacy
path; CeraLive images already pin C.UTF-8 with no translation catalogs, so they
change nothing visible there. No installed-board success is claimed here. The first-party-held policy refusal still shares the hold command's
simulation journal stage; splitting it is not a one-line change and is left as a
follow-up.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e0a2afd-47f0-4071-bc1d-8fbbdf77480b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@andrescera
andrescera merged commit 149751c into main Oct 22, 2026
18 checks passed
@andrescera
andrescera deleted the fix/apt-all-discovery-real-apt-output branch October 22, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant