Repository navigation
fix(schema): keep --schema/NSC_SCHEMA overrides out of the profile cache (#196) - #197
Merged
Merged
Conversation
…che (#196) The override path saved its model into the active profile's cache with a fresh fetched_at, so later runs without the override served it via the TTL fast-path (default: daily) or the offline fallback. Never write or touch the profile cache for an override; reuse a same-hash entry read-only, else build in memory. Claude-Session: https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb
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.
Fixes #196.
The override path used
_build_and_cache, which saved the override's model into the active profile's cache with a freshfetched_at. Later runs without the override then used it:schema_refresh: daily, for 24 hours, with no fetch and no warning._find_any_cached, whenever NetBox was unreachable.Fix: the new
_build_overridenever writes to the profile's cache and never callstouch_fetched_at. If the profile already has an entry with the same hash (identical schema content), it's reused read-only and the fast path is kept. Otherwise the model is built in memory, which costs about 0.2s for the full NetBox schema.Manual check: I ran the repro from the issue under both
dailyandon-hash-change. The second run, without--schema, no longer sees the override.Tests (in
tests/schema/test_source_ttl.py):fetched_at.Docs: CHANGELOG,
docs/architecture/schema-loading.md.https://claude.ai/code/session_01RD8NgCVtp3yYFd6NSZpbUb