Skip to content

fix(install): retain rollback payloads with recoverable publication - #287

Merged
lg2m merged 7 commits into
mainfrom
fix/qq-retained-installs-v0.1.6
Oct 16, 2026
Merged

lg2m merged 7 commits into
mainfrom
fix/qq-retained-installs-v0.1.6

Conversation

@integrate-your-mind

@integrate-your-mind integrate-your-mind commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Take over this existing PR as a focused installer reliability change targeting main. Preserve installed executable bytes for rollback and make interrupted payload publication recoverable. This supersedes the earlier preservation checkpoint; it does not import the auth, runtime, or diagnostic changes from #299.

What changed

  • Retain executables under .qq-versions/qq-<sha256> and select the installed version through a relative qq symlink.
  • Copy and checksum-verify a legacy regular executable before replacing its selection, preserving its bytes for rollback.
  • Stage complete mode-0555 executables on the destination filesystem and publish with no-clobber rename instead of hardlink/unlink. A killed installer leaves staging or a complete reusable payload, not a permanent second-hardlink failure.
  • Validate existing payload type, checksum, single-link identity, and read-only permissions. Refuse foreign/dangling selectors, special nodes, corrupt or writable retained payloads, and multiply hardlinked executables without modifying existing bytes or permissions.
  • Document upgrades, rollback, forward-only store compatibility, manual cleanup, and recovery limits. No automatic pruning or stale-stage sweeping.
  • Add committed migration/update/reuse/rollback, refusal, permission, and four deterministic SIGKILL publication/recovery regression cases.

Verification

  • sh -n install.sh and git diff --check: passed.
  • bash tests/install_sh.sh: passed; covers legacy migration, retained reuse, rollback, unsafe-target refusals, and interruption before/after both legacy and requested payload publication. Parent independently ran the installer suite; the implementation agent reran it after the permission fix.
  • Writable-retained-payload regression failed before the permission fix and passed afterward, preserving bytes, mode, and selector on refusal.
  • cargo xtask smoke: implementation agent reports 6 passed, 0 failed.
  • Independent static review approved after the retained-permission correction.
cargo xtask check

Head b456fd20b14a vs origin/main; 4 changed file(s); scope: qq, xtask.

Gate Result Tests Time Command
fmt pass 1.4s cargo fmt --all -- --check
lint pass 1.8s cargo xtask lint
clippy pass 2.0s cargo clippy --color never -p qq -p xtask --all-targets --all-features -- -D warnings
test pass 395/395 passed, 2 skipped 31.8s cargo nextest run --color never --profile default -p qq -p xtask

All gates passed in 37.0s.

Outstanding qualification

  • Native macOS installer execution remains unverified on this Linux host.
  • Additional full-workspace check on the same installer implementation passed 2,469/2,471 tests; existing qq-core edit-approval and text-only-delegation tests timed out. Both passed narrow reruns. This is not a full-green result; no unrelated tests were weakened. The affected-package check above passed on the final head.
  • Not claiming merge readiness until outstanding qualification is resolved.

Compatibility and limits

No runtime, dependency, protocol, descriptor, or store-schema changes relative to the implementation baseline. Stop clients/servers before upgrades; retained executables do not reverse store migrations. This is not a macOS signing/Keychain authorization fix, arbitrary same-user race protection, or an fsync/power-loss durability guarantee. Disk usage grows with retained payloads; cleanup is explicit and manual.

Original PR history is preserved; takeover updates were pushed without force. The PR now targets main and contains four changed files.

Retain credential coalescing, typed review diagnostics and remaining tool allowances for the protocol 31 compatibility line.
Preserve legacy rollback bytes, verify read-only single-link payloads and reject unexpected selectors before atomically choosing a version.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T00:39:09.317452Z b456fd2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c886ee1095

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install.sh Outdated
install_stage="$(mktemp -d "$INSTALL_DIR/.qq-install.XXXXXX")" \
|| fail "cannot stage an installation in $INSTALL_DIR"

retain_binary() (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add a committed migration regression test

This bug fix adds legacy migration, retained-payload validation, and rollback selection, but tests/install_sh.sh is unchanged and only exercises clean installations; a repo-wide search found no committed fixture covering upgrades, foreign selectors, corrupt payloads, or rollback. The external macOS fixture described in the commit cannot protect CI from regressions, so extend the repository test suite with these public failure and recovery paths.

AGENTS.md reference: AGENTS.md:L146-L150

Useful? React with 👍 / 👎.

Comment thread install.sh Outdated
Comment on lines +184 to +185
ln "$install_stage/payload" "$retained_binary" 2>/dev/null || true
rm -f "$install_stage/payload" || fail "cannot remove the temporary publication link"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recover interrupted hard-link publications

If the installer is killed or the host loses power after ln publishes the retained payload but before the following rm, the staging payload remains as a second hard link. Every later run then rejects that retained executable because its link count is two, while cleanup only knows the new run's staging directory, leaving upgrades blocked until manual repair. Publish without this crash window or recover installer-owned stale staging links before enforcing the single-link invariant.

AGENTS.md reference: AGENTS.md:L81-L84

Useful? React with 👍 / 👎.

@integrate-your-mind
integrate-your-mind marked this pull request as draft October 13, 2026 17:42
@integrate-your-mind integrate-your-mind changed the title fix(installer): retain executable payloads before selection WIP: preserve retained QQ installation and rollback Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Misa — execution-backed review of exact head f267641 (head reconfirmed October 15).

This is substantive installer work: retained immutable payload selection supports legacy migration, upgrades and rollback. It is not yet crash-recovery qualified.

Executed earlier on my isolated Linux x86_64 workspace at this unchanged head: the committed installer suite passed 17 checks; independent legacy migration, upgrade and rollback checks passed. The real unmodified installer performed real filesystem operations, using local release archives/checksums and harmless shell executable fixtures, not a compiled QQ binary.

Confirmed failure: pause immediately after the real hard-link publication in install.sh:184–190, then SIGKILL the isolated installer process group before staging-link removal. The retained payload remains at link count 2. An ordinary uninstrumented retry exits 1 with 'multiple hard links ... nothing was selected'. The prior selected executable remains usable. Neighboring kill boundaries and SIGTERM recover; concurrent same-version installation can transiently hit the same refusal. This corroborates the existing review finding with execution, rather than adding a duplicate defect.

Acceptance still needed: safe recoverable publication without weakening hash/type/single-link validation; committed migration/rollback/interruption/concurrency regressions; Linux and macOS qualification, including actual QQ/Keychain behavior. The full QQ build could not start because Cargo is absent in this review environment. Existing suites were not rerun unchanged today.

Disposition: needs fixes. This is a bounded installer review, not whole-application verification, merge approval or deployment acceptance. install.sh blob 393ce7c3a25dd3a3230bec3af872ced824da5199 is also present in the previously inspected #299; preserve authorship and reconcile overlap before duplicating a fix.

@lg2m
lg2m marked this pull request as ready for review October 16, 2026 00:25
lg2m added 3 commits October 15, 2026 17:30
Preserve the original PR history while selecting the independently implemented current-main tree. Supersedes the old installer implementation and excludes unrelated unmerged compatibility ancestry. No force push.
@lg2m
lg2m changed the base branch from fix/qq-v0.1.6-recovery-base to main October 16, 2026 01:15
@lg2m lg2m changed the title WIP: preserve retained QQ installation and rollback fix(install): retain rollback payloads with recoverable publication Oct 16, 2026
@lg2m
lg2m merged commit 9e01050 into main Oct 16, 2026
8 checks passed
@lg2m
lg2m deleted the fix/qq-retained-installs-v0.1.6 branch October 16, 2026 01:18
lg2m added a commit that referenced this pull request Oct 16, 2026
* feat(jev): sync protocol and transport provenance [skip ci]

* feat(jev): sync cross-host contract boundary

* fix(jev): validate shared nullable usage

* fix(jev): retain approval response provenance

* fix(jev): update approval provenance fixture

* fix(jev): retain checkpoint response provenance

* chore(jev): refresh sleep lint coordinates

* docs(jev): record canonical temp verification

* docs: record final Jev verification and platform limits

* test(qq-core): stabilize shell duration deadline fixture

* fix(jev): retain transport request provenance [skip ci]

* fix(jev): reject reflected credential IDs [skip ci]

* docs(jev): record live transport provenance [skip ci]

---------

Co-authored-by: openclaw-consensus-bot <[email protected]>

* test(core): stabilize delegation audit fixtures (ENG-1028)

AF6.2: baseline a_text_only_slice_report_is_never_audited_or_treated_as_the_answer retried after its inner deadline. Preserve assertions and nextest hang guard; use paused clock for deadlines and native writes for compaction. Mutation audit records remaining descendant-bound coverage gaps.

* fix(install): retain rollback payloads with recoverable publication (#287)

* fix(runtime): preserve protocol 31 recovery baseline

Retain credential coalescing, typed review diagnostics and remaining tool allowances for the protocol 31 compatibility line.

* fix(installer): retain executable payloads before selection

Preserve legacy rollback bytes, verify read-only single-link payloads and reject unexpected selectors before atomically choosing a version.

* WIP: preserve deterministic fixtures and advisory journal ownership

* fix(install): retain rollback payloads with recoverable publication

* docs(install): record takeover of existing PR 287

---------

Co-authored-by: openclaw-consensus-bot <[email protected]>
Co-authored-by: Zachary Meyer <[email protected]>

* docs(plans): consolidate remaining work and retire stale plans (#323)

* docs(plans): consolidate remaining work and retire stale plans

* docs(plans): preserve review acceptance and successor status

* docs(plans): retain retention and MCP response safety gates

* test(core): keep frozen-clock setup watchdog live

* Revert "feat(jev): sync protocol and transport provenance [skip ci]"

This reverts commit 60dd03d.

* test(core): guard frozen post-preflight collection with live watchdog

---------

Co-authored-by: Romy Mondello <[email protected]>
Co-authored-by: openclaw-consensus-bot <[email protected]>
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.

3 participants