serban·BOB·HAI·PSR·ToT

Technical System

Schema, API, and Integration

HAI's technical system turns the methodology into trackable, queryable data. This section describes the database schema, API endpoints, dashboard integration, and AI coding agent integration used in production at serban.eu.com. Adapt the schema and tooling to your own stack.

Database Schema: Work Items
The work_items table stores every HAI assessment. All assessment dimensions are ENUM columns for consistent querying.
ColumnTypeDescription
idUUIDPrimary key
titleVARCHARWork item title
descriptionTEXTFull description
work_modeENUMai | human_ai | human
involvementENUMlight | engaged | intensive
sizeENUMs | m | l | xl
riskENUMlow | medium | high
confidenceENUMlow | medium | high
spec_qualityENUMlow | medium | high
phaseENUMrequest | research | specification | implementation | review | complete
client_idUUID FKMulti-tenant scoping
created_atTIMESTAMPCreation time
updated_atTIMESTAMPLast update
completed_atTIMESTAMPCompletion time (nullable)

Additional tables track assessment history (snapshots at each phase transition), comments (retrospective notes, decision logs), and resource estimates (tokens, sessions, energy). The schema is multi-tenant — every query is scoped by client_id.

API Endpoints
RESTful API for creating, updating, and querying work items. All endpoints require authentication and are tenant-scoped.
GET

/api/v1/work-items

List all work items with filtering by phase, work_mode, size

POST

/api/v1/work-items

Create a new work item with initial HAI assessment

GET

/api/v1/work-items/{id}

Get a single work item with full assessment history

PATCH

/api/v1/work-items/{id}

Update assessment fields (reassessment)

POST

/api/v1/work-items/{id}/transition

Transition to next phase with assessment snapshot

POST

/api/v1/work-items/{id}/comments

Add retrospective notes, decision logs, or context

Dashboard Integration
The admin dashboard provides a visual Development Tracker for managing HAI work items through their lifecycle.

Work Item List

Filterable table showing all work items with phase, work mode, size, and spec quality badges. Full-row click opens detail view.

Phase Transitions

One-click phase advancement with automatic assessment snapshot. Each transition records the state at that point.

Assessment Editor

Inline editing of all HAI dimensions. Changes are logged with timestamps for audit trail.

Distribution Charts

Visual breakdown of work by mode, involvement, size, and spec quality. Shows patterns over time.

AI Coding Agent Integration
How HAI integrates with AI coding agents like Claude Code for automatic assessment tracking during development.
Session Start

Agent reads the current task list and checks for existing work items. If no work item exists, creates an initial HAI assessment (work mode, involvement, size, spec quality, risk, confidence).

During Work

Agent monitors for reassessment triggers: research completion, scope changes, issues discovered. Updates the assessment when triggers fire, not constantly.

Completion

Agent creates a retrospective entry: was the spec quality accurate? Did the work mode match reality? What would improve future assessments?

Parallel Sessions

Coordinator session owns the HAI assessment. Worker sessions execute tracks but do not update shared tracking docs. Admin Development Tracker API is the source of truth.

Adapting for Your Stack

The technical system described here is the Extended HAI implementation used at serban.eu.com. You don't need this specific stack to use HAI. The core methodology works with any tracking system.

Minimum viable

A spreadsheet with columns for work mode, involvement, size, spec quality, risk, confidence. That’s it.

PM tool integration

Custom fields in Jira, Linear, Notion, or GitHub Projects. See the Integration guide.

Full implementation

Dedicated database table, API endpoints, dashboard UI. What’s described on this page.

Example: Creating a Work Item
POST /api/v1/work-items
Content-Type: application/json
Authorization: Bearer <token>

{
  "title": "Add Spanish language support",
  "description": "Enable Spanish voice and text across all channels",
  "work_mode": "human_ai",
  "involvement": "engaged",
  "size": "m",
  "spec_quality": "medium",
  "risk": "medium",
  "confidence": "medium",
  "phase": "research"
}

Response includes the created work item with id, created_at, and initial assessment snapshot. Use PATCH to update the assessment as the work progresses through phases.