aetherproof 0.2.2__tar.gz → 0.2.3__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 (39) hide show
  1. aetherproof-0.2.3/LICENSE +61 -0
  2. {aetherproof-0.2.2 → aetherproof-0.2.3}/MANIFEST.in +26 -26
  3. {aetherproof-0.2.2/aetherproof.egg-info → aetherproof-0.2.3}/PKG-INFO +6 -7
  4. {aetherproof-0.2.2 → aetherproof-0.2.3}/README.md +3 -4
  5. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/__main__.py +5 -5
  6. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/cli.py +164 -164
  7. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/keystore.py +100 -100
  8. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/receipt.py +4 -4
  9. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/ui/easy_mode.py +449 -449
  10. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/ui/expert_mode.py +372 -372
  11. {aetherproof-0.2.2 → aetherproof-0.2.3/aetherproof.egg-info}/PKG-INFO +6 -7
  12. {aetherproof-0.2.2 → aetherproof-0.2.3}/pyproject.toml +3 -3
  13. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/README.md +32 -32
  14. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/test_cli_contract.py +66 -66
  15. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/test_cloud_api_attested.py +71 -71
  16. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/test_cloud_models_matrix.py +55 -55
  17. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/test_parsing_and_types.py +48 -48
  18. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/test_preimage_injectivity.py +83 -83
  19. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/security/test_v12_extensions.py +82 -82
  20. aetherproof-0.2.2/LICENSE +0 -661
  21. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/__init__.py +0 -0
  22. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/__init__.py +0 -0
  23. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/hash.py +0 -0
  24. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/log.py +0 -0
  25. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/signer.py +0 -0
  26. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/core/verifier.py +0 -0
  27. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/ui/__init__.py +0 -0
  28. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/ui/display.py +0 -0
  29. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof/ui/menus.py +0 -0
  30. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof.egg-info/SOURCES.txt +0 -0
  31. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof.egg-info/dependency_links.txt +0 -0
  32. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof.egg-info/entry_points.txt +0 -0
  33. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof.egg-info/requires.txt +0 -0
  34. {aetherproof-0.2.2 → aetherproof-0.2.3}/aetherproof.egg-info/top_level.txt +0 -0
  35. {aetherproof-0.2.2 → aetherproof-0.2.3}/setup.cfg +0 -0
  36. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/conftest.py +0 -0
  37. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/test_log.py +0 -0
  38. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/test_receipt.py +0 -0
  39. {aetherproof-0.2.2 → aetherproof-0.2.3}/tests/test_verifier.py +0 -0
@@ -0,0 +1,61 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship made available under the License, as indicated by a copyright notice that is included in or attached to the work.
22
+
23
+ "Derivative Works" shall mean any work that is based on the Work, for which the editorial revisions, annotations, elaborations, or other transformations represent, as a whole, an original work of authorship.
24
+
25
+ "Contribution" shall mean any work of authorship submitted to the Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner.
26
+
27
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of whom a Contribution has been received by the Licensor and included in the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file, you must include a readable copy of the attribution notices contained within such NOTICE file.
42
+
43
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions.
44
+
45
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor.
46
+
47
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. You are solely responsible for determining the appropriateness of using the Work.
48
+
49
+ 8. Limitation of Liability. In no event and under no legal theory shall any Contributor be liable for damages arising from this License or out of the use or inability to use the Work.
50
+
51
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work, You may offer acceptance of warranty, liability, or other conditions consistent with this License. However, in accepting such obligations, You act on Your own behalf alone.
52
+
53
+ END OF TERMS AND CONDITIONS
54
+
55
+ Copyright 2024-2025 Pulkit Srivastava
56
+
57
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
58
+
59
+ http://www.apache.org/licenses/LICENSE-2.0
60
+
61
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -1,26 +1,26 @@
1
- # What ships in the source distribution. Explicit allow-list + hard prunes so no
2
- # local data, keys, internal docs, or build junk can leak into a published build.
3
-
4
- include README.md
5
- include LICENSE
6
- include pyproject.toml
7
- recursive-include aetherproof *.py
8
- recursive-include tests *.py *.md
9
-
10
- # Hard prunes (defense in depth — setuptools does NOT read .gitignore)
11
- prune receipts
12
- prune build
13
- prune dist
14
- prune target
15
- prune docs
16
- recursive-exclude * __pycache__
17
- recursive-exclude * *.py[cod]
18
- recursive-exclude * *.pem
19
- recursive-exclude * *.pub
20
- recursive-exclude * *.key
21
- recursive-exclude * *.db
22
- recursive-exclude * *.receipt
23
- recursive-exclude * *.bin
24
- global-exclude AetherProof_*.html
25
- global-exclude .env
26
- global-exclude *.log
1
+ # What ships in the source distribution. Explicit allow-list + hard prunes so no
2
+ # local data, keys, internal docs, or build junk can leak into a published build.
3
+
4
+ include README.md
5
+ include LICENSE
6
+ include pyproject.toml
7
+ recursive-include aetherproof *.py
8
+ recursive-include tests *.py *.md
9
+
10
+ # Hard prunes (defense in depth — setuptools does NOT read .gitignore)
11
+ prune receipts
12
+ prune build
13
+ prune dist
14
+ prune target
15
+ prune docs
16
+ recursive-exclude * __pycache__
17
+ recursive-exclude * *.py[cod]
18
+ recursive-exclude * *.pem
19
+ recursive-exclude * *.pub
20
+ recursive-exclude * *.key
21
+ recursive-exclude * *.db
22
+ recursive-exclude * *.receipt
23
+ recursive-exclude * *.bin
24
+ global-exclude AetherProof_*.html
25
+ global-exclude .env
26
+ global-exclude *.log
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aetherproof
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: AetherProof — the open-source receipt engine. Prototype of Signet.
5
5
  Author: Pulkit Srivastava
6
- License: AGPL-3.0-or-later
6
+ License: Apache-2.0
7
7
  Keywords: cryptography,ai,audit,compliance,ed25519,receipt,tamper-proof
8
8
  Classifier: Development Status :: 3 - Alpha
9
9
  Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
@@ -46,7 +46,7 @@ Run `aetherproof` with no arguments for the interactive menu:
46
46
 
47
47
  ```
48
48
  .+######+. AETHERPROOF
49
- ## ## v0.2.1
49
+ ## ## v0.2.2
50
50
  # /\ # Cryptographic receipt engine
51
51
  # / \ # Prototype of Signet · R0/L2
52
52
  # / /\ \ #
@@ -336,9 +336,8 @@ AetherProof is **Layer 2** of the **Signet** stack. Signet adds hardware roots,
336
336
 
337
337
  ## License
338
338
 
339
- AGPL-3.0-or-later. Use it, deploy it, fork it, verify it — but if you run a
340
- modified version as a network service, you must release your changes under the
341
- same license. (Need a permissive/commercial license? That's what Signet is for.)
339
+ Apache 2.0. Use it, deploy it, fork it, embed it in commercial products —
340
+ no restrictions. See LICENSE for full terms.
342
341
 
343
342
  ---
344
343
 
@@ -16,7 +16,7 @@ Run `aetherproof` with no arguments for the interactive menu:
16
16
 
17
17
  ```
18
18
  .+######+. AETHERPROOF
19
- ## ## v0.2.1
19
+ ## ## v0.2.2
20
20
  # /\ # Cryptographic receipt engine
21
21
  # / \ # Prototype of Signet · R0/L2
22
22
  # / /\ \ #
@@ -306,9 +306,8 @@ AetherProof is **Layer 2** of the **Signet** stack. Signet adds hardware roots,
306
306
 
307
307
  ## License
308
308
 
309
- AGPL-3.0-or-later. Use it, deploy it, fork it, verify it — but if you run a
310
- modified version as a network service, you must release your changes under the
311
- same license. (Need a permissive/commercial license? That's what Signet is for.)
309
+ Apache 2.0. Use it, deploy it, fork it, embed it in commercial products —
310
+ no restrictions. See LICENSE for full terms.
312
311
 
313
312
  ---
314
313
 
@@ -1,5 +1,5 @@
1
- import sys
2
- from .cli import main
3
-
4
- if __name__ == "__main__":
5
- sys.exit(main())
1
+ import sys
2
+ from .cli import main
3
+
4
+ if __name__ == "__main__":
5
+ sys.exit(main())
@@ -1,164 +1,164 @@
1
- """CLI entry point — bare interactive menu or direct subcommands."""
2
-
3
- import sys
4
- import json
5
- from pathlib import Path
6
-
7
- import questionary
8
- from rich.table import Table
9
-
10
- from .ui.display import console, print_logo, run_about
11
- from .ui.menus import show_main_menu
12
- from .ui.easy_mode import (
13
- run_easy_mode,
14
- run_verify_wizard,
15
- PathValidator,
16
- _save_last_pubkey,
17
- )
18
- from .ui.expert_mode import run_expert_mode
19
- from .core.log import ReceiptLog
20
- from .core.keystore import KEY_DIR, load_or_create_signer
21
-
22
-
23
- def _app_state():
24
- # persistent app signing key + transparency log (shared keystore)
25
- signer = load_or_create_signer(KEY_DIR)
26
- pub = KEY_DIR / "signing_key.pub"
27
- if pub.exists():
28
- _save_last_pubkey(pub) # verify wizard defaults to the app key
29
- return signer, ReceiptLog()
30
-
31
-
32
- def _ask_path(message):
33
- try:
34
- return questionary.path(message, validate=PathValidator(is_file=True)).ask()
35
- except KeyboardInterrupt:
36
- return None
37
-
38
-
39
- def _ask_text(message, default=""):
40
- try:
41
- return questionary.text(message, default=default).ask()
42
- except KeyboardInterrupt:
43
- return None
44
-
45
-
46
- def run_expert_shell():
47
- console.print("[dim]Expert shell — type a command, or 'exit' to return.[/dim]")
48
- while True:
49
- try:
50
- line = console.input("[cyan bold]aetherproof>[/cyan bold] ").strip()
51
- except (EOFError, KeyboardInterrupt):
52
- return
53
- if not line:
54
- continue
55
- if line.lower() in ("exit", "quit"):
56
- return
57
- run_expert_mode(line.split())
58
-
59
-
60
- def run_inspect_wizard():
61
- p = _ask_path("Receipt file path:")
62
- if p:
63
- run_expert_mode(["inspect", p])
64
-
65
-
66
- def run_log_viewer():
67
- run_expert_mode(["log", "list"])
68
- run_expert_mode(["log", "verify"])
69
-
70
-
71
- def run_keygen_wizard():
72
- prefix = _ask_text("Key name (prefix):", default="aetherproof_key")
73
- if not prefix:
74
- return
75
- run_expert_mode(["keygen", "--output", prefix])
76
- pub = Path(f"{prefix}.pub")
77
- if pub.exists():
78
- _save_last_pubkey(pub) # becomes the verify-wizard default
79
-
80
-
81
- def _help_table():
82
- table = Table(title="AetherProof — commands", show_header=True, header_style="cyan")
83
- table.add_column("Command")
84
- table.add_column("Description")
85
- table.add_row("aetherproof", "Launch the interactive menu")
86
- table.add_row("sign <model> <output> [--quiet]", "Sign a model output → receipt")
87
- table.add_row("verify <receipt> [--pubkey K] [--output F] [--quiet]", "Verify a receipt (+ output file) offline")
88
- table.add_row("inspect <receipt>", "Show all receipt fields decoded")
89
- table.add_row("log <list|verify|count>", "Inspect the transparency log")
90
- table.add_row("keygen [--output NAME]", "Generate an Ed25519 keypair")
91
- table.add_row("export <receipt> --format <json|hex|cbor>", "Export a receipt")
92
- table.add_row("tamper <receipt>", "Test tamper detection")
93
- table.add_row("--debug", "Show full tracebacks on error")
94
- console.print(table)
95
-
96
-
97
- def _run(argv):
98
- if argv: # direct subcommand
99
- if argv[0] in ("-h", "--help", "help"):
100
- _help_table()
101
- return
102
- ok = run_expert_mode(argv)
103
- if ok is False: # failed verification / broken log / error -> exit 1
104
- sys.exit(1)
105
- return
106
-
107
- # the bare command launches the interactive menu, which needs a real
108
- # terminal. in a pipe / CI / redirected context, fail clearly instead of
109
- # with a confusing prompt_toolkit traceback.
110
- if not sys.stdin.isatty() or not sys.stdout.isatty():
111
- console.print("AetherProof needs an interactive terminal for the menu.")
112
- console.print("Run a direct command instead, e.g. "
113
- "[cyan]aetherproof --help[/cyan] or "
114
- "[cyan]aetherproof sign <model> <output>[/cyan].")
115
- sys.exit(2)
116
-
117
- signer, log = _app_state()
118
- print_logo()
119
- routes = {
120
- "Sign an AI output": lambda: run_easy_mode(signer, log),
121
- "Verify a receipt": lambda: run_verify_wizard(signer.get_public_key(), log),
122
- "Expert CLI mode": run_expert_shell,
123
- "Inspect a receipt": run_inspect_wizard,
124
- "View transparency log": run_log_viewer,
125
- "Generate keypair": run_keygen_wizard,
126
- "About AetherProof": run_about,
127
- "Quit": lambda: sys.exit(0),
128
- }
129
- while True:
130
- routes[show_main_menu()]()
131
-
132
-
133
- def main(argv=None) -> int:
134
- argv = list(sys.argv[1:] if argv is None else argv)
135
- debug = "--debug" in argv
136
- argv = [a for a in argv if a != "--debug"]
137
-
138
- try:
139
- _run(argv)
140
- return 0
141
- except KeyboardInterrupt:
142
- if debug:
143
- raise
144
- console.print("Cancelled. Nothing was written.")
145
- sys.exit(0)
146
- except FileNotFoundError as e:
147
- if debug:
148
- raise
149
- console.print(f"[red]File not found:[/red] {e.filename}")
150
- sys.exit(1)
151
- except json.JSONDecodeError:
152
- if debug:
153
- raise
154
- console.print("[red]Could not read file. May be corrupted.[/red]")
155
- sys.exit(1)
156
- except Exception as e:
157
- if debug:
158
- raise
159
- console.print(f"[red]Unexpected error:[/red] {e} (run with --debug for details)")
160
- sys.exit(1)
161
-
162
-
163
- if __name__ == "__main__":
164
- sys.exit(main())
1
+ """CLI entry point — bare interactive menu or direct subcommands."""
2
+
3
+ import sys
4
+ import json
5
+ from pathlib import Path
6
+
7
+ import questionary
8
+ from rich.table import Table
9
+
10
+ from .ui.display import console, print_logo, run_about
11
+ from .ui.menus import show_main_menu
12
+ from .ui.easy_mode import (
13
+ run_easy_mode,
14
+ run_verify_wizard,
15
+ PathValidator,
16
+ _save_last_pubkey,
17
+ )
18
+ from .ui.expert_mode import run_expert_mode
19
+ from .core.log import ReceiptLog
20
+ from .core.keystore import KEY_DIR, load_or_create_signer
21
+
22
+
23
+ def _app_state():
24
+ # persistent app signing key + transparency log (shared keystore)
25
+ signer = load_or_create_signer(KEY_DIR)
26
+ pub = KEY_DIR / "signing_key.pub"
27
+ if pub.exists():
28
+ _save_last_pubkey(pub) # verify wizard defaults to the app key
29
+ return signer, ReceiptLog()
30
+
31
+
32
+ def _ask_path(message):
33
+ try:
34
+ return questionary.path(message, validate=PathValidator(is_file=True)).ask()
35
+ except KeyboardInterrupt:
36
+ return None
37
+
38
+
39
+ def _ask_text(message, default=""):
40
+ try:
41
+ return questionary.text(message, default=default).ask()
42
+ except KeyboardInterrupt:
43
+ return None
44
+
45
+
46
+ def run_expert_shell():
47
+ console.print("[dim]Expert shell — type a command, or 'exit' to return.[/dim]")
48
+ while True:
49
+ try:
50
+ line = console.input("[cyan bold]aetherproof>[/cyan bold] ").strip()
51
+ except (EOFError, KeyboardInterrupt):
52
+ return
53
+ if not line:
54
+ continue
55
+ if line.lower() in ("exit", "quit"):
56
+ return
57
+ run_expert_mode(line.split())
58
+
59
+
60
+ def run_inspect_wizard():
61
+ p = _ask_path("Receipt file path:")
62
+ if p:
63
+ run_expert_mode(["inspect", p])
64
+
65
+
66
+ def run_log_viewer():
67
+ run_expert_mode(["log", "list"])
68
+ run_expert_mode(["log", "verify"])
69
+
70
+
71
+ def run_keygen_wizard():
72
+ prefix = _ask_text("Key name (prefix):", default="aetherproof_key")
73
+ if not prefix:
74
+ return
75
+ run_expert_mode(["keygen", "--output", prefix])
76
+ pub = Path(f"{prefix}.pub")
77
+ if pub.exists():
78
+ _save_last_pubkey(pub) # becomes the verify-wizard default
79
+
80
+
81
+ def _help_table():
82
+ table = Table(title="AetherProof — commands", show_header=True, header_style="cyan")
83
+ table.add_column("Command")
84
+ table.add_column("Description")
85
+ table.add_row("aetherproof", "Launch the interactive menu")
86
+ table.add_row("sign <model> <output> [--quiet]", "Sign a model output → receipt")
87
+ table.add_row("verify <receipt> [--pubkey K] [--output F] [--quiet]", "Verify a receipt (+ output file) offline")
88
+ table.add_row("inspect <receipt>", "Show all receipt fields decoded")
89
+ table.add_row("log <list|verify|count>", "Inspect the transparency log")
90
+ table.add_row("keygen [--output NAME]", "Generate an Ed25519 keypair")
91
+ table.add_row("export <receipt> --format <json|hex|cbor>", "Export a receipt")
92
+ table.add_row("tamper <receipt>", "Test tamper detection")
93
+ table.add_row("--debug", "Show full tracebacks on error")
94
+ console.print(table)
95
+
96
+
97
+ def _run(argv):
98
+ if argv: # direct subcommand
99
+ if argv[0] in ("-h", "--help", "help"):
100
+ _help_table()
101
+ return
102
+ ok = run_expert_mode(argv)
103
+ if ok is False: # failed verification / broken log / error -> exit 1
104
+ sys.exit(1)
105
+ return
106
+
107
+ # the bare command launches the interactive menu, which needs a real
108
+ # terminal. in a pipe / CI / redirected context, fail clearly instead of
109
+ # with a confusing prompt_toolkit traceback.
110
+ if not sys.stdin.isatty() or not sys.stdout.isatty():
111
+ console.print("AetherProof needs an interactive terminal for the menu.")
112
+ console.print("Run a direct command instead, e.g. "
113
+ "[cyan]aetherproof --help[/cyan] or "
114
+ "[cyan]aetherproof sign <model> <output>[/cyan].")
115
+ sys.exit(2)
116
+
117
+ signer, log = _app_state()
118
+ print_logo()
119
+ routes = {
120
+ "Sign an AI output": lambda: run_easy_mode(signer, log),
121
+ "Verify a receipt": lambda: run_verify_wizard(signer.get_public_key(), log),
122
+ "Expert CLI mode": run_expert_shell,
123
+ "Inspect a receipt": run_inspect_wizard,
124
+ "View transparency log": run_log_viewer,
125
+ "Generate keypair": run_keygen_wizard,
126
+ "About AetherProof": run_about,
127
+ "Quit": lambda: sys.exit(0),
128
+ }
129
+ while True:
130
+ routes[show_main_menu()]()
131
+
132
+
133
+ def main(argv=None) -> int:
134
+ argv = list(sys.argv[1:] if argv is None else argv)
135
+ debug = "--debug" in argv
136
+ argv = [a for a in argv if a != "--debug"]
137
+
138
+ try:
139
+ _run(argv)
140
+ return 0
141
+ except KeyboardInterrupt:
142
+ if debug:
143
+ raise
144
+ console.print("Cancelled. Nothing was written.")
145
+ sys.exit(0)
146
+ except FileNotFoundError as e:
147
+ if debug:
148
+ raise
149
+ console.print(f"[red]File not found:[/red] {e.filename}")
150
+ sys.exit(1)
151
+ except json.JSONDecodeError:
152
+ if debug:
153
+ raise
154
+ console.print("[red]Could not read file. May be corrupted.[/red]")
155
+ sys.exit(1)
156
+ except Exception as e:
157
+ if debug:
158
+ raise
159
+ console.print(f"[red]Unexpected error:[/red] {e} (run with --debug for details)")
160
+ sys.exit(1)
161
+
162
+
163
+ if __name__ == "__main__":
164
+ sys.exit(main())