Troubleshooting
Troubleshooting
Common issues, solutions, and reference information for the AI-SDLC Framework.
Validation Errors
"Missing 'kind' field"
Every resource MUST include apiVersion, kind, metadata, and spec at the top level.
# Wrong — missing kind
apiVersion: ai-sdlc.io/v1alpha1
metadata:
name: my-pipeline
spec: ...
# Correct
apiVersion: ai-sdlc.io/v1alpha1
kind: Pipeline
metadata:
name: my-pipeline
spec: ..."Unknown resource kind"
The kind field must be one of: Pipeline, AgentRole, QualityGate, AutonomyPolicy, AdapterBinding. Values are case-sensitive.
Schema validation fails with no useful message
Use validate() with an explicit kind instead of validateResource() for better error reporting:
// More specific error messages
const result = validate('Pipeline', doc);"additionalProperties" errors
The JSON schemas use additionalProperties: false in some locations. Check for typos in field names:
# Wrong — 'trigger' is not valid, should be 'triggers'
spec:
trigger:
- event: issue.assigned
# Correct
spec:
triggers:
- event: issue.assignedBuilder Gotchas
Builder produces empty stages array
addStage() returns this for chaining. If you forget to chain or call build():
// Wrong — build() called on new builder, not the chain
const builder = new PipelineBuilder('test');
builder.addStage({ name: 'implement', agent: 'code-agent' });
const pipeline = new PipelineBuilder('test').build(); // Empty!
// Correct
const pipeline = new PipelineBuilder('test')
.addStage({ name: 'implement', agent: 'code-agent' })
.build();AdapterBindingBuilder requires all four constructor arguments
Unlike other builders, AdapterBindingBuilder needs interface, type, and version upfront:
// Wrong — missing arguments
const binding = new AdapterBindingBuilder('github').build();
// Correct
const binding = new AdapterBindingBuilder('github', 'SourceControl', 'github', '1.0.0').build();Duration Format
Duration strings are used in health checks, timeouts, cooldowns, and minimum durations.
Shorthand format
Pattern: <number><unit> where unit is one of:
| Unit | Meaning | Example |
|---|---|---|
s | seconds | 300s (5 minutes) |
m | minutes | 5m |
h | hours | 2h |
d | days | 1d |
w | weeks | 2w |
ISO 8601 format
Also supported: P[nD][T[nH][nM][nS]]
| Example | Meaning |
|---|---|
P1D | 1 day |
PT1H | 1 hour |
PT30M | 30 minutes |
P1DT12H | 1 day 12 hours |
Common mistakes
# Wrong — no unit
timeout: 300
# Wrong — space between number and unit
timeout: 300 s
# Wrong — plural units
timeout: 5mins
# Correct
timeout: 300s
timeout: 5mEnforcement
Gate fails but pipeline continues
If the enforcement level is advisory, failures are logged but do not block. Check the enforcement level:
const result = enforce(gate, context);
for (const r of result.results) {
if (r.verdict === 'fail' && r.enforcement === 'advisory') {
// This failure was logged but did not block
console.log(`Advisory failure: ${r.gate}`);
}
}Override not working for soft-mandatory gate
Overrides require both conditions:
- The
overrideRolein the context must matchgate.override.requiredRole - If
requiresJustificationis true,overrideJustificationmust be provided
const result = enforce(gate, {
// ...
overrideRole: 'engineering-manager',
overrideJustification: 'Emergency hotfix for production outage',
});Hard-mandatory gate cannot be overridden
By design. Even if you provide override credentials, hard-mandatory gates always block on failure. Demote the gate to soft-mandatory if overrides are needed.
Autonomy Evaluation
Agent not eligible for promotion despite meeting metrics
Check these conditions in order:
- Minimum duration -- Has the agent been at the current level long enough? Check
minimumDurationon the level definition. - Demotion cooldown -- Was the agent recently demoted? The cooldown period must expire before promotion is considered.
- Task count -- Has the agent completed enough tasks? Check
minimumTasksin the promotion criteria. - Metric conditions -- Are all metric thresholds met?
- Required approvals -- Have all required human approvals been granted?
const result = evaluatePromotion(policy, agentMetrics);
console.log(result.unmetConditions); // Lists exactly what's missingAdapter Issues
"Secret not found" or undefined config values
Ensure environment variables are set using UPPER_SNAKE_CASE:
# secretRef: jira-api-token → JIRA_API_TOKEN
export JIRA_API_TOKEN="your-token-here"
# secretRef: github-token → GITHUB_TOKEN
export GITHUB_TOKEN="ghp_..."Adapter health check failing
Verify the adapter endpoint is reachable and credentials are valid. Check the health check configuration:
healthCheck:
interval: 60s # Must be valid duration
timeout: 10s # Must be less than intervalEnvironment Variables
| Variable | Purpose | Default |
|---|---|---|
AI_SDLC_MODEL | Default LLM model for agent operations | claude-sonnet-4-5-20250929 |
AI_SDLC_LOG_LEVEL | Logging level (debug, info, warn, error) | info |
GITHUB_TOKEN | GitHub API token for adapters | (required for GitHub adapters) |
LINEAR_API_KEY | Linear API key for issue tracking | (required for Linear adapter) |
Common Test Failures
Tests fail with "Cannot find module"
Build the reference implementation first:
pnpm --filter @ai-sdlc/reference build
pnpm testSchema validation tests fail after type changes
Regenerate or update JSON schemas to match type changes, then rebuild:
pnpm --filter @ai-sdlc/reference validate-schemasGetting Help
- API Reference -- Full SDK reference
- Specification -- Normative requirements
- GitHub Issues -- Report bugs or request features