Skip to content

refactor: keep the start deadline apart from the settle wait - #2169

Merged
yansfil merged 2 commits into
mainfrom
refactor/start-clock-split
Nov 6, 2026
Merged

yansfil merged 2 commits into
mainfrom
refactor/start-clock-split

Conversation

@yansfil

@yansfil yansfil commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Related: #2159

Summary

에이전트가 시작할 때 Hide는 시계 하나로 두 가지를 정했습니다. 시작이 끝나야 하는 120초 기한과, 입력하기 전 화면이 안정되기를 기다리는 3초입니다.
에이전트가 키를 받거나 질문에 답하면 이 시계가 처음으로 돌아갔고, 120초 기한도 함께 밀렸습니다. 그래서 줄 편집을 1초마다 켰다 껐다 하는 프로그램은 시작이 영영 끝나지 않았습니다(편지는 launch_pending으로 계속 붙잡힘).
이제 시계가 둘입니다. 120초 기한은 시작 시각에 고정되고 아무것도 그것을 옮기지 않습니다(Herdr v0.9.5의 Pending { ready_after, deadline }과 같은 분리). 3초 안정 대기는 지금처럼 키를 받을 때와 질문에 답할 때 다시 시작합니다.
"지금 키를 읽나"는 PaneAgent::takes_input(now) 하나가 답하고, 편지, agent.prompt, fork가 기다리는 상태가 모두 이것을 씁니다. 120초는 AGENT_START_DEADLINE 한 상수에서 나옵니다.

Review

  • 판단해 주세요: 질문에 답해도 이제 기한이 다시 시작하지 않습니다. 기한이 지난 뒤 답하면 시작은 바로 끝나고, 다음 화면이 그려지는 3초 동안 편지가 보는 이유가 launch_pending이 아니라 not_ready가 됩니다(둘 다 편지를 붙잡으므로 결과는 같음).
  • 판단해 주세요: 기한이 지나도 계속 줄 편집을 켰다 끄는 프로그램은 not_ready로 남습니다(전에는 launch_pending으로 영원히). 키를 받은 지 3초가 안 된 프로그램에는 기한 뒤에도 치지 않습니다.
  • 조심해서 볼 파일: herdr-core/src/engine/own/agents.rs - Live::started/Live::settles_from, launch_pending, takes_input, readiness, start_changes_at. engine/core 소유 경계에서 시작이 끝나는 순간을 정하는 곳입니다.
  • 조심해서 볼 파일: herdr-core/src/engine/answers.rs - Readiness::Unreported와 Readiness::of를 지웠습니다. 자체 엔진은 모든 에이전트에 두 값을 다 보냈으므로 production에서는 이미 쓰이지 않았고, Herdr 모양 테스트 fixture 변환은 engine/fake.rs로 옮겼습니다.
  • 비용 검토: 고빈도 경로 변화 없음. holder 사실 하나마다 하던 비교 그대로이고, start_changes_at이 내는 순간도 전과 같은 두 개(안정 대기 끝, 기한)입니다.

Evidence

  • 확인한 것: 첫 커밋 e2122e063의 시험(a_program_toggling_line_editing_every_second_finishes_starting_at_its_deadline)은 main에서 실패(the start ends at its deadline), 다음 커밋에서 통과. 1초마다 120번 토글해도 기한 전에는 시작 중, 기한에는 끝, 기한 뒤 키를 받으면 3초 뒤에 Ready가 됩니다.
  • 확인한 것: 새 시험 a_question_answered_past_the_deadline_settles_before_input. 기존 시험은 키 받기와 질문 답이 안정 대기만 다시 시작하고 started는 그대로임을 확인하도록 고쳤습니다.
  • 확인한 것: macOS에서 GIT_CONFIG_GLOBAL=/dev/null bash scripts/verify-cargo.sh nextest -p herdr-core: 3947개 중 3945개 통과, verify-cargo.sh clippy -p herdr-core --all-targets 경고 없음, fmt-check 통과.
  • 확인하지 못한 것: worktree_control::tests::a_process_that_has_ended_is_not_waited_for와 ..._never_the_systems_pids 두 개가 이 Mac에서 실패합니다(process 4294967294 could not be read: invalid input parameter). 시험만 더한 첫 커밋(main + 시험)에서도 똑같이 실패하므로 이 변경과는 무관합니다. CI에서 확인합니다.
  • 확인하지 못한 것: 실제 에이전트로 해 본 실행(isolated candidate)은 하지 않았습니다. 바뀐 것은 시계 판단뿐이고 위 단위 시험과 엔진 수준 시험이 그것을 다룹니다. Windows START_WITHIN은 Windows CI 계약 레인에서만 컴파일됩니다.

@yansfil
yansfil added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 5442d5e Nov 6, 2026
39 checks passed
@yansfil
yansfil deleted the refactor/start-clock-split branch November 6, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant