migrate-apim: a policy element no rule answers for is dropped with no trace, and the ones with no expression in them vanish completely
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start with plan._policies(), capability.policy_rule(), policy.FAMILIES, and rules.json; the issue reproduces the missing matches offline and outlines the expected behavior. Inspect the related open pull request #66 and the existing compile checks before choosing work. Done means unknown policy elements are represented in plan coverage and compilation reports any elements left to the terminal gap rule.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
plan._policies() drops any element capability.policy_rule() does not answer for:
rule = self.caps.policy_rule(element["name"], family=..., has_expression=...)
if not rule or rule["verdict"] in {"notApplicable", "handled"}:
continue
policy_rule runs three passes — element name, then family, then the hasExpression fallback — and returns None when none of them matches. The element is then read, classified, and discarded with nothing recorded anywhere. No item, no gap, no count.
Ten of the 62 elements in policy.FAMILIES resolve to None today:
| Element | Family | What it does |
|---|---|---|
authentication-basic |
backendAuthentication |
backend credentials |
authentication-certificate |
backendAuthentication |
backend credentials |
get-authorization-context |
backendAuthentication |
backend credentials |
check-header |
authentication |
gates callers |
validate-client-certificate |
authentication |
gates callers |
emit-metric |
observability |
|
log-to-eventhub |
observability |
|
mcp-server |
mcp |
|
validate-mcp-request |
mcp |
|
set-service-url |
routing |
Plus every policy APIM ships from here on, since a new element matches no rule by definition.
The selection order makes it worse than it reads
The third pass matches on hasExpression, so an element carrying a policy expression lands on the gap rule and is reported. What disappears completely is the subset with no expression in it:
caps = CapabilityMap.load()
[e for e, f in FAMILIES.items() if caps.policy_rule(e, family=f, has_expression=False) is None]
# 10 elements
[e for e, f in FAMILIES.items() if caps.policy_rule(e, family=f, has_expression=True) is None]
# 0 -- the same elements are answered once an expression is present
So the simpler the policy, the more certainly it vanishes. A literal <authentication-basic username="svc" password="{{secret}}"/> leaves no trace; the same element with an expression in it is reported as a gap.
Impact
This is the project's governing rule failing in the direction it exists to prevent: a failed inference reading as a confident negative. A plan that never saw a policy and a plan that saw it and discarded it are the same document, so "nothing else to migrate" is indistinguishable from "three backend credential policies were dropped on the floor".
collect has already settled the same question one stage earlier — collection.coverage records notCollected precisely because "it is not evidence that nothing is there" (schemas/inventory.schema.json). The inventory holds these elements. The plan is where they disappear.
Relationship to the existing rule-selection work
Worth stating, because it looks adjacent and is not. dispatch.py and compile solve the inverse direction — a rule no selection site can ever choose, which is what dispatch.py's docstring enumerates and what #53 dropped thirteen of. Nothing in that work looks at the other side of the match: an element no rule answers for. Selector.governs can tell you a rule is reachable; it cannot tell you the element vocabulary is covered.
It is also distinct from plan._note_unmapped, which reports source attributes with no target field on an element that did map.
Suggested fix
Three places, because no one of them is sufficient:
- A terminal rule in
rules.jsonmatching anything, tried after the expression pass, soNonebecomes unreachable at runtime. What reaches it is a blockinggap— the alternative is migrating past a policy nobody has read. Keeping it as data rather than a default in the planner keeps what an unknown element costs editable. - A
compilecheck, so the net does not quietly become the mapping: hold every element inpolicy.FAMILIESto a rule of its own or a family rule, and fail naming any left to the terminal rule.FAMILIESis committed data, so this is decidable offline, which is whatcompileis for. - A coverage tally on the plan, counting every element walked under exactly one disposition with the unrecognised ones named and located. Three of the dispositions raise no item, and while they were uncounted the plan could not be checked against the inventory.
The ten above are answerable by five family rules and one element rule rather than ten entries, so the next member of each family is answered before it is written.
Found while reviewing the fixes for #58/#59/#60. Reproduced offline against ea30225; no Azure or network needed.
- Lenguaje dominante
- Python
- Estrellas
- 18
- Forks
- 9
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 23
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/aigateway
-
How do I use the AI Gateway to route to ADO Remote MCP Server?Posiblemente ocupada @santiagxf la tomó hoy. Abiertoquestion
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
Azure/aigateway#72 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Playground testing to external claude enterprise fails from AI GatewayPosiblemente ocupada @santiagxf la tomó hoy. Abiertoinvestigate
Dificultad 3/5 1-2 días Aptitud para principiantes 53/100
Azure/aigateway#71 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
migrate-apim: partialWhen conditions are declared in the schema and implemented in the planner, and nothing checks the two agreePosiblemente ocupada @santiagxf la tomó hoy. Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
Todos los issues de Azure/aigateway
Issues similares
-
roadmap/v1.3.0 scope/entitlement type/improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
databrickslabs/ontos#1778 ·
Los mantenedores suelen responder en 2 días
-
bug good first issue help wanted up-for-grabs
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ClickHouse/loom#2075 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itselfPosiblemente ocupada @fedonman la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 69/100
StevenBlack/hosts#3314 ·
-
task
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
SparseLinearAlgebra/spla#316 · 1 comentario ·
Los mantenedores suelen responder en 1 día