Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
0fa84ca
Refresh maintained examples from generator v4.2.0 (qualification cand…
Nov 19, 2026
902040f
Align application creation calls and retained Assist with generator v…
Nov 19, 2026
a8be22c
Keep inherited legacy column mapping in application metadata assembly
Nov 19, 2026
952f770
Regenerate current examples with the qualified generator compatibilit…
Nov 19, 2026
11c664d
Bind the order console to the generator native library coordinate
Nov 19, 2026
c80a5eb
Install generated runtime module in order console
Nov 19, 2026
ef889ac
Bind current examples to one qualified generator source revision
Nov 19, 2026
d905464
Review the canonical total_amount mutation field in the order policy
Nov 19, 2026
da34cfe
Verify canonical KSML relation names in trace and aggregation metadata
Nov 19, 2026
ce0a5ec
Generate current examples with the qualified stable-intent producer
Nov 19, 2026
4aaf420
fix(examples): use canonical Standard Order JSON field
Nov 19, 2026
9a23c75
fix(examples): verify current Java scalar model metadata layout
Nov 19, 2026
7e38436
Place the School lifecycle consumer in generated Java scopes
Nov 20, 2026
932ad87
Record offline School source qualification and two-start business proof
Nov 20, 2026
ce0eec9
Use the generated Java Order workspace with the retained business and…
Nov 20, 2026
c0a1d9a
Record Java Order generated-workspace business qualification
Nov 20, 2026
af7e8b4
Show WorkItem and Spring transaction business through native Java scopes
Nov 20, 2026
77356ae
Record focused java examples/conformance business qualification
Nov 20, 2026
33932f3
Run purchase-order Fix and graph business cases inside native generat…
Nov 20, 2026
7235c28
Record focused java examples/fix-e-alignment business qualification
Nov 20, 2026
a9a15ff
Explain the purchase-order model, native workspace and business verif…
Nov 20, 2026
b6d9f09
Host the nested Catalog validation scenario in its own generated Java…
Nov 20, 2026
8e8e887
Record the independently qualified nested Catalog showcase
Nov 20, 2026
3032bc6
Explain the Catalog model, workspace entry and located validation out…
Nov 20, 2026
87b3225
Give the Java Context Fix child an immutable current domain library a…
Nov 20, 2026
852bca5
Record the independently qualified nested Catalog showcase
Nov 20, 2026
07b1782
Explain the Context-derived Catalog scene and preserved historical ca…
Nov 20, 2026
4c46bb9
Show generated Java procurement order numbering alongside existing ca…
Nov 20, 2026
9aae31a
Record focused java examples/business-id-runtime business qualification
Nov 20, 2026
6cc8596
Run the standard order operations queue in its generated Java workspace
Nov 20, 2026
8499d40
Keep the standard order workspace aligned with the local Maven reacto…
Nov 20, 2026
51c554c
Record focused java examples/standard-order business qualification
Nov 20, 2026
b23be96
Document the current local wire and business verification for the ord…
Nov 20, 2026
578582e
Retain standard order receipts with the canonical Java example inventory
Nov 20, 2026
26f81f6
Run precise settlement quotes in the generated Java workspace
Nov 20, 2026
201f1d0
Record focused java examples/exact-decimal business qualification
Nov 20, 2026
3254d93
Define freight quote and delivery domain model for Java
Nov 20, 2026
8012515
Demonstrate exact Java freight quotes in a generated workspace
Nov 20, 2026
a5e09f0
Record focused java examples/scalar-type-probe business qualification
Nov 20, 2026
c78341b
Run the TraceChain test fixture in the generated console workspace
Nov 20, 2026
175650a
Identify each normative order graph in the restart evidence
Nov 20, 2026
ba9cf81
Record focused java examples/trace-chain business qualification
Nov 20, 2026
b0a5493
File and retrieve an order receipt in the Java model workspace
Nov 20, 2026
95c0976
Use the source S3 provider namespace in the Java order workspace
Nov 20, 2026
efd0e02
Record focused java examples/object-storage business qualification
Nov 20, 2026
dcee386
Document the order receipt workspace and failure checks
Nov 20, 2026
b4dcf30
Run academy inheritance in its model and application workspace
Nov 20, 2026
26d4aaa
Wire school record projection to generated native scopes
Nov 20, 2026
b2d9c25
Use a relocatable reactor for school projection verification
Nov 20, 2026
8649902
Record focused java examples/inheritance-save business qualification
Nov 20, 2026
80bb99c
Record focused java examples/shared-load-state business qualification
Nov 20, 2026
c594573
Document the academy and school record workspace scenarios
Nov 20, 2026
5a93937
Qualify persisted Java order edits through scoped references
Nov 20, 2026
163cd90
Resolve the Java reference workspace against local reactor versions
Nov 20, 2026
3677fd0
Record focused java examples/round-trip-reference-runtime business qu…
Nov 20, 2026
1ca62c8
Synchronize persisted supplier orders through the Java HTTP Context
Nov 20, 2026
ccf0438
Record focused java examples/http-resilience business qualification
Nov 20, 2026
da876a0
Document supplier reconciliation and the original HTTP calibrations
Nov 20, 2026
b1ecdce
Model the pending order access and protocol showcases
Nov 20, 2026
dfc483a
Decide reconciliation from the actual supplier reply
Nov 20, 2026
bef2ed9
Record focused java examples/http-resilience business qualification
Nov 20, 2026
cc8d0e9
Demonstrate governed merchant order lookup and diagnostics in Java
Nov 20, 2026
742b0f7
Record focused java examples/security-foundations business qualification
Nov 20, 2026
2030055
Qualify Java example artifacts from the Maven repository that install…
Nov 20, 2026
3126490
Use only the sibling Maven domain library in Java example workspaces
Nov 20, 2026
cc75934
Build Java examples against the sibling Maven module from Make
Nov 20, 2026
d9525bc
Verify the Java decimal workspace against its single domain module
Nov 20, 2026
c670c65
Retain all main scalar regression gates during workspace migration (#…
Nov 23, 2026
2ab31da
Prime standalone console dependencies before offline examples (#290)
Nov 23, 2026
5f37b7e
Merge Java main after supplier onboarding integration (#290)
Nov 23, 2026
a8d9f22
Prime the standalone order attachment reactor before offline verifica…
Nov 23, 2026
026b934
Keep the current Hutool security pin in the moved Java workspaces (#290)
Nov 23, 2026
cb7225c
Merge Java main after Secret Provider integration (#290)
Nov 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: SpotBugs Check
# Generated examples are verified by the dedicated Example Gate. They
# intentionally do not inherit the runtime's SpotBugs build plugin.
run: mvn spotbugs:check -pl '!examples/conformance/lib,!examples/conformance'
run: mvn spotbugs:check -pl '!examples/conformance/java-lib-core/lib,!examples/conformance/java-app-console'
- name: Verify trusted snapshot selection policy
run: node --test .github/scripts/select-odc-snapshot.test.cjs
- name: Verify snapshot freshness policy
Expand Down Expand Up @@ -88,10 +88,10 @@ jobs:
-Dformats=HTML,JSON
- name: OWASP Dependency Check standalone generated examples
run: |
mvn -B -f examples/school-management/lib/pom.xml install -DskipTests
mvn -B -f examples/school-management/java-lib-core/lib/pom.xml install -DskipTests
for pom in \
examples/school-management/lib/pom.xml \
examples/school-management/pom.xml \
examples/school-management/java-lib-core/lib/pom.xml \
examples/school-management/java-app-console/pom.xml \
examples/order-management/java-lib-core/lib/pom.xml; do
mvn -B -f "$pom" org.owasp:dependency-check-maven:13.0.0:check \
-DdataDirectory=${{ runner.temp }}/teaql-odc-data \
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/example-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jobs:
# Keep its offline checks; prepare a fresh runner before they start.
run: |
mvn -B -ntp install
# These standalone console dependencies are absent from generated
# library manifests and are used by the offline workspace checks.
for artifact in com.zaxxer:HikariCP:6.3.0 org.mybatis:mybatis:3.5.19 org.codehaus.mojo:exec-maven-plugin:3.5.0; do
mvn -B -ntp org.apache.maven.plugins:maven-dependency-plugin:3.8.1:get "-Dartifact=$artifact"
done
node <<'NODE'
const fs = require('node:fs'), path = require('node:path'), os = require('node:os'), cp = require('node:child_process');
const runtime = process.cwd(), owned = fs.mkdtempSync(path.join(os.tmpdir(), 'teaql-ci-example-dependencies-'));
Expand All @@ -88,6 +93,20 @@ jobs:
cp.execFileSync('mvn', ['-B', '-ntp', '-f', selected,
'org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline'], {stdio: 'inherit'});
}
// Resolve the standalone console reactor's actual mediated runtime
// dependencies. Dependency go-offline alone visits a different
// Netty version through this workspace's Spring/AWS dependency graph.
const attachmentSource = path.join(runtime, 'examples/object-storage');
const attachment = path.join(owned, 'order-attachment-workspace');
fs.mkdirSync(attachment);
fs.copyFileSync(path.join(attachmentSource, 'workspace-pom.xml'), path.join(attachment, 'pom.xml'));
for (const role of ['java-lib-core', 'java-app-console']) {
fs.cpSync(path.join(attachmentSource, role), path.join(attachment, role), {
recursive: true, filter: file => path.basename(file) !== 'target',
});
}
cp.execFileSync('mvn', ['-B', '-ntp', '-f', path.join(attachment, 'pom.xml'),
'-DskipTests', 'install'], {stdio: 'inherit'});
} finally {
fs.rmSync(owned, {recursive: true});
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
fi
- name: Publish all Maven modules
if: github.event_name == 'push'
run: mvn -B deploy -DskipTests -pl '!examples/conformance/lib,!examples/conformance'
run: mvn -B deploy -DskipTests -pl '!examples/conformance/java-lib-core/lib,!examples/conformance/java-app-console'
env:
TEAQL_MAVEN_USERNAME: ${{ secrets.TEAQL_MAVEN_USERNAME }}
TEAQL_MAVEN_PASSWORD: ${{ secrets.TEAQL_MAVEN_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ own Java APIs.
These application-code excerpts assume the example's generated imports, trusted
Context and an existing object identity. `Q` and `E` belong to the generated
domain library, not a generic runtime object with arbitrary field strings.
See the [application source](examples/school-management/src/main/java/com/example/schoolmanagementservice/SchoolLifecycleVerifier.java) for complete setup.
See the [application source](examples/school-management/java-app-console/src/main/java/com/example/schoolmanagementservice/SchoolLifecycleVerifier.java) for complete setup.

```java
var schoolTypeDetails = Q.schoolTypesWithMinimalFields().selectCode();
Expand Down
10 changes: 9 additions & 1 deletion examples/business-id-runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Business ID focused runtime example
# Number two procurement orders

`model.xml` defines the purchase order and its `ORD` Business ID.
`java-lib-core/` contains the generated domain library. The console at
`java-app-console/src/main/java/com/teaql/purchaseordernumbering/App.java` installs the trusted business clock and SQLite allocator,
records two orders, retries the first, and reads both back by number.
It rejects a blank audit reason and verifies the denied order is absent.

## Allocator and live-dialect calibration

This example verifies the Java runtime Business ID boundary without running
the full multi-module regression suite. It covers the default six-character
Expand Down
53 changes: 53 additions & 0 deletions examples/business-id-runtime/java-app-console/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

*.gz
target/

### IntelliJ IDEA ###
.idea/*
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/dist/
/nbdist/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

*.class
*.log
*.contextt
.mtj.tmp/
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
hs_err_pid*
replay_pid*
66 changes: 66 additions & 0 deletions examples/business-id-runtime/java-app-console/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!-- DISCARD_BLOCK: phase_modeling -->

# TeaQL Java Agent Instructions

## TeaQL workspace rules

- Work in application-owned files. Keep the generated domain library read-only.
- Discover API names and signatures through model-aware Assist only.
Do not read or search generated library source for API discovery. Use the
original evaluated KSML file or directory and its exact entity and field names.
- Ask for the current entity and action first. Request field-level query help
only for the fields you use. If Assist lacks the operation, report
`MISSING_ASSIST` with the entity, action, and relevant field or diagnostic.

```text
cargo teaql --input [model] java-assist-[action]/[entity]
cargo teaql --input [model] java-assist-query/[entity].[field]
```

Replace the bracketed values with the actual model path, action, entity, and
field. Actions include `query`, `list-page`, `create`, `update`, `delete`, and
`expression`. Validate API usage by compiling and testing the application.

- Use the trusted `UserContext` as the only runtime argument for generated query
execution and saves. Resolve tenant, actor, authorization, and provider
resources from trusted application setup.
- Keep queries bounded and provide a non-empty purpose and comment. Supply a
non-empty audit reason for writes through the API shown by Assist.

> [!WARNING]
> **IGNORE GENERIC ORM EXPERIENCE**
>
> Do **not** use pre-trained habits from data-access frameworks, ORMs, or database integration libraries.
>
> Do **not** use MyBatis, JPA, Hibernate, Spring Data, MyBatis-Plus, or similar frameworks.
>
> Do **not** write raw SQL, DAOs, Repository implementations, or custom persistence layers.
>
> Do **not** guess TeaQL method names.

## Model entities

| entity-name | display-name |
|-------------|--------------|
| platform | platform |
| purchase_order | purchase_order |


## Application entry and context

Start in `App.java` under `src/main/java`. The console assembles the
`TeaQLRuntime` and creates its `UserContext` with `new CustomUserContext(runtime)`.

## Additional References

Read these only when the task requires them:

* **`TOOL_API_GUIDE.md`**
Framework runtime references and context handling.

* **`RUNTIME_CUSTOM_GUIDE.md`**
Runtime setup, debugging, and project-specific restrictions.

## Optional standard telemetry

See [STANDARD_TELEMETRY.md](STANDARD_TELEMETRY.md) for the selected runtime's optional module, trusted activation variables and safe startup diagnostics.
29 changes: 29 additions & 0 deletions examples/business-id-runtime/java-app-console/DOMAIN_API_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

**ATTENTION AI AGENTS:** Do not guess TeaQL API methods! To get the exact API usage and query examples for the entity you are working on, you must fetch the dynamically generated prompt directly from the code generation server. Use your tools to execute the following command to download the exact contextual prompt for the entity:

```bash
cargo teaql --input models/purchase-order-numbering.xml java-assist-[action]/[entity-name]
```

Replace `[entity-name]` with the exact entity-name of the entity.

**Available candidate entities in this model:**

| entity-name | display-name |
|-------------|--------------|
| platform | platform |
| purchase_order | purchase_order |


Replace `[action]` with one of the following depending on what you are trying to write:

| action | when-to-use |
|--------|-------------|
| query | You need to read/find records from the database using Q:: |
| create | You need to insert a new record into the database |
| update | You need to modify and save an existing record |
| delete | You need to remove or soft-delete a record |
| expression | You need to safely extract nested relation values (avoiding null panics) using the E:: facade |
| list-page | You need to implement a paginated query returning a SmartList |

Once the command succeeds, read its output. Use the printed code as a template to write your logic.
32 changes: 32 additions & 0 deletions examples/business-id-runtime/java-app-console/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# TEAQL WARNING: This project uses TeaQL. TeaQL was explicitly designed to PREVENT AI hallucinations and random guessing.
# AI AGENTS MUST STRICTLY USE THESE MAKE TARGETS ONLY. Do NOT guess other build commands.

.PHONY: build test run clean help generate-lib

# Default target
help:
@echo "Available commands:"
@echo " make generate-lib - Regenerate the TeaQL domain library"
@echo " make build - Build the Java console application (mvn clean package)"
@echo " make test - Run application tests (mvn test)"
@echo " make run - Run the application locally (java -jar target/purchase-order-numbering-0.0.1-SNAPSHOT.jar)"
@echo " make clean - Clean the project"

generate-lib:
@echo "Regenerating TeaQL library..."
./gen-lib.sh || echo "Please ensure gen-lib.sh exists or run teaql code generator manually"

build:
mvn -f ../java-lib-core/lib/pom.xml install -DskipTests
mvn clean package -DskipTests

test:
mvn -f ../java-lib-core/lib/pom.xml install -DskipTests
mvn test

run: build
java -jar target/purchase-order-numbering-0.0.1-SNAPSHOT.jar

clean:
mvn clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# TeaQL Runtime Customization Guide

This is a plain Java console application. `App.main()` creates and closes the Hikari
DataSource, wraps it with `JdbcSqlExecutor`, and manually assembles `TeaQLRuntime.builder()`.
The generated runtime module installs metadata and runtime services; `CustomUserContext`
is then created explicitly and `context.ensureSchema()` initializes the database.

Run `make run` to install the generated library, package the application, and launch it.
Configuration is loaded from `src/main/resources/application.properties`. Override values
with JVM properties or `--teaql.datasource.url=jdbc:...` command-line arguments.
Server database credentials use `TEAQL_DATABASE_USERNAME` and `TEAQL_DATABASE_PASSWORD`.
Keep business operations in the generated Q/E APIs and audited entity saves.

> [!WARNING]
> **DO NOT GUESS RUNTIME CONFIGURATION**
> Do not guess how to configure the runtime, connection pools, or schema generation.

To get the exact usage and examples for Customizing the Runtime (UserContext assembly, SQL debugging, Schema modes), you must fetch the dynamically generated prompt directly from the code generation server. Use your tools to execute the following command:

```bash
cargo teaql --input models/purchase-order-numbering.xml java-assist-runtime-custom
```

Once the command succeeds, read its output. Use the printed code as a template to write your logic.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Standard OpenTelemetry module

Use the optional standard module supplied by the selected TeaQL runtime. Match
its version to the runtime dependency selected by the model and workspace;
keep local source or internal Registry overrides during development. Do not
upgrade to an unrelated public release just to enable telemetry. A runtime
without this module reports `module_unavailable`; package installation alone
does not enable export.

On a supported backend, configure these trusted process variables before startup, never
through a query, JSON or TFP payload:

```bash
export TEAQL_TELEMETRY_ENABLED=true
export TEAQL_TELEMETRY_SERVICE_NAME=payment-service
export TEAQL_TELEMETRY_OTLP_ENDPOINT=http://localhost:4318
```

Without enablement, startup reports `disabled` and all three activation variables;
no SDK export resources are created. Enabled startup reports safe effective
settings, full recording and masking. Invalid settings produce a fixed safe
diagnostic, not a claim of successful export. Never print credentials or raw
configuration values.

The module automatically records supported Q, graph mutation and physical SQL
operations as traces, logs and metrics. SQL is expanded with masked parameters;
plaintext debugging never authorizes plaintext telemetry export. Full recording
does not promise lossless delivery when bounded queues or exporters fail.
Do not add per-method spans or replace the customer's global SDK providers.

Keep schema reconciliation explicit. Run the generated ensure-schema and seed
flow through the same configured runtime to observe startup settings and audited,
idempotent seeding. Telemetry setup must not run ensure-schema implicitly.
Flush and shut down the owned pipeline at application shutdown, not per query.
Exporter failures do not change business results; durable business audit remains
an independent path.


### Java assembly

Add the optional Maven artifact `io.teaql:teaql-opentelemetry` to the application,
using the exact same version as its TeaQL runtime dependency. Keep it out of the
generated domain library's mandatory dependencies. TeaQLRuntime discovers the
module through ServiceLoader at startup; no application SDK initialization is
required. Set the three variables before starting the JVM.
31 changes: 31 additions & 0 deletions examples/business-id-runtime/java-app-console/TOOL_API_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# TeaQL Tool & Runtime API Reference

> [!WARNING]
> **DO NOT GUESS FRAMEWORK APIS**
> Do not guess how to use `UserContext`, `SmartList`, `WebResponse`, or how to manage transactions.

> [!IMPORTANT]
> **USE TEAQL'S OWN TOOLING FIRST**
> Always use `cargo teaql` to retrieve assist content. Never bypass the CLI or invoke the generator endpoint directly.

To get the exact API usage and examples for Framework-level APIs (UserContext, SmartList, WebResponse, Entity Expression, Checkers, etc.), you must fetch the dynamically generated prompt directly from the code generation server. Use your tools to execute the following command:

```bash
cargo teaql --input models/purchase-order-numbering.xml java-assist-tool-api
```

Once the command succeeds, read its output. Use the printed code as a template to write your logic.

## Domain Object Assist APIs

If you need reference code or tool APIs specifically tailored for your domain objects (e.g., `user`, `order`), TeaQL provides code generators that yield perfect, ready-to-copy Java code snippets.

You can query these assist APIs for any object defined in your `models/purchase-order-numbering.xml`:

| Target | Description | Example Command |
|--------|-------------|-----------------|
| `java-assist-query/[object]` | How to query and filter `[object]` | `cargo teaql --input models/purchase-order-numbering.xml java-assist-query/school` |
| `java-assist-create/[object]` | How to insert/create `[object]` | `cargo teaql --input models/purchase-order-numbering.xml java-assist-create/school` |
| `java-assist-update/[object]` | How to update `[object]` | `cargo teaql --input models/purchase-order-numbering.xml java-assist-update/school` |
| `java-assist-delete/[object]` | How to delete `[object]` | `cargo teaql --input models/purchase-order-numbering.xml java-assist-delete/school` |
Loading
Loading