Migrate to new Gitea instance (gitea.wbd-rd.nl)
- Update all submodule URLs from gitea.centraal.wbd-rd.nl to gitea.wbd-rd.nl - Add settler as proper submodule in .gitmodules - Add agent skills, function anchors, decisions, and improvements - Add Docker configuration and scripts - Add manuals and third_party docs - Update .gitignore with secrets and build artifacts - Remove stale .tgz build artifact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
32
.claude/rules/general-functions.md
Normal file
32
.claude/rules/general-functions.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
paths:
|
||||
- "nodes/generalFunctions/**"
|
||||
---
|
||||
|
||||
# General Functions Rules
|
||||
|
||||
## Critical: Platform-Wide Impact
|
||||
generalFunctions is shared by ALL 13 nodes. Any change here can break any node.
|
||||
|
||||
## Before Modifying
|
||||
1. Identify which module(s) you're changing
|
||||
2. Search for imports across all `nodes/*/src/` directories
|
||||
3. List all consuming nodes
|
||||
4. Verify backward compatibility
|
||||
|
||||
## Export Stability
|
||||
- Never remove or rename exports without checking all consumers
|
||||
- Prefer additive changes (new exports) over breaking changes
|
||||
- If a breaking change is necessary, it requires a decision-gate interview
|
||||
|
||||
## Canonical Units
|
||||
MeasurementContainer and internal processing use canonical units:
|
||||
- Pressure: Pa
|
||||
- Flow: m³/s
|
||||
- Power: W
|
||||
- Temperature: K
|
||||
|
||||
Unit conversions happen at system boundaries (input/output), not in core logic.
|
||||
|
||||
## Testing After Changes
|
||||
Run tests in ALL affected consumer nodes, not just generalFunctions itself.
|
||||
31
.claude/rules/node-architecture.md
Normal file
31
.claude/rules/node-architecture.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
paths:
|
||||
- "nodes/*/src/**"
|
||||
---
|
||||
|
||||
# Node Architecture Rules
|
||||
|
||||
## 3-Tier Structure
|
||||
Every node follows entry → nodeClass → specificClass:
|
||||
|
||||
1. **Entry file** (`nodes/<nodeName>/<nodeName>.js`): Registers with Node-RED via `RED.nodes.registerType`, exposes admin HTTP endpoints.
|
||||
2. **nodeClass** (`nodes/<nodeName>/src/nodeClass.js`): Handles Node-RED runtime concerns — message routing, output formatting, tick loops, status updates, `RED.*` API calls.
|
||||
3. **specificClass** (`nodes/<nodeName>/src/specificClass.js`): Pure domain logic — physics, control algorithms, state machines.
|
||||
|
||||
## Separation Rules
|
||||
- **specificClass must never call `RED.*` directly** — all Node-RED interaction goes through nodeClass.
|
||||
- specificClass is the source of truth for domain behavior.
|
||||
- nodeClass is the adapter between Node-RED and domain logic.
|
||||
- Entry file is minimal — registration and admin endpoints only.
|
||||
|
||||
## Output Port Convention
|
||||
- Port 0: Process data (control outputs, state, setpoints)
|
||||
- Port 1: InfluxDB telemetry payload
|
||||
- Port 2: Registration/control plumbing (parent-child handshakes)
|
||||
|
||||
## Admin Endpoints
|
||||
- `GET /<nodeName>/menu.js` — Dynamic menu configuration for editor
|
||||
- `GET /<nodeName>/configData.js` — Runtime configuration for editor
|
||||
|
||||
## Submodule Awareness
|
||||
Most `nodes/*` directories are git submodules. Keep edits scoped to the target node's directory.
|
||||
31
.claude/rules/telemetry.md
Normal file
31
.claude/rules/telemetry.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
paths:
|
||||
- "nodes/*/src/nodeClass.js"
|
||||
---
|
||||
|
||||
# Telemetry Rules
|
||||
|
||||
## Output Port Convention
|
||||
- Port 0: Process data (downstream node consumption)
|
||||
- Port 1: InfluxDB telemetry payload
|
||||
- Port 2: Registration/control plumbing
|
||||
|
||||
## InfluxDB Payload Structure
|
||||
Port 1 payloads must follow InfluxDB line protocol conventions:
|
||||
- **Tags**: Low-cardinality indexed fields (node name, machine type, station ID)
|
||||
- **Fields**: High-cardinality values (measurements, setpoints, quality scores)
|
||||
|
||||
## Cardinality Rules
|
||||
- **Never add high-cardinality tags** — no timestamps, UUIDs, or free-text values as tags
|
||||
- Tags are for grouping/filtering; fields are for values
|
||||
- New tags require review for index impact
|
||||
|
||||
## FlowFuse Dashboard Compatibility
|
||||
- Charts use `msg.topic` for series identification (`category: "topic"`)
|
||||
- Dashboard API endpoints serve pre-aggregated data
|
||||
- Changes to Port 0 `msg.topic` format can break downstream dashboards
|
||||
|
||||
## Consistency
|
||||
- Field names for the same measurement type must be consistent across all nodes
|
||||
- Measurement names follow a documented naming convention
|
||||
- Aggregation windows (1min, 5min, 1hr, 24hr) are standardized
|
||||
35
.claude/rules/testing.md
Normal file
35
.claude/rules/testing.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
paths:
|
||||
- "nodes/*/test/**"
|
||||
---
|
||||
|
||||
# Testing Rules
|
||||
|
||||
## 3-Tier Test Structure
|
||||
Every node must have:
|
||||
- `test/basic/*.test.js` — Unit tests for individual functions
|
||||
- `test/integration/*.test.js` — Node interaction and message passing tests
|
||||
- `test/edge/*.test.js` — Edge cases, error conditions, boundary values
|
||||
- `test/helpers/` (optional) — Shared test utilities for this node
|
||||
|
||||
## Test Runner
|
||||
```bash
|
||||
node --test nodes/<nodeName>/test/basic/*.test.js
|
||||
node --test nodes/<nodeName>/test/integration/*.test.js
|
||||
node --test nodes/<nodeName>/test/edge/*.test.js
|
||||
```
|
||||
|
||||
## Test Requirements
|
||||
- Every behavior change requires a failing-before/passing-after test
|
||||
- Tests must validate against function anchor expected behavior
|
||||
- Example flows (`examples/`) must stay in sync with implementation
|
||||
|
||||
## Example Flows
|
||||
Each node must maintain:
|
||||
- `examples/README.md`
|
||||
- `examples/basic.flow.json`
|
||||
- `examples/integration.flow.json`
|
||||
- `examples/edge.flow.json`
|
||||
|
||||
## No Node-RED Runtime in Unit Tests
|
||||
Basic tests should test specificClass domain logic without requiring a running Node-RED instance.
|
||||
Reference in New Issue
Block a user