Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 671d2ed19c | |||
| ae661feebc | |||
| c89ed1abc1 | |||
| 5a79e3651b | |||
| f9fc764fcc | |||
| 65200fb0de | |||
| c5abef1fa2 | |||
| 4ad77bf28b |
@@ -0,0 +1,440 @@
|
||||
"""Trusted local Docker broker. No worker-facing shell, paths, Docker options or uploads."""
|
||||
from datetime import datetime, timezone, timedelta
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path, PurePosixPath
|
||||
import re
|
||||
import subprocess
|
||||
import tarfile
|
||||
import time
|
||||
import uuid
|
||||
|
||||
FIELDS={'stage','checkpoint','commit','branch','suite','policySha256','requestId'}
|
||||
MAX_ARCHIVE=192*1024*1024
|
||||
|
||||
|
||||
class ExecutorError(RuntimeError): pass
|
||||
|
||||
|
||||
def utc(): return datetime.now(timezone.utc).isoformat()
|
||||
def digest(value): return hashlib.sha256(json.dumps(value,sort_keys=True,separators=(',',':')).encode()).hexdigest()
|
||||
def sha(path): return hashlib.sha256(Path(path).read_bytes()).hexdigest()
|
||||
|
||||
|
||||
def atomic(path,value):
|
||||
path=Path(path)
|
||||
path.parent.mkdir(parents=True,exist_ok=True)
|
||||
temporary=path.with_name('.'+path.name+'.'+uuid.uuid4().hex)
|
||||
with temporary.open('x',encoding='utf-8') as stream:
|
||||
json.dump(value,stream,sort_keys=True)
|
||||
stream.flush(); os.fsync(stream.fileno())
|
||||
os.replace(temporary,path)
|
||||
|
||||
|
||||
def validate_request(request,expected,allowed):
|
||||
if set(request)!=FIELDS or any(not isinstance(v,str) for v in request.values()):
|
||||
raise ExecutorError('Only fixed test request identities are permitted')
|
||||
if request!=expected or request['suite'] not in allowed:
|
||||
raise ExecutorError('Unauthorised or altered test identity')
|
||||
if (not re.fullmatch('[a-f0-9]{40}',request['commit'])
|
||||
or not re.fullmatch('[a-f0-9]{64}',request['policySha256'])
|
||||
or not re.fullmatch('[a-f0-9]{32}',request['requestId'])
|
||||
or not re.fullmatch(r'(?:codex|feature|planning|test)/[A-Za-z0-9][A-Za-z0-9/_-]*',request['branch'])
|
||||
or '..' in request['branch']):
|
||||
raise ExecutorError('Invalid test identity')
|
||||
|
||||
|
||||
def safe_name(name):
|
||||
path=PurePosixPath(name)
|
||||
if not name or path.is_absolute() or '..' in path.parts or '\\' in name or ':' in name or '\0' in name:
|
||||
raise ExecutorError('Unsafe archive/report path')
|
||||
return path
|
||||
|
||||
|
||||
def validate_archive(raw):
|
||||
if not raw or len(raw)>MAX_ARCHIVE:
|
||||
raise ExecutorError('Source archive exceeds its bound')
|
||||
names=[]; total=0
|
||||
with tarfile.open(fileobj=io.BytesIO(raw),mode='r:') as archive:
|
||||
for item in archive:
|
||||
safe_name(item.name)
|
||||
if not (item.isfile() or item.isdir()) or item.size>32*1024*1024:
|
||||
raise ExecutorError('Links, special or oversized source files are forbidden')
|
||||
total+=item.size
|
||||
if total>MAX_ARCHIVE or len(names)>12000:
|
||||
raise ExecutorError('Expanded source archive exceeds its bound')
|
||||
if item.isfile(): names.append(item.name)
|
||||
if not names or len(names)!=len(set(names)):
|
||||
raise ExecutorError('Missing or duplicate source membership')
|
||||
return names
|
||||
|
||||
|
||||
def container_options(name,nonce,network,memory):
|
||||
if not re.fullmatch(r'jt-exec-[a-f0-9]{32}(?:-[a-z]+)?',name) or not 256<=memory<=8192:
|
||||
raise ExecutorError('Invalid generated container budget/identity')
|
||||
if network!='none' and not re.fullmatch(r'container:[a-f0-9]{64}',network):
|
||||
raise ExecutorError('Only isolated loopback namespace sharing is permitted')
|
||||
return ['--name',name,'--label','io.jobjakt.executor='+nonce,'--pull=never',
|
||||
'--network',network,'--read-only','--user','0:0','--cap-drop','ALL',
|
||||
'--cap-add','KILL','--cap-add','SETUID','--cap-add','SETGID',
|
||||
'--security-opt','no-new-privileges','--pids-limit','384',
|
||||
'--memory',str(memory)+'m','--memory-swap',str(memory)+'m','--cpus','2',
|
||||
'--ulimit','nofile=2048:2048','--log-driver','none',
|
||||
'--tmpfs','/tmp:rw,nosuid,nodev,size=512m,mode=1777',
|
||||
'--tmpfs','/work:rw,exec,nosuid,nodev,size=4g,mode=1777',
|
||||
'--tmpfs','/task:rw,nosuid,nodev,size=200m,mode=0700',
|
||||
'--tmpfs','/broker-result:rw,nosuid,nodev,size=64m,mode=0700']
|
||||
|
||||
|
||||
def guard_resource(data,expected):
|
||||
host=data.get('HostConfig',{})
|
||||
if (data.get('Name')!='/'+expected['name'] or data.get('Image')!=expected['image']
|
||||
or expected.get('id') and data.get('Id')!=expected['id']
|
||||
or data.get('Config',{}).get('Labels',{}).get('io.jobjakt.executor')!=expected['nonce']
|
||||
or host.get('Privileged') or host.get('ReadonlyRootfs') is not True
|
||||
or host.get('NetworkMode')!=expected.get('network','none')
|
||||
or host.get('Binds') or host.get('PortBindings')
|
||||
or host.get('PidMode','') not in ('','private') or host.get('IpcMode','') not in ('','private')
|
||||
or host.get('Devices') or host.get('DeviceRequests')
|
||||
or any(m.get('Type')!='tmpfs' for m in data.get('Mounts',[]))):
|
||||
raise ExecutorError('Resource identity/isolation mismatch; refusing Docker operation')
|
||||
if sorted(c.removeprefix('CAP_') for c in host.get('CapAdd') or [])!=sorted(expected.get('capAdd',[])):
|
||||
raise ExecutorError('Unexpected resource capabilities')
|
||||
if 'memoryMiB' in expected and (host.get('CapDrop')!=['ALL']
|
||||
or host.get('SecurityOpt')!=['no-new-privileges'] or data['Config'].get('User')!='0:0'
|
||||
or host.get('Memory')!=expected['memoryMiB']*1024*1024
|
||||
or host.get('MemorySwap')!=host['Memory'] or host.get('PidsLimit')!=384
|
||||
or host.get('NanoCpus')!=2000000000):
|
||||
raise ExecutorError('Resource privilege/budget configuration differs')
|
||||
|
||||
|
||||
def verify_receipt(directory,receipt,pin,expected):
|
||||
directory=Path(directory).resolve()
|
||||
if digest(receipt)!=pin or receipt.get('request')!=expected:
|
||||
raise ExecutorError('Private receipt identity/hash differs')
|
||||
if receipt.get('status')!='PASSED' or receipt.get('nativeExitCode')!=0 or receipt.get('cleanup') is not True:
|
||||
raise ExecutorError('Executor did not pass with complete cleanup')
|
||||
for report in receipt.get('reports',[]):
|
||||
safe_name(report['path'])
|
||||
path=directory/report['path']
|
||||
current=directory
|
||||
for part in PurePosixPath(report['path']).parts:
|
||||
current=current/part
|
||||
if current.is_symlink() or getattr(current,'is_junction',lambda:False)():
|
||||
raise ExecutorError('Private evidence path redirection')
|
||||
if not path.resolve().is_relative_to(directory) or not path.is_file() or sha(path)!=report['sha256']:
|
||||
raise ExecutorError('Private report missing or changed')
|
||||
|
||||
|
||||
class Broker:
|
||||
def __init__(self,root,repository,policy,pin,*,cancel=None):
|
||||
self.root=Path(root).resolve(); self.repo=Path(repository).resolve()
|
||||
self.policy=policy; self.pin=pin; self.cancel=cancel or (lambda:False)
|
||||
if digest(policy)!=pin or policy.get('schemaVersion')!=1:
|
||||
raise ExecutorError('Executor policy changed')
|
||||
for name,expected in policy.get('codeSha256',{}).items():
|
||||
if sha(Path(__file__).with_name(name))!=expected: raise ExecutorError('Trusted executor code changed')
|
||||
if self.root.is_relative_to(self.repo) or self.repo.is_relative_to(self.root):
|
||||
raise ExecutorError('Private executor evidence must be outside worker')
|
||||
self.directory=self.root/'executor'
|
||||
self.directory.mkdir(exist_ok=True)
|
||||
self.docker=[policy['dockerExecutable'],'--context','desktop-linux']
|
||||
endpoint=self.command(['context','inspect','desktop-linux','--format','{{.Endpoints.docker.Host}}']).decode().strip()
|
||||
if endpoint!='npipe:////./pipe/dockerDesktopLinuxEngine':
|
||||
raise ExecutorError('Only the qualified local Docker Desktop Linux engine is permitted')
|
||||
info=json.loads(self.command(['info','--format','{{json .}}']))
|
||||
if {k:info.get(k) for k in policy['engineIdentity']}!=policy['engineIdentity']:
|
||||
raise ExecutorError('Docker engine/kernel security configuration changed; requalify')
|
||||
|
||||
def require_qualified(self):
|
||||
report=json.loads((self.directory/'qualification.json').read_text())
|
||||
issued=datetime.fromisoformat(report['issuedUtc']);now=datetime.now(timezone.utc)
|
||||
if (report.get('status')!='PASSED' or report.get('policySha256')!=self.pin
|
||||
or issued>now+timedelta(minutes=5) or now-issued>timedelta(hours=24)):
|
||||
raise ExecutorError('Executor qualification failed, expired or changed')
|
||||
for entry in report['runs']:
|
||||
request=entry['request']
|
||||
validate_request(request,request,self.policy['allowed']['RUNTIME-QUALIFICATION/CANARY'])
|
||||
if (request['stage']!='RUNTIME-QUALIFICATION' or request['checkpoint']!='CANARY'
|
||||
or request['policySha256']!=self.pin or request['commit']!=self.policy['baselineCommit']):
|
||||
raise ExecutorError('Qualification request policy/source identity differs')
|
||||
directory=self.directory/'runs'/request['requestId']
|
||||
receipt=json.loads((directory/'receipt.json').read_text())
|
||||
if digest(receipt)!=entry['receiptSha256'] or receipt.get('cleanup') is not True:
|
||||
raise ExecutorError('Qualification receipt changed or cleanup incomplete')
|
||||
finished=datetime.fromisoformat(receipt['finishedUtc'])
|
||||
if finished>now+timedelta(minutes=5) or now-finished>timedelta(hours=24):
|
||||
raise ExecutorError('Individual runtime qualification expired')
|
||||
if (receipt.get('environment')!=self.policy['images'] or receipt.get('commandVersion')!=self.policy['catalogSha256']
|
||||
or receipt.get('executorIdentity')!=self.policy['executorIdentity']):
|
||||
raise ExecutorError('Qualification executor/images/catalog identity differs')
|
||||
if entry.get('probePassed') is not True: raise ExecutorError('Qualification contains a failed probe')
|
||||
for item in receipt['reports']:
|
||||
path=directory/safe_name(item['path'])
|
||||
if not path.is_file() or sha(path)!=item['sha256']: raise ExecutorError('Qualification report changed')
|
||||
if entry.get('expectPass'): verify_receipt(directory,receipt,entry['receiptSha256'],entry['request'])
|
||||
from executor_catalog import CANARIES
|
||||
if not set(CANARIES+['boundary-canary','failure-canary','timeout-canary','memory-limit-canary','interrupt-canary','log-limit-canary','symlink-report-canary']).issubset({e['request']['suite'] for e in report['runs']}):
|
||||
raise ExecutorError('Qualification lacks required runtime membership')
|
||||
recovery=report.get('recovery',{})
|
||||
path=self.directory/safe_name(recovery.get('path',''))
|
||||
if not path.is_file() or sha(path)!=recovery.get('sha256'): raise ExecutorError('Recovery qualification missing or changed')
|
||||
proof=json.loads(path.read_text())
|
||||
if proof.get('status')!='PASSED' or proof.get('cleanup') is not True or proof.get('brokerKilled') is not True:
|
||||
raise ExecutorError('Broker-death recovery is not qualified')
|
||||
finished=datetime.fromisoformat(proof['issuedUtc'])
|
||||
if finished>now+timedelta(minutes=5) or now-finished>timedelta(hours=24): raise ExecutorError('Recovery qualification expired')
|
||||
for item in proof['reports']:
|
||||
if sha(path.parent/safe_name(item['path']))!=item['sha256']: raise ExecutorError('Recovery evidence changed')
|
||||
for image in self.policy['images'].values():
|
||||
metadata=json.loads(self.command(['image','inspect',image]))[0]
|
||||
if metadata['Id']!=image or metadata['Config'].get('Labels',{}).get('io.jobjakt.executor.harness-sha256')!=self.policy['harnessSha256']:
|
||||
raise ExecutorError('Qualified image changed or missing')
|
||||
|
||||
def command(self,args,*,input=None,timeout=30,check=True,missing=None):
|
||||
env={k:v for k,v in os.environ.items() if k.upper() in {'PATH','SYSTEMROOT','WINDIR','TEMP','TMP','USERPROFILE','LOCALAPPDATA','APPDATA','PROGRAMFILES','COMSPEC','PATHEXT','SYSTEMDRIVE'}}
|
||||
result=subprocess.run([*self.docker,*args],input=input,stdout=subprocess.PIPE,stderr=subprocess.PIPE,
|
||||
env=env,timeout=timeout,creationflags=subprocess.CREATE_NO_WINDOW if os.name=='nt' else 0)
|
||||
if len(result.stdout)>64*1024*1024 or len(result.stderr)>1024*1024:
|
||||
raise ExecutorError('Docker transport output exceeds its bound')
|
||||
if result.returncode and missing:
|
||||
message=result.stderr.decode(errors='replace').strip()
|
||||
if message in ('Error response from daemon: No such container: '+missing,'Error: No such object: '+missing):
|
||||
return b''
|
||||
if check and result.returncode:
|
||||
raise ExecutorError('Docker '+args[0]+' failed: '+result.stderr.decode(errors='replace')[:400])
|
||||
return result.stdout
|
||||
|
||||
def git(self,*args):
|
||||
result=subprocess.run([self.policy.get('gitExecutable','git'),'-c','core.hooksPath=',
|
||||
'-C',str(self.repo),*args],capture_output=True,timeout=60)
|
||||
if result.returncode: raise ExecutorError('Git snapshot identity failed')
|
||||
return result.stdout
|
||||
|
||||
def snapshot(self,request):
|
||||
if self.git('cat-file','-t',request['commit']).strip()!=b'commit':
|
||||
raise ExecutorError('Requested source is not an exact Git commit')
|
||||
self.git('merge-base','--is-ancestor',self.policy['baselineCommit'],request['commit'])
|
||||
changed=self.git('diff','--name-only',self.policy['baselineCommit'],request['commit']).decode().splitlines()
|
||||
if request['stage']=='PHASE-10' and any(not p.startswith('docs/automation/stages/PHASE-10/') or not p.endswith('.md') for p in changed):
|
||||
raise ExecutorError('Assessment source/script change is not authorised')
|
||||
# Inspect sizes/modes before loading blobs; arbitrary candidate filenames never become commands.
|
||||
entries=[];total=0
|
||||
tree=self.git('ls-tree','-r','-l','-z',request['commit'],'--',*self.policy['sourceRoots'])
|
||||
for row in tree.split(b'\0'):
|
||||
if not row: continue
|
||||
metadata,name=row.split(b'\t',1);mode,kind,oid,size=metadata.decode().split();name=name.decode()
|
||||
path=safe_name(name);parts=path.parts
|
||||
if mode not in ('100644','100755') or kind!='blob': raise ExecutorError('Source links/submodules are not permitted')
|
||||
if any(p in {'bin','obj','node_modules','.artifacts','.git','.next','__pycache__'} for p in parts): continue
|
||||
if any(p.startswith('.env') or p.lower().endswith(('.pfx','.p12','.pem','.key')) or p.lower().startswith('appsettings.production') for p in parts): continue
|
||||
if parts[0]=='docs' and path.suffix not in ('.py','.ts','.js','.mjs','.cjs','.json','.txt'): continue
|
||||
total+=int(size)
|
||||
if int(size)>32*1024*1024 or total>MAX_ARCHIVE-8*1024*1024 or len(entries)>10000:
|
||||
raise ExecutorError('Candidate source size budget exceeded')
|
||||
entries.append((name,mode,oid,int(size)))
|
||||
query=''.join(oid+'\n' for _,_,oid,_ in entries).encode()
|
||||
result=subprocess.run([self.policy.get('gitExecutable','git'),'-C',str(self.repo),'cat-file','--batch'],
|
||||
input=query,capture_output=True,timeout=60)
|
||||
if result.returncode or len(result.stdout)>MAX_ARCHIVE: raise ExecutorError('Bounded source materialisation failed')
|
||||
blobs=io.BytesIO(result.stdout);output=io.BytesIO()
|
||||
with tarfile.open(fileobj=output,mode='w') as target:
|
||||
for name,mode,oid,size in entries:
|
||||
if blobs.readline().decode().strip()!=f'{oid} blob {size}': raise ExecutorError('Git blob identity differs')
|
||||
data=blobs.read(size)
|
||||
if len(data)!=size or blobs.read(1)!=b'\n': raise ExecutorError('Truncated Git blob')
|
||||
item=tarfile.TarInfo(name);item.size=size;item.mode=0o755 if mode=='100755' else 0o644
|
||||
target.addfile(item,io.BytesIO(data))
|
||||
raw=output.getvalue();validate_archive(raw)
|
||||
return raw
|
||||
|
||||
def inspect(self,resource):
|
||||
key=resource.get('id') or resource['name']
|
||||
raw=self.command(['container','inspect',key],missing=key)
|
||||
if not raw.strip(): return None
|
||||
data=json.loads(raw)[0]; guard_resource(data,resource)
|
||||
return data
|
||||
|
||||
def cleanup(self,lease):
|
||||
for resource in reversed(lease['resources']):
|
||||
data=self.inspect(resource)
|
||||
if data:
|
||||
self.command(['container','rm','--force',data['Id']])
|
||||
if self.inspect(resource) is not None: raise ExecutorError('Owned container cleanup incomplete')
|
||||
lease['cleanup']=True; atomic(self.directory/'leases'/ (lease['nonce']+'.json'),lease)
|
||||
|
||||
def recover(self):
|
||||
for path in (self.directory/'leases').glob('*.json') if (self.directory/'leases').exists() else []:
|
||||
lease=json.loads(path.read_text())
|
||||
if not lease.get('cleanup'): self.cleanup(lease)
|
||||
|
||||
def create(self,lease,image,network='none',memory=4096,db=False):
|
||||
name='jt-exec-'+uuid.uuid4().hex
|
||||
resource=dict(name=name,nonce=lease['nonce'],image=image,id=None,network=network,capAdd=['KILL','SETUID','SETGID'])
|
||||
resource['memoryMiB']=memory
|
||||
lease['resources'].append(resource)
|
||||
atomic(self.directory/'leases'/(lease['nonce']+'.json'),lease)
|
||||
args=['container','create',*container_options(name,lease['nonce'],network,memory)]
|
||||
metadata=json.loads(self.command(['image','inspect',image]))[0]
|
||||
if metadata['Id']!=image: raise ExecutorError('Image is not an immutable qualified local ID')
|
||||
if metadata['Config'].get('Labels',{}).get('io.jobjakt.executor.harness-sha256')!=self.policy['harnessSha256']:
|
||||
raise ExecutorError('Unqualified image harness identity')
|
||||
# Clear inherited image configuration before adding the reviewed synthetic environment.
|
||||
for value in metadata['Config'].get('Env',[]): args+=['--env',value.split('=',1)[0]+'=']
|
||||
for key,value in self.policy['environment'].items(): args+=['--env',key+'='+value]
|
||||
if db:
|
||||
args+=['--tmpfs','/var/lib/mysql:rw,nosuid,nodev,size=512m,uid=10000,gid=10000',
|
||||
'--tmpfs','/run/mysqld:rw,nosuid,nodev,size=16m,uid=10000,gid=10000',
|
||||
'--entrypoint','/bin/sh',image,'-c',
|
||||
'timeout -k 3 1200 setpriv --reuid=10000 --regid=10000 --clear-groups /opt/jobjakt/db-start.sh >/tmp/launcher.log 2>&1; '
|
||||
'printf "%s" "$?" >/broker-result/database-exit; sleep 120']
|
||||
else:
|
||||
args+=['--entrypoint','/usr/bin/python3' if self.policy['imageKinds'][image]=='web' else '/usr/local/bin/python',
|
||||
image,'-I','/opt/jobjakt/executor_supervisor.py']
|
||||
resource['id']=self.command(args).decode().strip()
|
||||
atomic(self.directory/'leases'/(lease['nonce']+'.json'),lease)
|
||||
self.inspect(resource)
|
||||
return resource
|
||||
|
||||
def copy_in(self,resource,files):
|
||||
if set(files)!={'source.tar','supervisor.json'}: raise ExecutorError('Unexpected trusted transport membership')
|
||||
data=io.BytesIO()
|
||||
with tarfile.open(fileobj=data,mode='w') as archive:
|
||||
for name,raw in files.items():
|
||||
safe_name(name); item=tarfile.TarInfo(name);item.size=len(raw);item.mode=0o400
|
||||
archive.addfile(item,io.BytesIO(raw))
|
||||
python='/usr/bin/python3' if self.policy['imageKinds'][resource['image']]=='web' else '/usr/local/bin/python'
|
||||
self.command(['container','exec','--interactive','--user','0:0',resource['id'],python,'-I','-c',
|
||||
"import sys,tarfile,pathlib,os; t=tarfile.open(fileobj=sys.stdin.buffer,mode='r|'); t.extractall('/task',filter='data'); "
|
||||
"p=pathlib.Path('/task/ready.tmp'); p.write_text(str(os.getpid())); p.rename('/task/ready')"],
|
||||
input=data.getvalue(),timeout=60)
|
||||
|
||||
def collect(self,resource,directory):
|
||||
python='/usr/bin/python3' if self.policy['imageKinds'][resource['image']]=='web' else '/usr/local/bin/python'
|
||||
raw=self.command(['container','exec','--user','0:0',resource['id'],python,'-I','-c',
|
||||
"import sys,tarfile,pathlib; t=tarfile.open(fileobj=sys.stdout.buffer,mode='w|'); "
|
||||
"[t.add(str(p),arcname=p.name,recursive=False) for p in sorted(pathlib.Path('/broker-result').iterdir())]; t.close()"],timeout=60)
|
||||
# Do not extract an arbitrary tar into the host filesystem.
|
||||
reports=[]
|
||||
with tarfile.open(fileobj=io.BytesIO(raw)) as archive:
|
||||
for item in archive:
|
||||
if item.isdir(): continue
|
||||
name=item.name.removeprefix('./'); safe_name(name)
|
||||
if not item.isfile() or '/' in name or item.size>20*1024*1024:
|
||||
raise ExecutorError('Unsafe result transport')
|
||||
target=directory/name
|
||||
with target.open('xb') as stream: stream.write(archive.extractfile(item).read(item.size+1))
|
||||
reports.append(dict(path=name,sha256=sha(target)))
|
||||
return reports
|
||||
|
||||
def execute(self,request,expected,*,qualifying=False):
|
||||
from executor_catalog import SUITES
|
||||
allowed=self.policy['allowed'].get(request.get('stage','')+'/'+request.get('checkpoint',''),[])
|
||||
validate_request(request,expected,set(allowed)&set(SUITES))
|
||||
if request['policySha256']!=self.pin: raise ExecutorError('Wrong executor policy pin')
|
||||
if not qualifying: self.require_qualified()
|
||||
directory=self.directory/'runs'/request['requestId']
|
||||
if directory.exists(): raise ExecutorError('Duplicate/replayed test request')
|
||||
directory.mkdir(parents=True)
|
||||
spec=SUITES[request['suite']]
|
||||
if spec.get('blocked'): raise ExecutorError('Independent unavailable capability: '+spec['blocked'])
|
||||
raw=self.snapshot(request)
|
||||
lease=dict(nonce=uuid.uuid4().hex,request=request,resources=[],cleanup=False)
|
||||
record=dict(request=request,executorIdentity=self.policy['executorIdentity'],commandVersion=self.policy['catalogSha256'],
|
||||
startedUtc=utc(),status='NOT RUN',nativeExitCode=None,cleanup=False,reports=[],
|
||||
sourceArchiveSha256=hashlib.sha256(raw).hexdigest(),environment=self.policy['images'])
|
||||
atomic(directory/'request.json',request)
|
||||
try:
|
||||
network='none'
|
||||
if spec.get('database'):
|
||||
database=self.create(lease,self.policy['images']['database'],memory=1024,db=True)
|
||||
self.command(['container','start',database['id']]); network='container:'+database['id']
|
||||
for _ in range(90):
|
||||
alive=self.command(['container','exec','--user','10000:10000',database['id'],
|
||||
'/usr/bin/mariadb','--protocol=tcp','--skip-ssl','-h127.0.0.1','-ujt_executor','--password=jt-integration-only',
|
||||
'--batch','--skip-column-names','--execute','SELECT 1'],check=False)
|
||||
if alive.strip()==b'1': break
|
||||
exit_code=self.command(['container','exec','--user','0:0',database['id'],
|
||||
'/bin/cat','/broker-result/database-exit'],check=False).strip()
|
||||
if exit_code:
|
||||
record['fixtureExitCode']=int(exit_code)
|
||||
break
|
||||
if self.cancel(): raise ExecutorError('Test fixture preparation paused')
|
||||
time.sleep(1)
|
||||
if alive.strip()!=b'1':
|
||||
log=directory/'database-setup.log'
|
||||
log.write_bytes(self.command(['container','exec','--user','10000:10000',database['id'],
|
||||
'/usr/bin/head','-c','65536','/tmp/install.log','/tmp/mariadb.log','/tmp/launcher.log'],check=False))
|
||||
record['reports'].append(dict(path=log.name,sha256=sha(log)))
|
||||
raise ExecutorError('Disposable MariaDB failed readiness; inspect database-setup.log')
|
||||
image=self.policy['images'][spec['runtime']]
|
||||
resource=self.create(lease,image,network,memory=spec.get('memoryMiB',4096))
|
||||
supervisor=dict(suite=request['suite'],request=request,archiveSha256=record['sourceArchiveSha256'],
|
||||
timeoutSeconds=spec.get('timeoutSeconds',600),reportNames=spec.get('reports',[]),
|
||||
childArgv=spec['argv'])
|
||||
self.command(['container','start',resource['id']])
|
||||
self.copy_in(resource,{'source.tar':raw,'supervisor.json':json.dumps(supervisor).encode()})
|
||||
deadline=time.monotonic()+spec.get('timeoutSeconds',600)+30
|
||||
while time.monotonic()<deadline:
|
||||
if self.cancel(): raise ExecutorError('Test execution paused/interrupted')
|
||||
status=self.command(['container','exec','--user','0:0',resource['id'],
|
||||
'/bin/cat','/broker-result/process.json'],check=False)
|
||||
if status.strip(): break
|
||||
data=self.inspect(resource)
|
||||
if not data or not data['State']['Running']: raise ExecutorError('Supervisor terminated before sealing evidence')
|
||||
time.sleep(.5)
|
||||
else: raise ExecutorError('Supervisor collection deadline expired')
|
||||
record['reports']=self.collect(resource,directory)
|
||||
process=json.loads((directory/'process.json').read_text())
|
||||
if process['request']!=request: raise ExecutorError('Sealed process identity differs')
|
||||
if process.get('supervisorSha256')!=self.policy['codeSha256']['executor_supervisor.py']:
|
||||
raise ExecutorError('Executed supervisor source differs from qualified policy')
|
||||
if process.get('identity')!=dict(uid=10000,groups=[],capabilities='ZERO',noNewPrivileges=True):
|
||||
raise ExecutorError('Candidate privilege attestation missing')
|
||||
if process.get('remainingCandidateProcesses')!=0: raise ExecutorError('Candidate descendants survived')
|
||||
record.update(nativeExitCode=process['exitCode'],process=process,
|
||||
commandSpecification=spec)
|
||||
import controller
|
||||
record['nativeReports']=[]
|
||||
for report in spec.get('structured',[]):
|
||||
path=directory/report['path']
|
||||
if not path.is_file():
|
||||
record['nativeReports'].append(dict(path=report['path'],status='MISSING'))
|
||||
continue
|
||||
try:
|
||||
measured=controller.measure_report(path,report['format'])
|
||||
names=measured.pop('names')
|
||||
record['nativeReports'].append(dict(path=report['path'],status='MEASURED',
|
||||
membershipSha256=digest(sorted(names)),**measured))
|
||||
except (ValueError,KeyError,OSError,controller.ET.ParseError) as error:
|
||||
record['nativeReports'].append(dict(path=report['path'],status='INVALID',failure=str(error)[:300]))
|
||||
if process['exitCode']!=0 or process.get('failure'): raise ExecutorError('Native test process failed')
|
||||
if int(process.get('memoryEvents',{}).get('oom_kill','0')):
|
||||
raise ExecutorError('Executor memory limit killed a process')
|
||||
results=[]
|
||||
for report in spec.get('structured',[]):
|
||||
expected_names=self.policy['membership'].get(request['suite'])
|
||||
if not expected_names: raise ExecutorError('Required exact test membership is unqualified')
|
||||
report_path=directory/report['path']
|
||||
if report['format']=='jest':
|
||||
data=json.loads(report_path.read_text(encoding='utf-8-sig'))
|
||||
for suite in data['testResults']:
|
||||
name=suite['name'].replace('\\','/')
|
||||
marker='/job-tracker-ui/'
|
||||
if marker not in name: raise ExecutorError('Unexpected Jest source identity')
|
||||
name='job-tracker-ui/'+name.rsplit(marker,1)[1]
|
||||
for case in suite['assertionResults']: case['fullName']=name+'::'+case['fullName']
|
||||
report_path=directory/'normalized-jest.json';atomic(report_path,data)
|
||||
record['reports'].append(dict(path=report_path.name,sha256=sha(report_path),derivedFrom=report['path']))
|
||||
results.append(controller.parse_report(report_path,
|
||||
dict(format=report['format'],minimumPassed=1,expectedNames=expected_names)))
|
||||
record.update(status='PASSED',checks=results)
|
||||
except (Exception,KeyboardInterrupt) as error:
|
||||
record.update(status='FAILED' if record['nativeExitCode'] is not None else 'BLOCKED',failure=str(error)[:600])
|
||||
finally:
|
||||
try: self.cleanup(lease); record['cleanup']=True
|
||||
except Exception as error: record.update(status='BLOCKED',cleanup=False,cleanupFailure=str(error)[:400])
|
||||
record['finishedUtc']=utc(); atomic(directory/'receipt.json',record)
|
||||
return dict(receipt=record,receiptSha256=digest(record),directory=str(directory))
|
||||
+164
-16
@@ -38,6 +38,7 @@ STATUSES = {'PENDING', 'READY', 'RUNNING', 'BLOCKED', 'AWAITING_APPROVAL', 'FAIL
|
||||
'CONDITIONALLY_ACCEPTED', 'ACCEPTED', 'COMPLETED'}
|
||||
OUTCOMES = {'complete', 'checkpoint', 'blocked', 'approval', 'conditional', 'failed'}
|
||||
SAFE_BRANCH = re.compile(r'^(?:codex|feature|planning|test)/[A-Za-z0-9][A-Za-z0-9/_-]*$')
|
||||
CODEX_SHUTDOWN_GRACE_SECONDS = 60
|
||||
|
||||
|
||||
def utc():
|
||||
@@ -166,6 +167,19 @@ def validate_manifest(m, root=None):
|
||||
if check['id'] in check_ids or not check.get('argv'):
|
||||
raise GateError('Duplicate check or empty test command')
|
||||
check_ids.add(check['id'])
|
||||
if check.get('adapter') == 'confined-composite':
|
||||
from executor_catalog import SUITES
|
||||
if (check['argv']!=['confined-composite'] or check['cwd']!='.' or check.get('report') is not None
|
||||
or not re.fullmatch('[a-f0-9]{64}',check.get('executorPolicySha256',''))
|
||||
or not check.get('suiteIds') or len(set(check['suiteIds']))!=len(check['suiteIds'])
|
||||
or any(s not in SUITES or SUITES[s].get('blocked') for s in check['suiteIds'])):
|
||||
raise GateError('Invalid fixed confined-composite adapter')
|
||||
if check.get('receipt'):
|
||||
if (not m.get('executionScope') or s['id']!='PHASE-10' or cp['id']!='P10-00'
|
||||
or not re.fullmatch('[a-f0-9]{64}',check.get('receiptSha256',''))):
|
||||
raise GateError('Historical source reuse is restricted to capped P10-00 assessment')
|
||||
if root and sha_file(under(root,check['receipt']))!=check['receiptSha256']:
|
||||
raise GateError('Historical source receipt changed')
|
||||
if check.get('adapter') == 'assessment-evidence-inspection':
|
||||
if not m.get('executionScope') or not re.fullmatch(r'[0-9a-f]{64}',check.get('receiptSha256','')):
|
||||
raise GateError('Assessment adapter requires a restricted policy and pinned receipt')
|
||||
@@ -276,10 +290,10 @@ class RepoLock:
|
||||
self.stream.close()
|
||||
|
||||
|
||||
def parse_report(path, spec):
|
||||
"""Count assertions independently, require membership, and reject skips/failures."""
|
||||
fmt = spec['format']
|
||||
def measure_report(path, fmt):
|
||||
"""Measure native outcomes, including failures; this does not accept the report."""
|
||||
names, passed, failed, skipped = [], 0, 0, 0
|
||||
global_error = None
|
||||
if fmt == 'trx':
|
||||
tree = ET.parse(path)
|
||||
for node in tree.iter():
|
||||
@@ -300,7 +314,7 @@ def parse_report(path, spec):
|
||||
elif fmt == 'jest':
|
||||
data = read_json(path)
|
||||
if data.get('success') is not True:
|
||||
raise GateError('Jest success flag is false')
|
||||
global_error = 'Jest success flag is false'
|
||||
for suite in data['testResults']:
|
||||
for case in suite['assertionResults']:
|
||||
names.append(case['fullName'])
|
||||
@@ -310,7 +324,7 @@ def parse_report(path, spec):
|
||||
else:
|
||||
data = read_json(path)
|
||||
if data.get('errors'):
|
||||
raise GateError('Playwright global errors')
|
||||
global_error = 'Playwright global errors'
|
||||
def visit(suites):
|
||||
nonlocal passed, failed, skipped
|
||||
for suite in suites:
|
||||
@@ -320,10 +334,20 @@ def parse_report(path, spec):
|
||||
results = case.get('results', [])
|
||||
ok = (len(results) == 1 and results[0]['status'] == 'passed'
|
||||
and case.get('expectedStatus', 'passed') == 'passed')
|
||||
skip = case.get('expectedStatus')=='skipped' or bool(results) and all(r['status']=='skipped' for r in results)
|
||||
passed += ok
|
||||
failed += not ok
|
||||
skipped += skip
|
||||
failed += not ok and not skip
|
||||
visit(suite.get('suites', []))
|
||||
visit(data['suites'])
|
||||
return dict(names=names,passed=passed,failed=failed,skipped=skipped,globalError=global_error)
|
||||
|
||||
|
||||
def parse_report(path, spec):
|
||||
"""Require exact membership and reject every skip, failure or global error."""
|
||||
measured=measure_report(path,spec['format'])
|
||||
names,passed,failed,skipped=(measured[k] for k in ('names','passed','failed','skipped'))
|
||||
if measured['globalError']: raise GateError(measured['globalError'])
|
||||
if not names or passed < spec.get('minimumPassed', 1) or failed or skipped:
|
||||
raise GateError(f'Invalid/empty/skipped/failing report: passed={passed}, failed={failed}, skipped={skipped}')
|
||||
expected = spec.get('expectedNames', [])
|
||||
@@ -446,7 +470,7 @@ class ProcessRunner:
|
||||
return ['-c','sandbox_mode="workspace-write"','-c','approval_policy="never"',
|
||||
'-c','sandbox_workspace_write.network_access=false']
|
||||
|
||||
def supervise(self, engine, argv, directory, seconds, stdin=None, cwd=None):
|
||||
def supervise(self, engine, argv, directory, seconds, stdin=None, cwd=None, codex_events=False):
|
||||
directory.mkdir(parents=True, exist_ok=True)
|
||||
env = {k: v for k, v in os.environ.items() if k.upper() in {
|
||||
'PATH', 'SYSTEMROOT', 'WINDIR', 'TEMP', 'TMP', 'USERPROFILE', 'LOCALAPPDATA',
|
||||
@@ -467,7 +491,10 @@ class ProcessRunner:
|
||||
# Reader threads drain both pipes; logs are local, redacted, bounded, and never notifications.
|
||||
import threading
|
||||
log_error = []
|
||||
def drain(stream, target):
|
||||
completed_at = []
|
||||
shutdown_timed_out = False
|
||||
forced_termination = False
|
||||
def drain(stream, target, inspect_events=False):
|
||||
total, pending = 0, b''
|
||||
with open(target, 'w', encoding='utf-8', newline='') as output:
|
||||
while chunk := stream.read1(8192):
|
||||
@@ -484,6 +511,13 @@ class ProcessRunner:
|
||||
continue
|
||||
while b'\n' in pending:
|
||||
line, pending = pending.split(b'\n', 1)
|
||||
if inspect_events and not completed_at:
|
||||
try:
|
||||
event=json.loads(line)
|
||||
if isinstance(event,dict) and event.get('type') in ('turn.completed','turn.failed'):
|
||||
completed_at.append(time.monotonic())
|
||||
except (ValueError,UnicodeError):
|
||||
pass # Full stream validation still rejects malformed CLI events.
|
||||
output.write(redact(line.rstrip(b'\r').decode('utf-8', errors='replace')) + '\n')
|
||||
output.flush()
|
||||
if pending and not log_error:
|
||||
@@ -500,13 +534,16 @@ class ProcessRunner:
|
||||
if job:
|
||||
job.assign(process)
|
||||
job.resume(process) # no worker instruction can execute before containment
|
||||
threads = [threading.Thread(target=drain, args=(process.stdout, directory / 'stdout.log'), daemon=True),
|
||||
threads = [threading.Thread(target=drain, args=(process.stdout, directory / 'stdout.log', codex_events), daemon=True),
|
||||
threading.Thread(target=drain, args=(process.stderr, directory / 'stderr.log'), daemon=True)]
|
||||
for thread in threads:
|
||||
thread.start()
|
||||
while process.poll() is None:
|
||||
if (engine.root / 'pause.request').exists():
|
||||
raise Interrupted('Owner requested pause')
|
||||
if completed_at and time.monotonic()-completed_at[0] > CODEX_SHUTDOWN_GRACE_SECONDS:
|
||||
shutdown_timed_out = True
|
||||
raise Interrupted('Codex shutdown stalled after terminal turn event; process tree stopped, handoff not accepted')
|
||||
if time.monotonic() - started > seconds or time.monotonic() > engine.deadline:
|
||||
raise Interrupted('Session/run time budget exceeded')
|
||||
if not engine.in_window():
|
||||
@@ -517,6 +554,7 @@ class ProcessRunner:
|
||||
if process.returncode:
|
||||
raise GateError(f'Process exited {process.returncode}; see redacted local logs')
|
||||
finally:
|
||||
forced_termination = process is not None and process.poll() is None
|
||||
if job:
|
||||
job.close() # closes/kills all descendants, including on normal parent-child completion
|
||||
if process is not None and process.poll() is None:
|
||||
@@ -534,6 +572,10 @@ class ProcessRunner:
|
||||
process.stdout.close()
|
||||
process.stderr.close()
|
||||
self.child = None
|
||||
if process is not None:
|
||||
atomic(directory/'process.json',dict(nativeExitCode=process.returncode,
|
||||
forcedTermination=forced_termination,shutdownTimedOut=shutdown_timed_out,
|
||||
terminalTurnSeen=bool(completed_at),finishedUtc=utc()))
|
||||
(engine.root / 'active-process.json').unlink(missing_ok=True)
|
||||
if log_error:
|
||||
raise GateError(log_error[0])
|
||||
@@ -548,7 +590,7 @@ class ProcessRunner:
|
||||
'--output-schema', str(engine.root / 'schemas/result.schema.json'),
|
||||
'--output-last-message', str(result), '--cd', str(engine.repo), '-')
|
||||
# Output is written by the CLI parent, not a model shell; worker cannot write protected state.
|
||||
self.supervise(engine, argv, directory, engine.config['maxSessionSeconds'], stdin=prompt)
|
||||
self.supervise(engine, argv, directory, engine.config['maxSessionSeconds'], stdin=prompt,codex_events=True)
|
||||
events = []
|
||||
for line in (directory / 'stdout.log').read_text(encoding='utf-8').splitlines():
|
||||
if not line.strip():
|
||||
@@ -569,6 +611,9 @@ class ProcessRunner:
|
||||
or not isinstance(data['blockers'], list) or not isinstance(data['requestedApprovals'], list)
|
||||
or not all(isinstance(x, str) for x in data['blockers'] + data['requestedApprovals'])):
|
||||
raise GateError('Invalid structured handoff')
|
||||
if data['outcome']=='complete' and (data['blockers'] or data['requestedApprovals']):
|
||||
raise GateError('Complete handoff contains blockers/approval requests; return blocked/approval for unresolved scope. '
|
||||
'Controller-owned pending checks and later-stage limitations belong in the summary/report, not blockers.')
|
||||
return data
|
||||
|
||||
def run_check(self, engine, check, directory):
|
||||
@@ -576,6 +621,36 @@ class ProcessRunner:
|
||||
raise GateError('Evidence inspection cannot replace command-running composite qualification')
|
||||
if local_mode.single(engine.config):
|
||||
local_mode.require_unattended(engine.root,engine.config)
|
||||
if check.get('adapter') == 'confined-composite':
|
||||
import confined_executor as executor
|
||||
context=engine.check_context
|
||||
broker=engine.executor(check)
|
||||
receipts=[]
|
||||
deadline=min(engine.deadline,time.monotonic()+engine.config['maxCheckSeconds'])
|
||||
broker.cancel=lambda:(engine.root/'pause.request').exists() or time.monotonic()>deadline
|
||||
for suite in check['suiteIds']:
|
||||
request={k:context[k] for k in ('stage','checkpoint','commit','branch')}
|
||||
request.update(suite=suite,policySha256=check['executorPolicySha256'],requestId=uuid.uuid4().hex)
|
||||
result=broker.execute(request,dict(request))
|
||||
receipts.append(result)
|
||||
# Failed logs are available to the worker without exposing trusted receipts or controls.
|
||||
public=engine.root/'sanitized-tests'/request['requestId'];public.mkdir(parents=True)
|
||||
summary=dict(suite=suite,status=result['receipt']['status'],nativeExitCode=result['receipt']['nativeExitCode'],
|
||||
failure=redact(result['receipt'].get('failure','')),checks=result['receipt'].get('checks',[]),
|
||||
nativeReports=result['receipt'].get('nativeReports',[]))
|
||||
atomic(public/'summary.json',summary)
|
||||
for name in ('stdout.log','stderr.log','browser-context.txt'):
|
||||
path=Path(result['directory'])/name
|
||||
if path.is_file(): (public/name).write_text(redact(path.read_text(encoding='utf-8',errors='replace')),encoding='utf-8')
|
||||
if broker.cancel(): raise Interrupted('Confined tests paused or session budget reached')
|
||||
try: executor.verify_receipt(result['directory'],result['receipt'],result['receiptSha256'],request)
|
||||
except executor.ExecutorError as error:
|
||||
raise GateError(f'Confined suite {suite}: {error}; sanitized feedback: {public}') from error
|
||||
answer=dict(id=check['id'],exitCode=0,failed=0,report=None,executorReceipts=receipts)
|
||||
if check.get('receipt'):
|
||||
answer['reusedEvidence']={k:check[k] for k in ('receipt','receiptSha256')}
|
||||
atomic(directory/'verification.json',answer)
|
||||
return answer
|
||||
working = engine.repo if check['cwd'] == '.' else under(engine.repo, check['cwd'])
|
||||
report_spec = check.get('report')
|
||||
report = None
|
||||
@@ -683,7 +758,9 @@ class Engine:
|
||||
|
||||
def policy_hash(self):
|
||||
files = ['controller.py', 'local_mode.py', 'assessment_adapter.py', 'Probe-JobjaktSandbox.ps1',
|
||||
'Approve-JobjaktBacklog.ps1', 'config.json', 'schemas/result.schema.json']
|
||||
'Approve-JobjaktBacklog.ps1', 'config.json', 'schemas/result.schema.json',
|
||||
'confined_executor.py','executor_catalog.py','executor_supervisor.py','executor_driver.py','executor-policy.json',
|
||||
'executor_cli.py','provision_executor.py','verify_nuget_cache.ps1']
|
||||
return digest({name: sha_file(self.root / name) for name in files if (self.root / name).exists()})
|
||||
|
||||
def verify_approval(self, request):
|
||||
@@ -901,6 +978,16 @@ class Engine:
|
||||
chunks.append(f'\nFULL PRIOR ACCEPTANCE ARTIFACT {evidence["path"]}\n' + path.read_text(encoding='utf-8-sig'))
|
||||
chunks.append('\nPRIOR CONTROLLER REPORTS\n' + json.dumps(state['recentSessions'][-12:], ensure_ascii=False))
|
||||
chunks.append('\nVERIFIED OWNER DECISIONS\n' + json.dumps(state['ownerDecisions'], ensure_ascii=False))
|
||||
if any(check.get('adapter')=='confined-composite' for check in cp['checks']):
|
||||
chunks.append('\nTRUSTED TEST EXECUTION: The controller runs the approved fixed suite IDs against an immutable '
|
||||
'candidate commit after a complete handoff. Complete means ready for those independent checks. '
|
||||
'For complete, blockers and requestedApprovals must be empty. Pending controller-owned checks, '
|
||||
'later-stage gates, production NO-GO and an assessment finding of no safe deletion candidate '
|
||||
'are documented limitations, not blockers to delivering the assessment. Actual unresolved '
|
||||
'checkpoint requirements must instead return blocked/approval; never hide them or waive a gate. '
|
||||
'Keep unexecuted checks labelled NOT RUN; test evidence and advancement belong to the controller. '
|
||||
'Use sanitized failure summaries/logs at '+str(self.root/'sanitized-tests')+' for remediation. '
|
||||
'The worker does not need host SDK, Docker, approval-store or private-receipt access.')
|
||||
chunks.append('\nACTIVE CHECKPOINT ONLY\n' + json.dumps(dict(stage=stage['id'], checkpoint=cp,
|
||||
integrationCommit=state['integrationCommit'], lastResult=ss['lastResult'],
|
||||
priorEvidence=ss['evidence'], failures=ss['failures'][-5:],
|
||||
@@ -924,6 +1011,19 @@ checkpoint; complete means ready for independent checks. Do not infer acceptance
|
||||
if not path.is_file() or sha_file(path) != artifact['sha256']:
|
||||
raise GateError('Checkpoint evidence changed since verification')
|
||||
for check in ss['verifiedChecks']:
|
||||
if check.get('reusedEvidence'):
|
||||
item=check['reusedEvidence']
|
||||
assessment_adapter.verify(self.repo,under(self.root,item['receipt']),item['receiptSha256'])
|
||||
for entry in check.get('executorReceipts',[]):
|
||||
import confined_executor as executor
|
||||
directory=Path(entry['directory'])
|
||||
if directory.resolve()!=self.root/'executor/runs'/entry['receipt']['request']['requestId']:
|
||||
raise GateError('Private executor evidence directory changed')
|
||||
receipt=read_json(directory/'receipt.json')
|
||||
if receipt['request']['commit']!=ss.get('verificationCandidate'):
|
||||
raise GateError('Executor tested a different candidate')
|
||||
try: executor.verify_receipt(directory,receipt,entry['receiptSha256'],entry['receipt']['request'])
|
||||
except executor.ExecutorError as error: raise GateError(str(error)) from error
|
||||
if check.get('report'):
|
||||
report = Path(check['report']['path'])
|
||||
if not report.is_file() or sha_file(report) != check['report']['sha256']:
|
||||
@@ -962,6 +1062,10 @@ checkpoint; complete means ready for independent checks. Do not infer acceptance
|
||||
if not cp['checks'] or any(check.get('adapter') == 'assessment-evidence-inspection'
|
||||
or not check.get('configured', True) for check in cp['checks']):
|
||||
raise GateError('Independent test adapters must be configured and owner-qualified before execution')
|
||||
for check in cp['checks']:
|
||||
if check.get('adapter')=='confined-composite':
|
||||
try: self.executor(check).require_qualified()
|
||||
except (RuntimeError,OSError,ValueError,KeyError) as error: raise GateError(str(error)) from error
|
||||
ss['attempts'] += 1
|
||||
ss['sessions'] += 1
|
||||
ss['status'] = 'RUNNING'
|
||||
@@ -998,6 +1102,19 @@ checkpoint; complete means ready for independent checks. Do not infer acceptance
|
||||
ss['attempts'] -= 1 # bounded by total sessions, not an ordinary failure
|
||||
self.store.write(state)
|
||||
return True
|
||||
candidate = None
|
||||
candidate_content = None
|
||||
if any(check.get('adapter') == 'confined-composite' for check in cp['checks']):
|
||||
candidate_content = self.content_hash()
|
||||
self.git('add','--all')
|
||||
if self.content_hash() != candidate_content:
|
||||
raise GateError('Candidate changed while preparing its immutable test commit')
|
||||
candidate = self.git('commit-tree',self.git('write-tree'),'-p',ss['checkpointBase'],
|
||||
'-m',f'{stage["id"]}: {cp["id"]} validated checkpoint\n\nOrchestrator-Checkpoint: {session_id}')
|
||||
ss['verificationCandidate'] = candidate
|
||||
self.check_context = dict(stage=stage['id'],checkpoint=cp['id'],commit=candidate,
|
||||
branch=stage['branch'],parent=ss['checkpointBase'])
|
||||
self.store.write(state)
|
||||
ss['verifiedChecks'] = []
|
||||
for check in cp['checks']:
|
||||
ss['verifiedChecks'].append(self.runner.run_check(self, check, directory / 'checks' / check['id']))
|
||||
@@ -1012,13 +1129,17 @@ checkpoint; complete means ready for independent checks. Do not infer acceptance
|
||||
raise GateError('Complete result still contains blockers/approval requests')
|
||||
# Pin tested content before Git hooks or unrelated processes can alter it.
|
||||
before = self.content_hash()
|
||||
if candidate and before != candidate_content:
|
||||
raise GateError('Source changed after the exact candidate commit was tested')
|
||||
ss['testedContentSha256'] = before
|
||||
ss['verificationPrepared'] = True
|
||||
self.store.write(state) # crash after commit can reconcile only these independently verified bytes
|
||||
self.git('add', '--all')
|
||||
if self.content_hash() != before:
|
||||
raise GateError('Worktree changed during verification/commit')
|
||||
if self.git('diff', '--cached', '--name-only'):
|
||||
if candidate:
|
||||
self.git('update-ref','refs/heads/'+stage['branch'],candidate,ss['checkpointBase'])
|
||||
elif self.git('diff', '--cached', '--name-only'):
|
||||
self.git('commit', '-m', f'{stage["id"]}: {cp["id"]} validated checkpoint\n\nOrchestrator-Checkpoint: {session_id}')
|
||||
ss['checkpointCommit'] = self.git('rev-parse', 'HEAD')
|
||||
ss['pendingPublication'] = ss['checkpointCommit']
|
||||
@@ -1048,6 +1169,19 @@ checkpoint; complete means ready for independent checks. Do not infer acceptance
|
||||
if deleted or any(name and (not name.startswith(prefix) or not name.endswith('.md')) for name in changed):
|
||||
raise GateError('Read-only assessment modified a forbidden path or deleted a file')
|
||||
|
||||
def executor(self,check):
|
||||
import confined_executor as executor
|
||||
try:
|
||||
if check.get('receipt'):
|
||||
assessment_adapter.verify(self.repo,under(self.root,check['receipt']),check['receiptSha256'])
|
||||
broker=executor.Broker(self.root,self.repo,read_json(self.root/'executor-policy.json'),check['executorPolicySha256'])
|
||||
if any(not lease.get('cleanup') for lease in
|
||||
(read_json(path) for path in (self.root/'executor/leases').glob('*.json'))):
|
||||
raise GateError('Unreconciled executor resources; run executor recovery first')
|
||||
return broker
|
||||
except (executor.ExecutorError,OSError,ValueError,KeyError) as error:
|
||||
raise GateError('Confined executor unavailable: '+str(error)) from error
|
||||
|
||||
def content_hash(self):
|
||||
# Git blob hashes include tracked modifications and untracked source without reading secrets into logs.
|
||||
files = self.git('ls-files', '--cached', '--others', '--exclude-standard', '-z').split('\0')
|
||||
@@ -1208,11 +1342,15 @@ def status(engine):
|
||||
for stage in engine.manifest['stages']:
|
||||
ss = state['stages'][stage['id']]
|
||||
checks = ss['verifiedChecks'] or ss.get('lastVerifiedChecks', [])
|
||||
suites=[dict(suite=entry['receipt']['request']['suite'],commit=entry['receipt']['request']['commit'],
|
||||
nativeExitCode=entry['receipt']['nativeExitCode'],reports=entry['receipt'].get('nativeReports',[]))
|
||||
for check in checks for entry in check.get('executorReceipts',[])]
|
||||
stages.append(dict(id=stage['id'], status=ss['status'],
|
||||
checkpoint=stage['checkpoints'][ss['checkpoint']]['id'] if ss['checkpoint'] < len(stage['checkpoints']) else 'done',
|
||||
branch=stage['branch'], latestVerifiedCommit=ss['latestCommit'],
|
||||
attempts=ss['attempts'], sessions=ss['sessions'], requiredOwnerAction=ss['awaiting'],
|
||||
testsPassed=sum(x.get('passed') or 0 for x in checks), testsFailed=sum(x.get('failed') or 0 for x in checks),
|
||||
testsPassed=None if suites else sum(x.get('passed') or 0 for x in checks),
|
||||
testsFailed=sum(x.get('failed') or 0 for x in checks),testSuites=suites,
|
||||
testState='VERIFIED' if checks else 'NOT_RUN',
|
||||
reports=ss['reports']))
|
||||
return dict(mode=engine.config.get('mode','dedicated-runner'),
|
||||
@@ -1232,7 +1370,8 @@ def install(source, root, repository, mode='dedicated-runner'):
|
||||
if root.is_relative_to(repo) or repo.is_relative_to(root):
|
||||
raise GateError('Install control plane outside worker checkout')
|
||||
root.mkdir(parents=True)
|
||||
for name in ('controller.py', 'local_mode.py', 'assessment_adapter.py', 'backlog.json', 'config.example.json'):
|
||||
for name in ('controller.py', 'local_mode.py', 'assessment_adapter.py', 'backlog.json', 'config.example.json',
|
||||
'confined_executor.py','executor_catalog.py','executor_supervisor.py','executor_driver.py','provision_executor.py','verify_nuget_cache.ps1','executor_cli.py'):
|
||||
shutil.copyfile(source / name, root / name)
|
||||
for name in ('schemas', 'prompts'):
|
||||
shutil.copytree(source / name, root / name)
|
||||
@@ -1253,7 +1392,8 @@ def main(argv=None):
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('command', choices=['init', 'validate', 'dry-run', 'start', 'resume', 'status',
|
||||
'pause', 'retry', 'current', 'logs', 'recover', 'configure',
|
||||
'setup','auth','auth-status','qualify','approve','prepare','prepare-entry','key','enable-unattended'])
|
||||
'setup','auth','auth-status','qualify','approve','prepare','prepare-entry','key','enable-unattended',
|
||||
'executor-status','executor-validate','executor-qualify','executor-recover'])
|
||||
parser.add_argument('--control-root', type=Path, required=True)
|
||||
parser.add_argument('--repository')
|
||||
parser.add_argument('--stage')
|
||||
@@ -1271,8 +1411,10 @@ def main(argv=None):
|
||||
and not read_json(root/'backlog.json')['executionEnabled']
|
||||
and not any(s['sessions'] for s in state['stages'].values())):
|
||||
with RepoLock(Path(existing['repository'])):
|
||||
for name in ('controller.py','local_mode.py','assessment_adapter.py'):
|
||||
for name in ('controller.py','local_mode.py','assessment_adapter.py','confined_executor.py',
|
||||
'executor_catalog.py','executor_supervisor.py','executor_driver.py','provision_executor.py','verify_nuget_cache.ps1','executor_cli.py'):
|
||||
shutil.copyfile(source/name,root/name)
|
||||
shutil.copyfile(source/'schemas/backlog.schema.json',root/'schemas/backlog.schema.json')
|
||||
for name in ('Run-JobjaktBacklog.ps1','Approve-JobjaktBacklog.ps1','Probe-JobjaktSandbox.ps1',
|
||||
'Use-JobjaktBacklog.ps1','Register-JobjaktBacklogTask.ps1'):
|
||||
shutil.copyfile(source.parent/'scripts'/name,root/name)
|
||||
@@ -1284,6 +1426,11 @@ def main(argv=None):
|
||||
print('Initialized disabled queue. Review protected config, identities, source gaps and gates before authorization.')
|
||||
return 0
|
||||
engine = Engine(root, read_json(root / 'backlog.json'), read_json(root / 'config.json'))
|
||||
if args.command.startswith('executor-'):
|
||||
import executor_cli
|
||||
options=[args.command.removeprefix('executor-'),'--control-root',str(root)]
|
||||
if args.repository: options+=['--repository',args.repository]
|
||||
return executor_cli.main(options)
|
||||
if args.command in ('key','enable-unattended'):
|
||||
if not local_mode.single(engine.config) or not sys.stdin.isatty() or os.environ.get('JOBBJAKT_ORCHESTRATED'):
|
||||
raise GateError('Run this single-user operator action yourself from an interactive PowerShell terminal')
|
||||
@@ -1402,6 +1549,7 @@ def main(argv=None):
|
||||
for check in cp['checks']:
|
||||
if check.get('adapter') == 'assessment-evidence-inspection' or not check.get('configured'):
|
||||
raise GateError('P10-00 composite adapter is not qualified')
|
||||
if check.get('adapter')=='confined-composite': engine.executor(check).require_qualified()
|
||||
for kind in ['environment-qualified','roadmap-execution',*stage['requiredOwnerApprovals'],*cp['approvalsBefore']]:
|
||||
if not engine.request(stage,cp,kind,state):
|
||||
print('Protected entry request prepared; approve it and run prepare-entry again. No worker launched.')
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
"""Owner-reviewed command identities. Request parameters never become shell commands."""
|
||||
VERSION=1
|
||||
BACKEND_FILTER='FullyQualifiedName~LocalAuthIdentityTests|FullyQualifiedName~ApiAuthorizationPostureTests|FullyQualifiedName~AdminProcessingControllerTests'
|
||||
FRONTEND_FILE='src/account-security-presentation.test.tsx'
|
||||
CV_GREP=r'\[PRE-P10 A\] en blank CV survives'
|
||||
PDF_GREP='light/en document controls preserve settings'
|
||||
|
||||
|
||||
def suite(runtime,*,report=None,fmt=None,database=False,seconds=600,memory=4096):
|
||||
result=dict(runtime=runtime,database=database,timeoutSeconds=seconds,memoryMiB=memory,
|
||||
reports=[report] if report else [],structured=[dict(path=report,format=fmt)] if fmt else [],
|
||||
argv=['/usr/bin/python3' if runtime=='web' else '/opt/docling/bin/python' if runtime=='docling' else '/usr/local/bin/python',
|
||||
'-I','/opt/jobjakt/executor_driver.py'])
|
||||
if report=='browser.json':
|
||||
result['reports'].append('browser-context.txt')
|
||||
result['fixtureProfile']='repository-static-export'
|
||||
return result
|
||||
|
||||
|
||||
SUITES={
|
||||
'backend-canary':suite('web',report='backend.trx',fmt='trx'),
|
||||
'backend-full':suite('web',report='backend.trx',fmt='trx',seconds=1200),
|
||||
'mariadb-canary':suite('web',report='mariadb.trx',fmt='trx',database=True),
|
||||
'rd21-canary':suite('web',report='mariadb.trx',fmt='trx',database=True),
|
||||
'mariadb-full':suite('web',report='mariadb.trx',fmt='trx',database=True,seconds=1200),
|
||||
'frontend-canary':suite('web',report='frontend.json',fmt='jest'),
|
||||
'frontend-full':suite('web',report='frontend.json',fmt='jest',seconds=1200),
|
||||
'typecheck':suite('web'), 'lint':suite('web'), 'build':suite('web',seconds=900,memory=6144),
|
||||
'browser-canary':suite('web',report='browser.json',fmt='playwright',seconds=900,memory=8192),
|
||||
'pdf-linux-canary':suite('web',report='browser.json',fmt='playwright',seconds=900,memory=8192),
|
||||
'browser-full':suite('web',report='browser.json',fmt='playwright',seconds=1800,memory=8192),
|
||||
'python-canary':suite('python',report='python.xml',fmt='junit',memory=2048),
|
||||
'parser-security':suite('python',report='python.xml',fmt='junit',memory=2048),
|
||||
'python-full':suite('python',report='python.xml',fmt='junit',memory=4096),
|
||||
'docling-canary':suite('docling',report='python.xml',fmt='junit',memory=4096),
|
||||
'boundary-canary':suite('python',report='boundary.json',memory=256),
|
||||
'failure-canary':suite('python',seconds=10,memory=256),
|
||||
'timeout-canary':suite('python',seconds=2,memory=256),
|
||||
'memory-limit-canary':suite('python',seconds=20,memory=256),
|
||||
'interrupt-canary':suite('python',seconds=30,memory=256),
|
||||
'log-limit-canary':suite('python',seconds=10,memory=256),
|
||||
'symlink-report-canary':suite('python',report='evil.json',seconds=10,memory=256),
|
||||
'windows-pdf':dict(blocked='A separately qualified Windows native exporter is required'),
|
||||
'licensed-provider':dict(blocked='Provider-specific rights and isolated credentials require a separate protected gate'),
|
||||
'live-model':dict(blocked='Real model compatibility/accuracy is not authorised or qualified'),
|
||||
'hosted-ci':dict(blocked='Hosted runner isolation is independently blocked'),
|
||||
'security-scanners':dict(blocked='Current advisory/scanner feeds require independently qualified offline inputs'),
|
||||
}
|
||||
for name,spec in SUITES.items():
|
||||
if 'argv' in spec: spec['argv']=[*spec['argv'],name]
|
||||
|
||||
CANARIES=['backend-canary','frontend-canary','typecheck','lint','build','browser-canary',
|
||||
'mariadb-canary','rd21-canary','python-canary','parser-security','docling-canary','pdf-linux-canary']
|
||||
@@ -0,0 +1,137 @@
|
||||
"""Operator-only runtime qualification; never launches a roadmap/model session."""
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
import uuid
|
||||
import time
|
||||
import subprocess
|
||||
import sys
|
||||
import confined_executor as x
|
||||
from executor_catalog import CANARIES
|
||||
|
||||
NEGATIVES={'failure-canary':7,'timeout-canary':-9,'memory-limit-canary':-9,'interrupt-canary':None,'log-limit-canary':None,'symlink-report-canary':0}
|
||||
|
||||
|
||||
def crash_recovery(broker,branch):
|
||||
request=dict(stage='RUNTIME-QUALIFICATION',checkpoint='CANARY',commit=broker.policy['baselineCommit'],
|
||||
branch=branch,suite='timeout-canary',policySha256=broker.pin,requestId=uuid.uuid4().hex)
|
||||
script="import sys,json;sys.path.insert(0,sys.argv[1]);import confined_executor as x;r=json.loads(sys.argv[4]);p=json.load(open(sys.argv[2]+'/executor-policy.json'));x.Broker(sys.argv[2],sys.argv[3],p,x.digest(p)).execute(r,dict(r),qualifying=True)"
|
||||
child=subprocess.Popen([sys.executable,'-I','-c',script,str(Path(__file__).resolve().parent),str(broker.root),str(broker.repo),json.dumps(request)],
|
||||
stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
||||
lease=None;resource=None
|
||||
directory=broker.directory/'recovery'/request['requestId'];directory.mkdir(parents=True)
|
||||
try:
|
||||
deadline=time.monotonic()+60
|
||||
while time.monotonic()<deadline:
|
||||
if child.poll() is not None: raise x.ExecutorError('Recovery probe broker exited before controlled interruption')
|
||||
for path in (broker.directory/'leases').glob('*.json'):
|
||||
row=json.loads(path.read_text())
|
||||
if row.get('request')==request and row['resources'] and row['resources'][0].get('id'):
|
||||
lease=row;resource=row['resources'][0]
|
||||
if resource:
|
||||
raw=broker.command(['container','exec','--user','0:0',resource['id'],'/bin/cat','/task/ready'],check=False)
|
||||
if raw.strip().isdigit() and int(raw)>1: break
|
||||
time.sleep(.1)
|
||||
else: raise x.ExecutorError('Recovery probe candidate did not start')
|
||||
child.kill();broker_exit=child.wait(timeout=10)
|
||||
if broker_exit==0: raise x.ExecutorError('Recovery probe broker completed before the controlled kill')
|
||||
deadline=time.monotonic()+20
|
||||
while time.monotonic()<deadline:
|
||||
raw=broker.command(['container','exec','--user','0:0',resource['id'],'/bin/cat','/broker-result/process.json'],check=False)
|
||||
if raw.strip(): break
|
||||
time.sleep(.2)
|
||||
else: raise x.ExecutorError('Independent supervisor did not terminate the orphan candidate')
|
||||
reports=broker.collect(resource,directory)
|
||||
process=json.loads((directory/'process.json').read_text())
|
||||
if process['request']!=request or process['exitCode']!=-9 or process['failure']!='TIMEOUT' or process['remainingCandidateProcesses']!=0:
|
||||
raise x.ExecutorError('Orphan candidate watchdog failed')
|
||||
broker.recover()
|
||||
if broker.inspect(resource) is not None: raise x.ExecutorError('Recovered resource remains')
|
||||
proof=dict(status='PASSED',issuedUtc=x.utc(),request=request,brokerKilled=True,brokerExitCode=broker_exit,
|
||||
brokerPid=child.pid,process=process,reports=reports,cleanup=True)
|
||||
x.atomic(directory/'proof.json',proof)
|
||||
return dict(path=(directory/'proof.json').relative_to(broker.directory).as_posix(),sha256=x.sha(directory/'proof.json'))
|
||||
finally:
|
||||
if child.poll() is None: child.kill();child.wait(timeout=10)
|
||||
if lease: broker.recover()
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('command',choices=['status','validate','qualify','recover'])
|
||||
parser.add_argument('--control-root',type=Path,required=True)
|
||||
parser.add_argument('--repository',type=Path)
|
||||
parser.add_argument('--suite',choices=CANARIES+['boundary-canary',*NEGATIVES])
|
||||
args=parser.parse_args(argv);root=args.control_root.resolve()
|
||||
config=json.loads((root/'config.json').read_text())
|
||||
if args.command in ('qualify','recover'):
|
||||
import controller
|
||||
with controller.RepoLock(Path(config['repository'])): return operate(args,root,config)
|
||||
return operate(args,root,config)
|
||||
|
||||
|
||||
def operate(args,root,config):
|
||||
policy=json.loads((root/'executor-policy.json').read_text())
|
||||
repo=args.repository or Path(config['repository'])
|
||||
broker=x.Broker(root,repo,policy,x.digest(policy))
|
||||
if args.command=='status':
|
||||
path=broker.directory/'qualification.json'
|
||||
print(path.read_text() if path.exists() else json.dumps(dict(status='NOT RUN',policySha256=broker.pin)))
|
||||
return
|
||||
if args.command=='recover': broker.recover();print('Owned executor resources reconciled');return
|
||||
if args.command=='validate': broker.require_qualified();print('Executor policy and fresh private qualification verified');return
|
||||
# Qualify only frozen accepted source, while preserving the disabled actual queue.
|
||||
import controller
|
||||
state=controller.StateStore(root).read()
|
||||
enabled=json.loads((root/'backlog.json').read_text())['executionEnabled']
|
||||
if ((root/'active-process.json').exists() or any(s['status']=='RUNNING' for s in state['stages'].values())
|
||||
or enabled and not (root/'pause.request').exists()):
|
||||
raise x.ExecutorError('Qualification requires a disabled or paused idle roadmap queue')
|
||||
broker.git('merge-base','--is-ancestor',policy['baselineCommit'],'HEAD')
|
||||
branch=broker.git('branch','--show-current').decode().strip()
|
||||
path=broker.directory/'qualification.json'
|
||||
report=json.loads(path.read_text()) if path.exists() else {}
|
||||
if report.get('policySha256')!=broker.pin: report=dict(policySha256=broker.pin,runs=[])
|
||||
report.update(status='NOT RUN',issuedUtc=x.utc())
|
||||
broker.recover()
|
||||
for suite in [args.suite] if args.suite else ['boundary-canary',*NEGATIVES,*CANARIES]:
|
||||
print('Qualifying '+suite,flush=True)
|
||||
request=dict(stage='RUNTIME-QUALIFICATION',checkpoint='CANARY',commit=policy['baselineCommit'],
|
||||
branch=branch,suite=suite,policySha256=broker.pin,requestId=uuid.uuid4().hex)
|
||||
started=time.monotonic()
|
||||
broker.cancel=lambda:suite=='interrupt-canary' and time.monotonic()-started>5
|
||||
result=broker.execute(request,dict(request),qualifying=True)
|
||||
receipt=result['receipt'];positive=suite not in NEGATIVES
|
||||
valid=receipt['cleanup'] and (receipt['status']=='PASSED' if positive else receipt['status']=='BLOCKED' if suite=='interrupt-canary' else receipt['status']=='FAILED')
|
||||
if not positive:
|
||||
expected=NEGATIVES[suite]
|
||||
valid=valid and (expected is None or receipt['nativeExitCode']==expected)
|
||||
if suite=='timeout-canary': valid=valid and receipt.get('process',{}).get('failure')=='TIMEOUT'
|
||||
if suite=='log-limit-canary': valid=valid and receipt.get('process',{}).get('failure')=='LOG_LIMIT'
|
||||
if suite=='memory-limit-canary': valid=valid and int(receipt.get('process',{}).get('memoryEvents',{}).get('oom_kill','0'))>0
|
||||
if suite=='interrupt-canary': valid=valid and 'paused/interrupted' in receipt.get('failure','')
|
||||
if suite=='symlink-report-canary': valid=valid and 'symlink' in receipt.get('process',{}).get('failure','').lower()
|
||||
report['runs']=[r for r in report['runs'] if r['request']['suite']!=suite]
|
||||
report['runs'].append(dict(request=request,receiptSha256=result['receiptSha256'],expectPass=positive,probePassed=bool(valid)))
|
||||
report.update(issuedUtc=x.utc(),status='FAILED' if not valid else 'NOT RUN')
|
||||
x.atomic(path,report)
|
||||
print(json.dumps(dict(suite=suite,status=receipt['status'],probePassed=valid,nativeExitCode=receipt['nativeExitCode'],
|
||||
failure=receipt.get('failure'),directory=result['directory'])),flush=True)
|
||||
if not valid: return 1
|
||||
required=set(CANARIES+['boundary-canary',*NEGATIVES])
|
||||
if required.issubset({r['request']['suite'] for r in report['runs'] if r['probePassed']}):
|
||||
print('Qualifying broker-death watchdog and durable recovery',flush=True)
|
||||
report['recovery']=crash_recovery(broker,branch)
|
||||
report['status']='PASSED'
|
||||
x.atomic(path,report)
|
||||
if report['status']=='PASSED':
|
||||
try: broker.require_qualified()
|
||||
except (x.ExecutorError,OSError,ValueError,KeyError) as error:
|
||||
report.update(status='FAILED',failure=str(error));x.atomic(path,report)
|
||||
print('Final independent qualification verification failed: '+str(error),flush=True)
|
||||
return 1
|
||||
print(json.dumps(dict(status=report['status'],policySha256=broker.pin,roadmapEnabled=False)))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__=='__main__': raise SystemExit(main())
|
||||
@@ -0,0 +1,133 @@
|
||||
"""Immutable unprivileged command driver. This file runs only inside confined containers."""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import signal
|
||||
import shutil
|
||||
from itertools import islice
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
sys.path.insert(0,'/opt/jobjakt')
|
||||
from executor_catalog import BACKEND_FILTER, FRONTEND_FILE, CV_GREP, PDF_GREP, SUITES
|
||||
|
||||
|
||||
ROOT=Path('/work/repo'); REPORT=ROOT/'.reports'
|
||||
|
||||
|
||||
def run(argv,cwd=ROOT,env=None):
|
||||
print(json.dumps(dict(command=argv,cwd=str(cwd))),flush=True)
|
||||
result=subprocess.run(argv,cwd=cwd,env=env)
|
||||
if result.returncode: raise SystemExit(result.returncode)
|
||||
|
||||
|
||||
def backend(project,build_only=False,filter=None):
|
||||
run(['dotnet','restore',project,'--locked-mode','--source','/opt/nuget-feed'])
|
||||
if build_only:
|
||||
run(['dotnet','build',project,'--configuration','Release','--no-restore'])
|
||||
else:
|
||||
args=['dotnet','test',project,'--configuration','Release','--no-restore','--logger',
|
||||
'trx;LogFileName='+('mariadb.trx' if 'MariaDb' in project else 'backend.trx'),
|
||||
'--results-directory',str(REPORT)]
|
||||
if filter: args+=['--filter',filter]
|
||||
run(args)
|
||||
|
||||
|
||||
def boundary():
|
||||
import socket
|
||||
status={line.split(':',1)[0]:line.split(':',1)[1].strip() for line in Path('/proc/self/status').read_text().splitlines() if ':' in line}
|
||||
assert os.getuid()==os.geteuid()==10000 and os.getgroups()==[]
|
||||
assert all(int(status[key],16)==0 for key in ('CapEff','CapPrm','CapAmb')) and status['NoNewPrivs']=='1'
|
||||
denied=[]
|
||||
for name in ('/broker-result/forged.json','/task/supervisor.json','/var/run/docker.sock',
|
||||
'/mnt/c/Users/Connor/.jobjakt-backlog/single-user-local/owner.cer',
|
||||
'/mnt/host/c/Users/Connor/.codex/auth.json','/etc/shadow'):
|
||||
try:
|
||||
with open(name,'rb'): pass
|
||||
except OSError: denied.append(name)
|
||||
else: raise AssertionError('Private host/root resource accessible: '+name)
|
||||
try: Path('/broker-result/forged.json').write_text('forged')
|
||||
except PermissionError: pass
|
||||
else: raise AssertionError('Candidate can forge root results')
|
||||
try: os.kill(1,signal.SIGUSR1)
|
||||
except PermissionError: pass
|
||||
else: raise AssertionError('Candidate can signal root supervisor')
|
||||
routes=Path('/proc/net/route').read_text().splitlines()
|
||||
assert int(Path('/sys/fs/cgroup/memory.max').read_text())==256*1024*1024
|
||||
assert int(Path('/sys/fs/cgroup/pids.max').read_text())==384
|
||||
assert not any(row.split()[1]=='00000000' for row in routes[1:])
|
||||
for host in ('1.1.1.1','192.168.65.254','172.17.0.1'):
|
||||
try:
|
||||
with socket.create_connection((host,443),timeout=.5): pass
|
||||
except OSError: pass
|
||||
else: raise AssertionError('External/host network unexpectedly reachable')
|
||||
# This child escapes its parent's session: PID1 must still terminate it before sealing.
|
||||
child=subprocess.Popen([sys.executable,'-I','-c','import time; time.sleep(600)'],start_new_session=True,
|
||||
stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
||||
(REPORT/'boundary.json').write_text(json.dumps(dict(uid=os.getuid(),capabilities='ZERO',
|
||||
noNewPrivileges=True,denied=denied,externalNetworkDenied=True,detachedChildPid=child.pid)))
|
||||
|
||||
|
||||
def main(name):
|
||||
if name not in SUITES or SUITES[name].get('blocked'): raise SystemExit('Unknown/unavailable fixed suite')
|
||||
REPORT.mkdir()
|
||||
os.environ.update(HOME='/tmp/home',DOTNET_CLI_HOME='/work/dotnet',NUGET_PACKAGES='/work/nuget',
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT='1',DOTNET_SKIP_FIRST_TIME_EXPERIENCE='1',DOTNET_PROCESSOR_COUNT='2',
|
||||
SKIP_MODEL_LOAD='1',AI_SERVICE_SKIP_MODEL_LOAD='1',PYTHONDONTWRITEBYTECODE='1')
|
||||
if name=='boundary-canary': boundary(); return
|
||||
if name=='failure-canary': raise SystemExit(7)
|
||||
if name=='timeout-canary': time.sleep(30); return
|
||||
if name=='memory-limit-canary': bytearray(1024**3); return
|
||||
if name=='interrupt-canary': time.sleep(60); return
|
||||
if name=='log-limit-canary':
|
||||
for _ in range(3000): print('x'*4096,flush=True)
|
||||
return
|
||||
if name=='symlink-report-canary': (REPORT/'evil.json').symlink_to('/etc/passwd'); return
|
||||
if name.startswith('backend-'):
|
||||
backend('JobTrackerApi.Tests/JobTrackerApi.Tests.csproj',filter=BACKEND_FILTER if name.endswith('canary') else None); return
|
||||
if name.startswith('mariadb-') or name=='rd21-canary':
|
||||
os.environ.update(JOBTRACKER_MARIADB_TEST_ADMIN='Server=127.0.0.1;Port=3306;User ID=jt_executor;Password=jt-integration-only;SslMode=None',
|
||||
JOBTRACKER_MARIADB_TEST_VERSION='12.2.2')
|
||||
filter='FullyQualifiedName~Rd21CareerPersistenceTests' if name=='rd21-canary' else 'FullyQualifiedName~DashboardGeometryPersistenceTests' if name.endswith('canary') else None
|
||||
backend('JobTrackerApi.MariaDb.Tests/JobTrackerApi.MariaDb.Tests.csproj',filter=filter);return
|
||||
if name.startswith('python-') or name in ('parser-security','docling-canary'):
|
||||
tests=['tests/test_document_extractor.py'] if name=='docling-canary' else ['tests/test_parser_security.py'] if name=='parser-security' else ['tests/test_app.py'] if name=='python-canary' else ['tests/test_app.py','tests/test_parser_security.py','tests/test_cv_grounding.py','tests/test_cv_import_ai.py']
|
||||
argv=[sys.executable,'-m','pytest',*tests,'-q','-p','no:cacheprovider','--junitxml='+str(REPORT/'python.xml')]
|
||||
if name=='python-canary': argv+=['-k','health']
|
||||
run(argv,ROOT/'tools/summarizer');return
|
||||
ui=ROOT/'job-tracker-ui'
|
||||
if name in ('build','browser-canary','browser-full','pdf-linux-canary'):
|
||||
# Turbopack rejects dependency symlinks that leave its project root.
|
||||
shutil.copytree('/opt/node_modules',ui/'node_modules',symlinks=True)
|
||||
else: (ui/'node_modules').symlink_to('/opt/node_modules',target_is_directory=True)
|
||||
if name.startswith('frontend-'):
|
||||
argv=['node','node_modules/jest/bin/jest.js','--runInBand','--json','--outputFile='+str(REPORT/'frontend.json')]
|
||||
if name.endswith('canary'): argv+=[FRONTEND_FILE]
|
||||
run(argv,ui);return
|
||||
if name in ('typecheck','lint','build'):
|
||||
run(['npm','run',name],ui);return
|
||||
if name.startswith('browser-') or name=='pdf-linux-canary':
|
||||
backend('JobTrackerApi/JobTrackerApi.csproj',build_only=True)
|
||||
os.environ.update(PLAYWRIGHT_JSON_OUTPUT_NAME=str(REPORT/'browser.json'),
|
||||
PLAYWRIGHT_BROWSERS_PATH='/ms-playwright',PLAYWRIGHT_REUSE_SERVERS='false',
|
||||
NEXT_PUBLIC_API_BASE_URL='http://localhost:5302/api',NEXT_TELEMETRY_DISABLED='1',
|
||||
PLAYWRIGHT_STATIC_EXPORT='true',PLAYWRIGHT_PREBUILT_EXPORT='true')
|
||||
run(['npm','run','build'],ui)
|
||||
argv=['node','node_modules/@playwright/test/cli.js','test','--retries=0','--workers=1','--reporter=json']
|
||||
if name=='browser-canary': argv+=['pre-p10-cv-editor.spec.ts','--grep',CV_GREP]
|
||||
if name=='pdf-linux-canary': argv+=['cv-settings-presentation.spec.ts','--grep',PDF_GREP]
|
||||
print(json.dumps(dict(command=argv,cwd=str(ui))),flush=True)
|
||||
result=subprocess.run(argv,cwd=ui)
|
||||
contexts=[]
|
||||
for path in islice((ui/'test-results').rglob('error-context.md'),5):
|
||||
if not path.is_file() or path.is_symlink(): continue
|
||||
try:
|
||||
with path.open('rb') as stream: text=stream.read(20000).decode('utf-8',errors='replace')
|
||||
contexts.append(str(path.relative_to(ui))+'\n'+text)
|
||||
except OSError as error: contexts.append('Failure context unavailable: '+str(error))
|
||||
(REPORT/'browser-context.txt').write_text('\n\n'.join(contexts) or 'No failure context produced',encoding='utf-8')
|
||||
raise SystemExit(result.returncode)
|
||||
raise SystemExit('Suite has no reviewed implementation')
|
||||
|
||||
|
||||
if __name__=='__main__': main(sys.argv[1])
|
||||
@@ -0,0 +1,166 @@
|
||||
"""Immutable container PID1. Never imported from candidate source or run on the host."""
|
||||
import ctypes
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path, PurePosixPath
|
||||
import selectors
|
||||
import signal
|
||||
import stat
|
||||
import subprocess
|
||||
import tarfile
|
||||
import time
|
||||
|
||||
|
||||
def drop_identity(proof=None):
|
||||
os.setgroups([])
|
||||
os.setgid(10000)
|
||||
os.setuid(10000)
|
||||
libc=ctypes.CDLL(None,use_errno=True)
|
||||
if libc.prctl(38,1,0,0,0)!=0: raise RuntimeError('no_new_privs failed')
|
||||
# setuid clears effective/permitted capabilities; clear ambient capabilities as well.
|
||||
if libc.prctl(47,4,0,0,0)!=0: raise RuntimeError('ambient capability clearing failed')
|
||||
fields={line.split(':',1)[0]:line.split(':',1)[1].strip() for line in Path('/proc/self/status').read_text().splitlines() if ':' in line}
|
||||
if (os.getgroups() or fields['Uid'].split()!=['10000']*4 or fields['NoNewPrivs']!='1'
|
||||
or any(int(fields[key],16) for key in ('CapEff','CapPrm','CapAmb'))):
|
||||
raise RuntimeError('Candidate privilege drop did not hold')
|
||||
if proof is not None:
|
||||
os.write(proof,json.dumps(dict(uid=10000,groups=[],capabilities='ZERO',noNewPrivileges=True)).encode())
|
||||
os.close(proof)
|
||||
os.nice(10)
|
||||
|
||||
|
||||
def terminate_candidates(process=None):
|
||||
try: os.kill(-1,signal.SIGKILL)
|
||||
except ProcessLookupError: pass
|
||||
if process is not None and process.returncode is None:
|
||||
process.wait(timeout=3) # reap the direct child through Popen, preserving its real signal/exit
|
||||
until=time.monotonic()+3
|
||||
while time.monotonic()<until:
|
||||
try:
|
||||
pid,_=os.waitpid(-1,os.WNOHANG)
|
||||
if pid==0: time.sleep(.02)
|
||||
except ChildProcessError: return
|
||||
|
||||
|
||||
def unpack(source,destination):
|
||||
total=0; names=set()
|
||||
with tarfile.open(source) as archive:
|
||||
for item in archive:
|
||||
name=PurePosixPath(item.name)
|
||||
if (name.is_absolute() or '..' in name.parts or '\\' in item.name or ':' in item.name
|
||||
or not (item.isfile() or item.isdir()) or item.size>32*1024*1024):
|
||||
raise ValueError('Unsafe candidate archive')
|
||||
total+=item.size
|
||||
if total>192*1024*1024 or len(names)>12000: raise ValueError('Candidate archive budget exceeded')
|
||||
target=destination/item.name
|
||||
target.parent.mkdir(parents=True,exist_ok=True)
|
||||
if item.isdir(): target.mkdir(exist_ok=True)
|
||||
else:
|
||||
if item.name in names: raise ValueError('Duplicate candidate file')
|
||||
names.add(item.name)
|
||||
with target.open('xb') as stream:
|
||||
stream.write(archive.extractfile(item).read(item.size+1))
|
||||
target.chmod(0o755 if item.mode&0o111 else 0o644)
|
||||
# Root-owned sticky directories admit build outputs, but cannot unlink/replace approved inputs.
|
||||
for directory,_,_ in os.walk(destination): Path(directory).chmod(0o1777)
|
||||
|
||||
|
||||
def seal_report(source,target):
|
||||
relative=source.relative_to('/work')
|
||||
current=Path('/work')
|
||||
for part in relative.parts:
|
||||
current=current/part
|
||||
if current.is_symlink(): raise ValueError('Report path contains symlink')
|
||||
descriptor=os.open(source,os.O_RDONLY|os.O_NOFOLLOW|os.O_NONBLOCK)
|
||||
try:
|
||||
info=os.fstat(descriptor)
|
||||
if not stat.S_ISREG(info.st_mode) or info.st_size>16*1024*1024: raise ValueError('Invalid report size/type')
|
||||
with os.fdopen(descriptor,'rb',closefd=False) as stream: target.write_bytes(stream.read(16*1024*1024+1))
|
||||
finally: os.close(descriptor)
|
||||
|
||||
|
||||
def candidate_count():
|
||||
count=0
|
||||
for status in Path('/proc').glob('[0-9]*/status'):
|
||||
try: content=status.read_text()
|
||||
except (FileNotFoundError,ProcessLookupError): continue
|
||||
count+=any(line.startswith('Uid:') and line.split()[1]=='10000' for line in content.splitlines())
|
||||
return count
|
||||
|
||||
|
||||
def main():
|
||||
if os.getpid()!=1 or os.getuid()!=0: raise RuntimeError('Supervisor must be immutable root PID1')
|
||||
limit=time.monotonic()+120
|
||||
while not Path('/task/ready').exists():
|
||||
if time.monotonic()>limit: return 120
|
||||
time.sleep(.05)
|
||||
transport_pid=int(Path('/task/ready').read_text())
|
||||
if transport_pid<=1: raise RuntimeError('Invalid trusted transport identity')
|
||||
# The root extractor must exit before fast candidate cleanup can kill other namespace processes.
|
||||
while Path('/proc/'+str(transport_pid)).exists():
|
||||
if time.monotonic()>limit: return 120
|
||||
time.sleep(.01)
|
||||
spec=json.loads(Path('/task/supervisor.json').read_text())
|
||||
result=Path('/broker-result'); result.chmod(0o700)
|
||||
record=dict(request=spec['request'],startedUtc=time.time(),exitCode=None,failure=None,
|
||||
supervisorSha256=hashlib.sha256(Path(__file__).read_bytes()).hexdigest())
|
||||
process=None
|
||||
try:
|
||||
source=Path('/task/source.tar')
|
||||
if hashlib.sha256(source.read_bytes()).hexdigest()!=spec['archiveSha256']: raise ValueError('Snapshot digest mismatch')
|
||||
work=Path('/work/repo');work.mkdir()
|
||||
unpack(source,work)
|
||||
proof_read,proof_write=os.pipe()
|
||||
try:
|
||||
process=subprocess.Popen(spec['childArgv'],cwd=work,stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.PIPE,stderr=subprocess.PIPE,preexec_fn=lambda:drop_identity(proof_write),
|
||||
pass_fds=(proof_write,),start_new_session=True)
|
||||
finally: os.close(proof_write)
|
||||
try: record['identity']=json.loads(os.read(proof_read,4096))
|
||||
finally: os.close(proof_read)
|
||||
selector=selectors.DefaultSelector()
|
||||
for stream,name in ((process.stdout,'stdout.log'),(process.stderr,'stderr.log')):
|
||||
os.set_blocking(stream.fileno(),False)
|
||||
selector.register(stream,selectors.EVENT_READ,(name,(result/name).open('wb')))
|
||||
sizes={}; deadline=time.monotonic()+min(int(spec['timeoutSeconds']),1800)
|
||||
while selector.get_map():
|
||||
if time.monotonic()>deadline:
|
||||
record['failure']='TIMEOUT';terminate_candidates(process)
|
||||
for key,_ in selector.select(.1):
|
||||
name,output=key.data
|
||||
chunk=os.read(key.fd,65536)
|
||||
if not chunk:
|
||||
selector.unregister(key.fileobj);output.close();key.fileobj.close();continue
|
||||
sizes[name]=sizes.get(name,0)+len(chunk)
|
||||
if sizes[name]>2*1024*1024:
|
||||
record['failure']='LOG_LIMIT';terminate_candidates(process)
|
||||
else: output.write(chunk)
|
||||
if process.poll() is not None:
|
||||
terminate_candidates(process) # setsid/double-fork children cannot survive their invocation
|
||||
record['exitCode']=process.wait(timeout=3)
|
||||
terminate_candidates(process)
|
||||
for name in spec['reportNames']:
|
||||
if '/' in name or '\\' in name or name in ('.','..'): raise ValueError('Unsafe report basename')
|
||||
seal_report(Path('/work/repo/.reports')/name,result/name)
|
||||
except BaseException as error:
|
||||
record['failure']=type(error).__name__+': '+str(error)[:300]
|
||||
terminate_candidates(process)
|
||||
if process is not None:
|
||||
record['exitCode']=process.poll()
|
||||
record['finishedUtc']=time.time()
|
||||
record['memoryEvents']=dict(line.split() for line in Path('/sys/fs/cgroup/memory.events').read_text().splitlines())
|
||||
record['storage']={}
|
||||
for name in ('/tmp','/work'):
|
||||
info=os.statvfs(name)
|
||||
record['storage'][name]=dict(totalBytes=info.f_blocks*info.f_frsize,freeBytes=info.f_bavail*info.f_frsize)
|
||||
record['remainingCandidateProcesses']=candidate_count()
|
||||
temporary=result/'process.tmp'
|
||||
temporary.write_text(json.dumps(record));temporary.rename(result/'process.json')
|
||||
# Bounded collection window; independent termination still works if the host broker dies.
|
||||
deadline=time.monotonic()+120
|
||||
while time.monotonic()<deadline: time.sleep(.25)
|
||||
return 0 if record['exitCode']==0 and not record['failure'] else 1
|
||||
|
||||
|
||||
if __name__=='__main__': raise SystemExit(main())
|
||||
@@ -4,7 +4,7 @@ from datetime import datetime, timezone, timedelta
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from pathlib import Path, PurePosixPath
|
||||
import shutil
|
||||
import socket
|
||||
import subprocess
|
||||
@@ -30,6 +30,44 @@ def validate_identity(config, sid):
|
||||
raise ValueError('single-user-local requires the configured current Windows identity for both owner and runner')
|
||||
|
||||
|
||||
def validate_bundled_skills(auth, config):
|
||||
skills = auth/'skills'
|
||||
pin = config.get('bundledSystemSkills')
|
||||
if not pin:
|
||||
if skills.exists() or skills.is_symlink():
|
||||
raise ValueError('Auth-only skills require an explicitly reviewed bundled-system pin')
|
||||
return
|
||||
files = pin.get('files', {}) if isinstance(pin, dict) else {}
|
||||
if (not isinstance(files,dict) or not files or len(files)>256 or any(
|
||||
not isinstance(name,str) or not name.startswith('.system/') or '\\' in name or ':' in name
|
||||
or '..' in PurePosixPath(name).parts or str(PurePosixPath(name))!=name
|
||||
or not isinstance(value,str) or len(value)!=64 or any(c not in '0123456789abcdef' for c in value)
|
||||
for name,value in files.items())):
|
||||
raise ValueError('Invalid bundled-system skill pin')
|
||||
if hashlib.sha256(Path(config['codexExecutable']).read_bytes()).hexdigest()!=pin.get('codexSha256'):
|
||||
raise ValueError('Pinned Codex executable changed; review bundled system skills again')
|
||||
if skills.is_symlink() or getattr(skills,'is_junction',lambda:False)():
|
||||
raise ValueError('Bundled system skills cannot redirect paths')
|
||||
if not skills.exists():
|
||||
return # Codex materializes its bundled skills on first worker launch.
|
||||
expected_dirs={str(parent) for name in files for parent in PurePosixPath(name).parents if str(parent)!='.'}
|
||||
actual_files, actual_dirs = {}, set()
|
||||
if not skills.is_dir():
|
||||
raise ValueError('Bundled system skills must be a directory')
|
||||
for path in skills.rglob('*'):
|
||||
if path.is_symlink() or getattr(path,'is_junction',lambda:False)():
|
||||
raise ValueError('Bundled system skills cannot redirect paths')
|
||||
name=path.relative_to(skills).as_posix()
|
||||
if path.is_dir():
|
||||
actual_dirs.add(name)
|
||||
elif path.is_file() and path.stat().st_size<=2*1024*1024:
|
||||
actual_files[name]=hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
else:
|
||||
raise ValueError('Unexpected bundled system skill entry')
|
||||
if actual_files!=files or actual_dirs!=expected_dirs:
|
||||
raise ValueError('Auth-only skills differ from the exact reviewed bundled-system pin')
|
||||
|
||||
|
||||
def validate_config(root, config):
|
||||
root = Path(root).resolve()
|
||||
repo = Path(config['repository']).resolve()
|
||||
@@ -51,9 +89,10 @@ def validate_config(root, config):
|
||||
raise ValueError('single-user-local plugin/MCP access is disabled until independently qualified')
|
||||
if config.get('executionPolicy') not in ('operator-controlled','qualified-unattended'):
|
||||
raise ValueError('Unknown single-user execution policy')
|
||||
for name in ('config.toml','plugins','skills','hooks.json','AGENTS.md'):
|
||||
for name in ('config.toml','plugins','hooks.json','AGENTS.md'):
|
||||
if (auth / name).exists():
|
||||
raise ValueError('Auth-only CODEX_HOME contains unrelated config, hooks, skills or plugins')
|
||||
validate_bundled_skills(auth,config)
|
||||
for name in ('.codex/config.toml','.mcp.json'):
|
||||
if (repo / name).exists():
|
||||
raise ValueError('Worker has an unqualified repository Codex/MCP configuration')
|
||||
@@ -80,6 +119,10 @@ def filesystem_rules(root, config):
|
||||
for path in (Path(root),Path(config['workerCodeXHome']),Path(config['normalCodeXHome']),
|
||||
Path.home()/'.ssh',Path.home()/'AppData/Roaming/Microsoft/Crypto'):
|
||||
rules[path.resolve().as_posix()] = 'deny'
|
||||
reports=Path(root).resolve()/'sanitized-tests'
|
||||
if reports.is_symlink() or getattr(reports,'is_junction',lambda:False)():
|
||||
raise ValueError('Sanitized reports cannot redirect protected paths')
|
||||
rules[reports.as_posix()]='read'
|
||||
for name in ('.env','.env.local','.env.production','appsettings.Production.json'):
|
||||
rules[(repo/name).as_posix()] = 'deny'
|
||||
rules[(repo/'.git').as_posix()] = 'read'
|
||||
@@ -103,7 +146,9 @@ def permission_args(root, config, command):
|
||||
|
||||
def binding(root,config):
|
||||
value = {k:v for k,v in config.items() if k != 'executionPolicy'}
|
||||
for name in ('local_mode.py','controller.py','assessment_adapter.py','Probe-JobjaktSandbox.ps1'):
|
||||
for name in ('local_mode.py','controller.py','assessment_adapter.py','Probe-JobjaktSandbox.ps1',
|
||||
'confined_executor.py','executor_catalog.py','executor_supervisor.py','executor_driver.py',
|
||||
'executor_cli.py','provision_executor.py','verify_nuget_cache.ps1'):
|
||||
source = Path(root)/name
|
||||
if source.exists():
|
||||
value[name+'Sha256'] = hashlib.sha256(source.read_bytes()).hexdigest()
|
||||
@@ -114,6 +159,8 @@ def probes_passed(result):
|
||||
files = result.get('files',[])
|
||||
return (result.get('positiveControl') is True and result.get('networkDenied') is True
|
||||
and result.get('signingKeyDenied') is True
|
||||
and result.get('dockerPipeDenied') is True
|
||||
and result.get('sanitizedReportRead') is True and result.get('sanitizedReportWriteDenied') is True
|
||||
and {f.get('category') for f in files} == CATEGORIES
|
||||
and all(f.get('readDenied') is True and f.get('writeDenied') is True for f in files))
|
||||
|
||||
@@ -131,6 +178,7 @@ def require_unattended(root,config):
|
||||
if (report.get('status') != 'PASS' or report.get('failure')
|
||||
or report.get('binding') != binding(root,config) or not probes_passed(report.get('probes',{}))
|
||||
or report.get('ownerKeyDenied') is not True
|
||||
or report.get('dockerPipeHostPositive') is not True
|
||||
or issued > now+timedelta(minutes=5) or now-issued > timedelta(hours=24)):
|
||||
raise ValueError('Native sandbox/key qualification failed, expired or changed; operator-controlled pause required')
|
||||
|
||||
@@ -186,7 +234,15 @@ def qualify(engine):
|
||||
with path.open('r+b'):
|
||||
pass # prove a denial is not a missing file or preexisting host ACL failure
|
||||
paths.append(dict(category=category,path=str(path)))
|
||||
sanitized=root/'sanitized-tests'/('canary-'+token+'.txt')
|
||||
sanitized.parent.mkdir(exist_ok=True);sanitized.write_text('SYNTHETIC-'+token,encoding='utf-8');owned.append(sanitized)
|
||||
owned.append(sanitized.with_name(sanitized.name+'.new'))
|
||||
helper = root/'Probe-JobjaktSandbox.ps1'
|
||||
pipe = subprocess.run([config['powershellExecutable'],'-NoProfile','-File',str(helper),
|
||||
'-Action','TestDockerPipe'],text=True,capture_output=True,timeout=15)
|
||||
if pipe.returncode or json.loads(pipe.stdout).get('connected') is not True:
|
||||
raise ValueError('Local development Docker pipe host positive control failed')
|
||||
report['dockerPipeHostPositive']=True
|
||||
setup = subprocess.run([config['powershellExecutable'],'-NoProfile','-File',str(helper),
|
||||
'-Action','CreateKey','-Tag',token],text=True,capture_output=True,timeout=30)
|
||||
if setup.returncode:
|
||||
@@ -209,6 +265,7 @@ def qualify(engine):
|
||||
accepted,_ = listener.accept()
|
||||
accepted.close()
|
||||
plan = dict(files=paths,port=listener.getsockname()[1],key=key,
|
||||
sanitizedReport=str(sanitized),sanitizedToken='SYNTHETIC-'+token,
|
||||
ownerThumbprint=config.get('ownerCertificateThumbprint'),ownerKeyName=owner_key['keyName'] if owner_key else None)
|
||||
(workspace/'plan.json').write_text(json.dumps(plan),encoding='utf-8')
|
||||
shutil.copyfile(helper,workspace/'probe.ps1')
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
"""Trusted operator setup: build offline tool images, never execute candidate code on host."""
|
||||
import base64
|
||||
import gzip
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import tarfile
|
||||
import urllib.request
|
||||
import zipfile
|
||||
import stat
|
||||
import xml.etree.ElementTree as ET
|
||||
import confined_executor as x
|
||||
from executor_catalog import SUITES, CANARIES, BACKEND_FILTER, FRONTEND_FILE, CV_GREP, PDF_GREP
|
||||
import re
|
||||
|
||||
BASELINE='fc5b9d377199ce51f480a920a3772108094929e3'
|
||||
SOURCE=Path(__file__).resolve().parent
|
||||
DOCKER=shutil.which('docker')
|
||||
|
||||
|
||||
def docker(*args,timeout=120):
|
||||
result=subprocess.run([DOCKER,'--context','desktop-linux',*args],capture_output=True,text=True,timeout=timeout)
|
||||
if result.returncode: raise RuntimeError(result.stderr[-1800:])
|
||||
return result.stdout.strip()
|
||||
|
||||
|
||||
def identity(image): return json.loads(docker('image','inspect',image))[0]['Id']
|
||||
|
||||
|
||||
def copy_dependencies(source,target):
|
||||
source=source.resolve();target.mkdir(parents=True,exist_ok=True)
|
||||
count=0
|
||||
for folder,directories,files in os.walk(source,followlinks=False):
|
||||
directories[:]=[name for name in directories if name not in ('.cache','.bin')]
|
||||
for name in directories+files:
|
||||
path=Path(folder)/name
|
||||
info=path.lstat()
|
||||
if stat.S_ISLNK(info.st_mode) or getattr(info,'st_file_attributes',0)&0x400:
|
||||
raise RuntimeError('Dependency path redirection is forbidden')
|
||||
for name in files:
|
||||
if name.startswith('.env') or name in ('.npmrc','.yarnrc'): continue
|
||||
path=Path(folder)/name; out=target/path.relative_to(source)
|
||||
out.parent.mkdir(parents=True,exist_ok=True)
|
||||
if not out.exists() or out.stat().st_size!=path.stat().st_size: shutil.copyfile(path,out)
|
||||
count+=1
|
||||
return count
|
||||
|
||||
|
||||
def pin_linux_packages(worker,context,allow_downloads):
|
||||
lock=json.loads((worker/'job-tracker-ui/package-lock.json').read_text())
|
||||
wanted={'node_modules/@next/swc-linux-x64-gnu','node_modules/@img/sharp-linux-x64','node_modules/@img/sharp-libvips-linux-x64',
|
||||
'node_modules/@unrs/resolver-binding-linux-x64-gnu'}
|
||||
observed=[]
|
||||
for name in sorted(wanted):
|
||||
entry=lock['packages'][name]
|
||||
url=entry['resolved']
|
||||
if not url.startswith('https://registry.npmjs.org/') or not entry['integrity'].startswith('sha512-'):
|
||||
raise RuntimeError('Unexpected dependency registry/integrity')
|
||||
target=context/'archives'/(name.rsplit('/',1)[-1]+'.tgz');target.parent.mkdir(exist_ok=True)
|
||||
if not target.exists():
|
||||
if not allow_downloads: raise RuntimeError('Explicit permission needed for missing pinned Linux npm archives')
|
||||
with urllib.request.urlopen(url,timeout=90) as response: raw=response.read(64*1024*1024+1)
|
||||
if len(raw)>64*1024*1024: raise RuntimeError('Pinned package exceeds its bound')
|
||||
target.write_bytes(raw)
|
||||
raw=target.read_bytes()
|
||||
expected=base64.b64decode(entry['integrity'].split('-',1)[1])
|
||||
if hashlib.sha512(raw).digest()!=expected: raise RuntimeError('Pinned package integrity mismatch')
|
||||
destination=context/'linux-node-modules'/name.removeprefix('node_modules/')
|
||||
destination.mkdir(parents=True,exist_ok=True)
|
||||
with tarfile.open(fileobj=io.BytesIO(raw),mode='r:gz') as archive:
|
||||
for item in archive:
|
||||
path=x.safe_name(item.name)
|
||||
if not path.parts or path.parts[0]!='package' or not (item.isfile() or item.isdir()):
|
||||
raise RuntimeError('Unsafe pinned dependency archive')
|
||||
out=destination.joinpath(*path.parts[1:])
|
||||
if item.isdir(): out.mkdir(parents=True,exist_ok=True)
|
||||
else:
|
||||
out.parent.mkdir(parents=True,exist_ok=True)
|
||||
out.write_bytes(archive.extractfile(item).read())
|
||||
observed.append(dict(package=name,version=entry['version'],integrity=entry['integrity'],sha256=x.sha(target)))
|
||||
return observed
|
||||
|
||||
|
||||
def nuget_feed(worker,context):
|
||||
destination=context/'nuget-feed';destination.mkdir(exist_ok=True)
|
||||
cache=Path.home()/'.nuget/packages';packages={}
|
||||
for project in ('JobTrackerApi','JobTrackerApi.Tests','JobTrackerApi.MariaDb.Tests'):
|
||||
lock=json.loads((worker/project/'packages.lock.json').read_text())
|
||||
for group in lock['dependencies'].values():
|
||||
for name,row in group.items():
|
||||
if row.get('type')=='Project': continue
|
||||
packages[(name.lower(),row['resolved'])]=row['contentHash']
|
||||
checks=[]
|
||||
for (name,version),expected in packages.items():
|
||||
source=cache/name/version/(name+'.'+version+'.nupkg')
|
||||
if not source.is_file(): raise RuntimeError('Accepted NuGet cache missing '+name+'/'+version)
|
||||
checks.append(dict(path=str(source),hash=expected))
|
||||
manifest=context/'nuget-integrity.json';x.atomic(manifest,checks)
|
||||
subprocess.run([shutil.which('pwsh'),'-NoProfile','-File',str(SOURCE/'verify_nuget_cache.ps1'),
|
||||
'-Manifest',str(manifest),'-SdkDirectory',str(Path.home()/'.dotnet/sdk/9.0.317')],check=True,timeout=180)
|
||||
for row in checks:
|
||||
source=Path(row['path'])
|
||||
shutil.copyfile(source,destination/source.name)
|
||||
return len(packages)
|
||||
|
||||
|
||||
def membership(root):
|
||||
receipt=json.loads((root/'assessment-activation-01/receipt.json').read_text())
|
||||
records={r['id']:r for r in receipt['nativeReports']}
|
||||
index=json.loads((root/'assessment-activation-01/handoff/TEST_EVIDENCE.json').read_text())
|
||||
def original(record):
|
||||
artifact=next(a for a in index['artifacts'] if a['id']==record['artifactId'])
|
||||
path=root/'assessment-activation-01/handoff'/artifact['path']
|
||||
if x.sha(path)!=artifact['sha256']: raise RuntimeError('Accepted native artifact changed')
|
||||
raw=path.read_bytes()
|
||||
return gzip.decompress(raw) if artifact['path'].endswith('.gz') else raw
|
||||
def trx(record):
|
||||
return [n.attrib['testName'] for n in ET.fromstring(original(record)).iter() if n.tag.endswith('UnitTestResult')]
|
||||
def junit(record):
|
||||
return [n.attrib.get('classname','')+'.'+n.attrib['name'] for n in ET.fromstring(original(record)).iter('testcase')]
|
||||
result={}
|
||||
# Read identities from original UTF-8 native artifacts, avoiding historic shell-decoding mojibake.
|
||||
be=trx(records['backend'])
|
||||
result['backend-full']=be
|
||||
result['backend-canary']=[n for n in be if any(s in n for s in ('LocalAuthIdentityTests.','ApiAuthorizationPostureTests.','AdminProcessingControllerTests.'))]
|
||||
db=trx(records['mariadb-provider']);result['mariadb-full']=db
|
||||
result['mariadb-canary']=[n for n in db if 'DashboardGeometryPersistenceTests.' in n]
|
||||
result['rd21-canary']=[n for n in db if 'Rd21CareerPersistenceTests.' in n]
|
||||
frontend=json.loads(original(records['frontend']))
|
||||
result['frontend-full']=[]
|
||||
for suite in frontend['testResults']:
|
||||
name='job-tracker-ui/'+suite['name'].replace('\\','/').rsplit('/job-tracker-ui/',1)[1]
|
||||
result['frontend-full'] += [name+'::'+case['fullName'] for case in suite['assertionResults']]
|
||||
result['frontend-canary']=[n for n in result['frontend-full'] if FRONTEND_FILE+'::' in n]
|
||||
py=junit(records['python-offline'])
|
||||
result['python-full']=py
|
||||
result['python-canary']=[n for n in py if 'test_app.' in n and 'health' in n.lower()]
|
||||
result['parser-security']=[n for n in py if 'test_parser_security.' in n]
|
||||
result['docling-canary']=junit(records['python-docling'])
|
||||
def native(record):
|
||||
return json.loads(original(record))
|
||||
browser=[]
|
||||
def visit(suites):
|
||||
for s in suites:
|
||||
for spec in s.get('specs',[]):
|
||||
for test in spec['tests']:
|
||||
browser.append((spec.get('file',''),spec['title'],test['projectName']))
|
||||
visit(s.get('suites',[]))
|
||||
for name in ('affected-rest','focused-template'): visit(native(records[name])['suites'])
|
||||
result['browser-full']=[':'.join(n) for n in browser]
|
||||
result['browser-canary']=[':'.join(n) for n in browser if 'pre-p10-cv-editor.spec.ts' in n[0] and re.search(CV_GREP,n[1])]
|
||||
result['pdf-linux-canary']=[':'.join(n) for n in browser if 'cv-settings-presentation.spec.ts' in n[0] and PDF_GREP in n[1]]
|
||||
if any(not result.get(suite) for suite in CANARIES if SUITES[suite]['structured']):
|
||||
raise RuntimeError('Representative native membership is missing; do not manufacture expectations')
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
parser=argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--control-root',type=Path,required=True)
|
||||
parser.add_argument('--worker',type=Path,required=True)
|
||||
parser.add_argument('--accepted-node-modules',type=Path,required=True)
|
||||
parser.add_argument('--linux-wheels',type=Path,required=True)
|
||||
parser.add_argument('--allow-approved-npm-downloads',action='store_true')
|
||||
parser.add_argument('--reuse-images',action='store_true',help='Reuse only images with the exact current immutable harness label')
|
||||
parser.add_argument('--refresh-harness',action='store_true',help='Layer current trusted harness onto the previously pinned local tool images')
|
||||
args=parser.parse_args();root=args.control_root.resolve();worker=args.worker.resolve()
|
||||
if args.reuse_images and args.refresh_harness: parser.error('Choose one image reuse mode')
|
||||
previous=json.loads((root/'executor-preparation.json').read_text()) if args.refresh_harness else None
|
||||
if previous and previous['baselineCommit']!=BASELINE: raise RuntimeError('Previous toolchain baseline differs')
|
||||
if root.is_relative_to(worker) or worker.is_relative_to(root): raise RuntimeError('Worker and control must be disjoint')
|
||||
import controller
|
||||
if controller.read_json(root/'backlog.json')['executionEnabled'] or any(s['sessions'] for s in controller.StateStore(root).read()['stages'].values()):
|
||||
raise RuntimeError('Provision only while the real queue is disabled and unused')
|
||||
head=subprocess.run(['git','-C',str(worker),'rev-parse','HEAD'],capture_output=True,text=True,check=True).stdout.strip()
|
||||
if head!=BASELINE: raise RuntimeError('Prepare from the exact accepted application baseline')
|
||||
if docker('context','inspect','desktop-linux','--format','{{.Endpoints.docker.Host}}')!='npipe:////./pipe/dockerDesktopLinuxEngine':
|
||||
raise RuntimeError('Not the local qualified development Docker Desktop engine')
|
||||
context=root/'executor-build';context.mkdir(exist_ok=True)
|
||||
preparation=dict(startedUtc=x.utc(),baselineCommit=head)
|
||||
for name in ('executor_supervisor.py','executor_driver.py','executor_catalog.py'):
|
||||
shutil.copyfile(SOURCE/name,context/name)
|
||||
preparation['harnessSha256']=x.digest({name:x.sha(SOURCE/name) for name in ('executor_supervisor.py','executor_driver.py','executor_catalog.py')})
|
||||
if not (context/'node_modules/.complete').exists():
|
||||
preparation['nodeFiles']=copy_dependencies(args.accepted_node_modules,context/'node_modules')
|
||||
(context/'node_modules/.complete').write_text('Accepted baseline dependency snapshot')
|
||||
preparation['linuxPackages']=pin_linux_packages(worker,context,args.allow_approved_npm_downloads)
|
||||
preparation['nugetPackages']=nuget_feed(worker,context)
|
||||
(context/'wheels').mkdir(exist_ok=True)
|
||||
for wheel in args.linux_wheels.glob('*.whl'): shutil.copyfile(wheel,context/'wheels'/wheel.name)
|
||||
shutil.copyfile(worker/'tools/summarizer/requirements-cv-import.txt',context/'requirements-cv-import.txt')
|
||||
bases={'sdk':identity('mcr.microsoft.com/dotnet/sdk:9.0.317'),
|
||||
'web':identity('mcr.microsoft.com/playwright:v1.62.1-noble'),
|
||||
'python':identity('sha256:e1dc2dfce83caa4fe785ee9485b86011bb3ec0470511a9dfbdb03206ee1c40b3'),
|
||||
'database':identity('mariadb:12.2.2')}
|
||||
aliases={}
|
||||
for kind,pin in bases.items():
|
||||
aliases[kind]='jobjakt-executor-base-'+kind+':'+pin.split(':')[1][:12]
|
||||
docker('tag',pin,aliases[kind])
|
||||
sdk,web,python,db=(aliases[k] for k in ('sdk','web','python','database'))
|
||||
label=preparation['harnessSha256']
|
||||
common='\nCOPY executor_supervisor.py executor_driver.py executor_catalog.py /opt/jobjakt/\nLABEL io.jobjakt.executor.harness-sha256="'+label+'"\n'
|
||||
dockerfiles={
|
||||
'web':f'FROM {sdk} AS sdk\nFROM {web}\nCOPY --from=sdk /usr/share/dotnet /usr/share/dotnet\nCOPY node_modules/ /opt/node_modules/\nCOPY linux-node-modules/ /opt/node_modules/\nCOPY nuget-feed/ /opt/nuget-feed/\nRUN mkdir -p /opt/node_modules/.bin && ln -s ../next/dist/bin/next /opt/node_modules/.bin/next && ln -s ../typescript/bin/tsc /opt/node_modules/.bin/tsc && ln -s ../eslint/bin/eslint.js /opt/node_modules/.bin/eslint && chmod 555 /opt/node_modules/next/dist/bin/next /opt/node_modules/typescript/bin/tsc /opt/node_modules/eslint/bin/eslint.js\n'+common,
|
||||
'python':f'FROM {python}\nUSER root\n'+common,
|
||||
'docling':f'FROM {python}\nUSER root\nCOPY wheels/ /wheels/\nCOPY requirements-cv-import.txt /tmp/requirements-cv-import.txt\nRUN python -m venv --system-site-packages /opt/docling && /opt/docling/bin/python -m pip install --no-index --find-links=/wheels -r /tmp/requirements-cv-import.txt\n'+common,
|
||||
'database':f'FROM {db}\nCOPY db-start.sh /opt/jobjakt/db-start.sh\nRUN chmod 555 /opt/jobjakt/db-start.sh\nLABEL io.jobjakt.executor.harness-sha256="{label}"\n'
|
||||
}
|
||||
(context/'db-start.sh').write_text('''#!/bin/sh
|
||||
set -eu
|
||||
mariadb-install-db --no-defaults --datadir=/var/lib/mysql --auth-root-authentication-method=normal --skip-test-db >/tmp/install.log 2>&1
|
||||
cat >/tmp/init.sql <<'SQL'
|
||||
CREATE USER 'jt_executor'@'127.0.0.1' IDENTIFIED BY 'jt-integration-only';
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'jt_executor'@'127.0.0.1' WITH GRANT OPTION;
|
||||
SQL
|
||||
exec /usr/sbin/mariadbd --no-defaults --datadir=/var/lib/mysql --bind-address=127.0.0.1 --port=3306 --socket=/run/mysqld/mysqld.sock --pid-file=/run/mysqld/mysqld.pid --skip-name-resolve --innodb-buffer-pool-size=128M --max-connections=30 --log-error=/tmp/mariadb.log --init-file=/tmp/init.sql
|
||||
''',encoding='utf-8',newline='\n')
|
||||
images={}
|
||||
for kind,source in dockerfiles.items():
|
||||
print('Building offline '+kind+' runtime',flush=True)
|
||||
file=context/(kind+'.Dockerfile')
|
||||
if previous:
|
||||
prior=previous['images'][kind]
|
||||
if identity(prior)!=prior: raise RuntimeError('Previously pinned tool image is missing')
|
||||
alias='jobjakt-executor-prior-'+kind+':'+prior.split(':')[1][:12]
|
||||
docker('tag',prior,alias)
|
||||
source=f'FROM {alias}\n'+('COPY db-start.sh /opt/jobjakt/db-start.sh\nRUN chmod 555 /opt/jobjakt/db-start.sh\n' if kind=='database' else common)
|
||||
if kind=='web': source+='COPY linux-node-modules/ /opt/node_modules/\n'
|
||||
if kind=='database': source+='LABEL io.jobjakt.executor.harness-sha256="'+label+'"\n'
|
||||
file.write_text(source,encoding='utf-8')
|
||||
exclusions=['archives','*.log','nuget-integrity.json']
|
||||
if kind!='web': exclusions+=['node_modules','linux-node-modules','nuget-feed']
|
||||
if kind!='docling': exclusions+=['wheels']
|
||||
if previous: exclusions=['**','!executor_supervisor.py','!executor_driver.py','!executor_catalog.py','!db-start.sh']
|
||||
if previous and kind=='web': exclusions+=['!linux-node-modules','!linux-node-modules/**']
|
||||
file.with_name(file.name+'.dockerignore').write_text('\n'.join(exclusions),encoding='utf-8')
|
||||
tag='jobjakt-executor-'+kind+':runtime02'
|
||||
if not args.reuse_images:
|
||||
log=docker('build','--network','none','--pull=false','--file',str(file),'--tag',tag,str(context),timeout=1200)
|
||||
(root/('executor-build-'+kind+'.log')).write_text(log)
|
||||
metadata=json.loads(docker('image','inspect',tag))[0]
|
||||
if metadata['Config'].get('Labels',{}).get('io.jobjakt.executor.harness-sha256')!=label:
|
||||
raise RuntimeError('Existing tool image has a different harness; rebuild required')
|
||||
images[kind]=identity(tag)
|
||||
roots=['JobTrackerApi','JobTrackerApi.Tests','JobTrackerApi.MariaDb.Tests','job-tracker-ui','tools/summarizer','global.json','scripts','docs/cv-redesign','docs/pre-phase10-ux','docs/redesign/phase-9']
|
||||
roots += [p.name for p in worker.glob('Directory.Build.*') if p.is_file()]
|
||||
policy=dict(schemaVersion=1,executorIdentity='jobjakt-local-docker-linux-runtime02',baselineCommit=BASELINE,
|
||||
dockerExecutable=DOCKER,gitExecutable=shutil.which('git'),images=images,
|
||||
imageKinds={value:key for key,value in images.items()},harnessSha256=label,
|
||||
catalogSha256=x.sha(SOURCE/'executor_catalog.py'),
|
||||
codeSha256={name:x.sha(SOURCE/name) for name in ('confined_executor.py','executor_catalog.py','executor_supervisor.py','executor_driver.py',
|
||||
'executor_cli.py','provision_executor.py','verify_nuget_cache.ps1','controller.py')},
|
||||
sourceRoots=roots,
|
||||
engineIdentity={k:v for k,v in json.loads(docker('info','--format','{{json .}}')).items()
|
||||
if k in ('ServerVersion','KernelVersion','OperatingSystem','OSType','Architecture','SecurityOptions')},
|
||||
environment={'PATH':'/usr/share/dotnet:/usr/local/bin:/usr/bin:/bin','HOME':'/tmp/home','LANG':'C.UTF-8','DOTNET_ROOT':'/usr/share/dotnet',
|
||||
'DOTNET_CLI_TELEMETRY_OPTOUT':'1','DOTNET_PROCESSOR_COUNT':'2','PYTHONUNBUFFERED':'1',
|
||||
'PLAYWRIGHT_BROWSERS_PATH':'/ms-playwright','SKIP_MODEL_LOAD':'1','AI_SERVICE_SKIP_MODEL_LOAD':'1','PYTHONDONTWRITEBYTECODE':'1','NEXT_TELEMETRY_DISABLED':'1'},
|
||||
membership=membership(root),allowed={'PHASE-10/P10-00':CANARIES,
|
||||
'RUNTIME-QUALIFICATION/CANARY':CANARIES+['boundary-canary','failure-canary','timeout-canary','memory-limit-canary','interrupt-canary','log-limit-canary','symlink-report-canary']})
|
||||
x.atomic(root/'executor-policy.json',policy)
|
||||
preparation.update(finishedUtc=x.utc(),images=images,policySha256=x.digest(policy),wheels={f.name:x.sha(f) for f in (context/'wheels').glob('*.whl')})
|
||||
x.atomic(root/'executor-preparation.json',preparation)
|
||||
print(json.dumps(dict(images=images,policySha256=x.digest(policy),ownerActivation=False),indent=2))
|
||||
|
||||
|
||||
if __name__=='__main__': main()
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"status": "PROPOSAL_ONLY_NOT_EXECUTABLE",
|
||||
"purpose": "Owner review of a narrowly scoped exception to mandatory remote publication for P10-00 only",
|
||||
"implementationRequired": true,
|
||||
"adopted": false,
|
||||
"scope": {
|
||||
"stage": "PHASE-10",
|
||||
"checkpoint": "P10-00",
|
||||
"baselineCommit": "fc5b9d377199ce51f480a920a3772108094929e3",
|
||||
"handoffCommit": "5cb903b989742b7a96cb22ddf4c0e24993b18980",
|
||||
"reportDirectory": "docs/automation/stages/PHASE-10",
|
||||
"allowedTrackedEdits": "Markdown assessment reports only; no deletions"
|
||||
},
|
||||
"proposedBehavior": [
|
||||
"Require an explicit signed manifest change and a checkpoint-specific owner decision before use; never infer a waiver from a remote failure",
|
||||
"Verify the exact baseline, frozen evidence and handoff ancestry/envelope locally without contacting Gitea",
|
||||
"Retain the existing sandbox, confined-executor, source binding, preservation, applicability and owner entry requirements",
|
||||
"Commit and independently verify P10-00 reports and private test evidence locally",
|
||||
"Record publication as NOT PUBLISHED with its exact local commit; never record remote verification or stage-wide acceptance",
|
||||
"Stop after P10-00 with a durable assessment-complete-local-only disposition; do not advance the checkpoint or stage into P10-01",
|
||||
"Require a separately reviewed implementation policy and candidate-specific owner approval for P10-01",
|
||||
"Keep default mandatory remote publication behavior for every other checkpoint and stage"
|
||||
],
|
||||
"excluded": [
|
||||
"Application or test edits",
|
||||
"Dependency changes or removals",
|
||||
"Database migrations or destructive cleanup",
|
||||
"Changes to accepted PDF metrics or visual acceptance",
|
||||
"Gitea repair or publication-hook bypass",
|
||||
"Main merge, production access or deployment",
|
||||
"Waiver of AI, hosted CI, human/device, provider, security or production gates"
|
||||
],
|
||||
"approvalEffect": "Review of this proposal is not an executable controller grant. The current controller does not implement this behavior. Do not configure this file or sign the existing remote-required request as a local-only waiver."
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"baselineCommit":"5032ccb41514807c8ca3008c24ca6326be1170de","candidateCommit":null,"checkpoint":"P10-00","detail":{"proposedManifestSha256":"51e12f29078c420ac4ebd10127c8b7f7ba3cd73eac09dcbb4d47da1fe88fbeaf"},"evidence":[],"kind":"manifest-policy-update","manifestSha256":"c82de8b5dda79beea50df31a952cfbebb7ebf0822414a346b978cdc9a652814e","policySha256":"f91c1a8ea4c7635a3c30e7024b389461029698bb54317cb47a7124cbd2965810","schemaVersion":1,"stage":"PHASE-10"}
|
||||
@@ -0,0 +1 @@
|
||||
{"baseline":"fc5b9d377199ce51f480a920a3772108094929e3","certificate":{"exportPolicy":"None","hasPrivateKey":true,"notAfter":"2028-10-29T17:33:01.0000000Z","thumbprint":"70CECAFB216759F9177E2A3B013F7CD473513170"},"checkedUtc":"2026-11-01T20:46:05.195856+00:00","checkoutClean":true,"executionEnabled":false,"executionPolicy":"operator-controlled","frozenSourceReceiptVerified":true,"handoffLocallyVerified":true,"handoffRemoteVerification":"NOT RUN in AUTO-START-01; previous publication evidence retained","installedCodeMatchesQualifiedSource":{"automation/assessment_adapter.py":"6f6b4e7b96f1e9ca896e1d2a9ab26c12bf38d603dbf087acf61969f5d3906a21","automation/confined_executor.py":"bd0ddbd321a53e65385899fc579e893dd247775264535ea6e181e4ce820bb4c2","automation/controller.py":"996eab9dfd55ce86b7fadb02b72e4cb7edbf19c2cf30450f9b4d5b5a87a0a35c","automation/executor_catalog.py":"d791e1c3a0566019999e69d218596cfb647955845c23012e755f0f409659f516","automation/executor_cli.py":"62b129adddf9beda57c0575be7771d566012148c6ddb9d02cf907507dd74ca1c","automation/executor_driver.py":"1a9b0ba9be1e568a545808f2d0836d05b3778546d88813593ee061cfdeaa9ff6","automation/executor_supervisor.py":"e5f813fc28ca402bad79a6e136c2a7fc2ccb7950a6611e79f4dae997062b55fc","automation/local_mode.py":"b5d5441ec1e40820f39ea88833c43863db2a6d5acc1209b4081b3812b917d78a","automation/provision_executor.py":"2c10f669a906e8629974d0e59a63d075f4a6f4a977a7ac337e9a6ef6ed94ac90","scripts/Probe-JobjaktSandbox.ps1":"4a29680903dead129cbfb37a9fdec0a3c461e518757b0f03558af4000a1b92ae","scripts/Run-JobjaktBacklog.ps1":"51161dbc58c57738475095e733ecfbc417a8a54f2b1eeb95b189943959cd1a08"},"nativeIssuedUtc":"2026-11-01T20:23:11.397774+00:00","nativeQualificationFresh":true,"ownerApprovalFiles":0,"roadmapSessions":0,"scope":{"checkpoint":"P10-00","handoffBranch":"test/pre-phase10-ux-acceptance","handoffCommit":"5cb903b989742b7a96cb22ddf4c0e24993b18980","mode":"assessment-only","reportDirectory":"docs/automation/stages/PHASE-10","stage":"PHASE-10"}}
|
||||
@@ -0,0 +1 @@
|
||||
{"activeManifestSha256":"b0a32cfdedfbedcf089f0dc929e774fc968221bd66f4e510fd981a99eaf4fe88","baselineCommit":"fc5b9d377199ce51f480a920a3772108094929e3","executionCheckoutClean":true,"executionEnabled":false,"executionPolicy":"operator-controlled","executorPolicySha256":"3dfe072995305d5e00ecc30d34ef77c920e14017c2457bfbf030b25bae169dbc","ownerPublicPinPreserved":true,"recoveryRequired":false,"repository":"C:\\Users\\Connor\\.codex\\worktrees\\p10-assessment\\Job tracker","roadmapSessions":0,"sourceReceiptVerified":true}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nativeExitCode": 0,
|
||||
"tests": 100,
|
||||
"elapsedSeconds": 175.57636070251465,
|
||||
"sourceStable": true,
|
||||
"sourceSha256": {
|
||||
"automation/assessment_adapter.py": "6f6b4e7b96f1e9ca896e1d2a9ab26c12bf38d603dbf087acf61969f5d3906a21",
|
||||
"automation/confined_executor.py": "bd0ddbd321a53e65385899fc579e893dd247775264535ea6e181e4ce820bb4c2",
|
||||
"automation/controller.py": "996eab9dfd55ce86b7fadb02b72e4cb7edbf19c2cf30450f9b4d5b5a87a0a35c",
|
||||
"automation/executor_catalog.py": "d791e1c3a0566019999e69d218596cfb647955845c23012e755f0f409659f516",
|
||||
"automation/executor_cli.py": "62b129adddf9beda57c0575be7771d566012148c6ddb9d02cf907507dd74ca1c",
|
||||
"automation/executor_driver.py": "1a9b0ba9be1e568a545808f2d0836d05b3778546d88813593ee061cfdeaa9ff6",
|
||||
"automation/executor_supervisor.py": "e5f813fc28ca402bad79a6e136c2a7fc2ccb7950a6611e79f4dae997062b55fc",
|
||||
"automation/local_mode.py": "b5d5441ec1e40820f39ea88833c43863db2a6d5acc1209b4081b3812b917d78a",
|
||||
"automation/prepare_queue.py": "6cad22305bc354ccbae2f031cb2b324596b3a7d42503b954c27f1e63e47a5f7d",
|
||||
"automation/provision_executor.py": "2c10f669a906e8629974d0e59a63d075f4a6f4a977a7ac337e9a6ef6ed94ac90",
|
||||
"automation/qualify_assessment.py": "0891520943779da0ff722d8deba62151d5c1dfad1329026310baab216459374d",
|
||||
"automation/schemas/backlog.schema.json": "f5647bf23237a3d14be76ace9fce6358d0e3ccc9ae97b6bca2b6abefc539e2cb",
|
||||
"automation/tests/fake_codex.py": "d50bc330392fe7aa15f2141f1ca2cde1bad797674ad9bc74304907f5dbe66cb3",
|
||||
"automation/tests/test_assessment.py": "d3d30aaa808ead6927a444c1f91aa583835d3a787893b8f67db6b68261aa243c",
|
||||
"automation/tests/test_controller.py": "458da3c60571e61aad42987ce156842efd73ef0e2aa0c7bce719d36d626d7e7d",
|
||||
"automation/tests/test_executor.py": "3f180f26ecffa7dab7195a3a780b58cdee835b8d2411b53fa7af98a5acaf28c1",
|
||||
"automation/tests/test_local_mode.py": "48e0fb92376053c39e99796570550ec51ca656506912788ec741bf39d20a454f",
|
||||
"scripts/Probe-JobjaktSandbox.ps1": "4a29680903dead129cbfb37a9fdec0a3c461e518757b0f03558af4000a1b92ae",
|
||||
"scripts/Run-JobjaktBacklog.ps1": "51161dbc58c57738475095e733ecfbc417a8a54f2b1eeb95b189943959cd1a08"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
test_assessment_profile_keeps_product_read_only (test_assessment.ReadOnlyProfileTests.test_assessment_profile_keeps_product_read_only) ... ok
|
||||
test_receipt_rejects_changed_product_or_changed_receipt (test_assessment.ReceiptTests.test_receipt_rejects_changed_product_or_changed_receipt) ... ok
|
||||
test_assessment_reaches_protected_stop_and_cannot_advance (test_assessment.ScopeTests.test_assessment_reaches_protected_stop_and_cannot_advance) ... ok
|
||||
test_assessment_reports_are_permitted (test_assessment.ScopeTests.test_assessment_reports_are_permitted) ... ok
|
||||
test_entry_cannot_prepare_approvals_without_composite_adapter (test_assessment.ScopeTests.test_entry_cannot_prepare_approvals_without_composite_adapter) ... ok
|
||||
test_evidence_inspection_cannot_be_marked_runtime_qualified (test_assessment.ScopeTests.test_evidence_inspection_cannot_be_marked_runtime_qualified) ... ok
|
||||
test_generic_approval_cannot_launch_next_checkpoint (test_assessment.ScopeTests.test_generic_approval_cannot_launch_next_checkpoint) ... ok
|
||||
test_inspection_requires_explicit_false_and_never_launches_worker (test_assessment.ScopeTests.test_inspection_requires_explicit_false_and_never_launches_worker) ... ok
|
||||
test_native_isolation_failure_stops_before_additional_probe (test_assessment.ScopeTests.test_native_isolation_failure_stops_before_additional_probe) ... ok
|
||||
test_policy_cannot_relabel_p10_01_as_assessment (test_assessment.ScopeTests.test_policy_cannot_relabel_p10_01_as_assessment) ... ok
|
||||
test_scope_rejects_product_write_and_deletion (test_assessment.ScopeTests.test_scope_rejects_product_write_and_deletion) ... ok
|
||||
test_scope_requires_protected_stop (test_assessment.ScopeTests.test_scope_requires_protected_stop) ... ok
|
||||
test_accidental_main_checkout_rejected (test_controller.EngineTests.test_accidental_main_checkout_rejected) ... ok
|
||||
test_after_approval_binds_tested_commit_without_rerunning_worker (test_controller.EngineTests.test_after_approval_binds_tested_commit_without_rerunning_worker) ... ok
|
||||
test_changed_prompt_blocks (test_controller.EngineTests.test_changed_prompt_blocks) ... ok
|
||||
test_conditional_can_advance_only_with_explicit_signed_deferral (test_controller.EngineTests.test_conditional_can_advance_only_with_explicit_signed_deferral) ... ok
|
||||
test_conditional_requires_explicit_deferrable_gates (test_controller.EngineTests.test_conditional_requires_explicit_deferrable_gates) ... ok
|
||||
test_corrupt_state_recovers_last_good_without_success (test_controller.EngineTests.test_corrupt_state_recovers_last_good_without_success) ... ok
|
||||
test_cryptographically_approved_resume_e2e (test_controller.EngineTests.test_cryptographically_approved_resume_e2e) ... ok
|
||||
test_dependency_cannot_be_bypassed (test_controller.EngineTests.test_dependency_cannot_be_bypassed) ... ok
|
||||
test_design_revision_reruns_current_checkpoint_and_keeps_owner_selection (test_controller.EngineTests.test_design_revision_reruns_current_checkpoint_and_keeps_owner_selection) ... ok
|
||||
test_disabled_manifest_never_executes (test_controller.EngineTests.test_disabled_manifest_never_executes) ... ok
|
||||
test_double_corruption_fails_closed (test_controller.EngineTests.test_double_corruption_fails_closed) ... ok
|
||||
test_duplicate_lock_rejected (test_controller.EngineTests.test_duplicate_lock_rejected) ... ok
|
||||
test_execution_window_stops_before_worker (test_controller.EngineTests.test_execution_window_stops_before_worker) ... ok
|
||||
test_failed_stage_stops_and_exhausts_retry_budget (test_controller.EngineTests.test_failed_stage_stops_and_exhausts_retry_budget) ... ok
|
||||
test_failing_checks_never_commit_or_advance (test_controller.EngineTests.test_failing_checks_never_commit_or_advance) ... ok
|
||||
test_interruption_is_not_success_and_resume_has_budget (test_controller.EngineTests.test_interruption_is_not_success_and_resume_has_budget) ... ok
|
||||
test_manifest_initially_disabled (test_controller.EngineTests.test_manifest_initially_disabled) ... ok
|
||||
test_missing_approval_does_not_run_model (test_controller.EngineTests.test_missing_approval_does_not_run_model) ... ok
|
||||
test_missing_prompt_blocks (test_controller.EngineTests.test_missing_prompt_blocks) ... ok
|
||||
test_model_cannot_approve_itself (test_controller.EngineTests.test_model_cannot_approve_itself) ... ok
|
||||
test_pause_persists_and_resume_clears_it (test_controller.EngineTests.test_pause_persists_and_resume_clears_it) ... ok
|
||||
test_push_failure_preserves_tested_commit (test_controller.EngineTests.test_push_failure_preserves_tested_commit) ... ok
|
||||
test_push_verification_mismatch_stops (test_controller.EngineTests.test_push_verification_mismatch_stops) ... ok
|
||||
test_recovered_running_without_marker_requires_reconciliation (test_controller.EngineTests.test_recovered_running_without_marker_requires_reconciliation) ... ok
|
||||
test_restart_running_marker_cannot_mean_completed (test_controller.EngineTests.test_restart_running_marker_cannot_mean_completed) ... ok
|
||||
test_same_repo_other_control_root_cannot_take_lock (test_controller.EngineTests.test_same_repo_other_control_root_cannot_take_lock) ... ok
|
||||
test_success_orders_stages_and_verifies_remote (test_controller.EngineTests.test_success_orders_stages_and_verifies_remote) ... ok
|
||||
test_tampered_evidence_cannot_be_approved (test_controller.EngineTests.test_tampered_evidence_cannot_be_approved) ... ok
|
||||
test_unavailable_remote_preserves_commit_and_retries_publication_only (test_controller.EngineTests.test_unavailable_remote_preserves_commit_and_retries_publication_only) ... ok
|
||||
test_unconfigured_test_adapter_blocks_before_model (test_controller.EngineTests.test_unconfigured_test_adapter_blocks_before_model) ... ok
|
||||
test_unsigned_recovery_cannot_clear_running_guard (test_controller.EngineTests.test_unsigned_recovery_cannot_clear_running_guard) ... ok
|
||||
test_forward_dependency_rejected (test_controller.QueueTests.test_forward_dependency_rejected) ... ok
|
||||
test_production_branches_rejected (test_controller.QueueTests.test_production_branches_rejected) ... ok
|
||||
test_real_queue_is_ordered_and_missing_sources_are_explicit (test_controller.QueueTests.test_real_queue_is_ordered_and_missing_sources_are_explicit) ... ok
|
||||
test_empty_report_is_not_a_pass (test_controller.ReportTests.test_empty_report_is_not_a_pass) ... ok
|
||||
test_json_log_redaction_preserves_event_structure (test_controller.ReportTests.test_json_log_redaction_preserves_event_structure) ... ok
|
||||
test_path_escape_rejected (test_controller.ReportTests.test_path_escape_rejected) ... ok
|
||||
test_playwright_retry_and_expected_failure_are_not_pass (test_controller.ReportTests.test_playwright_retry_and_expected_failure_are_not_pass) ... ok
|
||||
test_redacts_common_credentials (test_controller.ReportTests.test_redacts_common_credentials) ... ok
|
||||
test_report_membership_and_skip_enforcement (test_controller.ReportTests.test_report_membership_and_skip_enforcement) ... ok
|
||||
test_cli_nonzero_exit_never_accepts (test_controller.SubprocessTests.test_cli_nonzero_exit_never_accepts) ... ok
|
||||
test_cli_protocol_real_process_and_complete_prompt (test_controller.SubprocessTests.test_cli_protocol_real_process_and_complete_prompt) ... ok
|
||||
test_killed_controller_terminates_worker_and_grandchild (test_controller.SubprocessTests.test_killed_controller_terminates_worker_and_grandchild) ... ok
|
||||
test_marker_write_failure_does_not_leave_worker (test_controller.SubprocessTests.test_marker_write_failure_does_not_leave_worker) ... ok
|
||||
test_no_newline_output_obeys_log_budget (test_controller.SubprocessTests.test_no_newline_output_obeys_log_budget) ... ok
|
||||
test_prompt_stall_still_obeys_timeout (test_controller.SubprocessTests.test_prompt_stall_still_obeys_timeout) ... ok
|
||||
test_real_check_report_must_match_expected_membership (test_controller.SubprocessTests.test_real_check_report_must_match_expected_membership) ... ok
|
||||
test_worker_cannot_execute_before_job_assignment (test_controller.SubprocessTests.test_worker_cannot_execute_before_job_assignment) ... ok
|
||||
test_exact_tested_candidate_is_promoted_without_another_commit (test_executor.CandidateIntegrationTests.test_exact_tested_candidate_is_promoted_without_another_commit) ... ok
|
||||
test_failed_candidate_never_moves_the_branch (test_executor.CandidateIntegrationTests.test_failed_candidate_never_moves_the_branch) ... ok
|
||||
test_missing_live_qualification_stops_before_model (test_executor.CandidateIntegrationTests.test_missing_live_qualification_stops_before_model) ... ok
|
||||
test_process_runner_cannot_accept_native_failure_receipt (test_executor.CandidateIntegrationTests.test_process_runner_cannot_accept_native_failure_receipt) ... ok
|
||||
test_altered_identity_or_injection_is_rejected (test_executor.ValidationTests.test_altered_identity_or_injection_is_rejected) ... ok
|
||||
test_arbitrary_commands_docker_paths_and_exit_codes_are_rejected (test_executor.ValidationTests.test_arbitrary_commands_docker_paths_and_exit_codes_are_rejected) ... ok
|
||||
test_archive_rejects_traversal_links_and_special_files (test_executor.ValidationTests.test_archive_rejects_traversal_links_and_special_files) ... ok
|
||||
test_assessment_rejects_changed_application_script_before_materialization (test_executor.ValidationTests.test_assessment_rejects_changed_application_script_before_materialization) ... ok
|
||||
test_cleanup_requires_actual_id_image_nonce_and_safety (test_executor.ValidationTests.test_cleanup_requires_actual_id_image_nonce_and_safety) ... ok
|
||||
test_disappearing_root_process_cannot_interrupt_evidence_sealing (test_executor.ValidationTests.test_disappearing_root_process_cannot_interrupt_evidence_sealing) ... ok
|
||||
test_docker_outage_cannot_be_recorded_as_successful_cleanup (test_executor.ValidationTests.test_docker_outage_cannot_be_recorded_as_successful_cleanup) ... ok
|
||||
test_expired_individual_run_cannot_be_renewed_by_fresh_aggregate (test_executor.ValidationTests.test_expired_individual_run_cannot_be_renewed_by_fresh_aggregate) ... ok
|
||||
test_failed_native_report_keeps_counts_without_becoming_acceptable (test_executor.ValidationTests.test_failed_native_report_keeps_counts_without_becoming_acceptable) ... ok
|
||||
test_fixed_request_is_accepted (test_executor.ValidationTests.test_fixed_request_is_accepted) ... ok
|
||||
test_forged_private_receipt_or_changed_report_fails (test_executor.ValidationTests.test_forged_private_receipt_or_changed_report_fails) ... ok
|
||||
test_no_host_mounts_privileges_ports_or_external_network (test_executor.ValidationTests.test_no_host_mounts_privileges_ports_or_external_network) ... ok
|
||||
test_old_policy_receipt_cannot_qualify_a_new_policy (test_executor.ValidationTests.test_old_policy_receipt_cannot_qualify_a_new_policy) ... ok
|
||||
test_valid_archive_has_nonempty_unique_membership (test_executor.ValidationTests.test_valid_archive_has_nonempty_unique_membership) ... ok
|
||||
test_pending_recovery_can_be_signed_from_idle_operator_terminal (test_local_mode.LocalFlowTests.test_pending_recovery_can_be_signed_from_idle_operator_terminal) ... ok
|
||||
test_single_user_concurrent_controller_and_interrupted_guard (test_local_mode.LocalFlowTests.test_single_user_concurrent_controller_and_interrupted_guard) ... ok
|
||||
test_single_user_main_checkout_is_still_prohibited (test_local_mode.LocalFlowTests.test_single_user_main_checkout_is_still_prohibited) ... ok
|
||||
test_single_user_missing_approval_stops_before_worker (test_local_mode.LocalFlowTests.test_single_user_missing_approval_stops_before_worker) ... ok
|
||||
test_single_user_pause_and_publication_recovery (test_local_mode.LocalFlowTests.test_single_user_pause_and_publication_recovery) ... ok
|
||||
test_single_user_subprocess_protocol_and_ordered_publication (test_local_mode.LocalFlowTests.test_single_user_subprocess_protocol_and_ordered_publication) ... ok
|
||||
test_accessible_docker_pipe_cannot_qualify_worker (test_local_mode.LocalPolicyTests.test_accessible_docker_pipe_cannot_qualify_worker) ... ok
|
||||
test_auth_home_inside_worker_is_rejected (test_local_mode.LocalPolicyTests.test_auth_home_inside_worker_is_rejected) ... ok
|
||||
test_blocked_status_rejects_otherwise_successful_probes (test_local_mode.LocalPolicyTests.test_blocked_status_rejects_otherwise_successful_probes) ... ok
|
||||
test_different_or_missing_sid_rejected (test_local_mode.LocalPolicyTests.test_different_or_missing_sid_rejected) ... ok
|
||||
test_existing_normal_auth_home_is_rejected (test_local_mode.LocalPolicyTests.test_existing_normal_auth_home_is_rejected) ... ok
|
||||
test_failed_probe_and_unconfigured_owner_key_cannot_qualify (test_local_mode.LocalPolicyTests.test_failed_probe_and_unconfigured_owner_key_cannot_qualify) ... ok
|
||||
test_missing_or_stale_qualification_never_enables_unattended (test_local_mode.LocalPolicyTests.test_missing_or_stale_qualification_never_enables_unattended) ... ok
|
||||
test_mxc_is_explicit_without_legacy_or_unrestricted_fallback (test_local_mode.LocalPolicyTests.test_mxc_is_explicit_without_legacy_or_unrestricted_fallback) ... ok
|
||||
test_noninteractive_approval_is_refused (test_local_mode.LocalPolicyTests.test_noninteractive_approval_is_refused) ... ok
|
||||
test_operator_controlled_policy_cannot_launch_a_worker (test_local_mode.LocalPolicyTests.test_operator_controlled_policy_cannot_launch_a_worker) ... ok
|
||||
test_plugins_are_not_an_implicit_same_user_capability (test_local_mode.LocalPolicyTests.test_plugins_are_not_an_implicit_same_user_capability) ... ok
|
||||
test_probe_summary_rejects_partial_and_failed_boundaries (test_local_mode.LocalPolicyTests.test_probe_summary_rejects_partial_and_failed_boundaries) ... ok
|
||||
test_profile_denies_root_control_auth_and_normal_configuration (test_local_mode.LocalPolicyTests.test_profile_denies_root_control_auth_and_normal_configuration) ... ok
|
||||
test_same_chatgpt_auth_is_explicit_and_tokens_are_not_copied (test_local_mode.LocalPolicyTests.test_same_chatgpt_auth_is_explicit_and_tokens_are_not_copied) ... ok
|
||||
test_same_windows_identity_supported (test_local_mode.LocalPolicyTests.test_same_windows_identity_supported) ... ok
|
||||
test_tool_or_temp_roots_cannot_reopen_protected_parent (test_local_mode.LocalPolicyTests.test_tool_or_temp_roots_cannot_reopen_protected_parent) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 100 tests in 175.066s
|
||||
|
||||
OK
|
||||
{"baselineCommit":"e92befe96c1128b8be5b4667a0214ef3f3ac3e02","candidateCommit":null,"checkpoint":"work","detail":null,"evidence":[],"kind":"recovery-reconciled","manifestSha256":"ebdaa88506cdda0e77630dbe4eb5563fcc8622670a8cacb0fed11122692718f4","policySha256":"48bf64183374ec9ef266f70c405e6164ba35bb453ec1018af4524ef2c6b27f36","schemaVersion":1,"stage":"ONE"}
|
||||
@@ -0,0 +1 @@
|
||||
{"executionEnabled":false,"message":"Adopt the signed restricted assessment policy first","nativeExitCode":2,"roadmapSessions":0}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"assessmentScopeProbes":{"reportWrite":true,"sourceDeleteDenied":true,"sourceRead":true,"sourceWriteDenied":true},"binding":"ed55671009856e38474c334a943d3b5bc3f1fc72ab4dd77709842306953fb31e","dockerPipeHostPositive":true,"failure":null,"issuedUtc":"2026-11-01T20:23:11.397774+00:00","ownerKeyDenied":true,"probes":{"dockerPipeDenied":true,"files":[{"category":"approvals","readDenied":true,"writeDenied":true},{"category":"configuration","readDenied":true,"writeDenied":true},{"category":"key-file","readDenied":true,"writeDenied":true},{"category":"normal-codex","readDenied":true,"writeDenied":true},{"category":"other-repository","readDenied":true,"writeDenied":true},{"category":"personal","readDenied":true,"writeDenied":true},{"category":"production-canary","readDenied":true,"writeDenied":true}],"networkDenied":true,"ownerKeyDenied":true,"positiveControl":true,"sanitizedReportRead":true,"sanitizedReportWriteDenied":true,"signingKeyDenied":true},"scope":"Synthetic filesystem/network/signing canaries; real owner key probed","status":"PASS"}
|
||||
@@ -0,0 +1 @@
|
||||
{"activeManifestChanged":false,"disabledManifestSha256":"8aedbb62bae7d127cbe21d1cfddb054f6582d292bd5ddd432ff3707d56b6ac77","disabledProposal":"PASSED","enabledManifestSha256":"51e12f29078c420ac4ebd10127c8b7f7ba3cd73eac09dcbb4d47da1fe88fbeaf","enabledProposal":"PASSED","executorPolicySha256":"3dfe072995305d5e00ecc30d34ef77c920e14017c2457bfbf030b25bae169dbc","ownerApprovalsSigned":0,"phase10Entry":"BLOCKED_PENDING_PUBLICATION_AND_OWNER_APPROVALS"}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"attemptedUtc": "2026-11-01T20:40:15.994324+00:00",
|
||||
"localCommit": "c5abef1fa2f134998af5ff9b259905010c79331d",
|
||||
"nativePushExitCode": 1,
|
||||
"remoteVerificationExitCode": 0,
|
||||
"remoteCommit": "750d76317c2e4d4b34c89c283f06b38459d0917f",
|
||||
"published": false,
|
||||
"errorExcerpt": "remote: unexpected fault address 0x203cee8a6 \nremote: fatal error: fault \nremote: [signal SIGSEGV: segmentation violation code=0x1 addr=0x203cee8a6 pc=0x4986a1] \nremote: \nremote: goroutine 1 gp=0x3196258601e0 m=0 mp=0x74d87c0 [running, locked to thread]: \nremote: runtime.throw({0x3c94d26?, 0xc80?}) \nremote: \t/usr/local/go/src/runtime/panic.go:1229 +0x48 fp=0x3196263efa50 sp=0x3196263efa20 pc=0x493068 \nremote: runtime.sigpanic() \nremote: \t/usr/local/go/src/runtime/signal_unix.go:945 +0x285 fp=0x3196263efab0 sp=0x3196263efa50 pc=0x495525 \nremote: aeshashbody() \nremote: \t/usr/local/go/src/runtime/asm_amd64.s:1339 +0x61 fp=0x3196263efab8 sp=0x3196263efab0 pc=0x4986a1 \nremote: runtime.mapassign_faststr(0x36f8d20, 0x319625ca39b0, {0x203cee8a6, 0x9}) \nremote: \t/usr/local/go/src/internal/runtime/maps/runtime_faststr.go:277 +0xaa fp=0x3196263efb80 sp=0x3196263efab8 pc=0x419a6a \nremote: github.com/go-enry/go-enry/v2/data.map.init.6() \nremote: \t/go/pkg/mod/github.com/go-enry/go-enry/v2@v2.9.5/data/frequencies.go:742 +0x11fad fp=0x3196263efbd0 sp=0x3196263efb80 pc=0x13ed7ad \nremote: github.com/go-enry/go-enry/v2/data.init() \nremote: \t/go/pkg/mod/github.com/go-enry/go-enry/v2@v2.9.5/data/frequencies.go:742 +0x20f65 fp=0x3196263efe28 sp=0x3196263efbd0 pc=0x1431405 \nremote: runtime.doInit1(0x6a1d160) \nremote: \t/usr/local/go/src/runtime/proc.go:8103 +0xd5 fp=0x3196263eff48 sp=0x3196263efe28 pc=0x46aed5 \nremote: runtime.doInit(...) \nremote: \t/usr/local/go/src/\n...\n0x43652b \nremote: runtime.gcBgMarkStartWorkers.gowrap1() \nremote: \t/usr/local/go/src/runtime/mgc.go:1695 +0x17 fp=0x319625d6afe0 sp=0x319625d6afc8 pc=0x436417 \nremote: runtime.goexit({}) \nremote: \t/usr/local/go/src/runtime/asm_amd64.s:1771 +0x1 fp=0x319625d6afe8 sp=0x319625d6afe0 pc=0x49af21 \nremote: created by runtime.gcBgMarkStartWorkers in goroutine 1 \nremote: \t/usr/local/go/src/runtime/mgc.go:1695 +0x105 \nTo https://git.cesnimda.uk/cesnimda/jobtrackingapp.git\n ! [remote rejected] HEAD -> codex/autonomous-roadmap-single-user (pre-receive hook declined)\nerror: failed to push some refs to 'https://git.cesnimda.uk/cesnimda/jobtrackingapp.git'\n"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"approvalFiles":0,"disabledProposalSha256":"8aedbb62bae7d127cbe21d1cfddb054f6582d292bd5ddd432ff3707d56b6ac77","enabledProposalSha256":"51e12f29078c420ac4ebd10127c8b7f7ba3cd73eac09dcbb4d47da1fe88fbeaf","pending":[{"kind":"manifest-policy-update","request":"C:\\Users\\Connor\\.jobjakt-backlog\\single-user-local\\requests\\83562754828a67f2e6c08a5f6b3fec409dec1b4133f83e9a74a1ace7a0bfc14c.json"}]}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"nativeExitCode": 0,
|
||||
"sourceSha256": {
|
||||
"automation/controller.py": "31a27d336a42a84b9926cde36120bd20da384b4af6bf2afec91d9949bc0e2cd6",
|
||||
"automation/tests/test_controller.py": "0eb7e4a00176d555f447cb0726a8698c84b65c780239092f49ab09cf4369554b"
|
||||
},
|
||||
"elapsedSeconds": 93.125,
|
||||
"scope": "test_controller.py only; includes the focused subprocess cases",
|
||||
"sourceStable": true,
|
||||
"tests": 52,
|
||||
"failures": 0,
|
||||
"skips": 0
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
test_accidental_main_checkout_rejected (test_controller.EngineTests.test_accidental_main_checkout_rejected) ... ok
|
||||
test_after_approval_binds_tested_commit_without_rerunning_worker (test_controller.EngineTests.test_after_approval_binds_tested_commit_without_rerunning_worker) ... ok
|
||||
test_changed_prompt_blocks (test_controller.EngineTests.test_changed_prompt_blocks) ... ok
|
||||
test_conditional_can_advance_only_with_explicit_signed_deferral (test_controller.EngineTests.test_conditional_can_advance_only_with_explicit_signed_deferral) ... ok
|
||||
test_conditional_requires_explicit_deferrable_gates (test_controller.EngineTests.test_conditional_requires_explicit_deferrable_gates) ... ok
|
||||
test_corrupt_state_recovers_last_good_without_success (test_controller.EngineTests.test_corrupt_state_recovers_last_good_without_success) ... ok
|
||||
test_cryptographically_approved_resume_e2e (test_controller.EngineTests.test_cryptographically_approved_resume_e2e) ... ok
|
||||
test_dependency_cannot_be_bypassed (test_controller.EngineTests.test_dependency_cannot_be_bypassed) ... ok
|
||||
test_design_revision_reruns_current_checkpoint_and_keeps_owner_selection (test_controller.EngineTests.test_design_revision_reruns_current_checkpoint_and_keeps_owner_selection) ... ok
|
||||
test_disabled_manifest_never_executes (test_controller.EngineTests.test_disabled_manifest_never_executes) ... ok
|
||||
test_double_corruption_fails_closed (test_controller.EngineTests.test_double_corruption_fails_closed) ... ok
|
||||
test_duplicate_lock_rejected (test_controller.EngineTests.test_duplicate_lock_rejected) ... ok
|
||||
test_execution_window_stops_before_worker (test_controller.EngineTests.test_execution_window_stops_before_worker) ... ok
|
||||
test_failed_stage_stops_and_exhausts_retry_budget (test_controller.EngineTests.test_failed_stage_stops_and_exhausts_retry_budget) ... ok
|
||||
test_failing_checks_never_commit_or_advance (test_controller.EngineTests.test_failing_checks_never_commit_or_advance) ... ok
|
||||
test_interruption_is_not_success_and_resume_has_budget (test_controller.EngineTests.test_interruption_is_not_success_and_resume_has_budget) ... ok
|
||||
test_manifest_initially_disabled (test_controller.EngineTests.test_manifest_initially_disabled) ... ok
|
||||
test_missing_approval_does_not_run_model (test_controller.EngineTests.test_missing_approval_does_not_run_model) ... ok
|
||||
test_missing_prompt_blocks (test_controller.EngineTests.test_missing_prompt_blocks) ... ok
|
||||
test_model_cannot_approve_itself (test_controller.EngineTests.test_model_cannot_approve_itself) ... ok
|
||||
test_pause_persists_and_resume_clears_it (test_controller.EngineTests.test_pause_persists_and_resume_clears_it) ... ok
|
||||
test_push_failure_preserves_tested_commit (test_controller.EngineTests.test_push_failure_preserves_tested_commit) ... ok
|
||||
test_push_verification_mismatch_stops (test_controller.EngineTests.test_push_verification_mismatch_stops) ... ok
|
||||
test_recovered_running_without_marker_requires_reconciliation (test_controller.EngineTests.test_recovered_running_without_marker_requires_reconciliation) ... ok
|
||||
test_restart_running_marker_cannot_mean_completed (test_controller.EngineTests.test_restart_running_marker_cannot_mean_completed) ... ok
|
||||
test_same_repo_other_control_root_cannot_take_lock (test_controller.EngineTests.test_same_repo_other_control_root_cannot_take_lock) ... ok
|
||||
test_success_orders_stages_and_verifies_remote (test_controller.EngineTests.test_success_orders_stages_and_verifies_remote) ... ok
|
||||
test_tampered_evidence_cannot_be_approved (test_controller.EngineTests.test_tampered_evidence_cannot_be_approved) ... ok
|
||||
test_unavailable_remote_preserves_commit_and_retries_publication_only (test_controller.EngineTests.test_unavailable_remote_preserves_commit_and_retries_publication_only) ... ok
|
||||
test_unconfigured_test_adapter_blocks_before_model (test_controller.EngineTests.test_unconfigured_test_adapter_blocks_before_model) ... ok
|
||||
test_unsigned_recovery_cannot_clear_running_guard (test_controller.EngineTests.test_unsigned_recovery_cannot_clear_running_guard) ... ok
|
||||
test_forward_dependency_rejected (test_controller.QueueTests.test_forward_dependency_rejected) ... ok
|
||||
test_production_branches_rejected (test_controller.QueueTests.test_production_branches_rejected) ... ok
|
||||
test_real_queue_is_ordered_and_missing_sources_are_explicit (test_controller.QueueTests.test_real_queue_is_ordered_and_missing_sources_are_explicit) ... ok
|
||||
test_empty_report_is_not_a_pass (test_controller.ReportTests.test_empty_report_is_not_a_pass) ... ok
|
||||
test_json_log_redaction_preserves_event_structure (test_controller.ReportTests.test_json_log_redaction_preserves_event_structure) ... ok
|
||||
test_path_escape_rejected (test_controller.ReportTests.test_path_escape_rejected) ... ok
|
||||
test_playwright_retry_and_expected_failure_are_not_pass (test_controller.ReportTests.test_playwright_retry_and_expected_failure_are_not_pass) ... ok
|
||||
test_redacts_common_credentials (test_controller.ReportTests.test_redacts_common_credentials) ... ok
|
||||
test_report_membership_and_skip_enforcement (test_controller.ReportTests.test_report_membership_and_skip_enforcement) ... ok
|
||||
test_cli_nonzero_exit_never_accepts (test_controller.SubprocessTests.test_cli_nonzero_exit_never_accepts) ... ok
|
||||
test_cli_protocol_real_process_and_complete_prompt (test_controller.SubprocessTests.test_cli_protocol_real_process_and_complete_prompt) ... ok
|
||||
test_completed_turn_shutdown_hang_is_blocked_and_cleaned (test_controller.SubprocessTests.test_completed_turn_shutdown_hang_is_blocked_and_cleaned) ... ok
|
||||
test_completed_turn_still_requires_actual_zero_exit (test_controller.SubprocessTests.test_completed_turn_still_requires_actual_zero_exit) ... ok
|
||||
test_inconsistent_complete_handoff_rejected_before_checks (test_controller.SubprocessTests.test_inconsistent_complete_handoff_rejected_before_checks) ... ok
|
||||
test_killed_controller_terminates_worker_and_grandchild (test_controller.SubprocessTests.test_killed_controller_terminates_worker_and_grandchild) ... ok
|
||||
test_marker_write_failure_does_not_leave_worker (test_controller.SubprocessTests.test_marker_write_failure_does_not_leave_worker) ... ok
|
||||
test_no_newline_output_obeys_log_budget (test_controller.SubprocessTests.test_no_newline_output_obeys_log_budget) ... ok
|
||||
test_non_codex_commands_do_not_arm_shutdown_guard (test_controller.SubprocessTests.test_non_codex_commands_do_not_arm_shutdown_guard) ... ok
|
||||
test_prompt_stall_still_obeys_timeout (test_controller.SubprocessTests.test_prompt_stall_still_obeys_timeout) ... ok
|
||||
test_real_check_report_must_match_expected_membership (test_controller.SubprocessTests.test_real_check_report_must_match_expected_membership) ... ok
|
||||
test_worker_cannot_execute_before_job_assignment (test_controller.SubprocessTests.test_worker_cannot_execute_before_job_assignment) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 52 tests in 92.837s
|
||||
|
||||
OK
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"pausedByPersistedRequest": true,
|
||||
"activeProcessMarker": false,
|
||||
"stage": "BLOCKED",
|
||||
"sessions": 4,
|
||||
"installedControllerSha256": "996eab9dfd55ce86b7fadb02b72e4cb7edbf19c2cf30450f9b4d5b5a87a0a35c",
|
||||
"reportSha256": "55afecbcb09d91762fdddb2670c409566bf58f9fce6c2a705627e9fcfb8e10d0",
|
||||
"patchInstalled": false,
|
||||
"modelSessionsLaunchedByThisTask": 0,
|
||||
"underlyingCliShutdownCause": "UNRESOLVED"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"nativeExitCode": 0,
|
||||
"sourceSha256": {
|
||||
"automation\\controller.py": "31a27d336a42a84b9926cde36120bd20da384b4af6bf2afec91d9949bc0e2cd6",
|
||||
"automation\\tests\\test_controller.py": "0eb7e4a00176d555f447cb0726a8698c84b65c780239092f49ab09cf4369554b"
|
||||
},
|
||||
"elapsedSeconds": 26.264999999999418,
|
||||
"scope": "SubprocessTests only",
|
||||
"sourceStable": true,
|
||||
"tests": 12,
|
||||
"failures": 0,
|
||||
"skips": 0
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
test_cli_nonzero_exit_never_accepts (test_controller.SubprocessTests.test_cli_nonzero_exit_never_accepts) ... ok
|
||||
test_cli_protocol_real_process_and_complete_prompt (test_controller.SubprocessTests.test_cli_protocol_real_process_and_complete_prompt) ... ok
|
||||
test_completed_turn_shutdown_hang_is_blocked_and_cleaned (test_controller.SubprocessTests.test_completed_turn_shutdown_hang_is_blocked_and_cleaned) ... ok
|
||||
test_completed_turn_still_requires_actual_zero_exit (test_controller.SubprocessTests.test_completed_turn_still_requires_actual_zero_exit) ... ok
|
||||
test_inconsistent_complete_handoff_rejected_before_checks (test_controller.SubprocessTests.test_inconsistent_complete_handoff_rejected_before_checks) ... ok
|
||||
test_killed_controller_terminates_worker_and_grandchild (test_controller.SubprocessTests.test_killed_controller_terminates_worker_and_grandchild) ... ok
|
||||
test_marker_write_failure_does_not_leave_worker (test_controller.SubprocessTests.test_marker_write_failure_does_not_leave_worker) ... ok
|
||||
test_no_newline_output_obeys_log_budget (test_controller.SubprocessTests.test_no_newline_output_obeys_log_budget) ... ok
|
||||
test_non_codex_commands_do_not_arm_shutdown_guard (test_controller.SubprocessTests.test_non_codex_commands_do_not_arm_shutdown_guard) ... ok
|
||||
test_prompt_stall_still_obeys_timeout (test_controller.SubprocessTests.test_prompt_stall_still_obeys_timeout) ... ok
|
||||
test_real_check_report_must_match_expected_membership (test_controller.SubprocessTests.test_real_check_report_must_match_expected_membership) ... ok
|
||||
test_worker_cannot_execute_before_job_assignment (test_controller.SubprocessTests.test_worker_cannot_execute_before_job_assignment) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 12 tests in 25.953s
|
||||
|
||||
OK
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"binding":"ba1d68da93b1a0c1c0ec0865516150f6b6b12b8cb7aabc4ffb3324fbbb5fd3af","dockerPipeHostPositive":true,"failure":null,"issuedUtc":"2026-11-01T21:32:48.331969+00:00","ownerKeyDenied":true,"probes":{"dockerPipeDenied":true,"files":[{"category":"approvals","readDenied":true,"writeDenied":true},{"category":"configuration","readDenied":true,"writeDenied":true},{"category":"key-file","readDenied":true,"writeDenied":true},{"category":"normal-codex","readDenied":true,"writeDenied":true},{"category":"other-repository","readDenied":true,"writeDenied":true},{"category":"personal","readDenied":true,"writeDenied":true},{"category":"production-canary","readDenied":true,"writeDenied":true}],"networkDenied":true,"ownerKeyDenied":true,"positiveControl":true,"sanitizedReportRead":true,"sanitizedReportWriteDenied":true,"signingKeyDenied":true},"scope":"Synthetic filesystem/network/signing canaries; real owner key probed","status":"PASS"}
|
||||
@@ -0,0 +1 @@
|
||||
{"attempts":3,"checkedUtc":"2026-11-01T21:34:04.917134+00:00","executorQualificationReused":true,"priorApprovalsUnchanged":true,"reportSha256":"55afecbcb09d91762fdddb2670c409566bf58f9fce6c2a705627e9fcfb8e10d0","resetApproved":false,"sessions":3,"workerLaunchedByFix":false}
|
||||
@@ -0,0 +1 @@
|
||||
{"baselineCommit":"fc5b9d377199ce51f480a920a3772108094929e3","candidateCommit":null,"checkpoint":"P10-00","detail":[{"at":"2026-11-01T21:05:55.021712+00:00","checkpoint":"P10-00","message":"Auth-only CODEX_HOME contains unrelated config, hooks, skills or plugins"},{"at":"2026-11-01T21:06:29.928261+00:00","checkpoint":"P10-00","message":"Auth-only CODEX_HOME contains unrelated config, hooks, skills or plugins"},{"at":"2026-11-01T21:07:04.829357+00:00","checkpoint":"P10-00","message":"Auth-only CODEX_HOME contains unrelated config, hooks, skills or plugins"}],"evidence":[],"executionScope":{"checkpoint":"P10-00","handoffBranch":"test/pre-phase10-ux-acceptance","handoffCommit":"5cb903b989742b7a96cb22ddf4c0e24993b18980","mode":"assessment-only","reportDirectory":"docs/automation/stages/PHASE-10","stage":"PHASE-10"},"kind":"retry-budget-reset","manifestSha256":"51e12f29078c420ac4ebd10127c8b7f7ba3cd73eac09dcbb4d47da1fe88fbeaf","policySha256":"bc097f2a311e83d5564cc8800adfccb0d5ef071d6430988dc2362bc4b9f9c5aa","schemaVersion":1,"stage":"PHASE-10"}
|
||||
@@ -0,0 +1 @@
|
||||
{"failures":0,"nativeExitCode":0,"scope":"test_local_mode.py only","skips":0,"sourceSha256":{"automation\\local_mode.py":"01729254d75724d9a5568d825f3b17fcf7420cb9b56994331ba0bce59bd27e85","automation\\tests\\test_local_mode.py":"fb07f495e79d6056f70ec3e308543d00a7ea50c188839305e5c90e82d38ea14f"},"sourceStable":true,"tests":25}
|
||||
@@ -0,0 +1,31 @@
|
||||
test_pending_recovery_can_be_signed_from_idle_operator_terminal (test_local_mode.LocalFlowTests.test_pending_recovery_can_be_signed_from_idle_operator_terminal) ... ok
|
||||
test_single_user_concurrent_controller_and_interrupted_guard (test_local_mode.LocalFlowTests.test_single_user_concurrent_controller_and_interrupted_guard) ... ok
|
||||
test_single_user_main_checkout_is_still_prohibited (test_local_mode.LocalFlowTests.test_single_user_main_checkout_is_still_prohibited) ... ok
|
||||
test_single_user_missing_approval_stops_before_worker (test_local_mode.LocalFlowTests.test_single_user_missing_approval_stops_before_worker) ... ok
|
||||
test_single_user_pause_and_publication_recovery (test_local_mode.LocalFlowTests.test_single_user_pause_and_publication_recovery) ... ok
|
||||
test_single_user_subprocess_protocol_and_ordered_publication (test_local_mode.LocalFlowTests.test_single_user_subprocess_protocol_and_ordered_publication) ... ok
|
||||
test_accessible_docker_pipe_cannot_qualify_worker (test_local_mode.LocalPolicyTests.test_accessible_docker_pipe_cannot_qualify_worker) ... ok
|
||||
test_auth_home_inside_worker_is_rejected (test_local_mode.LocalPolicyTests.test_auth_home_inside_worker_is_rejected) ... ok
|
||||
test_blocked_status_rejects_otherwise_successful_probes (test_local_mode.LocalPolicyTests.test_blocked_status_rejects_otherwise_successful_probes) ... ok
|
||||
test_bundled_skills_never_allow_unpinned_or_altered_inputs (test_local_mode.LocalPolicyTests.test_bundled_skills_never_allow_unpinned_or_altered_inputs) ... ok
|
||||
test_bundled_skills_reject_redirection_and_other_configuration (test_local_mode.LocalPolicyTests.test_bundled_skills_reject_redirection_and_other_configuration) ... ok
|
||||
test_different_or_missing_sid_rejected (test_local_mode.LocalPolicyTests.test_different_or_missing_sid_rejected) ... ok
|
||||
test_exact_pinned_bundled_skills_survive_worker_initialization (test_local_mode.LocalPolicyTests.test_exact_pinned_bundled_skills_survive_worker_initialization) ... ok
|
||||
test_existing_normal_auth_home_is_rejected (test_local_mode.LocalPolicyTests.test_existing_normal_auth_home_is_rejected) ... ok
|
||||
test_failed_probe_and_unconfigured_owner_key_cannot_qualify (test_local_mode.LocalPolicyTests.test_failed_probe_and_unconfigured_owner_key_cannot_qualify) ... ok
|
||||
test_missing_or_stale_qualification_never_enables_unattended (test_local_mode.LocalPolicyTests.test_missing_or_stale_qualification_never_enables_unattended) ... ok
|
||||
test_mxc_is_explicit_without_legacy_or_unrestricted_fallback (test_local_mode.LocalPolicyTests.test_mxc_is_explicit_without_legacy_or_unrestricted_fallback) ... ok
|
||||
test_noninteractive_approval_is_refused (test_local_mode.LocalPolicyTests.test_noninteractive_approval_is_refused) ... ok
|
||||
test_operator_controlled_policy_cannot_launch_a_worker (test_local_mode.LocalPolicyTests.test_operator_controlled_policy_cannot_launch_a_worker) ... ok
|
||||
test_plugins_are_not_an_implicit_same_user_capability (test_local_mode.LocalPolicyTests.test_plugins_are_not_an_implicit_same_user_capability) ... ok
|
||||
test_probe_summary_rejects_partial_and_failed_boundaries (test_local_mode.LocalPolicyTests.test_probe_summary_rejects_partial_and_failed_boundaries) ... ok
|
||||
test_profile_denies_root_control_auth_and_normal_configuration (test_local_mode.LocalPolicyTests.test_profile_denies_root_control_auth_and_normal_configuration) ... ok
|
||||
test_same_chatgpt_auth_is_explicit_and_tokens_are_not_copied (test_local_mode.LocalPolicyTests.test_same_chatgpt_auth_is_explicit_and_tokens_are_not_copied) ... ok
|
||||
test_same_windows_identity_supported (test_local_mode.LocalPolicyTests.test_same_windows_identity_supported) ... ok
|
||||
test_tool_or_temp_roots_cannot_reopen_protected_parent (test_local_mode.LocalPolicyTests.test_tool_or_temp_roots_cannot_reopen_protected_parent) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 25 tests in 14.630s
|
||||
|
||||
OK
|
||||
{"baselineCommit":"2e5902c596fbedd2b7af68a41a3fc8528d36d877","candidateCommit":null,"checkpoint":"work","detail":null,"evidence":[],"kind":"recovery-reconciled","manifestSha256":"b8eaca62833ed547a3eb68fdc0cd5db324546218ace285559915b71d8f27b711","policySha256":"0031f0a33ab292b79fa74ec977cf8cacf15245d72090aa57794ef75e6b55ae33","schemaVersion":1,"stage":"ONE"}
|
||||
@@ -74,7 +74,9 @@
|
||||
"argv": {"type": "array", "minItems": 1, "items": {"type": "string"}},
|
||||
"cwd": {"type": "string"},
|
||||
"configured": {"type": "boolean"},
|
||||
"adapter": {"enum": ["assessment-evidence-inspection"]},
|
||||
"adapter": {"enum": ["assessment-evidence-inspection", "confined-composite"]},
|
||||
"suiteIds": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string"}},
|
||||
"executorPolicySha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"receipt": {"type": "string"},
|
||||
"receiptSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"report": {"type": ["object", "null"], "properties": {
|
||||
|
||||
@@ -490,6 +490,54 @@ class SubprocessTests(unittest.TestCase):
|
||||
1, stdin='x' * 4_000_000)
|
||||
self.assertLess(time.monotonic() - started, 5)
|
||||
|
||||
def test_completed_turn_shutdown_hang_is_blocked_and_cleaned(self):
|
||||
directory=self.control/'shutdown-hang'
|
||||
with mock.patch.object(c,'CODEX_SHUTDOWN_GRACE_SECONDS',.5):
|
||||
started=time.monotonic()
|
||||
with self.assertRaisesRegex(c.Interrupted,'shutdown'):
|
||||
self.engine.runner.supervise(self.engine,[sys.executable,'-c',
|
||||
'import time; print(\'{"type":"turn.completed"}\',flush=True); time.sleep(30)'],
|
||||
directory,10,codex_events=True)
|
||||
self.assertLess(time.monotonic()-started,5)
|
||||
record=c.read_json(directory/'process.json')
|
||||
self.assertTrue(record['shutdownTimedOut'])
|
||||
self.assertTrue(record['forcedTermination'])
|
||||
self.assertIsInstance(record['nativeExitCode'],int) # Windows Job closure can return zero; still interrupted.
|
||||
self.assertFalse((self.control/'active-process.json').exists())
|
||||
self.assertIsNone(self.engine.runner.child)
|
||||
|
||||
def test_completed_turn_still_requires_actual_zero_exit(self):
|
||||
for code in (0,7):
|
||||
directory=self.control/f'exit-{code}'
|
||||
argv=[sys.executable,'-c',
|
||||
f'import sys; print(\'{{"type":"turn.completed"}}\',flush=True); sys.exit({code})']
|
||||
if code:
|
||||
with self.assertRaisesRegex(c.GateError,'Process exited 7'):
|
||||
self.engine.runner.supervise(self.engine,argv,directory,5,codex_events=True)
|
||||
else:
|
||||
self.engine.runner.supervise(self.engine,argv,directory,5,codex_events=True)
|
||||
record=c.read_json(directory/'process.json')
|
||||
self.assertEqual(code,record['nativeExitCode'])
|
||||
self.assertFalse(record['forcedTermination'])
|
||||
|
||||
def test_non_codex_commands_do_not_arm_shutdown_guard(self):
|
||||
with mock.patch.object(c,'CODEX_SHUTDOWN_GRACE_SECONDS',.01):
|
||||
self.engine.runner.supervise(self.engine,[sys.executable,'-c',
|
||||
'import time; print(\'{"type":"turn.completed"}\',flush=True); time.sleep(.5)'],
|
||||
self.control/'ordinary-command',5)
|
||||
|
||||
def test_inconsistent_complete_handoff_rejected_before_checks(self):
|
||||
directory=self.control/'bad-handoff'
|
||||
directory.mkdir()
|
||||
result=dict(outcome='complete',summary='synthetic',blockers=['unresolved'],
|
||||
requestedApprovals=[],checkpoint='work')
|
||||
c.atomic(directory/'result.json',result)
|
||||
(directory/'stdout.log').write_text('{"type":"turn.completed"}\n')
|
||||
with mock.patch.object(self.engine.runner,'supervise'):
|
||||
with self.assertRaisesRegex(c.GateError,'Complete handoff'):
|
||||
self.engine.runner.run_session(self.engine,self.manifest['stages'][0],
|
||||
self.manifest['stages'][0]['checkpoints'][0],directory,'synthetic')
|
||||
|
||||
def test_no_newline_output_obeys_log_budget(self):
|
||||
self.engine.config['maxLogBytes'] = 1024
|
||||
with self.assertRaisesRegex(c.GateError, 'log byte budget'):
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
"""Disposable synthetic broker tests; never execute the development roadmap."""
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import tarfile
|
||||
import tempfile
|
||||
import unittest
|
||||
import test_controller as fixture
|
||||
import controller as c
|
||||
|
||||
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
|
||||
import confined_executor as x
|
||||
|
||||
|
||||
def request():
|
||||
return dict(stage='PHASE-10',checkpoint='P10-00',commit='a'*40,
|
||||
branch='feature/phase10-cleanup',suite='backend-canary',policySha256='b'*64,requestId='c'*32)
|
||||
|
||||
|
||||
class ValidationTests(unittest.TestCase):
|
||||
def test_failed_native_report_keeps_counts_without_becoming_acceptable(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
path=Path(directory)/'jest.json'
|
||||
path.write_text(json.dumps(dict(success=False,testResults=[dict(assertionResults=[
|
||||
dict(fullName='Bokmål passed',status='passed'),dict(fullName='failed',status='failed'),
|
||||
dict(fullName='skipped',status='pending')])]),ensure_ascii=False),encoding='utf-8')
|
||||
measured=c.measure_report(path,'jest')
|
||||
self.assertEqual((1,1,1),(measured['passed'],measured['failed'],measured['skipped']))
|
||||
self.assertIn('Bokmål passed',measured['names'])
|
||||
with self.assertRaises(c.GateError): c.parse_report(path,dict(format='jest'))
|
||||
path.write_text(json.dumps(dict(suites=[dict(specs=[dict(file='example.spec.ts',title='skipped',tests=[
|
||||
dict(projectName='chromium',expectedStatus='skipped',results=[dict(status='skipped')])])])])),encoding='utf-8')
|
||||
self.assertEqual(1,c.measure_report(path,'playwright')['skipped'])
|
||||
with self.assertRaises(c.GateError): c.parse_report(path,dict(format='playwright'))
|
||||
|
||||
def test_disappearing_root_process_cannot_interrupt_evidence_sealing(self):
|
||||
from unittest.mock import Mock,patch
|
||||
import executor_supervisor as supervisor
|
||||
gone=Mock();gone.read_text.side_effect=FileNotFoundError()
|
||||
candidate=Mock();candidate.read_text.return_value='Uid:\t10000\t10000\t10000\t10000\n'
|
||||
root=Mock();root.read_text.return_value='Uid:\t0\t0\t0\t0\n'
|
||||
with patch.object(supervisor,'Path') as path:
|
||||
path.return_value.glob.return_value=[gone,candidate,root]
|
||||
self.assertEqual(1,supervisor.candidate_count())
|
||||
|
||||
def test_fixed_request_is_accepted(self):
|
||||
r=request()
|
||||
x.validate_request(r,r,{'backend-canary'})
|
||||
|
||||
def test_arbitrary_commands_docker_paths_and_exit_codes_are_rejected(self):
|
||||
for field in ('argv','command','docker','mount','reportPath','exitCode','approval'):
|
||||
with self.subTest(field=field),self.assertRaises(x.ExecutorError):
|
||||
x.validate_request({**request(),field:'forged'},request(),{'backend-canary'})
|
||||
|
||||
def test_altered_identity_or_injection_is_rejected(self):
|
||||
for field,value in [('suite','backend-canary;whoami'),('stage','RELEASE'),('checkpoint','P10-01'),
|
||||
('commit','--upload-pack=evil'),('branch','../../main'),('policySha256','0'*64)]:
|
||||
with self.subTest(field=field),self.assertRaises(x.ExecutorError):
|
||||
x.validate_request({**request(),field:value},request(),{'backend-canary'})
|
||||
|
||||
def test_archive_rejects_traversal_links_and_special_files(self):
|
||||
for name,kind in [('../secret',tarfile.REGTYPE),('/etc/passwd',tarfile.REGTYPE),
|
||||
('source/link',tarfile.SYMTYPE),('source/device',tarfile.CHRTYPE),
|
||||
('a\\..\\secret',tarfile.REGTYPE)]:
|
||||
data=io.BytesIO()
|
||||
with tarfile.open(fileobj=data,mode='w') as archive:
|
||||
info=tarfile.TarInfo(name);info.type=kind;info.size=0
|
||||
archive.addfile(info)
|
||||
with self.subTest(name=name),self.assertRaises(x.ExecutorError):
|
||||
x.validate_archive(data.getvalue())
|
||||
|
||||
def test_valid_archive_has_nonempty_unique_membership(self):
|
||||
data=io.BytesIO()
|
||||
with tarfile.open(fileobj=data,mode='w') as archive:
|
||||
info=tarfile.TarInfo('JobTrackerApi/source.cs');info.size=2
|
||||
archive.addfile(info,io.BytesIO(b'OK'))
|
||||
self.assertEqual(['JobTrackerApi/source.cs'],x.validate_archive(data.getvalue()))
|
||||
|
||||
def test_forged_private_receipt_or_changed_report_fails(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root=Path(directory)
|
||||
(root/'report.xml').write_text('real')
|
||||
receipt=dict(request=request(),status='PASSED',nativeExitCode=0,cleanup=True,
|
||||
reports=[dict(path='report.xml',sha256=x.sha(root/'report.xml'))])
|
||||
pin=x.digest(receipt)
|
||||
x.verify_receipt(root,receipt,pin,request())
|
||||
(root/'report.xml').write_text('fake success')
|
||||
with self.assertRaises(x.ExecutorError): x.verify_receipt(root,receipt,pin,request())
|
||||
with self.assertRaises(x.ExecutorError): x.verify_receipt(root,{**receipt,'nativeExitCode':1},pin,request())
|
||||
|
||||
def test_no_host_mounts_privileges_ports_or_external_network(self):
|
||||
args=x.container_options('jt-exec-'+'a'*32,'nonce','none',512)
|
||||
for forbidden in ('--privileged','--volume','-v','--mount','--publish','-p','--pid','--ipc','host'):
|
||||
self.assertNotIn(forbidden,args)
|
||||
for required in ('--read-only','--cap-drop','ALL','no-new-privileges','none','--pids-limit','--memory'):
|
||||
self.assertIn(required,args)
|
||||
|
||||
def test_cleanup_requires_actual_id_image_nonce_and_safety(self):
|
||||
expected=dict(name='jt-exec-'+'a'*32,nonce='n',image='sha256:'+'b'*64,id='d'*64)
|
||||
inspect=dict(Id='d'*64,Name='/'+expected['name'],Image=expected['image'],
|
||||
Config=dict(Labels={'io.jobjakt.executor':'n'}),
|
||||
HostConfig=dict(Privileged=False,ReadonlyRootfs=True,NetworkMode='none',Binds=None,PortBindings={}))
|
||||
x.guard_resource(inspect,expected)
|
||||
for field,value in [('Id','e'*64),('Image','sha256:'+'f'*64),('Name','/production')]:
|
||||
with self.subTest(field=field),self.assertRaises(x.ExecutorError):
|
||||
x.guard_resource({**inspect,field:value},expected)
|
||||
|
||||
def test_docker_outage_cannot_be_recorded_as_successful_cleanup(self):
|
||||
from unittest.mock import patch
|
||||
import subprocess
|
||||
broker=x.Broker.__new__(x.Broker);broker.docker=['docker']
|
||||
resource=dict(name='jt-exec-'+'a'*32,id='d'*64)
|
||||
failure=subprocess.CompletedProcess([],1,b'',b'failed to connect to Docker engine')
|
||||
with patch.object(x.subprocess,'run',return_value=failure),self.assertRaises(x.ExecutorError):
|
||||
broker.inspect(resource)
|
||||
absent=subprocess.CompletedProcess([],1,b'[]',('Error response from daemon: No such container: '+resource['id']).encode())
|
||||
with patch.object(x.subprocess,'run',return_value=absent): self.assertIsNone(broker.inspect(resource))
|
||||
|
||||
def test_expired_individual_run_cannot_be_renewed_by_fresh_aggregate(self):
|
||||
from datetime import datetime,timezone,timedelta
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
broker=x.Broker.__new__(x.Broker);broker.directory=Path(directory);broker.pin='b'*64
|
||||
req={**request(),'stage':'RUNTIME-QUALIFICATION','checkpoint':'CANARY'}
|
||||
broker.policy=dict(baselineCommit='a'*40,allowed={'RUNTIME-QUALIFICATION/CANARY':['backend-canary']})
|
||||
run=broker.directory/'runs'/req['requestId'];run.mkdir(parents=True)
|
||||
receipt=dict(request=req,cleanup=True,finishedUtc=(datetime.now(timezone.utc)-timedelta(days=2)).isoformat())
|
||||
x.atomic(run/'receipt.json',receipt)
|
||||
x.atomic(broker.directory/'qualification.json',dict(status='PASSED',policySha256=broker.pin,issuedUtc=x.utc(),
|
||||
runs=[dict(request=req,receiptSha256=x.digest(receipt),probePassed=True)]))
|
||||
with self.assertRaisesRegex(x.ExecutorError,'Individual runtime qualification expired'): broker.require_qualified()
|
||||
|
||||
def test_old_policy_receipt_cannot_qualify_a_new_policy(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
broker=x.Broker.__new__(x.Broker);broker.directory=Path(directory);broker.pin='d'*64
|
||||
broker.policy=dict(baselineCommit='a'*40,allowed={'RUNTIME-QUALIFICATION/CANARY':['backend-canary']})
|
||||
req={**request(),'stage':'RUNTIME-QUALIFICATION','checkpoint':'CANARY'}
|
||||
run=broker.directory/'runs'/req['requestId'];run.mkdir(parents=True)
|
||||
receipt=dict(request=req,cleanup=True,finishedUtc=x.utc(),status='PASSED',nativeExitCode=0,reports=[])
|
||||
x.atomic(run/'receipt.json',receipt)
|
||||
x.atomic(broker.directory/'qualification.json',dict(status='PASSED',policySha256=broker.pin,issuedUtc=x.utc(),
|
||||
runs=[dict(request=req,receiptSha256=x.digest(receipt),expectPass=True,probePassed=True)]))
|
||||
with self.assertRaisesRegex(x.ExecutorError,'Qualification request policy'): broker.require_qualified()
|
||||
|
||||
def test_assessment_rejects_changed_application_script_before_materialization(self):
|
||||
broker=x.Broker.__new__(x.Broker);broker.policy=dict(baselineCommit='a'*40)
|
||||
def git(*args):
|
||||
if args[0]=='cat-file': return b'commit\n'
|
||||
if args[0]=='merge-base': return b''
|
||||
if args[0]=='diff': return b'job-tracker-ui/package.json\n'
|
||||
self.fail('Source must be rejected before reading candidate blobs')
|
||||
broker.git=git
|
||||
with self.assertRaisesRegex(x.ExecutorError,'source/script change'): broker.snapshot(request())
|
||||
|
||||
|
||||
class CandidateIntegrationTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
fixture.EngineTests.setUp(self)
|
||||
from unittest.mock import Mock
|
||||
self.engine.executor=Mock()
|
||||
tearDown=fixture.EngineTests.tearDown
|
||||
git_at=staticmethod(fixture.EngineTests.git_at)
|
||||
|
||||
def test_missing_live_qualification_stops_before_model(self):
|
||||
check=self.manifest['stages'][0]['checkpoints'][0]['checks'][0]
|
||||
check.update(adapter='confined-composite',argv=['confined-composite'],suiteIds=['backend-canary'],executorPolicySha256='b'*64)
|
||||
self.engine.executor.return_value.require_qualified.side_effect=x.ExecutorError('Runtime is not qualified')
|
||||
state=self.engine.store.read();state['manifestSha256']=c.digest(self.manifest);self.engine.store.write(state)
|
||||
self.engine.run()
|
||||
self.assertEqual(0,self.runner.calls)
|
||||
self.assertEqual('BLOCKED',self.engine.store.read()['stages']['ONE']['status'])
|
||||
|
||||
def test_process_runner_cannot_accept_native_failure_receipt(self):
|
||||
check=dict(id='runtime',adapter='confined-composite',argv=['confined-composite'],cwd='.',report=None,
|
||||
suiteIds=['backend-canary'],executorPolicySha256='b'*64)
|
||||
self.engine.check_context=dict(stage='ONE',checkpoint='work',commit='a'*40,branch='codex/one')
|
||||
broker=self.engine.executor.return_value
|
||||
def execute(request,expected):
|
||||
self.assertEqual(request,expected);self.assertEqual('a'*40,request['commit'])
|
||||
receipt=dict(request=request,status='FAILED',nativeExitCode=7,cleanup=True,reports=[])
|
||||
return dict(directory=str(self.control/'failed'),receipt=receipt,receiptSha256=x.digest(receipt))
|
||||
broker.execute.side_effect=execute
|
||||
with self.assertRaises(c.GateError): c.ProcessRunner().run_check(self.engine,check,self.control/'checks')
|
||||
broker.execute.assert_called_once()
|
||||
|
||||
def test_exact_tested_candidate_is_promoted_without_another_commit(self):
|
||||
captured=[]
|
||||
class CandidateRunner(fixture.SyntheticRunner):
|
||||
def run_check(inner,engine,check,directory):
|
||||
if check.get('adapter')=='confined-composite':
|
||||
context=engine.check_context
|
||||
captured.append(context['commit'])
|
||||
self.assertEqual('ONE 1',engine.git('show',context['commit']+':result.txt'))
|
||||
self.assertEqual(context['parent'],engine.git('rev-parse',context['commit']+'^'))
|
||||
return super().run_check(engine,check,directory)
|
||||
self.manifest['stages'][0]['checkpoints'][0]['checks'][0]['adapter']='confined-composite'
|
||||
state=self.engine.store.read();state['manifestSha256']=c.digest(self.manifest);self.engine.store.write(state)
|
||||
self.engine.runner=CandidateRunner()
|
||||
self.engine.run()
|
||||
self.assertEqual(1,len(captured))
|
||||
self.assertEqual(captured[0],self.engine.git('rev-parse','codex/one'))
|
||||
|
||||
def test_failed_candidate_never_moves_the_branch(self):
|
||||
class FailingRunner(fixture.SyntheticRunner):
|
||||
def run_check(inner,engine,check,directory):
|
||||
self.assertEqual('commit',engine.git('cat-file','-t',engine.check_context['commit']))
|
||||
raise c.GateError('Synthetic confined test failure')
|
||||
self.manifest['stages'][0]['checkpoints'][0]['checks'][0]['adapter']='confined-composite'
|
||||
state=self.engine.store.read();state['manifestSha256']=c.digest(self.manifest);self.engine.store.write(state)
|
||||
self.engine.runner=FailingRunner()
|
||||
self.engine.run()
|
||||
self.assertEqual(self.manifest['baselineCommit'],self.engine.git('rev-parse','codex/one'))
|
||||
|
||||
|
||||
if __name__=='__main__': unittest.main()
|
||||
@@ -68,6 +68,54 @@ class LocalPolicyTests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError,'plugin'):
|
||||
local.validate_config(self.root,self.config)
|
||||
|
||||
def pin_bundled_skills(self):
|
||||
import hashlib
|
||||
skills = Path(self.config['workerCodeXHome'])/'skills'
|
||||
source = skills/'.system/example/SKILL.md'
|
||||
source.parent.mkdir(parents=True)
|
||||
source.write_text('synthetic bundled skill',encoding='utf-8')
|
||||
binary = self.base/'codex.exe'
|
||||
binary.write_bytes(b'synthetic CLI')
|
||||
self.config.update(codexExecutable=str(binary),bundledSystemSkills=dict(
|
||||
codexSha256=hashlib.sha256(binary.read_bytes()).hexdigest(),
|
||||
files={'.system/example/SKILL.md':hashlib.sha256(source.read_bytes()).hexdigest()}))
|
||||
return skills, source, binary
|
||||
|
||||
def test_exact_pinned_bundled_skills_survive_worker_initialization(self):
|
||||
self.pin_bundled_skills()
|
||||
local.validate_config(self.root,self.config)
|
||||
local.permission_args(self.root,self.config,'exec')
|
||||
rules=local.filesystem_rules(self.root,self.config)
|
||||
self.assertEqual('deny',rules[Path(self.config['workerCodeXHome']).resolve().as_posix()])
|
||||
|
||||
def test_bundled_skills_never_allow_unpinned_or_altered_inputs(self):
|
||||
skills, source, binary = self.pin_bundled_skills()
|
||||
for target, data in [(source,b'changed skill'),(binary,b'changed CLI')]:
|
||||
original=target.read_bytes()
|
||||
target.write_bytes(data)
|
||||
with self.assertRaises(ValueError): local.validate_config(self.root,self.config)
|
||||
target.write_bytes(original)
|
||||
extra=skills/'user-skill'
|
||||
extra.mkdir()
|
||||
with self.assertRaises(ValueError): local.validate_config(self.root,self.config)
|
||||
extra.rmdir()
|
||||
del self.config['bundledSystemSkills']
|
||||
with self.assertRaises(ValueError): local.validate_config(self.root,self.config)
|
||||
|
||||
def test_bundled_skills_reject_redirection_and_other_configuration(self):
|
||||
skills, source, binary = self.pin_bundled_skills()
|
||||
with mock.patch.object(Path,'is_symlink',return_value=True):
|
||||
with self.assertRaises(ValueError): local.validate_config(self.root,self.config)
|
||||
for name in ('config.toml','hooks.json','AGENTS.md','plugins'):
|
||||
target=skills.parent/name
|
||||
target.write_text('unapproved')
|
||||
with self.assertRaises(ValueError): local.validate_config(self.root,self.config)
|
||||
target.unlink()
|
||||
pin=self.config['bundledSystemSkills']
|
||||
for path in ('../escape','.system/../escape','.system/escape:stream'):
|
||||
pin['files']={path:'a'*64}
|
||||
with self.assertRaises(ValueError): local.validate_config(self.root,self.config)
|
||||
|
||||
def test_tool_or_temp_roots_cannot_reopen_protected_parent(self):
|
||||
self.config['toolReadRoots']=[str(self.base)]
|
||||
with self.assertRaises(ValueError):
|
||||
@@ -93,6 +141,14 @@ class LocalPolicyTests(unittest.TestCase):
|
||||
result['files'][0]['writeDenied'] = True
|
||||
self.assertFalse(local.probes_passed(result)) # required categories cannot be omitted
|
||||
|
||||
def test_accessible_docker_pipe_cannot_qualify_worker(self):
|
||||
result=dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,
|
||||
sanitizedReportRead=True,sanitizedReportWriteDenied=True,dockerPipeDenied=False,
|
||||
files=[dict(category=k,readDenied=True,writeDenied=True) for k in sorted(local.CATEGORIES)])
|
||||
self.assertFalse(local.probes_passed(result))
|
||||
result['dockerPipeDenied']=True
|
||||
self.assertTrue(local.probes_passed(result))
|
||||
|
||||
def test_same_chatgpt_auth_is_explicit_and_tokens_are_not_copied(self):
|
||||
normal = Path(self.config['normalCodeXHome'])
|
||||
normal.mkdir()
|
||||
@@ -111,9 +167,9 @@ class LocalPolicyTests(unittest.TestCase):
|
||||
def test_failed_probe_and_unconfigured_owner_key_cannot_qualify(self):
|
||||
self.root.mkdir()
|
||||
self.config['executionPolicy']='qualified-unattended'
|
||||
valid = dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,
|
||||
valid = dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,sanitizedReportRead=True,sanitizedReportWriteDenied=True,dockerPipeDenied=True,
|
||||
files=[dict(category=k,readDenied=True,writeDenied=True) for k in sorted(local.CATEGORIES)])
|
||||
report = dict(status='PASS',failure=None,binding=local.binding(self.root,self.config),issuedUtc=datetime.now(timezone.utc).isoformat(),probes=valid,ownerKeyDenied=False)
|
||||
report = dict(status='PASS',failure=None,binding=local.binding(self.root,self.config),issuedUtc=datetime.now(timezone.utc).isoformat(),probes=valid,ownerKeyDenied=False,dockerPipeHostPositive=True)
|
||||
c.atomic(self.root/'qualification.json',report)
|
||||
with self.assertRaises(ValueError):
|
||||
local.require_unattended(self.root,self.config)
|
||||
@@ -135,8 +191,8 @@ class LocalPolicyTests(unittest.TestCase):
|
||||
self.root.mkdir()
|
||||
self.config['executionPolicy']='qualified-unattended'
|
||||
c.atomic(self.root/'qualification.json',dict(status='BLOCKED',failure='cleanup failed',
|
||||
binding=local.binding(self.root,self.config),issuedUtc=datetime.now(timezone.utc).isoformat(),ownerKeyDenied=True,
|
||||
probes=dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,
|
||||
binding=local.binding(self.root,self.config),issuedUtc=datetime.now(timezone.utc).isoformat(),ownerKeyDenied=True,dockerPipeHostPositive=True,
|
||||
probes=dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,sanitizedReportRead=True,sanitizedReportWriteDenied=True,dockerPipeDenied=True,
|
||||
files=[dict(category=k,readDenied=True,writeDenied=True) for k in sorted(local.CATEGORIES)])))
|
||||
with self.assertRaises(ValueError):
|
||||
local.require_unattended(self.root,self.config)
|
||||
@@ -163,8 +219,8 @@ class LocalFlowTests(unittest.TestCase):
|
||||
Path(self.config['workerCodeXHome']).mkdir()
|
||||
Path(self.config['workerTemp']).mkdir()
|
||||
c.atomic(self.control/'qualification.json',dict(status='PASS',failure=None,binding=local.binding(self.control,self.config),
|
||||
issuedUtc=datetime.now(timezone.utc).isoformat(),ownerKeyDenied=True,
|
||||
probes=dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,
|
||||
issuedUtc=datetime.now(timezone.utc).isoformat(),ownerKeyDenied=True,dockerPipeHostPositive=True,
|
||||
probes=dict(positiveControl=True,networkDenied=True,signingKeyDenied=True,sanitizedReportRead=True,sanitizedReportWriteDenied=True,dockerPipeDenied=True,
|
||||
files=[dict(category=k,readDenied=True,writeDenied=True) for k in sorted(local.CATEGORIES)])))
|
||||
|
||||
def test_single_user_subprocess_protocol_and_ordered_publication(self):
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
param([Parameter(Mandatory)][string]$Manifest, [Parameter(Mandatory)][string]$SdkDirectory)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
[void][Reflection.Assembly]::LoadFrom((Join-Path $SdkDirectory 'NuGet.Packaging.dll'))
|
||||
$token = [Threading.CancellationToken]::None
|
||||
$settings = [NuGet.Packaging.Signing.SignedPackageVerifierSettings]::GetDefault([NuGet.Common.EnvironmentVariableWrapper]::Instance)
|
||||
foreach ($entry in (Get-Content -LiteralPath $Manifest -Raw | ConvertFrom-Json)) {
|
||||
$reader = [NuGet.Packaging.PackageArchiveReader]::new($entry.path)
|
||||
try {
|
||||
$raw = [Convert]::ToBase64String([Security.Cryptography.SHA512]::HashData([IO.File]::ReadAllBytes($entry.path)))
|
||||
if ($raw -eq $entry.hash) { continue }
|
||||
$signature = $reader.GetPrimarySignatureAsync($token).GetAwaiter().GetResult()
|
||||
if ($null -eq $signature) { throw "Unsigned package hash mismatch: $($entry.path)" }
|
||||
$result = [NuGet.Packaging.Signing.IntegrityVerificationProvider]::new().GetTrustResultAsync($reader, $signature, $settings, $token).GetAwaiter().GetResult()
|
||||
# Signed NuGet content hashes exclude the repository signature; verify the actual payload first.
|
||||
if ($result.Trust.ToString() -ne 'Valid' -or $reader.GetContentHash($token, $null) -ne $entry.hash) {
|
||||
throw "Signed package content integrity mismatch: $($entry.path)"
|
||||
}
|
||||
} finally { $reader.Dispose() }
|
||||
}
|
||||
Write-Output 'NuGet content integrity verified offline'
|
||||
@@ -1,5 +1,7 @@
|
||||
# AUTO-ACTIVATION-01 — blocked before activation
|
||||
|
||||
Historical 30 October report. [AUTO-RUNTIME-02](RUNTIME_02.md) supersedes its infrastructure status: the confined executor is implemented and locally qualified. Actual entry remains blocked pending tooling publication and protected owner approvals; no roadmap stage has run.
|
||||
|
||||
30 October 2026. **P10-00 execution remains NO-GO.** The command-running composite application adapter is not qualified inside the existing security boundary. The queue remains disabled and operator-controlled. No autonomous/model session, owner signature, Phase 10 assessment, product edit, migration, main merge or deployment was performed.
|
||||
|
||||
## What is verified
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
# AUTO-START-01 — final owner activation review
|
||||
|
||||
Subsequent first-run compatibility repair and current owner retry instructions: [SKILL_GUARD_FIX_01.md](SKILL_GUARD_FIX_01.md). The initial-entry snapshot below is historical; do not rerun entry preparation on the now-started queue.
|
||||
|
||||
1 November 2026. **Ready for owner review; not ready for a local-only start.** No owner signature, policy adoption, unattended enablement, roadmap/model execution or Gitea access occurred. The controller remains disabled and operator-controlled with zero sessions and zero approval files. No infrastructure code was changed or synthetic/product suite repeated.
|
||||
|
||||
## Verified prerequisites
|
||||
|
||||
- Installed controller and runtime modules match the qualified source from implementation commit `65200fb0de77e05f8b7d82b72ba2f983c4d24001`. The existing 100-test and 20-invocation results are reused, not newly executed.
|
||||
- Installed `executor-validate` succeeds against current private evidence, image/environment/policy bindings and per-receipt freshness. Executor policy digest: `3dfe072995305d5e00ecc30d34ef77c920e14017c2457bfbf030b25bae169dbc`.
|
||||
- Existing native sandbox qualification, issued `2026-11-01T20:23:11.397774+00:00`, matches the installed binding and passes its current 24-hour validity check. Source read, source write/delete denial and report creation are already qualified; no repeat was necessary. Native and executor evidence must still be fresh when the owner starts.
|
||||
- Existing certificate `70CECAFB216759F9177E2A3B013F7CD473513170` has its private key, is nonexportable and expires `2028-10-29T17:33:01Z`. Its public certificate matches the configured hash. No signing operation was performed.
|
||||
- `auth-status` reports `CHATGPT_SIGNED_IN`. This is authentication status, not a new model round-trip or account-identity claim.
|
||||
- Execution checkout is clean at `fc5b9d377199ce51f480a920a3772108094929e3`. Local handoff `5cb903b989742b7a96cb22ddf4c0e24993b18980` has that direct parent, changes only its evidence envelope, and the frozen source/evidence receipt verifies. Prior remote evidence remains historical; no new remote query was made.
|
||||
- The enabled proposal permits only P10-00 Markdown reports, retains all preservation requirements and requires candidate-specific cleanup approval afterwards. The runtime hard cap refuses P10-01 even if a generic approval is signed. Scope is proposed, not yet owner-approved.
|
||||
|
||||
Private verification details: `C:\Users\Connor\.jobjakt-backlog\single-user-local\auto-start01-prerequisites.json`. Repository review copy: `automation/reports/auto-start01/prerequisites.json`.
|
||||
|
||||
## Mandatory publication condition
|
||||
|
||||
Tooling publication was a prerequisite in the previous operating report; the executable controller does **not** separately check whether tooling commit `65200fb` was pushed. However, remote checks remain mandatory for the assessment itself:
|
||||
|
||||
- `automation/controller.py:1515`: `prepare-entry` verifies the handoff remote HEAD.
|
||||
- `automation/controller.py:888`: first stage preparation re-verifies the published handoff.
|
||||
- `automation/controller.py:1129`: the assessment commit must be pushed and verified.
|
||||
- `automation/controller.py:1169`: checkpoint completion re-verifies that remote commit before requesting post-assessment approval.
|
||||
|
||||
There is no supported local-only switch. A signature or free-text decision cannot override these checks. Simply adding a JSON field would not implement an exception. A successful handoff read also would not prove that a later assessment push will succeed.
|
||||
|
||||
The exact local-only proposal is `automation/qualification/local-only-p10-assessment.proposal.json`, also copied to the control root. It limits the exception to this immutable baseline and P10-00, preserves local commits and private evidence, records **NOT PUBLISHED**, stops without stage-wide acceptance or P10-01, and retains mandatory publication elsewhere. It requires a small controller change and an exact owner-signed adoption before use. **It is a review artifact, not a runnable manifest or current approval request.** No change implementing that exception was made under this approval-preparation task.
|
||||
|
||||
If local-only execution is required, review that proposal first and authorise its bounded implementation. Do not approve the remote-required request below expecting a local-only waiver. No accepted PDF/visual gate, AI/hosted/human condition or production NO-GO needs reopening for that proposal.
|
||||
|
||||
## Genuine request prepared by the supported workflow
|
||||
|
||||
The installed `configure` command prepared, but did not adopt, the existing enabled assessment proposal:
|
||||
|
||||
```text
|
||||
C:\Users\Connor\.jobjakt-backlog\single-user-local\requests\fb2a0a6226d746e8069265051feb452e8d7f80c30e5bfee27ead606985e51b09.json
|
||||
```
|
||||
|
||||
Kind: `manifest-policy-update`. Proposed manifest digest: `51e12f29078c420ac4ebd10127c8b7f7ba3cd73eac09dcbb4d47da1fe88fbeaf`.
|
||||
|
||||
This genuine request adopts `proposed-p10-runtime02-enabled.json`, which still requires remote publication. Its `baselineCommit:5032ccb` and `manifestSha256:c82de8b...` identify the current inactive policy being replaced, not the proposed execution baseline. The signed proposed-manifest digest binds `fc5b9d3`, the full restrictions and all seven stage definitions. After adoption, the unused queue baseline becomes `fc5b9d3`. No approval of an old baseline is implied.
|
||||
|
||||
The supported workflow prepares one entry request at a time, after policy adoption and operator selection. Subsequent requests bind the then-current policy/configuration hashes. Preparing fictional future request files or signing all scopes in advance would not satisfy it. Exact entry kinds are:
|
||||
|
||||
1. `environment-qualified`
|
||||
2. `roadmap-execution`
|
||||
3. `phase10-development-entry`
|
||||
4. `restricted-p10-assessment`
|
||||
5. `assessment-evidence-reuse`
|
||||
6. `assessment-runtime-applicability`
|
||||
|
||||
The seventh request, `candidate-specific-cleanup-scope`, is deliberately unavailable until P10-00 produces its actual candidate, reports and evidence. Do not approve it as part of initial entry.
|
||||
|
||||
## Exact installed commands
|
||||
|
||||
Review only, safe now:
|
||||
|
||||
```powershell
|
||||
. "$HOME\.jobjakt-backlog\single-user-local\Use-JobjaktBacklog.ps1"
|
||||
$control = "$HOME\.jobjakt-backlog\single-user-local"
|
||||
Get-Content -LiteralPath "$control\proposed-p10-runtime02-enabled.json" -Raw | ConvertFrom-Json | ConvertTo-Json -Depth 100
|
||||
Get-Content -LiteralPath "$control\local-only-p10-assessment.proposal.json" -Raw
|
||||
Get-Content -LiteralPath "$control\requests\fb2a0a6226d746e8069265051feb452e8d7f80c30e5bfee27ead606985e51b09.json" -Raw
|
||||
Jobjakt status
|
||||
Jobjakt dry-run
|
||||
Jobjakt auth-status
|
||||
Jobjakt executor-validate
|
||||
```
|
||||
|
||||
**Existing remote-required route only:** if the owner deliberately chooses its mandatory remote conditions, these are actual supported commands. They do not implement the local-only proposal:
|
||||
|
||||
```powershell
|
||||
# The enabled-policy request above is already pending.
|
||||
Jobjakt approve
|
||||
Jobjakt configure -Manifest "$control\proposed-p10-runtime02-enabled.json"
|
||||
Jobjakt enable-unattended
|
||||
Jobjakt prepare-entry
|
||||
```
|
||||
|
||||
`approve` displays the exact request and asks for a random challenge, disposition `Approve` and concrete decision text, then signs using the existing key. Example scope to review yourself: "Adopt this exact manifest for PHASE-10/P10-00 assessment only at fc5b9d3. Permit repository/architecture/dependency/preservation inspection and Markdown reports only. Preserve all existing acceptance limitations. Stop after P10-00; no P10-01, source edits, removals, migrations, production changes, main merge or deployment. Retain this manifest's mandatory remote-publication conditions." This is suggested text, not an approval.
|
||||
|
||||
`enable-unattended` requires the owner to type `ENABLE`; it selects the execution mode without itself granting Phase 10 entry. Because executionPolicy is excluded from the sandbox binding, that selection does not require requalifying the valid sandbox. Remaining approval requests bind the selected mode. **Adopt the manifest before changing that mode**, so the currently prepared manifest request still has its exact policy hash when signed/adopted.
|
||||
|
||||
Then repeat this pair, reviewing each of the six distinct entry requests, until `prepare-entry` reports **All exact restricted entry approvals verified**:
|
||||
|
||||
```powershell
|
||||
Jobjakt approve
|
||||
Jobjakt prepare-entry
|
||||
```
|
||||
|
||||
Do not continue to start on a nonzero result or a pending request. `prepare-entry` still contacts the handoff remote on this route. Existing freshness limits and qualification requirements remain enforced; only if evidence genuinely expires should the reported qualification be renewed. The current P10-00 policy requires fresh named capability canaries after the assessment candidate; no complete product regression or new visual acceptance is implied.
|
||||
|
||||
Only once all required grants and checks pass, the exact first-start command is:
|
||||
|
||||
```powershell
|
||||
Jobjakt start
|
||||
```
|
||||
|
||||
Use a second PowerShell terminal for monitoring/control:
|
||||
|
||||
```powershell
|
||||
. "$HOME\.jobjakt-backlog\single-user-local\Use-JobjaktBacklog.ps1"
|
||||
Jobjakt status
|
||||
Jobjakt logs
|
||||
Jobjakt pause
|
||||
# After reviewing/resolving the reported gate, and only when continuation is authorised:
|
||||
Jobjakt resume
|
||||
```
|
||||
|
||||
No prompt copying is necessary. Resume rechecks policy, evidence and approval gates. On the current route a publication failure blocks completion; it does not become a pass or authorise an exception. Even after P10-00's post-assessment scope request, the hard cap requires a separately adopted implementation policy for P10-01.
|
||||
|
||||
## Owner handoff
|
||||
|
||||
No new system infrastructure is needed for the existing publication-required route. A complete **local-only** route has one real policy/implementation gap: the controller does not support that exception yet. Review the narrow proposal rather than signing a request under an inaccurate interpretation. No Gitea repair, repeat suite, signature, activation, reset or key replacement was attempted. Unfinished AI, hosted CI, human/device, provider, security and production gates retain their original scope.
|
||||
@@ -0,0 +1,21 @@
|
||||
# AUTO-RUNTIME-02 implementation plan
|
||||
|
||||
Implement the owner's confined executor request on the existing isolated tooling branch. No actual roadmap or owner signature. The accepted application baseline remains fc5b9d3 and handoff5cb903b; the acceptance worktree is read-only to this task.
|
||||
|
||||
Architecture: private trusted Python broker accepts fixed suite IDs plus exact stage/checkpoint/commit/branch/policy identity. Candidate code runs only in disposable Docker Desktop Linux containers: no host mounts/socket/ports, readonly root, no external network, bounded CPU/memory/PIDs. A separate UID0 immutable PID1 supervisor drops the candidate to UID10000 with no capabilities and enforces deadlines independently of broker survival. It kills/reaps all children before sealing actual exits/logs/reports into root-only storage. MariaDB fixtures use a network=none namespace shared only for loopback. Durable leases identify exact owned resources for cleanup/recovery.
|
||||
|
||||
The design review required isolated supervisor imports, sanitized environment/groups/capabilities, complete descendant termination, protected metadata, no symlinked report parents, bounded collection and exact cleanup identities. Containers/WSL are not claimed to be complete host isolation; the Docker Desktop VM/kernel/toolchain remain trusted infrastructure.
|
||||
|
||||
- [x] Inventory local SDK9.0.317, Node24.19/npm11, Python3.12/Docling wheel cache, Docker Desktop local Linux engine and WSL2. No separate general-purpose VM/runner is configured. Worker access remains denied.
|
||||
- [x] `confined_executor.py`: strict requests, pinned policy/catalog, safe Git archive, fixed Docker lifecycle, private evidence and cleanup/recovery. Negative tests before implementation.
|
||||
- [x] `executor_supervisor.py` / `executor_driver.py`: immutable container supervision and actual repository commands; privilege, timeout, memory, interruption, log-limit, symlink and detached-child probes. Final broker-death qualification remains in the matrix below.
|
||||
- [x] `executor_catalog.py` / `provision_executor.py`: reviewed suite definitions and immutable offline runtime images from official SDK/Playwright plus accepted dependency caches. Independent unavailable-provider/Windows/human/model gates preserved.
|
||||
- [x] Controller integration: exact candidate commit before broker verification; independently verify private receipts before branch promotion/publication. Existing generic lanes, locking/recovery, keys/auth and signed scope stops preserved.
|
||||
- [x] Qualify representative real backend/auth/admin, React/types/lint/build, browser/CV/PDF, MariaDB/RD21 and Python/Docling/security lanes: final 20 invocations, including negative and broker-death probes. No canary becomes a full regression claim.
|
||||
- [x] Finalize original81 controller cases plus18 executor cases and1 local-mode case: 100 passed, source stable. Native isolation, read-only assessment scope and evidence recorded. Disabled/enabled P10-00 policy proposals prepared for protected owner review; neither adopted, P10-01 capped.
|
||||
- [x] Refresh changed installation/bindings while preserving key/auth and disabled durable queue. Zero roadmap sessions and owner signatures.
|
||||
- [ ] Publish final validated work and independently verify remote HEAD. Stop at owner gate; a server hook crash currently blocks publication.
|
||||
|
||||
No system service, firewall rule, broad privilege, host test execution, production/model/provider activation, main merge or deployment is authorised. Owner explicitly approved official .NET SDK9.0.317 and Playwright1.62.1 development-image downloads. Package provisioning uses existing accepted caches where possible; missing external downloads require the applicable permission. Preserve all source thresholds and historical failures.
|
||||
|
||||
Checkpoint `4ad77bf` is committed locally. Gitea's pre-receive Go process segfaulted on push; remote HEAD was independently confirmed still `750d763`. Publication is blocked pending successful retry or server repair. The final source-qualified matrix passes, including Linux native export, measured storage/memory limits and the existing static-export browser profile. Failed attempts remain preserved, with no threshold or test-source changes. See RUNTIME_02.md and automation/reports/runtime02 for exact final evidence and publication status.
|
||||
@@ -0,0 +1,160 @@
|
||||
# AUTO-RUNTIME-02 — confined composite executor
|
||||
|
||||
For the current owner handoff, see [AUTO_START_01.md](AUTO_START_01.md). It distinguishes the previous tooling-publication prerequisite from executable assessment publication checks, reuses still-valid qualification and records the proposed local-only exception without adopting it.
|
||||
|
||||
1 November 2026. **Implementation and local qualification pass. Actual P10-00 entry remains NO-GO pending tooling publication and protected owner approvals.** The installed roadmap remains disabled and operator-controlled, with zero roadmap sessions. No owner approval was signed, and no Phase 10 assessment or later roadmap prompt was executed.
|
||||
|
||||
## Execution boundary
|
||||
|
||||
The Windows controller is the trusted broker. It accepts a closed request containing stage, checkpoint, exact commit, branch, fixed suite ID, executor-policy digest and unique request ID. Request fields cannot supply executable paths, arguments, mounts, Docker settings or report paths. Candidate commands come from `automation/executor_catalog.py`.
|
||||
|
||||
The broker reads an immutable Git snapshot and sends it to disposable Linux containers on the explicitly selected local Docker Desktop Linux engine. It never mounts a host directory, Docker socket, authentication home, approval store or owner key. Candidate code executes as UID/GID 10000, without supplementary groups or capabilities, with no-new-privileges, a read-only image, bounded tmpfs storage, memory/CPU/process limits and Docker's default seccomp policy. Approved source inputs are root-owned; build-output directories admit generated files without permitting replacement of those inputs. The Turbopack build receives a physical dependency copy because its project-root rules reject an external dependency symlink.
|
||||
|
||||
An immutable root PID1 supervises each invocation. Its only capabilities are KILL, SETUID and SETGID. It drops candidate privileges, captures the actual native exit, bounds logs and execution time, terminates/reaps detached descendants and seals reports in a root-only directory after candidate termination. An atomic transport handshake prevents fast cleanup from racing the input helper. The broker collects bounded regular files through fixed root helpers, independently parses native reports and compares exact expected identities. Historical expectations come from hash-verified original TRX/Jest/JUnit/Playwright artifacts, decoded as UTF-8.
|
||||
|
||||
Each resource has a durable lease containing its nonce, immutable image ID, exact container ID/name and isolation settings. Cleanup verifies that identity before removal. A Docker transport error is a blocked cleanup, never proof that a container disappeared. Recovery removes only resources whose recorded identity matches. No prune, compose down, general container stop, host database reset or production action exists in this adapter.
|
||||
|
||||
MariaDB uses a separate disposable container with tmpfs data. The test container joins only that container's network namespace. That namespace has loopback and no external interface/default route; no host ports are published. The fixed `jt_executor` credential is synthetic and grants access only to that disposable fixture.
|
||||
|
||||
Docker Desktop's VM, kernel, engine, official base images, trusted broker and cached development toolchains remain trusted components. These controls are a tested local CI boundary, not a claim of complete isolation from kernel/hypervisor vulnerabilities. Candidate repository scripts remain untrusted and execute inside that boundary. The worker retains MXC restrictions and never receives the broker's Docker privileges.
|
||||
|
||||
## Toolchains and capabilities
|
||||
|
||||
The executor uses the approved .NET SDK 9.0.317 and Playwright 1.62.1 development images, the accepted Python 3.12 development image, cached Linux Docling wheels and MariaDB 12.2.2. The Windows inventory found user-local SDK 9.0.317, Node 24.19.0/npm 11.17.0 and Python 3.12.10; the web executor uses the official image's Node 24.18.1. Docker Desktop 4.86.0/Engine 29.7.2 runs in its existing WSL2 VM. No separate general-purpose VM or isolated hosted runner was available.
|
||||
|
||||
No Windows service, firewall rule, system SDK or additional account/subscription was installed. Four approved Linux npm archives (SWC 16.4.1, Sharp 0.35.5, libvips 1.3.4 and the Jest resolver 1.12.2) are verified against lockfile SHA-512 digests. NuGet packages are checked against their lockfile content hashes through the installed SDK's offline package-integrity API, including signed-package payload verification. A deliberately altered signed-package copy was rejected with native exit 1; the accepted cache was unchanged.
|
||||
|
||||
Browser suites use the repository's existing production-export fixture flags, a fresh production build and disposable API/SQLite services. Development-server lazy compilation exceeded existing five-second assertions in earlier attempts; the supported production profile removes that compilation from the interaction under test. Test sources, assertions, expected membership and zero retries remain unchanged. Calibration found a 3 GiB work-storage limit and then a 6 GiB browser-memory limit insufficient. The final limits are 4 GiB work tmpfs, 512 MiB `/tmp`, 8 GiB browser memory, two CPUs, 384 processes and 2048 open files. Other suites retain smaller catalogued memory limits. The Docker VM reports about 16 GiB total memory; positive qualification rejects any OOM kill.
|
||||
|
||||
| Fixed suite | Capability / scope |
|
||||
|---|---|
|
||||
| `backend-canary` | Real backend auth, authorisation and Admin Processing Monitor tests |
|
||||
| `backend-full` | Full backend catalog, including existing CV-import/preservation tests; not implied by a canary |
|
||||
| `frontend-canary`, `frontend-full` | React/Jest, with path-qualified unique test identities |
|
||||
| `typecheck`, `lint`, `build` | Actual repository npm scripts; original production build configuration |
|
||||
| `browser-canary` | Existing real CV Editor browser workflow with disposable API/SQLite fixtures |
|
||||
| `pdf-linux-canary` | Existing Linux native document/settings/export browser workflow |
|
||||
| `browser-full` | Existing complete browser command, subject to exact qualified membership |
|
||||
| `mariadb-canary`, `rd21-canary`, `mariadb-full` | Real MariaDB provider, dashboard geometry and RD21 persistence |
|
||||
| `python-canary`, `parser-security`, `python-full` | Existing offline Python suites |
|
||||
| `docling-canary` | Existing real Docling DOCX/native-PDF extraction tests, without model activation |
|
||||
| `windows-pdf`, `licensed-provider`, `live-model`, `hosted-ci`, `security-scanners` | Independently BLOCKED; these IDs cannot be adopted as configured runnable checks |
|
||||
|
||||
The current executor policy permits only representative P10-00 suites and synthetic runtime qualification. Other stages require an explicitly reviewed policy extension. Full-suite identifiers do not constitute evidence that their full suites ran.
|
||||
|
||||
## Evidence and controller integration
|
||||
|
||||
Canonical evidence resides outside the worker in `ControlRoot/executor`. Each receipt binds the exact request, executor/image/tooling identities, command specification/version, source archive digest, timestamps, actual exit, structured passed/failed/skipped counts, native report/log digests and cleanup result. Sanitized summaries/logs are exposed through a separate read-only subtree. The worker cannot replace canonical receipts or approve decisions.
|
||||
|
||||
The controller prepares an immutable candidate commit before testing. It promotes that same commit only after checks pass and the worktree content remains unchanged. Checkpoint advancement and publication recovery independently verify private receipts, exact candidate identity and report digests. P10-00 additionally revalidates the frozen accepted evidence/source receipt; reused product evidence is labelled historical and does not replace live runtime qualification.
|
||||
|
||||
Prelaunch rejects missing, changed or expired qualification. Every underlying receipt has its own 24-hour freshness check, so a new small probe cannot renew older suites. Code, engine/kernel security configuration, immutable images and policy changes invalidate applicability. Pause/run/check budgets cancel execution and require complete cleanup. Unreconciled leases block the next worker until executor recovery.
|
||||
|
||||
## Operating commands
|
||||
|
||||
After the validated installation is refreshed:
|
||||
|
||||
```powershell
|
||||
. "$HOME\.jobjakt-backlog\single-user-local\Use-JobjaktBacklog.ps1"
|
||||
Jobjakt status
|
||||
Jobjakt dry-run
|
||||
Jobjakt executor-status
|
||||
Jobjakt executor-validate
|
||||
Jobjakt logs
|
||||
Jobjakt pause
|
||||
```
|
||||
|
||||
Runtime-only requalification uses the accepted source snapshot and launches no roadmap/model session:
|
||||
|
||||
```powershell
|
||||
Jobjakt executor-qualify -Repository 'C:\Users\Connor\.codex\worktrees\p10-assessment\Job tracker'
|
||||
Jobjakt executor-recover
|
||||
```
|
||||
|
||||
Qualification requires an idle disabled or paused queue and takes the shared repository lock. Recovery does not clear a controller's protected interrupted-run state; the existing signed `recover` process remains separate. `executor-validate` verifies current private evidence before any activation decision. `dry-run` validates configuration only; its disabled/NO-GO result is distinct from successful executor qualification.
|
||||
|
||||
`Jobjakt resume` continues the durable checkpoint after applicable owner approvals; no prompt copying is required. It still refuses disabled execution, missing entry approvals, changed policy/evidence or an unqualified runtime. `Jobjakt start` is reserved for the owner's deliberate first launch after all entry approvals. Neither command has been run against the real backlog by this task.
|
||||
|
||||
## Protected assessment applicability
|
||||
|
||||
The existing policy required full live backend/frontend/build checks and an unconfigured broad composite gate. A narrower **proposal** is justified only for immutable-source, report-only P10-00: representative live runtime canaries plus explicitly approved reuse of the source-bound accepted product evidence. It requires a new `assessment-runtime-applicability` owner decision as well as existing evidence-reuse, restricted-assessment, environment, roadmap and Phase 10 entry approvals. This is not an automatic waiver or adoption.
|
||||
|
||||
Windows PDF, licensed providers, real models, hosted infrastructure, advisory/scanner feeds, human/device decisions and production acceptance remain independent. No canary converts those decisions to PASS. Any application/test/script/dependency change invalidates the assessment-only source restriction and requires a separate implementation policy with affected/full gates.
|
||||
|
||||
P10-00 tracked edits are limited to its approved Markdown report directory; disposable worker/probe paths remain separate. It cannot modify application code, delete source files, change dependencies, run production migrations or deploy. After P10-00, the controller requests candidate-specific cleanup scope and stops. The hard execution cap rejects P10-01 even if a generic approval exists. A separately reviewed implementation policy is required for P10-01. No P10-01 or subsequent backlog execution is authorised by this installation.
|
||||
|
||||
Installed review files:
|
||||
|
||||
```text
|
||||
C:\Users\Connor\.jobjakt-backlog\single-user-local\proposed-p10-runtime02.json
|
||||
C:\Users\Connor\.jobjakt-backlog\single-user-local\proposed-p10-runtime02-enabled.json
|
||||
```
|
||||
|
||||
The first is disabled. The second is an enabled **proposal**, with the same P10-00 cap and mandatory approvals; it has not been adopted. Repository review copies are `automation/qualification/p10-runtime02.policy.json` and `p10-runtime02.enabled-proposal.json`. The canonical executor-policy digest is `3dfe072995305d5e00ecc30d34ef77c920e14017c2457bfbf030b25bae169dbc` (canonical JSON digest, not a raw-file hash).
|
||||
|
||||
One genuine unsigned **disabled** `manifest-policy-update` review request was prepared:
|
||||
|
||||
```text
|
||||
C:\Users\Connor\.jobjakt-backlog\single-user-local\requests\83562754828a67f2e6c08a5f6b3fec409dec1b4133f83e9a74a1ace7a0bfc14c.json
|
||||
```
|
||||
|
||||
No action on that disabled request is necessary while publication is blocked. Its current-baseline field describes the old inactive policy; its proposed-manifest digest binds the correct `fc5b9d3` assessment proposal. It does not accept the old baseline or authorise a worker.
|
||||
|
||||
**Only after Gitea publication is verified and the owner authorises entry following Pre-Phase-10 acceptance**, the protected sequence is:
|
||||
|
||||
```powershell
|
||||
$control = "$HOME\.jobjakt-backlog\single-user-local"
|
||||
Jobjakt configure -Manifest "$control\proposed-p10-runtime02-enabled.json"
|
||||
Jobjakt approve # Review and sign the exact enabled-policy request yourself
|
||||
Jobjakt configure -Manifest "$control\proposed-p10-runtime02-enabled.json"
|
||||
Jobjakt qualify
|
||||
Jobjakt executor-validate
|
||||
Jobjakt enable-unattended
|
||||
Jobjakt prepare-entry
|
||||
```
|
||||
|
||||
`prepare-entry` prepares one missing protected grant at a time. Review with `Jobjakt approve`, then repeat `Jobjakt prepare-entry` until it confirms the exact environment, roadmap, Phase 10 entry, restricted assessment, evidence-reuse and runtime-applicability grants. The owner may then deliberately run:
|
||||
|
||||
```powershell
|
||||
Jobjakt start
|
||||
Jobjakt status
|
||||
Jobjakt logs
|
||||
Jobjakt pause
|
||||
Jobjakt resume
|
||||
```
|
||||
|
||||
No prompt copying is required. Resume retains the current durable checkpoint and its approvals; it cannot bypass the P10-01 cap. These activation, signing and real start/resume commands were not executed by this task.
|
||||
|
||||
## Results and publication
|
||||
|
||||
| Verification | Actual result |
|
||||
|---|---|
|
||||
| Controller/executor tests | **100 passed**, native exit 0, zero failures/errors/skips, source hashes stable. Original81 +18 executor cases +1 new local Docker-pipe refusal case. Focused reruns are not added to 100. |
|
||||
| Native runtime invocations | **20**: 13 successful positive invocations (12 capability suites plus boundary canary), six expected negative invocations and one broker-death/recovery invocation. Their actual native FAILED/BLOCKED statuses are preserved rather than relabelled product passes. |
|
||||
| Backend auth/admin | 37 passed, zero failed/skipped |
|
||||
| React/Jest | 7 passed, zero failed/skipped |
|
||||
| TypeScript / lint / production build | Each actual repository command exited 0 |
|
||||
| CV Editor browser | 1 passed, zero retries/skips |
|
||||
| MariaDB dashboard geometry | 2 passed against real disposable MariaDB |
|
||||
| RD21 persistence | 15 passed against real disposable MariaDB |
|
||||
| Python health / parser security | 4 and 2 passed respectively, zero failed/skipped |
|
||||
| Real Docling | 14 passed, zero failed/skipped |
|
||||
| Linux document/settings/native-export workflow | 1 passed, zero retries/skips; finite export capability, not full visual/Windows fidelity acceptance |
|
||||
| Boundary / failure propagation | UID10000, zero capabilities/groups, no-new-privileges, private-file/result/PID1 denials, no external route, observed memory/process limits and detached-child termination pass. Exit7, timeout, OOM, interruption, log-limit and symlink failures remain failures with complete cleanup. |
|
||||
| Broker death | Actual Windows broker killed with exit1; independent root watchdog sealed candidate exit−9/TIMEOUT with zero remaining candidates. Durable recovery removed the exact orphan container. |
|
||||
| Native Windows worker | Host Docker-pipe positive succeeds; worker direct pipe access denied. Actual owner key denied; protected/personal/auth/approval canaries denied. Sanitized report read succeeds, write/new-file creation denied. |
|
||||
| Actual P10-00 filesystem profile | Source read succeeds, source write/delete denied, Markdown report creation succeeds. Exact frozen source/evidence receipt reverified; execution checkout remains clean. |
|
||||
| Installation/state | Updated code, existing owner key/public pin/auth preserved; `CHATGPT_SIGNED_IN` status. Disabled unused installation selects clean `fc5b9d3` execution worktree with read-only assessment permissions. Execution policy remains operator-controlled; no manifest adopted, zero roadmap sessions, zero owner approval files. |
|
||||
| Entry refusal | Actual `prepare-entry` native exit2 before launching any worker. RTK may map nonzero child exits to1. |
|
||||
| Application publication | Remote handoff remains `5cb903b989742b7a96cb22ddf4c0e24993b18980`; accepted proposed baseline is its parent `fc5b9d377199ce51f480a920a3772108094929e3`. Acceptance worktree was not modified. |
|
||||
| Tooling publication | Qualified implementation/evidence committed locally at `c5abef1fa2f134998af5ff9b259905010c79331d`. The retry returned native exit1: Gitea's pre-receive Go process again crashed with SIGSEGV during go-enry initialization. Independent remote verification returned exit0 and still `750d76317c2e4d4b34c89c283f06b38459d0917f`. See `publication.json`. Publication remains BLOCKED; no main merge, deployment, hook bypass or server repair was attempted. |
|
||||
|
||||
Evidence review copies are in `automation/reports/runtime02/`: `controller-tests.json`/`.txt`, `runtime-qualification.json`, `executor-qualification.json`, `native-active.json`, `control-state.json`, `policy-validation.json`, `unsigned-request.json`, `entry-refusal.json` and `publication.json`. Canonical private receipts/logs remain under `ControlRoot/executor`; repository copies cannot authorise advancement. `automation/qualification/executor-runtime02.policy.json` records exact image, code, environment and membership pins.
|
||||
|
||||
Earlier failed setup/canary attempts remain preserved privately. Corrections covered signed NuGet hashing, Linux command shims/resolver, tmpfs transport, capability-name normalization, source/report UTF-8 handling, MariaDB executable/SQL initialization, production browser setup and measured storage/memory limits. No application source, test threshold or original historical decision was changed. The final 20 invocations use the final recorded executor policy; prior focused runs are not added to that count.
|
||||
|
||||
Full product regressions were not rerun to demonstrate controller startup. Windows native PDF/visual qualification, licensed providers, live application models, hosted CI, current security scanner/advisory feeds, human/device acceptance and production remain independent NOT RUN/BLOCKED decisions. Existing accepted evidence retains its original scope. No live Codex model round-trip or account-identity verification was performed; authentication status is a separate local check.
|
||||
|
||||
## Docker Desktop repair during qualification
|
||||
|
||||
Docker Desktop initially failed before its engine started because stale zero-byte AF_UNIX socket entries could not be removed on Windows. With the engine already stopped, only Docker Desktop processes were closed. The socket-only `Docker/run` and `docker-secrets-engine` directories were preserved under `.stale-runtime02*` names, then recreated. No factory reset, image/container/volume deletion, settings change or production access occurred. Engine 29.7.2 subsequently responded normally. The preserved backups remain available for inspection.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Codex shutdown investigation — paused, patch not installed
|
||||
|
||||
The fourth P10-00 worker emitted `turn.completed` and wrote a structured result around21:39UTC on1November2026. Its Codex0.163.0 process remained alive until the owner's pause stopped it around22:18UTC. The supervisor was waiting for actual process exit, so controller application checks never began. The process tree is gone, active marker cleared, stage BLOCKED, pause request retained. The native runtime SQLite log contains no rows and stderr is empty; the underlying CLI shutdown cause is not established. `exec --help` exits normally without any model call, which does not reproduce post-turn shutdown.
|
||||
|
||||
## Prepared changes
|
||||
|
||||
- Codex worker supervision observes terminal turn events on its stdout JSONL stream. A terminal event starts a fixed60-second shutdown grace period. Exceeding it raises Interrupted, cleans the process tree and stops the controller rather than automatically spending another model attempt. Ordinary test commands do not use this event detector.
|
||||
- Private `process.json` records the actual native exit, whether termination was forced, terminal-event observation and shutdown timeout. A completed event does not replace a successful process exit. Windows Job closure can report exit0 for a killed process; the interrupted run still cannot be accepted. No exit is fabricated or converted into product acceptance.
|
||||
- An inconsistent `complete` handoff with blockers or requested approvals is rejected immediately after structured parsing, before costly application checks. Prompt guidance distinguishes actual unresolved checkpoint blockers from controller-owned pending checks, later-stage limitations and a legitimate finding that no deletion candidate is proven safe. Limitations remain in the report; actual blockers cannot be hidden or waived.
|
||||
|
||||
These changes are in the isolated tooling branch only. **Not installed, not activated, and not proof that Codex now shuts down normally.** Saved worker output and the assessment report were not edited or retroactively accepted. No new model/API execution, owner signature, queue reset, Gitea operation or production change occurred.
|
||||
|
||||
## Evidence and next boundary
|
||||
|
||||
An offline Python subprocess that emits the terminal event and then hangs reproduces the supervision problem. Tests cover bounded interruption/cleanup, real zero and nonzero exits, ordinary commands containing similar output, invalid complete handoffs, and existing suspended launch/Job containment. The complete controller test module passes52 cases, native exit0, source hashes stable. Its12 focused subprocess cases are included in52 and must not be added together. Results are under `automation/reports/shutdown-guard-01/`. The earlier failing guard assertion is retained as investigation history: a killed Windows process can report zero, so the final test verifies forced-termination/interruption rather than asserting a fabricated nonzero exit.
|
||||
|
||||
The installed executor policy pins `controller.py`, and the native qualification/owner policy also bind controller code. Deploying this patch therefore requires explicit policy/pin preparation, applicable fresh qualification and owner approval. Existing executor evidence must not simply be relabelled with a new policy hash. The runtime is deliberately left unchanged and paused while the native CLI issue is investigated. Neither a shutdown timeout nor a partial model handoff is sufficient to resume checkpoint acceptance.
|
||||
|
||||
Official release-note research requires the repository's explicit permission for internet access. No release download, CLI update or further paid worker execution is authorised by asking to inspect release notes.
|
||||
@@ -100,7 +100,7 @@ pwsh -NoProfile -File .\scripts\Register-JobjaktBacklogTask.ps1
|
||||
pwsh -NoProfile -File .\scripts\Register-JobjaktBacklogTask.ps1 -Install
|
||||
```
|
||||
|
||||
It uses your existing login, limited privileges, logon plus 15-minute continuation, an eight-hour task limit and no overlapping instances. Scheduled continuation uses `start`, preserving a manual pause; `resume` is the owner's deliberate unpause. The registration script refuses unqualified runtime/key state. No task was registered by this work.
|
||||
The task is named `JobbJakt-Codex-Runner`. It uses your existing login and limited privileges. Logon and 15-minute triggers can start at any hour. Task Scheduler starts missed runs when available, ignores overlapping triggers and limits each run to eight hours. Scheduled continuation uses `start`, preserving a manual pause. The owner can unpause with `resume`. The registration script requires current runtime and signing-key qualification.
|
||||
|
||||
## Security difference and current handoff
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# Bundled skill compatibility fix — owner retry required
|
||||
|
||||
1 November 2026. The initial P10-00 worker produced its Markdown assessment report, but post-worker validation rejected Codex's generated `auth/skills/.system` tree. Three attempts were consumed. This was a controller compatibility failure, not missing owner entry approval or an accepted assessment.
|
||||
|
||||
The guard now accepts only an explicit protected `bundledSystemSkills` configuration pin: SHA-256 of the exact Codex executable plus the complete relative file inventory and hashes under `.system`. The current installed inventory has49 files. Added files or even empty directories, modified files, changed CLI, symlinks/junctions, other skill roots, user configuration, hooks and plugins remain rejected. An unpinned skills directory is still rejected. Worker filesystem rules still deny the auth/control roots; no worker access was added. Pins describe the exact reviewed installed bytes, not a blanket trust in any directory called `.system`. The CLI currently generates this tree; future CLI/skill changes require another explicit review.
|
||||
|
||||
Only `automation/local_mode.py` changed in runtime code. The composite executor, its catalog, policy digest, images and existing private receipts are unchanged. Its current qualification still validates. The changed native binding was actually requalified: PASS, owner key and direct Docker pipe denied, protected files denied, network denied, sanitized report read succeeds/write denied. No application suite, model session or Gitea operation was launched by this fix.
|
||||
|
||||
Verification: **25 focused local-mode tests pass**, native exit0, including three new regression cases covering materialized pinned skills, altered/unpinned/extra entries, CLI substitution, redirected paths and unrelated configuration. These are not added to the earlier overlapping100-test result, which remains historical. Review copies are in `automation/reports/skill-guard-fix-01/`.
|
||||
|
||||
Installed code/configuration and native qualification were backed up under:
|
||||
|
||||
```text
|
||||
C:\Users\Connor\.jobjakt-backlog\single-user-local\skill-guard-fix-01
|
||||
```
|
||||
|
||||
The P10-00 report's SHA-256 and every existing approval envelope's SHA-256 were checked unchanged. State was preserved during installation. Only the supported retry request preparation subsequently marked `budgetResetRequested` and prepared an unsigned request. Attempts and sessions remain3; no retry budget was granted or cleared, no new owner signature was made, no controller reset occurred, and no worker was started.
|
||||
|
||||
## Owner action
|
||||
|
||||
The genuine current request is:
|
||||
|
||||
```text
|
||||
C:\Users\Connor\.jobjakt-backlog\single-user-local\requests\4d10165da7d8d1cb4ac1a9ea17ac10c2a375705be739282edbbf7a3142d7b4f9.json
|
||||
```
|
||||
|
||||
Kind: `retry-budget-reset`, with the actual three failures and current protected policy hash. It was prepared through the existing `Engine.retry` and `Engine.request` paths, without calling `run`/`resume` or changing attempt counts. Review the pin and then sign yourself:
|
||||
|
||||
```powershell
|
||||
. "$HOME\.jobjakt-backlog\single-user-local\Use-JobjaktBacklog.ps1"
|
||||
$control = "$HOME\.jobjakt-backlog\single-user-local"
|
||||
Get-Content "$control\skill-guard-fix-01\reviewed-bundled-skills.json"
|
||||
Jobjakt approve
|
||||
```
|
||||
|
||||
Suggested decision text, for the owner to review and enter:
|
||||
|
||||
```text
|
||||
Approve resetting the exhausted P10-00 retry budget after the bundled-system-skills compatibility fix, under this exact updated protected policy and reviewed CLI/skill hashes. Permit only the existing P10-00 assessment scope. Preserve the report, prior evidence, publication requirements and all acceptance limitations. No P10-01, application changes, destructive cleanup, migrations, main merge or production actions.
|
||||
```
|
||||
|
||||
Then deliberately continue:
|
||||
|
||||
```powershell
|
||||
Jobjakt resume
|
||||
```
|
||||
|
||||
The protected policy hash changed, so the three `approvalsBefore` grants (restricted assessment, evidence reuse, runtime applicability) must be signed again for that exact hash. The controller requests them sequentially before another worker. Review each using `Jobjakt approve`, then `Jobjakt resume`; after the last required grant, resume can launch the next authorised assessment worker. Do not use `prepare-entry`: it intentionally requires an unused queue, whereas this queue has three sessions. Do not run configure/setup or recreate the key.
|
||||
|
||||
The report is preserved for the next worker; it has not been accepted or published by this fix. P10-01 remains hard-capped. Mandatory Gitea publication can still block completion independently. Do not claim a remote pass or a completed assessment from this compatibility repair.
|
||||
@@ -1,6 +1,14 @@
|
||||
# Autonomous roadmap follow-up
|
||||
|
||||
30 October AUTO-ACTIVATION-01: pre-Phase-10 preparation is conditionally closed at published handoff `5cb903b`; proposed product baseline remains its parent `fc5b9d3`. Existing owner key/authentication and real-key isolation are verified. **Activation remains blocked by the real command-running composite runtime.** See [ACTIVATION_01.md](ACTIVATION_01.md) for current evidence and safe commands; the historical provisioning bullets below do not supersede that report.
|
||||
1 November SHUTDOWN-GUARD-01: owner pause stopped the fourth worker's post-turn CLI hang. Offline shutdown guard and early handoff validation patch prepared; not installed, since protected controller changes invalidate existing pins/bindings. Native CLI cause remains unresolved. Keep the queue paused; no further model execution or automatic acceptance. See [SHUTDOWN_GUARD_01.md](SHUTDOWN_GUARD_01.md).
|
||||
|
||||
1 November SKILL-GUARD-FIX-01: fixed rejection of Codex-generated system skills using exact protected CLI/file pins; user skills/config/hooks/plugins remain denied.25 focused tests and refreshed native sandbox qualification pass; existing executor qualification reused. P10-00 report and signatures preserved. Three attempts exhausted; genuine unsigned retry-budget-reset request prepared, no new worker. Owner commands: [SKILL_GUARD_FIX_01.md](SKILL_GUARD_FIX_01.md).
|
||||
|
||||
1 November AUTO-START-01: current installation, nonexportable certificate, authentication, native binding, executor qualification and frozen baseline verify without rerunning suites. Genuine enabled-manifest review request prepared, unsigned. Existing controller mandates remote handoff verification and assessment publication; it has no local-only mode. Exact restricted exception proposed, not implemented/adopted. See [AUTO_START_01.md](AUTO_START_01.md). Execution remains disabled, operator-controlled, zero sessions/signatures; no Gitea access in this task.
|
||||
|
||||
1 November AUTO-RUNTIME-02: confined broker/controller implementation and local qualification pass: 100 tests, 20 runtime/probe invocations, actual owner-key/Docker-pipe denial and read-only P10-00 scope verified. See [RUNTIME_02.md](RUNTIME_02.md). The roadmap remains disabled with zero sessions. Tooling publication is blocked by a remote Gitea pre-receive process crash; last verified remote HEAD remains `750d763`. No owner approval was signed.
|
||||
|
||||
30 October AUTO-ACTIVATION-01 (historical): pre-Phase-10 preparation is conditionally closed at published handoff `5cb903b`; proposed product baseline remains its parent `fc5b9d3`. Its composite-runtime blocker is superseded by [RUNTIME_02.md](RUNTIME_02.md). Publication and protected owner decisions still block activation; the historical provisioning bullets below do not supersede the current report.
|
||||
|
||||
AUTONOMOUS-ROADMAP-02 adds the normal-login route in [SINGLE_USER.md](SINGLE_USER.md). Single-user setup and native canary qualification are implemented; the real owner key, same-account sign-in and Phase 10 authorization remain owner actions. The separate-account provisioning below is now optional; single-user MXC qualification is the alternative.
|
||||
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
#Requires -Version 7.2
|
||||
param([ValidateSet('CreateKey','RemoveKey','Probe','TestOwnerKey')][string]$Action,[string]$Tag,[string]$Thumbprint,[string]$PlanPath)
|
||||
param([ValidateSet('CreateKey','RemoveKey','Probe','TestOwnerKey','TestDockerPipe')][string]$Action,[string]$Tag,[string]$Thumbprint,[string]$PlanPath)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
function Can-OpenDockerPipe {
|
||||
$pipe=[IO.Pipes.NamedPipeClientStream]::new('.','dockerDesktopLinuxEngine',[IO.Pipes.PipeDirection]::InOut)
|
||||
try { $pipe.Connect(1000); return $pipe.IsConnected } catch { return $false } finally { $pipe.Dispose() }
|
||||
}
|
||||
if ($Action -eq 'TestDockerPipe') {
|
||||
$connected=Can-OpenDockerPipe
|
||||
@{connected=$connected} | ConvertTo-Json -Compress
|
||||
if (-not $connected) { exit 1 }
|
||||
exit 0
|
||||
}
|
||||
if ($Action -eq 'CreateKey') {
|
||||
$cert = New-SelfSignedCertificate -Subject "CN=Jobjakt-SYNTHETIC-$Tag" -CertStoreLocation Cert:\CurrentUser\My `
|
||||
-KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy NonExportable -KeyUsage DigitalSignature -NotAfter (Get-Date).AddHours(2)
|
||||
@@ -71,5 +81,11 @@ $positive=([IO.File]::ReadAllText($PlanPath).Length -gt 0)
|
||||
$positivePath=Join-Path (Split-Path $PlanPath) 'positive.txt'
|
||||
try { [IO.File]::WriteAllText($positivePath,'synthetic'); $positive=$positive -and [IO.File]::ReadAllText($positivePath).Equals('synthetic') }
|
||||
catch { $positive=$false }
|
||||
$reportRead=$false; $reportWriteDenied=$false
|
||||
try { $reportRead=[IO.File]::ReadAllText($plan.sanitizedReport).Equals($plan.sanitizedToken) } catch {}
|
||||
try { $f=[IO.File]::Open($plan.sanitizedReport,[IO.FileMode]::Open,[IO.FileAccess]::Write,[IO.FileShare]::ReadWrite); $f.Dispose() } catch { $reportWriteDenied=$true }
|
||||
try { [IO.File]::WriteAllText(($plan.sanitizedReport+'.new'),'synthetic'); $reportWriteDenied=$false } catch {}
|
||||
@{positiveControl=$positive;files=$records;networkDenied=$networkDenied;signingKeyDenied=(-not $canSign);
|
||||
sanitizedReportRead=$reportRead;sanitizedReportWriteDenied=$reportWriteDenied;
|
||||
dockerPipeDenied=(-not (Can-OpenDockerPipe));
|
||||
ownerKeyDenied=([bool]$plan.ownerThumbprint -and -not $ownerCanSign)} | ConvertTo-Json -Depth 8 -Compress
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$ControlRoot = (Join-Path ([Environment]::GetFolderPath('UserProfile')) '.jobjakt-backlog/single-user-local'),
|
||||
[string]$Name = 'Jobjakt development backlog',
|
||||
[string]$Name = 'JobbJakt-Codex-Runner',
|
||||
[switch]$Install
|
||||
)
|
||||
$ErrorActionPreference='Stop'
|
||||
@@ -21,6 +21,6 @@ $action=New-ScheduledTaskAction -Execute $config.powershellExecutable -WorkingDi
|
||||
$repeat=New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1) -RepetitionInterval (New-TimeSpan -Minutes 15)
|
||||
$logon=New-ScheduledTaskTrigger -AtLogOn -User $config.windowsUsername
|
||||
$principal=New-ScheduledTaskPrincipal -UserId $config.windowsUsername -LogonType Interactive -RunLevel Limited
|
||||
$settings=New-ScheduledTaskSettingsSet -MultipleInstances IgnoreNew -ExecutionTimeLimit (New-TimeSpan -Hours 8)
|
||||
$settings=New-ScheduledTaskSettingsSet -StartWhenAvailable -MultipleInstances IgnoreNew -ExecutionTimeLimit (New-TimeSpan -Hours 8)
|
||||
Register-ScheduledTask -TaskName $Name -Action $action -Trigger @($repeat,$logon) -Principal $principal -Settings $settings | Out-Null
|
||||
Write-Output 'Registered for the existing login. A locked desktop is supported; logged-out execution needs separate Task Scheduler credential setup. No wake/sleep/security setting changed.'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#Requires -Version 7.2
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)][ValidateSet('init','validate','dry-run','start','resume','status','pause','retry','current','logs','recover','configure','setup','auth','auth-status','qualify','approve','prepare','prepare-entry','key','enable-unattended')][string]$Command,
|
||||
[Parameter(Mandatory)][ValidateSet('init','validate','dry-run','start','resume','status','pause','retry','current','logs','recover','configure','setup','auth','auth-status','qualify','approve','prepare','prepare-entry','key','enable-unattended','executor-status','executor-validate','executor-qualify','executor-recover')][string]$Command,
|
||||
[string]$ControlRoot,
|
||||
[string]$Repository,
|
||||
[string]$Stage,
|
||||
|
||||
Reference in New Issue
Block a user