/** * Forgen v1 — Profile Store * * Profile CRUD. 4축 + facet + trust preferences. * Authoritative schema: docs/plans/2026-04-03-forgen-data-model-storage-spec.md §2 */ import type { Profile, QualityPack, AutonomyPack, JudgmentPack, CommunicationPack, TrustPolicy } from './types.js'; import type { HostId } from '../core/trust-layer-intent.js'; export declare function createProfile(userId: string, qualityPack: QualityPack, autonomyPack: AutonomyPack, trustPolicy: TrustPolicy, trustSource: Profile['trust_preferences']['source'], judgmentPack?: JudgmentPack, communicationPack?: CommunicationPack): Profile; export declare function loadProfile(): Profile | null; export declare function loadProfileRaw(): unknown; export declare function saveProfile(profile: Profile): void; /** * File existence probe. NOTE: this returns `true` even if the on-disk * file is legacy/invalid — callers that need "valid v1 profile present" * should combine this with `loadProfile() !== null`. The raw existence * check is kept for bootstrap logic that explicitly differentiates * "file exists but legacy" from "no file at all" (e.g. to decide * whether to run `runLegacyCutover`). */ export declare function profileExists(): boolean; /** * profile.json 이 존재하지만 parse 실패 / v1 shape 위반인 경우, 사용자가 * 다음 onboarding 으로 매끄럽게 복구되도록 corrupt 파일을 timestamp 백업 * 으로 옆에 치워둔다. 백업 경로를 반환. * * v0.4.8 — bootstrapV1Session 의 loadProfile()=null early-return 보강. * 이전엔 needsOnboarding=true 만 반환했고 corrupt 파일이 그대로 남아 * 다음 실행 때도 동일 분기로 빠지면서 사용자가 정체 원인을 모른 채 * onboarding 안내만 반복 받는 패턴이었음. */ export declare function backupCorruptProfile(): string | null; export declare function isV1Profile(data: unknown): data is Profile; /** * D2 fix (2026-04-27): explicit_correction 누적 시 해당 축의 confidence 를 점진 * 상승시킨다. facet 값은 건드리지 않음 (회귀 위험 최소화) — confidence 가 score * 집계 공식 (confidence × facet_avg + (1-confidence) × neutral_anchor) 의 가중치 * 라서, 사용자가 명시 교정을 누적한 축은 score 가 facet 평균을 더 강하게 반영. * * 자기증거: autonomy explicit_correction 6건이 score 를 못 움직였음 (facet 값 * 갱신 경로가 mismatch-detector 의 strong rule 승급에만 의존). 본 함수가 직접 * 경로를 추가. * * delta 기본 0.02 — 6건 누적 시 +0.12 → 0.45 → 0.57 (의미 있는 변동 가시화). * clamp 0~1. */ export declare function bumpAxisConfidence(axis: 'quality_safety' | 'autonomy' | 'judgment_philosophy' | 'communication_style', delta?: number): boolean; /** * feat/codex-support — default_host 영속화 헬퍼. * * fgx / forgen 무인자 실행 시 어느 host 를 spawn 할지 결정. 'ask' 면 매번 묻기. * 미설정(undefined) 은 legacy 사용자 호환 — 'claude' 로 resolve. */ export type DefaultHost = HostId | 'ask'; export declare function getDefaultHost(): DefaultHost | undefined; export declare function setDefaultHost(host: DefaultHost): boolean; /** * Resolve effective host for runtime use. * 우선순위: explicit override > profile.default_host > 'claude' fallback. * 'ask' 는 caller 가 별도 처리 (interactive prompt). */ export declare function resolveDefaultHost(override?: HostId): DefaultHost;