feat: add SOD constraints to system-prompt and claude-code adapters#13
Merged
shreyas-lyzr merged 3 commits intoopen-gitagent:mainfrom Feb 27, 2026
Merged
Conversation
4 tasks
Add the `segregation_of_duties` subsection to the compliance schema with support for roles, conflict matrix, assignments, isolation levels, handoff workflows, and enforcement modes. - JSON Schema definition in agent-yaml.schema.json - TypeScript types in loader.ts ComplianceConfig interface - Spec documentation including DUTIES.md convention, validation rules, and regulatory reference table Closes open-gitagent#10 (part 1 of 4)
- validate.ts: 16 validation rules for SOD (role uniqueness, conflict detection, assignment integrity, handoff validation, risk tier checks) - audit.ts: new "Segregation of Duties" section in audit report - init.ts: DUTIES.md scaffolding in full template Part 2 of 4 — depends on feat/sod-1-spec-schema
- system-prompt.ts: exports SOD role assignments, conflict rules, handoff requirements, isolation constraints, and DUTIES.md content - claude-code.ts: includes SOD subsection in Compliance output and loads DUTIES.md into generated CLAUDE.md Part 3 of 4 — depends on feat/sod-2-cli-commands
ec8dbcd to
a76c6ea
Compare
shreyas-lyzr
approved these changes
Feb 27, 2026
Contributor
shreyas-lyzr
left a comment
There was a problem hiding this comment.
Both adapters handle SOD cleanly:
- system-prompt.ts: Natural language constraints that any LLM can follow — role assignments, conflict rules, handoff chains, isolation rules, enforcement mode. Good that it loads DUTIES.md too.
- claude-code.ts: SOD subsection under Compliance in CLAUDE.md — consistent with how other compliance fields are already exported.
The for (const [a, b] of sod.conflicts) destructuring is clean. Handoff output using → separator is readable.
Approving.
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
Adds segregation of duties output to both export adapters:
DUTIES.mdcontent.DUTIES.mdalongside SOUL.md and RULES.md.Context
Part 3 of 4 for the SOD feature (#10). Depends on #12 (CLI commands).
Test plan
npm run buildpasses cleanlynode dist/index.js export --format system-prompt -d examples/full— includes SOD constraintsnode dist/index.js export --format claude-code -d examples/full— includes SOD sectionPR Stack
🤖 Generated with Claude Code