You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: the lab synchronous-activation guard stops one hop after startServer #4704
AGENTS.md pins two invariants on src/server/index.ts: Lab activation stays behind labActivationRequired, and startServer stays synchronous so a policy route can never be evaluated before its evidence provider is registered. tests/lab/core-lab-boundary.test.ts is what holds the second one.
The scan stops after the direct callees of startServer. It catches activateLab becoming async, but activateLab calls installLabAutomationRuntime and startAutomationIfEnabled without awaiting them (src/lib/lab-activation.ts:176, :200). If either of those became async and awaited before registration, startServer would return before activation completed and the guard would stay green.
No runtime regression today — the production chain is synchronous. This is a guard that would not fail on the defect it exists to catch, which is worth fixing before it is relied on.
Reproduction
Read tests/lab/core-lab-boundary.test.ts:361 and follow which callees the synchrony scan walks.
Compare with the activation chain in src/lib/lab-activation.ts:167-200.
Mentally make installLabAutomationRuntime async with an await before its registration call: activateLab still parses as synchronous, so the guard passes while the window is broken.
Suggested fix: walk the bounded activation chain recursively, or pin every synchronous helper activateLab calls, and add a mutation case for a nested callee rather than only for the entry point.
이 이슈는 lab 동기 activation 가드가 startServer의 직접 호출자 한 홉만 본다는 한계다. tip tests/lab/core-lab-boundary.test.ts의 collectBodyLevelCalls 주석(약 361–365행)도 Depth is one on purpose라고 명시한다. activateLab이 async가 되면 잡지만, src/lib/lab-activation.ts 약 176·200행에서 installLabAutomationRuntime/startAutomationIfEnabled를 await 없이 호출하는 체인은 재귀로 안 내려간다. 중첩 헬퍼가 async로 바뀌어 registration 전에 await하면 startServer는 동기처럼 보이고 가드는 초록으로 남을 수 있다.
지금은 생산 체인이 동기라 런타임 회귀는 없다. AGENTS.md와 080_activation_is_synchronous.md가 보장하는 창문을, 가드가 의도적으로 얕게만 잠근 상태다. 이슈는 ‘오늘 깨짐’이 아니라 ‘가드가 자기가 지키려는 결함을 못 잡을 수 있다’는 메타 결함이다. 테스트 주석이 깊은 walk의 거짓양성을 걱정하므로, 무제한 재귀보다는 activation 체인에 핀한 동기 헬퍼 목록 + nested mutation 케이스가 현실적이다.
라인 tests/lab/core-lab-boundary.test.ts 361–365 - depth-1 설계가 주석으로 고정됨.
라인 src/lib/lab-activation.ts 167–200 - activateLab → install/startAutomation 동기 체인.
경로 Guard 3 / activation window 테스트 - entry 돌연변이만 주로 검증.
경로 생산 런타임 - 현재는 동기; 가드 강화가 목적.
너의 추천
받아라. installLabAutomationRuntime/startAutomationIfEnabled를 동기 pin 목록에 넣고, nested callee를 async로 만드는 mutation 테스트를 추가하라. 무제한 재귀 walk는 하지 않는 편이 주석의 경고와 맞다.
Activity
lidge-jun commentedon Sep 15, 2026
리뷰 · 우선순위 64 / 80
이 이슈는 lab 동기 activation 가드가
startServer의 직접 호출자 한 홉만 본다는 한계다. tiptests/lab/core-lab-boundary.test.ts의collectBodyLevelCalls주석(약 361–365행)도 Depth is one on purpose라고 명시한다.activateLab이 async가 되면 잡지만,src/lib/lab-activation.ts약 176·200행에서installLabAutomationRuntime/startAutomationIfEnabled를 await 없이 호출하는 체인은 재귀로 안 내려간다. 중첩 헬퍼가 async로 바뀌어 registration 전에 await하면startServer는 동기처럼 보이고 가드는 초록으로 남을 수 있다.지금은 생산 체인이 동기라 런타임 회귀는 없다. AGENTS.md와
080_activation_is_synchronous.md가 보장하는 창문을, 가드가 의도적으로 얕게만 잠근 상태다. 이슈는 ‘오늘 깨짐’이 아니라 ‘가드가 자기가 지키려는 결함을 못 잡을 수 있다’는 메타 결함이다. 테스트 주석이 깊은 walk의 거짓양성을 걱정하므로, 무제한 재귀보다는 activation 체인에 핀한 동기 헬퍼 목록 + nested mutation 케이스가 현실적이다.라인
tests/lab/core-lab-boundary.test.ts361–365 - depth-1 설계가 주석으로 고정됨.라인
src/lib/lab-activation.ts167–200 - activateLab → install/startAutomation 동기 체인.경로 Guard 3 / activation window 테스트 - entry 돌연변이만 주로 검증.
경로 생산 런타임 - 현재는 동기; 가드 강화가 목적.
메인테이너의 판단이 필요한 지점
너의 추천
받아라.
installLabAutomationRuntime/startAutomationIfEnabled를 동기 pin 목록에 넣고, nested callee를 async로 만드는 mutation 테스트를 추가하라. 무제한 재귀 walk는 하지 않는 편이 주석의 경고와 맞다.이 댓글은 grok-bot이 작성했습니다
Merge the layer below into the Lab activation guard layer (#4704) [sk…
Merge pull request #4754 from lidge-jun/codex/rg2-lab-sync-activation…
lidge-jun commentedon Sep 16, 2026
Landed via #4754 at 13f7573
lidge-jun commentedon Sep 16, 2026
Landed via #4754 at 21a3f18
fix(tests): walk the Lab activation chain instead of its first hop (l…
fix(tests): walk the Lab activation chain instead of its first hop (l…
Merge the layer below into the Lab activation guard layer (lidge-jun#…
Merge pull request lidge-jun#4754 from lidge-jun/codex/rg2-lab-sync-a…