loci-tools 0.1.94__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 (67) hide show
  1. loci_tools-0.1.94/.gitignore +36 -0
  2. loci_tools-0.1.94/CLAUDE.md +201 -0
  3. loci_tools-0.1.94/LICENSE.md +216 -0
  4. loci_tools-0.1.94/PKG-INFO +234 -0
  5. loci_tools-0.1.94/docs/auth-testing.md +63 -0
  6. loci_tools-0.1.94/docs/cli-local-testing.md +399 -0
  7. loci_tools-0.1.94/docs/cli-migration-plan.md +320 -0
  8. loci_tools-0.1.94/docs/commands.md +49 -0
  9. loci_tools-0.1.94/docs/sorting-decisions.md +66 -0
  10. loci_tools-0.1.94/pyproject.toml +48 -0
  11. loci_tools-0.1.94/src/loci/cli/__init__.py +26 -0
  12. loci_tools-0.1.94/src/loci/cli/_capture.py +120 -0
  13. loci_tools-0.1.94/src/loci/cli/_config.py +66 -0
  14. loci_tools-0.1.94/src/loci/cli/_credstore.py +244 -0
  15. loci_tools-0.1.94/src/loci/cli/_errors.py +62 -0
  16. loci_tools-0.1.94/src/loci/cli/_format.py +278 -0
  17. loci_tools-0.1.94/src/loci/cli/_json.py +83 -0
  18. loci_tools-0.1.94/src/loci/cli/_log.py +88 -0
  19. loci_tools-0.1.94/src/loci/cli/_oauth.py +299 -0
  20. loci_tools-0.1.94/src/loci/cli/_session.py +52 -0
  21. loci_tools-0.1.94/src/loci/cli/_tls.py +47 -0
  22. loci_tools-0.1.94/src/loci/cli/auth.py +247 -0
  23. loci_tools-0.1.94/src/loci/cli/backend.py +146 -0
  24. loci_tools-0.1.94/src/loci/cli/build.py +1419 -0
  25. loci_tools-0.1.94/src/loci/cli/cli.py +144 -0
  26. loci_tools-0.1.94/src/loci/cli/elf.py +1367 -0
  27. loci_tools-0.1.94/src/loci/cli/flag_sources/__init__.py +276 -0
  28. loci_tools-0.1.94/src/loci/cli/flag_sources/build_root.py +328 -0
  29. loci_tools-0.1.94/src/loci/cli/flag_sources/compile_commands.py +130 -0
  30. loci_tools-0.1.94/src/loci/cli/flag_sources/compiler_match.py +152 -0
  31. loci_tools-0.1.94/src/loci/cli/flag_sources/flags_normalize.py +91 -0
  32. loci_tools-0.1.94/src/loci/cli/flag_sources/gmake_dryrun.py +427 -0
  33. loci_tools-0.1.94/src/loci/cli/flag_sources/linked_elf_dwarf.py +159 -0
  34. loci_tools-0.1.94/src/loci/cli/flag_sources/makefile_regex.py +161 -0
  35. loci_tools-0.1.94/src/loci/cli/flag_sources/projectspec_xml.py +140 -0
  36. loci_tools-0.1.94/src/loci/cli/flag_sources/response_file.py +95 -0
  37. loci_tools-0.1.94/src/loci/cli/flag_sources/same_stem_dwarf.py +141 -0
  38. loci_tools-0.1.94/src/loci/cli/flag_sources/sibling_obj_dwarf.py +128 -0
  39. loci_tools-0.1.94/src/loci/cli/flag_sources/stdlib_headers.py +80 -0
  40. loci_tools-0.1.94/src/loci/cli/flag_sources/user_override.py +228 -0
  41. loci_tools-0.1.94/src/loci/cli/lifecycle.py +145 -0
  42. loci_tools-0.1.94/src/loci/cli/scan.py +225 -0
  43. loci_tools-0.1.94/src/loci/cli/stats.py +1163 -0
  44. loci_tools-0.1.94/src/loci/cli/timing.py +170 -0
  45. loci_tools-0.1.94/src/loci/cli/usage.py +30 -0
  46. loci_tools-0.1.94/tests/__init__.py +0 -0
  47. loci_tools-0.1.94/tests/conftest.py +96 -0
  48. loci_tools-0.1.94/tests/fixtures/__init__.py +0 -0
  49. loci_tools-0.1.94/tests/fixtures/asm_samples.py +41 -0
  50. loci_tools-0.1.94/tests/fixtures/csv_samples.py +30 -0
  51. loci_tools-0.1.94/tests/integration/__init__.py +0 -0
  52. loci_tools-0.1.94/tests/integration/test_elf_build_integration.py +160 -0
  53. loci_tools-0.1.94/tests/unit/__init__.py +0 -0
  54. loci_tools-0.1.94/tests/unit/test_auth.py +471 -0
  55. loci_tools-0.1.94/tests/unit/test_auth_gate.py +138 -0
  56. loci_tools-0.1.94/tests/unit/test_build_handlers.py +101 -0
  57. loci_tools-0.1.94/tests/unit/test_capture.py +51 -0
  58. loci_tools-0.1.94/tests/unit/test_cli_skeleton.py +140 -0
  59. loci_tools-0.1.94/tests/unit/test_config.py +113 -0
  60. loci_tools-0.1.94/tests/unit/test_elf_handlers.py +370 -0
  61. loci_tools-0.1.94/tests/unit/test_elf_helpers.py +147 -0
  62. loci_tools-0.1.94/tests/unit/test_format.py +120 -0
  63. loci_tools-0.1.94/tests/unit/test_lifecycle.py +59 -0
  64. loci_tools-0.1.94/tests/unit/test_scan_snapshot.py +137 -0
  65. loci_tools-0.1.94/tests/unit/test_stats.py +216 -0
  66. loci_tools-0.1.94/tests/unit/test_timing_usage.py +324 -0
  67. loci_tools-0.1.94/uv.lock +2324 -0
@@ -0,0 +1,36 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ .venv/
8
+ venv/
9
+ ENV/
10
+
11
+ # Python build artifacts (loci_cli wheel)
12
+ dist/
13
+ build/
14
+ *.egg-info/
15
+
16
+ # Test / tooling caches
17
+ .pytest_cache/
18
+ .ruff_cache/
19
+
20
+ # IDE
21
+ .vscode/
22
+ .idea/
23
+ *.swp
24
+ *.swo
25
+ *~
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # Logs / runtime state
32
+ *.log
33
+ state/
34
+
35
+ # LOCI analysis artifacts (elf/build outputs: symbols, chunks, meta sidecars, …)
36
+ .loci-build/
@@ -0,0 +1,201 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## What this is
6
+
7
+ `loci` is the single console-script front door (`loci <group> <command>`) to LOCI's analysis
8
+ primitives — ELF/build inspection, backend timing/energy prediction, and telemetry verbs. It
9
+ **wraps** primitives and emits JSON; it does **not** orchestrate them — the plugin's skills/hooks
10
+ remain the decision maker and call `loci ...` instead of raw scripts.
11
+
12
+ The import package is `loci.cli`; the distribution is `loci_cli` and the console script is `loci`
13
+ (entry point `loci = loci.cli.cli:main`). `loci` is a PEP 420 **namespace package** shared with the
14
+ slicer (`loci.service.asmslicer`), so the two distributions install side by side — there must be no
15
+ `src/loci/__init__.py`.
16
+
17
+ ## Migration phase — important
18
+
19
+ The repo is mid-migration. **Wired so far:**
20
+ - **Phase 1 (Auth & session):** `loci login`, `loci logout`, `loci auth status`, `loci auth
21
+ get-token` (`auth.py` + `_oauth.py` + `_credstore.py`; see the Auth bullet under Conventions).
22
+ - **Phase 2 (Local ELF + build):** `loci elf *` (`elf.py` ← `lib/asm_analyze.py`, via the
23
+ `loci.service.asmslicer` wheel) and `loci build *` (`build.py` + `flag_sources/` ←
24
+ `lib/build_metadata.py`).
25
+ - **Phase 3 (Backend prediction & usage):** `loci timing` and `loci usage` (`timing.py`,
26
+ `usage.py`, `backend.py`). These call the **loci-app REST endpoints** directly (`backend.py` is a
27
+ stdlib-`urllib` Bearer client): `timing` → `POST /api/timing` (SageMaker-backed prediction; built
28
+ in loci-app for this phase), `usage` → `GET /api/eligibility` + `GET /api/usage` merged. `energy_ws`
29
+ is computed in `sagemaker.ts` as `power_consumption_per_ns × execution_time_ns` (arch-dependent
30
+ constant, mirroring loci-agent's `calculate_power_consumption_change`).
31
+ - **Phase 4 (Telemetry):** `loci stats *` + the `loci trends` alias (`stats.py` ← `lib/loci_stats.py`).
32
+ `flush-impacts` (hidden Stop-hook verb) is fully wired — it POSTs to `$LOCI_IMPACT_ENDPOINT`
33
+ (default app.auroralabs.com/impact/v1) with the separate `~/.loci/impact-token.json`.
34
+ - **Phase 4 (Lifecycle):** `loci doctor` (`lifecycle.py`) — read-only, Python-native env/toolchain
35
+ diagnostics; emits `{ok,data:{checks,healthy,report}}` and exits non-zero only when a *required*
36
+ check fails (so a shell can gate; the agent reads `data.healthy`).
37
+
38
+ **Migration complete — no stubs remain.** Every command has real logic. The old `loci init`
39
+ placeholder was **removed** (it was a never-wired `stub()`; if a project-setup verb is ever needed
40
+ it will be designed from scratch, Python-native — not a port of `lib/detect-project.sh`), and
41
+ `_stub.py` went with it.
42
+
43
+ ## Commands
44
+
45
+ Targets Python 3.12. Packaged with hatchling via `pyproject.toml` (src layout); the wheel ships
46
+ `loci/cli/` and installs a `loci` console script (`loci = loci.cli.cli:main`).
47
+
48
+ uv venv --python 3.12 # one-time
49
+ uv pip install -e ".[test]" # editable install + pytest
50
+ uv run loci --help # run the CLI
51
+ uv run pytest # full suite (markers + 120s timeout from pyproject)
52
+ uv run pytest tests/unit/test_auth_gate.py # the login gate
53
+
54
+ The bare-`loci` PATH shims (`bin/loci`, `bin/loci.cmd`) live in the **plugin** repo, not here —
55
+ this repo is just the installable package the shims run via `uv run`.
56
+
57
+ ## Layout
58
+
59
+ The package lives in `src/loci/cli/`; modules use relative imports (`from . import _log`) and are
60
+ imported as `loci.cli.<module>`. There is **no** `src/loci/__init__.py` — `loci` must stay a
61
+ namespace package. `tests/unit/test_cli_skeleton.py` asserts the command *surface* and dispatcher
62
+ contract; `tests/unit/test_auth.py` covers Phase-1 auth *behavior*; `tests/conftest.py` has an
63
+ autouse fixture that isolates the credential store (forces the 0600-file fallback at a temp path,
64
+ no keyring) so the suite never touches the developer's real keyring or `~/.loci`.
65
+
66
+ - `src/loci/cli/cli.py` — entry point. Builds the parser, routes to the handler each group registered, and is
67
+ the **single error-rendering path** (see below).
68
+ - Group modules, each exposing `register(subparsers)` and self-registered in `cli._GROUPS`:
69
+ `auth.py` (login/logout/auth), `elf.py`, `build.py`, `timing.py`, `usage.py`, `stats.py`
70
+ (+ the top-level `trends` alias), `lifecycle.py` (`doctor`). Adding a group = import it
71
+ in `cli.py`, add it to `_GROUPS`, and give it a `register()`.
72
+ - Internal helpers (underscore-prefixed): `_errors.py`, `_json.py`, `_format.py` (the
73
+ output-serialization seam behind `--format`/`--payload-format`), `_log.py`,
74
+ `_credstore.py` (keyring + 0600-file credential store), `_oauth.py` (PKCE flow; the token-model seam),
75
+ `_session.py` (the login gate — one "is there a usable session?" rule, shared by the dispatcher and `backend`).
76
+ - `docs/cli-migration-plan.md` — the full design and the per-phase plan for moving real logic in.
77
+
78
+ ## Cross-cutting contracts — respect these when adding/wiring commands
79
+
80
+ **Two-channel error model (`_errors.py`).** Distinguish the two consumers:
81
+ - `ExitCode` (int, for shells/hooks/CI) — every handled error exits non-zero. `OK=0 RUNTIME=1
82
+ USAGE=2 AUTH_REQUIRED=3 BACKEND=4 NOT_IMPLEMENTED=5`. `loci auth status` exiting non-zero is how
83
+ a shell gates the plugin lock.
84
+ - `ErrorCode` (stable string, for deterministic branching by skills) — a **closed, minimal** set
85
+ (`auth_required`, `quota_exceeded`, `not_implemented`). Most errors carry only a `message` and
86
+ **no** code. Add a code only when a caller must tell this error apart and act differently —
87
+ never as blanket ceremony.
88
+
89
+ Raise `LociError(message, *, exit_code=..., code=..., **details)` for any handled failure.
90
+ `cli.main` is the only place that catches it, logs it, renders the envelope to **stdout**, and
91
+ returns the exit code. Do not print errors or call `sys.exit` from handlers.
92
+
93
+ **Self-describing JSON on stdout (`_json.py`).** The primary consumer is an agent that captures
94
+ the body and parses it — not a shell branching on `$?`. So every invocation emits **one**
95
+ self-describing document on **stdout**: success is `{"ok": true, "data": {...}}`
96
+ (`success_envelope`), failure is `{"ok": false, "error": {message, code?}}` (rendered centrally by
97
+ `cli.main`). The agent reads `.ok` then `.data`/`.error`; the non-zero exit code still gates
98
+ shells/hooks (`auth status`). stderr carries only human/diagnostic logs. Potentially large output
99
+ (assembly, CFG, the symbol table) is written to files and `data` carries the **paths** (+ a count
100
+ for `symbols`; default dir `.loci-build/elf/<elf-stem>/`), keeping stdout small. This is what retires `jq`-greps-on-error from the pipelines. **Every emitted path is posix-normalized** (forward slashes on all platforms — build a path with `Path`, then stringify with `_json.posix()`, never `str()`, so the JSON is identical on Windows/POSIX and stays valid input to downstream `loci` verbs and Git Bash). Both groups
101
+ (`elf`, `build`) follow this; `build diff` divergence is a *finding* (`ok:true`, `data.match:false`,
102
+ exit 0), not an error, and `--verbose` adds the rendered human block as `data.report`.
103
+ **One carve-out:** a verb whose stdout is a *raw* value rather than an envelope sets
104
+ `set_defaults(raw_output=True)` so `cli.main` renders its error to **stderr** instead, keeping
105
+ stdout clean — only `auth get-token` (bare token for `TOKEN=$(loci auth get-token)`) uses it.
106
+
107
+ **Switchable serialization — two independent axes (`_format.py`).** JSON is the **default** but
108
+ not the only shape; the serializer is a tuning knob (agents read different formats at different
109
+ token cost/accuracy, and we benchmark them):
110
+ - **Envelope axis — `--format`/`-f` (global, every command).** Selects how the *status envelope*
111
+ above is serialized. `_json.emit` (the single render path for both success and the central error
112
+ case) routes through `_format.render_envelope`, so the flag is honored everywhere via one seam;
113
+ `cli.main` calls `_json.configure(args.format)` once. Envelope formats are `json`, `yaml`,
114
+ `toon`, `csv`, `tsv`, `md` (`_format.ENVELOPE`) — **`ndjson` is deliberately excluded**: an
115
+ envelope is a single document, not a record stream, so ndjson only ever yielded a header-only
116
+ line (it stays on the payload axis). **Document** formats (`json`, `yaml`, `toon`, `md`) hold the
117
+ nested `{ok,data}` as-is; **tabular** formats (`csv`, `tsv`) render the envelope's *principal
118
+ collection* (first list-of-records under `data`) as the table and put status on a leading `#`
119
+ comment line (`# ok=true count=…`) — the exit code still carries success/failure. Wired as a
120
+ top-level arg plus a shared parent parser on every leaf
121
+ (`default=SUPPRESS` on the parent, so `loci -f csv elf symbols` and `loci elf symbols -f csv`
122
+ both work without the leaf clobbering the pre-command value). The two stdout carve-outs are
123
+ unaffected: `get-token` is raw (no envelope), and `stats flush-impacts`/`_compute_impact` print
124
+ fixed JSON for their hook consumer.
125
+ - **Payload axis — `--payload-format` (per-command).** Selects how a *file-backed payload* is
126
+ serialized, **independently** of the envelope (a `json` envelope can point at a `csv` file). The
127
+ handler reads `args.payload_format` and calls `_format.render_rows`; the written file's extension
128
+ follows (`_format.ext_for`) and `data.payload_format` reports it. **Each command owns its own
129
+ default and allowed set** — some payloads are inherently text (assembly, CFG) or a fixed backend
130
+ protocol (the `elf asm` timing CSV feeds `loci timing`) and have no switchable form. Today
131
+ only **`elf symbols`** opts in (default `json`; allowed json/csv/tsv/ndjson/toon/md). Add
132
+ serializers in `_format.py` (yaml needs `pyyaml`; the rest are stdlib or the hand-rolled TOON
133
+ encoder — the PyPI `toon` package is an unrelated library).
134
+
135
+ **Logging (`_log.py`).** Use `_log.info/warn/error/debug(source, msg)`. No-op unless
136
+ `$LOCI_LOG_LEVEL` ∈ DEBUG/INFO/WARN/ERROR; writes to `$LOCI_STATE_DIR/loci.log` (default
137
+ `~/.loci/state/loci.log`) in the shared LOCI log format. Logging never raises.
138
+
139
+ **Handler return convention.** A handler returns `None` (→ exit 0) or an int exit code; `cli.main`
140
+ maps `None→OK`. `KeyboardInterrupt→130`, `BrokenPipeError→OK`.
141
+
142
+ **Login gate (`_session.py`).** `loci` requires a valid session for **every** command except the
143
+ ones that must run signed out. `cli.main`, right before dispatching, calls
144
+ `_session.require_session()` unless the leaf parser marked itself
145
+ `set_defaults(public=True)` — so the gate is **fail-closed**: a new command is gated until it opts
146
+ out, and the gate raises the canonical `auth_required` `LociError` (exit 3, stable code, blocked
147
+ command in `details`) through the single error path above. The **public** (signed-out) verbs are
148
+ `login`, `logout`, `auth status`, `auth get-token`, `doctor` (its own probe reports the session
149
+ state), and the internal `stats flush-impacts` (fires from the Stop hook regardless of session,
150
+ carries its own `impact-token`, and must stay silent). `_session.load_valid_session()` — presence +
151
+ non-expired, purely local — is the one validity rule, reused by `backend._bearer` so the CLI gate
152
+ and the Bearer path agree. (For a normal CLI call the dispatcher gate short-circuits before
153
+ `_bearer`; the backend keeps its own check as a direct-call backstop.) In tests, the autouse fixture
154
+ leaves the store signed out, so gated-command suites opt into a session via
155
+ `pytestmark = [..., pytest.mark.usefixtures("signed_in")]` (`tests/conftest.py`).
156
+
157
+ ## Conventions
158
+
159
+ - `--arch` (one of `aarch64, armv7e-m, armv6-m, tc399`) is required on every `elf` subcommand
160
+ **except** `elf memmap`, which auto-detects from the ELF.
161
+ - `stats flush-impacts` is an internal Stop-hook verb hidden from `--help` (`help=SUPPRESS`) and
162
+ `public=True` (exempt from the login gate — see the Login-gate contract above).
163
+ - `loci trends` is the top-level alias for `loci stats trend`.
164
+ - Backend commands (`timing`, `usage`) reach the network only through `backend.py` (a stdlib-
165
+ `urllib` Bearer client — no `requests`/`httpx`), against the **loci-app REST endpoints** at
166
+ `LOCI_APP_URL` (default `https://app.auroralabs.com`): `predict_timing` → `POST /api/timing`,
167
+ `get_eligibility` → `GET /api/eligibility`, `get_usage` → `GET /api/usage`. `timing` parses the
168
+ timing CSV locally (stdlib `csv`) and POSTs structured `{function_name, assembly_code}` rows; the
169
+ backend batches them into model-sized SageMaker calls (chunking lives in `sagemaker.ts`, not the
170
+ CLI) and returns rows with a backend-computed `energy_ws` (power constant × execution time).
171
+ `usage` merges eligibility (plan + quota) and the
172
+ usage dashboard — an exceeded quota is *reported* (`eligible:false` + verbatim `message`), not an
173
+ error. No/invalid/expired token → `auth_required` (exit 3); HTTP 429 → `quota_exceeded` (exit 4,
174
+ verbatim server message). Token refresh-on-401 is still deferred — an expired token is reported as
175
+ `auth_required`.
176
+ - Auth model: `loci login` runs one browser PKCE flow (Cognito), and the stored credential is
177
+ sent as `Bearer` on every backend call (`timing`, `usage`, telemetry). Storage is the OS keyring
178
+ with a 0600-file fallback (`_credstore.py`). **The token itself is the issuer seam (`_oauth.py`):**
179
+ the MVP target is one opaque, revocable session token from the loci api, but that endpoint does
180
+ not exist yet (`loci_auth` returns Cognito JWTs verbatim — no `/introspect`, no opaque store), so
181
+ Phase 1 ships the only credential every backend accepts today — the **Cognito JWT** via PKCE.
182
+ When the opaque-token endpoint lands, only `_oauth.exchange_code`/`refresh` change; `auth.py` and
183
+ `_credstore.py` do not. Output discipline: progress → stderr, JSON result → stdout, and the token
184
+ is written **only** by `get-token` (bare string, so `TOKEN=$(loci auth get-token)` works) and is
185
+ never logged. `auth status` / `get-token` are network-free (local expiry check; no auto-refresh
186
+ at Phase 1 — the Phase-3 backend client will refresh on 401).
187
+ - Credential storage falls back from the OS keyring to a 0600 file (`~/.loci/credentials.json`;
188
+ override with `LOCI_TOKEN_FILE`) on **any** keyring failure — `_credstore` catches broadly, not
189
+ just `KeyringError`. Notably on **Windows**, Credential Manager caps a credential blob at ~2.5 KB
190
+ and rejects the larger Cognito access+refresh JSON (`CredWrite` error 1783, "The stub received
191
+ bad data"), so **the file is the normal Windows path** — not an error. `login` reports which via
192
+ the `"storage"` field. Force the file (headless/SSH/WSL/Docker/CI) with `LOCI_NO_KEYRING=1`.
193
+ - **Credentials are stored per issuer** (`_credstore.env_slug`): `save` **always** writes to the
194
+ slot for the token's own issuer (`creds["issuer"]`, the auth server that minted it) — independent
195
+ of how the sign-in was requested, so a `--auth-server X` login lands in X's slot, not the ambient
196
+ env's. Reads (`load`/`clear`/`backend_in_use`, and thus `auth status` / `get-token` / every backend
197
+ call) resolve the **current** env via `_config.auth_server_url()` (`LOCI_ENV` / `LOCI_AUTH_SERVER_URL`),
198
+ so `loci login` and `LOCI_ENV=dev loci login` keep independent sessions and each read hits its own
199
+ env's slot; `auth status` echoes the resolved `auth_server`. One keyring account per env; the file
200
+ holds a `{env-slug: credential}` map (a legacy single-credential file migrates in on read). To
201
+ *use* a credential minted for a different server, point the env at that server.
@@ -0,0 +1,216 @@
1
+ # LOCI LICENSE AGREEMENT
2
+
3
+ **Last Updated: May 4, 2026**
4
+
5
+ This Loci License Agreement ("**Terms**") constitutes a legally binding contract between you ("**Developer**" or "**you**") and Aurora Labs Ltd. ("**we**," "**us**," "**our**," and "**Aurora**") and governs your access to and use of our Loci product, which may be delivered as a plugin, integration, API, service, or through any other present or future distribution mechanism (collectively, "**Loci**" or "**Services**"). These Terms, together with any specific terms, the Data Processing Addendum, Documentation, and any other documents incorporated by reference, constitute the entire "**Agreement**."
6
+
7
+ By accessing or using the Services, or otherwise interacting with Loci, you agree to be bound by this Agreement. You must be at least 18 years of age to access or use Loci. If you are accepting on behalf of a company or other legal entity and represent that you have authority to bind it, the definitions "Developer" and "you" refer to such entity. If you do not agree, you may not access or use Loci or the Services, or allow any of your personnel to do so.
8
+
9
+ ---
10
+
11
+ ## 1. Definitions
12
+
13
+ **1.1** "**Authorized Users**" means Developer's employees, independent contractors, or Developer's affiliated companies. Developer will be responsible for the acts and omissions of its Authorized Users, including any acts or omissions that, if taken (or not taken) by Developer, would constitute a breach of the Agreement.
14
+
15
+ **1.2** "**Account**" means the account created by the Developer to access and use Loci.
16
+
17
+ **1.3** "**Beta Services**" means any features, endpoints, functionalities, or components that are identified as alpha, beta, preview, early access, or evaluation, or words or phrases with similar meanings, and which are made available to Developer for testing and evaluation purposes prior to general commercial release.
18
+
19
+ **1.4** "**Confidential Information**" means any confidential or proprietary information of the disclosing Party (the "**Discloser**") that is marked as "Confidential" or under the circumstances of disclosure should reasonably be considered confidential or proprietary. Confidential Information includes the Order Form and non-public information regarding features, functionality, and performance of the Services. Confidential Information does not include information that:
20
+
21
+ - (a) is lawfully in or enters the public domain through no fault of or breach by the receiving party (the "**Recipient**");
22
+ - (b) the Recipient was lawfully in possession of without any obligation of confidentiality prior to receiving it from the Discloser;
23
+ - (c) the Recipient developed independently and without use of or reference to the Discloser's Confidential Information; or
24
+ - (d) the Recipient receives from a third party without restriction on disclosure and without breach of a nondisclosure obligation.
25
+
26
+ **1.5** "**Developer Application**" means Developer's owned (or lawfully licensed) and operated application, web app, website, mobile app, game, or software, products, or services that interact with or incorporate Loci. For clarity, the Services are provided solely for use in Developer Applications and may not be sublicensed, resold, or otherwise made available to any third party for their independent use.
27
+
28
+ **1.6** "**DPA**" means the Data Processing Agreement.
29
+
30
+ **1.7** "**Input**" means the information, data, or content, in any form or medium, that is provided by Developer or its Authorized Users, directly or indirectly, submitted, uploaded, or otherwise provided to Loci.
31
+
32
+ **1.8** "**Intellectual Property Rights**" means any and all registered and unregistered rights granted, applied for, or otherwise now or hereafter in existence under or related to any patent, copyright, trademark, trade secret, or other intellectual property rights, in any part of the world.
33
+
34
+ **1.9** "**Materials**" means any and all materials, content, technology, and components made available by Aurora in connection with Loci or the Services, whether in source or object form, and regardless of delivery mechanism, including any present or future plugin, integration, API, service, repository, package, endpoint, interface, or other distribution method. Materials include, without limitation, software, code, models, prompts, prompt logic, instruction sets, workflows, configurations, pipelines, skill definitions, templates, connectors, authentication components, schemas, setup utilities, developer tools, helper scripts, documentation, technical reference materials, branding elements, and any other related content or materials made available by Aurora.
35
+
36
+ **1.10** "**Order Form**" means any written or electronic document, agreement, or online form that specifies the Services being provided to Developer, including but not limited to the type of access, usage limits, fees, payment terms, and any other commercial terms agreed upon between the parties. Order Forms are incorporated into and form part of this Agreement.
37
+
38
+ **1.11** "**Output**" means data, content, video, or other material generated, returned, or otherwise provided by Loci in response to an Input.
39
+
40
+ **1.12** "**Usage Data**" means data and information related to Developer's use of the Services, Loci, and Account, including telemetry data, timestamps, access times and dates, and duration of use, for the purpose of compiling statistical and performance information related to the provision and operation of the Services, for billing purposes, and for support services (if applicable). Usage Data is governed by Aurora's Privacy Policy.
41
+
42
+ ---
43
+
44
+ ## 2. License and Integration
45
+
46
+ **2.1 License.** Subject to the terms of this Agreement, Aurora grants Developer and its Authorized Users a limited, worldwide, non-exclusive, non-transferable, non-sublicensable, revocable license, during the Term, to: (i) access and use Loci solely to develop integrations within the Developer Application; and (ii) use the libraries and documentation solely as necessary to integrate with Loci.
47
+
48
+ **2.2 Loci Documentation.** Developer's use of Loci shall comply with the documentation for Loci, which includes technical specifications, usage guidelines, and other materials provided by Aurora ("**Documentation**"). The Loci Documentation forms an integral part of this Agreement and may be updated by Aurora from time to time.
49
+
50
+ **2.3 Developer License.** Developer hereby grants Aurora a fully paid, royalty-free, perpetual, irrevocable, worldwide, non-exclusive, and fully sublicensable right and license to use, distribute, reproduce, modify, adapt, publicly perform, and publicly display Developer's Input and Output for the purpose of operating the Services, improving the products and Services, and developing new products and services. Developer acknowledges that the foregoing means Aurora may use Inputs and Outputs to train and improve its artificial intelligence models, algorithms, and related technology, products, and services, and may reuse and generate the Input and Output as part of its training data in its sole discretion. Developer is solely responsible for ensuring that it has all necessary rights, licenses, and permissions to provide Input to Loci and to use Output in connection with its Developer Applications.
51
+
52
+ **2.4 Reservation of Rights.** Except for the licenses expressly granted, each party shall retain all rights, title, and interest in and to any related Intellectual Property Rights.
53
+
54
+ ---
55
+
56
+ ## 3. Developer's Obligations and Restrictions
57
+
58
+ **3.1 Sole Responsibility.** Developer assumes sole and exclusive responsibility for any acts or omissions related to the use or misuse of Loci and any Output generated through the Developer Applications, whether by Developer itself or by its end users, customers, or any third parties accessing Loci through Developer Application ("**End Users**"). Developer is solely responsible for ensuring that the Inputs do not include sensitive data (including health information) and that Developer, Authorized Users, and End Users comply with these Terms and any applicable law. To the extent applicable, Developer is solely responsible for adding applicable disclosures to End Users regarding data protection practices and notices, and for obtaining any required consents.
59
+
60
+ **3.2 Compliance with Terms and Law.** Developer must use Loci only in compliance with this Agreement, the Loci Documentation, and all applicable laws and regulations, including but not limited to laws related to data protection, privacy, intellectual property, export control, consumer protection, and content regulation. Developer is solely responsible for ensuring that its Developer Applications comply with all applicable legal requirements in the jurisdictions where Developer and its End Users operate, including by adding AI disclosures as required by applicable laws. Developer must not misrepresent the nature, source, or authenticity of Output generated by Loci.
61
+
62
+ **3.3 Security and Credential Management.** Developer must securely store and protect its Loci keys, tokens, authentication credentials, and any other access materials provided by Aurora. Developer may not share its credentials with unauthorized parties or allow third parties to access Loci using Developer's credentials without Aurora's prior written consent. Developer must implement appropriate technical and organizational measures to prevent unauthorized access, use, or disclosure of its Account and licenses provided herein, and shall report to Aurora immediately upon becoming aware of any unusual or unauthorized use of the Account or Services.
63
+
64
+ **3.4 Registration Information.** Developer must provide accurate, complete, and current information when registering for access to Loci and must promptly update such information if it changes. Developer represents and warrants that the information provided to Aurora is truthful and accurate.
65
+
66
+ **3.5 Content Moderation.** Developer is responsible for implementing appropriate content moderation measures, safety controls, and filtering mechanisms (substantially similar to the Acceptable Use Policy) to prevent its Developer Applications from generating, distributing, or facilitating access to harmful, illegal, or misleading content through Loci. Developer acknowledges that Aurora has no obligation, and it may be impossible, to pre-screen Developer's (or any End User's) Input or Output, although Aurora reserves the right in its sole discretion to do so. Aurora also reserves the right to remove any Input or Output from the Services that violates this Agreement.
67
+
68
+ **3.6 Restrictions.** Developer may not, and shall ensure its Authorized Users and End Users do not:
69
+
70
+ - (a) reverse engineer, decompile, or disassemble Loci;
71
+ - (b) circumvent or attempt to circumvent rate limits, quotas, authentication mechanisms, or access controls;
72
+ - (c) sell, sublicense, or otherwise provide Loci to third parties without Aurora's prior written consent;
73
+ - (d) interfere with, disrupt, or otherwise compromise the security, integrity, or availability of the Services;
74
+ - (e) use Loci or Output to generate, disseminate, or otherwise make available illegal content;
75
+ - (f) allow access to Loci or the Services from any source other than the Developer Application, meaning Developer may not host (or authorize or direct a third party to host) an endpoint that allows third parties to integrate with or otherwise use Loci in or with their own products or services;
76
+ - (g) extract, reproduce, retain, copy, publish, republish, display, distribute, scrape, crawl, harvest, or otherwise use any Materials outside the scope expressly permitted under this Agreement; or
77
+ - (h) use any Materials, Loci, Output, documentation, prompt logic, workflows, or related components to train, fine-tune, distill, benchmark, evaluate, improve, imitate, or otherwise support any external artificial intelligence, machine learning, large language model, or competing product or service, in each case without Aurora's prior written consent.
78
+
79
+ ---
80
+
81
+ ## 4. Input and Output Data
82
+
83
+ **4.1** Developer understands and acknowledges that, due to the nature of machine learning, the Output: (i) may not be unique across users, and Loci may generate the same or similar Output for other users; (ii) may be inaccurate, objectionable, inappropriate, or otherwise unsuited to Developer's purpose; and (iii) is dependent on the Input submitted by Developer, End Users, or Authorized Users, as applicable. Aurora will not be liable for any damages Developer or any third party alleges to incur as a result of or relating to any Output. Additionally, Developer may not use Output to impersonate real persons or falsely attribute Output as originating from real individuals. Developer agrees to evaluate the use of Output before using it, such as by using human review.
84
+
85
+ **4.2 No Confidentiality.** Developer acknowledges and agrees that Input and Output are not considered confidential information. Developer must not submit through Loci any Input that contains confidential, proprietary, or sensitive information unless Developer has all necessary rights and accepts the risk of disclosure and use as described in this Agreement.
86
+
87
+ **4.3 Representations.** Developer represents and warrants that it has sufficient rights in the Input to submit it to the Services. This means that if Developer uploads a photograph, image, video, or likeness of any person to the Services, Developer represents and warrants that it has obtained any and all required permissions or consent necessary to submit such person's likeness to the Services.
88
+
89
+ ---
90
+
91
+ ## 5. Fees and Payment
92
+
93
+ **5.1 Subscription Term and Fee.** The Services are provided as subscriptions based on subscription fees ("**Subscription**"). Subscription fees are paid in advance on a weekly, monthly, or annual basis, or other alternatives displayed to you and agreed by you prior to your subscription purchase (collectively, "**Subscription Fee**"). The Subscription Fee is displayed to you prior to your purchase.
94
+
95
+ **5.2 Cancellation.** You may cancel your Subscription plan at any time through your Account or any other means Aurora provides. Should you choose to cancel your Subscription, your access to the Services will continue through the end of your billing period, as applicable, and expire thereafter.
96
+
97
+ **5.3 Refund.** To the extent permitted by applicable law, any fees paid for your purchase of a subscription plan are non-refundable, and Aurora does not provide refunds for any partial subscriptions.
98
+
99
+ **5.4 Free Trial.** Aurora may offer a free trial for premium features ("**Free Trial**") as shall be determined by Aurora in its sole discretion. The Free Trial starts when you register and is for a limited period of time, with auto-renewal unless you cancel at least 24 hours before the end of the Free Trial period.
100
+
101
+ **5.5 Changes.** Aurora reserves the right, at its own discretion, to change any features or functionalities of the Subscription. Changes may be based on various factors, including improving or managing the Services or complying with legal or technical requirements. Aurora will notify Developer of any material changes.
102
+
103
+ **5.6 Taxes.** All fees and subscription purchases are exclusive of applicable taxes, duties, or levies, which Developer is responsible for paying in accordance with applicable law.
104
+
105
+ ---
106
+
107
+ ## 6. Termination
108
+
109
+ **6.1 Term.** This Agreement commences on the date Developer first accesses or uses Loci and will remain in effect until terminated in accordance with this Section 6 ("**Term**").
110
+
111
+ **6.2 Termination by Aurora.** Aurora may suspend or terminate Developer's access to Loci, in whole or in part, at any time and in its sole discretion, by providing notice to Developer (including via email or through Developer's account dashboard). Without limiting the foregoing, Aurora may suspend or terminate access:
112
+
113
+ - (i) to prevent or mitigate a security risk, operational risk, or other credible risk of harm or liability to Aurora, Loci, or any third party;
114
+ - (ii) if required to do so by applicable law, regulation, or governmental authority; or
115
+ - (iii) in the event of repeated or material violations of this Agreement.
116
+
117
+ **6.3 Termination by Developer.** Developer may terminate this Agreement at any time, for any reason, by ceasing all use of Loci and deleting its Account (if applicable).
118
+
119
+ **6.4 Effect of Termination.** Upon termination of this Agreement for any reason:
120
+
121
+ - (i) all rights and licenses granted to Developer under this Agreement will immediately cease;
122
+ - (ii) Developer must stop making calls to Loci and promptly delete all keys, credentials, and related integration materials provided by Aurora;
123
+ - (iii) Developer may retain and continue to use any Output generated prior to termination, subject to this Agreement and applicable law;
124
+ - (iv) Developer remains responsible for any obligations accrued prior to termination, including payment obligations;
125
+ - (v) Aurora's license to use Input and Output shall survive termination; and
126
+ - (vi) Developer is solely responsible for downloading and securing Output prior to the effective date of termination, as Aurora makes no commitment to store or maintain such Output following termination.
127
+
128
+ **6.5 Survival.** Sections 3.1 (Sole Responsibility), 9 (Disclaimer of Warranties), 10 (Limitation of Liability), and 13 (Governing Law) shall survive termination of this Agreement.
129
+
130
+ ---
131
+
132
+ ## 7. Support
133
+
134
+ Aurora will use commercially reasonable efforts to maintain the availability of Loci and to provide Developer with technical support for questions or issues regarding Loci during Aurora's normal business hours and through its designated support channels. Aurora does not guarantee uninterrupted or error-free operation of Loci and shall not be responsible for providing support directly to End Users of Developer Applications.
135
+
136
+ ---
137
+
138
+ ## 8. Confidentiality; DPA; Intellectual Property
139
+
140
+ **8.1 Privacy.** If the Input includes personal data, such data will be processed subject to the DPA. Aurora shall process such personal data as the "processor" or "service provider," as applicable.
141
+
142
+ **8.2 Intellectual Property.** As between the parties, Aurora owns and retains all right, title, and interest in and to the Services, the Materials, and all Intellectual Property Rights therein. Developer retains ownership of Input and Output, subject to the rights granted to Aurora under this Agreement. Except for the limited rights expressly granted under this Agreement, no license, right, or interest in or to the Services or Materials is granted, conveyed, or implied.
143
+
144
+ **8.3 Feedback.** Aurora may use and exploit, without any payment or attribution obligation of any kind, any comments, feedback, suggestions, or ideas ("**Feedback**") provided by Developer, Authorized Users, End Users, or any of their respective personnel, employees, agents, or subcontractors in connection with the Agreement or the Services. Developer waives any moral and similar rights relating to Feedback that Developer may have under any applicable law.
145
+
146
+ **8.4 Open Source.** Loci may include third-party open source software that is subject to third-party terms and conditions ("**Third Party Terms**"). If there is a conflict between any Third Party Terms and the terms of this Agreement, then the Third Party Terms shall prevail, but solely in connection with the related third-party open source software.
147
+
148
+ **8.5 Confidentiality.** Each party will:
149
+
150
+ - (a) hold in strict confidence all Confidential Information of the other party, using at least the same degree of care to protect the Discloser's Confidential Information as it uses to protect its own Confidential Information of like nature, but in no event less than reasonable care;
151
+ - (b) use such Confidential Information only to exercise its rights and perform its obligations under the Agreement; and
152
+ - (c) not transfer or disclose such Confidential Information to any individual or entity except to the directors, officers, employees, agents, contractors, accountants, auditors, or legal and financial advisors of such party who need to know such Confidential Information and who are under confidentiality obligations substantially similar to those set forth herein; provided that the handling and treatment of Confidential Information by any such individual or entity will be such party's full responsibility.
153
+
154
+ A Recipient may disclose the Discloser's Confidential Information to the extent required by law, provided that the Recipient: (i) notifies the Discloser in writing prior to disclosure so that the Discloser has a reasonable opportunity to obtain a protective order; (ii) assists the Discloser, at the Discloser's expense, in any attempt to limit or prevent the disclosure; and (iii) discloses only the minimum Confidential Information actually required to be disclosed. Neither party will disclose the existence or terms and conditions of the Agreement to any third party.
155
+
156
+ ---
157
+
158
+ ## 9. Disclaimer of Warranties
159
+
160
+ LOCI IS PROVIDED "AS IS" AND "AS AVAILABLE." TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, AURORA DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND ANY WARRANTIES ARISING FROM COURSE OF DEALING OR USAGE OF TRADE. AURORA DOES NOT WARRANT THAT LOCI WILL BE UNINTERRUPTED, ERROR-FREE, OR COMPLETELY SECURE.
161
+
162
+ ---
163
+
164
+ ## 10. Limitation of Liability
165
+
166
+ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, AURORA SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL, PUNITIVE, OR EXEMPLARY DAMAGES, INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF PROFITS, REVENUES, DATA, GOODWILL, OR OTHER INTANGIBLE LOSSES, ARISING OUT OF OR RELATED TO DEVELOPER'S USE OF LOCI, REGARDLESS OF THE THEORY OF LIABILITY AND EVEN IF AURORA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT SHALL AURORA'S TOTAL LIABILITY EXCEED THE AMOUNTS PAID BY DEVELOPER TO AURORA FOR LOCI IN THE TWELVE (12) MONTHS PRECEDING THE CLAIM.
167
+
168
+ NOTWITHSTANDING ANYTHING TO THE CONTRARY, AURORA PROVIDES THE BETA SERVICES "AS IS" AND "AS AVAILABLE," WITHOUT ANY WARRANTIES OR REPRESENTATIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED. TO THE MAXIMUM EXTENT PERMITTED BY LAW, AURORA DISCLAIMS ALL IMPLIED WARRANTIES, INCLUDING THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DEVELOPER ASSUMES ALL RISKS AND COSTS ASSOCIATED WITH USING THE BETA SERVICES. AURORA'S OBLIGATIONS TO INDEMNIFY, DEFEND, OR HOLD HARMLESS UNDER THIS AGREEMENT DO NOT APPLY TO BETA SERVICES. THE LIABILITY CAP FOR BETA SERVICES IS $0 (ZERO DOLLARS).
169
+
170
+ ---
171
+
172
+ ## 11. Indemnification
173
+
174
+ **11.1 Developer's Indemnity to Aurora.** Developer agrees to defend, indemnify, and hold harmless Aurora, its affiliates, and each of their respective directors, officers, employees, agents, and representatives (collectively, the "**Aurora Indemnified Parties**") from and against any and all third-party claims, demands, actions, damages, losses, liabilities, judgments, costs, and expenses (including reasonable attorneys' fees) arising out of or in connection with:
175
+
176
+ - (i) Developer Application, products, or services that integrate or interact with Loci;
177
+ - (ii) any data, content, including Inputs or Outputs, or materials Developer or End Users input, upload, or otherwise provide through or in connection with Loci;
178
+ - (iii) Developer's use of Loci or Loci Documentation in violation of this Agreement, applicable laws, or third-party rights;
179
+ - (iv) any combination of Loci with products, services, or software not provided by Aurora; or
180
+ - (v) any breach or alleged breach by Developer of this Agreement.
181
+
182
+ **11.2** Aurora may, at its option, participate in the defense and settlement of any such claim with its own counsel and at its own expense. Developer shall not settle any claim without Aurora's prior written consent if the settlement requires Aurora to take or refrain from taking any action, admit liability, or incur any obligation.
183
+
184
+ ---
185
+
186
+ ## 12. Changes to These Loci Terms
187
+
188
+ **12.1 Modifications.** Aurora may update or modify this Agreement from time to time. Material changes will be communicated through Developer's account dashboard, email notification, or posting on the Aurora website. Developer's continued use of Loci after any changes constitutes acceptance of the revised Loci Terms. If Developer does not agree to the changes, it must discontinue use of Loci.
189
+
190
+ **12.2 Modifications to Loci.** Aurora reserves the right, in its sole discretion, to modify, update, enhance, or discontinue Loci at any time, including without limitation its level of access, content, functionality, performance specifications, or availability. While Aurora will endeavor to provide reasonable notice of material changes to Loci, Developer acknowledges that some changes may be implemented immediately without prior notice, particularly those related to security, legal compliance, or system stability. Developer is responsible for regularly reviewing the Loci Documentation and implementing necessary updates to ensure continued compatibility and functionality of its Developer Applications.
191
+
192
+ ---
193
+
194
+ ## 13. Governing Law
195
+
196
+ This Agreement shall be governed by and construed in accordance with the laws of the State of Israel, without regard to its conflict of law provisions. Disputes shall be subject to the exclusive jurisdiction of the courts of Tel Aviv, Israel.
197
+
198
+ ---
199
+
200
+ ## 14. General Provisions
201
+
202
+ **14.1 Entire Agreement.** This Agreement, together with the Loci Documentation and any referenced policies, constitutes the entire agreement between Developer and Aurora regarding Loci.
203
+
204
+ **14.2 Independent Contractors.** The parties are independent contractors. Nothing in this Agreement shall be construed to create a partnership, joint venture, agency, or employment relationship between the parties. Neither party has authority to bind the other.
205
+
206
+ **14.3 Severability.** If any provision of this Agreement is found to be unenforceable, the remaining provisions shall remain in full force and effect.
207
+
208
+ **14.4 No Waiver.** Aurora's failure to enforce any provision of this Agreement shall not constitute a waiver of such provision or any other provision.
209
+
210
+ **14.5 Assignment.** Developer may not assign this Agreement without Aurora's prior written consent. Aurora may assign this Agreement without restriction.
211
+
212
+ ---
213
+
214
+ ## 15. Contact Information
215
+
216
+ If you have questions about this Agreement, please contact us at legal@auroralabs.com.