Files
multi-agent-mux/LOG.md
T
Godopu b4821fafa8 feat(a4,c3b): complete A-4 Phase 2 agent knowledge migration & Option B isolation removal
- Option B / C-3b: Deprecate isolation.root and remove its 4 legacy consumers in lib.sh, workspace_uuid.py, verify_session.py, and stop_session.sh.
- M2~M7 Migration: Implement artifact_path, verify_artifact, purge_artifacts, spawn_spec, resume_spec, auth_ok, discover, ready_tokens, exit_key, and delegate_agent_key across BaseAgentAdapter and all 4 adapters (Claude, Agy, Hermes, Cline).
- Migrate shell duplications in lib.sh, create_session.sh, resume_session.sh, stop_session.sh, and reconcile.sh to python -m lib_py.agents facts.
- Hardening & Corrections: Fix Cline resume_spec flag to '-i --id', apply shlex.quote across all facts variables with MAM_ prefix, add safe fallback in wait_for_tui_ready.
- Add comprehensive contract tests in tests/test_a4_adapter_contract.py and sync IMPROVEMENTS.md / LOG.md.
- Verified: 100% PASS across unit, component, contract, and integration tests.
2026-08-16 23:15:24 +09:00

18 KiB

📝 Multi-Agent Mux 작업 세션 기록 (LOG.md)

  • 최종 기록일시: 2026-08-16 10:00 (KST)
  • 작업 저장소: tmpl/multi-agent-mux (Branch: main)
  • 작업 상태: 모든 작업 완료, 세션 안전 종료(stopped), 저장소 상태 Clean!

1) P3-1 (A-4 Phase 2 / Option B / C-3b / M2~M7): 에이전트 지식 계층 마이그레이션 및 isolation.root 완전 폐기완료

2) P2-2 (C-3a / C-4): 레거시 격리 스텁 및 미사용 심볼 제거완료

2) P2-1 (B-6 / B-12): delegate_job_safe 임시 사본 제거 및 서브셸 루프 락 조기 해제 차단 조치완료

  • 배경: run_loop.sh::delegate_job_safe.agents/skills/... 내부에 .tmp 사본을 생성하여 트리 오염 및 배포 시 유출(B-6)되던 문제와, 명령 치환 서브셸 내의 trap _mam_release_guard EXIT 로 인해 첫 번째 잡 위임 시 루프 락 마커(.mam/loop-guard-active)가 조기 삭제되어 O-3 가드레일이 무력화되던 결함(B-12 / D1) 조치.
  • 주요 구현:
    • .agents/skills/multi-agent-mux-loop/scripts/run_loop.sh: delegate_job_safe 를 임시 사본 및 서브셸 트랩 없이 인플레이스로 직접 실행(bash "$orig_script" "$@")하도록 개선하고 실패 시 진단 로깅 추가. 루프 기동 시 기존 잔여 .tmp 스윕 구문 추가.
    • IMPROVEMENTS.md: B-6 완료 상태 갱신, B-12 (D1) 결함 명세 및 B-13 (턴 간 스킬 오염) Stage 2 과제 등록.
    • tests/test_o3_scoped_guard.py: 취약한 문자열 검사 Z-9를 4개 행위 기반 테스트(test_z9_loop_lock_survives_delegation, test_z9_probe_detects_the_defect, test_z9_no_tmp_copy_left_in_skill_tree, test_z9_exit_code_and_diagnostics_propagation)로 교체.
  • 검증: pytest tests/ -q 실행 결과 259 passed (100%) 달성.

2) multi-agent-mux-orc-onboard: 오케스트레이터 온보딩 스킬 및 orchestrator_uuids 배제 게이트 구축완료

  • 배경: 오케스트레이터(agy)가 서브 에이전트 생성/정지/복원 시 자기 대화 UUID가 agent-sessions.yaml 서브 세션으로 오염 캡처되어 SQLite DB 락(database is locked) 및 대화 충돌이 발생하던 결함 조치.
  • 주요 구현:
  • 멀티에이전트 자율 오케스트레이션: /multi-agent-mux-loop --plan --all-reviewer 가동 결과 Planner(claude), Creator(agy), Reviewer(cline) 3자에 의해 [VERDICT: PASS] (만장일치 통과).

2) P0-2 (O-2): 동일 워크스페이스 내 중복 루프 기동 방지 원자적 락 및 마커 소유권 대조 삭제 조치완료

  • 배경: 루프 중복 기동 시 마커 무단 덮어쓰기로 인한 데이터 오염 및 먼저 종료된 루프 인스턴스의 무차별 마커 삭제로 O-3 위임 가드레일이 조용히 무력화되던 결함 조치.
  • 주요 구현:

2) P0-1 (B-7): run_loop.sh 루프 기동 외곽 diff 누락 및 신규 미추적 파일 캡처 결함 조치완료

  • 배경: CWD 의존성으로 인해 저장소 외곽에서 run_loop.sh 구동 시 git diff 실패 및 미추적 신규 파일(Untracked Files) 누락으로 리뷰어가 빈 diff 보고 무조건 PASS를 남기던 무음 검증 결함 조치.
  • 주요 구현:
  • 멀티에이전트 자율 오케스트레이션: /multi-agent-mux-loop --plan --all-reviewer 가동 결과 Planner(claude), Creator(agy), Reviewer(cline) 3자에 의해 [VERDICT: PASS] (만장일치 통과).

2) B-4: 시프트 ls 세션 생성 시각(session_created) 동적 포시스 타임스탬프 복원완료

  • 배경: .agents/skills/lib.sh 554번 라인에서 herdr ls 시 생성시각이 999999로 하드코딩되어 reconcile.sh drift-B 등록 시 epoch 0이 되어 find_workspace_uuid 재개 가드가 붕괴되던 결함 조치.
  • 주요 구현:
    • .agents/skills/lib.sh: real herdr 및 YAML 상의 created/created_at/created_epoch 속성을 읽고, 미정의 시 int(time.time()) 동적 포시스 타임스탬프를 리턴하도록 정제.
    • reconcile.sh: created fallback 포맷팅 보완.
    • tests/test_b4_session_created.py: 전용 회귀 테스트 21개 항목 작성 및 21/21 PASS (100%) 달성.
  • 멀티에이전트 자율 오케스트레이션: /multi-agent-mux-loop --plan --all-reviewer 가동 결과 Planner(claude), Creator(agy), Reviewer(cline) 3자에 의해 [VERDICT: PASS] (만장일치 통과).

2) deploy/ 배포 스크립트 최신화 및 레지스트리 3-way 병합 구현완료

  • 배경: deploy/install.shinstall_mam.sh.agents/skills/ 밖 자산(hooks.json, MULTI_AGENT_RULES.md, INSTALL.md)을 갱신하지 못하거나 로컬 훅 수정을 덮어쓰는 맹점(Job 1567c88e / Plan Rev.2) 해결.
  • 주요 구현:
    • deploy/lib_ownership.sh 신설: 자산 소유권 및 레지스트리 파일 관리 단일 창구화.
    • deploy/install.sh: hooks.json 키 단위 3-way 병합(MERGE_REGISTRY) 및 .mam/base/ 스냅숏 도입.
    • deploy/install_mam.sh & deploy/remove.sh: asset_hashes.txt.mam/base/ 자동 생성과 fallback 자산 목록 동기화.
    • deploy/gitea-ci.yml & deploy/README.md: CI pytest 자동화 게이트 및 문서 구조 갱신.
    • 커밋 완료 (399242d, cc11a02).

2) 테스트 슈트 경량화 및 다이어트완료

  • 중복되고 오래된 레거시 테스트 7개 파일(1,559줄) 완전히 삭제 (cf51b2c).
  • 핵심 계층별 테스트 슈트(Tier 1~4, Deploy, Guard)만 정비하여 향후 기능 변경 시 실행 속도 및 자원 소모 대폭 개선.

3) O-3: 조건부 오케스트레이션 위임 가드 (Invocation-Aware Scoped Guard)완료

  • 배경: 오케스트레이터 에이전트가 /multi-agent-mux-loop 실행 시 직접 코드를 수정하지 않고 스크립트로 위임하도록 통제하며, 루프 내부에서 무한 재귀 기동되는 현상을 원천 방지함.
  • 주요 수정 파일:
    • .agents/skills/multi-agent-mux-loop/scripts/run_loop.sh: PID + 시작시각 기반 .mam/loop-guard-active 식별자 작성 및 trap 자동 삭제 적용.
    • AGENTS.md: Section 5 (Orchestrator Scope Guard O-3) 명시.
    • .agents/MULTI_AGENT_RULES.md & .ko.md: 오케스트레이터 세션 및 루프 활성화 모드 수칙 동기화.
    • tests/test_o3_scoped_guard.py: 24개 검증 케이스 작성 (24/24 PASS).
  • 멀티에이전트 자율 피어 리뷰: Planner(claude), Creator(agy), Reviewer(cline) 3자에 의해 루프 구동 후 [VERDICT: PASS] (100% 합의) 통과 및 커밋 완료 (1f8622e).

2) A-3 & C-2 과제 완수 및 안정화 버그 수정완료

  • A-3: send_keys_safe 시프트 버퍼 동시성 레이스 조건 해결 (호출 고유 토큰 생성 + 원자적 쓰기/이동 + 60분 자동 GC).
  • C-2: 미사용 .cache/multi-agent-mux-monitor 디렉터리 생성 로직 축소 및 reconcile.sh 상태 dead code 정리.
  • 환경 변수 전파 보완: .agents/skills/lib.shHOME_DIR, CLAUDE_PROJECT_DIR, LOCAL_BIN 하위 프로세스 export 누락 해결 (2fc0f58).
  • 테스트 슈트 Mock 지원: tests/conftest.pymock_herdrlist-panes 핸들러 추가 (778b22b).
  • 상태 복구 안전성: reconcile.sh 내 세션 생성 시각 안전 키 접근(t.get('created', 0)) 반영 (36d0178).

Git 커밋 내역 (Total 8 Commits on refactor)

  1. 2fc0f58: fix(lib): export HOME_DIR, CLAUDE_PROJECT_DIR, and LOCAL_BIN in lib.sh for proper child environment inheritance
  2. 55fc739: fix(lib): use symlink-safe realpath comparison for workspace cwd matching in find_workspace_uuid
  3. 778b22b: fix(test): add list-panes support to mock_herdr and fix environment overrides in tier3 integration tests
  4. 9f266e6: test(integration): update test_tier3_integration to align with global config-home convention
  5. 7e16d65: test(integration): refine test_integration_create_options_combination to test herdr spawn without wrapper
  6. 1658af4: test(sanity): update test_sanity assertions to align with removed config-home isolation
  7. 1f8622e: feat(o3): implement Invocation-Aware Scoped Guard for orchestrator role scoping (100% PASS)
  8. 5ab7687: fix(c2): remove unused .cache directory creation and clean up state dead code (100% PASS)
  9. 3530e8b: fix(a3): resolve shift buffer race condition with call-unique tokens, atomic write, and automatic GC (100% PASS)

🤖 3. 라이브 에이전트 세션 현황 (herdr: multi-agent-mux)

에이전트 이름 역할 herdr 세션 상태 비고
canary-projects-multi-agent-mux-creator-claude Planner stopped 대화 UUID 01eae7cf... 캡처 보존 완료
canary-projects-multi-agent-mux-creator-agy Creator stopped 대화 UUID 72d2d251... 캡처 보존 완료
canary-projects-multi-agent-mux-creator-cline Reviewer stopped 대화 UUID 17856352... 캡처 보존 완료

🚀 4. 추후 작업 재개 가이드 (Next Steps)

  1. 세션 상태 확인:
    bash .agents/skills/multi-agent-mux-status/scripts/status_session.sh
    
  2. 백로그 확인 (IMPROVEMENTS.md):
    • 다음 우선순위 추천 과제:
      • O-2: 동일 워크스페이스 내 중복 루프 기동 방지 락 (Race-Free Lock)
      • B-4: 시프트 lscreated=0 하드코딩 해결
  3. 루프 구동으로 작업 재개:
    /multi-agent-mux-loop --plan --all-reviewer "IMPROVEMENTS.md 백로그의 O-2 (또는 선택 과제) 문제를 해결해줘."