Skip to content

Commit 0680970

Browse files
committed
feat(docs): establish MailStack documentation baseline
1 parent 1e1737e commit 0680970

26 files changed

Lines changed: 1777 additions & 81 deletions

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ Describe the change and the operational problem it solves.
88
- [ ] Database and deployment compatibility were reviewed.
99
- [ ] Any intentional breaking change is explicitly approved and documented.
1010

11+
## Documentation baseline
12+
13+
- [ ] A `documents/phases/PHASE-NNN-*.md` record was added or updated
14+
- [ ] User-facing changes update `USER_MANUAL.md`, `HOW_TO_USE.md`, or `ADMIN_GUIDE.md`
15+
- [ ] `CHANGELOG.md` was updated
16+
- [ ] `python scripts/manage_documents.py check`
17+
- [ ] `python scripts/test_documents.py`
18+
- [ ] `python scripts/check_documentation_policy.py --base HEAD^ --head HEAD`
19+
1120
## Verification
1221

1322
- [ ] Tests added or updated

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
timeout-minutes: 30
1919
steps:
2020
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
2123

2224
- uses: actions/setup-python@v5
2325
with:
@@ -45,6 +47,17 @@ jobs:
4547
- name: Documentation and metadata validation
4648
run: python scripts/check_docs.py
4749

50+
- name: User documentation synchronization
51+
run: python scripts/manage_documents.py --root . check
52+
53+
- name: Documentation system tests
54+
run: python scripts/test_documents.py
55+
56+
- name: Feature documentation policy
57+
env:
58+
DOCUMENTATION_BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
59+
run: python scripts/check_documentation_policy.py --head "$GITHUB_SHA"
60+
4861
- name: Forensic file inventory
4962
run: python scripts/generate_inventory.py --root . --check
5063

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ All notable repository-level changes are recorded here. Application history befo
1616
- Removed the stale root `SOURCE_MANIFEST.sha256`; verified release archives continue to generate their own manifest.
1717
- Made forensic inventory and source-release ordering deterministic across Windows and Linux by sorting canonical POSIX repository-relative paths.
1818
- Upgraded the pinned Django LTS runtime from 5.2.15 to 5.2.16 to resolve the July 2026 Django security advisories and kept exact-version deployment verification aligned.
19+
- Established `MAILSTACK-1.3.0-RC1-DOCS-BASELINE-001` as the protected feature and documentation baseline.
20+
- Added the root `documents/` user-documentation hub with a user manual, task-based how-to guide, administrator guide, baseline record and mandatory phase history.
21+
- Added deterministic documentation index and manifest synchronization, phase scaffolding, contract tests and CI policy enforcement so maintained feature changes cannot merge without the required user documentation and changelog updates.
1922

2023
### Compatibility
2124

@@ -51,4 +54,4 @@ All notable repository-level changes are recorded here. Application history befo
5154

5255
### Qualification
5356

54-
Automated gates pass. Stable promotion remains blocked on a clean Ubuntu 24.04 VPS acceptance campaign, external SMTP/LMTP verification, online dependency advisory audit and release-owner legal confirmation.
57+
Repository CI, the online dependency advisory audit, deterministic release build, release verification and clean-clone verification pass. Stable promotion remains blocked on a clean Ubuntu 24.04 VPS acceptance campaign, external SMTP/LMTP verification, backup/restore acceptance and release-owner legal confirmation.

CONTRIBUTING.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ pip install -r requirements/development.txt
2323
From the repository root:
2424

2525
```bash
26+
python scripts/manage_documents.py check
27+
python scripts/test_documents.py
28+
python scripts/check_documentation_policy.py --base HEAD^ --head HEAD
2629
python scripts/check_docs.py
2730
python scripts/validate_templates.py
2831
python scripts/test_installer.py
@@ -36,10 +39,28 @@ The full gate runs tests, coverage, Ruff, Bandit, Django checks, contact-service
3639

3740
1. Open an issue for significant behavior, schema or deployment changes.
3841
2. Keep changes narrow and explain compatibility impact.
39-
3. Add or update tests for every behavior change.
40-
4. Update documentation, changelog and release notes where applicable.
41-
5. Do not commit secrets, real mailbox data, personal email addresses, certificates, databases, logs, archives or generated credentials.
42-
6. Confirm the pull-request checklist and CI results.
42+
3. Create or update a `documents/phases/PHASE-NNN-*.md` record for every maintained feature phase.
43+
4. Update `documents/USER_MANUAL.md`, `documents/HOW_TO_USE.md`, or `documents/ADMIN_GUIDE.md` whenever user-visible behavior changes.
44+
5. Run `python scripts/manage_documents.py sync` and commit the generated documentation index and manifest.
45+
6. Add or update tests for every behavior change.
46+
7. Update `CHANGELOG.md`, engineering documentation and release notes where applicable.
47+
8. Do not commit secrets, real mailbox data, personal email addresses, certificates, databases, logs, archives or generated credentials.
48+
9. Confirm the pull-request checklist and CI results.
49+
50+
## Documentation-first phase workflow
51+
52+
Start a maintained phase before implementation:
53+
54+
```bash
55+
python scripts/manage_documents.py new-phase \
56+
--phase-id PHASE-001 \
57+
--title "Feature title" \
58+
--summary "What the phase changes for users"
59+
```
60+
61+
Complete the generated draft, update the affected guides and changelog, then run `sync`, `check`,
62+
the documentation contract tests and the feature-change policy. Draft phase documents and stale
63+
generated documentation cannot pass CI.
4364

4465
## Coding standards
4566

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ ruff check .
188188
bandit -c .bandit -q -r apps config
189189
```
190190

191+
Synchronize and validate user documentation before the complete repository gate:
192+
193+
```bash
194+
python scripts/manage_documents.py sync
195+
python scripts/manage_documents.py check
196+
python scripts/test_documents.py
197+
python scripts/check_documentation_policy.py --base HEAD^ --head HEAD
198+
```
199+
191200
Run the complete repository gate from the project root:
192201

193202
```bash
@@ -232,6 +241,10 @@ See [docs/SCREENSHOTS.md](docs/SCREENSHOTS.md) for the approved screenshot set a
232241

233242
| Area | Document |
234243
|---|---|
244+
| User documentation | [documents/README.md](documents/README.md) |
245+
| User manual | [documents/USER_MANUAL.md](documents/USER_MANUAL.md) |
246+
| How to use | [documents/HOW_TO_USE.md](documents/HOW_TO_USE.md) |
247+
| Administrator guide | [documents/ADMIN_GUIDE.md](documents/ADMIN_GUIDE.md) |
235248
| Quick start | [docs/QUICKSTART.md](docs/QUICKSTART.md) |
236249
| Installation | [docs/INSTALLATION.md](docs/INSTALLATION.md) |
237250
| Configuration | [docs/CONFIGURATION.md](docs/CONFIGURATION.md) |

ROADMAP.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ This roadmap is directional. Security, data integrity and backward compatibility
1212
- Complete backup, restore and restart-recovery acceptance
1313
- Confirm source copyright ownership and third-party license compatibility
1414

15+
## Documentation baseline
16+
17+
- Preserve `MAILSTACK-1.3.0-RC1-DOCS-BASELINE-001` as the starting point for future phases
18+
- Require a phase record, changelog update and affected user-guide update with maintained feature changes
19+
- Keep the generated user-document index and manifest deterministic and CI-enforced
20+
1521
## 1.3 stable
1622

1723
- Promote the verified release candidate without feature removal

docs/DEPENDENCY_REVIEW.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ No obvious conflict was identified between the declared direct dependency licens
2121

2222
## Vulnerability review
2323

24-
`pip check` passes in the audit environment. Django is pinned to 5.2.16, the upstream July 2026 security release for the 5.2 LTS line. GitHub CI retains `pip-audit` as a blocking network-enabled gate.
24+
`pip check` passes. Django is pinned to 5.2.16, the July 2026 security maintenance release for the 5.2 LTS line. The blocking network-enabled `pip-audit` gate passed in GitHub Actions run `30133728843` for commit `1e1737edea2e6c922265a15d8584b56671820c65` and remains mandatory for future changes.

docs/FOLDER_STRUCTURE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
```text
44
.github/ CI, release workflow and contribution templates
55
deployment/templates/ Rendered server configuration templates
6+
documents/ User manual, how-to, admin guide, phase history and generated manifest
7+
phases/ Mandatory per-phase user and compatibility records
68
docs/ Public architecture, operations and release documentation
79
mailbox-app/ Django team mailbox application
810
apps/ Accounts, audit, core, dashboard, ingestion, mailboxes and messages
@@ -14,7 +16,7 @@ mailbox-app/ Django team mailbox application
1416
templates/ Django HTML templates
1517
tests/ Unit, integration, functional, reliability and security tests
1618
public-site/ Static site and isolated contact WSGI service
17-
scripts/ Repository audit, rendering, testing and release tools
19+
scripts/ Repository audit, documentation, rendering, testing and release tools
1820
install.sh Clean Ubuntu 24.04 installer
1921
VERSION Canonical release version
2022
```

docs/FORENSIC_AUDIT_REPORT.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Forensic audit report — MailStack 1.3.0 RC1
22

3-
**Audit date:** 2026-06-30
4-
**Release version:** `1.3.0-rc.1`
5-
**Target runtime:** Ubuntu Server 24.04 LTS and CPython 3.12
6-
**Release classification:** GitHub-ready open-source release candidate
3+
**Baseline audit date:** 2026-07-24
4+
**Release version:** `1.3.0-rc.1`
5+
**Target runtime:** Ubuntu Server 24.04 LTS and CPython 3.12
6+
**Release classification:** CI-qualified and clean-clone-qualified open-source release candidate
77

88
## Executive disposition
99

1010
| Gate | Status |
1111
|---|---|
1212
| Baseline feature preservation | PASS |
1313
| Repository structure and public documentation | PASS |
14+
| User manual, how-to, admin guide and phase-document baseline | PASS |
15+
| Deterministic documentation index, manifest and change policy | PASS |
1416
| Complete AGPL-3.0 license text | PASS |
1517
| Source secret/private-data safety gate | PASS |
1618
| Python, JSON, YAML and shell syntax | PASS |
@@ -21,13 +23,13 @@
2123
| Installer and operations contract tests | PASS |
2224
| Template rendering and placeholder validation | PASS |
2325
| Forensic file/symbol inventory | PASS |
24-
| Deterministic release ZIP, manifest and checksum | Required final build gate |
25-
| Online dependency advisory query | PENDING — audit environment DNS unavailable |
26+
| Deterministic release ZIP, manifest and checksum | PASS in GitHub CI |
27+
| Online dependency advisory query | PASS in GitHub CI |
2628
| Clean Ubuntu 24.04 full-stack acceptance | PENDING external VPS |
2729
| Real inbound SMTP/LMTP acceptance | PENDING external VPS |
2830
| Copyright ownership/license confirmation | PENDING release owner |
2931

30-
**OPEN_SOURCE_RELEASE_CANDIDATE:** PASS
32+
**OPEN_SOURCE_RELEASE_CANDIDATE:** PASS
3133
**PRODUCTION_ACCEPTANCE:** PENDING
3234

3335
## Audited scope
@@ -86,6 +88,8 @@ See `FEATURE_MATRIX.md` for the feature-by-feature verification record.
8688
10. The complete AGPL-3.0 license text and licensing rationale were added.
8789
11. A deterministic file/symbol inventory and documentation consistency gate were added.
8890
12. Local audit virtual environments are ignored without weakening generated-artifact release blocking.
91+
13. A root `documents/` baseline now provides maintained user, administrator and phase documentation.
92+
14. Deterministic synchronization, draft blocking and diff-based CI policy prevent maintained feature changes from merging without substantive documentation.
8993

9094
## Automated evidence
9195

@@ -101,16 +105,17 @@ See `FEATURE_MATRIX.md` for the feature-by-feature verification record.
101105
- Backup/restore/health contracts: **PASS**
102106
- Shell syntax: **13 files PASS**
103107
- Source forensic gate: **PASS with zero blocking findings**
104-
- Documentation gate: **23 required documents PASS**
108+
- Engineering documentation gate: **PASS**
109+
- User-document synchronization, manifest and policy tests: **PASS**
105110
- Python environment consistency (`pip check`): **PASS**
106111

107-
The tests ran locally with Python 3.13.5 because it is the available audit runtime. Package metadata and CI constrain production to Python 3.12 on Ubuntu 24.04.
112+
The authoritative repository qualification is GitHub Actions run `30133728843` on Ubuntu 24.04 with Python 3.12 at commit `1e1737edea2e6c922265a15d8584b56671820c65`. Local isolated audit environments remain useful for non-networked structural checks but do not replace CI.
108113

109114
## Security review
110115

111116
Verified controls include root-only generated secrets, strict configuration validation, Argon2 password hashing, CSRF and secure-cookie controls, login throttling, object-level mailbox authorization, safe HTML sanitization, protected attachments, receive-only SMTP, no public registration, no IMAP/POP3/submission in the reference deployment, MariaDB least privilege, systemd sandboxing, safe archive extraction, checksum verification and fail-closed CI/release gates.
112117

113-
The online `pip-audit` command was attempted but could not resolve `pypi.org` in the isolated environment. This is not a passing vulnerability result; the network-enabled CI step remains blocking.
118+
The network-enabled `pip-audit` command passed as a blocking step in GitHub Actions run `30133728843`. Future dependency changes must continue to pass the locked dependency, `pip check`, and online advisory gates.
114119

115120
## Performance review
116121

@@ -125,7 +130,7 @@ The repository includes an SEO-oriented README, logo asset, release/download/lic
125130
Before stable promotion:
126131

127132
1. Confirm source ownership and third-party license compatibility.
128-
2. Require GitHub CI, including the online dependency advisory audit, to pass.
133+
2. Preserve the successful GitHub CI baseline and require every subsequent release commit to pass all blocking gates.
129134
3. Install on a clean isolated Ubuntu Server 24.04 VPS.
130135
4. Verify DNS, MX, PTR/rDNS, TLS, firewall, unknown-recipient rejection, LMTP delivery, ingestion, authorization, contact delivery, backup, restore and restart recovery.
131136
5. Publish the first version as `v1.3.0-rc.1`; promote to stable only after acceptance.

0 commit comments

Comments
 (0)