chore: archive source ref plans
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
## Preconditions
|
## Preconditions
|
||||||
|
|
||||||
- Complete `docs/superpowers/plans/2026-06-13-platform-source-policy.md` first.
|
- Complete `docs/historical/superpowers/plans/2026-06-13-platform-source-policy.md` first.
|
||||||
- `CapabilitySource(policy=SourcePolicy(platform=True, binding_required=False))` must exist.
|
- `CapabilitySource(policy=SourcePolicy(platform=True, binding_required=False))` must exist.
|
||||||
- `wf.std` deployments should validate/run without `wf.std=wf.std` self-bindings.
|
- `wf.std` deployments should validate/run without `wf.std=wf.std` self-bindings.
|
||||||
|
|
||||||
@@ -41,6 +41,11 @@ class SourcePolicy:
|
|||||||
platform: bool = False
|
platform: bool = False
|
||||||
binding_required: bool = True
|
binding_required: bool = True
|
||||||
|
|
||||||
|
def __post_init__(self) -> None:
|
||||||
|
"""Reject contradictory deployment policy combinations."""
|
||||||
|
if self.platform and self.binding_required:
|
||||||
|
raise ValueError("platform sources cannot require bindings")
|
||||||
|
|
||||||
|
|
||||||
class SourceVisibilitySnapshot(BaseModel):
|
class SourceVisibilitySnapshot(BaseModel):
|
||||||
"""Serializable visibility flags for one source inventory snapshot."""
|
"""Serializable visibility flags for one source inventory snapshot."""
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from wf_platform import (
|
from wf_platform import (
|
||||||
CapabilityBuckets,
|
CapabilityBuckets,
|
||||||
CapabilitySource,
|
CapabilitySource,
|
||||||
@@ -118,3 +120,8 @@ def test_capability_source_exposes_policy_snapshot() -> None:
|
|||||||
"platform": True,
|
"platform": True,
|
||||||
"binding_required": False,
|
"binding_required": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_platform_source_policy_rejects_required_bindings() -> None:
|
||||||
|
with pytest.raises(ValueError, match="platform sources cannot require bindings"):
|
||||||
|
SourcePolicy(platform=True, binding_required=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user