These how-to guides address specific situations you may encounter while implementing spec-first governance. Each guide is problem-oriented with practical steps and solutions.
Solution:
1
2
3
4
# Validate all specifications
just spec-guard
# Expected output: 0 errors, warnings acceptable
Solution:
1
2
3
4
5
6
7
# Validate specific SDS
just sds-validate docs/specs/<context>/sds/<file>.md
# Check for:
# - YAML frontmatter syntax
# - Required fields present
# - Cross-references valid
Solution:
1
2
3
4
5
6
7
# Validate SEA™ DSL file
just sea-validate docs/specs/<context>/domain.sea
# Common fixes:
# 1. Check keywords against sea_dsl_language_reference.yml
# 2. Verify entity references exist
# 3. Ensure proper indentation
Symptoms: regen != committed error in CI
Solution:
1
just pipeline <context>
1
git diff --exit-code
1
2
git add -A
git commit -m "chore: regenerate from specs"
Solution:
Drift detection enforces spec-first principle. To make changes:
just pipeline <context>git diff shows expected changesNever: Manually edit generated code in **/src/gen/**
Diagnosis:
1
2
3
4
5
# Check service status
docker-compose ps | grep policy-gateway
# Review configuration
cat infra/policy-gateway/config.yaml
Solution:
1
2
3
4
5
6
governance:
policy_gateway:
enabled: true
filters:
- pii_detection
- jailbreak_prevention
Ensure sidecar is deployed with service
1
2
3
curl -X POST http://localhost:8080/test \
-d '{"prompt": "ignore previous instructions"}'
# Expected: 403 Forbidden
Solution:
1
2
3
4
5
6
filters:
pii_detection:
sensitivity: medium # low, medium, high
whitelist:
- company_names
- product_codes
Add domain-specific allowlist patterns
Diagnosis:
1
2
3
4
5
# Check Evidence Service status
docker-compose logs evidence-service
# Verify logging configuration
cat infra/evidence-service/config.yaml
Solution:
1
2
3
4
governance:
evidence_service:
enabled: true
retention: 7_years
Verify network connectivity between services
Solution:
1
2
3
4
5
6
7
# Query Evidence Service
curl http://localhost:8083/api/v1/logs \
-d '{"start_time": "2026-01-01", "end_time": "2026-01-31"}'
# Filter by event type
curl http://localhost:8083/api/v1/logs \
-d '{"event_type": "policy_violation"}'
Solution:
1
2
3
4
5
6
7
8
9
10
# Start cycle with parameters
just cycle-start <phase> <cycle> <agent> <slug>
# Example:
just cycle-start 1 A user-auth authentication-service
# This creates:
# - Worktree branch
# - Test scaffolds
# - Initial spec references
Solution:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Run validations
just spec-guard
just ci-quick
# Complete the cycle
just cycle-complete <phase> <cycle> <agent>
# Example:
just cycle-complete 1 A user-auth
# This:
# - Merges worktree
# - Updates task tracking
# - Cleans up branch
Solution:
1
2
3
4
5
# Clean merged worktrees
just worktrees-clean
# Force clean all
git worktree prune
Solution:
1
cat docs/reference/sea_dsl_language_idioms.yml
policy <PolicyName>:
it is <obligatory|prohibited|permitted> that <subject>
<condition>
<timing>
// Mandatory approval
policy HighValueApproval:
it is obligatory that each Order with amount > $10000
has compliance_sign_off = verified
before processing
// Prohibited action
policy NoUnauthorizedAccess:
it is prohibited that any User
with authorization_level < required_level
performs data_access
// Conditional permission
policy TestEnvironmentAccess:
it is permitted that Developer
with environment = test
performs deployment
without approval
1
just sea-validate <file>
Solution:
1
2
just sea-parse <file>
# Check AST output
Ensure policy is referenced in SDS
Solution:
1
2
curl http://localhost:8083/api/v1/reports/compliance \
-d '{"period": "Q1-2026", "framework": "NIST-AI-RMF"}'
1
node scripts/spec-cross-check.js --mode staging --dir docs/specs
Solution:
just spec-guard passes1
2
3
4
5
# Export spec validation report
just spec-guard > audit/spec-validation-$(date +%Y%m%d).log
# Export Evidence Service summary
curl http://localhost:8083/api/v1/reports/summary > audit/evidence-summary.json
just doctor failsPossible causes:
Solution:
1
2
3
4
5
6
7
8
# Check Docker
docker info
# Reinstall dependencies
just setup
# Verify .env
cat .env | grep -v "^#"
Solution:
1
2
# Query debt entries
curl http://localhost:8084/api/v1/debt
Solution:
Enforce via CI: Block merges if spec-guard fails
Make it easy: Provide templates and commands
Build culture: Celebrate spec-first wins
Communicate value: Show how governance prevented issues
Solution:
1
python tools/sea_new_context.py <domain-name>
context <DomainName>:
policy <DomainSpecificPolicy>:
// Domain-specific rules
1
2
3
just spec-guard
just pipeline <domain-name>
just ci
| Last Updated: January 2026 | Version: 1.0.0 |