feat: v2.2.173-193 — 4인 팀 운영 슬래시 13개 + ASTRA 검증 엔진 6종

4인 팀 운영 슬래시 (v2.2.173~189):
- 일과 리듬: /morning, /evening, /weekly, /standup
- 트래커 (event-sourced .astra/*.jsonl): /runway, /customers, /hire
- 작업·결정: /task, /blocked, /onesie, /decisions
- 외부 출력: /draft, /feedback
- 분석: /cohort (MoM 추세)

ASTRA 추론·검색 엔진 (v2.2.183~192):
- v2.2.183 Conflict Surface — scoring.conflictSeverity 를 [CONFLICT WARNINGS] 블록으로
  서피스 + 교차-문서 발산(Jaccard) 감지
- v2.2.184 Chain-of-Verification — [VERIFICATION CHECKLIST] 답변 작성 전 그라운딩 자기 점검
  (instructional, strictMode 옵션)
- v2.2.185 Actionability Scoring — 최근 슬래시 명령 + 열린 파일 신호로 검색 결과 재가중
- v2.2.186 Temporal Markers + Distillation Loop — LongTerm/Episodic 만료 필터 +
  30일+ stale episode → LongTerm 'episode-digest' 승급 (수동 /memory distill + 세션 종료 자동)
- v2.2.187 Hierarchical Context Window + LLM Semantic Re-rank — 3-level 추상도 매칭
  + 토큰 예산 통과 후 LLM 1회로 의도-부합 재정렬 (opt-in)
- v2.2.190 Intent Clarification + Citation Trace — 모호 차원 감지 시 역질문 우선
  + 답변 끝 사용 출처 한 줄 정리
- v2.2.191 Post-hoc Self-Check — 답변 완료 후 별도 LLM 호출 1회로 답함/그라운딩/모순 평가,
  footer 한 줄로 표시 (opt-in, semantic re-rank 와 같은 안전 fallback 패턴)
- v2.2.192 Terminology Dictionary — .astra/glossary.md 사용자 편집 파일 + Term Check
  지침 통합 + /glossary init/path/reload
- v2.2.193 /help — 카테고리별 명령 목록 + 6종 verification 블록 현재 on/off

신규 모듈:
- src/retrieval/{conflictBlock,coveBlock,actionabilityScoring,hierarchicalLevel,
  semanticRerank,intentClarification,citationTrace,terminologyBlock}.ts
- src/memory/distillation.ts + types.ts 에 expiresAt/promoted/episode-digest 추가
- src/agent/postHocSelfCheck.ts
- src/features/{customers,feedback,hire,runway}/*.ts (event-sourced stores)

ASTRA 검증 5종 자동 주입 (buildAstraModeSystemPrompt, casual 모드 제외):
[INTENT CLARIFICATION GUIDANCE] (답변 시작 전) → [TERMINOLOGY DICTIONARY] +
[CONFLICT WARNINGS] + [VERIFICATION CHECKLIST] (작성 중) → [CITATION TRACE] (끝)
+ 6번째: Post-hoc Self-Check footer (답변 완료 후, opt-in)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 16:05:30 +09:00
parent f3439ddad5
commit 990ea0ae5f
46 changed files with 7172 additions and 136 deletions
+150
View File
@@ -0,0 +1,150 @@
/**
* 채용 파이프라인 트래커.
*
* 4인 → 5인 이상 확장 시점에 후보자가 여러 명, 여러 역할(개발/기획/디자인) 로
* 들어오기 시작 — 노션·스프레드시트·이메일에 흩어진 정보를 한 명령으로 본다.
*
* Event-sourced (customersStore 와 동일 패턴) — append-only 이벤트 로그를
* 재생해 후보자별 현재 단계 + 노트 누적 도출.
*
* 위치: `<workspace>/.astra/hire.jsonl`. 사람 직접 편집 가능.
* 민감 정보(이름, 연봉, 거절 사유) 포함 — 로컬 only.
*/
import * as fs from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
const STORE_REL_PATH = '.astra/hire.jsonl';
export type HireEventType = 'add' | 'stage' | 'note' | 'offer' | 'reject' | 'decline' | 'hire';
/**
* 기본 파이프라인 단계. 사용자가 다른 단계명 지정 가능 — 그냥 문자열로 저장.
* 표시 순서·정렬용으로 알려진 단계는 가중치 부여.
*/
export const KNOWN_STAGES = ['inbox', 'screened', 'interview', 'final', 'offer', 'accepted', 'hired', 'rejected', 'declined'] as const;
export type KnownStage = typeof KNOWN_STAGES[number];
export interface HireEvent {
id: string;
timestamp: string;
candidateId: string;
candidateName: string;
role: string;
type: HireEventType;
/** stage 전환 시 새 단계. add 시 시작 단계 (기본 'inbox'). */
stage?: string;
/** offer 의 연봉 — KRW. */
salary?: number;
/** 입사 예정일 / 거절·이탈 사유. */
memo?: string;
}
export interface CandidateState {
candidateId: string;
candidateName: string;
role: string;
stage: string;
salary?: number;
addedAt: string;
lastEventAt: string;
eventCount: number;
notes: { timestamp: string; type: HireEventType; memo: string }[];
}
export function getHireFilePath(): string | null {
const folders = vscode.workspace.workspaceFolders;
if (!folders || folders.length === 0) return null;
return path.join(folders[0].uri.fsPath, STORE_REL_PATH);
}
export function candidateIdFromName(name: string): string {
return name.toLowerCase().trim().replace(/\s+/g, '-').replace(/[^\w가-힣-]/g, '');
}
export function readHireEvents(): HireEvent[] {
const filePath = getHireFilePath();
if (!filePath || !fs.existsSync(filePath)) return [];
const out: HireEvent[] = [];
let content = '';
try { content = fs.readFileSync(filePath, 'utf-8'); } catch { return []; }
for (const line of content.split('\n')) {
const trimmed = line.trim();
if (!trimmed) continue;
try {
const e = JSON.parse(trimmed);
if (e && typeof e.id === 'string' && typeof e.candidateId === 'string' && typeof e.type === 'string') {
out.push(e as HireEvent);
}
} catch { /* skip malformed */ }
}
return out;
}
export function appendHireEvent(event: HireEvent): { ok: true; filePath: string } | { ok: false; error: string } {
const filePath = getHireFilePath();
if (!filePath) return { ok: false, error: '워크스페이스 폴더가 없어 저장 불가.' };
try {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
fs.appendFileSync(filePath, JSON.stringify(event) + '\n', 'utf-8');
return { ok: true, filePath };
} catch (e: any) {
return { ok: false, error: e?.message || String(e) };
}
}
export function computeCandidateStates(): Map<string, CandidateState> {
const events = readHireEvents().slice().sort((a, b) => (a.timestamp || '').localeCompare(b.timestamp || ''));
const states = new Map<string, CandidateState>();
for (const e of events) {
let s = states.get(e.candidateId);
if (!s) {
s = {
candidateId: e.candidateId,
candidateName: e.candidateName,
role: e.role || '',
stage: e.stage || 'inbox',
addedAt: e.timestamp,
lastEventAt: e.timestamp,
eventCount: 0,
notes: [],
};
states.set(e.candidateId, s);
}
s.candidateName = e.candidateName || s.candidateName;
s.role = e.role || s.role;
s.lastEventAt = e.timestamp;
s.eventCount += 1;
switch (e.type) {
case 'add':
s.stage = e.stage || s.stage || 'inbox';
break;
case 'stage':
if (e.stage) s.stage = e.stage;
break;
case 'offer':
s.stage = 'offer';
if (e.salary !== undefined) s.salary = e.salary;
if (e.memo) s.notes.push({ timestamp: e.timestamp, type: 'offer', memo: e.memo });
break;
case 'hire':
s.stage = 'hired';
if (e.memo) s.notes.push({ timestamp: e.timestamp, type: 'hire', memo: e.memo });
break;
case 'reject':
s.stage = 'rejected';
if (e.memo) s.notes.push({ timestamp: e.timestamp, type: 'reject', memo: e.memo });
break;
case 'decline':
s.stage = 'declined';
if (e.memo) s.notes.push({ timestamp: e.timestamp, type: 'decline', memo: e.memo });
break;
case 'note':
if (e.memo) s.notes.push({ timestamp: e.timestamp, type: 'note', memo: e.memo });
break;
}
}
return states;
}