Skip to main content

Module patch_memory

Module patch_memory 

Source
Expand description

Verified-patch memory — the substrate for fleet patch sharing.

When the autonomous repair loop (crate::solve) makes a failing target go green, the verified fix can be recorded here, exported to peers (signed), and merged from peers. The point: a fix one node discovers becomes shared coding skill across the fleet.

§Safety invariant (the whole design rests on this)

A patch received from a peer is NEVER applied on trust. It is only ever written through PatchMemory::try_candidates, which writes the candidate, runs this node’s own verify check, and keeps the patch only if it goes green locally — otherwise it is rolled back byte-for-byte. So an incorrect or malicious peer patch cannot harm a node: it simply fails local verification and is discarded. Provenance (crate::provenance: SHA-256 + optional HMAC via AXIOM_FLEET_KEY) additionally gates which exports are even considered, and verified_count records how many independent nodes have confirmed a patch green (a trust signal for ranking, never for blind apply).

Structs§

FleetTrustPolicy
Byzantine-robustness policy for folding in a peer’s patch export.
PatchCandidate
One verified candidate fix for a given failure fingerprint.
PatchMemory
A fleet-shareable store of verified patches, keyed by failure fingerprint (heal_memory::fingerprint(command, args)).
PatchMergeReport
Summary of a peer merge.