Skip to content

chore(native): C ABI versioning rule + bump 0.5.0 → 0.6.0#1224

Merged
lotgon merged 1 commit into
masterfrom
chore/collector-abi-version-rule
Jul 3, 2026
Merged

chore(native): C ABI versioning rule + bump 0.5.0 → 0.6.0#1224
lotgon merged 1 commit into
masterfrom
chore/collector-abi-version-rule

Conversation

@lotgon

@lotgon lotgon commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What

  • Add src/native/collector/AGENTS.md (directory-scoped) documenting the collector's two version numbers:
    • C ABI version HSM_COLLECTOR_VERSION_* — bump MINOR for any added/changed exported hsm_* function (or appended struct field), MAJOR for breaking; same PR; keep CMakeLists.txt project VERSION in sync.
    • Product version HSM_COLLECTOR_PRODUCT_VERSION (the .module/Collector version sensor) — pinned to the managed HSMDataCollector.csproj <Version>; bump only at a DataCollector product release, in lockstep, never native-only.
  • Bump the C ABI version 0.5.0 → 0.6.0 and resync CMakeLists.txt project(HsmCollectorNative VERSION …) (0.4.0 → 0.6.0).

Why

The C ABI policy (stated in hsm_collector.h + docs/native-collector-c-abi.md) requires a MINOR bump for every new exported function, but the recent wave — including #1221's hsm_collector_enable_file_logging — added functions since 0.5.0 (2026-06-27) without bumping. CMakeLists.txt had also drifted (0.4.0 vs header 0.5.0). One MINOR bump to 0.6.0 catches up the whole additive batch and resyncs both.

HSM_COLLECTOR_PRODUCT_VERSION stays 3.4.12 on purpose — it mirrors the managed collector (which had no release); the native logging is parity work, not a product release. To move the .module/Collector version sensor, both sides bump in lockstep at a real DataCollector release.

Notes

🤖 Generated with Claude Code

Add src/native/collector/AGENTS.md: the C ABI version (HSM_COLLECTOR_VERSION_*) must bump MINOR for any added/changed exported hsm_* function (MAJOR for breaking), same PR, kept in sync with CMakeLists project VERSION. The product version (HSM_COLLECTOR_PRODUCT_VERSION, the .module/Collector version sensor) is pinned to managed HSMDataCollector.csproj and bumps only at a product release, never native-only.

Apply the rule: #1221 added hsm_collector_enable_file_logging (and the recent wave added more functions) without a bump. Bump ABI 0.5.0 -> 0.6.0 and resync CMakeLists (drifted to 0.4.0). Product version stays 3.4.12 (managed parity, no release).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

PR #1224 Review — chore/collector-abi-version-rule

Summary

A small, well-scoped chore PR that:

  1. Adds a directory-scoped src/native/collector/AGENTS.md documenting the collector's two independent version numbers (the C ABI semver HSM_COLLECTOR_VERSION_* vs. the product version HSM_COLLECTOR_PRODUCT_VERSION) and the rules for bumping each.
  2. Bumps the C ABI version in hsm_collector.h (HSM_COLLECTOR_VERSION_MINOR 5 → 6) as the hygiene fix for the missed bump described as precedent feat(native): collector logging parity — built-in file logger + events + tests #1221.
  3. Resyncs CMakeLists.txt project(... VERSION ...) 0.4.0 → 0.6.0 to match the header.

Overall this is a clean, correct, low-risk change. Verifications below.

Correctness — verified consistent ✅

  • Header ↔ CMake now in sync. Baseline on master was header 0.5.0 and CMake 0.4.0 (drifted); after this PR both read 0.6.0. This is exactly what the AGENTS.md rule ("keep CMakeLists.txt in sync with the header macros") requires. ✅
  • Product version correctly untouched. HSM_COLLECTOR_PRODUCT_VERSION stays "3.4.12", consistent with the stated policy that it moves only on a DataCollector product release. ✅
  • No hardcoded version drift. The only consumer of the number, hsm_collector_version() in src/hsm_collector.cpp:5398, returns the HSM_COLLECTOR_VERSION macro directly, so it auto-updates. The self-check test (tests/hsm_collector_tests.cpp:2891, version() == HSM_COLLECTOR_VERSION) still holds, and the range assertion (:2892, MINOR >= 2) still passes at 6. ✅
  • Packed value math MAJOR*10000 + MINOR*100 + PATCH = 600 for 0.6.0 — correct.
  • Bump semantics are right: adding an exported function (hsm_collector_enable_file_logging, present in the header at line 318) is additive/backward-compatible, which correctly warrants a MINOR bump per the documented policy.

No bugs, security issues, or performance concerns — the diff only touches version literals and a new markdown doc.

Minor — maintainability

  • Dangling doc reference. The new AGENTS.md (line 18) points to docs/native-collector-c-abi.md ("Policy is stated in the header and docs/native-collector-c-abi.md"), and the header (hsm_collector.h:12) already references the same path. That file does not exist anywhere in the repo (src/native/collector/docs/ is absent). The header's reference is pre-existing debt, but this PR adds a second pointer to a non-existent file. Consider either creating that doc (which the AGENTS.md implies is the canonical policy location) or trimming the references so the ABI policy has a single real home — otherwise a reader following the pointer hits nothing.

Note (not a defect)

  • Retroactively bumping the ABI to 0.6.0 means the previously-shipped 0.5.0 is slightly ambiguous (it exists both with and without the file-logging function, since feat(native): collector logging parity — built-in file logger + events + tests #1221 added the function under 0.5.0). Given the collector is at major 0 and there are no external versioned find_package(hsm_collector x.y ...) consumers in-repo (both test_package/ and examples/console/standalone/ request it without a version, under COMPATIBILITY SameMajorVersion), this hygiene correction is harmless. Flagging only for awareness.

Verdict: Approve. The version bump is correct and consistent across header, CMake, runtime, and tests. Suggest addressing the dangling docs/native-collector-c-abi.md reference (pre-existing, but this PR reinforces it).

@lotgon
lotgon merged commit 219ddaf into master Jul 3, 2026
20 checks passed
@lotgon
lotgon deleted the chore/collector-abi-version-rule branch July 3, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant