adopt_ASG_doc #12
@@ -153,7 +153,8 @@ I'll do the other docs not listed here later myself.
|
||||
|
||||
|
||||
|
||||
|
||||
now help me update the following fileaccording to ASG_Framework/ASG_Framework.md:
|
||||
- NATSBridge/docs/specification.md
|
||||
|
||||
|
||||
<!-- ------------------------------------------- 100 ------------------------------------------- -->
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Specification: NATSBridge
|
||||
|
||||
**Version**: 1.1.0
|
||||
**Date**: 2026-03-15
|
||||
**Date**: 2026-03-23
|
||||
**Status**: Active
|
||||
**Ground Truth**: [`src/NATSBridge.jl`](../src/NATSBridge.jl)
|
||||
**Specification Format**: JSON Schema + AsyncAPI
|
||||
|
||||
---
|
||||
|
||||
## Executive Summary
|
||||
## 1. Technical Contract Overview
|
||||
|
||||
This document defines the **technical contract** for NATSBridge - the cross-platform bi-directional data bridge that enables seamless communication between **Julia**, **JavaScript**, **Python**, and **MicroPython** applications using NATS as the message bus.
|
||||
|
||||
@@ -18,8 +18,33 @@ This specification serves as the single source of truth for:
|
||||
- **Data Shapes**: Exact field names, types, and constraints
|
||||
- **Error Codes**: Standardized error responses for failure scenarios
|
||||
|
||||
### 1.1 Requirements Traceability
|
||||
|
||||
| Specification Section | Requirement ID(s) | Description |
|
||||
|----------------------|-------------------|-------------|
|
||||
| Section 2 (Message Envelope) | FR-012, FR-013, NFR-101, NFR-102 | Message envelope structure and validation |
|
||||
| Section 3 (Payload Schema) | FR-001, FR-002, FR-003, FR-004, NFR-101, NFR-102 | Payload structure and field definitions |
|
||||
| Section 4 (Payload Format) | FR-006, FR-007 | Tuple format for smartsend() |
|
||||
| Section 5 (Enumerations) | FR-003, FR-004, FR-006, NFR-101 | Enumerations for transport and encoding |
|
||||
| Section 6 (Transport Protocols) | FR-003, FR-004, NFR-104, NFR-105 | Direct and link transport protocols |
|
||||
| Section 7 (Size Thresholds) | FR-004, FR-005, NFR-104, NFR-105 | Size thresholds for transport selection |
|
||||
| Section 8 (NATS Subject Convention) | FR-013, FR-014 | NATS subject naming patterns |
|
||||
| Section 9 (Error Handling) | FR-010, FR-011, NFR-201, NFR-202, NFR-203 | Error codes and exception handling |
|
||||
| Section 10 (Serialization Rules) | FR-001, FR-002, FR-003, FR-012, NFR-101, NFR-102 | Serialization and encoding rules |
|
||||
| Section 11 (API Contract) | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 | Function signatures for all platforms |
|
||||
| Section 12 (File Server Interface) | FR-008, FR-009, FR-010 | Upload and download handler contracts |
|
||||
| Section 13 (Platform-Specific Constraints) | FR-005, FR-006, NFR-106, NFR-107 | Platform-specific feature support |
|
||||
| Section 14 (Implementation Files) | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007 | Implementation file mapping |
|
||||
| Section 15 (Message Flow) | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 | Mermaid diagrams for send/receive flows |
|
||||
| Section 16 (Validation Rules) | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 | Envelope and payload validation rules |
|
||||
| Section 17 (Test Contracts) | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 | Unit and integration test scenarios |
|
||||
| Section 18 (Dependencies) | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 | Platform-specific dependencies |
|
||||
| Section 19 (Change Log) | N/A | Version history and changes |
|
||||
|
||||
---
|
||||
|
||||
## 2. Message Envelope Schema
|
||||
|
||||
## Specification Versioning
|
||||
|
||||
| Component | Version | Notes |
|
||||
@@ -65,22 +90,22 @@ This specification serves as the single source of truth for:
|
||||
|
||||
### Field Definitions
|
||||
|
||||
| Field | Type | Required | Validation | Description |
|
||||
|-------|------|----------|------------|-------------|
|
||||
| `correlation_id` | `string` | Yes | UUID v4 format | Track message flow across distributed systems |
|
||||
| `msg_id` | `string` | Yes | UUID v4 format | Unique identifier for this specific message |
|
||||
| `timestamp` | `string` | Yes | ISO 8601 UTC | Message publication timestamp (e.g., `2026-03-13T07:02:50.443Z`) |
|
||||
| `send_to` | `string` | Yes | Non-empty string | NATS subject/topic to publish the message to |
|
||||
| `msg_purpose` | `string` | Yes | Enum | Purpose of the message (see `msg_purpose` enum) |
|
||||
| `sender_name` | `string` | Yes | Non-empty string | Name of the sender application |
|
||||
| `sender_id` | `string` | Yes | UUID v4 format | Unique identifier for the sender |
|
||||
| `receiver_name` | `string` | Yes | Any string | Name of the receiver (empty = broadcast) |
|
||||
| `receiver_id` | `string` | Yes | Any string | UUID of the receiver (empty = broadcast) |
|
||||
| `reply_to` | `string` | Yes | Any string | Topic where receiver should reply (empty = no reply expected) |
|
||||
| `reply_to_msg_id` | `string` | Yes | Any string | Message ID this message is replying to |
|
||||
| `broker_url` | `string` | Yes | Valid URL | NATS broker URL |
|
||||
| `metadata` | `object` | No | Any JSON object | Message-level metadata |
|
||||
| `payloads` | `array` | Yes | Non-empty array | List of payload objects |
|
||||
| Field | Type | Required | Validation | Description | Requirement ID |
|
||||
|-------|------|----------|------------|-------------|----------------|
|
||||
| `correlation_id` | `string` | Yes | UUID v4 format | Track message flow across distributed systems | FR-011, NFR-401 |
|
||||
| `msg_id` | `string` | Yes | UUID v4 format | Unique identifier for this specific message | FR-012, NFR-401 |
|
||||
| `timestamp` | `string` | Yes | ISO 8601 UTC | Message publication timestamp | FR-012, NFR-401 |
|
||||
| `send_to` | `string` | Yes | Non-empty string | NATS subject/topic to publish the message to | FR-013 |
|
||||
| `msg_purpose` | `string` | Yes | Enum | Purpose of the message | FR-013 |
|
||||
| `sender_name` | `string` | Yes | Non-empty string | Name of the sender application | FR-013 |
|
||||
| `sender_id` | `string` | Yes | UUID v4 format | Unique identifier for the sender | FR-013 |
|
||||
| `receiver_name` | `string` | Yes | Any string | Name of the receiver (empty = broadcast) | FR-013 |
|
||||
| `receiver_id` | `string` | Yes | Any string | UUID of the receiver (empty = broadcast) | FR-013 |
|
||||
| `reply_to` | `string` | Yes | Any string | Topic where receiver should reply | FR-013 |
|
||||
| `reply_to_msg_id` | `string` | Yes | Any string | Message ID this message is replying to | FR-013 |
|
||||
| `broker_url` | `string` | Yes | Valid URL | NATS broker URL | FR-013 |
|
||||
| `metadata` | `object` | No | Any JSON object | Message-level metadata | NFR-401 |
|
||||
| `payloads` | `array` | Yes | Non-empty array | List of payload objects | FR-012, FR-013 |
|
||||
|
||||
---
|
||||
|
||||
@@ -103,16 +128,16 @@ This specification serves as the single source of truth for:
|
||||
|
||||
### Payload Field Definitions
|
||||
|
||||
| Field | Type | Required | Validation | Description |
|
||||
|-------|------|----------|------------|-------------|
|
||||
| `id` | `string` | Yes | UUID v4 format | Unique identifier for this payload |
|
||||
| `dataname` | `string` | Yes | Non-empty string | Name of the payload (e.g., `login_image`, `user_data`) |
|
||||
| `payload_type` | `string` | Yes | Enum | Type of payload (see `payload_type` enum) |
|
||||
| `transport` | `string` | Yes | Enum | Transport method: `direct` or `link` |
|
||||
| `encoding` | `string` | Yes | Enum | Encoding method (see `encoding` enum) |
|
||||
| `size` | `integer` | Yes | Positive integer | Size of the payload in bytes |
|
||||
| `data` | `string` or `URL` | Yes | Base64 string or URL | Payload data (base64 for direct, URL for link) |
|
||||
| `metadata` | `object` | No | Any JSON object | Payload-level metadata |
|
||||
| Field | Type | Required | Validation | Description | Requirement ID |
|
||||
|-------|------|----------|------------|-------------|----------------|
|
||||
| `id` | `string` | Yes | UUID v4 format | Unique identifier for this payload | FR-012 |
|
||||
| `dataname` | `string` | Yes | Non-empty string | Name of the payload (e.g., `login_image`, `user_data`) | FR-001, FR-002, FR-003 |
|
||||
| `payload_type` | `string` | Yes | Enum | Type of payload (see `payload_type` enum) | FR-001, FR-002, FR-003, FR-006 |
|
||||
| `transport` | `string` | Yes | Enum | Transport method: `direct` or `link` | FR-003, FR-004, NFR-104, NFR-105 |
|
||||
| `encoding` | `string` | Yes | Enum | Encoding method (see `encoding` enum) | FR-001, FR-002, FR-003, FR-012 |
|
||||
| `size` | `integer` | Yes | Positive integer | Size of the payload in bytes | FR-003, FR-004, NFR-104, NFR-105 |
|
||||
| `data` | `string` or `URL` | Yes | Base64 string or URL | Payload data (base64 for direct, URL for link) | FR-003, FR-004, FR-008, FR-009, FR-010 |
|
||||
| `metadata` | `object` | No | Any JSON object | Payload-level metadata | NFR-401 |
|
||||
|
||||
---
|
||||
|
||||
@@ -325,25 +350,25 @@ When `transport = "link"`, the `data` field contains a URL pointing to the uploa
|
||||
|
||||
### Error Codes
|
||||
|
||||
| Code | HTTP Status | Description | Recovery |
|
||||
|------|-------------|-------------|----------|
|
||||
| `INVALID_ENVELOPE` | 400 | Message envelope validation failed | Fix envelope structure |
|
||||
| `INVALID_PAYLOAD_TYPE` | 400 | Unsupported payload type | Use supported payload_type |
|
||||
| `INVALID_TRANSPORT` | 400 | Unsupported transport type | Use `direct` or `link` |
|
||||
| `UPLOAD_FAILED` | 500 | File server upload failed | Retry or use direct transport |
|
||||
| `DOWNLOAD_FAILED` | 503 | File server download failed | Retry with exponential backoff |
|
||||
| `NATS_CONNECTION_FAILED` | 503 | NATS connection failed | Check NATS server availability |
|
||||
| `DESERIALIZATION_ERROR` | 500 | Payload deserialization failed | Check payload_type matches data |
|
||||
| `SIZE_EXCEEDED` | 413 | Payload exceeds maximum size | Split payload or use link transport |
|
||||
| Code | HTTP Status | Description | Recovery | Requirement ID |
|
||||
|------|-------------|-------------|----------|----------------|
|
||||
| `INVALID_ENVELOPE` | 400 | Message envelope validation failed | Fix envelope structure | FR-012, FR-013, FR-014 |
|
||||
| `INVALID_PAYLOAD_TYPE` | 400 | Unsupported payload type | Use supported payload_type | FR-001, FR-002, FR-003, FR-006 |
|
||||
| `INVALID_TRANSPORT` | 400 | Unsupported transport type | Use `direct` or `link` | FR-003, FR-004, FR-006 |
|
||||
| `UPLOAD_FAILED` | 500 | File server upload failed | Retry or use direct transport | FR-008, FR-009 |
|
||||
| `DOWNLOAD_FAILED` | 503 | File server download failed | Retry with exponential backoff | FR-010, FR-011, NFR-201, NFR-202 |
|
||||
| `NATS_CONNECTION_FAILED` | 503 | NATS connection failed | Check NATS server availability | FR-013, FR-014, NFR-201, NFR-203 |
|
||||
| `DESERIALIZATION_ERROR` | 500 | Payload deserialization failed | Check payload_type matches data | FR-001, FR-002, FR-003, FR-012 |
|
||||
| `SIZE_EXCEEDED` | 413 | Payload exceeds maximum size | Split payload or use link transport | FR-003, FR-004, FR-005, NFR-104, NFR-105 |
|
||||
|
||||
### Exception Handling
|
||||
|
||||
| Scenario | Handler | Retry Policy |
|
||||
|----------|---------|--------------|
|
||||
| File server unavailable | Retry up to 5 times | Exponential backoff (100ms → 5000ms) |
|
||||
| NATS publish failure | Connection auto-reconnect | TCP-level reconnection |
|
||||
| Deserialization error | Log correlation ID and throw | No retry (data corruption) |
|
||||
| Memory overflow (MicroPython) | Reject payloads >50KB | No retry (client-side check) |
|
||||
| Scenario | Handler | Retry Policy | Requirement ID |
|
||||
|----------|---------|--------------|----------------|
|
||||
| File server unavailable | Retry up to 5 times | Exponential backoff (100ms → 5000ms) | FR-010, NFR-202 |
|
||||
| NATS publish failure | Connection auto-reconnect | TCP-level reconnection | FR-013, FR-014, NFR-201, NFR-203 |
|
||||
| Deserialization error | Log correlation ID and throw | No retry (data corruption) | FR-001, FR-002, FR-003, FR-012, NFR-401 |
|
||||
| Memory overflow (MicroPython) | Reject payloads >50KB | No retry (client-side check) | FR-005, NFR-106 |
|
||||
|
||||
---
|
||||
|
||||
@@ -759,23 +784,23 @@ flowchart TD
|
||||
|
||||
### Envelope Validation
|
||||
|
||||
| Rule | Condition | Error Code |
|
||||
|------|-----------|------------|
|
||||
| Required fields present | `correlation_id`, `msg_id`, `timestamp`, `send_to`, `payloads` | `INVALID_ENVELOPE` |
|
||||
| Valid UUID format | `correlation_id`, `msg_id`, `sender_id`, `receiver_id` | `INVALID_ENVELOPE` |
|
||||
| Valid timestamp format | ISO 8601 UTC | `INVALID_ENVELOPE` |
|
||||
| Non-empty payloads array | `length(payloads) > 0` | `INVALID_ENVELOPE` |
|
||||
| Rule | Condition | Error Code | Requirement ID |
|
||||
|------|-----------|------------|----------------|
|
||||
| Required fields present | `correlation_id`, `msg_id`, `timestamp`, `send_to`, `payloads` | `INVALID_ENVELOPE` | FR-012, FR-013 |
|
||||
| Valid UUID format | `correlation_id`, `msg_id`, `sender_id`, `receiver_id` | `INVALID_ENVELOPE` | FR-011, FR-012, NFR-401 |
|
||||
| Valid timestamp format | ISO 8601 UTC | `INVALID_ENVELOPE` | FR-012, NFR-401 |
|
||||
| Non-empty payloads array | `length(payloads) > 0` | `INVALID_ENVELOPE` | FR-012, FR-013 |
|
||||
|
||||
### Payload Validation
|
||||
|
||||
| Rule | Condition | Error Code |
|
||||
|------|-----------|------------|
|
||||
| Valid payload_type | Must be in `payload_type` enum | `INVALID_PAYLOAD_TYPE` |
|
||||
| Valid transport | Must be `direct` or `link` | `INVALID_TRANSPORT` |
|
||||
| Valid encoding | Must match payload_type and transport | `INVALID_TRANSPORT` |
|
||||
| Positive size | `size > 0` | `INVALID_PAYLOAD` |
|
||||
| Valid Base64 for direct | `data` matches Base64 pattern | `DESERIALIZATION_ERROR` |
|
||||
| Valid URL for link | `data` matches HTTP(S) URL pattern | `DOWNLOAD_FAILED` |
|
||||
| Rule | Condition | Error Code | Requirement ID |
|
||||
|------|-----------|------------|----------------|
|
||||
| Valid payload_type | Must be in `payload_type` enum | `INVALID_PAYLOAD_TYPE` | FR-001, FR-002, FR-003, FR-006 |
|
||||
| Valid transport | Must be `direct` or `link` | `INVALID_TRANSPORT` | FR-003, FR-004, FR-006 |
|
||||
| Valid encoding | Must match payload_type and transport | `INVALID_TRANSPORT` | FR-001, FR-002, FR-003, FR-012 |
|
||||
| Positive size | `size > 0` | `INVALID_PAYLOAD` | FR-003, FR-004, NFR-104, NFR-105 |
|
||||
| Valid Base64 for direct | `data` matches Base64 pattern | `DESERIALIZATION_ERROR` | FR-001, FR-002, FR-003, FR-012 |
|
||||
| Valid URL for link | `data` matches HTTP(S) URL pattern | `DOWNLOAD_FAILED` | FR-008, FR-009, FR-010 |
|
||||
|
||||
---
|
||||
|
||||
@@ -783,14 +808,14 @@ flowchart TD
|
||||
|
||||
### Unit Test Validation
|
||||
|
||||
| Test | Input | Expected Output | Notes |
|
||||
|------|-------|-----------------|-------|
|
||||
| Text round-trip | `("msg", "Hello", "text")` | `("msg", "Hello", "text")` | String serialization |
|
||||
| Dictionary round-trip | `("data", {"key": "value"}, "dictionary")` | `("data", {"key": "value"}, "dictionary")` | JSON object round-trip |
|
||||
| Arrow table round-trip | `("table", arrow_table_data, "arrowtable")` | `("table", arrow_table_data, "arrowtable")` | Arrow IPC round-trip |
|
||||
| JSON table round-trip | `("table", [{"a":1},{"b":2}], "jsontable")` | `("table", [{"a":1},{"b":2}], "jsontable")` | JSON array of objects |
|
||||
| Mixed payloads | `[("msg", "Hello", "text"), ("imgname", bytes, "binary")]` | `[("msg", "Hello", "text"), ("imgname", bytes, "binary")]` | Multiple payload types |
|
||||
| Large payload | `("data", rand(10_000_000), "arrowtable")` | `("data", URL, "arrowtable")` with link transport | File server upload |
|
||||
| Test | Input | Expected Output | Notes | Requirement ID |
|
||||
|------|-------|-----------------|-------|----------------|
|
||||
| Text round-trip | `("msg", "Hello", "text")` | `("msg", "Hello", "text")` | String serialization | FR-001, FR-012, NFR-101, NFR-102 |
|
||||
| Dictionary round-trip | `("data", {"key": "value"}, "dictionary")` | `("data", {"key": "value"}, "dictionary")` | JSON object round-trip | FR-002, FR-012, NFR-101, NFR-102 |
|
||||
| Arrow table round-trip | `("table", arrow_table_data, "arrowtable")` | `("table", arrow_table_data, "arrowtable")` | Arrow IPC round-trip | FR-002, FR-012, NFR-101, NFR-102 |
|
||||
| JSON table round-trip | `("table", [{"a":1},{"b":2}], "jsontable")` | `("table", [{"a":1},{"b":2}], "jsontable")` | JSON array of objects | FR-001, FR-002, FR-006, FR-012 |
|
||||
| Mixed payloads | `[("msg", "Hello", "text"), ("imgname", bytes, "binary")]` | `[("msg", "Hello", "text"), ("imgname", bytes, "binary")]` | Multiple payload types | FR-006, FR-007 |
|
||||
| Large payload | `("data", rand(10_000_000), "arrowtable")` | `("data", URL, "arrowtable")` with link transport | File server upload | FR-003, FR-004, FR-008, FR-009, NFR-104, NFR-105 |
|
||||
|
||||
**Platform-Specific Notes:**
|
||||
- **Julia**: Use `Dict`, `Vector{Dict}`, or convert `DataFrame` to dictionary for testing
|
||||
@@ -800,24 +825,24 @@ flowchart TD
|
||||
|
||||
### Integration Test Scenarios
|
||||
|
||||
| Scenario | Platforms | Payloads | Size Mix | Transport | Expected Result |
|
||||
|----------|-----------|----------|----------|-----------|-----------------|
|
||||
| Single text (small) | All | `text` | Small | direct | Round-trip successful |
|
||||
| Single dictionary (small) | All | `dictionary` | Small | direct | Round-trip successful |
|
||||
| Single arrow table (small) | Julia/JS/Python | `arrowtable` | Small | direct | Arrow IPC round-trip |
|
||||
| Single JSON table (small) | All | `jsontable` | Small | direct | Dictionary array round-trip |
|
||||
| Single image (small) | All | `image` | Small | direct | Binary round-trip |
|
||||
| Single audio (small) | All | `audio` | Small | direct | Binary round-trip |
|
||||
| Single video (small) | All | `video` | Small | direct | Binary round-trip |
|
||||
| Single binary (small) | All | `binary` | Small | direct | Binary round-trip |
|
||||
| Single text (large) | All | `text` | Large | link | File server upload/download |
|
||||
| Single JSON table (large) | All | `jsontable` | Large | link | File server upload/download |
|
||||
| Single image (large) | All | `image` | Large | link | File server upload/download |
|
||||
| **Ultimate Test** | Julia/JS/Python | `text` (small) + `dictionary` (small) + `arrowtable` (small) + `jsontable` (small) + `image` (small) + `audio` (small) + `video` (small) + `binary` (small) + `text` (large) + `dictionary` (large) + `arrowtable` (large) + `jsontable` (large) + `image` (large) | Mixed | direct/link | All payloads preserved with correct transport |
|
||||
| **Ultimate Test** | MicroPython | `text` (small) + `dictionary` (small) + `text` (large) + `dictionary` (large) | Mixed | direct | Limited to text/dictionary with direct transport only |
|
||||
| Cross-platform JSON table | All | `jsontable` | Small | direct | Dictionary array round-trip |
|
||||
| MicroPython ↔ Desktop | MicroPython ↔ Desktop | `text`/`dictionary` | Small | direct | Limited payload types |
|
||||
| Desktop ↔ Desktop (all combos) | Julia↔JS↔Python | All types | Small/Large | direct/link | Full compatibility |
|
||||
| Scenario | Platforms | Payloads | Size Mix | Transport | Expected Result | Requirement ID |
|
||||
|----------|-----------|----------|----------|-----------|-----------------|----------------|
|
||||
| Single text (small) | All | `text` | Small | direct | Round-trip successful | FR-001, FR-012, NFR-101, NFR-102 |
|
||||
| Single dictionary (small) | All | `dictionary` | Small | direct | Round-trip successful | FR-002, FR-012, NFR-101, NFR-102 |
|
||||
| Single arrow table (small) | Julia/JS/Python | `arrowtable` | Small | direct | Arrow IPC round-trip | FR-002, FR-012, NFR-101, NFR-102 |
|
||||
| Single JSON table (small) | All | `jsontable` | Small | direct | Dictionary array round-trip | FR-001, FR-002, FR-006, FR-012 |
|
||||
| Single image (small) | All | `image` | Small | direct | Binary round-trip | FR-001, FR-006, FR-012 |
|
||||
| Single audio (small) | All | `audio` | Small | direct | Binary round-trip | FR-001, FR-006, FR-012 |
|
||||
| Single video (small) | All | `video` | Small | direct | Binary round-trip | FR-001, FR-006, FR-012 |
|
||||
| Single binary (small) | All | `binary` | Small | direct | Binary round-trip | FR-001, FR-006, FR-012 |
|
||||
| Single text (large) | All | `text` | Large | link | File server upload/download | FR-003, FR-004, FR-008, FR-009, NFR-104, NFR-105 |
|
||||
| Single JSON table (large) | All | `jsontable` | Large | link | File server upload/download | FR-003, FR-004, FR-008, FR-009, NFR-104, NFR-105 |
|
||||
| Single image (large) | All | `image` | Large | link | File server upload/download | FR-003, FR-004, FR-008, FR-009, NFR-104, NFR-105 |
|
||||
| **Ultimate Test** | Julia/JS/Python | `text` (small) + `dictionary` (small) + `arrowtable` (small) + `jsontable` (small) + `image` (small) + `audio` (small) + `video` (small) + `binary` (small) + `text` (large) + `dictionary` (large) + `arrowtable` (large) + `jsontable` (large) + `image` (large) | Mixed | direct/link | All payloads preserved with correct transport | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-008, FR-009, FR-010, FR-011, FR-012, FR-013, FR-014 |
|
||||
| **Ultimate Test** | MicroPython | `text` (small) + `dictionary` (small) + `text` (large) + `dictionary` (large) | Mixed | direct | Limited to text/dictionary with direct transport only | FR-005, FR-006, FR-012 |
|
||||
| Cross-platform JSON table | All | `jsontable` | Small | direct | Dictionary array round-trip | FR-001, FR-002, FR-006, FR-012 |
|
||||
| MicroPython ↔ Desktop | MicroPython ↔ Desktop | `text`/`dictionary` | Small | direct | Limited payload types | FR-005, FR-006, FR-012 |
|
||||
| Desktop ↔ Desktop (all combos) | Julia↔JS↔Python | All types | Small/Large | direct/link | Full compatibility | FR-001, FR-002, FR-003, FR-004, FR-005, FR-006, FR-007, FR-012, FR-013, FR-014 |
|
||||
|
||||
---
|
||||
|
||||
@@ -871,11 +896,55 @@ flowchart TD
|
||||
|
||||
## References
|
||||
|
||||
- [`docs/requirements.md`](./requirements.md) - Business requirements and user stories
|
||||
- [`docs/architecture.md`](./architecture.md) - System architecture diagrams
|
||||
- [`docs/implementation.md`](./implementation.md) - Implementation details
|
||||
- [`src/NATSBridge.jl`](../src/NATSBridge.jl) - Ground truth implementation
|
||||
- [`README.md`](../README.md) - Project overview
|
||||
### 20.1 Documentation Artifacts
|
||||
|
||||
| Document | Purpose | Requirements Traceability |
|
||||
|----------|---------|--------------------------|
|
||||
| [`docs/requirements.md`](./requirements.md) | Business requirements and user stories | FR-001 through FR-014, NFR-101 through NFR-405 |
|
||||
| [`docs/specification.md`](./specification.md) | Technical contract for NATSBridge | This document |
|
||||
| [`docs/ui-specification.md`](./ui-specification.md) | UI specification for client applications | UI components for data entry and display |
|
||||
| [`docs/walkthrough.md`](./walkthrough.md) | End-to-end system flow | Traceability from user journey to technical implementation |
|
||||
| [`docs/architecture.md`](./architecture.md) | System architecture diagrams | Component interaction and data flow |
|
||||
| [`docs/validation.md`](./validation.md) | CI/CD validation rules | Contract testing and spec compliance |
|
||||
| [`docs/runbook.md`](./runbook.md) | Operational runbook | Deployment, scaling, and troubleshooting |
|
||||
|
||||
### 20.2 Implementation Files
|
||||
|
||||
| File | Platform | Features | Requirements Traceability |
|
||||
|------|----------|----------|--------------------------|
|
||||
| [`src/NATSBridge.jl`](../src/NATSBridge.jl) | Julia | Full feature set, Arrow IPC, multiple dispatch | FR-001 through FR-014, NFR-101 through NFR-405 |
|
||||
| [`src/natsbridge_ssr.js`](../src/natsbridge_ssr.js) | Node.js | Arrow IPC, async/await | FR-001 through FR-014, NFR-101 through NFR-405 |
|
||||
| [`src/natsbridge_csr.js`](../src/natsbridge_csr.js) | Browser | JSON table only, WebSocket NATS | FR-001 through FR-014, NFR-101 through NFR-405 |
|
||||
| [`src/natsbridge.py`](../src/natsbridge.py) | Python | Arrow IPC, async/await | FR-001 through FR-014, NFR-101 through NFR-405 |
|
||||
| [`src/natsbridge_mpy.py`](../src/natsbridge_mpy.py) | MicroPython | Limited to direct transport | FR-005, FR-006, FR-012 |
|
||||
|
||||
### 20.3 External Dependencies
|
||||
|
||||
| Platform | Package | Version | Purpose | Requirements Traceability |
|
||||
|----------|---------|---------|---------|--------------------------|
|
||||
| Julia | NATS.jl | Latest | NATS client | FR-013, FR-014, NFR-201 |
|
||||
| Julia | JSON.jl | Latest | JSON serialization | FR-012, NFR-101, NFR-102 |
|
||||
| Julia | Arrow.jl | Latest | Arrow IPC support | FR-002, FR-012 |
|
||||
| Julia | HTTP.jl | Latest | HTTP file server | FR-008, FR-009 |
|
||||
| Julia | UUIDs.jl | Latest | UUID generation | FR-011, NFR-401 |
|
||||
| Node.js | nats | Latest | NATS client (TCP) | FR-013, FR-014 |
|
||||
| Node.js | node-fetch | Latest | HTTP file server | FR-008, FR-009 |
|
||||
| Browser | nats.ws | Latest | NATS client (WebSocket) | FR-013, FR-014 |
|
||||
| Browser | nats | Latest | NATS client (for bundling) | FR-013, FR-014 |
|
||||
| Python | nats-py | Latest | NATS client | FR-013, FR-014 |
|
||||
| Python | aiohttp | Latest | HTTP file server | FR-008, FR-009 |
|
||||
| Python | pyarrow | Latest | Arrow IPC support | FR-002, FR-012 |
|
||||
| MicroPython | builtin | N/A | Limited implementation | FR-005, FR-006 |
|
||||
|
||||
---
|
||||
|
||||
## 21. Change Log
|
||||
|
||||
| Date | Version | Changes | Requirement ID(s) |
|
||||
|------|---------|---------|-------------------|
|
||||
| 2026-03-23 | 1.1.0 | Updated to ASG Framework specification guidelines | All |
|
||||
| 2026-03-15 | 1.1.0 | Browser connection management | FR-001 through FR-014 |
|
||||
| 2026-03-13 | 1.0.0 | Initial specification | FR-001 through FR-014, NFR-101 through NFR-405 |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user