Skip to main content

Crate aida

Crate aida 

Source
Expand description

§AIDA — AI-Native Requirements Management

Track what you build and why, with structured context for AI coding agents.

§Install the CLI

cargo install aida-cli

§Library Usage

This crate re-exports aida-core. For most users, install the CLI instead.

use aida::models::{Requirement, RequirementsStore};

Modules§

ai
AI Integration Module for AIDA
analytics
Analytics engine — deeper metrics for requirements management.
conflict
Conflict detection and resolution for distributed AIDA.
daemon
Daemon dispenser — Phase 3 sequence number server over Unix socket.
db
Database abstraction layer for AIDA requirements management
dispenser
Sequence Dispenser — generates monotonically increasing sequence numbers for object ID creation.
export
Export/Import functionality for requirements.
git_ops
Git operations for distributed AIDA.
hlc
Hybrid Logical Clock (HLC) implementation for distributed timestamp ordering.
import
Import functionality for legacy/incompatible requirements databases.
integrations
External integrations module.
meta
META Requirements Module
models
node
Node identity and workspace configuration for distributed AIDA.
object_store
Git-friendly object store for distributed AIDA.
oplog
Operation Log — append-only event log for conflict-free distributed sync.
project
registry
report
AI Integration Report Generation
scaffolding
AI Project Scaffolding Module
storage
telemetry
Telemetry — track AIDA usage for measuring tool effectiveness.
templates
Template loading system for scaffolding.
workspace
Multi-repo workspace support for distributed AIDA.

Structs§

AddResult
Result of adding a new requirement atomically
AgreedCounters
Per-type counters for agreed IDs assigned at merge-to-trunk.
AiActionPromptConfig
Configuration for a single AI prompt action (evaluation, duplicates, etc.)
AiClient
AI Client for interacting with Claude
AiIntegrationReport
AI Integration Report data
AiPromptConfig
Complete AI prompt configuration for a project
AiPromptsSection
AI Prompts configuration section
AiTypePromptConfig
Per-type AI prompt customization
BackgroundEvaluator
Background AI Evaluator
Baseline
Represents a baseline - a named snapshot of requirements at a point in time
BaselineComparison
Summary of changes between two baselines or baseline and current state
BaselineRequirementDiff
Represents changes to a single requirement between baselines
Comment
Represents a comment on a requirement with threading support
CommentReaction
Represents a reaction on a comment
ConflictInfo
Information about a conflict detected during save
CustomFieldDefinition
Definition of a custom field for a requirement type
CustomTypeDefinition
Definition of a custom requirement type with its specific statuses and fields
DatabaseConfig
Configuration for database backends
DispenserState
Current state of the dispenser — all counters for a given node.
EditLock
Information about a requirement being edited
EvaluationResponse
Response from evaluation action
EvaluationResult
Result of an evaluation to be applied to the store
EvaluatorConfig
Configuration for the background evaluator
FeatureDefinition
Configuration for a feature with its prefix
FieldChange
Represents a field change in a requirement’s history
FieldConflict
Describes a conflict in a specific field
FileDispenser
File-backed dispenser using a TOML state file with advisory locking. This is the Phase 1 implementation per the distributed architecture spec.
GitBackend
Git-backed storage backend.
GitLabIssueLink
Represents a link between an AIDA requirement and a GitLab issue Used to track traceability between specs and implementation work
GitLabSyncState
Tracks sync state between an AIDA requirement and a GitLab issue
HistoryEntry
Represents a history entry for a requirement update
Hlc
The HLC clock instance. Thread-safe via internal Mutex.
HlcTimestamp
A Hybrid Logical Clock timestamp.
IdConfigValidation
Result of validating ID configuration changes
IdConfiguration
ID system configuration
ImplementationInfo
Tracks implementation metadata for a requirement Stores information about how and when a requirement was implemented
ImportConfig
Configuration for an import operation
ImportIssue
Represents an issue found during import validation
ImportSummary
Summary of an import operation
ImportValidation
Result of validating an import file
IssueReport
Issue found in a requirement
LockFileInfo
Lock file contents tracking all active sessions
MemoryDispenser
A simple in-memory dispenser for testing and single-session use. Not persistent — loses state on drop.
NodeConfig
Information about a registered node (persisted locally, gitignored).
NodeRegistry
The shared node registry (committed to git, append-only).
NodeRegistryEntry
A node registration entry in the shared registry (committed to git).
PromptCustomization
Individual prompt customization
QueueEntry
Represents an entry in a user’s personal work queue
RawImportStore
Raw store structure for initial parsing
ReactionDefinition
Represents a reaction emoji definition
Registry
Registry of all projects
Relationship
Represents a relationship between two requirements
RelationshipDefinition
Defines a relationship type and its constraints
RelationshipValidation
Result of validating a relationship
ReportGenerator
Report generator
Requirement
Represents a single requirement in the system
RequirementSnapshot
A snapshot of a requirement at a specific point in time (for baselines) This is a full copy of the requirement state, not a reference
RequirementTypeDefinition
Configuration for a requirement type with its prefix
RequirementsStore
Collection of all requirements
ScaffoldArtifact
Represents a scaffolding artifact to be generated
ScaffoldConfig
Configuration for what scaffolding artifacts to generate
ScaffoldPreview
Result of scaffolding preview
ScaffoldStatus
Result of comparing scaffold to actual project
Scaffolder
Scaffolding generator
SessionInfo
Information about a user session with an open requirements file
SqliteBackend
SQLite backend implementation
SqliteDispenser
SQLite-backed dispenser using atomic UPSERT for sequence generation. This is the Phase 2 implementation per the distributed architecture spec.
Storage
Handles saving and loading requirements from disk with file locking for rudimentary multi-user support
StoredAiEvaluation
Stored AI evaluation with metadata This struct wraps evaluation results with timestamps to track when evaluations need to be refreshed (when requirement changes).
SuggestedImprovement
Suggested improvement to a requirement
Team
Represents a team in the system Teams can contain users (members) and can be nested (parent/child teams)
TemplateInfo
Information about an embedded template
TemplateLoader
Template loader that checks external files first, then falls back to embedded.
TraceLink
Represents a trace link between a requirement and a code artifact This enables bidirectional traceability: requirement -> code and code -> requirement
TraceabilityStats
Traceability statistics
TypePromptCustomization
Type-specific prompt customization
UrlLink
Represents an external URL link attached to a requirement
User
Represents a user in the system
UserRegistry
The shared user registry (committed to git, append-only).
UserRegistryEntry
A user registration entry in the shared registry.
VersionConflict
Error type for version conflicts during optimistic locking
WorkspaceConfig
Workspace configuration — discovered by walking up the directory tree.
YamlBackend
YAML file backend implementation

Enums§

AiMode
AI operation mode
ArtifactType
Represents the type of artifact being traced
BackendType
Types of database backends available
Cardinality
Cardinality constraints for relationships
ConfidenceLevel
Confidence level for AI-generated implementation
ConflictResolution
Resolution strategy when a conflict is detected
CustomFieldType
Field type for custom fields
DeploymentMode
The deployment mode for an AIDA instance.
EvaluatorStatus
Status of the background evaluator
FileStatus
Status of a scaffolded file compared to disk
GitLabLinkType
Type of link between AIDA requirement and GitLab issue
IdFormat
ID format style for requirement identifiers
IdMode
The operating mode for ID generation.
ImportIssueType
Types of issues that can occur during import
ImportMergeMode
How to merge imported data with existing data
IssueResolution
How to handle a specific issue during import
LinkOrigin
How a GitLab link was originally created
MetaSubtype
Represents the subtype for Meta requirements
MigrationCheck
Result of checking for migration status
NumberingStrategy
Numbering strategy for requirement IDs
ProjectType
Project type for specialized scaffolding
RelationshipType
Represents a relationship type between requirements
ReportFormat
Report output format
RequirementPriority
Represents the priority of a requirement
RequirementStatus
Represents the status of a requirement
RequirementType
Represents the type of a requirement
SaveResult
Result of attempting a save with conflict detection
ScaffoldError
Errors that can occur during scaffolding
StorageError
Error type for storage operations
SyncStatus
Current sync status between AIDA and GitLab
TemplateSource
Source of a template
UpdateResult
Result type for optimistic locking operations
UrlOpenMode
How a URL should be opened when clicked

Constants§

DEFAULT_DUPLICATES_PROMPT
Default template for finding duplicates
DEFAULT_EVALUATION_PROMPT
Default template for requirement evaluation
DEFAULT_GENERATE_CHILDREN_PROMPT
Default template for generating child requirements
DEFAULT_IMPROVE_PROMPT
Default template for improving descriptions
DEFAULT_RELATIONSHIPS_PROMPT
Default template for suggesting relationships
META_PREFIX_FEATURE
META_PREFIX_TEAM
META_PREFIX_USER
Meta-type prefixes for special object types
META_PREFIX_VIEW

Traits§

DatabaseBackend
Core trait for database backends
Dispenser
The Dispenser trait — the stable interface for sequence number generation.

Functions§

check_migration_status
Check if a YAML file has been migrated to SQLite
check_scaffold_status
Check scaffold status for a project (standalone function for CLI)
create_backend
Creates a database backend based on the file extension or explicit type
create_backup
Create a backup of the current requirements file
default_reaction_definitions
Returns the default set of reaction definitions
default_type_definitions
Returns the default type definitions
determine_requirements_path
Determines the requirements file path to use based on the available information. This version does NOT check for migration - use determine_requirements_path_with_migration_check for migration-aware path resolution.
execute_import
Execute an import operation with the given configuration
export_to_json
Exports a RequirementsStore to a JSON file
get_config_dir
Gets the path to the AIDA config directory (~/.config/aida/)
get_embedded_templates
Get all embedded templates with their info
get_prompt_template
Get a prompt template, checking database first, then falling back to embedded
get_registry_path
Gets the path to the registry file
get_template_categories
Get template categories with descriptions
get_templates_by_category
Get templates by category
get_templates_dir
Gets the path to the templates directory (~/.config/aida/templates/)
import_from_json
Imports a RequirementsStore from a JSON file
migrate_sqlite_to_yaml
Migrates data from a SQLite database to a YAML file
migrate_yaml_to_sqlite
Migrates data from a YAML file to a SQLite database
needs_meta_seeding
Check if META requirements need seeding
open_or_create
Opens an existing database or creates a new one
seed_meta_requirements
Seed META requirements in a new database
validate_import_content
Validate import content (YAML string)
validate_import_file
Validate an import file and return validation results