feat(harness): Memo 패턴 — 분산 슬롯 + 공유 헤더 (선택)#11
Open
namojo wants to merge 1 commit intorevfactory:mainfrom
Open
feat(harness): Memo 패턴 — 분산 슬롯 + 공유 헤더 (선택)#11namojo wants to merge 1 commit intorevfactory:mainfrom
namojo wants to merge 1 commit intorevfactory:mainfrom
Conversation
장기 작업·세션 재개·자동 컴팩트로 인한 토큰 폭증과 컨텍스트 유실을
완화하는 권장 패턴을 references/memo-pattern.md로 추가한다.
핵심 구조: <프로젝트>/.harness/status.md(공유 헤더, 리더만 라이트)
+ agents/{name}.md(자기 슬롯, 본인만 라이트). 라이터 경합이 구조적으로
없어 lockfile 불필요. 공유 헤더의 Decisions는 append-only.
기존 메커니즘(TaskCreate / SendMessage / _workspace / MEMORY.md /
git+code)과 역할을 명확히 분리하여 중복을 피하고, 충돌 시 우선순위
(코드 > git > TaskCreate > _workspace > .harness)도 명시한다.
default는 "적용 안 함"이며 Phase 1에서 도메인 특성을 보고 판단한다.
SKILL.md Phase 1에 선택적 권장 패턴 판단 단계와 참고 섹션 항목을
추가했다.
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경 및 동기
장기 작업,
/clear로 인한 세션 재개, 자동 컴팩트(auto-compact)로 인한 컨텍스트 유실은 하네스의 두 가지 비용을 발생시킵니다.기존 메커니즘으로는 이를 충분히 해결하지 못합니다.
TaskCreate/TaskUpdate는 진행 상태(pending/in_progress/completed)에 강하지만 왜 그렇게 결정했는가를 담지 못합니다.SendMessage는 실시간이고 영속이 아니며, 컴팩트되면 사라집니다._workspace/는 중간 산출물의 원본이지만 양이 많아 매 세션 전체를 읽기에는 비싸고, 결정 요약이 없어 빠른 흡수가 어렵습니다.MEMORY.md(auto memory)는 사용자 보편적 영속 메모리이며, 프로젝트별·세션별 진척을 담는 곳이 아닙니다.이 PR은 위 빈 칸 — 프로젝트별·세션 간 영속되는 결정 + 진척의 압축 요약 — 을 채우는 선택적 권장 패턴을 도입합니다.
무엇을 추가하는가
skills/harness/references/memo-pattern.md(신규, 약 280줄)를 추가하고,skills/harness/SKILL.md의 Phase 1에 선택적 권장 패턴 판단 단계를, 참고 섹션에 항목을 1줄씩 추가합니다.핵심 구조 — 분산 슬롯 + 공유 헤더
```
<프로젝트>/.harness/
├── status.md ← 공유 헤더 (팀 전체 목표 + 합의된 핵심 결정만)
├── agents/
│ ├── {agent-1}.md ← agent-1만 쓰는 자기 영역 (독립)
│ └── {agent-2}.md ← agent-2만 쓰는 자기 영역 (독립)
└── archive/ ← 압축된 옛날 내용 (필요 시)
```
라이터 분리:
이 분리로 lockfile이 구조적으로 불필요합니다. 라이터 경합이 발생하지 않습니다.
마일스톤 갱신 정책
매 도구 호출마다 갱신하면 오히려 토큰을 더 씁니다. 다음 시점에만 갱신합니다.
다른 메커니즘과의 역할 분리
원칙: Memo에는 "이미 다른 곳에 있는 정보의 위치 포인터 + 한 줄 요약"만 둡니다. 디테일을 복사하지 않습니다.
충돌 시 우선순위
```
코드 자체 > git log > TaskCreate 상태 > _workspace/ 산출물 > .harness/status.md
```
Memo는 요약·캐시이지 원본이 아닙니다. 충돌 시 코드를 신뢰하고 Memo를 정정합니다.
압축·폴딩
각 슬롯이 200줄을 넘으면 오래된 `Accomplishments` 상위 50%를 한 줄로 폴딩하고, 원본은 `archive/{agent}-{yyyy-mm-dd}.md`로 이동시킵니다.
적용 기준 (default는 적용 안 함)
Phase 1에서 도메인 특성을 보고 적용 여부를 판단합니다. 적용 시 사용자에게 1줄로 알립니다.
적용 예시
문서에는 "Express 4 → Fastify 4 단계적 마이그레이션" 시나리오로 5명 팀(orchestrator + dependency-analyst + route-rewriter + test-updater + regression-checker)의 `status.md`와 슬롯 발췌, 다음 세션 재개 흐름을 보여줍니다.
흔한 안티패턴 (8개)
매 Edit/Bash 후 갱신, 한 사람이 모든 슬롯 갱신, Decisions 항목 삭제, 산출물 본문을 status에 복사, TaskCreate를 status로 대체, status에 사용자 보편 사실 기록, `.harness/`를 git에 commit하지 않음, `.harness/`에 secrets/credentials 기록 — 모두 문서에 "왜 금지인가"와 함께 명시.
변경 사항
후속 PR
본 PR로 도입된 Memo 패턴을 자동화(SessionStart/PreCompact hook으로 status 자동 주입)하는 후속 PR "Hook 통합 (선택)"을 별도로 제안할 예정입니다. 자동화는 위험한 책임이므로 별도 PR로 분리하여 사용자 명시 승인이 있을 때만 적용되도록 합니다.
체크리스트