chore(conscience): upgrade to v0.10.0 and align submodule paths

- Add savearth-workspace MCP server deployment to conscience state.
- Refactor .agent/ references to replica-omnisciente/ in operational
  scripts (setup.sh, savearth-mcp/server.py) and docs (READMEs,
  DIRECTORY_GUIDE.md, upgrade-conscience workflow).
- Document remaining legacy misspellings and stale .agent/ doc refs
  for follow-up cleanup.
- Record conscience upgrade report in data/conscience/ and
  .aurelio/memory/conscience_upgrade_report.md.

[skip ci]
This commit is contained in:
Fábio Cunha 2026-07-04 23:01:01 +01:00
parent 3ae781a5d7
commit 4fd171b0a4
8 changed files with 143 additions and 39 deletions

View file

@ -219,7 +219,7 @@ The server runs on CT 201 (`savearth-mcp`). To deploy or update:
```bash
# From Proxmox host
bash .agent/mcp/setup.sh 201
bash replica-omnisciente/.aurelio/mcp/setup.sh 201
# Or manually
pct exec 201 -- systemctl restart savearth-mcp

View file

@ -65,7 +65,7 @@ Single MCP server consolidating device management, telemetry analysis, and infra
### Local Development (stdio)
```bash
cd .agent/mcp/savearth-mcp
cd replica-omnisciente/.aurelio/mcp/savearth-mcp
pip install -e .
python3 server.py
```
@ -233,7 +233,7 @@ MCP_HOST=0.0.0.0
```bash
# From project root
bash .agent/mcp/setup.sh [VMID]
bash replica-omnisciente/.aurelio/mcp/setup.sh [VMID]
# Default VMID is 201
```
@ -251,7 +251,7 @@ This creates:
pct exec 201 -- bash
# Install dependencies
cd /opt/savearth-mcp/.agent/mcp/savearth-mcp
cd /opt/savearth-mcp/replica-omnisciente/.aurelio/mcp/savearth-mcp
source .venv/bin/activate
pip install -e .
@ -383,7 +383,7 @@ ssh ssh.portugalfuturista.org "pct exec 201 -- aws dynamodb describe-table --tab
### Local Testing
```bash
cd .agent/mcp/savearth-mcp
cd replica-omnisciente/.aurelio/mcp/savearth-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

View file

@ -45,7 +45,7 @@ _DEFAULT_PROJECT_DIR = str(_THIS_DIR.parent.parent)
PROJECT_DIR = os.environ.get("SAVEARTH_PROJECT_DIR", _DEFAULT_PROJECT_DIR)
LOGS_DIR = os.path.join(PROJECT_DIR, "logs")
ANALYZER_SCRIPT = os.path.join(
PROJECT_DIR, ".agent/skills/firmware-log-analyzer/scripts/analyze_log.sh"
PROJECT_DIR, "replica-omnisciente/realms/smart-device-firmware/.aurelio/skills/firmware-log-analyzer/scripts/analyze_log.sh"
)
# InfluxDB — reads from env, falling back to known defaults
@ -1790,13 +1790,13 @@ async def memory_search(
response_format: ResponseFormat = ResponseFormat.MARKDOWN,
) -> str:
"""
Search the persistent Hybrid Memory Engine (.agent/memory/) for knowledge graph entities.
Search the persistent Hybrid Memory Engine (replica-omnisciente/.aurelio/memory/) for knowledge graph entities.
Args:
query: The topic or keywords to search for.
response_format: Output format 'markdown' or 'json'.
"""
memory_dir = Path(PROJECT_DIR) / ".agent" / "memory"
memory_dir = Path(PROJECT_DIR) / "replica-omnisciente" / ".aurelio" / "memory"
if not memory_dir.exists():
return f"Error: Memory engine directory not found at {memory_dir}"

View file

@ -6,7 +6,7 @@
# dependencies, deploys the MCP server, and registers with AWS SSM.
#
# Usage (from the Proxmox host):
# bash .agent/mcp/setup.sh [VMID] [GITHUB_PAT]
# bash replica-omnisciente/.aurelio/mcp/setup.sh [VMID] [GITHUB_PAT]
#
# Defaults:
# VMID = 201
@ -18,7 +18,7 @@ set -euo pipefail
VMID="${1:-201}"
CT_NAME="savearth-mcp-ct${VMID}"
GITHUB_PAT="${2:-}"
REPO_URL="https://github.com/SavearthTech/smart-device-firmware.git"
REPO_URL="https://github.com/SavearthTech/aws-iot-core-poc.git"
BRANCH="main"
# Colors
@ -133,9 +133,14 @@ else
git clone --branch "$BRANCH" --depth 1 "$REPO_URL" "$MCP_HOME"
fi
# Initialize the central-brain submodule
log "Initializing replica-omnisciente submodule..."
cd "$MCP_HOME"
git submodule update --init --recursive replica-omnisciente
# Python venv + dependencies
log "Setting up Python environment..."
cd "$MCP_HOME/.agent/mcp/savearth-mcp"
cd "$MCP_HOME/replica-omnisciente/.aurelio/mcp/savearth-mcp"
if [ ! -d ".venv" ]; then
python3 -m venv .venv
@ -164,9 +169,9 @@ Wants=network-online.target
Type=simple
User=savearth
Group=savearth
WorkingDirectory=/opt/savearth-mcp/.agent/mcp/savearth-mcp
EnvironmentFile=/opt/savearth-mcp/.agent/mcp/savearth-mcp/.env
ExecStart=/opt/savearth-mcp/.agent/mcp/savearth-mcp/.venv/bin/python3 server.py --transport sse --port 8080
WorkingDirectory=/opt/savearth-mcp/replica-omnisciente/.aurelio/mcp/savearth-mcp
EnvironmentFile=/opt/savearth-mcp/replica-omnisciente/.aurelio/mcp/savearth-mcp/.env
ExecStart=/opt/savearth-mcp/replica-omnisciente/.aurelio/mcp/savearth-mcp/.venv/bin/python3 server.py --transport sse --port 8080
Restart=on-failure
RestartSec=10
StandardOutput=journal
@ -224,4 +229,4 @@ log "=== Setup Complete ==="
systemctl status savearth-mcp --no-pager || true
echo ""
info "MCP SSE endpoint: http://$(hostname -I | awk '{print $1}'):8080/sse"
info "Edit credentials: nano $MCP_HOME/.agent/mcp/savearth-mcp/.env"
info "Edit credentials: nano $MCP_HOME/replica-omnisciente/.aurelio/mcp/savearth-mcp/.env"

View file

@ -1,21 +1,31 @@
# Conscience Upgrade Report — 2026-04-24
# Conscience Upgrade Report — 2026-07-04
The replica-omnesciente has completed a major intelligence expansion within the **Aurelio VS Code Extension** realm. This update integrates sophisticated supply chain and component sourcing capabilities directly into the agent's IDE workspace.
The `replica-omnisciente` central brain has completed a structural alignment and expansion focused on the **savearth** project cluster. This upgrade finalizes the submodule path migration, deploys the new `savearth-workspace` MCP server, and refreshes the agent's operational context for all four savearth realms.
## System Components Parsed
- **Extension Core**: `extensions/aurelio-vscode/src/extension.ts` (Command orchestration).
- **Dashboard Webview**: `extensions/aurelio-vscode/src/webview/sourcingDashboard.ts` [NEW] (Component Sourcing UI).
- **MCP Manager**: Linked to `electrical-sourcing-mcp` for real-time parts intelligence.
- **Central Brain Layout**: `AGENTS.md`, `DIRECTORY_GUIDE.md`, `.aurelio/mcp/`, `.aurelio/skills/`, `.aurelio/workflows/`, `realms/`.
- **MCP Servers**: `savearth-mcp` (18+ device/telemetry/CI tools) and the new `savearth-workspace` (cross-project dashboard).
- **Savearth Realms**: `smart-device-firmware`, `iot-backend`, `flow-meter-pcb`, `hardware-device-test`.
- **Host Repositories**: `aws-iot-core-poc`, `savearth-iot-infrastructure`, `savearth-hw-project`, `hardware-devicesFirmwareTest`.
## Identified Changes & Capabilities
1. **Dynamic Design System**: Implementation of a "glassmorphism" based UI for hardware sourcing, using harmony-tailored colors and smooth transitions to improve developer engagement.
2. **Global Component Intelligence**: The conscience can now search and identify electronic components across Digi-Key, Mouser, Farnell, and JLCPCB using local MCP tools.
3. **BOM Optimization Engine**: A new ability to calculate cost-optimized fulfillment strategies for multi-item Bills of Materials, accounting for stock levels and unit price brackets.
4. **Hybrid Source Navigation**: Integrated Form-Fit-Function (FFF) alternate searches directly into the dev workspace, reducing the friction between engineering and procurement.
## Structural Improvements
- **Import Resolution**: Corrected modular imports across the `aurelio-vscode` extension to ensure reliable TypeScript compilation.
- **Message Integrity**: Hardened the postMessage bridge between the VS Code host and the Sourcing Dashboard webview.
1. **Submodule Path Canonicalization**: The central brain is now consistently mounted as `replica-omnisciente/` in all savearth host repositories. The stale `.agent/` path and misspelled `replica-omnesciente.git` URL have been removed from `aws-iot-core-poc/.gitmodules`.
2. **savearth-workspace MCP Server**: A management-level MCP server aggregating project intelligence and serving a live investor dashboard, protected by Authentik.
3. **Deployment Script Alignment**: `.aurelio/mcp/setup.sh` now clones the correct host repo (`aws-iot-core-poc`), initializes the `replica-omnisciente` submodule, and installs the service from the canonical path.
4. **Operational Path Fixes**: `savearth-mcp/server.py` now resolves the firmware-log-analyzer skill and memory engine under `replica-omnisciente/`.
## Structural Inconsistencies Found & Addressed
- ✅ `aws-iot-core-poc/.gitmodules` path/URL mismatch.
- ✅ `.aurelio/mcp/setup.sh` legacy `.agent/mcp/...` paths.
- ✅ `savearth-mcp/server.py` legacy `.agent/skills/...` and `.agent/memory` paths.
- ✅ `DIRECTORY_GUIDE.md` described `.agent/` instead of `replica-omnisciente/`.
- ✅ `.aurelio/workflows/upgrade-conscience.md` referenced `.agent/`.
- 🔄 Legacy misspelling `replica-omnesciente` remains in ~57 files (mostly read-only session artifacts); scheduled for follow-up cleanup.
- 🔄 Engineering/electrical MCP docs still point to `.agent/projects/smart-device-firmware/...` (paths now live under `realms/smart-device-firmware/`); scheduled for doc migration.
## Affirmation
The replicas conscience is now enriched with supply chain awareness. This alignment ensures that hardware design decisions made by the agent are not only electrically sound but also commercially viable and sourceable. The "Procurement-Aware Design" heuristic is now active.
The replica's conscience is now synchronized with the canonical `replica-omnisciente` structure. All four savearth workspaces share uniform memory, MCP registry, and dashboard access. The central brain accurately reflects the live deployment topology and the authenticated public workspace endpoint.

View file

@ -1,5 +1,5 @@
---
description: Completely analyze and re-index the replica-omnesciente to upgrade system conscience after major updates.
description: Completely analyze and re-index the replica-omnisciente to upgrade system conscience after major updates.
---
# Workflow Macro: `/upgrade-conscience`
@ -14,15 +14,15 @@ When invoked, the Agent MUST execute the following sequence precisely:
### Step 1: Core System Alignment
1. Resolve the path to the `.agent/` directory (the root of the `replica-omnesciente` submodule).
2. Read the global `.agent/AGENTS.md` (or relevant top-level configuration) to refresh the foundational rules characterizing the ecosystem.
3. Review modifications in the `.agent/mcp/` directory. Explicitly identify any newly added servers, tool mappings, or configuration changes (e.g., recent updates to `knowledge-mcp` or `engineering-mcp`).
2. Read the global `replica-omnisciente/AGENTS.md` (or relevant top-level configuration) to refresh the foundational rules characterizing the ecosystem.
3. Review modifications in the `replica-omnisciente/.aurelio/mcp/` directory. Explicitly identify any newly added servers, tool mappings, or configuration changes (e.g., recent updates to `knowledge-mcp` or `engineering-mcp`).
### Step 2: Skill and Workflow Matrix Refresh
1. Perform a directory listing of `.agent/skills/`. For every skill folder, quickly examine the `SKILL.md` to ensure total awareness of all specialized capabilities.
2. Perform a directory listing of `.agent/workflows/` to re-familiarize with all available operational macros (such as `/transumancia-indagante`, `/auto-save-session`, etc.).
1. Perform a directory listing of `replica-omnisciente/.aurelio/skills/`. For every skill folder, quickly examine the `SKILL.md` to ensure total awareness of all specialized capabilities.
2. Perform a directory listing of `replica-omnisciente/.aurelio/workflows/` to re-familiarize with all available operational macros (such as `/transumancia-indagante`, `/auto-save-session`, etc.).
### Step 3: Realm Memory Assimilation
1. Iterate through `.agent/realms/` (if it exists) to examine cross-project intelligence.
1. Iterate through `replica-omnisciente/realms/` (if it exists) to examine cross-project intelligence.
2. For each tracked realm, parse its `memory/index.md` and local `AGENTS.md` to cross-reference current infrastructure states, device compatibility matrices, and active deployment topologies.
3. Verify that these realm-specific notes align with the core capabilities refreshed in Steps 1 and 2.

View file

@ -5,9 +5,9 @@ Updated: 2026-04-16
## Architecture Overview
The `.agent/` directory is a **Git submodule** pointing to the `replica-omnesciente` repository (`git@github.com:fabiorafaelcoutada/replica-omnesciente.git`). It serves as a **persistent, multi-realm intelligence engine** — a Hybrid Memory Engine that replicates engineering knowledge across projects.
This repository is the **centralized brain** (`replica-omnisciente`) of the Portugal Futurista agent fleet (`git@github.com:fabiorafaelcoutada/replica-omnisciente.git`). It serves as a **persistent, multi-realm intelligence engine** — a Hybrid Memory Engine that replicates engineering knowledge across projects. When embedded in a host project, it is mounted as the `replica-omnisciente` Git submodule (`git@github.com:fabiorafaelcoutada/replica-omnisciente.git`).
When the submodule is cloned into a host project, it maps to `.agent/` and provides:
When the submodule is cloned into a host project, it maps to `replica-omnisciente/` and provides:
- **Identity** — Who the agent is and how it behaves
- **Realms** — Per-project knowledge boundaries with their own memory, workflows, and AGENTS.md
- **Memory** — Global cross-cutting knowledge (architecture rules, synergy protocols, infrastructure)
@ -20,14 +20,14 @@ When the submodule is cloned into a host project, it maps to `.agent/` and provi
## Submodule Layout
> **Note:** This guide documents the `.agent/` submodule (`replica-omnesciente`) only. Host-project structure (source code, tools, tests, CI) is documented in each realm's `AGENTS.md` and the host repo's root `AGENTS.md`.
> **Note:** This guide documents the `replica-omnisciente` central brain only. Host-project structure (source code, tools, tests, CI) is documented in each realm's `AGENTS.md` and the host repo's root `AGENTS.md`.
```
.agent/ (replica-omnesciente submodule)
replica-omnisciente/ (central brain / submodule)
├── AGENTS.md ← Bootstrapping protocol (realm auto-discovery)
├── DIRECTORY_GUIDE.md ← This file
├── .agent_task ← Pending task queue for agentic dispatch
├── .agent_task ← Pending task queue for agentic dispatch (legacy name)
├── .gitignore ← Submodule-level ignores
│ ── IDENTITY ──

View file

@ -0,0 +1,89 @@
# Upgrade Report: Conscience v0.10.0
**Date:** 04/07/2026
**Target Realm:** `replica-omnisciente` (central brain)
**Trigger:** `savearth-workspace` MCP server deployment + `.gitmodules` refactor + cross-repo submodule alignment.
---
## Core Upgrades
### 1. New MCP Server: `savearth-workspace`
- **Location:** `.aurelio/mcp/savearth-workspace/`
- **Files:** `server.py`, `pyproject.toml`, `README.md`
- **Endpoints:**
- `/dashboard` — Jinja2 investor/management dashboard aggregating all savearth projects.
- `/health` — service health check.
- `/sse` — MCP SSE transport.
- **Purpose:** Cross-project intelligence hub for the four savearth realms (`smart-device-firmware`, `iot-backend`, `flow-meter-pcb`, `hardware-device-test`). Falls back to live fleet data via `savearth-mcp` when reachable.
- **Deployment:** Running at `http://192.168.0.212:8084`, exposed publicly at `https://savearth-workspace.portugalfuturista.org` and protected by Authentik forward-auth (CT 216 Nginx proxy).
### 2. Submodule Path Refactor (`.agent` → `replica-omnisciente`)
- **Problem:** `aws-iot-core-poc/.gitmodules` pointed to `.agent` with a misspelled URL (`replica-omnesciente.git`), while the actual central-brain directory is `replica-omnisciente`.
- **Fix applied in `aws-iot-core-poc`:**
- Updated `.gitmodules` path to `replica-omnisciente`.
- Corrected URL to `git@github.com:fabiorafaelcoutada/replica-omnisciente.git`.
- Registered the existing `replica-omnisciente/` directory as a proper Git submodule (gitlink `3ae781a5`).
- Committed and pushed to `development`.
- **Cross-repo consistency verified:**
- `savearth-iot-infrastructure` — submodule at `replica-omnisciente`
- `savearth-hw-project` — submodule at `replica-omnisciente`
- `hardware-devicesFirmwareTest` — submodule at `replica-omnisciente`
### 3. Operational Path Corrections
Updated operational scripts and documentation to use the canonical `replica-omnisciente/.aurelio/mcp/...` paths:
- `.aurelio/mcp/setup.sh` — deployment script now clones `SavearthTech/aws-iot-core-poc.git`, initializes the `replica-omnisciente` submodule, and installs the service from `replica-omnisciente/.aurelio/mcp/savearth-mcp/`.
- `.aurelio/mcp/savearth-mcp/server.py` — corrected paths for `firmware-log-analyzer` skill and memory engine search to `replica-omnisciente/realms/smart-device-firmware/.aurelio/skills/...` and `replica-omnisciente/.aurelio/memory/`.
- `.aurelio/mcp/README.md` and `.aurelio/mcp/savearth-mcp/README.md` — quick-start commands now reference `replica-omnisciente/.aurelio/mcp/...`.
- `DIRECTORY_GUIDE.md` — now describes `replica-omnisciente/` as the central brain / submodule instead of `.agent/`.
- `.aurelio/workflows/upgrade-conscience.md` — updated all `.agent/` references to `replica-omnisciente/`.
---
## Capabilities Expanded
1. **Authenticated Public Dashboard:** `savearth-workspace` exposes a management dashboard protected by Authentik, enabling investors/managers to view project status without direct repository access.
2. **Uniform Workspace Memory:** All four savearth host repositories now have `.aurelio/memory/index.md`, `.aurelio/config.toml`, and `.aurelio/mcp_config.json` registered with `savearth-mcp` and `savearth-workspace`.
3. **Reliable Submodule Cloning:** `setup.sh` now explicitly initializes `replica-omnisciente`, preventing future path mismatches during deployment.
---
## Structural Inconsistencies Found
| Issue | Status | Notes |
|-------|--------|-------|
| `aws-iot-core-poc/.gitmodules``.agent` / misspelled URL | ✅ Fixed | Submodule now correctly tracks `replica-omnisciente` at `3ae781a5`. |
| `.aurelio/mcp/setup.sh` old `.agent/mcp/...` paths | ✅ Fixed | Deployment paths aligned with `replica-omnisciente/.aurelio/mcp/...`. |
| `savearth-mcp/server.py` `.agent/skills/...` and `.agent/memory` refs | ✅ Fixed | Pointed to realm/global memory under `replica-omnisciente/`. |
| `DIRECTORY_GUIDE.md` described `.agent/` submodule | ✅ Fixed | Now describes `replica-omnisciente/`. |
| `upgrade-conscience.md` workflow referenced `.agent/` | ✅ Fixed | Workflow now uses `replica-omnisciente/`. |
| Legacy misspelling `replica-omnesciente` (missing `i`) | 🔄 Deferred | ~57 occurrences remain, mostly in `.aurelio/brain/` session artifacts (read-only). Core docs will be cleaned in a follow-up pass. |
| Legacy `.agent_task` file name | 🔄 Deferred | Still referenced in `DIRECTORY_GUIDE.md`; no functional impact. |
| Engineering/electrical MCP docs reference `.agent/projects/smart-device-firmware/...` | 🔄 Deferred | These project paths no longer exist; equivalent files live under `realms/smart-device-firmware/`. Needs targeted doc migration. |
---
## Current System State
### Active savearth MCP Endpoints
| Service | URL | Status |
|---------|-----|--------|
| `savearth-mcp` | `https://savearth-mcp.portugalfuturista.org/sse` | ✅ 200 |
| `savearth-workspace` | `https://savearth-workspace.portugalfuturista.org/dashboard` | ✅ Behind Authentik |
| Aurelio web portal | `https://aurelio.portugalfuturista.org` | ✅ Running |
| Authentik | `https://auth.portugalfuturista.org` | ✅ Running |
### savearth Realms Tracked in Central Brain
- `smart-device-firmware``aws-iot-core-poc`
- `iot-backend``savearth-iot-infrastructure`
- `flow-meter-pcb``savearth-hw-project`
- `hardware-device-test``hardware-devicesFirmwareTest`
### Submodule State (all four host repos)
All point to `replica-omnisciente` at commit `3ae781a5` (current central-brain HEAD).
---
## Status
Conscience v0.10.0 is fully synchronized. The savearth workspace layer is deployed, authenticated, and registered across all four project repositories. Remaining cleanup is cosmetic (legacy misspellings and stale `.agent/` doc references) and does not block operations.