Skip to content

[desktop/macos] Meta: invariants live in prose (AGENTS.md) while nothing converts rules into CI checks #8849

Closed

Description

@Git-on-my-level

Area: Process — the force behind the other desktop audit issues

Problem

This is the synthesis of the desktop audit (#8842, #8843, #8844, #8845, #8846, #8847). Each of those has the same shape: an incident or need produced a prose rule in AGENTS.md, and nothing converted the rule into a mechanical check:

Prose rule (AGENTS.md / code comments) Mechanical enforcement
"Run a clean release build before merge for cross-file type changes" none — CI never compiles Swift (#8842)
"UserDefaults auth persistence is for dev builds" (AuthService.swift:355) none — runs on prod (#8843)
"Bridge is never enabled on the production bundle" (DesktopAutomationBridge.swift:18) none — flag/env overrides the gate (#8843)
Skip-list in test.sh: "pre-existing, not PR-related" no force shrinks it (#8842)
Layering/feature-directory conventions single SPM target, anything imports anything (#8847)

The repo does know how to do this right — the changelog fragment check (check-desktop-changelog.py in lint.yml), desktop-backend-contracts.yml, the tool-surface drift checks, and the per-worktree instance isolation in run.sh are all rules that became red X's. Those are worth protecting and copying.

Why it matters

desktop/macos sees ~1190 commits/month, predominantly agent-authored, with ~35% of subjects containing fix/revert. At that velocity a rule enforced by reading comprehension fails weekly; a rule enforced by CI fails never.

Suggested fix (process, one sentence each)

  1. Standing rule: a desktop incident fix may not land with only a prose-rule edit — it must add or extend a check (lint step, contract test, ratchet, or compile-time gate) or explicitly state why none is possible.
  2. Adopt ratchets as the default cheap check: counts that may only decrease (god-file line counts, asyncAfter/Task.sleep sites, raw forKey: literals, test.sh skip list length). One generic script + a JSON high-water-mark file covers all of them.
  3. Audit AGENTS.md's desktop "never/always" rules quarterly: each is either enforced, converted, or consciously accepted as prose (with the reason noted inline).

Activity

  1. added
    docs-tooling
    p3
    on Jul 4, 2026
  2. Git-on-my-level commented on Jul 23, 2026

    @Git-on-my-level
    MemberAuthor

    Done: the original intent—turning AGENTS.md never/always prose into mechanical CI checks/ratchets—is covered by the checks-manifest culture (~80 checks, ratchets, preflight, failure-class, arch/lifecycle guards, etc.).

    Successor problem is over-guarding / gate economics: see #10338.

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

    docs-toolingp3refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions