feat(self-modification): backend engine, REST API, and frontend panel#127
Closed
feat(self-modification): backend engine, REST API, and frontend panel#127
Conversation
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add backend self-modification engine and connect to UI
feat(self-modification): backend engine, REST API, and frontend panel
Mar 6, 2026
10 tasks
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The backend self-modification engine referenced by the existing frontend stores was absent. This PR delivers the engine, wires it to four new REST endpoints, and adds a UI panel that drives the full propose → apply → rollback lifecycle.
Backend:
SelfModificationEngineNew
backend/core/self_modification_engine.py— standalone, no heavy dependencies:Supported targets:
knowledge_graph(add/remove nodes + edges),reasoning_params(parameter tuning),goal_priority(goal reweighting). Operates in simulation mode when noCognitiveManageris provided.REST API (
unified_server.py)POST/api/self-modification/proposeproposal_id,predicted_impact,risk_levelPOST/api/self-modification/apply/{proposal_id}success,applied_changesPOST/api/self-modification/rollback/{proposal_id}success,reverted_toGET/api/self-modification/historyhistory[],totalGuarded by
SELF_MODIFICATION_AVAILABLE— returns 503 cleanly if the module fails to import.Frontend
SelfModificationPanel.svelte— 3-tab panel: Pending Proposals (risk badges, apply action), History (full audit table with rollback action), New Proposal (target/type dropdowns with JSON parameter editor and auto-populated templates).App.svelte— panel registered as🔧 Self-Modificationin the System Management nav section (featured: true).evolutionStatestore (pendingProposalsderived store).Tests
tests/backend/test_self_modification_engine.py— 27 tests covering the four required scenarios:test_propose_modification_returns_proposal_idtest_apply_modification_changes_knowledge_graphtest_rollback_reverts_applied_modificationtest_history_records_all_operationsRelated Issues
Test Evidence
Frontend:
npm run build— ✓ built in 6.31s, 0 errors.Checklist
pytest tests/)black .andisort .)Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.