feat(sofiia-console): add artifacts list endpoint + team onboarding doc

- runbook_artifacts.py: adds list_run_artifacts() returning files with
  names, paths, sizes, mtime_utc from release_artifacts/<run_id>/
- runbook_runs_router.py: adds GET /api/runbooks/runs/{run_id}/artifacts
- docs/runbook/team-onboarding-console.md: one-page team onboarding doc
  covering access, rehearsal run steps, audit auth model (strict, no
  localhost bypass), artifacts location, abort procedure

Made-with: Cursor
This commit is contained in:
Apple
2026-03-03 06:55:49 -08:00
parent e0bea910b9
commit 2962d33a3b
3 changed files with 221 additions and 0 deletions

View File

@@ -361,6 +361,31 @@ async def render_release_evidence(run_id: str) -> Dict[str, Any]:
}
async def list_run_artifacts(run_id: str) -> Dict[str, Any]:
"""
List files in release_artifacts/<run_id>/ with sizes and mtimes.
Returns {run_id, dir, files: [{name, path, bytes, mtime_utc}]}.
"""
out_dir = _artifacts_dir(run_id)
files = []
if out_dir.exists():
for f in sorted(out_dir.iterdir()):
if f.is_file():
stat = f.stat()
files.append({
"name": f.name,
"path": str(f),
"bytes": stat.st_size,
"mtime_utc": _iso_utc(stat.st_mtime),
})
return {
"run_id": run_id,
"dir": str(out_dir),
"exists": out_dir.exists(),
"files": files,
}
async def render_post_review(run_id: str) -> Dict[str, Any]:
"""
Generate post-release review markdown from run DB data.

View File

@@ -82,6 +82,15 @@ async def complete_step(
return {"ok": True, "run_id": run_id, "step_index": step_index, "next_step": step_index + 1}
@runbook_runs_router.get("/{run_id}/artifacts")
async def list_artifacts(
run_id: str,
_auth: str = Depends(require_auth),
):
"""List generated artifacts for a run (paths, sizes, mtimes)."""
return await artifacts.list_run_artifacts(run_id)
@runbook_runs_router.post("/{run_id}/evidence")
async def generate_evidence(
run_id: str,