Phase 1: PeerTube plugin and recon_domains module

Single source of truth for the 18 RECON knowledge domains mapped to
PeerTube category IDs 100-117. Replaces duplicate VALID_DOMAINS sets
in enricher.py and embedder.py with imports from lib/recon_domains.py.

Includes PeerTube plugin (peertube-plugin-recon-domains) that registers
custom categories via videoCategoryManager.addConstant(), and a parity
test to verify constants match between RECON and the PeerTube API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-04-28 00:04:13 +00:00
commit 71e3dc12ed
7 changed files with 207 additions and 14 deletions

View file

@ -0,0 +1,52 @@
# peertube-plugin-recon-domains
Registers 18 RECON knowledge domains as PeerTube video categories using IDs 100-117. These categories are assigned automatically by RECON's domain assignment pipeline based on concept extraction analysis.
## Category Mapping
| ID | Domain |
|-----|---------------------------|
| 100 | Agriculture & Livestock |
| 101 | Civil Organization |
| 102 | Communications |
| 103 | Food Systems |
| 104 | Foundational Skills |
| 105 | Logistics |
| 106 | Medical |
| 107 | Navigation |
| 108 | Operations |
| 109 | Power Systems |
| 110 | Preservation & Storage |
| 111 | Security |
| 112 | Shelter & Construction |
| 113 | Technology |
| 114 | Tools & Equipment |
| 115 | Vehicles |
| 116 | Water Systems |
| 117 | Wilderness Skills |
Built-in PeerTube categories (IDs 1-18) are not modified.
## Install
```bash
# Copy plugin to PeerTube storage
cp -r peertube-plugin-recon-domains /var/www/peertube/storage/plugins/node_modules/
# Register plugin via API or admin UI
# Admin > Plugins > Install > peertube-plugin-recon-domains
# Restart PeerTube
sudo systemctl restart peertube
```
## Uninstall
Remove the plugin via PeerTube admin UI or:
```bash
rm -rf /var/www/peertube/storage/plugins/node_modules/peertube-plugin-recon-domains
sudo systemctl restart peertube
```
Videos with RECON categories will revert to showing the raw category ID until the plugin is reinstalled.

View file

@ -0,0 +1,28 @@
async function register ({ videoCategoryManager }) {
const reconDomains = {
100: 'Agriculture & Livestock',
101: 'Civil Organization',
102: 'Communications',
103: 'Food Systems',
104: 'Foundational Skills',
105: 'Logistics',
106: 'Medical',
107: 'Navigation',
108: 'Operations',
109: 'Power Systems',
110: 'Preservation & Storage',
111: 'Security',
112: 'Shelter & Construction',
113: 'Technology',
114: 'Tools & Equipment',
115: 'Vehicles',
116: 'Water Systems',
117: 'Wilderness Skills'
}
for (const [id, label] of Object.entries(reconDomains)) {
videoCategoryManager.addConstant(parseInt(id), label)
}
}
module.exports = { register }

View file

@ -0,0 +1,20 @@
{
"name": "peertube-plugin-recon-domains",
"version": "1.0.0",
"description": "Registers 18 RECON knowledge domains as PeerTube video categories (IDs 100-117)",
"engine": {
"peertube": ">=6.0.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://forge.echo6.co/matt/recon",
"author": "Echo6",
"license": "MIT",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}