How anand-cpp/sih_2026 works
MAAP-NAWI is an offline Electron desktop application for producing and verifying regulated OIML R 76 evaluation reports. Its principal workflow captures instrument details, records guided bench observations, computes clause-traceable verdicts, then seals and exports a report that can later be reproduced. Separate governance capabilities manage versioned rulebooks, regression checks, permissions and audit integrity. The graph combines README-documented workflow with source-index references; unsampled implementation details are represented only where their subsystem is clear.
Main entry points: report.service.ts Report finalization · evaluation.ts Metrology evaluation · App.tsx Application shell · observation.service.ts Observation capture
Components 25
Desktop experience
- Electron main
src/electron/main.ts - Preload bridge
src/preload/index.ts - IPC contracts
src/shared/ipc.ts - Application shell
src/renderer/App.tsx - Intake screen
src/renderer/screens/IntakeScreen.tsx - Bench screen
src/renderer/screens/BenchScreen.tsx - Verification trace
src/renderer/screens/TraceScreen.tsx - Report repository UI
src/renderer/screens/RepositoryScreen.tsx
Evaluation workflow
- Instrument intake
src/application/intake.service.ts - Observation capture
src/application/observation.service.ts - Report finalization
src/application/report.service.ts
Domain engines
- Metrology evaluation
src/domain/metrology/evaluation.ts - Exact decimals
src/domain/metrology/decimal.ts - Changeover derivation
src/domain/metrology/changeover.ts - Rulebook engine
src/domain/rulebook/engine.ts - Canonical report document
src/domain/reports/document.ts - Canonical hash
src/domain/canonical/index.ts
Governance and records
- Rulebook governance
src/application/rulebook.service.ts - Audit service
src/application/audit.service.ts - Role permissions
src/domain/access/policy.ts
Local persistence and exports
- Dossier storage
src/infrastructure/db/repositories/session.repository.ts - Report storage
src/infrastructure/db/repositories/report.repository.ts - Rulebook storage
src/infrastructure/db/repositories/rulebook.repository.ts - PDF and DOCX export
src/infrastructure/export
Other components
- Lab operator
Connections 27
- Lab operator → Intake screen: enters instrument
README.md - Intake screen → Instrument intake: submits intake
- Instrument intake → Observation capture: opens bench
README.md - Bench screen → Observation capture: records readings
- Observation capture → Metrology evaluation: evaluates observations
src/application/observation.service.ts - Metrology evaluation → Exact decimals: uses exact arithmetic
src/domain/metrology/evaluation.ts - Metrology evaluation → Changeover derivation: derives changeover
src/domain/metrology/evaluation.ts - Metrology evaluation → Rulebook engine: looks up rules
src/domain/metrology/evaluation.ts - Metrology evaluation → Report finalization: feeds finalization
README.md - Rulebook governance → Rulebook engine: validates candidates
src/application/rulebook.service.ts - Rulebook governance → Rulebook storage: manages versions
src/application/rulebook.service.ts - Report finalization → Canonical report document: builds report
src/application/report.service.ts - Report finalization → Canonical hash: seals canonical data
README.md - Report finalization → PDF and DOCX export: generates documents
src/application/report.service.ts - Report finalization → Report storage: seals report
src/application/report.service.ts - Report finalization → Audit service: appends audit event
src/application/report.service.ts - Instrument intake → Dossier storage: creates dossier
src/application/intake.service.ts - Observation capture → Dossier storage: stores readings
src/application/observation.service.ts - Verification trace → Report finalization: requests reproduction
README.md - Report repository UI → Report finalization: finalizes or reproduces
README.md - Application shell → Intake screen: routes to intake
src/renderer/App.tsx - Application shell → Bench screen: routes to bench
src/renderer/App.tsx - Application shell → Verification trace: routes to trace
src/renderer/App.tsx - Application shell → Report repository UI: routes to repository
src/renderer/App.tsx - Electron main → Preload bridge: exposes bridge
- Preload bridge → IPC contracts: uses contracts
src/preload/index.ts - Audit service → Role permissions: checks permissions
src/application/audit.service.ts