You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add json-java21-jsonpath module implementing JsonPath query engine
Implements JsonPath query language for the java.util.json backport based on
Stefan Goessner's specification (https://goessner.net/articles/JsonPath/).
Features:
- Parses JsonPath expressions to AST (sealed interface + records)
- Evaluates AST against JsonValue documents from core library
- No external dependencies (java.base only)
- Java 21 functional style (immutable records, pattern matching)
- Pure TDD development with 76 comprehensive tests
Supported operators:
- Root ($), property access (.name, ['name'])
- Array index ([n], [-1]), slice ([:2], [0:10:2])
- Wildcard ([*], .*), recursive descent (..)
- Union ([0,1], ['a','b'])
- Filter expressions ([?(@.isbn)], [?(@.price<10)])
- Script expressions ([(@.length-1)])
All examples from Goessner article implemented as tests.
To verify:
mvn test -pl json-java21-jsonpath -Djava.util.logging.ConsoleHandler.level=INFO
* Add fluent API: JsonPath.parse(...).select(...)
Adds alternative API style for JsonPath queries:
- JsonPath.parse(expr) returns a compiled JsonPath
- .select(json) evaluates against a document
- Compiled paths are reusable across multiple documents
- Retains original JsonPath.query(expr, json) as convenience method
Tests verify:
- parse(...).select(...) returns same results as query(...)
- Compiled paths can be reused on different documents
- expression() accessor returns original path string
To verify: mvn test -pl json-java21-jsonpath
* Issue #126 Simplify JsonPath docs and use mvnw
Promote json-java21-jsonpath docs to README.md and keep it focused on public usage (Goessner spec + basic examples). Update human READMEs to use ./mvnw (with -am when selecting modules) and add a top-level JsonPath pointer.\n\nVerify: ./mvnw test -pl json-java21-jsonpath -am -Djava.util.logging.ConsoleHandler.level=INFO
* Issue #127 JsonPath logical filters and parse error tests
Extend filter parsing to support !, &&, || (with parentheses) and treat bare @ as the current node. Add targeted parser/integration tests plus JsonPathParseException formatting assertions.\n\nVerify: ./mvnw -pl json-java21-jsonpath -am clean test -Djava.util.logging.ConsoleHandler.level=INFO
* Issue #127 Add JsonPathFilterEvaluationTest to prove logical operator robustness on varying inputs
* Fix JsonPathFilterEvaluationTest to use correct value comparison for false
Corrected !@.prop usage: it means 'property does not exist'. To check for a false boolean value, explicit comparison @.prop == false is required. Updated testComplexNestedLogic to reflect this.
* Replace stored expression string with AST reconstruction in JsonPath
Removed stored path string to save memory. Implemented toString() to reconstruct the path from the AST. Updated usage and tests.
* Issue #129 Add JsonPathStreams helpers and stream aggregation docs
Add JsonPathStreams predicates/converters (strict and OrNull), document stream-based aggregation in json-java21-jsonpath/README.md, and bump AssertJ minimum to 3.27.7 in parent pom.
How to test: ./mvnw test -pl json-java21-jsonpath -am -Djava.util.logging.ConsoleHandler.level=INFO
* Issue #129 Bump CI expected test count
* Issue #129 Tighten JsonPath docs and fix reverse slices
* Issue #129 Expand README JsonPath example
* Issue #129 Keep README user-facing; move agent rules to AGENTS
* Issue #129 Keep templates user-focused; AGENTS for contributors
* Issue #129 Clarify invasive change guidance
* Issue #129 Clarify mvn wrapper policy in AGENTS
* Issue #129 Document jsonpath module and module doc policy
* Issue #129 Clarify upstream bugfix policy
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ assignees: ""
9
9
10
10
(Optional) When submitting an Issue, please consider using a "deep research" tool to sanity check your proposal. Then **before** submission, run your draft through a strong model with a prompt such as:
11
11
12
-
> "Please review the AGENTS.md and README.md along with this draft Issue and check that it does not have any gaps — why it might be insufficient, incomplete, lacking a concrete example, duplicating prior issues or PRs, or not be aligned with the project goals or non‑goals."
12
+
> "Please review README.md along with this draft Issue and check that it does not have any gaps — why it might be insufficient, incomplete, lacking a concrete example, duplicating prior issues or PRs, or not be aligned with the project goals or non‑goals."
13
+
14
+
If you used an AI assistant while preparing this Issue, ensure it followed the contributor/agent workflow rules in `AGENTS.md`.
13
15
14
16
(Optional) Please then attach both the prompt and the model's review to the bottom of this template under "Augmented Intelligence Review".
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/bug_report.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ assignees: ''
9
9
10
10
(Optional) When submitting a bug report, please consider using an AI assistant to help create a minimal test case that demonstrates the issue. Then **before** submission, run your bug description through a strong model with a prompt such as:
11
11
12
-
> "Please review the AGENTS.md and README.md along with this bug report and check that it includes: a clear description of the problem, steps to reproduce, expected vs actual behavior, and a minimal test case that demonstrates the bug."
12
+
> "Please review README.md along with this bug report and check that it includes: a clear description of the problem, steps to reproduce, expected vs actual behavior, and a minimal test case that demonstrates the bug."
13
+
14
+
If you used an AI assistant while preparing this report, ensure it followed the contributor/agent workflow rules in `AGENTS.md`.
13
15
14
16
(Optional) Please then attach both the prompt and the model's review to the bottom of this template under "Augmented Intelligence Review".
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/custom.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,9 @@ assignees: ''
9
9
10
10
(Optional) When submitting this issue, please consider using an AI assistant to help analyze and articulate the problem. Then **before** submission, run your issue description through a strong model with a prompt such as:
11
11
12
-
> "Please review the AGENTS.md and README.md along with this issue description and check that it: clearly explains the problem or request, provides sufficient context, includes relevant details, and aligns with project standards."
12
+
> "Please review README.md along with this issue description and check that it: clearly explains the problem or request, provides sufficient context, includes relevant details, and aligns with project standards."
13
13
14
-
(Optional) Please then attach both the prompt and the model's review to the bottom of this template under "Augmented Intelligence Review".
14
+
If you used an AI assistant while preparing this issue, ensure it followed the contributor/agent workflow rules in `AGENTS.md`.
15
15
16
+
(Optional) Please then attach both the prompt and the model's review to the bottom of this template under "Augmented Intelligence Review".
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/feature_request.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ assignees: ''
9
9
10
10
(Optional) When submitting a feature request, please consider using an AI assistant to validate your implementation approach. Then **before** submission, run your feature description through a strong model with a prompt such as:
11
11
12
-
> "Please review the AGENTS.md and README.md along with this feature request and check that it: aligns with project goals, doesn't duplicate existing functionality, includes concrete use cases, and suggests a reasonable implementation approach."
12
+
> "Please review README.md along with this feature request and check that it: aligns with project goals, doesn't duplicate existing functionality, includes concrete use cases, and suggests a reasonable implementation approach."
13
+
14
+
If you used an AI assistant while preparing this request, ensure it followed the contributor/agent workflow rules in `AGENTS.md`.
13
15
14
16
(Optional) Please then attach both the prompt and the model's review to the bottom of this template under "Augmented Intelligence Review".
Copy file name to clipboardExpand all lines: .github/pull_request_template.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
2
-
(Optional) When submitting an PR, please consider using a "deep research" tool to sanity check your proposal. Then **before** submission, run your draft through a strong model with a prompt such as:
2
+
(Optional) When submitting a PR, please consider using a "deep research" tool to sanity check your proposal. Then **before** submission, run your draft through a strong model with a prompt such as:
3
3
4
-
> "Please review the AGENTS.md and README.md along with this draft PR and check that it does not have any gaps — why it might be insufficient, incomplete, lacking a concrete example, duplicating prior issues or PRs, or not be aligned with the project goals or non‑goals."
4
+
> "Please review README.md along with this draft PR and check that it does not have any gaps — why it might be insufficient, incomplete, lacking a concrete example, duplicating prior issues or PRs, or not be aligned with the project goals or non‑goals."
5
+
6
+
If you used an AI assistant while preparing this PR, ensure it followed the contributor/agent workflow rules in `AGENTS.md`.
5
7
6
8
(Optional) Please then attach both the prompt and the model's review to the bottom of this template under "Augmented Intelligence Review".
7
9
@@ -28,4 +30,3 @@
28
30
29
31
**(Optional) Augmented Intelligence Review**:
30
32
*Both prompt and model out, asking a strong model to double-check your submission, from the perspective of a maintainer of this repo*
Copy file name to clipboardExpand all lines: AGENTS.md
+20-44Lines changed: 20 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,13 @@
3
3
## Purpose & Scope
4
4
- Operational guidance for human and AI agents working in this repository. This revision preserves all existing expectations while improving structure and wording in line with agents.md best practices.
5
5
6
+
User-facing documentation lives in `README.md`. Keep this file focused on contributor/agent workflow, debugging, and coding standards.
7
+
6
8
## Operating Principles
7
9
- Follow the sequence plan → implement → verify; do not pivot without restating the plan.
8
10
- Stop immediately on unexpected failures and ask before changing approach.
9
11
- Keep edits atomic and avoid leaving mixed partial states.
10
-
-Propose jsonSchemaOptions with trade-offs before invasive changes.
12
+
-You SHOULD discuss trade-offs before making invasive changes to existing code.
11
13
- Prefer mechanical, reversible transforms (especially when syncing upstream sources).
12
14
- Validate that outputs are non-empty before overwriting files.
13
15
- Minimal shims are acceptable only when needed to keep backports compiling.
@@ -39,13 +41,13 @@ When making changes, always update documentation files before modifying code.
39
41
40
42
### Non-Negotiable Rules
41
43
- You MUST NOT ever filter test output; debugging relies on observing the unknown.
42
-
- You MUST restrict the amount of tokens by adding logging at INFO, FINE, FINER, and FINEST. Focus runs on the narrowest model/test/method that exposes the issue.
44
+
- You MUST keep debug output actionable by using JUL levels (INFO/FINE/FINER/FINEST) and running the narrowest test/class/module that reproduces the issue.
43
45
- You MUST NOT add ad-hoc "temporary logging"; only the defined JUL levels above are acceptable.
44
46
- You SHOULD NOT delete logging. Adjust levels downward (finer granularity) instead of removing statements.
45
47
- You MUST add a JUL log statement at INFO level at the top of every test method announcing execution.
46
48
- You MUST have all new tests extend a helper such as `JsonSchemaLoggingConfig` so environment variables configure JUL levels compatibly with `$(command -v mvnd || command -v mvn || command -v ./mvnw)`.
47
49
- You MUST NOT guess root causes; add targeted logging or additional tests. Treat observability as the path to the fix.
48
-
-YOU MUST Use exactly one logger for the JSON Schema subsystem and use appropriate logging to debug as below.
50
+
- Use a single shared logger per subsystem/package and use appropriate JUL levels to debug.
49
51
- YOU MUST honour official JUL logging levels:
50
52
- SEVERE (1000): Critical errors—application will likely abort.
51
53
- WARNING (900): Indications of potential problems or recoverable issues.
@@ -57,7 +59,8 @@ When making changes, always update documentation files before modifying code.
57
59
58
60
### Run Tests With Valid Logging
59
61
60
-
- You MUST prefer the `$(command -v mvnd || command -v mvn || command -v ./mvnw)` wrapper for every Maven invocation.
62
+
- For agent/local development, prefer `$(command -v mvnd || command -v mvn || command -v ./mvnw)` to automatically pick the fastest available tool.
63
+
- User-facing documentation MUST only use the top-level `./mvnw` command.
61
64
- You MUST pass in a `java.util.logging.ConsoleHandler.level` of INFO or more low-level.
62
65
- You SHOULD run all tests in all models or a given `-pl mvn_moduue` passing `-Djava.util.logging.ConsoleHandler.level=INFO` to see which tests run and which tests might hang
63
66
- You SHOULD run a single test class using `-Dtest=BlahTest -Djava.util.logging.ConsoleHandler.level=FINE` as fine will show you basic debug info
IMPORTANT: Fix the method with FINEST logging, then fix the test class with FINER logging, then fix the module with FINE logging, then run the whole suite with INFO logging. THERE IS NO TRIVIAL LOGIC LEFT IN THIS PROJECT TO BE SYSTEMATIC.
85
+
IMPORTANT: Fix the method with FINEST logging, then fix the test class with FINER logging, then fix the module with FINE logging, then run the whole suite with INFO logging.
83
86
84
87
### Output Visibility Requirements
85
88
86
89
- You MUST NEVER pipe build or test output to tools (head, tail, grep, etc.) that reduce visibility. Logging uncovers the unexpected; piping hides it. Use the instructions above to zoom in on what you want to see using `-Dtest=BlahTest` and `-Dtest=BlahTest#testSomething` passing the appropriate `Djava.util.logging.ConsoleHandler.level=XXX` to avoid too much outputs
87
90
- You MAY log full data structures at FINEST for deep tracing. Run a single test method at that granularity.
88
91
- If output volume becomes unbounded (for example, due to inadvertent infinite loops), this is the only time head/tail is allowed. Even then, you MUST inspect a sufficiently large sample (thousands of lines) to capture the real issue and avoid focusing on Maven startup noise.
89
-
-My time is far more precious than yours do not error on the side of less information and thrash around guessing. You MUST add more logging and look harder!
92
+
-Avoid guessing. Add targeted logging or additional tests until the failing case is fully observable.
90
93
- Deep debugging employs the same FINE/FINEST discipline: log data structures at FINEST for one test method at a time and expand coverage with additional logging or tests instead of guessing.
91
94
92
95
### Logging Practices
93
96
- JUL logging is used for safety and performance. Many consumers rely on SLF4J bridges and search for the literal `ERROR`, not `SEVERE`. When logging at `SEVERE`, prefix the message with `ERROR` to keep cloud log filters effective:
94
97
95
98
```java
96
-
LOG.severe(() ->"ERROR: Remote references disabled but computeIfAbsent called for: "+key);
99
+
LOG.severe(() ->"ERROR: "+message);
97
100
```
98
101
99
102
- Only tag true errors (pre-exception logging, validation failures, and similar) with the `ERROR` prefix. Do not downgrade log semantics.
@@ -138,14 +141,8 @@ throw new IllegalArgumentException("bad value"); // No specifics
138
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.
-`json-java21-api-tracker`: API evolution tracking utilities.
155
152
-`json-compatibility-suite`: JSON Test Suite compatibility validation.
156
153
-`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.
155
+
156
+
Only when you are asked to work on a specific module, start by reading that module's `README.md`, then its `AGENTS.md`.
157
+
158
+
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.
157
159
158
160
### Core Components
159
161
@@ -174,7 +176,9 @@ IMPORTANT: This API **MUST NOT** deviate from the upstream jdk.sandbox repo whic
174
176
-`Json*Impl`: Immutable implementations of `Json*` types.
175
177
-`Utils`: Internal utilities and factory methods.
176
178
177
-
IMPORTANT: Bugs in the main logic this code cannot be fixed in this repo they **MUST** be fixed upstream. Only bugs in any backporting machinery such as the double-check-locking class that is a polyfill for a future JDK `@StableValue` feature may be fixed in this repo.
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).
180
+
181
+
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.
178
182
179
183
### Design Patterns
180
184
- Algebraic Data Types: Sealed interfaces enable exhaustive pattern matching.
@@ -202,35 +206,7 @@ IMPORTANT: Bugs in the main logic this code cannot be fixed in this repo they **
202
206
203
207
## Common Workflows
204
208
205
-
### API Compatibility Testing
206
-
1. Run the compatibility suite: `mvn exec:java -pl json-compatibility-suite`.
207
-
2. Inspect reports for regressions relative to upstream expectations.
208
-
3. Validate outcomes against the official JSON Test Suite.
- Automatically downloads the JSON Test Suite from GitHub.
219
-
- Surfaces known vulnerabilities (for example, StackOverflowError under deep nesting).
220
-
- Intended for education and testing, not production deployment.
221
-
222
-
### json-java21-api-tracker
223
-
- Tracks API evolution and compatibility changes.
224
-
- Uses Java 24 preview features (`--enable-preview`).
225
-
- Runner: `io.github.simbo1905.tracker.ApiTrackerRunner` compares the public JSON API (`jdk.sandbox.java.util.json`) with upstream `java.util.json`.
226
-
- Workflow fetches upstream sources, parses both codebases with the Java compiler API, and reports matching/different/missing elements across modifiers, inheritance, methods, fields, and constructors.
227
-
- Continuous integration prints the report daily. It does not fail or open issues on differences; to trigger notifications, either make the runner exit non-zero when `differentApi > 0` or parse the report and call `core.setFailed()` within CI.
228
-
229
-
### json-java21-jtd (JTD Validator)
230
-
- JSON Type Definition validator implementing RFC 8927 specification.
231
-
- Provides eight mutually-exclusive schema forms for simple, predictable validation.
232
-
- Uses stack-based validation with comprehensive error reporting.
233
-
- Includes full RFC 8927 compliance test suite.
209
+
Prefer linking to `README.md` for stable, user-facing workflows and module descriptions. Keep this file focused on agent execution details.
0 commit comments