Enforce bounded operation guardrails
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a028de-e2c8-7732-8521-46a7fc5db82f
This commit is contained in:
parent
c384f60530
commit
26934e25b9
51 changed files with 1843 additions and 472 deletions
|
|
@ -225,6 +225,54 @@ def test_state_hub_progress_prefers_workplan_id(monkeypatch) -> None:
|
|||
assert "workstream_id" not in body
|
||||
|
||||
|
||||
def test_bounded_operation_progress_drops_raw_and_credential_fields(monkeypatch) -> None:
|
||||
posts: list[dict[str, Any]] = []
|
||||
|
||||
monkeypatch.setattr(httpx, "get", lambda *args, **kwargs: DummyResponse([]))
|
||||
|
||||
def fake_post(url: str, **kwargs: Any) -> DummyResponse:
|
||||
posts.append({"url": url, **kwargs})
|
||||
return DummyResponse({"id": "progress-prune-1"})
|
||||
|
||||
monkeypatch.setattr(httpx, "post", fake_post)
|
||||
persist_ops_inventory_evidence(
|
||||
{
|
||||
"activity_id": "weekly-forgejo-package-prune",
|
||||
"run_id": "12345678-aaaa-bbbb-cccc-123456789abc",
|
||||
"context_sources": [
|
||||
{
|
||||
"type": "shell",
|
||||
"query": "forgejo_package_prune",
|
||||
"bind_to": "context.prune",
|
||||
"params": {
|
||||
"evidence_sinks": [
|
||||
{
|
||||
"type": "state-hub-progress",
|
||||
"state_hub_url": "http://state-hub.test",
|
||||
"event_type": "forgejo_package_prune",
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
],
|
||||
"context": {
|
||||
"prune": {
|
||||
"kind": "forgejo_package_prune",
|
||||
"apply": True,
|
||||
"deleted_count": 2,
|
||||
"tool_output": "must not persist",
|
||||
"credential": "must not persist",
|
||||
"provider_response": {"raw": "must not persist"},
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
body = posts[0]["json"]
|
||||
assert body["detail"]["probe"]["deleted_count"] == 2
|
||||
assert "must not persist" not in str(body)
|
||||
|
||||
|
||||
def test_core_hub_stabilization_sink_posts_progress(monkeypatch) -> None:
|
||||
posts: list[dict[str, Any]] = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue