Skip to content

fix(registry): reject unknown config fields to prevent configuration drift#4139

Open
H4ck3r-netizen wants to merge 1 commit into
orchestration-agent:mainfrom
H4ck3r-netizen:fix/registry-reject-unknown-fields
Open

fix(registry): reject unknown config fields to prevent configuration drift#4139
H4ck3r-netizen wants to merge 1 commit into
orchestration-agent:mainfrom
H4ck3r-netizen:fix/registry-reject-unknown-fields

Conversation

@H4ck3r-netizen
Copy link
Copy Markdown

Summary

Fixes #4055

The registry config loader was accepting any configuration fields without validation, allowing stale, duplicate, or policy-violating transitions to be committed. This could cause tasks to resolve to unavailable, unauthorized, or incompatible handlers.

Changes

  • Define ALLOWED_CONFIG_FIELDS set with all permitted config keys (image, command, args, env, resources, volumes, network, labels, secrets, schedule, retries, timeout, description)
  • Add _validate_config() method that rejects unknown fields with a clear error message
  • register() now validates config before storing the agent
  • Raise UnknownRegistryFieldError (subclass of ValueError) with descriptive message listing unknown and allowed fields
  • Log rejected fields for audit purposes without exposing private runtime data

Testing

  • 7 new regression tests covering: valid config, empty config, single unknown field, multiple unknown fields, stale/deprecated fields, config immutability, and all-allowed-fields acceptance
  • All tests pass: pytest tests/test_registry_fields.py -v

Bounty

This PR addresses the $2k bounty on issue #4055.

…drift

- Add ALLOWED_CONFIG_FIELDS set defining permitted config keys
- Add _validate_config() method that rejects unknown fields
- register() now validates config before storing agent
- Raise UnknownRegistryFieldError with descriptive message on invalid fields
- Log rejected fields for audit purposes
- Add 7 regression tests covering valid, empty, unknown, stale, and all-allowed cases

Fixes orchestration-agent#4055
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Bounty $2k ] [ Registry ] Reject unknown registry fields — configuration drift

1 participant