[bug] SessionHarvester counts prompts from headless runs (LLM judges, reviewers) as…

オープン 初心者向け
#3,017 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, typescript
領域
cli

調査の方向性

LIFEOS/TOOLS/SessionHarvester.ts、特に isHumanTurn()、347行目付近の修正ロジック、424行目付近の --mine ロジックから始めます。提供された bun コマンドで再現し、その後、promptSource と entrypoint を認識し、<command-args> 内のスラッシュコマンド引数と promptSource を持たない古いトランスクリプトを保持する、共通の人間プロンプト判定を適用します。完了の基準は、入力された修正がカウントされ、SDKジャッジのプロンプトが修正および --mine から除外され、既存のアーカイブ用フォールバックが維持されることです。

索引モデルが issue の本文から書いたものです。

説明

What happened

SessionHarvester counts prompts from headless runs (LLM judges, reviewers) as the principal's own corrections and preferences

Summary

LIFEOS/TOOLS/SessionHarvester.ts reads every .jsonl in the projects directory, headless runs included. Claude Code marks each user line with who wrote it: promptSource is typed (or queued, suggestion_accepted) when a person typed it and sdk when a tool did, and entrypoint is sdk-cli for a headless run. The harvester does not read either field.

  1. Corrections (:347): isHumanTurn() rejects tool results, isMeta and injected blocks, but a prompt written by a tool for a headless run passes. A judge prompt that opens with "Actually," becomes a correction from the principal.
  2. --mine (:424): no human check at all. Every user line of 20 or more characters is mined, headless prompts included.

Repro on a clean v8.761.0 checkout, from LifeOS/install, with two one-line sessions in a temp dir:

D=$(mktemp -d); bun -e '
const u=(t,x)=>JSON.stringify({type:"user",timestamp:"2026-11-28T10:00:00Z",message:{role:"user",content:t},...x});
require("fs").writeFileSync(process.argv[1]+"/aaaaaaaa.jsonl", u("Actually, use bun for this script, not npm, we never use npm here.",{promptSource:"typed",entrypoint:"cli"})+"\n");
require("fs").writeFileSync(process.argv[1]+"/bbbbbbbb.jsonl", u("Actually, grade the draft below against the rubric and return a score from 1 to 5. Never use a lenient score, always use the strict rubric, and you must never skip a criterion.",{promptSource:"sdk",entrypoint:"sdk-cli"})+"\n");' "$D"
bun LIFEOS/TOOLS/SessionHarvester.ts --projects-dir "$D" --all --dry-run
bun LIFEOS/TOOLS/SessionHarvester.ts --projects-dir "$D" --all --dry-run --mine
  • Expected: one correction (session aaaaaaaa), and no mined candidate from the judge run.
  • Actual: two corrections, one of them the judge prompt (correction_bbbbbbbb); --mine returns the judge prompt as a [preference] at 40%.

On a real install this is most of the output: headless runs (memory review, Assay judges, sub-agent prompts) produce many transcripts, and their prompts are full of "always", "never" and "actually". On my install in September, keeping only lines a person typed cut false corrections from 173 to 17 over the same set of sessions.

Suggested fix: count a user line as the principal's words only when entrypoint is not sdk-cli and promptSource is typed, queued or suggestion_accepted, and use the same check in --mine. One case needs care: arguments typed after a slash command are recorded with no promptSource, inside <command-args>, so the check should read those arguments and not drop the line. If promptSource is absent from a whole transcript (an older Claude Code), falling back to today's isHumanTurn() keeps old archives working.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

主要言語
TypeScript
スター
20k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

danielmiessler/LifeOS のほかの issue

danielmiessler/LifeOS の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。