digital.vasic.models is a generic, reusable Go module providing core data types and structures for AI/LLM applications, agent systems, and related services.
- LLM Types:
LLMRequest,LLMResponse,ProviderCapabilities,ModelLimits - User & Session:
User,UserSession,CogneeMemory - Task Management:
TaskStatus(withIsTerminal()andIsActive()methods),TaskPriority - Protocol Servers:
MCPServer,LSPServer,ACPServer - LSP/Code Intelligence:
CodeIntelligence,Diagnostic,CompletionItem,HoverInfo,Location,Range,Position,SymbolInfo,SemanticTokens,WorkspaceEdit,TextEdit - Zero Dependencies: Pure Go standard library, no external runtime dependencies
- Dual Serialization: All types include both
jsonanddbtags for API and database mapping - Thread-Safe: Value objects with no shared mutable state
go get digital.vasic/modelsimport "digital.vasic.models"
// Create an LLM request
req := &models.LLMRequest{
ID: "req_123",
SessionID: "sess_456",
Prompt: "Hello, world!",
ModelParams: models.ModelParameters{
Model: "gpt-4",
Temperature: 0.7,
MaxTokens: 1000,
},
Status: "pending",
}
// Use task status helpers
status := models.TaskStatusRunning
if status.IsActive() {
fmt.Println("Task is active")
}
// Create a background task status
taskStatus := models.TaskStatusPending
if !taskStatus.IsTerminal() {
fmt.Println("Task can still be processed")
}LLMRequest: Complete LLM request with prompt/messages, model parameters, ensemble config, memory, toolsLLMResponse: LLM response with content, confidence, tokens used, metadata, tool callsProviderCapabilities: LLM provider capabilities (supported models, features, streaming, function calling, vision)ModelLimits: Operational limits (max tokens, input/output length, concurrent requests)
User: User account with API key, role, timestampsUserSession: Active user session with token, context, memory IDCogneeMemory: Memory storage for Cognee integration
TaskStatus: Lifecycle state (pending,queued,running,completed,failed,stuck,cancelled,dead_letter) with helper methodsTaskPriority: Execution priority (critical,high,normal,low)
MCPServer: Model Context Protocol server configurationLSPServer: Language Server Protocol server configurationACPServer: Agent Communication Protocol server configuration
CodeIntelligence: Comprehensive code intelligence containerDiagnostic: Diagnostic message with range, severity, code, source, messageCompletionItem: Code completion item with label, kind, detail, documentationHoverInfo: Hover information with content and languageLocation: File location with URI and rangeRange: Text range with start/end positionsPosition: Line and character positionSymbolInfo: Symbol information with name, kind, location, containerSemanticTokens: Semantic token data arrayWorkspaceEdit: Workspace edit with file changesTextEdit: Text edit with range and new text
All structs include db tags for PostgreSQL mapping using pgx driver:
type User struct {
ID string `json:"id" db:"id"`
Username string `json:"username" db:"username"`
Email string `json:"email" db:"email"`
PasswordHash string `json:"-" db:"password_hash"`
APIKey string `json:"api_key" db:"api_key"`
// ...
}All structs include json tags for API serialization:
type LLMResponse struct {
ID string `json:"id" db:"id"`
RequestID string `json:"request_id" db:"request_id"`
ProviderID string `json:"provider_id" db:"provider_id"`
Content string `json:"content" db:"content"`
Confidence float64 `json:"confidence" db:"confidence"`
// ...
}# Build
go build ./...
# Run all tests
go test ./...
# Run tests with race detection
go test ./... -race
# Format code
gofmt -w .
# Vet code
go vet ./...- Add the type definition to
types.go(for core types) orprotocol_types.go(for protocol types) - Include appropriate
jsonanddbtags - Add test cases in
types_test.goor separate test file - Update documentation in
README.mdandCLAUDE.md
This module ships an anti-bluff posture per Article XI §11.9 and CONST-035 / CONST-050(B). Every test and every Challenge under this repository MUST carry positive runtime evidence; metadata-only, grep-only, or absence-of-error PASS counts are categorically forbidden.
Verbatim 2026-05-19 operator mandate: "all existing tests and Challenges do work in anti-bluff manner - they MUST confirm that all tested codebase really works as expected! We had been in position that all tests do execute with success and all Challenges as well, but in reality the most of the features does not work and can't be used! This MUST NOT be the case and execution of tests and Challenges MUST guarantee the quality, the completition and full usability by end users of the product!"
docs/test-coverage.md— symbol → exerciser ledger covering every exported symbol ofdigital.vasic.models(types.go,protocol_types.go,background_task.go).challenges/runner/main.go— 8-section runtime exerciser that drives the public surface end-to-end across 5 locales: en (Latin), sr (Cyrillic), ja (Japanese), ar (Arabic, RTL), zh-CN (Han). The fixture lives attests/fixtures/models/payloads.json— no prompt, task name, username, tool description, diagnostic message, completion label, or MCP command is hardcoded in the runner source.challenges/scripts/models_describe_challenge.sh— paired-mutation wrapper. Clean-mode exit 0 proves runner + ledger + fixture + README all converge;--anti-bluff-mutateexit 99 proves the wrapper actually catches ledger-vs-source drift when a known mutation (renameTaskStatus->TaskStatus_MUTATEDin a tmp ledger copy) is planted.
TaskStatus.IsTerminal/IsActivetruth-table walk +TaskPriority.Weightinversion + 14 string-constant audits.NewBackgroundTaskdefaults + 7 transition helpers (CanRetry,CanPause,CanCancel,CanResume,Duration,IsOverdue,HasStaleHeartbeat) per locale.LLMRequest/LLMResponse/Message/Tool/ToolCall/User/UserSession/CogneeMemoryJSON round-trip per locale;User.PasswordHashjson:"-" leak guard.MCPServer/LSPServer/ACPServerper-locale round-tripProtocolType*+ServerType*constant audits.
ProtocolMetrics× 3 status variants (success / error / timeout) per locale +MetricsStatus*constant audits.CodeIntelligence+Diagnostic+CompletionItem+HoverInfo+Range+Position+SymbolInfo+SemanticTokens+WorkspaceEdit+TextEditper locale.TaskExecutionHistory/DeadLetterTask/WebhookDelivery/TaskLogEntry/TaskProgressUpdate/TaskErrorlifecycle payloads per locale +TaskEvent*constant audit (9 entries).ProviderCapabilities+ModelLimits+LLMProvider(withAPIKeyjson:"-" leak guard +Models.devpointer fields) +EnsembleConfig+VectorDocument(withEmbedding []float32json:"-" leak guard) per locale.
# Unit suite (with race detector)
GOMAXPROCS=2 nice -n 19 go test -count=1 -race ./...
# Challenge runner (real Models surface, 5 locales)
go run ./challenges/runner/ -fixtures tests/fixtures/models/payloads.json
# Paired-mutation gate (clean mode)
bash challenges/scripts/models_describe_challenge.sh
# Paired-mutation gate (mutate mode — MUST exit 99)
bash challenges/scripts/models_describe_challenge.sh --anti-bluff-mutateThis module is part of the HelixAgent / HelixCode project family. See root project for license details.
See AGENTS.md for agent coordination guidelines and CLAUDE.md
for AI assistant instructions.