Installation lifecycle
Installation lifecycle
Baseline skill. Read references/specification.md, references/installation-scripts.md and references/engineering-contract.md before implementing installation. New-project bootstrap has already installed scripts/install.sh, upgrade.sh, uninstall.sh, install.py, version constants and new-release.sh from approved BMForge templates. Do not create a second installer or release script without a named requirement.
- Ask or infer from explicit requirements which topology is actually needed: library/CLI-only, single-machine service, or client/server on separate machines. Do not select client/server merely because the application uses ZeroMQ or HTTP.
- Use the existing
scripts/install.pyand thin wrappers as the default implementation. It starts withDEPLOYMENT_READY = False. Complete its file ownership, deployment preparation, configuration preservation and validation for the actual application before enabling it. No empty stub may claim an installation completed. - Every successfully installed project owns
D<Name>.BASE_DIR, normally/opt/prod/<slug>, including pure client and custom library installs. Include a readable<slug>/constants/D<Name>.py, the existing.installation-manifest.jsonownership record and the.deployment-versionmarker containing the successfully installed literalD<Name>.VERSION. Ifpyproject.tomlcontains a version, keep it in sync. Keep the payload minimal for library-only installs, but actually install/verify the chosen library or CLI. - If two deployment roles are explicitly required, inspect
references/source/devlog/to learn the client-onlyinstall.sh -server HOST, optionalinstall-server.sh, persistedconf/installation.jsonrole, release activation and role-preservingupgrade.shpattern. Adapt this behaviour inside the application’s own deployment interface. Never transplant DevLog’s time-tracker features, database credentials or hard-coded ports. - Python production isolation (specification 0.1.3): for a Python application with dependencies, configure the existing installer with
REQUIREMENTS_FILE = "requirements.txt",SYSTEM_PYTHONpointing to the host interpreter (not a development venv), andRUNTIME_IMPORTSlisting the package, service, CLI/client and significant third-party modules. Deploy requirements into<BASE_DIR>, create/reuse<BASE_DIR>/.venv, run its pip withinstall --upgrade -rfollowed bypip checkand deployed imports, and recordvenv_ownedbefore creation. Preflight hostvenv/ensurepip, not global PyZMQ. Refuse editable/development requirements, unowned venvs and broken venvs.--checkmust be read-only; failed installation/import/startup may never advance.deployment-version. Remove only installer-owned venvs on uninstall. When dependencies are absent, do not create a venv. - Wire every deployed entry point: make systemd
WorkingDirectorythe installed application directory andExecStartuse<BASE_DIR>/.venv/bin/python. Deployed CLI/client launchers mustcd <BASE_DIR>and execute that interpreter. Fail2ban actions, service health checks, activation probes and scheduled jobs must call the installed launcher or the same interpreter. Never run a production application with/usr/bin/python3or a developer checkoutpython3,PYTHONPATH, editable install or path under/opt/dev. Codex must update actual service definitions, not stop after creating.venv. - Preflight the role-and-operation-specific executable set before any host changes, using identical prerequisites for the actual action and
--check. A fresh server installation must verifymariadbwhen it will provision a database; client installs and upgrades that never provision a database must not require that administrator executable. For a client-only machine, do not install server dependencies, provision MariaDB, create users/systemd units, or require a running server during installation. Validate the address before changes. For a server, provision only explicitly required services, validate startup through the existing application health endpoint, and preserve secrets/configuration. - Implement and test all three mandatory operations: install, upgrade and uninstall. Only create an
install-server.shwhen a separate server installation role is genuinely required. Upgrade retains the installed role and user data; uninstall removes managed files/services for that role while retaining application/user data unless explicitly authorized otherwise. - Use disposable directories and local service/DB fixtures to test metadata-only library installs, client-only installs, server installs, upgrades of both roles, failed activation, uninstall and repeat uninstall. Simulate missing executables and verify that
--checkand the real action both fail before mutation only when those executables are required by the specific operation. For Python services, exercise a real offline dependency install/upgrade, failed pip/imports, an unowned venv, and the service/client/health runtime with the development checkout unavailable. Verify ownership, read-only checks and the last-successful marker. DevLog’s pinned revision has no uninstall script; don’t mistake it for a complete implementation. - Before releasing, check that deployment is enabled, wrappers are executable,
--helpand--checkwork, installed versions match the application’s literals, and success markers move only after verification. Applying thebmforge.installationcomponent marker is provenance, not a substitute for testing. - No installation or uninstall on a real host, Git release, privilege escalation or secret provisioning is authorized merely by loading this skill. Implementation and use are separate. Report which operations were tested and what needs explicit user approval.
The stable standards for Git release publication and skill-version update notifications remain unchanged.