therookie 0.4.34 → 0.4.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "therookie",
3
- "version": "0.4.34",
3
+ "version": "0.4.35",
4
4
  "description": "Persistent memory for Claude Code and Codex CLI — teach your AI once and it remembers across sessions, tools, and machines. The AI new hire that remembers what you teach it.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -27,5 +27,7 @@ skill_gate_record_epoch() {
27
27
  # checkpoint 리마인더 카운터 리셋 (spec 2026-07-16-checkpoint-working-card §2.4) —
28
28
  # /clear·compact 직후 이월된 카운트로 리마인더가 바로 뜨지 않게 한다.
29
29
  rm -f "$dir/$key.prompts" 2>/dev/null
30
+ # 마일스톤 관측 지점도 함께 버린다 — 새 epoch 의 transcript 는 처음부터 다시 본다.
31
+ rm -f "$dir/$key.ckptpos" 2>/dev/null
30
32
  return 0
31
33
  }
@@ -45,6 +45,9 @@ cat | ROOKIE_GATE_DIR="$GATE_DIR" ROOKIE_PI_DIR="$PI_DIR" ROOKIE_DROP_LOG="$DROP
45
45
  const SKILL_MSG="⚠️ 이 세션에서 아직 rookie Skill 을 로드하지 않았습니다. 다른 작업·응답 전에 먼저 rookie Skill 을 호출하세요 — 회상(recall)·미link 등록 제안·기억 저장 절차가 그 안에 있습니다. (이미 호출했다면 이 안내는 사라집니다.)";
46
46
  const RECALL_MSG="🧠 이 프롬프트에 과거 맥락·방법 회상 신호가 있습니다. grep·파일 열람·자기판단·두목 되묻기 이전에 GET /api/rookie/recall 을 먼저 호출하세요 (brand.ts 회상-순서 룰).";
47
47
  const CKPT_MSG="📌 이 세션이 길어지고 있습니다. 직전 checkpoint 이후 마일스톤(커밋·배포·설계 수렴·단계 전환)이 지났다면 checkpoint 진입카드를 저장하세요 — 지나지 않았다면 무시해도 됩니다.";
48
+ // 2026-09-22 — 프롬프트 20개를 못 채우고 끝난 세션이 카드를 한 장도 못 남겼다(그날 네 세션, 최대 8 프롬프트).
49
+ // 커밋·배포는 짧은 대화 안에서도 일어난다. 길이가 아니라 사건에 거는 쪽이 본래 규칙에 맞다.
50
+ const ckptEventMsg=(ev)=>"📌 방금 `"+ev+"` 가 지나갔습니다. 여기까지를 checkpoint 진입카드로 저장하세요 — 지금 세션이 끊겨도 이 지점까지는 남습니다. (이미 저장했다면 무시하세요.)";
48
51
  // 미로드 + 회상신호 전용(spec 2026-07-22 D1). 두 메시지를 잇기만 하면 "먼저 Skill" vs "먼저 recall" 이
49
52
  // 충돌하고, recall 절차 자체가 SKILL.md 안에 있어 미로드 세션은 그 절차를 아직 못 읽었다 — 순서를 못박는다.
50
53
  const COMBO_MSG="🧠 이 프롬프트에 과거 맥락·방법 회상 신호가 있는데, 이 세션은 아직 rookie Skill 을 로드하지 않았습니다. 순서대로 하세요 — ① rookie Skill 을 먼저 호출하고 ② 그 안의 회상 절차로 이번 프롬프트에 대해 GET /api/rookie/recall 을 최소 1회 호출한 뒤 ③ 답하세요. grep·파일 열람·git log 추론·두목 되묻기는 그 다음입니다.";
@@ -164,6 +167,37 @@ cat | ROOKIE_GATE_DIR="$GATE_DIR" ROOKIE_PI_DIR="$PI_DIR" ROOKIE_DROP_LOG="$DROP
164
167
  fs.writeFileSync(pf,String(n),{mode:0o600});
165
168
  }catch{ ckptDue=false; } // 카운터 실패 → 조용히 skip (fail-soft)
166
169
  }
170
+ // 마일스톤 checkpoint (2026-09-22) — 커밋·배포·마이그레이션이 지나간 직후 첫 프롬프트에 건다.
171
+ // 카운터(프롬프트 수)는 긴 세션용 안전망이고, 짧은 세션은 이쪽이 잡는다.
172
+ // .ckptpos = 마지막으로 살펴본 transcript byte. 없으면 지금 크기로 시작해 과거 커밋을 다시 울리지 않는다.
173
+ const MILESTONE=/git\s+commit|git\s+push|cf:deploy|wrangler\s+deploy|npm\s+publish|supabase\s+db\s+push|eas\s+(build|submit)/;
174
+ let ckptEvent=null;
175
+ if(key && tp && skillLoaded && !recallSignal && !ckptDue){
176
+ try{
177
+ const cf=path.join(gateDir,key+".ckptpos");
178
+ const size=fs.statSync(tp).size;
179
+ let from=null;
180
+ try{ const v=parseInt(String(fs.readFileSync(cf,"utf8")).trim(),10); if(Number.isFinite(v)&&v>=0) from=v; }catch{}
181
+ if(from===null){ from=size; } // 첫 관측 — 이 지점부터 본다
182
+ else if(size>from){
183
+ const chunk=fs.readFileSync(tp).slice(from).toString("utf8");
184
+ for(const line of chunk.split("\n")){
185
+ const t=line.trim(); if(!t) continue;
186
+ let j; try{ j=JSON.parse(t); }catch{ continue; }
187
+ const m=(j&&j.message)||j; const c=m&&m.content; const blocks=Array.isArray(c)?c:[];
188
+ for(const b of blocks){
189
+ if(b&&b.type==="tool_use"&&b.name==="Bash"&&b.input&&typeof b.input.command==="string"){
190
+ const hit=b.input.command.match(MILESTONE);
191
+ if(hit){ ckptEvent=hit[0]; break; }
192
+ }
193
+ }
194
+ if(ckptEvent) break;
195
+ }
196
+ }
197
+ fs.mkdirSync(gateDir,{recursive:true,mode:0o700});
198
+ fs.writeFileSync(cf,String(size),{mode:0o600});
199
+ }catch{ ckptEvent=null; } // 실패 → 조용히 skip (fail-soft)
200
+ }
167
201
  // spec 2026-07-22 D1 — 미로드 세션은 SKILL.md 회상 규범이 컨텍스트에 없다. 여기서 recall 지시까지
168
202
  // 꺼버리면 회상이 가장 필요한 상태가 무방비가 된다(2026-07-22 catsper 사고). 한 turn 한 메시지는 유지.
169
203
  // spec 2026-09-02 — 인격 블록은 기존 분기를 **가로채지 않고 앞에 붙는다**.
@@ -172,6 +206,7 @@ cat | ROOKIE_GATE_DIR="$GATE_DIR" ROOKIE_PI_DIR="$PI_DIR" ROOKIE_DROP_LOG="$DROP
172
206
  if(!skillLoaded && recallSignal) base=COMBO_MSG;
173
207
  else if(!skillLoaded) base=SKILL_MSG; // 미로드 + 무신호 → skill 리마인더
174
208
  else if(recallSignal) base=RECALL_MSG; // 로드됨 + 과거-방법 신호 → recall 리마인더
209
+ else if(ckptEvent) base=ckptEventMsg(ckptEvent); // 로드됨 + 무신호 + 마일스톤 통과 → 사건 checkpoint
175
210
  else if(ckptDue) base=CKPT_MSG; // 로드됨 + 무신호 + 임계 도달 → checkpoint 리마인더
176
211
  let taken=null;
177
212
  try{ taken=takePendingPersona(fs,path,key); }catch{ taken=null; }
package/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "cli_version": "0.4.34",
2
+ "cli_version": "0.4.35",
3
3
  "skill_version": "1.40.1"
4
4
  }