hakodesh 0.2.2__tar.gz → 0.2.4__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 (56) hide show
  1. {hakodesh-0.2.2/src/hakodesh.egg-info → hakodesh-0.2.4}/PKG-INFO +6 -28
  2. hakodesh-0.2.4/README.md +52 -0
  3. {hakodesh-0.2.2 → hakodesh-0.2.4}/docs/PROTOCOL.md +1 -10
  4. {hakodesh-0.2.2 → hakodesh-0.2.4}/pyproject.toml +2 -3
  5. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/__init__.py +1 -1
  6. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/catalog.py +46 -22
  7. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/cli.py +24 -10
  8. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/dispatch.py +2 -2
  9. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/events.py +2 -2
  10. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/grimoire.py +13 -1
  11. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/__init__.py +1 -1
  12. {hakodesh-0.2.2 → hakodesh-0.2.4/src/hakodesh.egg-info}/PKG-INFO +6 -28
  13. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh.egg-info/SOURCES.txt +1 -5
  14. hakodesh-0.2.2/README.md +0 -74
  15. hakodesh-0.2.2/docs/IMPLEMENTATION.md +0 -75
  16. hakodesh-0.2.2/docs/MIGRATION.md +0 -63
  17. hakodesh-0.2.2/docs/PROCEDURAL_MEMORY.md +0 -102
  18. hakodesh-0.2.2/tests/test_procedural_memory.py +0 -574
  19. {hakodesh-0.2.2 → hakodesh-0.2.4}/LICENSE +0 -0
  20. {hakodesh-0.2.2 → hakodesh-0.2.4}/MANIFEST.in +0 -0
  21. {hakodesh-0.2.2 → hakodesh-0.2.4}/docs/EXTRACT.md +0 -0
  22. {hakodesh-0.2.2 → hakodesh-0.2.4}/setup.cfg +0 -0
  23. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/__main__.py +0 -0
  24. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/akashic.py +0 -0
  25. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/benchmark.py +0 -0
  26. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/combo.py +0 -0
  27. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/contracts/hakodesh-event-v1.json +0 -0
  28. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/enchant.py +0 -0
  29. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/home.py +0 -0
  30. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/keys.py +0 -0
  31. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/adapter.py +0 -0
  32. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/decide.py +0 -0
  33. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/execute.py +0 -0
  34. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/lifecycle.py +0 -0
  35. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/metrics.py +0 -0
  36. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/normalize.py +0 -0
  37. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/policy.py +0 -0
  38. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/procedures.py +0 -0
  39. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/promote.py +0 -0
  40. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/recall.py +0 -0
  41. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/risk.py +0 -0
  42. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/scope.py +0 -0
  43. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/memory/traces.py +0 -0
  44. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/mint.py +0 -0
  45. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/templates/combo.json.tmpl +0 -0
  46. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/templates/enchantment.json.tmpl +0 -0
  47. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/templates/spell.py.tmpl +0 -0
  48. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/templates/ward.json.tmpl +0 -0
  49. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh/ward.py +0 -0
  50. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh.egg-info/dependency_links.txt +0 -0
  51. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh.egg-info/entry_points.txt +0 -0
  52. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh.egg-info/requires.txt +0 -0
  53. {hakodesh-0.2.2 → hakodesh-0.2.4}/src/hakodesh.egg-info/top_level.txt +0 -0
  54. {hakodesh-0.2.2 → hakodesh-0.2.4}/tests/test_agnostic.py +0 -0
  55. {hakodesh-0.2.2 → hakodesh-0.2.4}/tests/test_empty_book.py +0 -0
  56. {hakodesh-0.2.2 → hakodesh-0.2.4}/tests/test_events.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hakodesh
3
- Version: 0.2.2
4
- Summary: Host-agnostic empty book with a deterministic procedural-memory runtime.
3
+ Version: 0.2.4
4
+ Summary: Host-agnostic empty book: mint spells, enchantments, wards, and combos as you need them.
5
5
  Author: Shelleyguitar
6
6
  License-Expression: LicenseRef-Proprietary
7
7
  Project-URL: Homepage, https://pypi.org/project/hakodesh/
@@ -26,20 +26,10 @@ Dynamic: license-file
26
26
 
27
27
  # hakodesh
28
28
 
29
- Host-agnostic Python CLI and SDK. After `pip install hakodesh` the user book is empty. Your LLM or agents **mint** spells, enchantments, wards, and combos as they need them. Repeated structured workflows can be **remembered** and, after a configurable promotion policy, executed as deterministic procedures **without another LLM pass**.
29
+ Host-agnostic Python CLI and SDK. After `pip install hakodesh` the user book is empty. Your LLM or agents **mint** spells, enchantments, wards, and combos as they need them.
30
30
 
31
31
  PyPI name, import, and command: **hakodesh**. Not snax. Not snx.
32
32
 
33
- This package does **not** prove SNX token savings. Measurements are recall, correctness, straight-through execution, re-entry, model turns, and host-reported context crossing.
34
-
35
- ## Release
36
-
37
- Current PyPI version is **0.2.2**. `pip install hakodesh` installs this release.
38
-
39
- **0.2.0 was withdrawn** from the index (deleted, not yanked) because procedure integrity did not cover approval or routing state and parameterized replay reused last-seen literals. **0.1.0 remains** installable. 0.2.2 is the same runtime as the Watson HMAC / `--bind` fix first shipped as 0.2.1; this version only makes the public page and shipped docs match that fact.
40
-
41
- Procedures are HMAC-authenticated with the home chain key. Arguments that vary across training traces become required slots; `decide` / `run-intent` take `--bind name=value`. Unsigned 0.2.0 `vN.json` files fail closed until re-promoted.
42
-
43
33
  ## Install
44
34
 
45
35
  ```bash
@@ -55,18 +45,9 @@ These are the runtime, not starter spells:
55
45
  | Command | What it does |
56
46
  |---|---|
57
47
  | `hakodesh catalog` | User artifacts in the book (empty at install) |
58
- | `hakodesh route "<intent>"` | Rank minted names plus kernel commands (may include procedure candidates) |
48
+ | `hakodesh route "<intent>"` | Rank minted names plus kernel commands |
59
49
  | `hakodesh invoke <name> [args...]` | Cast a minted spell by name |
60
50
  | `hakodesh mint <name> --kind spell\|enchantment\|ward\|combo` | Scaffold into the book (preview; `--confirm` writes) |
61
- | `hakodesh remember --intent "…" --step spell:name --source host` | Record a structured execution trace (not an opaque receipt) |
62
- | `hakodesh recall "<intent>"` | Local deterministic procedure recall |
63
- | `hakodesh decide "<intent>" [--bind name=value]` | `execute` / `ask_model` / `ambiguous` / `blocked` / `not_found` |
64
- | `hakodesh run-intent "<intent>" [--bind name=value]` | Straight-through execute when decide says `execute` |
65
- | `hakodesh next-action --intent "…" [--bind name=value]` | Next validated procedure step, or a suggestion |
66
- | `hakodesh procedures` | List promoted procedures |
67
- | `hakodesh approve <id> --confirm` | Approve a high-risk procedure |
68
- | `hakodesh policy` | Show promotion policy (three-success default is an implementation policy, not SNX history) |
69
- | `hakodesh metrics` | Recall / straight-through / re-entry / context-crossing stats |
70
51
  | `hakodesh akashic` | Verify HMAC chain; `--tail N` |
71
52
  | `hakodesh grimoire` | Cast ledger stats |
72
53
  | `hakodesh grimoire-seal` | RFC 6962 Merkle seal (preview; `--confirm` writes; `--verify`) |
@@ -77,7 +58,7 @@ These are the runtime, not starter spells:
77
58
 
78
59
  `--like` on an empty book uses the **kind template** in the wheel. After one spell exists, `--like <that>` copies its shape.
79
60
 
80
- Every mint and cast emits `hakodesh.event/v1`. Akashic is SHA-256 linked and HMAC-SHA256 signed. Grimoire is Merkle-sealed with the same chain key. Promoted procedures use that same home key for `procedure_mac`. The keystore is `$HAKODESH_HOME/keys` (0700/0600), minted on first seal, never in the wheel.
61
+ Every mint and cast emits `hakodesh.event/v1`. Akashic is SHA-256 linked and HMAC-SHA256 signed. Grimoire is Merkle-sealed with the same chain key. The keystore is `$HAKODESH_HOME/keys` (0700/0600), minted on first seal, never in the wheel.
81
62
 
82
63
  Notifications default to `none`. The package does not write LaunchAgents or editor hooks until you mint and bind an enchantment.
83
64
 
@@ -90,11 +71,8 @@ from hakodesh import events, akashic, grimoire
90
71
  from hakodesh.enchant import bind, lift
91
72
  from hakodesh.ward import unlock
92
73
  from hakodesh.combo import seal, cast
93
- from hakodesh.memory import remember, recall, decide, run_intent, next_action, approve
94
74
  ```
95
75
 
96
- See `docs/PROCEDURAL_MEMORY.md` and `docs/MIGRATION.md`.
97
-
98
76
  ## Empty book law
99
77
 
100
- A fresh install has zero user spells, enchantments, wards, combos, or promoted procedures. Discovery picks up a file the moment it lands under `HAKODESH_HOME/book/`.
78
+ A fresh install has zero user spells, enchantments, wards, or combos. Discovery picks up a file the moment it lands under `HAKODESH_HOME/book/`.
@@ -0,0 +1,52 @@
1
+ # hakodesh
2
+
3
+ Host-agnostic Python CLI and SDK. After `pip install hakodesh` the user book is empty. Your LLM or agents **mint** spells, enchantments, wards, and combos as they need them.
4
+
5
+ PyPI name, import, and command: **hakodesh**. Not snax. Not snx.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install hakodesh
11
+ ```
12
+
13
+ Data home: `HAKODESH_HOME` or the platform user-data directory for `hakodesh`. Never `~/spells`.
14
+
15
+ ## Kernel commands
16
+
17
+ These are the runtime, not starter spells:
18
+
19
+ | Command | What it does |
20
+ |---|---|
21
+ | `hakodesh catalog` | User artifacts in the book (empty at install) |
22
+ | `hakodesh route "<intent>"` | Rank minted names plus kernel commands |
23
+ | `hakodesh invoke <name> [args...]` | Cast a minted spell by name |
24
+ | `hakodesh mint <name> --kind spell\|enchantment\|ward\|combo` | Scaffold into the book (preview; `--confirm` writes) |
25
+ | `hakodesh akashic` | Verify HMAC chain; `--tail N` |
26
+ | `hakodesh grimoire` | Cast ledger stats |
27
+ | `hakodesh grimoire-seal` | RFC 6962 Merkle seal (preview; `--confirm` writes; `--verify`) |
28
+ | `hakodesh enchant bind\|lift <name> --settings <path>` | Bind or lift a minted enchantment |
29
+ | `hakodesh ward status\|lock\|unlock\|check <name>` | Fail-closed ward kernel |
30
+ | `hakodesh combo seal\|cast\|list [name]` | Sealed pipelines of minted spells |
31
+ | `hakodesh <minted-name> [args...]` | Cast after mint |
32
+
33
+ `--like` on an empty book uses the **kind template** in the wheel. After one spell exists, `--like <that>` copies its shape.
34
+
35
+ Every mint and cast emits `hakodesh.event/v1`. Akashic is SHA-256 linked and HMAC-SHA256 signed. Grimoire is Merkle-sealed with the same chain key. The keystore is `$HAKODESH_HOME/keys` (0700/0600), minted on first seal, never in the wheel.
36
+
37
+ Notifications default to `none`. The package does not write LaunchAgents or editor hooks until you mint and bind an enchantment.
38
+
39
+ ## SDK
40
+
41
+ ```python
42
+ from hakodesh.catalog import catalog
43
+ from hakodesh.mint import mint
44
+ from hakodesh import events, akashic, grimoire
45
+ from hakodesh.enchant import bind, lift
46
+ from hakodesh.ward import unlock
47
+ from hakodesh.combo import seal, cast
48
+ ```
49
+
50
+ ## Empty book law
51
+
52
+ A fresh install has zero user spells, enchantments, wards, or combos. Discovery picks up a file the moment it lands under `HAKODESH_HOME/book/`.
@@ -16,7 +16,7 @@ Canonical JSON: sorted keys, compact separators, UTF-8. Same hashes as `everplay
16
16
 
17
17
  Default `notification_policy` is `none`.
18
18
 
19
- Mint emits kind `artifact.minted`. Casts emit `spell.cast.started` / `completed` / `failed`. Procedure lifecycle emits `procedure.recorded`, `procedure.promoted`, `procedure.executed`, `procedure.failed`, `procedure.decision`, and `procedure.approved`. Procedure artifacts are HMAC-SHA256 authenticated with the home chain key.
19
+ Mint emits kind `artifact.minted`. Casts emit `spell.cast.started` / `completed` / `failed`.
20
20
 
21
21
  ## Akashic chain
22
22
 
@@ -54,12 +54,3 @@ All runtime state is under `HAKODESH_HOME` (or platformdirs):
54
54
  - `akashic/`
55
55
  - `grimoire.jsonl` / `grimoire_head.json`
56
56
  - `keys/`
57
- - `memory/traces.jsonl`
58
- - `memory/procedures/<id>/vN.json`
59
- - `memory/policy.json`
60
- - `memory/metrics.jsonl`
61
-
62
- ## Procedural memory
63
-
64
- See `docs/PROCEDURAL_MEMORY.md`. Promotion default: three successful structured traces, same procedure signature, compatible safety scope, inside `window_seconds`. That default is an implementation policy, not SNX history. Opaque receipts are not a promotion source.
65
-
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hakodesh"
7
- version = "0.2.2"
8
- description = "Host-agnostic empty book with a deterministic procedural-memory runtime."
7
+ version = "0.2.4"
8
+ description = "Host-agnostic empty book: mint spells, enchantments, wards, and combos as you need them."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = "LicenseRef-Proprietary"
@@ -44,5 +44,4 @@ hakodesh = ["templates/*", "contracts/*.json"]
44
44
 
45
45
  [tool.pytest.ini_options]
46
46
  testpaths = ["tests"]
47
- pythonpath = ["src"]
48
47
  addopts = "-q"
@@ -11,7 +11,7 @@ from .grimoire import seal as grimoire_seal
11
11
  from .memory import approve, decide, metrics_summary, next_action, recall, remember, run_intent
12
12
  from .ward import unlock
13
13
 
14
- __version__ = "0.2.2"
14
+ __version__ = "0.2.3"
15
15
  __all__ = [
16
16
  "list_catalog",
17
17
  "route",
@@ -7,28 +7,45 @@ from pathlib import Path
7
7
 
8
8
  from . import home as paths
9
9
 
10
- KERNEL = (
11
- "mint",
12
- "catalog",
13
- "route",
14
- "invoke",
15
- "akashic",
16
- "grimoire",
17
- "grimoire-seal",
18
- "enchant",
19
- "ward",
20
- "combo",
21
- "remember",
22
- "recall",
23
- "decide",
24
- "run-intent",
25
- "next-action",
26
- "promote",
27
- "procedures",
28
- "approve",
29
- "metrics",
30
- "policy",
31
- )
10
+ # Advertised kernel — primary names only. Old names live in ALIASES and still dispatch.
11
+ # `devra` is the snx-shaped caster: `devra <spell> [args...]`.
12
+ # Minted spell names are kebab-case. Kernel verbs are single tokens unless they already were kebab aliases.
13
+ KERNEL_GROUPS = {
14
+ "cast": ("devra",),
15
+ "spellbook": ("mint", "spellbook", "route"),
16
+ "kinds": ("enchant", "ward", "combo"),
17
+ "memory": (
18
+ "remember",
19
+ "recall",
20
+ "decide",
21
+ "run",
22
+ "next",
23
+ "rites",
24
+ "approve",
25
+ "promote",
26
+ "policy",
27
+ "metrics",
28
+ "benchmark",
29
+ ),
30
+ "ledger": ("akashic", "grimoire", "protocol"),
31
+ }
32
+ KERNEL = tuple(name for group in KERNEL_GROUPS.values() for name in group)
33
+ ALIASES = {
34
+ "catalog": "spellbook",
35
+ "book": "spellbook",
36
+ "invoke": "devra",
37
+ "run-intent": "run",
38
+ "run_intent": "run",
39
+ "next-action": "next",
40
+ "next_action": "next",
41
+ "procedures": "rites",
42
+ "grimoire-seal": "grimoire",
43
+ }
44
+ KINDS_DETAIL = {
45
+ "enchant": "enchantments — bind|lift <name> --settings PATH [--confirm]",
46
+ "ward": "wards — status|lock|unlock|check <name>",
47
+ "combo": "combos — seal|cast|list [name]",
48
+ }
32
49
 
33
50
 
34
51
  def _load_spell(path: Path):
@@ -86,6 +103,9 @@ def catalog(root: Path | None = None):
86
103
  for item in items
87
104
  ],
88
105
  "kernel": list(KERNEL),
106
+ "groups": {key: list(names) for key, names in KERNEL_GROUPS.items()},
107
+ "aliases": dict(ALIASES),
108
+ "kinds": dict(KINDS_DETAIL),
89
109
  }
90
110
 
91
111
 
@@ -97,6 +117,10 @@ def route(intent: str, root: Path | None = None):
97
117
  intent = (intent or "").lower()
98
118
  scored = []
99
119
  haystacks = [(name, "kernel command %s" % name, "kernel") for name in KERNEL]
120
+ haystacks.extend(
121
+ (alias, "kernel command %s alias %s" % (alias, target), "kernel")
122
+ for alias, target in ALIASES.items()
123
+ )
100
124
  for item in user_artifacts(root):
101
125
  desc = item.get("descriptor") or {}
102
126
  hay = "%s %s %s" % (item["name"], desc.get("purpose", ""), " ".join(desc.get("tags") or []))
@@ -1,4 +1,4 @@
1
- """hakodesh CLI — JSON in / JSON out. No snx shim."""
1
+ """devra CLI — JSON in / JSON out. Package import remains hakodesh."""
2
2
  from __future__ import annotations
3
3
 
4
4
  import json
@@ -96,8 +96,13 @@ def main(argv=None) -> int:
96
96
  if not argv or argv[0] in ("-h", "--help", "help"):
97
97
  emit(
98
98
  {
99
- "usage": "hakodesh <catalog|route|invoke|mint|akashic|grimoire|grimoire-seal|enchant|ward|combo|remember|recall|decide|run-intent|next-action|promote|procedures|approve|metrics|policy|NAME> [args]",
99
+ "usage": "devra <command> [args]",
100
+ "package": "hakodesh",
101
+ "cast": "devra <spell> [args...]",
102
+ "groups": {key: list(names) for key, names in catalog.KERNEL_GROUPS.items()},
103
+ "kinds": dict(catalog.KINDS_DETAIL),
100
104
  "kernel": list(catalog.KERNEL),
105
+ "aliases": dict(catalog.ALIASES),
101
106
  }
102
107
  )
103
108
  return 0
@@ -115,16 +120,16 @@ def main(argv=None) -> int:
115
120
 
116
121
  def _dispatch(cmd, rest):
117
122
  confirm = _has(rest, "--confirm")
118
- if cmd == "catalog":
123
+ if cmd in {"spellbook", "book", "catalog"}:
119
124
  return catalog.catalog()
120
125
  if cmd == "route":
121
126
  return catalog.route(" ".join(rest))
122
- if cmd == "invoke":
127
+ if cmd in {"devra", "invoke"}:
123
128
  if not rest:
124
- return {"ok": False, "error": "usage: invoke <name> [args...]"}
129
+ return {"ok": False, "error": "usage: devra <spell> [args...]"}
125
130
  if rest[0] == "--route":
126
131
  return catalog.route(" ".join(rest[1:]))
127
- if rest[0] == "--catalog":
132
+ if rest[0] in {"--catalog", "--spellbook"}:
128
133
  return catalog.catalog()
129
134
  return dispatch.invoke(rest[0], rest[1:])
130
135
  if cmd == "mint":
@@ -141,7 +146,16 @@ def _dispatch(cmd, rest):
141
146
  return {"ok": True, "events": akashic.tail_events(n)}
142
147
  return akashic.verify_chain(strict=_has(rest, "--strict"))
143
148
  if cmd == "grimoire":
144
- return grimoire.stats()
149
+ if _has(rest, "--verify"):
150
+ return grimoire.verify()
151
+ action = rest[0] if rest else "stats"
152
+ if action in {"stats", "status"}:
153
+ return grimoire.stats()
154
+ if action == "seal":
155
+ return grimoire.seal(confirm=confirm)
156
+ if action == "verify":
157
+ return grimoire.verify()
158
+ return {"ok": False, "error": "usage: grimoire [stats|seal|verify]"}
145
159
  if cmd == "grimoire-seal":
146
160
  if _has(rest, "--verify"):
147
161
  return grimoire.verify()
@@ -287,14 +301,14 @@ def _memory_dispatch(cmd, rest, confirm):
287
301
  if cmd == "decide":
288
302
  bindings, leftover = _parse_bindings(rest)
289
303
  return decide(" ".join(leftover), bindings=bindings or None)
290
- if cmd in {"run-intent", "run_intent"}:
304
+ if cmd in {"run", "run-intent", "run_intent"}:
291
305
  bindings, leftover = _parse_bindings(rest)
292
306
  return run_intent(
293
307
  " ".join(x for x in leftover if x != "--full"),
294
308
  full=_has(rest, "--full"),
295
309
  bindings=bindings or None,
296
310
  )
297
- if cmd in {"next-action", "next_action"}:
311
+ if cmd in {"next", "next-action", "next_action"}:
298
312
  bindings, leftover = _parse_bindings(rest)
299
313
  after = _flag(leftover, "--after-step")
300
314
  intent = _flag(leftover, "--intent") or " ".join(
@@ -307,7 +321,7 @@ def _memory_dispatch(cmd, rest, confirm):
307
321
  )
308
322
  if cmd == "promote":
309
323
  return promote_mod.maybe_promote(replace=_has(rest, "--replace"))
310
- if cmd == "procedures":
324
+ if cmd in {"rites", "procedures"}:
311
325
  rows = procedures_mod.list_procedures()
312
326
  return {"ok": True, "count": len(rows), "procedures": rows}
313
327
  if cmd == "approve":
@@ -8,8 +8,8 @@ from . import akashic, catalog, events, grimoire
8
8
 
9
9
  def invoke(name: str, args=None, *, surface="cli", root=None) -> dict:
10
10
  args = list(args or [])
11
- if name == "invoke":
12
- return {"ok": False, "error": "invoke cannot invoke itself"}
11
+ if name in {"invoke", "devra"}:
12
+ return {"ok": False, "error": "%s cannot invoke itself" % name}
13
13
  reg = catalog.registry(root)
14
14
  item = reg.get(name)
15
15
  if not item or item["kind"] != "spell" or item.get("run") is None:
@@ -98,9 +98,9 @@ SUBJECT_FIELDS = frozenset(
98
98
  )
99
99
 
100
100
  _EVENT_ID = re.compile(r"^evt_[a-f0-9]{32}$")
101
- _IDEMPOTENCY_KEY = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$")
101
+ _IDEMPOTENCY_KEY = re.compile(r"^[A-Za-z0-9֐-׿][A-Za-z0-9._:\-֐-׿]{7,127}$")
102
102
  _STATE = re.compile(r"^[a-z][a-z0-9._-]{1,63}$")
103
- _ACTOR_ID = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$")
103
+ _ACTOR_ID = re.compile(r"^[A-Za-z0-9֐-׿][A-Za-z0-9._:\-֐-׿]{2,127}$")
104
104
  _SENSITIVE_KEY = re.compile(
105
105
  r"(?:^|_)(?:token|secret|password|authorization|api_?key|private_?key|"
106
106
  r"webhook_?url|credential)(?:$|_)",
@@ -98,7 +98,19 @@ def log_cast(
98
98
  event_id=None,
99
99
  root=None,
100
100
  ):
101
- if spell in {"grimoire", "grimoire-seal", "akashic", "catalog", "route"}:
101
+ if spell in {
102
+ "grimoire",
103
+ "grimoire-seal",
104
+ "akashic",
105
+ "catalog",
106
+ "book",
107
+ "spellbook",
108
+ "devra",
109
+ "invoke",
110
+ "route",
111
+ "rites",
112
+ "procedures",
113
+ }:
102
114
  return {"ok": True, "status": "excluded", "spell": spell}
103
115
  try:
104
116
  try:
@@ -1,4 +1,4 @@
1
- """Procedural memory runtime: remember, recall, decide, run-intent, promote."""
1
+ """Procedural memory runtime: remember, recall, decide, run, next, rites."""
2
2
  from __future__ import annotations
3
3
 
4
4
  from .decide import decide
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hakodesh
3
- Version: 0.2.2
4
- Summary: Host-agnostic empty book with a deterministic procedural-memory runtime.
3
+ Version: 0.2.4
4
+ Summary: Host-agnostic empty book: mint spells, enchantments, wards, and combos as you need them.
5
5
  Author: Shelleyguitar
6
6
  License-Expression: LicenseRef-Proprietary
7
7
  Project-URL: Homepage, https://pypi.org/project/hakodesh/
@@ -26,20 +26,10 @@ Dynamic: license-file
26
26
 
27
27
  # hakodesh
28
28
 
29
- Host-agnostic Python CLI and SDK. After `pip install hakodesh` the user book is empty. Your LLM or agents **mint** spells, enchantments, wards, and combos as they need them. Repeated structured workflows can be **remembered** and, after a configurable promotion policy, executed as deterministic procedures **without another LLM pass**.
29
+ Host-agnostic Python CLI and SDK. After `pip install hakodesh` the user book is empty. Your LLM or agents **mint** spells, enchantments, wards, and combos as they need them.
30
30
 
31
31
  PyPI name, import, and command: **hakodesh**. Not snax. Not snx.
32
32
 
33
- This package does **not** prove SNX token savings. Measurements are recall, correctness, straight-through execution, re-entry, model turns, and host-reported context crossing.
34
-
35
- ## Release
36
-
37
- Current PyPI version is **0.2.2**. `pip install hakodesh` installs this release.
38
-
39
- **0.2.0 was withdrawn** from the index (deleted, not yanked) because procedure integrity did not cover approval or routing state and parameterized replay reused last-seen literals. **0.1.0 remains** installable. 0.2.2 is the same runtime as the Watson HMAC / `--bind` fix first shipped as 0.2.1; this version only makes the public page and shipped docs match that fact.
40
-
41
- Procedures are HMAC-authenticated with the home chain key. Arguments that vary across training traces become required slots; `decide` / `run-intent` take `--bind name=value`. Unsigned 0.2.0 `vN.json` files fail closed until re-promoted.
42
-
43
33
  ## Install
44
34
 
45
35
  ```bash
@@ -55,18 +45,9 @@ These are the runtime, not starter spells:
55
45
  | Command | What it does |
56
46
  |---|---|
57
47
  | `hakodesh catalog` | User artifacts in the book (empty at install) |
58
- | `hakodesh route "<intent>"` | Rank minted names plus kernel commands (may include procedure candidates) |
48
+ | `hakodesh route "<intent>"` | Rank minted names plus kernel commands |
59
49
  | `hakodesh invoke <name> [args...]` | Cast a minted spell by name |
60
50
  | `hakodesh mint <name> --kind spell\|enchantment\|ward\|combo` | Scaffold into the book (preview; `--confirm` writes) |
61
- | `hakodesh remember --intent "…" --step spell:name --source host` | Record a structured execution trace (not an opaque receipt) |
62
- | `hakodesh recall "<intent>"` | Local deterministic procedure recall |
63
- | `hakodesh decide "<intent>" [--bind name=value]` | `execute` / `ask_model` / `ambiguous` / `blocked` / `not_found` |
64
- | `hakodesh run-intent "<intent>" [--bind name=value]` | Straight-through execute when decide says `execute` |
65
- | `hakodesh next-action --intent "…" [--bind name=value]` | Next validated procedure step, or a suggestion |
66
- | `hakodesh procedures` | List promoted procedures |
67
- | `hakodesh approve <id> --confirm` | Approve a high-risk procedure |
68
- | `hakodesh policy` | Show promotion policy (three-success default is an implementation policy, not SNX history) |
69
- | `hakodesh metrics` | Recall / straight-through / re-entry / context-crossing stats |
70
51
  | `hakodesh akashic` | Verify HMAC chain; `--tail N` |
71
52
  | `hakodesh grimoire` | Cast ledger stats |
72
53
  | `hakodesh grimoire-seal` | RFC 6962 Merkle seal (preview; `--confirm` writes; `--verify`) |
@@ -77,7 +58,7 @@ These are the runtime, not starter spells:
77
58
 
78
59
  `--like` on an empty book uses the **kind template** in the wheel. After one spell exists, `--like <that>` copies its shape.
79
60
 
80
- Every mint and cast emits `hakodesh.event/v1`. Akashic is SHA-256 linked and HMAC-SHA256 signed. Grimoire is Merkle-sealed with the same chain key. Promoted procedures use that same home key for `procedure_mac`. The keystore is `$HAKODESH_HOME/keys` (0700/0600), minted on first seal, never in the wheel.
61
+ Every mint and cast emits `hakodesh.event/v1`. Akashic is SHA-256 linked and HMAC-SHA256 signed. Grimoire is Merkle-sealed with the same chain key. The keystore is `$HAKODESH_HOME/keys` (0700/0600), minted on first seal, never in the wheel.
81
62
 
82
63
  Notifications default to `none`. The package does not write LaunchAgents or editor hooks until you mint and bind an enchantment.
83
64
 
@@ -90,11 +71,8 @@ from hakodesh import events, akashic, grimoire
90
71
  from hakodesh.enchant import bind, lift
91
72
  from hakodesh.ward import unlock
92
73
  from hakodesh.combo import seal, cast
93
- from hakodesh.memory import remember, recall, decide, run_intent, next_action, approve
94
74
  ```
95
75
 
96
- See `docs/PROCEDURAL_MEMORY.md` and `docs/MIGRATION.md`.
97
-
98
76
  ## Empty book law
99
77
 
100
- A fresh install has zero user spells, enchantments, wards, combos, or promoted procedures. Discovery picks up a file the moment it lands under `HAKODESH_HOME/book/`.
78
+ A fresh install has zero user spells, enchantments, wards, or combos. Discovery picks up a file the moment it lands under `HAKODESH_HOME/book/`.
@@ -4,9 +4,6 @@ README.md
4
4
  pyproject.toml
5
5
  setup.cfg
6
6
  docs/EXTRACT.md
7
- docs/IMPLEMENTATION.md
8
- docs/MIGRATION.md
9
- docs/PROCEDURAL_MEMORY.md
10
7
  docs/PROTOCOL.md
11
8
  src/hakodesh/__init__.py
12
9
  src/hakodesh/__main__.py
@@ -50,5 +47,4 @@ src/hakodesh/templates/spell.py.tmpl
50
47
  src/hakodesh/templates/ward.json.tmpl
51
48
  tests/test_agnostic.py
52
49
  tests/test_empty_book.py
53
- tests/test_events.py
54
- tests/test_procedural_memory.py
50
+ tests/test_events.py
hakodesh-0.2.2/README.md DELETED
@@ -1,74 +0,0 @@
1
- # hakodesh
2
-
3
- Host-agnostic Python CLI and SDK. After `pip install hakodesh` the user book is empty. Your LLM or agents **mint** spells, enchantments, wards, and combos as they need them. Repeated structured workflows can be **remembered** and, after a configurable promotion policy, executed as deterministic procedures **without another LLM pass**.
4
-
5
- PyPI name, import, and command: **hakodesh**. Not snax. Not snx.
6
-
7
- This package does **not** prove SNX token savings. Measurements are recall, correctness, straight-through execution, re-entry, model turns, and host-reported context crossing.
8
-
9
- ## Release
10
-
11
- Current PyPI version is **0.2.2**. `pip install hakodesh` installs this release.
12
-
13
- **0.2.0 was withdrawn** from the index (deleted, not yanked) because procedure integrity did not cover approval or routing state and parameterized replay reused last-seen literals. **0.1.0 remains** installable. 0.2.2 is the same runtime as the Watson HMAC / `--bind` fix first shipped as 0.2.1; this version only makes the public page and shipped docs match that fact.
14
-
15
- Procedures are HMAC-authenticated with the home chain key. Arguments that vary across training traces become required slots; `decide` / `run-intent` take `--bind name=value`. Unsigned 0.2.0 `vN.json` files fail closed until re-promoted.
16
-
17
- ## Install
18
-
19
- ```bash
20
- pip install hakodesh
21
- ```
22
-
23
- Data home: `HAKODESH_HOME` or the platform user-data directory for `hakodesh`. Never `~/spells`.
24
-
25
- ## Kernel commands
26
-
27
- These are the runtime, not starter spells:
28
-
29
- | Command | What it does |
30
- |---|---|
31
- | `hakodesh catalog` | User artifacts in the book (empty at install) |
32
- | `hakodesh route "<intent>"` | Rank minted names plus kernel commands (may include procedure candidates) |
33
- | `hakodesh invoke <name> [args...]` | Cast a minted spell by name |
34
- | `hakodesh mint <name> --kind spell\|enchantment\|ward\|combo` | Scaffold into the book (preview; `--confirm` writes) |
35
- | `hakodesh remember --intent "…" --step spell:name --source host` | Record a structured execution trace (not an opaque receipt) |
36
- | `hakodesh recall "<intent>"` | Local deterministic procedure recall |
37
- | `hakodesh decide "<intent>" [--bind name=value]` | `execute` / `ask_model` / `ambiguous` / `blocked` / `not_found` |
38
- | `hakodesh run-intent "<intent>" [--bind name=value]` | Straight-through execute when decide says `execute` |
39
- | `hakodesh next-action --intent "…" [--bind name=value]` | Next validated procedure step, or a suggestion |
40
- | `hakodesh procedures` | List promoted procedures |
41
- | `hakodesh approve <id> --confirm` | Approve a high-risk procedure |
42
- | `hakodesh policy` | Show promotion policy (three-success default is an implementation policy, not SNX history) |
43
- | `hakodesh metrics` | Recall / straight-through / re-entry / context-crossing stats |
44
- | `hakodesh akashic` | Verify HMAC chain; `--tail N` |
45
- | `hakodesh grimoire` | Cast ledger stats |
46
- | `hakodesh grimoire-seal` | RFC 6962 Merkle seal (preview; `--confirm` writes; `--verify`) |
47
- | `hakodesh enchant bind\|lift <name> --settings <path>` | Bind or lift a minted enchantment |
48
- | `hakodesh ward status\|lock\|unlock\|check <name>` | Fail-closed ward kernel |
49
- | `hakodesh combo seal\|cast\|list [name]` | Sealed pipelines of minted spells |
50
- | `hakodesh <minted-name> [args...]` | Cast after mint |
51
-
52
- `--like` on an empty book uses the **kind template** in the wheel. After one spell exists, `--like <that>` copies its shape.
53
-
54
- Every mint and cast emits `hakodesh.event/v1`. Akashic is SHA-256 linked and HMAC-SHA256 signed. Grimoire is Merkle-sealed with the same chain key. Promoted procedures use that same home key for `procedure_mac`. The keystore is `$HAKODESH_HOME/keys` (0700/0600), minted on first seal, never in the wheel.
55
-
56
- Notifications default to `none`. The package does not write LaunchAgents or editor hooks until you mint and bind an enchantment.
57
-
58
- ## SDK
59
-
60
- ```python
61
- from hakodesh.catalog import catalog
62
- from hakodesh.mint import mint
63
- from hakodesh import events, akashic, grimoire
64
- from hakodesh.enchant import bind, lift
65
- from hakodesh.ward import unlock
66
- from hakodesh.combo import seal, cast
67
- from hakodesh.memory import remember, recall, decide, run_intent, next_action, approve
68
- ```
69
-
70
- See `docs/PROCEDURAL_MEMORY.md` and `docs/MIGRATION.md`.
71
-
72
- ## Empty book law
73
-
74
- A fresh install has zero user spells, enchantments, wards, combos, or promoted procedures. Discovery picks up a file the moment it lands under `HAKODESH_HOME/book/`.
@@ -1,75 +0,0 @@
1
- # Hakodesh 0.2.2 — procedural memory implementation report
2
-
3
- This implementation does **not** prove SNX token savings. Tests and measurements establish local recall, promotion, straight-through execution, fail-closed safety, and host-reported context accounting only.
4
-
5
- ## 0.2.1 Watson corrections (HKD-020)
6
-
7
- Public 0.2.0 needed correction. 0.2.1 ships:
8
-
9
- | ID | Fix |
10
- |---|---|
11
- | HKD-020-001 | HMAC-SHA256 `procedure_mac` over the full authenticated body including `risk.approved`; `approve()` writes `vN+1` and emits `procedure.approved` |
12
- | HKD-020-002 | `intent_example`, `normalized_intent`, tags, aliases, and status are in the authenticated body |
13
- | HKD-020-003 | Varying training args become required slots; `run-intent --bind` / SDK `bindings=`; fail closed if missing |
14
- | HKD-020-004 | Every success slice is searched; the latest clean cluster is promoted |
15
- | HKD-020-005 | Promotion uses `_cluster_confidence` vs `min_confidence`; policy probabilities must be in `[0, 1]` |
16
- | HKD-020-006 | Benchmark no longer double-counts `task_complete` on a successful replay |
17
- | HKD-020-007 | `procedure.recorded`, `procedure.failed`, and `procedure.decision` are emitted |
18
- | HKD-020-008 | 0.1.0 **sdist** sha256 `3e5959447bd1999797104a7fe27a3b6bc1253d2fb534d03809fbc7ed4ae91257`; **wheel** sha256 `7e74e20de8aa1af606299ae64d2fc01c89627dc405b668f159c957b1b23c8145` |
19
-
20
- Public **0.2.0** needed that correction and was later withdrawn from the index. **0.2.2** is the same runtime with README and shipped docs that match the live index: https://pypi.org/project/hakodesh/0.2.2/
21
-
22
- ## Files changed
23
-
24
- New:
25
-
26
- - `src/hakodesh/memory/` — traces, policy, recall, promote, procedures, decide, execute, metrics, risk, scope, adapter
27
- - `src/hakodesh/benchmark.py`
28
- - `tests/test_procedural_memory.py`
29
- - `docs/PROCEDURAL_MEMORY.md`
30
- - `docs/MIGRATION.md`
31
- - `docs/IMPLEMENTATION.md`
32
-
33
- Modified:
34
-
35
- - `src/hakodesh/{cli,catalog,home,events,__init__}.py`
36
- - `src/hakodesh/contracts/hakodesh-event-v1.json`
37
- - `pyproject.toml` (0.2.2)
38
- - `README.md`, `docs/PROTOCOL.md`
39
-
40
- SNX was not modified.
41
-
42
- ## Architecture implemented
43
-
44
- Structured host/agent/executor traces → configurable promotion → versioned hashed procedures → local recall (Jaccard + sequence + tags, no LLM/network) → `decide` → optional straight-through `run-intent` via existing `dispatch.invoke`. Compact receipts stay small; audit JSON stays on disk. Optional `ModelAdapter` exists for hosts and is never called by the executor.
45
-
46
- ## Promotion and time-window policy
47
-
48
- Default: **3** successful traces, same procedure signature, compatible env+safety scope, cluster span ≤ `window_seconds` (default 30 days), `failure_policy=block_on_any_in_window`. Failures and incorrect correctness do not count. The three-success default is an **implementation policy**, not SNX history. Policy fields are copied onto promotion receipts.
49
-
50
- ## Model boundary
51
-
52
- Straight-through runs set `model_reasoning_reentered=false`, `model_turns=0`, `model_crossed_bytes=0`. Metrics distinguish `locally_produced` vs host-supplied `model_crossed`. Receipt size is not treated as reasoning avoided. Billed tokens are recorded only when the host supplies them.
53
-
54
- ## Safety behavior
55
-
56
- Wards run at the execution boundary before `dispatch.invoke`. Procedure HMAC (home chain key) and hash are checked before replay; routing fields and `risk.approved` are in the authenticated body. Scope mismatch, unbound parameters, and missing high-risk approval return `blocked` / `needs_model_reasoning` with `recovery.suggestion=null`. Tamper fails closed. HMAC Akashic + Grimoire Merkle + receipt redaction are unchanged.
57
-
58
- ## Backward compatibility
59
-
60
- `catalog`, `route` (richer keys), `mint` preview/`--confirm`, `invoke <name>`, `combo`, existing events remain. Fresh install: zero user artifacts and zero procedures.
61
-
62
- ## Tests run and results
63
-
64
- `python3 -m pytest tests -q` → **43 passed** (legacy empty-book / events / agnostic + original procedural cases + Watson HKD-020 adversarial tests).
65
-
66
- ## Known limitations
67
-
68
- - Recall is lexical, not semantic. Unrelated paraphrases correctly fall through to `ask_model`.
69
- - `snx tokenomics` / billed-token A/B is out of scope (Hakodesh-only).
70
- - Drive git for 0.1.0 was unreadable (I/O); this tree is bootstrapped from the PyPI 0.1.0 **sdist** sha256 `3e5959447bd1999797104a7fe27a3b6bc1253d2fb534d03809fbc7ed4ae91257` (the **wheel** sha256 is `7e74e20de8aa1af606299ae64d2fc01c89627dc405b668f159c957b1b23c8145`; do not label the wheel digest as the sdist).
71
- - Auto-promote writes the first eligible version; further identical successes do not silently overwrite.
72
-
73
- ## Metrics still requiring a controlled experiment
74
-
75
- Causal tokens-per-completed-task (spells vs raw vs procedures), billed input+output tokens, and any comparison to Magus SNX. Those need a frozen task suite with API-reported tokens. This runtime only instruments recall, route precision (when labeled), straight-through rate, re-entry, reuse depth, model turns, and context-byte split.