chore: archive source ref plans

This commit is contained in:
lda
2026-06-13 23:07:31 +07:00 Verified
parent 4983033b7b
commit a1fcba6d4f
4 changed files with 13 additions and 1 deletions
@@ -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.
+5
View File
@@ -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."""
+7
View File
@@ -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)