Engineering Mandate, Architectural Invariants & Contribution Standard
Maintained by the Жирняк & Адольф Петушков Engineering Syndicate
Technology Foundation:TypeScript / Node.js / WebSocket / Vector Embeddings / Fastify
- 🏛️ Architectural Overview & Data Flow
- 📐 Strict Domain Invariants
- 💻 Development Toolchain & Local Environment
- 🧪 Testing Strategy & Verification Pipeline
- 💎 Code Standards & Anti-Patterns
- 🚀 Pull Request Protocol & Review Workflow
- 👥 Syndicate Governance & Attribution
StomChat Omnichannel Clinical Knowledge & Telemedicine Triage is engineered for maximum performance, deterministic state transitions, and zero computational slop. All contributions must respect existing subsystem boundaries and data flows:
graph TD
A[Patient Chat Client] -->|WebSocket Connection| B[Fastify WS Gateway]
B -->|Symptom Extraction| C[Vector Embedding Engine]
C -->|Cosine Search > 0.78| D[(Clinical Knowledge Base)]
D -->|Verified Medical Context| E[Safety Guardrail Classifier]
E -->|Doctor Escalation Signal| F[Doctor Dashboard]
E -->|Triage Guidance Payload| A
- Primary Compute / Domain Engine: Handles low-latency calculations, domain solvers, and state mutations.
- Validation & Boundary Layer: Enforces strict typing, schema assertions, and input sanitization before payloads enter the internal core.
- Presentation & Stream Sinks: Zero-allocation rendering, audio synthesis, or serialization buffers feeding client viewports.
Every pull request is automatically audited against these immutable project invariants. If any invariant is violated, the PR will be rejected:
- Formal Requirement: Symptom classifier must never provide definitive diagnoses; all triage outputs mandate professional doctor review.
- Verification Protocol: Automated unit test assertion + mathematical boundary check.
- Failure Mode: Immediate build rejection; PR cannot be approved without meeting this invariant.
- Formal Requirement: Real-time channels must maintain 30s ping-pong keepalives with automated reconnect backoff.
- Verification Protocol: Automated unit test assertion + mathematical boundary check.
- Failure Mode: Immediate build rejection; PR cannot be approved without meeting this invariant.
- Formal Requirement: RAG retrieval chunks below 0.78 cosine similarity must be rejected as unverified.
- Verification Protocol: Automated unit test assertion + mathematical boundary check.
- Failure Mode: Immediate build rejection; PR cannot be approved without meeting this invariant.
- Formal Requirement: Human doctor intervention instantly revokes bot response privileges on the active session.
- Verification Protocol: Automated unit test assertion + mathematical boundary check.
- Failure Mode: Immediate build rejection; PR cannot be approved without meeting this invariant.
- Primary Runtime:
TypeScript / Node.js / WebSocket / Vector Embeddings / Fastify - Git with configured GPG signing keys
- Static Analysis & Linters matching project versions
# 1. Clone the repository
git clone https://github.com/marko1olo/stomchat.git
cd stomchat
# 2. Check out target working branch
git checkout main
# 3. Install dependencies & initialize toolchains
npm install || cargo check || dotnet restore || pip install -r requirements.txt || make preflight
# 4. Execute the complete test suite
npm test || pytest || dotnet test || make testEvery non-trivial PR must contain empirical verification evidence. We do NOT accept "tested manually and looks fine":
- Unit & Invariant Tests: Must explicitly verify the mathematical or logical properties of the modified subsystem.
- Boundary & Edge-Case Sweeps: Test with zero-length inputs, extreme boundary coordinates, or adversarial configurations.
- Zero-Allocation Benchmarking: For render or audio frame loops, run the memory profiler to verify zero heap allocations per tick.
// ✅ CORRECT: Clinical Safety Score Verification
export function evaluateRAGContext(similarity: number, snippet: MedicalSnippet): VerifiedContext | null {
if (similarity < 0.78) return null; // Reject low confidence chunks
return { text: snippet.content, sourceId: snippet.id, doctorReviewRequired: true };
}- ❌ No AI Slop Comments: Avoid decorative fluff like
// This function handles calculating the result. Comment why, never what. - ❌ No Type Bypasses: Never use
any,unknowncasts without runtime assertions, or unchecked pointer arithmetic. - ❌ No Unbounded Memory Growth: Always provide explicit upper bounds on caches, array allocations, and event queues.
graph TD
A[Fork Repository] --> B[Create Descriptive Branch /feat or /fix]
B --> C[Implement Code & Satisfy Invariants]
C --> D[Run Full Test Suite & Linters]
D --> E[Submit PR with Benchmark Proof]
E --> F[Syndicate Adversarial Code Review]
F -->|Approved| G[Rebase & Fast-Forward Merge]
F -->|Corrections Needed| C
- Branch Naming:
feat/<subsystem>-<feature>,fix/<subsystem>-<bug>,perf/<subsystem>-<optimization>. - Commit Standard: Conventional Commits format with lowercase scope (
feat(core): implement SIMD acceleration). - PR Description: Include root-cause analysis, benchmark numbers (before/after), and test commands executed.
This project is authored and curated under the oversight of the Жирняк & Адольф Петушков Engineering Syndicate. All contributions merged into this repository will be credited to their authors while maintaining syndicate licensing integrity.