Persist initial provisioning inputs and final corrective deployment evidence

This commit is contained in:
Atlas Development Worker 2026-12-02 20:33:13 +00:00
parent cbe5c9da29
commit 34ae159780
3 changed files with 18 additions and 6 deletions

View File

@ -23,12 +23,13 @@ with requests submitted by the actual worker CLI inside atlas-worker-exec:
| SQL-only | 0ea225efc277fddcf534b95aece3cbf08dd554cd | 20261202T202445Z-703030df6b63; migration 340 committed |
| Combined application, procedure and data | 262f2f32199e89646190d9017eb74eb7f1d7187e | 20261202T202737Z-2bb0f210cb22; 341 and 342 committed; healthy |
| Production-target request | 2bdcf6bd46435cac7c7cb27051364b24cbdd5744 | rejected before admission; no Production command executed |
| Corrective application-only | cbe5c9da294e4f6bde10fc9ab382375d212240c5 | 20261202T203123Z-7c660e8ee618; healthy; no backup/migrations repeated |
| Controlled compiler failure | 2bdcf6bd46435cac7c7cb27051364b24cbdd5744 | failed_safe; contained-publish; CS1029, exact file/line and current deployment returned |
All requests share execution 48c7bf47bc2a4fe49e77ee297a4dd3f3. Corrections after known
safe failures were accepted within this execution. The final corrective receipt
and restored controller status are recorded in CYJ task 134 and the CYJ commissioning
report; feature acceptance remains with each feature worker.
safe failures were accepted within this execution. The final corrective receipt is shown above; restored controller status is recorded
in CYJ task 134 and the CYJ commissioning report. Feature acceptance remains with
each feature worker.
Commissioning exposed legacy unledgered source SQL. Its exact historical exclusions
are pinned outside Git and cannot adopt changed/new scripts. Migration 340 had never

View File

@ -61,7 +61,11 @@ Never run a repository installer with administrative authority. Install only rev
code and independently built tooling; no change to sudo rules is needed. The
unprivileged adapter needs `development_plan.py`; the existing Development helper
needs `development_qualification.py`, `development_plan.py` and the reviewed worker.
The Production installation is deliberately untouched.
The Production installation is deliberately untouched. Initial provisioning also installs
the qualification modules and takes a reviewed `--legacy-source-index` JSON file
with the pinned historical source commit and excluded SQL file hashes. This index
is root-controlled baseline data; routine releases never require a new index or
operator action.
Commission using real Development activations: application-only, SQL-only, combined,
successive correction and controlled copy/build failure. Check receipts and actual

View File

@ -6,6 +6,7 @@ import json
import os
from pathlib import Path
import pwd
import re
import shutil
import subprocess
import sys
@ -19,12 +20,16 @@ from release import require, load, verify_bundle, canonical, file_digest
def main():
parser = argparse.ArgumentParser(description=__doc__)
for name in ('deployment-user', 'database-config', 'worker', 'previous-package', 'previous-public-key', 'public-key'):
for name in ('deployment-user', 'database-config', 'worker', 'previous-package', 'previous-public-key', 'public-key', 'legacy-source-index'):
parser.add_argument('--'+name, required=True)
args = parser.parse_args()
require(os.geteuid() == 0 and __import__('socket').gethostname() == 'atlas', 'Atlas administrator required')
os.umask(0o077)
require(not dev.CONFIG.exists() and not Path(dev.ROOT).exists(), 'Already provisioned; refuses overwrite')
legacy = load(args.legacy_source_index)
require(set(legacy) == {'source_commit','files'} and re.fullmatch(r'[a-f0-9]{40}',legacy['source_commit']) and isinstance(legacy['files'],dict) and len(legacy['files']) <= 1000, 'Reviewed historical SQL source index required')
for name, checksum in legacy['files'].items():
require(re.fullmatch(r'[A-Za-z0-9_.-]+\.sql',name) and re.fullmatch(r'[a-f0-9]{64}',checksum), 'Invalid historical SQL source index')
db = load(args.database_config)
require(db['database'] == 'PlotDirector_Development' and db['expected_server'] == '192.168.10.10,1433' and db['expected_host'] == 'atlas', 'Wrong Development database')
operator = pwd.getpwnam(args.deployment_user)
@ -56,7 +61,7 @@ def main():
write(dev.FIXED['public_key'], Path(args.public_key).read_bytes(), mode=0o644)
lib = directory('/usr/local/lib/plotdirector-dev-deployment', mode=0o755)
tools = Path(__file__).resolve().parents[1]
for name in ('activate.py', 'release.py', 'receipt.py', 'transport.py', 'development.py', 'retention.py'):
for name in ('activate.py', 'release.py', 'receipt.py', 'transport.py', 'development.py', 'development_plan.py', 'development_qualification.py', 'retention.py'):
write(lib/name, (tools/name).read_bytes(), mode=0o644)
worker = directory(lib/'database', mode=0o755)
for source in Path(args.worker).rglob('*'):
@ -78,6 +83,7 @@ def main():
write(root/'deployment.lock', b'', mode=0o600)
state = directory('/var/lib/plotdirector-dev-deployment', deploy_gid, 0o751)
directory(state/'incoming', deploy_gid, 0o2770)
directory(state/'qualified', deploy_gid)
shared = directory(root/'shared', runtime_gid)
config = directory(shared/'config', runtime_gid)
old = Path('/srv/apps/plotdirector-dev/current')
@ -114,6 +120,7 @@ def main():
core.switch(root, destination/'app', 'provision')
write(root/'active-deployment.json', canonical({'deployment': previous['deployment_identifier'], 'release': manifest['release_id'], 'package_sha256':auth['package_sha256']}))
baseline = directory(state/'baseline', deploy_gid)
write(baseline/'legacy-source-sql.json', canonical(legacy), deploy_gid)
# The package was verified above. Copy only immutable reviewed plan data.
for area in ('sql', 'evidence'):
target = baseline/area