Phase 5: autonomous incident workflows#6
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/demo/run-incidentPOST /api/demo/approve-remediationChanged files summary
src/app/api/demo/*— guarded/rate-limited demo trigger + approval APIs.src/modules/workflows/incident-response/*— workflow constants, deterministic plan, start/pause/approval continuation services.src/modules/agents/fallbacks.ts— deterministic public-demo agent response library.src/lib/ai/gateway.ts— AI Gateway generation wrapper with safe fallback.src/modules/events/*— event envelope and Queue publisher.src/workflows/incident-response/queue-consumer.ts— Queue consumer-compatible workflow dispatcher.src/modules/audit/service.ts— idempotent audit log helper.scripts/workflow-smoke.ts+package.json— Phase 5 workflow smoke.tests/autonomous-workflows.test.ts— fallback, idempotency plan, approval gate, and audit continuation coverage.docs/autonomous-workflows.md— demo trigger/approval instructions and operational notes..env.example,src/types/cloudflare.ts— AI-disabled flag typing/example.Verification
npm install✅ — up to date; npm reported 8 moderate audit findings already present in dependency tree.npm run lint✅npm run typecheck✅npm test✅ — 5 files passed, 19 tests passed, 3 skipped.npm run build✅npm run cf:build✅npm run demo:reset✅ — reset Northstar demo successfully.npm run db:check✅ — DB smoke ok with flagship active incident.npm run workflow:smoke✅ —workflow smoke ok=true start=paused-for-approval approval=pending approve=remediated rerun=already-approved audit_seen=7.npm run ai:smoke✅ — fallback mode ok.git diff --check✅Demo trigger / approval smoke instructions
Set
BASE_URLto local/preview URL and ensureDEMO_MODE=true.Expected: HTTP 202,
status: "paused-for-approval", approvalapproval_phase5_buffer_mode_remediationexists, no Phase 5 postmortem yet.Expected: HTTP 202,
status: "remediated", incident timeline/status updated, reportreport_phase5_postmortem_warehouse_latencygenerated, audit rows written.Local DB smoke:
Acceptance checklist
Risks / notes
.open-next/worker.js; this PR includes Queue producer support and a Queue consumer-compatible module, but does not replace the OpenNext worker entrypoint to export a live queue handler. APIs process synchronously after publishing the event for local/preview reliability.DEMO_MODE=true, and rate-limited, but Phase 6 should add stronger auth/governance UI controls.npm installreports 8 moderate audit findings in the existing dependency tree; no new dependency was added.Preview/deploy URL