oryon-framework 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.claude/CLAUDE.md +387 -0
  2. package/.claude/commands/ORYON/agents/build.md +630 -0
  3. package/.claude/commands/ORYON/agents/check.md +511 -0
  4. package/.claude/commands/ORYON/agents/plan.md +502 -0
  5. package/.claude/commands/ORYON/agents/research.md +642 -0
  6. package/.claude/commands/ORYON/agents/ship.md +527 -0
  7. package/.claude/commands/ORYON/ask.md +48 -0
  8. package/.claude/commands/ORYON/conclave.md +256 -0
  9. package/.claude/commands/ORYON/start.md +166 -0
  10. package/.claude/commands/ORYON/status.md +42 -0
  11. package/.claude/hooks/README.md +194 -0
  12. package/.claude/hooks/code-intel-pretool.cjs +107 -0
  13. package/.claude/hooks/precompact-session-digest.cjs +106 -0
  14. package/.claude/hooks/synapse-engine.cjs +113 -0
  15. package/.claude/rules/agent-memory-imports.md +15 -0
  16. package/.claude/rules/coderabbit-integration.md +101 -0
  17. package/.claude/rules/ids-principles.md +119 -0
  18. package/.claude/rules/mcp-usage.md +176 -0
  19. package/.claude/rules/story-lifecycle.md +145 -0
  20. package/.claude/rules/token-efficiency.md +28 -0
  21. package/.claude/rules/tool-response-filtering.md +57 -0
  22. package/.claude/rules/vault-protocol.md +107 -0
  23. package/.claude/settings.json +3 -0
  24. package/.claude/settings.local.json +47 -0
  25. package/.gitignore +29 -0
  26. package/.knowledge/INDEX.md +67 -0
  27. package/.knowledge/dossiers/DOSSIER-AGENTES-IA.md +122 -0
  28. package/.knowledge/dossiers/DOSSIER-AI-OPERATING-SYSTEMS.md +209 -0
  29. package/.knowledge/dossiers/DOSSIER-CHATGPT-FERRAMENTAS.md +386 -0
  30. package/.knowledge/dossiers/DOSSIER-CLAUDE-CODE-DEV.md +209 -0
  31. package/.knowledge/dossiers/DOSSIER-CONCURSOS-EDUCACAO.md +233 -0
  32. package/.knowledge/dossiers/DOSSIER-COPYWRITING-FOUNDATION.md +283 -0
  33. package/.knowledge/dossiers/DOSSIER-ENTREGAVEIS-IA.md +180 -0
  34. package/.knowledge/dossiers/DOSSIER-GOOGLE-ADS.md +365 -0
  35. package/.knowledge/dossiers/DOSSIER-IA-CRIATIVOS-AUTOMACAO.md +568 -0
  36. package/.knowledge/dossiers/DOSSIER-LOW-TICKET-INFOPRODUTO.md +198 -0
  37. package/.knowledge/dossiers/DOSSIER-MARKETING-GERAL.md +347 -0
  38. package/.knowledge/dossiers/DOSSIER-META-ADS-TRAFFIC.md +570 -0
  39. package/.knowledge/dossiers/DOSSIER-META-PIXEL-TRACKING.md +240 -0
  40. package/.knowledge/dossiers/DOSSIER-OFERTAS-LOWTICKET.md +357 -0
  41. package/.knowledge/dossiers/DOSSIER-OFERTAS-LP.md +306 -0
  42. package/.knowledge/dossiers/DOSSIER-OFERTAS-MINERADAS.md +935 -0
  43. package/.knowledge/dossiers/DOSSIER-PROMPT-ENGINEERING.md +542 -0
  44. package/.knowledge/dossiers/DOSSIER-PSICOLOGIA-PERSUASAO.md +259 -0
  45. package/.knowledge/dossiers/DOSSIER-QUIZ-FUNNEL.md +325 -0
  46. package/.knowledge/dossiers/DOSSIER-VENDAS-SCRIPTS.md +285 -0
  47. package/.knowledge/dossiers/DOSSIER-WHATSAPP-CHATBOT.md +165 -0
  48. package/bin/oryon.js +23 -0
  49. package/package.json +31 -0
  50. package/src/init.js +276 -0
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * Code-Intel PreToolUse Hook — Auto-injects code intelligence context
6
+ * when an agent is about to Write or Edit a file.
7
+ *
8
+ * Protocol:
9
+ * - Reads JSON from stdin (Claude Code PreToolUse event)
10
+ * - Filters: only acts on Write and Edit tools
11
+ * - Queries RegistryProvider for entity, references, dependencies
12
+ * - Outputs JSON with additionalContext containing <code-intel-context> XML
13
+ * - Silent exit on any error (never blocks the tool call)
14
+ *
15
+ * @module code-intel-pretool-hook
16
+ */
17
+
18
+ const path = require('path');
19
+
20
+ /** Tools that trigger code-intel injection. */
21
+ const TARGET_TOOLS = new Set(['Write', 'Edit']);
22
+
23
+ /** Safety timeout (ms) — defense-in-depth. */
24
+ const HOOK_TIMEOUT_MS = 4000;
25
+
26
+ /**
27
+ * Read all data from stdin as a JSON object.
28
+ * @returns {Promise<object>}
29
+ */
30
+ function readStdin() {
31
+ return new Promise((resolve, reject) => {
32
+ let data = '';
33
+ process.stdin.setEncoding('utf8');
34
+ process.stdin.on('error', (e) => reject(e));
35
+ process.stdin.on('data', (chunk) => { data += chunk; });
36
+ process.stdin.on('end', () => {
37
+ try { resolve(JSON.parse(data)); }
38
+ catch (e) { reject(e); }
39
+ });
40
+ });
41
+ }
42
+
43
+ /**
44
+ * Main hook pipeline.
45
+ */
46
+ async function main() {
47
+ const input = await readStdin();
48
+
49
+ // Filter: only act on Write/Edit tools
50
+ const toolName = input && input.tool_name;
51
+ if (!toolName || !TARGET_TOOLS.has(toolName)) return;
52
+
53
+ // Extract file_path from tool input
54
+ const toolInput = input.tool_input;
55
+ if (!toolInput) return;
56
+ const filePath = toolInput.file_path;
57
+ if (!filePath) return;
58
+
59
+ // Resolve project root from hook cwd or process.cwd()
60
+ const cwd = input.cwd || process.cwd();
61
+
62
+ // Load hook-runtime (lazy — only when we actually need it)
63
+ const { resolveCodeIntel, formatAsXml } = require(
64
+ path.join(__dirname, '..', '..', '.aios-core', 'core', 'code-intel', 'hook-runtime.js'),
65
+ );
66
+
67
+ const intel = await resolveCodeIntel(filePath, cwd);
68
+ const xml = formatAsXml(intel, filePath);
69
+ if (!xml) return;
70
+
71
+ // Output in Claude Code hook format
72
+ const output = JSON.stringify({
73
+ hookSpecificOutput: {
74
+ additionalContext: xml,
75
+ },
76
+ });
77
+
78
+ const flushed = process.stdout.write(output);
79
+ if (!flushed) {
80
+ await new Promise((resolve) => process.stdout.once('drain', resolve));
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Safely exit — no-op inside Jest workers.
86
+ * @param {number} code
87
+ */
88
+ function safeExit(code) {
89
+ if (process.env.JEST_WORKER_ID) return;
90
+ process.exit(code);
91
+ }
92
+
93
+ /** Entry point runner. */
94
+ function run() {
95
+ const timer = setTimeout(() => safeExit(0), HOOK_TIMEOUT_MS);
96
+ timer.unref();
97
+ main()
98
+ .then(() => safeExit(0))
99
+ .catch(() => {
100
+ // Silent exit — stderr output triggers "hook error" in Claude Code UI
101
+ safeExit(0);
102
+ });
103
+ }
104
+
105
+ if (require.main === module) run();
106
+
107
+ module.exports = { readStdin, main, run, HOOK_TIMEOUT_MS, TARGET_TOOLS };
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Claude Code Hook: PreCompact Session Digest
4
+ *
5
+ * Registered as PreCompact event — fires before context compaction.
6
+ * Reads JSON from stdin (Claude Code hook protocol), delegates to
7
+ * the unified hook runner in oryon-core.
8
+ *
9
+ * Stdin format (PreCompact):
10
+ * {
11
+ * "session_id": "abc123",
12
+ * "transcript_path": "/path/to/session.jsonl",
13
+ * "cwd": "/path/to/project",
14
+ * "hook_event_name": "PreCompact",
15
+ * "trigger": "auto" | "manual"
16
+ * }
17
+ *
18
+ * @see .oryon-core/hooks/unified/runners/precompact-runner.js
19
+ * @see Story MIS-3 - Session Digest (PreCompact Hook)
20
+ * @see Story MIS-3.1 - Fix Session-Digest Hook Registration
21
+ */
22
+
23
+ 'use strict';
24
+
25
+ const path = require('path');
26
+
27
+ // Resolve project root via __dirname (same pattern as synapse-engine.cjs)
28
+ // More robust than input.cwd — doesn't depend on external input
29
+ const PROJECT_ROOT = path.resolve(__dirname, '..', '..');
30
+
31
+ /** Safety timeout (ms) — defense-in-depth; Claude Code also manages hook timeout. */
32
+ const HOOK_TIMEOUT_MS = 9000;
33
+
34
+ /**
35
+ * Read all data from stdin as a JSON object.
36
+ * Same pattern as synapse-engine.cjs.
37
+ * @returns {Promise<object>} Parsed JSON input
38
+ */
39
+ function readStdin() {
40
+ return new Promise((resolve, reject) => {
41
+ let data = '';
42
+ process.stdin.setEncoding('utf8');
43
+ process.stdin.on('error', (e) => reject(e));
44
+ process.stdin.on('data', (chunk) => { data += chunk; });
45
+ process.stdin.on('end', () => {
46
+ try { resolve(JSON.parse(data)); }
47
+ catch (e) { reject(e); }
48
+ });
49
+ });
50
+ }
51
+
52
+ /** Main hook execution pipeline. */
53
+ async function main() {
54
+ const input = await readStdin();
55
+
56
+ // Resolve path to the unified hook runner via __dirname (not input.cwd)
57
+ // Same pattern as synapse-engine.cjs — robust against incorrect cwd
58
+ const runnerPath = path.join(
59
+ PROJECT_ROOT,
60
+ '.oryon-core',
61
+ 'hooks',
62
+ 'unified',
63
+ 'runners',
64
+ 'precompact-runner.js',
65
+ );
66
+
67
+ // Build context object expected by onPreCompact
68
+ const context = {
69
+ sessionId: input.session_id,
70
+ projectDir: input.cwd || PROJECT_ROOT,
71
+ transcriptPath: input.transcript_path,
72
+ trigger: input.trigger || 'auto',
73
+ hookEventName: input.hook_event_name || 'PreCompact',
74
+ permissionMode: input.permission_mode,
75
+ conversation: input,
76
+ provider: 'claude',
77
+ };
78
+
79
+ const { onPreCompact } = require(runnerPath);
80
+ await onPreCompact(context);
81
+ }
82
+
83
+ /** Entry point runner — sets safety timeout and executes main(). */
84
+ function run() {
85
+ // Safety timeout — force exit only as last resort (no stdout to flush at this point).
86
+ const timer = setTimeout(() => {
87
+ process.exit(0);
88
+ }, HOOK_TIMEOUT_MS);
89
+ timer.unref();
90
+
91
+ main()
92
+ .then(() => {
93
+ clearTimeout(timer);
94
+ // Let event loop drain naturally — process.exitCode allows stdout flush
95
+ process.exitCode = 0;
96
+ })
97
+ .catch(() => {
98
+ clearTimeout(timer);
99
+ // Silent exit — never write to stderr (triggers "hook error" in Claude Code)
100
+ process.exitCode = 0;
101
+ });
102
+ }
103
+
104
+ if (require.main === module) run();
105
+
106
+ module.exports = { readStdin, main, run, HOOK_TIMEOUT_MS };
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * SYNAPSE Hook Entry Point — UserPromptSubmit
6
+ *
7
+ * Thin wrapper that reads JSON from stdin, delegates to SynapseEngine,
8
+ * and writes <synapse-rules> context to stdout.
9
+ *
10
+ * - Silent exit on missing .synapse/ directory
11
+ * - Silent exit on any error (never blocks the user prompt)
12
+ * - 5s safety timeout as defense-in-depth
13
+ *
14
+ * @module synapse-engine-hook
15
+ */
16
+
17
+ const path = require('path');
18
+ const { resolveHookRuntime, buildHookOutput } = require(
19
+ path.join(__dirname, '..', '..', '.oryon-core', 'core', 'synapse', 'runtime', 'hook-runtime.js'),
20
+ );
21
+
22
+ /** Safety timeout (ms) — defense-in-depth; Claude Code also manages hook timeout. */
23
+ const HOOK_TIMEOUT_MS = 5000;
24
+
25
+ /**
26
+ * Read all data from stdin as a JSON object.
27
+ * @returns {Promise<object>} Parsed JSON input
28
+ */
29
+ function readStdin() {
30
+ return new Promise((resolve, reject) => {
31
+ let data = '';
32
+ process.stdin.setEncoding('utf8');
33
+ process.stdin.on('error', (e) => reject(e));
34
+ process.stdin.on('data', (chunk) => { data += chunk; });
35
+ process.stdin.on('end', () => {
36
+ try { resolve(JSON.parse(data)); }
37
+ catch (e) { reject(e); }
38
+ });
39
+ });
40
+ }
41
+
42
+ /** Main hook execution pipeline. */
43
+ async function main() {
44
+ const input = await readStdin();
45
+ const runtime = resolveHookRuntime(input);
46
+ if (!runtime) return;
47
+
48
+ const result = await runtime.engine.process(input.prompt, runtime.session);
49
+
50
+ // QW-1: Wire updateSession() — persist bracket transitions after each prompt
51
+ if (runtime.sessionId && runtime.sessionsDir) {
52
+ try {
53
+ const { updateSession } = require(
54
+ path.join(runtime.cwd, '.oryon-core', 'core', 'synapse', 'session', 'session-manager.js'),
55
+ );
56
+ updateSession(runtime.sessionId, runtime.sessionsDir, {
57
+ context: { last_bracket: result.bracket || 'FRESH' },
58
+ });
59
+ } catch (_err) {
60
+ // Fire-and-forget — never block the prompt
61
+ }
62
+ }
63
+
64
+ const output = JSON.stringify(buildHookOutput(result.xml));
65
+
66
+ // Write output robustly across real process.stdout and mocked Jest streams.
67
+ // Some mocks return boolean but never invoke callback; handle both patterns.
68
+ await new Promise((resolve, reject) => {
69
+ let settled = false;
70
+ const finish = (err) => {
71
+ if (settled) return;
72
+ settled = true;
73
+ if (err) reject(err);
74
+ else resolve();
75
+ };
76
+
77
+ try {
78
+ const flushed = process.stdout.write(output, (err) => finish(err));
79
+ if (flushed) {
80
+ setImmediate(() => finish());
81
+ } else if (typeof process.stdout.once === 'function') {
82
+ process.stdout.once('drain', () => finish());
83
+ }
84
+ } catch (err) {
85
+ finish(err);
86
+ }
87
+ });
88
+ }
89
+
90
+ /**
91
+ * Safely exit the process — no-op inside Jest workers to prevent worker crashes.
92
+ * @param {number} code - Exit code
93
+ */
94
+ function safeExit(code) {
95
+ if (process.env.JEST_WORKER_ID) return;
96
+ process.exit(code);
97
+ }
98
+
99
+ /** Entry point runner — sets safety timeout and executes main(). */
100
+ function run() {
101
+ const timer = setTimeout(() => safeExit(0), HOOK_TIMEOUT_MS);
102
+ timer.unref();
103
+ main()
104
+ .then(() => safeExit(0))
105
+ .catch(() => {
106
+ // Silent exit — stderr output triggers "hook error" in Claude Code UI
107
+ safeExit(0);
108
+ });
109
+ }
110
+
111
+ if (require.main === module) run();
112
+
113
+ module.exports = { readStdin, main, run, HOOK_TIMEOUT_MS };
@@ -0,0 +1,15 @@
1
+ ---
2
+ paths: .oryon-core/development/agents/**
3
+ ---
4
+
5
+ # Agent Memory Imports
6
+
7
+ Each Oryon agent has a canonical MEMORY.md containing persistent knowledge.
8
+ These are the canonical locations — agents should read their memory on activation.
9
+
10
+ @import .oryon-core/development/agents/dev/MEMORY.md
11
+ @import .oryon-core/development/agents/qa/MEMORY.md
12
+ @import .oryon-core/development/agents/architect/MEMORY.md
13
+ @import .oryon-core/development/agents/devops/MEMORY.md
14
+ @import .oryon-core/development/agents/pm/MEMORY.md
15
+ @import .oryon-core/development/agents/po/MEMORY.md
@@ -0,0 +1,101 @@
1
+ ---
2
+ paths:
3
+ - ".oryon-core/**"
4
+ - "tests/**"
5
+ - "packages/**"
6
+ - "bin/**"
7
+ ---
8
+
9
+ # CodeRabbit Integration — Detailed Rules
10
+
11
+ ## Self-Healing Configuration
12
+
13
+ ### Dev Phase (@dev — Story Development Cycle Phase 3)
14
+
15
+ ```yaml
16
+ mode: light
17
+ max_iterations: 2
18
+ timeout_minutes: 30
19
+ severity_filter: [CRITICAL, HIGH]
20
+ behavior:
21
+ CRITICAL: auto_fix
22
+ HIGH: auto_fix (iteration < 2) else document_as_debt
23
+ MEDIUM: document_as_debt
24
+ LOW: ignore
25
+ ```
26
+
27
+ **Flow:**
28
+ ```
29
+ RUN CodeRabbit → CRITICAL found?
30
+ YES → auto-fix (iteration < 2) → Re-run
31
+ NO → Document HIGH as debt, proceed
32
+ After 2 iterations with CRITICAL → HALT, manual intervention
33
+ ```
34
+
35
+ ### QA Phase (@qa — QA Loop Pre-Review)
36
+
37
+ ```yaml
38
+ mode: full
39
+ max_iterations: 3
40
+ timeout_minutes: 30
41
+ severity_filter: [CRITICAL, HIGH]
42
+ behavior:
43
+ CRITICAL: auto_fix
44
+ HIGH: auto_fix
45
+ MEDIUM: document_as_debt
46
+ LOW: ignore
47
+ ```
48
+
49
+ **Flow:**
50
+ 1. Pre-commit review scan
51
+ 2. Self-healing loop (max 3 iterations)
52
+ 3. Manual QA analysis (architectural, traceability, NFR)
53
+ 4. Gate decision (verdict)
54
+
55
+ ## Severity Handling Summary
56
+
57
+ | Severity | Dev Phase | QA Phase |
58
+ |----------|-----------|----------|
59
+ | CRITICAL | auto_fix, block if persists | auto_fix, block if persists |
60
+ | HIGH | auto_fix, document if fails | auto_fix, document if fails |
61
+ | MEDIUM | document_as_tech_debt | document_as_tech_debt |
62
+ | LOW | ignore | ignore |
63
+
64
+ ## WSL Execution (Windows)
65
+
66
+ ```bash
67
+ # Self-healing mode (automatic in dev tasks)
68
+ wsl bash -c 'cd /mnt/c/.../oryon-core && ~/.local/bin/coderabbit --severity CRITICAL,HIGH --auto-fix'
69
+
70
+ # Manual review
71
+ wsl bash -c 'cd /mnt/c/.../oryon-core && ~/.local/bin/coderabbit -t uncommitted'
72
+
73
+ # Prompt-only mode
74
+ wsl bash -c 'cd /mnt/c/.../oryon-core && ~/.local/bin/coderabbit --prompt-only -t uncommitted'
75
+ ```
76
+
77
+ ## Integration Points
78
+
79
+ | Workflow | Phase | Trigger | Agent |
80
+ |----------|-------|---------|-------|
81
+ | Story Development Cycle | 3 (Implement) | After task completion | @dev |
82
+ | QA Loop | 1 (Review) | At review start | @qa |
83
+ | Standalone | Any | `*coderabbit-review` command | Any |
84
+
85
+ ## Focus Areas by Story Type
86
+
87
+ | Story Type | Primary Focus |
88
+ |-----------|--------------|
89
+ | Feature | Code patterns, test coverage, API design |
90
+ | Bug Fix | Regression risk, root cause coverage |
91
+ | Refactor | Breaking changes, interface stability |
92
+ | Documentation | Markdown quality, reference validity |
93
+ | Database | SQL injection, RLS coverage, migration safety |
94
+
95
+ ## Report Location
96
+
97
+ CodeRabbit reports saved to: `docs/qa/coderabbit-reports/`
98
+
99
+ ## Configuration Reference
100
+
101
+ Full config in `.oryon-core/core-config.yaml` under `coderabbit_integration` section.
@@ -0,0 +1,119 @@
1
+ ---
2
+ paths:
3
+ - ".oryon-core/**"
4
+ - "packages/**"
5
+ - "bin/**"
6
+ ---
7
+
8
+ # IDS Principles — Detailed Rules
9
+
10
+ > Status: Planned (IDS epic is Draft — principles apply as aspirational guidance)
11
+
12
+ ## Decision Hierarchy: REUSE > ADAPT > CREATE
13
+
14
+ ### REUSE (Relevance >= 90%)
15
+ - Use existing artifact directly without modification
16
+ - Import/reference existing entity
17
+ - No justification needed beyond confirming match
18
+
19
+ ### ADAPT (Relevance 60-89%)
20
+ - Adaptability score >= 0.6
21
+ - Changes MUST NOT exceed 30% of original artifact
22
+ - Changes MUST NOT break existing consumers (check usedBy list)
23
+ - Document changes in artifact's change log
24
+ - Update registry relationships
25
+ - Impact analysis required
26
+
27
+ ### CREATE (No suitable match)
28
+ Required justification:
29
+ - `evaluated_patterns`: Existing entities you considered
30
+ - `rejection_reasons`: Why each was rejected (technical reasons)
31
+ - `new_capability`: What unique capability this provides
32
+ - Register in Entity Registry within 24 hours
33
+ - Establish relationships with existing entities
34
+ - Define adaptability constraints for future reuse
35
+
36
+ ## Verification Gates G1-G6
37
+
38
+ ### G1: Epic Creation (@pm)
39
+ - **Type:** Human-in-loop, Advisory
40
+ - **Trigger:** `*create-epic` workflow
41
+ - **Action:** Query registry for related entities, display potentially reusable artifacts
42
+ - **Latency:** < 24h (async)
43
+ - **Blocking:** No
44
+
45
+ ### G2: Story Creation (@sm)
46
+ - **Type:** Human-in-loop, Advisory
47
+ - **Trigger:** `*draft` workflow
48
+ - **Action:** Check existing tasks/templates matching story work
49
+ - **Latency:** < 24h (async)
50
+ - **Blocking:** No
51
+
52
+ ### G3: Story Validation (@po)
53
+ - **Type:** Human-in-loop, Soft Block
54
+ - **Trigger:** `*validate-story-draft` workflow
55
+ - **Action:** Verify referenced artifacts exist, detect potential duplication
56
+ - **Latency:** < 4h (async)
57
+ - **Blocking:** Soft (can override with reason)
58
+
59
+ ### G4: Dev Context (@dev)
60
+ - **Type:** Automated, Informational
61
+ - **Trigger:** Story assignment / `*develop` start
62
+ - **Action:** Display matching patterns as reminder
63
+ - **Latency:** < 2s
64
+ - **Blocking:** NO (logged only for metrics)
65
+
66
+ ### G5: QA Review (@qa)
67
+ - **Type:** Automated, Blocks Merge
68
+ - **Trigger:** PR/merge request
69
+ - **Action:** Check if new artifacts could have reused existing
70
+ - **Latency:** < 30s
71
+ - **Blocking:** YES if new entity without registry entry or justification
72
+
73
+ ### G6: CI/CD (@devops)
74
+ - **Type:** Automated, Blocks Merge
75
+ - **Trigger:** CI pipeline
76
+ - **Action:** Registry integrity check + sync
77
+ - **Latency:** < 60s
78
+ - **Blocking:** YES on CRITICAL, WARN on MEDIUM/LOW
79
+
80
+ ## Override Policy
81
+
82
+ **Command:** `--override-ids --override-reason "explanation"`
83
+
84
+ **Permitted when:**
85
+ - Time-critical fix requires immediate creation
86
+ - Adaptation would introduce unacceptable risk
87
+ - Existing artifact is deprecated/frozen
88
+
89
+ **Requirements:**
90
+ - Logged for audit trail
91
+ - Reviewed within 7 days
92
+ - Include override reason in gate verification log
93
+
94
+ ## Graceful Degradation
95
+
96
+ All gates implement circuit breaker:
97
+ - **Timeout:** 2s default
98
+ - **On timeout:** warn-and-proceed
99
+ - **On error:** log-and-proceed
100
+ - **Key principle:** Development NEVER blocked by IDS failures
101
+
102
+ ```yaml
103
+ circuit_breaker:
104
+ failure_threshold: 5
105
+ success_threshold: 3
106
+ reset_timeout_ms: 60000
107
+ ```
108
+
109
+ ## Article IV-A: Incremental Development (Constitution Amendment)
110
+
111
+ **Severity:** MUST
112
+
113
+ **Four Core Rules:**
114
+ 1. **Registry Consultation Required** — Query before creating
115
+ 2. **Decision Hierarchy** — REUSE > ADAPT > CREATE strictly
116
+ 3. **Adaptation Limits** — Changes < 30%, don't break consumers
117
+ 4. **Creation Requirements** — Full justification, register within 24h
118
+
119
+ **Reference:** `docs/stories/epics/epic-ids-incremental-development/`