@mmnto/cli 1.4.2 → 1.5.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 (109) hide show
  1. package/dist/adapters/gh-utils.d.ts.map +1 -1
  2. package/dist/adapters/gh-utils.js +14 -11
  3. package/dist/adapters/gh-utils.js.map +1 -1
  4. package/dist/adapters/gh-utils.test.js +22 -1
  5. package/dist/adapters/gh-utils.test.js.map +1 -1
  6. package/dist/assets/baseline-packs.d.ts +16 -0
  7. package/dist/assets/baseline-packs.d.ts.map +1 -0
  8. package/dist/assets/baseline-packs.js +137 -0
  9. package/dist/assets/baseline-packs.js.map +1 -0
  10. package/dist/commands/compile.d.ts +1 -0
  11. package/dist/commands/compile.d.ts.map +1 -1
  12. package/dist/commands/compile.js +153 -179
  13. package/dist/commands/compile.js.map +1 -1
  14. package/dist/commands/config-drift.test.js +5 -4
  15. package/dist/commands/config-drift.test.js.map +1 -1
  16. package/dist/commands/docs.d.ts +7 -0
  17. package/dist/commands/docs.d.ts.map +1 -1
  18. package/dist/commands/docs.js +16 -5
  19. package/dist/commands/docs.js.map +1 -1
  20. package/dist/commands/docs.test.js +53 -1
  21. package/dist/commands/docs.test.js.map +1 -1
  22. package/dist/commands/doctor.d.ts +15 -0
  23. package/dist/commands/doctor.d.ts.map +1 -0
  24. package/dist/commands/doctor.js +409 -0
  25. package/dist/commands/doctor.js.map +1 -0
  26. package/dist/commands/doctor.test.d.ts +2 -0
  27. package/dist/commands/doctor.test.d.ts.map +1 -0
  28. package/dist/commands/doctor.test.js +269 -0
  29. package/dist/commands/doctor.test.js.map +1 -0
  30. package/dist/commands/extract.d.ts.map +1 -1
  31. package/dist/commands/extract.js +8 -1
  32. package/dist/commands/extract.js.map +1 -1
  33. package/dist/commands/init-detect.d.ts +5 -0
  34. package/dist/commands/init-detect.d.ts.map +1 -1
  35. package/dist/commands/init-detect.js +52 -0
  36. package/dist/commands/init-detect.js.map +1 -1
  37. package/dist/commands/init-templates.d.ts +16 -1
  38. package/dist/commands/init-templates.d.ts.map +1 -1
  39. package/dist/commands/init-templates.js +80 -0
  40. package/dist/commands/init-templates.js.map +1 -1
  41. package/dist/commands/init.d.ts +3 -2
  42. package/dist/commands/init.d.ts.map +1 -1
  43. package/dist/commands/init.js +52 -14
  44. package/dist/commands/init.js.map +1 -1
  45. package/dist/commands/init.test.js +112 -0
  46. package/dist/commands/init.test.js.map +1 -1
  47. package/dist/commands/install-hooks.d.ts +24 -3
  48. package/dist/commands/install-hooks.d.ts.map +1 -1
  49. package/dist/commands/install-hooks.js +105 -57
  50. package/dist/commands/install-hooks.js.map +1 -1
  51. package/dist/commands/install-hooks.test.js +137 -20
  52. package/dist/commands/install-hooks.test.js.map +1 -1
  53. package/dist/commands/list.d.ts +3 -0
  54. package/dist/commands/list.d.ts.map +1 -0
  55. package/dist/commands/list.js +44 -0
  56. package/dist/commands/list.js.map +1 -0
  57. package/dist/commands/list.test.d.ts +2 -0
  58. package/dist/commands/list.test.d.ts.map +1 -0
  59. package/dist/commands/list.test.js +131 -0
  60. package/dist/commands/list.test.js.map +1 -0
  61. package/dist/commands/run-compiled-rules.d.ts +1 -2
  62. package/dist/commands/run-compiled-rules.d.ts.map +1 -1
  63. package/dist/commands/run-compiled-rules.js +1 -2
  64. package/dist/commands/run-compiled-rules.js.map +1 -1
  65. package/dist/commands/shield-hints.d.ts +6 -0
  66. package/dist/commands/shield-hints.d.ts.map +1 -0
  67. package/dist/commands/shield-hints.js +44 -0
  68. package/dist/commands/shield-hints.js.map +1 -0
  69. package/dist/commands/shield-hints.test.d.ts +2 -0
  70. package/dist/commands/shield-hints.test.d.ts.map +1 -0
  71. package/dist/commands/shield-hints.test.js +151 -0
  72. package/dist/commands/shield-hints.test.js.map +1 -0
  73. package/dist/commands/shield.d.ts +6 -4
  74. package/dist/commands/shield.d.ts.map +1 -1
  75. package/dist/commands/shield.js +72 -33
  76. package/dist/commands/shield.js.map +1 -1
  77. package/dist/commands/shield.test.js +34 -3
  78. package/dist/commands/shield.test.js.map +1 -1
  79. package/dist/commands/sync.d.ts.map +1 -1
  80. package/dist/commands/sync.js +18 -1
  81. package/dist/commands/sync.js.map +1 -1
  82. package/dist/commands/sync.test.js +17 -1
  83. package/dist/commands/sync.test.js.map +1 -1
  84. package/dist/index.js +32 -5
  85. package/dist/index.js.map +1 -1
  86. package/dist/orchestrators/anthropic-orchestrator.d.ts.map +1 -1
  87. package/dist/orchestrators/anthropic-orchestrator.js +1 -0
  88. package/dist/orchestrators/anthropic-orchestrator.js.map +1 -1
  89. package/dist/orchestrators/gemini-orchestrator.d.ts.map +1 -1
  90. package/dist/orchestrators/gemini-orchestrator.js +4 -1
  91. package/dist/orchestrators/gemini-orchestrator.js.map +1 -1
  92. package/dist/orchestrators/ollama-orchestrator.d.ts.map +1 -1
  93. package/dist/orchestrators/ollama-orchestrator.js +8 -4
  94. package/dist/orchestrators/ollama-orchestrator.js.map +1 -1
  95. package/dist/orchestrators/openai-orchestrator.d.ts.map +1 -1
  96. package/dist/orchestrators/openai-orchestrator.js +1 -0
  97. package/dist/orchestrators/openai-orchestrator.js.map +1 -1
  98. package/dist/orchestrators/orchestrator.d.ts +2 -0
  99. package/dist/orchestrators/orchestrator.d.ts.map +1 -1
  100. package/dist/orchestrators/orchestrator.js.map +1 -1
  101. package/dist/ui.js +2 -2
  102. package/dist/ui.js.map +1 -1
  103. package/dist/utils.d.ts +11 -3
  104. package/dist/utils.d.ts.map +1 -1
  105. package/dist/utils.js +68 -14
  106. package/dist/utils.js.map +1 -1
  107. package/dist/utils.test.js +52 -3
  108. package/dist/utils.test.js.map +1 -1
  109. package/package.json +5 -3
@@ -1 +1 @@
1
- {"version":3,"file":"gh-utils.d.ts","sourceRoot":"","sources":["../../src/adapters/gh-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CA8BlE;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAaxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,CAAC,CAyBH"}
1
+ {"version":3,"file":"gh-utils.d.ts","sourceRoot":"","sources":["../../src/adapters/gh-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CA8BlE;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAOxD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,IAAI,EAAE,MAAM,EAAE,EACd,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,CAAC,CAuBH"}
@@ -4,6 +4,17 @@ import { TotemConfigError, TotemError, TotemParseError } from '@mmnto/totem';
4
4
  import { GH_TIMEOUT_MS, IS_WIN } from '../utils.js';
5
5
  const GH_MAX_BUFFER = 10 * 1024 * 1024; // 10MB — handles paginated API responses
6
6
  const GH_PAGINATED_TIMEOUT_MS = 60_000; // 60s — paginated endpoints can be slow
7
+ /** Shared exec options for all `gh` CLI calls. */
8
+ function ghExecOptions(cwd, timeout) {
9
+ return {
10
+ cwd,
11
+ encoding: 'utf-8',
12
+ timeout,
13
+ shell: IS_WIN,
14
+ stdio: 'pipe',
15
+ env: { ...process.env, GH_PROMPT_DISABLED: '1' },
16
+ };
17
+ }
7
18
  /**
8
19
  * Shared error handler for all GitHub CLI interactions.
9
20
  * Re-throws [Totem Error] as-is, wraps ZodErrors and ENOENT, and
@@ -31,13 +42,7 @@ export function handleGhError(err, context) {
31
42
  */
32
43
  export function ghExec(args, cwd) {
33
44
  try {
34
- execFileSync('gh', args, {
35
- cwd,
36
- encoding: 'utf-8',
37
- timeout: GH_TIMEOUT_MS,
38
- shell: IS_WIN,
39
- stdio: 'pipe',
40
- });
45
+ execFileSync('gh', args, ghExecOptions(cwd, GH_TIMEOUT_MS));
41
46
  }
42
47
  catch (err) {
43
48
  const context = args.slice(0, 3).join(' ');
@@ -50,11 +55,9 @@ export function ghExec(args, cwd) {
50
55
  export function ghFetchAndParse(args, schema, context, cwd) {
51
56
  const isPaginated = args.includes('--paginate');
52
57
  try {
58
+ const timeout = isPaginated ? GH_PAGINATED_TIMEOUT_MS : GH_TIMEOUT_MS;
53
59
  const raw = execFileSync('gh', args, {
54
- cwd,
55
- encoding: 'utf-8',
56
- timeout: isPaginated ? GH_PAGINATED_TIMEOUT_MS : GH_TIMEOUT_MS,
57
- shell: IS_WIN,
60
+ ...ghExecOptions(cwd, timeout),
58
61
  maxBuffer: GH_MAX_BUFFER,
59
62
  });
60
63
  let parsed;
@@ -1 +1 @@
1
- {"version":3,"file":"gh-utils.js","sourceRoot":"","sources":["../../src/adapters/gh-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,yCAAyC;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AM,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { execFileSync } from 'node:child_process';
2
2
  import { describe, expect, it, vi } from 'vitest';
3
3
  import { z } from 'zod';
4
- import { ghFetchAndParse, handleGhError } from './gh-utils.js';
4
+ import { ghExec, ghFetchAndParse, handleGhError } from './gh-utils.js';
5
5
  vi.mock('node:child_process', () => ({
6
6
  execFileSync: vi.fn(),
7
7
  execFile: vi.fn(),
@@ -46,6 +46,17 @@ describe('handleGhError', () => {
46
46
  expect(() => handleGhError(err, 'PRs')).toThrow('[Totem Error] GitHub API rate limit exceeded');
47
47
  });
48
48
  });
49
+ // ─── ghExec ─────────────────────────────────────────────
50
+ describe('ghExec', () => {
51
+ it('uses shared exec options with stdio pipe and GH_PROMPT_DISABLED', () => {
52
+ mockedExec.mockReturnValue('');
53
+ ghExec(['issue', 'comment', '1', '-b', 'test'], '/cwd');
54
+ expect(mockedExec).toHaveBeenCalledWith('gh', ['issue', 'comment', '1', '-b', 'test'], expect.objectContaining({
55
+ stdio: 'pipe',
56
+ env: expect.objectContaining({ GH_PROMPT_DISABLED: '1' }),
57
+ }));
58
+ });
59
+ });
49
60
  // ─── ghFetchAndParse ────────────────────────────────────
50
61
  const TestSchema = z.object({ id: z.number(), name: z.string() });
51
62
  describe('ghFetchAndParse', () => {
@@ -79,5 +90,15 @@ describe('ghFetchAndParse', () => {
79
90
  });
80
91
  expect(() => ghFetchAndParse(['test'], TestSchema, 'PR #5', '/cwd')).toThrow('[Totem Error] Failed to fetch PR #5: timeout exceeded');
81
92
  });
93
+ it('pipes stdio to prevent gh CLI stderr leaks (#863)', () => {
94
+ mockedExec.mockReturnValue(JSON.stringify({ id: 1, name: 'test' }));
95
+ ghFetchAndParse(['issue', 'view', '863'], TestSchema, 'issue #863', '/cwd');
96
+ expect(mockedExec).toHaveBeenCalledWith('gh', ['issue', 'view', '863'], expect.objectContaining({ stdio: 'pipe' }));
97
+ });
98
+ it('sets GH_PROMPT_DISABLED to prevent interactive auth hangs', () => {
99
+ mockedExec.mockReturnValue(JSON.stringify({ id: 1, name: 'test' }));
100
+ ghFetchAndParse(['issue', 'view', '1'], TestSchema, 'issue #1', '/cwd');
101
+ expect(mockedExec).toHaveBeenCalledWith('gh', ['issue', 'view', '1'], expect.objectContaining({ env: expect.objectContaining({ GH_PROMPT_DISABLED: '1' }) }));
102
+ });
82
103
  });
83
104
  //# sourceMappingURL=gh-utils.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gh-utils.test.js","sourceRoot":"","sources":["../../src/adapters/gh-utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE/D,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;IACnC,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;IACrB,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE;IACjB,QAAQ,EAAE,EAAE,CAAC,EAAE,EAAE;CAClB,CAAC,CAAC,CAAC;AAEJ,MAAM,UAAU,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAE3C,2DAA2D;AAE3D,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,GA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H,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACpE,eAAe,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;QAC5E,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CACrC,IAAI,EACJ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EACxB,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAC3C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACpE,eAAe,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QACxE,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CACrC,IAAI,EACJ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EACtB,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACvF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Language-specific baseline packs — curated lessons for each ecosystem.
3
+ * Combined with core lessons during `totem init` based on detected project type.
4
+ *
5
+ * @see #835 (language-specific baseline packs)
6
+ * @see ADR-067 (ecosystem agnosticism)
7
+ */
8
+ export interface BaselineLesson {
9
+ heading: string;
10
+ tags: string[];
11
+ body: string;
12
+ }
13
+ export declare const PYTHON_BASELINE: BaselineLesson[];
14
+ export declare const RUST_BASELINE: BaselineLesson[];
15
+ export declare const GO_BASELINE: BaselineLesson[];
16
+ //# sourceMappingURL=baseline-packs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseline-packs.d.ts","sourceRoot":"","sources":["../../src/assets/baseline-packs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAID,eAAO,MAAM,eAAe,EAAE,cAAc,EAyC3C,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,cAAc,EAyCzC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,cAAc,EAyCvC,CAAC"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Language-specific baseline packs — curated lessons for each ecosystem.
3
+ * Combined with core lessons during `totem init` based on detected project type.
4
+ *
5
+ * @see #835 (language-specific baseline packs)
6
+ * @see ADR-067 (ecosystem agnosticism)
7
+ */
8
+ // ─── Python Pack ────────────────────────────────────
9
+ export const PYTHON_BASELINE = [
10
+ {
11
+ heading: 'Mutable default arguments persist across function calls',
12
+ tags: ['python', 'gotcha'],
13
+ body: 'Default mutable arguments (lists, dicts) in Python function signatures are created once and shared across all calls. `def append(item, lst=[])` accumulates items across invocations. Fix: Use `None` as the default and create a new object inside the function body: `if lst is None: lst = []`.',
14
+ },
15
+ {
16
+ heading: 'Bare except clauses hide real errors',
17
+ tags: ['python', 'error-handling'],
18
+ body: 'Using bare `except:` catches everything including KeyboardInterrupt and SystemExit, masking bugs and preventing clean shutdown. Even `except Exception:` is too broad for most cases. Fix: Always catch specific exception types. Use `except ValueError:` or `except (TypeError, KeyError):` instead of bare except.',
19
+ },
20
+ {
21
+ heading: 'Import side effects in __init__.py cause circular imports',
22
+ tags: ['python', 'architecture'],
23
+ body: 'Heavy imports in `__init__.py` files create circular dependency chains that crash at import time with `ImportError: cannot import name`. Fix: Keep `__init__.py` files minimal. Use lazy imports or move imports inside functions when circular dependencies arise.',
24
+ },
25
+ {
26
+ heading: 'String concatenation in loops creates O(n²) performance',
27
+ tags: ['python', 'performance'],
28
+ body: 'Building strings with `+=` in a loop creates a new string object on every iteration because Python strings are immutable. For large loops this is O(n²). Fix: Collect strings in a list and use `"".join(parts)` at the end.',
29
+ },
30
+ {
31
+ heading: 'Type hints are not enforced at runtime',
32
+ tags: ['python', 'typing'],
33
+ body: 'Python type hints (`def foo(x: int) -> str`) are documentation only — they are not enforced at runtime. Passing a string where int is annotated will not raise an error. Fix: Use mypy or pyright in CI for static type checking. Do not assume type hints prevent runtime type errors.',
34
+ },
35
+ {
36
+ heading: 'Global interpreter lock blocks true parallelism for CPU tasks',
37
+ tags: ['python', 'concurrency'],
38
+ body: 'The GIL prevents multiple threads from executing Python bytecode simultaneously. Threading works for I/O-bound tasks but provides no speedup for CPU-bound work. Fix: Use `multiprocessing` for CPU-bound parallelism or `asyncio` for I/O-bound concurrency.',
39
+ },
40
+ {
41
+ heading: 'Virtual environments must be activated per project',
42
+ tags: ['python', 'tooling'],
43
+ body: 'Installing packages globally with `pip install` pollutes the system Python and causes version conflicts across projects. Fix: Always use `python -m venv .venv` and activate it before installing dependencies. Use `requirements.txt` or `pyproject.toml` to pin versions.',
44
+ },
45
+ {
46
+ heading: 'str.format with untrusted templates leaks attributes',
47
+ tags: ['python', 'security'],
48
+ body: '`str.format()` allows attribute access: `"{0.__class__.__init__.__globals__}".format(obj)` can leak sensitive data. Never use `.format()` on user-controlled template strings. Fix: Use f-strings for developer-authored templates. For user-controlled content, use simple string concatenation or `string.Template` which blocks attribute access.',
49
+ },
50
+ ];
51
+ // ─── Rust Pack ──────────────────────────────────────
52
+ export const RUST_BASELINE = [
53
+ {
54
+ heading: 'Unwrap in production code causes unrecoverable panics',
55
+ tags: ['rust', 'error-handling'],
56
+ body: '`.unwrap()` and `.expect()` on `Result` or `Option` cause a panic if the value is `Err` or `None`. In library code and production services, this crashes the process. Fix: Use `?` operator to propagate errors, or `match`/`if let` to handle `None`/`Err` gracefully. Reserve `.unwrap()` for tests only.',
57
+ },
58
+ {
59
+ heading: 'Clone to satisfy the borrow checker is a code smell',
60
+ tags: ['rust', 'performance'],
61
+ body: 'Calling `.clone()` to make the borrow checker happy often masks a design problem. Cloning large structs in hot loops destroys performance. Fix: Restructure code to use references, lifetimes, or `Rc`/`Arc` for shared ownership. Only clone when the data is small and the alternative is significantly more complex.',
62
+ },
63
+ {
64
+ heading: 'Deadlocks from nested Mutex locks',
65
+ tags: ['rust', 'concurrency'],
66
+ body: 'Locking a `Mutex` while already holding another lock can deadlock if another thread acquires them in reverse order. Rust prevents data races but does NOT prevent deadlocks. Fix: Always acquire locks in a consistent order across all threads. Consider using `parking_lot::Mutex` which has deadlock detection in debug mode.',
67
+ },
68
+ {
69
+ heading: 'String vs str confusion causes unnecessary allocations',
70
+ tags: ['rust', 'performance'],
71
+ body: '`String` is an owned, heap-allocated string. `&str` is a borrowed reference. Functions that only read strings should accept `&str`, not `String`, to avoid forcing callers to allocate. Fix: Use `&str` for function parameters that only read string data. Use `String` only when ownership transfer is needed.',
72
+ },
73
+ {
74
+ heading: 'Cargo.lock must be committed for binaries but not libraries',
75
+ tags: ['rust', 'tooling'],
76
+ body: 'For binary crates (applications), `Cargo.lock` ensures reproducible builds and must be committed. For library crates, it should be gitignored because downstream consumers generate their own lockfile. Fix: Commit `Cargo.lock` for `[[bin]]` targets. Add it to `.gitignore` for `[lib]` crates.',
77
+ },
78
+ {
79
+ heading: 'Unsafe blocks require safety invariant documentation',
80
+ tags: ['rust', 'safety'],
81
+ body: 'Every `unsafe` block must document why it is safe — what invariants the programmer is guaranteeing that the compiler cannot verify. Undocumented unsafe is a ticking UB bomb. Fix: Add a `// SAFETY: ...` comment above every `unsafe` block explaining the invariant being upheld.',
82
+ },
83
+ {
84
+ heading: 'Missing error context in the ? operator chain',
85
+ tags: ['rust', 'error-handling'],
86
+ body: 'Using `?` to propagate errors loses context about what operation failed. `file.read_to_string(&mut s)?` produces "No such file" with no indication of which file. Fix: Use `anyhow::Context` or `map_err` to add context: `file.read_to_string(&mut s).context("reading config.toml")?`.',
87
+ },
88
+ {
89
+ heading: 'Derive macros on large structs slow compilation',
90
+ tags: ['rust', 'performance'],
91
+ body: 'Deriving `Debug`, `Clone`, `Serialize`, `Deserialize` on large structs with many fields generates significant code at compile time. In hot-rebuild inner loops this adds seconds. Fix: Only derive what you need. Consider manual implementations for large structs in performance-critical crates.',
92
+ },
93
+ ];
94
+ // ─── Go Pack ────────────────────────────────────────
95
+ export const GO_BASELINE = [
96
+ {
97
+ heading: 'Goroutine leaks from unbounded channel sends',
98
+ tags: ['go', 'concurrency'],
99
+ body: 'A goroutine blocked on `ch <- value` when no receiver exists leaks forever. This is the most common goroutine leak in Go. Fix: Always use buffered channels or `select` with `context.Done()` to ensure goroutines can exit. Use `goleak` in tests to detect leaks.',
100
+ },
101
+ {
102
+ heading: 'Error strings should not be capitalized or end with punctuation',
103
+ tags: ['go', 'style'],
104
+ body: 'Go convention: error strings are lowercase and do not end with punctuation, because they are often wrapped with `fmt.Errorf("failed to connect: %w", err)`. A capitalized inner error produces "failed to connect: Connection refused." Fix: Use `errors.New("connection refused")` not `errors.New("Connection refused.")`.',
105
+ },
106
+ {
107
+ heading: 'nil interface values are not equal to nil',
108
+ tags: ['go', 'gotcha'],
109
+ body: 'An interface holding a nil pointer is NOT nil itself. `var p *MyStruct = nil; var i interface{} = p; i == nil` is FALSE. This causes subtle bugs in error returns. Fix: Return `nil` directly, not a typed nil pointer. Use `if err != nil` checks only on the interface value.',
110
+ },
111
+ {
112
+ heading: 'defer in loops delays cleanup until function returns',
113
+ tags: ['go', 'gotcha'],
114
+ body: '`defer` runs at function exit, not loop iteration exit. Deferring `file.Close()` inside a loop opens all files before closing any, causing file descriptor exhaustion. Fix: Extract the loop body into a separate function so defer runs per iteration, or close explicitly without defer.',
115
+ },
116
+ {
117
+ heading: 'Race conditions in map access require sync.Mutex or sync.Map',
118
+ tags: ['go', 'concurrency'],
119
+ body: 'Go maps are not safe for concurrent access. Reading and writing a map from multiple goroutines without synchronization causes a fatal runtime panic (not just bad data). Fix: Protect map access with `sync.Mutex` or use `sync.Map` for simple key-value concurrent access.',
120
+ },
121
+ {
122
+ heading: 'Context cancellation must be checked in long-running operations',
123
+ tags: ['go', 'concurrency'],
124
+ body: 'Long-running loops and I/O operations must check `ctx.Done()` periodically. Ignoring context cancellation makes services unresponsive to shutdown signals and timeouts. Fix: Add `select { case <-ctx.Done(): return ctx.Err() }` in loops and before expensive operations.',
125
+ },
126
+ {
127
+ heading: 'Exported functions must have doc comments',
128
+ tags: ['go', 'style'],
129
+ body: 'Go convention enforced by `golint` and `go vet`: every exported function, type, and variable must have a doc comment starting with its name. `// Foo does X` not `// does X`. Fix: Add doc comments to all exported identifiers. The comment must start with the identifier name.',
130
+ },
131
+ {
132
+ heading: 'go.sum must always be committed',
133
+ tags: ['go', 'tooling'],
134
+ body: '`go.sum` contains cryptographic checksums of dependencies. It must be committed to ensure reproducible builds and detect supply chain tampering. Fix: Always commit both `go.mod` and `go.sum`. Run `go mod tidy` before committing to clean up unused entries.',
135
+ },
136
+ ];
137
+ //# sourceMappingURL=baseline-packs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseline-packs.js","sourceRoot":"","sources":["../../src/assets/baseline-packs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,uDAAuD;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,OAAO,EAAE,yDAAyD;QAClE,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAC1B,IAAI,EAAE,oSAAoS;KAC3S;IACD;QACE,OAAO,EAAE,sCAAsC;QAC/C,IAAI,EAAE,CAAC,QAAQ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;QACE,OAAO,EAAE,2CAA2C;QACpD,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;QACrB,IAAI,EAAE,mRAAmR;KAC1R;IACD;QACE,OAAO,EAAE,iCAAiC;QAC1C,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC;QACvB,IAAI,EAAE,iQAAiQ;KACxQ;CACF,CAAC"}
@@ -7,6 +7,7 @@ export interface CompileOptions {
7
7
  export?: boolean;
8
8
  fromCursor?: boolean;
9
9
  concurrency?: string;
10
+ cloud?: string;
10
11
  }
11
12
  export declare function compileCommand(options: CompileOptions): Promise<void>;
12
13
  //# sourceMappingURL=compile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAoQD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA0P3E"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsDD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAuX3E"}