Skip to content

Keep repository validation results in structured form on the run result and task timeline #3429

Closed

Description

@integry

Problem

ProPR runs the validation commands from .propr/workflow.yml inside the agent container after the agent exits. The per-command outcome is observed in structured form (WorkflowObservation / WorkflowMarkerCollector in packages/core/src/workflow/workflowExecution.ts), but executeWithRepositoryWorkflow only renders it into a markdown string (buildRepositoryValidationReport) and discards the structure. The only thing that survives is AgentExecutionResult.repositoryValidation / ClaudeCodeResponse.repositoryValidation (markdown text).

Several planned features need to read the outcome programmatically (a PR digest section, a base-commit test-strength check, escalation after a failed validation, a validate-before-merge gate). Today nothing can.

Goal

Keep the structured per-command validation result next to the existing markdown, and persist it on the task timeline. No behaviour change: validation still never gates commit or PR creation, and the rendered markdown stays byte-identical.

Acceptance criteria

  • A typed, serialisable result exists (for example RepositoryValidationResult { commands: Array<{ index, command, status, exitCode?, verified }>, overall }) with a closed status vocabulary covering the cases rendered today: passed, failed (with exit code), timed out, killed, not run, not observed, plus the existing "unverified" qualifier.
  • executeWithRepositoryWorkflow returns the structured result alongside the markdown report; both are derived from the same observation so they cannot disagree.
  • The structured result is carried on AgentExecutionResult and ClaudeCodeResponse and copied wherever repositoryValidation is copied today (src/jobs/issueJob/agent.ts, src/jobs/prFileUtils.ts).
  • For issue runs and PR follow-up//fix runs, the structured result is written to task_history metadata under a stable key, following the existing convention used by repositoryWorkflowHistoryMetadata, networkEgress and autoMergeDecision. It is therefore visible through the task history API and MCP get_task_events without new endpoints.
  • Command strings stored in metadata go through the same redaction/bounding already applied to the markdown report.
  • The markdown shown in PR bodies and completion comments is unchanged (existing byte-identical tests keep passing).
  • A run with no workflow or no validation commands stores nothing (no empty object noise).
  • Unit tests cover each status mapping, the structured/markdown parity, and the timeline metadata write for both the issue path and the PR-comment path.

Out of scope

  • Making validation gate anything.
  • Any UI changes.
  • New workflow keys.

Implementation

Key files:

  • packages/core/src/workflow/workflowExecution.ts: executeWithRepositoryWorkflow (maps marker codes to statuses), buildRepositoryValidationReport, WorkflowObservation, WorkflowMarkerCollector.
  • packages/core/src/agents/types.ts (AgentExecutionResult.repositoryValidation), packages/core/src/claude/claudeService.ts (ClaudeCodeResponse.repositoryValidation).
  • Copy sites: src/jobs/issueJob/agent.ts (agentResultToClaudeResponse), src/jobs/prFileUtils.ts.
  • Callers: src/jobs/repositoryWorkflow.ts (runRepositoryWorkflow, repositoryWorkflowHistoryMetadata), src/jobs/issueJob/agent.ts, src/jobs/prCommentAgentUtils.ts.
  • Timeline-event precedents that do not change task state: recordNetworkEgressEvent in src/jobs/networkEgress.ts, recordAutoMergeDecisionEvent in packages/core/src/services/autoMergeGate.ts.

Approach: introduce the structured type in core (put the browser-safe type in packages/shared if the UI/API will need it), build it in executeWithRepositoryWorkflow from the same observation used for the report, and render the markdown from the structured value so there is one source of truth. Add the field to the result types and copy sites. Write one non-lifecycle task_history event (or extend the existing workflow metadata) with the structured result after the agent run.

Tests: packages/core/test/repositoryWorkflow.test.ts, test/prCommentAgentUtils.test.ts, test/workflowContainerSmoke.test.ts, test/prTemplateDescription.test.ts (must stay green unchanged).

Verification: npm run test:prepare, npm run typecheck, node scripts/run-test-suite.mjs <changed test files>, and eslint --max-warnings 0 in each touched package (CI enforces max-lines 400 and complexity 20 as errors).

Activity

  1. propr-dev commented on Nov 11, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3429/claude-opus-5-5-keep-repository-validatio-20261111-1911-dpv
    • Base Branch: main
    • Worktree: issue-3429-20261111-1911-claude-opus-5-5-dpv

    🔍 Track Task Execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions