fix: reconcile configured APT effect without retroactive acceptance and retain host reboot evidence
Rust development slice / linux (push) Failing after 6s

This commit is contained in:
2026-11-13 20:00:20 +01:00
parent 34d695a778
commit b08734065a
26 changed files with 2006 additions and 36 deletions
+53
View File
@@ -1,5 +1,58 @@
# Typed RootHelper bridge contract (implementation, not native acceptance)
## Host reboot evidence and historical configured effect (Spec 1.13)
An ambient `reboot_required=true` is honest pending evidence, not an implicit
reboot request or a failed package postcondition. Future fixture effects must
prove equal HOST flags before/after, unchanged boot and no private-worker flag.
The parent captures `active/host-reboot-before.json` **before unshare/private
`/run`**. Schema 1 fields are `transaction_sha256`, `job_payload_sha256`,
`effect_armed_ledger_id`, `grant_id`, `boot_id`, `host_reboot_required` (bool),
and `observed_at_ms`, plus `schema_version`. Creation is exclusive and fsynced;
its observation must belong to the original grant window. New native prechecks
use schema 2, retaining the old exact checks and adding
`host_reboot_before_sha256` and `host_reboot_required_before`. The child binds the
saved host observation; its private `/run` never measures the host flag.
After real APT success the parent verifies the current host flag equals the
saved value, boot is unchanged and `sandbox-result.reboot_required` is false.
False/false and true/true are valid; either change or a private-worker flag
vetoes acceptance. Outcome evidence includes `host_reboot_required_before`,
`host_reboot_required_after`, `host_reboot_before_sha256`,
`reboot_required_introduced:false`; `reboot_required` truthfully retains ambient
true. Ordinary acceptance record **schema 3** explicitly binds those fields and
`native_prechecks_schema_version:2`. The reader rejects old record schemas or
inconsistent values. Separate future recovery records use schema 2 and retain
their distinct `rmm.apt.native-recovery` type. Noop observations remain effect-free
and report their actual current reboot flag. Fresh planning adds the required
public bool `host_reboot_required`; known ambient true is shown in the fixed
WebUI plan reason.
Historical grant `33775478-15b0-46ec-b059-44f500dbb0b6` had **no host-before
sample**. It must never acquire retroactive success or an acceptance record.
Fixed mode `verify-configured-recovery` receives the same eight original binding
fields as `verify-partial`. Only its signed schema-4 configure-only job, old
provider `5ff260…`, old schema-1 prechecks, original partial grant `31ef5e5e…` /
proof `dc3bf387…`, preserved recovery once marker, exact Configure hook, APT exit
0 and private-worker false are eligible. It checks complete stable installed
1.0 state, clean audit, actual payload, unchanged boot, idle locks and current
host marker contents twice, rechecking all thirteen immutable witnesses.
Output is `known_failed` /
`APT_RECOVERY_CONFIGURED_ACCEPTANCE_REBOOT_FLAG_VERIFIED`. Its 24-field proof
contains the original eight bindings, type/schema, original evidence digest,
partial proof hash, original baseline and current snapshot hashes/fingerprint,
payload hash, full snapshot, check time, `effect_complete:true`,
`partial_effect:false`, `postconditions_passed:false`, `reboot_required:true`,
`host_reboot_required:true` and `host_reboot_marker_sha256`. No ctime-based
inference becomes a before measurement. It writes nothing and runs no package
mutation. Rust independently verifies the saved signature/old unknown code,
appends a separate immutable proof, and leaves consumption locked until normal
signed RootSync. Native classification and future 1.1 acceptance remain pending
until actually executed; **81 local Python tests passed**, including both actual
APT argument regressions under the readonly unprivileged offline container.
## Configure-only partial recovery (schema 4, local implementation)
This is a **new, separately WebUI-approved** dev-test native action. Schema 4