Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

symbolKey stable identity field

Platform spec ADR

symbolKey stable identity field

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Schema v4 already carries qualifiedName, refItemId, and compiler-derived signatures. Cross-package workspace doc runs and registry consumers still need a stable, package-qualified string that does not depend on recomputing module paths or splitting display names—especially when the same logical symbol can appear under different dense ItemId values during per-unit resolve.

Add optional field symbolKey on each ApiDocItem (JSON camelCase) for schema v4 emitters:

RuleRequirement
PresenceEmit only when qualified_name(resolution, item.id) succeeds (registry-backed exportable symbol)
OmissionNon-exportable rows (parameter, synthetic rows, unresolved collect) must omit the field
ValueSame encoding as SymbolRegistry / symbol_to_string (package prefix + :: segments)
qualifiedNameUnchanged; legacy recompute + fallback remains for display and tree labels
Graph edgesrefItemId stays the primary type-link and parent graph edge; symbolKey is parallel stable identity

Emitters must not copy qualifiedName into symbolKey when the registry has no symbol for the row.

Consumers may index and resolve @ref targets by exact symbolKey before suffix heuristics on qualifiedName.

Packed library artifacts: pckg must validate symbolKey when present (D-TOOL-PCKG-0005).

  • Rust type: ApiSymbolKey newtype in api_snapshot.rs (transparent JSON string).
  • CLI: beskid doc sets symbolKey from registry lookup only.
  • Older artifacts without symbolKey remain valid; field is additive on v4.
  • compiler/crates/beskid_analysis/src/doc/api_snapshot.rs
  • compiler/crates/beskid_cli/src/commands/doc.rs
  • compiler/crates/beskid_analysis/src/doc/refs.rs
  • compiler/crates/beskid_pckg/src/api_doc.rs