Skip to content

rollback --json counters count only the agent leg, so hosted and vendored failures report failed: 0 #1066

Description

[agent] Filed by the October 7 architecture audit campaign (core). Register: arch-audit register.

Kind: bug. Source: audit B75 (new finding), register C73.

Problem: rollback --json computes rolledBack, alreadyOriginal and failed from the agent leg's results only (rollback.rs#L1735-L1743); hosted and vendored outcomes go only into hosted.{reverted,failed} and vendored*. On a hosted-pinned project, rollback --dry-run --offline --json prints "status":"partial_failure","rolledBack":0,"failed":0 with the only (refused) pin under hosted.failed. remove counts hosted in summary.removed.

Impact: hosted is the v5 default, so scripts reading failed == 0 get a wrong answer for most projects, and partial_failure also means total failure.

Proposed change: count every leg in the top-level counters and emit an error status when no leg succeeded; document that the counters span all legs. The envelope shape itself is #704 (decided) / #1027.

Acceptance criteria:

  • Hosted and vendored rollback tests assert the counters.
  • CLI_CONTRACT documents the counters.

Dependencies: coordinate with #1027.


Generated by Claude Code

Activity

  1. added
    bugSomething isn't working
    arch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)
    on Oct 7, 2026
  2. mikolalysenko commented on Oct 7, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Triage: priority:p3 (general CLI). Not covered by #1027 (envelope shape only), which this should coordinate with. No duplicate found.


    Generated by Claude Code

  3. mikolalysenko commented on Oct 8, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Re-checked on main @ 830749f: still holds. The code has moved:

    • rolledBack, alreadyOriginal and failed are still counted from the agent leg's results only: rollback.rs#L1567-L1574.``
    • Hosted outcomes go only into hosted.{reverted,failed}, and vendored ones only into vendored*: rollback.rs#L1590-L1633.``

    PR #1027 (the envelope) is still open, so the dependency is unchanged.


    Generated by Claude Code

  4. mikolalysenko commented on Oct 9, 2026

    @mikolalysenko
    CollaboratorAuthor

    [agent] Re-checked on main @ a80b89e: the bug still holds, and the code has moved. rolledBack, alreadyOriginal and failed are still counted from the agent leg's results only (rollback.rs#L1581-L1589). `status` uses every leg ([`#L1574-L1580`](https://github.com/SocketDev/socket-patch/blob/a80b89e050f231bf3ebad5cbfc67aff5427a047c/crates/socket-patch-cli/src/commands/rollback.rs#L1574-L1580)),`` and the counters are printed at #L1606-L1610.`` #1257 tracks related counter and contract drift in the GC report.


    Generated by Claude Code

  5. added
    v5-blockerMust resolve before v5: public interface/migration or ordinary patch-install-undo failure.
    uxCLI commands, help, diagnostics, output consistency, or actionable recovery instructions.
    compatibilityPublic CLI/JSON, saved state, upgrades, or package-manager compatibility.
    and removed on Oct 9, 2026
  6. mikolalysenko commented on Oct 9, 2026

    @mikolalysenko
    CollaboratorAuthor

    v5 release blocker (P1). Hosted is the v5 default; rollback JSON must count hosted/vendored failures at the top level. PR #1273 is pending.

    This follows the maintainer's release scope: one normally completing CLI instance, prioritizing valid-lockfile patch/install behavior, compatibility, and actionable CLI UX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)bugSomething isn't workingcompatibilityPublic CLI/JSON, saved state, upgrades, or package-manager compatibility.priority:p1uxCLI commands, help, diagnostics, output consistency, or actionable recovery instructions.v5-blockerMust resolve before v5: public interface/migration or ordinary patch-install-undo failure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions