Repository navigation
feat(config): config model, preset merge, canonical fingerprint (T02) - #2
Merged
Merged
Conversation
CaliperConfig (pydantic, frozen, extra=forbid) with the section 9.7 binding
fields; load_config deep-merges the user config over the version preset;
fingerprint() is the SHA-256 of canonical JSON of the binding fields, fp8()
the 8-char table suffix. Invalid configs are rejected with the offending
key path (section 11.4). Ships configs/{caliper.sample,v1,v2,v3}.toml and
unit tests for merge semantics, preset contents, fingerprint stability and
per-field sensitivity, and key-path validation errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T02 — Config + fingerprint (ARCHITECTURE §14.2)
Closes out task T02. Dependent tasks per the shared-file protocol (§14.4): T03 (uses
fp8for per-fingerprint table naming), T04 (consumesCaliperConfig).What
src/caliper/config.py:CaliperConfig(pydantic, frozen,extra="forbid") with the §9.7 binding fields;load_config(user_path, preset);fingerprint()(SHA-256 of canonical JSON of the §11.2 binding fields);fp8();ConfigErrornaming the offending key path (§11.4)configs/caliper.sample.toml,configs/v1.toml,configs/v2.toml,configs/v3.toml— exact §9.7 contentstests/unit/test_config.py— 36 tests (merge semantics, §9.7 binding, fingerprint stability/per-field sensitivity, key-path errors)Decisions recorded (docs/TASKS.md Notes)
prompt_template_sha256: placeholder (SHA-256 of empty string) until T11 freezes the template; T11 replaces it in all four TOML files.high_confidence_threshold: initialized 0.60 (not pinned in §9.7); re-verify at T16.Verification
uv run pytest— 38 passedruff check+ruff format --check— cleanmypy(strict, src/caliper) — clean