Repository navigation
Closed
Labels
builddocs-toolingLayer: Documentation, examples, dev toolsneeds-maintainer-reviewNeeds a human maintainer to sign off before mergep2Priority: Important (score 14-21)workflow-reviewNeeds maintainer review for workflow, automation, hooks, or CI behavior
Description
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
-
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.
-
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.
-
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.
Metadata
Metadata
Assignees
Labels
builddocs-toolingLayer: Documentation, examples, dev toolsneeds-maintainer-reviewNeeds a human maintainer to sign off before mergep2Priority: Important (score 14-21)workflow-reviewNeeds maintainer review for workflow, automation, hooks, or CI behavior
Activity
ci: make PR preflight deterministic and observable (#9410)