[pkg] finalize unified reporting and data helpers#62
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 andkernelEventsPlugin()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
There was a problem hiding this comment.
💡 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.
10 tasks
pipewrk
added a commit
that referenced
this pull request
Nov 8, 2025
…5-specification [pkg] finalize unified reporting and data helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68e22adf92cc83258f1a99bffd3b3ab3