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.
CardsFile
cards.json ReviewCard snapshot (minimal consumer contract).
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.
EvidencePacketArtifacts
Packet artifact paths.
EvidencePacketManifest
Manifest for a scoped evidence packet directory.
EvidencePacketReviewPriorityItem
Advisory first-read item derived from packet artifacts.
ExportArgs
ExportArgsMeta
ExportData
Detailed export data containing individual file statistics.
ExportReceipt
FileRow
A single file row in the export inventory.
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
A report detailing language statistics.
LangRow
A single language row in the lang summary.
ManualCandidateRecord
One manual candidate row from manual-candidates.json.
ManualCandidatesFile
manual-candidates.json index (minimal consumer contract).
ModuleArgs
ModuleArgsMeta
ModuleReceipt
ModuleReport
ModuleRow
A single module row in the module breakdown.
PacketPresetInput
Ready-to-format sections for one audience preset.
PacketRenderBundle
Bundle passed from CLI load through formatting.
PacketSiblingInputs
Parsed sibling inputs available to the packet renderer.
PolicyExcludedFile
A file excluded by per-file cap / classification policy.
ReviewCardRecord
One ReviewCard row from cards.json.
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.
TokmdPacketsManifest
Top-level packet bundle manifest (tokmd-packets.json).
TokmdPacketsProducer
Producer metadata recorded by the exporting tool.
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
EvidencePacketStatus
Evidence packet status.
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§

BUN_UB_PACKET_PRESETS
Bun UB packet presets documented in docs/specs/tokmd-packets-render.md.
CARDS_FILE
Sibling artifact filename for ReviewCard analyzer output.
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).
EVIDENCE_PACKET_SCHEMA
Stable schema identifier for evidence packet manifests.
HANDOFF_SCHEMA_VERSION
Schema version for handoff receipts.
MANUAL_CANDIDATES_FILE
Sibling artifact filename for manual candidate indexes.
MANUAL_CANDIDATES_SCHEMA
Schema id recorded by unsafe-review manual-candidates.json exports.
SCHEMA_VERSION
The current schema version for core receipt types (lang, module, export, diff, run).
TOKMD_PACKETS_SCHEMA
Stable schema identifier for packet bundle manifests.