fix(compat): D-003 exempts metric-bound widgets from the fields the binding fills (#3186) - #3230
Merged
Merged
Conversation
…inding fills (#3186) A metric/status/progress widget bound to a declared metric gets its value (and a status widget its color) from the recorded points on every read (ent#479), and the agent server's validate_widget already exempts them. D-003 still demanded value/color, so an agent following the documented binding contract was reported HARD-incompatible. D-003 now applies the agent server's predicate (a truthy `metric`) and skips exactly the filled fields (_BOUND_FILLED); `label` stays required and unbound widgets keep today's rule. Decided: a binding to an undeclared name is exempt too — the backend renders "not declared" and drops any written value, so requiring one demands a number nobody sees. D-009 checks the metrics block's shape only; no check flags undeclared bindings yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
merge-train (2026-10-05, evening run): on the train (#3251). Nothing was pushed to this branch. Follow-ups from validation, none blocking:
|
12 of 16 tasks
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
A
metric,statusorprogresswidget bound to a declared metric (metric: <name>) gets its value, and a status widget its colour, from the recorded points on every read (ent#479). The agent server'svalidate_widgetalready exempts bound widgets from those fields. Compatibility check D-003 (HARD) still required them, so an agent that followed the documented binding contract was reported incompatible.metric. It skips exactly the fields the binding fills (_BOUND_FILLED):valuefor metric and progress widgets, andvalue+colorfor status widgets. The two rules reference each other so they stay in step.labelis still required, and unbound widgets keep today's rule.value, so requiring one would mean writing a number nobody sees.metrics:block. Nothing currently flags a binding to an undeclared name, and that would be a new check, so it's a possible follow-up rather than part of this PR.progressis included even though the issue names only metric and status. The agent server already exempts it, and leaving it out would keep the two rules out of step.Changes
src/backend/services/compatibility/static_checks.py:_BOUND_FILLEDand the exemption inc_d003, with a docstringdocker/base-image/agent_server/routers/dashboard.py: a comment linking to the D-003 rule (no behaviour change)docs/agent-validation-spec.md: the binding rule under D-003tests/unit/test_compatibility_checks.py: 10 new casesTest Plan
nullor0binding is not a binding; a bound widget still needs itslabel; an undeclared binding passes. The four bound cases fail without the fix.test_compatibility_checks.py+test_ent479_binding_and_compat.py+test_2110_widget_type_parity.py: 201 passed.Fixes #3186
🤖 Generated with Claude Code