zenmemes Platform Docs Download

Repository source: docs/plans/local_server_dependency_checks/local_server_dependency_checks_step4_implementation_summary.md

Feature plan: Step 1 · Step 2 · Step 3 · Step 4

Stage 1 - Executable and version readiness

  • Changes: added a shared read-only shell assessment for ./v3 start and ./v3 check-dependencies, covering missing/unusable Git and PHP, PHP 8.1 minimum, runtime identity, manual recovery, and unchanged startup arguments. Reused existing PHP setup guidance. Grouped the four artifacts and added plan navigation; added scoped checklist progress.

  • Verification: bash -n v3 scripts/local_server_dependencies.sh; bash tests/missing_php_startup_test.sh; bash tests/local_server_dependency_checks_test.sh; real PHP 8.3 diagnostic invocation; git diff --check all passed. PHP 8.1 syntax checks passed for all 255 source/script/public/autoload PHP files. PHP 8.1 filtered bootstrap, Unicode policy, and thread/reply write tests: 12 passed, 0 failed.

  • Notes: Ubuntu PHP 8.1 and 8.3 packages were downloaded/extracted under /tmp/v3-dependency-runtime for testing; system packages, PHP configuration, and PATH were not changed. PHP 8.1 source compatibility and ordinary local behavior substantiate the existing 8.1 minimum. Extension/process and optional diagnostics follow in subsequent stages. Production deployment and external-service checks are out of scope.

Stage 2 - Required runtime capabilities

  • Changes: added a standalone pre-application probe for PDO, PDO SQLite opening in memory, mbstring and its used functions, server process/lifecycle functions, PHP child execution, PHP shell execution, and Git execution from PHP. Both entry points share aggregated checks and selected-CLI/configuration recovery guidance; Ubuntu 24.04/PHP 8.3 extension instructions remain manual. Checks never inspect or alter application databases or repositories.

  • Verification: both shell regression scripts and PHP 8.1 probe syntax passed; real PHP 8.1/8.3 healthy diagnostic reports passed. A real PHP 8.3 matrix removed PDO, PDO SQLite, and mbstring, and disabled proc_open, exec, and mb_ord: both commands returned 1 with actionable guidance and no log, repository, database, or fatal error. Restored SQLite/PHP/Git execution returned 0 without application state changes. git diff --check passed.

  • Notes: missing software and disabled PHP functions have distinct guidance; a standalone sqlite3 executable does not satisfy PDO SQLite. PHP-dependent probes are skipped when PHP/version prerequisites are unavailable. Terminal and normalization warnings follow in Stage 3; persistent integration coverage follows in Stage 4.

Stage 3 - Optional degradation and reliable shutdown

  • Changes: added nonblocking warnings for intl, PCNTL functions/constants, terminal shell_exec, and stty; guarded terminal sizing/restoration and kept plain fallback logs. The Bash launcher supervises the PHP wrapper through a control pipe so SIGINT/SIGTERM and launcher exit permit child cleanup without PCNTL. PHP cleanup is registered for error exits and uses bounded termination, with forced child termination if graceful termination fails. Missing intl guidance explains existing combining-mark rejection.

  • Verification: shell regressions and Bash/PHP 8.1 syntax checks passed. Real PHP 8.3 lifecycle checks covered 20 combinations: normal runtime, missing PCNTL functions, disabled shell_exec, both disabled, and missing stty, each with terminal/redirected output and SIGINT/SIGTERM to the foreground process group. Every case served an HTTP request, wrote plain logs, exited successfully, and left no listener. PHP 8.1 Unicode policy/risk and logging tests passed: 25 run, 0 failures. Required-failure matrix remained passing; git diff --check passed.

  • Notes: terminal cosmetics stay optional. Lifecycle control needs Bash (already the launcher interpreter), not a new installed signal utility. The test packages include PCNTL statically, so absent support was exercised by disabling its functions. Runtime warnings do not change diagnostic success status.

Stage 4 - Repeatable end-to-end recovery verification

  • Changes: added tests/local_server_dependency_runtime_test.py, a Python-standard-library harness using real PHP, isolated projects/configurations, state snapshots, installer sentinels, HTTP thread/reply creation and reads, PTY/redirected output, and launcher/process-group signals. Expanded shell coverage for unreadable PHP identity. Corrected an existing Unicode inspector test that assumed intl was absent; it now verifies both normalization outcomes, with a matching policy regression.

  • Verification: PHP 8.3 integration passed seven required-capability failure cases in both entry points and 20 HTTP read/write/log/shutdown combinations. PHP 8.1 integration passed eight failure cases (including disabled escapeshellarg), healthy/restored and corrupt-database readiness reports, unattended installer sentinels, and the same 20 lifecycle combinations. PHP 8.3 targeted bootstrap/write/Unicode/logging suite: 29 passed. PHP 8.1 Unicode/logging suite: 26 passed. Both shell scripts, Bash syntax checks, and git diff --check passed.

  • Notes: every real-runtime failure preserved the isolated project's complete file snapshot; dependency reports do not validate application checkout/database health. Tests require Python 3 for HTTP/PTY orchestration and PHP CLI with its normal required extensions; neither is installed by the tests. Shared-extension removal cases explicitly skip statically compiled modules. Existing Unicode application behavior remains unchanged.

Stage 5 - Setup, discovery, and release evidence

  • Changes: documented local requirements, selected CLI/configuration recovery, Ubuntu 24.04/APT packages, generic guidance, optional Unicode/terminal behavior, retry, diagnostic statuses and limits, and standalone regression commands. Updated canonical CLI reference/help; diagnostic -h/--help works without PHP/Git. Added actionable Git setup and optional intl guidance, report readiness summary, and a Bash 4.1+ prerequisite check before sourcing shutdown supervision. All seven local-server checklist items are complete; broader workflow items remain future work.

  • Verification: both shell regression scripts, Bash syntax, PHP 8.1 probe syntax, real PHP 8.3 diagnostic/help invocation, and git diff --check passed. Final PHP 8.3 real-runtime integration passed eight required failure cases in both entry points, read-only restored/corrupt-state reports, installer sentinels, and all 20 HTTP read/write/log/shutdown combinations. Ubuntu APT metadata confirms documented Git/Bash/coreutils/PHP 8.3 package availability; packages previously downloaded/extracted provided actual test runtimes. All 18 plan/navigation/reference links resolve; setup and command/test documentation markers are present.

  • Notes: Ubuntu 24.04 with Bash 5.2 and PHP 8.1/8.3 is the verified environment; other environments receive generic guidance without a support claim. Bash 4.1+ is required by the control-pipe supervisor, and missing Bash/launcher utilities require the documented external setup path. Production deployment, external services, and unrelated command preflights remain outside scope. No software installation offer exists, so installation-decline/partial-install rollback checks are not applicable. System PHP is still absent; only temporary test runtimes were prepared.

Review follow-up - Scannable dependency reports

  • Changes: implemented the user's requested checkmarks and command emphasis for both sample failure reports. Diagnostic status rows use ✓/✗/!/? with a legend, terminal colors, and a clear READY/NOT READY result. Runtime details and manual recovery follow the status list; install commands occupy separate lines and appear in bold cyan on terminals. Missing/unusable PHP shows each dependent capability as unchecked and still checks stty independently. Reports stay together on stdout; redirected output and NO_COLOR contain no color escapes. Startup retains its existing guidance and status behavior.

  • Verification: both shell regressions, Bash syntax, PHP 8.1/8.3 syntax, and git diff --check passed. Expanded real-runtime tests verified eight required-failure cases in both entry points, status/result/recovery ordering, missing-PHP and missing-extension terminal reports, highlighted setup/configuration commands, NO_COLOR, unchanged state, and all 20 HTTP read/write/log/shutdown combinations.

  • Notes: the user supplied a second sample and requested highlighted commands during this follow-up; both samples are covered. Unknown capabilities are distinct from detected missing dependencies. Colors require a terminal and are disabled whenever NO_COLOR is set. System PHP 8.3 is now available in the workspace; this follow-up installed no software.

Review follow-up - Concise startup recovery and command alias

  • Changes: startup failures use short status rows; required Ubuntu PHP extension packages share one install command, optional intl recovery is separate, and runtime context and retry instructions appear once. Commands are emphasized on a terminal and respect NO_COLOR. Added dependency-check as an alias for check-dependencies; updated CLI documentation and the checklist.

  • Verification: both shell regressions and PHP 8.1/8.3 syntax passed. The extracted PHP 8.3 runtime passed eight required-failure cases across startup and both diagnostic names, grouped-install assertions, read-only readiness checks, and 20 HTTP read/write/log/shutdown combinations. Expanded terminal checks cover startup highlighting and NO_COLOR. The host runtime lacks a shared mbstring module required by the test fixture; tests use the existing temporary extracted runtime without installing system packages.

  • Notes: automatic installation remains a separate Step 1 proposal, uncommitted pending review.