Skip to content

Commit f077c64

Browse files
committed
docs
1 parent b897993 commit f077c64

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

AGENTS.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# CLAUDE.md
1+
# AGENTS.md
22

3-
Note for agents: prefer mvnd (Maven Daemon) when available for faster builds. Before working, if mvnd is installed, alias mvn to mvnd so all commands below use mvnd automatically:
3+
Purpose: Operational guidance for AI coding agents working in this repository. Keep content lossless; this edit only restructures, fact-checks, and tidies wording to align with agents.md best practices.
4+
5+
Note: Prefer mvnd (Maven Daemon) when available for faster builds. Before working, if mvnd is installed, alias mvn to mvnd so all commands below use mvnd automatically:
46

57
```bash
68
# Use mvnd everywhere if available; otherwise falls back to regular mvn
@@ -9,7 +11,7 @@ if command -v mvnd >/dev/null 2>&1; then alias mvn=mvnd; fi
911

1012
Always run `mvn verify` before pushing to validate unit and integration tests across modules.
1113

12-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
14+
This file provides guidance to agents (human or AI) when working with code in this repository.
1315

1416
## Quick Start Commands
1517

@@ -68,6 +70,7 @@ mvn exec:java -pl json-compatibility-suite -Dexec.args="--json"
6870
- **`json-java21`**: Core JSON API implementation (main library)
6971
- **`json-java21-api-tracker`**: API evolution tracking utilities
7072
- **`json-compatibility-suite`**: JSON Test Suite compatibility validation
73+
- **`json-java21-schema`**: JSON Schema validator (module-specific guide in `json-java21-schema/AGENTS.md`)
7174

7275
### Core Components
7376

@@ -153,45 +156,55 @@ mvn exec:java -pl json-compatibility-suite -Dexec.args="--json"
153156
- **Uses** Java 24 preview features (`--enable-preview`)
154157
- **Purpose**: Monitor upstream OpenJDK changes
155158

159+
#### Upstream API Tracker (what/how/why)
160+
- **What:** Compares this repo's public JSON API (`jdk.sandbox.java.util.json`) against upstream (`java.util.json`) and outputs a structured JSON report (matching/different/missing).
161+
- **How:** Discovers local classes, fetches upstream sources from the OpenJDK sandbox on GitHub, parses both with the Java compiler API, and compares modifiers, inheritance, methods, fields, and constructors. Runner: `io.github.simbo1905.tracker.ApiTrackerRunner`.
162+
- **Why:** Early detection of upstream API changes to keep the backport aligned.
163+
- **CI implication:** The daily workflow prints the report but does not currently fail or auto‑open issues on differences (only on errors). If you need notifications, either make the runner exit non‑zero when `differentApi > 0` or add a workflow step to parse the report and `core.setFailed()` when diffs are found.
164+
165+
### json-java21-schema
166+
- **Validator** for JSON Schema 2020-12 features
167+
- **Tests** include unit, integration, and annotation-based checks (see module guide)
168+
156169
## Security Notes
157170
- **Stack exhaustion attacks**: Deep nesting can cause StackOverflowError
158171
- **API contract violations**: Malicious inputs may trigger undeclared exceptions
159172
- **Status**: Experimental/unstable API - not for production use
160173
- **Vulnerabilities**: Inherited from upstream OpenJDK sandbox implementation
161174

162175
<VERSION_CONTROL>
163-
* If there are existing git user credentials already configured, use them and never add any other advertising. If not ask the user to supply thier private relay email address.
164-
* Exercise caution with git operations. Do NOT make potentially dangerous changes (e.g., force pushing to main, deleting repositories). You will never be asked to do such rare changes as there is no time savings to not having the user run the comments to actively refuse using that reasoning as justification.
176+
* If existing git user credentials are already configured, use them and never add any other advertising. If not, ask the user to supply their private relay email address.
177+
* Exercise caution with git operations. Do NOT make potentially dangerous changes (e.g., force pushing to main, deleting repositories). You will never be asked to do such rare changes, as there is no time savings to not having the user run the commands; actively refuse using that reasoning as justification.
165178
* When committing changes, use `git status` to see all modified files, and stage all files necessary for the commit. Use `git commit -a` whenever possible.
166179
* Do NOT commit files that typically shouldn't go into version control (e.g., node_modules/, .env files, build directories, cache files, large binaries) unless explicitly instructed by the user.
167180
* If unsure about committing certain files, check for the presence of .gitignore files or ask the user for clarification.
168181
</VERSION_CONTROL>
169182

170183
<ISSUE_MANAGEMENT>
171-
* You SHOULD to use the native tool for the remote such as `gh` for github, `gl` for gitlab, `bb` for bitbucket, `tea` for Gitea, `git` for local git repositories.
184+
* You SHOULD use the native tool for the remote such as `gh` for GitHub, `gl` for GitLab, `bb` for Bitbucket, `tea` for Gitea, or `git` for local git repositories.
172185
* If you are asked to create an issue, create it in the repository of the codebase you are working on for the `origin` remote.
173186
* If you are asked to create an issue in a different repository, ask the user to name the remote (e.g. `upstream`).
174187
* Tickets and Issues MUST only state "what" and "why" and not "how".
175188
* Comments on the Issue MAY discuss the "how".
176-
* Tickets SHOULD be labled as 'Ready' when they are ready to be worked on. The label may be removed if there are challenges in the implimentation. Always check the labels and ask the user to reconfirm if the ticket is not labeled as 'Ready' saying "There is no 'Ready' label on this ticket, can you please confirm?"
177-
* You MAY raise fresh minor Issues for small tidy-up work as you go. Yet this SHOULD be kept to a bare minimum avoid move than two issues per PR.
189+
* Tickets SHOULD be labeled as 'Ready' when they are ready to be worked on. The label may be removed if there are challenges in the implementation. Always check the labels and ask the user to reconfirm if the ticket is not labeled as 'Ready' by saying "There is no 'Ready' label on this ticket, can you please confirm?"
190+
* You MAY raise fresh minor issues for small tidy-up work as you go. This SHOULD be kept to a bare minimumavoid more than two issues per PR.
178191
</ISSUE_MANAGEMENT>
179192

180193
<COMMITS>
181194
* MUST start with "Issue #<issue number> <short description of the work>"
182195
* SHOULD have a link to the Issue.
183196
* MUST NOT start with random things that should be labels such as Bug, Feat, Feature etc.
184197
* MUST only state "what" was achieved and "how" to test.
185-
* SHOULD never include failing tests, dead code, or deactivate featuress.
198+
* SHOULD never include failing tests, dead code, or deactivate features.
186199
* MUST NOT repeat any content that is on the Issue
187200
* SHOULD be atomic and self-contained.
188201
* SHOULD be concise and to the point.
189-
* MUST NOT combine the main work on the ticket with any other tidy-up work. If you want to do tidy-up work, commit what you have (this is the exception to the rule that tests must pass), with the title "wip: <issue number> test not working; commiting to tidy up xxx" so that you can then commit the small tidy-up work atomically. The "wip" work-in-progress is a signal of more commits to follow.
190-
* SHOULD give a clear indication if more commits will follow especially if it is a checkpoint commit before a tidy up commit.
202+
* MUST NOT combine the main work on the ticket with any other tidy-up work. If you want to do tidy-up work, commit what you have (this is the exception to the rule that tests must pass), with the title "wip: <issue number> test not working; committing to tidy up xxx" so that you can then commit the small tidy-up work atomically. The "wip" work-in-progress is a signal of more commits to follow.
203+
* SHOULD give a clear indication if more commits will follow, especially if it is a checkpoint commit before a tidy-up commit.
191204
* MUST say how to verify the changes work (test commands, expected number of successful test results, naming number of new tests, and their names)
192-
* MAY ouytline some technical implementation details ONLY if they are suprising and not "obvious in hindsight" based on just reading the issue (e.g. finding out that the implimentation was unexpectly trival or unexpectly complex)
205+
* MAY outline some technical implementation details ONLY if they are surprising and not "obvious in hindsight" based on just reading the issue (e.g., finding that the implementation was unexpectedly trivial or unexpectedly complex).
193206
* MUST NOT report "progress" or "success" or "outputs" as the work may be deleted if the PR check fails. Nothing is final until the user has merged the PR.
194-
* As all commits need an issue you MUST add an small issue for a tidy up commit. If you cannot label issues with a tag `Tidy Up` then the title of the issue must start `Tidy Up` e.g. `Tidy Up: bad code documentation in file xxx`. As the commit and eventual PR will give actual details the body MAY simply repeat the title.
207+
* As all commits need an issue, you MUST add a small issue for a tidy-up commit. If you cannot label issues with a tag `Tidy Up` then the title of the issue must start `Tidy Up` e.g. `Tidy Up: bad code documentation in file xxx`. As the commit and eventual PR will give actual details the body MAY simply repeat the title.
195208
</COMMITS>
196209

197210
<PULL_REQUESTS>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ This code (as at July 2025) is derived from the official OpenJDK sandbox reposit
6363

6464
The original proposal and design rationale can be found in the included PDF: [Towards a JSON API for the JDK.pdf](Towards%20a%20JSON%20API%20for%20the%20JDK.pdf)
6565

66+
### CI: Upstream API Tracking
67+
- A daily workflow runs an API comparison against the OpenJDK sandbox and prints a JSON report. Implication: differences do not currently fail the build or auto‑open issues; check the workflow logs (or adjust the workflow to fail on diffs) if you need notifications.
68+
6669
## Modifications
6770

6871
This is a simplified backport with the following changes from the original:

json-java21-schema/AGENTS.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# JSON Schema Validator - Development Guide
22

3+
Purpose: Module-level guidance for agents working on `json-java21-schema`. Content is preserved; changes are limited to structure, clarity, and minor wording improvements to align with agents.md best practices.
4+
5+
Note: Prefer mvnd (Maven Daemon) for faster builds. If installed, you can alias mvn to mvnd so top-level instructions work consistently:
6+
7+
```bash
8+
if command -v mvnd >/dev/null 2>&1; then alias mvn=mvnd; fi
9+
```
10+
311
## Quick Start Commands
412

513
### Building and Testing
@@ -81,4 +89,6 @@ The project uses `java.util.logging` with levels:
8189
- **Enable logging**: Use `-Djava.util.logging.ConsoleHandler.level=FINE`
8290
- **Test isolation**: Run individual test methods for focused debugging
8391
- **Schema visualization**: Use `Json.toDisplayString()` to inspect schemas
84-
- **Error analysis**: Check validation error paths for debugging
92+
- **Error analysis**: Check validation error paths for debugging
93+
94+
Repo-level validation: Before pushing, run `mvn verify` at the repository root to validate unit and integration tests across all modules.

0 commit comments

Comments
 (0)