feat(config)!: registry-key adapter resolution, drop unsafe _target_ (#301)#356
Open
stanlrt wants to merge 27 commits into
Open
feat(config)!: registry-key adapter resolution, drop unsafe _target_ (#301)#356stanlrt wants to merge 27 commits into
stanlrt wants to merge 27 commits into
Conversation
e2acf44 to
1eff8e4
Compare
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
Closes the config-level
_target_arbitrary-callable RCE surface (#301) across every raitap module. Configs now select an implementation by a shortuse: <registry_name>key resolved through the closed_BUILDERSregistry —_target_no longer appears on any config surface (inline YAML, Hydra presets, programmatic builders). The same closed registry now feeds editor autocomplete and generated docs.Rebased onto
main— #301-only (24 commits). Breaking (pre-1.0, no shim):_target_: <ClassName>→use: <registry_name>in all configs.Design — two layers
use: <key>+ typed fields. No dotted paths anywhere.raitap.configs.registry_resolvemaps ausekey to the vetted class FQN baked at registration;_target_lives only here.reject_config_targetrecurses and rejects a_target_key at any depth (hydrainstantiaterecurses, so a nestedconstructor._target_was a real hole — now closed).All six resolvers (adapter_factory, reporting, metrics, tracking, evaluation/step, data parsers) plus the reporting/tracking/orchestrator "is-configured" guards follow reject → resolve → pop-
use→ instantiate.Autocomplete + docs (the push beyond the gate)
build_config_schema()emits a JSON Schema with per-groupuseenums.src/raitap/schema/raitap.schema.json(shipped in the wheel) +raitap config-schemaCLI (regenerates including installed plugins) + a CI freshness gate.# yaml-language-server: $schema=./raitap.schema.json.Also
library=→import_name(it feedsimportlib.import_module).configs.utils.resolve_targetprefix helper.Verification
Per-task TDD + spec/quality review each; two whole-branch passes (correctness: clean; refactor: 2 mechanical de-dups applied). Security invariant smoke-tested end-to-end (nested
_target_rejected,useresolves, unknown key errors).raitap --demoruns green. Full suite runs in CI.Known follow-ups (pre-existing, not regressions)
tracking/mlflowabsent from the generated schema: a swallowed circular import intracking/__init__.pyon theregister_configspath (documented in_config_schema.py). Order-harden then regen.smoke_test_mlflow.pynever setuse(skips tracking) — predates this work.🤖 Generated with Claude Code
https://claude.ai/code/session_01PdLtUmYVtwhPRfwpEvyshD
Checklist
!(feat(config)!:)._target_->use:is a necessary, non-deferrable config break (pre-1.0, closes the RCE surface before config-sharing lands).Optional
config-schemadocumented.