Skip to content

fix: fix bodyparts CRLF no-op, logic_engines regex, and indirect object syntax#53

Open
toddr-bot wants to merge 2 commits into
mainfrom
koan.toddr.bot/fix-core-bugs
Open

fix: fix bodyparts CRLF no-op, logic_engines regex, and indirect object syntax#53
toddr-bot wants to merge 2 commits into
mainfrom
koan.toddr.bot/fix-core-bugs

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

What

Fixes three bugs in Core.pm and one in Agent.pm.

Why

  1. CRLF normalization was silently skipped on body partsprepare_parts() applied s/\r\n/\n/gs to the scalar reference itself instead of the dereferenced string. The substitution ran against "SCALAR(0x...)", doing nothing. This could cause signature inconsistencies between platforms with different line endings.

  2. logic_engines config was silently ignored — The regex /^(\d\,)+$/ required a trailing comma, so valid input like logic_engines = 4,8 fell through to the default 'any' mode. Users who thought they were restricting engine selection were actually getting all engines.

  3. Indirect object notationnew IO::Select(...) / new IO::File can be ambiguous to the Perl parser. Replaced with IO::Select->new(...) / IO::File->new.

How

  • Line 470: $bodyparts[$_] =~${ $bodyparts[$_] } =~
  • Line 1036: /^(\d\,)+$//^\d+(?:,\d+)*$/
  • Lines 1762, Agent.pm 854: indirect → method call syntax

Testing

  • make test passes (full suite)
  • Added t/core_bugs.t with regression tests for the deref fix, regex fix, and check_logic integration

🤖 Generated with Claude Code


Quality Report

Changes: 4 files changed, 114 insertions(+), 4 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

toddr-bot and others added 2 commits April 10, 2026 10:42
…ct syntax

Three bugs in Core.pm:

1. prepare_parts() applied s/\r\n/\n/ to scalar references instead of
   dereferenced strings — CRLF normalization on body parts was silently
   a no-op, potentially affecting signature computation consistency.

2. check_logic() logic_engines regex /^(\d\,)+$/ required a trailing
   comma, so valid config like "4,8" silently fell through to 'any'
   engine mode. Fixed to /^\d+(?:,\d+)*$/.

3. Replaced indirect object notation (new IO::Select, new IO::File)
   with method call syntax (IO::Select->new, IO::File->new).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@toddr toddr marked this pull request as ready for review May 26, 2026 22:23
@toddr toddr self-assigned this May 26, 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

Development

Successfully merging this pull request may close these issues.

2 participants