Documentation Audit and Governance¶
This document establishes the audit baseline, verification requirements, outstanding investigation items, and maintenance process for WhiteLotusAI documentation.
It helps the engineering team maintain documentation that is accurate, traceable to the implementation, security-conscious, and suitable for ongoing beta development.
Audit overview¶
| Attribute | Details |
|---|---|
| Audit scope | Architecture, application services, infrastructure, security, configuration, and documentation quality |
| Audit type | Initial source-inspected baseline |
| Documentation generator | Zensical |
| Overall status | Initial baseline; verification remains outstanding |
| Latest reported build | Strict documentation build completed successfully |
| Production verification | Pending |
| Audit owner | To be assigned |
| Next review | Before the next beta release or significant deployment change |
Audit status and limitations
This is an initial source-inspected baseline, not a certification of production readiness, security compliance, or end-to-end operation.
A successful documentation build confirms that the documentation can be generated under the configuration used for that build. It does not prove that application services, integrations, security controls, or deployment procedures work correctly.
1. Purpose and scope¶
The audit covers the following areas:
- Architecture and service responsibilities.
- Data flow and inter-service communication.
- Database and infrastructure documentation.
- Docker deployment and configuration.
- Security and credential management.
- Verification evidence and documentation quality.
- Outstanding engineering questions that affect documentation accuracy.
The audit register records observations and follow-up actions. Findings must remain open until the relevant evidence supports closure, remediation, or an explicitly documented deferral.
2. Audit principles¶
All documentation and audit findings must follow these principles.
- Evidence before claims. Every implementation-specific statement must be supported by source code, configuration, a test result, or another identified source.
- Separate observation from conclusion. A configured port, declared route, or health check does not prove that the corresponding behavior works.
- Preserve uncertainty. Mark unresolved behavior as pending verification rather than filling gaps with assumptions.
- Distinguish documentation from remediation. Recording a problem does not mean it has been fixed.
- Protect sensitive information. Audit records must not contain actual credentials, tokens, encryption keys, or other secrets.
- Track security risks responsibly. A potential misconfiguration is an investigation item, not proof of an exploit.
- Maintain traceability. Findings should identify the relevant file, component, verification method, and follow-up action.
- Review changes continuously. Documentation must evolve alongside the implementation.
3. Documentation scope and status¶
The following pages form the initial documentation baseline.
| Document | Path | Current status |
|---|---|---|
| Architecture Overview | docs/architecture/overview.md |
Drafted; source-inspected baseline |
| System Design | docs/architecture/system-design.md |
Drafted; source-inspected baseline |
| Data Flow | docs/architecture/data-flow.md |
Drafted; source-inspected baseline |
| Database Architecture | docs/architecture/database.md |
Drafted; source-inspected baseline |
| Docker Deployment | docs/deployment/docker.md |
Drafted; source-inspected baseline |
| Configuration Reference | docs/engineering/configuration.md |
Drafted; source-inspected baseline |
| Documentation Audit | docs/governance/documentation-audit.md |
Active audit register |
The documentation build has been reported to complete successfully using the strict Zensical build command. This result applies to the documentation state at the time of the reported build.
Each page's technical status must be upgraded only after its claims have been reviewed against the relevant implementation and, where necessary, verified through tests or runtime evidence.
4. Audit status definitions¶
Use the following statuses consistently throughout the audit register.
| Status | Meaning |
|---|---|
| Not started | Work has not begun. |
| In progress | Investigation or implementation is underway. |
| Drafted | Documentation exists but requires further verification. |
| Verified | The stated behavior has been checked against the relevant source or configuration. |
| Tested | The specified test has been executed and its result recorded. |
| Remediation required | A confirmed issue needs correction. |
| Verification required | Evidence is insufficient to establish the expected behavior or condition. |
| Blocked | Verification cannot proceed because a dependency or decision is missing. |
| Deferred | Work has been intentionally postponed with a documented reason. |
Verification is not testing
Verified and Tested describe different kinds of evidence. Source inspection may establish that a route is declared, while a runtime test is needed to establish that the route is reachable and behaves as expected.
A finding may require both source verification and runtime testing before closure.
5. Findings register¶
The following findings are based on repository observations recorded during the initial documentation review. They are investigation and verification items, not declarations that every identified condition is exploitable or that remediation has been implemented.
5.1 Deployment and configuration¶
| ID | Finding | Evidence area | Required follow-up | Status |
|---|---|---|---|---|
| AUD-001 | Some application health checks test for a Python process rather than actual service readiness. | Local Compose health checks | Replace or supplement process checks with meaningful readiness checks. | Remediation required |
| AUD-002 | The production-oriented Nginx configuration reviewed did not establish a complete HTTPS server configuration. | docker-compose.prod.yaml, nginx/nginx.conf |
Verify certificate issuance, TLS configuration, redirects, and renewal. | Verification required |
| AUD-003 | Session, RAG, and User entry points were observed to start RabbitMQ workers despite Compose port mappings and configured HTTP service URLs. | Service entry points, Compose files, HTTP callers | Verify which HTTP endpoints are actually served and correct stale assumptions. | Verification required |
| AUD-004 | The frontend has a localhost API fallback. | frontend/src/lib/api.ts |
Verify the API URL used by each environment and the frontend build process. | Verification required |
| AUD-005 | The RAG service is configured to run as root in the inspected Compose files. | docker-compose.yaml, docker-compose.prod.yaml |
Assess filesystem permissions and adopt a non-root execution model where feasible. | Remediation required |
| AUD-006 | Local Compose includes development credentials. | docker-compose.yaml |
Ensure production credentials are separate and local defaults cannot be deployed unintentionally. | Verification required |
| AUD-007 | Application startup dependencies include conditions that do not guarantee full readiness. | Compose dependency declarations | Test dependency startup, recovery, and failure behavior. | Verification required |
5.2 Application integration and communication¶
| ID | Finding | Evidence area | Required follow-up | Status |
|---|---|---|---|---|
| AUD-008 | Gmail token persistence calls a User-service HTTP endpoint. | integrations/package/app/managers/gmail_client.py |
Verify that the target URL resolves to a running HTTP server with the expected route. | Verification required |
| AUD-009 | An OAuth-related router exists in the User codebase, but the inspected User entry point starts a RabbitMQ listener. | User application entry point and OAuth token handler | Trace route mounting and deployment arrangements before documenting the endpoint as operational. | Verification required |
| AUD-010 | The Chat service uses permissive wildcard CORS settings together with credentials. | chat/package/app/main.py |
Review browser-origin requirements and define an explicit, tested origin policy. | Remediation required |
| AUD-011 | Integrations uses wildcard CORS origins. | integrations/package/app/main.py |
Confirm the intended browser-access model and restrict origins where appropriate. | Verification required |
| AUD-012 | The REST API uses a catch-all proxy router after explicitly included routers. | REST API application and proxy modules | Test route precedence, authentication boundaries, and forwarding behavior. | Verification required |
| AUD-013 | RabbitMQ RPC request/reply behavior is central to worker communication. | Shared communication implementation | Test correlation IDs, reply queues, timeouts, reconnection, and worker failure scenarios. | Verification required |
5.3 Credentials and repository history¶
| ID | Finding | Evidence area | Required follow-up | Status |
|---|---|---|---|---|
| AUD-014 | The repository history has contained actual-looking LLM API keys in an example environment file. | .env.example and Git history |
Identify affected credentials, revoke or rotate them as appropriate, and review exposure. | Remediation required |
| AUD-015 | An OAuth client JSON file was historically tracked in Git. | Repository history and current Git status | Rotate or replace affected credentials as appropriate and review reachable history. | Remediation required |
| AUD-016 | Deleting a credential file or adding it to .gitignore does not remove historical copies. |
Git history and ignore rules | Verify current tracking, rotate exposed credentials, and evaluate history cleanup. | Verification required |
| AUD-017 | The current configuration inventory is not yet exhaustive. | Application settings and Compose files | Complete a variable-by-variable inventory with ownership and validation rules. | In progress |
Credential exposure requires independent assessment
Historical exposure findings must be assessed even if the files have since been deleted.
A potentially exposed credential must not be considered safe solely because it is absent from the current working tree or ignored by Git. Confirm appropriate revocation or rotation with the credential provider and assess the exposure.
Never place actual credential values, secret contents, private keys, or unredacted environment dumps in this register.
6. Prioritization and remediation workflow¶
The following sequence is the recommended investigation order. It is not a substitute for a formal security risk assessment or incident-response process.
6.1 Priority 1 — Credential exposure and production security¶
- Investigate and rotate potentially exposed credentials.
- Confirm that production secrets are supplied securely.
- Verify the intended public network exposure.
- Resolve the HTTPS configuration gap before representing the deployment as HTTPS-ready.
- Review permissive CORS configuration.
- Assess container privileges.
6.2 Priority 2 — Runtime correctness¶
- Verify the User OAuth token persistence path.
- Resolve mismatches between HTTP service URLs and actual service entry points.
- Improve readiness checks.
- Test RabbitMQ worker communication and failure recovery.
- Verify frontend API URL handling.
6.3 Priority 3 — Documentation completeness¶
- Complete the environment-variable inventory.
- Verify database initialization, migrations, and persistence procedures.
- Add evidence for runtime and integration tests.
- Review the remaining documentation pages for accuracy and consistency.
- Define the documentation release and review process.
6.4 Audit lifecycle¶
The following workflow describes the expected lifecycle of an audit finding.
flowchart TD
A["Identify finding"] --> B["Collect source or configuration evidence"]
B --> C["Assess impact and priority"]
C --> D["Assign owner and follow-up"]
D --> E["Implement remediation or investigate"]
E --> F["Verify the change"]
F --> G{"Acceptance criteria met?"}
G -- "No" --> E
G -- "Yes" --> H["Record evidence and update status"]
H --> I["Close, defer, or continue monitoring"]
classDef evidence fill:#e8f1ff,stroke:#4678b8,color:#172b4d
classDef action fill:#e5f5ed,stroke:#398568,color:#143d2c
classDef decision fill:#fff0d9,stroke:#b98235,color:#55370d
classDef terminal fill:#eee8ff,stroke:#8065b0,color:#33234f
class A,B evidence
class C,D,E,F action
class G decision
class H,I terminal
The diagram is a process model, not evidence that any particular finding has been resolved.
7. Verification evidence requirements¶
Every finding must contain enough evidence for another engineer to reproduce or independently review the conclusion.
7.1 Source-based findings¶
Record the following information:
- Relevant repository path.
- Configuration key, function, route, or code section.
- Observation made and its technical implications.
- Verification date.
- Reviewer, where applicable.
- Follow-up action and current status.
7.2 Runtime findings¶
In addition to source evidence, record:
- Environment tested, such as local, staging, or production.
- Command or test procedure.
- Expected behavior.
- Observed result.
- Relevant logs or test output, with secrets removed.
- Final outcome: passed, failed, or blocked.
Closure requires evidence
Do not mark a finding as resolved solely because a code change has been committed. Verify the relevant behavior after the change and record the result.
7.3 Evidence record template¶
Use the following template when recording a new finding or updating an existing one.
| Field | Required information |
|---|---|
| Finding ID | Unique identifier, such as AUD-018 |
| Observation | Concise, evidence-based description |
| Evidence | File path, configuration reference, test result, or sanitized log |
| Environment | Environment in which verification occurred |
| Owner | Assigned person or team |
| Priority | Relative remediation urgency |
| Action | Required investigation, fix, or verification |
| Status | One of the defined audit statuses |
| Last reviewed | Date of the latest evidence review |
| Closure evidence | Verification result and reference, when applicable |
8. Recommended verification commands¶
Run repository commands from the appropriate project root. Review output before sharing it, especially when configuration files or environment variables may contain secrets.
8.1 Documentation build¶
These commands check documentation generation and Git whitespace errors. They do not test application behavior.
8.2 Docker Compose validation¶
docker compose -f docker-compose.yaml config --quiet
docker compose -f docker-compose.prod.yaml config --quiet
The production validation may require the appropriate environment variables.
The --quiet flag avoids printing the fully rendered Compose configuration, which may contain sensitive values. Still, review the validation environment and avoid publishing secrets from command output or logs.
A successful configuration check does not establish that the containers start, dependencies become ready, or application endpoints work.
8.3 Repository state and change review¶
Use these commands to review outstanding changes, whitespace errors, and change scope. Do not discard unrelated work while cleaning up documentation.
8.4 Tracked credential-related paths¶
git ls-files -- \
.env \
.env.compose \
.env.example \
frontend/.env.local \
frontend/.env.local.example
This command lists matching tracked paths. It does not inspect Git history or establish that credentials are safe.
A broader history review may be necessary when credentials were previously committed. Coordinate history rewriting with repository maintainers because rewriting shared history can disrupt collaborators and does not revoke credentials.
9. Documentation acceptance criteria¶
Use the following checklist before approving a documentation change.
- The page purpose and scope are clear.
- Implementation-specific statements have identifiable evidence.
- Terminology agrees with the repository.
- Paths, service names, and configuration references are correct.
- Diagrams agree with the documented architecture.
- Unknowns and limitations are explicitly identified.
- Secrets and other sensitive values are excluded.
- Links to related pages resolve.
- The strict documentation build succeeds.
- Changes have been reviewed for accidental unrelated edits.
A page should be marked Verified only after its claims have been checked against the relevant implementation. Claims about operational behavior require appropriate runtime evidence.
10. Ongoing documentation governance¶
10.1 Ownership¶
Assign an owner for each major documentation area.
| Area | Suggested owner |
|---|---|
| Architecture | Technical lead or architecture owner |
| API and application services | Backend engineering owner |
| Frontend | Frontend engineering owner |
| Infrastructure and deployment | DevOps or platform owner |
| Security findings | Designated security reviewer |
| Documentation build and navigation | Documentation maintainer |
These are recommended responsibilities. Actual ownership must be assigned by the project team.
10.2 Change management¶
When a code or configuration change affects documented behavior:
- Identify affected documentation pages.
- Update the relevant technical explanation and diagrams.
- Review linked pages for consistency.
- Run the strict documentation build.
- Review the diff for unrelated changes and accidental secret exposure.
- Record any newly discovered audit findings.
- Obtain the required review before merging.
Documentation should be reviewed alongside the implementation change rather than postponed until the end of a release.
10.3 Review cadence¶
Use these review triggers:
- Every relevant pull request: Update affected documentation.
- Every beta release: Review architecture, configuration, deployment, and known issues.
- After a security incident or credential exposure: Review security guidance and affected integration documentation.
- After infrastructure changes: Revalidate service addresses, ports, health checks, persistence, and deployment procedures.
- Periodically: Reassess unresolved findings and remove obsolete documentation.
Set a formal recurring review interval once the project establishes its release and maintenance cadence.
11. Audit completion record¶
Maintain a concise record for each audit cycle. Update it only when new evidence is available.
| Field | Value |
|---|---|
| Audit scope | WhiteLotusAI beta documentation and inspected repository configuration |
| Audit type | Initial source-inspected baseline |
| Documentation generator | Zensical |
| Latest reported build result | Strict build completed without errors |
| Application integration tests | Not established by the documentation build |
| Production deployment verification | Pending |
| Security remediation verification | Pending for applicable findings |
| Audit owner | To be assigned |
| Next review | Before the next beta release or significant deployment change |
The reported build result is historical evidence of documentation generation, not proof that the current application or production deployment is operational.
12. Related documentation¶
Continue from this audit register to the relevant technical references.
- Architecture Overview
- System Design
- Data Flow
- Database Architecture
- Docker Deployment
- Configuration Reference
13. Governance rule¶
WhiteLotusAI documentation is an engineering artifact, not merely a description of intended behavior.
Every important claim must be traceable to evidence. Every unresolved issue must remain visible until it is verified, remediated, or explicitly deferred. Every security-sensitive change must be reviewed for both implementation impact and documentation accuracy.
The objective is not to make the project appear complete. It is to make its actual state understandable, testable, and maintainable.