Skip to content

Establish parallel-agent workflow guidelines for shared checkout/branch integration #360

@cmungall

Description

@cmungall

Summary

We need explicit, repository-level guidelines for multiple agents working in parallel against the same checkout/branch family. Recent PR work surfaced avoidable complexity and CI regressions caused by branch divergence, dirty working trees, and conflict-resolution flow under non-force-push constraints.

This issue proposes a lightweight but enforceable workflow for agent collaboration so that curation changes remain safe, reviewable, and mergeable.

Case Study Context

A recent supports-alignment effort across many disorder YAMLs required conflict resolution after upstream merges landed in parallel.

Observed sequence (condensed):

  • A large curation PR was created from a branch with substantial local dirt and branch drift.
  • Upstream moved quickly (multiple merged PRs), introducing many file conflicts in overlapping disorder YAMLs.
  • Conflict resolution was performed in temporary worktrees, but push strategy constraints (no force push in execution environment) complicated branch updates.
  • A fix commit for kb/disorders/Chronic_Myeloid_Leukemia.yaml (removing schema-incompatible target_mechanisms) was temporarily present, then effectively regressed at PR head after merge-history manipulation.
  • CI correctly failed on schema validation:
    • Additional properties are not allowed ('target_mechanisms' was unexpected) in /treatments/*
  • Final resolution required a clean worktree from exact PR head, replaying the fix, validating, and fast-forward pushing.

Net effect: the technical content change was small, but process overhead was high.

Problem Statement

Parallel agents currently lack a shared, explicit operating contract for:

  • Branch ownership and synchronization strategy
  • Dirty workspace handling
  • Conflict resolution and push rules
  • Post-push verification against exact remote head

Without this, we get increased risk of:

  • Reintroducing reverted/fixed content during conflict resolution
  • CI churn and delayed merges
  • Hard-to-audit branch histories
  • Confusion between local branch state and actual PR head state

Desired Action

Create and adopt a "Parallel Agent Workflow" guideline for this repo.

Proposed Deliverables

  1. Add docs/parallel-agent-workflow.md (or equivalent) covering:
    • Required use of clean worktrees for PR surgery/conflict resolution
    • Branch naming/ownership conventions for concurrent agents
    • Rules for handling dirty checkouts (never operate directly on shared dirty tree for integration)
    • Preferred rebase/merge strategy under force-push restrictions
    • Scope isolation for curation PRs (e.g., avoid cache/page churn unless intentional)
  2. Add a short checklist to PR template or contributor docs:
    • "Verified PR head SHA"
    • "Validated risky files from exact remote head"
    • "Ran just validate/just validate-all from clean worktree"
  3. Add a guardrail check where feasible:
    • Schema-incompatible key linting for known hotspots (e.g., unsupported treatment keys)
  4. Add a "conflict recovery" playbook:
    • Step-by-step for reconstructing a mergeable branch without reintroducing stale content

Acceptance Criteria

  • A documented, discoverable workflow exists and is linked from CONTRIBUTING.md and/or CLAUDE.md.
  • PR checklist includes remote-head verification and clean-worktree validation.
  • At least one lightweight automated guardrail is in place or explicitly deferred with rationale.
  • One trial run with agent-based curation follows the new workflow and reports outcome.

Why This Matters

This repo increasingly uses agent-assisted curation and concurrent PR activity. A clear protocol will reduce integration risk, shorten merge time, and make failures easier to diagnose when they do occur.

Signed,
codex

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestinfra

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions