You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 14, 2026. It is now read-only.
Document how to add log emissions when porting code from pnpm, so future
ports — especially AI-generated ones — don't silently skip events and
recreate the coverage gap we're fixing.
Scope
Add a "Reporting" section to AGENTS.md (or a subsection in CODE_STYLE_GUIDE.md, whichever fits the surrounding structure better)
covering:
Finding upstream emissions. Patterns to grep for in pnpm/pnpm: globalLogger.<channel>.<level>(...), logger.<level>({ name: 'pnpm:<channel>', ... }), and direct streamParser.write(...) calls.
Channel mapping. How upstream name: 'pnpm:<channel>' maps to a LogEvent variant in crates/reporter. Include the canonical list
and where to look it up.
Where to put the emit calls. Match the upstream call site —
typically immediately before or after the side effect the event
describes. Keep ordering consistent with pnpm so the rendered output
stays identical.
What not to do. Don't reformat upstream messages, don't invent new
channels, don't emit at higher granularity than pnpm (the JS reporter
expects pnpm's event cadence).
One worked example: pick a small ported pnpm function that emits one or
two log events, show the before/after Rust diff, link the upstream
permalink (pinned SHA per CLAUDE.md), and reference the test fake.
Add a pointer from the cardinal-rule section of AGENTS.md: matching
pnpm's behavior includes its log emissions — see the new section.
Acceptance criteria
A reviewer can read the new section and answer, given an upstream pnpm
function: which log events does it emit, where do those map in pacquet,
where do the emit calls go, and how do I test them.
Summary
Document how to add log emissions when porting code from pnpm, so future
ports — especially AI-generated ones — don't silently skip events and
recreate the coverage gap we're fixing.
Scope
AGENTS.md(or a subsection inCODE_STYLE_GUIDE.md, whichever fits the surrounding structure better)covering:
pnpm/pnpm:globalLogger.<channel>.<level>(...),logger.<level>({ name: 'pnpm:<channel>', ... }), and directstreamParser.write(...)calls.name: 'pnpm:<channel>'maps to aLogEventvariant incrates/reporter. Include the canonical listand where to look it up.
that emits takes
R: Reporterand callsR::emit(...). Productioncallers turbofish at the entry point. Same shape as the DI pattern in
Refactor and document the dependency injection pattern for tests #339.
typically immediately before or after the side effect the event
describes. Keep ordering consistent with pnpm so the rendered output
stays identical.
#[test]fn perRefactor and document the dependency injection pattern for tests #339, recording into a
static Mutex<Vec<LogEvent>>declared in thesame body; assert against the captured sequence.
channels, don't emit at higher granularity than pnpm (the JS reporter
expects pnpm's event cadence).
two log events, show the before/after Rust diff, link the upstream
permalink (pinned SHA per CLAUDE.md), and reference the test fake.
AGENTS.md: matchingpnpm's behavior includes its log emissions — see the new section.
Acceptance criteria
function: which log events does it emit, where do those map in pacquet,
where do the emit calls go, and how do I test them.
feat(reporter): implement the reporting engine (NDJSON + Reporter trait) #345.
part of what "match pnpm" entails.
Depends on
and call sites instead of pseudocode).
Parent
Design: #344.