From d8609395b44e178d8305fbc4370fd2090e9cf22e Mon Sep 17 00:00:00 2001 From: Mikei386 <44135113+Mikei386@users.noreply.github.com> Date: Mon, 23 Nov 2026 12:01:38 +0100 Subject: [PATCH] Record verified Basalt disk-cache activation and Claude hook removal --- docs/ATHENA_HANDOFF.md | 22 +++- .../README.md | 104 +++++++++++++++ .../activate_host.py | 78 +++++++++++ .../effective-basalt_sources.json | 37 ++++++ .../final-host.json | 1 + .../final-management.json | 122 ++++++++++++++++++ .../final-props.json | 25 ++++ .../final-response.json | 41 ++++++ .../final_host.py | 16 +++ .../first-props.json | 25 ++++ .../first-response.json | 41 ++++++ .../first-startup.json | 1 + .../test_activation.py | 22 ++++ .../basalt-disk-cache-2026-11-23.md | 5 + 14 files changed, 539 insertions(+), 1 deletion(-) create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/README.md create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/activate_host.py create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/effective-basalt_sources.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/final-host.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/final-management.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/final-props.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/final-response.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/final_host.py create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/first-props.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/first-response.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/first-startup.json create mode 100644 docs/maintenance/basalt-cache-activation-2026-11-23/test_activation.py diff --git a/docs/ATHENA_HANDOFF.md b/docs/ATHENA_HANDOFF.md index 3894111..791c7be 100644 --- a/docs/ATHENA_HANDOFF.md +++ b/docs/ATHENA_HANDOFF.md @@ -5,7 +5,27 @@ curated project handoff, not imported chat history. Read applicable `AGENTS.md`, then the current source and relevant linked documentation; verify live state again before changing anything. Historical notes do not override current facts. -## Basalt SSD conversation cache · 22/23 November 2026 +## Basalt SSD conversation cache activated; Claude hook removed + +Michael renewed Go and supplied normal Vault login. Cache commit17e7017 was +integrated into the actual running app base, preserving Basalt0.4.0. New image +`athena-deck-standalone:cache-17e7017`, ID +`sha256:21414d939a91d0aa997129cf4b30e67b84d95f01f80ee7071a328e074dc8eb72`. +Isolated full Server startup and15 targeted tests passed before activation; +829 synthetic root tests and4 drain guard tests passed. Two authenticated full +drains preceded normal stops; intervening active work was allowed to finish. +Both before and after hook removal, actual short model-endpoint replies passed. +Worker.json and final startup confirm kv=int8, RAM0/disk16384 MiB, batch2, +context262144 per slot. Original TTS/ASR loaded, warming=false; vision=true. +config.py restored from the upstream-matching Claude backup, override and README +removed. Container healthy,60GiB/sandbox/five settings unchanged, old image and +private rollback originals retained. No fresh audio/visual inference, benchmark, +full-context or native/full-restore acceptance. General main runtime recipe still +pins0.3.3; unrelated newer live runtime/Strata work was not swept into this task. +[Completed activation, execution environments, workflow faults and rollback](maintenance/basalt-cache-activation-2026-11-23/README.md). + +## Basalt SSD conversation cache preparation · historical + Claude's operator handoff is recorded with historical measurements, exact runtime hook, backup, rollback and activation gates in diff --git a/docs/maintenance/basalt-cache-activation-2026-11-23/README.md b/docs/maintenance/basalt-cache-activation-2026-11-23/README.md new file mode 100644 index 0000000..55266d1 --- /dev/null +++ b/docs/maintenance/basalt-cache-activation-2026-11-23/README.md @@ -0,0 +1,104 @@ +# Basalt disk-cache activation completed + +Michael renewed the unchanged activation order and Go, supplied the regular Deck +login through Hermes Vault and explicitly requested the temporary Claude hook's +removal after successful app acceptance. This receipt supersedes the preparation- +only status in `../basalt-disk-cache-2026-11-23.md`. + +## Delivered artifact + +Cache code commit: `17e7017e83c24e33b2fa45d2300788c1a718b6ba`. +Production base image: +`sha256:cab60d1e71aeb97386b2047b4e971f0082adb9cbe766edd4183ac1872d6372c2`. +New image `athena-deck-standalone:cache-17e7017`: +`sha256:21414d939a91d0aa997129cf4b30e67b84d95f01f80ee7071a328e074dc8eb72`. + +Only `/app/basalt_worker.py` and `/app/basalt_sources.json` were overlaid onto +the verified running image; canonical host copies were updated too. The worker +was byte-identical to commit 17e7017. The effective recipe preserves the running +Basalt 0.4.0 pin `99dc78cb51ac43555c3feed9a1ec14f056d05035` and all other +recipe fields, changing only the two cache values. No runtime rebuild, downgrade, +model download, profile save or Anna/Kikiri candidate activation occurred. +The checked effective recipe is archived alongside this receipt. This is not +an assertion that main's older general runtime recipe has been upgraded to 0.4.0. + +## Actual sequence and checks + +- Normal password-only login via Vault, management GET 200. The placeholder + username was not entered. After restart, the same normal login succeeded again. +- 15 targeted Basalt tests and isolated full Server construction in the new + no-network/no-GPU/no-production-state image passed before activation. +- Authenticated strict integer-zero endpoint/scheduler active and waiting + counters, switching=false, preceded each ordinary endpoint stop. Stopped + state was read back; fresh evidence was passed to the host apply/unhook guard. +- First activation preserved the complete normalized container sandbox, all five + protected settings files and 64424509440-byte (60 GiB) RAM limit. Previous + stopped container/image retained; no force stop of active/queued work. +- First normal model-endpoint request returned BEREIT; Basalt loaded 0.4.0, + two slots, context262144 each. Generated worker.json explicitly contained + RAM0/disk16384, independently of the still-present override. Vision capability + was true, original TTS and ASR owners loaded, warming=false. +- New user traffic arrived before the second drain. Waited without cancellation + until full idle; then used ordinary endpoint stop again. +- Verified the backup against `git show HEAD:serve/config.py` at the actual + 0.4.0 pin, restored config.py from config.py.bak-20261122-claude, removed + engine-overrides.json and engine-overrides.README.txt. Private originals remain + under the root-only activation rollback directory, not Git. +- Normal endpoint start and one more BEREIT request succeeded. Final startup: + `ctx=262144 kv=int8 ram-cache=0MiB disk-cache=16384MiB batch=2`. + Worker.json agrees. Public props: vision=true, Basalt0.4.0 loaded, two slots. + Original TTS owner `5b67537ab825493786861b278ae26cbe` and ASR owner + `129d5ea93fd34f1a9e5dcca7bcef5761` loaded on RTX3060, warming=false. +- Final exact readback: new image/source hashes match, health=healthy, + OOMKilled=false, RestartCount=0; sandbox, RAM limit and protected settings + byte-identical. Hook absent, config backup matches upstream, old image retained. + Later live traffic was observed; no further stop or inference was submitted. + +## Tests, workflow faults and boundaries + +829 synthetic root tests passed from the required checkout working directory. +The initial invocation from its parent failed one relative fixture lookup; +that was a test-launch cwd error, not an app failure. Four synthetic guard tests +cover valid drain and invalid active/waiting/null/bool/auth/age/origin states. +These tests are not real GPU or native fresh-host acceptance. + +Browser transport once disconnected and subsequently selected about:blank. +Returned to the exact origin in the existing browser context, confirmed normal +management200, and read state before further writes; no credential extraction. +The first unhook helper refused before modifying files because normal worker stop +had removed worker.json. Corrected its prerequisite to the previously verified +startup line plus immutable effective app recipe/source hashes, refreshed drain, +then successfully unhooked. Final worker.json was checked again after reload. +No failed app/model acceptance or rollback was necessary. + +No new TTS/ASR synthesis/transcription, visual inference, cache-parking benchmark, +performance/full-context/parallel/soak test, native Debian install or full encrypted +restore acceptance. Ready/loaded checks do not establish those functional tests. + +## Execution environment and rollback + +`activate_host.py` and `final_host.py` are ATHENA HOST scripts, not NAS scripts. +They are operation-specific archived evidence, not scheduled tasks; do not rerun +prepare/apply/unhook after this completed activation. The test file runs locally +without executing the script main. No new background guard/service was installed. + +Host private state and originals: +`/opt/athena-deck-dev/cache-activation-17e7017/`. +Host helper: `/opt/athena-deck-dev/cache-activation-tools-17e7017/activate_host.py`. +Old stopped container: `athena-deck-dev-cache-rollback-17e7017`. +Old image tag: `athena-deck-standalone:strata-0219-c6f6427d9de9`. + +Future rollback requires a new maintenance Go, regular management authentication, +and fresh full drain. Restore old image AND canonical app files AND the old +config.py hook/override/README together, preserving unrelated live settings; +normal endpoint restart and original-model/audio readiness must then be verified. +The archived rollback helper requires fresh stopped drain and never cancels jobs. +Do not simply start the retained old container without restoring the hook: that +old app otherwise supplies the old RAM cache policy. Keep linked CUDA trees. + +Native deployment uses the same worker/configuration delta and effective0.4.0 +recipe; no vendor patch or override is required. Existing native restoration +limits and private-cache storage requirements remain as documented in +`../basalt-disk-cache-2026-11-23.md`. A full live app reproducible solely from main +still depends on the separately retained unpublished Strata/runtime work; this +narrow activation does not silently publish that unrelated source tree. diff --git a/docs/maintenance/basalt-cache-activation-2026-11-23/activate_host.py b/docs/maintenance/basalt-cache-activation-2026-11-23/activate_host.py new file mode 100644 index 0000000..6fef431 --- /dev/null +++ b/docs/maintenance/basalt-cache-activation-2026-11-23/activate_host.py @@ -0,0 +1,78 @@ +"""Athena host only: scoped cache overlay with authenticated drain.""" +import sys,json,subprocess,time,hashlib,shutil,os,importlib.util +from pathlib import Path +R=Path('/opt/athena-deck-dev/cache-activation-17e7017'); B=Path('/opt/athena-deck-dev/runtime'); S=B/'state'; C=Path('/opt/athena-deck-dev/source'); RT=S/'basalt-runtime' +TAG='athena-deck-standalone:cache-17e7017'; OLD='athena-deck-dev-cache-rollback-17e7017'; FILES=('basalt_worker.py','basalt_sources.json'); SETTINGS=('profiles.json','endpoint.json','audio-policy.json','cpu-partition.json','reasoning-budget.json') +def run(*a,**kw):return subprocess.run(list(map(str,a)),check=True,**kw) +def out(*a):return subprocess.check_output(list(map(str,a)),text=True) +def info():return json.loads(out('docker','inspect','athena-deck-dev'))[0] +def sha(p):return hashlib.sha256(Path(p).read_bytes()).hexdigest() +def save(d):p=R/'receipt.json';p.write_text(json.dumps(d,indent=2));p.chmod(0o600) +def load():return json.loads((R/'receipt.json').read_text()) +def sandbox(d): + c=dict(d['Config']);c.pop('Image',None);c.pop('Hostname',None);c['Env']=sorted(c.get('Env') or []);return dict(config=c,host=d['HostConfig']) +def guard(d): + assert d['authenticated_status']==200 and d['origin']=='http://192.168.1.212:8108' + assert 0<=time.time()-d['checked_at']<60 and d['state']=='stopped' + assert type(d['active_requests']) is int and d['active_requests']==0 + assert all(type(d['scheduler'][k]) is int and d['scheduler'][k]==0 for k in ('active_requests','waiting_requests','tts_waiting_requests','stt_waiting_requests')) and d['scheduler']['switching'] is False + +def prepare(): + bundle=json.load(sys.stdin);assert set(bundle)==set(FILES);assert not R.exists();d=info();assert d['HostConfig']['Memory']==64424509440 + assert out('docker','image','inspect','--format','{{.Id}}',d['Config']['Image']).strip()==d['Image'] + assert json.loads((RT/'ready.json').read_text())['version']=='0.4.0' + pin=out('git','-c','safe.directory='+str(RT/'source'),'-C',RT/'source','rev-parse','HEAD').strip();assert pin=='99dc78cb51ac43555c3feed9a1ec14f056d05035' + original=out('git','-c','safe.directory='+str(RT/'source'),'-C',RT/'source','show','HEAD:serve/config.py').encode() + assert original==(RT/'source/serve/config.py.bak-20261122-claude').read_bytes() + R.mkdir(mode=0o700);(R/'image/app').mkdir(parents=True);(R/'before').mkdir();(R/'tmp').mkdir();os.chown(R/'tmp',65534,65534) + for n,text in bundle.items(): + p=R/'image/app'/n;p.write_text(text);p.chmod(0o644);shutil.copy2(C/n,R/'before'/n) + for n in SETTINGS:shutil.copy2(S/n,R/'before'/n) + for n in ('source/serve/config.py','engine-overrides.json','engine-overrides.README.txt'):shutil.copy2(RT/n,R/'before'/Path(n).name) + (R/'image/Dockerfile').write_text('FROM '+d['Config']['Image']+'\nUSER root\nCOPY app/ /app/\nUSER 65534:65534\n') + with (R/'build.log').open('w') as log:run('docker','build','--network','none','--pull=false','-t',TAG,R/'image',stdout=log,stderr=subprocess.STDOUT,timeout=180) + probe="from pathlib import Path\nimport tempfile\nfrom server import Server\nwith tempfile.TemporaryDirectory() as tmp:\n s=Server(0,state_dir=Path(tmp));s.endpoint.close();s.video.close();s.dashboard.close();s.server_close()\nprint('Full isolated Server constructor passed')" + run('docker','run','--rm','--runtime','runc','--network','none','--read-only','--user','65534:65534','--memory','512m','--pids-limit','256','--cap-drop','ALL','-e','NVIDIA_VISIBLE_DEVICES=void','-e','DECK_REQUIRE_SETUP=0','-e','DECK_NETWORK_MODE=disabled','-e','TMPDIR=/test-tmp','--mount','type=bind,src='+str(R/'tmp')+',dst=/test-tmp','--entrypoint','python3',TAG,'-B','-c',probe,timeout=60) + save(dict(phase='prepared',container=d['Id'],image_before=d['Image'],tag_before=d['Config']['Image'],image_after=out('docker','image','inspect','--format','{{.Id}}',TAG).strip(),settings={n:sha(S/n) for n in SETTINGS},sandbox=sandbox(d),pin=pin,source_before={n:sha(C/n) for n in FILES},source_after={n:sha(R/'image/app'/n) for n in FILES})) + print(json.dumps(dict(prepared=True,image=TAG,isolated_server=True))) +def endpoint_restore(): + old=json.loads((R/'before/endpoint.json').read_text());now=json.loads((S/'endpoint.json').read_text());now['autostart']=old['autostart'];assert now==old + shutil.copy2(R/'before/endpoint.json',S/'endpoint.json') +def installer(): + spec=importlib.util.spec_from_file_location('install',C/'deploy/install.py');m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m);return m + +def apply(): + guard(json.load(sys.stdin));a=load();d=info();assert a['phase']=='prepared' and d['Id']==a['container'] and d['Image']==a['image_before'] + assert all(sha(S/n)==a['settings'][n] for n in SETTINGS if n!='endpoint.json');assert all(sha(C/n)==a['source_before'][n] for n in FILES) + endpoint_restore();a['phase']='applying';save(a) + run('docker','stop','--timeout','45','athena-deck-dev');run('docker','rename','athena-deck-dev',OLD) + for n in FILES:shutil.copy2(R/'image/app'/n,C/n) + m=installer();cfg=m.load_manifest(B);assert cfg['image']==a['tag_before'];cfg.update(image=TAG,previous_image=a['tag_before']);m.launch(cfg);m.ready(cfg);m.write_manifest(B,cfg) + deadline=time.monotonic()+100 + while info()['State'].get('Health',{}).get('Status')=='starting' and time.monotonic()