Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2025-2026 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

root = true

[*]
Expand All @@ -9,3 +23,6 @@ indent_size = 4

[*.{xml,yml,yaml}]
indent_size = 2

[*.java]
indent_style = tab
35 changes: 35 additions & 0 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Copyright 2024-2026 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: 🗒️ License Check
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
license-check:
if: (github.repository == 'agentic-ai-java/argi-example')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./tools/github-actions/setup-deps
- run: make tools
- run: make licenses-check
37 changes: 37 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# Copyright 2024-2026 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: 👀 Linter
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
linter:
if: (github.repository == 'agentic-ai-java/argi-example')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./tools/github-actions/setup-deps
- run: make tools
- run: make lint
34 changes: 34 additions & 0 deletions .github/workflows/secret-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Copyright 2024-2026 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: 🗝️ Secrets Check
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
secret-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./tools/github-actions/setup-deps
- run: make tools
- run: make secrets-check
39 changes: 31 additions & 8 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
name: Verify examples
# Copyright 2025-2026 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 🛠️ Build Examples
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: examples
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: agentic-ai-java/argi
ref: f61a477220b9caec4d63b9469dbab5877eff1df9
ref: 5ec935b384d5379324ee60277ddcd3a6683a861f
path: argi
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: agentic-ai-java/argi-extensions
ref: 84994ebb71374ebc3dea688ae7f81360934313f9
Expand All @@ -33,9 +50,15 @@ jobs:
- name: Install pinned source dependencies
working-directory: examples
run: bash tools/bootstrap.sh
- name: Verify examples without external services
- name: Check Java formatting
working-directory: examples
run: bash tools/mvn.sh -B verify
run: make format-check
- name: Check Java style
working-directory: examples
run: make checkstyle-check
- name: Compile examples without external services
working-directory: examples
run: bash tools/mvn.sh -B -Dmaven.test.skip=true package
- name: Compile every backend profile
working-directory: examples
shell: bash
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

- Communicate with the user in Chinese. Write Java, comments, configuration descriptions, and documentation in English.
- The sibling `demo` repository is a directory and Maven-layout reference only. Do not read or copy its application code.
- Use `website/docs` as the scenario inventory; resolve outdated package names and APIs against `argi` and `argi-extensions` source.
- Use `argi-website/docs` as the scenario inventory; resolve outdated package names and APIs against `argi` and `argi-extensions` source.
- Keep every example as a named Maven module with a real entry point, a README, prerequisites, and expected behavior.
- Do not start Docker, OrbStack, databases, registries, or model services to work on this repository.
- Do not execute examples or integration tests unless the user explicitly asks. Static catalog and source checks are safe.
- These are teaching examples. Do not add test suites, test-only dependencies or coverage gates; validate by compiling and inspecting executable entry points.
- Do not execute examples unless the user explicitly asks. Static catalog and source checks are safe.
- Never embed credentials. Model and service configuration comes from environment variables.
- Avoid provider SDK objects in checkpoint state; use ARGI messages or ordinary data.
- Use lightweight local observation. Do not add a Prometheus or OpenTelemetry deployment.
Expand Down
37 changes: 34 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
.PHONY: catalog bootstrap compile verify install
# Copyright 2025-2026 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: catalog bootstrap compile format format-fix format-check checkstyle-check verify install

SHELL := /bin/bash
LOG_TARGET = true
export PATH := $(CURDIR)/.git/ci-tools/venv/bin:$(CURDIR)/.git/ci-tools/bin:$(PATH)

catalog:
python3 tools/check_catalog.py
Expand All @@ -9,8 +27,21 @@ bootstrap:
compile:
bash tools/mvn.sh -B -Dmaven.test.skip=true package

verify:
bash tools/mvn.sh -B verify
format:
bash tools/mvn.sh -B -Plegacy-agentscope spring-javaformat:apply

format-fix: format

format-check:
bash tools/mvn.sh -B -Plegacy-agentscope spring-javaformat:validate

checkstyle-check:
bash tools/mvn.sh -B -Plegacy-agentscope -Dcheckstyle.skip=false checkstyle:check

verify: catalog format-check checkstyle-check compile

install:
bash tools/mvn.sh -B -Dmaven.test.skip=true install

include tools/make/linter.mk
include tools/make/tools.mk
84 changes: 47 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ Examples for the ARGI core runtime and ARGI Extensions, organized as a Maven rea
**root project → capability group → independent example module**.
Only the sibling `demo` repository's directory and Maven aggregation layout was used.
The implementations come from ARGI/Extensions API contracts and the scenarios in
`website/docs`; no demo application source was reused.
`argi-website/docs`; no demo application source was reused.

The repository contains **59 executable example modules**, with **12 additional backend
The repository contains **64 example modules** (63 in the default reactor and one
historical AgentScope module behind `legacy-agentscope`), with **12 additional backend
profile configurations** across the memory and vector modules. All nine website Graph
scenario pages have dedicated examples. [Website coverage](docs/website-coverage.md)
maps chapters to relevant modules; a chapter mapping is not proof that every feature
Expand All @@ -16,7 +17,7 @@ the demonstrated paths, additional entry points, and limits of every module.

Expanded scenarios separate application data, repositories, tools, state inspection,
and workflow orchestration where they have distinct responsibilities. Small introductory
examples remain small. Both production and test Java sources use explicit imports;
examples remain small. Java sources use explicit imports;
the static catalog check rejects ordinary and static wildcard imports.

## Requirements and setup
Expand All @@ -37,7 +38,7 @@ open_source/
├── argi/
├── argi-extensions/
├── argi-example/
├── website/ # documentation input, not a build dependency
├── argi-website/ # documentation input, not a build dependency
└── demo/ # structural reference, not a build dependency
```

Expand Down Expand Up @@ -76,8 +77,7 @@ contracts at the ARGI runtime boundary.

Runtime labels: **local** needs no model or service; **model** uses real provider
credentials; **service** needs the external service described in its README and may
also need a model. Tests use local fixtures where provided; sample main methods use
real APIs rather than mock responses.
also need a model. Sample main methods use real APIs; controlled failure drills are labeled explicitly.


### argi-adapter-example
Expand Down Expand Up @@ -203,48 +203,48 @@ Each component has its own port/configuration and is started explicitly by its c

## Checks and CI

These are teaching examples. The repository contains no unit-test suites,
JUnit/Mockito dependencies or coverage gates. Verify formatting and compilation,
then run the desired entry point and inspect its documented output.

```shell
# Static inventory and document links only.
# Source inventory and document links.
make catalog

# Optional compilation without tests or sample execution.
# Apply the same Java formatter version used by Core.
make format

# Validate formatting without changing files.
make format-check

# Compile the default reactor without executing examples.
make compile

# Optional tests and JaCoCo verification; never starts external infrastructure.
# Run catalog, formatting and compilation checks together.
make verify
```

Local execution was authorized and performed on **2026-10-15**, using the selected
Claude Code model (`sonnet` resolved to `glm-5.3`) through its OpenAI-compatible gateway.
Credentials were passed only through child-process environments; neither the settings
file nor credentials were copied into this repository. The normal examples continue
to use `ARGI_API_KEY`, `ARGI_MODEL` and `ARGI_BASE_URL`.

The full reactor and all 12 backend profiles build successfully. All 109 local tests
and all 36 local entry-point runs pass. Of 38 real-model cases, 34 pass and four remain
incomplete after gateway resets/timeouts. Studio HTTP/SSE also passed.
The 90% JaCoCo line threshold remains enabled for bundles with execution data;
modules without tests are explicitly outside the measured percentage.
[Compatibility and validation results](docs/compatibility.md#verification-boundary)
record exact counts, failed gateway requests and unexecuted external-service scenarios.
No database, Nacos, MCP server, Docker daemon or sandbox infrastructure was started.
Performance, load, capacity, chaos, dependency-vulnerability and remote-CI checks
are not claimed by this local execution.

[GitHub Actions](.github/workflows/verify.yml) keeps CI enabled for pushes and pull
requests. It installs pinned upstream source revisions, verifies the examples, and
compiles every backend profile. CI is enabled; the current working-tree changes have not
been validated by a remote run. No CI result is inferred from source inspection.
The seven new local runtime entry points completed successfully on **2026-10-18**.
No model, database, Nacos, MCP server, Docker daemon or sandbox service was started.
Earlier real-model and service-validation boundaries remain documented in
[compatibility.md](docs/compatibility.md#verification-boundary); they are not a claim
that every external integration was exercised against the current source revision.

[GitHub Actions](.github/workflows/verify.yml) runs on pushes and pull requests.
It checks the catalog and Java formatting, installs pinned source dependencies,
compiles the default reactor, and compiles all 12 optional backend profiles.
ARGI lint, license and secret-check workflows use the same rule files as Core.
It does not execute test suites or enforce coverage thresholds.

## Adding an example

Add a capability-focused module, a Java main entry point, a README with prerequisites
and observable results, and tests for nontrivial local behavior. Register the module
in its group POM and update `docs/catalog.json`, `docs/website-coverage.md`, and
`docs/feature-coverage.md`. Register all supporting sources, tests, and additional
main methods in the catalog, with their demonstrated behavior and limitations.
Use a real integration in integration scenarios. Label local corpora, fault injection,
and emulation explicitly; keep mock providers in `src/test`. Do not use wildcard imports.
Add a named Maven module, a real Java main entry point, and a README with
prerequisites, a runnable command and observable results. Register the module in
its group POM and update `docs/catalog.json`, `docs/website-coverage.md`, and
`docs/feature-coverage.md`. Register supporting sources and additional main methods
with their demonstrated behavior and limitations. Do not add test suites.
Use real integrations where required; label local corpora, fault injection and
emulation explicitly. Use explicit imports and run `make format` before submitting.

## Cleanup and rollback

Expand All @@ -258,3 +258,13 @@ repository source files are not part of this change.
## License

[Apache License 2.0](LICENSE).

## Current main runtime examples

| Module | Demonstrated behavior |
| --- | --- |
| [tool-execution-policies](argi-agent-example/tool-execution-policies/README.md) | Runs a real AgentToolNode with application-owned trusted identity, opt-in argument validation and explicit business-result mapping. |
| [context-provenance](argi-agent-example/context-provenance/README.md) | Tags retrieved documents and child output, constructs two summaries and clamps a forged high-trust claim. |
| [background-tasks](argi-agent-example/background-tasks/README.md) | Uses one execution slot and one waiting slot to demonstrate capacity and duplicate-ID rejection, completion and explicit result removal. |
| [batched-array-loop](argi-agent-example/batched-array-loop/README.md) | Drives the actual LoopMode.array initialization and dispatch strategy with ordered JSON input. |
| [versioned-recovery](argi-graph-example/versioned-recovery/README.md) | Serializes exact graph, tool catalog, codec and application references and resolves them against an upgraded registry. |
Loading
Loading