Repository navigation
feat(termux-worker): canonical worker.js deploy script (#2791 stage 3) - #2931
Merged
Merged
Conversation
seoseo-ai
changed the base branch from
feat/2791-native-worker-restart
to
main
November 27, 2026 06:53
scripts/a2a-termux-native-worker-deploy.sh replaces the per-rollout ad-hoc Termux worker rollout scripts (owner decision 2026-11-27: the deploy side owns the worker.js restart; the script lives in ccc-node). Dry-run by default (plan + idle gate). --apply: idle gate via `restart-worker --if-idle --dry-run`, backups of the worker root and the replaced node_modules packages, copy dist/ scripts/ handlers/, check the build revision, the artifact's own rollout guard and an optional --smoke-cmd, then `restart-worker --if-idle` (registered with + health sup_count=1 workers=1 tunnel=UP) and write .deploy-source-sha. Failures roll the root back exactly; busy never signals the worker. Unsafe tar members are refused. Stacked on #2929 (stage 2b). Refs #2791 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seoseo-ai
force-pushed
the
feat/2791-native-worker-deploy
branch
from
November 27, 2026 06:54
e85eb43 to
d9a2c8d
Compare
jinon86
approved these changes
Nov 27, 2026
jinon86
left a comment
Contributor
There was a problem hiding this comment.
Approved after exact-head validation and fresh operator authorization using the relay-held jinon86 credential.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
#2791 3단계입니다. 오너 결정(2026-11-27)을 따릅니다.
scripts/a2a-termux-native-worker-deploy.sh입니다.롤아웃마다 따로 쓰던 임시 스크립트(11-24
termux-rollout-267d018.sh)의 동작을 정본으로 옮겼습니다. 원본은 읽기 전용으로만 확인했고, 비밀값은 없었습니다. 원본이 직접 하던 유휴 판정(pgrep -P)과 SIGTERM은 #2929의restart-worker --if-idle로 대체했습니다.동작
restart-worker --if-idle --dry-run게이트까지만 하고 노드는 바꾸지 않습니다.--apply일 때 순서는 다음과 같습니다(원본 스크립트와 같은 흐름).node_modules제외) tgz와, artifact가 교체할node_modules패키지 tgz입니다. 둘 다tar tzf로 확인한 뒤에만 다음 단계로 갑니다.dist/·scripts/·handlers/를 덮어쓰고, artifact에 든 패키지를 교체합니다.scripts/worker-artifact-rollout-guard.mjs --deployed가 있으면 그 결과(--no-guard로 끌 수 있음)--smoke-cmd(A2A_WORKER_ROOT를 넘겨 실행)restart-worker --if-idle로 worker.js만 SIGTERM합니다. 하네스가registered with와 healthsup_count=1 workers=1 tunnel=UP을 확인합니다.<worker_root>/.deploy-source-sha를 원자적으로 씁니다.flock으로 막습니다(exit 4)...·디바이스·밖을 가리키는 링크가 있으면 거부합니다.--env-file필수). 원본에 있던 a2a-nexus 전용 link smoke는 범용--smoke-cmd로 넘길 수 있습니다.docs:
docs/a2a-claude-worker.md("Deployingdist/worker.js"). changelog:changelog.d/2791-native-worker-deploy.md검증 (로컬, jingun)
scripts/a2a-termux-native-worker-deploy.test.sh(신규): PASS=33 FAIL=0. 가짜 하네스(A2A_NATIVE_WORKER_HARNESS)와 가짜node를 썼습니다...가 든 tar → 모두 rc 2. root는 그대로이고 게이트도 호출하지 않습니다..deploy-source-sha, 백업 2개가 생기고, 재기동 시점에 새 파일이 보이며, staging은 정리됩니다.ok:false는 rc 20이고 root가 정확히 복원되며 재기동하지 않습니다. 검증 실패는 rc 30이고 복원한 뒤 이전 코드로 다시 재기동합니다. 재기동 시점에 busy이면 rc 10이고 복원됩니다.shellcheck -S warning,canon-node-name-scan.sh --repo-wideok,changelog_fragments.py checkok운영자 할 일: Wiki ND-1086 수정 (이 PR은 Wiki를 고치지 않습니다)
pages/nodes/gongyung/RUNBOOK.md의[ND-1086] Native A2A worker절(143행 이후)이 낡은 supervisor 경로를 적고 있습니다. 대교 쪽 노드 문서에 같은 문구가 있는지도 함께 확인해 주세요. 고치기 전에 노드에서crontab -l,pgrep -af 'a2a-termux-native-worker.sh supervise'로 현재 상태를 확인한 뒤 PR-first(wiki-agent write-path→wiki-agent pr)로 반영해 주세요.~/.hermes/scripts/native-worker-supervisor.sh(터널+워커 루프), launcher~/.hermes/scripts/native-worker-launch.sh~/ccc-node/scripts/a2a-termux-native-worker.sh supervise --env-file <env>. 정본, flock singleton. 레거시 스크립트는 ND-1236 이후 쓰지 않습니다.start-nativeworker.sh중심canonical-native-worker-health(RB-411)가 5분마다a2a-termux-native-worker-health.sh --self-heal을 실행합니다. Boot 항목은 실측한 뒤 적습니다.~/.hermes/logs/native-worker-supervisor.log~/.hermes/logs/a2a-native-worker-supervisor.log,~/.hermes/logs/a2a-native-worker-health.log(health가 띄운 supervisor의 stdout, 곧registered with줄이 여기로 갑니다)pgrep -f "node.real.*dist/worker.js", 레거시 로그 tailbash ~/ccc-node/scripts/a2a-termux-native-worker-health.sh --env-file <env> --no-self-heal --json(supervisor_count=1,workers=1,tunnel=UP,stale=[])a2a-termux-native-worker.sh restart-worker --if-idle. supervise 변경 시:restart-supervisor --if-idle. worker.js 배포:scripts/a2a-termux-native-worker-deploy.sh --env-file <env> --artifact <tgz> --target-sha <sha>(dry-run을 먼저 하고 승인 후--apply). self-update 자동 재기동은 opt-inCCC_SELF_UPDATE_NATIVE_SUPERVISOR_RESTART=1(기본 0).범위 밖 / 게이트
--apply), 스위치 켜기, 라이브 재기동은 머지 뒤 노드별로 따로 승인받습니다.Refs #2791
🤖 Generated with Claude Code