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
|
|
@ -15,6 +15,7 @@ from urllib.parse import quote
|
|||
from sqlalchemy import Select, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from activity_core.audit_projection import bounded_audit_projection
|
||||
from activity_core.glas_evidence import normalise_ops_result
|
||||
from activity_core.orm import ActivityRun, OpsRun, TaskSpawnLog
|
||||
|
||||
|
|
@ -37,6 +38,14 @@ def forgejo_org() -> str:
|
|||
)
|
||||
|
||||
|
||||
def public_context_keys(context_snapshot: Any) -> list[str]:
|
||||
"""Return safe top-level context names for the public run projection."""
|
||||
projected = bounded_audit_projection(context_snapshot or {})
|
||||
if not isinstance(projected, dict):
|
||||
return []
|
||||
return sorted(projected.keys())[:40]
|
||||
|
||||
|
||||
def build_forgejo_blob_url(
|
||||
*,
|
||||
target_repo: str | None,
|
||||
|
|
@ -310,7 +319,7 @@ async def enrich_activity_runs(
|
|||
"artifacts": artifacts[:12],
|
||||
"evidence": {
|
||||
"task_spawns": spawns[:20],
|
||||
"context_keys": sorted((r.context_snapshot or {}).keys())[:40],
|
||||
"context_keys": public_context_keys(r.context_snapshot),
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue