feat(battle_test): InlinePromptGate Slice 5b — SerpentFlow boot wire-up - #29868
feat(battle_test): InlinePromptGate Slice 5b — SerpentFlow boot wire-up#29868drussell23 wants to merge 3 commits into
Conversation
Activates the Slice 4 phase-boundary renderer in production by wiring attach_phase_boundary_renderer(self.console.print) into SerpentFlow.__init__ immediately after console construction, with unsub called in stop(). The renderer now fires [Phase Boundary] blocks in the operator console for every NOTIFY_APPLY-tier op the session generates — closing the deferred integration gap from Slice 5. 384/384 tests green (test_inline_prompt_gate_* + test_inline_permission_*).
📊 PR Size AnalysisSize: Review Checklist
|
🚨 CI/CD Failure DetectedThe Validate Configuration workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🚨 CI/CD Failure DetectedThe Environment Variable Validation workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🚨 CI/CD Failure DetectedThe Database Connection Validation workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🤖 CI/CD Pipeline ResultsStatus: success Pipeline Stages
|
Summary
SerpentFlowproduction boot, closing the deferred integration gap from Slice 5.__init__call, onestop()unsub.test_inline_prompt_gate_*+test_inline_permission_*).Changes
backend/core/ouroboros/battle_test/serpent_flow.pyattach_phase_boundary_rendereris defensive (NEVER raises): if the controller singleton isn't available yet at boot, it returns a no-op unsub and logs a warning — so this can never blockSerpentFlowconstruction.Test Results
Task 2 — Battle Test Findings (renderer validation)
Environment constraint: The sandbox has no
ANTHROPIC_API_KEYorDOUBLEWORD_API_KEY, soouroboros_battle_test.pyexits at preflight withERROR: No API keys set.A live battle soak withJARVIS_INLINE_PROMPT_GATE_ENABLED=truemust be run interactively.Renderer validated via controlled simulation — a synthetic
NOTIFY_APPLY-tier phase-boundary request was registered against the controller singleton with a 50ms timeout (headless = no operator), then allowed to expire:Operator-visible block format (OUTPUT[0] — pending):
Dismiss line (OUTPUT[1] — auto-expired, headless):
Unexpected errors: None. The
[Phase Boundary]sentinel correctly filters out per-tool-call prompts — the existingConsoleInlineRendererpath was not double-fired in any simulation run.Latency between prompt emission and auto-EXPIRED is determined entirely by
timeout_son theInlinePromptRequest(set by the phase-boundary producer in Slice 2). In headless production runs there is no operator present to/allow, so prompts always expire attimeout_s. The renderer fires the dismiss line synchronously in the controller's_firepath — no additional latency.Test Plan
python3 -m pytest tests/governance/test_inline_prompt_gate_*.py tests/governance/test_inline_permission_*.py— 384/384 greenattach_phase_boundary_renderer/ unsub lifecycle validated end-to-end in simulation[Phase Boundary]block rendered correctly for pending + expired eventsJARVIS_INLINE_PROMPT_GATE_ENABLED=true— requires API keys, must be run locallyhttps://claude.ai/code/session_01Sgackd9hS2XsiN6ziKgrLe
Generated by Claude Code
Summary by cubic
Wire the Slice 4 phase-boundary renderer into
SerpentFlowboot so [Phase Boundary] prompts render in the operator console for NOTIFY_APPLY operations. Adds the renderer import, initializes it withself.console.print, and unsubscribes instop(); the hook is defensive and returns a no-op if the controller isn’t ready.Written for commit 67a2ff3. Summary will update on new commits.