Skip to content

refactor: extract shared parseFrontMatter utility to src/util.ts#148

Merged
keinstn merged 1 commit into
developfrom
agent/keinstn__baton-134
Jun 24, 2026
Merged

refactor: extract shared parseFrontMatter utility to src/util.ts#148
keinstn merged 1 commit into
developfrom
agent/keinstn__baton-134

Conversation

@keinstn

@keinstn keinstn commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extracts a shared parseFrontMatter(text) utility into src/util.ts (alongside isRecord)
  • src/workflow/loader.ts now delegates to the shared utility and wraps errors as BatonError (existing error codes preserved)
  • scripts/triage/config.ts removes its local duplicate and imports from src/util.ts
  • Single canonical implementation; bug fixes propagate to both callers automatically

Closes #134.

Test plan

  • All 327 tests pass (npm run test)
  • TypeScript compiles without errors (npm run typecheck)
  • Lint passes (npm run lint)
  • Public API of loadWorkflow and loadTriageConfig unchanged

🤖 Generated with Claude Code

Deduplicates the front-matter splitting algorithm that existed independently
in src/workflow/loader.ts and scripts/triage/config.ts. The shared utility
throws plain Error; workflow/loader.ts wraps it to preserve BatonError codes.

Closes #134.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@keinstn

keinstn commented Jun 24, 2026

Copy link
Copy Markdown
Owner Author

[Baton Reviewer] PR is ready for human review.
Managed by Baton; do not edit the marker line manually.

@keinstn keinstn self-assigned this Jun 24, 2026
@keinstn
keinstn merged commit 95e46e0 into develop Jun 24, 2026
4 checks passed
@keinstn
keinstn deleted the agent/keinstn__baton-134 branch June 24, 2026 12:40
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.

Deduplicate front-matter parser: extract shared utility from src/workflow/loader.ts

1 participant