stigmem-plugin-memory-garden-acl 0.1.0__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.
- stigmem_plugin_memory_garden_acl-0.1.0/.gitignore +70 -0
- stigmem_plugin_memory_garden_acl-0.1.0/PKG-INFO +105 -0
- stigmem_plugin_memory_garden_acl-0.1.0/README.md +82 -0
- stigmem_plugin_memory_garden_acl-0.1.0/STATUS.md +18 -0
- stigmem_plugin_memory_garden_acl-0.1.0/pyproject.toml +52 -0
- stigmem_plugin_memory_garden_acl-0.1.0/security.md +26 -0
- stigmem_plugin_memory_garden_acl-0.1.0/spec.md +31 -0
- stigmem_plugin_memory_garden_acl-0.1.0/src/stigmem_plugin_memory_garden_acl/__init__.py +12 -0
- stigmem_plugin_memory_garden_acl-0.1.0/src/stigmem_plugin_memory_garden_acl/config.py +44 -0
- stigmem_plugin_memory_garden_acl-0.1.0/src/stigmem_plugin_memory_garden_acl/handlers.py +61 -0
- stigmem_plugin_memory_garden_acl-0.1.0/src/stigmem_plugin_memory_garden_acl/manifest.py +41 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
.eggs/
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
.venv/
|
|
10
|
+
venv/
|
|
11
|
+
.uv/
|
|
12
|
+
.mypy_cache/
|
|
13
|
+
.ruff_cache/
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
htmlcov/
|
|
16
|
+
.coverage
|
|
17
|
+
coverage.xml
|
|
18
|
+
*.cover
|
|
19
|
+
coverage/
|
|
20
|
+
|
|
21
|
+
# Node / pnpm
|
|
22
|
+
node_modules/
|
|
23
|
+
.next/
|
|
24
|
+
.turbo/
|
|
25
|
+
.jscpd/
|
|
26
|
+
.pnpm-store/
|
|
27
|
+
dist/
|
|
28
|
+
*.tsbuildinfo
|
|
29
|
+
apps/dashboard/coverage/
|
|
30
|
+
adapters/mcp/coverage/
|
|
31
|
+
sdks/stigmem-ts/coverage/
|
|
32
|
+
|
|
33
|
+
# Environment
|
|
34
|
+
.env
|
|
35
|
+
.env.local
|
|
36
|
+
.env.*.local
|
|
37
|
+
|
|
38
|
+
# Release signing keys — public keys are attached to GitHub Releases only;
|
|
39
|
+
# private keys must NEVER be committed (use offline storage).
|
|
40
|
+
stigmem-release-signing-key.asc
|
|
41
|
+
stigmem-release-signing-key*.asc
|
|
42
|
+
*private*signing*key*.asc
|
|
43
|
+
*secret*signing*key*.asc
|
|
44
|
+
|
|
45
|
+
# IDE
|
|
46
|
+
.vscode/
|
|
47
|
+
.idea/
|
|
48
|
+
*.swp
|
|
49
|
+
*.swo
|
|
50
|
+
|
|
51
|
+
# OS
|
|
52
|
+
.DS_Store
|
|
53
|
+
Thumbs.db
|
|
54
|
+
|
|
55
|
+
# Local Codex project instructions
|
|
56
|
+
AGENTS.md
|
|
57
|
+
|
|
58
|
+
# Docker
|
|
59
|
+
*.log
|
|
60
|
+
|
|
61
|
+
# Stigmem runtime (DB and logs are runtime state, not source)
|
|
62
|
+
data/*.db
|
|
63
|
+
data/*.db-shm
|
|
64
|
+
data/*.db-wal
|
|
65
|
+
stigmem.db
|
|
66
|
+
stigmem.db-shm
|
|
67
|
+
stigmem.db-wal
|
|
68
|
+
logs/
|
|
69
|
+
# Eval results (CI-generated artifacts)
|
|
70
|
+
eval/results/
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stigmem-plugin-memory-garden-acl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Experimental Memory Garden advanced ACL plugin for Stigmem.
|
|
5
|
+
Project-URL: Homepage, https://github.com/eidetic-labs/stigmem
|
|
6
|
+
Project-URL: Documentation, https://github.com/eidetic-labs/stigmem/tree/main/features/memory-garden-acl
|
|
7
|
+
Project-URL: Repository, https://github.com/eidetic-labs/stigmem
|
|
8
|
+
Project-URL: Issues, https://github.com/eidetic-labs/stigmem/issues
|
|
9
|
+
Author-email: Eidetic Labs <oss@eidetic-labs.ai>
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
Keywords: acl,authorization,memory-garden,plugins,stigmem
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: pydantic<3,>=2
|
|
21
|
+
Requires-Dist: stigmem-node<1.0.0,>=0.9.0a8
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# Stigmem Memory Garden Advanced ACL Plugin
|
|
25
|
+
|
|
26
|
+
Experimental advanced Memory Garden ACL plugin for Stigmem.
|
|
27
|
+
|
|
28
|
+
This package provides the `stigmem-plugin-memory-garden-acl` source package for
|
|
29
|
+
alpha validation. It registers through the `stigmem.plugins` entry point group
|
|
30
|
+
and is loaded by `stigmem-node` only when explicitly installed and configured by
|
|
31
|
+
an operator.
|
|
32
|
+
|
|
33
|
+
## Status
|
|
34
|
+
|
|
35
|
+
Advanced Memory Garden ACL behavior remains experimental. Basic garden CRUD,
|
|
36
|
+
membership, and direct garden fact guards remain core. Installing this package
|
|
37
|
+
does not activate advanced cross-surface ACL behavior unless the plugin is
|
|
38
|
+
registered and the operator enables the relevant gates.
|
|
39
|
+
|
|
40
|
+
The package metadata is publication-shaped for the plugin readiness track, but
|
|
41
|
+
registry publication remains on hold until dry-run evidence and maintainer
|
|
42
|
+
clearance are recorded. See the feature record under
|
|
43
|
+
`features/memory-garden-acl/` for the current status, evidence, and security
|
|
44
|
+
notes.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install --pre stigmem-node==0.9.0a8 stigmem-plugin-memory-garden-acl==0.1.0
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Enable
|
|
53
|
+
|
|
54
|
+
Set the plugin gate environment variable to opt in:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
export STIGMEM_MEMORY_GARDEN_ACL_ENABLED=1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The default install is inert; advanced ACL hook behavior only activates when
|
|
61
|
+
the package is installed, discovered through the `stigmem.plugins` entry point,
|
|
62
|
+
and the operator enables the gate. Enforcement gates such as
|
|
63
|
+
`STIGMEM_MEMORY_GARDEN_ACL_ENFORCE_ASSERT_AUTHORIZE` and
|
|
64
|
+
`STIGMEM_MEMORY_GARDEN_ACL_ENFORCE_RECALL_AUTHORIZE` remain separately opt-in.
|
|
65
|
+
|
|
66
|
+
## Disable
|
|
67
|
+
|
|
68
|
+
Unset the plugin gate environment variable, or set it to any value other than
|
|
69
|
+
`1`, `true`, `yes`, or `on`:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
unset STIGMEM_MEMORY_GARDEN_ACL_ENABLED
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The plugin returns to inert state at the next process start. No data migration
|
|
76
|
+
is required; core garden CRUD, membership, scope, tenant, and audit enforcement
|
|
77
|
+
continues to hold.
|
|
78
|
+
|
|
79
|
+
## Test
|
|
80
|
+
|
|
81
|
+
From a Stigmem repository checkout with development dependencies installed:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uv run pytest node/tests/plugins/test_memory_garden_acl_plugin_scaffold.py \
|
|
85
|
+
node/tests/plugins/test_memory_garden_acl_plugin_validation.py
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The package itself ships no separate test tree; upstream plugin validation
|
|
89
|
+
lives in `node/tests/plugins/`.
|
|
90
|
+
|
|
91
|
+
## Uninstall
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip uninstall stigmem-plugin-memory-garden-acl
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Removing the package is sufficient. The gate environment variable becomes moot
|
|
98
|
+
once the entry point is no longer discoverable.
|
|
99
|
+
|
|
100
|
+
## Project Links
|
|
101
|
+
|
|
102
|
+
- Repository: <https://github.com/eidetic-labs/stigmem>
|
|
103
|
+
- Feature record: <https://github.com/eidetic-labs/stigmem/tree/main/features/memory-garden-acl>
|
|
104
|
+
- Plugin source: <https://github.com/eidetic-labs/stigmem/tree/main/experimental/memory-garden-acl>
|
|
105
|
+
- Issue tracker: <https://github.com/eidetic-labs/stigmem/issues>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Stigmem Memory Garden Advanced ACL Plugin
|
|
2
|
+
|
|
3
|
+
Experimental advanced Memory Garden ACL plugin for Stigmem.
|
|
4
|
+
|
|
5
|
+
This package provides the `stigmem-plugin-memory-garden-acl` source package for
|
|
6
|
+
alpha validation. It registers through the `stigmem.plugins` entry point group
|
|
7
|
+
and is loaded by `stigmem-node` only when explicitly installed and configured by
|
|
8
|
+
an operator.
|
|
9
|
+
|
|
10
|
+
## Status
|
|
11
|
+
|
|
12
|
+
Advanced Memory Garden ACL behavior remains experimental. Basic garden CRUD,
|
|
13
|
+
membership, and direct garden fact guards remain core. Installing this package
|
|
14
|
+
does not activate advanced cross-surface ACL behavior unless the plugin is
|
|
15
|
+
registered and the operator enables the relevant gates.
|
|
16
|
+
|
|
17
|
+
The package metadata is publication-shaped for the plugin readiness track, but
|
|
18
|
+
registry publication remains on hold until dry-run evidence and maintainer
|
|
19
|
+
clearance are recorded. See the feature record under
|
|
20
|
+
`features/memory-garden-acl/` for the current status, evidence, and security
|
|
21
|
+
notes.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install --pre stigmem-node==0.9.0a8 stigmem-plugin-memory-garden-acl==0.1.0
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Enable
|
|
30
|
+
|
|
31
|
+
Set the plugin gate environment variable to opt in:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
export STIGMEM_MEMORY_GARDEN_ACL_ENABLED=1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The default install is inert; advanced ACL hook behavior only activates when
|
|
38
|
+
the package is installed, discovered through the `stigmem.plugins` entry point,
|
|
39
|
+
and the operator enables the gate. Enforcement gates such as
|
|
40
|
+
`STIGMEM_MEMORY_GARDEN_ACL_ENFORCE_ASSERT_AUTHORIZE` and
|
|
41
|
+
`STIGMEM_MEMORY_GARDEN_ACL_ENFORCE_RECALL_AUTHORIZE` remain separately opt-in.
|
|
42
|
+
|
|
43
|
+
## Disable
|
|
44
|
+
|
|
45
|
+
Unset the plugin gate environment variable, or set it to any value other than
|
|
46
|
+
`1`, `true`, `yes`, or `on`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
unset STIGMEM_MEMORY_GARDEN_ACL_ENABLED
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The plugin returns to inert state at the next process start. No data migration
|
|
53
|
+
is required; core garden CRUD, membership, scope, tenant, and audit enforcement
|
|
54
|
+
continues to hold.
|
|
55
|
+
|
|
56
|
+
## Test
|
|
57
|
+
|
|
58
|
+
From a Stigmem repository checkout with development dependencies installed:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
uv run pytest node/tests/plugins/test_memory_garden_acl_plugin_scaffold.py \
|
|
62
|
+
node/tests/plugins/test_memory_garden_acl_plugin_validation.py
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The package itself ships no separate test tree; upstream plugin validation
|
|
66
|
+
lives in `node/tests/plugins/`.
|
|
67
|
+
|
|
68
|
+
## Uninstall
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip uninstall stigmem-plugin-memory-garden-acl
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Removing the package is sufficient. The gate environment variable becomes moot
|
|
75
|
+
once the entry point is no longer discoverable.
|
|
76
|
+
|
|
77
|
+
## Project Links
|
|
78
|
+
|
|
79
|
+
- Repository: <https://github.com/eidetic-labs/stigmem>
|
|
80
|
+
- Feature record: <https://github.com/eidetic-labs/stigmem/tree/main/features/memory-garden-acl>
|
|
81
|
+
- Plugin source: <https://github.com/eidetic-labs/stigmem/tree/main/experimental/memory-garden-acl>
|
|
82
|
+
- Issue tracker: <https://github.com/eidetic-labs/stigmem/issues>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Spec-X5-Memory-Garden-Advanced-ACL Status
|
|
2
|
+
|
|
3
|
+
This file is a compatibility pointer for existing
|
|
4
|
+
`experimental/memory-garden-acl/` links.
|
|
5
|
+
|
|
6
|
+
The canonical ADR-020 status record now lives at
|
|
7
|
+
[`features/memory-garden-acl/status.md`](../../features/memory-garden-acl/status.md).
|
|
8
|
+
|
|
9
|
+
Current summary:
|
|
10
|
+
|
|
11
|
+
- Status: `active`
|
|
12
|
+
- Stability: `experimental`
|
|
13
|
+
- Default surface: `opt-in`
|
|
14
|
+
- Implementation path: `experimental/memory-garden-acl/`
|
|
15
|
+
- Package: `stigmem-plugin-memory-garden-acl`
|
|
16
|
+
|
|
17
|
+
The implementation package remains here during transition. Product status,
|
|
18
|
+
gates, history, and release-facing facts belong in the feature record.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "stigmem-plugin-memory-garden-acl"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Experimental Memory Garden advanced ACL plugin for Stigmem."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = { text = "Apache-2.0" }
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Eidetic Labs", email = "oss@eidetic-labs.ai" },
|
|
10
|
+
]
|
|
11
|
+
keywords = ["stigmem", "plugins", "memory-garden", "acl", "authorization"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 3 - Alpha",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: Apache Software License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"pydantic>=2,<3",
|
|
23
|
+
"stigmem-node>=0.9.0a8,<1.0.0",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.entry-points."stigmem.plugins"]
|
|
27
|
+
memory-garden-acl = "stigmem_plugin_memory_garden_acl:plugin_manifest"
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/eidetic-labs/stigmem"
|
|
31
|
+
Documentation = "https://github.com/eidetic-labs/stigmem/tree/main/features/memory-garden-acl"
|
|
32
|
+
Repository = "https://github.com/eidetic-labs/stigmem"
|
|
33
|
+
Issues = "https://github.com/eidetic-labs/stigmem/issues"
|
|
34
|
+
|
|
35
|
+
[build-system]
|
|
36
|
+
requires = ["hatchling"]
|
|
37
|
+
build-backend = "hatchling.build"
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel]
|
|
40
|
+
packages = ["src/stigmem_plugin_memory_garden_acl"]
|
|
41
|
+
|
|
42
|
+
[tool.hatch.build.targets.wheel.sources]
|
|
43
|
+
"src" = ""
|
|
44
|
+
|
|
45
|
+
[tool.hatch.build.targets.sdist]
|
|
46
|
+
include = [
|
|
47
|
+
"README.md",
|
|
48
|
+
"STATUS.md",
|
|
49
|
+
"security.md",
|
|
50
|
+
"spec.md",
|
|
51
|
+
"src/stigmem_plugin_memory_garden_acl/**/*.py",
|
|
52
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
feature: memory-garden-acl
|
|
3
|
+
spec_id: Spec-X5-Memory-Garden-Advanced-ACL
|
|
4
|
+
status: Experimental
|
|
5
|
+
applies_to: stigmem v0.9.0a1
|
|
6
|
+
last_updated: 2026-05-21
|
|
7
|
+
owned_risks: []
|
|
8
|
+
contributed_risks:
|
|
9
|
+
- R-21
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Memory Garden ACL Security
|
|
13
|
+
|
|
14
|
+
This file is a compatibility pointer for existing
|
|
15
|
+
`experimental/memory-garden-acl/` security links.
|
|
16
|
+
|
|
17
|
+
The canonical ADR-020 security record now lives at
|
|
18
|
+
[`features/memory-garden-acl/security.md`](../../features/memory-garden-acl/security.md).
|
|
19
|
+
|
|
20
|
+
Current risk summary:
|
|
21
|
+
|
|
22
|
+
- Owned risks: none.
|
|
23
|
+
- Contributed risks: R-21 agent feedback-loop worm.
|
|
24
|
+
|
|
25
|
+
Product security analysis, operator scenarios, conformance pointers, residual
|
|
26
|
+
risk, and advisory history belong in the feature record.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
spec_id: Spec-X5-Memory-Garden-Advanced-ACL
|
|
3
|
+
version: 0.1.0-alpha.0
|
|
4
|
+
status: Experimental
|
|
5
|
+
applies_to: future experimental plugin line
|
|
6
|
+
last_updated: 2026-05-21
|
|
7
|
+
supersedes: pre-reset section 17 advanced Memory Garden ACL material
|
|
8
|
+
depends_on:
|
|
9
|
+
- Spec-01-Fact-Model >= 0.1.0-alpha.0
|
|
10
|
+
- Spec-02-Scopes-and-ACL >= 0.1.0-alpha.0
|
|
11
|
+
title: Memory Garden Advanced ACL
|
|
12
|
+
sidebar_label: Memory Garden Advanced ACL
|
|
13
|
+
audience: Spec
|
|
14
|
+
description: "Compatibility pointer for advanced Memory Garden ACL semantics."
|
|
15
|
+
stability: experimental
|
|
16
|
+
since: 0.9.0a1
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Spec-X5-Memory-Garden-Advanced-ACL
|
|
20
|
+
|
|
21
|
+
This file is a compatibility pointer for existing
|
|
22
|
+
`experimental/memory-garden-acl/` links and for the generated protocol index.
|
|
23
|
+
|
|
24
|
+
The canonical ADR-020 feature record now lives at
|
|
25
|
+
[`features/memory-garden-acl/`](../../features/memory-garden-acl/). The
|
|
26
|
+
canonical normative spec is
|
|
27
|
+
[`features/memory-garden-acl/spec.md`](../../features/memory-garden-acl/spec.md).
|
|
28
|
+
|
|
29
|
+
The implementation package remains in `experimental/memory-garden-acl/` during
|
|
30
|
+
the transition. The feature record owns product truth; this directory owns the
|
|
31
|
+
current source package until a future packaging move is explicitly planned.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Experimental Memory Garden advanced ACL plugin scaffold."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .config import MemoryGardenAclConfig
|
|
6
|
+
from .manifest import PLUGIN_NAME, plugin_manifest
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"PLUGIN_NAME",
|
|
10
|
+
"MemoryGardenAclConfig",
|
|
11
|
+
"plugin_manifest",
|
|
12
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Configuration schema for the Memory Garden advanced ACL plugin."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from collections.abc import Mapping
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class MemoryGardenAclConfig(BaseModel):
|
|
12
|
+
"""Operator-controlled gates for experimental advanced garden ACL behavior."""
|
|
13
|
+
|
|
14
|
+
enabled: bool = False
|
|
15
|
+
enforce_assert_authorize: bool = False
|
|
16
|
+
enforce_recall_authorize: bool = False
|
|
17
|
+
apply_recall_filter: bool = False
|
|
18
|
+
enable_oidc_permission_ceiling: bool = False
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def load_config_from_env(
|
|
22
|
+
environ: Mapping[str, str] | None = None,
|
|
23
|
+
) -> MemoryGardenAclConfig:
|
|
24
|
+
"""Load advanced garden ACL plugin gates from environment variables."""
|
|
25
|
+
|
|
26
|
+
env = environ if environ is not None else os.environ
|
|
27
|
+
prefix = "STIGMEM_MEMORY_GARDEN_ACL_"
|
|
28
|
+
return MemoryGardenAclConfig(
|
|
29
|
+
enabled=_env_bool(env, f"{prefix}ENABLED"),
|
|
30
|
+
enforce_assert_authorize=_env_bool(env, f"{prefix}ENFORCE_ASSERT_AUTHORIZE"),
|
|
31
|
+
enforce_recall_authorize=_env_bool(env, f"{prefix}ENFORCE_RECALL_AUTHORIZE"),
|
|
32
|
+
apply_recall_filter=_env_bool(env, f"{prefix}APPLY_RECALL_FILTER"),
|
|
33
|
+
enable_oidc_permission_ceiling=_env_bool(
|
|
34
|
+
env,
|
|
35
|
+
f"{prefix}ENABLE_OIDC_PERMISSION_CEILING",
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _env_bool(env: Mapping[str, str], name: str, *, default: bool = False) -> bool:
|
|
41
|
+
raw = env.get(name)
|
|
42
|
+
if raw is None:
|
|
43
|
+
return default
|
|
44
|
+
return raw.strip().lower() in {"1", "true", "yes", "on"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Hook handlers for the Memory Garden advanced ACL plugin scaffold."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, TypeVar
|
|
6
|
+
|
|
7
|
+
from stigmem_node.plugins import Allow, PluginContext, PluginHealth, PluginHealthStatus
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T")
|
|
10
|
+
PLUGIN_NAME = "stigmem-plugin-memory-garden-acl"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def pre_assert_authorize(_ctx: PluginContext, **_: Any) -> Allow:
|
|
14
|
+
"""Stub: scaffold returns Allow().
|
|
15
|
+
|
|
16
|
+
A future implementation is expected to enforce write-side garden membership
|
|
17
|
+
for advanced ACL policy. If this scaffold handler raises, returns ``None``,
|
|
18
|
+
or the plugin fails to load, the core hook path remains fail-open. Core fallback:
|
|
19
|
+
direct ``garden_id`` writes are still governed by the
|
|
20
|
+
``require_garden_write`` guard. Operators relying on advanced write-side
|
|
21
|
+
enforcement must verify the plugin is registered, healthy, and configured
|
|
22
|
+
for their deployment.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
return Allow()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def pre_recall_authorize(_ctx: PluginContext, **_: Any) -> Allow:
|
|
29
|
+
"""Stub: scaffold returns Allow().
|
|
30
|
+
|
|
31
|
+
A future implementation is expected to authorize advanced recall access
|
|
32
|
+
before ranking or traversal. If this scaffold handler raises, returns
|
|
33
|
+
``None``, or the plugin fails to load, the hook path remains fail-open and
|
|
34
|
+
core fallback behavior applies: direct garden reads are guarded, while
|
|
35
|
+
tenant-wide recall authorization is not narrowed by this plugin.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
return Allow()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def recall_filter(_ctx: PluginContext, value: T, **_: Any) -> T:
|
|
42
|
+
"""Stub: scaffold preserves the incoming recall value.
|
|
43
|
+
|
|
44
|
+
A future implementation is expected to remove facts and graph edges the
|
|
45
|
+
caller cannot see through advanced garden membership. If this scaffold
|
|
46
|
+
handler raises, returns ``None``, or the plugin fails to load, filtering
|
|
47
|
+
remains fail-open. Core fallback behavior still protects explicit
|
|
48
|
+
``garden_id`` reads, but tenant-wide queries, recall ranking, subscription
|
|
49
|
+
delivery, and graph traversal are not filtered by advanced ACL policy.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def health_check(_ctx: PluginContext) -> PluginHealth:
|
|
56
|
+
"""Report scaffold health for registry lifecycle tests."""
|
|
57
|
+
|
|
58
|
+
return PluginHealth(
|
|
59
|
+
status=PluginHealthStatus.HEALTHY,
|
|
60
|
+
message="memory garden ACL plugin scaffold registered",
|
|
61
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Plugin manifest factory for Memory Garden advanced ACL."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from stigmem_node.plugins import PluginManifest
|
|
6
|
+
|
|
7
|
+
from . import handlers
|
|
8
|
+
from .config import MemoryGardenAclConfig
|
|
9
|
+
|
|
10
|
+
PLUGIN_NAME = "stigmem-plugin-memory-garden-acl"
|
|
11
|
+
PLUGIN_VERSION = "0.1.0"
|
|
12
|
+
REQUIRES_STIGMEM = ">=0.9.0a3"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def plugin_manifest() -> PluginManifest:
|
|
16
|
+
"""Return the entry-point manifest consumed by ``stigmem.plugins`` discovery."""
|
|
17
|
+
|
|
18
|
+
return PluginManifest(
|
|
19
|
+
name=PLUGIN_NAME,
|
|
20
|
+
version=PLUGIN_VERSION,
|
|
21
|
+
requires_stigmem=REQUIRES_STIGMEM,
|
|
22
|
+
capabilities=frozenset(
|
|
23
|
+
{
|
|
24
|
+
"facts.read",
|
|
25
|
+
"facts.write",
|
|
26
|
+
"recall.read",
|
|
27
|
+
"identity.read",
|
|
28
|
+
"audit.emit",
|
|
29
|
+
"config.read",
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
hooks={
|
|
33
|
+
"pre_assert_authorize": handlers.pre_assert_authorize,
|
|
34
|
+
"pre_recall_authorize": handlers.pre_recall_authorize,
|
|
35
|
+
"recall_filter": handlers.recall_filter,
|
|
36
|
+
},
|
|
37
|
+
routes=(),
|
|
38
|
+
config_schema=MemoryGardenAclConfig,
|
|
39
|
+
health_check=handlers.health_check,
|
|
40
|
+
async_safe=True,
|
|
41
|
+
)
|