feat: portable Windows data layout and launcher package

Separate persistent user data from application code (data/work_tracker.db,
data/uploads, data/storage) with idempotent legacy migration and SQLite
integrity checks. Add offline packaging scripts for a Windows x11 x64
portable ZIP (embeddable Python, Start/Stop/Backup.bat). Fix launcher:
no multiline python -c in BAT and no os.dup2 — uvicorn runs detached with
wvt.log; health wait and busy-port diagnostics included.
This commit is contained in:
Арсентьев Александр
2026-10-20 15:55:04 +03:00
parent a6449a7d70
commit b97d79e13a
28 changed files with 2432 additions and 11 deletions
@@ -0,0 +1,85 @@
# REQ — Repository Cleanup Audit Before Portable Packaging
## Status
Audit-only task. No files may be deleted or modified during this pass, except the report deliverable.
## Goal
Prepare the Work Volume Tracker repository for a Windows x64 portable distribution by identifying clutter, obsolete artifacts, duplicate files, generated outputs, and packaging risks. The immediate task is to inspect and report, not to clean the repository or build the portable package.
## Context
The current local MVP is considered ready for practical use during the upcoming business trip. The intended next steps are:
1. Audit repository clutter and packaging contents.
2. Review the report and explicitly approve any cleanup.
3. Perform an approved, conservative cleanup.
4. Prepare a portable Windows x64 package with application code/runtime separated from user data and backups.
5. Consider API-based updating later, as a separate task.
The working tree may contain unfinished POST-E2E and BUG-UI work, saved QA artifacts, and other uncommitted work. These are not automatically disposable.
## Scope of this task
Inspect the repository and classify files/directories into these categories:
1. **Required runtime files** — modules, templates, static assets, document templates, migrations, runtime dependencies and configuration required by the app.
2. **Required development/test files** — tests, task specs, implementation reports, documentation and scripts that should remain in the source repository but should not be in the portable runtime package unless needed at runtime.
3. **Generated/re-creatable clutter candidates** — Python caches, test caches, build output, temporary logs, disposable test output directories and similar artifacts, only when their purpose is confirmed.
4. **Potentially obsolete/duplicate files** — old copies of templates, renamed backups, duplicate documents, abandoned scripts or dependencies that appear unused. These require evidence before recommending removal.
5. **User/business data — never delete** — SQLite databases, project storage, uploads, photos, generated documents, exports/backups and any unknown files that may contain user data.
6. **Uncommitted work and QA artifacts — preserve** — changes and untracked files related to POST-E2E, BUG-UI, KS-2, KS-3, daily-report photos, Playwright or other unfinished/accepted work. Do not assume that a file is disposable because its name begins with `_tmp_` or contains `out`.
7. **Sensitive/configuration files** — `.env`, credentials, certificates, local paths or machine-specific settings. Do not print secrets into the report; only identify the file and risk.
## Required inspection
- Run `git status --short` and capture the current branch and recent commit information.
- Inventory repository files and directory sizes, including untracked files.
- Identify Python cache directories, test caches, generated outputs, temporary scripts, duplicate-looking document templates and build artifacts.
- Inspect `.gitignore`, dependency declarations, entry points, runtime path configuration, template/static/document-template references and test configuration.
- Search for references to candidate obsolete files before classifying them as unused.
- Determine which files are required at runtime versus only for development/tests.
- Identify any local user data that currently lives inside the repository and would be at risk if the source tree were replaced during portable updates.
- Consider SQLite consistency and file dependencies when identifying backup requirements.
## Safety constraints
- **Do not delete, move, rename, rewrite, stage, commit, or revert any existing file.**
- Do not run `git clean`, `git reset`, broad cleanup scripts, database reset commands or commands that mutate the working tree.
- Do not use `git add .` or otherwise stage changes.
- Do not alter or remove POST-E2E, BUG-UI, KS-2, KS-3, photo attachment, QA, or any other uncommitted work.
- Do not delete anything merely because it looks temporary, duplicated or untracked.
- Do not include user database contents, project files, photos, generated documents or secrets in the report.
- Preserve the current working tree exactly; only create the requested audit report in the designated task/report location.
- Do not build the portable package or implement an updater during this task.
## Deliverable
Create `docs/implementation/REQ-repository-cleanup-audit.md` containing:
1. Summary of repository state and working-tree status.
2. Runtime dependency/file map.
3. Candidate clutter list with exact paths, size, classification and evidence.
4. Potential duplicate/obsolete file list with reference-search results and confidence.
5. Files/directories that must be preserved, including uncommitted task work and QA artifacts.
6. Data currently stored inside the application tree and the risks this creates for portable updates.
7. Proposed cleanup plan split into:
- Safe to remove after approval.
- Requires further investigation.
- Must not be removed.
8. Recommended `.gitignore` or packaging exclusions, if needed, as suggestions only; do not change `.gitignore` in this task.
9. Proposed source-to-portable package boundary: what belongs in the app package, what belongs in persistent `data/`, and what belongs in `backups/`.
10. Blockers and questions requiring the user's decision.
For every cleanup candidate, explain why it appears disposable and how that was verified. If uncertain, classify it as “investigate”, not “remove”.
## Acceptance criteria
- The audit report exists at `docs/implementation/REQ-repository-cleanup-audit.md`.
- The report distinguishes runtime files, development/test files, generated artifacts and user data.
- Uncommitted and untracked work is explicitly accounted for and preserved.
- Every proposed deletion has an exact path and supporting evidence.
- No existing files were deleted, moved, renamed, staged or modified.
- No commit or push was performed.
- The report ends with a short recommendation for the next step, awaiting explicit approval before cleanup begins.