feat(webui): read-only workflow policy and guardrail visibility (Closes #646) #856
Open
jcwalker3
wants to merge 4 commits from
feat/issue-646-policy-guardrail-visibility into master
pull from: feat/issue-646-policy-guardrail-visibility
merge into: :master
:master
:fix/issue-790-slice-a-heartbeat-policy
:feat/issue-651-usage-cost-analytics
:feat/issue-646-policy-guardrail-visibility
:feat/issue-636-inventory-api
:feat/issue-628-autonomous-handoffs-orchestration
:feat/issue-642-sanctioned-restart-controls
:fix/issue-850-native-mcp-bootstrap
:feat/issue-651-web-console-analytics
:feat/issue-639-webui-system-health-dashboard
:feat/issue-658-mcp-restart-coordinator
:fix/issue-860-dirty-orphan-worktree-recovery
:fix/issue-842-conflict-fix-lease-lifecycle
:feat/issue-638-webui-app-shell-phase1
:feat/issue-634-readonly-system-health-api
:feat/issue-822-atomic-install-authority-kernel
:feat/issue-798-worker-registry-schema
:chore/issue-681-preserve-review-session-wip
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#856
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #646
Phase 3 child of the Web Console epic #631. Policy and guardrail configuration currently lives in code, profiles, docs, and skills, so an operator cannot see what is actually in force without reading the repository tree. This adds a read-only projection of the active workflow policy and guardrail configuration to the console.
What this adds
webui/policy_inventory.py(new, 387) — a redacted, machine-readable guardrail inventory. One row per major guardrail (role separation / RBAC, lease rules, worktree binding, merge confirmation, redaction, contamination, allocator policy, audit logging, mutation gating), each carrying source pointers (file / module / doc) plus a compact projection of the active configuration read through the existing safe policy accessors. Each entry is fail-soft: an entry that cannot be built degrades to a status with a reason instead of raising. The whole payload passes throughconsole_redactionbefore it leaves the module, and a documented-default diff is emitted where feasible.webui/policy_views.py(new, 104) — HTML cards rendering each guardrail with its source pointers, active configuration, and the documented-default diff. Read-only page copy; no forms, no toggles.webui/app.py(+16) — additive registration ofGET /policyandGET /api/v1/policy.webui/layout.py(+1) — Policy nav item.tests/test_webui_policy_visibility.py(new, 222) — guardrail presence and source pointers, redaction including planted-secret masking checked withscan_for_secrets, read-only page plus no-mutation route assertions, and fail-soft rendering.docs/webui-local-dev.md(+15) — route table entry and a section stating the read-only nature of the view.Acceptance criteria
build_policy_inventory/GET /policyconsole_redactionat the emit boundarytests/test_webui_policy_visibility.pyplanted-secret casesdocs/webui-local-dev.mdNon-goals honored: no policy editing, no gate-weakening UI toggle, no token values displayed.
Files changed
6 files, 745 insertions, 0 deletions —
webui/policy_inventory.py,webui/policy_views.py,webui/app.py,webui/layout.py,tests/test_webui_policy_visibility.py,docs/webui-local-dev.md.Provenance
The implementation commit
ab33337was authored and published in an earlier author cycle whose owning MCP session then exited before the pull request was opened. This cycle recovered the durable claim through the sanctioned dead-session recovery path ingitea_lock_issue(identityjcwalker3/prgs-author, recovery modepublished_owning_pr, recorded pid 57529 dead, local head, remote head, and recorded head all996e7094feb2e1e9d8fc846354e4e5915fd93d83, head relationequal), then re-ran the full validation matrix in this session before opening this pull request. No file copy and no re-implementation.Validation (this session)
Run from
/Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-646-policy-guardrail-visibilitywith the worktree venv interpreter.venv/bin/python -m pytest tests/test_webui_policy_visibility.py -q— 15 passed, 9 subtests passed.venv/bin/python -m pytest -k webui -q -s— 313 passed, 279 subtests passed.venv/bin/python -m pytest -q -s— 4609 passed, 12 failed, 6 skipped, 693 subtests passed in 574.96s.Baseline comparison: a clean detached worktree at
branches/baseline-master-issue-646, pinned to master188e83c4d69bfb959c91b1f8e766ab8a0656d92d, running the identical command with the identical interpreter reports 4615 passed, 12 failed, 6 skipped, 735 subtests passed. The twelve failing node identifiers were compared withdiffand match exactly: six intests/test_commit_payloads.py, two intests/test_issue_702_review_findings_f1_f6.py, two intests/test_mcp_server.py(TestRuntimeProfile::test_whoami_v2_metadataandTestPreflightVerification::test_declared_clean_task_worktree_ignores_control_checkout_violation), one intests/test_post_merge_moot_lease.py, and one intests/test_reconciler_supersession_close.py. None of them touchwebui/. This branch therefore introduces no new failure.Both worktrees reported a zero-entry
git status --porcelainbefore and after validation, and so did the control checkout.git diff --checkis clean.Risk
Low. Every route added is a GET, the module performs no writes, and redaction runs at the emit boundary rather than per call site. The residual risk is a guardrail projection going out of date with the module it points at; the source pointers are asserted by the test suite so a rename fails the tests rather than silently mispointing.
Known limitations
The documented-default diff is emitted only where a documented default exists in machine-readable form; guardrails documented in prose alone show source pointers plus active configuration without a diff. Policy editing and rollback stay out of scope for a dedicated issue.
Provenance details
feat/issue-646-policy-guardrail-visibility/Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-646-policy-guardrail-visibilityab33337a94dcba319195bb7f72082cc551a7f026996e7094feb2e1e9d8fc846354e4e5915fd93d83188e83c4d69bfb959c91b1f8e766ab8a0656d92dCanonical PR State
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
pr: #856
branch: feat/issue-646-policy-guardrail-visibility
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/feat-issue-646-policy-guardrail-visibility
profile: prgs-author
session_id: unknown
phase: claimed
head_before:
996e7094feexpires_at: 2026-07-24T11:07:39Z
reviewer_active: no
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #856
issue: #646
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 17176-189c5701097a
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr856-policy-visibility
phase: claimed
candidate_head:
ef1ad41678target_branch: master
target_branch_sha: none
last_activity: 2026-07-24T12:17:23Z
expires_at: 2026-07-24T12:27:23Z
blocker: none
Review: PR #856 — policy/guardrail visibility (#646)
Reviewed at head
ef1ad41678196e635755b902d8c5a57d70056e6d(PR body still claims996e7094…; several master-sync merges landed after that).Verdict: REQUEST_CHANGES
Core inventory/module design is solid and focused tests pass (
15 passed, 9 subtests). Scope is right-sized for #646 (GET-only, no edit UI). Incomplete graduation / redaction boundary issues block approval.Blocking
1.
/policywas not graduated out of the Phase 1 stub registrywebui/nav.pystill hasNavItem("/policy", "Policy", "stub")andSTUB_PAGES["/policy"]. Real route is registered first so first-match serves the real page today, but home still labels Policy as (stub) and shell tests treat it as unimplemented. Graduate to live nav, remove fromSTUB_PAGES, add a test. PR body claimedlayout.pychange; nav is the source of truth after #638.2. Docs still contradict the new surface (AC4 incomplete)
docs/webui-local-dev.mdadds live/policyrows but still lists/policyas a Phase 1 stub and calls Policy a placeholder under “Not-yet-implemented surfaces”. New #646 section is good; shell/stub docs need a pass.3. HTML emit path skips
console_redaction(AC2 gap)API path redacts via
snapshot_to_dict✅. HTML path dumps rawentry.activewith onlyhtml.escape❌. Plantedkeychain:…secret appears verbatim in HTML; same snapshot is redacted on JSON. Fix: render from redacted dict or redact before dump; add planted-secret HTML test.Non-blocking
Acceptance criteria
Required before re-review
STUB_PAGES+ test/policyrow; remove stub/placeholder copyCanonical PR State
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.