Skip to content

Two ready backlog fixes: Claude MessageDisplay mapping + obs worker lcov#513

Merged
NikashPrakash merged 2 commits into
masterfrom
fix/backlog-ready-message-display-and-obs-lcov
Jul 23, 2026
Merged

Two ready backlog fixes: Claude MessageDisplay mapping + obs worker lcov#513
NikashPrakash merged 2 commits into
masterfrom
fix/backlog-ready-message-display-and-obs-lcov

Conversation

@NikashPrakash

Copy link
Copy Markdown

Two small, ready backlog items promoted from the triage. Independent commits.

1. feat(hooks): map Claude MessageDisplay

Claude Code documents a MessageDisplay hook event (between Notification and PreCompact), but claudeEventTable had no message_display key, so HookSpec.When: "message_display" silently failed to render for Claude (mapEventNameok=false). Every other platform table already had exact vendor parity — this was the one real gap the PLATFORM_DIRS_DOCS.md audit flagged.

  • internal/platform/hooks.go: add "message_display": "MessageDisplay" (1:1, no gate), reusing the P1d Claude-wider convention.
  • internal/platform/hooks_test.go: mapper + render coverage; still ok=false on codex/cursor/copilot/antigravity (D2, no cross-platform inference).
  • docs/HOOKS.md + docs/PLATFORM_DIRS_DOCS.md: add the row, flip the audit , drop the stale "separately-routed" claim.
  • Resolves the platform-dirs-claude-message-display fold-back → routed to loop-discipline-stop-hooks/fold-backs/.

Verified: go test ./internal/platform green; gofmt/go vet clean.

2. ci(obs): wire obs worker lcov into SonarCloud

The obs/ Cloudflare-worker package has tests but emitted no coverage, and sonar.javascript.lcov.reportPaths pointed at no obs lcov — so every obs/src/*.ts line read 0% on the merged scan (not untested, just unsignalled). Any obs-touching PR then fought the 80% new_coverage gate for lack of a report (seen on #503).

  • obs/package.json: add c8; test:coverage emits obs/coverage/lcov.info (--all --src=src, obs-relative SF: paths matching how Sonar resolves the dashboard report).
  • sonar-project.properties: add obs/coverage/lcov.info to sonar.javascript.lcov.reportPaths.
  • .github/workflows/test.yml: in the coverage-gate job, install obs deps (--ignore-scripts per S6505 + rebuild esbuild) and run test:coverage before the scan, mirroring the dashboard step.

Verified locally: npm ci --ignore-scripts && npm rebuild esbuild && npm run test:coverage → 18 pass, lcov lists all 6 obs/src files with obs-relative paths. This PR touches no obs src, so new_coverage is unaffected; the scanner log on this run confirms Sonar resolves the new report.

Claude Code documents a MessageDisplay hook event (between Notification and
PreCompact), but claudeEventTable in internal/platform/hooks.go had no
message_display key, so a HookSpec.When:"message_display" silently failed to
render for Claude (mapEventName ok=false). Every other platform table already
has exact parity with its vendor surface; this was the one genuine gap
(docs/PLATFORM_DIRS_DOCS.md audit marked it).

- hooks.go: add "message_display": "MessageDisplay" (1:1, no gate) in vendor
  order, reusing the P1d Claude-wider snake_case convention.
- hooks_test.go: mapper + render coverage for message_display; still ok=false
  on codex/cursor/copilot/antigravity (D2, no cross-platform inference).
- docs/HOOKS.md + PLATFORM_DIRS_DOCS.md: add the row, flip the audit gap to
  mapped, drop the stale 'separately-routed' claim.
- Resolves the platform-dirs-claude-message-display fold-back; routed to
  loop-discipline-stop-hooks/fold-backs.
The obs/ Cloudflare-worker package has tests but emitted no coverage, and
sonar.javascript.lcov.reportPaths pointed at no obs lcov, so every obs/src/*.ts
line read 0% on the merged Sonar scan - not untested, just unsignalled. Any
obs-touching PR then fights the 80% new_coverage gate for lack of a report
(seen on #503).

- obs/package.json: add c8; test:coverage emits obs/coverage/lcov.info
  (--all --src=src so all obs/src files are surfaced, SF: paths obs-relative
  to match how Sonar resolves the dashboard report).
- sonar-project.properties: add obs/coverage/lcov.info to the lcov reportPaths.
- .github/workflows/test.yml: in the coverage-gate job, install obs deps
  (--ignore-scripts per S6505 + rebuild esbuild) and run test:coverage before
  the scan, mirroring the dashboard step.

Verified locally: npm ci --ignore-scripts && npm rebuild esbuild &&
npm run test:coverage -> 18 pass, lcov lists all 6 obs/src files.
@sonarqubecloud

Copy link
Copy Markdown

@NikashPrakash
NikashPrakash merged commit 4092079 into master Jul 23, 2026
12 checks passed
@NikashPrakash
NikashPrakash deleted the fix/backlog-ready-message-display-and-obs-lcov branch July 23, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant