JsonlReporter: #path field is not declared readonly, inconsistent with the rest of the codebase

Open Beginner friendly
#73 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
tooling

Research direction

Start with src/reporters/jsonl.ts and compare its #path declaration with the readonly fields in the referenced agent and prompt-generator files. Check src/reporters/yaml.ts for the identical declaration. Done means both reporter path fields follow the repository convention; run the existing test suite afterward.

Written by the indexing model from the issue text.

Description

bug S4

Observed behavior

In src/reporters/jsonl.ts the private path field is declared as a mutable string:

export class JsonlReporter implements Reporter {
  // ...
  #path: string;

  constructor(path: string) {
    this.#path = path;
  }
  // ...
}

Nothing inside the class ever reassigns #path, but the declaration leaves it mutable.

Expected behavior

Per AGENTS.md:

Use readonly and ReadonlyArray<...> unless the data is designed to be mutable

Every other class in src/ that stores an immutable private field already follows the convention, for example ClaudeSDKAgent in src/agents/claude-sdk.ts:

readonly #config: ClaudeSDKAgentConfig;

The same pattern is used in src/agents/openai-sdk.ts, src/agents/codex-cli.ts, and every src/prompt-generators/*.ts file. JsonlReporter should match.

Minimal reproduction

$ rg "^\s+#\w+: \w+;" src/reporters/
src/reporters/jsonl.ts:24:  #path: string;
src/reporters/yaml.ts:24:  #path: string;

vs. every other class in src/:

$ rg "^\s+readonly #\w+:" src/ -l | head
src/agents/claude-sdk.ts
src/agents/openai-sdk.ts
src/agents/codex-cli.ts
src/prompt-generators/github.ts
...

Fix

Add readonly to the field declarations in both reporters:

-  #path: string;
+  readonly #path: string;

(The YamlReporter in src/reporters/yaml.ts has the identical issue and should be fixed in the same change.)

Dominant language
TypeScript
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from joewalker/loop-the-loop

All issues in joewalker/loop-the-loop

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.