Skip to main content
Version: Next

KQ271 — a constant is used where it is seen

Error · constant-visible · Policies

A name used in a value's place is a constant written on the model, or on the element the value is written on or in, or on one that holds it.

A policy, a period or an open property uses a constant written on another part of the model, which can't be seen from there: a constant is seen where it is written and in everything that element holds, and one written at a file's top level is seen everywhere. A name is looked up where it is written: in a policy, where the policy is written, never where the subject it judges sits; in a period or a property, on the element that holds it. Move the constant up to an element that holds the use, or to the top level, or write the value where it is used.

Examples​

The constant is written on the payments platform, and the policy that uses it on the shop, where it can't be seen, so it raises KQ271:

ecosystem shop "Shop" { platform payments "Payments" { const MAX_SECRET_ROTATION = P90D } policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION }

With the constant moved up to the shop, it raises nothing:

ecosystem shop "Shop" { const MAX_SECRET_ROTATION = P90D policy secret-rotation in architecture "Secrets rotate at least every 90 days" when credential: secret -> deny rotate: over MAX_SECRET_ROTATION }

© 2026 Extenza Works. All rights reserved.