Integrate reviewed full action pack admission and bounded idle scheduling

This commit is contained in:
zenord
2026-10-13 07:19:34 +08:00
parent 97f87e2409
commit f0620ddd65
21 changed files with 285 additions and 75 deletions
+13 -1
View File
@@ -13,13 +13,25 @@ ROOT=Path(__file__).resolve().parents[1]
def main():
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('--output',type=Path,required=True,help='New ignored numeric evidence file')
parser.add_argument('--approved-pack-sha',help='Exact public registry pin; no fixture admission')
parser.add_argument('--pack-gate',type=Path,help='Matching production gate for actual action metadata')
args=parser.parse_args()
output=args.output.resolve()
if output.exists() or not output.is_relative_to(ROOT/'logs'): raise ValueError('new logs evidence required')
source={p.name:base64.b64encode(p.read_bytes()).decode() for p in (ROOT/'gateway').glob('*.py')}
approved=None
if args.approved_pack_sha:
registry=ROOT/'gateway/reviewed_action_packs.json'
table=json.loads(registry.read_text())
gate=json.loads(args.pack_gate.read_text())
assert gate['status']=='passed' and gate['manifest_sha256']==args.approved_pack_sha and gate['action_count']==2
durations={row['id']:(row['durationUs']+999)//1000 for row in gate['action_measurements']}
assert table[args.approved_pack_sha]==durations
approved={'sha256':args.approved_pack_sha,'durations':durations,'body_packages':5,'edges':13,'own_bridges':8}
source[registry.name]=base64.b64encode(registry.read_bytes()).decode()
baseline=json.loads((ROOT/'gateway/SOURCE_MANIFEST.json').read_text())['deployment_baseline']['files']
expected={name:digest for name,digest in baseline.items() if name in source and name!='tests_fake.py'}
payload='sources='+repr(source)+'\nexpected='+repr(expected)+'\n'+(ROOT/'scripts/action-calling-path-remote.py').read_text()
payload='sources='+repr(source)+'\nexpected='+repr(expected)+'\napproved='+repr(approved)+'\n'+(ROOT/'scripts/action-calling-path-remote.py').read_text()
run=subprocess.run(['ssh','-o','BatchMode=yes','-o','ConnectTimeout=5',
'gorios-spark-2@192.168.31.61','cd /home/gorios-spark-2/lan-voice && exec .venv/bin/python -'],
input=payload.encode(),capture_output=True,timeout=210)