Files
Agent-System-Dev/.task/artifacts/project-member-runtime/final_live_check.py
T
weichenandCursor 3785408e71
ci / test-pg (pull_request) Successful in 9m3s
ci / test (pull_request) Successful in 7m48s
ci / svc-realcombo (pull_request) Successful in 2m34s
Archive the completed project-member-runtime task card
Why: the 8788 project-member runtime delivery finished (code merged via #526/#530) but its card and operation records lived only on an unpushed task branch, leaving the worktree impossible to recycle and the record invisible on main.
Evidence: card status "已完成(运行目标)" on feature/project-member-runtime 835d807; branch diff against merge-base touches only .task (card + 29 operation records); credential scan finds only variable-based Authorization headers and sha256 digests.
Impact: adds .task/archive/feature-project-member-runtime.md and .task/artifacts/project-member-runtime/**; no code, gitlink or policy change.
Refs: worktree cleanup 2026-10-18
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-18 09:01:23 +00:00

22 lines
1.7 KiB
Python

import json,os,urllib.request,urllib.error
from pathlib import Path
import prepare
r=prepare.R;w=prepare.W
pid=int((r/'svc.pid').read_text());exe=Path(f'/proc/{pid}/exe').resolve()
assert exe==(r/'current/bin/agent-system').resolve()
assert prepare.sha(exe)=='d5db3d0ac292d99582ec91938317af356c050ad61e61f42c097e7faf7a731765'
assert os.readlink(r/'current').startswith('releases/rdm-3f647f6-')
assert json.loads((r/'manifest.json').read_text())['instance_id']==prepare.INSTANCE
with prepare.db(prepare.DATA/'rdm.db') as c:
b=dict(c.execute('select * from rdm_host_project_map where host_project=?',(prepare.HOST,)).fetchone())
assert b['rdm_project']=='p-aea70b2559c6' and b['state']=='ready' and b['created_by']=='weichen'
roles=[tuple(x) for x in c.execute('select owner,role from rdm_members where project_id=? order by owner',(b['rdm_project'],))]
assert roles==[('test','member'),('weichen','owner')]
with prepare.db(prepare.DATA/'agent-system.db') as c:
assert c.execute("select count(*) from api_keys where name='project-member-runtime-20261013' and revoked=0").fetchone()[0]==0
assert not (w/'credentials.json').exists()
with urllib.request.urlopen('http://127.0.0.1:8788/',timeout=15) as response:assert response.status==200
try:urllib.request.urlopen('http://127.0.0.1:8788/api/me',timeout=15);raise AssertionError('anonymous authenticated')
except urllib.error.HTTPError as error:assert error.code==401
print(json.dumps({'source':'SELF','pid':pid,'release':os.readlink(r/'current'),'binary_sha256':prepare.sha(exe),'instance':prepare.INSTANCE,'binding':b,'roles':roles,'root_status':200,'anonymous_me_status':401,'revocation_verified':True,'protected_plaintext_removed':True,'fixed_runtime_object_unchanged_after_record_sync':True},ensure_ascii=False))