Add plan-only Device Core runtime drift audit without changing acceptance
This commit is contained in:
@@ -90,3 +90,26 @@ receipt + original incident evidence. Other rollback failures remain blocked.
|
||||
The r5 archive must never be replayed. Reconciliation does not install a release
|
||||
or activate automatic deployment. Only after its live acceptance may a NEW
|
||||
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.
|
||||
|
||||
`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`.
|
||||
Only canonical `plan` can execute this diagnostic; `apply` refuses before any
|
||||
application/backup action. It proves original incident evidence and reports all
|
||||
five service image/hash comparisons over three observations, source/Compose,
|
||||
health, secret/mount/network boundaries and unrelated Compose preservation.
|
||||
No raw inspect, environment values or secrets are printed.
|
||||
|
||||
The diagnostic searches at most 20,000 exact legacy hash candidates, changing only
|
||||
the order of observed HostConfig.Binds/Mounts (up to eight each) and NetworkMode
|
||||
among attached network names. It preserves every other value. A matching old
|
||||
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.
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build the exact plan-only r5 drift audit; apply is forbidden."""
|
||||
import argparse
|
||||
import gzip
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import tarfile
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
ENTRY = 'deployment/device-core-release-r5-drift-audit-v1.json'
|
||||
|
||||
|
||||
def bundle():
|
||||
descriptor = (ROOT / 'r5-drift-audit-v1.json').read_bytes()
|
||||
identity = json.loads(descriptor)['auditId']
|
||||
members = {
|
||||
'manifest.env': ('id='+identity+'\ncomponent=device-core-release-drift-audit\ntype=app-overlay\n').encode(),
|
||||
'files.txt': (ENTRY+'\n').encode(),
|
||||
'payload/'+ENTRY: descriptor,
|
||||
}
|
||||
output=io.BytesIO()
|
||||
with gzip.GzipFile(fileobj=output, mode='wb', mtime=0, filename='') as compressed:
|
||||
with tarfile.open(fileobj=compressed, mode='w') as archive:
|
||||
for name,data in sorted(members.items()):
|
||||
info=tarfile.TarInfo(name);info.mode=0o644;info.size=len(data)
|
||||
archive.addfile(info,io.BytesIO(data))
|
||||
return identity,output.getvalue()
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
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')
|
||||
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,8 @@
|
||||
{
|
||||
"schemaVersion": "nodedc.device-core.release-drift-audit.v1",
|
||||
"failedReleaseId": "device-core-release-v1-r5-67b2ae586399eb1eb7d3a6c074a292e0dbb7b406",
|
||||
"failedSha256": "b8dd1384f499d1173ce7d95dc1f2433a404290f443bd612816ad9136ccbf9347",
|
||||
"backupId": "device-core-release-device-core-release-v1-r5-67b2ae586399eb1eb7d3a6c074a292e0dbb7b406-20260929-190019",
|
||||
"mode": "read-only-plan;apply-forbidden",
|
||||
"auditId": "device-core-release-r5-drift-audit-v1-20260929-001"
|
||||
}
|
||||
Reference in New Issue
Block a user