Move version compatibility to the consumer; name libdpm-core explicitly
dpm_require no longer takes a minimum version and applies no version criterion of its own. A handle now means the module is valid, not that it suits the caller. dpm_module_info_of is added alongside it, reporting the name, version, description, and minimum-libdpm-core version read at load, so a consuming module can judge a dependency's version for itself. The one rule still enforced is the minimum-version handshake, where libdpm-core is the host and refuses a module that demands a newer library than the one running. dpm_module_info_of joins the version script, so the exported surface is now fourteen symbols under DPM_CORE_1.0. Separately, the bare word "core" is gone from prose everywhere. It named both the command-line tool and the library, so every use forced the reader to guess which. Text now says "the dpm binary" or "libdpm-core". Identifiers keep their spelling: libdpm-core, core.h, core.conf, the "core" configuration namespace, dpm_core_version, core_min, DPM_CORE_1.0, the dpmcore namespace, test_core, core_api. Three user-visible strings changed with it: the load-refusal message now reads "requires libdpm-core >= X, running libdpm-core is Y — update libdpm-core", and the info module's description and help text name the library. The test asserting on the refusal text was updated to match. DESIGN.md's terminology line no longer defines "DPM Core" as the CLI, which was the source of the ambiguity. OVERVIEW.md is restructured around the three layers a reader meets DPM at — user, developer, filesystem — so a code-level symbol never appears without saying whose layer it is. MODULES.md describes the bundled info module as testing and demonstrating full DPM system functionality rather than as a reference implementation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2
tests/fixtures/src/bad_magic.cpp
vendored
2
tests/fixtures/src/bad_magic.cpp
vendored
@@ -3,7 +3,7 @@
|
||||
* @brief Broken fixture: API table with a wrong magic constant
|
||||
*
|
||||
* Contract-complete, but its declared table opens with garbage instead
|
||||
* of the spec magic. Core must refuse it at validation step 5.
|
||||
* of the spec magic. libdpm-core must refuse it at validation step 5.
|
||||
*
|
||||
* Part of the Dark Horse Linux Package Manager (DPM)
|
||||
*
|
||||
|
||||
2
tests/fixtures/src/bad_version.cpp
vendored
2
tests/fixtures/src/bad_version.cpp
vendored
@@ -3,7 +3,7 @@
|
||||
* @brief Broken fixture: malformed module version string
|
||||
*
|
||||
* Contract-complete, but dpm_module_version() returns something that
|
||||
* is not X.Y.Z. Core must refuse it at validation step 3.
|
||||
* is not X.Y.Z. libdpm-core must refuse it at validation step 3.
|
||||
*
|
||||
* Part of the Dark Horse Linux Package Manager (DPM)
|
||||
*
|
||||
|
||||
10
tests/fixtures/src/core_too_new.cpp
vendored
10
tests/fixtures/src/core_too_new.cpp
vendored
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @file core_too_new.cpp
|
||||
* @brief Broken fixture: demands a core newer than any that exists
|
||||
* @brief Broken fixture: demands a libdpm-core newer than any that exists
|
||||
*
|
||||
* Contract-complete, but dpm_module_core_min() reports 99.0.0. Core
|
||||
* must refuse it at validation step 2 with a message naming the
|
||||
* remedy (update core).
|
||||
* Contract-complete, but dpm_module_core_min() reports 99.0.0.
|
||||
* libdpm-core must refuse it at validation step 2 with a message
|
||||
* naming the remedy (update libdpm-core).
|
||||
*
|
||||
* Part of the Dark Horse Linux Package Manager (DPM)
|
||||
*
|
||||
@@ -45,7 +45,7 @@ extern "C" const char* dpm_module_version(void)
|
||||
|
||||
extern "C" const char* dpm_module_description(void)
|
||||
{
|
||||
return "Fixture demanding a future core.";
|
||||
return "Fixture demanding a future libdpm-core.";
|
||||
}
|
||||
|
||||
extern "C" const char* dpm_module_core_min(void)
|
||||
|
||||
4
tests/fixtures/src/good.cpp
vendored
4
tests/fixtures/src/good.cpp
vendored
@@ -3,8 +3,8 @@
|
||||
* @brief Known-good stub module fixture
|
||||
*
|
||||
* A complete, valid DPM module written against the documented module
|
||||
* contract with its own declarations — no core headers — exactly as a
|
||||
* standalone module author would. Used to validate core's happy path.
|
||||
* contract with its own declarations — no libdpm-core headers — exactly
|
||||
* as a standalone module author would. Used to validate the happy path.
|
||||
*
|
||||
* Part of the Dark Horse Linux Package Manager (DPM)
|
||||
*
|
||||
|
||||
2
tests/fixtures/src/lying_manifest.cpp
vendored
2
tests/fixtures/src/lying_manifest.cpp
vendored
@@ -3,7 +3,7 @@
|
||||
* @brief Broken fixture: manifest declares an API it doesn't export
|
||||
*
|
||||
* Contract-complete, but its manifest names a table symbol that does
|
||||
* not exist in the .so. Core must refuse it at validation step 4.
|
||||
* not exist in the .so. libdpm-core must refuse it at validation step 4.
|
||||
*
|
||||
* Part of the Dark Horse Linux Package Manager (DPM)
|
||||
*
|
||||
|
||||
2
tests/fixtures/src/missing_symbols.cpp
vendored
2
tests/fixtures/src/missing_symbols.cpp
vendored
@@ -3,7 +3,7 @@
|
||||
* @brief Broken fixture: exports only part of the module contract
|
||||
*
|
||||
* Missing dpm_module_execute, dpm_module_core_min, and
|
||||
* dpm_module_manifest. Core must refuse it at validation step 1 and
|
||||
* dpm_module_manifest. libdpm-core must refuse it at step 1 and
|
||||
* name the missing symbols.
|
||||
*
|
||||
* Part of the Dark Horse Linux Package Manager (DPM)
|
||||
|
||||
Reference in New Issue
Block a user