Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

YamlReporter silently drops prompt text, so the YAML report cannot be paired with the prompt it answered

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript
領域
tooling

調査の方向性

src/reporters/yaml.ts から始めて YamlReporter.append を調べ、次にそのエントリーフィールドを JSONL reporter と比較します。コメントアウトされた prompt のチェックを含め、yaml.test.ts の関連するアサーションを読みます。reporter の動作が意図的に一貫しており、選択した prompt の処理動作をテストがカバーしていれば完了です。

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

説明

bug S3

Observed behavior

YamlReporter.append writes only id, status, and either output (plus optional structuredOutput) or reason for each entry. The block that would serialise prompt.prompt is commented out:

// src/reporters/yaml.ts
lines.push(`id: "${prompt.id}"`);
lines.push(`status: ${result.status}`);
// lines.push('prompt: |');
// for (const line of formatBlockScalar(prompt.prompt).split('\n')) {
//   lines.push(line === '' ? '' : `  ${line}`);
// }

The matching assertions in yaml.test.ts are commented out alongside it, so the gap is not caught by tests.

The JsonlReporter does serialise the prompt (JSON.stringify({ ...prompt, ...result })), so the two reporters disagree about what a "report entry" contains: a user who switches the reporter field from 'jsonl-report' to 'yaml-report' (or the default) silently loses the prompt column.

Expected behavior

Both built-in reporters should record the same data per entry, and the documented role of a reporter ("persists the results of running prompts through an agent" - src/reporters.ts) implies that the prompt is part of the entry. Reviewing a finished run typically requires reading the prompt that produced each output, especially for prompt-generation tasks that template per-item content into the prompt string.

If dropping the prompt text from the YAML report is intentional (for example, to keep the report readable when prompts are very large), the choice should be documented and ideally configurable per reporter, rather than encoded as commented-out dead code that diverges from the JSONL reporter.

Minimal reproduction

import { JsonlReporter } from 'loop-the-loop/reporters/jsonl';
import { YamlReporter } from 'loop-the-loop/reporters/yaml';
import { mkdtemp, readFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';

const dir = await mkdtemp(join(tmpdir(), 'reporter-diff-'));
const yaml = await YamlReporter.create({ outputDir: dir, jobName: 'y' });
const jsonl = await JsonlReporter.create({ outputDir: dir, jobName: 'j' });

const entry = [
  { id: 'a', prompt: 'review this file' },
  { status: 'success', output: 'looks fine' },
] as const;
await yaml.append(...entry);
await jsonl.append(...entry);

console.log(await readFile(join(dir, 'y-report.yaml'), 'utf-8'));
// ---
// id: "a"
// status: success
// output: |
//   looks fine

console.log(await readFile(join(dir, 'j-report.jsonl'), 'utf-8'));
// {"id":"a","prompt":"review this file","status":"success","output":"looks fine"}

Suggested fix

Either:

  1. Uncomment the prompt block in YamlReporter.append (and the matching assertions in yaml.test.ts) so both reporters record the prompt text, or
  2. Strip the prompt from the JSONL reporter as well, and document that Reporter entries do not include the prompt.

Option 1 keeps parity with the JSONL reporter and matches what most users will expect from an audit trail.

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

環境構築

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

はじめの一歩

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

joewalker/loop-the-loop のほかの issue

joewalker/loop-the-loop の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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