Skip to content

Commit d7804e9

Browse files
committed
Document uniform module lifecycle contract and Windows integration
1 parent 74603ba commit d7804e9

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

docs/MODULE-LIFECYCLE.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Module Lifecycle Contract
2+
3+
The Java.Web.Server.Telnet.Front.Java.21 repository now defines a uniform lifecycle surface for its modules:
4+
5+
```text
6+
install → update → verify → remove
7+
```
8+
9+
The repository already contains many per-module backend start/shutdown hooks; for example, the module tree contains `start-backend.sh` and `shutdown-backend.sh` pairs across modules. The Windows US-House tooling also already exposes install/update/remove/status operations for Microsoft and Apple package aliases. fileciteturn103file0 fileciteturn103file15 fileciteturn100file0
10+
11+
## Controllers
12+
13+
Linux/macOS/WSL-style environments:
14+
15+
```bash
16+
scripts/module-lifecycle.sh status all
17+
scripts/module-lifecycle.sh install all
18+
scripts/module-lifecycle.sh update all
19+
scripts/module-lifecycle.sh verify all
20+
scripts/module-lifecycle.sh remove <module>
21+
```
22+
23+
Windows PowerShell:
24+
25+
```powershell
26+
powershell -File scripts/module-lifecycle.ps1 -Action status -Module all
27+
powershell -File scripts/module-lifecycle.ps1 -Action install -Module all
28+
powershell -File scripts/module-lifecycle.ps1 -Action update -Module all
29+
powershell -File scripts/module-lifecycle.ps1 -Action verify -Module all
30+
powershell -File scripts/module-lifecycle.ps1 -Action remove -Module <module>
31+
```
32+
33+
## Contract
34+
35+
Every module should eventually expose these optional repository-local hooks:
36+
37+
- `install.sh` — install/prepare the module.
38+
- `update.sh` — update/rebuild the module.
39+
- `verify.sh` — verify expected source/build/runtime state.
40+
- `uninstall.sh` — remove installed artifacts using module-specific knowledge.
41+
- `start-backend.sh` / `shutdown-backend.sh` — runtime lifecycle where applicable.
42+
- `start-frontend.sh` / `shutdown-frontend.sh` — web deployment lifecycle where applicable.
43+
44+
The generic controllers use the best available repository-local build mechanism when a hook is absent: Make, Maven, or Gradle.
45+
46+
## Removal safety
47+
48+
**Remove does not delete source code.** It stops/undeploys supported services and removes recognized generated artifacts such as `out`, `build`, `target`, `.class`, and generated `.jar` files. A module-specific `uninstall.sh` takes precedence when one exists.
49+
50+
This keeps repository history, source, documentation, and configuration separate from installed/generated state.
51+
52+
## Windows ecosystem
53+
54+
The repository's existing US-House Windows PowerShell controller uses `winget` for Microsoft and Apple package operations and supports `install`, `update`, `remove`, `status`, and `list`. fileciteturn100file0
55+
56+
The new lifecycle controller complements that package layer: it manages **repository modules**, while US-House manages **host software packages**.
57+
58+
## Acceptance rule
59+
60+
A module is lifecycle-complete when it has:
61+
62+
1. a deterministic install path;
63+
2. a deterministic update path;
64+
3. a verification path with meaningful checks;
65+
4. a safe removal path;
66+
5. explicit runtime start/stop hooks when it is a service;
67+
6. documentation of dependencies and generated artifacts.
68+
69+
No module should become an installation orphan merely because its build or deployment mechanism differs from another module.

0 commit comments

Comments
 (0)