# DigiDala — текущая точка проекта

Этот файл является оперативным журналом состояния проекта.
Он дополняет ROADMAP, ADR и CHANGELOG и должен обновляться
после каждого существенного этапа разработки.

Исторические разделы ниже описывают состояние проекта на дату соответствующего
чекпоинта. Формулировки «текущий/current» внутри исторической записи не заменяют
верхний блок `Current State`, который отражает настоящее состояние проекта.

---

## Current State

- Project: DigiDala
- Current Git branch: `main`
- Current Git HEAD: `21fb337` (`fix: localize legal documents and open them in Mini App`)
- `origin/main`: `21fb337`
- Current tagged Git checkpoint: `v0.4.0-alpha.50.9.11`
- Current local candidate: `v0.4.0-alpha.50.9.12` (environment-configurable Mini App URL; not yet committed/tagged/deployed)
- Latest documentation checkpoint: `Alpha 50.9.11 deployed; legal WebView and localization QA reported working; production/staging separation is now being prepared`
- Product baseline tag: `v0.4.0-alpha.28`
- Current source/tagged checkpoint: `v0.4.0-alpha.50.9.11`
- Current active test release: `v0.4.0-alpha.50.9.11`
- Current active release path: `/opt/pixdala/releases/v0.4.0-alpha.50.9.11`
- Current symlink: `/opt/pixdala/current`
- Test API: `127.0.0.1:8090`
- Test Mini App: `https://im-test.bktis.ru/apps/miniapp/`
- Test DB: `/opt/pixdala/data/pixdala-alpha-test.db`
- Telegram test bot: `@PixDala_bot`
- Planned production bot: `@DigiDala_bot`
- Planned production Mini App: `https://digidala.ru/apps/miniapp/`
- Production infrastructure is not yet deployed; staging remains the only active runtime for the release process.
- Telegram Stars support remains live as a project-support flow; Sandbox remains free and separate from the internal `pix` economy.
- The internal `pix` economy and paid Support Mandala are implemented and hardened through the Alpha.49.x line.
- Paid cell debits reference immutable, cycle-scoped occupation events rather than reusable cell ids.
- Existing legacy Pix ledger rows are preserved unchanged; historical occupation reconstruction is intentionally not performed.
- Alpha.50.9.11 passed the complete automated verification on the local machine and again on the VPS: Structure OK, JavaScript syntax OK, Unit 53/53, Integration 58/58, API 23/23 (134/134 total).
- Alpha.50.9.11 was released from commit `21fb337`, tagged `v0.4.0-alpha.50.9.11` and deployed to `/opt/pixdala/releases/v0.4.0-alpha.50.9.11`.
- Alpha.50.9.11 added the English legal-document set, RU/EN document routing and Telegram WebView/deep-link document opening. Manual Telegram checking reported the updated document flows working.

- Alpha.50.9.12 was released from commit `177fc74`, tagged `v0.4.0-alpha.50.9.12`, deployed to `/opt/pixdala/releases/v0.4.0-alpha.50.9.12` and manually verified in Telegram. Its purpose was to make the bot Mini App URL environment-configurable while preserving the existing test URL as fallback.
- Alpha.50.9.13 is the current local production-infrastructure candidate. It adds isolated DigiDala production services under `/opt/digidala`, production Nginx configuration, deployment/rollback scripts and a separate production database path. DNS, certificate issuance and `@DigiDala_bot` activation are intentionally not yet performed.


## 2026-10-02 — Alpha.50.9.2 verified checkpoint

Alpha.50.9.2 is a focused Telegram bot QA patch on top of Alpha.50.9.1.

### Release identity

```text
Version: 0.4.0-alpha.50.9.2
Commit: 75c430c
Tag: v0.4.0-alpha.50.9.2
Active release: /opt/pixdala/releases/v0.4.0-alpha.50.9.2
Status: deployed; manual Telegram QA passed
```

### Changes

- fixed literal `\n` sequences in system-default localized bot welcome content;
- added migration `018_bot_localization_newline_fix.sql` without rewriting administrator-edited localized content;
- changed `/language` so the current message is immediately replaced by the selected-language welcome message and keyboard;
- removed the separate language-change notice from the normal switching flow.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 43/43
Integration: 50/50
API: 17/17
Total: 110/110
```

### Deployment and manual Telegram QA

- Exact tag `v0.4.0-alpha.50.9.2` was deployed successfully; all three test services were active and `HEAD` matched the exact tag.
- Migration `018_bot_localization_newline_fix.sql` was applied successfully during API startup.
- Manual Telegram QA passed for real English line breaks and immediate RU↔EN welcome-message replacement without a second `/start` or a separate language-change notice.

## 2026-10-02 — Alpha.50.9.1 verified checkpoint

Alpha.50.9.1 completes the Telegram bot RU/EN localization and branding foundation introduced by Alpha.50.9.

### Release identity

```text
Version: 0.4.0-alpha.50.9.1
Commit: 3200550
Tag: v0.4.0-alpha.50.9.1
Active release: /opt/pixdala/releases/v0.4.0-alpha.50.9.1
Status: deployed; manual Telegram QA passed
```

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 42/42
Integration: 49/49
API: 17/17
Total: 108/108
```

### Deployment and manual Telegram QA

- Exact tag `v0.4.0-alpha.50.9.1` was deployed successfully; all three test services were active and `HEAD` matched the exact tag.
- Manual Telegram QA passed for RU/EN language selection, saved preference and localized bot content.
- The approved Russian `О нас` text was restored through the bot administrator content editor after legacy test-database content was observed; this was a runtime data correction and did not require a code change.
- The follow-up Alpha.50.9.2 patch later closed the welcome-formatting and immediate-language-switch QA defects found during continued Telegram testing.

## 2026-09-24 — Alpha.50.6.8 deployed checkpoint

Alpha.50.6.8 closed the first post-release Competitive navigation/archive issues found during live Mini App testing and established the user-visible archive/navigation behavior at that checkpoint.

### Release identity

```text
Version: 0.4.0-alpha.50.6.8
Base: v0.4.0-alpha.50.6.7
Commit: 6af8591
Tag: v0.4.0-alpha.50.6.8
Active release: /opt/pixdala/releases/v0.4.0-alpha.50.6.8
Status: deployed; initial manual Telegram QA passed
```

### Changes

- generation-specific campaign/archive artwork URL versions;
- permanent Mini App Archive entry and archive index for Special and Competitive Mandalas;
- navigable empty Special/Competitive spaces;
- circular left/right navigation including inactive campaign spaces;
- explicit navigation-space metadata and route/bootstrap dispatch for future user-visible space types.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 21/21
Integration: 46/46
API: 17/17
Total: 84/84
```

### Deployment and manual Telegram QA

- Exact tag `v0.4.0-alpha.50.6.8` was committed as `6af8591`, pushed to GitHub and deployed successfully.
- Initial manual QA passed for the permanent Archive entry/index, empty Special/Competitive navigation and circular left/right traversal.
- The client-specific stale Competitive artwork symptom previously seen with older Owl/Lark artwork is no longer reproduced: the affected client shows the current uploaded artwork for a newly created Competitive campaign.
- Two Competitive campaigns have been created for queued-lifecycle verification.
- The full Competitive lifecycle through winner determination, destruction, archive and automatic activation of the next queued campaign remains open.

## 2026-09-23 — Alpha.50.6.7 verified checkpoint

Alpha.50.6.7 fixes the Mini App "Копировать ссылку" action so it produces clean Telegram Main Mini App deep links instead of copying the current browser/WebApp runtime URL.

### Release identity

```text
Version: 0.4.0-alpha.50.6.7
Base: v0.4.0-alpha.50.6.6
Commit: 42445ea
Tag: v0.4.0-alpha.50.6.7
Status: deployed to VPS; manual Telegram QA passed
```

### Changes

- Ordinary Mandala share links use `https://t.me/PixDala_bot?startapp=<slug>`.
- Special Mandala share links use `startapp=campaigns`; QA campaign links preserve `campaigns-qa-<slug>`.
- Competitive Mandala share links use `startapp=competitive`.
- The copied link no longer includes Telegram WebApp runtime `initData` or the current browser URL.
- The share button uses a higher-contrast DigiDala style and visible copied-state feedback.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 19/19
Integration: 46/46
API: 17/17
Total: 82/82
```

### Deployment / manual QA

The exact tag `v0.4.0-alpha.50.6.7` was committed as `42445ea`, pushed to GitHub and deployed successfully to `/opt/pixdala/releases/v0.4.0-alpha.50.6.7`. Manual Telegram QA passed for share links under all tested Mandala types: ordinary Mandalas, Special, Competitive, Support and Creative. The copied links open the requested Mandala in the Mini App and no longer expose the current browser URL or Telegram WebApp runtime data. The share button text is clearly readable on the dark interface and the copied-state feedback is visible.

The full Competitive lifecycle remains open for a separate end-to-end test.

## 2026-09-23 — Alpha.50.6.6 verified checkpoint

Alpha.50.6.6 fixes a Mini App navigation-state race observed when entering active Special and Competitive spaces with the left/right arrows.

### Candidate identity

```text
Version: 0.4.0-alpha.50.6.6
Base: v0.4.0-alpha.50.6.5
Status: deployed to VPS; manual Telegram QA passed
```

### Observed behavior

- Direct launch of an active Competitive or Special Mandala works.
- Entering the same space through the Mini App left/right arrows could show the empty-space message.
- Refreshing the Mini App made the same active space load correctly.
- The symptom reproduced for both Special and Competitive spaces.

### Root cause / fix

- Special-space arrow navigation did not stop the previous Mandala sync before starting the new bootstrap.
- In-flight requests from the previous route could continue during the transition and overwrite the new route state.
- The client now invalidates navigation generations, resets the previous route state, stops sync before special-space transitions, rejects stale responses, and restarts sync only after a successful bootstrap.
- Special/Competitive bootstrap errors now render a dedicated load-error state instead of the empty-space state.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 16/16
Integration: 46/46
API: 17/17
Total: 79/79
```

### Deployment / manual QA

The exact tag `v0.4.0-alpha.50.6.6` was committed as `d07f2ce`, pushed to GitHub and deployed successfully to `/opt/pixdala/releases/v0.4.0-alpha.50.6.6`. Manual Telegram QA passed: active Special and Competitive spaces open correctly through left/right navigation without a page refresh, and the previous false empty-state symptom was not reproduced.

The complete Competitive lifecycle remains open for a separate end-to-end test.

## 2026-09-23 — Alpha.50.6.5 verified checkpoint

Alpha.50.6.5 fixes a manual QA regression in Competitive campaign creation when the new campaign is queued behind an already active Competitive campaign.

### Candidate identity

```text
Version: 0.4.0-alpha.50.6.5
Base: v0.4.0-alpha.50.6.4
Status: deployed to VPS; queued creation QA passed
```

### Root cause and fix

- The internal Competitive create API returned a full view with `campaign.mandala` for an immediately active campaign, but only a compact queue item for a queued campaign.
- The administration bot expects `campaign.mandala.cell_price_pix` in the create response, causing the observed `Cannot read properties of undefined (reading 'cell_price_pix')` error for queued creations.
- The repository now returns one consistent full Competitive campaign view for both active and queued creations.
- The API regression test verifies the queued response includes `mandala.cell_price_pix`, `rows` and `cols`.
- Alpha.50.6.4's fixed 36/100/400 size behavior is unchanged.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 14/14
Integration: 46/46
API: 17/17
Total: 77/77
```

### Deployment / manual QA

The exact tag `v0.4.0-alpha.50.6.5` was committed as `25d4186`, pushed to GitHub and deployed successfully. Manual Telegram QA confirmed that a new Competitive campaign can be added to the queue while another Competitive campaign is active.

## 2026-09-23 — Alpha.50.6.4 deployed checkpoint

Alpha.50.6.4 extends Competitive Mandala creation with a controlled field-size choice and updates the campaign post-destruction message. The exact tag was deployed successfully; manual QA subsequently found a queued-creation response-shape defect.

### Candidate identity

```text
Version: 0.4.0-alpha.50.6.4
Base: v0.4.0-alpha.50.6.3
Status: deployed to VPS; manual QA found a queued-creation response-shape bug
```

### Changes

- `/new_competitive` offers exactly 36 (6×6), 100 (10×10) and 400 (20×20) cells after both artwork files are uploaded.
- The selected size is passed to the backend and stored as the concrete Mandala `rows`/`cols`/`total_cells`.
- The backend accepts only those three sizes; omitted `cellCount` remains 400 for compatibility.
- Competitive winner detection remains dimension-driven and therefore applies to all supported sizes.
- The post-destruction campaign text now says `Благодаря участникам рисунок полностью открыт, и мандала завершена. История мандалы сохранена в архиве.`
- Mini App/package version and cache-busters are `0.4.0-alpha.50.6.4`.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 14/14
Integration: 46/46
API: 17/17
Total: 77/77
```

The SQLite experimental warning remains non-fatal. Candidate-file `git diff --check` passes. The uploaded archive contains unrelated pre-existing working-tree modifications, so repository-wide whitespace checking is not a clean release gate for this archive.

### Deployment / manual QA

The exact tag `v0.4.0-alpha.50.6.4` was committed, pushed and deployed successfully. Manual Telegram QA then found the queued Competitive creation response-shape defect described above.

## 2026-09-17 — Alpha.50.5.4 verified checkpoint

Alpha.50.5.4 restores the client-side destruction preview that was broken by the Alpha.50.5.3 navigation/state fix. The root cause was an undefined `previewAsset` in the destruction preview path; the fix explicitly resolves the preview artwork from the active campaign artwork for campaign Mandalas and from the ordinary Mandala configuration asset for Sandbox/Support.

### Release identity

```text
Commit: 277a071
Tag: v0.4.0-alpha.50.5.4
Active release: /opt/pixdala/releases/v0.4.0-alpha.50.5.4
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 40/40
API: 16/16
Total: 66/66
```

### Deployment and manual Telegram QA

- The exact tag `v0.4.0-alpha.50.5.4` was deployed successfully.
- Sandbox and Small Creative Mandala were filled and destroyed through the expected scenario.
- Destruction sound, particle animation and other destruction effects worked.
- Post-destruction state and navigation remained correct.
- No visual impact on other Mandalas was observed.
- Support and campaign artwork paths were not separately distinguishable in the manual visual check; no regression of their existing behavior was observed.

Alpha.50.5.4 remains a historical verified checkpoint.

---

## 2026-09-19 — Alpha.50.6.1 deployed; Competitive QA almost complete

Alpha.50.6.1 was the deployed Competitive Mandala checkpoint at that time. It addresses the four issues found during manual QA of Alpha.50.6 without changing the existing Mandala modes.

### Release identity

```text
Commit: 97df895
Tag: v0.4.0-alpha.50.6.1
Active release: /opt/pixdala/releases/v0.4.0-alpha.50.6.1
```

### Changes

- competitive status reaches `Синхронизировано` after successful competitive bootstrap;
- competitive creation asks the admin for the cell price in Pix;
- `/competitive_edit <slug>` edits price and description; price changes are locked after the first occupied cell, while description remains editable;
- active competitive campaigns enter the navigation-only list used by the existing arrows, while remaining outside the regular cyclic catalog;
- a competitive-only vertical divider marks the 10+10 cell split;
- regression tests verify regular catalog/navigation and Sandbox/Support behavior remain unchanged when competitive campaigns are created or edited.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 44/44
API: 17/17
Total: 71/71
```

The exact release tag was pushed to GitHub and deployed successfully through the normal deployment workflow. The same automated verification passed in the deployed release.

### Manual Telegram QA

Passed on Mobile and Desktop:

- direct Competitive launch and `Синхронизировано`;
- left/right navigation into Competitive and back;
- Competitive creation with configurable price;
- Competitive description and price editing;
- price lock after first occupation;
- occupation on both Competitive sides;
- center divider;
- regression spot-checks of existing Mandala types.

During Desktop QA, one transient direct-launch case loaded the previous `app.js` version (`alpha.50.6`) instead of `alpha.50.6.1`. The condition later disappeared and could not be reproduced. No code change was made for this observation.

### Remaining verification

The only remaining manual QA item is the complete Competitive lifecycle:

```text
one side reaches 200 occupied cells
→ winner_side
→ destroying
→ archived
→ next queued Competitive becomes active
```

This final end-to-end lifecycle test has not yet been completed.

### Regression requirement

No behavioral change is intended for Sandbox, Small Creative, Large Creative, Support, Special/Daughter or their archive flows. Shared code paths remain covered by regression tests whenever competitive behavior is changed.

---

## 2026-09-18 — Alpha.50.6 candidate

Alpha.50.6 was the next product-stage release after the verified Alpha.50.5.9 checkpoint. It combined the first content-administration layer for `@PixDala_bot` with the first `competitive` campaign mode and was tagged as `v0.4.0-alpha.50.6`, deployed successfully, and manually exercised in Telegram. The manual test created the first competitive Mandala successfully but exposed the four follow-up issues recorded in the 2026-09-19 Alpha.50.6.1 candidate entry above.

### Product decisions implemented

- Public menu keeps one full-width `🪷 Открыть DigiDala` button, then a 2×2 grid for Small/Large Creative and Competitive/Special Mandalas, followed by `ℹ️ О нас` and `⭐ Поддержать проект`.
- The main welcome message and `О нас` message are stored as editable bot settings rather than hard-coded content.
- `О нас` uses the ordinary `start=about` deep link and opens in private chat.
- Administrative commands are private-chat-only and hidden from public help/menu.
- Admin roles are `content_admin` and `superadmin`; bootstrap comes from the external `TELEGRAM_SUPERADMIN_IDS` environment variable.

### Competitive Mandala

- technical mode: `competitive`;
- 20×20 / 400 cells;
- 200 cells per image side;
- initial implementation used a fixed price of 10 Pix per cell; Alpha.50.6.1 makes the price campaign-specific and administrator-defined;
- one cell per Telegram user per cycle;
- no team entities; the user chooses the side/image directly;
- the first side to reach 200 occupied cells wins;
- two separate PNG assets, 1024×2048 each, are rendered side-by-side;
- free cells use the existing Sandbox/Support grayscale SVG marker.

### Queue and lifecycle

Competitive campaigns may be prepared in advance through the bot. The server maintains queued/active state, archives a completed campaign with `winner_side`, and activates the next queued campaign automatically after destruction. New content therefore does not require a source release.

### Candidate verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 43/43
API: 17/17
Total: 70/70
```

These checks were run in the local Linux preparation workspace. The candidate still requires the normal Windows `npm.cmd run check`, Git review/commit/tag, exact-tag VPS deployment and manual Telegram QA before it becomes a verified checkpoint.

---

## 2026-09-18 — Alpha.50.5.9 verified checkpoint

Alpha.50.5.9 was the tagged and deployed test checkpoint at that time. It is a focused Daughter-campaign copy/UX refinement after the Alpha.50.5.7–50.5.8 archive-trace work.

### Release identity

```text
Commit: ab31892
Tag: v0.4.0-alpha.50.5.9
Active release: /opt/pixdala/releases/v0.4.0-alpha.50.5.9
```

### Changes

- The trembling-state hint now reports the actual number of remaining cells instead of always saying `осталась 1 клетка`. Russian singular/plural forms are handled for values such as 1, 2, 5, 11 and 21.
- The extra final CTA sentence `Поможем ей дорисовать мечту? 🎨` was removed from the Daughter campaign description.
- Migration `014_daughter_copy_cleanup.sql` applies the copy cleanup to both `daughter` and `daughter-qa` and is idempotent.
- The campaign API integration test was updated to verify the CTA is absent and the resulting five-line paragraph layout.
- Mini App cache-busters and package/client version were advanced to `0.4.0-alpha.50.5.9`.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 40/40
API: 16/16
Total: 66/66
```

The same complete automated check passed inside the VPS release created by `scripts/deploy-test.sh v0.4.0-alpha.50.5.9`.

### GitHub and deployment

- Commit `ab31892` was pushed to `main`.
- Tag `v0.4.0-alpha.50.5.9` was pushed successfully.
- The VPS deployment script fetched the tag, created `/opt/pixdala/releases/v0.4.0-alpha.50.5.9`, ran the complete check, switched `/opt/pixdala/current`, restarted the test web/API/bot services and completed HTTP verification.
- The deployment finished with `TEST DEPLOY УСПЕШНО ЗАВЕРШЁН`.

Note: `/opt/pixdala/current` is a release path and is not itself a Git checkout, so `git fetch --tags` was correctly performed by the deployment script from `/opt/pixdala/repo`.

### Manual Telegram QA

The Daughter QA campaign was exercised through the expected end-to-end scenario. Manual checks confirmed:

- the dynamic trembling hint shows the actual remaining count, including the expected pluralization;
- the Daughter description no longer contains the removed CTA sentence;
- destruction, thank-you state and archive navigation work as expected;
- archived participant trace colors, whole-trace hover highlighting and message icons remain correct;
- the previously verified campaign archive behavior remains intact.

### QA cleanup

The temporary QA copy was removed after testing:

```text
node scripts/campaign-qa.mjs cleanup daughter-qa
```

The subsequent `campaign-qa.mjs list` returned an empty table, confirming that no temporary QA campaigns remain in the test database. The real `daughter` campaign was not modified by the cleanup.

Alpha.50.5.9 is therefore the current fully verified functional checkpoint.

---

## 2026-09-17 — Alpha.50.5 local candidate: Особые мандалы

Alpha.50.5 is the first implementation of the new **Особые мандалы** product space. The user-facing term is **Особые мандалы**; the technical model is `campaigns`.

The first campaign is:

```text
Title: Подарок для юной художницы
Slug: daughter
Mandala: #5
Grid: 10×10 / 100 cells
Price: 370 Pix per cell
Goal: Графический планшет для дочки
```

The campaign uses the supplied 2048×2048 PNG as the hidden target artwork and the supplied cat SVG as its campaign-only free-cell marker. Campaign Mandalas are excluded from the regular Mandala catalog. The stable entry point is the `campaigns` Mini App route and the bot button **Особые мандалы**.

After destruction, a campaign is archived rather than reset into a new cycle. The archive stores the campaign goal, start/end dates, final artwork, participation statistics, each participant's cells and Pix contribution, and non-empty user messages by original cell position. The archive is exposed through a separate API and UI route.

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 40/40
API: 16/16
Total: 66/66
```

Deployment: **not performed**. Manual Telegram QA: **pending**.

## 2026-09-16 — Alpha.50.4 price-display/layout follow-up

Alpha.50.4 is the follow-up to the deployed Alpha.50.3 after manual Telegram QA found two release-gating UX defects.

Alpha.50.3 itself was successfully committed as `1a0efa3`, tagged `v0.4.0-alpha.50.3` and deployed to `/opt/pixdala/releases/v0.4.0-alpha.50.3`. Automated verification was 62/62. Manual QA then showed that the paid-cell price did not appear because the Mandala detail API response omitted `cell_price_pix`. The same QA also showed the Pix purchase row squeezing the `Купить` button on narrow screens and lacking the requested spacing before the package selector.

Alpha.50.4 fixes only those two confirmed causes: the Mandala detail API now exposes the server price, and the purchase-row CSS uses explicit spacing plus a fixed compact button width. Alpha.50.3 copy, Pix economy and purchase behavior remain unchanged.

### Candidate identity

```text
Version:
0.4.0-alpha.50.4

Base release:
v0.4.0-alpha.50.3
```

### Release status

- Release commit: `59b4be3`
- Tag: `v0.4.0-alpha.50.4`
- Automated verification: **62/62 passed** (10 unit, 37 integration, 15 API; structure and JS checks also passed).
- GitHub: commit and tag pushed successfully.
- Deployment: **successful** to `/opt/pixdala/releases/v0.4.0-alpha.50.4`; `/opt/pixdala/current` points to this release.
- Manual Telegram QA: **passed on Android and Desktop**.
- Verified: Support price `95 Pix` is visible below the Mandala and in the cell-occupation modal; other Mandalas are unchanged; the Pix purchase row and `Купить` button remain correctly spaced and fully visible on narrow screens.

### Final Alpha.50.4 verification

The deployed Alpha.50.4 release passed manual Telegram QA on Android and Desktop. The Support Mandala shows the server-provided `95 Pix` price both in the persistent text below the Mandala and in the cell-occupation modal. Other Mandalas remain unchanged. The Pix purchase row has the requested spacing, and the `Купить` button stays fully visible on narrow screens. The two Alpha.50.3 release-gating defects are therefore closed.

## 2026-09-16 — Alpha.50.3 deployed, manual QA failed

Alpha.50.3 was released as commit `1a0efa3`, tag `v0.4.0-alpha.50.3`, and deployed successfully to `/opt/pixdala/releases/v0.4.0-alpha.50.3`. Automated verification was 62/62 and the deployment script completed successfully.

Manual QA on Android and Desktop found two release-gating defects: `cell_price_pix` was not included in the paid Mandala detail API response, so the new persistent price microcopy stayed on the fallback text; and the Pix purchase row squeezed the `Купить` button on narrow screens while the requested spacing before the package selector was absent.

## 2026-09-16 — Alpha.50.2 verified deployment checkpoint

Alpha.50.2 changes the internal Pix economy to **1 Star = 1 Pix**, changes the purchase
packages to **1 / 50 / 100 / 500 / 1000 / 2000 Pix**, and changes the Support Mandala
price to **95 Pix per cell**.

### Release identity

```text
Commit:
be9db62

Tag:
v0.4.0-alpha.50.2

Active release:
/opt/pixdala/releases/v0.4.0-alpha.50.2
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 37/37
API: 15/15
Total: 62/62
```

The exact tag was pushed to GitHub and deployed successfully through:

```text
scripts/deploy-test.sh v0.4.0-alpha.50.2
```

Manual Telegram testing confirmed that the new Pix purchase interface and 1:1 pricing
model behave as expected. Direct paid-cell debit was not manually completed because the
test balance remained below the new 95-Pix Support cell price.

## 2026-09-16 — Alpha.50.1 verified

Alpha.50.1 adds a compact occupied-cell information plate for both Creative Mandalas. Clicking an occupied visual cell now opens a small popup showing only the participant name. The existing full occupied-cell information window remains unchanged for message-mode Mandalas.

### Release identity

```text
Commit:
53c2def

Tag:
v0.4.0-alpha.50.1

Active release:
/opt/pixdala/releases/v0.4.0-alpha.50.1
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 37/37
API: 15/15
Total: 62/62
```

The exact tag was pushed to GitHub and deployed successfully through:

```text
scripts/deploy-test.sh v0.4.0-alpha.50.1
```

### Manual Telegram QA

Passed:

- occupied cells in the Small Creative Mandala open a compact name-only popup;
- occupied cells in the Large Creative Mandala open the same compact name-only popup;
- the popup updates correctly when moving between different occupied cells;
- Android and Desktop display the new popup correctly;
- the existing detailed occupied-cell information window for non-visual Mandalas remains unchanged.

## 2026-09-16 — Alpha.50 verified

Alpha.50 adds the Large Creative Mandala as a second independent visual-mode Mandala while preserving the existing Creative Mandala as the Small Creative Mandala.

### Release identity

```text
Commit:
4c3876c

Tag:
v0.4.0-alpha.50

Active release:
/opt/pixdala/releases/v0.4.0-alpha.50
```

### Product changes

- Existing `creative` remains 10×10 / 100 cells and is named **Малая мандала творчества**.
- New `creative-large` is 20×20 / 400 cells and is named **Большая мандала творчества**.
- Both use the existing `visual` cell mode, color palette, lifecycle, destruction flow and cycle reset behavior.
- Each Mandala has its own Telegram Mini App deep link.
- The bot exposes separate inline buttons for the Small and Large Creative Mandalas.

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 37/37
API: 15/15
Total: 62/62
```

The exact tag was pushed to GitHub and deployed successfully through:

```text
scripts/deploy-test.sh v0.4.0-alpha.50
```

### Manual Telegram QA

Passed:

- Small Creative renders and remains independently addressable;
- Large Creative renders as a 20×20 / 400-cell grid and remains independently addressable;
- Android and Desktop render both Mandalas correctly;
- 400-cell filling was judged usable but close to the practical limit of convenience;
- the Small and Large Creative Mandalas remain independent in state.

Not manually completed:

- the complete 400-cell destruction/reset cycle has not been run manually because filling all 400 cells takes substantial time.

## 2026-09-15 — Alpha.49.7 verified

Alpha.49.7 fixes the client-side false occupation conflict observed after a successful cell purchase. The final solution does not compare the API `owner_user_id` with the Telegram user ID. Instead, the Mini App tracks the selected cell while the current client's occupation request is in flight and suppresses the conflict notice only for that matching pending own operation.

### Release identity

```text
Commit:
0f8fd46

Tag:
v0.4.0-alpha.49.7

Active release:
/opt/pixdala/releases/v0.4.0-alpha.49.7
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 37/37
API: 15/15
Total: 62/62
```

The exact tag was pushed to GitHub and deployed successfully through:

```text
scripts/deploy-test.sh v0.4.0-alpha.49.7
```

### Manual Telegram QA

Passed:

- the current user successfully occupies a free paid Support cell without receiving a false conflict notice;
- in Sandbox, when another user occupies a cell while the current user is composing a message for that same cell, the conflict notice is displayed and the occupation button becomes inactive.

These checks confirm that Alpha.49.7 removes the false-positive path while preserving the real concurrent-occupation protection.

### Historical Alpha.49.6 outcome

Alpha.49.6 was deployed after passing automated verification, but its attempted owner comparison was based on incompatible identifiers: API `owner_user_id` is the internal database `users.id`, while the Mini App exposes the Telegram user ID. Manual Telegram QA therefore reproduced the false conflict with the Alpha49.6 message. Alpha.49.6 is not considered an accepted functional checkpoint and is superseded by Alpha.49.7.

## Roadmap Position

Alpha.50.9.2 is the current verified release checkpoint. The RU/EN localization stage is now implemented and manually verified across the Mini App and Telegram bot. The existing Мандала поддержки remains the project's Developer Mandala for roadmap purposes.

Current launch-oriented sequence:

1. Large Creative Mandala — 20×20 / 400 cells. **Implemented; full manual destruction/reset remains unverified.**
2. Pix economy — **implemented and hardened; 1 Star = 1 Pix and the paid Support Mandala are in use on the test path.**
3. Daughter's fundraising Mandala — **implemented and manually verified through the campaign/archive path.**
4. Competitive Mandala — **implemented and refined; complete winner → destruction → archive → next-queue lifecycle remains a separate open manual verification item.**
5. RU/EN localization and bot localization — **implemented and manually verified through Alpha.50.9.2.**
6. Final explanatory copy, Telegram community/channel preparation and launch preparation.
7. Public launch, then further development based on real usage.

This is an explicit launch-oriented deviation from the older Developer → Creator → Event ordering; the historical roadmap remains preserved, while the current sequence is intentionally optimized to reach a usable public product sooner.

Уже реализовано и проверено:

- базовая domain model;
- SQLite backend;
- API;
- server-authoritative cell occupation;
- Telegram Mini App integration foundation;
- Telegram bot `@PixDala_bot`;
- test deployment infrastructure;
- rollback infrastructure;
- client/server state synchronization;
- lifecycle and destruction flow;
- Telegram Stars project-support payment foundation;
- stable Mandala identities and slug-based routing for Sandbox and support Mandala;
- separate 100-cell support Mandala capacity test;
- Mandala navigation by explicit controls and swipe;
- server-side payment verification and idempotent finalization;
- Telegram-user association and durable payment records;
- backend/integration/API coverage for payment and multi-Mandala flow;
- configurable `135 Stars -> 1 Pix` exchange rate and paid Support cell flow;
- cycle-scoped paid occupations and Pix debit protection;
- verified own-occupation and concurrent-occupation synchronization behavior.

Текущий незавершённый блок:

- complete manual destruction/reset verification for the 400-cell Large Creative Mandala;
- design and implement the daughter's fundraising Mandala with hidden artwork, dedicated lifecycle, preserved original artwork in archive and a warm personal thank-you;
- design the historical message layer used after Mandala destruction without tying readability to cell dimensions;
- keep the current polling synchronization for now; the observed Desktop delay is noted, but no SSE/WebSocket expansion is justified by this test alone;
- payment reconciliation/recovery hardening remains an operational follow-up; the internal `pix` ledger and paid Support Mandala are already implemented;
- The historical Developer Mandala stage is represented by the existing Мандала поддержки and is treated as substantially implemented.

---


## Historical State Snapshot — Alpha.49.5

- Project: DigiDala
- Current Git branch at that snapshot: `main`
- Tagged Git checkpoint at that snapshot: `d34d37f` (`feat: make Pix exchange rate configurable`)
- Product baseline tag: `v0.4.0-alpha.28`
- Current source/tagged checkpoint: `v0.4.0-alpha.49.5`
- Current active test release: `v0.4.0-alpha.49.5`
- Current symlink: `/opt/pixdala/current`
- Test API: `127.0.0.1:8090`
- Test Mini App: `https://im-test.bktis.ru/apps/miniapp/`
- Test DB: `/opt/pixdala/data/pixdala-alpha-test.db`
- Telegram Stars support remains live as a project-support flow; Sandbox remains free and separate from the internal `pix` economy.
- The internal `pix` economy and paid Support Mandala are implemented and hardened through the Alpha.49.x line.
- Paid cell debits reference immutable, cycle-scoped occupation events rather than reusable cell ids.
- Existing legacy Pix ledger rows are preserved unchanged; historical occupation reconstruction is intentionally not performed.
- Alpha.49.4 automated verification: **62/62** (10 unit, 37 integration, 15 API; structure and JS checks also passed).
- Alpha.49.4 manual Telegram QA: **Desktop passed, Android passed**.
- The insufficient-Pix modal flow is verified: the cell modal remains open, the existing error message is shown inside the modal, and the cell remains unoccupied.


## 2026-09-15 — Alpha.49.5 verified checkpoint

Alpha.49.5 changes the internal Pix purchase direction from the historical test model to a configurable **135 Stars -> 1 Pix** rate while keeping the paid Support Mandala cell price at **1 Pix**. The backend is authoritative for the conversion: clients select a Pix amount and the server calculates the Stars amount from `stars_per_pix`.

### Release identity

```text
Commit:
d34d37f

Tag:
v0.4.0-alpha.49.5

Active release:
/opt/pixdala/releases/v0.4.0-alpha.49.5
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 37/37
API: 15/15
Total: 62/62
```

The exact tag was deployed successfully through `scripts/deploy-test.sh v0.4.0-alpha.49.5`.

### Manual Telegram QA

Passed on Desktop and Android. Verified: compact Pix purchase selector, 135 Stars -> 1 Pix display, purchase options 1 / 5 / 10 / 20 / 50 Pix, successful Pix crediting, paid Support cell occupation, insufficient-Pix protection, and continued free Sandbox behavior.

Historical Pix acquired under the previous exchange rate remain valid balances and are spent at face value; no migration or conversion of existing Pix was required.

### Alpha.49.6 historical outcome

Manual QA after Alpha.49.5 exposed a client-side synchronization false-positive: when the current user successfully occupied a free cell, the background state reconciliation could interpret the newly occupied cell as a concurrent occupation by another participant and show the conflict notice. The issue is client-side and did not indicate a failed Pix debit or failed cell occupation.

Alpha.49.6 attempted to resolve this by comparing the API `owner_user_id` with the Telegram user ID. That comparison used incompatible identifiers because `owner_user_id` is the internal database `users.id`. Alpha.49.6 was deployed and its automated checks passed, but manual Telegram QA showed that the false conflict still occurred. It was therefore superseded by Alpha.49.7.

## Current Roadmap Position

Текущий приоритет — P0 / economic foundation following the verified Stars payment and pix ledger stages. The Alpha.49.x line established and hardened cycle-scoped paid cell occupations and the insufficient-Pix user flow; the next product stage is the Developer Mandala.

Уже реализовано и проверено:

- базовая domain model;
- SQLite backend;
- API;
- server-authoritative cell occupation;
- Telegram Mini App integration foundation;
- Telegram bot `@PixDala_bot`;
- test deployment infrastructure;
- rollback infrastructure;
- client/server state synchronization;
- lifecycle and destruction flow;
- Telegram Stars project-support payment foundation;
- stable Mandala identities and slug-based routing for Sandbox and support Mandala;
- separate 100-cell support Mandala capacity test;
- Mandala navigation by explicit controls and swipe;
- server-side payment verification and idempotent finalization;
- Telegram-user association and durable payment records;
- backend/integration/API coverage for payment and multi-Mandala flow.

Текущий незавершённый блок:

- redesign the permanent cell metadata presentation so large Mandalas remain readable;
- design a separate readable participant/message information layer;
- design the historical message layer used after Mandala destruction without tying readability to cell dimensions;
- keep the current polling synchronization for now; the observed Desktop delay is noted, but no SSE/WebSocket expansion is justified by this test alone;
- payment reconciliation/recovery hardening remains an operational follow-up; the internal `pix` ledger and paid Support Mandala are already implemented.
- Developer Mandala is the next planned product stage after the Alpha.49.2 occupation/cycle foundation is released and verified.

---



## 2026-09-15 — Alpha.49.4 verified

Alpha.49.4 completes the insufficient-Pix modal UX fix for the paid Support Mandala.

### Release identity

```text
Commit:
8552108

Tag:
v0.4.0-alpha.49.4

Active release:
/opt/pixdala/releases/v0.4.0-alpha.49.4
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 37/37
API: 15/15
Total: 62/62
```

The release was deployed successfully through:

```text
scripts/deploy-test.sh v0.4.0-alpha.49.4
```

### Manual Telegram QA

Passed on:

- Desktop
- Android

Verified behavior for insufficient Pix:

- the cell modal remains open;
- the insufficient-Pix message is displayed inside the modal;
- the selected cell remains unoccupied.

### Database diagnostic

A read-only inspection of the test database confirmed that the active Support Mandala cycle uses cycle-scoped `cell_occupations` and corresponding Pix debit ledger entries.

The previously observed possibility of occupying a cell with zero Pix was not reproduced in the current cycle. No confirmed current defect was found, so no additional code change was made for that observation.

---

## 2026-09-14 — Alpha.48.3 Telegram navigation verified

Alpha.48.3 was the verified checkpoint at that time. The release contains the final Alpha.48.x Telegram navigation code, and the remaining deep-link failure was traced to Telegram configuration rather than repository code.

### Release identity

```text
Commit:
a7887f88156310e6ac7dfac678d208254657c383

Tag:
v0.4.0-alpha.48.3

Active release:
/opt/pixdala/releases/v0.4.0-alpha.48.3
```

### Telegram navigation model

The group navigation intentionally uses different Telegram mechanisms because `web_app` inline buttons are limited to private chats:

- `🪷 Открыть DigiDala` in a group uses the Main Mini App deep link `https://t.me/PixDala_bot?startapp` and opens the Mini App on its default `sandbox` Mandala.
- `🤝 Мандала поддержки` uses `https://t.me/PixDala_bot?startapp=support` and opens the Support Mandala.
- `🎨 Мандала творчества` uses `https://t.me/PixDala_bot?startapp=creative` and opens the Creative Mandala.
- `⭐ Поддержать проект` uses the ordinary bot deep link `https://t.me/PixDala_bot?start=support` and transfers the user to the private chat for the existing Stars flow.

In private chat, `🪷 Открыть DigiDala` remains a true Telegram `web_app` button using the stable Mini App URL, and the Telegram Menu Button also uses `web_app`.

### Root cause and resolution of the Alpha.48.x deep-link issue

The Mini App routing code already accepted `mandala`, `startapp`, `tgWebAppStartParam` and Telegram `initDataUnsafe.start_param`, with `sandbox` as the final fallback. No application-code change was required to fix the observed group deep-link failure.

The actual missing prerequisite was Telegram's **Main Mini App** configuration for `@PixDala_bot`. It was not configured in BotFather. After configuring the Main Mini App to the stable entry URL:

```text
https://im-test.bktis.ru/apps/miniapp/
```

the group `startapp` links began working as intended.

### Manual Telegram QA after configuration

Passed on Android and Desktop:

- `🪷 Открыть DigiDala` opens the Mini App with Sandbox.
- `🤝 Мандала поддержки` opens the Support Mandala.
- `🎨 Мандала творчества` opens the Creative Mandala.
- `⭐ Поддержать проект` continues to open the private bot support flow and was not changed.
- The existing private `web_app` launch continues to work.

This resolves the Alpha.48.x Telegram group-navigation issue. No new code or release is required for this configuration fix.

---

## 2026-09-10 — Alpha.46.5 verified

Alpha.46.5 completes the current destruction-observer correction after the multi-Mandala expansion. The release preserves the server-authoritative destruction lifecycle and restores correct client-side sequencing for already-open non-destroyer viewers.

### Release identity

```text
Commit:
06afd97f70df3feeba82af1cbd4be33778ee133a

Tag:
v0.4.0-alpha.46.5

Active release:
/opt/pixdala/releases/v0.4.0-alpha.46.5
```

### What was corrected

- Remote destruction reset is now synchronized with the end of the observer's local particle animation. A server reset received while the animation is still running is remembered and applied after the animation completes.
- The remote observer view restores the shared Mandala container to visible and interactive state after reset.
- Pointer interaction is disabled while the remote view is intentionally invisible, so invisible cells cannot be clicked.
- Sandbox and Support Mandalas remain independently addressable and independent in lifecycle/state: destroying one does not reset the other.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 25/25
API: 13/13
Total: 48/48
```

### Deployment

- `v0.4.0-alpha.46.5` was fetched by the VPS from the exact Git tag.
- Exact-tag deployment completed successfully.
- `/opt/pixdala/current` points to `/opt/pixdala/releases/v0.4.0-alpha.46.5`.
- `pixdala-test-web`, `pixdala-test-api` and `pixdala-bot` were restarted successfully.

### Manual Telegram QA

Passed:

- destroyer completion and destruction flow;
- already-open observer completion state;
- observer-side particle destruction;
- observer reset after remote destruction;
- no independent observer server reset;
- independence of Sandbox and Support Mandalas.

### Open finding

When switching between Mandalas, a very brief flash of the previous free-cell presentation containing `Пока свободно` can appear before the new Mandala-specific rendering settles. This is a presentation transition artifact and is carried forward as a separate UX task. It does not indicate shared state, lifecycle, or data-reset coupling between Mandalas.

### Acceptance status

Alpha.46.5 is a **verified functional checkpoint** for the destruction observer and multi-Mandala independence scenarios tested on Telegram. The transient old free-cell rendering during Mandala switching remains open.

---


## 2026-09-11 — Alpha.46.6 verified

Alpha.46.6 closes the Alpha.46.5 follow-up transition artifact by removing the legacy free-cell presentation from the Mini App renderer instead of masking it during Mandala switching. Free cells now use the existing minimal SVG marker consistently for Sandbox and Support.

### Release identity

```text
Commit:
2a37d7fcbf765e62bc8cf17adfdd71b2e6ae9c12

Tag:
v0.4.0-alpha.46.6

Active release:
/opt/pixdala/releases/v0.4.0-alpha.46.6
```

### Scope

- removed old free-cell `✦`, number, `Пока свободно` and `Тестовый режим` markup from both grid-construction and normal-render paths;
- removed the corresponding obsolete CSS;
- preserved occupied-cell rendering and the verified server-authoritative lifecycle;
- did not change backend, API, payment, polling or Mandala identity/routing behavior.

### Verification and deployment

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 25/25
API: 13/13
Total: 48/48
```

The exact tag `v0.4.0-alpha.46.6` was deployed successfully and `/opt/pixdala/current` points to `/opt/pixdala/releases/v0.4.0-alpha.46.6`.

### Manual Telegram QA

Passed repeated `Sandbox → Support → Sandbox` switching. The previous old free-cell presentation and the `Пока свободно` flash were not observed. Occupied-cell presentation remained usable.

### Acceptance status

Alpha.46.6 is a **verified functional checkpoint**. The Alpha.46.5 transition artifact is closed. The remaining UX priority is the separate readable participant/message information layer for larger Mandala grids.

---

## Historical — 2026-09-06 — Alpha.35 verified and alpha.36a bot/deployment migration prepared

### Alpha.35 deployment and verification

Alpha.35 was committed and tagged from the Windows development clone:

```text
1efc2a5 feat: refine occupied cell details for alpha.35
v0.4.0-alpha.35
```

The release was deployed through `scripts/deploy-test.sh` and became the active
test release at `/opt/pixdala/releases/v0.4.0-alpha.35`. Local release checks and
Telegram verification passed.

### Alpha.36a candidate

Alpha.36a prepares the bot and deployment architecture for release-managed
operation:

- test bot source is stored under `bot/test-bot.js`;
- the Mini App URL used by the bot is the stable `https://im-test.bktis.ru/apps/miniapp/`;
- the bot systemd unit runs from `/opt/pixdala/current/bot/test-bot.js`;
- `deploy-test.sh` validates and deploys web, API and bot together;
- rollback restores the previous release and its bot unit when available;
- the Telegram Menu Button points to the stable Mini App entry point;
- the previous manually managed `/opt/pixdala/bot-test/bot.js` remains in place until
  the first alpha.36a deployment is verified.

Alpha.36a does not yet implement cross-user mandala synchronization. That is the
next planned foundation after the bot/deployment migration.

---

## 2026-09-09 — Alpha.45 deployed and manually evaluated

Alpha.45 introduced the second Mandala foundation used for a 100-cell capacity and UX experiment. The support Mandala is a separate stable entity from Sandbox and is intended to remain as the permanent project-support Mandala concept; it is not yet connected to the internal `pix` economy.

### Release identity

```text
Commit:
0c2376288dcfc46885ca56dff64a11607f0f98a4

Tag:
v0.4.0-alpha.45

Active release:
/opt/pixdala/releases/v0.4.0-alpha.45
```

### Implemented

- stable `sandbox` and `support` Mandala identities;
- support Mandala: `Мандала поддержки`, 10×10 / 100 cells;
- stable slug-based routing and direct `?mandala=support` entry;
- explicit left/right navigation and swipe switching;
- independent support-cell occupation;
- dedicated `assets/mandala-support.png`;
- migration made self-contained for clean databases by creating both stable Mandala identities and their cell sets when absent.

### Automated verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 25/25
API: 13/13
Total: 48/48
```

### Deployment

- GitHub `main` points to `0c237628` and the exact `v0.4.0-alpha.45` tag was fetched by the VPS.
- Exact-tag deployment completed successfully.
- `current` was switched to `/opt/pixdala/releases/v0.4.0-alpha.45`.
- `pixdala-test-web`, `pixdala-test-api` and `pixdala-bot` were restarted successfully.

### Manual Telegram QA

Passed:
- cell occupation works;
- Mandala destruction lifecycle works;
- 10×10 grid is usable for selecting individual cells;
- cell targeting remains easy.

Observed / open:

1. Desktop synchronization can show a small delay after another client changes the shared state. This is consistent with the existing polling-based synchronization and is not being treated as grounds for a transport rewrite.
2. At 10×10, the permanently rendered participant name/message text is no longer readable, although the grid itself remains usable. This establishes a UX scaling limit of the current in-cell metadata approach.
3. The current `Пока свободно` text on free cells is unnecessary at this scale and should be replaced by a small visual state marker.
4. The previously planned separated message layer remains necessary: readable participant/message information should be shown on interaction rather than permanently inside every cell.
5. The post-destruction historical message presentation must be designed as a separate layer and must not depend on fitting text into the original cells.

### Acceptance status

Alpha.45 is **deployed and functionally evaluated, but not a fully verified UX checkpoint** because the capacity experiment exposed the permanent cell-metadata readability problem. The finding is intentionally carried forward into the next design task rather than patched ad hoc inside Alpha.45.

---

## Historical — 2026-09-06 — Alpha.33 lifecycle verification and alpha.34 UI candidate

### Alpha.33 deployment and verification

Alpha.33 was committed and tagged from the Windows development clone:

```text
2834794 feat: harden Mandala Sandbox lifecycle for alpha.33
v0.4.0-alpha.33
```

The tag was pushed to GitHub and fetched by the VPS. The release was deployed
through `scripts/deploy-test.sh`.

Release checks passed:

- structure check;
- JavaScript syntax check;
- 10 unit tests;
- 14 integration tests;
- 6 API tests.

The initial Telegram verification exposed a stale Mini App entry URL/cache
behavior: Telegram could continue opening the old `/apps/miniapp/` entry point.
The test bot was therefore updated outside the main repository to open the
versioned entry point:

```text
https://im-test.bktis.ru/apps/miniapp/index.html?v=0.4.0-alpha.33
```

After restarting `pixdala-test-bot`, real Telegram testing produced the
following result:

- Mobile: new occupied-cell UI appeared; the last participant could start
  destruction; destruction completed; sandbox reset automatically.
- Desktop: occupation and destruction/reset worked; occupied-cell icon
  presentation differed from Mobile and requires UI refinement.

The alpha.33 server lifecycle is therefore considered verified.

### Alpha.34 candidate

The only current code change after alpha.33 deployment is a local
`apps/miniapp/styles.css` refinement for occupied-cell presentation.

The candidate:
- scales the user/message icons to the text size;
- keeps icons on the same row as their associated text;
- centers the occupied-cell metadata block inside the cell;
- prevents vertical jumping when text wraps differently;
- constrains metadata width to the cell.

Local `npm.cmd run check` passed:

```text
Structure: OK
JS syntax: OK
Unit: 10/10
Integration: 14/14
API: 6/6
```

No alpha.34 tag or deployment has been created yet.

### Working-process rule

For changes that can be safely prepared as complete files, use a ready-to-replace
file or ZIP archive rather than requiring manual line edits. This is a
convenience layer over the same verification discipline, not a replacement for
review, tests, Git history, or tagged deployment.

For files outside the main repository, such as the test bot, use an explicit
prepared-file transfer (`scp`), verify the deployed file, then restart only the
relevant service.

---

## Historical — 2026-09-04 — Mandala Sandbox alpha.32

### Result

The test Mini App now operates as a Mandala Sandbox: payment is disabled and cells can be occupied freely in any order for functional testing.

Telegram identity is server-authoritative. The participant name is taken from validated Telegram `initData`, the Telegram user ID is displayed as a non-editable value, and the client no longer submits a user-defined display name.

The last participant is determined by actual cell acquisition time rather than cell position. After all 12 cells are occupied, only the participant who acquired the final cell receives the destruction action.

After the destruction ritual finishes, the test Mandala automatically resets to an empty active state.

### Verification

Local checks passed:

- structure check;
- JavaScript syntax check;
- 10 unit tests;
- 11 integration tests;
- 5 API tests.

Manual verification in Telegram Desktop after deployment is currently correct.

### Release

Commit:

```text
b327a26 feat: complete Mandala Sandbox alpha.32
```

Tag:

```text
v0.4.0-alpha.32
```

The tag and `main` were pushed to GitHub.

### Deployment

The release was deployed successfully through:

```text
/opt/pixdala/repo/scripts/deploy-test.sh v0.4.0-alpha.32
```

Active release:

```text
/opt/pixdala/releases/v0.4.0-alpha.32
```

The deployment script successfully:

- created the release from the Git tag;
- ran the full project check;
- switched `/opt/pixdala/current`;
- restarted `pixdala-test-web` and `pixdala-test-api`;
- passed service health checks;
- passed the HTTPS smoke test.

### Current operational state

At that historical stage, the alpha.32 test environment was considered a verified working checkpoint for the Mandala Sandbox functionality.

At that historical stage, the next development session continued from `v0.4.0-alpha.33`; alpha.34 remained a local release candidate.

---

## Historical — 2026-09-03 — GitHub/VSCode workflow migration

### Result

The project uses the following primary development workflow:

```text
VSCode on Windows → local Git → GitHub → VPS fetch/tag → deploy-test.sh → release/current
```

No manual source editing on the VPS is part of the normal workflow.

### Windows environment

Verified:

- Git `2.54.0.windows.1`;
- Node.js `22.14.0`;
- npm `10.9.2`;
- VSCode `1.136.0`.

Installed VSCode extensions:

- ESLint;
- GitLens;
- Prettier;
- SQLite Viewer;
- Error Lens;
- Markdown All in One.

### First local cross-platform fix

The API integration test previously failed on Windows because `projectRoot` was
built from a URL pathname using `path.resolve()`. The test was corrected to use
`fileURLToPath()`.

Local verification passed:

- 9 unit tests;
- 11 integration tests;
- 5 API tests;
- structure check;
- JavaScript syntax check.

Commit:

```text
8e94695 fix: make API integration test cross-platform
```

### Deployment verification

Created technical tag:

```text
v0.4.0-alpha.28-winfix
```

The tag was pushed from Windows to GitHub, fetched by the VPS, and deployed using
`scripts/deploy-test.sh`. The release passed all checks and the HTTPS smoke test;
`current` now points to:

```text
/opt/pixdala/releases/v0.4.0-alpha.28-winfix
```

This tag is a workflow-verification point, not a new product baseline.

### VPS cleanup

Obsolete `/opt/pixdala/app` and historical `/opt/pixdala/deploy-*` staging directories
were removed after verifying that no active service referenced them.

A standalone SQLite backup was created and integrity-checked at:

```text
/opt/pixdala/backups/pixdala-alpha-test-20260903-0532.db
```

### Next process rule

Future code changes are to be made in the Windows VSCode clone, tested locally,
committed to GitHub, tagged when ready, and deployed to the VPS through the existing
release/rollback mechanism.

## Historical Alpha.24–28 Development Session

- Clean functional baseline: `v0.4.0-alpha.24`.
- Prepared and verified production-like baseline: `v0.4.0-alpha.24-clean`, based on alpha.24.
- Promoted accepted client changes into `main` as `v0.4.0-alpha.28`.
- `alpha.28` contains Telegram WebApp SDK in `<head>` and cache-buster/client version `0.4.0-alpha.28`.
- `alpha.28` removes the leftover `setDiag` confirmation-flow diagnostics.
- Local validation of `alpha.28`: `npm run check` passed (9 unit, 11 integration, 5 API tests).
- `alpha.28` deployed as active test release.
- Desktop test passed: cell occupation returned HTTP `201`.
- Android Telegram Mini App test passed when Telegram traffic was run through a full VPN / unrestricted network path: cell occupation returned HTTP `201`.
- Therefore the core Mini App → API occupation flow works in the normal/unrestricted target environment.

---

## Alpha.25–27 Diagnostic Result

### Alpha.25

Purpose:

- diagnose why Android Mini App previously loaded the UI and GET requests but did not produce the occupation POST.

Observed diagnostic result on affected Android environment:

- `WebApp: NO`;
- `initData: NO`;
- `user: NO`.

The Telegram WebApp SDK was not available to the page.

### Alpha.26

Change:

- Telegram WebApp SDK moved from `<body>` to `<head>`.

Result:

- `WebApp: NO` remained;
- moving the SDK did not solve the problem in the affected Android environment.

### Alpha.27

Added explicit SDK loading diagnostics and query-parameter diagnostics.

Observed result:

```text
TG MODAL
SDK: ERROR · URL data: NO
WebApp: NO · initData: NO (0)
user: NO · platform: — · version: —
```

No occupation POST appeared.

### Final verification

With the same Android client running through a full VPN / unrestricted network path:

- Mini App loaded normally;
- GET `/api/v1/mandalas/1` succeeded;
- occupation POST succeeded and returned `201`;
- Android occupied cell `4`.

Desktop verification also succeeded:

- occupation POST returned `201`;
- Desktop occupied cell `3`.

Conclusion:

- the previous Android `WebApp: NO / SDK: ERROR` condition was caused by the network environment in that test path, where the Mini App could not load `https://telegram.org/js/telegram-web-app.js?63`;
- Russian blocking/bypass behavior is an environmental factor for diagnostics, not a product requirement;
- do not add product complexity specifically to bypass Russian blocking unless a separate product requirement is introduced.

---

## Canonical Context

Для быстрого восстановления контекста проекта использовать:

```text
docs/PROJECT_CONTEXT.md
```

`PROJECT_CONTEXT.md` — компактный канонический handoff:
стабильные факты, архитектура, важные решения, история релизов,
известные ограничения и текущая задача.

`PROJECT_STATE.md` остаётся подробным оперативным журналом.
`docs/ROADMAP.md` является источником истины для направления и порядка работ.
Перед началом каждого существенного этапа roadmap должна быть просмотрена;
после завершения этапа его результат фиксируется в `PROJECT_STATE.md`.

---

## Historical Clarification: GET timeout 45s

Первичный источник причины выбора `45s` найден в архиве release
`v0.4.0-alpha.18` (`CHANGELOG.md`):

```text
Increased initial mandala GET timeout to 45 seconds for slow Telegram mobile connections.
```

Следовательно, `45s` был введён намеренно как мера стабилизации для медленных
Telegram mobile connections.

В том же alpha.18:

- retry исправлен так, чтобы каждая попытка использовала новый
  `AbortController` и timeout;
- occupation POST timeout оставался `15s`;
- подтверждение клетки ждало завершения shared bootstrap.

Ранее в журнале это было ошибочно обозначено как неподтверждённое происхождение
`45s`. Эта запись исправляет трактовку.

Важно различать:

- **почему 45s появился** — теперь подтверждено;
- **является ли 45s оптимальным значением сейчас** — пока не проверено и может
  быть предметом отдельного controlled test.
---

## Active Blocker / Current Focus

The previous Android `initData` blocker is no longer active in the normal/unrestricted target environment.

The current technical focus is controlled simplification of the client reliability mechanisms inherited from the experimental releases.

Audit individually:

1. GET timeout (`45s`);
2. GET retry (`2 attempts`);
3. fresh `AbortController` per retry;
4. occupation POST timeout (`15s`);
5. `bootstrapPromise` / `ensureBootstrap`;
6. waiting for bootstrap before confirm;
7. server-state reconciliation;
8. inline client-side domain model.

For each mechanism:

- identify when it was introduced;
- identify the concrete problem it was intended to solve;
- check whether the problem still exists in the normal target environment;
- simplify only when there is enough evidence.

Do not remove several mechanisms in one uncontrolled change.

---

## Historical Roadmap Reference

A historical search on the VPS found the surviving full roadmap from the original
`v0.1.1` baseline at:

```text
/opt/pixdala/deploy-0.1.1/pixdala-baseline/docs/ROADMAP.md
```

Its 13 stages are now preserved in `docs/ROADMAP.md` as historical product intent.
The current roadmap adds the actual project evolution and the present P0 working
sequence without rewriting the historical plan.

The `ROADMAP.md` file is now the source of truth for project direction and ordering.
Before each substantial development stage, review it together with this journal and
`PROJECT_CONTEXT.md`.

---

## Telegram Bot

The current Git-managed Telegram bot source is:

```text
bot/bot.cjs
```

Основной repository:

```text
/opt/pixdala/repo
```

Mini App:

```text
https://im-test.bktis.ru/apps/miniapp/
```

Активный systemd unit:

```text
infra/systemd/pixdala-bot.service
```

В release процесс бот запускается из:

```text
/opt/pixdala/current/bot/bot.cjs
```

Запуск Mini App выполняется через:

```text
InlineKeyboardButton
+
WebAppInfo
+
web_app.url
```

The bot uses long polling.

См. также:

```text
docs/TELEGRAM_TEST_BOT.md
```

---

## v0.4.0-alpha.28 Verification

- Promoted the verified alpha.24-clean client baseline into `main`.
- Removed the leftover `setDiag` helper and temporary confirmation-flow status messages.
- Kept GET timeout/retry, POST timeout, shared bootstrap, duplicate-confirmation protection,
  server-state reconciliation, inline client domain model, and server-authoritative occupation.
- Updated `package.json` to `0.4.0-alpha.28`.
- Updated `index.html` to load `app.js?v=0.4.0-alpha.28`.
- Updated the structure checker to accept versioned `app.js` ES-module URLs.
- `npm run check` passed: 9 unit, 11 integration, 5 API tests.
- Manual Desktop and Android verification passed.
- Android occupation succeeded under the unrestricted/full-VPN network path.
- Git commit: `b8f9459 feat: promote verified alpha.28 client baseline`.
- Git tag: `v0.4.0-alpha.28`.
- `origin/main` is synchronized with `b8f9459`.

## Temporary Experimental Releases

Важно:

релизы `alpha.17`–`alpha.27` создавались как экспериментальные
версии для отладки и не всегда соответствовали содержимому `main`.

Это было сделано намеренно, чтобы не менять стабильную ветку
repository до завершения отдельных диагностических этапов.

Поэтому:

```text
active release != current main
```

не является автоматически ошибкой.

`v0.4.0-alpha.28` является текущим подтверждённым
production-like test baseline и уже зафиксирован в `main` и tag.

В частности, `alpha.24-clean` содержит:

- встроенную в `app.js` client-side domain model;
- Telegram WebApp SDK в `index.html`;
- вызов `Telegram.WebApp.ready()`;
- server-backed occupation;
- bootstrap/retry/timeout logic;
- защиту от duplicate confirmation;
- server-state reconciliation.

---

## Release History

### v0.4.0-alpha.17

- переход к server-backed Mini App;
- runtime import domain model ещё вызывал дополнительный HTTP GET.

### v0.4.0-alpha.18

- GET timeout/retry;
- отдельный AbortController для retry;
- occupation POST timeout;
- ожидание bootstrap перед confirm.

### v0.4.0-alpha.19

- очистка части временной диагностики.

### v0.4.0-alpha.20

- попытка partial inline domain model;
- версия оказалась некорректной из-за отсутствующих зависимостей domain model.

Не использовать как baseline.

### v0.4.0-alpha.21

- полный inline domain model;
- затем обнаружена ошибка `confirmCellDiag is not defined`.

Не использовать как baseline.

### v0.4.0-alpha.22

- исправлена проблема alpha.21;
- полный inline domain model;
- runtime GET `/packages/domain/mandala.js` устранён;
- Desktop occupation успешно работает;
- Android GET работает.

### v0.4.0-alpha.23

- временная UI-диагностика A/B/C/D;
- версия признана недействительной из-за ошибки:
  `Cannot access 'name' before initialization`.

Не использовать как baseline.

### v0.4.0-alpha.24

- чистая версия на базе alpha.22;
- временная диагностическая UI-разметка удалена;
- direct `onclick` обработчик;
- Telegram WebApp SDK присутствует;
- `Telegram.WebApp.ready()` вызывается при bootstrap;
- Android всё ещё требовал диагностики `initData`.

### v0.4.0-alpha.24-clean

- чистая production-like test версия на базе alpha.24;
- Telegram WebApp SDK перенесён в `<head>`;
- диагностический UI alpha.25–27 отсутствует;
- cache-buster/client version изменён на `0.4.0-alpha.24-clean`;
- `npm run check` passed (9 unit, 11 integration, 5 API tests);
- Desktop occupation verified with HTTP `201`;
- Android occupation verified with HTTP `201` under unrestricted/full-VPN network path;
- использована как проверенная база для alpha.28.

### v0.4.0-alpha.28

- изменения из проверенного alpha.24-clean возвращены в `main`;
- удалён остаточный `setDiag` и временные status messages confirmation flow;
- сохранены bootstrap/retry/timeout и server-authoritative occupation;
- `package.json`, client version и cache-buster синхронизированы на `0.4.0-alpha.28`;
- structure checker обновлён для versioned `app.js`;
- `npm run check` passed (9 unit, 11 integration, 5 API tests);
- Desktop и Android occupation verified;
- Git commit: `b8f9459`; tag: `v0.4.0-alpha.28`;
- текущий active test release.

### v0.4.0-alpha.25–alpha.27

- временные диагностические releases для проверки Android Telegram SDK / `initData`;
- alpha.25 показал `WebApp: NO`, `initData: NO`, `user: NO`;
- alpha.26 подтвердил, что перенос SDK в `<head>` не меняет результат;
- alpha.27 показал `SDK: ERROR · URL data: NO`;
- последующая проверка с полным VPN показала, что core occupation flow работает;
- эти диагностические релизы не являются текущим baseline.

---

## Deployment

Нормальный механизм deployment уже существует:

```text
scripts/deploy-test.sh
scripts/rollback-test.sh
```

`deploy-test.sh` создаёт release из Git tag через:

```text
git archive "$TAG"
```

и не модифицирует содержимое release.

Во время экспериментального этапа некоторые alpha-релизы
создавались вручную и поэтому могут отличаться от `main`.

После завершения Telegram diagnostics следует вернуться
к воспроизводимому release-процессу.

---

## Important Rules for Current Work

1. Не считать `main` эквивалентом последнего experimental release.
2. Не добавлять продуктовую сложность из-за особенностей блокировок конкретного тестового сетевого окружения.
3. Не менять API без необходимости для текущего аудита.
4. Временную диагностику не оставлять в production-like UI.
5. Не удалять несколько reliability-механизмов одновременно.
6. Перед изменением каждого механизма сначала установить причину его появления и проверяемую пользу.
7. После подтверждения причины перенести необходимые изменения
   из experimental release обратно в source.
8. Перед каждым существенным релизом обновлять этот файл.
9. Перед каждым существенным этапом сверяться с `docs/ROADMAP.md`.

---

## Next Step

Continue the P0 reliability audit and subsequent code work from the Windows VSCode
clone, using `v0.4.0-alpha.43` as the current verified checkpoint. The next substantial
code change must follow the local-first GitHub workflow:

```text
edit → npm.cmd run check → git diff → commit → push → tagged deployment → test
```

The test-only Mandala reset flow remains part of the test infrastructure; the public Mini App now exposes the Mandala Sandbox flow without the former `Start new` control.

## Known Infrastructure

Services:

```text
pixdala-test-api
pixdala-test-web
```

API:

```text
http://127.0.0.1:8090
```

Public HTTPS:

```text
https://im-test.bktis.ru/
```

Database:

```text
/opt/pixdala/data/pixdala-alpha-test.db
```


## 2026-09-06 — alpha.36.1 checkpoint

`v0.4.0-alpha.36.1` is the bot-migration fix following alpha.36. The test bot is now
tracked in Git as `bot/test-bot.cjs`, uses the stable Mini App URL, and is launched
through the Git-managed systemd unit under `/opt/pixdala/current`. The deployment
rollback path includes a legacy-unit fallback for the first migration release.

The next planned engineering block remains multi-user Mandala synchronization via
server-side state versioning and periodic client polling, with the message editor
protected from background state reconciliation.

---

## 2026-09-07 — Alpha.38 candidate

Alpha.37 was verified on Telegram Mobile and Desktop, including multi-user Mandala
synchronization. The next release is intentionally limited to four observed UX/lifecycle
refinements before further architectural work.

Planned fixes in alpha.38:

- `участников` counts unique Telegram users, while the counter title remains unchanged;
- cell-acquisition sound works during every filling stage;
- the completion information overlay is above the cell metadata layer;
- viewers already on the completion screen start the client-side destruction animation
  after the server-authoritative `destroying` transition, while only the destroyer
  finishes the server-side reset.

Alpha.38 is a local release candidate and has not yet been tagged or deployed.

---

## 2026-09-09 — Alpha.43 verified

Alpha.43 is the first verified release after the public project rename from PixDala to DigiDala. The rename changes the public product name and user-facing text only; technical identifiers and the Telegram bot name remain unchanged.

### Release identity

```text
Commit:
5c6c009

Tag:
v0.4.0-alpha.43
```

### Public name migration

- Public project name: `DigiDala`.
- Telegram bot remains `@PixDala_bot`.
- GitHub repository and VPS technical paths remain unchanged.
- User-facing Mini App and bot texts use `DigiDala`.
- Technical service names, scripts and deployment paths were not renamed.

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 17/17
API: 8/8
Total: 35/35
```

Deployment used the exact Git tag `v0.4.0-alpha.43` and completed successfully. The active release is `/opt/pixdala/releases/v0.4.0-alpha.43`.

Manual Telegram QA passed after deployment, including the updated public name in the bot and Mini App and the existing core Sandbox flow.

Alpha.43 is now the current verified test checkpoint.

---

## 2026-09-08 — Alpha.42 verified

Alpha.42 completed the Telegram bot naming migration from the former test-bot naming to the
main project naming while keeping the current Mini App in its test environment. The release
was committed, pushed to GitHub, tagged, deployed from the exact tag, and manually verified
in Telegram.

### Release identity

```text
Release commit:
f4db92d

Earlier alpha.42 migration commit:
de6136b

Tag:
v0.4.0-alpha.42
```

The final release commit includes the rollback-safety fix for the bot service migration.

### Bot migration

Current Git-managed bot files:

```text
bot/bot.cjs
infra/systemd/pixdala-bot.service
```

The deployment script now installs/restarts `pixdala-bot` and contains an explicit fallback
to the legacy `pixdala-test-bot` unit when rolling back to a pre-migration release. The old
unit was stopped and disabled after the alpha.42 deployment.

The main bot is:

```text
@PixDala_bot
```

The Mini App URL remains:

```text
https://im-test.bktis.ru/apps/miniapp/
```

The bot token remains external in `/opt/pixdala/.env`.

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 17/17
API: 8/8
Total: 35/35
```

Deployment used the exact Git tag `v0.4.0-alpha.42` and completed successfully. The active
release is `/opt/pixdala/releases/v0.4.0-alpha.42`.

Manual Telegram QA passed on the main bot:

- `/start`: PASS
- Menu Button: PASS
- `/help`: PASS
- Mini App/API synchronization: PASS
- cell occupation: PASS
- overall Telegram test: PASS

### Runtime migration note

During migration the main bot token was updated in `/opt/pixdala/.env`. The bot picked up the
new token after restart, but the API initially continued running with the previous token until
`pixdala-test-api.service` was restarted. After that restart, the API and bot used the same main
bot token and the Mini App returned to normal synchronization.

This was a runtime configuration/restart issue, not a code defect in alpha.42.

Alpha.42 was the verified test checkpoint at that time.

---

## 2026-09-08 — Alpha.41 verified

Alpha.41 was committed, pushed to GitHub, tagged, deployed to the test VPS, and manually verified on Telegram Mobile and Desktop.

### Release identity

```text
Commit:
0da0b38

Tag:
v0.4.0-alpha.41
```

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 17/17
API: 8/8
Total: 35/35
```

### Change

The actual final-participant `celebrate` completion card was corrected:

```text
Мандала завершена!

Пора отпустить созданное...
```

The existing destruction button remains:

```text
Развеять мандалу
```

Alpha.41 makes no intentional changes to the server-authoritative destruction lifecycle, revision polling, remote destruction animation, reset behavior, or occupation audio.

### Deployment

- `main` and `v0.4.0-alpha.41` were pushed to GitHub.
- The VPS fetched the tag successfully.
- `scripts/deploy-test.sh v0.4.0-alpha.41` completed successfully.
- Active release: `/opt/pixdala/releases/v0.4.0-alpha.41`.
- `current` was switched to alpha.41.
- Test services were restarted successfully.

### Manual Telegram QA

Passed on:
- Telegram Mobile;
- Telegram Desktop.

The exact final-participant copy and the existing `Развеять мандалу` button were verified on both platforms.

Alpha.41 was the verified test checkpoint at that time.

### Alpha.40 historical note

Alpha.40 was deployed but failed manual acceptance because its text change targeted the `stageOverlay`, while the visible final completion card uses the separate `celebrate` overlay. Alpha.40 remains an immutable historical tag and was superseded by alpha.41.
## Historical — 2026-09-07 — Alpha.38 deployed and manually tested

Alpha.38 was completed through the normal Windows → GitHub → tagged VPS deployment workflow.

### Release identity

```text
Commit:
f355f62d2b9116648a44bf20428d829af7035b0a

Tag:
v0.4.0-alpha.38
```

### Local verification

```text
Structure check: OK
JavaScript syntax check: OK

Unit:        10/10
Integration: 17/17
API:          8/8

Total automated tests: 35/35
```

The same complete check passed again on the VPS during deployment.

### GitHub and deployment verification

- `main` was pushed successfully.
- `v0.4.0-alpha.38` was pushed successfully.
- The VPS fetched the tag successfully.
- The tag resolved to commit `f355f62d2b9116648a44bf20428d829af7035b0a`.
- `scripts/deploy-test.sh v0.4.0-alpha.38` completed successfully.
- Active release: `/opt/pixdala/releases/v0.4.0-alpha.38`.
- `current` was switched to alpha.38.
- `pixdala-test-web` and `pixdala-test-api` were restarted successfully.
- The deployment completed successfully.

### Manual Telegram verification

#### 1. Unique participant counter — PASS

The `участников` counter now counts unique Telegram users rather than occupied cells.

#### 2. Cell-occupation audio — PASS

The occupation sound plays correctly at every filling stage. When another participant occupies a cell, the sound is also heard by a viewer who merely has the Mandala open. This is accepted behavior and should remain.

#### 3. Completion information overlay — PARTIAL / NOT VERIFIED

On Mobile, the completion information was not observed to be covered by cell metadata. On Desktop, participant name/message plates still visually cover the completion information window.

Non-destroyer viewers also need a viewer-specific completion message while the final participant's existing text and `развеять мандалу` button remain unchanged.

Required viewer text:

> Внимание! Участник такой-то завершил мандалу и готовится её развеять.
> Давайте посмотрим на это...

#### 4. Destruction propagation to other viewers — FAIL / OPEN

An already-open non-destroyer viewer does not currently render the destruction particle animation after the server enters `destroying`. The completion window disappears, the filled Mandala remains visible, and then the server-side reset occurs.

The destroyer client performs the destruction animation as expected. The server-authoritative lifecycle remains intact: only the destroyer completes the server-side reset.

### Historical release status

Alpha.38 was deployed successfully but not fully verified at that historical checkpoint.

Automated verification: **35/35 passed**. Deployment verification: **passed**. Manual Telegram verification: **partial**.

Open issues for the next controlled refinement:

1. fix the Desktop completion overlay stacking;
2. give non-destroyer viewers the dedicated completion message while preserving the final participant's current text/button;
3. make already-open non-destroyer viewers render the destruction particle animation when the server enters `destroying`;
4. preserve the accepted cross-viewer occupation-sound behavior.

Alpha.38 is a historical checkpoint; its remaining issues were resolved in alpha.39.

---

## 2026-09-06 — Alpha.37 fully verified

Alpha.37 is now a completed and verified release, not a local candidate.

Release identity:

```text
Commit:
f3b046af268f4afeecc9374bc97215ba14a32b4f

Message:
feat: add multi-user Mandala synchronization

Tag:
v0.4.0-alpha.37
```

### Local verification

```text
Structure check: OK
JavaScript syntax check: OK

Unit:        10/10
Integration: 15/15
API:          7/7

Total automated tests: 32/32
```

### GitHub and deployment verification

- `main` was pushed successfully.
- `v0.4.0-alpha.37` was pushed successfully.
- The VPS fetched the tag successfully.
- `v0.4.0-alpha.37` resolved to commit
  `f3b046af268f4afeecc9374bc97215ba14a32b4f`.
- `scripts/deploy-test.sh v0.4.0-alpha.37` completed successfully.
- Active release:

```text
/opt/pixdala/releases/v0.4.0-alpha.37
```

- `current` was switched to the alpha.37 release.
- `pixdala-test-web` and `pixdala-test-api` were restarted successfully.
- The Git-managed test bot restarted successfully and connected as
  `@PixDalaTestBot`.
- HTTPS smoke test completed successfully.

### Manual Telegram verification

The alpha.37 multi-user synchronization behavior was verified with:

- Telegram Mobile: passed;
- Telegram Desktop: passed;
- cross-client Mandala state synchronization: passed.

Alpha.37 is therefore considered fully verified.

### Next state

The project can now continue from the verified alpha.37 checkpoint.
Before the next substantial development stage, review `docs/ROADMAP.md`,
`docs/PROJECT_STATE.md`, and `docs/PROJECT_CONTEXT.md`.

Do not create a second alpha.37 release or alter the deployed release manually
on the VPS. Further code changes must follow the Windows → local checks →
GitHub commit/tag → VPS tagged deployment workflow.
---

## 2026-09-08 — Main Telegram bot naming migration preparation

The Telegram bot is being migrated from the former test-bot naming to the main
project naming.

Current Git-managed files:

```text
bot/bot.cjs
infra/systemd/pixdala-bot.service
```

The current test Mini App remains:

```text
https://im-test.bktis.ru/apps/miniapp/
```

The release deployment script now targets `pixdala-bot.service` and validates
the renamed bot source and unit.

The former `pixdala-test-bot.service` name remains only as a legacy rollback
artifact for releases predating this migration. It must not run simultaneously
with `pixdala-bot.service`, because both use the same Telegram bot token.

The token remains outside Git in:

```text
/opt/pixdala/.env
TELEGRAM_BOT_TOKEN
```

No Telegram Stars/payment implementation is introduced by this migration.

The migration is now deployed and verified in alpha.42: the renamed unit is installed and active,
the old unit is stopped/disabled, deployment checks passed, and the main `@PixDala_bot` behavior
was verified in Telegram.


---

## 2026-09-09 — Alpha.44 verified

Alpha.44 is the first verified Telegram Stars payment foundation release. The payment path is implemented as permanent project support and is intentionally separate from the future internal `pix` economy. The Mandala Sandbox remains free.

### Release identity

```text
Commit:
6387d2df260752ef51f7b79564038dffb5d8f38c

Tag:
v0.4.0-alpha.44

Active release:
/opt/pixdala/releases/v0.4.0-alpha.44
```

### Payment foundation

- Bot `/start` now exposes `⭐ Поддержать проект`.
- Supported amounts: 1 / 5 / 10 / 25 / 50 / 100 Stars.
- Telegram payment currency: `XTR`.
- Payment intent, pre-checkout verification and completion are server-side.
- Payment records store purpose, amount, user association, status, timestamps and Telegram charge ID.
- Duplicate completion is idempotent.
- Internal payment endpoints accept local requests only.

### Verification

```text
Structure: OK
JavaScript syntax: OK
Unit: 10/10
Integration: 21/21
API: 10/10
Total: 41/41
```

The exact `v0.4.0-alpha.44` tag was deployed to the VPS successfully. Manual Telegram QA completed the support flow with a real 1-Star payment. The resulting payment record was confirmed in the active Alpha.44 database and linked to the Telegram user and Telegram charge ID.

### Known limitation

A user closing/cancelling the Telegram invoice does not currently produce a dedicated cancellation event in the payment ledger. Such intents may remain `pending` until future reconciliation/recovery logic is introduced.

Alpha.44 is therefore the current verified test checkpoint and completes the initial P0.5a payment foundation needed before introducing the internal pix ledger.
