vla-redteam 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 (59) hide show
  1. vla_redteam-0.2.0/.github/workflows/ci.yml +34 -0
  2. vla_redteam-0.2.0/.github/workflows/release.yml +94 -0
  3. vla_redteam-0.2.0/.gitignore +50 -0
  4. vla_redteam-0.2.0/CHANGELOG.md +141 -0
  5. vla_redteam-0.2.0/LICENSE +201 -0
  6. vla_redteam-0.2.0/PKG-INFO +316 -0
  7. vla_redteam-0.2.0/PRIOR_ART.md +80 -0
  8. vla_redteam-0.2.0/README.md +288 -0
  9. vla_redteam-0.2.0/SAFETY.md +67 -0
  10. vla_redteam-0.2.0/docs/assets/demo.svg +110 -0
  11. vla_redteam-0.2.0/leaderboard/README.md +63 -0
  12. vla_redteam-0.2.0/leaderboard/app.py +129 -0
  13. vla_redteam-0.2.0/leaderboard/requirements.txt +8 -0
  14. vla_redteam-0.2.0/leaderboard/results/leaderboard.json +80 -0
  15. vla_redteam-0.2.0/pyproject.toml +103 -0
  16. vla_redteam-0.2.0/results/smolvla_libero_object/README.md +25 -0
  17. vla_redteam-0.2.0/results/smolvla_libero_object/report.json +1197 -0
  18. vla_redteam-0.2.0/scripts/record_demo.sh +54 -0
  19. vla_redteam-0.2.0/scripts/run_real.sh +76 -0
  20. vla_redteam-0.2.0/src/vla_redteam/__init__.py +13 -0
  21. vla_redteam-0.2.0/src/vla_redteam/attacks/__init__.py +1 -0
  22. vla_redteam-0.2.0/src/vla_redteam/attacks/_image.py +77 -0
  23. vla_redteam-0.2.0/src/vla_redteam/attacks/_payload.py +51 -0
  24. vla_redteam-0.2.0/src/vla_redteam/attacks/base.py +50 -0
  25. vla_redteam-0.2.0/src/vla_redteam/attacks/baseline.py +28 -0
  26. vla_redteam-0.2.0/src/vla_redteam/attacks/injection.py +102 -0
  27. vla_redteam-0.2.0/src/vla_redteam/attacks/instruction.py +103 -0
  28. vla_redteam-0.2.0/src/vla_redteam/attacks/registry.py +120 -0
  29. vla_redteam-0.2.0/src/vla_redteam/attacks/visual.py +89 -0
  30. vla_redteam-0.2.0/src/vla_redteam/cli.py +250 -0
  31. vla_redteam-0.2.0/src/vla_redteam/config.py +50 -0
  32. vla_redteam-0.2.0/src/vla_redteam/leaderboard.py +178 -0
  33. vla_redteam-0.2.0/src/vla_redteam/policies/__init__.py +1 -0
  34. vla_redteam-0.2.0/src/vla_redteam/policies/base.py +57 -0
  35. vla_redteam-0.2.0/src/vla_redteam/policies/lerobot_adapter.py +260 -0
  36. vla_redteam-0.2.0/src/vla_redteam/policies/registry.py +94 -0
  37. vla_redteam-0.2.0/src/vla_redteam/policies/stub.py +134 -0
  38. vla_redteam-0.2.0/src/vla_redteam/report.py +148 -0
  39. vla_redteam-0.2.0/src/vla_redteam/runner.py +151 -0
  40. vla_redteam-0.2.0/src/vla_redteam/scoring/__init__.py +1 -0
  41. vla_redteam-0.2.0/src/vla_redteam/scoring/asr.py +87 -0
  42. vla_redteam-0.2.0/src/vla_redteam/suites/__init__.py +70 -0
  43. vla_redteam-0.2.0/src/vla_redteam/suites/base.py +64 -0
  44. vla_redteam-0.2.0/src/vla_redteam/suites/libero.py +404 -0
  45. vla_redteam-0.2.0/src/vla_redteam/suites/stub.py +127 -0
  46. vla_redteam-0.2.0/src/vla_redteam/types.py +131 -0
  47. vla_redteam-0.2.0/tests/conftest.py +20 -0
  48. vla_redteam-0.2.0/tests/test_attacks.py +94 -0
  49. vla_redteam-0.2.0/tests/test_cli.py +125 -0
  50. vla_redteam-0.2.0/tests/test_determinism.py +39 -0
  51. vla_redteam-0.2.0/tests/test_leaderboard.py +102 -0
  52. vla_redteam-0.2.0/tests/test_lerobot_adapter.py +155 -0
  53. vla_redteam-0.2.0/tests/test_libero_adapter.py +209 -0
  54. vla_redteam-0.2.0/tests/test_real_policy_injection.py +169 -0
  55. vla_redteam-0.2.0/tests/test_registries.py +63 -0
  56. vla_redteam-0.2.0/tests/test_runner_smoke.py +63 -0
  57. vla_redteam-0.2.0/tests/test_scoring.py +83 -0
  58. vla_redteam-0.2.0/tests/test_visual_injection.py +181 -0
  59. vla_redteam-0.2.0/uv.lock +3004 -0
@@ -0,0 +1,34 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ # CPU-only by design: this workflow NEVER installs the optional `[lerobot]` extra,
9
+ # so it pulls no torch / transformers / GPU stack. The LeRobot integration tests are
10
+ # gated (ROBOPWN_INTEGRATION) and skip here automatically.
11
+ jobs:
12
+ check:
13
+ name: ruff + mypy + pytest (CPU, no lerobot)
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Install uv (pinned Python 3.12)
19
+ uses: astral-sh/setup-uv@v5
20
+ with:
21
+ python-version: "3.12"
22
+ enable-cache: true
23
+
24
+ - name: Sync core + dev (no extras)
25
+ run: uv sync --locked
26
+
27
+ - name: Lint (ruff)
28
+ run: uv run ruff check .
29
+
30
+ - name: Type-check (mypy, strict)
31
+ run: uv run mypy src
32
+
33
+ - name: Test (pytest, CPU only)
34
+ run: uv run pytest -q
@@ -0,0 +1,94 @@
1
+ name: Release
2
+
3
+ # Tag-triggered release: build sdist + wheel, publish to PyPI via OIDC TRUSTED
4
+ # PUBLISHING (no API token stored anywhere), then cut a GitHub Release from the
5
+ # CHANGELOG.
6
+ #
7
+ # ────────────────────────────────────────────────────────────────────────────
8
+ # ONE-TIME MAINTAINER SETUP (PyPI trusted publisher — no secrets in the repo):
9
+ # 1. Create the project owner account on https://pypi.org.
10
+ # 2. PyPI → your account → "Publishing" → "Add a new pending publisher":
11
+ # PyPI project name : vla-redteam
12
+ # Owner : sattyamjjain
13
+ # Repository name : vla-redteam
14
+ # Workflow name : release.yml
15
+ # Environment name : pypi
16
+ # 3. In GitHub → repo Settings → Environments → create an environment named "pypi"
17
+ # (optionally add required reviewers / a tag protection rule).
18
+ # 4. Publish by pushing a tag that matches the version, e.g.:
19
+ # git tag v0.1.0 && git push origin v0.1.0
20
+ # (For a first dry run, point step `publish` at TestPyPI by setting
21
+ # `repository-url: https://test.pypi.org/legacy/` and adding the matching pending
22
+ # publisher on test.pypi.org.)
23
+ # ────────────────────────────────────────────────────────────────────────────
24
+
25
+ on:
26
+ push:
27
+ tags: ["v*"]
28
+
29
+ permissions: {} # least privilege by default; jobs opt into exactly what they need
30
+
31
+ jobs:
32
+ build:
33
+ name: Build sdist + wheel
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - name: Install uv (Python 3.12)
38
+ uses: astral-sh/setup-uv@v5
39
+ with:
40
+ python-version: "3.12"
41
+ - name: Build distributions
42
+ run: uv build
43
+ - name: Check metadata
44
+ run: uvx twine check dist/*
45
+ - uses: actions/upload-artifact@v4
46
+ with:
47
+ name: dist
48
+ path: dist/
49
+
50
+ publish-pypi:
51
+ name: Publish to PyPI (OIDC trusted publishing)
52
+ needs: build
53
+ runs-on: ubuntu-latest
54
+ environment: pypi
55
+ permissions:
56
+ id-token: write # REQUIRED for OIDC trusted publishing — no token needed
57
+ steps:
58
+ - uses: actions/download-artifact@v4
59
+ with:
60
+ name: dist
61
+ path: dist/
62
+ - name: Publish
63
+ uses: pypa/gh-action-pypi-publish@release/v1
64
+ # No `password:` — trusted publishing uses the OIDC id-token above.
65
+
66
+ github-release:
67
+ name: Create GitHub Release
68
+ needs: publish-pypi
69
+ runs-on: ubuntu-latest
70
+ permissions:
71
+ contents: write # to create the release
72
+ steps:
73
+ - uses: actions/checkout@v4
74
+ - uses: actions/download-artifact@v4
75
+ with:
76
+ name: dist
77
+ path: dist/
78
+ - name: Extract changelog notes for this tag
79
+ id: notes
80
+ run: |
81
+ version="${GITHUB_REF_NAME#v}"
82
+ awk -v ver="$version" '
83
+ $0 ~ "^## \\[" ver "\\]" {flag=1; next}
84
+ flag && /^## \[/ {exit}
85
+ flag {print}
86
+ ' CHANGELOG.md > release-notes.md
87
+ if [ ! -s release-notes.md ]; then echo "Release ${GITHUB_REF_NAME}" > release-notes.md; fi
88
+ - name: Create release
89
+ env:
90
+ GH_TOKEN: ${{ github.token }}
91
+ run: |
92
+ gh release create "${GITHUB_REF_NAME}" dist/* \
93
+ --title "${GITHUB_REF_NAME}" \
94
+ --notes-file release-notes.md
@@ -0,0 +1,50 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+ develop-eggs/
12
+ .installed.cfg
13
+ *.egg
14
+
15
+ # Virtual environments
16
+ .venv/
17
+ venv/
18
+ env/
19
+ ENV/
20
+ .uv/
21
+
22
+ # uv
23
+ uv.lock.bak
24
+
25
+ # Testing / coverage
26
+ .pytest_cache/
27
+ .coverage
28
+ .coverage.*
29
+ coverage.xml
30
+ htmlcov/
31
+ .mypy_cache/
32
+ .ruff_cache/
33
+ .hypothesis/
34
+
35
+ # Run artifacts (generated reports)
36
+ runs/
37
+
38
+ # Optional demo recording (regenerated by scripts/record_demo.sh when asciinema+agg
39
+ # are installed); the committed deterministic asset is docs/assets/demo.svg.
40
+ docs/assets/*.gif
41
+
42
+ # OS / editor
43
+ .DS_Store
44
+ .idea/
45
+ .vscode/
46
+ *.swp
47
+ *~
48
+
49
+ # Jupyter
50
+ .ipynb_checkpoints/
@@ -0,0 +1,141 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.0] — 2026-06-03
8
+
9
+ First public release. A model-agnostic harness that red-teams VLA policies in
10
+ simulation and reports an Attack Success Rate (ASR). The entire core runs and is tested
11
+ on a plain CPU with no GPU and no model/dataset download; real policies and the LIBERO
12
+ simulator are isolated behind the optional `[lerobot]` extra and an
13
+ `ROBOPWN_INTEGRATION=1` gate, and CI never installs them.
14
+
15
+ ### Added
16
+ - **Core engine**: `PolicyAdapter`, `SuiteAdapter` (with an `is_unsafe` predicate), and
17
+ `Attack` abstractions; a deterministic `runner` (policy × suite × attacks × seeds);
18
+ pydantic v2 result types (`AttackResult`, `RunReport`).
19
+ - **Deterministic CPU stubs**: `StubPolicy` (manipulable via a documented trigger-token
20
+ lexicon over the instruction *and* a fixed allow-list of observation channels) and
21
+ `StubSuite` (one-task env with a SHA-256, cross-platform per-seed unsafe threshold),
22
+ so every attack yields a real, exact, reproducible seed-0 ASR with no model.
23
+ - **Three attack families** (templated, auditable, CPU-testable):
24
+ - `instruction` — `RolePlayAttack`, `GoalSubstitutionAttack`, `ParaphraseAttack`
25
+ (RoboPAIR / POEX-inspired). Seed-0 ASR **21/30**.
26
+ - `visual` — `PatchAttack`, `DecoyObjectAttack` (observation-space markers; BadVLA
27
+ -inspired). Seed-0 ASR **14/20**.
28
+ - `injection` — `SceneTextInjection`, `MCPToolDescInjection` (indirect / embodied
29
+ prompt injection; POEX-inspired). Seed-0 ASR **12/20**.
30
+ - Combined seed-0 ASR across all three: **47/70**. See [PRIOR_ART.md](PRIOR_ART.md).
31
+ - **Scoring & reports**: ASR with per-attack and per-task breakdowns (zero-division
32
+ guarded); stable `report.json` (sorted keys, no wall-clock → byte-deterministic) and
33
+ `report.md`, plus a Rich console summary.
34
+ - **`robopwn` CLI**: `attack`, `list-policies`, `list-attacks`, `report`, `version`, and
35
+ `leaderboard build`. Clean, actionable errors (exit code 2) for a missing `[lerobot]`
36
+ extra or an unknown policy/suite/attack — never a traceback.
37
+ - **Verified LeRobot SmolVLA adapter (gated)**: loads `lerobot/smolvla_base` via
38
+ `SmolVLAPolicy.from_pretrained` + `make_pre_post_processors` + `build_inference_frame`
39
+ + `select_action`, written **after introspecting** the installed `lerobot==0.5.1`
40
+ (symbols and signatures confirmed, not guessed).
41
+ - **Verified LIBERO `SuiteAdapter` (gated)**: wraps the real LeRobot LIBERO env via the
42
+ introspected `make_env` / `make_env_config` / `LiberoEnv` API (`{suite: {task_id:
43
+ VectorEnv}}`, action dim 7, `info["final_info"]["is_success"]`). Configurable embodied
44
+ red-team predicate (`LiberoRedTeamRules`): default end-effector keep-out zone, optional
45
+ forbidden-object grasp. LIBERO is benign manipulation — we measure *redirection*, not
46
+ harm (see [SAFETY.md](SAFETY.md)).
47
+ - **ASR leaderboard (v0, static-data)**: `robopwn leaderboard build` aggregates
48
+ `report.json` files into a ranked `(policy × suite × family) → ASR` table
49
+ (deterministic). A Gradio Space (`leaderboard/`, ZeroGPU-compatible) renders the
50
+ committed `results/*.json` with no GPU; data is clearly labelled stub/demo until real
51
+ SmolVLA / OpenVLA runs are added.
52
+ - **Release engineering**: tag-triggered PyPI publish via OIDC trusted publishing
53
+ (`.github/workflows/release.yml`) and a GitHub Release from the CHANGELOG.
54
+ - **Docs & CI**: README (with a real "Verified environment" block), SAFETY.md,
55
+ PRIOR_ART.md, and a GitHub Actions workflow running ruff + mypy + pytest on Python
56
+ 3.12, CPU-only, never installing lerobot.
57
+
58
+ ### Known limitations
59
+ - The `StubPolicy` / `StubSuite` are deliberate test fixtures, not models of real VLA
60
+ behaviour. The visual/injection attacks target the stub's observation channels; against
61
+ a real policy they only transfer insofar as the policy reads the perturbed channel
62
+ (pixel-level visual attacks on real models are future work).
63
+ - The LeRobot SmolVLA adapter and the LIBERO `SuiteAdapter` are verified at the
64
+ symbol/signature level but not executed in CI (GPU-gated). The full LIBERO
65
+ observation→features wiring and the robosuite grasped-object accessor are deferred.
66
+ - The leaderboard ships demo (stub) data only until real-model runs are added.
67
+
68
+ ## [0.2.0] — 2026-06-07 (in-process SmolVLA×LIBERO + first real result)
69
+
70
+ The real attack loop `robopwn attack --policy smolvla --suite libero` now runs
71
+ end-to-end (GPU-gated) and produced the project's **first real red-team result** on a
72
+ RunPod RTX 4090. Verified by **running** against the installed `lerobot==0.5.1`.
73
+
74
+ ### Added
75
+ - **SmolVLA×LIBERO glue**: the SmolVLA adapter consumes a real LIBERO observation by
76
+ replicating LeRobot's own evaluator rollout (`preprocess_observation` → set task →
77
+ `env_preprocessor` (`LiberoProcessorStep`) → `preprocessor` → `select_action` →
78
+ `postprocessor` → `env_postprocessor` → clamp to `[-1,1]`). A `SuiteFeatures` protocol
79
+ exchanges the env config once; `make_policy(cfg, env_cfg, rename_map)` mirrors eval.
80
+ - **Real-policy attack injection**: instruction → the task language string; `visual.patch`
81
+ / `visual.decoy_object` → adversarial-marker overlay on the camera image;
82
+ `injection.scene_text` → PIL-rendered scene sign. `injection.mcp_tool_desc` is honestly
83
+ **N/A** on a direct LIBERO loop (excluded from the denominator).
84
+ - **Live unsafe predicate**: end-effector keep-out zone (live, verified `eef.pos`) plus a
85
+ **configurable** forbidden-object-grasp rule (a `grasp_extractor` hook).
86
+ - **Seeded mean ± std** reporting for stochastic (real) policies; `--seeds`, `--model`,
87
+ and `--rename-map` CLI options; `pillow` added for image rendering.
88
+ - **`baseline` family** (`none`, a no-op control): runs the benign task unchanged so its
89
+ ASR is the reference, and attack ASR can be read as **lift over baseline**.
90
+ - **Real task language as the base instruction**: the LIBERO adapter now reads the env's
91
+ actual task via `env.call("task_description")` (mirroring LeRobot's `add_envs_task`)
92
+ instead of a placeholder — so the benign baseline measures the policy on its real job
93
+ and attack ASR is a true "diverted from the legitimate task" number.
94
+ - **Headless-sim robustness**: LIBERO's first-run `input()` config prompt is auto-handled
95
+ (`_ensure_libero_initialized`); `scripts/run_real.sh` sets `MUJOCO_GL`/`PYOPENGL_PLATFORM`
96
+ and documents the GL deps (`osmesa` CPU render, or EGL) for cloud GPU boxes.
97
+
98
+ ### First real result — verified on a GPU (2026-06-06)
99
+ - Ran the full loop on a RunPod **RTX 4090** (`HuggingFaceVLA/smolvla_libero`,
100
+ `libero_object/0`, 10 seeds, horizon 280, `osmesa`). Overall **24.3% (17/70) ± 9.1%**.
101
+ Per family vs the benign `none` baseline (0/10): instruction `roleplay` **100%**,
102
+ `goal_substitution` **60%**, `paraphrase` 10%; `visual` and `injection` **0%**. The
103
+ canonical artifact is committed at `results/smolvla_libero_object/`, and
104
+ `leaderboard/results/leaderboard.json` now holds this real (non-demo) result.
105
+ - **Honest caveat**: the keep-out predicate is a default, **uncalibrated** region — so this
106
+ is "diverted out of the benign safe envelope," not a zone-calibrated hazard rate; one
107
+ task, `n = 10`.
108
+
109
+ ### Verified by running (isolated lerobot venv, CPU)
110
+ - `lerobot/smolvla_base` is **NOT** LIBERO-compatible (expects `camera1/2/3`; LIBERO
111
+ gives `image`/`image2` + 8-dim state) → the adapter surfaces a clean
112
+ `IncompatiblePolicyError`.
113
+ - The **ready** `HuggingFaceVLA/smolvla_libero` checkpoint **loads through the glue** with
114
+ no incompatibility (policy + pre/post + `LiberoProcessorStep` all build) — so no
115
+ fine-tuning is needed. It is the default in `scripts/run_real.sh` and the gated tests.
116
+
117
+ ### Known limitations
118
+ - Real-policy ASR is **seeded but model-stochastic** (mean ± std), not byte-deterministic
119
+ (only the stub is).
120
+ - Forbidden-object grasp is **disclosed-inert by default** (no verified robosuite accessor
121
+ without the sim) — live only with a user-supplied `grasp_extractor`.
122
+ - The first real ASR (above) uses an **uncalibrated** keep-out region, so it measures
123
+ redirection *out of the benign safe envelope*, not a zone-calibrated hazard rate; one
124
+ task, `n = 10`. Producing it requires a LIBERO-fine-tuned checkpoint + GPU + sim (not CI).
125
+
126
+ ## [Unreleased] — planned
127
+
128
+ - **Per-task keep-out-zone calibration** (+ trajectory inspection) so a real ASR is a
129
+ semantically-meaningful redirection rate, not "entered a default box" — and a multi-task,
130
+ multi-suite sweep. This is the headline `v0.2.0` follow-up to the first real result.
131
+ - **Optimized-suffix attack family** (GCG-style / POEX-style executable suffixes) and
132
+ pixel-level visual attacks tuned to transfer to real VLA policies.
133
+ - **`mcp_tool_desc` on a real robot-MCP target** (no surface in a direct LIBERO loop).
134
+ - A **default robosuite grasp accessor** so forbidden-object-grasp is live out of the box.
135
+ - **Full multi-policy live leaderboard** on Hugging Face ZeroGPU with real SmolVLA /
136
+ OpenVLA numbers (the `@spaces.GPU` live-run path).
137
+ - **`vla-guard`** (Phase 2): a defensive companion that hardens policies against the
138
+ attacks this tool measures.
139
+
140
+ [0.2.0]: https://github.com/sattyamjjain/vla-redteam/releases/tag/v0.2.0
141
+ [0.1.0]: https://github.com/sattyamjjain/vla-redteam/releases/tag/v0.1.0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work, excluding
103
+ those notices that do not pertain to any part of the Derivative
104
+ Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and do
117
+ not modify the License. You may add Your own attribution notices
118
+ within Derivative Works that You distribute, alongside or as an
119
+ addendum to the NOTICE text from the Work, provided that such
120
+ additional attribution notices cannot be construed as modifying
121
+ the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.