Skip to content

Repository layout and compatibility policy

Refs #105. This is a source-only cleanup, not a deployment or pipeline revival.

  • core/autominer/ledger/: interval derivation, watchtime statistics, session sweep.
  • core/autominer/mining/: aggregation, scoring, target-form and word-key checks.
  • core/autominer/adapters/: Spotify and Stremio pollers (existing stable package).
  • core/autominer/lang/: language profiles — the swappable language-specific layer (script ranges, reading folds, language tags). See docs/language-profiles.md.
  • core/autominer/*.py: stable facade modules and the still-shared application, DB, source/subtitle/media/job modules. See deliberate deferrals below.
  • core/tests/{ledger,mining,adapters,sources,media,ui,operations}/: tests named for behavior instead of historical batch/loop/revision numbers.
  • core/tests/: shared conftest, cross-subsystem integration, browser fixtures and active-PR seams retained at their current paths.
  • scripts/operations/: environment rendering, login bootstrap, backup and reports.
  • scripts/diagnostics/: read-only ASR scan and Anki audit bridge (the latter can write when explicitly invoked with --emit; classification is not permission).
  • scripts/qa/: legacy gate-fixture cleanup. This is destructive production-facing tooling, not a unit test; do not run it during repository validation.
  • deploy/: systemd units and explicit Pi installation scripts; safe-deploy.sh is the supported deployment entrypoint, safe-restart.sh the supported ordinary restart, and reset-pi-from-repo.sh the reset they drive. See safe deployment.
  • packaging/windows/: the one-file Windows installer (build script, Inno Setup script, pinned downloads); built by the manual windows-installer workflow. See its README.
  • separator/, probe_asr/: off-Pi HTTP services the sync judge needs — MDX-Net vocal separation and blind Japanese transcription for the sync judge’s probes (#307). Installed outside the repository or run as Docker images (self-hosting); core reaches them through AM_SEPARATOR_URL / AM_PROBE_ASR_URL and treats an unreachable one as a named refusal, never as a guess.
  • android/morphe-patches/: the YouTube-on-Android client, a Morphe patch bundle (Gradle, GPLv3, built on its own; the .mpp is attached to morphe-patches-v* releases). Setup: phone-youtube.md.
  • extension/: direct-to-Pi browser client and retained legacy agent fallback. Producer admission (which clients the core accepts events from, and what a refused client does with the watch it is holding) is documented in producer admission.
  • Root .env.example: sole template, generated from core/autominer/settings_registry.py (#108); ignored .env: sole installation input for non-secret settings; secrets live in $AUTOMINER_SECRETS_DIR (autominer secret set NAME). See configuration and migration.

The moved backend modules are imported only from their subsystem (autominer.ledger.<name> / autominer.mining.<name>). The old autominer.<name> identity aliases were removed once every import had been repointed; importing an old path now fails. No API route, CLI command, DB schema, static asset URL, service name, or runtime data path changed with the move.

The root scripts/*.py compatibility launchers were removed once the installed units and the Hermes weekly-report symlink pointed at the canonical paths (scripts/operations/, scripts/diagnostics/, scripts/qa/). An external caller still on an old root path must be repointed to its canonical file.

docs/repository-moves.json records every move and the only removed files. Git history retains old issue/batch provenance; descriptive names are for navigation, not an assertion that historical tests are obsolete.

Compared the full live changed-file lists of #104 (feat/reversible-sub-align) and #93 (work/pipeline-s1-pi) against master before moving files.

  • #104 changes app, ASR, assets, source/subtitle acquisition, jobs, segments, tracks and media actions. Their paths/import contracts stay stable. Also keep test_batch11_1_source_delete.py, test_batch11_csv_context_ui.py, and test_loop74_subtitle_file_recalc.py in place. Broad source/media/API module relocation is deferred until #104 lands.
  • #93 changes mobile probes/fixtures and the tests workflow, and adds separate pipeline packages. Keep mobile test/probe paths and that workflow stable. This PR neither edits nor enables the retired automation pipeline.
  • Cross-test browser dependencies (test_subs_ladder_offset_editor.py, waveform tests and the extension core-URL harness) stay together at the root. The suite still runs with python -m pytest core/tests; shared conftest applies recursively.
  • Backend facade shims are intentionally retained. Removing them requires a separate caller migration and deprecation decision, not a repository tidy-up.

Only the five redundant environment templates are removed: deploy/env/{autominer,stremio,spotify}.env.example and infra/{interim,nas}/.env.example. Every setting is represented in the root .env.example, except location-sensitive COMPOSE_FILE, deliberately replaced by explicit -f commands. Application/service settings and Compose host paths have separate allowlists. All repository references and install docs are updated.

No runtime/QA script is deleted on the strength of an empty repository search:

  • autominer-backup.service calls scripts/operations/backup_db.py; the reset reinstalls the unit from deploy/. Live adapter/core units still use the old env paths; preserve those external files and units untouched and document migration.
  • extension/agent/agent.py remains a documented rollback option after #71. Its gate_test_b5.py and paired scripts/qa/cleanup_gate_test.py remain useful as a legacy pair. They are not safe fixture-free validation commands.
  • asr_junk_scan.py, the Anki bridge and weekly report are still meaningful tools; absence of a checked-in scheduler is not proof of disuse.
  • The Device clip worker and the Compose media stack (zurg/rclone, the NAS override) were retired: every clip is cut on the Pi, and sources live on the Pi or a mounted remote store (AUTOMINER_SOURCES_ROOT). Their .env keys are accepted and ignored for one upgrade path (see configuration.md).
  • No live DB, cache, library, secret file, untracked artifact, other checkout or external Windows caller is moved or deleted. Windows scheduler completeness is not assumed: an unknown caller of a removed root scripts/*.py path must be repointed to the canonical file.
Terminal window
python -m pytest core/tests -q -rs -p no:cacheprovider --basetemp=/YOUR/SCRATCH/pytest
ruff check .
npm ci --no-audit --no-fund && npm run lint
# Do not execute the reset or legacy cleanup scripts to lint them:
bash -n deploy/reset-pi-from-repo.sh
shellcheck --severity=warning deploy/reset-pi-from-repo.sh
python scripts/operations/configure_env.py --input .env.example --check

Use a restricted test account and synthetic data. Browser tests require the Node/Playwright/Chromium stack documented by CI. Layout regression tests exercise old/new import identity, the packaged DB schema, sole-template discovery, literal parsing, scoped outputs, invalid inputs, file modes and safe token updates. Build and install the wheel in a scratch venv to verify moved packages remain shipped.