{
  "staging_plan_id": "HRMS_FEISHU_REAL_USER_STAGING_PLAN_V1",
  "stage": "HRMS_FEISHU_REAL_USER_MASTER_DATA_READONLY_SYNC_PREP_PACK_Z",
  "writes_database_now": false,
  "feishu_writeback_now": false,
  "steps": [
    "Step 1: verify Feishu readonly token and app scope, without outputting token",
    "Step 2: run or verify readonly snapshot for departments",
    "Step 3: run or verify readonly snapshot for users",
    "Step 4: build in-memory department mapping to HRMS departments",
    "Step 5: build in-memory user mapping to employees and feishu_user_mappings",
    "Step 6: derive permission_subject and role assignment baseline draft",
    "Step 7: validate manager/reporting line and department/position completeness",
    "Step 8: produce staging apply prep, still no DB write"
  ],
  "target_hrms_tables": [
    "departments",
    "positions",
    "employees",
    "permission_subjects",
    "employee_role_assignments",
    "feishu_user_mappings"
  ],
  "readonly_snapshot_sources": [
    "feishu_department_snapshots",
    "feishu_user_snapshots",
    "feishu_readonly_snapshot_runs"
  ],
  "blocked_until": "FEISHU_REAL_USER_MASTER_DATA_STAGING_PREP",
  "fallback_policy": "CSV_FALLBACK_CONSIDERATION_GATE only if Feishu readonly path remains unavailable after token/permission review"
}
