Skip to content

Commit 4afaa84

Browse files
committed
Merge remote-tracking branch 'origin/main' into copilot/implement-rfc-6901-json-pointer-v2
# Conflicts: # pom.xml
2 parents cfb2f3f + be49c19 commit 4afaa84

168 files changed

Lines changed: 10816 additions & 2863 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/copilot-instructions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ return switch (jsonValue) {
8181
```
8282

8383
### Project Architecture
84-
- Core package: `jdk.sandbox.java.util.json`
85-
- Internal implementation: `jdk.sandbox.internal.util.json`
84+
- Core package: `jdk.incubator.java.util.json`
85+
- Internal implementation: `jdk.incubator.internal.util.json`
8686
- JSON Schema validator in separate module
8787
- Use appropriate logging configuration per module
8888

‎.github/workflows/api-tracker-java25.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
jobs:
1111
track-api:
1212
runs-on: ubuntu-latest
13+
timeout-minutes: 30
1314

1415
steps:
1516
- name: Checkout repository

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,33 @@ name: CI
22

33
on:
44
push:
5+
paths-ignore:
6+
- '**/*.md'
7+
- 'docs/**'
58
branches: ["**"]
69
pull_request:
10+
paths-ignore:
11+
- '**/*.md'
12+
- 'docs/**'
713
branches: ["**"]
814

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
919
jobs:
1020
build:
1121
runs-on: ubuntu-latest
22+
timeout-minutes: 30
1223
steps:
1324
- name: Checkout
1425
uses: actions/checkout@v4
1526

16-
- name: Set up JDK 24
27+
- name: Set up JDK 25
1728
uses: actions/setup-java@v4
1829
with:
1930
distribution: oracle
20-
java-version: '24'
31+
java-version: '25'
2132
cache: 'maven'
2233

2334
- name: Build and verify
@@ -39,7 +50,7 @@ jobs:
3950
for k in totals: totals[k]+=int(r.get(k,'0'))
4051
except Exception:
4152
pass
42-
exp_tests=1355
53+
exp_tests=2108
4354
exp_skipped=0
4455
if totals['tests']!=exp_tests or totals['skipped']!=exp_skipped:
4556
print(f"Unexpected test totals: {totals} != expected tests={exp_tests}, skipped={exp_skipped}")
@@ -50,6 +61,7 @@ jobs:
5061
docker-build:
5162
name: Build Docker image (Java 25)
5263
runs-on: ubuntu-latest
64+
timeout-minutes: 20
5365
steps:
5466
- name: Checkout
5567
uses: actions/checkout@v4
@@ -68,11 +80,11 @@ jobs:
6880
uses: docker/build-push-action@v6
6981
with:
7082
context: .
71-
file: jdt2jar/Dockerfile
83+
file: jtd2jar/Dockerfile
7284
push: false
7385
load: true
74-
tags: jdt2jar:ci
86+
tags: jtd2jar:ci
7587

7688
- name: Smoke test
7789
run: |
78-
docker run --rm jdt2jar:ci --help
90+
docker run --rm jtd2jar:ci --help

‎.github/workflows/daily-api-tracker.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ permissions:
1313
jobs:
1414
track-api:
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 30
1617

1718
steps:
1819
- name: Checkout repository

‎.github/workflows/maven.yml‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@ name: Java CI with Maven
22

33
on:
44
push:
5+
paths-ignore:
6+
- '**/*.md'
7+
- 'docs/**'
58
branches: [ "main" ]
69
pull_request:
10+
paths-ignore:
11+
- '**/*.md'
12+
- 'docs/**'
713
branches: [ "main" ]
814
types: [opened, synchronize, reopened]
915

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
1020
jobs:
1121
test-java21:
1222
name: Test Core Library (Java 21)
1323
runs-on: ubuntu-latest
24+
timeout-minutes: 15
1425

1526
steps:
1627
- uses: actions/checkout@v4
@@ -34,6 +45,7 @@ jobs:
3445
test-java25:
3546
name: Test with Tooling (Java 25)
3647
runs-on: ubuntu-latest
48+
timeout-minutes: 20
3749

3850
steps:
3951
- uses: actions/checkout@v4
@@ -57,6 +69,7 @@ jobs:
5769
docker-build:
5870
name: Build Docker image (Java 25)
5971
runs-on: ubuntu-latest
72+
timeout-minutes: 20
6073
needs: test-java25
6174

6275
steps:
@@ -76,11 +89,11 @@ jobs:
7689
uses: docker/build-push-action@v6
7790
with:
7891
context: .
79-
file: jdt2jar/Dockerfile
92+
file: jtd2jar/Dockerfile
8093
push: false
8194
load: true
82-
tags: jdt2jar:ci
95+
tags: jtd2jar:ci
8396

8497
- name: Smoke test
8598
run: |
86-
docker run --rm jdt2jar:ci --help
99+
docker run --rm jtd2jar:ci --help

‎.github/workflows/release-on-tag.yml‎

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
tags:
66
- 'release/[0-9]*.[0-9]*.[0-9]*'
7+
paths-ignore:
8+
- 'docs/**'
9+
- '**/*.md'
710

811
permissions:
912
contents: write
@@ -17,6 +20,7 @@ concurrency:
1720
jobs:
1821
release:
1922
runs-on: ubuntu-latest
23+
timeout-minutes: 30
2024
steps:
2125
- name: Checkout
2226
uses: actions/checkout@v4
@@ -27,13 +31,22 @@ jobs:
2731
uses: actions/setup-java@v4
2832
with:
2933
distribution: temurin
30-
java-version: '21'
34+
# JDK 25 activates the jtd-codegen profile ([24,)) so the
35+
# json-java21-jtd-codegen and jtd2jar modules join the reactor
36+
# and are published too (issue #165).
37+
java-version: '25'
3138
cache: maven
3239
server-id: central
33-
server-username: ${{ secrets.CENTRAL_USERNAME }}
34-
server-password: ${{ secrets.CENTRAL_PASSWORD }}
40+
# setup-java expects ENVIRONMENT VARIABLE NAMES here, not values;
41+
# the values are provided via the env block below (issue #156).
42+
server-username: CENTRAL_USERNAME
43+
server-password: CENTRAL_PASSWORD
3544
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
36-
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
45+
gpg-passphrase: GPG_PASSPHRASE
46+
env:
47+
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
48+
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
49+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3750

3851
- name: Extract version from tag
3952
id: version
@@ -45,29 +58,51 @@ jobs:
4558
tag_name: ${{ github.ref_name }}
4659
generate_release_notes: true
4760
body: |
61+
## Maven Central Artifacts
62+
63+
All reactor modules are published under `io.github.simbo1905.json` at version `${{ steps.version.outputs.version }}`: [`java.util.json`](https://central.sonatype.com/artifact/io.github.simbo1905.json/java.util.json), [`java.util.json.jsonpath`](https://central.sonatype.com/artifact/io.github.simbo1905.json/java.util.json.jsonpath), [`java.util.json.jtd`](https://central.sonatype.com/artifact/io.github.simbo1905.json/java.util.json.jtd), [`java.util.json.jtd.codegen`](https://central.sonatype.com/artifact/io.github.simbo1905.json/java.util.json.jtd.codegen), [`jtd2jar`](https://central.sonatype.com/artifact/io.github.simbo1905.json/jtd2jar), [`json-compatibility-suite`](https://central.sonatype.com/artifact/io.github.simbo1905.json/json-compatibility-suite), [`json-java21-api-tracker`](https://central.sonatype.com/artifact/io.github.simbo1905.json/json-java21-api-tracker).
64+
4865
## Docker Image
4966
5067
Pre-built distroless container image available on GitHub Container Registry:
5168
5269
```bash
53-
docker pull ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jdt2jar:${{ steps.version.outputs.version }}
54-
docker pull ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jdt2jar:latest
70+
docker pull ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jtd2jar:${{ steps.version.outputs.version }}
71+
docker pull ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jtd2jar:latest
5572
```
5673
57-
See [jdt2jar/README.md](https://github.com/${{ github.repository }}/blob/main/jdt2jar/README.md) for usage.
74+
See [jtd2jar/README.md](https://github.com/${{ github.repository }}/blob/main/jtd2jar/README.md) for usage.
5875
5976
- name: Build and Deploy to Central (release profile)
77+
id: deploy
6078
env:
6179
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
6280
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
6381
run: |
6482
KN="${{ secrets.GPG_KEYNAME }}"
6583
EXTRA=""
6684
if [ -n "$KN" ]; then EXTRA="-Dgpg.keyname=$KN"; fi
67-
mvn -B -ntp -P release \
85+
if mvn -B -ntp -P release \
6886
-Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" \
6987
$EXTRA \
70-
clean deploy
88+
clean deploy; then
89+
echo "Central deploy succeeded (fresh publish)."
90+
else
91+
# Idempotency guard (issue #160): a deployment of this exact
92+
# version may already be live on Maven Central (e.g. after a
93+
# re-tag). Maven Central versions are immutable; "already
94+
# exists" means the release is live, so treat it as success.
95+
V="${{ steps.version.outputs.version }}"
96+
if curl -fsSL -o /dev/null \
97+
"https://repo1.maven.org/maven2/io/github/simbo1905/json/parent/${V}/parent-${V}.pom" \
98+
&& curl -fsSL -o /dev/null \
99+
"https://repo1.maven.org/maven2/io/github/simbo1905/json/java.util.json/${V}/java.util.json-${V}.pom"; then
100+
echo "Artifacts for ${V} are already live on Maven Central; treating duplicate-publish as success." | tee -a "$GITHUB_STEP_SUMMARY"
101+
else
102+
echo "Central deploy failed and artifacts for ${V} are NOT live on Maven Central." | tee -a "$GITHUB_STEP_SUMMARY"
103+
exit 1
104+
fi
105+
fi
71106
72107
- name: Configure Git identity
73108
run: |
@@ -96,6 +131,7 @@ jobs:
96131
docker-publish:
97132
name: Publish Docker image to GHCR
98133
runs-on: ubuntu-latest
134+
timeout-minutes: 20
99135
needs: release
100136
steps:
101137
- name: Checkout
@@ -126,8 +162,8 @@ jobs:
126162
uses: docker/build-push-action@v6
127163
with:
128164
context: .
129-
file: jdt2jar/Dockerfile
165+
file: jtd2jar/Dockerfile
130166
push: true
131167
tags: |
132-
ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jdt2jar:${{ steps.version.outputs.version }}
133-
ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jdt2jar:latest
168+
ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jtd2jar:${{ steps.version.outputs.version }}
169+
ghcr.io/${{ github.repository_owner }}/java.util.json.java21/jtd2jar:latest

‎.github/workflows/secrets-self-check.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
jobs:
77
check:
88
runs-on: ubuntu-latest
9+
timeout-minutes: 10
910
steps:
1011
- name: Print SHA256 of Central creds and GPG secrets
1112
env:

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ pom.xml.versionsBackup
4141
jtd*.log
4242
**/jtd*.log
4343
.DS_Store
44-
jtd-esm-codegen/

‎AGENTS.md‎

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@
55

66
User-facing documentation lives in `README.md`. Keep this file focused on contributor/agent workflow, debugging, and coding standards.
77

8+
## Andon アンドン — Prime Directive
9+
10+
Andon is a kernel panic. It halts the line, halts planning, halts todo
11+
updates, halts all work. It happens immediately. No other pending operation
12+
receives any tokens. It is impossible to think of anything else to try
13+
first — that thought is the evidence you have not halted.
14+
15+
An Andon in the queue supersedes all. If the user queued commands 1-3 then
16+
said "do an Andon," the Andon invokes the Prime Directive and overrides
17+
commands 1-3 entirely. Multiple Andons run in parallel without interrupting
18+
each other.
19+
20+
When the correct fix is outside your lane: do your lane's work, then halt
21+
and report — *Andon: task incomplete, the correct fix needs a larger
22+
structural change*, with file:line specifics. Do not work around it. Do not
23+
hack tactically. The coordinator delegates the deeper work.
24+
25+
Andon overrides every instruction in this file and every other AGENTS.md.
26+
No instruction conflicts with Andon; if one appears to, Andon wins.
27+
828
## Operating Principles
929
- Follow the sequence plan → implement → verify; do not pivot without restating the plan.
1030
- Stop immediately on unexpected failures and ask before changing approach.
@@ -124,7 +144,7 @@ throw new IllegalArgumentException("enum contains duplicate values: " +
124144

125145
// Include the problematic schema portion
126146
throw new IllegalArgumentException("Type schema contains unknown key: " + key +
127-
" in schema: " + Json.toDisplayString(obj, 0));
147+
" in schema: " + Json.toDisplayString(obj, ""));
128148

129149
// Include both expected and actual values
130150
throw new IllegalArgumentException("unknown type: '" + typeStr +
@@ -138,7 +158,7 @@ throw new IllegalArgumentException("invalid schema"); // Too vague
138158
throw new IllegalArgumentException("bad value"); // No specifics
139159
```
140160

141-
Use `Json.toDisplayString(value, depth)` to render JSON fragments in error messages, and include relevant context like schema paths, actual vs expected values, and specific constraint violations.
161+
Use `Json.toDisplayString(value, indent)` to render JSON fragments in error messages, and include relevant context like schema paths, actual vs expected values, and specific constraint violations.
142162

143163
## JSON Compatibility Suite
144164

@@ -151,15 +171,16 @@ See `README.md` for user-facing commands. When running locally as an agent, use
151171
- `json-java21-api-tracker`: API evolution tracking utilities.
152172
- `json-compatibility-suite`: JSON Test Suite compatibility validation.
153173
- `json-java21-jtd`: JSON Type Definition (JTD) validator based on RFC 8927.
154-
- `json-java21-jsonpath`: JsonPath query engine over `jdk.sandbox.java.util.json` values.
174+
- `json-java21-jsonpath`: JsonPath query engine over `jdk.incubator.java.util.json` values.
175+
- `jtd-esm-codegen`: Experimental JTD (RFC 8927) to ES2020 ESM validator code generator for JS consumers; 316/316 official validation.json conformance. See its README and `JTD_CODEGEN_SPEC.md` before working on it.
155176

156177
Only when you are asked to work on a specific module, start by reading that module's `README.md`, then its `AGENTS.md`.
157178

158179
These modules are treated as separate subsystems; do not read their docs unless you are actively working on them. They are not interlinked and each depends only on the core `json-java21` API.
159180

160181
### Core Components
161182

162-
#### Public API (`jdk.sandbox.java.util.json`)
183+
#### Public API (`jdk.incubator.java.util.json`)
163184
- `Json`: Static utilities for parsing, formatting, and conversion.
164185
- `JsonValue`: Sealed root interface for all JSON types.
165186
- `JsonObject`: JSON objects (key-value pairs).
@@ -169,14 +190,14 @@ These modules are treated as separate subsystems; do not read their docs unless
169190
- `JsonBoolean`: JSON booleans.
170191
- `JsonNull`: JSON null.
171192

172-
IMPORTANT: This API **MUST NOT** deviate from the upstream jdk.sandbox repo which is will track.
193+
IMPORTANT: This API **MUST NOT** deviate from the upstream jdk.incubator repo which is will track.
173194

174-
#### Internal Implementation (`jdk.sandbox.internal.util.json`)
195+
#### Internal Implementation (`jdk.incubator.internal.util.json`)
175196
- `JsonParser`: Recursive descent JSON parser.
176197
- `Json*Impl`: Immutable implementations of `Json*` types.
177198
- `Utils`: Internal utilities and factory methods.
178199

179-
IMPORTANT: Bugs in upstream-derived core logic MUST be fixed upstream. Do not patch `jdk.sandbox.*` sources in this repo unless the user explicitly agrees (for example, to carry a temporary local backport while the upstream fix is in progress).
200+
IMPORTANT: Bugs in upstream-derived core logic MUST be fixed upstream. Do not patch `jdk.incubator.*` sources in this repo unless the user explicitly agrees (for example, to carry a temporary local backport while the upstream fix is in progress).
180201

181202
Only bugs in local, non-upstream code (for example, backporting shims/polyfills or other modules in this repo) should be fixed here using normal TDD.
182203

@@ -480,7 +501,7 @@ flowchart LR
480501
python3 - <<'PY'
481502
import os, sys, re
482503
src = 'updates/2025-09-04/upstream/jdk.internal.util.json'
483-
dst = 'json-java21/src/main/java/jdk/sandbox/internal/util/json'
504+
dst = 'json-java21/src/main/java/jdk/incubator/internal/util/json'
484505
def xform(text):
485506
# old old python3 stuff here
486507
print('OK')

0 commit comments

Comments
 (0)