Second audit round, findings fixed:
- ROADMAP was two versions stale: v1.3 still labelled 'current work',
the plans feature absent. All shipped sections now carry their
version, open work lives under 'next — current work' with real
issue numbers (#29/#30/#31) and the two pending experiments
- architecture.md Quota section documented only the v1.3 monthly
allowance; now covers the full plans system: free/pro table, both
402 codes, expiry downgrade, stacked renewals, admin endpoint and
the deliberate no-payment-gateway design (all claims verified
against limits.py/deps.py/routes_admin.py/handlers.py)
- CODE_OF_CONDUCT.md (Contributor Covenant 2.1) + CODEOWNERS —
community profile previously missing both
- CodeQL workflow: weekly + per-push SAST over Python
(security-extended) and web, results in the Security tab
- .env.example: WEBHOOK_TIMEOUT_SECONDS / WEBHOOK_ATTEMPTS existed in
Settings but were undocumented
- landing page: transparent-quota feature card (headline feature of
v1.4.0 was absent from the product face)
- CHANGELOG Unreleased section documents all of the above
Validated: YAML parses, HTML tag balance, linkcheck 25/25,
CI green on the previous commit.
- Persian-first RTL landing page in site/ (measured numbers, benchmark
table, screenshots, quickstart, architecture chain, og-image), pushed
to production by the new pages.yml workflow on every main push
- CI test job now measures branch coverage over sokhan + sokhan_bot and
appends a per-file markdown table to the job summary
(scripts/coverage_summary.py); pytest-cov joins the backend dev extra
- weekly dependabot updates (pip, npm, github-actions, docker) and a PR
template that repeats the measurement-first checklist
- README: fix stale honest-limits/roadmap claims — streaming decode and
signed webhooks shipped in v1.3.0, not open items; add Docker badge and
landing-page link
Streaming decode (ROADMAP v1.4): the worker now streams PyAV blocks and
emits the same 30-second windows from the block stream instead of decoding
the whole file to memory. iter_chunks reproduces chunk_samples exactly
(proven by test, including the short-tail fold); diarizers declare
requires_full_audio and take the legacy full decode automatically.
Measured whole-process peak RSS on identical mono 16 kHz WAVs:
30-minute file 86.4 MB streamed vs 355.6 MB full decode (4.1x),
10-minute file 84.9 MB vs 169.6 MB (2.0x) - streaming stays flat while
the full decode grows linearly with duration.
Signed webhooks (ROADMAP v1.5): POST /jobs accepts callback_url
(http/https, <=2048 chars, migration 0003). On completion or failure the
worker POSTs a JSON event signed Stripe-style (X-Sokhan-Signature:
t=<unix>,v1=<hex hmac-sha256(secret, '<ts>.<body>')>, 5-minute replay
window) after the DB session closes; a dead endpoint is retried once and
logged, never fatal to the job. WEBHOOK_SIGNING_SECRET enables signing.
40 new tests (streaming equivalence, lazy consumption, resampler flush
parity with decode_audio, signature scheme, delivery retries, end-to-end
signed callback on completed and failed jobs); full suite 154 passing,
ruff and mypy clean.
Closes the two product-feature gaps still open in the ROADMAP, plus the
v1.5 deploy item:
- Persian punctuation restoration (v1.4): a deterministic rule-based
post-pass in the worker pipeline and on the OpenAI-compatible endpoint
behind PUNCTUATION_ENABLED (default on). Question sentences get a real
؟ (آیا/چرا/چطور/کی/کجا/کدام/چیه word family), declaratives get a
period, Latin ,/;/? map to ،/؛/؟, spacing is fixed around every mark
(no space before, one after), and decimals/clock times are deliberately
left intact. The WER benchmark path bypasses the pipeline, so the
measured numbers stay comparable; search normalization split into
normalize_for_search (punctuation stripped on column and query) so
phrase queries match the punctuated text while benchmarks keep using
normalize_persian unchanged. The browser demo ports the same rule
family verbatim (18-case parity check in scripts/), so the Space shows
transcripts in the product's shape.
- Confidence-aware review flags (v1.5): the engine's exp(avg_logprob)
now survives the whole pipeline — segments.confidence column (Alembic
0002), GET /jobs/{id}, the JSON export, verbose_json — and segments
below LOW_CONFIDENCE_THRESHOLD (0.5 default) are marked with a ⚠
prefix in SRT/VTT/DOCX exports and a 'نیاز به بازبینی / Needs review'
badge (hover shows the percent) in the dashboard timeline. Reviewers
re-listen exactly where the model was unsure.
- Prebuilt images on GHCR (v1.5): the Docker workflow builds and pushes
ghcr.io/abolfazlrwm/sokhan-api and ...-web on pushes to main and
version tags (latest / sha-* / semver) with the GITHUB_TOKEN, no
extra secrets; the compose file references the same image names next
to its build: blocks so both pull and build paths work, and now also
passes WHISPER_BEAM_SIZE / WHISPER_INITIAL_PROMPT / PUNCTUATION_ENABLED
/ LOW_CONFIDENCE_THRESHOLD through to the containers.
Docs updated end to end (README features + config table + prebuilt-image
section, ROADMAP ticks v1.4/v1.5, architecture request-flow, CHANGELOG).
101 tests passing (new: punctuation rules, search normalization, review
flags on exports, confidence flow through API/exports/verbose_json);
ruff and mypy clean; web build clean; demo punctuation port verified
against the same test cases as the backend.
Closes the biggest feature gaps found in a full inventory pass:
- GET /jobs/{id} now returns the per-segment timeline (start / end /
speaker / text, 1-based position) the database always stored but never
exposed; the dashboard renders a timestamped, speaker-labelled
transcript view with copy-to-clipboard and a delete button (the DELETE
endpoint existed and was tested, but no UI called it)
- New transcript exports: WebVTT and structured JSON; the
OpenAI-compatible endpoint completes its response_format set with vtt
- Engine decoding knobs: WHISPER_BEAM_SIZE and WHISPER_INITIAL_PROMPT
(the v1.4 initial-prompt lexicon item)
- The Telegram bot now delivers what it always promised: a persisted
completion notifier pushes the transcript in Telegram-sized chunks (or
a failure notice) the moment the backend finishes; jobs stuck over six
hours are released instead of leaking
- Weekly benchmark workflow re-runs the fixture against the committed
baseline (benchmarks/results/baseline.json) and fails on a >1 WER point
regression; benchmark_wer.py gained --archive / --baseline /
--max-regression with the gate logic unit-tested in
benchmarks/regression.py
92 tests passing (new: segments+exports, vtt, engine options, notifier
decision logic, store tracking and legacy migration, regression gate);
ruff and mypy clean; next build clean
The pyannote engine and the DIARIZATION_ENGINE factory landed earlier
without unit coverage of their own: add offline tests for the provider
(missing HF token raises DiarizerUnavailableError before any load attempt,
annotation itertracks convert to SpeakerTurn, the temporary WAV is cleaned
up) and for the factory success path (a fake pyannote.audio in sys.modules
plus a token yields a PyannoteDiarizer with the configured model; unknown
engine values fall back to the stub). No test touches the network, gated
weights or torch.
docs/architecture.md now documents the diarization stage between decode
and chunking, the three DIARIZATION_ENGINE values, and states plainly that
the energy engine's labels are acoustic similarity rather than speaker
identity (ADR 0004, rule 3).
Closes#8
HF's 2026 pricing gates Gradio/Docker Spaces behind PRO (create_repo came
back 402), so the demo ships as a free Static Space instead: transformers.js
runs Whisper ONNX q8 entirely client-side — RTL Persian UI, mic + file +
bundled benchmark sample clip, base/small selectable, nothing uploaded.
Verified end to end with a headless browser: it loaded the Space, fetched
the bundled Common Voice (fa) sample, downloaded the model and transcribed
the clip on-device (3.5 s clip in 5.0 s); screenshot embedded in the README.
One real bug found and fixed by that test: the sample path deadlocked on
the busy-guard before starting inference.
- space/: static demo (index.html/demo.js/worker.js) at the root; the
Gradio app moves to space/gradio/ for self-hosting or PRO Spaces
- model card published to hf.co/Abol0pati/whisper-small-fa-sokhan with the
measured numbers and honest caveats; demo paragraph updated to describe
what actually runs where
- notebook: cell 10 now writes the model card only (a Colab-run Gradio
Space would 402), new cell 11 uploads merged HF weights to unlock the
ONNX/browser fine-tune path
- ROADMAP: v1.3 progress recorded with the pricing discovery; new item
for pointing the browser demo at the fine-tuned ONNX
The v1.2.0 fine-tune is measured but only visible from inside the repo.
This makes the work visible and sets the next phase in stone:
- space/: a Gradio demo Space serving the checkpoint with the production
engine (faster-whisper, CPU int8), RTL Persian UI, and an A/B radio
against the untuned baseline; compatible with Gradio 5 and 6 (css moved
to launch() in 6.0), linted by CI from now on
- notebook cell 10: publishes the Space and writes the model card onto
the model repo from Colab in one run, pointing the demo at whichever
repo id cell 9 used
- training/model_card.md: YAML-fronted card with the measured numbers
(WER 79.3% vs 80.5%, CER 24.9% vs 26.7%), honest caveats about the
12-clip fixture and 500-clip training set, usage snippet, reproduction
path; numbers must be re-measured before the scaled run changes them
- docs/ROADMAP.md: v1.3 public face / v1.4 engine quality / v1.5 product
surface / v2.0 candidates, plus release-hygiene rules; linked from the
README Roadmap section
- .pre-commit-config.yaml for contributors
Rule unchanged: nothing here claims a number that benchmark_wer.py
did not print.
- guard the google.colab import in the save cell so the same notebook
runs on Kaggle (zip mode prints the path instead of crashing)
- docs/free-gpu.md: document the "Failed to assign a backend -
restriction in your location" error (sanctioned-region IPs) with the
VPN reload and Kaggle import fixes
- The Colab data cell pointed at mozilla-foundation/common_voice_17_0, which
no longer ships data files (verified 2026-11-15: its repo tree holds only
README and .gitattributes) and whose loading script is unsupported since
datasets 3. It now streams the public CC-0 parquet mirror
pymmdrza/Common-Voice-Speech-26.0-Persian-Clean (train split only, same
release as the benchmark fixture) - no account, no token, no gating, so
the token cell is only needed when saving to the Hub
- The trainer checkpoints every 150 optimizer steps instead of per epoch, so
preempted Colab/Kaggle sessions lose at most a few minutes
- The chain executed against real data end to end on CPU: 518 clips / 45 min
-> LoRA (loss 3.84 -> 1.55) -> merge -> CT2 int8 -> faster-whisper serve
-> benchmark; no WER gain at this scale, documented honestly
- training/README, docs/free-gpu.md and CHANGELOG updated with the measured
facts and the corrected data-source guidance
docs/free-gpu.md lists the verified free GPU options (Colab free T4,
Kaggle ~30 GPU-h/week, Lightning AI credits) with the run recipe. The
README features and honest-limits sections now describe the shipped
diarization engines accurately, the changelog moves diarization into
[Unreleased] where the code actually lands, and the v1.1.0 over-claim is
corrected.
DIARIZATION_ENGINE selects stub | energy | pyannote. The energy engine is a
numpy-only voiced-region two-cluster heuristic; pyannote is the real neural
pipeline, gated behind an HF token and the optional diarize extra. The
factory and the pipeline treat diarization as an enhancement: any failure
degrades to no speaker labels instead of failing the job. Speaker labels
flow into segments and the SRT export. Fixes the diarization tests' missing
shared fake_engine fixture (they could never run on the source branch).
Includes real captures of the Persian landing page, the configuration table,
the API surface, and an honest status section: no accuracy benchmark has
been published yet, diarization is still a stub, and long recordings are
decoded fully into memory.