iop/agent-task/m-agent-readable-repository-refactor/09+01,03,04,05,06,07,08_secondary_completion/PLAN-cloud-G09.md

6.2 KiB
Raw Blame History

Secondary modules와 장기 함수 완료 감사 계획

이 파일을 읽는 구현 에이전트에게

이 plan은 이름에 적힌 01/03/04/05/06/07/08 sibling이 모두 PASS되고 active sibling 또는 matching archive에 각 complete.log가 정확히 하나 존재할 때만 시작한다. 하나라도 없거나 중복이면 구현하지 않는다. 검증과 잔여 수정 후 review stub을 실제 evidence로 채우고 active 파일을 유지한다. 직접 사용자 질문과 구현 에이전트의 finalization은 금지한다.

Roadmap Targets

  • Milestone: agent-roadmap/phase/automation-runtime-bridge/milestones/agent-readable-repository-refactor.md
  • Milestone link: Milestone 문서
  • Task ids:
    • secondary-modules: HTTP/CLI/Ollama adapter, Flutter runtime panel, E2E shell의 책임 분해 완료
    • long-functions: Classify/adapter Execute/Node·transport handler/E2E orchestration의 장기 함수 처리 또는 응집 예외 근거
  • Completion mode: check-on-pass

분석 결과

  • 선행 완료 근거: 계획 작성 시점 없음. 모든 sibling은 active plan이며 이 plan은 의존성 gate다. 완료 evidence는 active 또는 matching agent-task/archive/YYYY/MM/m-agent-readable-repository-refactor/<subtask>/complete.log 중 정확히 하나만 허용한다.
  • 직접 완료 baseline: 현 worktree에서 Ollama 500줄 파일/145줄 Execute를 6개 책임 파일과 stream session으로 분리했고 adapter/Node tests 및 bin-diagnostic이 통과했다. configrefresh.Classify 227줄은 Edge/Node/provider/model 단계 helper로 분리했고 package test가 통과했다.
  • 잔여 범위: 선행 plan 결과와 최신 scripts/readability_audit.py output에서 production/E2E function_loc >= 120, secondary 대상 file_loc >= 500을 다시 산출한다.
  • 테스트 환경: local node/client/testing profiles와 e2e-smoke. 전체 Go, Flutter, smoke/full-cycle을 요구한다.
  • 분할 판단: 실제 구현은 도메인 sibling으로 분리했고 이 plan은 통합 감사에서 발견된 bounded residual만 수정한다. 새 독립 subsystem이 발견되면 억지로 포함하지 말고 code-review follow-up plan으로 남긴다.
  • 제외: test 함수 LOC만을 줄이기 위한 assertion 분산, 범용 utils/micro-package, 동작/계약 변경.
  • 빌드 등급: cloud-G09; 다도메인 완료 판정과 full regression evidence를 검토한다.

구현 체크리스트

  • 모든 선행 sibling의 complete.log와 직접 완료된 Ollama/Classify source evidence를 확인한다.
  • 최신 audit에서 secondary file과 production/E2E 120줄 이상 함수의 잔여 목록을 결정적으로 생성한다.
  • 책임 혼합 잔여는 단계 함수로 축소하고 응집 예외는 symbol·이유·테스트 근거를 기록한다.
  • 전체 Go/Flutter, smoke/full-cycle, readability ratchet을 통과하고 roadmap 두 Task의 완료 evidence를 정리한다.
  • CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.

[REFACTOR_COMPLETION-1] 선행·직접 변경 evidence 검증

문제: split 완료는 sibling archive와 현재 source를 함께 확인하지 않으면 일부 domain 누락을 감출 수 있다.

해결 방법: 각 sibling complete.log와 Ollama/Classify symbol/file audit를 확인한다.

  • dependency 파일 존재와 PASS를 기록한다.
  • 테스트 작성: skip. 완료 gate 검증이다.
  • 중간 검증: for d in 01_openai_modules 03_service_node_modules 04+01,03_openai_complexity 05_http_provider_adapters 06_cli_adapter 07_client_runtime_panel 08_e2e_scripts; do mapfile -t logs < <(find "agent-task/m-agent-readable-repository-refactor/$d" agent-task/archive -type f -path "*/m-agent-readable-repository-refactor/$d/complete.log" 2>/dev/null | sort); test "${#logs[@]}" -eq 1; rg -q 'PASS' "${logs[0]}"; done

[REFACTOR_COMPLETION-2] 결정적 잔여 감사와 bounded 수정

문제: 파일 이동만으로 120줄 이상 책임 혼합 함수가 남거나 새 위반이 생길 수 있다.

해결 방법: worktree audit JSON을 /tmp에 만들고 대상 path의 file_loc/function_loc을 정렬 출력한다. split_review production/E2E 항목은 수정하거나 응집 예외 evidence를 review에 기록한다.

  • tests의 긴 setup/assertion은 production 완료를 위해 기계적으로 쪼개지 않는다.
  • utils/micro-package 없이 도메인 언어의 단계 이름을 사용한다.
  • 테스트 작성: 수정한 residual마다 기존 test 또는 focused table test를 실행한다.
  • 중간 검증: python3 scripts/readability_audit.py --input-mode worktree --output /tmp/iop-final-readability.json

[REFACTOR_COMPLETION-3] 전체 회귀와 full-cycle

문제: 다도메인 구조 변경은 개별 package 성공만으로 사용자 실행 계약을 닫을 수 없다.

해결 방법: 전체 Go/Flutter와 보조 smoke, repo 내부 EdgeNode 진단을 실행한다. CLI 변경은 준비된 실제 profile 결과와 blocker를 분리 기록한다.

  • make test-e2e는 보조 smoke로만 기록한다.
  • bin-diagnostic에서 메시지 2회와 command ordering을 확인한다.
  • 테스트 작성: skip. 통합 verification item이다.
  • 중간 검증: GOCACHE=/tmp/iop-go-cache go test -count=1 ./... && make client-test

최종 검증

GOCACHE=/tmp/iop-go-cache go test -count=1 ./...
make client-test
(cd apps/client && flutter analyze)
bash -n scripts/e2e-smoke.sh scripts/e2e-long-context-admission-smoke.sh
make test-e2e
make readability-audit
git diff --check

이어 e2e-smoke mode=all, scope=secondary modules and long-function completion을 수행한다. 모든 필수 명령 성공, 새/증가 위반 없음, 남은 대상별 응집 예외 evidence가 있어야 PASS다.

모든 코드 변경 완료 후 반드시 CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 채운다. 이 파일 작성이 구현의 마지막 단계다.