Skip to content

[pkg] finalize unified reporting and data helpers#62

Merged
pipewrk merged 4 commits intomainfrom
implement-tasks-from-sprint-4.5-specification
Oct 5, 2025
Merged

[pkg] finalize unified reporting and data helpers#62
pipewrk merged 4 commits intomainfrom
implement-tasks-from-sprint-4.5-specification

Conversation

@pipewrk
Copy link
Contributor

@pipewrk pipewrk commented Oct 5, 2025

Summary

  • add a LogLayer-backed reporter with console and WordPress hook transports plus unit coverage
  • replace ad-hoc console usage with the shared reporter across actions, policies, and namespace detection
  • introduce kernel data integration helpers, registry plugin wiring, and accompanying documentation updates

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm typecheck:tests
  • pnpm test

https://chatgpt.com/codex/tasks/task_e_68e22adf92cc83258f1a99bffd3b3ab3

@pipewrk pipewrk marked this pull request as ready for review October 5, 2025 11:35
Copilot AI review requested due to automatic review settings October 5, 2025 11:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR finalizes Sprint 4.5's unified reporting system by introducing a LogLayer-backed reporter for structured telemetry, replacing ad-hoc console usage throughout the kernel, and adding WordPress data integration helpers with accompanying documentation.

  • Implements a complete reporter module with console and WordPress hook transports backed by LogLayer
  • Replaces all console.* calls across actions, policies, and namespace detection with structured reporters
  • Adds kernel data integration helpers including useKernel() for registry middleware and kernelEventsPlugin() for notice bridging

Reviewed Changes

Copilot reviewed 37 out of 39 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/kernel/src/reporter/ New reporter module with types, transports, and LogLayer integration
packages/kernel/src/resource/cache.ts Replaces console.warn with cacheReporter for structured logging
packages/kernel/src/policy/ Updates policy module to use shared reporter types and instances
packages/kernel/src/namespace/detect.ts Replaces console.warn with namespaceReporter for dev warnings
packages/kernel/src/actions/ Updates action context to use shared reporter infrastructure
packages/kernel/src/data/ New data integration module with registry helpers and events plugin
eslint-rules/no-console-in-kernel.js Custom ESLint rule to enforce reporter usage in kernel code
docs/ Documentation for reporting, data integration, and API reference
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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

Fixes namespace drift where hardcoded [wp-kernel] prefixes in error
messages were being double-prefixed by the reporter's automatic
namespace handling.

Changes:
- Remove [wp-kernel] prefix from 4 policy cache error messages
- Remove [wp-kernel] prefix from 1 policy events error message
- Update test expectations to match clean namespace format

Result:
- Console: [kernel.policy.cache] Failed to persist policy cache.
- Hooks: kernel.policy.cache.reporter.warn with structured payload

Previously:
- Console: [kernel.policy.cache] [wp-kernel] Failed to persist...

All tests pass (889/891), zero remaining [wp-kernel] prefixes in
production code.
- Create namespace/constants.ts with WPK_NAMESPACE, WPK_SUBSYSTEM_NAMESPACES, and WPK_INFRASTRUCTURE
- Replace all hardcoded 'kernel.*' and 'wpk.*' strings with constants
- Update reporters to use wpk.* namespaces consistently (was split between kernel.* and wpk.*)
- Update all test expectations to use constants instead of hardcoded strings
- Export constants from namespace/index.ts for public API

This prevents namespace drift by establishing a single source of truth.
All framework namespaces now consistently use 'wpk' as the root.

Resolves namespace inconsistency where framework used both 'kernel.*'
and 'wpk.*' patterns.
- Fix hook namespace collision in kernelEventsPlugin with unique instance counters
- Add WPK_HOOKS_NAMESPACE constant for WordPress hooks integration
- Replace ALL remaining hardcoded 'kernel' and 'wpk' strings with constants:
  - reporter/transports.ts: resolveNamespace fallback
  - resource/grouped-api.ts: detectNamespace fallback
  - All test files updated to use constants
- Add test to verify multiple plugin instances get unique hook namespaces

This completes the namespace standardization ensuring zero hardcoded namespace
strings remain in the codebase. All framework namespaces now flow from a single
source of truth in namespace/constants.ts.
@pipewrk pipewrk merged commit 07b7099 into main Oct 5, 2025
7 checks passed
@pipewrk pipewrk deleted the implement-tasks-from-sprint-4.5-specification branch October 14, 2025 10:10
pipewrk added a commit that referenced this pull request Nov 8, 2025
…5-specification

[pkg] finalize unified reporting and data helpers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants