Skip to content

Commit 4075aa4

Browse files
authored
Merge pull request #1675 from netalertx/next_release
Next release
2 parents 3e08505 + 5ee3a04 commit 4075aa4

13 files changed

Lines changed: 1172 additions & 138 deletions

File tree

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
### 🧠 NAX Research Skill — Specification
2+
3+
This defines a **Research Skill module for NAX (NetAlertX)** focused on safe, structured analysis before any implementation work.
4+
5+
---
6+
7+
## 1. Purpose
8+
9+
Ensure all work begins with **documentation-first understanding**, **PRD validation**, and **conflict detection**, before any planning or coding.
10+
11+
---
12+
13+
## 2. Core Workflow
14+
15+
### Step 1 — Documentation First
16+
17+
* Always begin by reading relevant repository documentation.
18+
19+
* Priority order:
20+
21+
1. `/CONTRIBUTING.md`
22+
2. `/README.md`
23+
3. `/.github/skills/code-standards/SKILL.md`
24+
4. `/docs/**`
25+
5. Related module/code context if referenced
26+
27+
* Extract:
28+
29+
* Architecture expectations
30+
* Coding standards
31+
* Plugin or module conventions
32+
* Existing workflows or constraints
33+
34+
---
35+
36+
### Step 2 — PRD Check
37+
38+
* If a PRD (Product Requirements Document) is NOT provided:
39+
40+
* Explicitly request it before proceeding further
41+
* Do not assume requirements
42+
43+
* If PRD is provided:
44+
45+
* Parse and restate key requirements internally
46+
* Identify scope boundaries
47+
48+
---
49+
50+
### Step 3 — Clarification Gate
51+
52+
If anything is unclear:
53+
54+
* Stop immediately
55+
* Ask targeted clarifying questions
56+
* Do NOT propose solutions yet
57+
58+
---
59+
60+
### Step 4 — Codebase Cross-Check
61+
62+
* Compare PRD + documentation against existing codebase
63+
64+
* Identify:
65+
66+
* Conflicting behavior
67+
* Outdated patterns
68+
* Duplicate logic
69+
* Breaking assumptions
70+
* Plugin or API mismatches
71+
72+
* Clearly report inconsistencies before proceeding
73+
74+
---
75+
76+
### Step 5 — Planning Requirement (Strict)
77+
78+
Before any implementation:
79+
80+
* Produce a structured plan including:
81+
82+
* Approach overview
83+
* Files/modules affected
84+
* Dependencies
85+
* Risk areas
86+
* Migration considerations (if any)
87+
88+
* Explicitly label:
89+
90+
> “WAITING FOR USER CONFIRMATION”
91+
92+
---
93+
94+
### Step 6 — Implementation Gate (Hard Rule)
95+
96+
* Do NOT start implementation until user explicitly confirms the plan
97+
* No partial coding, no early patches, no assumptions
98+
99+
---
100+
101+
## 3. Behavioral Constraints
102+
103+
* Always prioritize correctness over speed
104+
* Never skip PRD validation
105+
* Never proceed past ambiguity
106+
* Never implement without approval
107+
* Always surface contradictions in source material
108+
* Always prefer asking questions over guessing
109+
110+
---
111+
112+
## 4. Output Style Rules
113+
114+
* Be structured and technical
115+
* Avoid unnecessary verbosity
116+
* Separate:
117+
118+
* Findings
119+
* Risks
120+
* Questions
121+
* Plan
122+
* No hidden assumptions
123+
124+
---
125+
126+
## 5. Summary Flow
127+
128+
```
129+
Docs → PRD → Clarify → Codebase Check → Plan → User Approval → Implement
130+
```
131+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ db/pialert.db
1919
db/app.db
2020
front/log/*
2121
/log/*
22+
.gemini/internal-docs/PRDs/*
2223
/log/plugins/*
2324
front/api/*
2425
/api/*

docs/WORKFLOW_EXAMPLES.md

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Sometimes devices are manually archived (e.g., no longer expected on the network
5454

5555
* `devIsArchived` is `1` (archived).
5656
* `devPresentLastScan` is `1` (device was detected in the latest scan).
57+
5758
* **Action**:
5859

5960
* Updates the device to set `devIsArchived` to `0` (unarchived).
@@ -110,6 +111,7 @@ When new devices join your network, assigning them to the correct network node i
110111
* **Conditions**:
111112

112113
* `devLastIP` contains `192.168.1.` (matches subnet).
114+
113115
* **Action**:
114116

115117
* Sets `devNetworkNode` to the specified MAC address.
@@ -175,11 +177,78 @@ You may want to automatically clear out newly detected Google devices (such as C
175177

176178
* `devVendor` contains `Google`.
177179
* `devIsNew` is `1` (device marked as new).
180+
178181
* **Actions**:
179182

180183
1. Sets `devIsNew` to `0` (mark as not new).
181184
2. Deletes the device.
182185

183186
### ✅ Result
184187

185-
Any newly detected Google devices are cleaned up instantly — first marked as not new, then deleted — helping you avoid clutter in your device records.
188+
Any newly detected Google devices are cleaned up instantly — first marked as not new, then deleted — helping you avoid clutter in your device records.
189+
190+
---
191+
192+
## Example 4: On new device discovery archive the old device with the same ip
193+
194+
This workflow automatically archives devices if a new device is discovered with an already assigned IP.
195+
196+
### 📋 Use Case
197+
198+
This workflow is useful if you are assigning static IPs to your devices. This workflow can also help with archiving device entries with [random MAC addresses](./RANDOM_MAC.md).
199+
200+
### ⚙️ Workflow Configuration
201+
202+
```json
203+
{
204+
"name": "Archive device with same ip",
205+
"trigger": {
206+
"object_type": "Devices",
207+
"event_type": "insert"
208+
},
209+
"conditions": [
210+
{
211+
"logic": "AND",
212+
"conditions": []
213+
}
214+
],
215+
"actions": [
216+
{
217+
"type": "update_field",
218+
"field": "devIsArchived",
219+
"value": "1",
220+
"target": {
221+
"strategy": "query",
222+
"conditions": [
223+
{
224+
"field": "devLastIP",
225+
"operator": "equals",
226+
"value": "{{trigger.devLastIP}}"
227+
}
228+
]
229+
}
230+
}
231+
]
232+
}
233+
```
234+
235+
### 🔍 Explanation
236+
237+
* **Trigger**: Runs on a new device being inserted.
238+
239+
* **Conditions**:
240+
241+
* `N/A`
242+
243+
* **Target Conditions**:
244+
245+
* `devLastIP` of the target is the same as the newly discovered device's `devLastIP` value.
246+
247+
* **Actions**:
248+
249+
1. Sets `devIsArchived` to `1` (mark target device as archived).
250+
251+
252+
### ✅ Result
253+
254+
Any newly detected device that has the same IP as an existing device will automatically trigger the archival of the old device.

front/css/app.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,17 @@ textarea[readonly],
23382338
padding: 5px;
23392339
}
23402340

2341+
.workflows .add-target-condition
2342+
{
2343+
margin: 10px;
2344+
text-align: center;
2345+
}
2346+
2347+
.workflows .inline-hint
2348+
{
2349+
margin: 5px;
2350+
}
2351+
23412352
.workflows
23422353
{
23432354
max-width: 800px;
@@ -2430,6 +2441,18 @@ textarea[readonly],
24302441
color: var(--color-green) !important;
24312442
}
24322443

2444+
.workflows .action-target-conditions
2445+
{
2446+
opacity: 0.8;
2447+
}
2448+
2449+
.workflows .bckg-icon-base
2450+
{
2451+
display: block;
2452+
position: absolute;
2453+
opacity: 0.1;
2454+
right: 0.1em;
2455+
}
24332456
.workflows .bckg-icon-1-line
24342457
{
24352458
font-size: 3em;

front/php/templates/language/en_us.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,9 @@
742742
"VERSION_name": "Version or timestamp",
743743
"WF_Action_Add": "Add Action",
744744
"WF_Action_field": "Field",
745+
"WF_Action_target": "Apply action to",
746+
"WF_Action_target_conditions": "Target device conditions",
747+
"WF_Action_token_hint": "Use <code>{{trigger.COLUMN}}</code> to reference the triggering device (e.g. <code>{{trigger.devLastIP}}</code>, <code>{{trigger.devMac}}</code>)",
745748
"WF_Action_type": "Type",
746749
"WF_Action_value": "Value",
747750
"WF_Actions": "Actions",

0 commit comments

Comments
 (0)