@drafthq/draft 2.7.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 (158) hide show
  1. package/.claude-plugin/marketplace.json +38 -0
  2. package/.claude-plugin/plugin.json +26 -0
  3. package/LICENSE +21 -0
  4. package/README.md +272 -0
  5. package/bin/README.md +49 -0
  6. package/cli/bin/draft.js +13 -0
  7. package/cli/src/cli.js +113 -0
  8. package/cli/src/hosts/claude-code.js +46 -0
  9. package/cli/src/hosts/codex.js +33 -0
  10. package/cli/src/hosts/cursor.js +50 -0
  11. package/cli/src/hosts/index.js +24 -0
  12. package/cli/src/hosts/opencode.js +39 -0
  13. package/cli/src/installer.js +61 -0
  14. package/cli/src/lib/fsx.js +34 -0
  15. package/cli/src/lib/graph.js +23 -0
  16. package/cli/src/lib/log.js +32 -0
  17. package/cli/src/lib/paths.js +14 -0
  18. package/core/agents/architect.md +338 -0
  19. package/core/agents/debugger.md +193 -0
  20. package/core/agents/ops.md +104 -0
  21. package/core/agents/planner.md +158 -0
  22. package/core/agents/rca.md +314 -0
  23. package/core/agents/reviewer.md +256 -0
  24. package/core/agents/writer.md +110 -0
  25. package/core/guardrails/README.md +4 -0
  26. package/core/guardrails/code-quality.md +4 -0
  27. package/core/guardrails/dependency-triage.md +4 -0
  28. package/core/guardrails/design-norms.md +4 -0
  29. package/core/guardrails/language-standards.md +4 -0
  30. package/core/guardrails/review-checks.md +4 -0
  31. package/core/guardrails/secure-patterns.md +4 -0
  32. package/core/guardrails/security.md +4 -0
  33. package/core/guardrails.md +22 -0
  34. package/core/knowledge-base.md +127 -0
  35. package/core/methodology.md +1221 -0
  36. package/core/shared/condensation.md +224 -0
  37. package/core/shared/context-verify.md +44 -0
  38. package/core/shared/cross-skill-dispatch.md +127 -0
  39. package/core/shared/discovery-schema.md +75 -0
  40. package/core/shared/draft-context-loading.md +282 -0
  41. package/core/shared/git-report-metadata.md +106 -0
  42. package/core/shared/graph-query.md +239 -0
  43. package/core/shared/graph-usage-report.md +22 -0
  44. package/core/shared/jira-sync.md +170 -0
  45. package/core/shared/parallel-analysis.md +386 -0
  46. package/core/shared/parallel-fanout.md +10 -0
  47. package/core/shared/pattern-learning.md +146 -0
  48. package/core/shared/red-flags.md +58 -0
  49. package/core/shared/template-contract.md +22 -0
  50. package/core/shared/template-hygiene.md +10 -0
  51. package/core/shared/tool-resolver.md +10 -0
  52. package/core/shared/vcs-commands.md +97 -0
  53. package/core/shared/verification-gates.md +47 -0
  54. package/core/templates/CHANGELOG.md +70 -0
  55. package/core/templates/ai-context-export.md +8 -0
  56. package/core/templates/ai-context.md +270 -0
  57. package/core/templates/ai-profile.md +41 -0
  58. package/core/templates/architecture.md +203 -0
  59. package/core/templates/dependency-graph.md +103 -0
  60. package/core/templates/discovery.md +79 -0
  61. package/core/templates/guardrails.md +143 -0
  62. package/core/templates/hld.md +327 -0
  63. package/core/templates/intake-questions.md +403 -0
  64. package/core/templates/jira.md +119 -0
  65. package/core/templates/lld.md +283 -0
  66. package/core/templates/metadata.json +66 -0
  67. package/core/templates/plan.md +130 -0
  68. package/core/templates/product.md +110 -0
  69. package/core/templates/rca.md +86 -0
  70. package/core/templates/root-architecture.md +127 -0
  71. package/core/templates/root-product.md +53 -0
  72. package/core/templates/root-tech-stack.md +117 -0
  73. package/core/templates/service-index.md +55 -0
  74. package/core/templates/session-summary.md +8 -0
  75. package/core/templates/spec.md +165 -0
  76. package/core/templates/tech-matrix.md +101 -0
  77. package/core/templates/tech-stack.md +169 -0
  78. package/core/templates/track-architecture.md +311 -0
  79. package/core/templates/workflow.md +187 -0
  80. package/integrations/agents/AGENTS.md +24384 -0
  81. package/integrations/copilot/.github/copilot-instructions.md +24384 -0
  82. package/integrations/gemini/.gemini.md +26 -0
  83. package/package.json +53 -0
  84. package/scripts/fetch-memory-engine.sh +116 -0
  85. package/scripts/lib.sh +256 -0
  86. package/scripts/tools/_lib.sh +220 -0
  87. package/scripts/tools/adr-index.sh +117 -0
  88. package/scripts/tools/check-graph-usage-report.sh +95 -0
  89. package/scripts/tools/check-scope-conflicts.sh +139 -0
  90. package/scripts/tools/check-skill-line-caps.sh +115 -0
  91. package/scripts/tools/check-template-noop.sh +87 -0
  92. package/scripts/tools/check-track-hygiene.sh +230 -0
  93. package/scripts/tools/classify-files.sh +231 -0
  94. package/scripts/tools/cycle-detect.sh +75 -0
  95. package/scripts/tools/detect-test-framework.sh +135 -0
  96. package/scripts/tools/diff-templates-vs-tracks.sh +176 -0
  97. package/scripts/tools/emit-skill-metrics.sh +71 -0
  98. package/scripts/tools/fix-whitespace.sh +192 -0
  99. package/scripts/tools/freshness-check.sh +143 -0
  100. package/scripts/tools/git-metadata.sh +203 -0
  101. package/scripts/tools/graph-callers.sh +74 -0
  102. package/scripts/tools/graph-impact.sh +93 -0
  103. package/scripts/tools/graph-snapshot.sh +102 -0
  104. package/scripts/tools/hotspot-rank.sh +75 -0
  105. package/scripts/tools/manage-symlinks.sh +85 -0
  106. package/scripts/tools/mermaid-from-graph.sh +92 -0
  107. package/scripts/tools/migrate-track-frontmatter.sh +241 -0
  108. package/scripts/tools/parse-git-log.sh +135 -0
  109. package/scripts/tools/parse-reports.sh +114 -0
  110. package/scripts/tools/render-track.sh +145 -0
  111. package/scripts/tools/run-coverage.sh +153 -0
  112. package/scripts/tools/scan-markers.sh +144 -0
  113. package/scripts/tools/skill-caps.conf +24 -0
  114. package/scripts/tools/validate-frontmatter.sh +125 -0
  115. package/scripts/tools/verify-citations.sh +250 -0
  116. package/scripts/tools/verify-doc-anchors.sh +204 -0
  117. package/scripts/tools/verify-graph-binary.sh +154 -0
  118. package/skills/GRAPH.md +332 -0
  119. package/skills/adr/SKILL.md +374 -0
  120. package/skills/assist-review/SKILL.md +49 -0
  121. package/skills/bughunt/SKILL.md +668 -0
  122. package/skills/bughunt/references/regression-tests.md +399 -0
  123. package/skills/change/SKILL.md +267 -0
  124. package/skills/coverage/SKILL.md +336 -0
  125. package/skills/debug/SKILL.md +201 -0
  126. package/skills/decompose/SKILL.md +656 -0
  127. package/skills/deep-review/SKILL.md +326 -0
  128. package/skills/deploy-checklist/SKILL.md +254 -0
  129. package/skills/discover/SKILL.md +66 -0
  130. package/skills/docs/SKILL.md +42 -0
  131. package/skills/documentation/SKILL.md +197 -0
  132. package/skills/draft/SKILL.md +177 -0
  133. package/skills/draft/context-files.md +57 -0
  134. package/skills/draft/intent-mapping.md +37 -0
  135. package/skills/draft/quality-guide.md +51 -0
  136. package/skills/graph/SKILL.md +107 -0
  137. package/skills/impact/SKILL.md +86 -0
  138. package/skills/implement/SKILL.md +794 -0
  139. package/skills/incident-response/SKILL.md +245 -0
  140. package/skills/index/SKILL.md +848 -0
  141. package/skills/init/SKILL.md +1784 -0
  142. package/skills/init/references/architecture-spec.md +1259 -0
  143. package/skills/integrations/SKILL.md +53 -0
  144. package/skills/jira/SKILL.md +577 -0
  145. package/skills/jira/references/review.md +1322 -0
  146. package/skills/learn/SKILL.md +478 -0
  147. package/skills/new-track/SKILL.md +841 -0
  148. package/skills/ops/SKILL.md +57 -0
  149. package/skills/plan/SKILL.md +60 -0
  150. package/skills/quick-review/SKILL.md +216 -0
  151. package/skills/revert/SKILL.md +178 -0
  152. package/skills/review/SKILL.md +1114 -0
  153. package/skills/standup/SKILL.md +183 -0
  154. package/skills/status/SKILL.md +183 -0
  155. package/skills/tech-debt/SKILL.md +318 -0
  156. package/skills/testing-strategy/SKILL.md +195 -0
  157. package/skills/tour/SKILL.md +38 -0
  158. package/skills/upload/SKILL.md +117 -0
@@ -0,0 +1,143 @@
1
+ ---
2
+ project: "{PROJECT_NAME}"
3
+ module: "root"
4
+ generated_by: "draft:init"
5
+ generated_at: "{ISO_TIMESTAMP}"
6
+ ---
7
+
8
+ # Guardrails
9
+
10
+ | Field | Value |
11
+ |-------|-------|
12
+ | **Branch** | `{LOCAL_BRANCH}` → `{REMOTE/BRANCH}` |
13
+ | **Commit** | `{SHORT_SHA}` — {COMMIT_MESSAGE} |
14
+ | **Generated** | {ISO_TIMESTAMP} |
15
+ | **Synced To** | `{FULL_SHA}` |
16
+
17
+ ---
18
+
19
+ This file defines project-level guardrails and learned coding patterns. All quality commands (`/draft:bughunt`, `/draft:deep-review`, `/draft:review`) read this file and enforce its rules.
20
+
21
+ - **Hard Guardrails** — Human-defined constraints. Violations are always flagged.
22
+ - **Learned Conventions** — Auto-discovered patterns that are intentional. Quality commands skip these.
23
+ - **Learned Anti-Patterns** — Auto-discovered patterns that are problematic. Quality commands always flag these.
24
+
25
+ Run `/draft:learn` to scan the codebase and update learned patterns. Quality commands also update this file incrementally after each run.
26
+
27
+ ---
28
+
29
+ ## Hard Guardrails
30
+
31
+ <!-- Hard constraints that must never be violated. Check [x] to enable enforcement. -->
32
+
33
+ ### Git & Version Control
34
+ - [ ] No direct commits to main/master
35
+ - [ ] No force push to shared branches
36
+ - [ ] PR required for all changes
37
+
38
+ ### Code Quality
39
+ - [ ] No console.log/print statements in production code
40
+ - [ ] No commented-out code blocks
41
+ - [ ] No TODO comments without linked issue
42
+
43
+ ### Security
44
+ - [ ] No secrets/credentials in code
45
+ - [ ] No disabled security checks without documented exception
46
+ - [ ] Dependencies must pass security audit
47
+
48
+ ### Testing
49
+ - [ ] Tests required before merge
50
+ - [ ] No skipped tests without documented reason
51
+ - [ ] Coverage must not decrease
52
+
53
+ ### C++/Systems — Object Lifecycle & Memory Safety
54
+ <!-- From core/guardrails.md — C++ Hard Guardrails. Pre-checked for all C++ projects. -->
55
+ - [x] G1.1: No temporary `.c_str()` in Printf-style trace APIs (dangling pointer)
56
+ - [x] G1.2: No dangling references/pointers after object destruction
57
+ - [x] G1.3: No capture-all-by-reference `[&]` in async lambdas
58
+ - [x] G1.4: Every async functor must be wrapped with `callback_muter_`
59
+ - [x] G1.5: Never wrap op's own `done_cb` in ClosureRunner when extracting result via raw pointer
60
+ - [x] G1.6: ClosureRunner/CallbackMuter must be wrapped in correct order (`callback_muter_` first, then `cr_`)
61
+ - [x] G1.7: Every async functor must be wrapped with `cr_`
62
+ - [x] G1.8: No op member access after potential op destruction in loops
63
+ - [x] G1.9: Always return immediately after `Finish()` — no code execution post-Finish
64
+ - [x] G1.10: No unintended deep copies via `auto` (use `auto&` or `const auto&` for map lookups)
65
+ - [x] G1.11: std::move discipline — always move expensive objects; never use after move
66
+ - [x] G1.12: No `shared_ptr` binding to non-trivial objects (EventDriver holders) in callbacks
67
+
68
+ ### C++/Systems — Concurrency & Locking
69
+ - [x] G2.1: No mutable operations under shared/read locks
70
+ - [x] G2.2: Always release spinlock before invoking callbacks or `Finish()`
71
+ - [x] G2.3: No expensive object destruction under spinlock protection
72
+ - [x] G2.4: Never sacrifice locking correctness for performance optimization
73
+ - [x] G2.5: No synchronous waits (`Trigger::Wait`) in async code paths
74
+
75
+ ### C++/Systems — Control Flow & Error Handling
76
+ - [x] G3.1: Always `return` after `Finish()` in conditional blocks
77
+ - [x] G3.2: CHECKs for internal consistency only — never for external input validation
78
+ - [x] G3.3: No side-effecting expressions inside DCHECK
79
+ - [x] G3.4: CHECK/DCHECK/LOG(DFATAL) selection per severity matrix
80
+
81
+ ### C++/Systems — Format & API Correctness
82
+ - [x] G4.1: Printf format specifiers must match argument types
83
+ - [x] G4.2: MemTracer Print vs Printf selection (lazy construction vs immediate materialization)
84
+ - [x] G4.3: Use Maybe-prefixed MemTracer variants only when op may be finished
85
+ - [x] G4.4: No string + integer (pointer arithmetic, not concatenation) — use `StringPrintf`
86
+ - [x] G4.5: `boost::optional<bool>` tests presence, not value — use `*xx` or `.value_or()`
87
+
88
+ ### C++/Systems — GFlags & Runtime Configuration
89
+ - [x] G5.1: Snapshot gflag values at op start — never depend on flag stability mid-op
90
+
91
+ ### C++/Systems — Performance
92
+ - [x] G6.1: Avoid `ByteSize()` on proto objects in hot paths
93
+ - [x] G6.2: Prefer repeated fields over map fields in proto for serialization-sensitive paths
94
+ - [x] G6.3: No inline execution in `SpawnWorkersAndJoin` `done_cb`
95
+
96
+ > Check the guardrails that apply to this project. Unchecked items are not enforced. Quality commands flag violations of checked guardrails only.
97
+ > **C++/Systems guardrails** are pre-checked and enforced by default. See `core/guardrails.md` for full descriptions and fix guidance. Uncheck only if the project does not contain C++ code.
98
+
99
+ ---
100
+
101
+ ## Learned Conventions
102
+
103
+ <!-- Auto-discovered coding patterns verified as intentional. Quality commands skip these. -->
104
+ <!-- Each entry is added by /draft:learn or by quality commands during post-analysis. -->
105
+ <!-- Format: pattern name, category, confidence, evidence, description. -->
106
+
107
+ <!-- No learned conventions yet. Run /draft:learn or a quality command to discover patterns. -->
108
+
109
+ ---
110
+
111
+ ## Learned Anti-Patterns
112
+
113
+ <!-- Auto-discovered patterns verified as problematic. Quality commands always flag these. -->
114
+ <!-- Each entry is added by /draft:learn or by quality commands during post-analysis. -->
115
+ <!-- Entry format:
116
+ ### [Anti-Pattern Name]
117
+ - **Category:** security | reliability | performance | correctness | concurrency
118
+ - **Severity:** critical | high | medium
119
+ - **graph_severity:** critical | high | medium | low | unresolved (fanIn-derived; "unresolved" if no graph data)
120
+ - **high_fanin_files:** `path/file.go` (fanIn:12) (omit if none meet fanIn ≥ 5)
121
+ - **Evidence:** Found in N files — `path/file.ext:line`
122
+ - **Discovered at:** YYYY-MM-DD
123
+ - **Established at:** YYYY-MM-DD
124
+ - **Last verified:** YYYY-MM-DD
125
+ - **Last active:** YYYY-MM-DD
126
+ - **Discovered by:** draft:[command] on YYYY-MM-DD
127
+ - **Description:** [What the pattern is and why it's problematic]
128
+ - **Suggested fix:** [Brief description of the correct approach]
129
+ -->
130
+
131
+ <!-- No learned anti-patterns yet. Run /draft:learn or a quality command to discover patterns. -->
132
+
133
+ ---
134
+
135
+ ## Pattern Promotion
136
+
137
+ Learned patterns with `confidence: high` and consistent evidence across multiple quality runs are candidates for promotion:
138
+
139
+ - **Convention → Accepted Pattern**: Promote to `tech-stack.md ## Accepted Patterns` for technology-level decisions
140
+ - **Convention → Hard Guardrail**: Promote to Hard Guardrails above if the team wants enforcement
141
+ - **Anti-Pattern → Hard Guardrail**: Promote to Hard Guardrails above for mandatory enforcement
142
+
143
+ Run `/draft:learn promote` to review candidates.
@@ -0,0 +1,327 @@
1
+ ---
2
+ project: "{PROJECT_NAME}"
3
+ module: "root"
4
+ track_id: "{TRACK_ID}"
5
+ generated_by: "draft:decompose"
6
+ generated_at: "{ISO_TIMESTAMP}"
7
+ # Stable frontmatter only (WS-8). Ephemeral fields live in metadata.json
8
+ # and render via <!-- META:<key> --> directives.
9
+ links:
10
+ spec: "./spec.md"
11
+ plan: "./plan.md"
12
+ lld: "./lld.md"
13
+ project_architecture: "../../architecture.md"
14
+ ---
15
+
16
+ # {TRACK_TITLE} — HLD
17
+
18
+ **_TBD_author_** (_TBD_email_) <!-- REQUIRED -->
19
+
20
+ **Status:** <!-- META:status --> <!-- REQUIRED -->
21
+
22
+ > Track ID: `{TRACK_ID}` — generated by `draft:decompose`. Requirements live in [`./spec.md`](./spec.md); implementation tasks in [`./plan.md`](./plan.md); detailed design in [`./lld.md`](./lld.md). For project-wide architecture, see [`../../architecture.md`](../../architecture.md).
23
+
24
+ ## Scope <!-- OPTIONAL -->
25
+
26
+ - **Includes:** <!-- META:scope_includes -->
27
+ - **Excludes:** <!-- META:scope_excludes -->
28
+
29
+ > Conflicts surfaced by `scripts/tools/check-scope-conflicts.sh`.
30
+
31
+ ---
32
+
33
+ ## Approvals
34
+
35
+ > **Pre-fill:** Pulled from `spec.md` frontmatter `approvers.*`. Replace `{...}` with actual names; capture sign-off date and comments per row. Draft gates `git upload` on this table being populated for `criticality ∈ {high, mission-critical}` tracks.
36
+
37
+ | Role | Approver | Date | Comments | <!-- REQUIRED for criticality ∈ {high, mission-critical} -->
38
+ |------|----------|------|----------|
39
+ | Technical Leads | _TBD_approver_tech_leads_ | _TBD_date_ | _TBD_comments_ |
40
+ | Architecture Review Board | _TBD_approver_arb_ | _TBD_date_ | _TBD_comments_ |
41
+ | Cloud Operations (For SaaS deployments) | _TBD_approver_cloudops_ | _TBD_date_ | _TBD_comments_ |
42
+ | Quality Assurance (For on-prem services) | _TBD_approver_qa_ | _TBD_date_ | _TBD_comments_ |
43
+ | Product Management | _TBD_approver_pm_ | _TBD_date_ | _TBD_comments_ |
44
+
45
+ ---
46
+
47
+ ## Table of Contents
48
+
49
+ 1. [Background](#background)
50
+ 2. [Requirements](#requirements)
51
+ 3. [High Level Design](#high-level-design)
52
+ 4. [Detailed Design](#detailed-design)
53
+ 5. [Dependencies](#dependencies)
54
+ 6. [Intellectual Property](#intellectual-property)
55
+ 7. [Checklist](#checklist)
56
+ 8. [Deployment](#deployment)
57
+ 9. [Observability](#observability)
58
+
59
+ ---
60
+
61
+ ## Background
62
+
63
+ <Describe the background - current state, why>
64
+
65
+ **Ideal Length:** ½ to 1 page
66
+
67
+ > **Source:** auto-pulled from `spec.md` §Problem Statement and §Background & Why Now. Tighten as needed for HLD audience.
68
+
69
+ ---
70
+
71
+ ## Requirements
72
+
73
+ > **Source:** [`./spec.md`](./spec.md) is the requirements scorecard. Do not duplicate content here — link to the spec sections.
74
+
75
+ - **Blackbox (feature/service-level) requirements:** see [`./spec.md` §Requirements / Functional](./spec.md#requirements)
76
+ - **Whitebox (technical, per-component) requirements:** see [`./lld.md` §Requirements](./lld.md#requirements)
77
+ - **Acceptance Criteria:** see [`./spec.md` §Acceptance Criteria](./spec.md#acceptance-criteria)
78
+ - **Non-Functional Requirements:** see [`./spec.md` §Requirements / Non-Functional](./spec.md#requirements)
79
+
80
+ <If requirements warrant changes in UX or a new UX, include UX mock here>
81
+
82
+ ---
83
+
84
+ ## High Level Design
85
+
86
+ ### Architecture
87
+
88
+ **Primary goal:** Explain various components and their interactions at a very high level
89
+
90
+ <!-- GRAPH:track-component-diagram:START -->
91
+ <!-- Rendered by draft:decompose Step 5a from track module set + integration edges.
92
+ Mermaid flowchart TD with three subgraphs: Track (modules in scope),
93
+ Existing (existing modules this track touches), External (DB/queue/3P APIs).
94
+ Edges labeled with transport (HTTP, RPC, queue, direct call) when non-obvious. -->
95
+ <!-- GRAPH:track-component-diagram:END -->
96
+
97
+ **Architecture narrative** (≤300 words). Explain how the blackbox requirements are translated into the architecture — name the architectural style (hexagonal / layered / pipeline / event-driven), justify from observable evidence, and call out the dominant interaction pattern (sync RPC, async event, batch).
98
+
99
+ ### UI Architecture Changes
100
+
101
+ **Primary goal:** Explain UI changes necessary for the feature / service
102
+
103
+ - Is it MFE based, or is factored into existing service UI?
104
+ - Are there changes to the UI infra libraries, components?
105
+ - Tradeoffs between implementing business logic in backend vs UI
106
+
107
+ _If no UI changes: write `N/A — backend-only track.`_
108
+
109
+ ### Key Design Decisions
110
+
111
+ <Discuss key design choices. This is a summary of the design choices in the architecture>
112
+
113
+ - **Decision 1:** {one-sentence statement} — _Why:_ {observable constraint, not aesthetic}
114
+ - **Decision 2:** {one-sentence statement} — _Why:_ {observable constraint, not aesthetic}
115
+
116
+ ### Alternatives Considered
117
+
118
+ <Alternative architectures and design choices considered and reasons for decisions>
119
+
120
+ | Alternative | Rejected Because | promote_to_adr | <!-- REQUIRED -->
121
+ |-------------|------------------|----------------|
122
+ | _TBD_alt_1_ | _TBD_alt_1_reason_ | _TBD_alt_1_promote_to_adr_ (yes / no — if yes, run `/draft:adr`) |
123
+
124
+ #### Notes for HLD Sections
125
+
126
+ - Try not to use examples to illustrate the design here
127
+ - Don't include detailed design aspects here (e.g. Sequence diagrams for workflows — those go in [`./lld.md`](./lld.md))
128
+
129
+ ---
130
+
131
+ ## Detailed Design
132
+
133
+ ### Component Level Design
134
+
135
+ **Primary goal:** Zoom into each component and explain its design in detail
136
+
137
+ <!-- GRAPH:track-component-table:START -->
138
+ <!-- Rendered by draft:decompose Step 5a — one row per module in scope.
139
+ Columns: Module, Status (New/Modified/Existing), Files, Public API count,
140
+ Fan-In, Fan-Out, Complexity, Primary Deps, concurrency_model,
141
+ aggregate_resource_cap, parallel_flag_interaction, Citation. -->
142
+ <!-- WS-7 required columns: concurrency_model, aggregate_resource_cap,
143
+ parallel_flag_interaction. Use "n/a" when truly inapplicable. -->
144
+ <!-- GRAPH:track-component-table:END -->
145
+
146
+ For each component, populate one subsection:
147
+
148
+ #### [Component Name]
149
+
150
+ **Responsibility:** {one sentence — what this module owns}
151
+ **Status:** `New` | `Modified` | `Existing`
152
+ **Entry point:** `{path:line}` → `{symbol}`
153
+ **Public API:** see [`./lld.md` §Classes and Interfaces — {component}](./lld.md#classes-and-interfaces)
154
+ **Whitebox requirements addressed:** {list AC IDs from spec.md} <!-- back-link to discovery.md Hotspot rows -->
155
+ **Discovery hotspots addressed:** {list Hotspot-row IDs from `./discovery.md`} <!-- REQUIRED -->
156
+
157
+ **Design notes** (≤200 words). How this component translates whitebox requirements into structure. Cite `path:line` for non-obvious decisions.
158
+
159
+ #### Key Design Decisions
160
+
161
+ <Discuss key design choices that are relevant at the component level>
162
+
163
+ #### Alternatives Considered
164
+
165
+ <Alternative designs considered for the component if any, and reasons for decisions>
166
+
167
+ #### Notes for Detailed Sections
168
+
169
+ - Include APIs, sequence diagrams for important workflows in the components — sequence diagrams live in [`./lld.md` §Key Algorithms and Workflows](./lld.md#key-algorithms-and-workflows)
170
+ - Don't include data structures, protobuf definitions, class level interfaces here (they belong in [`./lld.md`](./lld.md))
171
+
172
+ ---
173
+
174
+ ## Dependencies
175
+
176
+ <Identify all components dependent on your design proposal. It is important to review this list to identify alternatives, which would minimize/eliminate the impact to other components. It is also important to highlight this list during the design review discussion to raise awareness of the dependent component changes that need to be planned.>
177
+
178
+ <!-- GRAPH:track-dependencies:START -->
179
+ <!-- Rendered by draft:decompose Step 5a from cross-module integration edges.
180
+ Columns: Dependent Component, Edge Kind (call/import/event/shared-schema),
181
+ Impact Assessment (Small/Medium/Large), Description, Citation. -->
182
+ <!-- GRAPH:track-dependencies:END -->
183
+
184
+ | Dependent Component | Impact Assessment | Description | Citation |
185
+ |---|---|---|---|
186
+ | [Component Name] | Small / Medium / Large | Detailed description of the impacted functionality. | `path:line` |
187
+
188
+ ---
189
+
190
+ ## Intellectual Property
191
+
192
+ ### Inventions
193
+
194
+ Provide a brief list and summary of all inventions associated with the proposed design.
195
+
196
+ 1.
197
+ 2.
198
+ 3.
199
+
200
+ **Were Invention Disclosure Forms (IDFs) submitted for the inventions listed?**
201
+
202
+ - [ ] Yes
203
+ - [ ] No
204
+
205
+ > If No, submit an Invention Disclosure Form through your company's standard IP process.
206
+
207
+ ### Third Party Technology (TPT)
208
+
209
+ **TPT includes:**
210
+ - **Open Source Software (OSS):** Software licensed under an Open Source License (e.g., MIT, BSD, GPL, Apache)
211
+ - **Commercial (non-OSS) Technology:** Non- software, documentation, content, APIs, SDKs, logos, artwork, data, GUIs, Tools, databases, and other intellectual property NOT licensed under an Open Source License
212
+
213
+ #### List All NEW TPT Used
214
+
215
+ | TPT | Where/How? |
216
+ |---|---|
217
+ | | |
218
+
219
+ **Note:** As noted in the TPT Policy, prior to downloading/onboarding any new TPT, you must do the following:
220
+
221
+ 1. **For all new OSS:**
222
+ - Document the license and usage. Follow your organization's legal and security review process for Open Source.
223
+
224
+ 2. **For all new Commercial TPT:**
225
+ - Follow your organization's procurement and legal review process before onboarding any commercial technology or non-open-source assets.
226
+
227
+ ---
228
+
229
+ ## Checklist
230
+
231
+ > **Draft integration:** `/draft:deploy-checklist` validates each row below is populated before allowing deploy of `criticality ∈ {high, mission-critical}` tracks.
232
+
233
+ ### Performance <!-- REQUIRED -->
234
+
235
+ - Describe request QPS and 95th percentile latency
236
+
237
+ | Budget | Value | Baseline source | <!-- REQUIRED -->
238
+ |--------|-------|-----------------|
239
+ | p50 latency | _TBD_p50_ | _TBD_p50_baseline_ |
240
+ | p95 latency | _TBD_p95_ | _TBD_p95_baseline_ |
241
+ | p99 latency | _TBD_p99_ | _TBD_p99_baseline_ |
242
+ | Throughput target | _TBD_throughput_ | _TBD_throughput_baseline_ |
243
+ | Resource budget (CPU / RAM / IO) | _TBD_resource_budget_ | _TBD_resource_baseline_ |
244
+
245
+ ### Scale <!-- REQUIRED -->
246
+
247
+ - Does the service scale horizontally? What are the metrics used for this?
248
+ - Is vertical scaling required?
249
+ - Are there fundamental scaling bottlenecks? (e.g., single leader doing unbounded work)
250
+
251
+ ### Security <!-- REQUIRED -->
252
+
253
+ - How are credentials protected?
254
+ - Are there any firewall / ports implications?
255
+ - Is there any resource level RBAC needed for this feature / service?
256
+ - Are there any certificate management implications? (e.g., manual deployment etc.)
257
+ - Is customer data protected with encryption?
258
+
259
+ ### Resiliency <!-- REQUIRED -->
260
+
261
+ - Describe the kind and number of failures that may cause service unavailability
262
+ - How is graceful degradation on a fault handled?
263
+
264
+ ### Multi-tenancy <!-- REQUIRED -->
265
+
266
+ - Is the data / metadata isolated across tenants? In other words, even if datastore is shared, query correctness / partitioning should ensure no leaks should happen
267
+ - Can the tenants expect predictable performance regardless of other tenants' workloads?
268
+ - Can the data and state (config and runtime) of a tenant be migrated?
269
+
270
+ ### Upgrade <!-- REQUIRED -->
271
+
272
+ - Is there any breakage in backward compatibility in API or data model?
273
+ - What are the dependent services that need to be upgraded prior to this? (e.g., in SaaS, this service upgrade depends on a new ElasticSearch manager service version)
274
+ - Does the impact of changes go beyond the upgraded cluster / service instance? (e.g., if this is a cluster change, will it break reporting or remote replication)
275
+
276
+ ### Flags and Controlled Rollout of Features <!-- REQUIRED -->
277
+
278
+ - Does this change the persistent state? If yes, describe the flags used to protect the change
279
+ - Is the feature going to be rolled out in a controlled manner? If yes, describe the targets and the feature flags here
280
+
281
+ | Field | Value | <!-- REQUIRED -->
282
+ |-------|-------|
283
+ | `flag_name` | _TBD_flag_name_ |
284
+ | `cluster_feature_gate` | _TBD_cluster_feature_gate_ |
285
+ | `kill_switch_test_id` | _TBD_kill_switch_test_id_ |
286
+ | `runbook_link` | _TBD_runbook_link_ |
287
+ | `sunset_criteria` | _TBD_sunset_criteria_ |
288
+
289
+ ### Cost Implications <!-- REQUIRED -->
290
+
291
+ *Primarily for SaaS deployments*
292
+
293
+ - Include cloud cost calculation here
294
+ - Is there any cost to the customer for cloud workloads?
295
+ - Is there any sizing impact?
296
+
297
+ ---
298
+
299
+ ## Pre-Deploy Validation <!-- REQUIRED -->
300
+
301
+ `scripts/tools/check-track-hygiene.sh` → hygiene clean
302
+ `scripts/tools/verify-citations.sh` → citations clean (±5 lines tolerance)
303
+ `scripts/tools/verify-doc-anchors.sh` → anchors and §-refs resolve
304
+ `scripts/tools/check-graph-usage-report.sh` → Graph Usage Report present
305
+ `scripts/tools/check-scope-conflicts.sh` → no overlap with adjacent tracks
306
+ `scripts/tools/diff-templates-vs-tracks.sh` → no schema drift
307
+
308
+ Result stored in `metadata.json:pre_deploy_status`
309
+ (`unrun` / `passing` / `failing` / `bypassed`). Deploy is blocked unless
310
+ `passing`.
311
+
312
+ ---
313
+
314
+ ## Deployment
315
+
316
+ - Is there any dependency on the platform where this is deployed?
317
+ - For DP: on-prem vs customer managed cloud vs SaaS vs Services running in the cloud
318
+ - For CP: self managed on-prem vs SaaS vs IBM cloud
319
+
320
+ ---
321
+
322
+ ## Observability
323
+
324
+ - List down the key metrics (don't list all metrics) that SREs need to look at to identify issues
325
+ - List down alerting thresholds on those metrics
326
+
327
+ > Per-component metrics + alert threshold tables live in [`./lld.md` §Observability](./lld.md#observability).