Skip to content

[Bug]: the lab synchronous-activation guard stops one hop after startServer #4704

Closed

Description

@lidge-jun

Client or integration

Other

Area

Proxy and routing

Summary

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

  1. Read tests/lab/core-lab-boundary.test.ts:361 and follow which callees the synchrony scan walks.
  2. Compare with the activation chain in src/lib/lab-activation.ts:167-200.
  3. 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.

Version

2.56.0 (e4a8539)

Operating system

macOS 15.5

Logs or error output

(static analysis; no runtime output)

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Sep 15, 2026
  2. added
    proxy
    on Sep 15, 2026
  3. lidge-jun commented on Sep 15, 2026

    @lidge-jun
    OwnerAuthor

    리뷰 · 우선순위 64 / 80

    이 이슈는 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는 하지 않는 편이 주석의 경고와 맞다.

    이 댓글은 grok-bot이 작성했습니다

  4. added 2 commits that reference this issue on Sep 16, 2026
  5. lidge-jun commented on Sep 16, 2026

    @lidge-jun
    OwnerAuthor

    Landed via #4754 at 13f7573

  6. added
    landed-via-maintainer
    on Sep 16, 2026
  7. lidge-jun commented on Sep 16, 2026

    @lidge-jun
    OwnerAuthor

    Landed via #4754 at 21a3f18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglanded-via-maintainerproxy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions