# glass16: Bluesky video, test and deploy report (2026-11-13/14)

Ruling: Chairman 2026-11-13, "Bluesky video: yes, fix it in Glass in its own session."
Work-Spine card: glass-bluesky-video-fix.

## Diagnosis
- Live Post.error history on Local Theory Bluesky: 11-09 "missing jobId", 11-10 "Bluesky refused the video (401): " (blank reason).
- Orchestrator log 11-10: video.bsky.app answered 401 `{"jobStatus":{"did":"","error":"unconfirmed_email","jobId":"","state":""}}`.
  The reply is wrapped in `jobStatus`; upstream reads it at the top level, so the reason was lost.
- Read-only per-account check (getSession + app.bsky.video.getUploadLimits), 2026-11-14 05:2xZ:
  thinkandactlocally: emailConfirmed true, canUpload true. unrivaledmarketing: true/true.
  localtheory: emailConfirmed FALSE, canUpload false. Local Theory needs its email confirmed in Bluesky; no code fixes that.

## Change (files/libraries/.../bluesky.provider.ts, uploadVideo only)
- unwrap `raw.jobStatus ?? raw`; refusal throws with Bluesky's error + message (unconfirmed_email gets a plain hint)
- `already_exists` (409 with jobId) keeps polling
- poll every 5 s (was 30 s), 10-minute limit, FAILED reason included, break as soon as the blob is ready
- `aspectRatio` from the MP4 tkhd box (vertical Reels no longer letterboxed); helper never throws
Drafted by #2 (SECOND_TASK.md / SECOND_ANSWER.md), reviewed by Code; Code replaced BigInt/readBigUInt64BE (lib risk)
and a block-level function declaration with an arrow. Helper unit-tested on the real Reel (1080x1920), a 1280x720
faststart file, and junk bytes (undefined).

## Image
- `postiz-glass:1.47.0-glass16` = FROM glass14 + this layer (Dockerfile here), built on Forge in 2 min, id 99c691889eac,
  shipped with docker save | gzip | ssh docker load. Build guard fails unless the fix is in BOTH dists and the glass14
  TikTok refreshCron survived.
- Why FROM glass14, not glass15: glass15 (live 2026-11-10 20:35Z) was built on KVM2 from the stale
  /opt/glass-overlay/rebrand.py (10-09 base + a Bluesky-refusal section) straight off the upstream digest. It LOST the
  glass14 TikTok token rotation (refreshCron 0 vs 1) and overlay 4j "View live" + preview brand (0 vs 2 files).
  glass16 restores both. glass15's only other change (the refusal message) is superseded here.

## Deploy (KVM2, 2026-11-14 05:38Z)
- backups: /opt/postiz/docker-compose.yaml.bak-20261114-053818-glass16 (points at glass15),
  /root/backups/Integration-pre-glass16-20261114-053818.sql (root-only, holds tokens; delete after the watch)
- after: login page 200 external, API 401 with a bad key, pm2 backend/frontend/orchestrator online 0 restarts,
  Temporal queue main: new worker polling (workflow + activity). A GMB post published 05:39Z (after restart).
- ROLLBACK: `cp /opt/postiz/docker-compose.yaml.bak-20261114-053818-glass16 /opt/postiz/docker-compose.yaml && cd /opt/postiz && docker compose up -d postiz`
  then check pollers. (That returns to glass15 and loses TikTok rotation again; prefer glass14 if Bluesky is not the issue.)

## Proof (destination truth)
- Approved TAAL Reel taal.social_queue fd7a339c (Walmart Sparky Thanksgiving basket, live on TAAL Facebook 11-11,
  https://www.facebook.com/reel/1891395568965381), same Glass upload, caption cut to Bluesky's 300 limit
  (first two approved lines + blog link + music credit; meal-plan offer line dropped).
- Glass post cmwfzboeq0001pe9bzxpbehpe: upload -> JobId dbrv9mu78e5s73c5fdb0 -> ENCODING -> COMPLETED -> PUBLISHED.
- https://bsky.app/profile/thinkandactlocally.bsky.social/post/3n2as4dow5u2o
  public.api.bsky.app getPosts: embed app.bsky.embed.video#view, aspectRatio 1080x1920, 1 link facet; HLS playlist 200
  (360p + 720p renditions); TAAL postsCount 81.
