[PR #1918] [MERGED] Consolidate regex script replacement helper #5344

Closed
opened 2026-10-22 04:15:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1918
Author: @Xelvanis
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @Xelvanis

Base: refactor ← Head: architecture/regex-application-consolidation


📝 Commits (5)

  • a855328 Consolidate regex script replacement helper
  • f441c19 Refresh PR discovery metadata check
  • a5cb466 Allow empty frontend test suite in CI
  • cc999ee Merge remote-tracking branch 'origin/refactor' into architecture/regex-application-consolidation
  • 2600362 Drop stale test-only exports

📊 Changes

9 files changed (+34 additions, -30 deletions)

View changed files

📝 .github/workflows/ci.yml (+1 -1)
📝 src/engine/generation-core/regex/regex-application.ts (+4 -6)
📝 src/engine/generation/regex-runtime.ts (+2 -5)
📝 src/engine/generation/world-state-agent-result.ts (+1 -1)
➕ src/engine/shared/regex/regex-script-application.ts (+18 -0)
📝 src/features/catalog/agents/components/RegexScriptEditor.tsx (+2 -8)
📝 src/features/catalog/agents/regex-application.ts (+4 -6)
📝 src/features/catalog/chats/hooks/use-chats.ts (+1 -1)
📝 src/features/modes/game/lib/game-start-connection.ts (+1 -2)

📄 Description

Linked issue

N/A

Why this change

  • Consolidates duplicated regex script replacement and trim-string application logic behind a shared engine helper while preserving each caller's existing filtering, parsing, and invalid-regex behavior.
  • Keeps PR CI aligned with latest refactor, where the tracked frontend test suite was removed but CI still runs a frontend test step.
  • Clears stale test-only exports that became unused after the base branch removed the test files.

What changed

  • Added a shared applyRegexScriptReplacement helper for replacement plus trim-string removal.
  • Updated prompt regex, runtime regex, catalog apply hook, and editor preview paths to use the helper.
  • Switched CI's frontend test step to the existing pnpm test:allow-empty script so the base branch's empty test suite does not fail before later checks run.
  • Removed export modifiers/dead export surface from symbols that are now only internal after test removal.

Refactor impact

Primary owner:

Engine shared regex helpers; runtime generation and catalog regex consumers; CI frontend workflow; stale export cleanup.

Impact areas reviewed:

  • Prompt regex application
  • Runtime regex application
  • Catalog regex application hook
  • Regex script editor preview path
  • Frontend CI test step
  • Knip unused-export cleanup paths

Boundary notes:

  • Helper lives in src/engine/shared/regex as React-free deterministic product logic.
  • Feature code imports the engine helper only; no shared API, Tauri, Rust, or remote-runtime boundary changes.
  • CI change uses an existing package script and does not alter runtime behavior.
  • Export cleanup removes public surface only where current callers are internal or absent.

Pressure points touched:

  • .github/workflows/ci.yml frontend job test step.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm test:allow-empty passed with no test files in the current checkout, exiting with code 0.
  • pnpm check:unused passed after stale export cleanup.
  • pnpm check:workflow-names passed locally; no PR title/source branch env provided, so metadata name check skipped as expected.
  • pnpm check passed, including line endings, architecture, frontend typecheck, Rust check, docs, discovery metadata, and unused-code checks.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Internal refactor and CI maintenance only; no user-facing discoverable feature changes.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A; no visible UI behavior changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1918 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `architecture/regex-application-consolidation` --- ### 📝 Commits (5) - [`a855328`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a855328efd42360b3633934a19c2d1509195963d) Consolidate regex script replacement helper - [`f441c19`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f441c190cd945cf10ab767a8211ce081978b2b85) Refresh PR discovery metadata check - [`a5cb466`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a5cb4664ed1e0bc1b023198e5edec4f314080b93) Allow empty frontend test suite in CI - [`cc999ee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cc999ee781806302c8ebe754c1fdcf94a0db5e53) Merge remote-tracking branch 'origin/refactor' into architecture/regex-application-consolidation - [`2600362`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26003621c5a5ff0d58d86aa2dca944a4c71d8dc8) Drop stale test-only exports ### 📊 Changes **9 files changed** (+34 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+1 -1) 📝 `src/engine/generation-core/regex/regex-application.ts` (+4 -6) 📝 `src/engine/generation/regex-runtime.ts` (+2 -5) 📝 `src/engine/generation/world-state-agent-result.ts` (+1 -1) ➕ `src/engine/shared/regex/regex-script-application.ts` (+18 -0) 📝 `src/features/catalog/agents/components/RegexScriptEditor.tsx` (+2 -8) 📝 `src/features/catalog/agents/regex-application.ts` (+4 -6) 📝 `src/features/catalog/chats/hooks/use-chats.ts` (+1 -1) 📝 `src/features/modes/game/lib/game-start-connection.ts` (+1 -2) </details> ### 📄 Description ## Linked issue N/A ## Why this change - Consolidates duplicated regex script replacement and trim-string application logic behind a shared engine helper while preserving each caller's existing filtering, parsing, and invalid-regex behavior. - Keeps PR CI aligned with latest `refactor`, where the tracked frontend test suite was removed but CI still runs a frontend test step. - Clears stale test-only exports that became unused after the base branch removed the test files. ## What changed - Added a shared `applyRegexScriptReplacement` helper for replacement plus trim-string removal. - Updated prompt regex, runtime regex, catalog apply hook, and editor preview paths to use the helper. - Switched CI's frontend test step to the existing `pnpm test:allow-empty` script so the base branch's empty test suite does not fail before later checks run. - Removed export modifiers/dead export surface from symbols that are now only internal after test removal. ## Refactor impact Primary owner: Engine shared regex helpers; runtime generation and catalog regex consumers; CI frontend workflow; stale export cleanup. Impact areas reviewed: - Prompt regex application - Runtime regex application - Catalog regex application hook - Regex script editor preview path - Frontend CI test step - Knip unused-export cleanup paths Boundary notes: - Helper lives in `src/engine/shared/regex` as React-free deterministic product logic. - Feature code imports the engine helper only; no shared API, Tauri, Rust, or remote-runtime boundary changes. - CI change uses an existing package script and does not alter runtime behavior. - Export cleanup removes public surface only where current callers are internal or absent. Pressure points touched: - `.github/workflows/ci.yml` frontend job test step. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm test:allow-empty` passed with no test files in the current checkout, exiting with code 0. - `pnpm check:unused` passed after stale export cleanup. - `pnpm check:workflow-names` passed locally; no PR title/source branch env provided, so metadata name check skipped as expected. - `pnpm check` passed, including line endings, architecture, frontend typecheck, Rust check, docs, discovery metadata, and unused-code checks. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Internal refactor and CI maintenance only; no user-facing discoverable feature changes. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A; no visible UI behavior changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5344
No description provided.