agent-jit-runtime 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,223 @@
1
+ Metadata-Version: 2.5
2
+ Name: agent-jit-runtime
3
+ Version: 0.1.0
4
+ Summary: A tracing-JIT runtime for tool-using LLM agents
5
+ Project-URL: Homepage, https://github.com/Rayyan-Oumlil/agent-jit
6
+ Project-URL: Issues, https://github.com/Rayyan-Oumlil/agent-jit/issues
7
+ License: Apache-2.0
8
+ License-File: LICENSE
9
+ Keywords: agents,cost-reduction,jit,llm,tool-use
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.11
16
+ Provides-Extra: dev
17
+ Requires-Dist: hypothesis>=6.100; extra == 'dev'
18
+ Requires-Dist: mypy>=1.11; extra == 'dev'
19
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
20
+ Requires-Dist: pytest>=8; extra == 'dev'
21
+ Requires-Dist: ruff>=0.6; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # agent-jit
25
+
26
+ **A JIT compiler for LLM agents.** agent-jit watches a tool-using agent work, spots the multi-step
27
+ tasks it repeats, and compiles them into guarded Python code that runs without the inner-loop LLM.
28
+ When a guard fails mid-run, it hands the job back to the agent as already-executed tool history, and
29
+ a journal at the tool boundary stops a write from running twice.
30
+
31
+ > **Status: 0.1.0 (alpha). All four milestones are on `main`: the runtime, safety rules, evaluation
32
+ > harness, property and chaos tests, ablations, a drift workload and a write-up.** An end-to-end toy
33
+ > demo works with a mock LLM and no API key. On AppWorld nothing compiled (no savings). On a
34
+ > repeated-request support-desk workload agent-jit used fewer tokens at equal success; every number,
35
+ > its caveats and its command are under "Evaluation" and in
36
+ > [docs/support-desk-results.md](docs/support-desk-results.md).
37
+ > Design: [docs/PLAN.md](docs/PLAN.md) and
38
+ > [docs/superpowers/specs/2026-11-28-agent-jit-design.md](docs/superpowers/specs/2026-11-28-agent-jit-design.md).
39
+
40
+ ## Evaluation (milestone 3)
41
+
42
+ What exists, all under `src/agent_jit/adapters/`, `src/agent_jit/eval/` and `benchmarks/`:
43
+
44
+ - `adapters/appworld.py`: exposes AppWorld's APIs as discrete tools (reads: `show_*`, `search_*`,
45
+ `login`; everything else is treated as a write).
46
+ - `adapters/anthropic.py`: a client restricted to `claude-haiku-5-5`. It refuses a call whose
47
+ estimated size (about 3 characters per token, plus the largest possible reply) would take the spend
48
+ past the budget, and tracks usage per token kind because cache reads and writes are priced
49
+ differently. The estimate is rough, so the budget is a tight guard, not an exact limit.
50
+ - `eval/`: baselines (plain agent, exact-match cache, a lexical semantic cache, a one-shot replay in
51
+ the spirit of LOOP), metrics (net tokens including compile tokens, hit/fallback rate, latency
52
+ percentiles) and an episode harness that scores every episode with the environment's own check.
53
+ - `benchmarks/appworld_eval.py --llm mock` runs all of it on real AppWorld worlds with a mock model
54
+ (plumbing only, it never solves a task).
55
+
56
+ Caveats that apply to any result from this harness: the success signal agent-jit records with is
57
+ AppWorld's own ground-truth evaluator (an oracle, which a deployment would not have), the baselines
58
+ record runs whether or not they succeeded, the JIT's latency includes that one evaluator call per
59
+ run, and the cost of a run is estimated from list prices, not billed.
60
+
61
+ Measured so far, with the command that reproduces each:
62
+
63
+ | What | Result | Command |
64
+ |---|---|---|
65
+ | AppWorld facts: 457 function-calling tools, 256,659 characters of schema, train 90 / dev 57 tasks, scorer accepts the known answer | see the JSON | `python benchmarks/appworld_facts.py` |
66
+ | Three local models (gemma4:e4b, qwen3.5:9b, nemotron-3-nano:4b) on 10 AppWorld train tasks each | 0/30 passed | `python benchmarks/appworld_check1.py --models gemma4:e4b qwen3.5:9b nemotron-3-nano:4b` (inside the AppWorld venv) |
67
+ | Haiku 5.5 on 5 AppWorld scenarios x 3 tasks, plain agent vs agent-jit | 12/15 passed by both; agent-jit compiled 0 skills (no savings result), see the diagnosis | `python benchmarks/appworld_eval.py --llm haiku --scenarios 5 --systems plain jit --budget-usd 1.0`; details in [docs/appworld-results.md](docs/appworld-results.md) |
68
+ | Support-desk workload (36 requests, 6 types), gemma4:e4b, plain vs agent-jit | plain 31/36, 38,976 tokens; jit 33/36, 39% hit, 30,458 tokens (-22%); loose caches 8/36 | `python benchmarks/support_desk_eval.py --llm ollama --model gemma4:e4b`; details in [docs/support-desk-results.md](docs/support-desk-results.md) |
69
+ | Same workload on Haiku 5.5, 3 seeds, plain vs agent-jit | 108/108 for both; tokens 99,326 vs 75,016 on average (-24%, range -19% to -33%), but estimated dollars only about -6% (range -4.5% to -8%) because most tokens are cheap cache reads; about $0.04 per pass | `python benchmarks/support_desk_eval.py --llm haiku --budget-usd 0.15 --systems plain jit --seed 11` (also 12, 13) |
70
+ | Drift workload (mock policy): tools that do not validate, valid and invalid orders mixed after a warm-up | plain 36/36; agent-jit 36/36 (12/12 invalid requests stopped by a guard, 33% fallbacks); agent-jit with guards switched off 24/36, 12 wrong writes | `python benchmarks/drift_eval.py`; details in [docs/ablations.md](docs/ablations.md) |
71
+
72
+ Payback chart (Haiku, three seeds; cumulative net tokens, compile cost included, which is 0 here):
73
+ ![cumulative net tokens, plain vs agent-jit](docs/payback-haiku.svg)
74
+ Regenerate with `python benchmarks/plot_payback.py`. The curves flatten once skills compile; the
75
+ dollar saving is smaller than this token view suggests (see the results doc).
76
+
77
+ Also: ablations of the safety rules in [docs/ablations.md](docs/ablations.md), a write-up in
78
+ [docs/blog-post.md](docs/blog-post.md), and details and caveats in
79
+ [docs/week1-appworld-checks.md](docs/week1-appworld-checks.md).
80
+
81
+ ## Try it (no API key)
82
+
83
+ ```bash
84
+ pip install agent-jit-runtime # (import agent_jit) or, from a checkout: pip install -e ".[dev]"
85
+ python -m agent_jit.demo
86
+ ```
87
+
88
+ The demo runs a toy refund agent five times against a mock LLM (a deterministic script):
89
+
90
+ | Run | What happens |
91
+ |---|---|
92
+ | 1, 2 | The agent runs normally and is recorded. After run 2 the repeated pattern is compiled. |
93
+ | 3 | A router (one LLM call) picks the compiled skill; zero inner-loop LLM calls. |
94
+ | 4 | A guard fails *after* the refund ran. The agent resumes, asks to refund again, and the journal answers without executing. |
95
+ | 5 | A guard fails before any write. The agent finishes without refunding. |
96
+
97
+ The token counts it prints, including the final `stats` line, come from the mock script; they are
98
+ not measurements.
99
+
100
+ ## How it works
101
+
102
+ ```
103
+ request ──> router (1 LLM call) ──hit──> compiled skill ──guards ok──> answer
104
+ │ │
105
+ │ miss └─guard fails─> agent continues from synthetic
106
+ v tool history (journal blocks repeats)
107
+ plain agent ──> RecordingTools(JournaledTools(tools)) ──> traces (SQLite)
108
+ │
109
+ bind arguments, slice dead reads, synthesize guards, emit Python
110
+ ```
111
+
112
+ 1. **Record**: every run is stored as a trace (`tracer.py`, `store.py`).
113
+ 2. **Bind**: each tool argument is traced to the request (a parameter), an earlier tool output (a
114
+ data dependency) or a constant seen in at least two traces (`provenance.py`). An argument that
115
+ cannot be traced makes compilation refuse.
116
+ 3. **Slice**: failed reads and reads nothing depends on after the last write are dropped; a
117
+ successful read before a write is always kept (`slicer.py`).
118
+ 4. **Guard**: invariants that held in every successful trace become checks (`guards.py`).
119
+ 5. **Compile**: readable Python source, validated against a whitelist before it ever runs
120
+ (`compiler.py`).
121
+ 6. **Run and fall back**: `runtime.py`, `router.py`, `core.py`.
122
+
123
+ Around that loop, milestone 2 adds four guards on *when* a skill may run:
124
+
125
+ - **Schema invalidation**: every tool's schema, effect and idempotency key are hashed
126
+ (`schema_hash`). A skill whose tools changed is no longer offered to the router, and traces
127
+ recorded under an older schema never feed a new compile (`Wrapped.disabled` says why).
128
+ - **Circuit breaker**: a skill that fell back on more than half of its recent runs (default: at
129
+ least 5 runs, window 10) is switched off for good (`stats.py`).
130
+ - **ROI gate**: a group is compiled only if its mean inner-loop tokens exceed the router's
131
+ per-request cost (`roi.py`); declined groups appear in `Wrapped.skipped`. The router cost is
132
+ `router_token_estimate`, else the mean seen so far, else `DEFAULT_ROUTER_TOKENS` (100). That
133
+ default is a placeholder, **not a measurement**: set the estimate for your own router.
134
+ - **Branches**: when two kinds of request start with the same tool but diverge later, one skill can
135
+ branch on a value read before they diverge (`branches.py`, `compile_branched`). A run whose value
136
+ matches no known branch stops and falls back. Each branch re-checks its own guards on the shared
137
+ steps before any of its tools run.
138
+
139
+ A generated skill (from the demo):
140
+
141
+ ```python
142
+ async def run(ctx, *, order_id):
143
+ s0 = await ctx.call(0, 'get_order', {'order_id': order_id}, GUARDS)
144
+ s1 = await ctx.call(1, 'get_customer', {'customer_id': ctx.get(s0, ('customer_id',), 'identity')}, GUARDS)
145
+ s2 = await ctx.call(2, 'refund_order', {'order_id': order_id, 'amount': ctx.get(s0, ('amount',), 'identity')}, GUARDS)
146
+ ...
147
+ ```
148
+
149
+ ## Safety guarantees (and what they are not)
150
+
151
+ - Compiled code runs no further tool after a failed guard. What happens next is up to the agent
152
+ that takes over (in the demo's run 4 it asks to refund again, and the journal blocks the repeat).
153
+ Unannotated tools are treated as `write`; `irreversible` tools are never compiled.
154
+ - **The runtime does not knowingly repeat a mutating call within a run.** Each mutating call is
155
+ journaled before it runs. If its outcome is unknown (timeout, cancellation, unclassified error),
156
+ the run performs no further write and says a human must check.
157
+ - Tool output and trace data reach generated source only through `repr()` of validated literals, and
158
+ skills are re-checked against an AST whitelist at load time.
159
+ - The router can only choose a skill and copy values that literally appear in the request.
160
+
161
+ **This is not exactly-once.** See the limits below.
162
+
163
+ ## Limits
164
+
165
+ - Not exactly-once: a crash can leave a call `unknown`, and resuming after a process crash is not
166
+ supported.
167
+ - A fallback agent that repeats a write with *different* arguments is not caught.
168
+ - A condition the traces never read cannot be guarded. Numbers are guarded only by type and sign,
169
+ so a threshold such as "under 30 days" read from a tool is not checked.
170
+ - With few traces a value can coincide by chance. Writes refuse the cases it can detect (a request
171
+ value that also appears in an earlier output, two output fields with the same value, a numeric
172
+ constant), but a coincidence across only two traces can still bind to the wrong source.
173
+ - An id written with a prefix (`ORD-9001` for tool value `9001`) binds only when every trace uses
174
+ the same prefix. Numbers written like `1,234` are not matched in requests, so those requests go
175
+ to the plain agent.
176
+ - Traces recorded before milestone 2 carry no schema hashes, so they are never used for compiling.
177
+ - Branching refuses when two different values both separate the groups (a coincidence is likelier
178
+ than a decision) or when a write happens before the branch value is read.
179
+ - Branches need a categorical discriminator: a boolean or a short, digit-free string read in a step
180
+ before the groups diverge. A request kind whose tool sequence is a strict prefix of another's
181
+ cannot be separated and is refused as ambiguous. The router runs a skill only for a request whose
182
+ wording (with parameter values masked) matches one it was learned from, and a branched skill with
183
+ a writing branch is refused unless all its groups were worded alike, so a paraphrase goes to the
184
+ plain agent. Fallback runs are never compiled.
185
+ - Loops over lists are not compiled. A *read* argument may be taken from a list item past the first
186
+ (for example the password of one account in a list of accounts); the item's fields are then guarded
187
+ so a reordered list fails a guard. This is refused unless some field of the item is identical in
188
+ every trace. The item is still found by position: if two items share that identifying value, the
189
+ guard cannot tell them apart (a known limitation). A *write* argument is never taken from a later
190
+ list item directly.
191
+ - A value the model computed itself (a maximum, a sum, a choice among items) is not traceable to any
192
+ tool output, so a step that passes it on is refused.
193
+ - Retried runs (a failed step followed by a retry) are not compiled.
194
+ - A request value that also appears in an earlier tool output is refused for writes (the source is
195
+ ambiguous), except when the output merely echoes the request value.
196
+ - Bookkeeping that fails after a run's tools already ran (an unsavable trace, a compile error) is
197
+ reported in `Wrapped.problems` / `Wrapped.refusals`, never raised.
198
+ - Skills live as long as the `Wrapped` object; one database file is assumed to serve one agent.
199
+ - A tripped circuit breaker is not re-armed by hand; only new evidence (a new request kind or a
200
+ schema change) produces a new skill. The router cost used by the ROI gate is an estimate until
201
+ real runs have been observed.
202
+
203
+ ## Results
204
+
205
+ See the measured-results table under "Evaluation" above. Every number there comes from a script in
206
+ `benchmarks/` with its command; the compiler spends no tokens (it is deterministic Python).
207
+
208
+ ## Development
209
+
210
+ ```bash
211
+ pip install -e ".[dev]"
212
+ ruff check . && mypy --strict src tests && pytest
213
+ ```
214
+
215
+ ## Prior work
216
+
217
+ Closest published work, to be read and cited, not claimed missing: TraceCompiler (arXiv 2608.02680),
218
+ which compiles agent traces offline and states it has no runtime; ReTrace (2611.14492), AgentPRO
219
+ (2611.00628) and SkillCache (2611.10022). See [docs/prior-work-notes.md](docs/prior-work-notes.md).
220
+
221
+ ## License
222
+
223
+ Apache-2.0.
@@ -0,0 +1,32 @@
1
+ agent_jit/__init__.py,sha256=lTgkg4MLKJYjIGXyZmx0y86PiFrNUn1mR9_nUC2iLvg,171
2
+ agent_jit/branches.py,sha256=gXa6P8Fo0V0-yFizik9zMS3qVvREHQaXnkduEnHxv_c,2752
3
+ agent_jit/compiler.py,sha256=7zrsY2WJX6Smw0PzTidgP_zbxOdajbVXcU6EEPBVXs0,26673
4
+ agent_jit/core.py,sha256=gcbHnX4bdEV-lbB0Iq_gIl5x9pgv25KwS78D89VwPuk,15760
5
+ agent_jit/demo.py,sha256=wcezK5RYN9KWXtFGRvKe9riMYxdgGEOAYfY62bE7nz0,9815
6
+ agent_jit/guards.py,sha256=x2TJW_dAWNrgOAKBgFNHsxCQIQdBpC6b2xQpF9FkyKo,6816
7
+ agent_jit/ir.py,sha256=GjNxXjUE8Kqem73Qh5mdmFYBNtrhaPvddi6hSUYkzfE,1351
8
+ agent_jit/journal.py,sha256=tFIMKiUA7Y9u0oilKD9cxYlVu64yciaIYal_fB_PDQI,8622
9
+ agent_jit/provenance.py,sha256=qds3IDNn5sNYeHPtCaNMp9fyrfkcamOkikUEAyB0kKg,17210
10
+ agent_jit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ agent_jit/roi.py,sha256=GTv6fuJKKezXloKUhAn0TRGn_3uy-n9hTrLOWOI-NhY,700
12
+ agent_jit/router.py,sha256=oST2cGI4oG_XMc4QRni3ekoUFztmcLRhIwu_54P6bK8,5266
13
+ agent_jit/runtime.py,sha256=hXH0fph1qErqUr1qbBtbv3_0pHTKhPP_Lb5wHmf23Zk,5322
14
+ agent_jit/slicer.py,sha256=FnC6VD4lQWoj3oE10U4YBdJCVqKotwYqXo3p-JZhVEI,2301
15
+ agent_jit/stats.py,sha256=oIUuoN3qEF35rCxGmUZwGYkdUC5gmDSr_MK1mVuKPiA,2513
16
+ agent_jit/store.py,sha256=wwrd1jbD15FT5CYE60p4shdEcK0WAhH1_wrvnyU-OI4,3516
17
+ agent_jit/tools.py,sha256=Jh42YBo0p9a5KibVLJk9DY-YruPJMuXYNUKyOBNYUBc,2354
18
+ agent_jit/tracer.py,sha256=ApVVePCV48-7rOzclPER5tHT_80HDqcYudk0XMQ2t1w,1871
19
+ agent_jit/adapters/__init__.py,sha256=MlybjjRBwTcUYmUd_ONjfaRFXPWQy-leT1sEUVCvWEI,89
20
+ agent_jit/adapters/anthropic.py,sha256=xFY6dc6tMmeNZ0HETSKsIrkULZcfjD1ll-Wei23-2Rs,6311
21
+ agent_jit/adapters/appworld.py,sha256=BG3Uz0k7Lb0XUe1OewbM4MRs0NEktr2INdFCv3w7oWI,3408
22
+ agent_jit/adapters/loop_agent.py,sha256=CtAf8KS_Rkitk5CP6h7L5Re-vlTVhVi5f55R2Z-NMq8,1311
23
+ agent_jit/adapters/ollama.py,sha256=b5Swi-6KHBL2-mBtwnwhowkUhKaW9jOcWfJnALW97ek,4179
24
+ agent_jit/eval/__init__.py,sha256=ClwsQhZTJIz3ZnG7I76VsIgkvHcDxoE6TLEVai478g0,84
25
+ agent_jit/eval/baselines.py,sha256=icKEcSwB5cJcswYsgMwMwbS619OCBS4a6TCnNY_UOSw,3833
26
+ agent_jit/eval/harness.py,sha256=-83GUJ5QFuggI5G34peSBlUsnOSImHoG48een9cIGJo,4627
27
+ agent_jit/eval/metrics.py,sha256=N4S_wN-h9jCT9ykkwUG5OyzAbNSJpd66oLRZPZlDUt0,1497
28
+ agent_jit/eval/supportdesk.py,sha256=pN9kFnuEcT8fKTGS5F5ZGHXZmsJ58xAjTGoqVbZ3uXU,18677
29
+ agent_jit_runtime-0.1.0.dist-info/METADATA,sha256=_43BDAfYHp5SFUp1CIScJY1hLNV6wHY2eDUCrxsWIxw,14293
30
+ agent_jit_runtime-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
31
+ agent_jit_runtime-0.1.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
32
+ agent_jit_runtime-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -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.