agentverity 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. agentverity-0.2.0/.github/workflows/ci.yml +105 -0
  2. agentverity-0.2.0/.github/workflows/release.yml +55 -0
  3. agentverity-0.2.0/.gitignore +8 -0
  4. agentverity-0.2.0/CHANGELOG.md +99 -0
  5. agentverity-0.2.0/CONTRIBUTING.md +32 -0
  6. agentverity-0.2.0/DESIGN.md +121 -0
  7. agentverity-0.2.0/LICENSE +202 -0
  8. agentverity-0.2.0/PKG-INFO +401 -0
  9. agentverity-0.2.0/README.md +367 -0
  10. agentverity-0.2.0/RELEASING.md +59 -0
  11. agentverity-0.2.0/agentverity/__init__.py +53 -0
  12. agentverity-0.2.0/agentverity/adapters/__init__.py +14 -0
  13. agentverity-0.2.0/agentverity/adapters/callable_adapter.py +43 -0
  14. agentverity-0.2.0/agentverity/adapters/strands.py +100 -0
  15. agentverity-0.2.0/agentverity/blindness.py +164 -0
  16. agentverity-0.2.0/agentverity/cli.py +113 -0
  17. agentverity-0.2.0/agentverity/meter.py +204 -0
  18. agentverity-0.2.0/agentverity/observation.py +64 -0
  19. agentverity-0.2.0/agentverity/py.typed +0 -0
  20. agentverity-0.2.0/agentverity/relations.py +142 -0
  21. agentverity-0.2.0/agentverity/runner.py +376 -0
  22. agentverity-0.2.0/examples/bugfix_pipeline.py +122 -0
  23. agentverity-0.2.0/examples/strands_example.py +61 -0
  24. agentverity-0.2.0/examples/toy_agent.py +102 -0
  25. agentverity-0.2.0/pyproject.toml +68 -0
  26. agentverity-0.2.0/tests/test_blindness.py +112 -0
  27. agentverity-0.2.0/tests/test_callable_adapter.py +64 -0
  28. agentverity-0.2.0/tests/test_cli.py +72 -0
  29. agentverity-0.2.0/tests/test_meter.py +123 -0
  30. agentverity-0.2.0/tests/test_observation.py +30 -0
  31. agentverity-0.2.0/tests/test_public_api.py +55 -0
  32. agentverity-0.2.0/tests/test_relations.py +102 -0
  33. agentverity-0.2.0/tests/test_runner.py +295 -0
  34. agentverity-0.2.0/tests/test_strands_adapter.py +101 -0
@@ -0,0 +1,105 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ name: Python ${{ matrix.python-version }}
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ python-version:
24
+ - "3.10"
25
+ - "3.11"
26
+ - "3.12"
27
+ - "3.13"
28
+ - "3.14"
29
+
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ matrix.python-version }}
35
+ cache: pip
36
+ - name: Install
37
+ run: python -m pip install -e ".[dev]"
38
+ - name: Test
39
+ run: python -m pytest -q
40
+
41
+ lint:
42
+ name: Lint
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - uses: actions/setup-python@v5
47
+ with:
48
+ python-version: "3.12"
49
+ cache: pip
50
+ - name: Install
51
+ run: python -m pip install -e ".[dev]"
52
+ - name: Lint
53
+ run: ruff check .
54
+
55
+ package:
56
+ name: Package
57
+ runs-on: ubuntu-latest
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ - uses: actions/setup-python@v5
61
+ with:
62
+ python-version: "3.12"
63
+ cache: pip
64
+ - name: Install build tools
65
+ run: python -m pip install build twine
66
+ - name: Build distributions
67
+ run: python -m build
68
+ - name: Check distribution metadata
69
+ run: python -m twine check dist/*
70
+ - name: Install wheel
71
+ run: python -m pip install --force-reinstall dist/*.whl
72
+ - name: Smoke-test installed package
73
+ run: |
74
+ export PACKAGE_VERSION
75
+ PACKAGE_VERSION="$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")"
76
+ cd "${RUNNER_TEMP}"
77
+ python -c "import importlib.metadata as m, os; import agentverity; assert m.version('agentverity') == os.environ['PACKAGE_VERSION']"
78
+ agentverity --help
79
+
80
+ gate:
81
+ name: CI gate
82
+ runs-on: ubuntu-latest
83
+ needs:
84
+ - test
85
+ - lint
86
+ - package
87
+ # Runs even when a needed job fails, so the gate reports a real failure
88
+ # instead of being skipped and leaving the required check pending forever.
89
+ if: always()
90
+ steps:
91
+ - name: Require every upstream job to succeed
92
+ env:
93
+ TEST_RESULT: ${{ needs.test.result }}
94
+ LINT_RESULT: ${{ needs.lint.result }}
95
+ PACKAGE_RESULT: ${{ needs.package.result }}
96
+ run: |
97
+ echo "test: ${TEST_RESULT}"
98
+ echo "lint: ${LINT_RESULT}"
99
+ echo "package: ${PACKAGE_RESULT}"
100
+ for result in "${TEST_RESULT}" "${LINT_RESULT}" "${PACKAGE_RESULT}"; do
101
+ if [ "${result}" != "success" ]; then
102
+ echo "::error::a required job did not succeed"
103
+ exit 1
104
+ fi
105
+ done
@@ -0,0 +1,55 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distributions
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ ref: ${{ github.event.release.tag_name }}
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+ cache: pip
23
+ - name: Verify release tag
24
+ env:
25
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
26
+ run: |
27
+ PACKAGE_VERSION="$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")"
28
+ test "${RELEASE_TAG}" = "v${PACKAGE_VERSION}"
29
+ - name: Install build tools
30
+ run: python -m pip install build twine
31
+ - name: Build distributions
32
+ run: python -m build
33
+ - name: Check distribution metadata
34
+ run: python -m twine check dist/*
35
+ - uses: actions/upload-artifact@v4
36
+ with:
37
+ name: python-package-distributions
38
+ path: dist/
39
+
40
+ publish:
41
+ name: Publish to PyPI
42
+ needs: build
43
+ runs-on: ubuntu-latest
44
+ environment:
45
+ name: pypi
46
+ url: https://pypi.org/p/agentverity
47
+ permissions:
48
+ id-token: write
49
+ steps:
50
+ - uses: actions/download-artifact@v4
51
+ with:
52
+ name: python-package-distributions
53
+ path: dist/
54
+ - name: Publish distributions
55
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .venv/
4
+ *.egg-info/
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ build/
8
+ dist/
@@ -0,0 +1,99 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ This project follows [Semantic Versioning](https://semver.org/) once it
7
+ reaches 1.0.0; before that, minor versions may include breaking changes.
8
+
9
+ ## [Unreleased]
10
+
11
+ ## [0.2.0] - 2026-07-25
12
+
13
+ ### Added
14
+
15
+ - Distribution build and clean-install validation in CI.
16
+ - PyPI Trusted Publishing workflow and a documented maintainer release
17
+ procedure.
18
+ - `RelationResult.skipped`, `.exercised`, and `.is_vacuous`, plus
19
+ `RunResult.vacuous_relations`, so a relation whose transform never changed
20
+ an input is reported instead of counted as a pass.
21
+ - `RunConfig.reuse_unchanged_calls` (default on) and
22
+ `agentverity.blindness.score`, which scores observations another phase has
23
+ already collected.
24
+ - A reproducible supervisor-pattern example that contrasts a blind triage step
25
+ with a stochastic full pipeline.
26
+ - A pull-request-only contribution workflow and CI across Python 3.10 to 3.14.
27
+
28
+ ### Changed
29
+
30
+ - The verdict-stochasticity interval now uses disjoint repeat pairs. The
31
+ earlier all-pairs calculation reused the same calls across comparisons and
32
+ overstated the effective sample size.
33
+ - The runner now executes both diagnostics before any metamorphic relation.
34
+ - The built-in accent/whitespace transform is named
35
+ `normalisation-invariance`, matching what it actually does.
36
+ - `suite_is_meaningful` now reports whether relation passes may be vacuous
37
+ under the skew scan. Meter calls remain separate oracle guidance.
38
+ - Public novelty claims now distinguish repeated-trial and calibration tools
39
+ from AgentVerity's narrower oracle-selection and verdict-skew diagnostics.
40
+ - `violation_rate` is now measured over exercised pairs rather than over all
41
+ inputs, so inputs the transform left untouched no longer dilute it.
42
+ - A run reuses the meter's first draw per input for the blindness scan and for
43
+ each relation's source side. Agent calls drop from `n * (k + 1 + 2r)` to
44
+ `n * (k + r)`, halving them on the default configuration.
45
+
46
+ ### Fixed
47
+
48
+ - Empty probe sets and invalid meter/blindness thresholds now fail with clear
49
+ `ValueError`s.
50
+ - The CLI no longer invokes an agent with a hidden probe input before the
51
+ configured suite, avoiding side effects and wasted model calls.
52
+ - Passing `relations=[]` now runs no relations instead of restoring built-ins.
53
+ - `normalisation-invariance` and `tool-selection-invariance` normalise accents
54
+ and whitespace, so on plain ASCII input the follow-up string was identical to
55
+ the source. Both relations reported a perfect pass without the agent ever
56
+ being asked a different question. Those inputs are now skipped, the rate
57
+ reads `n/a`, and the report names the relation as not exercised.
58
+
59
+ ## [0.1.0] - 2026-07-24
60
+
61
+ Initial public release.
62
+
63
+ ### Added
64
+
65
+ - Verdict-stochasticity meter (`agentverity.meter`): a Wilson-CI-backed
66
+ tri-state call (`verdict-stochastic` / `verdict-deterministic` /
67
+ `undecided`) on whether an agent's decision is stable across identical
68
+ reruns, refusing to label an underpowered probe "deterministic."
69
+ - Constant-gate-blindness detector (`agentverity.blindness`): flags when
70
+ a passing test suite is trivially satisfied because the agent returns
71
+ a near-constant verdict regardless of input.
72
+ - Typed metamorphic relations (`agentverity.relations`): invariant,
73
+ monotone, and directional, with four built-in relations (paraphrase,
74
+ case, whitespace, and tool-selection invariance).
75
+ - Runner (`agentverity.runner`) orchestrating meter, then relations,
76
+ then blindness into a single diagnostics-first report.
77
+ - CLI (`agentverity run --agent module:func --inputs file.txt`).
78
+ - Callable adapter (zero dependencies) and an optional Strands adapter.
79
+ - 64 tests, all passing.
80
+
81
+ ### Fixed (found during pre-release review, before this version shipped)
82
+
83
+ - `from_callable` was not exported from the top-level `agentverity`
84
+ package, only from `agentverity.adapters`, so the README's own
85
+ Quickstart (`from agentverity import run, from_callable`) raised
86
+ `ImportError` for anyone who copy-pasted it. Now exported at the top
87
+ level and covered by `tests/test_public_api.py` so the documented
88
+ import surface can't silently drift again.
89
+ - The Quickstart's shown output didn't match what the shown code
90
+ actually produces (stale pair counts, a tri-state call that wasn't
91
+ reachable with that input size). Replaced with output captured from
92
+ an actual run against the fixed code.
93
+ - Lint cleanup across the package: unused imports, a test asserting a
94
+ bare `Exception` narrowed to the specific `FrozenInstanceError` it's
95
+ actually checking for, missing trailing newlines.
96
+
97
+ [Unreleased]: https://github.com/mrwersa/agentverity/compare/v0.2.0...HEAD
98
+ [0.2.0]: https://github.com/mrwersa/agentverity/compare/v0.1.0...v0.2.0
99
+ [0.1.0]: https://github.com/mrwersa/agentverity/releases/tag/v0.1.0
@@ -0,0 +1,32 @@
1
+ # Contributing
2
+
3
+ AgentVerity uses a pull-request-only workflow for `main`.
4
+
5
+ 1. Create a branch from the latest `main`:
6
+
7
+ ```bash
8
+ git switch main
9
+ git pull --ff-only
10
+ git switch -c feature/short-description
11
+ ```
12
+
13
+ 2. Keep the change focused and add tests for behavioural changes.
14
+
15
+ 3. Run the local quality gate:
16
+
17
+ ```bash
18
+ python -m pytest -q
19
+ ruff check .
20
+ ```
21
+
22
+ 4. Push the branch and open a pull request:
23
+
24
+ ```bash
25
+ git push -u origin feature/short-description
26
+ ```
27
+
28
+ Direct pushes, force pushes, and deletion of `main` are blocked. Merge only
29
+ after CI passes and all review conversations are resolved.
30
+
31
+ Maintainers should follow [RELEASING.md](RELEASING.md) when publishing a
32
+ version.
@@ -0,0 +1,121 @@
1
+ # agentverity — design
2
+
3
+ A side project, NOT a research paper: an open-source framework for
4
+ **measure-first testing of non-deterministic LLM agents**. Created 2026-07-05.
5
+ Career artifact: "I build reusable tooling for testing agentic AI."
6
+
7
+ ## Identity
8
+
9
+ **Name:** `agentverity` — "agent" + "verity" (truth). The tool tells you the
10
+ truth about whether your test suite is meaningful before you trust it.
11
+
12
+ **Wedge:** not "run metamorphic relations" but "diagnose whether your agent
13
+ test suite is lying to you" — suite-quality diagnostics for non-deterministic
14
+ agents. Compete on non-determinism honesty, NOT on breadth (lose to
15
+ DeepEval/promptfoo) or on the MR taxonomy (CheckList).
16
+
17
+ ## Prior-art landscape (researched 2026-07-06)
18
+
19
+ | Tool | Stars | Non-determinism | Metamorphic | Suite-quality diagnostic | License |
20
+ |---|---|---|---|---|---|
21
+ | DeepEval | 16.7k | Repeated runs | No | No | Apache-2.0 |
22
+ | promptfoo | 22.9k | Repeated runs | No | Red-team coverage only | MIT |
23
+ | agentevals (langchain) | 636 | No | No | No | MIT |
24
+ | CheckList | 2k | Assumes deterministic | INV/DIR (owns it) | No | MIT |
25
+ | AgentAssay | paper | Yes (Wilson CIs) | Yes | Mutation testing | AGPL |
26
+ | agentrial | 17 | Yes (Wilson CIs) | No | No | MIT |
27
+ | **agentverity** | — | **Yes + measure-first** | **Yes (inherited)** | **Meter + blindness** | **Apache-2.0** |
28
+
29
+ **The three differentiators that survive the research:**
30
+
31
+ 1. **Verdict-layer oracle selection.** Existing tools repeat tests, report
32
+ uncertainty, and in AgentAssay's case calibrate trial budgets. AgentVerity
33
+ asks whether the chosen categorical decision layer is stable enough that a
34
+ frozen baseline dominates MRs. The novelty claim is this oracle-selection
35
+ use, not awareness that agents are non-deterministic.
36
+
37
+ 2. **Constant-gate-blindness detector.** A gate that returns `"allow"` on 96%
38
+ of a probe set can satisfy many invariance checks without exercising a
39
+ boundary. The detector flags the pass as potentially vacuous. This is a
40
+ suite-power warning, not a correctness judgement.
41
+
42
+ 3. **Suite-quality diagnostic framing.** Not "run tests and report pass/fail"
43
+ but "tell you if your tests are meaningful before you trust them." The
44
+ report leads with the diagnostics, then per-relation results.
45
+
46
+ **Borrowed, established (cite in README):**
47
+ - **Metamorphic relations** (Chen et al. 1998): assert a law between two runs
48
+ (transform input, check the outputs relate correctly) — no golden output
49
+ needed. The escape from the oracle problem for non-deterministic systems.
50
+ - **Semantic-invariance transforms** (CheckList / LLMORPH): normalisation,
51
+ casing, whitespace.
52
+ - **Wilson CIs** (AgentAssay, agentrial use them for pass-rate CIs; we use
53
+ them for verdict-stability certification — same primitive, different use).
54
+
55
+ **Apache-2.0** is an adoption edge over AgentAssay's AGPL.
56
+
57
+ ---
58
+
59
+ ## 1. What it is (one line)
60
+
61
+ `agentverity` runs two diagnostics before any test relation: does the agent's
62
+ verdict flip across identical reruns (meter), and does the agent return a
63
+ near-constant verdict across a diverse input set (blindness). The first guides
64
+ oracle selection. The second warns when green relation results may be vacuous.
65
+
66
+ ## 2. Architecture (three layers)
67
+
68
+ ```
69
+ your agent (Strands / LangGraph / any callable)
70
+ | adapter: normalise to Observation
71
+ v
72
+ agentverity.core
73
+ |
74
+ ├── meter.py — verdict-stochasticity meter (headline #1)
75
+ ├── blindness.py — constant-gate-blindness detector (headline #2)
76
+ ├── relations.py — typed metamorphic relations (the vehicle)
77
+ ├── runner.py — orchestrates meter -> blindness -> relations
78
+ └── cli.py — `agentverity run` entry point
79
+ ```
80
+
81
+ ### 3a. Adapter layer (`agentverity/adapters/`)
82
+ Turns a real agent into a uniform `run(input) -> Observation`. `Observation`
83
+ carries what relations can assert over:
84
+ - `text` — final response string
85
+ - `verdict`— an optional extracted categorical decision
86
+ - `tools` — the ordered list of tool names the agent called (the trajectory)
87
+ - `raw` — the underlying result object, for custom relations
88
+
89
+ Adapters:
90
+ - **Strands:** `Agent(prompt) -> AgentResult`. Adapter calls the agent, reads
91
+ the final message text and the tool-use blocks for `tools`.
92
+ - **LangGraph:** compiled graph `.invoke(state)` (planned).
93
+ - **callable:** any `fn(input) -> str | dict | Observation` for non-library agents.
94
+ Adapters are OPTIONAL imports — the core installs without any agent library.
95
+
96
+ ### 3b. Core (`agentverity/`)
97
+ - `relations.py` — Relation = (name, type, transform, check). Built-in
98
+ catalogue: normalisation, casing, whitespace invariance (text-level);
99
+ tool-selection-invariance (agent-specific, our emphasis).
100
+ - `meter.py` — verdict-stochasticity meter. Tri-state call with Wilson CI.
101
+ - `blindness.py` — constant-gate-blindness detector. Skew scan + warning.
102
+ - `runner.py` — orchestrates meter -> blindness -> relations. Returns RunResult.
103
+ - `cli.py` — `agentverity run --agent module:func --inputs file.txt`.
104
+
105
+ ## 3. Scope discipline (what it is NOT)
106
+
107
+ - Not a benchmark, not a leaderboard, not an LLM-judge scorer.
108
+ - Not correctness testing — it tests *relations*, and explicitly warns it cannot
109
+ tell a correct agent from an indifferent one (blindness detector).
110
+ - Not tied to any provider or the research programme's own gate.
111
+ - Zero dependency on the `mnem`/sibling-paper code. Fully standalone.
112
+
113
+ ## 4. Status (2026-07-06)
114
+
115
+ - M1 core: DONE — observation, meter, blindness, relations, runner, CLI.
116
+ - M2 Strands adapter: DONE — adapter written, tested, worked example runs.
117
+ - M2 LangGraph adapter: PLANNED.
118
+ - M3 agent-specific relations: PLANNED (tool-selection-invariance is built-in;
119
+ more user-extensible relations to follow).
120
+ - M4 packaging: pyproject.toml written, README written, LICENSE added.
121
+ PyPI name `agentverity` verified free. Not yet published.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.