Skip to content

refactor: simplify accessor internals#29

Closed
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/simplify-accessor-internals
Closed

refactor: simplify accessor internals#29
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/simplify-accessor-internals

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

What

Three targeted simplifications to lib/Simple/Accessor.pm addressing issues #22, #25, and #26.

Why

How

  • Moved require mro to module top-level (load once at use time)
  • Converted eval qq[require $module; 1] to eval { require $file; 1 } with ::/ path conversion
  • Unified hook dispatch: resolve coderef first (class → role chain fallback), then single call + single rollback block. Same pattern applied to builder resolution.

Testing

Full test suite passes (all existing tests cover these code paths — roles, hooks, builders, transitive composition, inheritance, MRO).

Closes #22, closes #25, closes #26


Quality Report

Changes: 1 file changed, 21 insertions(+), 23 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

…dispatch)

- Move `require mro` to module load time instead of calling it on every
  new() invocation (#22)
- Replace string eval for role require with block eval, eliminating a
  potential code injection vector (#25)
- Unify hook dispatch: resolve coderef first (class → role chain), then
  single call site with single rollback path, removing duplicated
  _after_* rollback logic (#26)

Closes #22, closes #25, closes #26

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atoomic atoomic marked this pull request as ready for review April 11, 2026 21:09
@Koan-Bot

Koan-Bot commented May 2, 2026

Copy link
Copy Markdown
Collaborator Author

Same situation as #27 — this has merge conflicts and the codebase has evolved significantly since this was opened. The incremental fixes (hook cache, strict constructor timing, etc.) have addressed some of the same concerns. Let me know if you'd like me to rebase or if we should close this one.

@Koan-Bot

Koan-Bot commented May 3, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: same rationale as #27 — superseded by PR #34 (covers #22 + #25 with tests) and master's hook cache (commit 6b8f5d7 solved #26). This PR also has merge conflicts. PR #34 is the definitive version.

@Koan-Bot Koan-Bot closed this May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants