harness: auto-skill general + memory spesifik + lossless compaction
Memory balik spesifik per-project (keep paths, THIS repo), general jadi skill auto-create ke ~/.shiro-neko/skills/auto-*.md. Compaction lossless dengan head preserved + droppedSpan normalized + retained note. Learner throttled tiap 3 turn / delta 8, pakai subagentModel (learnerModel) dan ceiling guard, hash dedup, JSON fallback, TTL tiap 6 turn.
This commit is contained in:
+3
-4
@@ -246,10 +246,9 @@ function headOf(messages: ModelMessage[]): ModelMessage[] {
|
||||
function withHeadPreserved(all: ModelMessage[], pruned: ModelMessage[]): ModelMessage[] {
|
||||
const head = headOf(all);
|
||||
if (head.length === 0) return pruned;
|
||||
// If head already in pruned (by identity of content's first 80 chars), leave it.
|
||||
const headText = JSON.stringify(head[0]!.content).slice(0, 80);
|
||||
if (pruned.some((m) => JSON.stringify(m.content).slice(0, 80) === headText)) return pruned;
|
||||
// Prepend head; dedupe if head was partially kept.
|
||||
// identity + full content equality (not 80-char slice which collides)
|
||||
const headNorm = JSON.stringify(head[0]!.content);
|
||||
if (pruned.some((m) => m === head[0]! || JSON.stringify(m.content) === headNorm)) return pruned;
|
||||
return [...head, ...pruned];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user