Skip to content

fix(rules,http): linearTyped value loss and RequestBuilder raw-body JSON coercion - #10

Merged
senrecep merged 2 commits into
mainfrom
fix/rule-engine-and-http-send-bugs
Aug 3, 2026
Merged

fix(rules,http): linearTyped value loss and RequestBuilder raw-body JSON coercion#10
senrecep merged 2 commits into
mainfrom
fix/rule-engine-and-http-send-bugs

Conversation

@senrecep

@senrecep senrecep commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • RuleEngine.linearTyped/linearTypedAsync always returned an Empty failure on success instead of the last rule's value — fixed to track and return the last value, matching andTyped/andTypedAsync.
  • RequestBuilder.send() always routed POST/PUT/PATCH through fetchResult.post/put/patch, which JSON.stringifys its body argument — so a raw body set via .body() (e.g. plain text, FormData) got double-encoded/corrupted. Added fetchResult.send() and wired RequestBuilder to use it for non-JSON bodies.
  • Regression tests added for both fixes; agent-skill docs updated to describe the corrected behavior (they had previously documented the bugs as known limitations).
  • Version bumped 0.1.11 → 0.1.12 since real src/ behavior changed.

Test plan

  • npm test — 1089/1089 passing
  • npm run typecheck
  • npm run check (Biome lint + format)
  • npm run build

…stBuilder raw bodies

- RuleEngine.linearTyped/linearTypedAsync now return the last rule's
  value on success instead of always returning an Empty failure.
- fetchResult gains a send() method and RequestBuilder now uses it for
  non-JSON POST/PUT/PATCH bodies, so raw bodies set via .body() are no
  longer forced through JSON.stringify.
- Add regression tests for both fixes and correct the agent-skill docs
  that had documented the old buggy behavior.
@senrecep
senrecep merged commit 98ec9d3 into main Aug 3, 2026
5 of 6 checks passed
@senrecep
senrecep deleted the fix/rule-engine-and-http-send-bugs branch August 3, 2026 15:08
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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