kestrel-feature-talon 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 (55) hide show
  1. kestrel_feature_talon-0.2.0/.github/workflows/ci.yml +168 -0
  2. kestrel_feature_talon-0.2.0/.github/workflows/publish.yml +100 -0
  3. kestrel_feature_talon-0.2.0/.gitignore +9 -0
  4. kestrel_feature_talon-0.2.0/AGENTS.md +68 -0
  5. kestrel_feature_talon-0.2.0/LICENSE +190 -0
  6. kestrel_feature_talon-0.2.0/PKG-INFO +208 -0
  7. kestrel_feature_talon-0.2.0/README.md +176 -0
  8. kestrel_feature_talon-0.2.0/kestrel_feature_talon/__init__.py +6 -0
  9. kestrel_feature_talon-0.2.0/kestrel_feature_talon/application.py +98 -0
  10. kestrel_feature_talon-0.2.0/kestrel_feature_talon/config.py +399 -0
  11. kestrel_feature_talon-0.2.0/kestrel_feature_talon/contributions.py +111 -0
  12. kestrel_feature_talon-0.2.0/kestrel_feature_talon/feature.py +6578 -0
  13. kestrel_feature_talon-0.2.0/kestrel_feature_talon/github_write.py +299 -0
  14. kestrel_feature_talon-0.2.0/kestrel_feature_talon/host.py +195 -0
  15. kestrel_feature_talon-0.2.0/kestrel_feature_talon/operator.py +2166 -0
  16. kestrel_feature_talon-0.2.0/kestrel_feature_talon/operator_state.py +602 -0
  17. kestrel_feature_talon-0.2.0/kestrel_feature_talon/process.py +374 -0
  18. kestrel_feature_talon-0.2.0/kestrel_feature_talon/prompts/signals/talon_job_complete.md +36 -0
  19. kestrel_feature_talon-0.2.0/kestrel_feature_talon/redaction.py +36 -0
  20. kestrel_feature_talon-0.2.0/kestrel_feature_talon/runtime.py +686 -0
  21. kestrel_feature_talon-0.2.0/kestrel_feature_talon/setup.py +176 -0
  22. kestrel_feature_talon-0.2.0/kestrel_feature_talon/sources/__init__.py +2 -0
  23. kestrel_feature_talon-0.2.0/kestrel_feature_talon/sources/ecosystem_roster.py +221 -0
  24. kestrel_feature_talon-0.2.0/kestrel_feature_talon/sources/fleet_coding_pipeline.py +448 -0
  25. kestrel_feature_talon-0.2.0/kestrel_feature_talon/sources/talon.py +155 -0
  26. kestrel_feature_talon-0.2.0/kestrel_feature_talon/sources/talon_pipeline.py +406 -0
  27. kestrel_feature_talon-0.2.0/kestrel_feature_talon/sources/workflow_rescue.py +658 -0
  28. kestrel_feature_talon-0.2.0/kestrel_feature_talon/static/talon.css +18 -0
  29. kestrel_feature_talon-0.2.0/kestrel_feature_talon/static/talon.js +462 -0
  30. kestrel_feature_talon-0.2.0/kestrel_feature_talon/static/talon_helpers.mjs +27 -0
  31. kestrel_feature_talon-0.2.0/kestrel_feature_talon/verification.py +497 -0
  32. kestrel_feature_talon-0.2.0/kestrel_feature_talon/wait.py +84 -0
  33. kestrel_feature_talon-0.2.0/kestrel_feature_talon/wait_provider.py +174 -0
  34. kestrel_feature_talon-0.2.0/pyproject.toml +76 -0
  35. kestrel_feature_talon-0.2.0/tests/conftest.py +20 -0
  36. kestrel_feature_talon-0.2.0/tests/fixtures/sovereign-0.52.0-talon-tools.json +439 -0
  37. kestrel_feature_talon-0.2.0/tests/generate_parity_fixture.py +88 -0
  38. kestrel_feature_talon-0.2.0/tests/js/test_talon_helpers.mjs +45 -0
  39. kestrel_feature_talon-0.2.0/tests/test_a2a.py +140 -0
  40. kestrel_feature_talon-0.2.0/tests/test_config_and_feature.py +491 -0
  41. kestrel_feature_talon-0.2.0/tests/test_contributions.py +172 -0
  42. kestrel_feature_talon-0.2.0/tests/test_github_checks.py +416 -0
  43. kestrel_feature_talon-0.2.0/tests/test_github_write.py +50 -0
  44. kestrel_feature_talon-0.2.0/tests/test_operator_api.py +2518 -0
  45. kestrel_feature_talon-0.2.0/tests/test_parity_contract.py +232 -0
  46. kestrel_feature_talon-0.2.0/tests/test_process.py +712 -0
  47. kestrel_feature_talon-0.2.0/tests/test_redaction.py +93 -0
  48. kestrel_feature_talon-0.2.0/tests/test_runtime.py +403 -0
  49. kestrel_feature_talon-0.2.0/tests/test_setup.py +83 -0
  50. kestrel_feature_talon-0.2.0/tests/test_sources_and_observability.py +224 -0
  51. kestrel_feature_talon-0.2.0/tests/test_stock_host_context.py +226 -0
  52. kestrel_feature_talon-0.2.0/tests/test_verification.py +65 -0
  53. kestrel_feature_talon-0.2.0/tests/test_wait_provider.py +153 -0
  54. kestrel_feature_talon-0.2.0/tests/test_workspace.py +41 -0
  55. kestrel_feature_talon-0.2.0/uv.lock +3542 -0
@@ -0,0 +1,168 @@
1
+ name: kestrel-feature-talon CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, 'release/*', 'codex/*', 'feat/*', 'fix/*', 'extract/*']
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+ workflow_call:
10
+ inputs:
11
+ ref:
12
+ required: false
13
+ type: string
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ lock:
20
+ name: Check uv lockfile
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ ref: ${{ inputs.ref || github.ref }}
26
+ - uses: astral-sh/setup-uv@v7
27
+ - run: uv lock --check
28
+
29
+ test:
30
+ name: Test Python ${{ matrix.python-version }}
31
+ runs-on: ubuntu-latest
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ python-version: ['3.11', '3.12', '3.13', '3.14']
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ with:
39
+ ref: ${{ inputs.ref || github.ref }}
40
+ - uses: astral-sh/setup-uv@v7
41
+ - run: uv python install ${{ matrix.python-version }}
42
+ - run: uv run --frozen --python ${{ matrix.python-version }} --extra test pytest -q
43
+
44
+ distribution:
45
+ name: Build and inspect distributions
46
+ needs: [lock, test]
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ with:
51
+ ref: ${{ inputs.ref || github.ref }}
52
+ - uses: astral-sh/setup-uv@v7
53
+ - run: uv python install 3.14
54
+ - run: node --check kestrel_feature_talon/static/talon.js
55
+ - run: node --test tests/js/test_talon_helpers.mjs
56
+ - run: uv build --clear --python 3.14
57
+ - name: Inspect wheel and sdist contents
58
+ run: |
59
+ python - <<'PY'
60
+ from email.parser import Parser
61
+ from glob import glob
62
+ from pathlib import PurePosixPath
63
+ import tarfile
64
+ import zipfile
65
+
66
+ wheels = glob("dist/*.whl")
67
+ sdists = glob("dist/*.tar.gz")
68
+ assert len(wheels) == 1, wheels
69
+ assert len(sdists) == 1, sdists
70
+
71
+ required = {
72
+ "kestrel_feature_talon/__init__.py",
73
+ "kestrel_feature_talon/application.py",
74
+ "kestrel_feature_talon/config.py",
75
+ "kestrel_feature_talon/feature.py",
76
+ "kestrel_feature_talon/github_write.py",
77
+ "kestrel_feature_talon/host.py",
78
+ "kestrel_feature_talon/operator.py",
79
+ "kestrel_feature_talon/operator_state.py",
80
+ "kestrel_feature_talon/runtime.py",
81
+ "kestrel_feature_talon/static/talon.css",
82
+ "kestrel_feature_talon/static/talon_helpers.mjs",
83
+ "kestrel_feature_talon/static/talon.js",
84
+ "kestrel_feature_talon/verification.py",
85
+ "kestrel_feature_talon/wait_provider.py",
86
+ "kestrel_feature_talon/prompts/signals/talon_job_complete.md",
87
+ }
88
+ with zipfile.ZipFile(wheels[0]) as archive:
89
+ wheel_names = set(archive.namelist())
90
+ print("\n".join(sorted(wheel_names)))
91
+ assert not required - wheel_names, sorted(required - wheel_names)
92
+ assert not any(
93
+ name.startswith(("tests/", ".github/"))
94
+ or "__pycache__" in name
95
+ or name.endswith((".pyc", ".pyo"))
96
+ for name in wheel_names
97
+ )
98
+ entry_points = next(
99
+ name for name in wheel_names if name.endswith(".dist-info/entry_points.txt")
100
+ )
101
+ entry_text = archive.read(entry_points).decode()
102
+ assert "[kestrel_sovereign.features]" in entry_text
103
+ assert "[kestrel_sovereign.host_features]" in entry_text
104
+ assert (
105
+ "TalonCoordinatorFeature = "
106
+ "kestrel_feature_talon.feature:TalonCoordinatorFeature"
107
+ ) in entry_text
108
+ metadata_path = next(
109
+ name for name in wheel_names if name.endswith(".dist-info/METADATA")
110
+ )
111
+ metadata = Parser().parsestr(archive.read(metadata_path).decode())
112
+ assert {
113
+ "fastapi<1,>=0.115",
114
+ "kestrel-feature-workflows<0.6,>=0.5",
115
+ "kestrel-sovereign<0.53,>=0.52.0",
116
+ "kestrel-sovereign-sdk<0.37,>=0.36.0",
117
+ } <= set(metadata.get_all("Requires-Dist"))
118
+
119
+ with tarfile.open(sdists[0], "r:gz") as archive:
120
+ sdist_names = [PurePosixPath(name) for name in archive.getnames()]
121
+ print("\n".join(str(name) for name in sorted(sdist_names)))
122
+ assert any(name.name == "pyproject.toml" for name in sdist_names)
123
+ assert any(name.name == "uv.lock" for name in sdist_names)
124
+ assert any(
125
+ str(name).endswith(
126
+ "kestrel_feature_talon/prompts/signals/talon_job_complete.md"
127
+ )
128
+ for name in sdist_names
129
+ )
130
+ PY
131
+ - name: Clean-install and import built wheel
132
+ run: |
133
+ expected_version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
134
+ export EXPECTED_VERSION="$expected_version"
135
+ uv venv --python 3.14 .venv-wheel-smoke
136
+ uv pip install --python .venv-wheel-smoke/bin/python --no-cache dist/*.whl
137
+ smoke_dir="$(mktemp -d)"
138
+ cd "$smoke_dir"
139
+ env -u PYTHONPATH "$GITHUB_WORKSPACE/.venv-wheel-smoke/bin/python" -P - <<'PY'
140
+ from importlib.metadata import entry_points, version
141
+ import os
142
+ from pathlib import Path
143
+
144
+ from kestrel_feature_talon import TalonCoordinatorFeature
145
+ from kestrel_feature_talon.sources.fleet_coding_pipeline import (
146
+ WORKFLOW_NAME,
147
+ build_fleet_coding_pipeline_spec,
148
+ )
149
+ from kestrel_sdk.features.base import Feature
150
+ from kestrel_feature_workflows import WorkflowSpec
151
+
152
+ assert "PYTHONPATH" not in os.environ
153
+ source_package = Path(os.environ["GITHUB_WORKSPACE"]) / "kestrel_feature_talon"
154
+ installed_package = Path(__import__("kestrel_feature_talon").__file__).parent
155
+ assert installed_package.resolve() != source_package.resolve()
156
+ assert version("kestrel-feature-talon") == os.environ["EXPECTED_VERSION"]
157
+ assert issubclass(TalonCoordinatorFeature, Feature)
158
+ fleet_spec = build_fleet_coding_pipeline_spec()
159
+ assert isinstance(fleet_spec, WorkflowSpec)
160
+ assert fleet_spec.name == WORKFLOW_NAME
161
+ matches = [
162
+ ep
163
+ for ep in entry_points(group="kestrel_sovereign.features")
164
+ if ep.name == "TalonCoordinatorFeature"
165
+ ]
166
+ assert len(matches) == 1
167
+ assert matches[0].load() is TalonCoordinatorFeature
168
+ PY
@@ -0,0 +1,100 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ['v[0-9]+.[0-9]+.[0-9]+']
6
+ workflow_dispatch:
7
+ inputs:
8
+ ref:
9
+ description: 'Release tag to publish (for example, v0.1.0)'
10
+ required: true
11
+ type: string
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ validate:
18
+ name: Validate release tag and version
19
+ runs-on: ubuntu-latest
20
+ outputs:
21
+ tag: ${{ steps.release.outputs.tag }}
22
+ version: ${{ steps.release.outputs.version }}
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0
27
+ ref: ${{ inputs.ref || github.ref }}
28
+ - id: release
29
+ name: Match tag to project version
30
+ env:
31
+ INPUT_REF: ${{ inputs.ref }}
32
+ run: |
33
+ release_tag="${INPUT_REF:-$GITHUB_REF_NAME}"
34
+ if [[ ! "$release_tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
35
+ echo "Release ref must be a stable vMAJOR.MINOR.PATCH tag: $release_tag" >&2
36
+ exit 1
37
+ fi
38
+ tag_commit="$(git rev-list -n 1 "$release_tag")"
39
+ test -n "$tag_commit"
40
+ test "$tag_commit" = "$(git rev-parse HEAD)"
41
+ package_version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
42
+ test "$release_tag" = "v$package_version"
43
+ echo "tag=$release_tag" >> "$GITHUB_OUTPUT"
44
+ echo "version=$package_version" >> "$GITHUB_OUTPUT"
45
+
46
+ ci:
47
+ needs: validate
48
+ uses: ./.github/workflows/ci.yml
49
+ with:
50
+ ref: ${{ needs.validate.outputs.tag }}
51
+
52
+ build:
53
+ needs: [validate, ci]
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ with:
58
+ ref: ${{ needs.validate.outputs.tag }}
59
+ - uses: astral-sh/setup-uv@v7
60
+ - run: uv build --clear
61
+ - name: Verify built metadata version
62
+ env:
63
+ EXPECTED_VERSION: ${{ needs.validate.outputs.version }}
64
+ run: |
65
+ python - <<'PY'
66
+ from email.parser import BytesParser
67
+ from glob import glob
68
+ import os
69
+ import zipfile
70
+
71
+ wheels = glob("dist/*.whl")
72
+ assert len(wheels) == 1, wheels
73
+ with zipfile.ZipFile(wheels[0]) as archive:
74
+ metadata_name = next(
75
+ name for name in archive.namelist() if name.endswith(".dist-info/METADATA")
76
+ )
77
+ metadata = BytesParser().parsebytes(archive.read(metadata_name))
78
+ assert metadata["Name"] == "kestrel-feature-talon"
79
+ assert metadata["Version"] == os.environ["EXPECTED_VERSION"]
80
+ PY
81
+ - uses: actions/upload-artifact@v4
82
+ with:
83
+ name: dist
84
+ path: dist/
85
+ if-no-files-found: error
86
+
87
+ publish:
88
+ needs: build
89
+ runs-on: ubuntu-latest
90
+ environment:
91
+ name: pypi
92
+ url: https://pypi.org/p/kestrel-feature-talon
93
+ permissions:
94
+ id-token: write
95
+ steps:
96
+ - uses: actions/download-artifact@v4
97
+ with:
98
+ name: dist
99
+ path: dist/
100
+ - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .kestreltalon/
7
+ dist/
8
+ build/
9
+ *.egg-info/
@@ -0,0 +1,68 @@
1
+ # kestrel-feature-talon — Agent Instructions
2
+
3
+ This repository contains the publishable Talon runtime feature extracted from
4
+ Kestrel Sovereign. Keep it portable: import framework contracts from
5
+ `kestrel_sdk` and public `kestrel_sovereign` APIs only. Never add an editable
6
+ or path-based dependency on a sibling checkout.
7
+
8
+ Runtime paths must be supplied by feature configuration or host context. Do
9
+ not infer paths from `__file__` or sibling checkout layout.
10
+
11
+ ## Entry points
12
+
13
+ - Python distribution: `kestrel-feature-talon` (version `0.2.0`).
14
+ - Agent discovery group: `kestrel_sovereign.features`.
15
+ - Host discovery group: `kestrel_sovereign.host_features`.
16
+ - Entry-point name: `TalonCoordinatorFeature`.
17
+ - Entry-point target:
18
+ `kestrel_feature_talon.feature:TalonCoordinatorFeature`.
19
+ - Host entry-point name/target:
20
+ `TalonHostFeature = kestrel_feature_talon.host:TalonHostFeature`.
21
+ - Optional SDK setup step: `kestrel setup talon`.
22
+
23
+ ## Key files
24
+
25
+ - `pyproject.toml` — release metadata, dependencies, entry point, and Hatch
26
+ wheel/sdist contents.
27
+ - `kestrel_feature_talon/feature.py` — SDK feature entry point, tools, health,
28
+ and configuration contract.
29
+ - `kestrel_feature_talon/config.py` — explicit runtime paths and atomic TOML
30
+ adapter.
31
+ - `kestrel_feature_talon/contributions.py` — SDK service, wait, workflow,
32
+ permissions, and setup registrations.
33
+ - `kestrel_feature_talon/runtime.py` — backend/auth/model policy and environment
34
+ handling.
35
+ - `kestrel_feature_talon/setup.py` — optional credential setup step.
36
+ - `kestrel_feature_talon/process.py` — bounded subprocess and process-tree
37
+ cleanup.
38
+ - `kestrel_feature_talon/github_write.py` — pure bounded GitHub write request
39
+ builder.
40
+ - `kestrel_feature_talon/verification.py` — test evidence vocabulary and
41
+ verifier.
42
+ - `kestrel_feature_talon/wait_provider.py` — generic Talon job wait provider.
43
+ - `kestrel_feature_talon/sources/` — completion, pipeline, fleet, and rescue
44
+ workflow sources.
45
+ - `tests/fixtures/sovereign-0.52.0-talon-tools.json` — frozen predecessor tool
46
+ schema used by parity tests.
47
+ - `.github/workflows/ci.yml` — Python compatibility and distribution smoke
48
+ tests.
49
+ - `.github/workflows/publish.yml` — validated-tag trusted PyPI publishing.
50
+
51
+ ## Exact verification
52
+
53
+ Run the locked complete test suite and build exactly as follows:
54
+
55
+ ```bash
56
+ uv lock --check
57
+ uv run --extra test pytest -q
58
+ uv build
59
+ git diff --check
60
+ ```
61
+
62
+ The complete suite is all `tests/test_*.py` files. In particular,
63
+ `tests/test_parity_contract.py` and `tests/test_contributions.py` freeze the
64
+ entry point, 16-tool schema, permissions, workflows, and package assets;
65
+ `tests/test_config_and_feature.py` and `tests/test_runtime.py` freeze portable
66
+ configuration and runtime safety; and the remaining test modules cover A2A,
67
+ process cleanup, GitHub writes, setup, sources/observability, verification,
68
+ waits, and workspace containment.
@@ -0,0 +1,190 @@
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 the Licensor for inclusion in the Work by the copyright
52
+ owner or by an individual or Legal Entity authorized to submit on behalf
53
+ of 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
95
+ Derivative 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,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative 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
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying 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
+ Copyright 2024-2026 Kestrel Sovereign AI Project
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.