Skip to content

Commit 91e5c30

Browse files
authored
Merge pull request #56 from m1ngsama/feat/module-lifecycle-governance
Add module lifecycle governance for TNT 1.1.0
2 parents 1284d5d + c0bbcc2 commit 91e5c30

28 files changed

Lines changed: 1828 additions & 39 deletions

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
attributes:
1212
label: Version
1313
description: Run `tnt --version`, or provide the commit hash.
14-
placeholder: "tnt 1.0.1"
14+
placeholder: "tnt 1.1.0"
1515
validations:
1616
required: true
1717
- type: dropdown

MAINTAINERS

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
PROJECT METADATA
2+
S: Maintained
3+
F: .github/**
4+
F: .gitignore
5+
F: LICENSE
6+
F: MAINTAINERS
7+
F: demos/**
8+
F: include/.gitkeep
9+
F: scripts/check_maintainers.sh
10+
F: scripts/get_maintainer.sh
11+
F: src/.gitkeep
12+
13+
TNT CORE
14+
S: Maintained
15+
F: Makefile
16+
F: install.sh
17+
F: tnt.service
18+
F: include/*.h
19+
F: src/*.c
20+
F: include/common.h
21+
F: include/config_defaults.h
22+
F: src/main.c
23+
F: src/common.c
24+
F: src/config_defaults.c
25+
26+
SSH SERVER AND EXEC INTERFACE
27+
S: Maintained
28+
F: include/bootstrap.h
29+
F: include/ssh_server.h
30+
F: include/exec*.h
31+
F: include/tntctl_text.h
32+
F: src/bootstrap.c
33+
F: src/ssh_server.c
34+
F: src/exec*.c
35+
F: src/tntctl*.c
36+
F: tests/test_exec_mode.sh
37+
F: tests/test_tntctl_cli.sh
38+
39+
INTERACTIVE TUI
40+
S: Maintained
41+
F: include/input*.h
42+
F: include/tui*.h
43+
F: include/history_view.h
44+
F: src/input*.c
45+
F: src/tui*.c
46+
F: src/history_view.c
47+
F: tests/test_interactive_input.sh
48+
F: tests/test_user_lifecycle.sh
49+
50+
MESSAGE STORAGE
51+
S: Maintained
52+
F: include/message*.h
53+
F: src/message*.c
54+
F: scripts/logrotate.sh
55+
F: tests/test_message_log_tool.sh
56+
F: tests/test_logrotate.sh
57+
F: docs/MESSAGE_LOG.md
58+
59+
MODULE CORE INTERFACE
60+
S: Maintained
61+
F: include/module_*.h
62+
F: src/module_*.c
63+
F: scripts/module_check.sh
64+
F: scripts/install_wizard.sh
65+
F: tests/test_module_*.sh
66+
F: tests/test_install_wizard.sh
67+
F: docs/MODULE_PROTOCOL.md
68+
F: docs/INSTALL_LIFECYCLE.md
69+
70+
PACKAGING AND RELEASE
71+
S: Maintained
72+
F: packaging/**
73+
F: scripts/healthcheck.sh
74+
F: scripts/package_*.sh
75+
F: scripts/check_release_ref.sh
76+
F: scripts/release_check.sh
77+
F: scripts/setup_cron.sh
78+
F: tests/test_release_artifact_gate.sh
79+
F: tests/test_source_archive.sh
80+
F: docs/DEPLOYMENT.md
81+
F: docs/CICD.md
82+
83+
TESTING
84+
S: Maintained
85+
F: tests/**
86+
87+
DOCUMENTATION
88+
S: Maintained
89+
F: README.md
90+
F: SECURITY.md
91+
F: docs/**
92+
F: tnt.1
93+
F: tntctl.1

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ script-test: all
133133
@echo "Running script tests..."
134134
@cd tests && ./test_cli_options.sh
135135
@cd tests && ./test_docs_help_surface.sh
136+
@cd tests && ./test_get_maintainer.sh
137+
@cd tests && ./test_check_maintainers.sh
138+
@cd tests && ./test_module_check.sh
139+
@cd tests && ./test_install_wizard.sh
136140
@cd tests && ./test_logrotate.sh
137141
@cd tests && ./test_message_log_tool.sh
138142
@cd tests && ./test_source_archive.sh

README.md

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,20 @@ A minimalist terminal chat server with Vim-style interface over SSH.
1717

1818
### Installation
1919

20-
**One-liner:**
20+
**Pinned release installer:**
2121
```sh
22-
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
22+
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/v1.1.0/install.sh | VERSION=v1.1.0 sh
2323
```
2424
The installer verifies downloaded release binaries against `checksums.txt`
2525
before installing them. Older releases may provide only `tnt`; newer releases
2626
also install `tntctl`.
2727

28+
For convenience during testing, the moving `main` installer is also available:
29+
30+
```sh
31+
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
32+
```
33+
2834
**From source:**
2935
```sh
3036
git clone https://github.com/m1ngsama/TNT.git
@@ -36,6 +42,18 @@ sudo make install
3642
**Binary releases:**
3743
https://github.com/m1ngsama/TNT/releases
3844

45+
**Interactive setup guide:**
46+
47+
After installing the binary, operators can generate a reviewable environment
48+
file and choose a module profile with the terminal setup wizard:
49+
50+
```sh
51+
scripts/install_wizard.sh --output tnt.env
52+
```
53+
54+
The wizard does not restart services or install modules. Review the generated
55+
file, then install it manually as your systemd environment file.
56+
3957
### Running
4058

4159
```sh
@@ -422,6 +440,33 @@ replace placeholder checksums, and run:
422440
SOURCE_TARBALL=dist/tnt-chat-vX.Y.Z-source.tar.gz make package-publish-check
423441
```
424442

443+
## Module Development
444+
445+
TNT modules are external processes that speak the `tnt.module.v1` JSON Lines
446+
protocol over stdin/stdout. TNT core stays minimal, Unix-like, text-first, and
447+
reliable; modules are the optional layer for richer modern-terminal interaction,
448+
visual presentation, workflow automation, and future community features.
449+
450+
The core server owns the protocol contract and the runtime supervisor;
451+
community module examples and module packages live in the public companion
452+
repository:
453+
454+
https://github.com/m1ngsama/tnt-modules
455+
456+
Before enabling a third-party module, check its manifest and handshake:
457+
458+
```sh
459+
scripts/module_check.sh /path/to/module
460+
```
461+
462+
Enable reviewed modules explicitly:
463+
464+
```sh
465+
TNT_MODULE_PATHS=/opt/tnt-modules/echo-module:/opt/tnt-modules/other-module tnt
466+
```
467+
468+
Unset `TNT_MODULE_PATHS` and restart TNT to return to the plain core server.
469+
425470
## Files
426471

427472
```
@@ -432,11 +477,11 @@ tnt.service - systemd service unit
432477
```
433478

434479
The persisted chat-history format is documented in
435-
[docs/MESSAGE_LOG.md](docs/MESSAGE_LOG.md). Experimental community modules
436-
should follow the external-process protocol in
437-
[docs/MODULE_PROTOCOL.md](docs/MODULE_PROTOCOL.md). Module-generated content
438-
must always include a plain-text fallback so TNT can keep working on basic
439-
terminal clients and preserve the stable `messages.log` v1 history contract.
480+
[docs/MESSAGE_LOG.md](docs/MESSAGE_LOG.md). The core module protocol is
481+
documented in [docs/MODULE_PROTOCOL.md](docs/MODULE_PROTOCOL.md).
482+
Module-generated content must always include a plain-text fallback so TNT can
483+
keep working on basic terminal clients and preserve the stable `messages.log`
484+
v1 history contract.
440485

441486
### MOTD (Message of the Day)
442487

@@ -457,6 +502,7 @@ Delete `motd.txt` to disable the MOTD.
457502
- [Development Guide](https://github.com/m1ngsama/TNT/wiki/Development-Guide) - Complete development manual
458503
- [Quick Setup](docs/EASY_SETUP.md) - 5-minute deployment guide
459504
- [Roadmap](docs/ROADMAP.md) - Long-term Unix/GNU direction and next stages
505+
- [Installation Lifecycle](docs/INSTALL_LIFECYCLE.md) - Setup wizard, module selection, and rollback model
460506
- [Interface Contract](docs/INTERFACE.md) - Scriptable commands, exit statuses, and JSON fields
461507
- [Module Protocol](docs/MODULE_PROTOCOL.md) - External-process module contract
462508
- [Security Reference](docs/SECURITY_QUICKREF.md) - Security config quick reference

docs/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@
22

33
## Unreleased
44

5+
## 1.1.0 - 2026-06-16
6+
57
### Added
8+
- Added `scripts/module_check.sh` for validating third-party module manifests,
9+
entrypoints, protocol handshakes, permissions, events, and TNT minimum
10+
version compatibility before deployment.
11+
- Added `scripts/install_wizard.sh`, a non-mutating installer guide that writes
12+
reviewable environment files for core-only, all-compatible, selected, and
13+
manually supplied module deployments.
14+
- Added `MAINTAINERS` plus maintainer lookup and coverage checks, giving the
15+
core runtime, module interface, packaging, tests, and documentation explicit
16+
ownership patterns.
17+
- Added regression tests for module manifest compatibility, install wizard
18+
selection behavior, maintainer lookup, and maintainer coverage.
619
- Added a release tag/version guard used by the GitHub release workflow, so a
720
`vX.Y.Z` tag must match `TNT_VERSION` before release assets are built.
821
- Added `make package-publish-check` for verifying Arch/Homebrew source
@@ -51,6 +64,15 @@
5164
and server survival stay responsive.
5265

5366
### Changed
67+
- Module names are now restricted to lowercase ASCII letters, digits, and
68+
hyphens, with a length cap that keeps generated `module:<name>` senders
69+
within the public message username limit.
70+
- The module runtime now disables modules that flood a single event with too
71+
many responses or repeatedly emit invalid response records, keeping bad
72+
downstream modules isolated from the core server.
73+
- Module documentation now treats the public companion module repository as
74+
downstream of the TNT core protocol and keeps TNT's core Unix surface
75+
minimal, text-first, and robust.
5476
- INSERT-mode chrome now only advertises message sending and `Esc` to NORMAL;
5577
`? keys` appears only in NORMAL mode, matching where help keys work.
5678
- Dismissing MOTD now returns first-time users to INSERT mode, and `Ctrl+C`

docs/CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,20 @@ utf8.c → UTF-8 string handling
9797
4. Put shared localized strings in `src/i18n_text.c`.
9898
5. Add or update the narrowest unit/integration test for the behavior.
9999

100+
## Adding Modules
101+
102+
TNT core owns the module protocol, runtime supervisor, and compatibility tests.
103+
Community modules and module examples live in the companion repository:
104+
105+
```text
106+
https://github.com/m1ngsama/tnt-modules
107+
```
108+
109+
For core protocol or runtime changes, update `docs/MODULE_PROTOCOL.md`, add or
110+
update tests in this repository, and keep `scripts/module_check.sh` aligned with
111+
the manifest and handshake rules. For new module implementations, contribute to
112+
the companion module repository instead of adding them to TNT core.
113+
100114
## Debugging Tips
101115

102116
```sh

docs/DEPLOYMENT.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Quick Install
44

5-
One-line install (latest release):
5+
Pinned release install:
66
```bash
7-
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
7+
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/v1.1.0/install.sh | VERSION=v1.1.0 sh
88
```
99

10-
Specific version:
10+
Moving latest-release installer, convenient for test deployments:
1111
```bash
12-
VERSION=vX.Y.Z curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
12+
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
1313
```
1414

1515
## Manual Install
@@ -82,6 +82,20 @@ sudo systemctl restart tnt
8282
The service uses `StateDirectory=tnt`, so systemd creates `/var/lib/tnt` automatically.
8383
Use `TNT_STATE_DIR` or `tnt -d DIR` when running outside systemd to avoid depending on the current working directory.
8484

85+
To generate a reviewable environment file with an interactive terminal setup
86+
wizard:
87+
88+
```bash
89+
scripts/install_wizard.sh --output tnt.env
90+
sudo install -m 600 tnt.env /etc/default/tnt
91+
sudo systemctl restart tnt
92+
```
93+
94+
The wizard can choose a core-only deployment, scan a module root, select
95+
individual modules, or validate a manually entered module path list. It never
96+
downloads modules, edits systemd units, or restarts TNT by itself. See
97+
`docs/INSTALL_LIFECYCLE.md` for the full operator lifecycle.
98+
8599
Recommended interpretation:
86100

87101
- `TNT_MAX_CONNECTIONS`: global connection ceiling
@@ -109,7 +123,9 @@ For that profile:
109123
- Prefer plain-text fallbacks for every module-created message, even when the
110124
module also targets richer terminal renderers.
111125
- Before promoting a module, test its manifest and JSONL handshake against the
112-
protocol in `docs/MODULE_PROTOCOL.md`.
126+
protocol in `docs/MODULE_PROTOCOL.md` with `scripts/module_check.sh`.
127+
- Develop and publish community modules in the public companion repository:
128+
`https://github.com/m1ngsama/tnt-modules`.
113129

114130
Enable modules explicitly with `TNT_MODULE_PATHS`, using a colon-separated
115131
list of module directories:
@@ -183,8 +199,8 @@ sudo firewall-cmd --reload
183199
# Stop service
184200
sudo systemctl stop tnt
185201

186-
# Re-run install script
187-
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
202+
# Re-run the pinned installer for the version you want
203+
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/v1.1.0/install.sh | VERSION=v1.1.0 sh
188204

189205
# Start service
190206
sudo systemctl start tnt

docs/INSTALL_LIFECYCLE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Installation Lifecycle
2+
3+
TNT core is the small Unix tool: text-first, compatible, and reliable. Modules
4+
are downstream enhancements for modern terminal UX, visuals, automation, and
5+
community features. Module failure must not take TNT down.
6+
7+
## Flow
8+
9+
1. Install `tnt` and `tntctl`.
10+
2. Choose a profile: `core`, `select`, `all`, or `manual`.
11+
3. Validate modules with `scripts/module_check.sh`.
12+
4. Generate an env file with `scripts/install_wizard.sh`.
13+
5. Review, install, restart, smoke-test.
14+
6. Roll back by removing `TNT_MODULE_PATHS` and restarting.
15+
16+
## Commands
17+
18+
Generate a reviewable env file:
19+
20+
```sh
21+
scripts/install_wizard.sh --output tnt.env
22+
```
23+
24+
Preview all modules under a root:
25+
26+
```sh
27+
scripts/install_wizard.sh --print-modules --module-root /opt/tnt-modules
28+
```
29+
30+
Generate an all-valid-modules env file:
31+
32+
```sh
33+
TNT_SETUP_PROFILE=all \
34+
TNT_SETUP_MODULE_ROOT=/opt/tnt-modules \
35+
scripts/install_wizard.sh --non-interactive --output tnt.env
36+
```
37+
38+
Activate manually:
39+
40+
```sh
41+
sudo install -m 600 tnt.env /etc/default/tnt
42+
sudo systemctl restart tnt
43+
ssh -p 2222 localhost health
44+
```
45+
46+
The wizard never installs binaries, downloads modules, edits systemd units, or
47+
restarts services. It only makes choices visible and emits config.

0 commit comments

Comments
 (0)