Skip to content

Protocol Management

Last Updated: 2025-01-16
Primary Source: docs/project_status.md
Page: aso-portal/src/pages/ProtocolManagementPage.tsx
Components: aso-portal/src/components/protocols/


Overview

The Protocol Management interface enables administrators to view, create, edit, and manage protocols that define how the ASO interacts with users. It includes protocol cards, forms, versioning UI, and protocol diff viewing.


Architecture

Protocol Management Flow


Core Components

1. Protocol Management Page

File: aso-portal/src/pages/ProtocolManagementPage.tsx

Route: /protocols

Features:

  • Protocol list display
  • Protocol search and filtering
  • Create new protocol button
  • Protocol cards grid
  • Protocol details view

2. Protocol Card

File: aso-portal/src/components/protocols/ProtocolCard.tsx

Features:

  • Protocol display card
  • Protocol title and description
  • Protocol status indicator
  • Protocol actions (view, edit, delete)
  • Protocol version badge
  • Quick actions menu

Display Information:

  • Protocol ID
  • Protocol title
  • Protocol description
  • Protocol status (active, deprecated)
  • Protocol version
  • Last updated date

3. Protocol Form

File: aso-portal/src/components/protocols/ProtocolForm.tsx

Features:

  • Protocol creation form
  • Protocol editing form
  • Protocol fields:
    • ID
    • Title
    • Description
    • Status
    • Phases
    • Vows
    • Rules
  • Form validation
  • Save/Cancel actions

Form Fields:

  • id - Protocol identifier
  • title - Protocol title
  • description - Protocol description
  • status - Protocol status
  • phases - Protocol phases (JSON)
  • vows - Protocol vows (array)
  • rules - Protocol rules (JSON)

Protocol Operations

View Protocol

Process:

  1. Click protocol card
  2. View protocol details
  3. View protocol phases
  4. View protocol vows
  5. View protocol rules

Create Protocol

Process:

  1. Click "Create Protocol"
  2. Fill protocol form
  3. Define phases
  4. Define vows
  5. Define rules
  6. Save protocol

API: POST /api/protocols

Edit Protocol

Process:

  1. Click "Edit" on protocol card
  2. Modify protocol form
  3. Update phases/vows/rules
  4. Save changes

API: PUT /api/protocols/:id

Versioning:

  • Creates new version on edit
  • Maintains version history
  • Immutable version records

Delete Protocol

Process:

  1. Click "Delete" on protocol card
  2. Confirm deletion
  3. Protocol marked as deprecated
  4. Orphaned (if no references)

API: DELETE /api/protocols/:id


Protocol Versioning

Version History

Features:

  • View all protocol versions
  • Compare versions
  • View version diffs
  • Restore previous version

Version Model:

  • protocolId - Protocol ID
  • version - Version number
  • definition - Protocol definition (JSON)
  • createdByUserId - Creator user ID
  • createdAt - Creation timestamp

Version Diff

Features:

  • Side-by-side comparison
  • Highlighted changes
  • Phase changes
  • Vow changes
  • Rule changes

Data Flow


API Endpoints

Protocol Management

  • GET /api/protocols - List protocols
  • GET /api/protocols/:id - Get protocol
  • POST /api/protocols - Create protocol
  • PUT /api/protocols/:id - Update protocol
  • DELETE /api/protocols/:id - Delete protocol

Protocol Versioning

  • GET /api/protocols/:id/versions - Get version history
  • GET /api/protocols/:id/versions/:version - Get specific version
  • GET /api/protocols/:id/diff - Get version diff
  • POST /api/protocols/:id/restore - Restore version

Source Files

Primary Sources:

  • aso-portal/src/pages/ProtocolManagementPage.tsx - Protocol management page
  • aso-portal/src/components/protocols/ProtocolCard.tsx - Protocol card
  • aso-portal/src/components/protocols/ProtocolForm.tsx - Protocol form

Related Files:

  • backend/src/services/protocol.service.ts - Protocol service
  • backend/src/services/protocolMemory.service.ts - Protocol memory
  • backend/src/models/protocolVersion.model.ts - Version model

ASO Universal Consciousness System Documentation