Requalify closed APT runtime through preserved four-field metadata recovery
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -0,0 +1,206 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Requalify closed APT runtime after the same reboot has finished and closed.
|
||||||
|
|
||||||
|
Updates measurements only, using the existing copied-dpkg ExecStartPre probe.
|
||||||
|
No binary/provider replacement, package command, endpoint exposure or approval.
|
||||||
|
"""
|
||||||
|
import argparse
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
import cloud_reboot_capacity_upgrade as capacity
|
||||||
|
|
||||||
|
cloud=capacity.cloud
|
||||||
|
require=cloud.contract.require
|
||||||
|
|
||||||
|
|
||||||
|
def requalify(payload):
|
||||||
|
import contextlib
|
||||||
|
import fcntl
|
||||||
|
import sqlite3
|
||||||
|
import traceback
|
||||||
|
os.umask(0o077)
|
||||||
|
base=Path('/var/lib/rmm-apt-transaction');state=Path('/var/lib/rmm-agent-remote');root=Path('/var/lib/rmm-helper')
|
||||||
|
helper=Path('/usr/local/libexec/rmm-privileged-helper');agent=Path('/usr/local/libexec/rmm-agent-remote')
|
||||||
|
provider=Path('/usr/lib/rmm-apt-transaction/apt_transaction.py');config=Path('/etc/rmm/apt-helper.json')
|
||||||
|
proof=Path('/etc/rmm-remote/apt-helper-proof.json');metadata=base/'install-metadata.json';ready_file=base/'native-readiness.json'
|
||||||
|
general_config=Path('/etc/rmm-remote/helper-general.json');general_proof=Path('/etc/rmm-remote/general-helper-proof.json')
|
||||||
|
dropin=Path('/etc/systemd/system/rmm-agent-remote.service.d/30-cloud-root.conf')
|
||||||
|
def sha(raw):return hashlib.sha256(raw).hexdigest()
|
||||||
|
def canonical(value):return json.dumps(value,sort_keys=True,separators=(',',':'),ensure_ascii=True).encode()
|
||||||
|
def run(args,**kwargs):return subprocess.run(args,capture_output=True,check=True,timeout=30,**kwargs).stdout
|
||||||
|
def sync(path):
|
||||||
|
fd=os.open(path,os.O_RDONLY|os.O_DIRECTORY|os.O_NOFOLLOW)
|
||||||
|
try:os.fsync(fd)
|
||||||
|
finally:os.close(fd)
|
||||||
|
def create(path,raw,mode=0o600,gid=0):
|
||||||
|
fd=os.open(path,os.O_WRONLY|os.O_CREAT|os.O_EXCL|os.O_NOFOLLOW,mode)
|
||||||
|
with os.fdopen(fd,'wb') as f:f.write(raw);f.flush();os.fchown(f.fileno(),0,gid);os.fchmod(f.fileno(),mode);os.fsync(f.fileno())
|
||||||
|
sync(path.parent)
|
||||||
|
def manifest(path):
|
||||||
|
if not path.exists():return {'absent':True}
|
||||||
|
result={}
|
||||||
|
for p in [path,*sorted(path.rglob('*'))]:
|
||||||
|
s=p.lstat();require(not p.is_symlink() and (p.is_file() or p.is_dir()),'regular preserved tree')
|
||||||
|
result[str(p.relative_to(path))]=dict(device=s.st_dev,inode=s.st_ino,uid=s.st_uid,gid=s.st_gid,mode=s.st_mode,
|
||||||
|
sha256=sha(p.read_bytes()) if p.is_file() else None)
|
||||||
|
return result
|
||||||
|
def guard():
|
||||||
|
require(payload['session_id']=='d015c3ef-f3aa-4522-a3c2-fcb6099df17b' and len(payload['root_rows'])==18,'one finished original reboot and all18 Root rows')
|
||||||
|
require(json.loads((state/'identity.json').read_bytes())['agent_id']==payload['agent_id'] and
|
||||||
|
Path('/proc/sys/kernel/random/boot_id').read_text().strip()==payload['new_boot_id'],'same permanent device/newboot')
|
||||||
|
require(all(sha(p.read_bytes())==payload[k] for p,k in ((agent,'agent_sha256'),(helper,'helper_sha256'),(provider,'provider_sha256'))),'qualified binaries/provider unchanged')
|
||||||
|
require(sha(general_config.read_bytes())==payload['general_config_sha256'] and sha(general_proof.read_bytes())==payload['general_pin_sha256'] and
|
||||||
|
json.loads(general_config.read_bytes())['allow_reboot'] is False,'exact restored non-reboot General policy')
|
||||||
|
require('RMM_APT_HELPER_' not in dropin.read_text() and run(['systemctl','show','rmm-apt-helper.service','-p','ActiveState','--value']).strip()==b'inactive','APT remains unexposed/inactive')
|
||||||
|
ledger=root/'consumption.sqlite';s=ledger.stat();require([s.st_dev,s.st_ino]==payload['database_inodes'][str(ledger)],'original Root inode')
|
||||||
|
for name,inode in payload['database_inodes'].items():
|
||||||
|
s=Path(name).stat();require([s.st_dev,s.st_ino]==inode,'all original database inodes')
|
||||||
|
with contextlib.closing(sqlite3.connect(ledger.as_uri()+'?mode=ro',uri=True)) as db:
|
||||||
|
require(db.execute('PRAGMA integrity_check').fetchone()[0]=='ok' and
|
||||||
|
db.execute('SELECT count(*) FROM consumed WHERE result IS NULL').fetchone()[0]==0 and
|
||||||
|
db.execute('SELECT count(*) FROM helper_sync_meta WHERE fault IS NOT NULL').fetchone()[0]==0,'all Root effects definitively closed')
|
||||||
|
rows=db.execute('SELECT c.grant_id,c.agent,c.generation,c.job,c.attempt,c.result,e.start,e.outcome FROM consumed c LEFT JOIN execution_evidence e USING(grant_id) ORDER BY grant_id').fetchall()
|
||||||
|
actual={r[0]:sha(json.dumps([dict(sha256=sha(v),size=len(v)) if isinstance(v,bytes) else v for v in r],separators=(',',':')).encode()) for r in rows}
|
||||||
|
require(actual==payload['root_rows'],'all original closed Root rows unchanged')
|
||||||
|
strict_metadata={'schema_version','provider_sha256','hook_sha256','unit_sha256'}
|
||||||
|
def resume_inputs():
|
||||||
|
failed=payload['failed'];previous=Path(failed['backup'])
|
||||||
|
require(previous==Path('/var/lib/rmm-bootstrap-history/post-reboot-apt-readiness-dd358cdd-d60c-4e98-8f00-cea46d8347c3') and
|
||||||
|
json.loads((previous/'report.json').read_bytes())==failed and not failed['completed'] and failed['stage']=='repinned_preserved',
|
||||||
|
'exact retained failed qualification report; never repeat original maintenance')
|
||||||
|
require(all(Path(failed['backups'][str(p)])==previous/str(p).lstrip('/').replace('/','__') for p in (config,proof,metadata,ready_file)),
|
||||||
|
'fixed original versioned artifacts only')
|
||||||
|
expected=json.loads(Path(failed['backups'][str(config)]).read_bytes())
|
||||||
|
expected['apt_provider'].update(runtime_sha256=failed['runtime_sha256'],apt_config_sha256=failed['apt_config_sha256'])
|
||||||
|
require(config.read_bytes()==json.dumps(expected).encode() and proof.read_bytes()==json.dumps(failed['apt_pin']).encode(),
|
||||||
|
'correct config/proof bytes remain unchanged')
|
||||||
|
current_raw=metadata.read_bytes();original=Path(failed['backups'][str(metadata)]).read_bytes()
|
||||||
|
old=json.loads(original);current=json.loads(current_raw)
|
||||||
|
require(sha(current_raw)==payload['invalid_metadata_sha256'] and sha(original)==payload['original_metadata_sha256'] and
|
||||||
|
set(old)==strict_metadata and old['schema_version']==2 and old['provider_sha256']==payload['provider_sha256'] and
|
||||||
|
set(current)==strict_metadata|{'helper_sha256','runtime_sha256','apt_config_sha256'} and
|
||||||
|
all(current[k]==v for k,v in old.items()) and current['helper_sha256']==payload['helper_sha256'] and
|
||||||
|
current['runtime_sha256']==failed['runtime_sha256'] and current['apt_config_sha256']==failed['apt_config_sha256'] and
|
||||||
|
not ready_file.exists(),'only known extra metadata fields may be corrected; original readiness remains archived')
|
||||||
|
return failed,original
|
||||||
|
guard()
|
||||||
|
if payload.get('resume_failed'):resume_inputs()
|
||||||
|
if payload['preflight_only']:return dict(preflight_only=True,maintenance_mutations=False,root_consumed=18,root_unresolved=0,apt_endpoint_enabled=False)
|
||||||
|
folder=Path('/var/lib/rmm-bootstrap-history')/('post-reboot-apt-readiness-'+str(uuid.UUID(payload['id'])));folder.mkdir(mode=0o700)
|
||||||
|
report=dict(completed=False,backup=str(folder),stage='validated',readiness_only=True,native_acceptance=False,apt_endpoint_enabled=False,
|
||||||
|
jobs_created=False,grants_created=False,package_effects=False,reboot_requested=False,backups={})
|
||||||
|
def save():
|
||||||
|
create(folder/'.report-next.json',json.dumps(report,indent=2).encode());os.replace(folder/'.report-next.json',folder/'report.json');sync(folder)
|
||||||
|
def replace(path,raw=None,mode=0o600,gid=0):
|
||||||
|
require(path.is_file() and not path.is_symlink() and path.stat().st_dev==folder.stat().st_dev,'version only known same-filesystem artifact')
|
||||||
|
old=folder/str(path).lstrip('/').replace('/','__');require(not old.exists(),'versioned destination exclusive')
|
||||||
|
if raw is not None:create(folder/'.artifact-next',raw,mode,gid)
|
||||||
|
os.rename(path,old);sync(path.parent);sync(folder);report['backups'][str(path)]=str(old);save()
|
||||||
|
if raw is not None:os.rename(folder/'.artifact-next',path);sync(path.parent)
|
||||||
|
lock=None
|
||||||
|
try:
|
||||||
|
save();run(['systemctl','stop','rmm-agent-remote.service','rmm-helper-cloud.service'])
|
||||||
|
lock=os.open(root/'executor.lock',os.O_RDWR|os.O_NOFOLLOW);fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB);guard()
|
||||||
|
preserved={str(p):manifest(p) for p in (state,root,Path('/var/lib/rmm-agent'))};old_base=manifest(base)
|
||||||
|
controls={}
|
||||||
|
for p in (agent,helper,provider,general_config,general_proof,dropin,Path('/var/lib/dpkg/status'),Path('/usr/share/rmm-mvp-test/version')):
|
||||||
|
s=p.stat();controls[str(p)]=(s.st_dev,s.st_ino,sha(p.read_bytes()))
|
||||||
|
command=['/usr/bin/python3','-I',str(provider)];config_bytes=run(command+['print-config']);config_sha=sha(config_bytes)
|
||||||
|
require(config_sha==payload['apt_config_sha256'] and all(v in config_bytes for v in
|
||||||
|
(b'DPkg::ConfigurePending "false";',b'DPkg::TriggersPending "false";',b'dpkg::selection::remove::approved "false";')),'unchanged exact reviewed APT parser configuration')
|
||||||
|
runtime=json.loads(run(command+['inspect-runtime']));runtime_sha=sha(canonical(runtime))
|
||||||
|
if payload.get('resume_failed'):
|
||||||
|
failed,original_metadata=resume_inputs();previous=Path(failed['backup'])
|
||||||
|
require(runtime_sha==failed['runtime_sha256'] and config_sha==failed['apt_config_sha256'],'measured runtime remains the already repinned runtime')
|
||||||
|
pin=failed['apt_pin'];replace(metadata,original_metadata)
|
||||||
|
report.update(resumed_failed_report_sha256=sha(canonical(failed)),corrected_metadata_sha256=sha(original_metadata),original_failed_backup=str(previous))
|
||||||
|
else:
|
||||||
|
current=json.loads(config.read_bytes());current['apt_provider'].update(runtime_sha256=runtime_sha,apt_config_sha256=config_sha)
|
||||||
|
replace(config,json.dumps(current).encode())
|
||||||
|
pin=json.loads(run([str(helper),'--inspect-apt-profile'],env=dict(os.environ,RMM_HELPER_CONFIG=str(config))))
|
||||||
|
require(pin['identity']==json.loads(general_proof.read_bytes())['identity'],'same APT identity')
|
||||||
|
replace(proof,json.dumps(pin).encode(),0o640,984)
|
||||||
|
# InstallMetadata is a strict four-field Rust struct. Runtime and
|
||||||
|
# helper measurements belong in config/proof/report, never here.
|
||||||
|
metadata_bytes=metadata.read_bytes();meta=json.loads(metadata_bytes)
|
||||||
|
require(set(meta)==strict_metadata and meta['schema_version']==2 and meta['provider_sha256']==payload['provider_sha256'],
|
||||||
|
'strict original installation metadata')
|
||||||
|
replace(metadata,metadata_bytes);replace(ready_file)
|
||||||
|
def preserved_state(probe_id=None):
|
||||||
|
require(all(manifest(Path(p))==v for p,v in preserved.items()),'identities/journals/consumptions bytes and inodes unchanged')
|
||||||
|
current_base=manifest(base);exceptions={'install-metadata.json','native-readiness.json'}
|
||||||
|
require(all(current_base.get(k)==v for k,v in old_base.items() if k not in exceptions),'all original APT archives/history/attempts/acceptances unchanged')
|
||||||
|
require(all(k in old_base or k in exceptions or probe_id and (k=='probes/'+probe_id or k.startswith('probes/'+probe_id+'/')) for k in current_base),'only fixed new copied probe artifacts allowed')
|
||||||
|
for p,v in controls.items():
|
||||||
|
path=Path(p);s=path.stat();require((s.st_dev,s.st_ino,sha(path.read_bytes()))==v,'original control/package file bytes and inode unchanged')
|
||||||
|
preserved_state();report.update(stage='repinned_preserved',preserved_state=True,agent_sha256=payload['agent_sha256'],helper_sha256=payload['helper_sha256'],
|
||||||
|
provider_sha256=payload['provider_sha256'],runtime_sha256=runtime_sha,apt_config_sha256=config_sha,apt_pin=pin,general_pin=json.loads(general_proof.read_bytes()));save()
|
||||||
|
fcntl.flock(lock,fcntl.LOCK_UN);os.close(lock);lock=None
|
||||||
|
run(['systemctl','start','rmm-apt-helper.service'])
|
||||||
|
require(run(['systemctl','show','rmm-apt-helper.service','-p','ActiveState','--value']).strip()==b'active','native copied-database ExecStartPre passed')
|
||||||
|
run(['systemctl','stop','rmm-apt-helper.service'])
|
||||||
|
lock=os.open(root/'executor.lock',os.O_RDWR|os.O_NOFOLLOW);fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB)
|
||||||
|
ready=json.loads(ready_file.read_bytes());probe_id=str(uuid.UUID(ready['probe_id']));workspace=base/'probes'/probe_id
|
||||||
|
require(ready['runtime']==runtime and ready['readiness_only'] is True and ready['native_acceptance'] is False and
|
||||||
|
ready['host_status_sha256']==sha(Path('/var/lib/dpkg/status').read_bytes()) and
|
||||||
|
(workspace/'dpkg/status').read_bytes()==Path('/var/lib/dpkg/status').read_bytes(),'actual immutable copied host database and measured runtime')
|
||||||
|
preserved_state(probe_id);guard()
|
||||||
|
report.update(stage='native_readiness_preserved',readiness_sha256=sha(ready_file.read_bytes()),probe_id=probe_id,
|
||||||
|
journals_preserved_before_restart=True,root_consumed=18,root_unresolved=0,apt_runtime_ready=True);save()
|
||||||
|
fcntl.flock(lock,fcntl.LOCK_UN);os.close(lock);lock=None
|
||||||
|
run(['systemctl','start','rmm-helper-cloud.service','rmm-agent-remote.service'])
|
||||||
|
require(run(['systemctl','show','rmm-apt-helper.service','-p','ActiveState','--value']).strip()==b'inactive','APT remains stopped')
|
||||||
|
report.update(stage='closed_requalified_runtime_started',completed=True);save()
|
||||||
|
except Exception as error:
|
||||||
|
report.update(error_class=type(error).__name__,frames=[dict(function=f.name,line=f.lineno) for f in traceback.extract_tb(error.__traceback__)]);save()
|
||||||
|
finally:
|
||||||
|
if lock is not None:fcntl.flock(lock,fcntl.LOCK_UN);os.close(lock)
|
||||||
|
subprocess.run(['systemctl','stop','rmm-apt-helper.service'],capture_output=True,timeout=20)
|
||||||
|
return report
|
||||||
|
|
||||||
|
|
||||||
|
def build_payload(preflight_only,resume_failed=False):
|
||||||
|
m=cloud.contract;folder=capacity.reboot.STATE/capacity.SESSION
|
||||||
|
session=m.protected_json(folder/'before.json');closed=m.protected_json(folder/'closed.json');result=m.protected_json(folder/'result.json')
|
||||||
|
report=m.protected_json(folder/'capacity-runtime.json')
|
||||||
|
require(closed['verified'] and result['verified'] and result['result']['state']=='succeeded' and report['completed'],'original one reboot finished and restored before APT requalification')
|
||||||
|
payload=dict(id=str(uuid.uuid4()),session_id=capacity.SESSION,agent_id=session['target']['agent_id'],new_boot_id=result['native']['boot_id'],
|
||||||
|
root_rows=result['native']['root_rows'],database_inodes=result['native']['database_inodes'],agent_sha256=report['agent_sha256'],helper_sha256=report['helper_sha256'],
|
||||||
|
provider_sha256=report['provider_sha256'],general_config_sha256=closed['helper']['config_sha256'],general_pin_sha256=closed['helper']['pin_sha256'],
|
||||||
|
apt_config_sha256=m.protected_json(cloud.ROOT/'devstate/cloud-apt-recovery/configured-reconcile-runtime.json')['apt_config_sha256'],preflight_only=preflight_only)
|
||||||
|
if resume_failed:
|
||||||
|
failed=m.protected_json(folder/'post-reboot-apt-readiness.json')
|
||||||
|
schema=m.protected_json(cloud.ROOT/'devstate/post-apt-readiness-metadata-schema.json')
|
||||||
|
require(failed['completed'] is False and failed['stage']=='repinned_preserved','one retained failed runtime qualification')
|
||||||
|
require(schema['original_strict_schema'] is True and schema['original_fields_unchanged'] is True and
|
||||||
|
schema['current_sha256']=='f55a784e8c29bc3fe60099bcb7bac6a96d63cf6be39276f29efc8d35ea42942a' and
|
||||||
|
schema['previous_sha256']=='5566bc269e22d05176a7bd469935b9447bf6a37bf99850241ef68ada11966ad0',
|
||||||
|
'actual independently captured strict metadata mismatch required')
|
||||||
|
payload.update(resume_failed=True,failed=failed,
|
||||||
|
invalid_metadata_sha256='f55a784e8c29bc3fe60099bcb7bac6a96d63cf6be39276f29efc8d35ea42942a',
|
||||||
|
original_metadata_sha256='5566bc269e22d05176a7bd469935b9447bf6a37bf99850241ef68ada11966ad0')
|
||||||
|
return payload
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
p=argparse.ArgumentParser(description=__doc__);p.add_argument('--preflight-only',action='store_true');p.add_argument('--resume-failed',action='store_true');args=p.parse_args();os.umask(0o077)
|
||||||
|
m=cloud.contract;folder=capacity.reboot.STATE/capacity.SESSION;payload=build_payload(args.preflight_only,args.resume_failed)
|
||||||
|
policy=cloud.bootstrap.rpc('server.conf',capacity.reboot.server_policy,dict(action='state'));require(policy['closed'],'all central Root scopes closed')
|
||||||
|
target=m.protected_json(folder/'before.json')['target'];require(capacity.reboot.evidence(target,'gate')['unresolved']==0,'no unresolved central jobs')
|
||||||
|
name='post-reboot-apt-'+('recovery-preflight' if args.preflight_only else 'recovery') if args.resume_failed else 'post-reboot-apt-'+('preflight' if args.preflight_only else 'readiness')
|
||||||
|
require(not (folder/(name+'.json')).exists(),'existing qualification retained; inspect before any explicit recovery')
|
||||||
|
m.write_private(folder/(name+'-intent.json'),payload)
|
||||||
|
report=cloud.bootstrap.rpc('linux-vm.conf',requalify,payload);m.write_private(folder/(name+'.json'),report)
|
||||||
|
require(report.get('preflight_only') if args.preflight_only else report.get('completed'),'qualification incomplete; preserve report')
|
||||||
|
print('PASS post-reboot APT runtime measurements/readiness; endpoint and scopes remain closed; no package acceptance')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
try:main()
|
||||||
|
except Exception as error:
|
||||||
|
message=str(error);print(message if message.startswith('remote bootstrap incomplete: ') else 'POST_REBOOT_APT_READINESS_INCOMPLETE:'+type(error).__name__)
|
||||||
|
raise SystemExit(2) from None
|
||||||
@@ -1,5 +1,22 @@
|
|||||||
# Tatsächlicher Implementierungsstand
|
# Tatsächlicher Implementierungsstand
|
||||||
|
|
||||||
|
## APT-Messungsrequalifikation nach Originalabschluss bestanden
|
||||||
|
|
||||||
|
Separater enger Resume nach nachgewiesenem Bootstrapfehler nativ bestanden:
|
||||||
|
ungültige siebenfeldrige Metadatendatei versioniert, exakt ursprüngliche
|
||||||
|
vierFeldbytes/SHA5566bc26… kopiert. Bereits richtige APT-Konfiguration/-pin
|
||||||
|
unverändert; kein Provider-/Binarywechsel, kein erneutes Requalifikationssetup.
|
||||||
|
Aktuelle Runtime6545c78462a23be67b283e22e084fa889e094973e91fea9f4abd207e4d515f63
|
||||||
|
mitAgent9e9f/Helperd6fb/Provider1dc gemessen. Echtes systemdExecStartPre mit
|
||||||
|
kopierter dpkg-Datenbank und nativer Sandbox-/Lock-/Rechteprüfung bestanden;
|
||||||
|
readiness_onlytrue/native_acceptancefalse. AlteAcceptances und alleRoot18-/
|
||||||
|
DBinodes-/Identitäts-/Historybelege unverändert; keine neuePaketwirkung/Jobs/
|
||||||
|
Grants/Reboot. APTdanachinaktiv/Endpunktabwesend/Scopegeschlossen, General+Agent
|
||||||
|
wieder gestartet. Privater post-reboot-apt-recovery.jsoncompletedtrue;
|
||||||
|
ursprünglicher failedpost-reboot-apt-readiness.json bleibt unverändert.
|
||||||
|
Historische Paketabnahme bleibt an Originalruntime3bac gebunden, wird nicht
|
||||||
|
auf6545 umgeschrieben. Noch MCP-Endbericht und DoD-Endsnapshot erforderlich.
|
||||||
|
|
||||||
## APT-Runtimemessung sicher verweigert; Bootstrap-Metadatenfehler
|
## APT-Runtimemessung sicher verweigert; Bootstrap-Metadatenfehler
|
||||||
|
|
||||||
Der neue post-reboot-Requalifikationslauf stoppte nach versionierter
|
Der neue post-reboot-Requalifikationslauf stoppte nach versionierter
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
# Finite journal capacity during the final Cloud reboot acceptance
|
||||||
|
|
||||||
|
On 2026-11-13 the original approved Cloud-VM reboot had already happened, but
|
||||||
|
normal reconciliation stopped before producing a new Agent SyncRequest. The
|
||||||
|
Root database occupied 268,414,976 bytes: 65,531 pages of 4,096 bytes, against
|
||||||
|
the helper's 65,536-page limit. Helper checkpoint 1378 and both journals stayed
|
||||||
|
fault-free; generic transport/dependency errors did not identify the cause.
|
||||||
|
The VM still had approximately 21.6 GB of filesystem space available, so the
|
||||||
|
configured SQLite limit was distinct from disk exhaustion.
|
||||||
|
|
||||||
|
The helper persists a capture before the Agent constructs its SyncRequest.
|
||||||
|
That transaction inserts the complete bound snapshot and advances the helper
|
||||||
|
checkpoint together. The configured limit prevented the insert, explaining
|
||||||
|
the unchanged helper checkpoint and absence of a new request. Historical
|
||||||
|
captures, signed responses and consumption tombstones intentionally remain
|
||||||
|
durable; this change deletes or rewrites none of them.
|
||||||
|
|
||||||
|
## Actual copied-database proof
|
||||||
|
|
||||||
|
The bootstrap adapter made a consistent private SQLite backup of the actual
|
||||||
|
Root database. On that copy, the old 65,536-page limit rejected a 524,288-byte
|
||||||
|
test insertion with **SQLITE_FULL, code 13**. After rollback, the exact same
|
||||||
|
insertion succeeded at the new finite limit of **262,144 pages / 1 GiB**.
|
||||||
|
It was rolled back again. The original database's bytes and inode remained
|
||||||
|
unchanged, and both copies of the schema/row fingerprint matched. No package
|
||||||
|
effect, RMM job or reboot was involved in this proof.
|
||||||
|
|
||||||
|
## Preserving runtime maintenance and normal completion
|
||||||
|
|
||||||
|
The shared `bounded_journal_capacity` now enforces 1 GiB on both Agent and
|
||||||
|
helper, still refusing unexpected page sizes. The Agent uses this same routine
|
||||||
|
when opening its journal, so both binaries were rebuilt. Qualified Bookworm
|
||||||
|
builds, **126 affected Rust tests**, formatting and warning-denying Clippy
|
||||||
|
passed. The existing capacity tests verify the new limit while retaining the
|
||||||
|
original consumed grant, start evidence, sequence and replay protection.
|
||||||
|
|
||||||
|
The native maintenance versioned only the two binaries. It preserved all
|
||||||
|
18 Root consumptions, the original unresolved reboot, old signed histories,
|
||||||
|
device identity, database inodes, General policy/pin, provider and all APT
|
||||||
|
attempt/acceptance files. The helper was started first while the Agent remained
|
||||||
|
stopped for independent receipt verification. The qualified binaries are:
|
||||||
|
|
||||||
|
- Agent: `9e9f323075f44e02e3900267b846f124303179171476a23d023708fc8339f9b4`
|
||||||
|
- Helper: `d6fbfc25263243475c50e703c014772c359533548bccc3f09ff91072b0e8b929`
|
||||||
|
- Unchanged provider: `1dc0237dd8df9c9d22568bb1f6b047ede73bc2a5fca5c7fcedb7f24ab2a58b1e`
|
||||||
|
|
||||||
|
After the normal Agent resumed, the **same** original reboot grant
|
||||||
|
`25a4bf3f-772c-487d-825d-73bcbbc418fd` completed through signed RootSync.
|
||||||
|
The actual Root ledger then contained **18 consumed, 0 unresolved, 0 faults**;
|
||||||
|
the old 17 Root rows and database inodes remained unchanged. No second reboot,
|
||||||
|
new grant, direct outcome update or journal reset was used. The verified final
|
||||||
|
reboot result and restored non-reboot General policy are separate native
|
||||||
|
receipts in the original session.
|
||||||
|
|
||||||
|
Protected witnesses, excluded from Git, are under
|
||||||
|
`devstate/cloud-reboot/d015c3ef-f3aa-4522-a3c2-fcb6099df17b/`:
|
||||||
|
|
||||||
|
- `capacity-copy.json`: actual SQLite error 13 and unchanged original database.
|
||||||
|
- `capacity-runtime.json`: completed preserving binary maintenance.
|
||||||
|
- `capacity-upgrade.json`: bound index of actual runtime and build receipts.
|
||||||
|
- `result.json`: verified completion of the original single reboot.
|
||||||
|
- `closed.json`: verified restoration of the original non-reboot policy.
|
||||||
|
|
||||||
|
The APT endpoint remained disabled throughout. Because runtime measurement
|
||||||
|
includes the helper binary, its earlier closed APT pin becomes historical after
|
||||||
|
this replacement. A separate post-reboot tool remeasures the unchanged provider
|
||||||
|
and performs only the existing copied-database readiness probe after all
|
||||||
|
18 Root attempts are closed. It does not create a new package acceptance or
|
||||||
|
change any historical acceptance record.
|
||||||
|
|
||||||
|
The initial post-reboot readiness run failed before launching the Python probe.
|
||||||
|
The bootstrap had incorrectly added three measurement fields to installation
|
||||||
|
metadata, whose Rust parser permits exactly four fields. Independent readback
|
||||||
|
confirmed the seven current keys, the exact original four-field backup and
|
||||||
|
unchanged values for those original fields. The failed report and all original
|
||||||
|
backups remain retained. A narrowly bound source correction restores a copy of
|
||||||
|
the original four-field bytes while separately versioning the invalid file;
|
||||||
|
it leaves the already correct runtime config/proof unchanged. This recovery
|
||||||
|
requires the original reboot to be closed and does not repeat any package job.
|
||||||
|
Its native completion must be recorded separately from the earlier failure.
|
||||||
|
|
||||||
|
## Follow-up after the MVP
|
||||||
|
|
||||||
|
The 1 GiB limit is finite reserve, not permanent retention management. Durable
|
||||||
|
capture/decision history continues to grow and another exhausted limit must
|
||||||
|
fail closed. Investigate measured growth, storage visibility and a separately
|
||||||
|
specified safe archival policy after the MVP; do not add deletion, compaction
|
||||||
|
or automatic limit increases to this acceptance fix.
|
||||||
@@ -23,9 +23,17 @@ und nach Austausch/start alle18Verbrauchszeilen, DBinodes, Journal-/Identitäts-
|
|||||||
APT-Historybytes sowie Generalpolicy/-pin erhalten. Keine Jobs/Grants/Paketwirkung
|
APT-Historybytes sowie Generalpolicy/-pin erhalten. Keine Jobs/Grants/Paketwirkung
|
||||||
oder weiterer Reboot. Private capacity-runtime.json und separat hashgebundener
|
oder weiterer Reboot. Private capacity-runtime.json und separat hashgebundener
|
||||||
capacity-upgrade.json erhalten Originalbefore.json/Checkpoint unverändert.
|
capacity-upgrade.json erhalten Originalbefore.json/Checkpoint unverändert.
|
||||||
Der aktuelle APT-Runtimepin muss wegen neuem Helperhash separat rein kopierend
|
Nach normalem signiertem Abschluss desselben Rebootgrants und Wiederherstellung
|
||||||
requalifiziert werden; Endpunkt bleibt aus. Noch kein erfolgreicher
|
der ursprünglichen Generalpolicy folgte die aktuelle kopierende APT-Qualifikation.
|
||||||
Rebootabschluss.
|
Ein zunächst fehlerhaftes Bootstrap ergänzte drei unbekannte InstallMetadatafelder;
|
||||||
|
der strikte Rustparser verweigerte vor Pythonprobe. Originaler failedReport bleibt.
|
||||||
|
Separater versionierter Resume stellte genau ursprüngliche vierFeldbytes5566bc26…
|
||||||
|
wieder her; richtige Runtime-/Policy-Pins blieben unverändert. Tatsächlicher
|
||||||
|
kopierender NativeReadinesslauf unter Runtime6545c784… bestanden, alleRoot18/
|
||||||
|
DBinodes/altenAcceptance-/Historydaten erhalten. APTgestoppt/Endpunktentfernt,
|
||||||
|
General+Agent wiederaktiv. readiness_onlytrue/native_acceptancefalse; **keine neue
|
||||||
|
Paketabnahme** oder Pakettransaktion, alte3bac-Paketnachweise nicht umgedeutet.
|
||||||
|
Details:[getrennter Kapazitätsbericht](journal-capacity-acceptance.md).
|
||||||
|
|
||||||
Die folgenden256MiB-Angaben sind historische Vorgängerqualifikationen; sie
|
Die folgenden256MiB-Angaben sind historische Vorgängerqualifikationen; sie
|
||||||
werden weder überschrieben noch als aktuelles1GiB-Installationszeugnis benutzt.
|
werden weder überschrieben noch als aktuelles1GiB-Installationszeugnis benutzt.
|
||||||
|
|||||||
Reference in New Issue
Block a user