Archived case · VK parser and content pipeline

WTG

Where things are in the code, how to run it and what was checked.
Version 21841487f524 · prepared on 8 September 2026

About the project

The task was to combine VK content collection, image and text processing and operator review in one observable flow. Every stage had to leave a verifiable result and support retries without losing the original evidence.

WTG is a VK parser and content pipeline. It collects posts and related material through VK API and Playwright, stores raw evidence, queues OCR and classification and presents the result for operator review, labeling and publication decisions. The case records the interface, architecture, code map and measurements.

What sets the implementation apart

Raw evidence is stored separately from derived data. Queues separate collection, OCR, classification and editorial decisions; the operator sees the source and intermediate results before publishing. The code map connects screens and APIs to modules, tables and checks so a change can be traced end to end.

Application-code composition

Python content pipeline 60.7%Python / VK / Playwright 19.4%FastAPI / operator UI 12.6%Alembic / PostgreSQL 4.8%Python / OCR 2.5%

Shares use Git application-file bytes at pinned revisions. Each file belongs to one subsystem under scripts/generate-stack-share.mjs rules; tests, assets, dependencies and generated files are excluded. Rounded to 0.1%. This describes code composition, not proficiency.

  • The archived case has no live demo link; anonymized screens, diagrams and aggregate measurements document its behavior.
  • Job statuses and confidence values are not measurements of OCR or model accuracy.
  • Legacy noVNC and unavailable sections are not presented as working features.
  • Observed web-process memory growth is reported as a measurement; its code-level root cause was not established.

Screenshots, diagrams and source evidence retain their original language; captions and descriptions are translated.

Architecture and diagrams

  • Collection and long-running processing are separate jobs with leases and heartbeats.
  • OCR is separate from the web service, with its own queue, statuses and attempts.
  • Source publications, intermediate decisions and final materials have different roles.
  • The public archive contains anonymized images, documentation and aggregate measurements without user identifiers.
Observed WTG system architecture
Observed WTG system architecture · Mermaid ↓
VK parser and pipeline data model
VK parser and pipeline data model · Mermaid ↓
Publication processing sequence
Publication processing sequence · Mermaid ↓
Target worker separation from the project documentation
Target worker separation from the project documentation · Mermaid ↓

Code map: files and dependencies

This map is tied to version 21841487f524. The table lists the screen or API, related module and data.

FeatureScreen / APIModuleData / verification
Authorizationaccountsservices/auth.py, vk_user_token.pyauth_accounts, account_communities; browser/API states are considered separately
Job creation and executionschedules, processingservices/admin_control.py, cli/admin_worker.pyadmin_jobs, admin_job_step_logs; claim, heartbeat, retry, stale cleanup
API schedulingschedules, group-poolservices/api_posts_schedule.pyapi_schedule_steps, api_group_pool_items; schedule generation, queue, cooldown
Collectiongroups, postsservices/crawler.py, vk_parsers.pycommunities, posts, post_media; source, rereading, normalization
Profile and marketplacegroups tabs, marketcommunity_profile.py, community_market.py, community_services.pyprofile, products, services; filters and group association
Quick selectiongroup-poolfast_screen_pool.py, fast_wall_probe.pyfast_screen_pool_states, fast_screen_pool_checks; lease, due rows, retention
Pipelinepipelineservices/content_pipeline.pycontent_pipeline_runs/posts/items; stages and persisted results
OCRprocessing, post detailsocr.py, ocr_jobs.py, cli/ocr_worker.py, cli/ocr_sidecar.pyocr_jobs, post_media; completed/failed, attempts, timeout
Canonical materialsresultspublication_materials.py, publication-intelligencepublication_decisions/materials/media; decision-to-source relationship and revision
Labeling and teacherlabels, processingpublication_teacher.pyteacher runs/results/applications; labeling, discrepancies, application
Logslogs, file-logsweb/app.py, helpers file logsadmin_job_logs, step logs, files; event and file traces
DeliveryTelegram / MAXseparate bot repositoriescanonical output + bot tables; downstream consumes prepared data

Using the code map

  1. Before making a change, find the feature and trace its links to the API, state and storage.
  2. Check inputs, errors, repeated events and dependent workflows.
  3. After making a change, update the map and affected diagrams alongside the code.
  4. Run the related checks and link the new evidence to the source version.

Workflows and API

  1. Browse anonymized schedules, groups, pipeline and materials.
  2. Match a screen to its code-map entry and data diagram.
  3. Open queue/history aggregates and read the measurement date and limitations.

Verification of the published version

CI: prod-deploy ↗ · 61c78116 · historical run of a different version · 2026-06-16T11:57:17Z

CI: prod-deploy ↗ · 1299a357 · historical run of a different version · 2026-06-16T11:45:01Z

  • Sanitization of 30 captures was checked against the evidence index and full-size images.
  • The code map was matched to UI routes, APIs, modules, tables and checks for revision 2184148.
  • Queue, OCR, publication-material and table-size aggregates were retained without user records.

These checks apply to the listed version. Business metrics and model quality on an independent dataset were not measured.

Measurements

collection history
collection history · Source data ↓
container logs
container logs · Source data ↓
cpu samples
cpu samples · Source data ↓
material types
material types · Source data ↓
ocr status
ocr status · Source data ↓
table storage
table storage · Source data ↓
  • 30 meaningful screenshots of the actual interface retained.
  • Each screenshot includes its date, scenario and code revision.
  • 527,718 publications and 29,092 OCR jobs recorded; these are different entities, not quality metrics.

Running and operating

The server checkout and published audited repository have different SHAs. Each evidence source is identified separately; no equivalence is claimed between the old image and the checkout contents.

Stack

Python / FastAPI / JinjaOperations admin interface, JSON API and orchestration.
PostgreSQL / SQLAlchemy / AlembicPublications, jobs, decision versions, materials and migrations.
PaddleOCRSeparate OCR sidecar and worker.
Docker / Nginx / systemdFormer deployment of seven services and background jobs.

Materials and source code

Development and evidence period: June–July 2026. The archived case was prepared on 8 September 2026.

The evidence archive retains its original language.