STATIYA_POLUCHATEL_1
EXEC-17 · RUNTIME DISCOVERY
PRE-START_PROJECT / EXECUTION PACKET

Runtime discovery: выполнить, доказать, только потом замораживать архитектуру

Это следующий практический пакет после SP-16. Он превращает SP-03 из плана в точную read-only процедуру: собрать факты о Work, сохранить evidence, найти конфликты и подготовить основание для immutable START_PROJECT.

11read-only discovery blocks
18runtime facts to verify
5architecture ADR outputs
0production mutations

01 / Execution rules

READ-ONLY FIRST.

Не устанавливать пакеты, не менять nginx/systemd/Docker/config, не писать в production paths. Сначала только доказательства.

START_PROJECT пока запрещён.

Его можно создать только после того, как runtime facts заполнены VERIFIED, а SP-02 technology shortlist reconciled against actual Work.

02 / Discovery blocks

RD-01

Host passport

OS, kernel, time, uptime, CPU, RAM, disks.

hostnamectl || true
uname -a
cat /etc/os-release
date -Is
uptime
nproc
free -h
df -hT
lsblk -f
RD-02

Runtime inventory

Python, Node, npm/pnpm, uv/pip, Docker/Compose.

python3 --version || true
python --version || true
node --version || true
npm --version || true
pnpm --version || true
uv --version || true
pip3 --version || true
docker --version || true
docker compose version || true
RD-03

Locate Work

Find repo/project root, services.html, work-ai-index.html, compose/pyproject/package files.

find /mnt /opt /srv /var/www /home -maxdepth 4 -type d -name .git 2>/dev/null | sed 's#/.git$##' | sort
find /mnt /opt /srv /var/www /home -maxdepth 5 -type f \( -name 'work-ai-index.html' -o -name 'services.html' \) 2>/dev/null
find /mnt /opt /srv /var/www /home -maxdepth 4 -type f \( -name 'compose.yml' -o -name 'docker-compose.yml' -o -name 'pyproject.toml' -o -name 'package.json' \) 2>/dev/null
RD-04

Repo verification

Git remote, branch, commit, status, top-level project map.

git status --short --branch
git remote -v
git rev-parse HEAD
git log -5 --oneline --decorate
find . -maxdepth 2 -type f | sort | sed -n '1,240p'
test -f pyproject.toml && sed -n '1,220p' pyproject.toml || true
test -f requirements.txt && sed -n '1,220p' requirements.txt || true
test -f package.json && cat package.json || true
RD-05

Running services

Listeners, systemd, Docker containers, compose stacks.

ss -lntup || true
systemctl --type=service --state=running --no-pager || true
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}' || true
docker compose ls || true
RD-06

Stateful services

Redis/Valkey/Postgres/SQLite/other state stores.

command -v redis-cli >/dev/null && redis-cli --version || true
command -v valkey-cli >/dev/null && valkey-cli --version || true
command -v psql >/dev/null && psql --version || true
command -v sqlite3 >/dev/null && sqlite3 --version || true
docker ps --format '{{.Names}} {{.Image}}' | grep -Ei 'redis|valkey|postgres|sqlite|mysql|mariadb' || true
RD-07

Reverse proxy

Nginx/server_name/root/proxy_pass/location for work.mathchast.com.

nginx -T 2>/dev/null | sed -n '1,320p' || true
find /etc/nginx -maxdepth 3 -type f -print 2>/dev/null | sort
grep -RniE 'work\.mathchast\.com|server_name|root |proxy_pass|location ' /etc/nginx 2>/dev/null | head -n 400
RD-08

Catalog/index implementation

Services page, service routing, global AI index/generator.

grep -RniE 'work-ai-index|services|Сервисы|service' . --exclude-dir=.git | head -n 400
find . -maxdepth 4 -type f \( -name '*.html' -o -name '*.py' -o -name '*.js' -o -name '*.ts' \) | sort | sed -n '1,500p'
RD-09

Logging

Logging libraries, journal/container config, SSE/WebSocket/EventSource patterns.

grep -RniE 'logging|structlog|loguru|winston|pino|sse|websocket|EventSource' . --exclude-dir=.git | head -n 400
journalctl --disk-usage || true
docker ps --format '{{.Names}}' | while read n; do echo '###' $n; docker inspect "$n" --format '{{json .HostConfig.LogConfig}}' 2>/dev/null; done || true
RD-10

Deploy/rollback

Scripts, services, rsync/scp/systemd/docker deploy conventions.

find . -maxdepth 4 -type f \( -iname '*deploy*' -o -iname '*publish*' -o -name '*.service' -o -name '*.sh' \) | sort
grep -RniE 'rsync|scp|nginx|systemctl|docker compose|deploy|publish' . --exclude-dir=.git | head -n 500
RD-11

Live HTTP proof

DNS + HEAD requests for Work root, work-ai-index, services.

getent hosts work.mathchast.com || true
curl -sSIL --max-time 20 https://work.mathchast.com/ || true
curl -sSIL --max-time 20 https://work.mathchast.com/work-ai-index.html || true
curl -sSIL --max-time 20 https://work.mathchast.com/services.html || true

03 / Runtime passport template

IDFactStatusMeaning
FACT-R01work_project_rootUNVERIFIEDExact path to Work project root.
FACT-R02git_remoteUNVERIFIEDCanonical repository remote.
FACT-R03git_branchUNVERIFIEDCurrent branch.
FACT-R04git_commitUNVERIFIEDCurrent commit hash.
FACT-R05primary_runtimeUNVERIFIEDPython/Node/other.
FACT-R06runtime_versionUNVERIFIEDExact version.
FACT-R07web_frameworkUNVERIFIEDExisting Work backend/frontend framework.
FACT-R08worker_queueUNVERIFIEDExisting background task system.
FACT-R09redis_valkeyUNVERIFIEDPresence/version/ownership.
FACT-R10databaseUNVERIFIEDExisting DB/state store.
FACT-R11logging_stackUNVERIFIEDLogger/event transport.
FACT-R12reverse_proxyUNVERIFIEDNginx/other and site mapping.
FACT-R13deploy_methodUNVERIFIEDVerified publish path/mechanism.
FACT-R14rollback_methodUNVERIFIEDKnown-good rollback approach.
FACT-R15services_catalog_sourceUNVERIFIEDFile/route/generator.
FACT-R16work_ai_index_sourceUNVERIFIEDFile/route/generator.
FACT-R17auth_modelUNVERIFIEDAdmin/operator access model.
FACT-R18dataset_public_rootUNVERIFIEDActual public storage/route convention.

04 / Evidence packet

ArtifactPurpose
evidence/server2_host_passport.txtRD-01 raw sanitized output
evidence/runtime_inventory.txtRD-02 raw sanitized output
evidence/work_location_candidates.txtRD-03
evidence/work_repo_inventory.txtRD-04
evidence/service_inventory.txtRD-05
evidence/stateful_services_inventory.txtRD-06
evidence/nginx_work_routes.txtRD-07
evidence/work_catalog_routes.txtRD-08
evidence/logging_inventory.txtRD-09
evidence/deploy_inventory.txtRD-10
evidence/live_work_http.txtRD-11
runtime_passport.jsonNormalized VERIFIED facts
runtime_conflicts.jsonPlanning vs runtime conflicts
architecture_candidates_reconciled.jsonSP-02 candidate statuses after discovery
IDRedaction rule
RED-01Never copy password/token/API key/cookie/private key values.
RED-02Environment variable names may be recorded; values must be redacted.
RED-03If command output includes secrets, sanitize before saving evidence.
RED-04Private paths may be recorded inside internal evidence, but never copied to public dataset output.
RED-05Do not cat secret stores, .env files, SSH keys or credentials files.

05 / Architecture decisions unlocked by this packet

ADRDecision
ADR-CRAWLERChoose Crawlee vs Scrapy or another already-present compatible core after equal spike.
ADR-STATEChoose persistent job state/queue using existing Work infrastructure first.
ADR-LOGGINGChoose live event transport + structured logging.
ADR-RENDERERChoose existing renderer or Jinja-like template layer.
ADR-DEPLOYBind to real Work deploy/rollback mechanism.

06 / Definition of Done

IDCriterion
A-17-01All RD-01…RD-11 executed read-only or explicitly marked blocked.
A-17-02Work project root and repository are VERIFIED.
A-17-03Active branch and commit are VERIFIED.
A-17-04Primary runtime and versions are VERIFIED.
A-17-05Queue/state/logging/deploy systems are VERIFIED or explicitly proven absent.
A-17-06Reverse proxy/domain mapping is VERIFIED.
A-17-07Services catalog and work-ai-index update mechanisms are located.
A-17-08No secret values are stored in evidence.
A-17-09Conflicts with SP-01…SP-16 are recorded explicitly.
A-17-10Architecture candidate statuses are reconciled.
A-17-11START_PROJECT remains uncreated until all critical runtime facts above are verified.

07 / Next exact action after completion

WHEN ALL CRITICAL RUNTIME FACTS ARE VERIFIED:

1. reconcile SP-02 candidates;
2. run equal bounded crawler spikes;
3. create ADR-CRAWLER / ADR-STATE / ADR-LOGGING / ADR-RENDERER / ADR-DEPLOY;
4. resolve planning ↔ runtime conflicts;
5. create immutable:
   START_PROJECT_AUTONOMOUS_SITE_RESEARCH_PIPELINE_YYYY-MM-DD.html
6. initialize /razraba canonical state;
7. start Active Window 01 from SP-16.