ArcpRuntime.advertised returns the runtime's internal Set directly at arcp-runtime/src/main/java/dev/arcp/runtime/ArcpRuntime.java around line 128. The field is an EnumSet created during construction, so any caller can mutate runtime.advertised() and change future capability negotiation after the runtime has been built. Other public APIs generally use immutable copies, so this accessor is inconsistent with the SDK's immutable data-carrier style.
Fix prompt: Store advertised as an immutable Set.copyOf or return Collections.unmodifiableSet(advertised) from the accessor. Prefer making the field itself immutable so internal code cannot accidentally mutate it later. Add a regression test that attempts to mutate runtime.advertised() and verifies it throws UnsupportedOperationException or otherwise cannot alter the runtime's advertised feature set.
ArcpRuntime.advertised returns the runtime's internal Set directly at arcp-runtime/src/main/java/dev/arcp/runtime/ArcpRuntime.java around line 128. The field is an EnumSet created during construction, so any caller can mutate runtime.advertised() and change future capability negotiation after the runtime has been built. Other public APIs generally use immutable copies, so this accessor is inconsistent with the SDK's immutable data-carrier style.
Fix prompt: Store advertised as an immutable Set.copyOf or return Collections.unmodifiableSet(advertised) from the accessor. Prefer making the field itself immutable so internal code cannot accidentally mutate it later. Add a regression test that attempts to mutate runtime.advertised() and verifies it throws UnsupportedOperationException or otherwise cannot alter the runtime's advertised feature set.