@konductro/codex-plugin 2.0.0 → 2.1.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.
package/README.md CHANGED
@@ -67,6 +67,7 @@ Skills are guided, multi-step workflows invoked by asking Codex naturally:
67
67
  | `konductro-find-prototype` | Find and download approved UX prototypes for the current project |
68
68
  | `konductro-profile-repository` | Scan the current repo and submit its profile to Konductro |
69
69
  | `konductro-start-ticket` | Pick up an assigned ticket and start work |
70
+ | `konductro-bug-enrich` | Enrich a bug ticket with technical analysis — explores codebase and submits structured context |
70
71
 
71
72
  ## Tools
72
73
 
@@ -114,6 +115,8 @@ Tools are called automatically by Codex based on natural language. You do not in
114
115
  | Tool | What it does |
115
116
  |---|---|
116
117
  | `profile_repository` | Submit a repository profile: tech stack, APIs, dependencies, and events |
118
+ | `get_bug_for_enrichment` | Load a bug ticket and project context for enrichment |
119
+ | `submit_bug_enrichment` | Submit structured technical enrichment for a bug ticket |
117
120
 
118
121
  ## Updating
119
122
 
@@ -133,7 +136,7 @@ Restart Codex after updating.
133
136
  | `EACCES` permission error | Use `sudo` or fix npm global permissions |
134
137
  | Token rejected | Verify the token has not been revoked in Konductro settings |
135
138
  | Plugin not recognised by Codex | Restart Codex after setup |
136
- | Tools are not available | Confirm `~/.codex/config.toml` contains `konductro@local-konductro` with `enabled = true` |
139
+ | Tools are not available | Confirm `~/.codex/config.toml` contains `konductro@local` with `enabled = true` |
137
140
  | Connection timeout | Check that `platform.konductro.com` is reachable from your network |
138
141
 
139
142
  ## Local Development
package/bin/setup.js CHANGED
@@ -142,7 +142,7 @@ function updateCodexConfig() {
142
142
 
143
143
  config = upsertTomlBlock(
144
144
  config,
145
- '[marketplaces.local-konductro]',
145
+ '[marketplaces.local]',
146
146
  [
147
147
  `last_updated = ${JSON.stringify(new Date().toISOString())}`,
148
148
  'source_type = "local"',
@@ -152,7 +152,7 @@ function updateCodexConfig() {
152
152
 
153
153
  config = upsertTomlBlock(
154
154
  config,
155
- '[plugins."konductro@local-konductro"]',
155
+ '[plugins."konductro@local"]',
156
156
  'enabled = true',
157
157
  );
158
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konductro/codex-plugin",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Codex plugin for the Konductro platform: technical analysis, delivery tasks, repository profiling, and prototype workflows.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -899,6 +899,87 @@ server.tool(
899
899
  }
900
900
  );
901
901
 
902
+ // Tool: Get bug context for enrichment
903
+ server.tool(
904
+ 'get_bug_for_enrichment',
905
+ 'Load a bug ticket and its project context for enrichment. Returns the bug description, acceptance criteria, project name, and existing notes.',
906
+ {
907
+ ticketId: z.string().describe('The ticket ID or key (e.g. KON-42) of the bug to enrich'),
908
+ },
909
+ async ({ ticketId }) => {
910
+ try {
911
+ const ctx = await konductroFetch(`/api/cli/bugs/${encodeURIComponent(ticketId)}/context`);
912
+
913
+ let text = `## Bug Context\n\n`;
914
+ text += `**Ticket:** ${ctx.key} — ${ctx.title}\n`;
915
+ text += `**Project:** ${ctx.projectName ?? 'Unknown'}\n`;
916
+ text += `**Phase:** ${ctx.phaseName ?? 'Unknown'}\n`;
917
+ if (ctx.componentPath) text += `**Component:** ${ctx.componentPath}\n`;
918
+ if (ctx.repository) text += `**Repository:** ${ctx.repository.name} (${ctx.repository.repoType}) — ${ctx.repository.repoUrl}\n`;
919
+ text += `\n`;
920
+
921
+ text += `### Description\n\n${ctx.description}\n\n`;
922
+
923
+ if (ctx.acceptanceCriteria?.length > 0) {
924
+ text += `### Acceptance Criteria\n\n`;
925
+ ctx.acceptanceCriteria.forEach((ac, i) => { text += `${i + 1}. ${ac}\n`; });
926
+ text += `\n`;
927
+ }
928
+
929
+ if (ctx.architecturalNotes?.length > 0) {
930
+ text += `### Existing Notes\n\n`;
931
+ ctx.architecturalNotes.forEach(n => { text += `- ${n}\n`; });
932
+ text += `\n`;
933
+ }
934
+
935
+ return { content: [{ type: 'text', text }] };
936
+ } catch (err) {
937
+ const msg = err.message?.includes('BUG_NOT_FOUND') || err.message?.includes('404')
938
+ ? `Ticket ${ticketId} not found or is not a bug.`
939
+ : `Failed to load bug context: ${err.message}`;
940
+ return { content: [{ type: 'text', text: msg }], isError: true };
941
+ }
942
+ }
943
+ );
944
+
945
+ // Tool: Submit bug enrichment
946
+ server.tool(
947
+ 'submit_bug_enrichment',
948
+ 'Submit structured technical enrichment for a bug ticket. At least one field must be provided. The enrichment is append-only — the original description is never modified.',
949
+ {
950
+ ticketId: z.string().describe('The ticket ID or key (e.g. KON-42) of the bug to enrich'),
951
+ suspectedRootCause: z.string().optional().describe('Your assessment of why the bug occurs'),
952
+ affectedComponents: z.array(z.string()).optional().describe('File paths or module names involved'),
953
+ stackTraceHints: z.array(z.string()).optional().describe('Relevant error origins, log lines, or exception paths'),
954
+ investigationSteps: z.array(z.string()).optional().describe('What you checked and what you found'),
955
+ verifyFixCriteria: z.array(z.string()).optional().describe('Conditions that confirm the bug is fixed (appended to acceptance criteria)'),
956
+ },
957
+ async ({ ticketId, suspectedRootCause, affectedComponents, stackTraceHints, investigationSteps, verifyFixCriteria }) => {
958
+ if (!suspectedRootCause && !affectedComponents?.length && !stackTraceHints?.length && !investigationSteps?.length && !verifyFixCriteria?.length) {
959
+ return { content: [{ type: 'text', text: 'At least one enrichment field must be provided.' }], isError: true };
960
+ }
961
+
962
+ try {
963
+ const result = await konductroFetch(`/api/cli/bugs/${encodeURIComponent(ticketId)}/enrich`, {
964
+ method: 'POST',
965
+ body: JSON.stringify({ suspectedRootCause, affectedComponents, stackTraceHints, investigationSteps, verifyFixCriteria }),
966
+ });
967
+
968
+ const applied = result.fieldsApplied?.length > 0
969
+ ? `Enrichment applied: ${result.fieldsApplied.join(', ')}`
970
+ : 'No new enrichment applied (fields may already exist on the ticket).';
971
+ return { content: [{ type: 'text', text: applied }] };
972
+ } catch (err) {
973
+ const msg = err.message?.includes('BUG_NOT_FOUND') || err.message?.includes('404')
974
+ ? `Ticket ${ticketId} not found or is not a bug.`
975
+ : err.message?.includes('INVALID_ENRICHMENT')
976
+ ? 'At least one enrichment field must be provided.'
977
+ : `Failed to submit enrichment: ${err.message}`;
978
+ return { content: [{ type: 'text', text: msg }], isError: true };
979
+ }
980
+ }
981
+ );
982
+
902
983
  // Start the server
903
984
  async function main() {
904
985
  const transport = new StdioServerTransport();
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: konductro-bug-enrich
3
+ description: Enrich an existing bug ticket with technical analysis. Use when assigned to triage a bug — fetches the ticket, explores the codebase locally, and submits structured technical context back to Konductro.
4
+ ---
5
+
6
+ # Konductro Bug Enrichment
7
+
8
+ You are enriching an existing bug ticket with technical context for the Konductro delivery platform. Your role is to add structured technical detail — never to rewrite or modify the user's original bug description.
9
+
10
+ ## Critical Constraint
11
+
12
+ **DO NOT modify the original `description` of the ticket.** The enrichment is append-only. Your job is to add technical context (root cause, affected components, investigation steps) — the user's original report is preserved byte-for-byte by the server.
13
+
14
+ ## Workflow
15
+
16
+ ### Step 1: Accept Ticket ID
17
+
18
+ The user provides a ticket ID (e.g. `KON-42` or a UUID) as a positional argument from `/bug-enrich <ticket-id>`.
19
+
20
+ ### Step 2: Load Bug Context
21
+
22
+ Call `get_bug_for_enrichment` with the ticket ID. This returns:
23
+ - The bug title, description, and existing acceptance criteria
24
+ - Project and phase context
25
+ - Any existing architectural notes or component path
26
+
27
+ Review the bug report and share a summary with the user. Confirm you understand the issue.
28
+
29
+ ### Step 3: Explore the Codebase
30
+
31
+ The user has the target repository cloned locally. Use Glob, Grep, and Read to investigate:
32
+
33
+ - **Affected code paths** — trace the flow described in the bug report
34
+ - **Potential root cause** — look for the code that could produce the described behaviour
35
+ - **Related components** — what files/modules are involved
36
+ - **Stack trace clues** — if error messages are mentioned, find where they originate
37
+ - **Fix verification** — what would need to be true for the bug to be resolved
38
+
39
+ Focus your exploration on what's relevant to the bug. Don't scan the entire codebase.
40
+
41
+ ### Step 4: Plan the Enrichment
42
+
43
+ Based on your investigation, prepare structured enrichment fields:
44
+
45
+ - **suspectedRootCause** — your best assessment of why the bug occurs (reference specific code)
46
+ - **affectedComponents** — file paths or module names involved
47
+ - **stackTraceHints** — relevant error origins, log lines, or exception paths
48
+ - **investigationSteps** — what you checked and what you found
49
+ - **verifyFixCriteria** — specific conditions that confirm the bug is fixed (these get appended to acceptance criteria)
50
+
51
+ Present your findings to the user before submitting.
52
+
53
+ ### Step 5: Submit Enrichment
54
+
55
+ After the user approves, call `submit_bug_enrichment` with the ticket ID and your structured findings. The server applies them using append-only rules:
56
+ - `architecturalNotes` receives prefixed entries
57
+ - `componentPath` is set only if currently empty
58
+ - `acceptanceCriteria` receives verify-fix criteria (de-duplicated)
59
+
60
+ Report success and summarise what was applied.
61
+
62
+ ## Important Rules
63
+
64
+ - Always load the bug context first — don't assume or hallucinate ticket contents
65
+ - Explore the ACTUAL local codebase — don't invent file paths or code snippets
66
+ - Reference specific files, line numbers, and function names in your findings
67
+ - Present findings for user review before submitting
68
+ - Never modify the original description — enrichment is additive only
69
+ - If you can't find relevant code, say so honestly rather than guessing