Skip to content

Consume shared GitHub mount-path parser instead of hand-rolled regexes #21

Description

@miyaontherelay

Problem

Factory currently parses GitHub Relayfile mount paths with local regexes in src/orchestrator/factory.ts. This already drifted once: PR ingestion handled compact repo paths like OWNER__REPO, while issue ingestion only handled split OWNER/REPO paths.

The short-term bug is fixed in PR #20 by updating the local issue regexes, but the robust long-term fix is to consume a shared parser from relayfile-adapters once it exists.

Desired robust fix

After AgentWorkforce/relayfile-adapters#224 exports a GitHub mount-path parser, replace factory local parsing logic with that shared contract:

  • githubIssuePathParts() should delegate to the shared issue parser.
  • githubPullPathParts() should delegate to the shared PR parser.
  • githubIssueDirectoryPathParts() and tree-path checks should use shared parser support for directory-event paths, or a shared repo-path parser plus resource-specific parser.
  • Keep factory-specific filtering and routing logic local; only path-shape knowledge should move out.

Acceptance criteria

  • Factory no longer duplicates split-vs-compact GitHub repo parsing in multiple regexes.
  • Existing regressions from PR Handle compact GitHub issue repo paths #20 still pass: split OWNER/REPO, compact OWNER__REPO, by-id, flat JSON, nested meta.json, nested metadata.json, and directory events.
  • PR path behavior remains unchanged.
  • Add or keep contract tests based on fixtures from relayfile-adapters.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions