Skip to content

Commit 1822a8c

Browse files
author
Mark Pollack
committed
Add @UnstableAcpApi stability marker annotation
Marks ACP API elements that correspond to protocol methods defined only in schema.unstable.json. These APIs are public and functional but may change in any minor release to track the ACP protocol. Design aligns with JDK @PreviewFeature and JetBrains ApiStatus.Experimental conventions: CLASS retention, @documented, not @inherited. Targets TYPE, METHOD, CONSTRUCTOR, FIELD, PACKAGE, RECORD_COMPONENT, ANNOTATION_TYPE (PARAMETER excluded per JDK guidance and zero surveyed projects including it). Optional String value() for tracking links (gRPC pattern). See plans/outbox/unstable-api-annotation-design.md for full research across JDK, JetBrains, Netty, Micronaut, gRPC, Guava, Hadoop, Kafka, Flink and 7 rounds of review feedback.
1 parent ad3bcde commit 1822a8c

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2025-2026 the original author or authors.
3+
*/
4+
5+
package com.agentclientprotocol.sdk.annotation;
6+
7+
import java.lang.annotation.Documented;
8+
import java.lang.annotation.ElementType;
9+
import java.lang.annotation.Retention;
10+
import java.lang.annotation.RetentionPolicy;
11+
import java.lang.annotation.Target;
12+
13+
/**
14+
* Marks an ACP API element as unstable.
15+
*
16+
* <p>Unstable APIs correspond to protocol elements defined only in
17+
* {@code schema.unstable.json}. They are public and functional but may
18+
* change signature, behavior, wire mapping, or be removed in any minor
19+
* release to track the ACP protocol. See {@code VERSIONING.md} for the
20+
* full stability policy.
21+
*
22+
* <p>When the protocol element is promoted to {@code schema.json}, this
23+
* annotation will be removed. Removing it is a compatible change.
24+
*
25+
* <p>"Unstable" refers to protocol stability, not implementation quality.
26+
*
27+
* <p><b>Propagation:</b> if a package is marked, all its classes are
28+
* considered unstable (subpackages are not affected). If a type is marked,
29+
* all its members are unstable, but inheritors are not. If a method is
30+
* marked, overriding methods are not considered unstable.
31+
*
32+
* <p>This annotation is a stability marker and documentation signal, not
33+
* an access-control mechanism. IntelliJ users can configure the built-in
34+
* <em>Unstable API Usage</em> inspection to flag usages of APIs carrying
35+
* this annotation.
36+
*
37+
* @author Mark Pollack
38+
* @since 0.12.0
39+
* @see <a href="https://agentclientprotocol.com/protocol/overview">ACP Protocol</a>
40+
*/
41+
@Documented
42+
@Retention(RetentionPolicy.CLASS)
43+
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD,
44+
ElementType.PACKAGE, ElementType.RECORD_COMPONENT, ElementType.ANNOTATION_TYPE })
45+
public @interface UnstableAcpApi {
46+
47+
/**
48+
* Optional reference to the tracking spec entry, RFD, or issue that gates
49+
* stabilization. Empty by default.
50+
* @return a URL or identifier linking to the protocol proposal
51+
*/
52+
String value() default "";
53+
54+
}

0 commit comments

Comments
 (0)