[bug] SessionHarvester counts prompts from headless runs (LLM judges, reviewers) as…
メンテナーはふだん 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.
- Corrections (
:347):isHumanTurn()rejects tool results,isMetaand 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. --mine(:424): no human check at all. Everyuserline 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);--minereturns 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
danielmiessler/LifeOS のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
danielmiessler/LifeOS#3028 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
danielmiessler/LifeOS#3023 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
danielmiessler/LifeOS#3022 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
danielmiessler/LifeOS#3020 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 78/100
danielmiessler/LifeOS#3018 ·
メンテナーはふだん 5 日以内に返信
danielmiessler/LifeOS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
iOS: last line of a long UITextView text is sometimes not drawn (frame a fraction of a point short)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
Koenkk/zigbee2mqtt#33855 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
yavorsky/unbuilt.app#65 ·