feat(posture): add deterministic feedback proposals
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a02929-244b-7391-b933-c04010e8eedb
This commit is contained in:
tegwick 2026-08-23 13:16:34 +02:00
parent dc8da422f8
commit cfc9e7d0cb
19 changed files with 1428 additions and 16 deletions

View file

@ -67,6 +67,7 @@ def validate_semantics(document: dict[str, Any], path: pathlib.Path) -> list[str
reason = posture.get("reason", {})
gap = posture.get("gap", {})
evidence = entry.get("evidence", {})
evidence_freshness = entry.get("evidence_freshness", {})
reviewed = dt.date.fromisoformat(posture["reviewed"])
review_due = dt.date.fromisoformat(posture["review_due"])
@ -92,6 +93,22 @@ def validate_semantics(document: dict[str, Any], path: pathlib.Path) -> list[str
f"{name}: implemented {axis}{level} must be above current {axis}{current_level}"
)
for key, freshness in evidence_freshness.items():
if key not in evidence:
errors.append(f"{name}: evidence_freshness {key} has no evidence entry")
observed_at = dt.datetime.fromisoformat(
freshness["observed_at"].replace("Z", "+00:00")
)
valid_until_raw = freshness.get("valid_until")
if valid_until_raw:
valid_until = dt.datetime.fromisoformat(
valid_until_raw.replace("Z", "+00:00")
)
if valid_until <= observed_at:
errors.append(
f"{name}: evidence_freshness {key} valid_until must be after observed_at"
)
provider = entry.get("provider", {})
for axis, reach in provider.get("axes", {}).items():
available = reach["available"]