You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 22990b9
Browse filesBrowse the repository at this point in the historyBrowse files
Add incremental, confirmation-gated share creation with separate entropy
requests and preserve the original ceremony seed for wallet initialization.
Support the six BIP93 master-seed sizes and retain the bip93-ms-profile
correction behavior, including cross-length recovery and ambiguity handling.
Add verified Bitcoin Core wallet initialization, keeping private descriptors
on stdin, excluding passphrase handling, revalidating wallet state, verifying
the exact public descriptor set, and relocking encrypted wallets on success,
failure, or interruption.
Refactor application profiles into dedicated modules, simplify the Bech32
codec, remove the custom build backend and BIP32 wrapper, and keep the package
below the 3,000-logical-line reviewability gate.
Rewrite and consolidate user, developer, and security documentation. Add a
reproducible trusted-publishing workflow and prepare the 1.0.0rc1 release
artifacts.
Copy file name to clipboardExpand all lines: AGENTS.md
+42-7Lines changed: 42 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Project Structure & Module Organization
4
4
5
-
Production code lives in `src/codex32/`; keep its codec, profile, artifact, generation, correction, wallet, and CLI modules narrow. Do not duplicate domain logic in `cli.py`. Tests are in `tests/test_*.py`, with frozen external vectors under `tests/data/`. Architecture, provenance, and user guidance live in `docs/`. `tools/` contains offline verification utilities.
5
+
Production code lives in `src/codex32/`; keep its modules narrow. Do not duplicate domain logic in `cli.py` or `profiles/`. Tests are in `tests/test_*.py`, with frozen external vectors under `tests/data/`. Durable documentation is grouped under `docs/user/`, `docs/developer/`, and `docs/security/`. Local plans and unfinished gate reports belong in the ignored `docs/planning/` directory. `tools/` contains offline verification utilities.
Run the local CLI with `codex32 --help`. Python 3.12 is the minimum; CI also covers 3.13 and 3.14.
20
+
Run the local CLI with `codex32 --help`. Python 3.12 is the minimum; CI also covers 3.13.
21
21
22
22
## Coding Style & Naming Conventions
23
23
24
-
Use four-space indentation and PEP 8. Ruff is the only linter and formatter. Mypy is strict; keep untyped dependency interaction inside its narrow adapter. Use `snake_case` for functions and modules, `CapWords` for types, `UPPER_CASE` for constants. Optimize for external human review. Keep the 100-character rule soft, explicitly prefer lines under 100 when doing so does not reduce readability.
24
+
- Use 4 space indentation
25
+
- The line limit for Python code is 79 characters, while comments and docstrings must be wrapped at 72 characters. However, lines up to 99 characters may be used where they improve readability and reduce line count. Definitions should use lines up to 99 characters when it reduces line count.
25
26
26
-
Prefer the style of segwit_addr.py and the in-line Python reference of BIP-0093, BIP-0173, BIP-0350, and BIP-380:
27
-
Be deliberately direct and function-oriented, with recognizable algorithm names rather than layers of abstraction, type hints, no wildcard imports, predictable imports, and explanatory module-level test documentation.
27
+
- Easy to match operators with operands
28
+
29
+
- Surround top-level function and class definitions with 2 blank lines
30
+
- Method definitions inside a class are surrounded by 1 blank line
31
+
- Extra blank lines may be used (sparingly) to separate groups of related functions
32
+
- Blank lines may be omitted between a bunch of related one-liners (e.g. a set of dummy implementations)
33
+
-Use blank lines in functions, sparingly, to indicate logical sections
34
+
35
+
- Prefer f-strings over `str.format()` or `%` formatting
36
+
37
+
- Comments that contradict the code are worse than no comments. Always make a priority of keeping the comments up-to-date when the code changes!
38
+
- Comments should be complete sentences. The first word should be capitalized, unless it is an identifier that begins with a lower case letter (never alter the case of identifiers!).
39
+
- Ensure that your comments are clear and easily understandable to English speakers.
40
+
- Use inline comments sparingly.
41
+
- An inline comment is a comment on the same line as a statement. Inline comments should be separated by at least two spaces from the statement. They should start with a # and a single space.
42
+
- Inline comments are unnecessary and in fact distracting if they state the obvious.
43
+
- Write one liner docstrings for all public modules, functions, classes, and methods. Docstrings are not necessary for non-public methods, but you should have a comment that describes what the method does. This comment should appear after the def line.
44
+
45
+
- Names that are visible to the user as public parts of the API should follow conventions that reflect usage rather than implementation.
46
+
47
+
- Use type hints, no wildcard imports
48
+
- Embrace idiomatic Python like comprehensions, generators, and decorators
49
+
- If more than one name from a module is needed, use lexicographically sorted multi-line imports in order to reduce the possibility of potential merge conflicts
50
+
51
+
Use a python linter like Ruff/flake8/Black before submitting to catch common style nits (eg trailing whitespace, unused imports, etc)
52
+
Mypy is strict; keep ignores for untyped dependency by its references. Use `snake_case` for functions and modules, `CapWords` for types, `UPPER_CASE` for constants. Optimize for human readability.
53
+
54
+
In text codex32 is always lowercase unless it refers to the Codex32 Book.
55
+
56
+
## Constraints
57
+
58
+
- Ask before adding any external dependency.
59
+
- Ask before changing the signature and response shape of existing endpoints
60
+
- Ask before suppressing format or style lints.
61
+
- Tests enforce an installed-package budget below 3,000 logical lines of code.
62
+
- Declare a task done only after the gates pass and docstrings are updated
28
63
29
64
## Testing Guidelines
30
65
31
-
Use pytest and Hypothesis. Name tests `test_<behavior>` and give test modules an evidence-focused docstring. Add normative vectors, negative cases, and regressions with behavioral changes. Never derive expected fixtures from production code, weaken assertions, or add skips to pass. Do not use real seeds or funded-wallet data. Tests enforce an installed-package budget below 3,000 lines.
66
+
Use pytest and Hypothesis. Name tests `test_<behavior>` and give test modules an evidence-focused docstring. Add normative vectors, negative cases, and regressions with behavioral changes. Never derive expected fixtures from production code, weaken assertions, or add skips to pass. Do not use real seeds or funded-wallet data.
32
67
33
68
## Security and Agent Instructions
34
69
35
-
Read `SECURITY.md`, `docs/architecture.md`, and `docs/AI_POLICY.md` before security work. Preserve validated-artifact boundaries, symbol-only shares, OS-backed entropy, and stdout/stderr separation. Agents may edit and test locally, but must not push, open pull requests, post maintainer comments, or claim authorship. A human publishes every contribution.
70
+
Read `SECURITY.md`, `docs/security/model.md`, `docs/developer/api.md`, and `docs/developer/ai-policy.md` before security work. Preserve validated-artifact boundaries, symbol-only shares, OS-backed entropy, and stdout/stderr separation. Agents may edit and test locally, but must not push, open pull requests, post maintainer comments, or claim authorship. A human publishes every contribution.
0 commit comments