Skip to content

devex/ci: make desktop PR preflight deterministic and observable #9408

Closed

Description

@Git-on-my-level

Context

PR #9402 exposed avoidable feedback-loop failures while fixing desktop agent routing:

  • Desktop Swift CI failed because a changed source file was not declared in an E2E flow covers list, despite focused unit tests passing.
  • Hygiene required INV-AUTH-1, INV-CHAT-1, and INV-AGENT-* in the PR body.
  • Editing the live PR body fixed the metadata, but rerunning the existing GitHub Actions workflow still used the stale pull_request event body. A zero-diff commit was required only to create a fresh event.
  • Long pre-push validation gave poor progress visibility. A duplicate push attempt created overlapping local hooks and ambiguous branch state.

The gates are useful and should remain strict. The problem is deterministic local feedback and workflow observability.

Scope

  1. Add a local PR preflight command for desktop-agent changes.

    • Mirror the relevant CI gates: strict E2E flow coverage, product invariant citations, desktop changelog validation, diff/format checks, and relevant focused test selection.
    • Support a supplied PR body or a checked preflight metadata input so invariant failures are discoverable before push.
    • Print one concise pass/fail summary with direct remediation commands.
  2. Make GitHub Hygiene read current PR metadata.

    • Do not rely exclusively on the original pull_request event payload for PR-body invariant validation.
    • A workflow rerun after a body edit must evaluate the current body.
    • Use the repository-provided GitHub token/API safely and fail clearly if current metadata cannot be read.
  3. Make pre-push validation single-flight and observable per worktree.

    • Prevent or join duplicate validations for the same worktree/branch.
    • Emit phase names, elapsed time, and stable log-file paths.
    • On interruption/failure, clean up only the hook-owned process tree and leave normal Git/app processes untouched.
    • Do not weaken required checks or silently skip them.

Acceptance criteria

  • Running the documented local preflight against PR fix(desktop): keep managed agents on cloud routing #9402-equivalent changes catches both the missing flow coverage and missing invariant IDs before push.
  • Updating a PR body and rerunning Hygiene uses the updated body without requiring an empty commit.
  • Two simultaneous pushes from the same worktree cannot run competing validation hooks; the second invocation gets an actionable status.
  • A developer can identify the current pre-push phase and open its log without process inspection.
  • CI remains fail-closed for missing invariant citations, missing E2E coverage, changelog defects, and real test failures.

Non-goals

  • Do not remove or downgrade existing Hygiene, release, invariant, or E2E gates.
  • Do not use production Omi/Omi Beta bundles for local validation.
  • Do not convert the pre-push hook into a full release pipeline.

Suggested ownership

This is developer tooling and GitHub Actions work. Keep it separate from the desktop agent runtime issue so the implementation can be reviewed and reverted independently.

Verification

  • Unit tests for the invariant-body loader and preflight changed-file selection.
  • A fixture proving rerun/current-body behavior.
  • A two-process hook test proving single-flight behavior and cleanup.
  • Documentation update with the one command agents should run before pushing desktop-agent PRs.

Activity

  1. added
    docs-tooling
    p2
    needs-maintainer-review
    workflow-review
    on Jul 10, 2026
  2. added a commit that references this issue on Jul 10, 2026
    78b49b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    builddocs-toolingneeds-maintainer-reviewp2workflow-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions