dmint 2.0.1__tar.gz → 2.0.2__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 (110) hide show
  1. {dmint-2.0.1/src/dmint.egg-info → dmint-2.0.2}/PKG-INFO +18 -11
  2. {dmint-2.0.1 → dmint-2.0.2}/README.md +17 -10
  3. {dmint-2.0.1 → dmint-2.0.2}/pyproject.toml +1 -1
  4. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/routes.py +48 -31
  5. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/version.py +5 -5
  6. {dmint-2.0.1 → dmint-2.0.2/src/dmint.egg-info}/PKG-INFO +18 -11
  7. {dmint-2.0.1 → dmint-2.0.2}/LICENSE +0 -0
  8. {dmint-2.0.1 → dmint-2.0.2}/setup.cfg +0 -0
  9. {dmint-2.0.1 → dmint-2.0.2}/setup.py +0 -0
  10. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/__init__.py +0 -0
  11. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/approvals.py +0 -0
  12. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/authority.py +0 -0
  13. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/canonicalize.py +0 -0
  14. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/__init__.py +0 -0
  15. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/__main__.py +0 -0
  16. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/api.py +0 -0
  17. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/approvals.py +0 -0
  18. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/compile_policy.py +0 -0
  19. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/create_mcp_policy.py +0 -0
  20. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/create_policy.py +0 -0
  21. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/dashboard.py +0 -0
  22. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/errors.py +0 -0
  23. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/install_skill.py +0 -0
  24. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/io_utils.py +0 -0
  25. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/keys.py +0 -0
  26. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/limits.py +0 -0
  27. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/mcp_auth.py +0 -0
  28. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/mcp_connections.py +0 -0
  29. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/mcp_credentials.py +0 -0
  30. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/mcp_oauth.py +0 -0
  31. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/policy_digest.py +0 -0
  32. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/prompts/__init__.py +0 -0
  33. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/prompts/policy_skill.md +0 -0
  34. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/py.typed +0 -0
  35. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/verify_policy.py +0 -0
  36. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/cli/version.py +0 -0
  37. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/__init__.py +0 -0
  38. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/approvals.py +0 -0
  39. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/authority.py +0 -0
  40. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/canonicalize.py +0 -0
  41. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/constraints.py +0 -0
  42. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/enforcement.py +0 -0
  43. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/errors.py +0 -0
  44. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/hashing.py +0 -0
  45. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/keys.py +0 -0
  46. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/models.py +0 -0
  47. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/policy.py +0 -0
  48. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/py.typed +0 -0
  49. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/redaction.py +0 -0
  50. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/request_binding.py +0 -0
  51. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/resources.py +0 -0
  52. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/__init__.py +0 -0
  53. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/base.py +0 -0
  54. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/factory.py +0 -0
  55. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/postgres_schema.sql +0 -0
  56. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/sql.py +0 -0
  57. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/sqlite.py +0 -0
  58. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/storage/thread_safe.py +0 -0
  59. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/verification.py +0 -0
  60. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/versions.py +0 -0
  61. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/core/webhooks.py +0 -0
  62. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/__init__.py +0 -0
  63. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/__main__.py +0 -0
  64. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/app.py +0 -0
  65. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/auth.py +0 -0
  66. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/core_client.py +0 -0
  67. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/py.typed +0 -0
  68. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/static/favicon.svg +0 -0
  69. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/static/logo.svg +0 -0
  70. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/static/style.css +0 -0
  71. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/static/theme.js +0 -0
  72. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/templates/approval.html +0 -0
  73. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/templates/audit.html +0 -0
  74. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/templates/base.html +0 -0
  75. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/templates/error.html +0 -0
  76. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/templates/index.html +0 -0
  77. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/dashboard/templates/login.html +0 -0
  78. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/enforcement.py +0 -0
  79. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/errors.py +0 -0
  80. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/hashing.py +0 -0
  81. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/__init__.py +0 -0
  82. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/__main__.py +0 -0
  83. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/auth.py +0 -0
  84. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/client.py +0 -0
  85. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/config.py +0 -0
  86. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/config_loader.py +0 -0
  87. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/errors.py +0 -0
  88. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/gateway.py +0 -0
  89. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/mapper.py +0 -0
  90. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/proxy.py +0 -0
  91. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/py.typed +0 -0
  92. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/mcp/ssrf.py +0 -0
  93. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/models.py +0 -0
  94. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/policy.py +0 -0
  95. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/py.typed +0 -0
  96. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/request_binding.py +0 -0
  97. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/skills/__init__.py +0 -0
  98. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/skills/manager.py +0 -0
  99. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/skills/py.typed +0 -0
  100. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/skills/skill.py +0 -0
  101. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/skills/skills/dmint-policy-manager/SKILL.md +0 -0
  102. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/skills/version.py +0 -0
  103. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/storage/__init__.py +0 -0
  104. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/storage/sqlite.py +0 -0
  105. {dmint-2.0.1 → dmint-2.0.2}/src/dmint/versions.py +0 -0
  106. {dmint-2.0.1 → dmint-2.0.2}/src/dmint.egg-info/SOURCES.txt +0 -0
  107. {dmint-2.0.1 → dmint-2.0.2}/src/dmint.egg-info/dependency_links.txt +0 -0
  108. {dmint-2.0.1 → dmint-2.0.2}/src/dmint.egg-info/entry_points.txt +0 -0
  109. {dmint-2.0.1 → dmint-2.0.2}/src/dmint.egg-info/requires.txt +0 -0
  110. {dmint-2.0.1 → dmint-2.0.2}/src/dmint.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmint
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Deterministic authorization and security enforcement for AI-agent tool execution
5
5
  Author: Dmint Authors
6
6
  License-Expression: Apache-2.0
@@ -132,7 +132,7 @@ Modern AI agents (Claude Code, Cursor, Antigravity, AutoGPT, custom LangChain/Ll
132
132
 
133
133
  ## Subsystems
134
134
 
135
- `dmint` v2.0.1 is organized as a unified monorepo providing modular packages under a single distribution:
135
+ `dmint` v2.0.2 is organized as a unified monorepo providing modular packages under a single distribution:
136
136
 
137
137
  | Module | Description | Primary Exports / Entrypoint |
138
138
  | :--- | :--- | :--- |
@@ -461,7 +461,7 @@ mypy src/
461
461
  # 4. Run targeted tests for what you changed
462
462
  pytest tests/<subsystem>/ -v # e.g., tests/core/, tests/cli/, tests/mcp/, tests/dashboard/
463
463
 
464
- # 5. Run full test suite (baseline: 1515 passed, 0 skipped, 0 failed)
464
+ # 5. Run full test suite (baseline: 1525 passed, 0 skipped, 0 failed)
465
465
  pytest tests/ -q
466
466
 
467
467
  # 6. Run pre-commit checks across all files
@@ -506,10 +506,10 @@ python3 -m venv /tmp/dmint-test-env
506
506
  source /tmp/dmint-test-env/bin/activate
507
507
 
508
508
  # Install the wheel with all extras
509
- pip install "dist/dmint-2.0.1-py3-none-any.whl[all]"
509
+ pip install "dist/dmint-2.0.2-py3-none-any.whl[all]"
510
510
 
511
511
  # 4. Verify all installed CLI entrypoints
512
- dmint --version # Expected: dmint 2.0.1
512
+ dmint --version # Expected: dmint 2.0.2
513
513
  dmint --help # Policy wizards and verification commands
514
514
  dmint-mcp --help # MCP multi-server gateway
515
515
  dmint-dashboard --help # Approval web review console
@@ -571,14 +571,21 @@ npm start
571
571
 
572
572
  ---
573
573
 
574
- ## Versioning & Severity Protocol
574
+ ## Versioning & Push-Time Release Gate
575
575
 
576
- Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)**:
577
- - **Patch (`2.0.0` &rarr; `2.0.1`)**: Bug fixes, documentation updates, test additions, non-breaking refactors.
578
- - **Minor (`2.0.0` &rarr; `2.1.0`)**: Backwards-compatible features, new CLI flags, new integrations.
579
- - **Major (`2.0.0` &rarr; `3.0.0`)**: Incompatible API changes, breaking policy schema modifications.
576
+ Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)** and uses a push-time release gate:
580
577
 
581
- > **CRITICAL RULE FOR AI AGENTS**: AI agents must **NEVER** change or bump version numbers silently. Always assess change severity, suggest the recommended SemVer bump to the user with clear rationale, and wait for explicit permission before updating `pyproject.toml`, `version.py`, `__init__.py`, or `CHANGELOG.md`.
578
+ | Change severity | SemVer bump | Typical changes |
579
+ |---|---|---|
580
+ | **High / Major** | `2.0.2` &rarr; `3.0.0` | Incompatible API changes, breaking policy schema modifications, removed public methods. |
581
+ | **Medium / Minor** | `2.0.2` &rarr; `2.1.0` | Backwards-compatible features, new CLI flags, new integrations. |
582
+ | **Low / Patch** | `2.0.2` &rarr; `2.0.3` | Bug fixes, security hardening, documentation updates, test additions, non-breaking refactors. |
583
+
584
+ Every push must include the appropriate version decision and bump. A push carrying any Major change is Major; otherwise any Minor change makes it Minor; otherwise it is Patch. When severity is ambiguous, choose the higher severity and ask before a Major bump.
585
+
586
+ The bump and its required updates are made in the same push: `pyproject.toml`, `src/dmint/version.py`, `CHANGELOG.md`, `PLAIN.md`, current-version documentation, and any version-pinned tests. The full verification flow in [`FLOW.md`](FLOW.md) must pass before pushing.
587
+
588
+ After CI succeeds for a push to `main`, the **Publish to PyPI** workflow publishes the new version automatically. Manual dispatch and GitHub release publication remain fallback paths. The workflow rejects a version that already exists on PyPI; bump the version instead of retrying the same one.
582
589
 
583
590
  ---
584
591
 
@@ -76,7 +76,7 @@ Modern AI agents (Claude Code, Cursor, Antigravity, AutoGPT, custom LangChain/Ll
76
76
 
77
77
  ## Subsystems
78
78
 
79
- `dmint` v2.0.1 is organized as a unified monorepo providing modular packages under a single distribution:
79
+ `dmint` v2.0.2 is organized as a unified monorepo providing modular packages under a single distribution:
80
80
 
81
81
  | Module | Description | Primary Exports / Entrypoint |
82
82
  | :--- | :--- | :--- |
@@ -405,7 +405,7 @@ mypy src/
405
405
  # 4. Run targeted tests for what you changed
406
406
  pytest tests/<subsystem>/ -v # e.g., tests/core/, tests/cli/, tests/mcp/, tests/dashboard/
407
407
 
408
- # 5. Run full test suite (baseline: 1515 passed, 0 skipped, 0 failed)
408
+ # 5. Run full test suite (baseline: 1525 passed, 0 skipped, 0 failed)
409
409
  pytest tests/ -q
410
410
 
411
411
  # 6. Run pre-commit checks across all files
@@ -450,10 +450,10 @@ python3 -m venv /tmp/dmint-test-env
450
450
  source /tmp/dmint-test-env/bin/activate
451
451
 
452
452
  # Install the wheel with all extras
453
- pip install "dist/dmint-2.0.1-py3-none-any.whl[all]"
453
+ pip install "dist/dmint-2.0.2-py3-none-any.whl[all]"
454
454
 
455
455
  # 4. Verify all installed CLI entrypoints
456
- dmint --version # Expected: dmint 2.0.1
456
+ dmint --version # Expected: dmint 2.0.2
457
457
  dmint --help # Policy wizards and verification commands
458
458
  dmint-mcp --help # MCP multi-server gateway
459
459
  dmint-dashboard --help # Approval web review console
@@ -515,14 +515,21 @@ npm start
515
515
 
516
516
  ---
517
517
 
518
- ## Versioning & Severity Protocol
518
+ ## Versioning & Push-Time Release Gate
519
519
 
520
- Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)**:
521
- - **Patch (`2.0.0` &rarr; `2.0.1`)**: Bug fixes, documentation updates, test additions, non-breaking refactors.
522
- - **Minor (`2.0.0` &rarr; `2.1.0`)**: Backwards-compatible features, new CLI flags, new integrations.
523
- - **Major (`2.0.0` &rarr; `3.0.0`)**: Incompatible API changes, breaking policy schema modifications.
520
+ Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)** and uses a push-time release gate:
524
521
 
525
- > **CRITICAL RULE FOR AI AGENTS**: AI agents must **NEVER** change or bump version numbers silently. Always assess change severity, suggest the recommended SemVer bump to the user with clear rationale, and wait for explicit permission before updating `pyproject.toml`, `version.py`, `__init__.py`, or `CHANGELOG.md`.
522
+ | Change severity | SemVer bump | Typical changes |
523
+ |---|---|---|
524
+ | **High / Major** | `2.0.2` &rarr; `3.0.0` | Incompatible API changes, breaking policy schema modifications, removed public methods. |
525
+ | **Medium / Minor** | `2.0.2` &rarr; `2.1.0` | Backwards-compatible features, new CLI flags, new integrations. |
526
+ | **Low / Patch** | `2.0.2` &rarr; `2.0.3` | Bug fixes, security hardening, documentation updates, test additions, non-breaking refactors. |
527
+
528
+ Every push must include the appropriate version decision and bump. A push carrying any Major change is Major; otherwise any Minor change makes it Minor; otherwise it is Patch. When severity is ambiguous, choose the higher severity and ask before a Major bump.
529
+
530
+ The bump and its required updates are made in the same push: `pyproject.toml`, `src/dmint/version.py`, `CHANGELOG.md`, `PLAIN.md`, current-version documentation, and any version-pinned tests. The full verification flow in [`FLOW.md`](FLOW.md) must pass before pushing.
531
+
532
+ After CI succeeds for a push to `main`, the **Publish to PyPI** workflow publishes the new version automatically. Manual dispatch and GitHub release publication remain fallback paths. The workflow rejects a version that already exists on PyPI; bump the version instead of retrying the same one.
526
533
 
527
534
  ---
528
535
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dmint"
7
- version = "2.0.1"
7
+ version = "2.0.2"
8
8
  description = "Deterministic authorization and security enforcement for AI-agent tool execution"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -9,6 +9,7 @@ from __future__ import annotations
9
9
  import json
10
10
  import logging
11
11
  import secrets
12
+ import urllib.parse
12
13
  from typing import Any
13
14
 
14
15
  from fastapi import APIRouter, Form, Request
@@ -39,6 +40,22 @@ _MAX_REASON_LENGTH = 500
39
40
  # Limit for dashboard listing pages.
40
41
  _LIST_LIMIT = 100
41
42
  _AUDIT_LIMIT = 200
43
+ _APPROVAL_STORE_UNAVAILABLE_MSG = "Approval store unavailable."
44
+ _APPROVAL_STORE_ERROR_MSG = "Approval Store Error: Could not load dashboard data. Check server logs for details."
45
+
46
+
47
+ def _redirect_to_approval(approval_id: str, *, msg: str, msg_type: str = "success") -> RedirectResponse:
48
+ """Redirect to a local approval detail page with a flash message.
49
+
50
+ The approval ID is untrusted path input. Keep it in a single URL-encoded
51
+ path segment under a constant local prefix so the redirect can never
52
+ acquire a scheme or host from user input.
53
+ """
54
+ params = urllib.parse.urlencode({"msg": msg, "msg_type": msg_type})
55
+ return RedirectResponse(
56
+ "/approvals/" + urllib.parse.quote(approval_id, safe="") + "?" + params,
57
+ status_code=303,
58
+ )
42
59
 
43
60
 
44
61
  def build_router() -> APIRouter:
@@ -70,12 +87,6 @@ def build_router() -> APIRouter:
70
87
  request=request, name=template, context=ctx, status_code=status_code
71
88
  )
72
89
 
73
- def _redirect_with_msg(url: str, *, msg: str, msg_type: str = "success") -> RedirectResponse:
74
- import urllib.parse
75
-
76
- params = urllib.parse.urlencode({"msg": msg, "msg_type": msg_type})
77
- return RedirectResponse(f"{url}?{params}", status_code=303)
78
-
79
90
  def _record_display(record: ApprovalRecord) -> dict[str, Any]:
80
91
  """Convert an ApprovalRecord to a template-friendly dict."""
81
92
  resource = record.request.resource
@@ -286,11 +297,11 @@ def build_router() -> APIRouter:
286
297
  count_pending = len(pending_records)
287
298
  count_approved = client.count_by_state(ApprovalState.APPROVED)
288
299
  count_rejected = client.count_by_state(ApprovalState.REJECTED)
289
- except ApprovalStoreError as exc:
290
- log.error("store error on api_dashboard: %s", exc)
300
+ except ApprovalStoreError:
301
+ log.exception("store error on api_dashboard")
291
302
  pending_records = []
292
303
  count_pending = count_approved = count_rejected = 0
293
- error_msg = str(exc)
304
+ error_msg = _APPROVAL_STORE_UNAVAILABLE_MSG
294
305
 
295
306
  pending = []
296
307
  for rec in pending_records:
@@ -333,7 +344,7 @@ def build_router() -> APIRouter:
333
344
  count_approved = client.count_by_state(ApprovalState.APPROVED)
334
345
  count_rejected = client.count_by_state(ApprovalState.REJECTED)
335
346
  except ApprovalStoreError as exc:
336
- log.error("store error on index: %s", exc)
347
+ log.exception("store error on index")
337
348
  pending_records = []
338
349
  count_pending = count_approved = count_rejected = 0
339
350
  if "deployment epoch mismatch" in str(exc).lower():
@@ -346,7 +357,7 @@ def build_router() -> APIRouter:
346
357
  }
347
358
  else:
348
359
  flash_override = {
349
- "flash_message": f"Approval Store Error: {exc}",
360
+ "flash_message": _APPROVAL_STORE_ERROR_MSG,
350
361
  "flash_type": "danger",
351
362
  }
352
363
 
@@ -485,29 +496,32 @@ def build_router() -> APIRouter:
485
496
 
486
497
  client = _client(request)
487
498
  actor = session.get("identity")
488
- detail_url = f"/approvals/{approval_id}"
489
499
  try:
490
500
  client.approve(approval_id, approved_by=actor)
491
501
  except ApprovalNotFoundError:
492
- return _redirect_with_msg(detail_url, msg="Approval not found.", msg_type="danger")
502
+ return _redirect_to_approval(approval_id, msg="Approval not found.", msg_type="danger")
493
503
  except ApprovalExpiredError:
494
- return _redirect_with_msg(detail_url, msg="Approval has expired and cannot be approved.", msg_type="danger")
504
+ return _redirect_to_approval(
505
+ approval_id, msg="Approval has expired and cannot be approved.", msg_type="danger"
506
+ )
495
507
  except ApprovalConcurrentConsumeError:
496
- return _redirect_with_msg(
497
- detail_url, msg="A concurrent decision was already made on this approval.", msg_type="warning"
508
+ return _redirect_to_approval(
509
+ approval_id, msg="A concurrent decision was already made on this approval.", msg_type="warning"
498
510
  )
499
511
  except IllegalApprovalTransitionError:
500
- return _redirect_with_msg(detail_url, msg="This approval is not in a pending state.", msg_type="warning")
512
+ return _redirect_to_approval(
513
+ approval_id, msg="This approval is not in a pending state.", msg_type="warning"
514
+ )
501
515
  except (CorruptApprovalRecordError, MalformedApprovalError) as exc:
502
516
  log.warning("approval rejected by Core for %s: %s", approval_id, exc)
503
- return _redirect_with_msg(detail_url, msg="Invalid approval request.", msg_type="danger")
517
+ return _redirect_to_approval(approval_id, msg="Invalid approval request.", msg_type="danger")
504
518
  except ApprovalMalformedError as exc:
505
519
  # Assertion issuance rejected the approval (e.g. policy_evaluated_at is ahead of
506
520
  # this host's clock due to cross-host skew). Fail closed with actionable guidance
507
521
  # instead of an unhandled HTTP 500; the record stays PENDING.
508
522
  log.warning("approval assertion rejected by Core for %s: %s", approval_id, exc)
509
- return _redirect_with_msg(
510
- detail_url,
523
+ return _redirect_to_approval(
524
+ approval_id,
511
525
  msg=(
512
526
  "Approval could not be issued: the signed assertion was rejected as malformed "
513
527
  "(often caused by clock skew between hosts). Verify clock synchronization and retry."
@@ -516,8 +530,8 @@ def build_router() -> APIRouter:
516
530
  )
517
531
  except ApprovalStoreError as exc:
518
532
  log.error("store error approving %s: %s", approval_id, exc)
519
- return _redirect_with_msg(detail_url, msg="Internal error. Could not approve.", msg_type="danger")
520
- return _redirect_with_msg(detail_url, msg="Approval granted successfully.", msg_type="success")
533
+ return _redirect_to_approval(approval_id, msg="Internal error. Could not approve.", msg_type="danger")
534
+ return _redirect_to_approval(approval_id, msg="Approval granted successfully.", msg_type="success")
521
535
 
522
536
  # ------------------------------------------------------------------
523
537
  # POST /approvals/{approval_id}/reject
@@ -546,7 +560,6 @@ def build_router() -> APIRouter:
546
560
 
547
561
  client = _client(request)
548
562
  actor = session.get("identity")
549
- detail_url = f"/approvals/{approval_id}"
550
563
 
551
564
  # Sanitise reason at the HTTP layer; Core enforces its own limit.
552
565
  clean_reason: str | None = reason.strip() if reason else None
@@ -556,22 +569,26 @@ def build_router() -> APIRouter:
556
569
  try:
557
570
  client.reject(approval_id, reason=clean_reason, rejected_by=actor)
558
571
  except ApprovalNotFoundError:
559
- return _redirect_with_msg(detail_url, msg="Approval not found.", msg_type="danger")
572
+ return _redirect_to_approval(approval_id, msg="Approval not found.", msg_type="danger")
560
573
  except ApprovalExpiredError:
561
- return _redirect_with_msg(detail_url, msg="Approval has expired and cannot be rejected.", msg_type="danger")
574
+ return _redirect_to_approval(
575
+ approval_id, msg="Approval has expired and cannot be rejected.", msg_type="danger"
576
+ )
562
577
  except ApprovalConcurrentConsumeError:
563
- return _redirect_with_msg(
564
- detail_url, msg="A concurrent decision was already made on this approval.", msg_type="warning"
578
+ return _redirect_to_approval(
579
+ approval_id, msg="A concurrent decision was already made on this approval.", msg_type="warning"
565
580
  )
566
581
  except IllegalApprovalTransitionError:
567
- return _redirect_with_msg(detail_url, msg="This approval is not in a pending state.", msg_type="warning")
582
+ return _redirect_to_approval(
583
+ approval_id, msg="This approval is not in a pending state.", msg_type="warning"
584
+ )
568
585
  except (CorruptApprovalRecordError, MalformedApprovalError) as exc:
569
586
  log.warning("rejection rejected by Core for %s: %s", approval_id, exc)
570
- return _redirect_with_msg(detail_url, msg="Invalid rejection request.", msg_type="danger")
587
+ return _redirect_to_approval(approval_id, msg="Invalid rejection request.", msg_type="danger")
571
588
  except ApprovalStoreError as exc:
572
589
  log.error("store error rejecting %s: %s", approval_id, exc)
573
- return _redirect_with_msg(detail_url, msg="Internal error. Could not reject.", msg_type="danger")
574
- return _redirect_with_msg(detail_url, msg="Approval rejected.", msg_type="success")
590
+ return _redirect_to_approval(approval_id, msg="Internal error. Could not reject.", msg_type="danger")
591
+ return _redirect_to_approval(approval_id, msg="Approval rejected.", msg_type="success")
575
592
 
576
593
  # ------------------------------------------------------------------
577
594
  # GET /audit
@@ -9,7 +9,7 @@ from __future__ import annotations
9
9
  import os
10
10
 
11
11
  # Base package version (single source of truth in code)
12
- DEFAULT_VERSION: str = "2.0.1"
12
+ DEFAULT_VERSION: str = "2.0.2"
13
13
 
14
14
  # Canonical package version (overridable via DMINT_VERSION env var)
15
15
  __version__: str = os.environ.get("DMINT_VERSION", DEFAULT_VERSION)
@@ -26,10 +26,10 @@ def get_user_agent(component: str | None = None) -> str:
26
26
  Can be explicitly overridden via DMINT_USER_AGENT environment variable for base client.
27
27
 
28
28
  Examples:
29
- get_user_agent() -> 'dmint-cli/2.0.1'
30
- get_user_agent('mcp') -> 'dmint-mcp/2.0.1'
31
- get_user_agent('oauth') -> 'dmint-oauth/2.0.1'
32
- get_user_agent('webhook') -> 'dmint-webhook/2.0.1'
29
+ get_user_agent() -> 'dmint-cli/2.0.2'
30
+ get_user_agent('mcp') -> 'dmint-mcp/2.0.2'
31
+ get_user_agent('oauth') -> 'dmint-oauth/2.0.2'
32
+ get_user_agent('webhook') -> 'dmint-webhook/2.0.2'
33
33
  """
34
34
  version = get_version()
35
35
  if component:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmint
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Deterministic authorization and security enforcement for AI-agent tool execution
5
5
  Author: Dmint Authors
6
6
  License-Expression: Apache-2.0
@@ -132,7 +132,7 @@ Modern AI agents (Claude Code, Cursor, Antigravity, AutoGPT, custom LangChain/Ll
132
132
 
133
133
  ## Subsystems
134
134
 
135
- `dmint` v2.0.1 is organized as a unified monorepo providing modular packages under a single distribution:
135
+ `dmint` v2.0.2 is organized as a unified monorepo providing modular packages under a single distribution:
136
136
 
137
137
  | Module | Description | Primary Exports / Entrypoint |
138
138
  | :--- | :--- | :--- |
@@ -461,7 +461,7 @@ mypy src/
461
461
  # 4. Run targeted tests for what you changed
462
462
  pytest tests/<subsystem>/ -v # e.g., tests/core/, tests/cli/, tests/mcp/, tests/dashboard/
463
463
 
464
- # 5. Run full test suite (baseline: 1515 passed, 0 skipped, 0 failed)
464
+ # 5. Run full test suite (baseline: 1525 passed, 0 skipped, 0 failed)
465
465
  pytest tests/ -q
466
466
 
467
467
  # 6. Run pre-commit checks across all files
@@ -506,10 +506,10 @@ python3 -m venv /tmp/dmint-test-env
506
506
  source /tmp/dmint-test-env/bin/activate
507
507
 
508
508
  # Install the wheel with all extras
509
- pip install "dist/dmint-2.0.1-py3-none-any.whl[all]"
509
+ pip install "dist/dmint-2.0.2-py3-none-any.whl[all]"
510
510
 
511
511
  # 4. Verify all installed CLI entrypoints
512
- dmint --version # Expected: dmint 2.0.1
512
+ dmint --version # Expected: dmint 2.0.2
513
513
  dmint --help # Policy wizards and verification commands
514
514
  dmint-mcp --help # MCP multi-server gateway
515
515
  dmint-dashboard --help # Approval web review console
@@ -571,14 +571,21 @@ npm start
571
571
 
572
572
  ---
573
573
 
574
- ## Versioning & Severity Protocol
574
+ ## Versioning & Push-Time Release Gate
575
575
 
576
- Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)**:
577
- - **Patch (`2.0.0` &rarr; `2.0.1`)**: Bug fixes, documentation updates, test additions, non-breaking refactors.
578
- - **Minor (`2.0.0` &rarr; `2.1.0`)**: Backwards-compatible features, new CLI flags, new integrations.
579
- - **Major (`2.0.0` &rarr; `3.0.0`)**: Incompatible API changes, breaking policy schema modifications.
576
+ Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)** and uses a push-time release gate:
580
577
 
581
- > **CRITICAL RULE FOR AI AGENTS**: AI agents must **NEVER** change or bump version numbers silently. Always assess change severity, suggest the recommended SemVer bump to the user with clear rationale, and wait for explicit permission before updating `pyproject.toml`, `version.py`, `__init__.py`, or `CHANGELOG.md`.
578
+ | Change severity | SemVer bump | Typical changes |
579
+ |---|---|---|
580
+ | **High / Major** | `2.0.2` &rarr; `3.0.0` | Incompatible API changes, breaking policy schema modifications, removed public methods. |
581
+ | **Medium / Minor** | `2.0.2` &rarr; `2.1.0` | Backwards-compatible features, new CLI flags, new integrations. |
582
+ | **Low / Patch** | `2.0.2` &rarr; `2.0.3` | Bug fixes, security hardening, documentation updates, test additions, non-breaking refactors. |
583
+
584
+ Every push must include the appropriate version decision and bump. A push carrying any Major change is Major; otherwise any Minor change makes it Minor; otherwise it is Patch. When severity is ambiguous, choose the higher severity and ask before a Major bump.
585
+
586
+ The bump and its required updates are made in the same push: `pyproject.toml`, `src/dmint/version.py`, `CHANGELOG.md`, `PLAIN.md`, current-version documentation, and any version-pinned tests. The full verification flow in [`FLOW.md`](FLOW.md) must pass before pushing.
587
+
588
+ After CI succeeds for a push to `main`, the **Publish to PyPI** workflow publishes the new version automatically. Manual dispatch and GitHub release publication remain fallback paths. The workflow rejects a version that already exists on PyPI; bump the version instead of retrying the same one.
582
589
 
583
590
  ---
584
591
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes