Repository navigation
feat(ai): spike official image API behind a default-off release gate - #239
alirezasafaei-dev wants to merge 17 commits into
Conversation
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
CI corrective follow-up — 2026-10-11First CI run Fresh targeted evidence after fix: 15/15 mock-only tests PASS, targeted TypeScript check exit 0, Prettier and diff check PASS. At the new exact-head CI run No image provider inference was sent; PR stays Draft / NO-GO, no merge or deploy. |
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Phase D verification close-out — exact draft SHA 6a22752On 2026-10-11, all 6/6 GitHub Actions workflow runs succeeded on this exact, unmerged candidate:
Scope: Atomic current+previous minute account admission now prevents a second provider attempt one second across a minute boundary during 45s upstream timeout. 11/11 local tests against a disposable actual PostgreSQL (3 integration + 8 unit) passed with container removed; test RED before code and GREEN after. Financial/ingress findings: Cloudflare official docs Oct 9 2026 say 10k Free neurons per account per day, but actual independent Free image account, account isolation, billing and token permissions are still unverified. Unauthenticated GET from intended Iran production VPS proved DNS/TCP/TLS only (HTTP400 with no token), not model acceptance. Nginx live read-only trust-chain audit did not establish safe real client IP; do not trust X-Forwarded-For for API throttling before approved edge ingress/WAF review. Existing per-account global five-per-day quota remains hard fail-closed. No credentials or paid inference used. Security distinction: The default-branch GitHub Code Scanning API reported 56 already-open alerts (25 error, 31 warning); none in sampled image-specific paths. CodeQL CI success is not a zero-findings attestation. Dependabot alerts currently disabled; independent triage remains open. NO-GO remains: independent Workers Free and dedicated account verification, least-privilege Workers AI Read/Edit token created by account owner, authorized measured single-image output and Neuron usage, trusted ingress/IP control and alerts, genuine physical mobile/manual screen reader/200% browser zoom, security acceptance, explicit owner merge and production deploy authorization. All flags default OFF, PR remains Draft, live deployed SHA f58ef7a unchanged. No FlatAI email or restrictions bypass. Full operational evidence: issue #238 comment. |
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
2026-10-11 owner Free confirmation + secured one-shot/keyboard acceptance checkpointOwner says Cloudflare account is Free. Treat this as owner plan attestation only. Independent image account isolation and a least-privilege image API token distinct from existing production chat are not verified; do not set Exact unmerged Draft PR #239 head: Delivered
Latest exact-head checks
Still NO-GO: distinct image account/token + real one-image acceptance/Neurons confirmation, trusted edge/IP controls, full independent security and manual device/zoom/screen reader, explicit owner merge and deploy authorization. Neither the image provider nor the live production chat was invoked/changed. No FlatAI email. |
Final exact-head CI confirmation — 2026-10-11Latest draft head
This resolves the earlier TypeScript/lighthouse failure as verified on the new SHA. No real Cloudflare image inference or new image account credentials were used. PR remains Draft and unmerged; production unchanged; public enablement remains NO-GO until the separated-account and real-inference/usage acceptance plus independent release authorization. |
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
New acceptance milestone — REAL isolated Workers Free image test PASS (2026-10-11)New owner-created image account was verified locally distinct from the chat account; image token HTTP 200 active, selected FLUX model searchable HTTP 200, and read-only AI access to old chat account denied HTTP 403. One authorized fixed-model REST request from Windows using the production adapter succeeded (1024×1024 JPEG, 22,030 bytes, 2,016 ms, process exit 0); no retries, secrets/images saved, or production changes. Local secret file image-only names, Git-ignored, ACL restricted, feature flag false. The isolated test checkout was removed afterward. See full sanitized evidence and release gate ledger, commit Still NO-GO for merge/deploy: exact actual Neuron count not dashboard-measured, token's full permission list not independently reviewed, authenticated Iran-VPS test NOT_RUN, trusted real client-IP rate limiting and manual mobile/screen reader/200% zoom review pending. Free tier is owner-attested. All image flags remain OFF. Exact-head CI running; do not conflate one-shot provider success with production rollout. |
Signed-off-by: alirezasafaeigfx <alirezasafaei.gfx@gmail.com>
Workers AI screenshot usage checkpoint — 2026-10-11Owner-provided new-account Workers AI usage dashboard confirms 172.8/10,000 Neurons shown as used today, for Docs and evidence revised in commit |
Owner decision supersedes this candidate — 2026-10-11STOP / NOT APPROVED FOR PRODUCT USE. The owner explicitly clarified: Cloudflare Workers AI must be used for chat only, and FlatAI's separate image-generator track must not have been deprioritized without a product-level agreement. The official Cloudflare image spike proved API execution but has unsuitable public Free capacity: the source implementation hard-caps Disposition: Close draft PR #239 without merge, deployment, feature activation, credential transfer, or branch deletion. This preserves technical audit history only, not a pending implementation candidate. Do not link Return priority to FlatAI browser-based draft PR #229 and blocker #230. Their Playwright + isolated-browser implementation remains an unmerged draft. Last controlled Linux result This is a product-direction correction; no claim that FlatAI is publicly production-capable, free/unlimited for automated multi-user use, or permitted for browser automation until independently evidenced. Final release still requires separate owner authorization. |
Scope — default-off image generation candidate (not a production release)
Phase A: official provider. A fixed-model Cloudflare Workers AI
@cf/black-forest-labs/flux-1-schnellserver adapter, explicit separate Free-account attestation, bounded bytes/pixels and metadata-stripping JPEG re-encoding. It never retries or scrapes FlatAI.Phase B: fail-closed backend.
POST /api/ai/imagedemands trusted same-origin POST, explicit consent, valid input and an atomically reserved image quota. Allimage:HMAC keys use the existing PostgreSQL table but never overwrite chat counters. Hard limits: 1/visitor/day, 1/visitor/minute, 5/account/day and 1/account/minute. Image account/token must be distinct from existing chat credentials. All image flags default OFF.Phase C: opt-in Persian UI. Adds RTL
/ai/image, responsive two-panel description/preview/download, full keyboard-labelled form, consent to transmission to Cloudflare, in-memory blob JPEG URL with cleanup, 45-second timeout, stop/late-response safeguards, quota/error UX and no automatic retry/history. The /ai hub only links when the backend gates are verified and enabled. The image page remains noindex/nofollow even on an enabled test deployment. No production flags or accounts modified.Evidence / checks
ci-coreretesting branch.pnpm security:secrets, andgit diff --check: PASS locally.921d2e494d2ef0539f12eee66c3125f517f12632. Its six hosted workflows must be checked to completion; no assumption that the previous SHA's green checks carry over.Unresolved / NO-GO for merge or deployment
AGENTS.md. No deployment, real inference, Cloudflare token access, DNS or production changes in this PR.Tracked at #238. Legacy FlatAI draft #229 remains untouched, blocked and not bypassed.