feat: [ENG-2326] session-end banner for accepted harness refinements#536
feat: [ENG-2326] session-end banner for accepted harness refinements#536danhdoan merged 2 commits intoproj/autoharness-v2from
Conversation
|
Claude finished @RyanNg1403's task in 2m 35s —— View job PR Review: feat: [ENG-2326] session-end banner for accepted harness refinementsTodo List
SummaryScore: 4 / 5 Clean, well-scoped feature. The design is sound — discriminated union extension to carry heuristic values, a lean listener class with idempotent What's good
Issues
Design note (not a bug, just worth knowing)Because The moderate issue (constructor arity) should be fixed before merge. The rest are polish. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4bd911b65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @RyanNg1403's task in 1m 54s —— View job Todo List
PR Review: feat: [ENG-2326] session-end banner for accepted harness refinementsScore: 4.5 / 5 The refactor commit ( What changed vs. the first reviewThe previous review flagged 4 items. Here's their status:
What's good
Remaining observationsNitpick — The callback receives a string with Consider either:
Nitpick — The type Design note (acknowledged, not actionable for this PR) The Codex P2 concern about cross-session contamination is real but accepted by design: since SummaryThe main blocker from the first review is fixed. The remaining items are polish-level. This is ready to merge once the team confirms the cross-session banner behavior is acceptable for the initial rollout (likely fine per the scoping note in the PR). |
Summary
HarnessBannerListenerclass subscribes toharness:refinement-completedon the agent event bus, buffers accepted refinements during a session, and prints a one-line banner to stderr on session end.SessionManagerwires the listener per session (create on session start, end on session cleanup).harness:refinement-completedevent withfromHeuristic/toHeuristicfields so the banner can display H values without store access.Type of change
Scope (select all touched areas)
Linked issues
Root cause (bug fixes only, otherwise write
N/A)N/A
Test plan
test/unit/agent/session/harness-banner-listener.test.tsv{from} → v{to} (H: {fromH} → {toH})onSessionEnd— second call does not re-printUser-visible changes
New stderr line after sessions where a harness refinement was accepted:
Only appears when: harness enabled + TTY + at least one accepted refinement during the session. Written to stderr so it doesn't pollute stdout/JSON output.
Evidence
Full suite: 7230 passing, 0 failing. Typecheck, lint, build all clean.
Acceptance criteria evidence
HarnessBannerListenerclass + subscription wire-upsrc/agent/infra/session/harness-banner-listener.ts:26SessionManagercallsonSessionEnd()in cleanup pathsession-manager.ts:413npm run typecheck/lint/test/buildall cleanImplementation decisions
SessionEventBusAgentEventBusharness:refinement-completedexists only onAgentEventMap, notSessionEventMapfromHeuristic/toHeuristicservice-initializer.tsSessionManagerOptionsSessionManagerOptions.bannerOverridesis the correct injection pointChecklist
npm test)npm run lint)npm run typecheck)npm run build)proj/autoharness-v2Risks and mitigations
harness:refinement-completedevent adds 2 required fields to the accepted variant — could break consumers that construct the event manually.harness-synthesizer.ts:215). All existing tests pass. The change is backward-compatible for consumers that only read the event.onSessionEndis called in all cleanup paths (endSession,deleteSession,dispose), ensuring unsubscription. No leak path.