Introduce a pipeline metadata surface that enforces "no body content ever reaches pipeline decisions". MetaReader is an interface with four methods (getPRMeta, getEpicMeta, getIssueState, getCommentReactions), each returning a readonly DTO carrying only structural fields — state, mergeability, SHAs, branches, reaction counts, child linkage. ForgejoMetaReader projects raw Forgejo API payloads into these DTOs and drops body/description/review text before the caller can see it. Unit test mocks rich Forgejo payloads containing body, description, review_text, and comment_body, then asserts the DTO toArray output never exposes those keys — the regression fence for the RFC rule. Downstream callers (ScanForWork, ManagePullRequest) still use the raw ForgejoService today; that refactor lands under Mantis #90. Closes tasks.lthn.sh/view.php?id=89 Co-authored-by: Codex <noreply@openai.com> Co-Authored-By: Virgil <virgil@lethean.io>
30 lines
652 B
PHP
30 lines
652 B
PHP
<?php
|
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Core\Mod\Agentic\Pipeline;
|
|
|
|
final readonly class EpicChild
|
|
{
|
|
public function __construct(
|
|
public int $issueId,
|
|
public string $state,
|
|
public bool $checkedBool,
|
|
public ?int $linkedPrNumberOrNull,
|
|
) {}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'issue_id' => $this->issueId,
|
|
'state' => $this->state,
|
|
'checked_bool' => $this->checkedBool,
|
|
'linked_pr_number_or_null' => $this->linkedPrNumberOrNull,
|
|
];
|
|
}
|
|
}
|