Skip to main content

Crate tokmd_types

Crate tokmd_types 

Source
Expand description

§tokmd-types

Tier 0 (Core Types)

This crate defines the core data structures and contracts for tokmd. It contains only data types, Serde definitions, and schema_version.

§Stability Policy

JSON-first stability: The primary contract is the JSON schema, not Rust struct literals.

  • JSON consumers: Stable. New fields have sensible defaults; removed/renamed fields bump SCHEMA_VERSION.
  • Rust library consumers: Semi-stable. New fields may be added in minor versions, which can break struct literal construction. Use Default + field mutation or ..Default::default() patterns for forward compatibility.

If you need strict Rust API stability, pin to an exact version.

§What belongs here

  • Pure data structs (Receipts, Rows, Reports)
  • Serialization/Deserialization logic
  • Stability markers (SCHEMA_VERSION)

§What does NOT belong here

  • File I/O
  • CLI argument parsing
  • Complex business logic
  • Tokei dependencies

Modules§

cockpit
Cockpit receipt types for PR metrics and evidence gates.

Structs§

ArtifactEntry
Entry describing an artifact in the handoff bundle.
ArtifactHash
Hash for artifact integrity.
CapabilityStatus
Status of a detected capability.
ContextBundleManifest
Manifest for a context bundle directory (bundle.txt + receipt.json + manifest.json).
ContextExcludedPath
Explicitly excluded path with reason for context bundles.
ContextFileRow
ContextLogRecord
Log record for context command JSONL append mode. Contains metadata only (not file contents) for lightweight logging.
ContextReceipt
DiffReceipt
JSON receipt for diff output with envelope metadata.
DiffRow
A row in the diff output showing changes for a single language.
DiffTotals
Aggregate totals for the diff.
ExportArgs
ExportArgsMeta
ExportData
ExportReceipt
FileRow
HandoffComplexity
Simplified complexity report for handoff intelligence.
HandoffDerived
Simplified derived metrics for handoff intelligence.
HandoffExcludedPath
Explicitly excluded path with reason.
HandoffHotspot
Simplified hotspot row for handoff intelligence.
HandoffIntelligence
Intelligence bundle for handoff containing tree, hotspots, complexity, and derived metrics.
HandoffManifest
Manifest for a handoff bundle containing LLM-ready artifacts.
LangArgs
LangArgsMeta
LangReceipt
LangReport
LangRow
ModuleArgs
ModuleArgsMeta
ModuleReceipt
ModuleReport
ModuleRow
PolicyExcludedFile
A file excluded by per-file cap / classification policy.
RunReceipt
ScanArgs
SmartExcludedFile
A file excluded by smart-exclude heuristics (lockfiles, minified, etc.).
TokenAudit
Post-write audit comparing actual output to estimates.
TokenEstimationMeta
Metadata about how token estimates were produced.
ToolInfo
Totals
A small totals struct shared by summary outputs.

Enums§

AnalysisFormat
CapabilityState
State of a capability: available, skipped, or unavailable.
ChildIncludeMode
ChildrenMode
CommitIntentKind
Classification of a commit’s intent, derived from subject line.
ConfigMode
ExportFormat
FileClassification
Classification of a file for bundle hygiene purposes.
FileKind
InclusionPolicy
How a file is included in the context/handoff bundle.
RedactMode
ScanStatus
TableFormat

Constants§

CONTEXT_BUNDLE_SCHEMA_VERSION
Schema version for context bundle manifests.
CONTEXT_SCHEMA_VERSION
Schema version for context receipts (separate from SCHEMA_VERSION used by lang/module/export/diff).
HANDOFF_SCHEMA_VERSION
Schema version for handoff receipts.
SCHEMA_VERSION
The current schema version for all receipt types.