Skip to main content

agentic_codebase/types/
mod.rs

1//! Core data types for the AgenticCodebase semantic code compiler.
2//!
3//! This module contains all type definitions used throughout the system.
4//! No logic or I/O — pure struct definitions, enum definitions, and trait
5//! implementations.
6
7pub mod code_unit;
8pub mod edge;
9pub mod error;
10pub mod header;
11pub mod language;
12pub mod span;
13
14pub use code_unit::{CodeUnit, CodeUnitBuilder, CodeUnitType, Visibility};
15pub use edge::{Edge, EdgeType};
16pub use error::{AcbError, AcbResult};
17pub use header::FileHeader;
18pub use language::Language;
19pub use span::Span;
20
21/// Magic bytes at the start of every .acb file: "ACDB"
22pub const ACB_MAGIC: [u8; 4] = [0x41, 0x43, 0x44, 0x42];
23
24/// Current format version.
25pub const FORMAT_VERSION: u32 = 1;
26
27/// Default feature vector dimensionality.
28pub const DEFAULT_DIMENSION: usize = 256;
29
30/// Maximum symbol name length.
31pub const MAX_SYMBOL_NAME: usize = 1024;
32
33/// Maximum qualified name length.
34pub const MAX_QUALIFIED_NAME: usize = 4096;
35
36/// Maximum file path length.
37pub const MAX_PATH_LENGTH: usize = 4096;
38
39/// Maximum edges per code unit.
40pub const MAX_EDGES_PER_UNIT: u32 = 16384;
41
42/// Maximum signature length.
43pub const MAX_SIGNATURE_LENGTH: usize = 2048;
44
45/// Maximum doc summary length.
46pub const MAX_DOC_LENGTH: usize = 512;
47
48/// Returns the current time as Unix epoch microseconds.
49pub fn now_micros() -> u64 {
50    chrono::Utc::now().timestamp_micros() as u64
51}