Repository navigation
Add reference lookup and pure entry rename, and split refs into references and sensitive - #49
Open
nicoloesch wants to merge 8 commits into
Open
nicoloesch wants to merge 8 commits into
nicoloesch wants to merge 8 commits into
Conversation
3 tasks done
nicoloesch
marked this pull request as ready for review
November 7, 2026 17:38
This was
linked to
issues
Nov 7, 2026
nicoloesch
force-pushed
the
24-reverse-reference-lookup
branch
from
November 16, 2026 21:36
2d86015 to
1d65ff8
Compare
gkennos
requested changes
Nov 16, 2026
gkennos
approved these changes
Nov 17, 2026
This branch has not been deployed
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.
Summary
Adds reverse reference lookup (which entries and package fields name a given entry) and a pure, atomic
rename_entrythat repoints every reference. Both read the existingRefTomarkers, so forward and reverse lookups share one walk.Along the way, the reference logic is gathered in
references.py, entry classes now carry their own section name, andrefs.pyis split intoreferences.pyandsensitive.pyto remove therefs/referencesambiguity.refs.pystays as a deprecated alias.Changes
references.pycollect_referenceslists every reference in the stack.references_tofilters it by target.find_referencesdoes the same but discovers installed package classes from theomop.configentry points and reports broken, duplicate or invalid registrations asDiscoveryProblem.[tools.*]fields are read through the package classes. A tool section with no known class is listed inunknown_tool_schemas, never treated as having no references. An omitted field counts through its default, and so does every field of an installed package whose section is absent from the config.Reference,ReferenceReportandDiscoveryProblem, exported from the package.rename_entry[tools.*]references, and writes an explicit new value where a package field referred to the old name through its default. A package with no section gets one holding just that value.Sectionedcarriessection, andReferenceablemarks the classes aRefTomay name. The abstractDatabaseConfigis sectioned but not referenceable._REF_SECTIONStable.RefTo.targetis typed astype[Referenceable].StackConfig.entry_sections()is derived from the field annotations, with tests that each class's section matches its field._add_entryand_list_entriesread the section from the class instead of taking a string.unresolved_refs,mismatched_kind_refsandUnknownRefTargetfromstack_config.pytoreferences.py. They share a walker with the new lookup and remain importable fromstack_config.refs.pyRefTo,Referenceableand_iter_refsmove toreferences.py.Sensitive,Secret, masking and error sanitising move tosensitive.py.SecretandSensitiveare now exported from the package root.refs.pyremains as an alias that warns withDeprecationWarningand is to be removed in the next major release.package_entry_points()as the single reader of theomop.configgroup, used by the CLI and discovery.docs/apifor the new locations and add the lookup and rename. Add tests for lookup, discovery, rename, section consistency and therefsalias.Behaviour
oa_configurator.refs.*and thestack_confighelper paths still resolve. Onlyrefsemits a deprecation warning.DatabaseConfigtoRefTois now also a type error. At runtime it still raisesUnknownRefTargetas before.Checklist
feature)pytest -q): 674 passedruff check .,ty check src/ tests/)