Skip to content

feat: added compliance copilot kit#257

Open
vk2git wants to merge 4 commits into
Lamatic:mainfrom
vk2git:main
Open

feat: added compliance copilot kit#257
vk2git wants to merge 4 commits into
Lamatic:mainfrom
vk2git:main

Conversation

@vk2git

@vk2git vk2git commented Jul 16, 2026

Copy link
Copy Markdown

PR Checklist

1. Select Contribution Type

  • Kit (kits/<category>/<kit-name>/)
  • Bundle (bundles/<bundle-name>/)
  • Template (templates/<template-name>/)

2. General Requirements

  • PR is for one project only (no unrelated changes)
  • No secrets, API keys, or real credentials are committed
  • Folder name uses kebab-case and matches the flow ID
  • All changes are documented in README.md (purpose, setup, usage)

3. File Structure (Check what applies)

  • config.json present with valid metadata (name, description, tags, steps, author, env keys)
  • All flows in flows/<flow-name>/ (where applicable) include:
    • config.json (Lamatic flow export)
    • inputs.json
    • meta.json
    • README.md
  • .env.example with placeholder values only (kits only)
  • No hand‑edited flow config.json node graphs (changes via Lamatic Studio export)

4. Validation

  • npm install && npm run dev works locally (kits: UI runs; bundles/templates: flows are valid)
  • PR title is clear (e.g., [kit] Add <name> for <use case>)
  • GitHub Actions workflows pass (all checks are green)
  • All CodeRabbit or other PR review comments are addressed and resolved
  • No unrelated files or projects are modified
  • Added the Compliance Copilot kit under kits/compliance-copilot/, including:
    • README.md + agent.md with setup/run instructions, required env vars (LAMATIC_API_URL, LAMATIC_PROJECT_ID, LAMATIC_API_KEY, COMPLIANCE_AUDIT), and integration notes.
    • lamatic.config.ts with kit metadata and a mandatory compliance-audit step.
    • constitutions/default.md defining baseline safety/data-handling/tone rules.
    • prompts/ (compliance-audit_instructor-llmnode-286_system_0.md, ..._user_1.md) to audit an input document against provided guidelines and return JSON-only output.
    • model-configs/ (compliance-audit_instructor-llmnode-286_generative-model-name.ts) with placeholder model/provider/credential configuration.
    • flows/compliance-audit.ts defining the compliance audit flow:
      • Node types & wiring:
        • triggerNode (triggerNode_1) configured as graphqlNode accepting documentText: string and guidelines: string.
        • dynamicNode (InstructorLLMNode_286) running an InstructorLLMNode with:
          • instructor prompt pair (system + user),
          • JSON schema for { requirement, status, analysis, remediation },
          • generative model config reference.
        • responseNode (responseNode_triggerNode_1) with outputMapping wiring {{InstructorLLMNode_286.output}} into the flow response.
        • Edges connect: triggerNode_1 -> InstructorLLMNode_286 (defaultEdge), InstructorLLMNode_286 -> responseNode_triggerNode_1 (defaultEdge), plus the responseEdge from triggerNode_1 to the response node.
      • Flow behavior: produces compliance findings (requirement + Compliant/Partial/Non-Compliant status + analysis + remediation) from the provided document and guidelines.
    • Environment template + housekeeping:
      • kits/compliance-copilot/.env.example and apps/.env.example with placeholder values for endpoint/project key and the COMPLIANCE_AUDIT flow id.
      • kits/compliance-copilot/.gitignore to ignore common build artifacts, env files, and dependency outputs.
  • Added a new Next.js web app under kits/compliance-copilot/apps/:
    • Tooling/config: package.json, tsconfig.json, next.config.ts, eslint.config.mjs, postcss.config.mjs, src/app/globals.css.
    • App UI: src/app/layout.tsx (metadata + root layout) and src/app/page.tsx (“Compliance Copilot” page) to:
      • load an example policy/guidelines,
      • call the server action to run the COMPLIANCE_AUDIT flow,
      • normalize the returned payload (unwrap/marshal JSON, drop _meta, ensure findings are an array) and render findings + remediation (or show raw JSON on unexpected shapes).
    • Lamatic integration:
      • src/lib/lamatic-client.ts exporting a configured Lamatic client from env vars.
      • src/actions/orchestrate.ts adding checkCompliance(documentText, guidelines) which validates COMPLIANCE_AUDIT, executes the flow, and returns { success, data | error }.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@vk2git, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 49e8e9a4-95cd-429f-8324-a7cf8b9f1b7f

📥 Commits

Reviewing files that changed from the base of the PR and between 330668d and 6dfdd72.

📒 Files selected for processing (7)
  • kits/compliance-copilot/README.md
  • kits/compliance-copilot/apps/src/actions/orchestrate.ts
  • kits/compliance-copilot/apps/src/app/globals.css
  • kits/compliance-copilot/apps/src/app/layout.tsx
  • kits/compliance-copilot/apps/src/app/page.tsx
  • kits/compliance-copilot/apps/src/lib/lamatic-client.ts
  • kits/compliance-copilot/flows/compliance-audit.ts

Walkthrough

Changes

The Compliance Copilot kit adds a Lamatic compliance-audit flow with structured JSON output, supporting prompts and model configuration, and a Next.js interface for submitting documents and guidelines and displaying audit findings.

Compliance Copilot

Layer / File(s) Summary
Audit flow and model contract
kits/compliance-copilot/flows/..., kits/compliance-copilot/prompts/..., kits/compliance-copilot/model-configs/..., kits/compliance-copilot/constitutions/..., kits/compliance-copilot/lamatic.config.ts
Defines audit inputs, prompt references, model configuration, output schema, response mapping, graph edges, and kit metadata.
Application foundation
kits/compliance-copilot/apps/package.json, kits/compliance-copilot/apps/*.json, kits/compliance-copilot/apps/*config.*, kits/compliance-copilot/apps/src/app/..., kits/compliance-copilot/.env.example, kits/compliance-copilot/apps/.env.example, kits/compliance-copilot/.gitignore
Adds Next.js configuration, build tooling, TypeScript settings, global styles, root layout, environment templates, and ignore rules.
Server-side Lamatic execution
kits/compliance-copilot/apps/src/lib/lamatic-client.ts, kits/compliance-copilot/apps/src/actions/orchestrate.ts
Creates the Lamatic client and exposes checkCompliance, which executes the configured flow and returns success or failure data.
Audit submission and results UI
kits/compliance-copilot/apps/src/app/page.tsx
Adds document and guideline inputs, example loading, validation, loading and error states, response normalization, and audit result rendering.
Kit setup and operation documentation
kits/compliance-copilot/README.md, kits/compliance-copilot/agent.md
Documents deployment, environment configuration, application startup, flow behavior, guardrails, and troubleshooting.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and clearly describes the main change: adding the Compliance Copilot kit.
Description check ✅ Passed The description follows the required checklist template and covers the major sections, with only a few non-critical items left unchecked.
✨ 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 16, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Kit: kits/compliance-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.

@github-actions

Copy link
Copy Markdown
Contributor

Failure recorded at 2026-07-16T10:21:11Z UTC. If this PR is not fixed within 4 weeks it will be automatically closed.

@coderabbitai
coderabbitai Bot requested a review from d-pamneja July 16, 2026 10:21

@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: 5

🤖 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/compliance-copilot/apps/src/app/globals.css`:
- Around line 8-26: Update the `@theme` inline typography variables to reference
the Inter font CSS variables provided by the Next.js layout instead of the
unavailable Geist variables, and remove the hardcoded Arial/Helvetica
font-family from body so typography consistently uses the deployed Inter
configuration.

In `@kits/compliance-copilot/apps/src/app/layout.tsx`:
- Around line 5-19: Update the Inter configuration in RootLayout’s module scope
to export a CSS variable, then apply that variable and Tailwind’s default sans
class to the body className alongside the existing Inter class. Preserve the
current metadata and child rendering.

In `@kits/compliance-copilot/constitutions/default.md`:
- Around line 1-17: Fix the heading and section spacing in the central template
generator that produces the default constitution, rather than editing the
generated default.md directly. Ensure consistent blank lines around all headings
and between sections so regenerated kits inherit the corrected Markdown
formatting.

In `@kits/compliance-copilot/flows/compliance-audit.ts`:
- Line 74: The JSON schema configured on the InstructorLLMNode currently
describes one compliance result object instead of the required collection.
Update the schema’s root type to an array and define its item schema with the
existing requirement, status, analysis, and remediation string properties,
preserving those fields for every returned object.

In `@kits/compliance-copilot/README.md`:
- Around line 73-74: Update the fenced file-tree code block in the README to
specify a plaintext-compatible language identifier, such as plaintext or text,
while preserving its existing contents.
🪄 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: c979b51d-98be-4f03-84f0-32c53669f3c1

📥 Commits

Reviewing files that changed from the base of the PR and between 0ada432 and 55f0958.

⛔ Files ignored due to path filters (7)
  • kits/compliance-copilot/apps/package-lock.json is excluded by !**/package-lock.json
  • kits/compliance-copilot/apps/public/file.svg is excluded by !**/*.svg
  • kits/compliance-copilot/apps/public/globe.svg is excluded by !**/*.svg
  • kits/compliance-copilot/apps/public/next.svg is excluded by !**/*.svg
  • kits/compliance-copilot/apps/public/vercel.svg is excluded by !**/*.svg
  • kits/compliance-copilot/apps/public/window.svg is excluded by !**/*.svg
  • kits/compliance-copilot/apps/src/app/favicon.ico is excluded by !**/*.ico
📒 Files selected for processing (20)
  • kits/compliance-copilot/.env.example
  • kits/compliance-copilot/.gitignore
  • kits/compliance-copilot/README.md
  • kits/compliance-copilot/agent.md
  • kits/compliance-copilot/apps/eslint.config.mjs
  • kits/compliance-copilot/apps/next.config.ts
  • kits/compliance-copilot/apps/package.json
  • kits/compliance-copilot/apps/postcss.config.mjs
  • kits/compliance-copilot/apps/src/actions/orchestrate.ts
  • kits/compliance-copilot/apps/src/app/globals.css
  • kits/compliance-copilot/apps/src/app/layout.tsx
  • kits/compliance-copilot/apps/src/app/page.tsx
  • kits/compliance-copilot/apps/src/lib/lamatic-client.ts
  • kits/compliance-copilot/apps/tsconfig.json
  • kits/compliance-copilot/constitutions/default.md
  • kits/compliance-copilot/flows/compliance-audit.ts
  • kits/compliance-copilot/lamatic.config.ts
  • kits/compliance-copilot/model-configs/compliance-audit_instructor-llmnode-286_generative-model-name.ts
  • kits/compliance-copilot/prompts/compliance-audit_instructor-llmnode-286_system_0.md
  • kits/compliance-copilot/prompts/compliance-audit_instructor-llmnode-286_user_1.md

Comment thread kits/compliance-copilot/apps/src/app/globals.css
Comment thread kits/compliance-copilot/apps/src/app/layout.tsx Outdated
Comment thread kits/compliance-copilot/constitutions/default.md
Comment thread kits/compliance-copilot/flows/compliance-audit.ts Outdated
Comment thread kits/compliance-copilot/README.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Hi @vk2git! 👋

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