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

Đang mở Phù hợp với người mới
#3,017 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với LIFEOS/TOOLS/SessionHarvester.ts, đặc biệt là isHumanTurn(), logic sửa lỗi gần dòng 347 và logic --mine gần dòng 424. Tái hiện bằng các lệnh bun được cung cấp, sau đó áp dụng một kiểm tra chung cho prompt của con người nhận diện promptSource và entrypoint, đồng thời giữ nguyên các đối số lệnh slash trong <command-args> và các bản ghi cũ không có promptSource. Hoàn thành nghĩa là bản sửa được nhập sẽ được tính, prompt của judge SDK bị loại khỏi các bản sửa và --mine, cơ chế dự phòng lưu trữ hiện có vẫn được giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
20k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.