Two native-inference hardening features from boocode_code_review_v2 §1 #12. MistakeTracker: new pure mistake-tracker.ts tracks consecutive heterogeneous tool failures (kinds surfaced per tool from tool-phase.ts). On 3 in a row the turn loop soft-nudges (model-facing recovery guidance + mistake_recovery sentinel + reset), then escalates to stopping the turn (cap-hit-style, Continue affordance) on a re-trip. Complements doom-loop (identical repeats) + cap-hit. File-provenance ledger: compaction.ts derives a deterministic ## Files Read list from the head messages' read-tool calls and injects it into the rolling-summary prompt so provenance survives compaction (no new table; read-only). mistake_recovery sentinel: MessageMetadata arm (server + web) + MessageBubble render branch. Built by 2 parallel agents. Server 545 tests passing (23 new); build + web tsc clean. Native-inference only. Builds on v2.7.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
// v1.12.4: re-export shim. Outside callers (apps/server/src/index.ts and the
|
|
// vitest inference tests) import from './services/inference/index.js'. The
|
|
// directory is now the public surface; turn.ts holds runAssistantTurn /
|
|
// runInference / createInferenceRunner while the other inference/*.ts files
|
|
// stay implementation-private.
|
|
|
|
export {
|
|
createInferenceRunner,
|
|
MAX_STEPS,
|
|
runAssistantTurn,
|
|
runInference,
|
|
} from './turn.js';
|
|
export type {
|
|
FramePublisher,
|
|
InferenceContext,
|
|
InferenceFrame,
|
|
StreamResult,
|
|
TurnArgs,
|
|
} from './turn.js';
|
|
export type { ToolPhaseResult } from './tool-phase.js';
|
|
export { detectDoomLoop, DOOM_LOOP_THRESHOLD } from './sentinels.js';
|
|
export {
|
|
detectMistakePattern,
|
|
freshMistakeState,
|
|
recordStep,
|
|
MISTAKE_THRESHOLD,
|
|
MISTAKE_RECOVERY_NOTE,
|
|
} from './mistake-tracker.js';
|
|
export type { FailureKind, MistakeState } from './mistake-tracker.js';
|
|
export { buildMessagesPayload } from './payload.js';
|
|
export { generateToolUseSummary } from './tool-summaries.js';
|
|
export type { ToolInfo } from './tool-summaries.js';
|