Skip to content

feat: Add incident-copilot kit#183

Open
Tushar2604 wants to merge 2 commits into
Lamatic:mainfrom
Tushar2604:feat/incident-copilot
Open

feat: Add incident-copilot kit#183
Tushar2604 wants to merge 2 commits into
Lamatic:mainfrom
Tushar2604:feat/incident-copilot

Conversation

@Tushar2604

@Tushar2604 Tushar2604 commented Jul 7, 2026

Copy link
Copy Markdown

Incident Copilot — an investigation agent for on-call engineers

Paste a production alert and it does what a good teammate does in the first ten
minutes of an incident: reads the runbooks, checks what shipped recently, and
returns ranked, evidence-grounded root-cause hypotheses — each with the evidence
for and against it and a concrete next step. Feed it new information and it
revises the ranking instead of restarting. When you're ready, it drafts a hedged
Slack update and a blameless postmortem skeleton. It investigates and drafts — it
never acts (no deploys, restarts, or posting).

Companion to llm-eval-harness: that kit gates generation quality, this one helps
you diagnose a live incident.

Why it's an agent, not a chatbot

  1. Grounds every hypothesis in real evidence — runbook excerpts (RAG) + the actual
    recent commits on the affected repo (a live apiNode GitHub call), never a guess.
  2. Argues against itself — the constitution makes "surface contradicting evidence"
    a hard rule, so you get a calibrated ranking, not a confident single answer.
  3. Gets smarter with new information — memory is scoped to the incident ID, so a
    follow-up ("the DB pool is maxed") revises the existing ranking and says what changed.

AgentKit capabilities used (each doing real work)

Capability Where Why it earns its place
RAG Runbook_RAG Grounds hypotheses in your runbooks, not the model's memory
Tool calling Fetch_Commits (apiNode → GitHub) Turns "check recent deploys" into a real check
Memory Retrieve_Prior / Remember, keyed by incident ID Makes re-investigation revise rather than repeat
Structured output Diagnose (InstructorLLMNode + JSON schema) Ranked hypotheses the UI can render, guaranteed shape
Multiple flows investigate + draft-comms Separates "what's true" from "how we communicate it"
Prompts / model-configs / constitution throughout Diagnose at temp 0 (repeatable triage); drafts warmer; constitution enforces evidence + hedging

Flows

Flow Input Output
investigate { alertText, incidentId, repoUrl?, githubToken? } { hypotheses[], summary, insufficientInfo }
draft-comms { hypothesis, evidence, rankedHypotheses, incidentId } { slackUpdate, postmortem }

Verified locally

  • npx tsc --noEmit → clean
  • npm run build → clean (Next 16 / React 19, 3 routes prerendered)
  • All @reference paths resolve; no .env/secrets committed; only this kit folder touched

Try it

  1. Load example — a realistically ambiguous checkout-latency incident (INC-2043).
  2. Investigate — retrieves runbooks, checks changes, returns 2–4 ranked hypotheses with evidence.
  3. Add info & re-investigate — the pre-filled follow-up pushes the DB-pool hypothesis up
    and payment degradation down; each card explains what changed.
  4. Draft Slack + postmortem — hedged status update + blameless postmortem skeleton.

Demo

📹

Notes

  • Drafts, never posts (v1) — the draft-vs-post line is a deliberate safety boundary.
  • Graceful degradation — no repo / private repo without token / rate-limit all resolve to
    "recent-changes unavailable"; the investigation continues on runbooks alone.
  • Bring your own runbooks — swap assets/demo/runbooks.md for your team's, no code changes.

PR Checklist

Contribution type: Kit (kits/incident-copilot/) — flat structure per current CONTRIBUTING.md / CLAUDE.md.

General

  • One project only; no unrelated changes (only kits/incident-copilot/)
  • No secrets or real credentials committed (only .env.example placeholders)
  • Folder name is kebab-case
  • Purpose, setup, and usage documented in README.md

Structure (current flat format)

  • lamatic.config.ts present with valid type, name, author, tags, steps, links
  • agent.md, README.md, constitutions/default.md present
  • flows/investigate.ts and flows/draft-comms.ts present; resources externalized via @references
  • .env.example at kit root and in apps/ with placeholders only
  • apps/package.json builds and runs (npm install && npm run dev)

Validation

  • App builds and typechecks locally
  • PR title starts with feat:
  • GitHub Actions all green — Phase 2 (Studio runtime check) is failing with parse-error:
    the validation endpoint returned a Vercel Security Checkpoint HTML page instead of a JSON
    verdict, so the workflow couldn't parse a status. This looks like endpoint bot-protection
    rather than a kit issue (workflow is marked "Phase 2, testing"). Phase 1 structural validation
    passed — could a maintainer please re-run Phase 2?
  • No unrelated files or projects modified
  • Added a new incident-copilot kit with a Next.js app, Lamatic kit config, README/agent docs, constitution, env templates, and demo assets.
  • Added two flows:
    • investigate: a multi-stage incident triage flow using API Request trigger, runbook RAG, GitHub apiNode commit lookup, code nodes to shape repo evidence, memory retrieve/remember nodes for incident-scoped history, an InstructorLLMNode Diagnose step with structured JSON output, and an API Response node.
    • draft-comms: a parallel communications flow using API Request trigger, two dynamic LLM nodes to draft a Slack update and blameless postmortem skeleton, and an API Response node.
  • Added shared app logic and UI components for orchestration, evidence formatting, hypothesis cards, investigation timeline, and comms rendering, plus global styling and Next.js app boilerplate.
  • Added shared types, Lamatic client initialization, and defensive parsing/formatting helpers to normalize investigation output and present ranked hypotheses consistently.
  • Added model configs, memory configs, and prompt templates for the investigate and draft-comms flows, including deterministic diagnose settings, RAG behavior, and communication guardrails.
  • Added demo runbooks and an example alert payload to support local testing and walkthroughs.
  • No flow.json file was present; the flow structure is defined directly in flows/investigate.ts and flows/draft-comms.ts.

An investigation agent for on-call engineers. Paste a production alert and it
grounds ranked root-cause hypotheses in runbooks (RAG) and recent GitHub activity
(apiNode tool call), surfaces supporting AND contradicting evidence, uses
incident-scoped memory so follow-up information revises the ranking instead of
restarting, and drafts a hedged Slack update plus a blameless postmortem skeleton.

Showcases RAG, tool calling, memory, structured output (InstructorLLMNode),
multiple flows, prompts, model-configs, and a constitution. App typechecks and
builds clean (Next 16 / React 19).
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Incident Copilot is added as a new kit with Lamatic investigate and draft-comms flows, supporting prompts/configs/memory, a Next.js app, setup files, and demo documentation/assets.

Changes

Incident Copilot Kit

Layer / File(s) Summary
Flow definitions and kit config
kits/incident-copilot/flows/investigate.ts, kits/incident-copilot/flows/draft-comms.ts, kits/incident-copilot/lamatic.config.ts
Defines the investigate and draft-comms flow graphs and the kit metadata that binds their deployed flow environment keys.
Prompts, model configs, memory, and constitution
kits/incident-copilot/model-configs/*, kits/incident-copilot/memory/*, kits/incident-copilot/prompts/*, kits/incident-copilot/constitutions/default.md
Adds the model configuration files, memory node configs, prompt templates, and constitution used by the flows.
Shared types, parsing, and orchestration
kits/incident-copilot/apps/lib/types.ts, apps/lib/format.ts, apps/lib/lamatic-client.ts, apps/actions/orchestrate.ts
Defines shared flow types, defensive parsing/formatting helpers, the Lamatic client singleton, and the server actions that execute the flows.
Next.js app UI and styles
kits/incident-copilot/apps/app/layout.tsx, apps/app/page.tsx, apps/app/globals.css, apps/components/*
Adds the root layout, interactive incident page, UI components, and global styling for investigation and communications output.
App setup and environment files
kits/incident-copilot/apps/next.config.mjs, apps/package.json, apps/tsconfig.json, .env.example, .gitignore
Adds the app’s project configuration plus environment and ignore templates for local development.
Documentation and demo assets
kits/incident-copilot/README.md, agent.md, assets/demo/*
Adds the kit README, agent guide, demo alert payload, and demo runbook corpus.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Clear, concise, and directly describes the new incident-copilot kit.
Description check ✅ Passed It covers the required checklist sections and documents purpose, setup, usage, validation, and the remaining Phase 2 issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/incident-copilot

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@kits/incident-copilot/apps/app/globals.css`:
- Around line 1-156: The stylesheet is still fully custom CSS instead of the
required Tailwind/shadcn styling stack. Replace the handcrafted rules in
globals.css with Tailwind v4 base/theme/utilities-driven styles and move
component styling to shadcn/ui patterns used by the app’s React components. Also
update the app setup to include the missing Tailwind/PostCSS dependencies and
ensure the layout imports the global Tailwind stylesheet so the styling system
matches the mandated stack.

In `@kits/incident-copilot/apps/app/page.tsx`:
- Line 152: The error banner in page.tsx is missing live-region semantics, so
screen readers may not announce failures automatically. Update the conditional
error rendering in the page component to include accessible alert behavior, such
as adding an alert role and an appropriate aria-live setting, while keeping the
existing error message display logic in place.
- Around line 183-186: The “Draft Slack + postmortem” action is only disabled by
commsBusy, so it can still run while an investigation is active and the
hypothesis set may change. Update the button in the page component that renders
onDraftComms to also gate on busy, so drafting cannot start during
runInvestigation. Keep the label/disabled behavior consistent with the existing
commsBusy loading state.

In `@kits/incident-copilot/apps/components/hypothesis-card.tsx`:
- Around line 28-35: The Contradicting section in hypothesis-card.tsx renders an
empty <ul> when hypothesisCard’s contradictingEvidence array has no items,
unlike the supportingEvidence block. Update the HypothesisCard rendering so the
contradiction list has the same empty-state fallback as the supporting section,
showing a clear “None cited.” message when h.contradictingEvidence is empty. Use
the existing h.contradictingEvidence map block and match the conditional
rendering pattern already used for supportingEvidence.

In `@kits/incident-copilot/flows/investigate.ts`:
- Around line 97-100: The investigate flow references missing script modules, so
update the flow setup to point `codeNode_parse` and `codeNode_changes` at valid
script locations or add the missing `@scripts/investigate_parse-repo.ts` and
`@scripts/investigate_shape-changes.ts` files. Check the `investigate` flow
wiring and the related code node references so the script paths resolve
correctly at runtime.

In `@kits/incident-copilot/model-configs/draft-comms_postmortem.ts`:
- Around line 4-15: The draft postmortem config comment mentions a low
temperature (~0.3), but the exported object in draft-comms_postmortem.ts does
not include a temperature setting. Update the default export so the
configuration explicitly sets the same temperature value used by the related
diagnose and slack config objects, keeping the field on the model config object
alongside generativeModelName and the other properties.

In `@kits/incident-copilot/model-configs/draft-comms_slack.ts`:
- Around line 4-15: The draft-comms Slack model config is missing the
temperature setting that the comment calls for, and the current fields are still
self-referencing placeholders. Update the exported object in
draft-comms_slack.ts to include a temperature value around 0.5, and replace the
stubbed credentials, memories, messages, and attachments entries with the
intended real configuration values or references used by the other model-config
files.

In `@kits/incident-copilot/model-configs/investigate_diagnose.ts`:
- Around line 4-18: The exported config stub in investigate_diagnose.ts does not
match the header comment: it claims temperature 0, but the object has no
temperature field and every property points back to the same file. Update the
object to either include the intended model configuration fields, including
temperature if it should be set here, or revise the comment to explicitly say
the setting is Studio-only; use the exported default object and the header
comment as the places to align.

In `@kits/incident-copilot/README.md`:
- Around line 24-47: The diagram labels in README are using placeholder
parameters and omit the required rankedHypotheses argument, so update the action
callouts to match the real orchestrator signatures: investigate(alertText,
incidentId, repoUrl) and draftComms(hypothesis, evidence, rankedHypotheses,
incidentId). Make the flow diagram and any nearby labels consistent with the
actual action names and parameter order shown by actions/orchestrate.ts,
especially around investigate and draftComms.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: e9646722-1745-4c4b-8f96-11ee6bf7c94e

📥 Commits

Reviewing files that changed from the base of the PR and between dafde4c and b85bcc7.

⛔ Files ignored due to path filters (1)
  • kits/incident-copilot/apps/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (37)
  • kits/incident-copilot/.env.example
  • kits/incident-copilot/.gitignore
  • kits/incident-copilot/README.md
  • kits/incident-copilot/agent.md
  • kits/incident-copilot/apps/.env.example
  • kits/incident-copilot/apps/.gitignore
  • kits/incident-copilot/apps/actions/orchestrate.ts
  • kits/incident-copilot/apps/app/globals.css
  • kits/incident-copilot/apps/app/layout.tsx
  • kits/incident-copilot/apps/app/page.tsx
  • kits/incident-copilot/apps/components/comms-panel.tsx
  • kits/incident-copilot/apps/components/hypothesis-card.tsx
  • kits/incident-copilot/apps/components/investigation-timeline.tsx
  • kits/incident-copilot/apps/lib/format.ts
  • kits/incident-copilot/apps/lib/lamatic-client.ts
  • kits/incident-copilot/apps/lib/types.ts
  • kits/incident-copilot/apps/next.config.mjs
  • kits/incident-copilot/apps/package.json
  • kits/incident-copilot/apps/tsconfig.json
  • kits/incident-copilot/assets/demo/example-alert.json
  • kits/incident-copilot/assets/demo/runbooks.md
  • kits/incident-copilot/constitutions/default.md
  • kits/incident-copilot/flows/draft-comms.ts
  • kits/incident-copilot/flows/investigate.ts
  • kits/incident-copilot/lamatic.config.ts
  • kits/incident-copilot/memory/investigate_memory-add.ts
  • kits/incident-copilot/memory/investigate_memory-retrieve.ts
  • kits/incident-copilot/model-configs/draft-comms_postmortem.ts
  • kits/incident-copilot/model-configs/draft-comms_slack.ts
  • kits/incident-copilot/model-configs/investigate_diagnose.ts
  • kits/incident-copilot/model-configs/investigate_rag.ts
  • kits/incident-copilot/prompts/draft-comms_postmortem_system.md
  • kits/incident-copilot/prompts/draft-comms_slack_system.md
  • kits/incident-copilot/prompts/draft-comms_user.md
  • kits/incident-copilot/prompts/investigate_diagnose_system.md
  • kits/incident-copilot/prompts/investigate_diagnose_user.md
  • kits/incident-copilot/prompts/investigate_rag_system.md

Comment on lines +1 to +156
:root {
--bg: #0b0f17;
--panel: #131a26;
--panel-2: #0f1520;
--border: #232d3f;
--text: #e6edf6;
--muted: #8b98ac;
--accent: #4f8cff;
--high: #ff5c5c;
--medium: #ffb23e;
--low: #6aa1ff;
--good: #35c98b;
--radius: 12px;
}

* { box-sizing: border-box; }

html, body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--text);
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.55;
}

a { color: var(--accent); }

.container {
max-width: 920px;
margin: 0 auto;
padding: 32px 20px 96px;
}

.header h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.02em; }
.header p { margin: 0; color: var(--muted); }

.panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 18px;
margin-top: 18px;
}

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }

textarea, input[type="text"] {
width: 100%;
background: var(--panel-2);
border: 1px solid var(--border);
color: var(--text);
border-radius: 8px;
padding: 10px 12px;
font-size: 14px;
font-family: inherit;
resize: vertical;
}
textarea:focus, input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }

.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

button {
background: var(--accent);
color: white;
border: none;
border-radius: 8px;
padding: 10px 16px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
}
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
border: 1px solid var(--high);
background: rgba(255, 92, 92, 0.08);
color: #ffd6d6;
padding: 12px 14px;
border-radius: 8px;
margin-top: 16px;
font-size: 14px;
}

/* Timeline */
.timeline { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.step {
display: flex; align-items: center; gap: 8px;
font-size: 13px; color: var(--muted);
border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
}
.step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.step.active .dot { background: var(--accent); animation: pulse 1s infinite; }
.step.done .dot { background: var(--good); }
.step.done { color: var(--text); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Hypotheses */
.summary { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.hyp {
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px;
margin-top: 14px;
background: var(--panel-2);
}
.hyp.top { border-color: var(--accent); }
.hyp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hyp-title { margin: 0; font-size: 16px; }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; }

.badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-high { background: rgba(255, 92, 92, 0.15); color: var(--high); }
.badge-medium { background: rgba(255, 178, 62, 0.15); color: var(--medium); }
.badge-low { background: rgba(106, 161, 255, 0.15); color: var(--low); }

.reasoning { margin: 10px 0; font-size: 14px; }
.evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.evidence h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.evidence ul { margin: 0; padding-left: 18px; font-size: 13px; }
.evidence .support li::marker { color: var(--good); }
.evidence .against li::marker { color: var(--high); }
.nextstep { margin-top: 12px; font-size: 13px; color: var(--text); }
.nextstep b { color: var(--accent); }

@media (max-width: 640px) { .evidence { grid-template-columns: 1fr; } }

/* Comms */
.comms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .comms { grid-template-columns: 1fr; } }
.comms h3 { margin: 0 0 8px; font-size: 15px; }
pre.draft {
white-space: pre-wrap;
word-break: break-word;
background: var(--panel-2);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
font-size: 13px;
font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
margin: 0;
max-height: 420px;
overflow: auto;
}

.callout {
border-left: 3px solid var(--medium);
background: rgba(255, 178, 62, 0.06);
padding: 8px 12px; margin-top: 10px; border-radius: 6px;
font-size: 13px; color: var(--muted);
}
.muted { color: var(--muted); font-size: 13px; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Your CSS has gone rogue, agent — no Tailwind in sight.

This entire stylesheet is hand-rolled vanilla CSS; there's no Tailwind utility usage, config, or shadcn/ui styling anywhere. As per coding guidelines, kits/*/apps/**/*.{ts,tsx,js,jsx}: "use Next.js 14-15, React 18, TypeScript, Tailwind CSS v4+, shadcn/ui components, react-hook-form + zod for forms, lucide-react for icons, and Vercel for deployment." This file (and the corresponding missing tailwindcss/postcss deps in package.json) confirms the app diverges from the mandated styling stack.

🧰 Tools
🪛 Stylelint (17.14.0)

[error] 1-1: Unknown rule scss/at-rule-no-unknown. Did you mean at-rule-no-unknown?

(scss/at-rule-no-unknown)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/incident-copilot/apps/app/globals.css` around lines 1 - 156, The
stylesheet is still fully custom CSS instead of the required Tailwind/shadcn
styling stack. Replace the handcrafted rules in globals.css with Tailwind v4
base/theme/utilities-driven styles and move component styling to shadcn/ui
patterns used by the app’s React components. Also update the app setup to
include the missing Tailwind/PostCSS dependencies and ensure the layout imports
the global Tailwind stylesheet so the styling system matches the mandated stack.

Source: Coding guidelines

Comment thread kits/incident-copilot/apps/app/page.tsx Outdated
Comment thread kits/incident-copilot/apps/app/page.tsx Outdated
Comment on lines +28 to +35
<div className="against">
<h4>Contradicting</h4>
<ul>
{h.contradictingEvidence.map((e, i) => (
<li key={i}>{e}</li>
))}
</ul>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Agent, the "Contradicting" section has gone dark — no empty-state fallback.

Unlike supportingEvidence (line 21-25), contradictingEvidence has no "None cited." fallback, so an empty array renders a bare, confusing <ul>.

🎯 Proposed fix
         <div className="against">
           <h4>Contradicting</h4>
           <ul>
-            {h.contradictingEvidence.map((e, i) => (
-              <li key={i}>{e}</li>
-            ))}
+            {h.contradictingEvidence.length > 0 ? (
+              h.contradictingEvidence.map((e, i) => <li key={i}>{e}</li>)
+            ) : (
+              <li className="muted">None cited.</li>
+            )}
           </ul>
         </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="against">
<h4>Contradicting</h4>
<ul>
{h.contradictingEvidence.map((e, i) => (
<li key={i}>{e}</li>
))}
</ul>
</div>
<div className="against">
<h4>Contradicting</h4>
<ul>
{h.contradictingEvidence.length > 0 ? (
h.contradictingEvidence.map((e, i) => <li key={i}>{e}</li>)
) : (
<li className="muted">None cited.</li>
)}
</ul>
</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/incident-copilot/apps/components/hypothesis-card.tsx` around lines 28 -
35, The Contradicting section in hypothesis-card.tsx renders an empty <ul> when
hypothesisCard’s contradictingEvidence array has no items, unlike the
supportingEvidence block. Update the HypothesisCard rendering so the
contradiction list has the same empty-state fallback as the supporting section,
showing a clear “None cited.” message when h.contradictingEvidence is empty. Use
the existing h.contradictingEvidence map block and match the conditional
rendering pattern already used for supportingEvidence.

Comment on lines +97 to +100
"scripts": {
"investigate_parse_repo": "@scripts/investigate_parse-repo.ts",
"investigate_shape_changes": "@scripts/investigate_shape-changes.ts"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd . kits/incident-copilot -t d
fd 'investigate_parse-repo|investigate_shape-changes' kits/incident-copilot

Repository: Lamatic/AgentKit

Length of output: 550


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the kit tree and inspect the investigate flow plus any script-like references.
printf '\n== file tree ==\n'
fd . kits/incident-copilot -t d | sort
printf '\n== files of interest ==\n'
fd . kits/incident-copilot -t f | sort | sed -n '1,200p'

printf '\n== investigate flow outline ==\n'
ast-grep outline kits/incident-copilot/flows/investigate.ts --view expanded || true

printf '\n== investigate flow references ==\n'
rg -n '`@scripts/`|investigate_parse-repo|investigate_shape-changes|codeNode_parse|codeNode_changes' kits/incident-copilot/flows/investigate.ts

Repository: Lamatic/AgentKit

Length of output: 3478


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== scripts directories anywhere in repo ==\n'
fd . -t d | rg '(^|/)scripts$|^kits/.+/scripts/$' || true

printf '\n== kit config and aliases ==\n'
cat -n kits/incident-copilot/lamatic.config.ts | sed -n '1,260p'

printf '\n== package/project references to `@scripts` ==\n'
rg -n '`@scripts/`' -g '!**/node_modules/**' -g '!**/dist/**' -g '!**/build/**' .

printf '\n== investigate flow surrounding references ==\n'
sed -n '88,205p' kits/incident-copilot/flows/investigate.ts

Repository: Lamatic/AgentKit

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== docs on `@scripts` convention ==\n'
sed -n '130,190p' CLAUDE.md
printf '\n== more docs on `@scripts` convention ==\n'
sed -n '110,145p' CONTRIBUTING.md

printf '\n== incident-copilot README mentions ==\n'
rg -n 'scripts/|`@scripts/`|code node|Lamatic|deploy' kits/incident-copilot/README.md kits/incident-copilot/agent.md kits/incident-copilot/flows/investigate.ts

Repository: Lamatic/AgentKit

Length of output: 7515


Add the missing @scripts files for the investigate flow
kits/incident-copilot/flows/investigate.ts:98-99,160,192 points codeNode_parse and codeNode_changes at @scripts/investigate_parse-repo.ts and @scripts/investigate_shape-changes.ts, but there’s no scripts/ directory or matching files in this repo. Those code nodes won’t resolve until the scripts are added or the references are corrected.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/incident-copilot/flows/investigate.ts` around lines 97 - 100, The
investigate flow references missing script modules, so update the flow setup to
point `codeNode_parse` and `codeNode_changes` at valid script locations or add
the missing `@scripts/investigate_parse-repo.ts` and
`@scripts/investigate_shape-changes.ts` files. Check the `investigate` flow
wiring and the related code node references so the script paths resolve
correctly at runtime.

Comment on lines +4 to +15
// Capable chat model at a low temperature (~0.3). The postmortem is a structured
// skeleton templated tightly off the investigation evidence, so it favours
// faithful, well-organised output over creative prose. Credentials blanked for
// sharing; set your own in Lamatic Studio.

export default {
"generativeModelName": "@model-configs/draft-comms_postmortem.ts",
"credentials": "@model-configs/draft-comms_postmortem.ts",
"memories": "@model-configs/draft-comms_postmortem.ts",
"messages": "@model-configs/draft-comms_postmortem.ts",
"attachments": "@model-configs/draft-comms_postmortem.ts"
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Third time's the pattern: postmortem's "~0.3" temperature has no field to back it up.

Consistent with the diagnose and slack configs — the comment sets an expectation the object doesn't fulfill.

🕵️ Suggested clarification
 export default {
   "generativeModelName": "`@model-configs/draft-comms_postmortem.ts`",
   "credentials": "`@model-configs/draft-comms_postmortem.ts`",
+  "temperature": "`@model-configs/draft-comms_postmortem.ts`",
   "memories": "`@model-configs/draft-comms_postmortem.ts`",
   "messages": "`@model-configs/draft-comms_postmortem.ts`",
   "attachments": "`@model-configs/draft-comms_postmortem.ts`"
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Capable chat model at a low temperature (~0.3). The postmortem is a structured
// skeleton templated tightly off the investigation evidence, so it favours
// faithful, well-organised output over creative prose. Credentials blanked for
// sharing; set your own in Lamatic Studio.
export default {
"generativeModelName": "@model-configs/draft-comms_postmortem.ts",
"credentials": "@model-configs/draft-comms_postmortem.ts",
"memories": "@model-configs/draft-comms_postmortem.ts",
"messages": "@model-configs/draft-comms_postmortem.ts",
"attachments": "@model-configs/draft-comms_postmortem.ts"
};
// Capable chat model at a low temperature (~0.3). The postmortem is a structured
// skeleton templated tightly off the investigation evidence, so it favours
// faithful, well-organised output over creative prose. Credentials blanked for
// sharing; set your own in Lamatic Studio.
export default {
"generativeModelName": "`@model-configs/draft-comms_postmortem.ts`",
"credentials": "`@model-configs/draft-comms_postmortem.ts`",
"temperature": "`@model-configs/draft-comms_postmortem.ts`",
"memories": "`@model-configs/draft-comms_postmortem.ts`",
"messages": "`@model-configs/draft-comms_postmortem.ts`",
"attachments": "`@model-configs/draft-comms_postmortem.ts`"
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/incident-copilot/model-configs/draft-comms_postmortem.ts` around lines 4
- 15, The draft postmortem config comment mentions a low temperature (~0.3), but
the exported object in draft-comms_postmortem.ts does not include a temperature
setting. Update the default export so the configuration explicitly sets the same
temperature value used by the related diagnose and slack config objects, keeping
the field on the model config object alongside generativeModelName and the other
properties.

Comment on lines +4 to +15
// A capable chat model at a moderate temperature (~0.5) for natural, readable
// status-update prose. Higher than the diagnose node (which is 0) because this is
// writing, not ranking — but not so high that it starts embellishing beyond the
// evidence. Credentials blanked for sharing; set your own in Lamatic Studio.

export default {
"generativeModelName": "@model-configs/draft-comms_slack.ts",
"credentials": "@model-configs/draft-comms_slack.ts",
"memories": "@model-configs/draft-comms_slack.ts",
"messages": "@model-configs/draft-comms_slack.ts",
"attachments": "@model-configs/draft-comms_slack.ts"
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Same briefing gap as the Diagnose config: temperature is described but not encoded.

The comment specifies "~0.5" for natural prose, yet the object exposes no temperature key — just self-referencing stubs.

🕵️ Suggested clarification
 export default {
   "generativeModelName": "`@model-configs/draft-comms_slack.ts`",
   "credentials": "`@model-configs/draft-comms_slack.ts`",
+  "temperature": "`@model-configs/draft-comms_slack.ts`",
   "memories": "`@model-configs/draft-comms_slack.ts`",
   "messages": "`@model-configs/draft-comms_slack.ts`",
   "attachments": "`@model-configs/draft-comms_slack.ts`"
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/incident-copilot/model-configs/draft-comms_slack.ts` around lines 4 -
15, The draft-comms Slack model config is missing the temperature setting that
the comment calls for, and the current fields are still self-referencing
placeholders. Update the exported object in draft-comms_slack.ts to include a
temperature value around 0.5, and replace the stubbed credentials, memories,
messages, and attachments entries with the intended real configuration values or
references used by the other model-config files.

Comment thread kits/incident-copilot/model-configs/investigate_diagnose.ts
Comment thread kits/incident-copilot/README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
kits/incident-copilot/model-configs/investigate_diagnose.ts (1)

15-21: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Undercover fields that never get called into action.

Cross-referencing the investigate flow, InstructorLLMNode_diagnose only wires generativeModelName to @model-configs/investigate_diagnose.ts; its memories, messages, attachments, and credentials are hardcoded literals ("[]", "") rather than referencing this config. Compare this with draft-comms_slack.ts/draft-comms_postmortem.ts, where all five keys are genuinely wired by their consuming nodes. Here, four of the five exported keys are decoys — dead weight that contradicts the file's own "shareable convention" framing and could mislead whoever edits this file expecting those settings to take effect.

Either drop the unused keys to match what the node actually consumes, or (if the intent is to eventually wire them) note that explicitly in the header comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@kits/incident-copilot/model-configs/investigate_diagnose.ts` around lines 15
- 21, The exported config in investigate_diagnose.ts includes several fields
that are never consumed by the investigate flow, so the file misrepresents what
actually takes effect. Update the model config export to only include the
settings used by InstructorLLMNode_diagnose, or align the consumer to reference
the exported keys consistently like the draft-comms_* configs; if these fields
are intentionally placeholders, add that clarification in the header comment so
the dead entries in the export are not misleading.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@kits/incident-copilot/model-configs/investigate_diagnose.ts`:
- Around line 15-21: The exported config in investigate_diagnose.ts includes
several fields that are never consumed by the investigate flow, so the file
misrepresents what actually takes effect. Update the model config export to only
include the settings used by InstructorLLMNode_diagnose, or align the consumer
to reference the exported keys consistently like the draft-comms_* configs; if
these fields are intentionally placeholders, add that clarification in the
header comment so the dead entries in the export are not misleading.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9eef5282-74dd-446a-9495-21c1d2871b50

📥 Commits

Reviewing files that changed from the base of the PR and between b85bcc7 and c19f77c.

📒 Files selected for processing (5)
  • kits/incident-copilot/README.md
  • kits/incident-copilot/apps/app/page.tsx
  • kits/incident-copilot/model-configs/draft-comms_postmortem.ts
  • kits/incident-copilot/model-configs/draft-comms_slack.ts
  • kits/incident-copilot/model-configs/investigate_diagnose.ts

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Hi @Tushar2604! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant