Skip to content

Add #service Prefix Parser to ServiceWorkflowExecutor #358

@nuwangeek

Description

@nuwangeek

Priority: P2 — Prerequisite for Task-06
File: src/tool_classifier/workflows/service_workflow.py
Type: New method
Add a static method _parse_service_prefix(payload: str) -> Optional[tuple[str, str]] that:
Strips the #service, or #common_service, prefix.
Splits the remainder on the first / to extract the HTTP method (e.g. POST, GET).
Constructs the full Ruuter URL: {RUUTER_SERVICE_BASE_URL}{path}.
Returns (http_method, full_url) or None if the format is unrecognised.
Example:

Input:  "#service, /POST/services/active/application_mcq_step_passport"
Output: ("POST", "http://ruuter:8086/services/active/application_mcq_step_passport")

Also add a module-level constant:
SERVICE_STEP_PREFIXES = ("#service,", "#common_service,")
Work:

  1. Add SERVICE_STEP_PREFIXES constant to src/tool_classifier/constants.py.
  2. Implement _parse_service_prefix() as a @staticmethod on ServiceWorkflowExecutor.
  3. Add unit test covering: valid POST, valid GET, #common_service prefix, malformed input → None.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions