Skip to content

core: enumerate and identify eligible application windows safely #42

Description

@woosublee

User problem

현재 AX service가 frontmost window 하나만 다뤄 여러 앱·창 workspace를 안전하게 저장할 수 없다. title이나 배열 순서처럼 불안정한 값으로 창을 식별하면 같은 앱의 여러 창을 잘못 이동할 수 있으므로, eligible window enumeration과 명시적인 no-guess matching contract가 workspace 기능보다 먼저 필요하다.

Product value

여러 앱과 여러 창을 안전하게 workspace에 포함할 기반을 만든다. session identity와 app-provided AXIdentifier를 우선하고 단일 후보일 때만 fallback해, ambiguous한 창을 추측해서 다른 문서나 작업 창으로 오인하지 않는다.

Scope

  • 실행 중인 application에서 일반 user top-level window를 열거하고 현재 session 동안 재사용 가능한 window identity를 부여한다.
  • matching descriptor를 app bundle identifier, AX role/subrole, optional application-provided AXIdentifier, session window identity로 구성한다.
  • restore matching algorithm을 exact session identity → stable AXIdentifier → 해당 앱의 단일 eligible candidate 순서로 고정한다.
  • 각 eligible window에 대해 display information과 visible frame 기준 normalized frame을 계산한다.
  • sheet, system dialog와 비표준 window를 명시적인 exclusion policy로 분류하고, window title을 identity·matching·persistence input에서 제외한다.

Acceptance criteria

  • 일반 user window를 열거하고 stable session identity를 부여한다.
  • matching descriptor는 app bundle identifier, AX role/subrole, optional application-provided AXIdentifier, session window identity로 구성한다.
  • restore matching은 exact session identity → stable AXIdentifier → 해당 앱의 단일 eligible candidate 순서로 시도한다.
  • 후보가 둘 이상이고 stable match가 없으면 추측하지 않고 ambiguous match로 보고한다.
  • sheet, system dialog, 비표준 window를 명확한 정책으로 제외한다.
  • display와 normalized frame을 계산한다.
  • window title은 identity나 persistence에 사용하지 않는다.
  • exact session identity가 존재하면 이후 단계의 후보를 보지 않고 해당 window만 반환하며, session identity가 stale이면 동일 identity를 다른 window에 재할당하지 않는다.
  • session identity match가 없을 때만 같은 bundle identifier의 stable AXIdentifier exact match를 시도하고, AXIdentifier가 중복되거나 일치하지 않으면 이를 안정적인 match로 취급하지 않는다.
  • 앞의 두 단계가 실패한 경우 role/subrole와 eligibility policy를 통과한 해당 앱 후보가 정확히 하나일 때만 fallback match를 반환한다.
  • eligible candidate가 0개면 no match, 2개 이상이면 ambiguous match를 반환하며 어느 경우에도 임의의 window를 선택하지 않는다.
  • enumeration과 matching unit/integration test가 같은 앱의 복수 window, AXIdentifier 있음/없음/중복, 닫힌 session window, sheet/system dialog exclusion과 multi-display normalized frame을 검증한다.

Dependencies

External prerequisites

  • Zap에 대한 macOS Accessibility authorization. 권한이 없으면 enumeration/matching을 수행하지 않고 명시적인 authorization failure를 반환해야 한다.

Non-goals

  • window title, document title, file path, URL 또는 OCR/content를 identity나 persistence에 사용하지 않는다.
  • ambiguous candidate를 MRU, z-order, geometry similarity 또는 title 유사도로 추측하지 않는다.
  • workspace preset 저장·복원 UI와 persistence는 각각 R-35와 R-36의 범위다.
  • Screen Recording 권한, window thumbnail 또는 cross-device identity를 추가하지 않는다.

Evidence

Milestone exit-gate impact

Non-gating foundation. 이 Issue는 v0.4.0의 Save/Restore, partial-failure safety와 global undo를 구현할 때 잘못된 window를 추측하지 않게 하는 prerequisite이며 사용자-facing gate는 R-35와 R-36이 완성한다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:accessibilityAccessibility 권한, AX API, 보조 기술area:window-management창 위치, 크기, history, workspaceenhancementNew feature or requestpriority:P1핵심 사용자 흐름의 정확성, 복구, 높은 가치 작업roadmap승인된 Zap 제품 roadmap 항목status:blocked명시적 dependency가 완료되지 않은 작업

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions