-
Notifications
You must be signed in to change notification settings - Fork 38
[#700] Add AI assistant instruction files #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| ## Tech Stack | ||
| * **Java Version:** 17 (use JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64/ to build with a newer JDK, compiler target is 17) | ||
| * **Build Tool:** Maven multi-module (use `./mvnw`) | ||
| * **Key Frameworks:** JUnit 4, Mockito, compile-testing | ||
|
|
||
| ## Project Architecture | ||
|
|
||
| * **parent:** Parent POM with shared dependency and plugin versions | ||
| * **core:** Core library — annotations, descriptors, serialization runtime (`TagReader`/`TagWriter`), `.proto` schema parsing | ||
| * **processor:** Annotation processor for compile-time marshaller and `.proto` schema generation | ||
| * **processor-tests:** Tests for the annotation processor (Java) | ||
| * **processor-tests-kotlin:** Tests for the annotation processor (Kotlin) | ||
| * **types:** Pre-built adapters for common JDK types (`BigDecimal`, `UUID`, `LocalDateTime`, collections, etc.) | ||
| * **integrationtests:** Integration tests | ||
| * **sample-domain-definition:** Sample `.proto` domain definitions used across tests | ||
| * **sample-domain-implementation:** Sample marshaller implementations used across tests | ||
| * **maven-plugin:** Maven plugin for `.proto` schema backward compatibility checks | ||
|
|
||
| ## Common Build Commands | ||
| * **Full build (skip tests):** `./mvnw install -DskipTests -Dcheckstyle.skip` | ||
| * **Build a single module:** `./mvnw install -pl core -DskipTests -Dcheckstyle.skip` | ||
| * **Build a module and its dependencies:** `./mvnw install -pl processor-tests -am -DskipTests -Dcheckstyle.skip` | ||
| * **Run a single test class:** `./mvnw test -pl core -Dtest=ProtobufUtilTest -Dcheckstyle.skip` | ||
| * **Run a single test method:** `./mvnw test -pl core -Dtest=ProtobufUtilTest#testMethodName -Dcheckstyle.skip` | ||
| * **Processor tests** depend on core+processor being built first: | ||
| ```bash | ||
| ./mvnw install -pl core,processor -DskipTests -Dcheckstyle.skip | ||
| ./mvnw test -pl processor-tests -Dcheckstyle.skip | ||
| ``` | ||
|
|
||
| ## Key Packages (core module) | ||
| * `org.infinispan.protostream` — Public API: `ProtobufUtil` (entry point), `SerializationContext`, `TagReader`/`TagWriter`, marshaller interfaces | ||
| * `org.infinispan.protostream.annotations` — User-facing annotations: `@ProtoSchema`, `@Proto`, `@ProtoField`, `@ProtoFactory`, `@ProtoAdapter` | ||
| * `org.infinispan.protostream.descriptors` — Proto schema object model: `FileDescriptor`, `Descriptor`, `FieldDescriptor`, `EnumDescriptor` | ||
| * `org.infinispan.protostream.impl` — Runtime implementation: `SerializationContextImpl`, `TagReaderImpl`/`TagWriterImpl`, proto file parser | ||
| * `org.infinispan.protostream.impl.json` — JSON-to-protobuf bridging | ||
|
|
||
| ## Key Packages (processor module) | ||
| * `ProtoSchemaAnnotationProcessor` — Main JSR 269 processor, entry point for compile-time code generation | ||
| * `MarshallerSourceCodeGenerator` — Generates marshaller Java source code | ||
| * `CompileTimeProtoSchemaGenerator` — Generates `.proto` schema files | ||
| * `types/MirrorTypeFactory` — Compile-time implementation of the `XTypeFactory` abstraction (uses `javax.lang.model` instead of reflection) | ||
|
|
||
| ## How Serialization Works | ||
| 1. Users annotate classes with `@Proto`/`@ProtoField` and create a `@ProtoSchema`-annotated interface | ||
| 2. At compile time, the annotation processor generates: marshaller classes, `.proto` schema files, and a `SerializationContextInitializer` implementation | ||
| 3. At runtime, `ProtobufUtil.newSerializationContext()` creates a context, the generated initializer registers schemas and marshallers | ||
| 4. `ProtobufUtil.toByteArray()`/`fromByteArray()` perform serialization via `TagWriter`/`TagReader` | ||
|
|
||
| ## Development Standards | ||
| * **Style:** Functional programming patterns where possible; use Records for DTOs | ||
| * **Coding style:** Skip checkstyle with `-Dcheckstyle.skip` during development. Format code before committing. | ||
| * **Commit logs:** Must start with `[#00000] Summary` (issue number) | ||
| * **Git branches:** Name as `issueid/issue_summary`, use `origin/main` as upstream | ||
|
|
||
| ## Related Projects | ||
| * **Infinispan:** The main consumer of ProtoStream — source code is in ../infinispan | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Issue Creation Instructions | ||
|
|
||
| ## Issue Tracker | ||
|
|
||
| Issues are tracked at https://github.com/infinispan/protostream/issues | ||
|
|
||
| ProtoStream does not currently have GitHub issue type templates. Use plain issues with clear titles and descriptions. | ||
|
|
||
| ## Conventions | ||
|
|
||
| - Issue titles should be concise and descriptive | ||
| - Reference related issues and PRs using `#number` format | ||
| - For issues that also affect Infinispan, cross-reference the Infinispan issue using `infinispan/infinispan#number` | ||
| - When creating issues from code investigation, include file paths and line numbers where relevant | ||
| - Commit messages reference issues using `[#00000] Summary` format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Testing Instructions | ||
|
|
||
| ## Test Framework | ||
|
|
||
| ProtoStream uses **JUnit 4** across all modules. | ||
|
|
||
| | Module | Test Focus | Test Naming | | ||
| |---------------------|--------------------------------------------------|-------------| | ||
| | core | Serialization, parsing, descriptors, utilities | `*Test` | | ||
| | processor-tests | Annotation processor code generation | `*Test` | | ||
| | processor-tests-kotlin | Kotlin-specific annotation processor tests | `*Test` | | ||
| | integrationtests | Cross-module integration | `*Test` | | ||
|
|
||
| ## Writing Tests | ||
|
|
||
| ### Core Module Tests | ||
|
|
||
| Most core tests extend `AbstractProtoStreamTest`, which provides helper methods for creating a `SerializationContext` with sample domain schemas and marshallers pre-registered. | ||
|
|
||
| ```java | ||
| public class MyFeatureTest extends AbstractProtoStreamTest { | ||
|
|
||
| @Test | ||
| public void testSomething() throws Exception { | ||
| SerializationContext ctx = createContext(); | ||
| // use ctx to serialize/deserialize | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Annotation Processor Tests | ||
|
|
||
| Processor tests use the `compile-testing` library to verify compile-time behavior: | ||
|
|
||
| ```java | ||
| @Test | ||
| public void testAnnotationProcessing() { | ||
| Compilation compilation = Compiler.javac() | ||
| .withProcessors(new ProtoSchemaAnnotationProcessor()) | ||
| .compile(JavaFileObjects.forSourceString("MyClass", source)); | ||
| assertThat(compilation).succeeded(); | ||
| } | ||
| ``` | ||
|
|
||
| ### Sample Domain Classes | ||
|
|
||
| The `sample-domain-definition` and `sample-domain-implementation` modules provide reusable test domain objects (`User`, `Address`, `Account`, etc.) with their `.proto` schemas and marshallers. Use these in tests rather than creating ad-hoc domain classes when possible. | ||
|
|
||
| ## Running Tests | ||
|
|
||
| ```bash | ||
| # Run all tests in a module | ||
| ./mvnw test -pl core -Dcheckstyle.skip | ||
|
|
||
| # Run a single test class | ||
| ./mvnw test -pl core -Dtest=ProtobufUtilTest -Dcheckstyle.skip | ||
|
|
||
| # Run a single test method | ||
| ./mvnw test -pl core -Dtest=ProtobufUtilTest#testMethodName -Dcheckstyle.skip | ||
|
|
||
| # Processor tests (must build core+processor first) | ||
| ./mvnw install -pl core,processor -DskipTests -Dcheckstyle.skip | ||
| ./mvnw test -pl processor-tests -Dcheckstyle.skip | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Project Context: ProtoStream | ||
|
|
||
| ProtoStream is a Java serialization library based on Protocol Buffers, part of the Infinispan platform. It provides compile-time annotation processing to generate high-performance protobuf marshallers from annotated Java classes, enums, and records. | ||
|
|
||
| ## Shared guidelines | ||
| - Use the project's established patterns and terminology. When in doubt, follow the conventions of the module you are working in. | ||
| - Prefer clarity over cleverness. This is a long-lived open-source project with many contributors. | ||
| - Be aware of backward compatibility implications — ProtoStream is used as a core dependency by Infinispan and other projects. | ||
|
|
||
| ## Coding instructions | ||
| When planning and writing code, read and follow the instructions in AI-CODE.md. | ||
|
|
||
| ## Testing instructions | ||
| When writing or modifying tests, read and follow the instructions in AI-TEST.md. | ||
|
|
||
| ## Issue creation instructions | ||
| When creating GitHub issues, read and follow the instructions in AI-ISSUES.md. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how confused an agent could get with this path defined here. I assume not much.