verdock 0.3.1__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 (115) hide show
  1. verdock-0.3.1/.github/ISSUE_TEMPLATE/bug_report.md +12 -0
  2. verdock-0.3.1/.github/ISSUE_TEMPLATE/question.md +10 -0
  3. verdock-0.3.1/.github/workflows/check.yml +60 -0
  4. verdock-0.3.1/.github/workflows/publish-pypi.yml +37 -0
  5. verdock-0.3.1/.github/workflows/publish-testpypi.yml +38 -0
  6. verdock-0.3.1/CHANGELOG.md +68 -0
  7. verdock-0.3.1/LICENSE +21 -0
  8. verdock-0.3.1/MANIFEST.in +8 -0
  9. verdock-0.3.1/PKG-INFO +170 -0
  10. verdock-0.3.1/README.md +154 -0
  11. verdock-0.3.1/docs/ADAPTERS.md +153 -0
  12. verdock-0.3.1/docs/CLI.md +74 -0
  13. verdock-0.3.1/docs/DISCLOSURE.md +29 -0
  14. verdock-0.3.1/docs/EXCHANGE.md +47 -0
  15. verdock-0.3.1/docs/LIMITS.md +12 -0
  16. verdock-0.3.1/docs/MAKER_CHECKER.md +37 -0
  17. verdock-0.3.1/docs/MANIFEST.md +45 -0
  18. verdock-0.3.1/docs/OFFLINE_BUNDLE.md +60 -0
  19. verdock-0.3.1/docs/ROADMAP_SDKS.md +19 -0
  20. verdock-0.3.1/docs/THIRD_PARTY.md +18 -0
  21. verdock-0.3.1/docs/banks.md +29 -0
  22. verdock-0.3.1/js/verify.js +485 -0
  23. verdock-0.3.1/js/verify.test.mjs +127 -0
  24. verdock-0.3.1/pyproject.toml +30 -0
  25. verdock-0.3.1/setup.cfg +4 -0
  26. verdock-0.3.1/tests/adapter_support.py +757 -0
  27. verdock-0.3.1/tests/fixtures/statement.camt053.xml +45 -0
  28. verdock-0.3.1/tests/fixtures/statement.csv +5 -0
  29. verdock-0.3.1/tests/fixtures/statement.inr.camt053.xml +45 -0
  30. verdock-0.3.1/tests/fixtures/statement.inr.csv +5 -0
  31. verdock-0.3.1/tests/test_adapters_paypal.py +187 -0
  32. verdock-0.3.1/tests/test_adapters_razorpay.py +190 -0
  33. verdock-0.3.1/tests/test_adapters_stripe.py +123 -0
  34. verdock-0.3.1/tests/test_approvals.py +125 -0
  35. verdock-0.3.1/tests/test_bankfile.py +122 -0
  36. verdock-0.3.1/tests/test_cli.py +55 -0
  37. verdock-0.3.1/tests/test_credits_cli.py +196 -0
  38. verdock-0.3.1/tests/test_crosslang.py +261 -0
  39. verdock-0.3.1/tests/test_crosslang_adapters.py +107 -0
  40. verdock-0.3.1/tests/test_crosslang_credits.py +113 -0
  41. verdock-0.3.1/tests/test_crosslang_v3.py +121 -0
  42. verdock-0.3.1/tests/test_demo_scenes.py +499 -0
  43. verdock-0.3.1/tests/test_diag.py +92 -0
  44. verdock-0.3.1/tests/test_egress.py +131 -0
  45. verdock-0.3.1/tests/test_every_action.py +124 -0
  46. verdock-0.3.1/tests/test_exceptions.py +77 -0
  47. verdock-0.3.1/tests/test_exchange.py +344 -0
  48. verdock-0.3.1/tests/test_invariants.py +128 -0
  49. verdock-0.3.1/tests/test_manifest.py +130 -0
  50. verdock-0.3.1/tests/test_offline_bundle.py +260 -0
  51. verdock-0.3.1/tests/test_outcome.py +110 -0
  52. verdock-0.3.1/tests/test_package.py +233 -0
  53. verdock-0.3.1/tests/test_policy.py +211 -0
  54. verdock-0.3.1/tests/test_razorpay_run_tool.py +63 -0
  55. verdock-0.3.1/tests/test_receipts.py +225 -0
  56. verdock-0.3.1/tests/test_vectors_shared.py +114 -0
  57. verdock-0.3.1/tests/test_vectors_v3.py +71 -0
  58. verdock-0.3.1/tests/vectors.py +38 -0
  59. verdock-0.3.1/tools/build_offline_bundle.py +331 -0
  60. verdock-0.3.1/tools/check_distribution.py +81 -0
  61. verdock-0.3.1/tools/installed_quickstart.py +34 -0
  62. verdock-0.3.1/tools/make_vectors.py +728 -0
  63. verdock-0.3.1/tools/make_vectors_v3.py +229 -0
  64. verdock-0.3.1/tools/offline_demo.py +226 -0
  65. verdock-0.3.1/tools/razorpay_refund_run.py +99 -0
  66. verdock-0.3.1/tools/smoke_razorpay.py +89 -0
  67. verdock-0.3.1/tools/smoke_stripe.py +82 -0
  68. verdock-0.3.1/tools/verify_offline.py +181 -0
  69. verdock-0.3.1/vectors/approvals.json +529 -0
  70. verdock-0.3.1/vectors/canonical.json +245 -0
  71. verdock-0.3.1/vectors/invariants.json +396 -0
  72. verdock-0.3.1/vectors/outcomes.json +651 -0
  73. verdock-0.3.1/vectors/policy.json +2465 -0
  74. verdock-0.3.1/vectors/receipts.json +248 -0
  75. verdock-0.3.1/vectors/v3.json +1610 -0
  76. verdock-0.3.1/vectors/verify.json +734 -0
  77. verdock-0.3.1/verdock/__init__.py +15 -0
  78. verdock-0.3.1/verdock/__main__.py +173 -0
  79. verdock-0.3.1/verdock/_db.py +40 -0
  80. verdock-0.3.1/verdock/adapters/__init__.py +12 -0
  81. verdock-0.3.1/verdock/adapters/_http.py +531 -0
  82. verdock-0.3.1/verdock/adapters/paypal.py +147 -0
  83. verdock-0.3.1/verdock/adapters/razorpay.py +219 -0
  84. verdock-0.3.1/verdock/adapters/stripe.py +131 -0
  85. verdock-0.3.1/verdock/approvals.py +169 -0
  86. verdock-0.3.1/verdock/bankfile.py +249 -0
  87. verdock-0.3.1/verdock/credits.py +282 -0
  88. verdock-0.3.1/verdock/credits_cli.py +265 -0
  89. verdock-0.3.1/verdock/demo.py +808 -0
  90. verdock-0.3.1/verdock/diag.py +81 -0
  91. verdock-0.3.1/verdock/disclosure.py +93 -0
  92. verdock-0.3.1/verdock/ed25519.py +145 -0
  93. verdock-0.3.1/verdock/egress.py +132 -0
  94. verdock-0.3.1/verdock/errors.py +13 -0
  95. verdock-0.3.1/verdock/exceptions.py +45 -0
  96. verdock-0.3.1/verdock/exchange.py +587 -0
  97. verdock-0.3.1/verdock/exchange_cli.py +373 -0
  98. verdock-0.3.1/verdock/gate.py +65 -0
  99. verdock-0.3.1/verdock/guard.py +96 -0
  100. verdock-0.3.1/verdock/invariants.py +175 -0
  101. verdock-0.3.1/verdock/licence.py +232 -0
  102. verdock-0.3.1/verdock/local.py +29 -0
  103. verdock-0.3.1/verdock/maker_checker.py +140 -0
  104. verdock-0.3.1/verdock/manifest.py +269 -0
  105. verdock-0.3.1/verdock/netguard.py +37 -0
  106. verdock-0.3.1/verdock/outcome.py +201 -0
  107. verdock-0.3.1/verdock/policy.py +435 -0
  108. verdock-0.3.1/verdock/queue.py +48 -0
  109. verdock-0.3.1/verdock/receipts.py +411 -0
  110. verdock-0.3.1/verdock/run_v1.json +232 -0
  111. verdock-0.3.1/verdock.egg-info/PKG-INFO +170 -0
  112. verdock-0.3.1/verdock.egg-info/SOURCES.txt +113 -0
  113. verdock-0.3.1/verdock.egg-info/dependency_links.txt +1 -0
  114. verdock-0.3.1/verdock.egg-info/entry_points.txt +2 -0
  115. verdock-0.3.1/verdock.egg-info/top_level.txt +1 -0
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a problem with Verdock
4
+ title: ''
5
+ labels: bug
6
+ ---
7
+
8
+ What happened? What did you expect?
9
+
10
+ Verdock version, Python version and operating system:
11
+
12
+ Steps to reproduce, with credentials and private records removed:
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: Question
3
+ about: Ask about using Verdock
4
+ title: ''
5
+ labels: question
6
+ ---
7
+
8
+ What would you like to understand?
9
+
10
+ Include only information you can share publicly. Never include keys, passwords or account records.
@@ -0,0 +1,60 @@
1
+ name: Package checks
2
+ on: [push, pull_request, workflow_dispatch]
3
+ jobs:
4
+ test:
5
+ strategy:
6
+ matrix:
7
+ os: [ubuntu-latest, windows-latest]
8
+ python: ['3.10', '3.13']
9
+ runs-on: ${{ matrix.os }}
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: ${{ matrix.python }}
15
+ - uses: actions/setup-node@v4
16
+ with:
17
+ node-version: '22'
18
+ - run: python -m pip install build
19
+ - run: python -m build
20
+ - run: python tools/check_distribution.py
21
+ - run: python -m unittest discover -s tests
22
+ - run: node --test js/verify.test.mjs
23
+ - run: python -m venv .venv-wheel
24
+ - name: Fresh wheel quickstart
25
+ shell: bash
26
+ run: |
27
+ if [ "$RUNNER_OS" = "Windows" ]; then PY=.venv-wheel/Scripts/python; else PY=.venv-wheel/bin/python; fi
28
+ "$PY" -m pip install --no-index --no-deps dist/*.whl
29
+ "$PY" tools/installed_quickstart.py
30
+ node:
31
+ name: node ${{ matrix.node }} on ${{ matrix.os }}
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ os: [ubuntu-latest, windows-latest]
36
+ node: ['18', '22']
37
+ runs-on: ${{ matrix.os }}
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: actions/setup-python@v5
41
+ with:
42
+ python-version: '3.13'
43
+ - uses: actions/setup-node@v4
44
+ with:
45
+ node-version: ${{ matrix.node }}
46
+ - name: Shared vectors match the Python generator
47
+ run: python tools/make_vectors.py --check
48
+ - name: Shared vectors, Python side
49
+ run: python -m unittest discover -s tests -p "test_vectors_shared.py"
50
+ - name: Cross language receipts, both directions
51
+ run: python -m unittest discover -s tests -p "test_crosslang.py"
52
+ - name: Cross language adapter receipts, both directions
53
+ run: python -m unittest discover -s tests -p "test_crosslang_adapters.py"
54
+ - name: Cross language 0.3.0 receipts, both directions
55
+ run: python -m unittest discover -s tests -p "test_crosslang_v3.py"
56
+ - name: Browser verifier and shared 0.3.0 vectors
57
+ run: node --test js/verify.test.mjs
58
+ - name: Node tests (includes shared vectors, adapters against the fake provider, network block and clean install)
59
+ working-directory: node
60
+ run: npm test
@@ -0,0 +1,37 @@
1
+ name: Publish to PyPI
2
+ # Manual only. This publishes to the real PyPI index and cannot be undone, so it refuses
3
+ # to run unless the confirm field is exactly: publish pypi
4
+ on:
5
+ workflow_dispatch:
6
+ inputs:
7
+ confirm:
8
+ description: 'Type publish pypi to upload to the real PyPI index'
9
+ required: true
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ steps:
16
+ - name: Check the confirmation word
17
+ run: |
18
+ if [ "${{ github.event.inputs.confirm }}" != "publish pypi" ]; then
19
+ echo "The confirm field must be exactly: publish pypi"
20
+ exit 1
21
+ fi
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.13'
26
+ - run: python -m pip install build twine==6.1.0
27
+ - run: python -m build
28
+ - run: python tools/check_distribution.py
29
+ - run: python -m unittest discover -s tests
30
+ - run: python -m twine check dist/*
31
+ - name: Upload to PyPI
32
+ env:
33
+ TWINE_USERNAME: __token__
34
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35
+ run: |
36
+ if [ -z "$TWINE_PASSWORD" ]; then echo "Add the repository secret PYPI_API_TOKEN first."; exit 1; fi
37
+ python -m twine upload --non-interactive dist/*
@@ -0,0 +1,38 @@
1
+ name: Upload to TestPyPI
2
+ # Manual only. It uploads to the TestPyPI index, never to PyPI, and refuses to run
3
+ # unless the confirm field is exactly: testpypi
4
+ on:
5
+ workflow_dispatch:
6
+ inputs:
7
+ confirm:
8
+ description: 'Type testpypi to upload to the TestPyPI index'
9
+ required: true
10
+ jobs:
11
+ upload:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ steps:
16
+ - name: Check the confirmation word
17
+ run: |
18
+ if [ "${{ github.event.inputs.confirm }}" != "testpypi" ]; then
19
+ echo "The confirm field must be exactly: testpypi"
20
+ exit 1
21
+ fi
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.13'
26
+ - run: python -m pip install build twine==6.1.0
27
+ - run: python -m build
28
+ - run: python tools/check_distribution.py
29
+ - run: python -m unittest discover -s tests
30
+ - run: python -m twine check dist/*
31
+ - name: Upload to TestPyPI
32
+ env:
33
+ TWINE_USERNAME: __token__
34
+ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
35
+ TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
36
+ run: |
37
+ if [ -z "$TWINE_PASSWORD" ]; then echo "Add the repository secret TEST_PYPI_API_TOKEN first."; exit 1; fi
38
+ python -m twine upload --non-interactive dist/*
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ ## 0.3.1 (unreleased)
4
+
5
+ * `verdock demo --currency usd|inr` in Python and Node, default usd. usd shows $4,800 and $200,000. inr shows the rupee sign with Indian grouping, for example 2,00,000. The currency code in the scene text, receipts and policies follows the choice. The text is identical in both languages for each currency. The counters (verified 105, mismatch 2, unknown reconciled 1, held 7, blocked 1, approved 4) and the 106 credits are the same in both. Any other value is an error with exit status 2.
6
+ * `tools/offline_demo.py --currency usd|inr`. INR variants of the bank statement fixtures sit beside the USD ones with the same numbers.
7
+
8
+ Credit rule: one credit is one action that ends VERIFIED. A MISMATCH is raised to a human and is free, and the free safety checks row counts it. An UNKNOWN is free until it reconciles to VERIFIED, then it is charged once. The scenario file `run_v1.json` follows the same rule: the full run uses 106 credits.
9
+ Adapters, in Python and Node:
10
+
11
+ * PayPal sandbox adapter, refund only: `PayPal-Request-Id` on `POST /v2/payments/captures/{id}/refund`, read back with `GET /v2/payments/refunds/{id}`, VERIFIED, MISMATCH or UNKNOWN. The live PayPal host is refused with no override. PayPal has no refund list call, so `reconcile` cannot find a refund whose id was lost; `retry_same_key` sends the same request id and PayPal returns the first refund. Tested against a local stand in provider only; no sandbox run is recorded yet.
12
+ * Razorpay: the idempotency key sent as `X-Refund-Idempotency` and `X-Payout-Idempotency` must be at least 10 characters (checked before anything is stored or sent). `accept_webhook` (`acceptWebhook` in Node) drops duplicate deliveries by `x-razorpay-event-id` and can check `x-razorpay-signature`.
13
+ * Stripe is unchanged: `Idempotency-Key` on every POST, read back, no blind retry.
14
+ * `tools/razorpay_refund_run.py`: runs one Razorpay test mode refund for a captured test payment id from `RAZORPAY_TEST_PAYMENT_ID` and saves a run file and the receipt chain under `data/runs/`. No real Razorpay refund has been run from this branch; Razorpay test payments cannot be created by API.
15
+ * The distribution check allows exactly `paypal` beside `stripe`, `razorpay` and `_http` in the adapters.
16
+
17
+ Licence files made before the holder rename still verify.
18
+
19
+ Offline credits, in Python and Node with identical output. Brings in the verdock-core 0.3.1 credits modules.
20
+
21
+ * `verdock licence`: checks a signed `licence.json` with Ed25519, offline. `verdock licence issue --dev` makes a licence signed by a local dev key, marked dev in the file and in the output. Plan names and monthly credits are inputs.
22
+ * `verdock usage`: used, remaining, reset date, by agent, by kind and the free safety checks row, recomputed from the receipt chain. `usage export --period 2026-Q4` writes a signed counts only statement with the chain head hash and the licence id. `usage verify FILE` fails on one changed byte.
23
+ * `guard` holds new actions with "Credit limit reached. Approve, add credits, or raise the cap." at zero credits and after 30 days of grace past the licence end. Actions already running finish and are checked. Verifying, receipts and exports never lock.
24
+ * Usage commands end with `Network: 0 attempts`, counted by a socket guard.
25
+ * Tests: the counter against a receipt recount, a changed byte, an expired licence, zero network attempts, and Python and Node producing the same text and the same statement bytes.
26
+ * Offline bundle: `tools/build_offline_bundle.py` builds `verdock-offline-<version>.tar.gz` (wheel, `verdock.pyz`, `SHA256SUMS` with an Ed25519 signature, `RELEASE_KEY.pub`, `verify_offline.py`, CycloneDX `sbom.cdx.json`, `INSTALL.txt`, `LICENSE`) reproducibly. `tools/offline_demo.py` runs the offline sequence and ends with `Network attempts: 0`.
27
+ * `verdock.bankfile`: a local system of record that reads a bank statement CSV or an ISO 20022 camt.053 file, for use as the `guard` reader.
28
+ * `verdock diag --redact`: hashes and counts only, the same text from Python and Node.
29
+ * `verdock.demo` reads `run_v1.json` through `pkgutil`, so `verdock.pyz` runs.
30
+
31
+ ## 0.3.0
32
+
33
+ * `verdock demo --scene credits` and `run_v1.json`: the demo scenes follow the same scenario file as the site Run, a credits scene shows the spend cap, and the run prints a `Credits:` line. Full run counters: verified 105, mismatch 2, unknown reconciled 1, held 7, blocked 1, approved 4. Two more scenes: `approval` (an approval signs the action hash; a changed amount voids it) and `stop` (a stopped agent's actions are held).
34
+
35
+ Brings in verdock-core 0.3.0 and makes the full path runnable from the command line, in Python and Node.
36
+
37
+ Added in the Python package (standard library only, Python 3.10 or newer):
38
+
39
+ * Maker and checker approvals: approvers sign with their own Ed25519 keys, a policy can ask for more approvers above an amount (`approvers_required`, `approval_bands`), the requester cannot approve and nobody approves twice.
40
+ * Salted commitments for identifiers and account numbers, and selective disclosure of one field (`disclosure`).
41
+ * Agent manifests with delegation that only narrows, and a delegation chain recorded in the receipt (`manifest`).
42
+ * Authorized exchange between people, teams and organisations: send policy, held send, approval by signature or by a 6 digit code bound to the exchange, receiver acceptance, and an exchange receipt that both sides verify offline (`exchange`). Approver seeds are encrypted at rest with a construction built from HMAC SHA256; it has not been audited.
43
+ * `exceptions()`: held items, MISMATCH and UNKNOWN older than a set number of minutes.
44
+ * `verify_log(lines, anchor, manifest_root)` checks approver signatures and delegation chains inside receipts.
45
+ * `OutcomeLog.latest_states()`.
46
+ * Commands: `verdock demo --scene all|payout|credit|data|unknown|exchange|fleet`, `verdock demo --offline`, `verdock keys create NAME`, `verdock exchange request|enroll|code|approve|accept|status|trust|verify`, `verdock exceptions`, `verdock disclose`, and `verdock verify --manifest-root`. `verdock demo` with no flags still prints the double refund text.
47
+ * The distribution check allows exactly the new modules `disclosure`, `exceptions`, `exchange`, `exchange_cli`, `maker_checker` and `manifest`, and still forbids provider, workspace, key management and credential code outside the adapters.
48
+
49
+ Added in the Node package:
50
+
51
+ * Verification of the new receipt kinds with the same failure reasons as Python: approver signatures and quorum, manifest delegation chains, committed fields and exchange receipts. `verifyLog(lines, anchor, manifestRoot)`.
52
+ * Producers that the demo uses: `issueManifest`, `ManifestRegistry`, `signVote`, `draftExchange`, `signRole`, `boundCode`, `SendPolicy`, `protect`, `disclose`, `exceptions`.
53
+ * Policy keys `approvers_required` and `approval_bands`, and `approversRequired` on a decision.
54
+ * Commands: `demo --scene ...`, `demo --offline`, `keys create`, `exchange verify`, `disclose`, and `verify --manifest-root`. The demo text is the same as the Python text, and receipts written by one language verify in the other.
55
+
56
+ Shared vectors: `vectors/v3.json` (from verdock-core 0.3.0) is checked by Python and by Node, and by the browser verifier in `js/verify.js`, which is updated to 0.3.0.
57
+
58
+ Changed: the adapters report the version 0.3.0 in their user agent. Wording in the documents is tightened; no behavior changed.
59
+
60
+ ## 0.2.0
61
+
62
+ Adds test mode provider adapters for Stripe and Razorpay (refund and payout) under `verdock.adapters`, built on the existing policy, invariants, outcome and receipt code. Standard library only. Each call is decided by the policy before any network request, sent with a stable idempotency key, read back from the provider and signed in a receipt. A lost response is UNKNOWN and is never retried automatically: use `reconcile` or `retry_same_key`. Live keys are refused unless explicitly allowed. The distribution check now allows exactly `verdock/adapters/__init__.py`, `_http.py`, `stripe.py` and `razorpay.py` and scans the wheel for key shaped strings.
63
+
64
+ The Node package has the same adapters at version 0.2.0: `StripeAdapter`, `RazorpayAdapter` and `loadEnv`, importable from `verdock` and `verdock/adapters`, using only global `fetch` and Node built ins.
65
+
66
+ ## 0.1.0
67
+
68
+ Based on verdock-core 0.2.0, copied under its MIT license. Adds the verdock import and command, an offline quickstart, a local guard, daily team cap policy configuration, and distribution boundary checks. The original repository remains independent.
verdock-0.3.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sriharsan B S
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ include LICENSE README.md CHANGELOG.md
2
+ recursive-include verdock *.py *.json
3
+ recursive-include tests *.py *.csv *.xml
4
+ recursive-include js *.js *.mjs
5
+ recursive-include docs *.md
6
+ recursive-include tools *.py
7
+ recursive-include .github *.yml *.md
8
+ recursive-include vectors *.json
verdock-0.3.1/PKG-INFO ADDED
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.4
2
+ Name: verdock
3
+ Version: 0.3.1
4
+ Summary: Offline policy checks, money limits, outcome checks and signed receipts for AI agents
5
+ Author-email: Sriharsan B S <bssriharsan@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://getverdock.com
8
+ Project-URL: Documentation, https://getverdock.com/docs
9
+ Project-URL: Source, https://github.com/Sriharsan/verdock
10
+ Project-URL: Issues, https://github.com/Sriharsan/verdock/issues
11
+ Project-URL: Feedback, https://getverdock.com/feedback/?source=pip
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Dynamic: license-file
16
+
17
+ The core runs fully offline. Adapters call the provider only when you use them. Verdock sits between AI agents and a bank's systems: it checks each action against limits, confirms the result against the record, and signs a receipt that anyone can verify offline.
18
+
19
+ # Verdock
20
+
21
+ ## What it does for a bank
22
+
23
+ An agent that moves money, changes a record or sends a file is taking an action the bank answers for. Verdock puts one checkpoint in front of all three.
24
+
25
+ * **Money moves once.** A refund or payout carries a stable request id. A lost response becomes UNKNOWN, only that action is held, and the retry is refused until the record is read. Other actions keep moving.
26
+ * **The record decides, not the agent.** After every action Verdock reads the provider's record and compares it with what the policy expected: VERIFIED, MISMATCH, UNKNOWN or PENDING. A MISMATCH is raised to a person.
27
+ * **Record changes need people.** A credit limit change above a set amount needs two approvers. Each signs with their own Ed25519 key. The requester cannot approve, and the same person cannot approve twice.
28
+ * **Agents get a manifest.** Each agent identity lists the action kinds, limits and destinations the agent can use. Default is deny. A delegated manifest can only narrow its parent, and the receipt records the delegation chain.
29
+ * **Data leaves only by policy.** The egress gateway blocks a send to a host that is not on the allowlist, and the receipt shows the blocked destination with masked values.
30
+ * **Exchange between people, teams and organisations.** A send outside the send policy is held and never leaves. A named approver approves with a signature or with a 6 digit code from an authenticator. The receiver signs an acceptance before the payload is released. Both sides keep the same receipt and verify it offline with the same function.
31
+ * **Owners see exceptions only.** `exceptions` returns held items, MISMATCH and UNKNOWN older than a set number of minutes. In the fleet scene, 100 agents run and the owner sees exactly 3.
32
+ * **Receipts anyone can check.** Every step is a signed, hash chained line. An auditor, a partner bank or a regulator can verify a receipt on a machine with no network and no account. One changed byte fails.
33
+
34
+ Teams use it because the answer to "what did the agent do, and who allowed it" is a file they can verify, not a log they have to trust.
35
+
36
+ ## Install and run in five minutes
37
+
38
+ Python 3.10 or newer. Zero runtime dependencies.
39
+
40
+ ```sh
41
+ pip install verdock
42
+ verdock demo --scene all
43
+ verdock init
44
+ verdock check refund 3500 --currency USD --counterparty c1
45
+ verdock keys
46
+ verdock verify .verdock/receipts.ndjson --public-key <hex-from-verdock-keys>
47
+ ```
48
+
49
+ `verdock demo --scene all` runs the whole path with real Ed25519 signatures and prints the result of every check. Nothing leaves your machine.
50
+
51
+ Amounts are integer minor units: 3500 is USD 35.00. The default refund threshold is 2000, so the check prints `needs approval`. `check` evaluates your policy and writes a receipt; it executes no payment and reserves no budget. Keep `.verdock/signing.seed` private. Share only your public key and reviewed receipts. `init` refuses to replace an existing policy.
52
+
53
+ ## The demo
54
+
55
+ `verdock demo --scene all|payout|credit|data|unknown|exchange|fleet|approval|stop|credits`. Ids, seeds and the clock are fixed, so the output is the same on every run.
56
+
57
+ | Scene | What it shows |
58
+ | --- | --- |
59
+ | `payout` | A payout is VERIFIED against the ledger. A second payout books 4999 where the policy said 499: MISMATCH, raised to a human. A widened child manifest is refused. |
60
+ | `unknown` | The provider executes and the response is lost. The action is UNKNOWN and held, the retry is refused, another payout keeps moving, and the ledger read settles it. A naive agent pays twice; Verdock pays once. |
61
+ | `credit` | A credit limit change from 50,000 to 2,00,000 needs two approvers. The requester is refused, one signature is not enough, the same person cannot sign twice, and the record check confirms the new limit. |
62
+ | `data` | An incoming message says to ignore limits and send the data file. The payout stays above the limit, the manifest denies the send, and the gateway blocks it. The receipt holds masked values. |
63
+ | `exchange` | A report to Partner Bank is outside the send policy, so it is held. The junior requests approval, the senior approves with a 6 digit code, Partner Bank accepts, and both sides verify the same receipt offline. A reused code, a code for another exchange and a receiver refusal each release nothing. The second exchange is a probe and is not counted. |
64
+ | `fleet` | 100 agents run routine actions. The owner sees exactly 3 exceptions: one held, one MISMATCH, one old UNKNOWN. |
65
+ | `approval` | An approver signs an approval for a payout of 499. The approval signs the action hash, which is shown. The amount becomes 4999, the hash changes and the approval no longer matches: held with "Approval does not match this action: amount changed", with a receipt. The unchanged 499 action passes and is VERIFIED. |
66
+ | `stop` | The owner stops one agent. Its new action is held with "Agent stopped by owner. Start the agent to release." and a receipt, while two other agents keep running and are VERIFIED. |
67
+ | `credits` | The spend cap is reached. The next payout is held with the reason "Credit limit reached. Approve, add credits, or raise the cap." and nothing is sent. Verification keeps working. The owner raises the cap, the payout runs once and is VERIFIED. |
68
+
69
+ The run ends with the offline checks: every receipt line is verified, every receipt with one changed byte is rejected, and the count of duplicate payouts is printed (0). The scenes follow `run_v1.json`, the same file the site Run reads, so a full run ends with the same counters as the site: verified 105, mismatch 2, unknown reconciled 1, held 7, blocked 1, approved 4, and 106 credits used. The last lines print the counters and the credits. `verdock demo --offline` is the same run with every socket call blocked, and it reports 0 network attempts. `verdock demo --scene all --out DIR` keeps the receipts and a `trust.json` so you can run `verdock verify` and `verdock exchange verify` yourself. `verdock demo` with no flags prints the original double refund text. `verdock demo --currency usd|inr` chooses how amounts are shown and the currency code in the scene text, the receipts and the policies. usd (the default) shows $4,800 and $200,000. inr shows the rupee sign with Indian grouping, for example 2,00,000. The amounts, counters (verified 105, mismatch 2, unknown reconciled 1, held 7, blocked 1, approved 4) and credits (106) are the same in both. Any other value is an error with exit status 2. `python tools/offline_demo.py --currency usd|inr` does the same for the offline demo.
70
+
71
+ ## Exchange between parties
72
+
73
+ ```sh
74
+ verdock keys create junior
75
+ verdock keys create senior
76
+ verdock keys create partner-bank
77
+ echo "monthly report" > report.txt
78
+ verdock exchange enroll --approver senior # for 6 digit codes
79
+ verdock exchange request --sender junior --recipient partner-bank --data-class report --payload report.txt --approver senior
80
+ verdock exchange code <id> --approver senior # what the approver's authenticator shows
81
+ verdock exchange approve <id> --approver senior --code <6 digits> # or leave out --code to sign with senior's key
82
+ verdock exchange accept <id> --receiver partner-bank # releases the payload and writes the receipt
83
+ verdock exchange trust --out trust.json # public keys only
84
+ verdock exchange verify .verdock/exchange/receipts/<id>.json --trust trust.json
85
+ ```
86
+
87
+ Write rules into `.verdock/exchange/send_policy.json` (a list of `sender`, `data_class`, `recipient`, `limit`) to let an exchange through without approval. With no rule, every exchange is held. `verdock exceptions --exchange` lists what is held. `verdock exceptions --outcomes FILE --held FILE` lists MISMATCH, old UNKNOWN and held actions from your own stores. `verdock disclose` opens one committed field of a receipt. `verdock keys create NAME` makes a private key with mode 0600. See [docs/CLI.md](docs/CLI.md).
88
+
89
+ ## Python
90
+
91
+ ```python
92
+ from verdock.policy import load_policy, decide
93
+ decision = decide(load_policy("verdock.yaml"), "refund", 1500, currency="USD")
94
+ ```
95
+
96
+ The core APIs are importable under `verdock`: policy, approvals, maker_checker, manifest, exchange, disclosure, exceptions, invariants, outcome, receipts, egress and queue. Use `Invariants.reserve` for shared caps, stable request ids for provider calls, and `OutcomeLog` for separate record checks. UNKNOWN means read and reconcile, never repeat the action.
97
+
98
+ ```python
99
+ import verdock
100
+
101
+ @verdock.guard("refund", reconcile=read_refund_record)
102
+ def refund(amount_minor, currency, counterparty, request_key, request_id=None):
103
+ return send_refund(amount_minor, currency, counterparty, request_id)
104
+ ```
105
+
106
+ `read_refund_record(request_id)` must independently return the provider record with `amount_minor` and `currency`, or None. Supply a unique business `request_key`. The guard refuses reused keys, approval required actions, missing readers, and calls exceeding daily team or counterparty caps. It reserves before calling and retains uncertain reservations. An exception leaves UNKNOWN. Reconcile through the outcome store and reservation APIs; the guard never retries by itself. Async functions are not supported. Bare `@verdock.guard("refund")` refuses execution until a reader is configured. The two caller functions above are your application code; any network activity they perform is outside the offline package commands.
107
+
108
+ ## Offline usage
109
+
110
+ Safety checks are free. You pay only when an action is verified. Offline, `verdock usage` shows the meter from your own receipt chain, and `verdock licence` checks a signed licence file without calling out:
111
+
112
+ ```
113
+ verdock licence issue --dev --holder "Acme" --environment env-1 --plan Team --credits 1000
114
+ verdock usage
115
+ verdock usage export --period 2026-Q4
116
+ verdock usage verify usage-statement-2026-Q4.json
117
+ ```
118
+
119
+ See `docs/CLI.md` for the rule and the commands.
120
+
121
+ ## Offline bundle and release key
122
+
123
+ `dist/verdock-offline-<version>.tar.gz` holds the wheel, `verdock.pyz`, a signed `SHA256SUMS`, the release public key, `verify_offline.py` (Python standard library only), a CycloneDX SBOM, `INSTALL.txt` and the licence. Check it and install with no network:
124
+
125
+ ```sh
126
+ python verify_offline.py --fingerprint <value below>
127
+ sha256sum -c SHA256SUMS
128
+ pip install --no-index --find-links ./wheels verdock
129
+ ```
130
+
131
+ Release key fingerprint (SHA-256 of the 32 raw public key bytes): `f3d41aac56f470a3af260b5aa66a4c30445561d6204f2a7f52309a9e8790b392`. A bundle whose `RELEASE_KEY.pub` says DEV is for tests and not for production. `python tools/offline_demo.py` runs the whole offline sequence and ends with `Network attempts: 0`. See `docs/OFFLINE_BUNDLE.md` and `docs/banks.md`.
132
+
133
+ `verdock diag --redact` prints hashes and counts only: the policy hash, the key hash, the receipt count, the chain head hash and counts by hashed action kind. It prints no payload, id, amount or key, in both the Python and the Node command line.
134
+
135
+ A local bank file works as the system of record: `verdock.bankfile.BankFile` reads a statement CSV or an ISO 20022 camt.053 file, and a refund is VERIFIED when a matching entry exists.
136
+
137
+ ## Provider adapters, test mode
138
+
139
+ Stripe and Razorpay adapters handle refunds and payouts, and a PayPal sandbox adapter handles refunds, using only the standard library. The PayPal adapter is tested against a local stand in provider only.
140
+
141
+ ```python
142
+ from verdock.adapters import load_env
143
+ from verdock.adapters.stripe import StripeAdapter
144
+
145
+ load_env(".env") # reads STRIPE_API_KEY from your own file
146
+ result = StripeAdapter().refund(amount_minor=1500, currency="USD", counterparty="cus_123",
147
+ request_key="order-77-refund", payment="pi_123")
148
+ ```
149
+
150
+ Each call is decided by your policy before any network request, checked against team and counterparty caps, sent with a stable idempotency key, read back from the provider and signed in a receipt. The result is VERIFIED, MISMATCH, PENDING or UNKNOWN. A lost response is UNKNOWN and is never retried automatically: `reconcile(request_key)` finds the provider record and settles it, and `retry_same_key(request_key)` resends with the same key so the provider keeps one object. A reused `request_key` never sends a second request.
151
+
152
+ Keys come from your environment or the constructor and are never written to receipts or messages. Live keys are refused unless you pass `allow_live=True` or set `VERDOCK_ALLOW_LIVE=1`. The tests use a local stand in provider; `tools/smoke_stripe.py` and `tools/smoke_razorpay.py` try your own test account. See [docs/ADAPTERS.md](docs/ADAPTERS.md).
153
+
154
+ ## Limits, stated exactly
155
+
156
+ * Exactly once behavior requires that every action uses the guard, a stable business key, provider idempotency and an independent record reader. A decorator cannot stop calls that bypass it or make an external provider transactional. A manifest is a signed list; it does not stop a process that bypasses Verdock.
157
+ * Signing seeds are local files; whoever holds a seed can sign a replacement history. Tail removal is undetectable without an external latest hash and count. Timestamps use the writer's clock. Receipts use integers within plus or minus (2^53 minus 1). Ed25519 here is not constant time.
158
+ * `ReceiptLog` needs one writer per file. SQLite stores coordinate one machine, not distributed hosts.
159
+ * A 6 digit code approval is proven to a third party by the attestor's signature, not by the code. Whoever holds both the attestor key and the vault master key can forge a code approval. A signature approval has no such dependency. Approver seeds are encrypted at rest with a construction built from HMAC SHA256 because the standard library has no AES. It has not been audited, and it does not protect a host where the master key or process memory can be read. See [docs/EXCHANGE.md](docs/EXCHANGE.md).
160
+ * Manifest revocation is local to a `ManifestRegistry`. A verifier that only has a receipt cannot learn that a manifest was revoked later.
161
+ * Gateway hostname checks depend on enforced network isolation and do not inspect TLS. The gateway is an opt in network API; none of the quickstart commands starts it.
162
+ * The package contains three test mode provider adapters (Stripe, Razorpay and PayPal) and no hosted workspace, private runtime, managed signing keys, deployment tools or telemetry.
163
+
164
+ See [all inherited limits](docs/LIMITS.md), [docs/MAKER_CHECKER.md](docs/MAKER_CHECKER.md), [docs/MANIFEST.md](docs/MANIFEST.md) and [docs/DISCLOSURE.md](docs/DISCLOSURE.md).
165
+
166
+ Teams that need a hosted workspace, approvals, or a private deployment inside their own network: getverdock.com.
167
+
168
+ ## License
169
+
170
+ MIT. Copyright 2026 Sriharsan B S. Based on verdock-core 0.3.0; upstream notices retained.
@@ -0,0 +1,154 @@
1
+ The core runs fully offline. Adapters call the provider only when you use them. Verdock sits between AI agents and a bank's systems: it checks each action against limits, confirms the result against the record, and signs a receipt that anyone can verify offline.
2
+
3
+ # Verdock
4
+
5
+ ## What it does for a bank
6
+
7
+ An agent that moves money, changes a record or sends a file is taking an action the bank answers for. Verdock puts one checkpoint in front of all three.
8
+
9
+ * **Money moves once.** A refund or payout carries a stable request id. A lost response becomes UNKNOWN, only that action is held, and the retry is refused until the record is read. Other actions keep moving.
10
+ * **The record decides, not the agent.** After every action Verdock reads the provider's record and compares it with what the policy expected: VERIFIED, MISMATCH, UNKNOWN or PENDING. A MISMATCH is raised to a person.
11
+ * **Record changes need people.** A credit limit change above a set amount needs two approvers. Each signs with their own Ed25519 key. The requester cannot approve, and the same person cannot approve twice.
12
+ * **Agents get a manifest.** Each agent identity lists the action kinds, limits and destinations the agent can use. Default is deny. A delegated manifest can only narrow its parent, and the receipt records the delegation chain.
13
+ * **Data leaves only by policy.** The egress gateway blocks a send to a host that is not on the allowlist, and the receipt shows the blocked destination with masked values.
14
+ * **Exchange between people, teams and organisations.** A send outside the send policy is held and never leaves. A named approver approves with a signature or with a 6 digit code from an authenticator. The receiver signs an acceptance before the payload is released. Both sides keep the same receipt and verify it offline with the same function.
15
+ * **Owners see exceptions only.** `exceptions` returns held items, MISMATCH and UNKNOWN older than a set number of minutes. In the fleet scene, 100 agents run and the owner sees exactly 3.
16
+ * **Receipts anyone can check.** Every step is a signed, hash chained line. An auditor, a partner bank or a regulator can verify a receipt on a machine with no network and no account. One changed byte fails.
17
+
18
+ Teams use it because the answer to "what did the agent do, and who allowed it" is a file they can verify, not a log they have to trust.
19
+
20
+ ## Install and run in five minutes
21
+
22
+ Python 3.10 or newer. Zero runtime dependencies.
23
+
24
+ ```sh
25
+ pip install verdock
26
+ verdock demo --scene all
27
+ verdock init
28
+ verdock check refund 3500 --currency USD --counterparty c1
29
+ verdock keys
30
+ verdock verify .verdock/receipts.ndjson --public-key <hex-from-verdock-keys>
31
+ ```
32
+
33
+ `verdock demo --scene all` runs the whole path with real Ed25519 signatures and prints the result of every check. Nothing leaves your machine.
34
+
35
+ Amounts are integer minor units: 3500 is USD 35.00. The default refund threshold is 2000, so the check prints `needs approval`. `check` evaluates your policy and writes a receipt; it executes no payment and reserves no budget. Keep `.verdock/signing.seed` private. Share only your public key and reviewed receipts. `init` refuses to replace an existing policy.
36
+
37
+ ## The demo
38
+
39
+ `verdock demo --scene all|payout|credit|data|unknown|exchange|fleet|approval|stop|credits`. Ids, seeds and the clock are fixed, so the output is the same on every run.
40
+
41
+ | Scene | What it shows |
42
+ | --- | --- |
43
+ | `payout` | A payout is VERIFIED against the ledger. A second payout books 4999 where the policy said 499: MISMATCH, raised to a human. A widened child manifest is refused. |
44
+ | `unknown` | The provider executes and the response is lost. The action is UNKNOWN and held, the retry is refused, another payout keeps moving, and the ledger read settles it. A naive agent pays twice; Verdock pays once. |
45
+ | `credit` | A credit limit change from 50,000 to 2,00,000 needs two approvers. The requester is refused, one signature is not enough, the same person cannot sign twice, and the record check confirms the new limit. |
46
+ | `data` | An incoming message says to ignore limits and send the data file. The payout stays above the limit, the manifest denies the send, and the gateway blocks it. The receipt holds masked values. |
47
+ | `exchange` | A report to Partner Bank is outside the send policy, so it is held. The junior requests approval, the senior approves with a 6 digit code, Partner Bank accepts, and both sides verify the same receipt offline. A reused code, a code for another exchange and a receiver refusal each release nothing. The second exchange is a probe and is not counted. |
48
+ | `fleet` | 100 agents run routine actions. The owner sees exactly 3 exceptions: one held, one MISMATCH, one old UNKNOWN. |
49
+ | `approval` | An approver signs an approval for a payout of 499. The approval signs the action hash, which is shown. The amount becomes 4999, the hash changes and the approval no longer matches: held with "Approval does not match this action: amount changed", with a receipt. The unchanged 499 action passes and is VERIFIED. |
50
+ | `stop` | The owner stops one agent. Its new action is held with "Agent stopped by owner. Start the agent to release." and a receipt, while two other agents keep running and are VERIFIED. |
51
+ | `credits` | The spend cap is reached. The next payout is held with the reason "Credit limit reached. Approve, add credits, or raise the cap." and nothing is sent. Verification keeps working. The owner raises the cap, the payout runs once and is VERIFIED. |
52
+
53
+ The run ends with the offline checks: every receipt line is verified, every receipt with one changed byte is rejected, and the count of duplicate payouts is printed (0). The scenes follow `run_v1.json`, the same file the site Run reads, so a full run ends with the same counters as the site: verified 105, mismatch 2, unknown reconciled 1, held 7, blocked 1, approved 4, and 106 credits used. The last lines print the counters and the credits. `verdock demo --offline` is the same run with every socket call blocked, and it reports 0 network attempts. `verdock demo --scene all --out DIR` keeps the receipts and a `trust.json` so you can run `verdock verify` and `verdock exchange verify` yourself. `verdock demo` with no flags prints the original double refund text. `verdock demo --currency usd|inr` chooses how amounts are shown and the currency code in the scene text, the receipts and the policies. usd (the default) shows $4,800 and $200,000. inr shows the rupee sign with Indian grouping, for example 2,00,000. The amounts, counters (verified 105, mismatch 2, unknown reconciled 1, held 7, blocked 1, approved 4) and credits (106) are the same in both. Any other value is an error with exit status 2. `python tools/offline_demo.py --currency usd|inr` does the same for the offline demo.
54
+
55
+ ## Exchange between parties
56
+
57
+ ```sh
58
+ verdock keys create junior
59
+ verdock keys create senior
60
+ verdock keys create partner-bank
61
+ echo "monthly report" > report.txt
62
+ verdock exchange enroll --approver senior # for 6 digit codes
63
+ verdock exchange request --sender junior --recipient partner-bank --data-class report --payload report.txt --approver senior
64
+ verdock exchange code <id> --approver senior # what the approver's authenticator shows
65
+ verdock exchange approve <id> --approver senior --code <6 digits> # or leave out --code to sign with senior's key
66
+ verdock exchange accept <id> --receiver partner-bank # releases the payload and writes the receipt
67
+ verdock exchange trust --out trust.json # public keys only
68
+ verdock exchange verify .verdock/exchange/receipts/<id>.json --trust trust.json
69
+ ```
70
+
71
+ Write rules into `.verdock/exchange/send_policy.json` (a list of `sender`, `data_class`, `recipient`, `limit`) to let an exchange through without approval. With no rule, every exchange is held. `verdock exceptions --exchange` lists what is held. `verdock exceptions --outcomes FILE --held FILE` lists MISMATCH, old UNKNOWN and held actions from your own stores. `verdock disclose` opens one committed field of a receipt. `verdock keys create NAME` makes a private key with mode 0600. See [docs/CLI.md](docs/CLI.md).
72
+
73
+ ## Python
74
+
75
+ ```python
76
+ from verdock.policy import load_policy, decide
77
+ decision = decide(load_policy("verdock.yaml"), "refund", 1500, currency="USD")
78
+ ```
79
+
80
+ The core APIs are importable under `verdock`: policy, approvals, maker_checker, manifest, exchange, disclosure, exceptions, invariants, outcome, receipts, egress and queue. Use `Invariants.reserve` for shared caps, stable request ids for provider calls, and `OutcomeLog` for separate record checks. UNKNOWN means read and reconcile, never repeat the action.
81
+
82
+ ```python
83
+ import verdock
84
+
85
+ @verdock.guard("refund", reconcile=read_refund_record)
86
+ def refund(amount_minor, currency, counterparty, request_key, request_id=None):
87
+ return send_refund(amount_minor, currency, counterparty, request_id)
88
+ ```
89
+
90
+ `read_refund_record(request_id)` must independently return the provider record with `amount_minor` and `currency`, or None. Supply a unique business `request_key`. The guard refuses reused keys, approval required actions, missing readers, and calls exceeding daily team or counterparty caps. It reserves before calling and retains uncertain reservations. An exception leaves UNKNOWN. Reconcile through the outcome store and reservation APIs; the guard never retries by itself. Async functions are not supported. Bare `@verdock.guard("refund")` refuses execution until a reader is configured. The two caller functions above are your application code; any network activity they perform is outside the offline package commands.
91
+
92
+ ## Offline usage
93
+
94
+ Safety checks are free. You pay only when an action is verified. Offline, `verdock usage` shows the meter from your own receipt chain, and `verdock licence` checks a signed licence file without calling out:
95
+
96
+ ```
97
+ verdock licence issue --dev --holder "Acme" --environment env-1 --plan Team --credits 1000
98
+ verdock usage
99
+ verdock usage export --period 2026-Q4
100
+ verdock usage verify usage-statement-2026-Q4.json
101
+ ```
102
+
103
+ See `docs/CLI.md` for the rule and the commands.
104
+
105
+ ## Offline bundle and release key
106
+
107
+ `dist/verdock-offline-<version>.tar.gz` holds the wheel, `verdock.pyz`, a signed `SHA256SUMS`, the release public key, `verify_offline.py` (Python standard library only), a CycloneDX SBOM, `INSTALL.txt` and the licence. Check it and install with no network:
108
+
109
+ ```sh
110
+ python verify_offline.py --fingerprint <value below>
111
+ sha256sum -c SHA256SUMS
112
+ pip install --no-index --find-links ./wheels verdock
113
+ ```
114
+
115
+ Release key fingerprint (SHA-256 of the 32 raw public key bytes): `f3d41aac56f470a3af260b5aa66a4c30445561d6204f2a7f52309a9e8790b392`. A bundle whose `RELEASE_KEY.pub` says DEV is for tests and not for production. `python tools/offline_demo.py` runs the whole offline sequence and ends with `Network attempts: 0`. See `docs/OFFLINE_BUNDLE.md` and `docs/banks.md`.
116
+
117
+ `verdock diag --redact` prints hashes and counts only: the policy hash, the key hash, the receipt count, the chain head hash and counts by hashed action kind. It prints no payload, id, amount or key, in both the Python and the Node command line.
118
+
119
+ A local bank file works as the system of record: `verdock.bankfile.BankFile` reads a statement CSV or an ISO 20022 camt.053 file, and a refund is VERIFIED when a matching entry exists.
120
+
121
+ ## Provider adapters, test mode
122
+
123
+ Stripe and Razorpay adapters handle refunds and payouts, and a PayPal sandbox adapter handles refunds, using only the standard library. The PayPal adapter is tested against a local stand in provider only.
124
+
125
+ ```python
126
+ from verdock.adapters import load_env
127
+ from verdock.adapters.stripe import StripeAdapter
128
+
129
+ load_env(".env") # reads STRIPE_API_KEY from your own file
130
+ result = StripeAdapter().refund(amount_minor=1500, currency="USD", counterparty="cus_123",
131
+ request_key="order-77-refund", payment="pi_123")
132
+ ```
133
+
134
+ Each call is decided by your policy before any network request, checked against team and counterparty caps, sent with a stable idempotency key, read back from the provider and signed in a receipt. The result is VERIFIED, MISMATCH, PENDING or UNKNOWN. A lost response is UNKNOWN and is never retried automatically: `reconcile(request_key)` finds the provider record and settles it, and `retry_same_key(request_key)` resends with the same key so the provider keeps one object. A reused `request_key` never sends a second request.
135
+
136
+ Keys come from your environment or the constructor and are never written to receipts or messages. Live keys are refused unless you pass `allow_live=True` or set `VERDOCK_ALLOW_LIVE=1`. The tests use a local stand in provider; `tools/smoke_stripe.py` and `tools/smoke_razorpay.py` try your own test account. See [docs/ADAPTERS.md](docs/ADAPTERS.md).
137
+
138
+ ## Limits, stated exactly
139
+
140
+ * Exactly once behavior requires that every action uses the guard, a stable business key, provider idempotency and an independent record reader. A decorator cannot stop calls that bypass it or make an external provider transactional. A manifest is a signed list; it does not stop a process that bypasses Verdock.
141
+ * Signing seeds are local files; whoever holds a seed can sign a replacement history. Tail removal is undetectable without an external latest hash and count. Timestamps use the writer's clock. Receipts use integers within plus or minus (2^53 minus 1). Ed25519 here is not constant time.
142
+ * `ReceiptLog` needs one writer per file. SQLite stores coordinate one machine, not distributed hosts.
143
+ * A 6 digit code approval is proven to a third party by the attestor's signature, not by the code. Whoever holds both the attestor key and the vault master key can forge a code approval. A signature approval has no such dependency. Approver seeds are encrypted at rest with a construction built from HMAC SHA256 because the standard library has no AES. It has not been audited, and it does not protect a host where the master key or process memory can be read. See [docs/EXCHANGE.md](docs/EXCHANGE.md).
144
+ * Manifest revocation is local to a `ManifestRegistry`. A verifier that only has a receipt cannot learn that a manifest was revoked later.
145
+ * Gateway hostname checks depend on enforced network isolation and do not inspect TLS. The gateway is an opt in network API; none of the quickstart commands starts it.
146
+ * The package contains three test mode provider adapters (Stripe, Razorpay and PayPal) and no hosted workspace, private runtime, managed signing keys, deployment tools or telemetry.
147
+
148
+ See [all inherited limits](docs/LIMITS.md), [docs/MAKER_CHECKER.md](docs/MAKER_CHECKER.md), [docs/MANIFEST.md](docs/MANIFEST.md) and [docs/DISCLOSURE.md](docs/DISCLOSURE.md).
149
+
150
+ Teams that need a hosted workspace, approvals, or a private deployment inside their own network: getverdock.com.
151
+
152
+ ## License
153
+
154
+ MIT. Copyright 2026 Sriharsan B S. Based on verdock-core 0.3.0; upstream notices retained.