Skip to content

The nearest-older profile fallback is log-only: no caller can branch on it #61

Closed

Description

@CameronBrooks11

Summary

When a jar's version has no checked-in profile, get_profile() correctly
returns (profile, exact=False) — but OpenRocketInstance.__init__ consumes
that flag, logs a warning, and discards it. Nothing on the instance says
whether it is running on an exact profile or a nearest-older fallback.

The fallback is a could not tell: orlab is telling you it does not know this
OpenRocket version and is proceeding on older facts, where "newer constants may
be missing from orlab's enums". That belongs in the object, not only in a log
line.

Reproduction

Fake jars carrying only build.properties; __init__ reads the version and
selects the profile without starting a JVM, so no OpenRocket install is needed.

i = OpenRocketInstance(jar_path=fake_jar("25.09"))   # no profile for 25.09
print(i.or_version, i.profile.version_string)        # 25.09 24.12
=== Can a caller branch on "am I on a fallback?" ===
  public attributes: MANUAL_JVM_PATH, jar_path, jvm_args, jvm_path, openrocket,
                     or_log_level, or_version, profile, started
  attributes naming exact/fallback/approximate: NONE

The warning is the only signal, and it is suppressible

Setting the root logger to ERROR — an ordinary application choice — removes it
entirely:

  (root logger set to ERROR, as an application might)
  --- constructing a 25.09 instance; any warning should appear below ---
  --- end ---
  instance built. or_version=25.09 profile=24.12
  the caller received: no exception, no return value, no attribute.

The obvious workaround is wrong

Comparing or_version to profile.version_string looks like it recovers the
flag. It does not — parse_version maps 24.12.RC.01 to (24, 12), an
exact match, while the strings differ:

jar truth or_version != profile.version_string
24.12 exact exact
25.09 fallback fallback
24.12.RC.01 exact fallback — wrong
26.xx-SNAPSHOT fallback fallback

So a consumer that reconstructs the flag gets false positives on every RC and
point-release build.

Suggested fix

Keep the value that already exists:

self.profile, self.profile_exact = get_profile(self.or_version)
if not self.profile_exact:
    logger.warning(...)

Additive and non-breaking. tests/test_api_surface.py freezes the public
surface, so this is a deliberate addition rather than a rename.

Worth considering alongside: Helper warns once per absent
FlightDataType/getter via _warn_absent_once, which has the same shape — the
caller learns that a requested quantity was unavailable only from a log line
that fires once per process.

Why this is filed

orlab is a heibench member, and the org contract's §3 states that degrading to
an older profile is a "could not tell" that must reach the caller as a value.
A4 in that contract recorded this as suspected but untested; this is the
test. Reproduced against main @ b0708f9.

Activity

  1. added a commit that references this issue on Sep 5, 2026
    6ebbaad
  2. added
    silence-defect
    on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    silence-defect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions