Skip to content

Conform the library to the tiny-blocks rules and skill canon.#10

Merged
gustavofreze merged 4 commits into
mainfrom
feature/develop
Jun 27, 2026
Merged

Conform the library to the tiny-blocks rules and skill canon.#10
gustavofreze merged 4 commits into
mainfrom
feature/develop

Conversation

@gustavofreze

Copy link
Copy Markdown
Member

No description provided.

Align the package with the .claude/rules and the tiny-blocks-create skill:
restore the canonical tooling, refactor src to the coding and architecture
rules, rewrite the tests to the BDD, naming, and ordering rules, and fix
the README to the documentation rules.

- Restore canonical config: add phpcs.xml, reduce composer.json to the five
  standard scripts with keywords and the dev-dependency floor, run PHPStan
  at level max over src and tests, and align phpunit, infection, the editor
  and git config files, the Makefile, and ci.yml.
- Refactor src: move LogLevel under Internal, keep Internal types out of the
  public API through StructuredLogger::from, make the builder an immutable
  final readonly value, and apply the naming, ordering, self-reference, and
  format-string rules. An unknown PSR-3 level now raises the dedicated
  UnknownLogLevel instead of a native error.
- Rewrite the tests onto an InMemoryStream fixture with testXxxWhenYyyThenZzz
  names and corrected BDD steps, covering the unknown-level and stderr
  fallback paths through the public API.
Track the .claude rules, hooks, skills, and settings together with the
root CLAUDE.md so contributors share the same coding-standard tooling.
The per-clone settings.local.json stays ignored.
Copilot AI review requested due to automatic review settings June 27, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request aligns the logger library with the tiny-blocks canon by introducing the .claude/ rules and skills, standardizing tooling and CI, and refactoring the logger/redaction internals to follow the updated naming and immutability conventions.

Changes:

  • Refactor StructuredLogger/StructuredLoggerBuilder to an immutable builder flow and add UnknownLogLevel for unsupported levels.
  • Normalize redaction terminology from data to payload across redaction APIs and internal redaction pipeline.
  • Restore canonical tiny-blocks repository/tooling shape (CI workflow, Makefile, PHPUnit/PHPStan/PHPCS config, docs, and .claude/ rules/skills/hooks).

Reviewed changes

Copilot reviewed 60 out of 61 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Internal/Stream/LogStreamTest.php Removes redundant internal stream test.
tests/InMemoryStream.php Adds in-memory stream test helper.
src/StructuredLoggerBuilder.php Makes builder immutable and documented.
src/StructuredLogger.php Adds from() factory and level validation.
src/Redactions/PhoneRedaction.php Payload naming + docs + template var.
src/Redactions/PasswordRedaction.php Payload naming + docs.
src/Redactions/NameRedaction.php Payload naming + docs + template var.
src/Redactions/EmailRedaction.php Payload naming + docs + template var.
src/Redactions/DocumentRedaction.php Payload naming + docs + template var.
src/Redaction.php Renames data to payload in contract.
src/LogContext.php Adds class and factory PHPDoc.
src/Internal/Stream/LogStream.php Minor null-check style adjustment.
src/Internal/Redactor/Redactor.php Renames data to payload internally.
src/Internal/Redactor/Redactions.php Renames applyTo(data) to applyTo(payload).
src/Internal/LogLevel.php Moves enum to Internal namespace.
src/Internal/LogFormatter.php Reorders ctor args and updates format signature.
src/Exceptions/UnknownLogLevel.php Adds dedicated PSR-3 invalid-level exception.
README.md Expands and canonicalizes usage documentation/examples.
phpunit.xml Aligns PHPUnit config with canonical tiny-blocks settings.
phpstan.neon.dist Moves to level: max, adds scoped suppressions.
phpcs.xml Adds canonical PSR-12 ruleset file.
Makefile Aligns targets to canonical configure/review/tests workflow.
infection.json.dist Updates report paths and canonical mutator config.
composer.json Adds keywords, canonical scripts, dependency bumps.
CLAUDE.md Adds repo index for rules/skills and validation commands.
.gitignore Canonical ignore list incl. reports and local overrides.
.github/workflows/ci.yml Canonical CI with PHP version resolved from composer.json.
.gitattributes Canonical export-ignore set + linguist vendoring.
.editorconfig Adds canonical max_line_length = 120.
.claude/skills/tiny-blocks-create/SKILL.md Adds scaffolding skill definition.
.claude/skills/tiny-blocks-create/assets/github/workflows/ci.yml Adds canonical CI workflow asset.
.claude/skills/tiny-blocks-create/assets/github/PULL_REQUEST_TEMPLATE.md Adds PR template asset.
.claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/feature_request.md Adds feature request template asset.
.claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/bug_report.md Adds bug report template asset.
.claude/skills/tiny-blocks-create/assets/docs/SECURITY.md Adds SECURITY.md asset.
.claude/skills/tiny-blocks-create/assets/config/phpunit.xml Adds PHPUnit config asset.
.claude/skills/tiny-blocks-create/assets/config/phpstan.neon.dist Adds PHPStan baseline asset.
.claude/skills/tiny-blocks-create/assets/config/phpcs.xml Adds PHPCS ruleset asset.
.claude/skills/tiny-blocks-create/assets/config/Makefile Adds Makefile asset.
.claude/skills/tiny-blocks-create/assets/config/infection.json.dist Adds Infection config asset.
.claude/skills/tiny-blocks-create/assets/config/composer.json Adds Composer canonical asset.
.claude/skills/tiny-blocks-create/assets/config/.gitignore Adds gitignore canonical asset.
.claude/skills/tiny-blocks-create/assets/config/.gitattributes Adds gitattributes canonical asset.
.claude/skills/tiny-blocks-create/assets/config/.editorconfig Adds editorconfig canonical asset.
.claude/skills/tiny-blocks-consume/SKILL.md Adds dependency reuse skill definition.
.claude/skills/tiny-blocks-consume/scripts/refresh-catalog.py Adds Packagist catalog refresh script.
.claude/skills/tiny-blocks-consume/references/catalog.md Adds initial tiny-blocks package catalog.
.claude/skills/commit-message/SKILL.md Adds conventional commit-message skill.
.claude/settings.json Adds Claude settings and tool permissions.
.claude/rules/php-library-tooling.md Adds canonical tooling invariants.
.claude/rules/php-library-testing.md Adds canonical testing conventions.
.claude/rules/php-library-modeling.md Adds canonical modeling rules.
.claude/rules/php-library-github-workflows.md Adds canonical workflow conventions.
.claude/rules/php-library-documentation.md Adds canonical README/docs rules.
.claude/rules/php-library-code-style.md Adds canonical code style rules.
.claude/rules/php-library-architecture.md Adds canonical folder/API boundary rules.
.claude/hooks/php-prose-punctuation-conformance.py Adds prose punctuation conformance hook.
.claude/hooks/php-ordering-conformance.py Adds member/parameter ordering conformance hook.
.claude/CLAUDE.md Removes obsolete .claude/ index file.

Comment thread src/StructuredLogger.php
Comment thread tests/InMemoryStream.php
@gustavofreze gustavofreze merged commit c7fff96 into main Jun 27, 2026
8 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch June 27, 2026 12:24
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.

2 participants