| name | legal-sanity-review |
| title | Legal Sanity Review Workflow |
| description | Legal Sanity Review Workflow — mandatory pre-gate in the cross-review cycle |
| author | vamseeachanta |
| author_url | https://github.com/vamseeachanta/workspace-hub/tree/main/.agents/skills/_internal/workflows/legal-sanity-review |
| license | MIT |
| version | 0.1.0 |
| execution_mode | open |
| jurisdiction | general |
| practice | general |
| language | en |
Legal Sanity Review Workflow
Version: 1.0.0
Category: Workflows
Triggers: Before cross-review (Codex/Gemini), PR creation, code porting
Purpose
Ensures no client project names, proprietary tool references, or legally sensitive content reaches the cross-review stage or a pull request. This is a mandatory pre-gate — if the legal scan fails, the review cycle does not proceed.
Review Flow
Codex/Gemini performs task
↓
Commit changes
↓
Legal Sanity Scan ◄── MANDATORY PRE-GATE
├── BLOCK → Fix violations → Re-scan
└── PASS → Proceed to Codex review
↓
Cross-Review Cycle
Integration Points
Cross-Review Pre-Gate
The legal scan runs before the first Codex/Gemini iteration:
| Step | Gate | Action |
|---|
| 1 | Legal Scan | Run legal-sanity-scan.sh --diff-only |
| 2 | Pass? | If no → fix and re-scan |
| 3 | Codex Review | First cross-review iteration |
| 4 | Gemini Review | Parallel cross-review |
PR Pre-Hook
Integrated into pr-manager.md hooks:
./scripts/legal/legal-sanity-scan.sh --diff-only || (echo "Legal sanity FAILED" && exit 1)
Manual Invocation
./scripts/legal/legal-sanity-scan.sh --repo=worldenergydata
./scripts/legal/legal-sanity-scan.sh --all
Exit Conditions
| Condition | Code | Action |
|---|
| PASS | 0 | Proceed to cross-review |
| BLOCK | 1 | Fix violations, re-scan |
| SCAN_ERROR | 2 | Check script/config, retry |
Violation Response
When the scan finds block-severity violations:
- — do not proceed to cross-review or PR creation