lighthouse-cli 0.17.2__tar.gz → 0.18.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 (73) hide show
  1. {lighthouse_cli-0.17.2/lighthouse_cli.egg-info → lighthouse_cli-0.18.0}/PKG-INFO +1 -1
  2. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/README.md +1 -0
  3. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/__init__.py +1 -1
  4. lighthouse_cli-0.18.0/lighthouse/commands/verify.py +207 -0
  5. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/ar.json +20 -1
  6. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/de.json +20 -1
  7. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/en.json +20 -1
  8. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/es.json +20 -1
  9. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/fr.json +20 -1
  10. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/ga.json +20 -1
  11. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/it.json +20 -1
  12. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/ja.json +20 -1
  13. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/nl.json +20 -1
  14. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/pt.json +20 -1
  15. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/zh-Hans.json +20 -1
  16. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/locales/zh-Hant.json +20 -1
  17. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/main.py +2 -1
  18. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0/lighthouse_cli.egg-info}/PKG-INFO +1 -1
  19. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse_cli.egg-info/SOURCES.txt +2 -0
  20. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/pyproject.toml +1 -1
  21. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_commands.py +60 -0
  22. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_golden.py +4 -0
  23. lighthouse_cli-0.18.0/tests/test_verify.py +127 -0
  24. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/LICENSE +0 -0
  25. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/NOTICE +0 -0
  26. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/__main__.py +0 -0
  27. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/__init__.py +0 -0
  28. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/agents.py +0 -0
  29. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/builds.py +0 -0
  30. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/collectors.py +0 -0
  31. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/connect.py +0 -0
  32. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/connections.py +0 -0
  33. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/evals.py +0 -0
  34. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/kb.py +0 -0
  35. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/language.py +0 -0
  36. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/limits.py +0 -0
  37. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/login.py +0 -0
  38. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/models.py +0 -0
  39. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/offline.py +0 -0
  40. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/runs.py +0 -0
  41. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/spend.py +0 -0
  42. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/stack.py +0 -0
  43. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/terms.py +0 -0
  44. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/commands/whoami.py +0 -0
  45. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/config.py +0 -0
  46. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/credentials.py +0 -0
  47. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/device.py +0 -0
  48. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/exits.py +0 -0
  49. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/flags.py +0 -0
  50. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/http.py +0 -0
  51. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/i18n.py +0 -0
  52. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/out.py +0 -0
  53. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/py.typed +0 -0
  54. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse/sealing.py +0 -0
  55. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse_cli.egg-info/dependency_links.txt +0 -0
  56. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse_cli.egg-info/entry_points.txt +0 -0
  57. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse_cli.egg-info/requires.txt +0 -0
  58. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/lighthouse_cli.egg-info/top_level.txt +0 -0
  59. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/setup.cfg +0 -0
  60. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_ci_credential.py +0 -0
  61. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_collectors.py +0 -0
  62. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_connect_erp_hr.py +0 -0
  63. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_connect_finav.py +0 -0
  64. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_connect_library.py +0 -0
  65. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_dev_surface.py +0 -0
  66. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_fixtures.py +0 -0
  67. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_i18n.py +0 -0
  68. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_installers.py +0 -0
  69. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_offline.py +0 -0
  70. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_plumbing.py +0 -0
  71. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_sealing.py +0 -0
  72. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_stack.py +0 -0
  73. {lighthouse_cli-0.17.2 → lighthouse_cli-0.18.0}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lighthouse-cli
3
- Version: 0.17.2
3
+ Version: 0.18.0
4
4
  Summary: The LightHouse command line: sign in, connect your estate, deploy agents, watch runs
5
5
  License-Expression: Apache-2.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -160,6 +160,7 @@ a terminal, and when `CI`, `NO_COLOR` or `TERM=dumb` is set.
160
160
  | `spend` | spend by day, model, pack, agent or connection; the forecast; the estimated savings |
161
161
  | `limits` | the limits in force, and whether the engines applied them |
162
162
  | `terms` | the commercial terms in force |
163
+ | `verify-answer <receipt.json> [--answer file] [--keys URL or file]` | check that an answer from Octy was signed and is unchanged: the receipt's Ed25519 signature, and with `--answer`, the answer text against its hash. A public Octy's receipt (documentation, company site) is checked against the keys published at `https://ask.atlanticagenticlabs.com/.well-known/octy-keys.json` (never a URL the receipt names), with no sign-in; a client Octy's receipt (portal or deployment) against the tenant's published keys, `GET /api/v1/octy/keys` (a portal receipt with LightHouse's key, a deployment receipt with that deployment's own) |
163
164
 
164
165
  ### A release gate in CI
165
166
 
@@ -3,4 +3,4 @@
3
3
  """The `lighthouse-ai` command line for LightHouse."""
4
4
  from __future__ import annotations
5
5
 
6
- __version__ = "0.17.2"
6
+ __version__ = "0.18.0"
@@ -0,0 +1,207 @@
1
+ # Copyright 2026 Atlantic Agentic Labs. All Rights Reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ """`lighthouse-ai verify-answer`: check an answer from Octy against its signed receipt.
4
+
5
+ lighthouse-ai verify-answer octy-receipt-oar_xyz.json
6
+ lighthouse-ai verify-answer octy-receipt-oar_xyz.json --answer answer.txt
7
+ lighthouse-ai verify-answer receipt.json --keys octy-keys.json
8
+
9
+ Every answer Octy gives on Atlantic's documentation and company site comes
10
+ with a receipt, downloadable from the answer's evidence panel: hashes of the
11
+ question and the answer, each cited passage's URL and SHA-256, the corpus
12
+ version, how the answer was produced, the time, and the id of the Ed25519 key
13
+ that signed it. This command checks the signature against Atlantic's
14
+ published keys and, with `--answer`, that the answer text is the one signed.
15
+
16
+ **Which keys.** For a public Octy's receipt (`profile` docs or site, or an
17
+ Octy profile's), the keys are read by default from Atlantic's well-known URL,
18
+ `https://ask.atlanticagenticlabs.com/.well-known/octy-keys.json`, and never
19
+ from a URL the receipt names: a forged receipt could name its forger's keys.
20
+ A receipt whose issuer is not Atlantic's is refused unless `--keys` is given.
21
+ For a client Octy's receipt (`profile` portal or deployment, #48) the keys
22
+ are the tenant's, `GET /api/v1/octy/keys` read with this CLI's credential:
23
+ a portal receipt must verify with LightHouse's key, a deployment receipt
24
+ with that deployment's own. `--keys` takes another URL (https only) or a
25
+ saved copy of the keys file, and needs no sign-in.
26
+
27
+ **Rotation.** A receipt verifies while the key that signed it is listed,
28
+ current or retired. A key taken off the list no longer verifies anything.
29
+
30
+ **The signed bytes** are the receipt without `sig`, as canonical JSON: keys
31
+ sorted, no whitespace, UTF-8 with non-ASCII characters literal (RFC 8785 for
32
+ the values a receipt holds).
33
+
34
+ No credential is needed for a public receipt, and nothing is sent anywhere
35
+ but the keys URL (or, for a client receipt, the tenant's keys route).
36
+ Exit 0 when the receipt verifies (and the answer matches, if given); exit 1
37
+ otherwise, with a reason.
38
+ """
39
+ from __future__ import annotations
40
+
41
+ import argparse
42
+ import base64
43
+ import hashlib
44
+ import json
45
+ import sys
46
+ from pathlib import Path
47
+ from typing import Any
48
+
49
+ import httpx
50
+ from cryptography.exceptions import InvalidSignature
51
+ from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
52
+
53
+ from lighthouse.exits import FAILED, USAGE, CliError
54
+ from lighthouse.i18n import t
55
+ from lighthouse.main import Command, Context
56
+ from lighthouse.out import Out
57
+
58
+ ISSUER = "https://ask.atlanticagenticlabs.com"
59
+ CLIENT = ("portal", "deployment")
60
+ KEYS_URL = f"{ISSUER}/.well-known/octy-keys.json"
61
+ MAX_BYTES = 1024 * 1024
62
+
63
+
64
+ def _configure(ap: argparse.ArgumentParser) -> None:
65
+ ap.add_argument("receipt", metavar="RECEIPT",
66
+ help="the receipt file from the answer's evidence panel ('-' for standard input)")
67
+ ap.add_argument("--answer", metavar="FILE",
68
+ help="a file holding the answer's text, to check that it is the answer signed")
69
+ ap.add_argument("--keys", metavar="URL_OR_FILE",
70
+ help="the published keys, as an https URL or a saved file (default: Atlantic's well-known URL)")
71
+
72
+
73
+ def _b64u(text: str) -> bytes:
74
+ return base64.urlsafe_b64decode(text + "=" * (-len(text) % 4))
75
+
76
+
77
+ def _integers_only(value: Any) -> None:
78
+ """A receipt holds no floats (its canonical form is defined for integers only)."""
79
+ if isinstance(value, float):
80
+ raise ValueError("float")
81
+ for v in value.values() if isinstance(value, dict) else value if isinstance(value, list) else ():
82
+ _integers_only(v)
83
+
84
+
85
+ def canonical(value: Any) -> bytes:
86
+ return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=False,
87
+ allow_nan=False).encode("utf-8")
88
+
89
+
90
+ def _read(ctx: Context, name: str) -> bytes:
91
+ try:
92
+ if name == "-":
93
+ stream = ctx.stdin or sys.stdin
94
+ raw = stream.buffer.read(MAX_BYTES + 1) if hasattr(stream, "buffer") else stream.read(MAX_BYTES + 1)
95
+ data = raw.encode() if isinstance(raw, str) else raw
96
+ else:
97
+ with Path(name).open("rb") as fh:
98
+ data = fh.read(MAX_BYTES + 1)
99
+ except OSError:
100
+ raise CliError(t("err.file_unreadable", name=name), code=USAGE, error="file_unreadable") from None
101
+ if len(data) > MAX_BYTES:
102
+ raise CliError(t("err.file_unreadable", name=name), code=USAGE, error="file_unreadable")
103
+ return data
104
+
105
+
106
+ def _load_receipt(ctx: Context, name: str) -> dict[str, Any]:
107
+ try:
108
+ doc = json.loads(_read(ctx, name))
109
+ except ValueError:
110
+ raise CliError(t("err.receipt_unreadable"), code=USAGE, error="receipt_unreadable") from None
111
+ # A saved response or fixture holds the receipt under "receipt".
112
+ if isinstance(doc, dict) and isinstance(doc.get("receipt"), dict):
113
+ doc = doc["receipt"]
114
+ if not isinstance(doc, dict) or doc.get("alg") != "Ed25519" or not isinstance(doc.get("sig"), str) \
115
+ or not isinstance(doc.get("kid"), str):
116
+ raise CliError(t("err.receipt_unreadable"), code=USAGE, error="receipt_unreadable")
117
+ return doc
118
+
119
+
120
+ def _load_keys(ctx: Context, given: str | None, receipt: dict[str, Any]) -> tuple[dict[str, Any], str]:
121
+ if given is None and receipt.get("profile") in CLIENT:
122
+ doc = ctx.client().get("/api/v1/octy/keys")
123
+ if not isinstance(doc, dict) or not isinstance(doc.get("keys"), list):
124
+ raise CliError(t("err.keys_unavailable"), code=FAILED, error="keys_unavailable")
125
+ return dict(doc), "tenant"
126
+ if given is None and receipt.get("iss") != ISSUER:
127
+ raise CliError(t("err.receipt_issuer"), code=FAILED, error="receipt_issuer")
128
+ source = given or KEYS_URL
129
+ if source.startswith("https://"):
130
+ timeout = float(getattr(ctx.args, "timeout", None) or 20)
131
+ try:
132
+ with httpx.Client(transport=ctx.transport, timeout=timeout, follow_redirects=False) as h:
133
+ r = h.get(source, headers={"Accept": "application/json"})
134
+ if r.status_code != 200:
135
+ raise CliError(t("err.keys_unavailable"), code=FAILED, error="keys_unavailable")
136
+ doc = r.json()
137
+ except (httpx.HTTPError, ValueError):
138
+ raise CliError(t("err.keys_unavailable"), code=FAILED, error="keys_unavailable") from None
139
+ kind = "url"
140
+ elif "://" in source:
141
+ raise CliError(t("err.keys_unavailable"), code=USAGE, error="keys_unavailable")
142
+ else:
143
+ try:
144
+ doc = json.loads(_read(ctx, source))
145
+ except ValueError:
146
+ raise CliError(t("err.keys_unavailable"), code=FAILED, error="keys_unavailable") from None
147
+ kind = "file"
148
+ if not isinstance(doc, dict) or not isinstance(doc.get("keys"), list):
149
+ raise CliError(t("err.keys_unavailable"), code=FAILED, error="keys_unavailable")
150
+ return doc, kind
151
+
152
+
153
+ def verify_answer(ctx: Context) -> dict[str, Any]:
154
+ receipt = _load_receipt(ctx, ctx.args.receipt)
155
+ keys, source = _load_keys(ctx, ctx.args.keys, receipt)
156
+ candidates = [k for k in keys["keys"] if isinstance(k, dict) and k.get("kid") == receipt["kid"]]
157
+ # A client receipt names who signed it: LightHouse for the portal, the
158
+ # deployment itself for a deployment's answer. Any other key is refused.
159
+ if receipt.get("profile") == "portal":
160
+ candidates = [k for k in candidates if k.get("issuer") == "lighthouse"]
161
+ elif receipt.get("profile") == "deployment":
162
+ candidates = [k for k in candidates if k.get("issuer") == "deployment"
163
+ and k.get("deployment") == receipt.get("deployment")]
164
+ key = next((k for k in candidates if k.get("kty") == "OKP" and k.get("crv") == "Ed25519"), None)
165
+ if key is None:
166
+ raise CliError(t("err.receipt_key_unknown"), code=FAILED, error="receipt_key_unknown")
167
+ try:
168
+ _integers_only(receipt)
169
+ Ed25519PublicKey.from_public_bytes(_b64u(str(key["x"]))).verify(
170
+ _b64u(receipt["sig"]), canonical({k: v for k, v in receipt.items() if k != "sig"}))
171
+ except (InvalidSignature, ValueError, TypeError):
172
+ raise CliError(t("err.receipt_invalid"), code=FAILED, error="receipt_invalid") from None
173
+ answer = "not_checked"
174
+ if ctx.args.answer is not None:
175
+ data = _read(ctx, ctx.args.answer)
176
+ # Exactly the answer, or the answer and the one newline an editor adds.
177
+ texts = {data, data[:-1] if data.endswith(b"\n") else data}
178
+ if receipt.get("answer_sha256") not in {hashlib.sha256(c).hexdigest() for c in texts}:
179
+ raise CliError(t("err.receipt_answer_mismatch"), code=FAILED, error="receipt_answer_mismatch")
180
+ answer = "matches"
181
+ return {
182
+ "ok": True, "verified": True, "kid": receipt["kid"], "key_status": key.get("status") or "current",
183
+ "keys": source, "keys_url": (ctx.args.keys or KEYS_URL) if source == "url" else None,
184
+ "answer": answer,
185
+ "receipt": {"id": receipt.get("id"), "issuer": receipt.get("iss"), "profile": receipt.get("profile"),
186
+ "kind": receipt.get("kind"), "produced": receipt.get("produced"),
187
+ "issued_at": receipt.get("issued_at"), "passages": len(receipt.get("passages") or []),
188
+ "reads": len(receipt.get("reads") or []), "corpus": receipt.get("corpus"),
189
+ "tenant": receipt.get("tenant"), "deployment": receipt.get("deployment")},
190
+ }
191
+
192
+
193
+ def _show(out: Out, body: dict[str, Any]) -> None:
194
+ r = body["receipt"]
195
+ # A deployment's answer is signed with the deployment's own key, not Atlantic's.
196
+ out.done(t("verify.verified_deployment") if r["profile"] == "deployment" else t("verify.verified"))
197
+ out.pairs([("receipt", r["id"]),
198
+ ("issued", r["issued_at"]),
199
+ ("kind", r["kind"]),
200
+ ("passages", r["passages"]),
201
+ ("signed with key", f"{body['kid']} ({body['key_status']})"),
202
+ ("answer", t("verify.answer_matches") if body["answer"] == "matches"
203
+ else t("verify.answer_not_checked"))])
204
+
205
+
206
+ COMMANDS = (Command("verify-answer", "check that an answer from Octy was signed by Atlantic Agentic and is unchanged",
207
+ _configure, verify_answer, _show, anonymous=True),)
@@ -364,5 +364,24 @@
364
364
  "label.missing": "المفقود",
365
365
  "label.records_stored": "السجلات المخزنة",
366
366
  "label.records_already_held": "السجلات المحفوظة مسبقًا",
367
- "label.spans": "الامتدادات"
367
+ "label.spans": "الامتدادات",
368
+ "help.verify-answer._help": "التحقق من أن إجابة من Octy موقّعة من Atlantic Agentic ولم تُغيَّر",
369
+ "help.verify-answer.receipt": "ملف الإيصال من لوحة الأدلة الخاصة بالإجابة ('-' للإدخال القياسي)",
370
+ "help.verify-answer.answer": "ملف يحتوي على نص الإجابة، للتحقق من أنها الإجابة الموقّعة",
371
+ "help.verify-answer.keys": "المفاتيح المنشورة، كعنوان https أو ملف محفوظ (الافتراضي: عنوان Atlantic المعروف)",
372
+ "err.file_unreadable": "تعذّرت قراءة {name}",
373
+ "err.receipt_unreadable": "هذا ليس إيصالًا من Octy",
374
+ "err.receipt_issuer": "لم تُصدر Atlantic Agentic هذا الإيصال؛ استخدم --keys للتحقق منه بمفاتيح أخرى",
375
+ "err.keys_unavailable": "تعذّرت قراءة المفاتيح المنشورة",
376
+ "err.receipt_key_unknown": "المفتاح الذي وقّع هذا الإيصال غير منشور",
377
+ "err.receipt_invalid": "التوقيع غير مطابق: تم تغيير الإيصال أو لم توقّعه Atlantic Agentic",
378
+ "err.receipt_answer_mismatch": "الإجابة لا تطابق إيصالها",
379
+ "verify.verified": "موقّع من Atlantic Agentic · تم التحقق",
380
+ "verify.answer_matches": "مطابقة للإيصال",
381
+ "verify.answer_not_checked": "لم يتم التحقق (استخدم --answer)",
382
+ "label.receipt": "الإيصال",
383
+ "label.passages": "المقاطع",
384
+ "label.signed_with_key": "موقّع بالمفتاح",
385
+ "label.answer": "الإجابة",
386
+ "verify.verified_deployment": "الإيصال صالح: توقيع Octy صحيح."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "fehlend",
365
365
  "label.records_stored": "gespeicherte Datensätze",
366
366
  "label.records_already_held": "bereits gehaltene Datensätze",
367
- "label.spans": "Spans"
367
+ "label.spans": "Spans",
368
+ "help.verify-answer._help": "prüfen, ob eine Antwort von Octy von Atlantic Agentic signiert und unverändert ist",
369
+ "help.verify-answer.receipt": "die Belegdatei aus dem Nachweisbereich der Antwort ('-' für die Standardeingabe)",
370
+ "help.verify-answer.answer": "eine Datei mit dem Text der Antwort, um zu prüfen, dass es die signierte Antwort ist",
371
+ "help.verify-answer.keys": "die veröffentlichten Schlüssel als https-URL oder gespeicherte Datei (Standard: die bekannte URL von Atlantic)",
372
+ "err.file_unreadable": "{name} konnte nicht gelesen werden",
373
+ "err.receipt_unreadable": "dies ist kein Octy-Beleg",
374
+ "err.receipt_issuer": "der Beleg wurde nicht von Atlantic Agentic ausgestellt; geben Sie --keys an, um ihn mit anderen Schlüsseln zu prüfen",
375
+ "err.keys_unavailable": "die veröffentlichten Schlüssel konnten nicht gelesen werden",
376
+ "err.receipt_key_unknown": "der Schlüssel, der diesen Beleg signiert hat, ist nicht veröffentlicht",
377
+ "err.receipt_invalid": "die Signatur stimmt nicht: der Beleg wurde geändert oder nicht von Atlantic Agentic signiert",
378
+ "err.receipt_answer_mismatch": "die Antwort stimmt nicht mit ihrem Beleg überein",
379
+ "verify.verified": "Signiert von Atlantic Agentic · geprüft",
380
+ "verify.answer_matches": "stimmt mit dem Beleg überein",
381
+ "verify.answer_not_checked": "nicht geprüft (--answer angeben)",
382
+ "label.receipt": "Beleg",
383
+ "label.passages": "Passagen",
384
+ "label.signed_with_key": "signiert mit Schlüssel",
385
+ "label.answer": "Antwort",
386
+ "verify.verified_deployment": "Die Quittung ist gültig: Octys Signatur ist korrekt."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "missing",
365
365
  "label.records_stored": "records stored",
366
366
  "label.records_already_held": "records already held",
367
- "label.spans": "spans"
367
+ "label.spans": "spans",
368
+ "help.verify-answer._help": "check that an answer from Octy was signed by Atlantic Agentic and is unchanged",
369
+ "help.verify-answer.receipt": "the receipt file from the answer's evidence panel ('-' for standard input)",
370
+ "help.verify-answer.answer": "a file holding the answer's text, to check that it is the answer signed",
371
+ "help.verify-answer.keys": "the published keys, as an https URL or a saved file (default: Atlantic's well-known URL)",
372
+ "err.file_unreadable": "{name} could not be read",
373
+ "err.receipt_unreadable": "this is not an Octy receipt",
374
+ "err.receipt_issuer": "the receipt was not issued by Atlantic Agentic; give --keys to check it against other keys",
375
+ "err.keys_unavailable": "the published keys could not be read",
376
+ "err.receipt_key_unknown": "the key that signed this receipt is not published",
377
+ "err.receipt_invalid": "the signature does not match: the receipt has been changed or was not signed by Atlantic Agentic",
378
+ "err.receipt_answer_mismatch": "the answer does not match its receipt",
379
+ "verify.verified": "Signed by Atlantic Agentic · verified",
380
+ "verify.answer_matches": "matches the receipt",
381
+ "verify.answer_not_checked": "not checked (give --answer)",
382
+ "label.receipt": "receipt",
383
+ "label.passages": "passages",
384
+ "label.signed_with_key": "signed with key",
385
+ "label.answer": "answer",
386
+ "verify.verified_deployment": "The receipt verifies: Octy's signature is valid."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "faltan",
365
365
  "label.records_stored": "registros almacenados",
366
366
  "label.records_already_held": "registros ya conservados",
367
- "label.spans": "spans"
367
+ "label.spans": "spans",
368
+ "help.verify-answer._help": "comprobar que una respuesta de Octy fue firmada por Atlantic Agentic y no ha cambiado",
369
+ "help.verify-answer.receipt": "el archivo de recibo del panel de evidencias de la respuesta ('-' para la entrada estándar)",
370
+ "help.verify-answer.answer": "un archivo con el texto de la respuesta, para comprobar que es la respuesta firmada",
371
+ "help.verify-answer.keys": "las claves publicadas, como URL https o archivo guardado (por defecto: la URL conocida de Atlantic)",
372
+ "err.file_unreadable": "no se pudo leer {name}",
373
+ "err.receipt_unreadable": "esto no es un recibo de Octy",
374
+ "err.receipt_issuer": "el recibo no lo emitió Atlantic Agentic; indique --keys para comprobarlo con otras claves",
375
+ "err.keys_unavailable": "no se pudieron leer las claves publicadas",
376
+ "err.receipt_key_unknown": "la clave que firmó este recibo no está publicada",
377
+ "err.receipt_invalid": "la firma no coincide: el recibo se ha modificado o no lo firmó Atlantic Agentic",
378
+ "err.receipt_answer_mismatch": "la respuesta no coincide con su recibo",
379
+ "verify.verified": "Firmado por Atlantic Agentic · verificado",
380
+ "verify.answer_matches": "coincide con el recibo",
381
+ "verify.answer_not_checked": "sin comprobar (indique --answer)",
382
+ "label.receipt": "recibo",
383
+ "label.passages": "pasajes",
384
+ "label.signed_with_key": "firmado con la clave",
385
+ "label.answer": "respuesta",
386
+ "verify.verified_deployment": "El recibo es válido: la firma de Octy es correcta."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "manquants",
365
365
  "label.records_stored": "enregistrements stockés",
366
366
  "label.records_already_held": "enregistrements déjà détenus",
367
- "label.spans": "spans"
367
+ "label.spans": "spans",
368
+ "help.verify-answer._help": "vérifier qu'une réponse d'Octy a été signée par Atlantic Agentic et n'a pas été modifiée",
369
+ "help.verify-answer.receipt": "le fichier de reçu du panneau de preuves de la réponse ('-' pour l'entrée standard)",
370
+ "help.verify-answer.answer": "un fichier contenant le texte de la réponse, pour vérifier qu'il s'agit de la réponse signée",
371
+ "help.verify-answer.keys": "les clés publiées, sous forme d'URL https ou de fichier enregistré (par défaut : l'URL bien connue d'Atlantic)",
372
+ "err.file_unreadable": "{name} n'a pas pu être lu",
373
+ "err.receipt_unreadable": "ce n'est pas un reçu d'Octy",
374
+ "err.receipt_issuer": "le reçu n'a pas été émis par Atlantic Agentic ; indiquez --keys pour le vérifier avec d'autres clés",
375
+ "err.keys_unavailable": "les clés publiées n'ont pas pu être lues",
376
+ "err.receipt_key_unknown": "la clé qui a signé ce reçu n'est pas publiée",
377
+ "err.receipt_invalid": "la signature ne correspond pas : le reçu a été modifié ou n'a pas été signé par Atlantic Agentic",
378
+ "err.receipt_answer_mismatch": "la réponse ne correspond pas à son reçu",
379
+ "verify.verified": "Signé par Atlantic Agentic · vérifié",
380
+ "verify.answer_matches": "correspond au reçu",
381
+ "verify.answer_not_checked": "non vérifiée (indiquez --answer)",
382
+ "label.receipt": "reçu",
383
+ "label.passages": "passages",
384
+ "label.signed_with_key": "signé avec la clé",
385
+ "label.answer": "réponse",
386
+ "verify.verified_deployment": "Le reçu est valide : la signature d'Octy est correcte."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "in easnamh",
365
365
  "label.records_stored": "taifid stóráilte",
366
366
  "label.records_already_held": "taifid ar coimeád cheana",
367
- "label.spans": "réisí"
367
+ "label.spans": "réisí",
368
+ "help.verify-answer._help": "seiceáil gur shínigh Atlantic Agentic freagra ó Octy agus nár athraíodh é",
369
+ "help.verify-answer.receipt": "comhad na hadmhála ó phainéal fianaise an fhreagra ('-' don ionchur caighdeánach)",
370
+ "help.verify-answer.answer": "comhad ina bhfuil téacs an fhreagra, chun a sheiceáil gurb é an freagra sínithe é",
371
+ "help.verify-answer.keys": "na heochracha foilsithe, mar URL https nó comhad sábháilte (réamhshocrú: URL aitheanta Atlantic)",
372
+ "err.file_unreadable": "níorbh fhéidir {name} a léamh",
373
+ "err.receipt_unreadable": "ní admháil Octy í seo",
374
+ "err.receipt_issuer": "níor eisigh Atlantic Agentic an admháil; tabhair --keys chun í a sheiceáil le heochracha eile",
375
+ "err.keys_unavailable": "níorbh fhéidir na heochracha foilsithe a léamh",
376
+ "err.receipt_key_unknown": "níl an eochair a shínigh an admháil seo foilsithe",
377
+ "err.receipt_invalid": "ní mheaitseálann an síniú: athraíodh an admháil nó níor shínigh Atlantic Agentic í",
378
+ "err.receipt_answer_mismatch": "ní mheaitseálann an freagra a admháil",
379
+ "verify.verified": "Sínithe ag Atlantic Agentic · fíoraithe",
380
+ "verify.answer_matches": "meaitseálann sé an admháil",
381
+ "verify.answer_not_checked": "gan seiceáil (tabhair --answer)",
382
+ "label.receipt": "admháil",
383
+ "label.passages": "sleachta",
384
+ "label.signed_with_key": "sínithe leis an eochair",
385
+ "label.answer": "freagra",
386
+ "verify.verified_deployment": "Tá an admháil bailí: tá síniú Octy ceart."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "mancanti",
365
365
  "label.records_stored": "record archiviati",
366
366
  "label.records_already_held": "record già conservati",
367
- "label.spans": "span"
367
+ "label.spans": "span",
368
+ "help.verify-answer._help": "verificare che una risposta di Octy sia stata firmata da Atlantic Agentic e non sia stata modificata",
369
+ "help.verify-answer.receipt": "il file della ricevuta dal pannello delle evidenze della risposta ('-' per l'input standard)",
370
+ "help.verify-answer.answer": "un file con il testo della risposta, per verificare che sia la risposta firmata",
371
+ "help.verify-answer.keys": "le chiavi pubblicate, come URL https o file salvato (predefinito: l'URL noto di Atlantic)",
372
+ "err.file_unreadable": "impossibile leggere {name}",
373
+ "err.receipt_unreadable": "questa non è una ricevuta di Octy",
374
+ "err.receipt_issuer": "la ricevuta non è stata emessa da Atlantic Agentic; indicare --keys per verificarla con altre chiavi",
375
+ "err.keys_unavailable": "impossibile leggere le chiavi pubblicate",
376
+ "err.receipt_key_unknown": "la chiave che ha firmato questa ricevuta non è pubblicata",
377
+ "err.receipt_invalid": "la firma non corrisponde: la ricevuta è stata modificata o non è stata firmata da Atlantic Agentic",
378
+ "err.receipt_answer_mismatch": "la risposta non corrisponde alla sua ricevuta",
379
+ "verify.verified": "Firmato da Atlantic Agentic · verificato",
380
+ "verify.answer_matches": "corrisponde alla ricevuta",
381
+ "verify.answer_not_checked": "non verificata (indicare --answer)",
382
+ "label.receipt": "ricevuta",
383
+ "label.passages": "passaggi",
384
+ "label.signed_with_key": "firmata con la chiave",
385
+ "label.answer": "risposta",
386
+ "verify.verified_deployment": "La ricevuta è valida: la firma di Octy è corretta."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "欠落",
365
365
  "label.records_stored": "保存したレコード",
366
366
  "label.records_already_held": "保持済みのレコード",
367
- "label.spans": "スパン"
367
+ "label.spans": "スパン",
368
+ "help.verify-answer._help": "Octy の回答が Atlantic Agentic によって署名され、変更されていないことを確認します",
369
+ "help.verify-answer.receipt": "回答のエビデンスパネルから取得したレシートファイル(標準入力は '-')",
370
+ "help.verify-answer.answer": "回答のテキストを含むファイル。署名された回答であることを確認します",
371
+ "help.verify-answer.keys": "公開鍵(https URL または保存したファイル。既定: Atlantic の well-known URL)",
372
+ "err.file_unreadable": "{name} を読み取れませんでした",
373
+ "err.receipt_unreadable": "これは Octy のレシートではありません",
374
+ "err.receipt_issuer": "このレシートは Atlantic Agentic が発行したものではありません。他の鍵で確認するには --keys を指定してください",
375
+ "err.keys_unavailable": "公開鍵を読み取れませんでした",
376
+ "err.receipt_key_unknown": "このレシートに署名した鍵は公開されていません",
377
+ "err.receipt_invalid": "署名が一致しません。レシートが変更されたか、Atlantic Agentic が署名したものではありません",
378
+ "err.receipt_answer_mismatch": "回答がレシートと一致しません",
379
+ "verify.verified": "Atlantic Agentic による署名 · 検証済み",
380
+ "verify.answer_matches": "レシートと一致",
381
+ "verify.answer_not_checked": "未確認(--answer を指定)",
382
+ "label.receipt": "レシート",
383
+ "label.passages": "パッセージ",
384
+ "label.signed_with_key": "署名鍵",
385
+ "label.answer": "回答",
386
+ "verify.verified_deployment": "レシートは有効です: Octy の署名は正しいです。"
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "ontbrekend",
365
365
  "label.records_stored": "opgeslagen records",
366
366
  "label.records_already_held": "al bewaarde records",
367
- "label.spans": "spans"
367
+ "label.spans": "spans",
368
+ "help.verify-answer._help": "controleren of een antwoord van Octy door Atlantic Agentic is ondertekend en ongewijzigd is",
369
+ "help.verify-answer.receipt": "het ontvangstbewijs uit het bewijspaneel van het antwoord ('-' voor standaardinvoer)",
370
+ "help.verify-answer.answer": "een bestand met de tekst van het antwoord, om te controleren dat het het ondertekende antwoord is",
371
+ "help.verify-answer.keys": "de gepubliceerde sleutels, als https-URL of opgeslagen bestand (standaard: de bekende URL van Atlantic)",
372
+ "err.file_unreadable": "{name} kon niet worden gelezen",
373
+ "err.receipt_unreadable": "dit is geen ontvangstbewijs van Octy",
374
+ "err.receipt_issuer": "het ontvangstbewijs is niet door Atlantic Agentic uitgegeven; geef --keys op om het met andere sleutels te controleren",
375
+ "err.keys_unavailable": "de gepubliceerde sleutels konden niet worden gelezen",
376
+ "err.receipt_key_unknown": "de sleutel die dit ontvangstbewijs ondertekende, is niet gepubliceerd",
377
+ "err.receipt_invalid": "de handtekening klopt niet: het ontvangstbewijs is gewijzigd of niet door Atlantic Agentic ondertekend",
378
+ "err.receipt_answer_mismatch": "het antwoord komt niet overeen met het ontvangstbewijs",
379
+ "verify.verified": "Ondertekend door Atlantic Agentic · geverifieerd",
380
+ "verify.answer_matches": "komt overeen met het ontvangstbewijs",
381
+ "verify.answer_not_checked": "niet gecontroleerd (geef --answer op)",
382
+ "label.receipt": "ontvangstbewijs",
383
+ "label.passages": "passages",
384
+ "label.signed_with_key": "ondertekend met sleutel",
385
+ "label.answer": "antwoord",
386
+ "verify.verified_deployment": "Het ontvangstbewijs is geldig: de handtekening van Octy klopt."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "em falta",
365
365
  "label.records_stored": "registos guardados",
366
366
  "label.records_already_held": "registos já guardados",
367
- "label.spans": "spans"
367
+ "label.spans": "spans",
368
+ "help.verify-answer._help": "verificar que uma resposta do Octy foi assinada pela Atlantic Agentic e não foi alterada",
369
+ "help.verify-answer.receipt": "o ficheiro do recibo do painel de evidências da resposta ('-' para a entrada padrão)",
370
+ "help.verify-answer.answer": "um ficheiro com o texto da resposta, para verificar que é a resposta assinada",
371
+ "help.verify-answer.keys": "as chaves publicadas, como URL https ou ficheiro guardado (por omissão: o URL conhecido da Atlantic)",
372
+ "err.file_unreadable": "não foi possível ler {name}",
373
+ "err.receipt_unreadable": "isto não é um recibo do Octy",
374
+ "err.receipt_issuer": "o recibo não foi emitido pela Atlantic Agentic; indique --keys para o verificar com outras chaves",
375
+ "err.keys_unavailable": "não foi possível ler as chaves publicadas",
376
+ "err.receipt_key_unknown": "a chave que assinou este recibo não está publicada",
377
+ "err.receipt_invalid": "a assinatura não corresponde: o recibo foi alterado ou não foi assinado pela Atlantic Agentic",
378
+ "err.receipt_answer_mismatch": "a resposta não corresponde ao seu recibo",
379
+ "verify.verified": "Assinado pela Atlantic Agentic · verificado",
380
+ "verify.answer_matches": "corresponde ao recibo",
381
+ "verify.answer_not_checked": "não verificada (indique --answer)",
382
+ "label.receipt": "recibo",
383
+ "label.passages": "passagens",
384
+ "label.signed_with_key": "assinado com a chave",
385
+ "label.answer": "resposta",
386
+ "verify.verified_deployment": "O recibo é válido: a assinatura da Octy está correta."
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "缺失",
365
365
  "label.records_stored": "已存储的记录",
366
366
  "label.records_already_held": "已保存过的记录",
367
- "label.spans": "跨度"
367
+ "label.spans": "跨度",
368
+ "help.verify-answer._help": "检查 Octy 的回答是否由 Atlantic Agentic 签名且未被更改",
369
+ "help.verify-answer.receipt": "来自回答证据面板的回执文件('-' 表示标准输入)",
370
+ "help.verify-answer.answer": "包含回答文本的文件,用于检查它是否为已签名的回答",
371
+ "help.verify-answer.keys": "已发布的密钥,可为 https URL 或已保存的文件(默认:Atlantic 的 well-known URL)",
372
+ "err.file_unreadable": "无法读取 {name}",
373
+ "err.receipt_unreadable": "这不是 Octy 回执",
374
+ "err.receipt_issuer": "该回执并非由 Atlantic Agentic 签发;请使用 --keys 以其他密钥进行检查",
375
+ "err.keys_unavailable": "无法读取已发布的密钥",
376
+ "err.receipt_key_unknown": "签署此回执的密钥未发布",
377
+ "err.receipt_invalid": "签名不匹配:回执已被更改或并非由 Atlantic Agentic 签署",
378
+ "err.receipt_answer_mismatch": "回答与其回执不匹配",
379
+ "verify.verified": "由 Atlantic Agentic 签名 · 已验证",
380
+ "verify.answer_matches": "与回执一致",
381
+ "verify.answer_not_checked": "未检查(请提供 --answer)",
382
+ "label.receipt": "回执",
383
+ "label.passages": "段落",
384
+ "label.signed_with_key": "签名密钥",
385
+ "label.answer": "回答",
386
+ "verify.verified_deployment": "回执有效:Octy 的签名正确。"
368
387
  }
@@ -364,5 +364,24 @@
364
364
  "label.missing": "缺少",
365
365
  "label.records_stored": "已儲存的記錄",
366
366
  "label.records_already_held": "已保存過的記錄",
367
- "label.spans": "跨度"
367
+ "label.spans": "跨度",
368
+ "help.verify-answer._help": "檢查 Octy 的回答是否由 Atlantic Agentic 簽署且未被更改",
369
+ "help.verify-answer.receipt": "來自回答證據面板的回執檔案('-' 表示標準輸入)",
370
+ "help.verify-answer.answer": "包含回答文字的檔案,用於檢查它是否為已簽署的回答",
371
+ "help.verify-answer.keys": "已發布的金鑰,可為 https URL 或已儲存的檔案(預設:Atlantic 的 well-known URL)",
372
+ "err.file_unreadable": "無法讀取 {name}",
373
+ "err.receipt_unreadable": "這不是 Octy 回執",
374
+ "err.receipt_issuer": "此回執並非由 Atlantic Agentic 簽發;請使用 --keys 以其他金鑰進行檢查",
375
+ "err.keys_unavailable": "無法讀取已發布的金鑰",
376
+ "err.receipt_key_unknown": "簽署此回執的金鑰未發布",
377
+ "err.receipt_invalid": "簽章不符:回執已被更改或並非由 Atlantic Agentic 簽署",
378
+ "err.receipt_answer_mismatch": "回答與其回執不符",
379
+ "verify.verified": "由 Atlantic Agentic 簽署 · 已驗證",
380
+ "verify.answer_matches": "與回執一致",
381
+ "verify.answer_not_checked": "未檢查(請提供 --answer)",
382
+ "label.receipt": "回執",
383
+ "label.passages": "段落",
384
+ "label.signed_with_key": "簽署金鑰",
385
+ "label.answer": "回答",
386
+ "verify.verified_deployment": "收據有效:Octy 的簽章正確。"
368
387
  }
@@ -137,11 +137,12 @@ def commands() -> dict[str, Command]:
137
137
  spend,
138
138
  stack,
139
139
  terms,
140
+ verify,
140
141
  whoami,
141
142
  )
142
143
  out: dict[str, Command] = {}
143
144
  for module in (login, whoami, connect, connections, collectors, models, kb, agents, builds, evals,
144
- runs, spend, limits, terms, stack, language, offline):
145
+ runs, spend, limits, terms, stack, language, offline, verify):
145
146
  for command in module.COMMANDS:
146
147
  out[command.name] = command
147
148
  return out
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lighthouse-cli
3
- Version: 0.17.2
3
+ Version: 0.18.0
4
4
  Summary: The LightHouse command line: sign in, connect your estate, deploy agents, watch runs
5
5
  License-Expression: Apache-2.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -32,6 +32,7 @@ lighthouse/commands/runs.py
32
32
  lighthouse/commands/spend.py
33
33
  lighthouse/commands/stack.py
34
34
  lighthouse/commands/terms.py
35
+ lighthouse/commands/verify.py
35
36
  lighthouse/commands/whoami.py
36
37
  lighthouse/locales/ar.json
37
38
  lighthouse/locales/de.json
@@ -66,4 +67,5 @@ tests/test_offline.py
66
67
  tests/test_plumbing.py
67
68
  tests/test_sealing.py
68
69
  tests/test_stack.py
70
+ tests/test_verify.py
69
71
  tests/test_version.py
@@ -18,7 +18,7 @@ build-backend = "setuptools.build_meta"
18
18
 
19
19
  [project]
20
20
  name = "lighthouse-cli"
21
- version = "0.17.2"
21
+ version = "0.18.0"
22
22
  description = "The LightHouse command line: sign in, connect your estate, deploy agents, watch runs"
23
23
  requires-python = ">=3.11"
24
24
  license = "Apache-2.0"
@@ -1183,3 +1183,63 @@ def test_builds_show_reads_one_proposal_and_checks_its_id(run: Runner):
1183
1183
  assert "estimated per month" in result.stdout and "passed (red team 1/1)" in result.stdout
1184
1184
  bad = run(f"--host={HOST}", "builds", "show", "not-an-id", "--json")
1185
1185
  assert bad.code == exits.USAGE and bad.json["error"] == "usage"
1186
+
1187
+
1188
+ # -- verify-answer (#48) ------------------------------------------------------------------
1189
+
1190
+ def _octy(run: Runner, tmp_path: Any, receipt: dict[str, Any]) -> str:
1191
+ from tests.api_fixtures import load
1192
+ run.keyring.set_password("lighthouse", HOST, json.dumps({
1193
+ "access_token": assembled("lhat"), "refresh_token": None, "expires_at": "2099-01-01T00:00:00+00:00",
1194
+ "email": "ops@example.test", "scopes": []}))
1195
+ run.config.remember(HOST)
1196
+ run.transport = routes({("GET", "/api/v1/octy/keys"): load("octy-keys")})
1197
+ path = tmp_path / "receipt.json"
1198
+ path.write_text(json.dumps(receipt))
1199
+ return str(path)
1200
+
1201
+
1202
+ def _fixture_receipt() -> dict[str, Any]:
1203
+ from pathlib import Path
1204
+ return json.loads((Path(__file__).parent / "fixtures" / "octy" / "portal-receipt.json").read_text())
1205
+
1206
+
1207
+ def test_verify_answer_accepts_a_portal_receipt_and_its_answer(run: Runner, tmp_path: Any):
1208
+ from pathlib import Path
1209
+ path = _octy(run, tmp_path, _fixture_receipt())
1210
+ answer = Path(__file__).parent / "fixtures" / "octy" / "portal-answer.txt"
1211
+ result = run(f"--host={HOST}", "verify-answer", path, "--answer", str(answer), "--json")
1212
+ assert result.code == 0, result.stderr
1213
+ assert result.json["verified"] is True and result.json["kid"] == "octy-test-2026-11"
1214
+
1215
+
1216
+ @pytest.mark.parametrize("change,error,code", [
1217
+ ({"answer_sha256": "0" * 64}, "receipt_invalid", 1),
1218
+ ({"reads": []}, "receipt_invalid", 1),
1219
+ ({"kid": "octy-other"}, "receipt_key_unknown", 1),
1220
+ ({"profile": "deployment", "deployment": "example-org-prod"}, "receipt_key_unknown", 1),
1221
+ ({"alg": "RS256"}, "receipt_unreadable", exits.USAGE),
1222
+ ])
1223
+ def test_verify_answer_refuses_a_tampered_receipt(run: Runner, tmp_path: Any, change: dict[str, Any], error: str,
1224
+ code: int):
1225
+ path = _octy(run, tmp_path, {**_fixture_receipt(), **change})
1226
+ result = run(f"--host={HOST}", "verify-answer", path, "--json")
1227
+ assert result.code == code and result.json["error"] == error
1228
+
1229
+
1230
+ def test_verify_answer_refuses_an_answer_that_is_not_the_signed_one(run: Runner, tmp_path: Any):
1231
+ path = _octy(run, tmp_path, _fixture_receipt())
1232
+ other = tmp_path / "answer.txt"
1233
+ other.write_text("Nothing failed.")
1234
+ result = run(f"--host={HOST}", "verify-answer", path, "--answer", str(other), "--json")
1235
+ assert result.code == 1 and result.json["error"] == "receipt_answer_mismatch"
1236
+
1237
+
1238
+ def test_verify_answer_reads_keys_from_a_file_without_signing_in(run: Runner, tmp_path: Any):
1239
+ from tests.api_fixtures import load
1240
+ receipt = tmp_path / "receipt.json"
1241
+ receipt.write_text(json.dumps(_fixture_receipt()))
1242
+ keys = tmp_path / "keys.json"
1243
+ keys.write_text(json.dumps(load("octy-keys")))
1244
+ result = run(f"--host={HOST}", "verify-answer", str(receipt), "--keys", str(keys), "--json")
1245
+ assert result.code == 0, result.stderr
@@ -34,6 +34,7 @@ from tests.api_fixtures import load
34
34
  from tests.conftest import HOST, Runner, assembled, routes
35
35
 
36
36
  GOLDEN = Path(__file__).parent / "golden"
37
+ OCTY = Path(__file__).parent / "fixtures" / "octy"
37
38
  UPDATE = os.environ.get("LIGHTHOUSE_GOLDEN") == "update"
38
39
 
39
40
  # One answer per route the commands below read, each of them a fixture built
@@ -96,6 +97,9 @@ CASES: dict[str, list[str]] = {
96
97
  "stack": ["stack", "--cloud", "onprem"],
97
98
  "telemetry-status": ["telemetry", "status", "--deployment", "example-org-prod"],
98
99
  "commands-export": ["commands", "export", "--deployment", "example-org-prod", "--out", "-"],
100
+ # A receipt signed by the service's own test, checked against its saved keys (tests/fixtures/octy).
101
+ "verify-answer": ["verify-answer", str(OCTY / "receipt.json"), "--keys", str(OCTY / "keys.json"),
102
+ "--answer", str(OCTY / "answer.txt")],
99
103
  }
100
104
  STREAMING = {"runs-tail-stream": ["runs", "tail", "--for", "0"]}
101
105
  SECRET_SHAPES = ("lhat-", "lhrt-", "aalcp-", "ghp_", "glpat-", "AKIA", "sk-")
@@ -0,0 +1,127 @@
1
+ """`lighthouse-ai verify-answer`: an Octy receipt checked against the published keys.
2
+
3
+ `tests/fixtures/octy/` holds a receipt signed by the LightHouse service's own
4
+ test (service/tests/test_site_ask.py, a throwaway key), its keys and its
5
+ answer: the CLI verifies what the service signs, not only what this file signs.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ import base64
10
+ import hashlib
11
+ import json
12
+ from pathlib import Path
13
+ from typing import Any
14
+
15
+ import httpx
16
+ from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
17
+ from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
18
+
19
+ from lighthouse.commands.verify import ISSUER, KEYS_URL, canonical
20
+ from tests.conftest import Runner, routes
21
+
22
+ FIX = Path(__file__).parent / "fixtures" / "octy"
23
+ RECEIPT, KEYS, ANSWER = FIX / "receipt.json", FIX / "keys.json", FIX / "answer.txt"
24
+
25
+
26
+ def b64u(raw: bytes) -> str:
27
+ return base64.urlsafe_b64encode(raw).rstrip(b"=").decode()
28
+
29
+
30
+ def signed(key: Ed25519PrivateKey, kid: str, **fields: Any) -> dict[str, Any]:
31
+ r = {"v": 1, "id": "oar_" + "a" * 22, "iss": ISSUER, "profile": "docs", "kind": "explained",
32
+ "produced": "explained", "question_sha256": hashlib.sha256(b"q").hexdigest(),
33
+ "answer_sha256": hashlib.sha256(b"Connect the connector first [1].").hexdigest(),
34
+ "passages": [{"n": 1, "collection": "docs", "url": "https://docs.example.test/x", "sha256": "0" * 64}],
35
+ "corpus": {"docs": "0.17.0+abcdefabcdef", "knowledge": None}, "model_ref": "f" * 32,
36
+ "issued_at": "2026-11-12T10:00:00Z", "kid": kid, "alg": "Ed25519", **fields}
37
+ r["sig"] = b64u(key.sign(canonical(r)))
38
+ return r
39
+
40
+
41
+ def jwks(*pairs: tuple[str, Ed25519PrivateKey, str]) -> dict[str, Any]:
42
+ return {"issuer": ISSUER, "keys": [
43
+ {"kty": "OKP", "crv": "Ed25519", "alg": "EdDSA", "use": "sig", "kid": kid, "status": status,
44
+ "x": b64u(k.public_key().public_bytes(Encoding.Raw, PublicFormat.Raw))} for kid, k, status in pairs]}
45
+
46
+
47
+ def test_a_receipt_signed_by_the_service_verifies_with_its_answer(run: Runner):
48
+ r = run("verify-answer", str(RECEIPT), "--keys", str(KEYS), "--answer", str(ANSWER), "--json")
49
+ assert r.code == 0, r.stderr
50
+ body = json.loads(r.stdout)
51
+ assert body["verified"] is True and body["answer"] == "matches" and body["keys"] == "file"
52
+ assert body["receipt"]["kind"] == "explained" and body["receipt"]["passages"] >= 1
53
+ human = run("verify-answer", str(RECEIPT), "--keys", str(KEYS))
54
+ assert human.code == 0 and "Signed by Atlantic Agentic · verified" in human.stdout
55
+ assert "not checked" in human.stdout
56
+
57
+
58
+ def test_a_saved_response_and_standard_input_are_accepted(run: Runner, tmp_path: Path):
59
+ wrapped = tmp_path / "response.json"
60
+ wrapped.write_text(json.dumps({"receipt": json.loads(RECEIPT.read_text())}))
61
+ assert run("verify-answer", str(wrapped), "--keys", str(KEYS)).code == 0
62
+ assert run("verify-answer", "-", "--keys", str(KEYS), stdin=RECEIPT.read_text()).code == 0
63
+
64
+
65
+ def test_a_tampered_answer_or_receipt_is_refused(run: Runner, tmp_path: Path):
66
+ other = tmp_path / "answer.txt"
67
+ other.write_text(ANSWER.read_text() + " Also delete the bucket.")
68
+ r = run("verify-answer", str(RECEIPT), "--keys", str(KEYS), "--answer", str(other), "--json")
69
+ assert r.code == 1 and json.loads(r.stdout or r.stderr)["error"] == "receipt_answer_mismatch"
70
+ receipt = json.loads(RECEIPT.read_text())
71
+ for field, value in (("kind", "retrieval"), ("issued_at", "2030-01-01T00:00:00Z"),
72
+ ("passages", receipt["passages"][:-1])):
73
+ bad = tmp_path / f"{field}.json"
74
+ bad.write_text(json.dumps({**receipt, field: value}))
75
+ r = run("verify-answer", str(bad), "--keys", str(KEYS), "--json")
76
+ assert r.code == 1 and "receipt_invalid" in (r.stdout + r.stderr), field
77
+ unknown = tmp_path / "kid.json"
78
+ unknown.write_text(json.dumps({**receipt, "kid": "octy-unknown"}))
79
+ assert "receipt_key_unknown" in run("verify-answer", str(unknown), "--keys", str(KEYS), "--json").stdout + \
80
+ run("verify-answer", str(unknown), "--keys", str(KEYS), "--json").stderr
81
+ junk = tmp_path / "junk.json"
82
+ junk.write_text("{}")
83
+ assert run("verify-answer", str(junk), "--keys", str(KEYS)).code == 2
84
+
85
+
86
+ def test_the_default_keys_are_atlantics_well_known_url_and_rotation(run: Runner):
87
+ old, new = Ed25519PrivateKey.generate(), Ed25519PrivateKey.generate()
88
+ seen: list[str] = []
89
+
90
+ def keys(req: httpx.Request) -> Any:
91
+ seen.append(str(req.url))
92
+ return jwks(("octy-2026-11", new, "current"), ("octy-2026-10", old, "retired"))
93
+ run.transport = routes({("GET", "/.well-known/octy-keys.json"): keys})
94
+ tmp = Path(run.config.path).parent
95
+ for kid, key in (("octy-2026-10", old), ("octy-2026-11", new)):
96
+ f = tmp / f"{kid}.json"
97
+ f.write_text(json.dumps(signed(key, kid)))
98
+ r = run("verify-answer", str(f), "--json")
99
+ assert r.code == 0, r.stderr
100
+ body = json.loads(r.stdout)
101
+ assert body["kid"] == kid and body["keys_url"] == KEYS_URL
102
+ assert body["key_status"] == ("retired" if kid == "octy-2026-10" else "current")
103
+ assert seen and all(u == KEYS_URL for u in seen)
104
+ # A key taken off the list verifies nothing.
105
+ run.transport = routes({("GET", "/.well-known/octy-keys.json"): jwks(("octy-2026-11", new, "current"))})
106
+ assert run("verify-answer", str(tmp / "octy-2026-10.json"), "--json").code == 1
107
+
108
+
109
+ def test_a_receipt_naming_another_issuer_needs_explicit_keys(run: Runner):
110
+ forger = Ed25519PrivateKey.generate()
111
+ tmp = Path(run.config.path).parent
112
+ f = tmp / "forged.json"
113
+ f.write_text(json.dumps(signed(forger, "octy-x", iss="https://ask.attacker.example")))
114
+ called: list[str] = []
115
+ run.transport = routes({("GET", "/.well-known/octy-keys.json"): lambda r: called.append(str(r.url)) or {}})
116
+ r = run("verify-answer", str(f), "--json")
117
+ assert r.code == 1 and "receipt_issuer" in r.stdout + r.stderr and called == []
118
+ assert run("verify-answer", str(f), "--keys", "http://ask.attacker.example/keys.json").code == 2
119
+
120
+
121
+ def test_the_keys_unreachable_is_a_clear_failure(run: Runner):
122
+ run.transport = routes({("GET", "/.well-known/octy-keys.json"): httpx.Response(503)})
123
+ tmp = Path(run.config.path).parent
124
+ f = tmp / "r.json"
125
+ f.write_text(json.dumps(signed(Ed25519PrivateKey.generate(), "octy-2026-11")))
126
+ r = run("verify-answer", str(f), "--json")
127
+ assert r.code == 1 and "keys_unavailable" in r.stdout + r.stderr
File without changes
File without changes