Skip to content

Add CAN predicates, consolidate XS via ALIAS, unify test pipeline - #8

Merged
rehsack merged 8 commits into
masterfrom
feature/provide-can
May 2, 2026
Merged

rehsack merged 8 commits into
masterfrom
feature/provide-can

Conversation

@rehsack

@rehsack rehsack commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

  • New predicates: _CLASSCAN, _INSTANCECAN, _INVOCANTCAN — resolve the UNIVERSAL::can debacle by calling ->can as a method, respecting overridden can() in the invocant's class hierarchy
  • XS consolidation via ALIAS (ADR-005): five groups now share C bodies — string validators, numeric validators, class dispatchers, instance dispatchers, invocant dispatchers. All previously PP-only predicates except _SET/_SET0/_HANDLE/_DRIVER now have XS accelerators.
  • Test infrastructure (ADR-001): replaced hand-maintained t/pp and t/xs with a Test::WriteVariants pipeline. Canonical tests live in t/inline/; backend variants are generated at perl Makefile.PL time and shipped in the distribution
  • Memory-leak coverage: t/inline/10_leaks.t exercises both success and failure paths through call_method to verify ENTER/SAVETMPS/FREETMPS/LEAVE handling
  • Architecture Decision Records: ADR-001..005 in lib/Params/Util/ document the pipeline, deferred designs (multi-method _CAN/_DOES, Params::Util::Assert, Test::Params::Util), and the ALIAS rationale
  • Release prep: bumped to 1.105_001 (skipping 1.104 to leapfrog an unauthorised ETHER upload that was numerically shadowing 1.103_001 on MetaCPAN), GitHub-first SUPPORT section, cleaner realclean

Test plan

  • make test passes (2147 tests, all author-test gates green: perltidy, perlcritic, pod, spelling, manifest, kwalitee)
  • make disttest passes (2068 tests against the dist-tarball layout, no Sandbox)
  • PP and XS variants both green (Test::WriteVariants generates both from t/inline/)
  • Memory-leak test green (44 leak checks, 0 leaks)
  • CI matrix on Linux (Perl 5.30..5.42), macOS, Windows

🤖 Generated with Claude Code

rehsack and others added 8 commits May 2, 2026 14:07
Resolve the `UNIVERSAL::can` debacle by providing predicates that call
`->can` as a method rather than as a function, respecting any overridden
`can()` in the invocant's class hierarchy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Maintaining two near-identical test trees violated DRY and SPOT.
Canonical tests now live in t/inline/; Sandbox/Tumble.pm generates
the backend-specific variants during `perl Makefile.PL`.

See lib/Params/Util/ADR-001.pod for the full rationale.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
ADR-002: Multi-method signatures for `_CAN` and `_DOES` (proposed)
ADR-003: `Params::Util::Assert` assertion variants (proposed)
ADR-004: `Test::Params::Util` as separate distribution (proposed)

Cross-reference the ADRs from the TO DO section in the main POD so
future contributors find the design context directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
RT is kept as historical reference but GitHub Issues is now the
primary channel for bugs and feature requests.  Also update the
copyright year range.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Refactor _INSTANCE/_INSTANCECAN into a single ALIAS group (Group 4)
and add XS implementations for all previously PP-only predicates:

- Group 1: _IDENTIFIER, _CLASS
- Group 2: _POSINT, _NONNEGINT
- Group 3: _CLASSISA, _CLASSDOES, _CLASSCAN, _SUBCLASS
- Group 5: _INVOCANT, _INVOCANTCAN

See ADR-005 for the rationale behind using ALIAS over duplicated XSUBs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Exercises both success and failure paths through call_method to verify
ENTER/SAVETMPS/FREETMPS/LEAVE stack handling is leak-free.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Captures the non-obvious conventions: container-only workflow, the
PP/XS dual implementation with PP fallback, the Test::WriteVariants
generation pipeline, the XS ALIAS groups, the author-test gates, and
the asymmetric `Foo`/`Bar`/`Baz`/`Bad` test fixtures that discriminate
`_ISA` from `_CAN`/`_DOES`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
Skip 1.104 to leapfrog the unauthorised ETHER/Params-Util-1.103_01
upload that was numerically shadowing the 1.103_001 release on
MetaCPAN (1.10301 > 1.103001 in Perl's decimal version comparison).

Also extend `realclean` to mop up `inc/latest*`, `inc/inc_*`,
`config.log`, and `M*.bak` so a freshly cloned dev checkout returns
to a pristine state without manual cleanup.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Jens Rehsack <sno@netbsd.org>
@rehsack
rehsack force-pushed the feature/provide-can branch from 1f3fbb4 to 539b969 Compare May 2, 2026 13:57
@rehsack
rehsack merged commit 539b969 into master May 2, 2026
17 checks passed
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