Fix Device Core mount-order fingerprints with exact r5 recovery
This commit is contained in:
@@ -94,9 +94,10 @@ successful CI run become the next normal-release candidate.
|
||||
## Read-only diagnosis after rejected reconciliation
|
||||
|
||||
Reconciliation001 stopped in plan on the saved Core runtime configuration hash.
|
||||
No apply ran. This does not prove either harmless ordering or actual drift. The
|
||||
original backup stores only an aggregate hash, and the legacy snapshot retains
|
||||
HostConfig.Binds/Mounts order. Existing acceptance is deliberately unchanged.
|
||||
No apply ran. The initial rejection alone did not prove harmless ordering or
|
||||
actual drift. The original backup stores only an aggregate hash, and the legacy
|
||||
snapshot retains HostConfig.Binds/Mounts order. The diagnostic kept acceptance
|
||||
unchanged.
|
||||
|
||||
`build_drift_audit.py` creates a separate `device-core-release-drift-audit` bundle.
|
||||
Its only entry is `deployment/device-core-release-r5-drift-audit-v1.json`.
|
||||
@@ -113,3 +114,43 @@ NetworkMode is reported as a difference, never accepted as harmless. Exhaustion,
|
||||
changing samples or no match remains unresolved. No diagnostic result creates a
|
||||
reconciliation marker or bypasses the original acceptance barriers. A subsequent
|
||||
recovery decision requires the actual NAS report.
|
||||
|
||||
|
||||
## Proven mount-order recovery and runtime fingerprint v2
|
||||
|
||||
The NAS audit on 2026-09-29 found an exact old hash preimage for Core and Manager
|
||||
by reordering only `HostConfig.Mounts` (7 and 3 entries). All three observations
|
||||
were stable; image IDs, source, topology, health, runtime boundaries and preserved
|
||||
services matched. The audit output SHA is
|
||||
`cf687c8bf550fa8c7d1125a3297e04c3d0d81a704b1d6ad17dbddc66470a1189`.
|
||||
This evidence does not itself create a canonical recovery receipt.
|
||||
|
||||
The recurring release domain now records `runtimeFingerprintVersion: 2` in new
|
||||
before snapshots. Version 2 sorts complete `HostConfig.Mounts` objects, requiring
|
||||
unique absolute normalized Target paths, and preserves every value and option.
|
||||
Binds and NetworkMode are unchanged. Old snapshots without a version retain the
|
||||
legacy comparison; generic Compose and historical transition guards are unchanged.
|
||||
Docker 24.0.2 registers mount points by unique destination, independently of this
|
||||
input list order: <https://github.com/moby/moby/blob/v24.0.2/daemon/volumes.go>.
|
||||
|
||||
Build the NEW data-only recovery package with:
|
||||
|
||||
```sh
|
||||
python3 infra/device-core-deploy/build_reconciliation.py --version 2 --output-dir /tmp/recovery-v2
|
||||
```
|
||||
|
||||
The fixed identity is `device-core-release-r5-reconciliation-v2-20260929-002`, with
|
||||
only `deployment/device-core-release-r5-reconciliation-v2.json`. Version 1 remains
|
||||
strict and byte-identical. V2 proves the old digest with at most 5,041 candidates
|
||||
per service by permuting only existing HostConfig.Mounts (at most seven); it never
|
||||
uses the broader diagnostic probe. Three identical observations, old images and
|
||||
exact preserved service rows are required. After proving equivalence it derives a
|
||||
v2 baseline and rechecks every existing acceptance guard. Plan, locked preflight
|
||||
and post-copy acceptance all repeat this proof. Conflicting v1/v2 markers fail.
|
||||
|
||||
Apply only writes the marker, backup and canonical journal. Original incident
|
||||
files and the failed receipt remain unchanged. Marker plus unique applied receipt,
|
||||
archive digest/identity and original evidence are required to acknowledge r5.
|
||||
A failure removes only the marker. This package performs no application deployment
|
||||
and does not activate automatic deployment. Live plan/apply are still required;
|
||||
the old r5 artifact and the rejected v1 reconciliation must not be replayed.
|
||||
|
||||
@@ -12,13 +12,16 @@ ROOT = Path(__file__).resolve().parent
|
||||
ENTRY = 'deployment/device-core-release-r5-reconciliation-v1.json'
|
||||
|
||||
|
||||
def bundle():
|
||||
descriptor = (ROOT / 'r5-reconciliation-v1.json').read_bytes()
|
||||
def bundle(version=1):
|
||||
if version not in (1, 2):
|
||||
raise ValueError("unsupported reconciliation version")
|
||||
entry = ENTRY if version == 1 else ENTRY.replace("-v1.json", "-v2.json")
|
||||
descriptor = (ROOT / ('r5-reconciliation-v'+str(version)+'.json')).read_bytes()
|
||||
identity = json.loads(descriptor)['releaseId']
|
||||
members = {
|
||||
'manifest.env': ('id='+identity+'\ncomponent=device-core-release-reconciliation\ntype=app-overlay\n').encode(),
|
||||
'files.txt': (ENTRY+'\n').encode(),
|
||||
'payload/'+ENTRY: descriptor,
|
||||
'files.txt': (entry+'\n').encode(),
|
||||
'payload/'+entry: descriptor,
|
||||
}
|
||||
output=io.BytesIO()
|
||||
with gzip.GzipFile(fileobj=output, mode='wb', mtime=0, filename='') as compressed:
|
||||
@@ -31,8 +34,9 @@ def bundle():
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--version', type=int, choices=(1, 2), default=1)
|
||||
parser.add_argument('--output-dir',required=True,type=Path)
|
||||
args=parser.parse_args();args.output_dir.mkdir(parents=True,exist_ok=True)
|
||||
identity,data=bundle();path=args.output_dir/('nodedc-'+identity+'.tgz')
|
||||
identity,data=bundle(args.version);path=args.output_dir/('nodedc-'+identity+'.tgz')
|
||||
with path.open('xb') as stream:stream.write(data)
|
||||
print(json.dumps({'artifact':str(path),'sha256':hashlib.sha256(data).hexdigest(),'id':identity}))
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"backupId": "device-core-release-device-core-release-v1-r5-67b2ae586399eb1eb7d3a6c074a292e0dbb7b406-20260929-190019",
|
||||
"failedReleaseId": "device-core-release-v1-r5-67b2ae586399eb1eb7d3a6c074a292e0dbb7b406",
|
||||
"failedSha256": "b8dd1384f499d1173ce7d95dc1f2433a404290f443bd612816ad9136ccbf9347",
|
||||
"mode": "prove-restored-baseline-mount-order-only",
|
||||
"releaseId": "device-core-release-r5-reconciliation-v2-20260929-002",
|
||||
"runtimeFingerprintVersion": 2,
|
||||
"schemaVersion": "nodedc.device-core.release-reconciliation.v2"
|
||||
}
|
||||
Reference in New Issue
Block a user