harness: auto-skill general + memory spesifik + lossless compaction
ci / check (macos-latest) (push) Canceled after 0s
ci / check (ubuntu-latest) (push) Canceled after 0s
ci / check (windows-latest) (push) Canceled after 0s

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:
asepharyana
2026-09-08 22:52:31 +07:00
parent 7db69f19da
commit 4848db308a
7 changed files with 203 additions and 103 deletions
+3 -4
View File
@@ -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];
}